@elizaos/plugin-elizacloud 2.0.0-alpha.4 → 2.0.0-alpha.537
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +185 -0
- package/dist/actions/check-credits.d.ts.map +1 -1
- package/dist/actions/confirmation.d.ts +7 -0
- package/dist/actions/confirmation.d.ts.map +1 -0
- package/dist/actions/freeze-agent.d.ts.map +1 -1
- package/dist/actions/provision-agent.d.ts.map +1 -1
- package/dist/actions/resume-agent.d.ts.map +1 -1
- package/dist/browser/index.browser.js +22 -19
- package/dist/browser/index.browser.js.map +36 -27
- package/dist/cjs/index.node.cjs +1710 -406
- package/dist/cjs/index.node.js.map +36 -27
- package/dist/cloud-providers/credit-balance.d.ts +1 -3
- package/dist/cloud-providers/credit-balance.d.ts.map +1 -1
- package/dist/cloud-providers/model-registry.d.ts +4 -0
- package/dist/cloud-providers/model-registry.d.ts.map +1 -0
- package/dist/index.browser.d.ts +2 -1
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.node.d.ts +2 -1
- package/dist/index.node.d.ts.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/models/embeddings.d.ts.map +1 -1
- package/dist/models/image.d.ts.map +1 -1
- package/dist/models/index.d.ts +2 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/object.d.ts.map +1 -1
- package/dist/models/research.d.ts +4 -0
- package/dist/models/research.d.ts.map +1 -0
- package/dist/models/speech.d.ts.map +1 -1
- package/dist/models/text.d.ts +5 -0
- package/dist/models/text.d.ts.map +1 -1
- package/dist/models/transcription.d.ts.map +1 -1
- package/dist/node/index.node.js +1710 -396
- package/dist/node/index.node.js.map +36 -27
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/services/cloud-auth.d.ts +140 -4
- package/dist/services/cloud-auth.d.ts.map +1 -1
- package/dist/services/cloud-bootstrap.d.ts +38 -0
- package/dist/services/cloud-bootstrap.d.ts.map +1 -0
- package/dist/services/cloud-bridge.d.ts +1 -1
- package/dist/services/cloud-managed-gateway-relay.d.ts +38 -0
- package/dist/services/cloud-managed-gateway-relay.d.ts.map +1 -0
- package/dist/services/cloud-model-registry.d.ts +28 -0
- package/dist/services/cloud-model-registry.d.ts.map +1 -0
- package/dist/types/cloud.d.ts +41 -19
- package/dist/types/cloud.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/cloud-api.d.ts +2 -27
- package/dist/utils/cloud-api.d.ts.map +1 -1
- package/dist/utils/config.d.ts +9 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/events.d.ts.map +1 -1
- package/dist/utils/forwarded-settings.d.ts +1 -1
- package/dist/utils/forwarded-settings.d.ts.map +1 -1
- package/dist/utils/responses-output.d.ts +6 -0
- package/dist/utils/responses-output.d.ts.map +1 -0
- package/dist/utils/sdk-client.d.ts +5 -0
- package/dist/utils/sdk-client.d.ts.map +1 -0
- package/package.json +84 -16
- package/types/cloud.ts +54 -41
- package/types/index.ts +6 -0
- package/dist/actions/index.d.ts +0 -5
- package/dist/actions/index.d.ts.map +0 -1
- package/dist/build.d.ts +0 -3
- package/dist/build.d.ts.map +0 -1
- package/dist/cloud-providers/index.d.ts +0 -4
- package/dist/cloud-providers/index.d.ts.map +0 -1
- package/dist/generated/specs/specs.d.ts +0 -55
- package/dist/generated/specs/specs.d.ts.map +0 -1
- package/dist/services/index.d.ts +0 -5
- package/dist/services/index.d.ts.map +0 -1
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
var AY=Object.create;var{getPrototypeOf:VY,defineProperty:KO,getOwnPropertyNames:JX,getOwnPropertyDescriptor:IY}=Object,$X=Object.prototype.hasOwnProperty;var EY=(Q,G,I)=>{I=Q!=null?AY(VY(Q)):{};let L=G||!Q||!Q.__esModule?KO(I,"default",{value:Q,enumerable:!0}):I;for(let T of JX(Q))if(!$X.call(L,T))KO(L,T,{get:()=>Q[T],enumerable:!0});return L},YX=new WeakMap,h0=(Q)=>{var G=YX.get(Q),I;if(G)return G;if(G=KO({},"__esModule",{value:!0}),Q&&typeof Q==="object"||typeof Q==="function")JX(Q).map((L)=>!$X.call(G,L)&&KO(G,L,{get:()=>Q[L],enumerable:!(I=IY(Q,L))||I.enumerable}));return YX.set(Q,G),G},KY=(Q,G)=>()=>(G||Q((G={exports:{}}).exports,G),G.exports);var TO=(Q,G)=>{for(var I in G)KO(Q,I,{get:G[I],enumerable:!0,configurable:!0,set:(L)=>G[I]=()=>L})};var CO=(Q,G)=>()=>(Q&&(G=Q(Q=0)),G);var TY=((Q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(Q,{get:(G,I)=>(typeof require<"u"?require:G)[I]}):Q)(function(Q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+Q+'" is not supported')});var CU={};TO(CU,{transcode:()=>EJ,resolveObjectURL:()=>AJ,kStringMaxLength:()=>xX,kMaxLength:()=>SO,isUtf8:()=>VJ,isAscii:()=>IJ,default:()=>KJ,constants:()=>yY,btoa:()=>xY,atob:()=>NY,INSPECT_MAX_BYTES:()=>gX,File:()=>fY,Buffer:()=>A0,Blob:()=>wY});function jY(Q){var G=Q.length;if(G%4>0)throw Error("Invalid string. Length must be a multiple of 4");var I=Q.indexOf("=");if(I===-1)I=G;var L=I===G?0:4-I%4;return[I,L]}function _Y(Q,G){return(Q+G)*3/4-G}function vY(Q){var G,I=jY(Q),L=I[0],T=I[1],F=new Uint8Array(_Y(L,T)),J=0,M=T>0?L-4:L,z;for(z=0;z<M;z+=4)G=NU[Q.charCodeAt(z)]<<18|NU[Q.charCodeAt(z+1)]<<12|NU[Q.charCodeAt(z+2)]<<6|NU[Q.charCodeAt(z+3)],F[J++]=G>>16&255,F[J++]=G>>8&255,F[J++]=G&255;if(T===2)G=NU[Q.charCodeAt(z)]<<2|NU[Q.charCodeAt(z+1)]>>4,F[J++]=G&255;if(T===1)G=NU[Q.charCodeAt(z)]<<10|NU[Q.charCodeAt(z+1)]<<4|NU[Q.charCodeAt(z+2)]>>2,F[J++]=G>>8&255,F[J++]=G&255;return F}function BY(Q){return hU[Q>>18&63]+hU[Q>>12&63]+hU[Q>>6&63]+hU[Q&63]}function gY(Q,G,I){var L,T=[];for(var F=G;F<I;F+=3)L=(Q[F]<<16&16711680)+(Q[F+1]<<8&65280)+(Q[F+2]&255),T.push(BY(L));return T.join("")}function PX(Q){var G,I=Q.length,L=I%3,T=[],F=16383;for(var J=0,M=I-L;J<M;J+=F)T.push(gY(Q,J,J+F>M?M:J+F));if(L===1)G=Q[I-1],T.push(hU[G>>2]+hU[G<<4&63]+"==");else if(L===2)G=(Q[I-2]<<8)+Q[I-1],T.push(hU[G>>10]+hU[G>>4&63]+hU[G<<2&63]+"=");return T.join("")}function yO(Q,G,I,L,T){var F,J,M=T*8-L-1,z=(1<<M)-1,W=z>>1,H=-7,C=I?T-1:0,R=I?-1:1,q=Q[G+C];C+=R,F=q&(1<<-H)-1,q>>=-H,H+=M;for(;H>0;F=F*256+Q[G+C],C+=R,H-=8);J=F&(1<<-H)-1,F>>=-H,H+=L;for(;H>0;J=J*256+Q[G+C],C+=R,H-=8);if(F===0)F=1-W;else if(F===z)return J?NaN:(q?-1:1)*(1/0);else J=J+Math.pow(2,L),F=F-W;return(q?-1:1)*J*Math.pow(2,F-L)}function BX(Q,G,I,L,T,F){var J,M,z,W=F*8-T-1,H=(1<<W)-1,C=H>>1,R=T===23?Math.pow(2,-24)-Math.pow(2,-77):0,q=L?0:F-1,P=L?1:-1,j=G<0||G===0&&1/G<0?1:0;if(G=Math.abs(G),isNaN(G)||G===1/0)M=isNaN(G)?1:0,J=H;else{if(J=Math.floor(Math.log(G)/Math.LN2),G*(z=Math.pow(2,-J))<1)J--,z*=2;if(J+C>=1)G+=R/z;else G+=R*Math.pow(2,1-C);if(G*z>=2)J++,z/=2;if(J+C>=H)M=0,J=H;else if(J+C>=1)M=(G*z-1)*Math.pow(2,T),J=J+C;else M=G*Math.pow(2,C-1)*Math.pow(2,T),J=0}for(;T>=8;Q[I+q]=M&255,q+=P,M/=256,T-=8);J=J<<T|M,W+=T;for(;W>0;Q[I+q]=J&255,q+=P,J/=256,W-=8);Q[I+q-P]|=j*128}function dU(Q){if(Q>SO)throw RangeError('The value "'+Q+'" is invalid for option "size"');let G=new Uint8Array(Q);return Object.setPrototypeOf(G,A0.prototype),G}function RZ(Q,G,I){return class extends I{constructor(){super();Object.defineProperty(this,"message",{value:G.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Q}]`,this.stack,delete this.name}get code(){return Q}set code(L){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:L,writable:!0})}toString(){return`${this.name} [${Q}]: ${this.message}`}}}function A0(Q,G,I){if(typeof Q==="number"){if(typeof G==="string")throw TypeError('The "string" argument must be of type string. Received type number');return WZ(Q)}return NX(Q,G,I)}function NX(Q,G,I){if(typeof Q==="string")return uY(Q,G);if(ArrayBuffer.isView(Q))return lY(Q);if(Q==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q);if(uU(Q,ArrayBuffer)||Q&&uU(Q.buffer,ArrayBuffer))return LZ(Q,G,I);if(typeof SharedArrayBuffer<"u"&&(uU(Q,SharedArrayBuffer)||Q&&uU(Q.buffer,SharedArrayBuffer)))return LZ(Q,G,I);if(typeof Q==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let L=Q.valueOf&&Q.valueOf();if(L!=null&&L!==Q)return A0.from(L,G,I);let T=bY(Q);if(T)return T;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Q[Symbol.toPrimitive]==="function")return A0.from(Q[Symbol.toPrimitive]("string"),G,I);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q)}function fX(Q){if(typeof Q!=="number")throw TypeError('"size" argument must be of type number');else if(Q<0)throw RangeError('The value "'+Q+'" is invalid for option "size"')}function hY(Q,G,I){if(fX(Q),Q<=0)return dU(Q);if(G!==void 0)return typeof I==="string"?dU(Q).fill(G,I):dU(Q).fill(G);return dU(Q)}function WZ(Q){return fX(Q),dU(Q<0?0:HZ(Q)|0)}function uY(Q,G){if(typeof G!=="string"||G==="")G="utf8";if(!A0.isEncoding(G))throw TypeError("Unknown encoding: "+G);let I=wX(Q,G)|0,L=dU(I),T=L.write(Q,G);if(T!==I)L=L.slice(0,T);return L}function CZ(Q){let G=Q.length<0?0:HZ(Q.length)|0,I=dU(G);for(let L=0;L<G;L+=1)I[L]=Q[L]&255;return I}function lY(Q){if(uU(Q,Uint8Array)){let G=new Uint8Array(Q);return LZ(G.buffer,G.byteOffset,G.byteLength)}return CZ(Q)}function LZ(Q,G,I){if(G<0||Q.byteLength<G)throw RangeError('"offset" is outside of buffer bounds');if(Q.byteLength<G+(I||0))throw RangeError('"length" is outside of buffer bounds');let L;if(G===void 0&&I===void 0)L=new Uint8Array(Q);else if(I===void 0)L=new Uint8Array(Q,G);else L=new Uint8Array(Q,G,I);return Object.setPrototypeOf(L,A0.prototype),L}function bY(Q){if(A0.isBuffer(Q)){let G=HZ(Q.length)|0,I=dU(G);if(I.length===0)return I;return Q.copy(I,0,0,G),I}if(Q.length!==void 0){if(typeof Q.length!=="number"||Number.isNaN(Q.length))return dU(0);return CZ(Q)}if(Q.type==="Buffer"&&Array.isArray(Q.data))return CZ(Q.data)}function HZ(Q){if(Q>=SO)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+SO.toString(16)+" bytes");return Q|0}function wX(Q,G){if(A0.isBuffer(Q))return Q.length;if(ArrayBuffer.isView(Q)||uU(Q,ArrayBuffer))return Q.byteLength;if(typeof Q!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Q);let I=Q.length,L=arguments.length>2&&arguments[2]===!0;if(!L&&I===0)return 0;let T=!1;for(;;)switch(G){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":return SZ(Q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I*2;case"hex":return I>>>1;case"base64":return oX(Q).length;default:if(T)return L?-1:SZ(Q).length;G=(""+G).toLowerCase(),T=!0}}function dY(Q,G,I){let L=!1;if(G===void 0||G<0)G=0;if(G>this.length)return"";if(I===void 0||I>this.length)I=this.length;if(I<=0)return"";if(I>>>=0,G>>>=0,I<=G)return"";if(!Q)Q="utf8";while(!0)switch(Q){case"hex":return UJ(this,G,I);case"utf8":case"utf-8":return cX(this,G,I);case"ascii":return aY(this,G,I);case"latin1":case"binary":return iY(this,G,I);case"base64":return rY(this,G,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return OJ(this,G,I);default:if(L)throw TypeError("Unknown encoding: "+Q);Q=(Q+"").toLowerCase(),L=!0}}function ZO(Q,G,I){let L=Q[G];Q[G]=Q[I],Q[I]=L}function yX(Q,G,I,L,T){if(Q.length===0)return-1;if(typeof I==="string")L=I,I=0;else if(I>2147483647)I=2147483647;else if(I<-2147483648)I=-2147483648;if(I=+I,Number.isNaN(I))I=T?0:Q.length-1;if(I<0)I=Q.length+I;if(I>=Q.length)if(T)return-1;else I=Q.length-1;else if(I<0)if(T)I=0;else return-1;if(typeof G==="string")G=A0.from(G,L);if(A0.isBuffer(G)){if(G.length===0)return-1;return jX(Q,G,I,L,T)}else if(typeof G==="number"){if(G=G&255,typeof Uint8Array.prototype.indexOf==="function")if(T)return Uint8Array.prototype.indexOf.call(Q,G,I);else return Uint8Array.prototype.lastIndexOf.call(Q,G,I);return jX(Q,[G],I,L,T)}throw TypeError("val must be string, number or Buffer")}function jX(Q,G,I,L,T){let F=1,J=Q.length,M=G.length;if(L!==void 0){if(L=String(L).toLowerCase(),L==="ucs2"||L==="ucs-2"||L==="utf16le"||L==="utf-16le"){if(Q.length<2||G.length<2)return-1;F=2,J/=2,M/=2,I/=2}}function z(H,C){if(F===1)return H[C];else return H.readUInt16BE(C*F)}let W;if(T){let H=-1;for(W=I;W<J;W++)if(z(Q,W)===z(G,H===-1?0:W-H)){if(H===-1)H=W;if(W-H+1===M)return H*F}else{if(H!==-1)W-=W-H;H=-1}}else{if(I+M>J)I=J-M;for(W=I;W>=0;W--){let H=!0;for(let C=0;C<M;C++)if(z(Q,W+C)!==z(G,C)){H=!1;break}if(H)return W}}return-1}function oY(Q,G,I,L){I=Number(I)||0;let T=Q.length-I;if(!L)L=T;else if(L=Number(L),L>T)L=T;let F=G.length;if(L>F/2)L=F/2;let J;for(J=0;J<L;++J){let M=parseInt(G.substr(J*2,2),16);if(Number.isNaN(M))return J;Q[I+J]=M}return J}function nY(Q,G,I,L){return cO(SZ(G,Q.length-I),Q,I,L)}function tY(Q,G,I,L){return cO(YJ(G),Q,I,L)}function mY(Q,G,I,L){return cO(oX(G),Q,I,L)}function sY(Q,G,I,L){return cO(JJ(G,Q.length-I),Q,I,L)}function rY(Q,G,I){if(G===0&&I===Q.length)return PX(Q);else return PX(Q.slice(G,I))}function cX(Q,G,I){I=Math.min(Q.length,I);let L=[],T=G;while(T<I){let F=Q[T],J=null,M=F>239?4:F>223?3:F>191?2:1;if(T+M<=I){let z,W,H,C;switch(M){case 1:if(F<128)J=F;break;case 2:if(z=Q[T+1],(z&192)===128){if(C=(F&31)<<6|z&63,C>127)J=C}break;case 3:if(z=Q[T+1],W=Q[T+2],(z&192)===128&&(W&192)===128){if(C=(F&15)<<12|(z&63)<<6|W&63,C>2047&&(C<55296||C>57343))J=C}break;case 4:if(z=Q[T+1],W=Q[T+2],H=Q[T+3],(z&192)===128&&(W&192)===128&&(H&192)===128){if(C=(F&15)<<18|(z&63)<<12|(W&63)<<6|H&63,C>65535&&C<1114112)J=C}}}if(J===null)J=65533,M=1;else if(J>65535)J-=65536,L.push(J>>>10&1023|55296),J=56320|J&1023;L.push(J),T+=M}return eY(L)}function eY(Q){let G=Q.length;if(G<=_X)return String.fromCharCode.apply(String,Q);let I="",L=0;while(L<G)I+=String.fromCharCode.apply(String,Q.slice(L,L+=_X));return I}function aY(Q,G,I){let L="";I=Math.min(Q.length,I);for(let T=G;T<I;++T)L+=String.fromCharCode(Q[T]&127);return L}function iY(Q,G,I){let L="";I=Math.min(Q.length,I);for(let T=G;T<I;++T)L+=String.fromCharCode(Q[T]);return L}function UJ(Q,G,I){let L=Q.length;if(!G||G<0)G=0;if(!I||I<0||I>L)I=L;let T="";for(let F=G;F<I;++F)T+=$J[Q[F]];return T}function OJ(Q,G,I){let L=Q.slice(G,I),T="";for(let F=0;F<L.length-1;F+=2)T+=String.fromCharCode(L[F]+L[F+1]*256);return T}function TU(Q,G,I){if(Q%1!==0||Q<0)throw RangeError("offset is not uint");if(Q+G>I)throw RangeError("Trying to access beyond buffer length")}function PU(Q,G,I,L,T,F){if(!A0.isBuffer(Q))throw TypeError('"buffer" argument must be a Buffer instance');if(G>T||G<F)throw RangeError('"value" argument is out of bounds');if(I+L>Q.length)throw RangeError("Index out of range")}function pX(Q,G,I,L,T){dX(G,L,T,Q,I,7);let F=Number(G&BigInt(4294967295));Q[I++]=F,F=F>>8,Q[I++]=F,F=F>>8,Q[I++]=F,F=F>>8,Q[I++]=F;let J=Number(G>>BigInt(32)&BigInt(4294967295));return Q[I++]=J,J=J>>8,Q[I++]=J,J=J>>8,Q[I++]=J,J=J>>8,Q[I++]=J,I}function hX(Q,G,I,L,T){dX(G,L,T,Q,I,7);let F=Number(G&BigInt(4294967295));Q[I+7]=F,F=F>>8,Q[I+6]=F,F=F>>8,Q[I+5]=F,F=F>>8,Q[I+4]=F;let J=Number(G>>BigInt(32)&BigInt(4294967295));return Q[I+3]=J,J=J>>8,Q[I+2]=J,J=J>>8,Q[I+1]=J,J=J>>8,Q[I]=J,I+8}function uX(Q,G,I,L,T,F){if(I+L>Q.length)throw RangeError("Index out of range");if(I<0)throw RangeError("Index out of range")}function lX(Q,G,I,L,T){if(G=+G,I=I>>>0,!T)uX(Q,G,I,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return BX(Q,G,I,L,23,4),I+4}function bX(Q,G,I,L,T){if(G=+G,I=I>>>0,!T)uX(Q,G,I,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return BX(Q,G,I,L,52,8),I+8}function vX(Q){let G="",I=Q.length,L=Q[0]==="-"?1:0;for(;I>=L+4;I-=3)G=`_${Q.slice(I-3,I)}${G}`;return`${Q.slice(0,I)}${G}`}function ZJ(Q,G,I){if($O(G,"offset"),Q[G]===void 0||Q[G+I]===void 0)RO(G,Q.length-(I+1))}function dX(Q,G,I,L,T,F){if(Q>I||Q<G){let J=typeof G==="bigint"?"n":"",M;if(F>3)if(G===0||G===BigInt(0))M=`>= 0${J} and < 2${J} ** ${(F+1)*8}${J}`;else M=`>= -(2${J} ** ${(F+1)*8-1}${J}) and < 2 ** ${(F+1)*8-1}${J}`;else M=`>= ${G}${J} and <= ${I}${J}`;throw new TZ("value",M,Q)}ZJ(L,T,F)}function $O(Q,G){if(typeof Q!=="number")throw new pY(G,"number",Q)}function RO(Q,G,I){if(Math.floor(Q)!==Q)throw $O(Q,I),new TZ(I||"offset","an integer",Q);if(G<0)throw new cY;throw new TZ(I||"offset",`>= ${I?1:0} and <= ${G}`,Q)}function QJ(Q){if(Q=Q.split("=")[0],Q=Q.trim().replace(XJ,""),Q.length<2)return"";while(Q.length%4!==0)Q=Q+"=";return Q}function SZ(Q,G){G=G||1/0;let I,L=Q.length,T=null,F=[];for(let J=0;J<L;++J){if(I=Q.charCodeAt(J),I>55295&&I<57344){if(!T){if(I>56319){if((G-=3)>-1)F.push(239,191,189);continue}else if(J+1===L){if((G-=3)>-1)F.push(239,191,189);continue}T=I;continue}if(I<56320){if((G-=3)>-1)F.push(239,191,189);T=I;continue}I=(T-55296<<10|I-56320)+65536}else if(T){if((G-=3)>-1)F.push(239,191,189)}if(T=null,I<128){if((G-=1)<0)break;F.push(I)}else if(I<2048){if((G-=2)<0)break;F.push(I>>6|192,I&63|128)}else if(I<65536){if((G-=3)<0)break;F.push(I>>12|224,I>>6&63|128,I&63|128)}else if(I<1114112){if((G-=4)<0)break;F.push(I>>18|240,I>>12&63|128,I>>6&63|128,I&63|128)}else throw Error("Invalid code point")}return F}function YJ(Q){let G=[];for(let I=0;I<Q.length;++I)G.push(Q.charCodeAt(I)&255);return G}function JJ(Q,G){let I,L,T,F=[];for(let J=0;J<Q.length;++J){if((G-=2)<0)break;I=Q.charCodeAt(J),L=I>>8,T=I%256,F.push(T),F.push(L)}return F}function oX(Q){return vY(QJ(Q))}function cO(Q,G,I,L){let T;for(T=0;T<L;++T){if(T+I>=G.length||T>=Q.length)break;G[T+I]=Q[T]}return T}function uU(Q,G){return Q instanceof G||Q!=null&&Q.constructor!=null&&Q.constructor.name!=null&&Q.constructor.name===G.name}function eU(Q){return typeof BigInt>"u"?GJ:Q}function GJ(){throw Error("BigInt not supported")}function FZ(Q){return()=>{throw Error(Q+" is not implemented for node:buffer browser polyfill")}}var hU,NU,KZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",OO,qX,kX,gX=50,SO=2147483647,xX=536870888,xY,NY,fY,wY,yY,cY,pY,TZ,_X=4096,XJ,$J,AJ,VJ,IJ=(Q)=>{for(let G of Q)if(G.charCodeAt(0)>127)return!1;return!0},EJ,KJ;var LU=CO(()=>{hU=[],NU=[];for(OO=0,qX=KZ.length;OO<qX;++OO)hU[OO]=KZ[OO],NU[KZ.charCodeAt(OO)]=OO;NU[45]=62;NU[95]=63;kX=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,xY=globalThis.btoa,NY=globalThis.atob,fY=globalThis.File,wY=globalThis.Blob,yY={MAX_LENGTH:SO,MAX_STRING_LENGTH:xX};cY=RZ("ERR_BUFFER_OUT_OF_BOUNDS",function(Q){if(Q)return`${Q} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),pY=RZ("ERR_INVALID_ARG_TYPE",function(Q,G){return`The "${Q}" argument must be of type number. Received type ${typeof G}`},TypeError),TZ=RZ("ERR_OUT_OF_RANGE",function(Q,G,I){let L=`The value of "${Q}" is out of range.`,T=I;if(Number.isInteger(I)&&Math.abs(I)>4294967296)T=vX(String(I));else if(typeof I==="bigint"){if(T=String(I),I>BigInt(2)**BigInt(32)||I<-(BigInt(2)**BigInt(32)))T=vX(T);T+="n"}return L+=` It must be ${G}. Received ${T}`,L},RangeError);Object.defineProperty(A0.prototype,"parent",{enumerable:!0,get:function(){if(!A0.isBuffer(this))return;return this.buffer}});Object.defineProperty(A0.prototype,"offset",{enumerable:!0,get:function(){if(!A0.isBuffer(this))return;return this.byteOffset}});A0.poolSize=8192;A0.from=function(Q,G,I){return NX(Q,G,I)};Object.setPrototypeOf(A0.prototype,Uint8Array.prototype);Object.setPrototypeOf(A0,Uint8Array);A0.alloc=function(Q,G,I){return hY(Q,G,I)};A0.allocUnsafe=function(Q){return WZ(Q)};A0.allocUnsafeSlow=function(Q){return WZ(Q)};A0.isBuffer=function(Q){return Q!=null&&Q._isBuffer===!0&&Q!==A0.prototype};A0.compare=function(Q,G){if(uU(Q,Uint8Array))Q=A0.from(Q,Q.offset,Q.byteLength);if(uU(G,Uint8Array))G=A0.from(G,G.offset,G.byteLength);if(!A0.isBuffer(Q)||!A0.isBuffer(G))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Q===G)return 0;let I=Q.length,L=G.length;for(let T=0,F=Math.min(I,L);T<F;++T)if(Q[T]!==G[T]){I=Q[T],L=G[T];break}if(I<L)return-1;if(L<I)return 1;return 0};A0.isEncoding=function(Q){switch(String(Q).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};A0.concat=function(Q,G){if(!Array.isArray(Q))throw TypeError('"list" argument must be an Array of Buffers');if(Q.length===0)return A0.alloc(0);let I;if(G===void 0){G=0;for(I=0;I<Q.length;++I)G+=Q[I].length}let L=A0.allocUnsafe(G),T=0;for(I=0;I<Q.length;++I){let F=Q[I];if(uU(F,Uint8Array))if(T+F.length>L.length){if(!A0.isBuffer(F))F=A0.from(F);F.copy(L,T)}else Uint8Array.prototype.set.call(L,F,T);else if(!A0.isBuffer(F))throw TypeError('"list" argument must be an Array of Buffers');else F.copy(L,T);T+=F.length}return L};A0.byteLength=wX;A0.prototype._isBuffer=!0;A0.prototype.swap16=function(){let Q=this.length;if(Q%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let G=0;G<Q;G+=2)ZO(this,G,G+1);return this};A0.prototype.swap32=function(){let Q=this.length;if(Q%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let G=0;G<Q;G+=4)ZO(this,G,G+3),ZO(this,G+1,G+2);return this};A0.prototype.swap64=function(){let Q=this.length;if(Q%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let G=0;G<Q;G+=8)ZO(this,G,G+7),ZO(this,G+1,G+6),ZO(this,G+2,G+5),ZO(this,G+3,G+4);return this};A0.prototype.toString=function(){let Q=this.length;if(Q===0)return"";if(arguments.length===0)return cX(this,0,Q);return dY.apply(this,arguments)};A0.prototype.toLocaleString=A0.prototype.toString;A0.prototype.equals=function(Q){if(!A0.isBuffer(Q))throw TypeError("Argument must be a Buffer");if(this===Q)return!0;return A0.compare(this,Q)===0};A0.prototype.inspect=function(){let Q="",G=gX;if(Q=this.toString("hex",0,G).replace(/(.{2})/g,"$1 ").trim(),this.length>G)Q+=" ... ";return"<Buffer "+Q+">"};if(kX)A0.prototype[kX]=A0.prototype.inspect;A0.prototype.compare=function(Q,G,I,L,T){if(uU(Q,Uint8Array))Q=A0.from(Q,Q.offset,Q.byteLength);if(!A0.isBuffer(Q))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Q);if(G===void 0)G=0;if(I===void 0)I=Q?Q.length:0;if(L===void 0)L=0;if(T===void 0)T=this.length;if(G<0||I>Q.length||L<0||T>this.length)throw RangeError("out of range index");if(L>=T&&G>=I)return 0;if(L>=T)return-1;if(G>=I)return 1;if(G>>>=0,I>>>=0,L>>>=0,T>>>=0,this===Q)return 0;let F=T-L,J=I-G,M=Math.min(F,J),z=this.slice(L,T),W=Q.slice(G,I);for(let H=0;H<M;++H)if(z[H]!==W[H]){F=z[H],J=W[H];break}if(F<J)return-1;if(J<F)return 1;return 0};A0.prototype.includes=function(Q,G,I){return this.indexOf(Q,G,I)!==-1};A0.prototype.indexOf=function(Q,G,I){return yX(this,Q,G,I,!0)};A0.prototype.lastIndexOf=function(Q,G,I){return yX(this,Q,G,I,!1)};A0.prototype.write=function(Q,G,I,L){if(G===void 0)L="utf8",I=this.length,G=0;else if(I===void 0&&typeof G==="string")L=G,I=this.length,G=0;else if(isFinite(G))if(G=G>>>0,isFinite(I)){if(I=I>>>0,L===void 0)L="utf8"}else L=I,I=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let T=this.length-G;if(I===void 0||I>T)I=T;if(Q.length>0&&(I<0||G<0)||G>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!L)L="utf8";let F=!1;for(;;)switch(L){case"hex":return oY(this,Q,G,I);case"utf8":case"utf-8":return nY(this,Q,G,I);case"ascii":case"latin1":case"binary":return tY(this,Q,G,I);case"base64":return mY(this,Q,G,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sY(this,Q,G,I);default:if(F)throw TypeError("Unknown encoding: "+L);L=(""+L).toLowerCase(),F=!0}};A0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};A0.prototype.slice=function(Q,G){let I=this.length;if(Q=~~Q,G=G===void 0?I:~~G,Q<0){if(Q+=I,Q<0)Q=0}else if(Q>I)Q=I;if(G<0){if(G+=I,G<0)G=0}else if(G>I)G=I;if(G<Q)G=Q;let L=this.subarray(Q,G);return Object.setPrototypeOf(L,A0.prototype),L};A0.prototype.readUintLE=A0.prototype.readUIntLE=function(Q,G,I){if(Q=Q>>>0,G=G>>>0,!I)TU(Q,G,this.length);let L=this[Q],T=1,F=0;while(++F<G&&(T*=256))L+=this[Q+F]*T;return L};A0.prototype.readUintBE=A0.prototype.readUIntBE=function(Q,G,I){if(Q=Q>>>0,G=G>>>0,!I)TU(Q,G,this.length);let L=this[Q+--G],T=1;while(G>0&&(T*=256))L+=this[Q+--G]*T;return L};A0.prototype.readUint8=A0.prototype.readUInt8=function(Q,G){if(Q=Q>>>0,!G)TU(Q,1,this.length);return this[Q]};A0.prototype.readUint16LE=A0.prototype.readUInt16LE=function(Q,G){if(Q=Q>>>0,!G)TU(Q,2,this.length);return this[Q]|this[Q+1]<<8};A0.prototype.readUint16BE=A0.prototype.readUInt16BE=function(Q,G){if(Q=Q>>>0,!G)TU(Q,2,this.length);return this[Q]<<8|this[Q+1]};A0.prototype.readUint32LE=A0.prototype.readUInt32LE=function(Q,G){if(Q=Q>>>0,!G)TU(Q,4,this.length);return(this[Q]|this[Q+1]<<8|this[Q+2]<<16)+this[Q+3]*16777216};A0.prototype.readUint32BE=A0.prototype.readUInt32BE=function(Q,G){if(Q=Q>>>0,!G)TU(Q,4,this.length);return this[Q]*16777216+(this[Q+1]<<16|this[Q+2]<<8|this[Q+3])};A0.prototype.readBigUInt64LE=eU(function(Q){Q=Q>>>0,$O(Q,"offset");let G=this[Q],I=this[Q+7];if(G===void 0||I===void 0)RO(Q,this.length-8);let L=G+this[++Q]*256+this[++Q]*65536+this[++Q]*16777216,T=this[++Q]+this[++Q]*256+this[++Q]*65536+I*16777216;return BigInt(L)+(BigInt(T)<<BigInt(32))});A0.prototype.readBigUInt64BE=eU(function(Q){Q=Q>>>0,$O(Q,"offset");let G=this[Q],I=this[Q+7];if(G===void 0||I===void 0)RO(Q,this.length-8);let L=G*16777216+this[++Q]*65536+this[++Q]*256+this[++Q],T=this[++Q]*16777216+this[++Q]*65536+this[++Q]*256+I;return(BigInt(L)<<BigInt(32))+BigInt(T)});A0.prototype.readIntLE=function(Q,G,I){if(Q=Q>>>0,G=G>>>0,!I)TU(Q,G,this.length);let L=this[Q],T=1,F=0;while(++F<G&&(T*=256))L+=this[Q+F]*T;if(T*=128,L>=T)L-=Math.pow(2,8*G);return L};A0.prototype.readIntBE=function(Q,G,I){if(Q=Q>>>0,G=G>>>0,!I)TU(Q,G,this.length);let L=G,T=1,F=this[Q+--L];while(L>0&&(T*=256))F+=this[Q+--L]*T;if(T*=128,F>=T)F-=Math.pow(2,8*G);return F};A0.prototype.readInt8=function(Q,G){if(Q=Q>>>0,!G)TU(Q,1,this.length);if(!(this[Q]&128))return this[Q];return(255-this[Q]+1)*-1};A0.prototype.readInt16LE=function(Q,G){if(Q=Q>>>0,!G)TU(Q,2,this.length);let I=this[Q]|this[Q+1]<<8;return I&32768?I|4294901760:I};A0.prototype.readInt16BE=function(Q,G){if(Q=Q>>>0,!G)TU(Q,2,this.length);let I=this[Q+1]|this[Q]<<8;return I&32768?I|4294901760:I};A0.prototype.readInt32LE=function(Q,G){if(Q=Q>>>0,!G)TU(Q,4,this.length);return this[Q]|this[Q+1]<<8|this[Q+2]<<16|this[Q+3]<<24};A0.prototype.readInt32BE=function(Q,G){if(Q=Q>>>0,!G)TU(Q,4,this.length);return this[Q]<<24|this[Q+1]<<16|this[Q+2]<<8|this[Q+3]};A0.prototype.readBigInt64LE=eU(function(Q){Q=Q>>>0,$O(Q,"offset");let G=this[Q],I=this[Q+7];if(G===void 0||I===void 0)RO(Q,this.length-8);let L=this[Q+4]+this[Q+5]*256+this[Q+6]*65536+(I<<24);return(BigInt(L)<<BigInt(32))+BigInt(G+this[++Q]*256+this[++Q]*65536+this[++Q]*16777216)});A0.prototype.readBigInt64BE=eU(function(Q){Q=Q>>>0,$O(Q,"offset");let G=this[Q],I=this[Q+7];if(G===void 0||I===void 0)RO(Q,this.length-8);let L=(G<<24)+this[++Q]*65536+this[++Q]*256+this[++Q];return(BigInt(L)<<BigInt(32))+BigInt(this[++Q]*16777216+this[++Q]*65536+this[++Q]*256+I)});A0.prototype.readFloatLE=function(Q,G){if(Q=Q>>>0,!G)TU(Q,4,this.length);return yO(this,Q,!0,23,4)};A0.prototype.readFloatBE=function(Q,G){if(Q=Q>>>0,!G)TU(Q,4,this.length);return yO(this,Q,!1,23,4)};A0.prototype.readDoubleLE=function(Q,G){if(Q=Q>>>0,!G)TU(Q,8,this.length);return yO(this,Q,!0,52,8)};A0.prototype.readDoubleBE=function(Q,G){if(Q=Q>>>0,!G)TU(Q,8,this.length);return yO(this,Q,!1,52,8)};A0.prototype.writeUintLE=A0.prototype.writeUIntLE=function(Q,G,I,L){if(Q=+Q,G=G>>>0,I=I>>>0,!L){let J=Math.pow(2,8*I)-1;PU(this,Q,G,I,J,0)}let T=1,F=0;this[G]=Q&255;while(++F<I&&(T*=256))this[G+F]=Q/T&255;return G+I};A0.prototype.writeUintBE=A0.prototype.writeUIntBE=function(Q,G,I,L){if(Q=+Q,G=G>>>0,I=I>>>0,!L){let J=Math.pow(2,8*I)-1;PU(this,Q,G,I,J,0)}let T=I-1,F=1;this[G+T]=Q&255;while(--T>=0&&(F*=256))this[G+T]=Q/F&255;return G+I};A0.prototype.writeUint8=A0.prototype.writeUInt8=function(Q,G,I){if(Q=+Q,G=G>>>0,!I)PU(this,Q,G,1,255,0);return this[G]=Q&255,G+1};A0.prototype.writeUint16LE=A0.prototype.writeUInt16LE=function(Q,G,I){if(Q=+Q,G=G>>>0,!I)PU(this,Q,G,2,65535,0);return this[G]=Q&255,this[G+1]=Q>>>8,G+2};A0.prototype.writeUint16BE=A0.prototype.writeUInt16BE=function(Q,G,I){if(Q=+Q,G=G>>>0,!I)PU(this,Q,G,2,65535,0);return this[G]=Q>>>8,this[G+1]=Q&255,G+2};A0.prototype.writeUint32LE=A0.prototype.writeUInt32LE=function(Q,G,I){if(Q=+Q,G=G>>>0,!I)PU(this,Q,G,4,4294967295,0);return this[G+3]=Q>>>24,this[G+2]=Q>>>16,this[G+1]=Q>>>8,this[G]=Q&255,G+4};A0.prototype.writeUint32BE=A0.prototype.writeUInt32BE=function(Q,G,I){if(Q=+Q,G=G>>>0,!I)PU(this,Q,G,4,4294967295,0);return this[G]=Q>>>24,this[G+1]=Q>>>16,this[G+2]=Q>>>8,this[G+3]=Q&255,G+4};A0.prototype.writeBigUInt64LE=eU(function(Q,G=0){return pX(this,Q,G,BigInt(0),BigInt("0xffffffffffffffff"))});A0.prototype.writeBigUInt64BE=eU(function(Q,G=0){return hX(this,Q,G,BigInt(0),BigInt("0xffffffffffffffff"))});A0.prototype.writeIntLE=function(Q,G,I,L){if(Q=+Q,G=G>>>0,!L){let M=Math.pow(2,8*I-1);PU(this,Q,G,I,M-1,-M)}let T=0,F=1,J=0;this[G]=Q&255;while(++T<I&&(F*=256)){if(Q<0&&J===0&&this[G+T-1]!==0)J=1;this[G+T]=(Q/F>>0)-J&255}return G+I};A0.prototype.writeIntBE=function(Q,G,I,L){if(Q=+Q,G=G>>>0,!L){let M=Math.pow(2,8*I-1);PU(this,Q,G,I,M-1,-M)}let T=I-1,F=1,J=0;this[G+T]=Q&255;while(--T>=0&&(F*=256)){if(Q<0&&J===0&&this[G+T+1]!==0)J=1;this[G+T]=(Q/F>>0)-J&255}return G+I};A0.prototype.writeInt8=function(Q,G,I){if(Q=+Q,G=G>>>0,!I)PU(this,Q,G,1,127,-128);if(Q<0)Q=255+Q+1;return this[G]=Q&255,G+1};A0.prototype.writeInt16LE=function(Q,G,I){if(Q=+Q,G=G>>>0,!I)PU(this,Q,G,2,32767,-32768);return this[G]=Q&255,this[G+1]=Q>>>8,G+2};A0.prototype.writeInt16BE=function(Q,G,I){if(Q=+Q,G=G>>>0,!I)PU(this,Q,G,2,32767,-32768);return this[G]=Q>>>8,this[G+1]=Q&255,G+2};A0.prototype.writeInt32LE=function(Q,G,I){if(Q=+Q,G=G>>>0,!I)PU(this,Q,G,4,2147483647,-2147483648);return this[G]=Q&255,this[G+1]=Q>>>8,this[G+2]=Q>>>16,this[G+3]=Q>>>24,G+4};A0.prototype.writeInt32BE=function(Q,G,I){if(Q=+Q,G=G>>>0,!I)PU(this,Q,G,4,2147483647,-2147483648);if(Q<0)Q=4294967295+Q+1;return this[G]=Q>>>24,this[G+1]=Q>>>16,this[G+2]=Q>>>8,this[G+3]=Q&255,G+4};A0.prototype.writeBigInt64LE=eU(function(Q,G=0){return pX(this,Q,G,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});A0.prototype.writeBigInt64BE=eU(function(Q,G=0){return hX(this,Q,G,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});A0.prototype.writeFloatLE=function(Q,G,I){return lX(this,Q,G,!0,I)};A0.prototype.writeFloatBE=function(Q,G,I){return lX(this,Q,G,!1,I)};A0.prototype.writeDoubleLE=function(Q,G,I){return bX(this,Q,G,!0,I)};A0.prototype.writeDoubleBE=function(Q,G,I){return bX(this,Q,G,!1,I)};A0.prototype.copy=function(Q,G,I,L){if(!A0.isBuffer(Q))throw TypeError("argument should be a Buffer");if(!I)I=0;if(!L&&L!==0)L=this.length;if(G>=Q.length)G=Q.length;if(!G)G=0;if(L>0&&L<I)L=I;if(L===I)return 0;if(Q.length===0||this.length===0)return 0;if(G<0)throw RangeError("targetStart out of bounds");if(I<0||I>=this.length)throw RangeError("Index out of range");if(L<0)throw RangeError("sourceEnd out of bounds");if(L>this.length)L=this.length;if(Q.length-G<L-I)L=Q.length-G+I;let T=L-I;if(this===Q&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(G,I,L);else Uint8Array.prototype.set.call(Q,this.subarray(I,L),G);return T};A0.prototype.fill=function(Q,G,I,L){if(typeof Q==="string"){if(typeof G==="string")L=G,G=0,I=this.length;else if(typeof I==="string")L=I,I=this.length;if(L!==void 0&&typeof L!=="string")throw TypeError("encoding must be a string");if(typeof L==="string"&&!A0.isEncoding(L))throw TypeError("Unknown encoding: "+L);if(Q.length===1){let F=Q.charCodeAt(0);if(L==="utf8"&&F<128||L==="latin1")Q=F}}else if(typeof Q==="number")Q=Q&255;else if(typeof Q==="boolean")Q=Number(Q);if(G<0||this.length<G||this.length<I)throw RangeError("Out of range index");if(I<=G)return this;if(G=G>>>0,I=I===void 0?this.length:I>>>0,!Q)Q=0;let T;if(typeof Q==="number")for(T=G;T<I;++T)this[T]=Q;else{let F=A0.isBuffer(Q)?Q:A0.from(Q,L),J=F.length;if(J===0)throw TypeError('The value "'+Q+'" is invalid for argument "value"');for(T=0;T<I-G;++T)this[T+G]=F[T%J]}return this};XJ=/[^+/0-9A-Za-z-_]/g;$J=function(){let Q=Array(256);for(let G=0;G<16;++G){let I=G*16;for(let L=0;L<16;++L)Q[I+L]="0123456789abcdef"[G]+"0123456789abcdef"[L]}return Q}();AJ=FZ("resolveObjectURL"),VJ=FZ("isUtf8"),EJ=FZ("transcode"),KJ=A0});var HO={};TO(HO,{setMaxListeners:()=>ZQ,once:()=>UQ,listenerCount:()=>XQ,init:()=>aU,getMaxListeners:()=>YQ,getEventListeners:()=>OQ,default:()=>DJ,captureRejectionSymbol:()=>rX,addAbortListener:()=>JQ,EventEmitter:()=>aU});function eX(Q,G){var{_events:I}=Q;if(G[0]??=Error("Unhandled error."),!I)throw G[0];var L=I[sX];if(L)for(var T of tX.call(L))T.apply(Q,G);var F=I.error;if(!F)throw G[0];for(var T of tX.call(F))T.apply(Q,G);return!0}function LJ(Q,G,I,L){G.then(void 0,function(T){queueMicrotask(()=>SJ(Q,T,I,L))})}function SJ(Q,G,I,L){if(typeof Q[nX]==="function")Q[nX](G,I,...L);else try{Q[XO]=!1,Q.emit("error",G)}finally{Q[XO]=!0}}function aX(Q,G,I){I.warned=!0;let L=Error(`Possible EventEmitter memory leak detected. ${I.length} ${String(G)} listeners added to [${Q.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);L.name="MaxListenersExceededWarning",L.emitter=Q,L.type=G,L.count=I.length,console.warn(L)}function iX(Q,G,...I){this.removeListener(Q,G),G.apply(this,I)}function UQ(Q,G,I){var L=I?.signal;if(QQ(L,"options.signal"),L?.aborted)throw new DZ(void 0,{cause:L?.reason});let{resolve:T,reject:F,promise:J}=$newPromiseCapability(Promise),M=(H)=>{if(Q.removeListener(G,z),L!=null)pO(L,"abort",W);F(H)},z=(...H)=>{if(typeof Q.removeListener==="function")Q.removeListener("error",M);if(L!=null)pO(L,"abort",W);T(H)};if(mX(Q,G,z,{once:!0}),G!=="error"&&typeof Q.once==="function")Q.once("error",M);function W(){pO(Q,G,z),pO(Q,"error",M),F(new DZ(void 0,{cause:L?.reason}))}if(L!=null)mX(L,"abort",W,{once:!0});return J}function OQ(Q,G){return Q.listeners(G)}function ZQ(Q,...G){zZ(Q,"setMaxListeners",0);var I;if(G&&(I=G.length))for(let L=0;L<I;L++)G[L].setMaxListeners(Q);else QO=Q}function XQ(Q,G){return Q.listenerCount(G)}function pO(Q,G,I,L){if(typeof Q.removeListener==="function")Q.removeListener(G,I);else Q.removeEventListener(G,I,L)}function mX(Q,G,I,L){if(typeof Q.on==="function")if(L.once)Q.once(G,I);else Q.on(G,I);else Q.addEventListener(G,I,L)}function GO(Q,G,I){let L=TypeError(`The "${Q}" argument must be of type ${G}. Received ${I}`);return L.code="ERR_INVALID_ARG_TYPE",L}function HJ(Q,G,I){let L=RangeError(`The "${Q}" argument is out of range. It must be ${G}. Received ${I}`);return L.code="ERR_OUT_OF_RANGE",L}function QQ(Q,G){if(Q!==void 0&&(Q===null||typeof Q!=="object"||!("aborted"in Q)))throw GO(G,"AbortSignal",Q)}function zZ(Q,G,I,L){if(typeof Q!=="number")throw GO(G,"number",Q);if(I!=null&&Q<I||L!=null&&Q>L||(I!=null||L!=null)&&Number.isNaN(Q))throw HJ(G,`${I!=null?`>= ${I}`:""}${I!=null&&L!=null?" && ":""}${L!=null?`<= ${L}`:""}`,Q)}function WO(Q){if(typeof Q!=="function")throw TypeError("The listener must be a function")}function FJ(Q,G){if(typeof Q!=="boolean")throw GO(G,"boolean",Q)}function YQ(Q){return Q?._maxListeners??QO}function JQ(Q,G){if(Q===void 0)throw GO("signal","AbortSignal",Q);if(QQ(Q,"signal"),typeof G!=="function")throw GO("listener","function",G);let I;if(Q.aborted)queueMicrotask(()=>G());else Q.addEventListener("abort",G,{__proto__:null,once:!0}),I=()=>{Q.removeEventListener("abort",G)};return{__proto__:null,[Symbol.dispose](){I?.()}}}var MZ,XO,sX,TJ,CJ,nX,rX,tX,QO=10,aU=function(Q){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[XO]=Q?.captureRejections?Boolean(Q?.captureRejections):d0[XO])this.emit=WJ},d0,RJ=function(Q,...G){if(Q==="error")return eX(this,G);var{_events:I}=this;if(I===void 0)return!1;var L=I[Q];if(L===void 0)return!1;let T=L.length>1?L.slice():L;for(let F=0,{length:J}=T;F<J;F++){let M=T[F];switch(G.length){case 0:M.call(this);break;case 1:M.call(this,G[0]);break;case 2:M.call(this,G[0],G[1]);break;case 3:M.call(this,G[0],G[1],G[2]);break;default:M.apply(this,G);break}}return!0},WJ=function(Q,...G){if(Q==="error")return eX(this,G);var{_events:I}=this;if(I===void 0)return!1;var L=I[Q];if(L===void 0)return!1;let T=L.length>1?L.slice():L;for(let F=0,{length:J}=T;F<J;F++){let M=T[F],z;switch(G.length){case 0:z=M.call(this);break;case 1:z=M.call(this,G[0]);break;case 2:z=M.call(this,G[0],G[1]);break;case 3:z=M.call(this,G[0],G[1],G[2]);break;default:z=M.apply(this,G);break}if(z!==void 0&&typeof z?.then==="function"&&z.then===Promise.prototype.then)LJ(this,z,Q,G)}return!0},DZ,DJ;var FO=CO(()=>{MZ=Symbol.for,XO=Symbol("kCapture"),sX=MZ("events.errorMonitor"),TJ=Symbol("events.maxEventTargetListeners"),CJ=Symbol("events.maxEventTargetListenersWarned"),nX=MZ("nodejs.rejection"),rX=MZ("nodejs.rejection"),tX=Array.prototype.slice,d0=aU.prototype={};d0._events=void 0;d0._eventsCount=0;d0._maxListeners=void 0;d0.setMaxListeners=function(Q){return zZ(Q,"setMaxListeners",0),this._maxListeners=Q,this};d0.constructor=aU;d0.getMaxListeners=function(){return this?._maxListeners??QO};d0.emit=RJ;d0.addListener=function(Q,G){WO(G);var I=this._events;if(!I)I=this._events={__proto__:null},this._eventsCount=0;else if(I.newListener)this.emit("newListener",Q,G.listener??G);var L=I[Q];if(!L)I[Q]=[G],this._eventsCount++;else{L.push(G);var T=this._maxListeners??QO;if(T>0&&L.length>T&&!L.warned)aX(this,Q,L)}return this};d0.on=d0.addListener;d0.prependListener=function(Q,G){WO(G);var I=this._events;if(!I)I=this._events={__proto__:null},this._eventsCount=0;else if(I.newListener)this.emit("newListener",Q,G.listener??G);var L=I[Q];if(!L)I[Q]=[G],this._eventsCount++;else{L.unshift(G);var T=this._maxListeners??QO;if(T>0&&L.length>T&&!L.warned)aX(this,Q,L)}return this};d0.once=function(Q,G){WO(G);let I=iX.bind(this,Q,G);return I.listener=G,this.addListener(Q,I),this};d0.prependOnceListener=function(Q,G){WO(G);let I=iX.bind(this,Q,G);return I.listener=G,this.prependListener(Q,I),this};d0.removeListener=function(Q,G){WO(G);var{_events:I}=this;if(!I)return this;var L=I[Q];if(!L)return this;var T=L.length;let F=-1;for(let J=T-1;J>=0;J--)if(L[J]===G||L[J].listener===G){F=J;break}if(F<0)return this;if(F===0)L.shift();else L.splice(F,1);if(L.length===0)delete I[Q],this._eventsCount--;return this};d0.off=d0.removeListener;d0.removeAllListeners=function(Q){var{_events:G}=this;if(Q&&G){if(G[Q])delete G[Q],this._eventsCount--}else this._events={__proto__:null};return this};d0.listeners=function(Q){var{_events:G}=this;if(!G)return[];var I=G[Q];if(!I)return[];return I.map((L)=>L.listener??L)};d0.rawListeners=function(Q){var{_events:G}=this;if(!G)return[];var I=G[Q];if(!I)return[];return I.slice()};d0.listenerCount=function(Q){var{_events:G}=this;if(!G)return 0;return G[Q]?.length??0};d0.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};d0[XO]=!1;DZ=class DZ extends Error{constructor(Q="The operation was aborted",G=void 0){if(G!==void 0&&typeof G!=="object")throw GO("options","Object",G);super(Q,G);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(aU,{captureRejections:{get(){return d0[XO]},set(Q){FJ(Q,"EventEmitter.captureRejections"),d0[XO]=Q},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return QO},set:(Q)=>{zZ(Q,"defaultMaxListeners",0),QO=Q}},kMaxEventTargetListeners:{value:TJ,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:CJ,enumerable:!1,configurable:!1,writable:!1}});Object.assign(aU,{once:UQ,getEventListeners:OQ,getMaxListeners:YQ,setMaxListeners:ZQ,EventEmitter:aU,usingDomains:!1,captureRejectionSymbol:rX,errorMonitor:sX,addAbortListener:JQ,init:aU,listenerCount:XQ});DJ=aU});var bO=KY((vV,TQ)=>{var u0=(Q,G)=>()=>(G||Q((G={exports:{}}).exports,G),G.exports),n0=u0((Q,G)=>{class I extends Error{constructor(L){if(!Array.isArray(L))throw TypeError(`Expected input to be an Array, got ${typeof L}`);let T="";for(let F=0;F<L.length;F++)T+=` ${L[F].stack}
|
|
2
|
-
`;super(T);this.name="AggregateError",this.errors=L}}G.exports={AggregateError:I,ArrayIsArray(L){return Array.isArray(L)},ArrayPrototypeIncludes(L,T){return L.includes(T)},ArrayPrototypeIndexOf(L,T){return L.indexOf(T)},ArrayPrototypeJoin(L,T){return L.join(T)},ArrayPrototypeMap(L,T){return L.map(T)},ArrayPrototypePop(L,T){return L.pop(T)},ArrayPrototypePush(L,T){return L.push(T)},ArrayPrototypeSlice(L,T,F){return L.slice(T,F)},Error,FunctionPrototypeCall(L,T,...F){return L.call(T,...F)},FunctionPrototypeSymbolHasInstance(L,T){return Function.prototype[Symbol.hasInstance].call(L,T)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(L,T){return Object.defineProperties(L,T)},ObjectDefineProperty(L,T,F){return Object.defineProperty(L,T,F)},ObjectGetOwnPropertyDescriptor(L,T){return Object.getOwnPropertyDescriptor(L,T)},ObjectKeys(L){return Object.keys(L)},ObjectSetPrototypeOf(L,T){return Object.setPrototypeOf(L,T)},Promise,PromisePrototypeCatch(L,T){return L.catch(T)},PromisePrototypeThen(L,T,F){return L.then(T,F)},PromiseReject(L){return Promise.reject(L)},PromiseResolve(L){return Promise.resolve(L)},ReflectApply:Reflect.apply,RegExpPrototypeTest(L,T){return L.test(T)},SafeSet:Set,String,StringPrototypeSlice(L,T,F){return L.slice(T,F)},StringPrototypeToLowerCase(L){return L.toLowerCase()},StringPrototypeToUpperCase(L){return L.toUpperCase()},StringPrototypeTrim(L){return L.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(L,T,F){return L.set(T,F)},Boolean,Uint8Array}}),$Q=u0((Q,G)=>{G.exports={format(I,...L){return I.replace(/%([sdifj])/g,function(...[T,F]){let J=L.shift();if(F==="f")return J.toFixed(6);else if(F==="j")return JSON.stringify(J);else if(F==="s"&&typeof J==="object")return`${J.constructor!==Object?J.constructor.name:""} {}`.trim();else return J.toString()})},inspect(I){switch(typeof I){case"string":if(I.includes("'")){if(!I.includes('"'))return`"${I}"`;else if(!I.includes("`")&&!I.includes("${"))return`\`${I}\``}return`'${I}'`;case"number":if(isNaN(I))return"NaN";else if(Object.is(I,-0))return String(I);return I;case"bigint":return`${String(I)}n`;case"boolean":case"undefined":return String(I);case"object":return"{}"}}}}),DU=u0((Q,G)=>{var{format:I,inspect:L}=$Q(),{AggregateError:T}=n0(),F=globalThis.AggregateError||T,J=Symbol("kIsNodeError"),M=["string","function","number","object","Function","Object","boolean","bigint","symbol"],z=/^([A-Z][a-z0-9]*)+$/,W={};function H(B,v){if(!B)throw new W.ERR_INTERNAL_ASSERTION(v)}function C(B){let v="",g=B.length,f=B[0]==="-"?1:0;for(;g>=f+4;g-=3)v=`_${B.slice(g-3,g)}${v}`;return`${B.slice(0,g)}${v}`}function R(B,v,g){if(typeof v==="function")return H(v.length<=g.length,`Code: ${B}; The provided arguments length (${g.length}) does not match the required ones (${v.length}).`),v(...g);let f=(v.match(/%[dfijoOs]/g)||[]).length;if(H(f===g.length,`Code: ${B}; The provided arguments length (${g.length}) does not match the required ones (${f}).`),g.length===0)return v;return I(v,...g)}function q(B,v,g){if(!g)g=Error;class f extends g{constructor(...w){super(R(B,v,w))}toString(){return`${this.name} [${B}]: ${this.message}`}}Object.defineProperties(f.prototype,{name:{value:g.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${B}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),f.prototype.code=B,f.prototype[J]=!0,W[B]=f}function P(B){let v="__node_internal_"+B.name;return Object.defineProperty(B,"name",{value:v}),B}function j(B,v){if(B&&v&&B!==v){if(Array.isArray(v.errors))return v.errors.push(B),v;let g=new F([v,B],v.message);return g.code=v.code,g}return B||v}class k extends Error{constructor(B="The operation was aborted",v=void 0){if(v!==void 0&&typeof v!=="object")throw new W.ERR_INVALID_ARG_TYPE("options","Object",v);super(B,v);this.code="ABORT_ERR",this.name="AbortError"}}q("ERR_ASSERTION","%s",Error),q("ERR_INVALID_ARG_TYPE",(B,v,g)=>{if(H(typeof B==="string","'name' must be a string"),!Array.isArray(v))v=[v];let f="The ";if(B.endsWith(" argument"))f+=`${B} `;else f+=`"${B}" ${B.includes(".")?"property":"argument"} `;f+="must be ";let w=[],d=[],Y0=[];for(let J0 of v)if(H(typeof J0==="string","All expected entries have to be of type string"),M.includes(J0))w.push(J0.toLowerCase());else if(z.test(J0))d.push(J0);else H(J0!=="object",'The value "object" should be written as "Object"'),Y0.push(J0);if(d.length>0){let J0=w.indexOf("object");if(J0!==-1)w.splice(w,J0,1),d.push("Object")}if(w.length>0){switch(w.length){case 1:f+=`of type ${w[0]}`;break;case 2:f+=`one of type ${w[0]} or ${w[1]}`;break;default:{let J0=w.pop();f+=`one of type ${w.join(", ")}, or ${J0}`}}if(d.length>0||Y0.length>0)f+=" or "}if(d.length>0){switch(d.length){case 1:f+=`an instance of ${d[0]}`;break;case 2:f+=`an instance of ${d[0]} or ${d[1]}`;break;default:{let J0=d.pop();f+=`an instance of ${d.join(", ")}, or ${J0}`}}if(Y0.length>0)f+=" or "}switch(Y0.length){case 0:break;case 1:if(Y0[0].toLowerCase()!==Y0[0])f+="an ";f+=`${Y0[0]}`;break;case 2:f+=`one of ${Y0[0]} or ${Y0[1]}`;break;default:{let J0=Y0.pop();f+=`one of ${Y0.join(", ")}, or ${J0}`}}if(g==null)f+=`. Received ${g}`;else if(typeof g==="function"&&g.name)f+=`. Received function ${g.name}`;else if(typeof g==="object"){var G0;if((G0=g.constructor)!==null&&G0!==void 0&&G0.name)f+=`. Received an instance of ${g.constructor.name}`;else{let J0=L(g,{depth:-1});f+=`. Received ${J0}`}}else{let J0=L(g,{colors:!1});if(J0.length>25)J0=`${J0.slice(0,25)}...`;f+=`. Received type ${typeof g} (${J0})`}return f},TypeError),q("ERR_INVALID_ARG_VALUE",(B,v,g="is invalid")=>{let f=L(v);if(f.length>128)f=f.slice(0,128)+"...";return`The ${B.includes(".")?"property":"argument"} '${B}' ${g}. Received ${f}`},TypeError),q("ERR_INVALID_RETURN_VALUE",(B,v,g)=>{var f;let w=g!==null&&g!==void 0&&(f=g.constructor)!==null&&f!==void 0&&f.name?`instance of ${g.constructor.name}`:`type ${typeof g}`;return`Expected ${B} to be returned from the "${v}" function but got ${w}.`},TypeError),q("ERR_MISSING_ARGS",(...B)=>{H(B.length>0,"At least one arg needs to be specified");let v,g=B.length;switch(B=(Array.isArray(B)?B:[B]).map((f)=>`"${f}"`).join(" or "),g){case 1:v+=`The ${B[0]} argument`;break;case 2:v+=`The ${B[0]} and ${B[1]} arguments`;break;default:{let f=B.pop();v+=`The ${B.join(", ")}, and ${f} arguments`}break}return`${v} must be specified`},TypeError),q("ERR_OUT_OF_RANGE",(B,v,g)=>{H(v,'Missing "range" argument');let f;if(Number.isInteger(g)&&Math.abs(g)>4294967296)f=C(String(g));else if(typeof g==="bigint"){f=String(g);let w=BigInt(2)**BigInt(32);if(g>w||g<-w)f=C(f);f+="n"}else f=L(g);return`The value of "${B}" is out of range. It must be ${v}. Received ${f}`},RangeError),q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),q("ERR_STREAM_WRITE_AFTER_END","write after end",Error),q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),G.exports={AbortError:k,aggregateTwoErrors:P(j),hideStackFrames:P,codes:W}}),MJ=u0((Q,G)=>{Object.defineProperty(Q,"__esModule",{value:!0});var I=new WeakMap,L=new WeakMap;function T(u){let O0=I.get(u);return console.assert(O0!=null,"'this' is expected an Event object, but got",u),O0}function F(u){if(u.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",u.passiveListener);return}if(!u.event.cancelable)return;if(u.canceled=!0,typeof u.event.preventDefault==="function")u.event.preventDefault()}function J(u,O0){I.set(this,{eventTarget:u,event:O0,eventPhase:2,currentTarget:u,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:O0.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let U=Object.keys(O0);for(let X=0;X<U.length;++X){let $=U[X];if(!($ in this))Object.defineProperty(this,$,M($))}}if(J.prototype={get type(){return T(this).event.type},get target(){return T(this).eventTarget},get currentTarget(){return T(this).currentTarget},composedPath(){let u=T(this).currentTarget;if(u==null)return[];return[u]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return T(this).eventPhase},stopPropagation(){let u=T(this);if(u.stopped=!0,typeof u.event.stopPropagation==="function")u.event.stopPropagation()},stopImmediatePropagation(){let u=T(this);if(u.stopped=!0,u.immediateStopped=!0,typeof u.event.stopImmediatePropagation==="function")u.event.stopImmediatePropagation()},get bubbles(){return Boolean(T(this).event.bubbles)},get cancelable(){return Boolean(T(this).event.cancelable)},preventDefault(){F(T(this))},get defaultPrevented(){return T(this).canceled},get composed(){return Boolean(T(this).event.composed)},get timeStamp(){return T(this).timeStamp},get srcElement(){return T(this).eventTarget},get cancelBubble(){return T(this).stopped},set cancelBubble(u){if(!u)return;let O0=T(this);if(O0.stopped=!0,typeof O0.event.cancelBubble==="boolean")O0.event.cancelBubble=!0},get returnValue(){return!T(this).canceled},set returnValue(u){if(!u)F(T(this))},initEvent(){}},Object.defineProperty(J.prototype,"constructor",{value:J,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(J.prototype,window.Event.prototype),L.set(window.Event.prototype,J);function M(u){return{get(){return T(this).event[u]},set(O0){T(this).event[u]=O0},configurable:!0,enumerable:!0}}function z(u){return{value(){let O0=T(this).event;return O0[u].apply(O0,arguments)},configurable:!0,enumerable:!0}}function W(u,O0){let U=Object.keys(O0);if(U.length===0)return u;function X($,Z){u.call(this,$,Z)}X.prototype=Object.create(u.prototype,{constructor:{value:X,configurable:!0,writable:!0}});for(let $=0;$<U.length;++$){let Z=U[$];if(!(Z in u.prototype)){let Y=typeof Object.getOwnPropertyDescriptor(O0,Z).value==="function";Object.defineProperty(X.prototype,Z,Y?z(Z):M(Z))}}return X}function H(u){if(u==null||u===Object.prototype)return J;let O0=L.get(u);if(O0==null)O0=W(H(Object.getPrototypeOf(u)),u),L.set(u,O0);return O0}function C(u,O0){return new(H(Object.getPrototypeOf(O0)))(u,O0)}function R(u){return T(u).immediateStopped}function q(u,O0){T(u).eventPhase=O0}function P(u,O0){T(u).currentTarget=O0}function j(u,O0){T(u).passiveListener=O0}var k=new WeakMap,B=1,v=2,g=3;function f(u){return u!==null&&typeof u==="object"}function w(u){let O0=k.get(u);if(O0==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return O0}function d(u){return{get(){let O0=w(this).get(u);while(O0!=null){if(O0.listenerType===g)return O0.listener;O0=O0.next}return null},set(O0){if(typeof O0!=="function"&&!f(O0))O0=null;let U=w(this),X=null,$=U.get(u);while($!=null){if($.listenerType===g)if(X!==null)X.next=$.next;else if($.next!==null)U.set(u,$.next);else U.delete(u);else X=$;$=$.next}if(O0!==null){let Z={listener:O0,listenerType:g,passive:!1,once:!1,next:null};if(X===null)U.set(u,Z);else X.next=Z}},configurable:!0,enumerable:!0}}function Y0(u,O0){Object.defineProperty(u,`on${O0}`,d(O0))}function G0(u){function O0(){J0.call(this)}O0.prototype=Object.create(J0.prototype,{constructor:{value:O0,configurable:!0,writable:!0}});for(let U=0;U<u.length;++U)Y0(O0.prototype,u[U]);return O0}function J0(){if(this instanceof J0){k.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return G0(arguments[0]);if(arguments.length>0){let u=Array(arguments.length);for(let O0=0;O0<arguments.length;++O0)u[O0]=arguments[O0];return G0(u)}throw TypeError("Cannot call a class as a function")}if(J0.prototype={addEventListener(u,O0,U){if(O0==null)return;if(typeof O0!=="function"&&!f(O0))throw TypeError("'listener' should be a function or an object.");let X=w(this),$=f(U),Z=($?Boolean(U.capture):Boolean(U))?B:v,Y={listener:O0,listenerType:Z,passive:$&&Boolean(U.passive),once:$&&Boolean(U.once),next:null},E=X.get(u);if(E===void 0){X.set(u,Y);return}let K=null;while(E!=null){if(E.listener===O0&&E.listenerType===Z)return;K=E,E=E.next}K.next=Y},removeEventListener(u,O0,U){if(O0==null)return;let X=w(this),$=(f(U)?Boolean(U.capture):Boolean(U))?B:v,Z=null,Y=X.get(u);while(Y!=null){if(Y.listener===O0&&Y.listenerType===$){if(Z!==null)Z.next=Y.next;else if(Y.next!==null)X.set(u,Y.next);else X.delete(u);return}Z=Y,Y=Y.next}},dispatchEvent(u){if(u==null||typeof u.type!=="string")throw TypeError('"event.type" should be a string.');let O0=w(this),U=u.type,X=O0.get(U);if(X==null)return!0;let $=C(this,u),Z=null;while(X!=null){if(X.once)if(Z!==null)Z.next=X.next;else if(X.next!==null)O0.set(U,X.next);else O0.delete(U);else Z=X;if(j($,X.passive?X.listener:null),typeof X.listener==="function")try{X.listener.call(this,$)}catch(Y){if(typeof console<"u"&&typeof console.error==="function")console.error(Y)}else if(X.listenerType!==g&&typeof X.listener.handleEvent==="function")X.listener.handleEvent($);if(R($))break;X=X.next}return j($,null),q($,0),P($,null),!$.defaultPrevented}},Object.defineProperty(J0.prototype,"constructor",{value:J0,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(J0.prototype,window.EventTarget.prototype);Q.defineEventAttribute=Y0,Q.EventTarget=J0,Q.default=J0,G.exports=J0,G.exports.EventTarget=G.exports.default=J0,G.exports.defineEventAttribute=Y0}),DO=u0((Q,G)=>{Object.defineProperty(Q,"__esModule",{value:!0});var I=MJ();class L extends I.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let H=J.get(this);if(typeof H!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return H}}I.defineEventAttribute(L.prototype,"abort");function T(){let H=Object.create(L.prototype);return I.EventTarget.call(H),J.set(H,!1),H}function F(H){if(J.get(H)!==!1)return;J.set(H,!0),H.dispatchEvent({type:"abort"})}var J=new WeakMap;if(Object.defineProperties(L.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(L.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class M{constructor(){z.set(this,T())}get signal(){return W(this)}abort(){F(W(this))}}var z=new WeakMap;function W(H){let C=z.get(H);if(C==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${H===null?"null":typeof H}`);return C}if(Object.defineProperties(M.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(M.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});Q.AbortController=M,Q.AbortSignal=L,Q.default=M,G.exports=M,G.exports.AbortController=G.exports.default=M,G.exports.AbortSignal=L}),kU=u0((Q,G)=>{var I=(LU(),h0(CU)),{format:L,inspect:T}=$Q(),{codes:{ERR_INVALID_ARG_TYPE:F}}=DU(),{kResistStopPropagation:J,AggregateError:M,SymbolDispose:z}=n0(),W=globalThis.AbortSignal||DO().AbortSignal,H=globalThis.AbortController||DO().AbortController,C=Object.getPrototypeOf(async function(){}).constructor,R=globalThis.Blob||I.Blob,q=typeof R<"u"?function(k){return k instanceof R}:function(k){return!1},P=(k,B)=>{if(k!==void 0&&(k===null||typeof k!=="object"||!("aborted"in k)))throw new F(B,"AbortSignal",k)},j=(k,B)=>{if(typeof k!=="function")throw new F(B,"Function",k)};G.exports={AggregateError:M,kEmptyObject:Object.freeze({}),once(k){let B=!1;return function(...v){if(B)return;B=!0,k.apply(this,v)}},createDeferredPromise:function(){let k,B;return{promise:new Promise((v,g)=>{k=v,B=g}),resolve:k,reject:B}},promisify(k){return new Promise((B,v)=>{k((g,...f)=>{if(g)return v(g);return B(...f)})})},debuglog(){return function(){}},format:L,inspect:T,types:{isAsyncFunction(k){return k instanceof C},isArrayBufferView(k){return ArrayBuffer.isView(k)}},isBlob:q,deprecate(k,B){return k},addAbortListener:(FO(),h0(HO)).addAbortListener||function(k,B){if(k===void 0)throw new F("signal","AbortSignal",k);P(k,"signal"),j(B,"listener");let v;if(k.aborted)queueMicrotask(()=>B());else k.addEventListener("abort",B,{__proto__:null,once:!0,[J]:!0}),v=()=>{k.removeEventListener("abort",B)};return{__proto__:null,[z](){var g;(g=v)===null||g===void 0||g()}}},AbortSignalAny:W.any||function(k){if(k.length===1)return k[0];let B=new H,v=()=>B.abort();return k.forEach((g)=>{P(g,"signals"),g.addEventListener("abort",v,{once:!0})}),B.signal.addEventListener("abort",()=>{k.forEach((g)=>g.removeEventListener("abort",v))},{once:!0}),B.signal}},G.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),MO=u0((Q,G)=>{var{ArrayIsArray:I,ArrayPrototypeIncludes:L,ArrayPrototypeJoin:T,ArrayPrototypeMap:F,NumberIsInteger:J,NumberIsNaN:M,NumberMAX_SAFE_INTEGER:z,NumberMIN_SAFE_INTEGER:W,NumberParseInt:H,ObjectPrototypeHasOwnProperty:C,RegExpPrototypeExec:R,String:q,StringPrototypeToUpperCase:P,StringPrototypeTrim:j}=n0(),{hideStackFrames:k,codes:{ERR_SOCKET_BAD_PORT:B,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:g,ERR_OUT_OF_RANGE:f,ERR_UNKNOWN_SIGNAL:w}}=DU(),{normalizeEncoding:d}=kU(),{isAsyncFunction:Y0,isArrayBufferView:G0}=kU().types,J0={};function u(c){return c===(c|0)}function O0(c){return c===c>>>0}var U=/^[0-7]+$/,X="must be a 32-bit unsigned integer or an octal string";function $(c,o,x0){if(typeof c>"u")c=x0;if(typeof c==="string"){if(R(U,c)===null)throw new g(o,c,X);c=H(c,8)}return E(c,o),c}var Z=k((c,o,x0=W,m=z)=>{if(typeof c!=="number")throw new v(o,"number",c);if(!J(c))throw new f(o,"an integer",c);if(c<x0||c>m)throw new f(o,`>= ${x0} && <= ${m}`,c)}),Y=k((c,o,x0=-2147483648,m=2147483647)=>{if(typeof c!=="number")throw new v(o,"number",c);if(!J(c))throw new f(o,"an integer",c);if(c<x0||c>m)throw new f(o,`>= ${x0} && <= ${m}`,c)}),E=k((c,o,x0=!1)=>{if(typeof c!=="number")throw new v(o,"number",c);if(!J(c))throw new f(o,"an integer",c);let m=x0?1:0,Z0=4294967295;if(c<m||c>Z0)throw new f(o,`>= ${m} && <= ${Z0}`,c)});function K(c,o){if(typeof c!=="string")throw new v(o,"string",c)}function A(c,o,x0=void 0,m){if(typeof c!=="number")throw new v(o,"number",c);if(x0!=null&&c<x0||m!=null&&c>m||(x0!=null||m!=null)&&M(c))throw new f(o,`${x0!=null?`>= ${x0}`:""}${x0!=null&&m!=null?" && ":""}${m!=null?`<= ${m}`:""}`,c)}var O=k((c,o,x0)=>{if(!L(x0,c)){let m="must be one of: "+T(F(x0,(Z0)=>typeof Z0==="string"?`'${Z0}'`:q(Z0)),", ");throw new g(o,c,m)}});function V(c,o){if(typeof c!=="boolean")throw new v(o,"boolean",c)}function D(c,o,x0){return c==null||!C(c,o)?x0:c[o]}var S=k((c,o,x0=null)=>{let m=D(x0,"allowArray",!1),Z0=D(x0,"allowFunction",!1);if(!D(x0,"nullable",!1)&&c===null||!m&&I(c)||typeof c!=="object"&&(!Z0||typeof c!=="function"))throw new v(o,"Object",c)}),_=k((c,o)=>{if(c!=null&&typeof c!=="object"&&typeof c!=="function")throw new v(o,"a dictionary",c)}),N=k((c,o,x0=0)=>{if(!I(c))throw new v(o,"Array",c);if(c.length<x0){let m=`must be longer than ${x0}`;throw new g(o,c,m)}});function p(c,o){N(c,o);for(let x0=0;x0<c.length;x0++)K(c[x0],`${o}[${x0}]`)}function n(c,o){N(c,o);for(let x0=0;x0<c.length;x0++)V(c[x0],`${o}[${x0}]`)}function V0(c,o){N(c,o);for(let x0=0;x0<c.length;x0++){let m=c[x0],Z0=`${o}[${x0}]`;if(m==null)throw new v(Z0,"AbortSignal",m);i(m,Z0)}}function r(c,o="signal"){if(K(c,o),J0[c]===void 0){if(J0[P(c)]!==void 0)throw new w(c+" (signals must use all capital letters)");throw new w(c)}}var b=k((c,o="buffer")=>{if(!G0(c))throw new v(o,["Buffer","TypedArray","DataView"],c)});function X0(c,o){let x0=d(o),m=c.length;if(x0==="hex"&&m%2!==0)throw new g("encoding",o,`is invalid for data of length ${m}`)}function t(c,o="Port",x0=!0){if(typeof c!=="number"&&typeof c!=="string"||typeof c==="string"&&j(c).length===0||+c!==+c>>>0||c>65535||c===0&&!x0)throw new B(o,c,x0);return c|0}var i=k((c,o)=>{if(c!==void 0&&(c===null||typeof c!=="object"||!("aborted"in c)))throw new v(o,"AbortSignal",c)}),N0=k((c,o)=>{if(typeof c!=="function")throw new v(o,"Function",c)}),y=k((c,o)=>{if(typeof c!=="function"||Y0(c))throw new v(o,"Function",c)}),h=k((c,o)=>{if(c!==void 0)throw new v(o,"undefined",c)});function Q0(c,o,x0){if(!L(x0,c))throw new v(o,`('${T(x0,"|")}')`,c)}var s=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function a(c,o){if(typeof c>"u"||!R(s,c))throw new g(o,c,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function H0(c){if(typeof c==="string")return a(c,"hints"),c;else if(I(c)){let o=c.length,x0="";if(o===0)return x0;for(let m=0;m<o;m++){let Z0=c[m];if(a(Z0,"hints"),x0+=Z0,m!==o-1)x0+=", "}return x0}throw new g("hints",c,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}G.exports={isInt32:u,isUint32:O0,parseFileMode:$,validateArray:N,validateStringArray:p,validateBooleanArray:n,validateAbortSignalArray:V0,validateBoolean:V,validateBuffer:b,validateDictionary:_,validateEncoding:X0,validateFunction:N0,validateInt32:Y,validateInteger:Z,validateNumber:A,validateObject:S,validateOneOf:O,validatePlainFunction:y,validatePort:t,validateSignalName:r,validateString:K,validateUint32:E,validateUndefined:h,validateUnion:Q0,validateAbortSignal:i,validateLinkHeaderValue:H0}}),YO=u0((Q,G)=>{G.exports=globalThis.process}),nU=u0((Q,G)=>{var{SymbolAsyncIterator:I,SymbolIterator:L,SymbolFor:T}=n0(),F=T("nodejs.stream.destroyed"),J=T("nodejs.stream.errored"),M=T("nodejs.stream.readable"),z=T("nodejs.stream.writable"),W=T("nodejs.stream.disturbed"),H=T("nodejs.webstream.isClosedPromise"),C=T("nodejs.webstream.controllerErrorFunction");function R(D,S=!1){var _;return!!(D&&typeof D.pipe==="function"&&typeof D.on==="function"&&(!S||typeof D.pause==="function"&&typeof D.resume==="function")&&(!D._writableState||((_=D._readableState)===null||_===void 0?void 0:_.readable)!==!1)&&(!D._writableState||D._readableState))}function q(D){var S;return!!(D&&typeof D.write==="function"&&typeof D.on==="function"&&(!D._readableState||((S=D._writableState)===null||S===void 0?void 0:S.writable)!==!1))}function P(D){return!!(D&&typeof D.pipe==="function"&&D._readableState&&typeof D.on==="function"&&typeof D.write==="function")}function j(D){return D&&(D._readableState||D._writableState||typeof D.write==="function"&&typeof D.on==="function"||typeof D.pipe==="function"&&typeof D.on==="function")}function k(D){return!!(D&&!j(D)&&typeof D.pipeThrough==="function"&&typeof D.getReader==="function"&&typeof D.cancel==="function")}function B(D){return!!(D&&!j(D)&&typeof D.getWriter==="function"&&typeof D.abort==="function")}function v(D){return!!(D&&!j(D)&&typeof D.readable==="object"&&typeof D.writable==="object")}function g(D){return k(D)||B(D)||v(D)}function f(D,S){if(D==null)return!1;if(S===!0)return typeof D[I]==="function";if(S===!1)return typeof D[L]==="function";return typeof D[I]==="function"||typeof D[L]==="function"}function w(D){if(!j(D))return null;let{_writableState:S,_readableState:_}=D,N=S||_;return!!(D.destroyed||D[F]||N!==null&&N!==void 0&&N.destroyed)}function d(D){if(!q(D))return null;if(D.writableEnded===!0)return!0;let S=D._writableState;if(S!==null&&S!==void 0&&S.errored)return!1;if(typeof(S===null||S===void 0?void 0:S.ended)!=="boolean")return null;return S.ended}function Y0(D,S){if(!q(D))return null;if(D.writableFinished===!0)return!0;let _=D._writableState;if(_!==null&&_!==void 0&&_.errored)return!1;if(typeof(_===null||_===void 0?void 0:_.finished)!=="boolean")return null;return!!(_.finished||S===!1&&_.ended===!0&&_.length===0)}function G0(D){if(!R(D))return null;if(D.readableEnded===!0)return!0;let S=D._readableState;if(!S||S.errored)return!1;if(typeof(S===null||S===void 0?void 0:S.ended)!=="boolean")return null;return S.ended}function J0(D,S){if(!R(D))return null;let _=D._readableState;if(_!==null&&_!==void 0&&_.errored)return!1;if(typeof(_===null||_===void 0?void 0:_.endEmitted)!=="boolean")return null;return!!(_.endEmitted||S===!1&&_.ended===!0&&_.length===0)}function u(D){if(D&&D[M]!=null)return D[M];if(typeof(D===null||D===void 0?void 0:D.readable)!=="boolean")return null;if(w(D))return!1;return R(D)&&D.readable&&!J0(D)}function O0(D){if(D&&D[z]!=null)return D[z];if(typeof(D===null||D===void 0?void 0:D.writable)!=="boolean")return null;if(w(D))return!1;return q(D)&&D.writable&&!d(D)}function U(D,S){if(!j(D))return null;if(w(D))return!0;if((S===null||S===void 0?void 0:S.readable)!==!1&&u(D))return!1;if((S===null||S===void 0?void 0:S.writable)!==!1&&O0(D))return!1;return!0}function X(D){var S,_;if(!j(D))return null;if(D.writableErrored)return D.writableErrored;return(S=(_=D._writableState)===null||_===void 0?void 0:_.errored)!==null&&S!==void 0?S:null}function $(D){var S,_;if(!j(D))return null;if(D.readableErrored)return D.readableErrored;return(S=(_=D._readableState)===null||_===void 0?void 0:_.errored)!==null&&S!==void 0?S:null}function Z(D){if(!j(D))return null;if(typeof D.closed==="boolean")return D.closed;let{_writableState:S,_readableState:_}=D;if(typeof(S===null||S===void 0?void 0:S.closed)==="boolean"||typeof(_===null||_===void 0?void 0:_.closed)==="boolean")return(S===null||S===void 0?void 0:S.closed)||(_===null||_===void 0?void 0:_.closed);if(typeof D._closed==="boolean"&&Y(D))return D._closed;return null}function Y(D){return typeof D._closed==="boolean"&&typeof D._defaultKeepAlive==="boolean"&&typeof D._removedConnection==="boolean"&&typeof D._removedContLen==="boolean"}function E(D){return typeof D._sent100==="boolean"&&Y(D)}function K(D){var S;return typeof D._consuming==="boolean"&&typeof D._dumped==="boolean"&&((S=D.req)===null||S===void 0?void 0:S.upgradeOrConnect)===void 0}function A(D){if(!j(D))return null;let{_writableState:S,_readableState:_}=D,N=S||_;return!N&&E(D)||!!(N&&N.autoDestroy&&N.emitClose&&N.closed===!1)}function O(D){var S;return!!(D&&((S=D[W])!==null&&S!==void 0?S:D.readableDidRead||D.readableAborted))}function V(D){var S,_,N,p,n,V0,r,b,X0,t;return!!(D&&((S=(_=(N=(p=(n=(V0=D[J])!==null&&V0!==void 0?V0:D.readableErrored)!==null&&n!==void 0?n:D.writableErrored)!==null&&p!==void 0?p:(r=D._readableState)===null||r===void 0?void 0:r.errorEmitted)!==null&&N!==void 0?N:(b=D._writableState)===null||b===void 0?void 0:b.errorEmitted)!==null&&_!==void 0?_:(X0=D._readableState)===null||X0===void 0?void 0:X0.errored)!==null&&S!==void 0?S:(t=D._writableState)===null||t===void 0?void 0:t.errored))}G.exports={isDestroyed:w,kIsDestroyed:F,isDisturbed:O,kIsDisturbed:W,isErrored:V,kIsErrored:J,isReadable:u,kIsReadable:M,kIsClosedPromise:H,kControllerErrorFunction:C,kIsWritable:z,isClosed:Z,isDuplexNodeStream:P,isFinished:U,isIterable:f,isReadableNodeStream:R,isReadableStream:k,isReadableEnded:G0,isReadableFinished:J0,isReadableErrored:$,isNodeStream:j,isWebStream:g,isWritable:O0,isWritableNodeStream:q,isWritableStream:B,isWritableEnded:d,isWritableFinished:Y0,isWritableErrored:X,isServerRequest:K,isServerResponse:E,willEmitClose:A,isTransformStream:v}}),iU=u0((Q,G)=>{var I=YO(),{AbortError:L,codes:T}=DU(),{ERR_INVALID_ARG_TYPE:F,ERR_STREAM_PREMATURE_CLOSE:J}=T,{kEmptyObject:M,once:z}=kU(),{validateAbortSignal:W,validateFunction:H,validateObject:C,validateBoolean:R}=MO(),{Promise:q,PromisePrototypeThen:P,SymbolDispose:j}=n0(),{isClosed:k,isReadable:B,isReadableNodeStream:v,isReadableStream:g,isReadableFinished:f,isReadableErrored:w,isWritable:d,isWritableNodeStream:Y0,isWritableStream:G0,isWritableFinished:J0,isWritableErrored:u,isNodeStream:O0,willEmitClose:U,kIsClosedPromise:X}=nU(),$;function Z(O){return O.setHeader&&typeof O.abort==="function"}var Y=()=>{};function E(O,V,D){var S,_;if(arguments.length===2)D=V,V=M;else if(V==null)V=M;else C(V,"options");if(H(D,"callback"),W(V.signal,"options.signal"),D=z(D),g(O)||G0(O))return K(O,V,D);if(!O0(O))throw new F("stream",["ReadableStream","WritableStream","Stream"],O);let N=(S=V.readable)!==null&&S!==void 0?S:v(O),p=(_=V.writable)!==null&&_!==void 0?_:Y0(O),n=O._writableState,V0=O._readableState,r=()=>{if(!O.writable)t()},b=U(O)&&v(O)===N&&Y0(O)===p,X0=J0(O,!1),t=()=>{if(X0=!0,O.destroyed)b=!1;if(b&&(!O.readable||N))return;if(!N||i)D.call(O)},i=f(O,!1),N0=()=>{if(i=!0,O.destroyed)b=!1;if(b&&(!O.writable||p))return;if(!p||X0)D.call(O)},y=(c)=>{D.call(O,c)},h=k(O),Q0=()=>{h=!0;let c=u(O)||w(O);if(c&&typeof c!=="boolean")return D.call(O,c);if(N&&!i&&v(O,!0)){if(!f(O,!1))return D.call(O,new J)}if(p&&!X0){if(!J0(O,!1))return D.call(O,new J)}D.call(O)},s=()=>{h=!0;let c=u(O)||w(O);if(c&&typeof c!=="boolean")return D.call(O,c);D.call(O)},a=()=>{O.req.on("finish",t)};if(Z(O)){if(O.on("complete",t),!b)O.on("abort",Q0);if(O.req)a();else O.on("request",a)}else if(p&&!n)O.on("end",r),O.on("close",r);if(!b&&typeof O.aborted==="boolean")O.on("aborted",Q0);if(O.on("end",N0),O.on("finish",t),V.error!==!1)O.on("error",y);if(O.on("close",Q0),h)I.nextTick(Q0);else if(n!==null&&n!==void 0&&n.errorEmitted||V0!==null&&V0!==void 0&&V0.errorEmitted){if(!b)I.nextTick(s)}else if(!N&&(!b||B(O))&&(X0||d(O)===!1))I.nextTick(s);else if(!p&&(!b||d(O))&&(i||B(O)===!1))I.nextTick(s);else if(V0&&O.req&&O.aborted)I.nextTick(s);let H0=()=>{if(D=Y,O.removeListener("aborted",Q0),O.removeListener("complete",t),O.removeListener("abort",Q0),O.removeListener("request",a),O.req)O.req.removeListener("finish",t);O.removeListener("end",r),O.removeListener("close",r),O.removeListener("finish",t),O.removeListener("end",N0),O.removeListener("error",y),O.removeListener("close",Q0)};if(V.signal&&!h){let c=()=>{let o=D;H0(),o.call(O,new L(void 0,{cause:V.signal.reason}))};if(V.signal.aborted)I.nextTick(c);else{$=$||kU().addAbortListener;let o=$(V.signal,c),x0=D;D=z((...m)=>{o[j](),x0.apply(O,m)})}}return H0}function K(O,V,D){let S=!1,_=Y;if(V.signal)if(_=()=>{S=!0,D.call(O,new L(void 0,{cause:V.signal.reason}))},V.signal.aborted)I.nextTick(_);else{$=$||kU().addAbortListener;let p=$(V.signal,_),n=D;D=z((...V0)=>{p[j](),n.apply(O,V0)})}let N=(...p)=>{if(!S)I.nextTick(()=>D.apply(O,p))};return P(O[X].promise,N,N),Y}function A(O,V){var D;let S=!1;if(V===null)V=M;if((D=V)!==null&&D!==void 0&&D.cleanup)R(V.cleanup,"cleanup"),S=V.cleanup;return new q((_,N)=>{let p=E(O,V,(n)=>{if(S)p();if(n)N(n);else _()})})}G.exports=E,G.exports.finished=A}),AO=u0((Q,G)=>{var I=YO(),{aggregateTwoErrors:L,codes:{ERR_MULTIPLE_CALLBACK:T},AbortError:F}=DU(),{Symbol:J}=n0(),{kIsDestroyed:M,isDestroyed:z,isFinished:W,isServerRequest:H}=nU(),C=J("kDestroy"),R=J("kConstruct");function q(U,X,$){if(U){if(U.stack,X&&!X.errored)X.errored=U;if($&&!$.errored)$.errored=U}}function P(U,X){let $=this._readableState,Z=this._writableState,Y=Z||$;if(Z!==null&&Z!==void 0&&Z.destroyed||$!==null&&$!==void 0&&$.destroyed){if(typeof X==="function")X();return this}if(q(U,Z,$),Z)Z.destroyed=!0;if($)$.destroyed=!0;if(!Y.constructed)this.once(C,function(E){j(this,L(E,U),X)});else j(this,U,X);return this}function j(U,X,$){let Z=!1;function Y(E){if(Z)return;Z=!0;let{_readableState:K,_writableState:A}=U;if(q(E,A,K),A)A.closed=!0;if(K)K.closed=!0;if(typeof $==="function")$(E);if(E)I.nextTick(k,U,E);else I.nextTick(B,U)}try{U._destroy(X||null,Y)}catch(E){Y(E)}}function k(U,X){v(U,X),B(U)}function B(U){let{_readableState:X,_writableState:$}=U;if($)$.closeEmitted=!0;if(X)X.closeEmitted=!0;if($!==null&&$!==void 0&&$.emitClose||X!==null&&X!==void 0&&X.emitClose)U.emit("close")}function v(U,X){let{_readableState:$,_writableState:Z}=U;if(Z!==null&&Z!==void 0&&Z.errorEmitted||$!==null&&$!==void 0&&$.errorEmitted)return;if(Z)Z.errorEmitted=!0;if($)$.errorEmitted=!0;U.emit("error",X)}function g(){let U=this._readableState,X=this._writableState;if(U)U.constructed=!0,U.closed=!1,U.closeEmitted=!1,U.destroyed=!1,U.errored=null,U.errorEmitted=!1,U.reading=!1,U.ended=U.readable===!1,U.endEmitted=U.readable===!1;if(X)X.constructed=!0,X.destroyed=!1,X.closed=!1,X.closeEmitted=!1,X.errored=null,X.errorEmitted=!1,X.finalCalled=!1,X.prefinished=!1,X.ended=X.writable===!1,X.ending=X.writable===!1,X.finished=X.writable===!1}function f(U,X,$){let{_readableState:Z,_writableState:Y}=U;if(Y!==null&&Y!==void 0&&Y.destroyed||Z!==null&&Z!==void 0&&Z.destroyed)return this;if(Z!==null&&Z!==void 0&&Z.autoDestroy||Y!==null&&Y!==void 0&&Y.autoDestroy)U.destroy(X);else if(X){if(X.stack,Y&&!Y.errored)Y.errored=X;if(Z&&!Z.errored)Z.errored=X;if($)I.nextTick(v,U,X);else v(U,X)}}function w(U,X){if(typeof U._construct!=="function")return;let{_readableState:$,_writableState:Z}=U;if($)$.constructed=!1;if(Z)Z.constructed=!1;if(U.once(R,X),U.listenerCount(R)>1)return;I.nextTick(d,U)}function d(U){let X=!1;function $(Z){if(X){f(U,Z!==null&&Z!==void 0?Z:new T);return}X=!0;let{_readableState:Y,_writableState:E}=U,K=E||Y;if(Y)Y.constructed=!0;if(E)E.constructed=!0;if(K.destroyed)U.emit(C,Z);else if(Z)f(U,Z,!0);else I.nextTick(Y0,U)}try{U._construct((Z)=>{I.nextTick($,Z)})}catch(Z){I.nextTick($,Z)}}function Y0(U){U.emit(R)}function G0(U){return(U===null||U===void 0?void 0:U.setHeader)&&typeof U.abort==="function"}function J0(U){U.emit("close")}function u(U,X){U.emit("error",X),I.nextTick(J0,U)}function O0(U,X){if(!U||z(U))return;if(!X&&!W(U))X=new F;if(H(U))U.socket=null,U.destroy(X);else if(G0(U))U.abort();else if(G0(U.req))U.req.abort();else if(typeof U.destroy==="function")U.destroy(X);else if(typeof U.close==="function")U.close();else if(X)I.nextTick(u,U,X);else I.nextTick(J0,U);if(!U.destroyed)U[M]=!0}G.exports={construct:w,destroyer:O0,destroy:P,undestroy:g,errorOrDestroy:f}}),qZ=u0((Q,G)=>{var{ArrayIsArray:I,ObjectSetPrototypeOf:L}=n0(),{EventEmitter:T}=(FO(),h0(HO));function F(M){T.call(this,M)}L(F.prototype,T.prototype),L(F,T),F.prototype.pipe=function(M,z){let W=this;function H(B){if(M.writable&&M.write(B)===!1&&W.pause)W.pause()}W.on("data",H);function C(){if(W.readable&&W.resume)W.resume()}if(M.on("drain",C),!M._isStdio&&(!z||z.end!==!1))W.on("end",q),W.on("close",P);let R=!1;function q(){if(R)return;R=!0,M.end()}function P(){if(R)return;if(R=!0,typeof M.destroy==="function")M.destroy()}function j(B){if(k(),T.listenerCount(this,"error")===0)this.emit("error",B)}J(W,"error",j),J(M,"error",j);function k(){W.removeListener("data",H),M.removeListener("drain",C),W.removeListener("end",q),W.removeListener("close",P),W.removeListener("error",j),M.removeListener("error",j),W.removeListener("end",k),W.removeListener("close",k),M.removeListener("close",k)}return W.on("end",k),W.on("close",k),M.on("close",k),M.emit("pipe",W),M};function J(M,z,W){if(typeof M.prependListener==="function")return M.prependListener(z,W);if(!M._events||!M._events[z])M.on(z,W);else if(I(M._events[z]))M._events[z].unshift(W);else M._events[z]=[W,M._events[z]]}G.exports={Stream:F,prependListener:J}}),hO=u0((Q,G)=>{var{SymbolDispose:I}=n0(),{AbortError:L,codes:T}=DU(),{isNodeStream:F,isWebStream:J,kControllerErrorFunction:M}=nU(),z=iU(),{ERR_INVALID_ARG_TYPE:W}=T,H,C=(R,q)=>{if(typeof R!=="object"||!("aborted"in R))throw new W(q,"AbortSignal",R)};G.exports.addAbortSignal=function(R,q){if(C(R,"signal"),!F(q)&&!J(q))throw new W("stream",["ReadableStream","WritableStream","Stream"],q);return G.exports.addAbortSignalNoValidate(R,q)},G.exports.addAbortSignalNoValidate=function(R,q){if(typeof R!=="object"||!("aborted"in R))return q;let P=F(q)?()=>{q.destroy(new L(void 0,{cause:R.reason}))}:()=>{q[M](new L(void 0,{cause:R.reason}))};if(R.aborted)P();else{H=H||kU().addAbortListener;let j=H(R,P);z(q,j[I])}return q}}),zJ=u0((Q,G)=>{var{StringPrototypeSlice:I,SymbolIterator:L,TypedArrayPrototypeSet:T,Uint8Array:F}=n0(),{Buffer:J}=(LU(),h0(CU)),{inspect:M}=kU();G.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(z){let W={data:z,next:null};if(this.length>0)this.tail.next=W;else this.head=W;this.tail=W,++this.length}unshift(z){let W={data:z,next:this.head};if(this.length===0)this.tail=W;this.head=W,++this.length}shift(){if(this.length===0)return;let z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z}clear(){this.head=this.tail=null,this.length=0}join(z){if(this.length===0)return"";let W=this.head,H=""+W.data;while((W=W.next)!==null)H+=z+W.data;return H}concat(z){if(this.length===0)return J.alloc(0);let W=J.allocUnsafe(z>>>0),H=this.head,C=0;while(H)T(W,H.data,C),C+=H.data.length,H=H.next;return W}consume(z,W){let H=this.head.data;if(z<H.length){let C=H.slice(0,z);return this.head.data=H.slice(z),C}if(z===H.length)return this.shift();return W?this._getString(z):this._getBuffer(z)}first(){return this.head.data}*[L](){for(let z=this.head;z;z=z.next)yield z.data}_getString(z){let W="",H=this.head,C=0;do{let R=H.data;if(z>R.length)W+=R,z-=R.length;else{if(z===R.length)if(W+=R,++C,H.next)this.head=H.next;else this.head=this.tail=null;else W+=I(R,0,z),this.head=H,H.data=I(R,z);break}++C}while((H=H.next)!==null);return this.length-=C,W}_getBuffer(z){let W=J.allocUnsafe(z),H=z,C=this.head,R=0;do{let q=C.data;if(z>q.length)T(W,q,H-z),z-=q.length;else{if(z===q.length)if(T(W,q,H-z),++R,C.next)this.head=C.next;else this.head=this.tail=null;else T(W,new F(q.buffer,q.byteOffset,z),H-z),this.head=C,C.data=q.slice(z);break}++R}while((C=C.next)!==null);return this.length-=R,W}[Symbol.for("nodejs.util.inspect.custom")](z,W){return M(this,{...W,depth:0,customInspect:!1})}}}),uO=u0((Q,G)=>{var{MathFloor:I,NumberIsInteger:L}=n0(),{validateInteger:T}=MO(),{ERR_INVALID_ARG_VALUE:F}=DU().codes,J=16384,M=16;function z(R,q,P){return R.highWaterMark!=null?R.highWaterMark:q?R[P]:null}function W(R){return R?M:J}function H(R,q){if(T(q,"value",0),R)M=q;else J=q}function C(R,q,P,j){let k=z(q,j,P);if(k!=null){if(!L(k)||k<0){let B=j?`options.${P}`:"options.highWaterMark";throw new F(B,k)}return I(k)}return W(R.objectMode)}G.exports={getHighWaterMark:C,getDefaultHighWaterMark:W,setDefaultHighWaterMark:H}}),qJ=u0((Q,G)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var I=(LU(),h0(CU)),L=I.Buffer;function T(J,M){for(var z in J)M[z]=J[z]}if(L.from&&L.alloc&&L.allocUnsafe&&L.allocUnsafeSlow)G.exports=I;else T(I,Q),Q.Buffer=F;function F(J,M,z){return L(J,M,z)}F.prototype=Object.create(L.prototype),T(L,F),F.from=function(J,M,z){if(typeof J==="number")throw TypeError("Argument must not be a number");return L(J,M,z)},F.alloc=function(J,M,z){if(typeof J!=="number")throw TypeError("Argument must be a number");var W=L(J);if(M!==void 0)if(typeof z==="string")W.fill(M,z);else W.fill(M);else W.fill(0);return W},F.allocUnsafe=function(J){if(typeof J!=="number")throw TypeError("Argument must be a number");return L(J)},F.allocUnsafeSlow=function(J){if(typeof J!=="number")throw TypeError("Argument must be a number");return I.SlowBuffer(J)}}),PJ=u0((Q)=>{var G=qJ().Buffer,I=G.isEncoding||function(v){switch(v=""+v,v&&v.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function L(v){if(!v)return"utf8";var g;while(!0)switch(v){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return v;default:if(g)return;v=(""+v).toLowerCase(),g=!0}}function T(v){var g=L(v);if(typeof g!=="string"&&(G.isEncoding===I||!I(v)))throw Error("Unknown encoding: "+v);return g||v}Q.StringDecoder=F;function F(v){this.encoding=T(v);var g;switch(this.encoding){case"utf16le":this.text=R,this.end=q,g=4;break;case"utf8":this.fillLast=W,g=4;break;case"base64":this.text=P,this.end=j,g=3;break;default:this.write=k,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=G.allocUnsafe(g)}F.prototype.write=function(v){if(v.length===0)return"";var g,f;if(this.lastNeed){if(g=this.fillLast(v),g===void 0)return"";f=this.lastNeed,this.lastNeed=0}else f=0;if(f<v.length)return g?g+this.text(v,f):this.text(v,f);return g||""},F.prototype.end=C,F.prototype.text=H,F.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function J(v){if(v<=127)return 0;else if(v>>5===6)return 2;else if(v>>4===14)return 3;else if(v>>3===30)return 4;return v>>6===2?-1:-2}function M(v,g,f){var w=g.length-1;if(w<f)return 0;var d=J(g[w]);if(d>=0){if(d>0)v.lastNeed=d-1;return d}if(--w<f||d===-2)return 0;if(d=J(g[w]),d>=0){if(d>0)v.lastNeed=d-2;return d}if(--w<f||d===-2)return 0;if(d=J(g[w]),d>=0){if(d>0)if(d===2)d=0;else v.lastNeed=d-3;return d}return 0}function z(v,g,f){if((g[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&g.length>2){if((g[2]&192)!==128)return v.lastNeed=2,"�"}}}function W(v){var g=this.lastTotal-this.lastNeed,f=z(this,v,g);if(f!==void 0)return f;if(this.lastNeed<=v.length)return v.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,g,0,v.length),this.lastNeed-=v.length}function H(v,g){var f=M(this,v,g);if(!this.lastNeed)return v.toString("utf8",g);this.lastTotal=f;var w=v.length-(f-this.lastNeed);return v.copy(this.lastChar,0,w),v.toString("utf8",g,w)}function C(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed)return g+"�";return g}function R(v,g){if((v.length-g)%2===0){var f=v.toString("utf16le",g);if(f){var w=f.charCodeAt(f.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],f.slice(0,-1)}return f}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",g,v.length-1)}function q(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed){var f=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,f)}return g}function P(v,g){var f=(v.length-g)%3;if(f===0)return v.toString("base64",g);if(this.lastNeed=3-f,this.lastTotal=3,f===1)this.lastChar[0]=v[v.length-1];else this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1];return v.toString("base64",g,v.length-f)}function j(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed)return g+this.lastChar.toString("base64",0,3-this.lastNeed);return g}function k(v){return v.toString(this.encoding)}function B(v){return v&&v.length?this.write(v):""}}),GQ=u0((Q,G)=>{var I=YO(),{PromisePrototypeThen:L,SymbolAsyncIterator:T,SymbolIterator:F}=n0(),{Buffer:J}=(LU(),h0(CU)),{ERR_INVALID_ARG_TYPE:M,ERR_STREAM_NULL_VALUES:z}=DU().codes;function W(H,C,R){let q;if(typeof C==="string"||C instanceof J)return new H({objectMode:!0,...R,read(){this.push(C),this.push(null)}});let P;if(C&&C[T])P=!0,q=C[T]();else if(C&&C[F])P=!1,q=C[F]();else throw new M("iterable",["Iterable"],C);let j=new H({objectMode:!0,highWaterMark:1,...R}),k=!1;j._read=function(){if(!k)k=!0,v()},j._destroy=function(g,f){L(B(g),()=>I.nextTick(f,g),(w)=>I.nextTick(f,w||g))};async function B(g){let f=g!==void 0&&g!==null,w=typeof q.throw==="function";if(f&&w){let{value:d,done:Y0}=await q.throw(g);if(await d,Y0)return}if(typeof q.return==="function"){let{value:d}=await q.return();await d}}async function v(){for(;;){try{let{value:g,done:f}=P?await q.next():q.next();if(f)j.push(null);else{let w=g&&typeof g.then==="function"?await g:g;if(w===null)throw k=!1,new z;else if(j.push(w))continue;else k=!1}}catch(g){j.destroy(g)}break}}return j}G.exports=W}),lO=u0((Q,G)=>{var I=YO(),{ArrayPrototypeIndexOf:L,NumberIsInteger:T,NumberIsNaN:F,NumberParseInt:J,ObjectDefineProperties:M,ObjectKeys:z,ObjectSetPrototypeOf:W,Promise:H,SafeSet:C,SymbolAsyncDispose:R,SymbolAsyncIterator:q,Symbol:P}=n0();G.exports=m,m.ReadableState=x0;var{EventEmitter:j}=(FO(),h0(HO)),{Stream:k,prependListener:B}=qZ(),{Buffer:v}=(LU(),h0(CU)),{addAbortSignal:g}=hO(),f=iU(),w=kU().debuglog("stream",(x)=>{w=x}),d=zJ(),Y0=AO(),{getHighWaterMark:G0,getDefaultHighWaterMark:J0}=uO(),{aggregateTwoErrors:u,codes:{ERR_INVALID_ARG_TYPE:O0,ERR_METHOD_NOT_IMPLEMENTED:U,ERR_OUT_OF_RANGE:X,ERR_STREAM_PUSH_AFTER_EOF:$,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Z},AbortError:Y}=DU(),{validateObject:E}=MO(),K=P("kPaused"),{StringDecoder:A}=PJ(),O=GQ();W(m.prototype,k.prototype),W(m,k);var V=()=>{},{errorOrDestroy:D}=Y0,S=1,_=2,N=4,p=8,n=16,V0=32,r=64,b=128,X0=256,t=512,i=1024,N0=2048,y=4096,h=8192,Q0=16384,s=32768,a=65536,H0=131072,c=262144;function o(x){return{enumerable:!1,get(){return(this.state&x)!==0},set(l){if(l)this.state|=x;else this.state&=~x}}}M(x0.prototype,{objectMode:o(S),ended:o(_),endEmitted:o(N),reading:o(p),constructed:o(n),sync:o(V0),needReadable:o(r),emittedReadable:o(b),readableListening:o(X0),resumeScheduled:o(t),errorEmitted:o(i),emitClose:o(N0),autoDestroy:o(y),destroyed:o(h),closed:o(Q0),closeEmitted:o(s),multiAwaitDrain:o(a),readingMore:o(H0),dataEmitted:o(c)});function x0(x,l,e){if(typeof e!=="boolean")e=l instanceof oU();if(this.state=N0|y|n|V0,x&&x.objectMode)this.state|=S;if(e&&x&&x.readableObjectMode)this.state|=S;if(this.highWaterMark=x?G0(this,x,"readableHighWaterMark",e):J0(!1),this.buffer=new d,this.length=0,this.pipes=[],this.flowing=null,this[K]=null,x&&x.emitClose===!1)this.state&=~N0;if(x&&x.autoDestroy===!1)this.state&=~y;if(this.errored=null,this.defaultEncoding=x&&x.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,x&&x.encoding)this.decoder=new A(x.encoding),this.encoding=x.encoding}function m(x){if(!(this instanceof m))return new m(x);let l=this instanceof oU();if(this._readableState=new x0(x,this,l),x){if(typeof x.read==="function")this._read=x.read;if(typeof x.destroy==="function")this._destroy=x.destroy;if(typeof x.construct==="function")this._construct=x.construct;if(x.signal&&!l)g(x.signal,this)}k.call(this,x),Y0.construct(this,()=>{if(this._readableState.needReadable)R0(this,this._readableState)})}m.prototype.destroy=Y0.destroy,m.prototype._undestroy=Y0.undestroy,m.prototype._destroy=function(x,l){l(x)},m.prototype[j.captureRejectionSymbol]=function(x){this.destroy(x)},m.prototype[R]=function(){let x;if(!this.destroyed)x=this.readableEnded?null:new Y,this.destroy(x);return new H((l,e)=>f(this,(U0)=>U0&&U0!==x?e(U0):l(null)))},m.prototype.push=function(x,l){return Z0(this,x,l,!1)},m.prototype.unshift=function(x,l){return Z0(this,x,l,!0)};function Z0(x,l,e,U0){w("readableAddChunk",l);let f0=x._readableState,E0;if((f0.state&S)===0){if(typeof l==="string"){if(e=e||f0.defaultEncoding,f0.encoding!==e)if(U0&&f0.encoding)l=v.from(l,e).toString(f0.encoding);else l=v.from(l,e),e=""}else if(l instanceof v)e="";else if(k._isUint8Array(l))l=k._uint8ArrayToBuffer(l),e="";else if(l!=null)E0=new O0("chunk",["string","Buffer","Uint8Array"],l)}if(E0)D(x,E0);else if(l===null)f0.state&=~p,I0(x,f0);else if((f0.state&S)!==0||l&&l.length>0)if(U0)if((f0.state&N)!==0)D(x,new Z);else if(f0.destroyed||f0.errored)return!1;else w0(x,f0,l,!0);else if(f0.ended)D(x,new $);else if(f0.destroyed||f0.errored)return!1;else if(f0.state&=~p,f0.decoder&&!e)if(l=f0.decoder.write(l),f0.objectMode||l.length!==0)w0(x,f0,l,!1);else R0(x,f0);else w0(x,f0,l,!1);else if(!U0)f0.state&=~p,R0(x,f0);return!f0.ended&&(f0.length<f0.highWaterMark||f0.length===0)}function w0(x,l,e,U0){if(l.flowing&&l.length===0&&!l.sync&&x.listenerCount("data")>0){if((l.state&a)!==0)l.awaitDrainWriters.clear();else l.awaitDrainWriters=null;l.dataEmitted=!0,x.emit("data",e)}else{if(l.length+=l.objectMode?1:e.length,U0)l.buffer.unshift(e);else l.buffer.push(e);if((l.state&r)!==0)C0(x)}R0(x,l)}m.prototype.isPaused=function(){let x=this._readableState;return x[K]===!0||x.flowing===!1},m.prototype.setEncoding=function(x){let l=new A(x);this._readableState.decoder=l,this._readableState.encoding=this._readableState.decoder.encoding;let e=this._readableState.buffer,U0="";for(let f0 of e)U0+=l.write(f0);if(e.clear(),U0!=="")e.push(U0);return this._readableState.length=U0.length,this};var K0=1073741824;function T0(x){if(x>K0)throw new X("size","<= 1GiB",x);else x--,x|=x>>>1,x|=x>>>2,x|=x>>>4,x|=x>>>8,x|=x>>>16,x++;return x}function t0(x,l){if(x<=0||l.length===0&&l.ended)return 0;if((l.state&S)!==0)return 1;if(F(x)){if(l.flowing&&l.length)return l.buffer.first().length;return l.length}if(x<=l.length)return x;return l.ended?l.length:0}m.prototype.read=function(x){if(w("read",x),x===void 0)x=NaN;else if(!T(x))x=J(x,10);let l=this._readableState,e=x;if(x>l.highWaterMark)l.highWaterMark=T0(x);if(x!==0)l.state&=~b;if(x===0&&l.needReadable&&((l.highWaterMark!==0?l.length>=l.highWaterMark:l.length>0)||l.ended)){if(w("read: emitReadable",l.length,l.ended),l.length===0&&l.ended)EU(this);else C0(this);return null}if(x=t0(x,l),x===0&&l.ended){if(l.length===0)EU(this);return null}let U0=(l.state&r)!==0;if(w("need readable",U0),l.length===0||l.length-x<l.highWaterMark)U0=!0,w("length less than watermark",U0);if(l.ended||l.reading||l.destroyed||l.errored||!l.constructed)U0=!1,w("reading, ended or constructing",U0);else if(U0){if(w("do read"),l.state|=p|V0,l.length===0)l.state|=r;try{this._read(l.highWaterMark)}catch(E0){D(this,E0)}if(l.state&=~V0,!l.reading)x=t0(e,l)}let f0;if(x>0)f0=M0(x,l);else f0=null;if(f0===null)l.needReadable=l.length<=l.highWaterMark,x=0;else if(l.length-=x,l.multiAwaitDrain)l.awaitDrainWriters.clear();else l.awaitDrainWriters=null;if(l.length===0){if(!l.ended)l.needReadable=!0;if(e!==x&&l.ended)EU(this)}if(f0!==null&&!l.errorEmitted&&!l.closeEmitted)l.dataEmitted=!0,this.emit("data",f0);return f0};function I0(x,l){if(w("onEofChunk"),l.ended)return;if(l.decoder){let e=l.decoder.end();if(e&&e.length)l.buffer.push(e),l.length+=l.objectMode?1:e.length}if(l.ended=!0,l.sync)C0(x);else l.needReadable=!1,l.emittedReadable=!0,r0(x)}function C0(x){let l=x._readableState;if(w("emitReadable",l.needReadable,l.emittedReadable),l.needReadable=!1,!l.emittedReadable)w("emitReadable",l.flowing),l.emittedReadable=!0,I.nextTick(r0,x)}function r0(x){let l=x._readableState;if(w("emitReadable_",l.destroyed,l.length,l.ended),!l.destroyed&&!l.errored&&(l.length||l.ended))x.emit("readable"),l.emittedReadable=!1;l.needReadable=!l.flowing&&!l.ended&&l.length<=l.highWaterMark,D0(x)}function R0(x,l){if(!l.readingMore&&l.constructed)l.readingMore=!0,I.nextTick(S0,x,l)}function S0(x,l){while(!l.reading&&!l.ended&&(l.length<l.highWaterMark||l.flowing&&l.length===0)){let e=l.length;if(w("maybeReadMore read 0"),x.read(0),e===l.length)break}l.readingMore=!1}m.prototype._read=function(x){throw new U("_read()")},m.prototype.pipe=function(x,l){let e=this,U0=this._readableState;if(U0.pipes.length===1){if(!U0.multiAwaitDrain)U0.multiAwaitDrain=!0,U0.awaitDrainWriters=new C(U0.awaitDrainWriters?[U0.awaitDrainWriters]:[])}U0.pipes.push(x),w("pipe count=%d opts=%j",U0.pipes.length,l);let f0=(!l||l.end!==!1)&&x!==I.stdout&&x!==I.stderr?L0:y0;if(U0.endEmitted)I.nextTick(f0);else e.once("end",f0);x.on("unpipe",E0);function E0(b0,l0){if(w("onunpipe"),b0===e){if(l0&&l0.hasUnpiped===!1)l0.hasUnpiped=!0,g0()}}function L0(){w("onend"),x.end()}let m0,q0=!1;function g0(){if(w("cleanup"),x.removeListener("close",s0),x.removeListener("finish",c0),m0)x.removeListener("drain",m0);if(x.removeListener("error",W0),x.removeListener("unpipe",E0),e.removeListener("end",L0),e.removeListener("end",y0),e.removeListener("data",P0),q0=!0,m0&&U0.awaitDrainWriters&&(!x._writableState||x._writableState.needDrain))m0()}function RU(){if(!q0){if(U0.pipes.length===1&&U0.pipes[0]===x)w("false write response, pause",0),U0.awaitDrainWriters=x,U0.multiAwaitDrain=!1;else if(U0.pipes.length>1&&U0.pipes.includes(x))w("false write response, pause",U0.awaitDrainWriters.size),U0.awaitDrainWriters.add(x);e.pause()}if(!m0)m0=WU(e,x),x.on("drain",m0)}e.on("data",P0);function P0(b0){w("ondata");let l0=x.write(b0);if(w("dest.write",l0),l0===!1)RU()}function W0(b0){if(w("onerror",b0),y0(),x.removeListener("error",W0),x.listenerCount("error")===0){let l0=x._writableState||x._readableState;if(l0&&!l0.errorEmitted)D(x,b0);else x.emit("error",b0)}}B(x,"error",W0);function s0(){x.removeListener("finish",c0),y0()}x.once("close",s0);function c0(){w("onfinish"),x.removeListener("close",s0),y0()}x.once("finish",c0);function y0(){w("unpipe"),e.unpipe(x)}if(x.emit("pipe",e),x.writableNeedDrain===!0)RU();else if(!U0.flowing)w("pipe resume"),e.resume();return x};function WU(x,l){return function(){let e=x._readableState;if(e.awaitDrainWriters===l)w("pipeOnDrain",1),e.awaitDrainWriters=null;else if(e.multiAwaitDrain)w("pipeOnDrain",e.awaitDrainWriters.size),e.awaitDrainWriters.delete(l);if((!e.awaitDrainWriters||e.awaitDrainWriters.size===0)&&x.listenerCount("data"))x.resume()}}m.prototype.unpipe=function(x){let l=this._readableState,e={hasUnpiped:!1};if(l.pipes.length===0)return this;if(!x){let f0=l.pipes;l.pipes=[],this.pause();for(let E0=0;E0<f0.length;E0++)f0[E0].emit("unpipe",this,{hasUnpiped:!1});return this}let U0=L(l.pipes,x);if(U0===-1)return this;if(l.pipes.splice(U0,1),l.pipes.length===0)this.pause();return x.emit("unpipe",this,e),this},m.prototype.on=function(x,l){let e=k.prototype.on.call(this,x,l),U0=this._readableState;if(x==="data"){if(U0.readableListening=this.listenerCount("readable")>0,U0.flowing!==!1)this.resume()}else if(x==="readable"){if(!U0.endEmitted&&!U0.readableListening){if(U0.readableListening=U0.needReadable=!0,U0.flowing=!1,U0.emittedReadable=!1,w("on readable",U0.length,U0.reading),U0.length)C0(this);else if(!U0.reading)I.nextTick(k0,this)}}return e},m.prototype.addListener=m.prototype.on,m.prototype.removeListener=function(x,l){let e=k.prototype.removeListener.call(this,x,l);if(x==="readable")I.nextTick(F0,this);return e},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(x){let l=k.prototype.removeAllListeners.apply(this,arguments);if(x==="readable"||x===void 0)I.nextTick(F0,this);return l};function F0(x){let l=x._readableState;if(l.readableListening=x.listenerCount("readable")>0,l.resumeScheduled&&l[K]===!1)l.flowing=!0;else if(x.listenerCount("data")>0)x.resume();else if(!l.readableListening)l.flowing=null}function k0(x){w("readable nexttick read 0"),x.read(0)}m.prototype.resume=function(){let x=this._readableState;if(!x.flowing)w("resume"),x.flowing=!x.readableListening,HU(this,x);return x[K]=!1,this};function HU(x,l){if(!l.resumeScheduled)l.resumeScheduled=!0,I.nextTick(j0,x,l)}function j0(x,l){if(w("resume",l.reading),!l.reading)x.read(0);if(l.resumeScheduled=!1,x.emit("resume"),D0(x),l.flowing&&!l.reading)x.read(0)}m.prototype.pause=function(){if(w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)w("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[K]=!0,this};function D0(x){let l=x._readableState;w("flow",l.flowing);while(l.flowing&&x.read()!==null);}m.prototype.wrap=function(x){let l=!1;x.on("data",(U0)=>{if(!this.push(U0)&&x.pause)l=!0,x.pause()}),x.on("end",()=>{this.push(null)}),x.on("error",(U0)=>{D(this,U0)}),x.on("close",()=>{this.destroy()}),x.on("destroy",()=>{this.destroy()}),this._read=()=>{if(l&&x.resume)l=!1,x.resume()};let e=z(x);for(let U0=1;U0<e.length;U0++){let f0=e[U0];if(this[f0]===void 0&&typeof x[f0]==="function")this[f0]=x[f0].bind(x)}return this},m.prototype[q]=function(){return SU(this)},m.prototype.iterator=function(x){if(x!==void 0)E(x,"options");return SU(this,x)};function SU(x,l){if(typeof x.read!=="function")x=m.wrap(x,{objectMode:!0});let e=_0(x,l);return e.stream=x,e}async function*_0(x,l){let e=V;function U0(L0){if(this===x)e(),e=V;else e=L0}x.on("readable",U0);let f0,E0=f(x,{writable:!1},(L0)=>{f0=L0?u(f0,L0):null,e(),e=V});try{while(!0){let L0=x.destroyed?null:x.read();if(L0!==null)yield L0;else if(f0)throw f0;else if(f0===null)return;else await new H(U0)}}catch(L0){throw f0=u(f0,L0),f0}finally{if((f0||(l===null||l===void 0?void 0:l.destroyOnReturn)!==!1)&&(f0===void 0||x._readableState.autoDestroy))Y0.destroyer(x,null);else x.off("readable",U0),E0()}}M(m.prototype,{readable:{__proto__:null,get(){let x=this._readableState;return!!x&&x.readable!==!1&&!x.destroyed&&!x.errorEmitted&&!x.endEmitted},set(x){if(this._readableState)this._readableState.readable=!!x}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(x){if(this._readableState)this._readableState.flowing=x}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(x){if(!this._readableState)return;this._readableState.destroyed=x}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),M(x0.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[K]!==!1},set(x){this[K]=!!x}}}),m._fromList=M0;function M0(x,l){if(l.length===0)return null;let e;if(l.objectMode)e=l.buffer.shift();else if(!x||x>=l.length){if(l.decoder)e=l.buffer.join("");else if(l.buffer.length===1)e=l.buffer.first();else e=l.buffer.concat(l.length);l.buffer.clear()}else e=l.buffer.consume(x,l.decoder);return e}function EU(x){let l=x._readableState;if(w("endReadable",l.endEmitted),!l.endEmitted)l.ended=!0,I.nextTick(v0,l,x)}function v0(x,l){if(w("endReadableNT",x.endEmitted,x.length),!x.errored&&!x.closeEmitted&&!x.endEmitted&&x.length===0){if(x.endEmitted=!0,l.emit("end"),l.writable&&l.allowHalfOpen===!1)I.nextTick(B0,l);else if(x.autoDestroy){let e=l._writableState;if(!e||e.autoDestroy&&(e.finished||e.writable===!1))l.destroy()}}}function B0(x){if(x.writable&&!x.writableEnded&&!x.destroyed)x.end()}m.from=function(x,l){return O(m,x,l)};var KU;function z0(){if(KU===void 0)KU={};return KU}m.fromWeb=function(x,l){return z0().newStreamReadableFromReadableStream(x,l)},m.toWeb=function(x,l){return z0().newReadableStreamFromStreamReadable(x,l)},m.wrap=function(x,l){var e,U0;return new m({objectMode:(e=(U0=x.readableObjectMode)!==null&&U0!==void 0?U0:x.objectMode)!==null&&e!==void 0?e:!0,...l,destroy(f0,E0){Y0.destroyer(x,f0),E0(f0)}}).wrap(x)}}),PZ=u0((Q,G)=>{var I=YO(),{ArrayPrototypeSlice:L,Error:T,FunctionPrototypeSymbolHasInstance:F,ObjectDefineProperty:J,ObjectDefineProperties:M,ObjectSetPrototypeOf:z,StringPrototypeToLowerCase:W,Symbol:H,SymbolHasInstance:C}=n0();G.exports=E,E.WritableState=Z;var{EventEmitter:R}=(FO(),h0(HO)),q=qZ().Stream,{Buffer:P}=(LU(),h0(CU)),j=AO(),{addAbortSignal:k}=hO(),{getHighWaterMark:B,getDefaultHighWaterMark:v}=uO(),{ERR_INVALID_ARG_TYPE:g,ERR_METHOD_NOT_IMPLEMENTED:f,ERR_MULTIPLE_CALLBACK:w,ERR_STREAM_CANNOT_PIPE:d,ERR_STREAM_DESTROYED:Y0,ERR_STREAM_ALREADY_FINISHED:G0,ERR_STREAM_NULL_VALUES:J0,ERR_STREAM_WRITE_AFTER_END:u,ERR_UNKNOWN_ENCODING:O0}=DU().codes,{errorOrDestroy:U}=j;z(E.prototype,q.prototype),z(E,q);function X(){}var $=H("kOnFinished");function Z(y,h,Q0){if(typeof Q0!=="boolean")Q0=h instanceof oU();if(this.objectMode=!!(y&&y.objectMode),Q0)this.objectMode=this.objectMode||!!(y&&y.writableObjectMode);this.highWaterMark=y?B(this,y,"writableHighWaterMark",Q0):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let s=!!(y&&y.decodeStrings===!1);this.decodeStrings=!s,this.defaultEncoding=y&&y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=D.bind(void 0,h),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Y(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!y||y.emitClose!==!1,this.autoDestroy=!y||y.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[$]=[]}function Y(y){y.buffered=[],y.bufferedIndex=0,y.allBuffers=!0,y.allNoop=!0}Z.prototype.getBuffer=function(){return L(this.buffered,this.bufferedIndex)},J(Z.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function E(y){let h=this instanceof oU();if(!h&&!F(E,this))return new E(y);if(this._writableState=new Z(y,this,h),y){if(typeof y.write==="function")this._write=y.write;if(typeof y.writev==="function")this._writev=y.writev;if(typeof y.destroy==="function")this._destroy=y.destroy;if(typeof y.final==="function")this._final=y.final;if(typeof y.construct==="function")this._construct=y.construct;if(y.signal)k(y.signal,this)}q.call(this,y),j.construct(this,()=>{let Q0=this._writableState;if(!Q0.writing)p(this,Q0);b(this,Q0)})}J(E,C,{__proto__:null,value:function(y){if(F(this,y))return!0;if(this!==E)return!1;return y&&y._writableState instanceof Z}}),E.prototype.pipe=function(){U(this,new d)};function K(y,h,Q0,s){let a=y._writableState;if(typeof Q0==="function")s=Q0,Q0=a.defaultEncoding;else{if(!Q0)Q0=a.defaultEncoding;else if(Q0!=="buffer"&&!P.isEncoding(Q0))throw new O0(Q0);if(typeof s!=="function")s=X}if(h===null)throw new J0;else if(!a.objectMode)if(typeof h==="string"){if(a.decodeStrings!==!1)h=P.from(h,Q0),Q0="buffer"}else if(h instanceof P)Q0="buffer";else if(q._isUint8Array(h))h=q._uint8ArrayToBuffer(h),Q0="buffer";else throw new g("chunk",["string","Buffer","Uint8Array"],h);let H0;if(a.ending)H0=new u;else if(a.destroyed)H0=new Y0("write");if(H0)return I.nextTick(s,H0),U(y,H0,!0),H0;return a.pendingcb++,A(y,a,h,Q0,s)}E.prototype.write=function(y,h,Q0){return K(this,y,h,Q0)===!0},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){let y=this._writableState;if(y.corked){if(y.corked--,!y.writing)p(this,y)}},E.prototype.setDefaultEncoding=function(y){if(typeof y==="string")y=W(y);if(!P.isEncoding(y))throw new O0(y);return this._writableState.defaultEncoding=y,this};function A(y,h,Q0,s,a){let H0=h.objectMode?1:Q0.length;h.length+=H0;let c=h.length<h.highWaterMark;if(!c)h.needDrain=!0;if(h.writing||h.corked||h.errored||!h.constructed){if(h.buffered.push({chunk:Q0,encoding:s,callback:a}),h.allBuffers&&s!=="buffer")h.allBuffers=!1;if(h.allNoop&&a!==X)h.allNoop=!1}else h.writelen=H0,h.writecb=a,h.writing=!0,h.sync=!0,y._write(Q0,s,h.onwrite),h.sync=!1;return c&&!h.errored&&!h.destroyed}function O(y,h,Q0,s,a,H0,c){if(h.writelen=s,h.writecb=c,h.writing=!0,h.sync=!0,h.destroyed)h.onwrite(new Y0("write"));else if(Q0)y._writev(a,h.onwrite);else y._write(a,H0,h.onwrite);h.sync=!1}function V(y,h,Q0,s){--h.pendingcb,s(Q0),N(h),U(y,Q0)}function D(y,h){let Q0=y._writableState,s=Q0.sync,a=Q0.writecb;if(typeof a!=="function"){U(y,new w);return}if(Q0.writing=!1,Q0.writecb=null,Q0.length-=Q0.writelen,Q0.writelen=0,h){if(h.stack,!Q0.errored)Q0.errored=h;if(y._readableState&&!y._readableState.errored)y._readableState.errored=h;if(s)I.nextTick(V,y,Q0,h,a);else V(y,Q0,h,a)}else{if(Q0.buffered.length>Q0.bufferedIndex)p(y,Q0);if(s)if(Q0.afterWriteTickInfo!==null&&Q0.afterWriteTickInfo.cb===a)Q0.afterWriteTickInfo.count++;else Q0.afterWriteTickInfo={count:1,cb:a,stream:y,state:Q0},I.nextTick(S,Q0.afterWriteTickInfo);else _(y,Q0,1,a)}}function S({stream:y,state:h,count:Q0,cb:s}){return h.afterWriteTickInfo=null,_(y,h,Q0,s)}function _(y,h,Q0,s){if(!h.ending&&!y.destroyed&&h.length===0&&h.needDrain)h.needDrain=!1,y.emit("drain");while(Q0-- >0)h.pendingcb--,s();if(h.destroyed)N(h);b(y,h)}function N(y){if(y.writing)return;for(let a=y.bufferedIndex;a<y.buffered.length;++a){var h;let{chunk:H0,callback:c}=y.buffered[a],o=y.objectMode?1:H0.length;y.length-=o,c((h=y.errored)!==null&&h!==void 0?h:new Y0("write"))}let Q0=y[$].splice(0);for(let a=0;a<Q0.length;a++){var s;Q0[a]((s=y.errored)!==null&&s!==void 0?s:new Y0("end"))}Y(y)}function p(y,h){if(h.corked||h.bufferProcessing||h.destroyed||!h.constructed)return;let{buffered:Q0,bufferedIndex:s,objectMode:a}=h,H0=Q0.length-s;if(!H0)return;let c=s;if(h.bufferProcessing=!0,H0>1&&y._writev){h.pendingcb-=H0-1;let o=h.allNoop?X:(m)=>{for(let Z0=c;Z0<Q0.length;++Z0)Q0[Z0].callback(m)},x0=h.allNoop&&c===0?Q0:L(Q0,c);x0.allBuffers=h.allBuffers,O(y,h,!0,h.length,x0,"",o),Y(h)}else{do{let{chunk:o,encoding:x0,callback:m}=Q0[c];Q0[c++]=null;let Z0=a?1:o.length;O(y,h,!1,Z0,o,x0,m)}while(c<Q0.length&&!h.writing);if(c===Q0.length)Y(h);else if(c>256)Q0.splice(0,c),h.bufferedIndex=0;else h.bufferedIndex=c}h.bufferProcessing=!1}E.prototype._write=function(y,h,Q0){if(this._writev)this._writev([{chunk:y,encoding:h}],Q0);else throw new f("_write()")},E.prototype._writev=null,E.prototype.end=function(y,h,Q0){let s=this._writableState;if(typeof y==="function")Q0=y,y=null,h=null;else if(typeof h==="function")Q0=h,h=null;let a;if(y!==null&&y!==void 0){let H0=K(this,y,h);if(H0 instanceof T)a=H0}if(s.corked)s.corked=1,this.uncork();if(a);else if(!s.errored&&!s.ending)s.ending=!0,b(this,s,!0),s.ended=!0;else if(s.finished)a=new G0("end");else if(s.destroyed)a=new Y0("end");if(typeof Q0==="function")if(a||s.finished)I.nextTick(Q0,a);else s[$].push(Q0);return this};function n(y){return y.ending&&!y.destroyed&&y.constructed&&y.length===0&&!y.errored&&y.buffered.length===0&&!y.finished&&!y.writing&&!y.errorEmitted&&!y.closeEmitted}function V0(y,h){let Q0=!1;function s(a){if(Q0){U(y,a!==null&&a!==void 0?a:w());return}if(Q0=!0,h.pendingcb--,a){let H0=h[$].splice(0);for(let c=0;c<H0.length;c++)H0[c](a);U(y,a,h.sync)}else if(n(h))h.prefinished=!0,y.emit("prefinish"),h.pendingcb++,I.nextTick(X0,y,h)}h.sync=!0,h.pendingcb++;try{y._final(s)}catch(a){s(a)}h.sync=!1}function r(y,h){if(!h.prefinished&&!h.finalCalled)if(typeof y._final==="function"&&!h.destroyed)h.finalCalled=!0,V0(y,h);else h.prefinished=!0,y.emit("prefinish")}function b(y,h,Q0){if(n(h)){if(r(y,h),h.pendingcb===0){if(Q0)h.pendingcb++,I.nextTick((s,a)=>{if(n(a))X0(s,a);else a.pendingcb--},y,h);else if(n(h))h.pendingcb++,X0(y,h)}}}function X0(y,h){h.pendingcb--,h.finished=!0;let Q0=h[$].splice(0);for(let s=0;s<Q0.length;s++)Q0[s]();if(y.emit("finish"),h.autoDestroy){let s=y._readableState;if(!s||s.autoDestroy&&(s.endEmitted||s.readable===!1))y.destroy()}}M(E.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(y){if(this._writableState)this._writableState.destroyed=y}},writable:{__proto__:null,get(){let y=this._writableState;return!!y&&y.writable!==!1&&!y.destroyed&&!y.errored&&!y.ending&&!y.ended},set(y){if(this._writableState)this._writableState.writable=!!y}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let y=this._writableState;if(!y)return!1;return!y.destroyed&&!y.ending&&y.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var t=j.destroy;E.prototype.destroy=function(y,h){let Q0=this._writableState;if(!Q0.destroyed&&(Q0.bufferedIndex<Q0.buffered.length||Q0[$].length))I.nextTick(N,Q0);return t.call(this,y,h),this},E.prototype._undestroy=j.undestroy,E.prototype._destroy=function(y,h){h(y)},E.prototype[R.captureRejectionSymbol]=function(y){this.destroy(y)};var i;function N0(){if(i===void 0)i={};return i}E.fromWeb=function(y,h){return N0().newStreamWritableFromWritableStream(y,h)},E.toWeb=function(y){return N0().newWritableStreamFromStreamWritable(y)}}),kJ=u0((Q,G)=>{var I=YO(),L=(LU(),h0(CU)),{isReadable:T,isWritable:F,isIterable:J,isNodeStream:M,isReadableNodeStream:z,isWritableNodeStream:W,isDuplexNodeStream:H,isReadableStream:C,isWritableStream:R}=nU(),q=iU(),{AbortError:P,codes:{ERR_INVALID_ARG_TYPE:j,ERR_INVALID_RETURN_VALUE:k}}=DU(),{destroyer:B}=AO(),v=oU(),g=lO(),f=PZ(),{createDeferredPromise:w}=kU(),d=GQ(),Y0=globalThis.Blob||L.Blob,G0=typeof Y0<"u"?function($){return $ instanceof Y0}:function($){return!1},J0=globalThis.AbortController||DO().AbortController,{FunctionPrototypeCall:u}=n0();class O0 extends v{constructor($){super($);if(($===null||$===void 0?void 0:$.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(($===null||$===void 0?void 0:$.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}G.exports=function $(Z,Y){if(H(Z))return Z;if(z(Z))return X({readable:Z});if(W(Z))return X({writable:Z});if(M(Z))return X({writable:!1,readable:!1});if(C(Z))return X({readable:g.fromWeb(Z)});if(R(Z))return X({writable:f.fromWeb(Z)});if(typeof Z==="function"){let{value:K,write:A,final:O,destroy:V}=U(Z);if(J(K))return d(O0,K,{objectMode:!0,write:A,final:O,destroy:V});let D=K===null||K===void 0?void 0:K.then;if(typeof D==="function"){let S,_=u(D,K,(N)=>{if(N!=null)throw new k("nully","body",N)},(N)=>{B(S,N)});return S=new O0({objectMode:!0,readable:!1,write:A,final(N){O(async()=>{try{await _,I.nextTick(N,null)}catch(p){I.nextTick(N,p)}})},destroy:V})}throw new k("Iterable, AsyncIterable or AsyncFunction",Y,K)}if(G0(Z))return $(Z.arrayBuffer());if(J(Z))return d(O0,Z,{objectMode:!0,writable:!1});if(C(Z===null||Z===void 0?void 0:Z.readable)&&R(Z===null||Z===void 0?void 0:Z.writable))return O0.fromWeb(Z);if(typeof(Z===null||Z===void 0?void 0:Z.writable)==="object"||typeof(Z===null||Z===void 0?void 0:Z.readable)==="object"){let K=Z!==null&&Z!==void 0&&Z.readable?z(Z===null||Z===void 0?void 0:Z.readable)?Z===null||Z===void 0?void 0:Z.readable:$(Z.readable):void 0,A=Z!==null&&Z!==void 0&&Z.writable?W(Z===null||Z===void 0?void 0:Z.writable)?Z===null||Z===void 0?void 0:Z.writable:$(Z.writable):void 0;return X({readable:K,writable:A})}let E=Z===null||Z===void 0?void 0:Z.then;if(typeof E==="function"){let K;return u(E,Z,(A)=>{if(A!=null)K.push(A);K.push(null)},(A)=>{B(K,A)}),K=new O0({objectMode:!0,writable:!1,read(){}})}throw new j(Y,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],Z)};function U($){let{promise:Z,resolve:Y}=w(),E=new J0,K=E.signal;return{value:$(async function*(){while(!0){let A=Z;Z=null;let{chunk:O,done:V,cb:D}=await A;if(I.nextTick(D),V)return;if(K.aborted)throw new P(void 0,{cause:K.reason});({promise:Z,resolve:Y}=w()),yield O}}(),{signal:K}),write(A,O,V){let D=Y;Y=null,D({chunk:A,done:!1,cb:V})},final(A){let O=Y;Y=null,O({done:!0,cb:A})},destroy(A,O){E.abort(),O(A)}}}function X($){let Z=$.readable&&typeof $.readable.read!=="function"?g.wrap($.readable):$.readable,Y=$.writable,E=!!T(Z),K=!!F(Y),A,O,V,D,S;function _(N){let p=D;if(D=null,p)p(N);else if(N)S.destroy(N)}if(S=new O0({readableObjectMode:!!(Z!==null&&Z!==void 0&&Z.readableObjectMode),writableObjectMode:!!(Y!==null&&Y!==void 0&&Y.writableObjectMode),readable:E,writable:K}),K)q(Y,(N)=>{if(K=!1,N)B(Z,N);_(N)}),S._write=function(N,p,n){if(Y.write(N,p))n();else A=n},S._final=function(N){Y.end(),O=N},Y.on("drain",function(){if(A){let N=A;A=null,N()}}),Y.on("finish",function(){if(O){let N=O;O=null,N()}});if(E)q(Z,(N)=>{if(E=!1,N)B(Z,N);_(N)}),Z.on("readable",function(){if(V){let N=V;V=null,N()}}),Z.on("end",function(){S.push(null)}),S._read=function(){while(!0){let N=Z.read();if(N===null){V=S._read;return}if(!S.push(N))return}};return S._destroy=function(N,p){if(!N&&D!==null)N=new P;if(V=null,A=null,O=null,D===null)p(N);else D=p,B(Y,N),B(Z,N)},S}}),oU=u0((Q,G)=>{var{ObjectDefineProperties:I,ObjectGetOwnPropertyDescriptor:L,ObjectKeys:T,ObjectSetPrototypeOf:F}=n0();G.exports=z;var J=lO(),M=PZ();F(z.prototype,J.prototype),F(z,J);{let R=T(M.prototype);for(let q=0;q<R.length;q++){let P=R[q];if(!z.prototype[P])z.prototype[P]=M.prototype[P]}}function z(R){if(!(this instanceof z))return new z(R);if(J.call(this,R),M.call(this,R),R){if(this.allowHalfOpen=R.allowHalfOpen!==!1,R.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(R.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}I(z.prototype,{writable:{__proto__:null,...L(M.prototype,"writable")},writableHighWaterMark:{__proto__:null,...L(M.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...L(M.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...L(M.prototype,"writableBuffer")},writableLength:{__proto__:null,...L(M.prototype,"writableLength")},writableFinished:{__proto__:null,...L(M.prototype,"writableFinished")},writableCorked:{__proto__:null,...L(M.prototype,"writableCorked")},writableEnded:{__proto__:null,...L(M.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...L(M.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(R){if(this._readableState&&this._writableState)this._readableState.destroyed=R,this._writableState.destroyed=R}}});var W;function H(){if(W===void 0)W={};return W}z.fromWeb=function(R,q){return H().newStreamDuplexFromReadableWritablePair(R,q)},z.toWeb=function(R){return H().newReadableWritablePairFromDuplex(R)};var C;z.from=function(R){if(!C)C=kJ();return C(R,"body")}}),AQ=u0((Q,G)=>{var{ObjectSetPrototypeOf:I,Symbol:L}=n0();G.exports=z;var{ERR_METHOD_NOT_IMPLEMENTED:T}=DU().codes,F=oU(),{getHighWaterMark:J}=uO();I(z.prototype,F.prototype),I(z,F);var M=L("kCallback");function z(C){if(!(this instanceof z))return new z(C);let R=C?J(this,C,"readableHighWaterMark",!0):null;if(R===0)C={...C,highWaterMark:null,readableHighWaterMark:R,writableHighWaterMark:C.writableHighWaterMark||0};if(F.call(this,C),this._readableState.sync=!1,this[M]=null,C){if(typeof C.transform==="function")this._transform=C.transform;if(typeof C.flush==="function")this._flush=C.flush}this.on("prefinish",H)}function W(C){if(typeof this._flush==="function"&&!this.destroyed)this._flush((R,q)=>{if(R){if(C)C(R);else this.destroy(R);return}if(q!=null)this.push(q);if(this.push(null),C)C()});else if(this.push(null),C)C()}function H(){if(this._final!==W)W.call(this)}z.prototype._final=W,z.prototype._transform=function(C,R,q){throw new T("_transform()")},z.prototype._write=function(C,R,q){let P=this._readableState,j=this._writableState,k=P.length;this._transform(C,R,(B,v)=>{if(B){q(B);return}if(v!=null)this.push(v);if(j.ended||k===P.length||P.length<P.highWaterMark)q();else this[M]=q})},z.prototype._read=function(){if(this[M]){let C=this[M];this[M]=null,C()}}}),VQ=u0((Q,G)=>{var{ObjectSetPrototypeOf:I}=n0();G.exports=T;var L=AQ();I(T.prototype,L.prototype),I(T,L);function T(F){if(!(this instanceof T))return new T(F);L.call(this,F)}T.prototype._transform=function(F,J,M){M(null,F)}}),kZ=u0((Q,G)=>{var I=YO(),{ArrayIsArray:L,Promise:T,SymbolAsyncIterator:F,SymbolDispose:J}=n0(),M=iU(),{once:z}=kU(),W=AO(),H=oU(),{aggregateTwoErrors:C,codes:{ERR_INVALID_ARG_TYPE:R,ERR_INVALID_RETURN_VALUE:q,ERR_MISSING_ARGS:P,ERR_STREAM_DESTROYED:j,ERR_STREAM_PREMATURE_CLOSE:k},AbortError:B}=DU(),{validateFunction:v,validateAbortSignal:g}=MO(),{isIterable:f,isReadable:w,isReadableNodeStream:d,isNodeStream:Y0,isTransformStream:G0,isWebStream:J0,isReadableStream:u,isReadableFinished:O0}=nU(),U=globalThis.AbortController||DO().AbortController,X,$,Z;function Y(N,p,n){let V0=!1;N.on("close",()=>{V0=!0});let r=M(N,{readable:p,writable:n},(b)=>{V0=!b});return{destroy:(b)=>{if(V0)return;V0=!0,W.destroyer(N,b||new j("pipe"))},cleanup:r}}function E(N){return v(N[N.length-1],"streams[stream.length - 1]"),N.pop()}function K(N){if(f(N))return N;else if(d(N))return A(N);throw new R("val",["Readable","Iterable","AsyncIterable"],N)}async function*A(N){if(!$)$=lO();yield*$.prototype[F].call(N)}async function O(N,p,n,{end:V0}){let r,b=null,X0=(N0)=>{if(N0)r=N0;if(b){let y=b;b=null,y()}},t=()=>new T((N0,y)=>{if(r)y(r);else b=()=>{if(r)y(r);else N0()}});p.on("drain",X0);let i=M(p,{readable:!1},X0);try{if(p.writableNeedDrain)await t();for await(let N0 of N)if(!p.write(N0))await t();if(V0)p.end(),await t();n()}catch(N0){n(r!==N0?C(r,N0):N0)}finally{i(),p.off("drain",X0)}}async function V(N,p,n,{end:V0}){if(G0(p))p=p.writable;let r=p.getWriter();try{for await(let b of N)await r.ready,r.write(b).catch(()=>{});if(await r.ready,V0)await r.close();n()}catch(b){try{await r.abort(b),n(b)}catch(X0){n(X0)}}}function D(...N){return S(N,z(E(N)))}function S(N,p,n){if(N.length===1&&L(N[0]))N=N[0];if(N.length<2)throw new P("streams");let V0=new U,r=V0.signal,b=n===null||n===void 0?void 0:n.signal,X0=[];g(b,"options.signal");function t(){a(new B)}Z=Z||kU().addAbortListener;let i;if(b)i=Z(b,t);let N0,y,h=[],Q0=0;function s(m){a(m,--Q0===0)}function a(m,Z0){var w0;if(m&&(!N0||N0.code==="ERR_STREAM_PREMATURE_CLOSE"))N0=m;if(!N0&&!Z0)return;while(h.length)h.shift()(N0);if((w0=i)===null||w0===void 0||w0[J](),V0.abort(),Z0){if(!N0)X0.forEach((K0)=>K0());I.nextTick(p,N0,y)}}let H0;for(let m=0;m<N.length;m++){let Z0=N[m],w0=m<N.length-1,K0=m>0,T0=w0||(n===null||n===void 0?void 0:n.end)!==!1,t0=m===N.length-1;if(Y0(Z0)){let I0=function(C0){if(C0&&C0.name!=="AbortError"&&C0.code!=="ERR_STREAM_PREMATURE_CLOSE")s(C0)};var c=I0;if(T0){let{destroy:C0,cleanup:r0}=Y(Z0,w0,K0);if(h.push(C0),w(Z0)&&t0)X0.push(r0)}if(Z0.on("error",I0),w(Z0)&&t0)X0.push(()=>{Z0.removeListener("error",I0)})}if(m===0)if(typeof Z0==="function"){if(H0=Z0({signal:r}),!f(H0))throw new q("Iterable, AsyncIterable or Stream","source",H0)}else if(f(Z0)||d(Z0)||G0(Z0))H0=Z0;else H0=H.from(Z0);else if(typeof Z0==="function"){if(G0(H0)){var o;H0=K((o=H0)===null||o===void 0?void 0:o.readable)}else H0=K(H0);if(H0=Z0(H0,{signal:r}),w0){if(!f(H0,!0))throw new q("AsyncIterable",`transform[${m-1}]`,H0)}else{var x0;if(!X)X=VQ();let I0=new X({objectMode:!0}),C0=(x0=H0)===null||x0===void 0?void 0:x0.then;if(typeof C0==="function")Q0++,C0.call(H0,(S0)=>{if(y=S0,S0!=null)I0.write(S0);if(T0)I0.end();I.nextTick(s)},(S0)=>{I0.destroy(S0),I.nextTick(s,S0)});else if(f(H0,!0))Q0++,O(H0,I0,s,{end:T0});else if(u(H0)||G0(H0)){let S0=H0.readable||H0;Q0++,O(S0,I0,s,{end:T0})}else throw new q("AsyncIterable or Promise","destination",H0);H0=I0;let{destroy:r0,cleanup:R0}=Y(H0,!1,!0);if(h.push(r0),t0)X0.push(R0)}}else if(Y0(Z0)){if(d(H0)){Q0+=2;let I0=_(H0,Z0,s,{end:T0});if(w(Z0)&&t0)X0.push(I0)}else if(G0(H0)||u(H0)){let I0=H0.readable||H0;Q0++,O(I0,Z0,s,{end:T0})}else if(f(H0))Q0++,O(H0,Z0,s,{end:T0});else throw new R("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],H0);H0=Z0}else if(J0(Z0)){if(d(H0))Q0++,V(K(H0),Z0,s,{end:T0});else if(u(H0)||f(H0))Q0++,V(H0,Z0,s,{end:T0});else if(G0(H0))Q0++,V(H0.readable,Z0,s,{end:T0});else throw new R("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],H0);H0=Z0}else H0=H.from(Z0)}if(r!==null&&r!==void 0&&r.aborted||b!==null&&b!==void 0&&b.aborted)I.nextTick(t);return H0}function _(N,p,n,{end:V0}){let r=!1;if(p.on("close",()=>{if(!r)n(new k)}),N.pipe(p,{end:!1}),V0){let X0=function(){r=!0,p.end()};var b=X0;if(O0(N))I.nextTick(X0);else N.once("end",X0)}else n();return M(N,{readable:!0,writable:!1},(X0)=>{let t=N._readableState;if(X0&&X0.code==="ERR_STREAM_PREMATURE_CLOSE"&&t&&t.ended&&!t.errored&&!t.errorEmitted)N.once("end",n).once("error",n);else n(X0)}),M(p,{readable:!1,writable:!0},n)}G.exports={pipelineImpl:S,pipeline:D}}),IQ=u0((Q,G)=>{var{pipeline:I}=kZ(),L=oU(),{destroyer:T}=AO(),{isNodeStream:F,isReadable:J,isWritable:M,isWebStream:z,isTransformStream:W,isWritableStream:H,isReadableStream:C}=nU(),{AbortError:R,codes:{ERR_INVALID_ARG_VALUE:q,ERR_MISSING_ARGS:P}}=DU(),j=iU();G.exports=function(...k){if(k.length===0)throw new P("streams");if(k.length===1)return L.from(k[0]);let B=[...k];if(typeof k[0]==="function")k[0]=L.from(k[0]);if(typeof k[k.length-1]==="function"){let U=k.length-1;k[U]=L.from(k[U])}for(let U=0;U<k.length;++U){if(!F(k[U])&&!z(k[U]))continue;if(U<k.length-1&&!(J(k[U])||C(k[U])||W(k[U])))throw new q(`streams[${U}]`,B[U],"must be readable");if(U>0&&!(M(k[U])||H(k[U])||W(k[U])))throw new q(`streams[${U}]`,B[U],"must be writable")}let v,g,f,w,d;function Y0(U){let X=w;if(w=null,X)X(U);else if(U)d.destroy(U);else if(!O0&&!u)d.destroy()}let G0=k[0],J0=I(k,Y0),u=!!(M(G0)||H(G0)||W(G0)),O0=!!(J(J0)||C(J0)||W(J0));if(d=new L({writableObjectMode:!!(G0!==null&&G0!==void 0&&G0.writableObjectMode),readableObjectMode:!!(J0!==null&&J0!==void 0&&J0.readableObjectMode),writable:u,readable:O0}),u){if(F(G0))d._write=function(X,$,Z){if(G0.write(X,$))Z();else v=Z},d._final=function(X){G0.end(),g=X},G0.on("drain",function(){if(v){let X=v;v=null,X()}});else if(z(G0)){let X=(W(G0)?G0.writable:G0).getWriter();d._write=async function($,Z,Y){try{await X.ready,X.write($).catch(()=>{}),Y()}catch(E){Y(E)}},d._final=async function($){try{await X.ready,X.close().catch(()=>{}),g=$}catch(Z){$(Z)}}}let U=W(J0)?J0.readable:J0;j(U,()=>{if(g){let X=g;g=null,X()}})}if(O0){if(F(J0))J0.on("readable",function(){if(f){let U=f;f=null,U()}}),J0.on("end",function(){d.push(null)}),d._read=function(){while(!0){let U=J0.read();if(U===null){f=d._read;return}if(!d.push(U))return}};else if(z(J0)){let U=(W(J0)?J0.readable:J0).getReader();d._read=async function(){while(!0)try{let{value:X,done:$}=await U.read();if(!d.push(X))return;if($){d.push(null);return}}catch{return}}}}return d._destroy=function(U,X){if(!U&&w!==null)U=new R;if(f=null,v=null,g=null,w===null)X(U);else if(w=X,F(J0))T(J0,U)},d}}),jJ=u0((Q,G)=>{var I=globalThis.AbortController||DO().AbortController,{codes:{ERR_INVALID_ARG_VALUE:L,ERR_INVALID_ARG_TYPE:T,ERR_MISSING_ARGS:F,ERR_OUT_OF_RANGE:J},AbortError:M}=DU(),{validateAbortSignal:z,validateInteger:W,validateObject:H}=MO(),C=n0().Symbol("kWeak"),R=n0().Symbol("kResistStopPropagation"),{finished:q}=iU(),P=IQ(),{addAbortSignalNoValidate:j}=hO(),{isWritable:k,isNodeStream:B}=nU(),{deprecate:v}=kU(),{ArrayPrototypePush:g,Boolean:f,MathFloor:w,Number:d,NumberIsNaN:Y0,Promise:G0,PromiseReject:J0,PromiseResolve:u,PromisePrototypeThen:O0,Symbol:U}=n0(),X=U("kEmpty"),$=U("kEof");function Z(b,X0){if(X0!=null)H(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)z(X0.signal,"options.signal");if(B(b)&&!k(b))throw new L("stream",b,"must be writable");let t=P(this,b);if(X0!==null&&X0!==void 0&&X0.signal)j(X0.signal,t);return t}function Y(b,X0){if(typeof b!=="function")throw new T("fn",["Function","AsyncFunction"],b);if(X0!=null)H(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)z(X0.signal,"options.signal");let t=1;if((X0===null||X0===void 0?void 0:X0.concurrency)!=null)t=w(X0.concurrency);let i=t-1;if((X0===null||X0===void 0?void 0:X0.highWaterMark)!=null)i=w(X0.highWaterMark);return W(t,"options.concurrency",1),W(i,"options.highWaterMark",0),i+=t,async function*(){let N0=kU().AbortSignalAny([X0===null||X0===void 0?void 0:X0.signal].filter(f)),y=this,h=[],Q0={signal:N0},s,a,H0=!1,c=0;function o(){H0=!0,x0()}function x0(){c-=1,m()}function m(){if(a&&!H0&&c<t&&h.length<i)a(),a=null}async function Z0(){try{for await(let w0 of y){if(H0)return;if(N0.aborted)throw new M;try{if(w0=b(w0,Q0),w0===X)continue;w0=u(w0)}catch(K0){w0=J0(K0)}if(c+=1,O0(w0,x0,o),h.push(w0),s)s(),s=null;if(!H0&&(h.length>=i||c>=t))await new G0((K0)=>{a=K0})}h.push($)}catch(w0){let K0=J0(w0);O0(K0,x0,o),h.push(K0)}finally{if(H0=!0,s)s(),s=null}}Z0();try{while(!0){while(h.length>0){let w0=await h[0];if(w0===$)return;if(N0.aborted)throw new M;if(w0!==X)yield w0;h.shift(),m()}await new G0((w0)=>{s=w0})}}finally{if(H0=!0,a)a(),a=null}}.call(this)}function E(b=void 0){if(b!=null)H(b,"options");if((b===null||b===void 0?void 0:b.signal)!=null)z(b.signal,"options.signal");return async function*(){let X0=0;for await(let i of this){var t;if(b!==null&&b!==void 0&&(t=b.signal)!==null&&t!==void 0&&t.aborted)throw new M({cause:b.signal.reason});yield[X0++,i]}}.call(this)}async function K(b,X0=void 0){for await(let t of D.call(this,b,X0))return!0;return!1}async function A(b,X0=void 0){if(typeof b!=="function")throw new T("fn",["Function","AsyncFunction"],b);return!await K.call(this,async(...t)=>{return!await b(...t)},X0)}async function O(b,X0){for await(let t of D.call(this,b,X0))return t;return}async function V(b,X0){if(typeof b!=="function")throw new T("fn",["Function","AsyncFunction"],b);async function t(i,N0){return await b(i,N0),X}for await(let i of Y.call(this,t,X0));}function D(b,X0){if(typeof b!=="function")throw new T("fn",["Function","AsyncFunction"],b);async function t(i,N0){if(await b(i,N0))return i;return X}return Y.call(this,t,X0)}class S extends F{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function _(b,X0,t){var i;if(typeof b!=="function")throw new T("reducer",["Function","AsyncFunction"],b);if(t!=null)H(t,"options");if((t===null||t===void 0?void 0:t.signal)!=null)z(t.signal,"options.signal");let N0=arguments.length>1;if(t!==null&&t!==void 0&&(i=t.signal)!==null&&i!==void 0&&i.aborted){let a=new M(void 0,{cause:t.signal.reason});throw this.once("error",()=>{}),await q(this.destroy(a)),a}let y=new I,h=y.signal;if(t!==null&&t!==void 0&&t.signal){let a={once:!0,[C]:this,[R]:!0};t.signal.addEventListener("abort",()=>y.abort(),a)}let Q0=!1;try{for await(let a of this){var s;if(Q0=!0,t!==null&&t!==void 0&&(s=t.signal)!==null&&s!==void 0&&s.aborted)throw new M;if(!N0)X0=a,N0=!0;else X0=await b(X0,a,{signal:h})}if(!Q0&&!N0)throw new S}finally{y.abort()}return X0}async function N(b){if(b!=null)H(b,"options");if((b===null||b===void 0?void 0:b.signal)!=null)z(b.signal,"options.signal");let X0=[];for await(let i of this){var t;if(b!==null&&b!==void 0&&(t=b.signal)!==null&&t!==void 0&&t.aborted)throw new M(void 0,{cause:b.signal.reason});g(X0,i)}return X0}function p(b,X0){let t=Y.call(this,b,X0);return async function*(){for await(let i of t)yield*i}.call(this)}function n(b){if(b=d(b),Y0(b))return 0;if(b<0)throw new J("number",">= 0",b);return b}function V0(b,X0=void 0){if(X0!=null)H(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)z(X0.signal,"options.signal");return b=n(b),async function*(){var t;if(X0!==null&&X0!==void 0&&(t=X0.signal)!==null&&t!==void 0&&t.aborted)throw new M;for await(let N0 of this){var i;if(X0!==null&&X0!==void 0&&(i=X0.signal)!==null&&i!==void 0&&i.aborted)throw new M;if(b--<=0)yield N0}}.call(this)}function r(b,X0=void 0){if(X0!=null)H(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)z(X0.signal,"options.signal");return b=n(b),async function*(){var t;if(X0!==null&&X0!==void 0&&(t=X0.signal)!==null&&t!==void 0&&t.aborted)throw new M;for await(let N0 of this){var i;if(X0!==null&&X0!==void 0&&(i=X0.signal)!==null&&i!==void 0&&i.aborted)throw new M;if(b-- >0)yield N0;if(b<=0)return}}.call(this)}G.exports.streamReturningOperators={asIndexedPairs:v(E,"readable.asIndexedPairs will be removed in a future version."),drop:V0,filter:D,flatMap:p,map:Y,take:r,compose:Z},G.exports.promiseReturningOperators={every:A,forEach:V,reduce:_,toArray:N,some:K,find:O}}),EQ=u0((Q,G)=>{var{ArrayPrototypePop:I,Promise:L}=n0(),{isIterable:T,isNodeStream:F,isWebStream:J}=nU(),{pipelineImpl:M}=kZ(),{finished:z}=iU();KQ();function W(...H){return new L((C,R)=>{let q,P,j=H[H.length-1];if(j&&typeof j==="object"&&!F(j)&&!T(j)&&!J(j)){let k=I(H);q=k.signal,P=k.end}M(H,(k,B)=>{if(k)R(k);else C(B)},{signal:q,end:P})})}G.exports={finished:z,pipeline:W}}),KQ=u0((Q,G)=>{var{Buffer:I}=(LU(),h0(CU)),{ObjectDefineProperty:L,ObjectKeys:T,ReflectApply:F}=n0(),{promisify:{custom:J}}=kU(),{streamReturningOperators:M,promiseReturningOperators:z}=jJ(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:W}}=DU(),H=IQ(),{setDefaultHighWaterMark:C,getDefaultHighWaterMark:R}=uO(),{pipeline:q}=kZ(),{destroyer:P}=AO(),j=iU(),k=EQ(),B=nU(),v=G.exports=qZ().Stream;v.isDestroyed=B.isDestroyed,v.isDisturbed=B.isDisturbed,v.isErrored=B.isErrored,v.isReadable=B.isReadable,v.isWritable=B.isWritable,v.Readable=lO();for(let f of T(M)){let w=function(...Y0){if(new.target)throw W();return v.Readable.from(F(d,this,Y0))},d=M[f];L(w,"name",{__proto__:null,value:d.name}),L(w,"length",{__proto__:null,value:d.length}),L(v.Readable.prototype,f,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}for(let f of T(z)){let w=function(...Y0){if(new.target)throw W();return F(d,this,Y0)},d=z[f];L(w,"name",{__proto__:null,value:d.name}),L(w,"length",{__proto__:null,value:d.length}),L(v.Readable.prototype,f,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}v.Writable=PZ(),v.Duplex=oU(),v.Transform=AQ(),v.PassThrough=VQ(),v.pipeline=q;var{addAbortSignal:g}=hO();v.addAbortSignal=g,v.finished=j,v.destroy=P,v.compose=H,v.setDefaultHighWaterMark=C,v.getDefaultHighWaterMark=R,L(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return k}}),L(q,J,{__proto__:null,enumerable:!0,get(){return k.pipeline}}),L(j,J,{__proto__:null,enumerable:!0,get(){return k.finished}}),v.Stream=v,v._isUint8Array=function(f){return f instanceof Uint8Array},v._uint8ArrayToBuffer=function(f){return I.from(f.buffer,f.byteOffset,f.byteLength)}}),_J=u0((Q,G)=>{var I=bO();{let L=KQ(),T=EQ(),F=L.Readable.destroy;G.exports=L.Readable,G.exports._uint8ArrayToBuffer=L._uint8ArrayToBuffer,G.exports._isUint8Array=L._isUint8Array,G.exports.isDisturbed=L.isDisturbed,G.exports.isErrored=L.isErrored,G.exports.isReadable=L.isReadable,G.exports.Readable=L.Readable,G.exports.Writable=L.Writable,G.exports.Duplex=L.Duplex,G.exports.Transform=L.Transform,G.exports.PassThrough=L.PassThrough,G.exports.addAbortSignal=L.addAbortSignal,G.exports.finished=L.finished,G.exports.destroy=L.destroy,G.exports.destroy=F,G.exports.pipeline=L.pipeline,G.exports.compose=L.compose,Object.defineProperty(L,"promises",{configurable:!0,enumerable:!0,get(){return T}}),G.exports.Stream=L.Stream}G.exports.default=G.exports});TQ.exports=_J()});var yZ={};TO(yZ,{uptime:()=>bJ,type:()=>tJ,totalmem:()=>oJ,tmpdir:()=>DQ,tmpDir:()=>aJ,release:()=>mJ,platform:()=>eJ,networkInterfaces:()=>sJ,loadavg:()=>lJ,hostname:()=>uJ,homedir:()=>U$,getNetworkInterfaces:()=>FQ,freemem:()=>dJ,endianness:()=>hJ,cpus:()=>nJ,arch:()=>rJ,EOL:()=>iJ});var hJ=function(){return"LE"},uJ=function(){if(typeof location<"u")return location.hostname;else return""},lJ=function(){return[]},bJ=function(){return 0},dJ=function(){return Number.MAX_VALUE},oJ=function(){return Number.MAX_VALUE},nJ=function(){return[]},tJ=function(){return"Browser"},mJ=function(){if(typeof navigator<"u")return navigator.appVersion;return""},FQ=function(){return{}},sJ,rJ=function(){return"javascript"},eJ=function(){return"browser"},DQ=function(){return"/tmp"},aJ,iJ=`
|
|
3
|
-
`,
|
|
4
|
-
`)>-1)if(
|
|
5
|
-
`).map(function(
|
|
6
|
-
`).slice(2);else
|
|
7
|
-
`+
|
|
8
|
-
`).map(function(
|
|
9
|
-
`)}else
|
|
10
|
-
`)>=0)L++;return
|
|
11
|
-
`)+" "
|
|
12
|
-
`)+" "+I[1];return I[0]+G+" "+Q.join(", ")+" "+I[1]}function MQ(Q){return Array.isArray(Q)}function dZ(Q){return typeof Q==="boolean"}function aO(Q){return Q===null}function I$(Q){return Q==null}function zQ(Q){return typeof Q==="number"}function iO(Q){return typeof Q==="string"}function E$(Q){return typeof Q==="symbol"}function IO(Q){return Q===void 0}function mO(Q){return EO(Q)&&oZ(Q)==="[object RegExp]"}function EO(Q){return typeof Q==="object"&&Q!==null}function lZ(Q){return EO(Q)&&oZ(Q)==="[object Date]"}function sO(Q){return EO(Q)&&(oZ(Q)==="[object Error]"||Q instanceof Error)}function rO(Q){return typeof Q==="function"}function K$(Q){return Q===null||typeof Q==="boolean"||typeof Q==="number"||typeof Q==="string"||typeof Q==="symbol"||typeof Q>"u"}function T$(Q){return Q instanceof Buffer}function oZ(Q){return Object.prototype.toString.call(Q)}function hZ(Q){return Q<10?"0"+Q.toString(10):Q.toString(10)}function L$(){var Q=new Date,G=[hZ(Q.getHours()),hZ(Q.getMinutes()),hZ(Q.getSeconds())].join(":");return[Q.getDate(),C$[Q.getMonth()],G].join(" ")}function qQ(...Q){console.log("%s - %s",L$(),bZ.apply(null,Q))}function PQ(Q,G){if(G)Q.super_=G,Q.prototype=Object.create(G.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}})}function nZ(Q,G){if(!G||!EO(G))return Q;var I=Object.keys(G),L=I.length;while(L--)Q[I[L]]=G[I[L]];return Q}function kQ(Q,G){return Object.prototype.hasOwnProperty.call(Q,G)}function tZ(Q,G){if(!Q){var I=Error("Promise was rejected with a falsy value");I.reason=Q,Q=I}return G(Q)}function _Q(Q){if(typeof Q!=="function")throw TypeError('The "original" argument must be of type Function');function G(...I){var L=I.pop();if(typeof L!=="function")throw TypeError("The last argument must be of type Function");var T=this,F=function(...J){return L.apply(T,...J)};Q.apply(this,I).then(function(J){process.nextTick(F.bind(null,null,J))},function(J){process.nextTick(tZ.bind(null,J,F))})}return Object.setPrototypeOf(G,Object.getPrototypeOf(Q)),Object.defineProperties(G,Object.getOwnPropertyDescriptors(Q)),G}var O$,X$,JO,V$=()=>{},C$,jQ,vQ,BQ,S$;var xQ=CO(()=>{O$=/%[sdj%]/g;X$=((Q={},G={},I)=>((I=typeof process<"u"&&!1)&&(I=I.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),G=new RegExp("^"+I+"$","i"),(L)=>{if(L=L.toUpperCase(),!Q[L])if(G.test(L))Q[L]=function(...T){console.error("%s: %s",L,pid,bZ.apply(null,...T))};else Q[L]=function(){};return Q[L]}))(),JO=((Q)=>(Q.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]},Q.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},Q.custom=Symbol.for("nodejs.util.inspect.custom"),Q))(function(Q,G,...I){var L={seen:[],stylize:Y$};if(I.length>=1)L.depth=I[0];if(I.length>=2)L.colors=I[1];if(dZ(G))L.showHidden=G;else if(G)nZ(L,G);if(IO(L.showHidden))L.showHidden=!1;if(IO(L.depth))L.depth=2;if(IO(L.colors))L.colors=!1;if(L.colors)L.stylize=Q$;return eO(L,Q,L.depth)});C$=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];jQ=((Q)=>(Q.custom=Symbol.for("nodejs.util.promisify.custom"),Q))(function(Q){if(typeof Q!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&Q[kCustomPromisifiedSymbol]){var G=Q[kCustomPromisifiedSymbol];if(typeof G!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(G,kCustomPromisifiedSymbol,{value:G,enumerable:!1,writable:!1,configurable:!0}),G}function G(...I){var L,T,F=new Promise(function(J,M){L=J,T=M});I.push(function(J,M){if(J)T(J);else L(M)});try{Q.apply(this,I)}catch(J){T(J)}return F}if(Object.setPrototypeOf(G,Object.getPrototypeOf(Q)),kCustomPromisifiedSymbol)Object.defineProperty(G,kCustomPromisifiedSymbol,{value:G,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(G,Object.getOwnPropertyDescriptors(Q))});({TextEncoder:vQ,TextDecoder:BQ}=globalThis),S$={TextEncoder:vQ,TextDecoder:BQ,promisify:jQ,log:qQ,inherits:PQ,_extend:nZ,callbackifyOnRejected:tZ,callbackify:_Q}});var jU={};TO(jU,{webcrypto:()=>dA,rng:()=>ZA,randomUUID:()=>uA,randomFillSync:()=>wA,randomFill:()=>fA,randomBytes:()=>XA,publicEncrypt:()=>BA,publicDecrypt:()=>xA,pseudoRandomBytes:()=>OA,prng:()=>UA,privateEncrypt:()=>gA,privateDecrypt:()=>NA,pbkdf2Sync:()=>VA,pbkdf2:()=>AA,listCiphers:()=>HA,getRandomValues:()=>hA,getHashes:()=>GA,getDiffieHellman:()=>MA,getCurves:()=>bA,getCiphers:()=>WA,default:()=>oA,createVerify:()=>jA,createSign:()=>PA,createHmac:()=>$A,createHash:()=>YA,createECDH:()=>vA,createDiffieHellmanGroup:()=>DA,createDiffieHellman:()=>zA,createDecipheriv:()=>RA,createDecipher:()=>LA,createCredentials:()=>yA,createCipheriv:()=>TA,createCipher:()=>EA,constants:()=>cA,Verify:()=>_A,Sign:()=>kA,Hmac:()=>JA,Hash:()=>QA,DiffieHellmanGroup:()=>FA,DiffieHellman:()=>qA,Decipheriv:()=>SA,Decipher:()=>CA,DEFAULT_ENCODING:()=>pA,Cipheriv:()=>KA,Cipher:()=>IA});function bA(){return lA}var R$,W$,NQ,H$,F$,D$=(Q,G,I)=>{I=Q!=null?R$(W$(Q)):{};let L=G||!Q||!Q.__esModule?NQ(I,"default",{value:Q,enumerable:!0}):I;for(let T of H$(Q))if(!F$.call(L,T))NQ(L,T,{get:()=>Q[T],enumerable:!0});return L},$0=(Q,G)=>()=>(G||Q((G={exports:{}}).exports,G),G.exports),UZ,OZ,wQ,M$,sZ,rZ,MU,z$,qO,yQ,q$,P$,k$,j$,cQ,_$,v$,B$,g$,x$,N$,f$,w$,y$,c$,PO,ZZ,pQ,p$,hQ,uQ,h$,kO,eZ,aZ,u$,lQ,iZ,l$,bQ,b$,dQ,oQ,d$,o$,n$,t$,m$,s$,r$,e$,a$,i$,UG,OG,ZG,XG,UX,nQ,QG,tQ,YG,JG,$G,GG,tU,UO,mQ,fU,sQ,XZ,AG,BU,VG,IG,EG,rQ,lU,jO,eQ,KG,aQ,TG,iQ,CG,LG,SG,RG,OX,WG,ZX,HG,FG,DG,MG,zG,qG,PG,kG,jG,_G,vG,BG,gG,xG,fQ,NG,zO,fG,UY,OY,wG,yG,ZY,cG,pG,_O,hG,uG,lG,bG,dG,oG,XY,nG,QY,YY,JY,XX,$Y,tG,GY,mG,sG,mZ,rG,eG,aG,iG,p0,UA,OA,ZA,XA,QA,YA,JA,$A,GA,AA,VA,IA,EA,KA,TA,CA,LA,SA,RA,WA,HA,FA,DA,MA,zA,qA,PA,kA,jA,_A,vA,BA,gA,xA,NA,fA,wA,yA,cA,pA="buffer",hA=(Q)=>{return crypto.getRandomValues(Q)},uA=()=>{return crypto.randomUUID()},lA,dA,oA;var _U=CO(()=>{R$=Object.create,{getPrototypeOf:W$,defineProperty:NQ,getOwnPropertyNames:H$}=Object,F$=Object.prototype.hasOwnProperty,UZ=$0((Q,G)=>{G.exports=(_U(),h0(jU)).randomBytes}),OZ=$0((Q,G)=>{G.exports=(_U(),h0(jU)).createHash}),wQ=$0((Q,G)=>{G.exports=(_U(),h0(jU)).createHmac}),M$=$0((Q,G)=>{G.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}}),sZ=$0((Q,G)=>{var I=isFinite,L=Math.pow(2,30)-1;G.exports=function(T,F){if(typeof T!=="number")throw TypeError("Iterations not a number");if(T<0||!I(T))throw TypeError("Bad iterations");if(typeof F!=="number")throw TypeError("Key length not a number");if(F<0||F>L||F!==F)throw TypeError("Bad key length")}}),rZ=$0((Q,G)=>{var I;if(globalThis.process&&globalThis.process.browser)I="utf-8";else if(globalThis.process&&globalThis.process.version)L=parseInt(process.version.split(".")[0].slice(1),10),I=L>=6?"utf-8":"binary";else I="utf-8";var L;G.exports=I}),MU=$0((Q,G)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var I=(LU(),h0(CU)),L=I.Buffer;function T(J,M){for(var z in J)M[z]=J[z]}if(L.from&&L.alloc&&L.allocUnsafe&&L.allocUnsafeSlow)G.exports=I;else T(I,Q),Q.Buffer=F;function F(J,M,z){return L(J,M,z)}F.prototype=Object.create(L.prototype),T(L,F),F.from=function(J,M,z){if(typeof J==="number")throw TypeError("Argument must not be a number");return L(J,M,z)},F.alloc=function(J,M,z){if(typeof J!=="number")throw TypeError("Argument must be a number");var W=L(J);if(M!==void 0)if(typeof z==="string")W.fill(M,z);else W.fill(M);else W.fill(0);return W},F.allocUnsafe=function(J){if(typeof J!=="number")throw TypeError("Argument must be a number");return L(J)},F.allocUnsafeSlow=function(J){if(typeof J!=="number")throw TypeError("Argument must be a number");return I.SlowBuffer(J)}}),z$=$0((Q,G)=>{var I={}.toString;G.exports=Array.isArray||function(L){return I.call(L)=="[object Array]"}}),qO=$0((Q,G)=>{G.exports=TypeError}),yQ=$0((Q,G)=>{G.exports=Object}),q$=$0((Q,G)=>{G.exports=Error}),P$=$0((Q,G)=>{G.exports=EvalError}),k$=$0((Q,G)=>{G.exports=RangeError}),j$=$0((Q,G)=>{G.exports=ReferenceError}),cQ=$0((Q,G)=>{G.exports=SyntaxError}),_$=$0((Q,G)=>{G.exports=URIError}),v$=$0((Q,G)=>{G.exports=Math.abs}),B$=$0((Q,G)=>{G.exports=Math.floor}),g$=$0((Q,G)=>{G.exports=Math.max}),x$=$0((Q,G)=>{G.exports=Math.min}),N$=$0((Q,G)=>{G.exports=Math.pow}),f$=$0((Q,G)=>{G.exports=Math.round}),w$=$0((Q,G)=>{G.exports=Number.isNaN||function(I){return I!==I}}),y$=$0((Q,G)=>{var I=w$();G.exports=function(L){if(I(L)||L===0)return L;return L<0?-1:1}}),c$=$0((Q,G)=>{G.exports=Object.getOwnPropertyDescriptor}),PO=$0((Q,G)=>{var I=c$();if(I)try{I([],"length")}catch(L){I=null}G.exports=I}),ZZ=$0((Q,G)=>{var I=Object.defineProperty||!1;if(I)try{I({},"a",{value:1})}catch(L){I=!1}G.exports=I}),pQ=$0((Q,G)=>{G.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var I={},L=Symbol("test"),T=Object(L);if(typeof L==="string")return!1;if(Object.prototype.toString.call(L)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(T)!=="[object Symbol]")return!1;var F=42;I[L]=F;for(var J in I)return!1;if(typeof Object.keys==="function"&&Object.keys(I).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(I).length!==0)return!1;var M=Object.getOwnPropertySymbols(I);if(M.length!==1||M[0]!==L)return!1;if(!Object.prototype.propertyIsEnumerable.call(I,L))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var z=Object.getOwnPropertyDescriptor(I,L);if(z.value!==F||z.enumerable!==!0)return!1}return!0}}),p$=$0((Q,G)=>{var I=typeof Symbol<"u"&&Symbol,L=pQ();G.exports=function(){if(typeof I!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof I("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return L()}}),hQ=$0((Q,G)=>{G.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),uQ=$0((Q,G)=>{var I=yQ();G.exports=I.getPrototypeOf||null}),h$=$0((Q,G)=>{var I="Function.prototype.bind called on incompatible ",L=Object.prototype.toString,T=Math.max,F="[object Function]",J=function(W,H){var C=[];for(var R=0;R<W.length;R+=1)C[R]=W[R];for(var q=0;q<H.length;q+=1)C[q+W.length]=H[q];return C},M=function(W,H){var C=[];for(var R=H||0,q=0;R<W.length;R+=1,q+=1)C[q]=W[R];return C},z=function(W,H){var C="";for(var R=0;R<W.length;R+=1)if(C+=W[R],R+1<W.length)C+=H;return C};G.exports=function(W){var H=this;if(typeof H!=="function"||L.apply(H)!==F)throw TypeError(I+H);var C=M(arguments,1),R,q=function(){if(this instanceof R){var v=H.apply(this,J(C,arguments));if(Object(v)===v)return v;return this}return H.apply(W,J(C,arguments))},P=T(0,H.length-C.length),j=[];for(var k=0;k<P;k++)j[k]="$"+k;if(R=Function("binder","return function ("+z(j,",")+"){ return binder.apply(this,arguments); }")(q),H.prototype){var B=function(){};B.prototype=H.prototype,R.prototype=new B,B.prototype=null}return R}}),kO=$0((Q,G)=>{var I=h$();G.exports=Function.prototype.bind||I}),eZ=$0((Q,G)=>{G.exports=Function.prototype.call}),aZ=$0((Q,G)=>{G.exports=Function.prototype.apply}),u$=$0((Q,G)=>{G.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),lQ=$0((Q,G)=>{var I=kO(),L=aZ(),T=eZ(),F=u$();G.exports=F||I.call(T,L)}),iZ=$0((Q,G)=>{var I=kO(),L=qO(),T=eZ(),F=lQ();G.exports=function(J){if(J.length<1||typeof J[0]!=="function")throw new L("a function is required");return F(I,T,J)}}),l$=$0((Q,G)=>{var I=iZ(),L=PO(),T;try{T=[].__proto__===Array.prototype}catch(z){if(!z||typeof z!=="object"||!("code"in z)||z.code!=="ERR_PROTO_ACCESS")throw z}var F=!!T&&L&&L(Object.prototype,"__proto__"),J=Object,M=J.getPrototypeOf;G.exports=F&&typeof F.get==="function"?I([F.get]):typeof M==="function"?function(z){return M(z==null?z:J(z))}:!1}),bQ=$0((Q,G)=>{var I=hQ(),L=uQ(),T=l$();G.exports=I?function(F){return I(F)}:L?function(F){if(!F||typeof F!=="object"&&typeof F!=="function")throw TypeError("getProto: not an object");return L(F)}:T?function(F){return T(F)}:null}),b$=$0((Q,G)=>{var I=Function.prototype.call,L=Object.prototype.hasOwnProperty,T=kO();G.exports=T.call(I,L)}),dQ=$0((Q,G)=>{var I,L=yQ(),T=q$(),F=P$(),J=k$(),M=j$(),z=cQ(),W=qO(),H=_$(),C=v$(),R=B$(),q=g$(),P=x$(),j=N$(),k=f$(),B=y$(),v=Function,g=function(X0){try{return v('"use strict"; return ('+X0+").constructor;")()}catch(t){}},f=PO(),w=ZZ(),d=function(){throw new W},Y0=f?function(){try{return arguments.callee,d}catch(X0){try{return f(arguments,"callee").get}catch(t){return d}}}():d,G0=p$()(),J0=bQ(),u=uQ(),O0=hQ(),U=aZ(),X=eZ(),$={},Z=typeof Uint8Array>"u"||!J0?I:J0(Uint8Array),Y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?I:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?I:ArrayBuffer,"%ArrayIteratorPrototype%":G0&&J0?J0([][Symbol.iterator]()):I,"%AsyncFromSyncIteratorPrototype%":I,"%AsyncFunction%":$,"%AsyncGenerator%":$,"%AsyncGeneratorFunction%":$,"%AsyncIteratorPrototype%":$,"%Atomics%":typeof Atomics>"u"?I:Atomics,"%BigInt%":typeof BigInt>"u"?I:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?I:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?I:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?I:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":T,"%eval%":eval,"%EvalError%":F,"%Float16Array%":typeof Float16Array>"u"?I:Float16Array,"%Float32Array%":typeof Float32Array>"u"?I:Float32Array,"%Float64Array%":typeof Float64Array>"u"?I:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?I:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":$,"%Int8Array%":typeof Int8Array>"u"?I:Int8Array,"%Int16Array%":typeof Int16Array>"u"?I:Int16Array,"%Int32Array%":typeof Int32Array>"u"?I:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":G0&&J0?J0(J0([][Symbol.iterator]())):I,"%JSON%":typeof JSON==="object"?JSON:I,"%Map%":typeof Map>"u"?I:Map,"%MapIteratorPrototype%":typeof Map>"u"||!G0||!J0?I:J0(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":L,"%Object.getOwnPropertyDescriptor%":f,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?I:Promise,"%Proxy%":typeof Proxy>"u"?I:Proxy,"%RangeError%":J,"%ReferenceError%":M,"%Reflect%":typeof Reflect>"u"?I:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?I:Set,"%SetIteratorPrototype%":typeof Set>"u"||!G0||!J0?I:J0(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?I:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":G0&&J0?J0(""[Symbol.iterator]()):I,"%Symbol%":G0?Symbol:I,"%SyntaxError%":z,"%ThrowTypeError%":Y0,"%TypedArray%":Z,"%TypeError%":W,"%Uint8Array%":typeof Uint8Array>"u"?I:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?I:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?I:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?I:Uint32Array,"%URIError%":H,"%WeakMap%":typeof WeakMap>"u"?I:WeakMap,"%WeakRef%":typeof WeakRef>"u"?I:WeakRef,"%WeakSet%":typeof WeakSet>"u"?I:WeakSet,"%Function.prototype.call%":X,"%Function.prototype.apply%":U,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":u,"%Math.abs%":C,"%Math.floor%":R,"%Math.max%":q,"%Math.min%":P,"%Math.pow%":j,"%Math.round%":k,"%Math.sign%":B,"%Reflect.getPrototypeOf%":O0};if(J0)try{null.error}catch(X0){E=J0(J0(X0)),Y["%Error.prototype%"]=E}var E,K=function X0(t){var i;if(t==="%AsyncFunction%")i=g("async function () {}");else if(t==="%GeneratorFunction%")i=g("function* () {}");else if(t==="%AsyncGeneratorFunction%")i=g("async function* () {}");else if(t==="%AsyncGenerator%"){var N0=X0("%AsyncGeneratorFunction%");if(N0)i=N0.prototype}else if(t==="%AsyncIteratorPrototype%"){var y=X0("%AsyncGenerator%");if(y&&J0)i=J0(y.prototype)}return Y[t]=i,i},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=kO(),V=b$(),D=O.call(X,Array.prototype.concat),S=O.call(U,Array.prototype.splice),_=O.call(X,String.prototype.replace),N=O.call(X,String.prototype.slice),p=O.call(X,RegExp.prototype.exec),n=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V0=/\\(\\)?/g,r=function(X0){var t=N(X0,0,1),i=N(X0,-1);if(t==="%"&&i!=="%")throw new z("invalid intrinsic syntax, expected closing `%`");else if(i==="%"&&t!=="%")throw new z("invalid intrinsic syntax, expected opening `%`");var N0=[];return _(X0,n,function(y,h,Q0,s){N0[N0.length]=Q0?_(s,V0,"$1"):h||y}),N0},b=function(X0,t){var i=X0,N0;if(V(A,i))N0=A[i],i="%"+N0[0]+"%";if(V(Y,i)){var y=Y[i];if(y===$)y=K(i);if(typeof y>"u"&&!t)throw new W("intrinsic "+X0+" exists, but is not available. Please file an issue!");return{alias:N0,name:i,value:y}}throw new z("intrinsic "+X0+" does not exist!")};G.exports=function(X0,t){if(typeof X0!=="string"||X0.length===0)throw new W("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!=="boolean")throw new W('"allowMissing" argument must be a boolean');if(p(/^%?[^%]*%?$/,X0)===null)throw new z("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=r(X0),N0=i.length>0?i[0]:"",y=b("%"+N0+"%",t),h=y.name,Q0=y.value,s=!1,a=y.alias;if(a)N0=a[0],S(i,D([0,1],a));for(var H0=1,c=!0;H0<i.length;H0+=1){var o=i[H0],x0=N(o,0,1),m=N(o,-1);if((x0==='"'||x0==="'"||x0==="`"||(m==='"'||m==="'"||m==="`"))&&x0!==m)throw new z("property names with quotes must have matching quotes");if(o==="constructor"||!c)s=!0;if(N0+="."+o,h="%"+N0+"%",V(Y,h))Q0=Y[h];else if(Q0!=null){if(!(o in Q0)){if(!t)throw new W("base intrinsic for "+X0+" exists, but the property is not available.");return}if(f&&H0+1>=i.length){var Z0=f(Q0,o);if(c=!!Z0,c&&"get"in Z0&&!("originalValue"in Z0.get))Q0=Z0.get;else Q0=Q0[o]}else c=V(Q0,o),Q0=Q0[o];if(c&&!s)Y[h]=Q0}}return Q0}}),oQ=$0((Q,G)=>{var I=dQ(),L=iZ(),T=L([I("%String.prototype.indexOf%")]);G.exports=function(F,J){var M=I(F,!!J);if(typeof M==="function"&&T(F,".prototype.")>-1)return L([M]);return M}}),d$=$0((Q,G)=>{var I=Function.prototype.toString,L=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,T,F;if(typeof L==="function"&&typeof Object.defineProperty==="function")try{T=Object.defineProperty({},"length",{get:function(){throw F}}),F={},L(function(){throw 42},null,T)}catch(f){if(f!==F)L=null}else L=null;var J=/^\s*class\b/,M=function(f){try{var w=I.call(f);return J.test(w)}catch(d){return!1}},z=function(f){try{if(M(f))return!1;return I.call(f),!0}catch(w){return!1}},W=Object.prototype.toString,H="[object Object]",C="[object Function]",R="[object GeneratorFunction]",q="[object HTMLAllCollection]",P="[object HTML document.all class]",j="[object HTMLCollection]",k=typeof Symbol==="function"&&!!Symbol.toStringTag,B=!(0 in[,]),v=function(){return!1};if(typeof document==="object"){if(g=document.all,W.call(g)===W.call(document.all))v=function(f){if((B||!f)&&(typeof f>"u"||typeof f==="object"))try{var w=W.call(f);return(w===q||w===P||w===j||w===H)&&f("")==null}catch(d){}return!1}}var g;G.exports=L?function(f){if(v(f))return!0;if(!f)return!1;if(typeof f!=="function"&&typeof f!=="object")return!1;try{L(f,null,T)}catch(w){if(w!==F)return!1}return!M(f)&&z(f)}:function(f){if(v(f))return!0;if(!f)return!1;if(typeof f!=="function"&&typeof f!=="object")return!1;if(k)return z(f);if(M(f))return!1;var w=W.call(f);if(w!==C&&w!==R&&!/^\[object HTML/.test(w))return!1;return z(f)}}),o$=$0((Q,G)=>{var I=d$(),L=Object.prototype.toString,T=Object.prototype.hasOwnProperty,F=function(W,H,C){for(var R=0,q=W.length;R<q;R++)if(T.call(W,R))if(C==null)H(W[R],R,W);else H.call(C,W[R],R,W)},J=function(W,H,C){for(var R=0,q=W.length;R<q;R++)if(C==null)H(W.charAt(R),R,W);else H.call(C,W.charAt(R),R,W)},M=function(W,H,C){for(var R in W)if(T.call(W,R))if(C==null)H(W[R],R,W);else H.call(C,W[R],R,W)};function z(W){return L.call(W)==="[object Array]"}G.exports=function(W,H,C){if(!I(H))throw TypeError("iterator must be a function");var R;if(arguments.length>=3)R=C;if(z(W))F(W,H,R);else if(typeof W==="string")J(W,H,R);else M(W,H,R)}}),n$=$0((Q,G)=>{G.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),t$=$0((Q,G)=>{var I=n$(),L=typeof globalThis>"u"?globalThis:globalThis;G.exports=function(){var T=[];for(var F=0;F<I.length;F++)if(typeof L[I[F]]==="function")T[T.length]=I[F];return T}}),m$=$0((Q,G)=>{var I=ZZ(),L=cQ(),T=qO(),F=PO();G.exports=function(J,M,z){if(!J||typeof J!=="object"&&typeof J!=="function")throw new T("`obj` must be an object or a function`");if(typeof M!=="string"&&typeof M!=="symbol")throw new T("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new T("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new T("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new T("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new T("`loose`, if provided, must be a boolean");var W=arguments.length>3?arguments[3]:null,H=arguments.length>4?arguments[4]:null,C=arguments.length>5?arguments[5]:null,R=arguments.length>6?arguments[6]:!1,q=!!F&&F(J,M);if(I)I(J,M,{configurable:C===null&&q?q.configurable:!C,enumerable:W===null&&q?q.enumerable:!W,value:z,writable:H===null&&q?q.writable:!H});else if(R||!W&&!H&&!C)J[M]=z;else throw new L("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),s$=$0((Q,G)=>{var I=ZZ(),L=function(){return!!I};L.hasArrayLengthDefineBug=function(){if(!I)return null;try{return I([],"length",{value:1}).length!==1}catch(T){return!0}},G.exports=L}),r$=$0((Q,G)=>{var I=dQ(),L=m$(),T=s$()(),F=PO(),J=qO(),M=I("%Math.floor%");G.exports=function(z,W){if(typeof z!=="function")throw new J("`fn` is not a function");if(typeof W!=="number"||W<0||W>4294967295||M(W)!==W)throw new J("`length` must be a positive 32-bit integer");var H=arguments.length>2&&!!arguments[2],C=!0,R=!0;if("length"in z&&F){var q=F(z,"length");if(q&&!q.configurable)C=!1;if(q&&!q.writable)R=!1}if(C||R||!H)if(T)L(z,"length",W,!0,!0);else L(z,"length",W);return z}}),e$=$0((Q,G)=>{var I=kO(),L=aZ(),T=lQ();G.exports=function(){return T(I,L,arguments)}}),a$=$0((Q,G)=>{var I=r$(),L=ZZ(),T=iZ(),F=e$();if(G.exports=function(J){var M=T(arguments),z=J.length-(arguments.length-1);return I(M,1+(z>0?z:0),!0)},L)L(G.exports,"apply",{value:F});else G.exports.apply=F}),i$=$0((Q,G)=>{var I=pQ();G.exports=function(){return I()&&!!Symbol.toStringTag}}),UG=$0((Q,G)=>{var I=o$(),L=t$(),T=a$(),F=oQ(),J=PO(),M=bQ(),z=F("Object.prototype.toString"),W=i$()(),H=typeof globalThis>"u"?globalThis:globalThis,C=L(),R=F("String.prototype.slice"),q=F("Array.prototype.indexOf",!0)||function(B,v){for(var g=0;g<B.length;g+=1)if(B[g]===v)return g;return-1},P={__proto__:null};if(W&&J&&M)I(C,function(B){var v=new H[B];if(Symbol.toStringTag in v&&M){var g=M(v),f=J(g,Symbol.toStringTag);if(!f&&g){var w=M(g);f=J(w,Symbol.toStringTag)}P["$"+B]=T(f.get)}});else I(C,function(B){var v=new H[B],g=v.slice||v.set;if(g)P["$"+B]=T(g)});var j=function(B){var v=!1;return I(P,function(g,f){if(!v)try{if("$"+g(B)===f)v=R(f,1)}catch(w){}}),v},k=function(B){var v=!1;return I(P,function(g,f){if(!v)try{g(B),v=R(f,1)}catch(w){}}),v};G.exports=function(B){if(!B||typeof B!=="object")return!1;if(!W){var v=R(z(B),8,-1);if(q(C,v)>-1)return v;if(v!=="Object")return!1;return k(B)}if(!J)return null;return j(B)}}),OG=$0((Q,G)=>{var I=UG();G.exports=function(L){return!!I(L)}}),ZG=$0((Q,G)=>{var I=qO(),L=oQ(),T=L("TypedArray.prototype.buffer",!0),F=OG();G.exports=T||function(J){if(!F(J))throw new I("Not a Typed Array");return J.buffer}}),XG=$0((Q,G)=>{var I=MU().Buffer,L=z$(),T=ZG(),F=ArrayBuffer.isView||function(W){try{return T(W),!0}catch(H){return!1}},J=typeof Uint8Array<"u",M=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",z=M&&(I.prototype instanceof Uint8Array||I.TYPED_ARRAY_SUPPORT);G.exports=function(W,H){if(I.isBuffer(W)){if(W.constructor&&!("isBuffer"in W))return I.from(W);return W}if(typeof W==="string")return I.from(W,H);if(M&&F(W)){if(W.byteLength===0)return I.alloc(0);if(z){var C=I.from(W.buffer,W.byteOffset,W.byteLength);if(C.byteLength===W.byteLength)return C}var R=W instanceof Uint8Array?W:new Uint8Array(W.buffer,W.byteOffset,W.byteLength),q=I.from(R);if(q.length===W.byteLength)return q}if(J&&W instanceof Uint8Array)return I.from(W);var P=L(W);if(P)for(var j=0;j<W.length;j+=1){var k=W[j];if(typeof k!=="number"||k<0||k>255||~~k!==k)throw RangeError("Array items must be numbers in the range 0-255.")}if(P||I.isBuffer(W)&&W.constructor&&typeof W.constructor.isBuffer==="function"&&W.constructor.isBuffer(W))return I.from(W);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),UX=$0((Q,G)=>{var I=MU().Buffer,L=XG(),T=typeof Uint8Array<"u",F=T&&typeof ArrayBuffer<"u",J=F&&ArrayBuffer.isView;G.exports=function(M,z,W){if(typeof M==="string"||I.isBuffer(M)||T&&M instanceof Uint8Array||J&&J(M))return L(M,z);throw TypeError(W+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),nQ=$0((Q,G)=>{var I={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},L={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},T=wQ(),F=MU().Buffer,J=sZ(),M=rZ(),z=UX();function W(H,C,R,q,P){J(R,q),H=z(H,M,"Password"),C=z(C,M,"Salt");var j=(P||"sha1").toLowerCase(),k=L[j]||j,B=I[k];if(typeof B!=="number"||!B)throw TypeError("Digest algorithm not supported: "+P);var v=F.allocUnsafe(q),g=F.allocUnsafe(C.length+4);C.copy(g,0,0,C.length);var f=0,w=B,d=Math.ceil(q/w);for(var Y0=1;Y0<=d;Y0++){g.writeUInt32BE(Y0,C.length);var G0=T(k,H).update(g).digest(),J0=G0;for(var u=1;u<R;u++){J0=T(k,H).update(J0).digest();for(var O0=0;O0<w;O0++)G0[O0]^=J0[O0]}G0.copy(v,f),f+=w}return v}G.exports=W}),QG=$0((Q,G)=>{var I=MU().Buffer,L=sZ(),T=rZ(),F=nQ(),J=UX(),M,z=globalThis.crypto&&globalThis.crypto.subtle,W={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},H=[],C;function R(){if(C)return C;if(globalThis.process&&globalThis.process.nextTick)C=globalThis.process.nextTick;else if(globalThis.queueMicrotask)C=globalThis.queueMicrotask;else if(globalThis.setImmediate)C=globalThis.setImmediate;else C=globalThis.setTimeout;return C}function q(k,B,v,g,f){return z.importKey("raw",k,{name:"PBKDF2"},!1,["deriveBits"]).then(function(w){return z.deriveBits({name:"PBKDF2",salt:B,iterations:v,hash:{name:f}},w,g<<3)}).then(function(w){return I.from(w)})}function P(k){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!z||!z.importKey||!z.deriveBits)return Promise.resolve(!1);if(H[k]!==void 0)return H[k];M=M||I.alloc(8);var B=q(M,M,10,128,k).then(function(){return!0},function(){return!1});return H[k]=B,B}function j(k,B){k.then(function(v){R()(function(){B(null,v)})},function(v){R()(function(){B(v)})})}G.exports=function(k,B,v,g,f,w){if(typeof f==="function")w=f,f=void 0;if(L(v,g),k=J(k,T,"Password"),B=J(B,T,"Salt"),typeof w!=="function")throw Error("No callback provided to pbkdf2");f=f||"sha1";var d=W[f.toLowerCase()];if(!d||typeof globalThis.Promise!=="function"){R()(function(){var Y0;try{Y0=F(k,B,v,g,f)}catch(G0){w(G0);return}w(null,Y0)});return}j(P(d).then(function(Y0){if(Y0)return q(k,B,v,g,d);return F(k,B,v,g,f)}),w)}}),tQ=$0((Q)=>{var G=(_U(),h0(jU)),I=sZ(),L=rZ(),T=UX();function F(M,z,W,H,C,R){if(I(W,H),M=T(M,L,"Password"),z=T(z,L,"Salt"),typeof C==="function")R=C,C="sha1";if(typeof R!=="function")throw Error("No callback provided to pbkdf2");return G.pbkdf2(M,z,W,H,C,R)}function J(M,z,W,H,C){return I(W,H),M=T(M,L,"Password"),z=T(z,L,"Salt"),C=C||"sha1",G.pbkdf2Sync(M,z,W,H,C)}if(!G.pbkdf2Sync||G.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)Q.pbkdf2Sync=nQ(),Q.pbkdf2=QG();else Q.pbkdf2Sync=J,Q.pbkdf2=F}),YG=$0((Q)=>{var G=(_U(),h0(jU));Q.createCipher=Q.Cipher=G.createCipher,Q.createCipheriv=Q.Cipheriv=G.createCipheriv,Q.createDecipher=Q.Decipher=G.createDecipher,Q.createDecipheriv=Q.Decipheriv=G.createDecipheriv,Q.listCiphers=Q.getCiphers=G.getCiphers}),JG=$0((Q)=>{var G=(_U(),h0(jU));Q.DiffieHellmanGroup=G.DiffieHellmanGroup,Q.createDiffieHellmanGroup=G.createDiffieHellmanGroup,Q.getDiffieHellman=G.getDiffieHellman,Q.createDiffieHellman=G.createDiffieHellman,Q.DiffieHellman=G.DiffieHellman}),$G=$0((Q)=>{var G=(_U(),h0(jU));Q.createSign=G.createSign,Q.Sign=G.Sign,Q.createVerify=G.createVerify,Q.Verify=G.Verify}),GG=$0((Q,G)=>{G.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}}),tU=$0((Q,G)=>{(function(I,L){function T(U,X){if(!U)throw Error(X||"Assertion failed")}function F(U,X){U.super_=X;var $=function(){};$.prototype=X.prototype,U.prototype=new $,U.prototype.constructor=U}function J(U,X,$){if(J.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")$=X,X=10;this._init(U||0,X||10,$||"be")}}if(typeof I==="object")I.exports=J;else L.BN=J;J.BN=J,J.wordSize=26;var M;try{if(typeof window<"u"&&typeof window.Buffer<"u")M=window.Buffer;else M=(LU(),h0(CU)).Buffer}catch(U){}J.isBN=function(U){if(U instanceof J)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===J.wordSize&&Array.isArray(U.words)},J.max=function(U,X){if(U.cmp(X)>0)return U;return X},J.min=function(U,X){if(U.cmp(X)<0)return U;return X},J.prototype._init=function(U,X,$){if(typeof U==="number")return this._initNumber(U,X,$);if(typeof U==="object")return this._initArray(U,X,$);if(X==="hex")X=16;T(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,$);else if(this._parseBase(U,X,Z),$==="le")this._initArray(this.toArray(),X,$)}},J.prototype._initNumber=function(U,X,$){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else T(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if($!=="le")return;this._initArray(this.toArray(),X,$)},J.prototype._initArray=function(U,X,$){if(T(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y,E,K=0;if($==="be"){for(Z=U.length-1,Y=0;Z>=0;Z-=3)if(E=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[Y]|=E<<K&67108863,this.words[Y+1]=E>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}else if($==="le"){for(Z=0,Y=0;Z<U.length;Z+=3)if(E=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[Y]|=E<<K&67108863,this.words[Y+1]=E>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}return this.strip()};function z(U,X){var $=U.charCodeAt(X);if($>=65&&$<=70)return $-55;else if($>=97&&$<=102)return $-87;else return $-48&15}function W(U,X,$){var Z=z(U,$);if($-1>=X)Z|=z(U,$-1)<<4;return Z}J.prototype._parseHex=function(U,X,$){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y=0,E=0,K;if($==="be")for(Z=U.length-1;Z>=X;Z-=2)if(K=W(U,X,Z)<<Y,this.words[E]|=K&67108863,Y>=18)Y-=18,E+=1,this.words[E]|=K>>>26;else Y+=8;else{var A=U.length-X;for(Z=A%2===0?X+1:X;Z<U.length;Z+=2)if(K=W(U,X,Z)<<Y,this.words[E]|=K&67108863,Y>=18)Y-=18,E+=1,this.words[E]|=K>>>26;else Y+=8}this.strip()};function H(U,X,$,Z){var Y=0,E=Math.min(U.length,$);for(var K=X;K<E;K++){var A=U.charCodeAt(K)-48;if(Y*=Z,A>=49)Y+=A-49+10;else if(A>=17)Y+=A-17+10;else Y+=A}return Y}J.prototype._parseBase=function(U,X,$){this.words=[0],this.length=1;for(var Z=0,Y=1;Y<=67108863;Y*=X)Z++;Z--,Y=Y/X|0;var E=U.length-$,K=E%Z,A=Math.min(E,E-K)+$,O=0;for(var V=$;V<A;V+=Z)if(O=H(U,V,V+Z,X),this.imuln(Y),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(K!==0){var D=1;O=H(U,V,U.length,X);for(V=0;V<K;V++)D*=X;if(this.imuln(D),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},J.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},J.prototype.clone=function(){var U=new J(null);return this.copy(U),U},J.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},J.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},J.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},J.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var C=["","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"],R=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(J.prototype.toString=function(U,X){U=U||10,X=X|0||1;var $;if(U===16||U==="hex"){$="";var Z=0,Y=0;for(var E=0;E<this.length;E++){var K=this.words[E],A=((K<<Z|Y)&16777215).toString(16);if(Y=K>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,E--;if(Y!==0||E!==this.length-1)$=C[6-A.length]+A+$;else $=A+$}if(Y!==0)$=Y.toString(16)+$;while($.length%X!==0)$="0"+$;if(this.negative!==0)$="-"+$;return $}if(U===(U|0)&&U>=2&&U<=36){var O=R[U],V=q[U];$="";var D=this.clone();D.negative=0;while(!D.isZero()){var S=D.modn(V).toString(U);if(D=D.idivn(V),!D.isZero())$=C[O-S.length]+S+$;else $=S+$}if(this.isZero())$="0"+$;while($.length%X!==0)$="0"+$;if(this.negative!==0)$="-"+$;return $}T(!1,"Base should be between 2 and 36")},J.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)T(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},J.prototype.toJSON=function(){return this.toString(16)},J.prototype.toBuffer=function(U,X){return T(typeof M<"u"),this.toArrayLike(M,U,X)},J.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},J.prototype.toArrayLike=function(U,X,$){var Z=this.byteLength(),Y=$||Math.max(1,Z);T(Z<=Y,"byte array longer than desired length"),T(Y>0,"Requested array length <= 0"),this.strip();var E=X==="le",K=new U(Y),A,O,V=this.clone();if(!E){for(O=0;O<Y-Z;O++)K[O]=0;for(O=0;!V.isZero();O++)A=V.andln(255),V.iushrn(8),K[Y-O-1]=A}else{for(O=0;!V.isZero();O++)A=V.andln(255),V.iushrn(8),K[O]=A;for(;O<Y;O++)K[O]=0}return K},Math.clz32)J.prototype._countBits=function(U){return 32-Math.clz32(U)};else J.prototype._countBits=function(U){var X=U,$=0;if(X>=4096)$+=13,X>>>=13;if(X>=64)$+=7,X>>>=7;if(X>=8)$+=4,X>>>=4;if(X>=2)$+=2,X>>>=2;return $+X};J.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,$=0;if((X&8191)===0)$+=13,X>>>=13;if((X&127)===0)$+=7,X>>>=7;if((X&15)===0)$+=4,X>>>=4;if((X&3)===0)$+=2,X>>>=2;if((X&1)===0)$++;return $},J.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var $=0;$<X.length;$++){var Z=$/26|0,Y=$%26;X[$]=(U.words[Z]&1<<Y)>>>Y}return X}J.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var $=this._zeroBits(this.words[X]);if(U+=$,$!==26)break}return U},J.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},J.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},J.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},J.prototype.isNeg=function(){return this.negative!==0},J.prototype.neg=function(){return this.clone().ineg()},J.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},J.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},J.prototype.ior=function(U){return T((this.negative|U.negative)===0),this.iuor(U)},J.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},J.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},J.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var $=0;$<X.length;$++)this.words[$]=this.words[$]&U.words[$];return this.length=X.length,this.strip()},J.prototype.iand=function(U){return T((this.negative|U.negative)===0),this.iuand(U)},J.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},J.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},J.prototype.iuxor=function(U){var X,$;if(this.length>U.length)X=this,$=U;else X=U,$=this;for(var Z=0;Z<$.length;Z++)this.words[Z]=X.words[Z]^$.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},J.prototype.ixor=function(U){return T((this.negative|U.negative)===0),this.iuxor(U)},J.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},J.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},J.prototype.inotn=function(U){T(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,$=U%26;if(this._expand(X),$>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if($>0)this.words[Z]=~this.words[Z]&67108863>>26-$;return this.strip()},J.prototype.notn=function(U){return this.clone().inotn(U)},J.prototype.setn=function(U,X){T(typeof U==="number"&&U>=0);var $=U/26|0,Z=U%26;if(this._expand($+1),X)this.words[$]=this.words[$]|1<<Z;else this.words[$]=this.words[$]&~(1<<Z);return this.strip()},J.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var $,Z;if(this.length>U.length)$=this,Z=U;else $=U,Z=this;var Y=0;for(var E=0;E<Z.length;E++)X=($.words[E]|0)+(Z.words[E]|0)+Y,this.words[E]=X&67108863,Y=X>>>26;for(;Y!==0&&E<$.length;E++)X=($.words[E]|0)+Y,this.words[E]=X&67108863,Y=X>>>26;if(this.length=$.length,Y!==0)this.words[this.length]=Y,this.length++;else if($!==this)for(;E<$.length;E++)this.words[E]=$.words[E];return this},J.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},J.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var $=this.cmp(U);if($===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Y;if($>0)Z=this,Y=U;else Z=U,Y=this;var E=0;for(var K=0;K<Y.length;K++)X=(Z.words[K]|0)-(Y.words[K]|0)+E,E=X>>26,this.words[K]=X&67108863;for(;E!==0&&K<Z.length;K++)X=(Z.words[K]|0)+E,E=X>>26,this.words[K]=X&67108863;if(E===0&&K<Z.length&&Z!==this)for(;K<Z.length;K++)this.words[K]=Z.words[K];if(this.length=Math.max(this.length,K),Z!==this)this.negative=1;return this.strip()},J.prototype.sub=function(U){return this.clone().isub(U)};function j(U,X,$){$.negative=X.negative^U.negative;var Z=U.length+X.length|0;$.length=Z,Z=Z-1|0;var Y=U.words[0]|0,E=X.words[0]|0,K=Y*E,A=K&67108863,O=K/67108864|0;$.words[0]=A;for(var V=1;V<Z;V++){var D=O>>>26,S=O&67108863,_=Math.min(V,X.length-1);for(var N=Math.max(0,V-U.length+1);N<=_;N++){var p=V-N|0;Y=U.words[p]|0,E=X.words[N]|0,K=Y*E+S,D+=K/67108864|0,S=K&67108863}$.words[V]=S|0,O=D|0}if(O!==0)$.words[V]=O|0;else $.length--;return $.strip()}var k=function(U,X,$){var Z=U.words,Y=X.words,E=$.words,K=0,A,O,V,D=Z[0]|0,S=D&8191,_=D>>>13,N=Z[1]|0,p=N&8191,n=N>>>13,V0=Z[2]|0,r=V0&8191,b=V0>>>13,X0=Z[3]|0,t=X0&8191,i=X0>>>13,N0=Z[4]|0,y=N0&8191,h=N0>>>13,Q0=Z[5]|0,s=Q0&8191,a=Q0>>>13,H0=Z[6]|0,c=H0&8191,o=H0>>>13,x0=Z[7]|0,m=x0&8191,Z0=x0>>>13,w0=Z[8]|0,K0=w0&8191,T0=w0>>>13,t0=Z[9]|0,I0=t0&8191,C0=t0>>>13,r0=Y[0]|0,R0=r0&8191,S0=r0>>>13,WU=Y[1]|0,F0=WU&8191,k0=WU>>>13,HU=Y[2]|0,j0=HU&8191,D0=HU>>>13,SU=Y[3]|0,_0=SU&8191,M0=SU>>>13,EU=Y[4]|0,v0=EU&8191,B0=EU>>>13,KU=Y[5]|0,z0=KU&8191,x=KU>>>13,l=Y[6]|0,e=l&8191,U0=l>>>13,f0=Y[7]|0,E0=f0&8191,L0=f0>>>13,m0=Y[8]|0,q0=m0&8191,g0=m0>>>13,RU=Y[9]|0,P0=RU&8191,W0=RU>>>13;$.negative=U.negative^X.negative,$.length=19,A=Math.imul(S,R0),O=Math.imul(S,S0),O=O+Math.imul(_,R0)|0,V=Math.imul(_,S0);var s0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(s0>>>26)|0,s0&=67108863,A=Math.imul(p,R0),O=Math.imul(p,S0),O=O+Math.imul(n,R0)|0,V=Math.imul(n,S0),A=A+Math.imul(S,F0)|0,O=O+Math.imul(S,k0)|0,O=O+Math.imul(_,F0)|0,V=V+Math.imul(_,k0)|0;var c0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,A=Math.imul(r,R0),O=Math.imul(r,S0),O=O+Math.imul(b,R0)|0,V=Math.imul(b,S0),A=A+Math.imul(p,F0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,F0)|0,V=V+Math.imul(n,k0)|0,A=A+Math.imul(S,j0)|0,O=O+Math.imul(S,D0)|0,O=O+Math.imul(_,j0)|0,V=V+Math.imul(_,D0)|0;var y0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,A=Math.imul(t,R0),O=Math.imul(t,S0),O=O+Math.imul(i,R0)|0,V=Math.imul(i,S0),A=A+Math.imul(r,F0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(b,F0)|0,V=V+Math.imul(b,k0)|0,A=A+Math.imul(p,j0)|0,O=O+Math.imul(p,D0)|0,O=O+Math.imul(n,j0)|0,V=V+Math.imul(n,D0)|0,A=A+Math.imul(S,_0)|0,O=O+Math.imul(S,M0)|0,O=O+Math.imul(_,_0)|0,V=V+Math.imul(_,M0)|0;var b0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(b0>>>26)|0,b0&=67108863,A=Math.imul(y,R0),O=Math.imul(y,S0),O=O+Math.imul(h,R0)|0,V=Math.imul(h,S0),A=A+Math.imul(t,F0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(i,F0)|0,V=V+Math.imul(i,k0)|0,A=A+Math.imul(r,j0)|0,O=O+Math.imul(r,D0)|0,O=O+Math.imul(b,j0)|0,V=V+Math.imul(b,D0)|0,A=A+Math.imul(p,_0)|0,O=O+Math.imul(p,M0)|0,O=O+Math.imul(n,_0)|0,V=V+Math.imul(n,M0)|0,A=A+Math.imul(S,v0)|0,O=O+Math.imul(S,B0)|0,O=O+Math.imul(_,v0)|0,V=V+Math.imul(_,B0)|0;var l0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,A=Math.imul(s,R0),O=Math.imul(s,S0),O=O+Math.imul(a,R0)|0,V=Math.imul(a,S0),A=A+Math.imul(y,F0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,F0)|0,V=V+Math.imul(h,k0)|0,A=A+Math.imul(t,j0)|0,O=O+Math.imul(t,D0)|0,O=O+Math.imul(i,j0)|0,V=V+Math.imul(i,D0)|0,A=A+Math.imul(r,_0)|0,O=O+Math.imul(r,M0)|0,O=O+Math.imul(b,_0)|0,V=V+Math.imul(b,M0)|0,A=A+Math.imul(p,v0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,v0)|0,V=V+Math.imul(n,B0)|0,A=A+Math.imul(S,z0)|0,O=O+Math.imul(S,x)|0,O=O+Math.imul(_,z0)|0,V=V+Math.imul(_,x)|0;var e0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(e0>>>26)|0,e0&=67108863,A=Math.imul(c,R0),O=Math.imul(c,S0),O=O+Math.imul(o,R0)|0,V=Math.imul(o,S0),A=A+Math.imul(s,F0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(a,F0)|0,V=V+Math.imul(a,k0)|0,A=A+Math.imul(y,j0)|0,O=O+Math.imul(y,D0)|0,O=O+Math.imul(h,j0)|0,V=V+Math.imul(h,D0)|0,A=A+Math.imul(t,_0)|0,O=O+Math.imul(t,M0)|0,O=O+Math.imul(i,_0)|0,V=V+Math.imul(i,M0)|0,A=A+Math.imul(r,v0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(b,v0)|0,V=V+Math.imul(b,B0)|0,A=A+Math.imul(p,z0)|0,O=O+Math.imul(p,x)|0,O=O+Math.imul(n,z0)|0,V=V+Math.imul(n,x)|0,A=A+Math.imul(S,e)|0,O=O+Math.imul(S,U0)|0,O=O+Math.imul(_,e)|0,V=V+Math.imul(_,U0)|0;var a0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(a0>>>26)|0,a0&=67108863,A=Math.imul(m,R0),O=Math.imul(m,S0),O=O+Math.imul(Z0,R0)|0,V=Math.imul(Z0,S0),A=A+Math.imul(c,F0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,F0)|0,V=V+Math.imul(o,k0)|0,A=A+Math.imul(s,j0)|0,O=O+Math.imul(s,D0)|0,O=O+Math.imul(a,j0)|0,V=V+Math.imul(a,D0)|0,A=A+Math.imul(y,_0)|0,O=O+Math.imul(y,M0)|0,O=O+Math.imul(h,_0)|0,V=V+Math.imul(h,M0)|0,A=A+Math.imul(t,v0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(i,v0)|0,V=V+Math.imul(i,B0)|0,A=A+Math.imul(r,z0)|0,O=O+Math.imul(r,x)|0,O=O+Math.imul(b,z0)|0,V=V+Math.imul(b,x)|0,A=A+Math.imul(p,e)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,e)|0,V=V+Math.imul(n,U0)|0,A=A+Math.imul(S,E0)|0,O=O+Math.imul(S,L0)|0,O=O+Math.imul(_,E0)|0,V=V+Math.imul(_,L0)|0;var i0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,A=Math.imul(K0,R0),O=Math.imul(K0,S0),O=O+Math.imul(T0,R0)|0,V=Math.imul(T0,S0),A=A+Math.imul(m,F0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(Z0,F0)|0,V=V+Math.imul(Z0,k0)|0,A=A+Math.imul(c,j0)|0,O=O+Math.imul(c,D0)|0,O=O+Math.imul(o,j0)|0,V=V+Math.imul(o,D0)|0,A=A+Math.imul(s,_0)|0,O=O+Math.imul(s,M0)|0,O=O+Math.imul(a,_0)|0,V=V+Math.imul(a,M0)|0,A=A+Math.imul(y,v0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,v0)|0,V=V+Math.imul(h,B0)|0,A=A+Math.imul(t,z0)|0,O=O+Math.imul(t,x)|0,O=O+Math.imul(i,z0)|0,V=V+Math.imul(i,x)|0,A=A+Math.imul(r,e)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(b,e)|0,V=V+Math.imul(b,U0)|0,A=A+Math.imul(p,E0)|0,O=O+Math.imul(p,L0)|0,O=O+Math.imul(n,E0)|0,V=V+Math.imul(n,L0)|0,A=A+Math.imul(S,q0)|0,O=O+Math.imul(S,g0)|0,O=O+Math.imul(_,q0)|0,V=V+Math.imul(_,g0)|0;var UU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,A=Math.imul(I0,R0),O=Math.imul(I0,S0),O=O+Math.imul(C0,R0)|0,V=Math.imul(C0,S0),A=A+Math.imul(K0,F0)|0,O=O+Math.imul(K0,k0)|0,O=O+Math.imul(T0,F0)|0,V=V+Math.imul(T0,k0)|0,A=A+Math.imul(m,j0)|0,O=O+Math.imul(m,D0)|0,O=O+Math.imul(Z0,j0)|0,V=V+Math.imul(Z0,D0)|0,A=A+Math.imul(c,_0)|0,O=O+Math.imul(c,M0)|0,O=O+Math.imul(o,_0)|0,V=V+Math.imul(o,M0)|0,A=A+Math.imul(s,v0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(a,v0)|0,V=V+Math.imul(a,B0)|0,A=A+Math.imul(y,z0)|0,O=O+Math.imul(y,x)|0,O=O+Math.imul(h,z0)|0,V=V+Math.imul(h,x)|0,A=A+Math.imul(t,e)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(i,e)|0,V=V+Math.imul(i,U0)|0,A=A+Math.imul(r,E0)|0,O=O+Math.imul(r,L0)|0,O=O+Math.imul(b,E0)|0,V=V+Math.imul(b,L0)|0,A=A+Math.imul(p,q0)|0,O=O+Math.imul(p,g0)|0,O=O+Math.imul(n,q0)|0,V=V+Math.imul(n,g0)|0,A=A+Math.imul(S,P0)|0,O=O+Math.imul(S,W0)|0,O=O+Math.imul(_,P0)|0,V=V+Math.imul(_,W0)|0;var OU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,A=Math.imul(I0,F0),O=Math.imul(I0,k0),O=O+Math.imul(C0,F0)|0,V=Math.imul(C0,k0),A=A+Math.imul(K0,j0)|0,O=O+Math.imul(K0,D0)|0,O=O+Math.imul(T0,j0)|0,V=V+Math.imul(T0,D0)|0,A=A+Math.imul(m,_0)|0,O=O+Math.imul(m,M0)|0,O=O+Math.imul(Z0,_0)|0,V=V+Math.imul(Z0,M0)|0,A=A+Math.imul(c,v0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,v0)|0,V=V+Math.imul(o,B0)|0,A=A+Math.imul(s,z0)|0,O=O+Math.imul(s,x)|0,O=O+Math.imul(a,z0)|0,V=V+Math.imul(a,x)|0,A=A+Math.imul(y,e)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,e)|0,V=V+Math.imul(h,U0)|0,A=A+Math.imul(t,E0)|0,O=O+Math.imul(t,L0)|0,O=O+Math.imul(i,E0)|0,V=V+Math.imul(i,L0)|0,A=A+Math.imul(r,q0)|0,O=O+Math.imul(r,g0)|0,O=O+Math.imul(b,q0)|0,V=V+Math.imul(b,g0)|0,A=A+Math.imul(p,P0)|0,O=O+Math.imul(p,W0)|0,O=O+Math.imul(n,P0)|0,V=V+Math.imul(n,W0)|0;var ZU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,A=Math.imul(I0,j0),O=Math.imul(I0,D0),O=O+Math.imul(C0,j0)|0,V=Math.imul(C0,D0),A=A+Math.imul(K0,_0)|0,O=O+Math.imul(K0,M0)|0,O=O+Math.imul(T0,_0)|0,V=V+Math.imul(T0,M0)|0,A=A+Math.imul(m,v0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(Z0,v0)|0,V=V+Math.imul(Z0,B0)|0,A=A+Math.imul(c,z0)|0,O=O+Math.imul(c,x)|0,O=O+Math.imul(o,z0)|0,V=V+Math.imul(o,x)|0,A=A+Math.imul(s,e)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(a,e)|0,V=V+Math.imul(a,U0)|0,A=A+Math.imul(y,E0)|0,O=O+Math.imul(y,L0)|0,O=O+Math.imul(h,E0)|0,V=V+Math.imul(h,L0)|0,A=A+Math.imul(t,q0)|0,O=O+Math.imul(t,g0)|0,O=O+Math.imul(i,q0)|0,V=V+Math.imul(i,g0)|0,A=A+Math.imul(r,P0)|0,O=O+Math.imul(r,W0)|0,O=O+Math.imul(b,P0)|0,V=V+Math.imul(b,W0)|0;var XU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,A=Math.imul(I0,_0),O=Math.imul(I0,M0),O=O+Math.imul(C0,_0)|0,V=Math.imul(C0,M0),A=A+Math.imul(K0,v0)|0,O=O+Math.imul(K0,B0)|0,O=O+Math.imul(T0,v0)|0,V=V+Math.imul(T0,B0)|0,A=A+Math.imul(m,z0)|0,O=O+Math.imul(m,x)|0,O=O+Math.imul(Z0,z0)|0,V=V+Math.imul(Z0,x)|0,A=A+Math.imul(c,e)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,e)|0,V=V+Math.imul(o,U0)|0,A=A+Math.imul(s,E0)|0,O=O+Math.imul(s,L0)|0,O=O+Math.imul(a,E0)|0,V=V+Math.imul(a,L0)|0,A=A+Math.imul(y,q0)|0,O=O+Math.imul(y,g0)|0,O=O+Math.imul(h,q0)|0,V=V+Math.imul(h,g0)|0,A=A+Math.imul(t,P0)|0,O=O+Math.imul(t,W0)|0,O=O+Math.imul(i,P0)|0,V=V+Math.imul(i,W0)|0;var QU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,A=Math.imul(I0,v0),O=Math.imul(I0,B0),O=O+Math.imul(C0,v0)|0,V=Math.imul(C0,B0),A=A+Math.imul(K0,z0)|0,O=O+Math.imul(K0,x)|0,O=O+Math.imul(T0,z0)|0,V=V+Math.imul(T0,x)|0,A=A+Math.imul(m,e)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(Z0,e)|0,V=V+Math.imul(Z0,U0)|0,A=A+Math.imul(c,E0)|0,O=O+Math.imul(c,L0)|0,O=O+Math.imul(o,E0)|0,V=V+Math.imul(o,L0)|0,A=A+Math.imul(s,q0)|0,O=O+Math.imul(s,g0)|0,O=O+Math.imul(a,q0)|0,V=V+Math.imul(a,g0)|0,A=A+Math.imul(y,P0)|0,O=O+Math.imul(y,W0)|0,O=O+Math.imul(h,P0)|0,V=V+Math.imul(h,W0)|0;var YU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,A=Math.imul(I0,z0),O=Math.imul(I0,x),O=O+Math.imul(C0,z0)|0,V=Math.imul(C0,x),A=A+Math.imul(K0,e)|0,O=O+Math.imul(K0,U0)|0,O=O+Math.imul(T0,e)|0,V=V+Math.imul(T0,U0)|0,A=A+Math.imul(m,E0)|0,O=O+Math.imul(m,L0)|0,O=O+Math.imul(Z0,E0)|0,V=V+Math.imul(Z0,L0)|0,A=A+Math.imul(c,q0)|0,O=O+Math.imul(c,g0)|0,O=O+Math.imul(o,q0)|0,V=V+Math.imul(o,g0)|0,A=A+Math.imul(s,P0)|0,O=O+Math.imul(s,W0)|0,O=O+Math.imul(a,P0)|0,V=V+Math.imul(a,W0)|0;var JU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,A=Math.imul(I0,e),O=Math.imul(I0,U0),O=O+Math.imul(C0,e)|0,V=Math.imul(C0,U0),A=A+Math.imul(K0,E0)|0,O=O+Math.imul(K0,L0)|0,O=O+Math.imul(T0,E0)|0,V=V+Math.imul(T0,L0)|0,A=A+Math.imul(m,q0)|0,O=O+Math.imul(m,g0)|0,O=O+Math.imul(Z0,q0)|0,V=V+Math.imul(Z0,g0)|0,A=A+Math.imul(c,P0)|0,O=O+Math.imul(c,W0)|0,O=O+Math.imul(o,P0)|0,V=V+Math.imul(o,W0)|0;var $U=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,A=Math.imul(I0,E0),O=Math.imul(I0,L0),O=O+Math.imul(C0,E0)|0,V=Math.imul(C0,L0),A=A+Math.imul(K0,q0)|0,O=O+Math.imul(K0,g0)|0,O=O+Math.imul(T0,q0)|0,V=V+Math.imul(T0,g0)|0,A=A+Math.imul(m,P0)|0,O=O+Math.imul(m,W0)|0,O=O+Math.imul(Z0,P0)|0,V=V+Math.imul(Z0,W0)|0;var GU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,A=Math.imul(I0,q0),O=Math.imul(I0,g0),O=O+Math.imul(C0,q0)|0,V=Math.imul(C0,g0),A=A+Math.imul(K0,P0)|0,O=O+Math.imul(K0,W0)|0,O=O+Math.imul(T0,P0)|0,V=V+Math.imul(T0,W0)|0;var AU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,A=Math.imul(I0,P0),O=Math.imul(I0,W0),O=O+Math.imul(C0,P0)|0,V=Math.imul(C0,W0);var VU=(K+A|0)+((O&8191)<<13)|0;if(K=(V+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,E[0]=s0,E[1]=c0,E[2]=y0,E[3]=b0,E[4]=l0,E[5]=e0,E[6]=a0,E[7]=i0,E[8]=UU,E[9]=OU,E[10]=ZU,E[11]=XU,E[12]=QU,E[13]=YU,E[14]=JU,E[15]=$U,E[16]=GU,E[17]=AU,E[18]=VU,K!==0)E[19]=K,$.length++;return $};if(!Math.imul)k=j;function B(U,X,$){$.negative=X.negative^U.negative,$.length=U.length+X.length;var Z=0,Y=0;for(var E=0;E<$.length-1;E++){var K=Y;Y=0;var A=Z&67108863,O=Math.min(E,X.length-1);for(var V=Math.max(0,E-U.length+1);V<=O;V++){var D=E-V,S=U.words[D]|0,_=X.words[V]|0,N=S*_,p=N&67108863;K=K+(N/67108864|0)|0,p=p+A|0,A=p&67108863,K=K+(p>>>26)|0,Y+=K>>>26,K&=67108863}$.words[E]=A,Z=K,K=Y}if(Z!==0)$.words[E]=Z;else $.length--;return $.strip()}function v(U,X,$){var Z=new g;return Z.mulp(U,X,$)}J.prototype.mulTo=function(U,X){var $,Z=this.length+U.length;if(this.length===10&&U.length===10)$=k(this,U,X);else if(Z<63)$=j(this,U,X);else if(Z<1024)$=B(this,U,X);else $=v(this,U,X);return $};function g(U,X){this.x=U,this.y=X}g.prototype.makeRBT=function(U){var X=Array(U),$=J.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,$,U);return X},g.prototype.revBin=function(U,X,$){if(U===0||U===$-1)return U;var Z=0;for(var Y=0;Y<X;Y++)Z|=(U&1)<<X-Y-1,U>>=1;return Z},g.prototype.permute=function(U,X,$,Z,Y,E){for(var K=0;K<E;K++)Z[K]=X[U[K]],Y[K]=$[U[K]]},g.prototype.transform=function(U,X,$,Z,Y,E){this.permute(E,U,X,$,Z,Y);for(var K=1;K<Y;K<<=1){var A=K<<1,O=Math.cos(2*Math.PI/A),V=Math.sin(2*Math.PI/A);for(var D=0;D<Y;D+=A){var S=O,_=V;for(var N=0;N<K;N++){var p=$[D+N],n=Z[D+N],V0=$[D+N+K],r=Z[D+N+K],b=S*V0-_*r;if(r=S*r+_*V0,V0=b,$[D+N]=p+V0,Z[D+N]=n+r,$[D+N+K]=p-V0,Z[D+N+K]=n-r,N!==A)b=O*S-V*_,_=O*_+V*S,S=b}}}},g.prototype.guessLen13b=function(U,X){var $=Math.max(X,U)|1,Z=$&1,Y=0;for($=$/2|0;$;$=$>>>1)Y++;return 1<<Y+1+Z},g.prototype.conjugate=function(U,X,$){if($<=1)return;for(var Z=0;Z<$/2;Z++){var Y=U[Z];U[Z]=U[$-Z-1],U[$-Z-1]=Y,Y=X[Z],X[Z]=-X[$-Z-1],X[$-Z-1]=-Y}},g.prototype.normalize13b=function(U,X){var $=0;for(var Z=0;Z<X/2;Z++){var Y=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+$;if(U[Z]=Y&67108863,Y<67108864)$=0;else $=Y/67108864|0}return U},g.prototype.convert13b=function(U,X,$,Z){var Y=0;for(var E=0;E<X;E++)Y=Y+(U[E]|0),$[2*E]=Y&8191,Y=Y>>>13,$[2*E+1]=Y&8191,Y=Y>>>13;for(E=2*X;E<Z;++E)$[E]=0;T(Y===0),T((Y&-8192)===0)},g.prototype.stub=function(U){var X=Array(U);for(var $=0;$<U;$++)X[$]=0;return X},g.prototype.mulp=function(U,X,$){var Z=2*this.guessLen13b(U.length,X.length),Y=this.makeRBT(Z),E=this.stub(Z),K=Array(Z),A=Array(Z),O=Array(Z),V=Array(Z),D=Array(Z),S=Array(Z),_=$.words;_.length=Z,this.convert13b(U.words,U.length,K,Z),this.convert13b(X.words,X.length,V,Z),this.transform(K,E,A,O,Z,Y),this.transform(V,E,D,S,Z,Y);for(var N=0;N<Z;N++){var p=A[N]*D[N]-O[N]*S[N];O[N]=A[N]*S[N]+O[N]*D[N],A[N]=p}return this.conjugate(A,O,Z),this.transform(A,O,_,E,Z,Y),this.conjugate(_,E,Z),this.normalize13b(_,Z),$.negative=U.negative^X.negative,$.length=U.length+X.length,$.strip()},J.prototype.mul=function(U){var X=new J(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},J.prototype.mulf=function(U){var X=new J(null);return X.words=Array(this.length+U.length),v(this,U,X)},J.prototype.imul=function(U){return this.clone().mulTo(U,this)},J.prototype.imuln=function(U){T(typeof U==="number"),T(U<67108864);var X=0;for(var $=0;$<this.length;$++){var Z=(this.words[$]|0)*U,Y=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=Y>>>26,this.words[$]=Y&67108863}if(X!==0)this.words[$]=X,this.length++;return this.length=U===0?1:this.length,this},J.prototype.muln=function(U){return this.clone().imuln(U)},J.prototype.sqr=function(){return this.mul(this)},J.prototype.isqr=function(){return this.imul(this.clone())},J.prototype.pow=function(U){var X=P(U);if(X.length===0)return new J(1);var $=this;for(var Z=0;Z<X.length;Z++,$=$.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var Y=$.sqr();Z<X.length;Z++,Y=Y.sqr()){if(X[Z]===0)continue;$=$.mul(Y)}return $},J.prototype.iushln=function(U){T(typeof U==="number"&&U>=0);var X=U%26,$=(U-X)/26,Z=67108863>>>26-X<<26-X,Y;if(X!==0){var E=0;for(Y=0;Y<this.length;Y++){var K=this.words[Y]&Z,A=(this.words[Y]|0)-K<<X;this.words[Y]=A|E,E=K>>>26-X}if(E)this.words[Y]=E,this.length++}if($!==0){for(Y=this.length-1;Y>=0;Y--)this.words[Y+$]=this.words[Y];for(Y=0;Y<$;Y++)this.words[Y]=0;this.length+=$}return this.strip()},J.prototype.ishln=function(U){return T(this.negative===0),this.iushln(U)},J.prototype.iushrn=function(U,X,$){T(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var Y=U%26,E=Math.min((U-Y)/26,this.length),K=67108863^67108863>>>Y<<Y,A=$;if(Z-=E,Z=Math.max(0,Z),A){for(var O=0;O<E;O++)A.words[O]=this.words[O];A.length=E}if(E===0);else if(this.length>E){this.length-=E;for(O=0;O<this.length;O++)this.words[O]=this.words[O+E]}else this.words[0]=0,this.length=1;var V=0;for(O=this.length-1;O>=0&&(V!==0||O>=Z);O--){var D=this.words[O]|0;this.words[O]=V<<26-Y|D>>>Y,V=D&K}if(A&&V!==0)A.words[A.length++]=V;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},J.prototype.ishrn=function(U,X,$){return T(this.negative===0),this.iushrn(U,X,$)},J.prototype.shln=function(U){return this.clone().ishln(U)},J.prototype.ushln=function(U){return this.clone().iushln(U)},J.prototype.shrn=function(U){return this.clone().ishrn(U)},J.prototype.ushrn=function(U){return this.clone().iushrn(U)},J.prototype.testn=function(U){T(typeof U==="number"&&U>=0);var X=U%26,$=(U-X)/26,Z=1<<X;if(this.length<=$)return!1;var Y=this.words[$];return!!(Y&Z)},J.prototype.imaskn=function(U){T(typeof U==="number"&&U>=0);var X=U%26,$=(U-X)/26;if(T(this.negative===0,"imaskn works only with positive numbers"),this.length<=$)return this;if(X!==0)$++;if(this.length=Math.min($,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},J.prototype.maskn=function(U){return this.clone().imaskn(U)},J.prototype.iaddn=function(U){if(T(typeof U==="number"),T(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},J.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},J.prototype.isubn=function(U){if(T(typeof U==="number"),T(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},J.prototype.addn=function(U){return this.clone().iaddn(U)},J.prototype.subn=function(U){return this.clone().isubn(U)},J.prototype.iabs=function(){return this.negative=0,this},J.prototype.abs=function(){return this.clone().iabs()},J.prototype._ishlnsubmul=function(U,X,$){var Z=U.length+$,Y;this._expand(Z);var E,K=0;for(Y=0;Y<U.length;Y++){E=(this.words[Y+$]|0)+K;var A=(U.words[Y]|0)*X;E-=A&67108863,K=(E>>26)-(A/67108864|0),this.words[Y+$]=E&67108863}for(;Y<this.length-$;Y++)E=(this.words[Y+$]|0)+K,K=E>>26,this.words[Y+$]=E&67108863;if(K===0)return this.strip();T(K===-1),K=0;for(Y=0;Y<this.length;Y++)E=-(this.words[Y]|0)+K,K=E>>26,this.words[Y]=E&67108863;return this.negative=1,this.strip()},J.prototype._wordDiv=function(U,X){var $=this.length-U.length,Z=this.clone(),Y=U,E=Y.words[Y.length-1]|0,K=this._countBits(E);if($=26-K,$!==0)Y=Y.ushln($),Z.iushln($),E=Y.words[Y.length-1]|0;var A=Z.length-Y.length,O;if(X!=="mod"){O=new J(null),O.length=A+1,O.words=Array(O.length);for(var V=0;V<O.length;V++)O.words[V]=0}var D=Z.clone()._ishlnsubmul(Y,1,A);if(D.negative===0){if(Z=D,O)O.words[A]=1}for(var S=A-1;S>=0;S--){var _=(Z.words[Y.length+S]|0)*67108864+(Z.words[Y.length+S-1]|0);_=Math.min(_/E|0,67108863),Z._ishlnsubmul(Y,_,S);while(Z.negative!==0)if(_--,Z.negative=0,Z._ishlnsubmul(Y,1,S),!Z.isZero())Z.negative^=1;if(O)O.words[S]=_}if(O)O.strip();if(Z.strip(),X!=="div"&&$!==0)Z.iushrn($);return{div:O||null,mod:Z}},J.prototype.divmod=function(U,X,$){if(T(!U.isZero()),this.isZero())return{div:new J(0),mod:new J(0)};var Z,Y,E;if(this.negative!==0&&U.negative===0){if(E=this.neg().divmod(U,X),X!=="mod")Z=E.div.neg();if(X!=="div"){if(Y=E.mod.neg(),$&&Y.negative!==0)Y.iadd(U)}return{div:Z,mod:Y}}if(this.negative===0&&U.negative!==0){if(E=this.divmod(U.neg(),X),X!=="mod")Z=E.div.neg();return{div:Z,mod:E.mod}}if((this.negative&U.negative)!==0){if(E=this.neg().divmod(U.neg(),X),X!=="div"){if(Y=E.mod.neg(),$&&Y.negative!==0)Y.isub(U)}return{div:E.div,mod:Y}}if(U.length>this.length||this.cmp(U)<0)return{div:new J(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new J(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new J(this.modn(U.words[0]))}}return this._wordDiv(U,X)},J.prototype.div=function(U){return this.divmod(U,"div",!1).div},J.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},J.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},J.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var $=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),Y=U.andln(1),E=$.cmp(Z);if(E<0||Y===1&&E===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},J.prototype.modn=function(U){T(U<=67108863);var X=67108864%U,$=0;for(var Z=this.length-1;Z>=0;Z--)$=(X*$+(this.words[Z]|0))%U;return $},J.prototype.idivn=function(U){T(U<=67108863);var X=0;for(var $=this.length-1;$>=0;$--){var Z=(this.words[$]|0)+X*67108864;this.words[$]=Z/U|0,X=Z%U}return this.strip()},J.prototype.divn=function(U){return this.clone().idivn(U)},J.prototype.egcd=function(U){T(U.negative===0),T(!U.isZero());var X=this,$=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),Y=new J(0),E=new J(0),K=new J(1),A=0;while(X.isEven()&&$.isEven())X.iushrn(1),$.iushrn(1),++A;var O=$.clone(),V=X.clone();while(!X.isZero()){for(var D=0,S=1;(X.words[0]&S)===0&&D<26;++D,S<<=1);if(D>0){X.iushrn(D);while(D-- >0){if(Z.isOdd()||Y.isOdd())Z.iadd(O),Y.isub(V);Z.iushrn(1),Y.iushrn(1)}}for(var _=0,N=1;($.words[0]&N)===0&&_<26;++_,N<<=1);if(_>0){$.iushrn(_);while(_-- >0){if(E.isOdd()||K.isOdd())E.iadd(O),K.isub(V);E.iushrn(1),K.iushrn(1)}}if(X.cmp($)>=0)X.isub($),Z.isub(E),Y.isub(K);else $.isub(X),E.isub(Z),K.isub(Y)}return{a:E,b:K,gcd:$.iushln(A)}},J.prototype._invmp=function(U){T(U.negative===0),T(!U.isZero());var X=this,$=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),Y=new J(0),E=$.clone();while(X.cmpn(1)>0&&$.cmpn(1)>0){for(var K=0,A=1;(X.words[0]&A)===0&&K<26;++K,A<<=1);if(K>0){X.iushrn(K);while(K-- >0){if(Z.isOdd())Z.iadd(E);Z.iushrn(1)}}for(var O=0,V=1;($.words[0]&V)===0&&O<26;++O,V<<=1);if(O>0){$.iushrn(O);while(O-- >0){if(Y.isOdd())Y.iadd(E);Y.iushrn(1)}}if(X.cmp($)>=0)X.isub($),Z.isub(Y);else $.isub(X),Y.isub(Z)}var D;if(X.cmpn(1)===0)D=Z;else D=Y;if(D.cmpn(0)<0)D.iadd(U);return D},J.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),$=U.clone();X.negative=0,$.negative=0;for(var Z=0;X.isEven()&&$.isEven();Z++)X.iushrn(1),$.iushrn(1);do{while(X.isEven())X.iushrn(1);while($.isEven())$.iushrn(1);var Y=X.cmp($);if(Y<0){var E=X;X=$,$=E}else if(Y===0||$.cmpn(1)===0)break;X.isub($)}while(!0);return $.iushln(Z)},J.prototype.invm=function(U){return this.egcd(U).a.umod(U)},J.prototype.isEven=function(){return(this.words[0]&1)===0},J.prototype.isOdd=function(){return(this.words[0]&1)===1},J.prototype.andln=function(U){return this.words[0]&U},J.prototype.bincn=function(U){T(typeof U==="number");var X=U%26,$=(U-X)/26,Z=1<<X;if(this.length<=$)return this._expand($+1),this.words[$]|=Z,this;var Y=Z;for(var E=$;Y!==0&&E<this.length;E++){var K=this.words[E]|0;K+=Y,Y=K>>>26,K&=67108863,this.words[E]=K}if(Y!==0)this.words[E]=Y,this.length++;return this},J.prototype.isZero=function(){return this.length===1&&this.words[0]===0},J.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var $;if(this.length>1)$=1;else{if(X)U=-U;T(U<=67108863,"Number is too big");var Z=this.words[0]|0;$=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-$|0;return $},J.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},J.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var $=this.length-1;$>=0;$--){var Z=this.words[$]|0,Y=U.words[$]|0;if(Z===Y)continue;if(Z<Y)X=-1;else if(Z>Y)X=1;break}return X},J.prototype.gtn=function(U){return this.cmpn(U)===1},J.prototype.gt=function(U){return this.cmp(U)===1},J.prototype.gten=function(U){return this.cmpn(U)>=0},J.prototype.gte=function(U){return this.cmp(U)>=0},J.prototype.ltn=function(U){return this.cmpn(U)===-1},J.prototype.lt=function(U){return this.cmp(U)===-1},J.prototype.lten=function(U){return this.cmpn(U)<=0},J.prototype.lte=function(U){return this.cmp(U)<=0},J.prototype.eqn=function(U){return this.cmpn(U)===0},J.prototype.eq=function(U){return this.cmp(U)===0},J.red=function(U){return new u(U)},J.prototype.toRed=function(U){return T(!this.red,"Already a number in reduction context"),T(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},J.prototype.fromRed=function(){return T(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},J.prototype._forceRed=function(U){return this.red=U,this},J.prototype.forceRed=function(U){return T(!this.red,"Already a number in reduction context"),this._forceRed(U)},J.prototype.redAdd=function(U){return T(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},J.prototype.redIAdd=function(U){return T(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},J.prototype.redSub=function(U){return T(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},J.prototype.redISub=function(U){return T(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},J.prototype.redShl=function(U){return T(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},J.prototype.redMul=function(U){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},J.prototype.redIMul=function(U){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},J.prototype.redSqr=function(){return T(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},J.prototype.redISqr=function(){return T(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},J.prototype.redSqrt=function(){return T(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},J.prototype.redInvm=function(){return T(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},J.prototype.redNeg=function(){return T(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},J.prototype.redPow=function(U){return T(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new J(X,16),this.n=this.p.bitLength(),this.k=new J(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new J(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,$;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),$=X.bitLength();while($>this.n);var Z=$<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}F(d,w),d.prototype.split=function(U,X){var $=4194303,Z=Math.min(U.length,9);for(var Y=0;Y<Z;Y++)X.words[Y]=U.words[Y];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var E=U.words[9];X.words[X.length++]=E&$;for(Y=10;Y<U.length;Y++){var K=U.words[Y]|0;U.words[Y-10]=(K&$)<<4|E>>>22,E=K}if(E>>>=22,U.words[Y-10]=E,E===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var $=0;$<U.length;$++){var Z=U.words[$]|0;X+=Z*977,U.words[$]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}F(Y0,w);function G0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}F(G0,w);function J0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}F(J0,w),J0.prototype.imulK=function(U){var X=0;for(var $=0;$<U.length;$++){var Z=(U.words[$]|0)*19+X,Y=Z&67108863;Z>>>=26,U.words[$]=Y,X=Z}if(X!==0)U.words[U.length++]=X;return U},J._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new G0;else if(U==="p25519")X=new J0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=J._prime(U);this.m=X.p,this.prime=X}else T(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){T(U.negative===0,"red works only with positives"),T(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){T((U.negative|X.negative)===0,"red works only with positives"),T(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var $=U.add(X);if($.cmp(this.m)>=0)$.isub(this.m);return $._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var $=U.iadd(X);if($.cmp(this.m)>=0)$.isub(this.m);return $},u.prototype.sub=function(U,X){this._verify2(U,X);var $=U.sub(X);if($.cmpn(0)<0)$.iadd(this.m);return $._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var $=U.isub(X);if($.cmpn(0)<0)$.iadd(this.m);return $},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(T(X%2===1),X===3){var $=this.m.add(new J(1)).iushrn(2);return this.pow(U,$)}var Z=this.m.subn(1),Y=0;while(!Z.isZero()&&Z.andln(1)===0)Y++,Z.iushrn(1);T(!Z.isZero());var E=new J(1).toRed(this),K=E.redNeg(),A=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new J(2*O*O).toRed(this);while(this.pow(O,A).cmp(K)!==0)O.redIAdd(K);var V=this.pow(O,Z),D=this.pow(U,Z.addn(1).iushrn(1)),S=this.pow(U,Z),_=Y;while(S.cmp(E)!==0){var N=S;for(var p=0;N.cmp(E)!==0;p++)N=N.redSqr();T(p<_);var n=this.pow(V,new J(1).iushln(_-p-1));D=D.redMul(n),V=n.redSqr(),S=S.redMul(V),_=p}return D},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new J(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var $=4,Z=Array(1<<$);Z[0]=new J(1).toRed(this),Z[1]=U;for(var Y=2;Y<Z.length;Y++)Z[Y]=this.mul(Z[Y-1],U);var E=Z[0],K=0,A=0,O=X.bitLength()%26;if(O===0)O=26;for(Y=X.length-1;Y>=0;Y--){var V=X.words[Y];for(var D=O-1;D>=0;D--){var S=V>>D&1;if(E!==Z[0])E=this.sqr(E);if(S===0&&K===0){A=0;continue}if(K<<=1,K|=S,A++,A!==$&&(Y!==0||D!==0))continue;E=this.mul(E,Z[K]),A=0,K=0}O=26}return E},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},J.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new J(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)}F(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var $=U.imul(X),Z=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=$.isub(Z).iushrn(this.shift),E=Y;if(Y.cmp(this.m)>=0)E=Y.isub(this.m);else if(Y.cmpn(0)<0)E=Y.iadd(this.m);return E._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new J(0)._forceRed(this);var $=U.mul(X),Z=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=$.isub(Z).iushrn(this.shift),E=Y;if(Y.cmp(this.m)>=0)E=Y.isub(this.m);else if(Y.cmpn(0)<0)E=Y.iadd(this.m);return E._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof G>"u"||G,Q)}),UO=$0((Q,G)=>{G.exports=I;function I(L,T){if(!L)throw Error(T||"Assertion failed")}I.equal=function(L,T,F){if(L!=T)throw Error(F||"Assertion failed: "+L+" != "+T)}}),mQ=$0((Q)=>{var G=Q;function I(F,J){if(Array.isArray(F))return F.slice();if(!F)return[];var M=[];if(typeof F!=="string"){for(var z=0;z<F.length;z++)M[z]=F[z]|0;return M}if(J==="hex"){if(F=F.replace(/[^a-z0-9]+/ig,""),F.length%2!==0)F="0"+F;for(var z=0;z<F.length;z+=2)M.push(parseInt(F[z]+F[z+1],16))}else for(var z=0;z<F.length;z++){var W=F.charCodeAt(z),H=W>>8,C=W&255;if(H)M.push(H,C);else M.push(C)}return M}G.toArray=I;function L(F){if(F.length===1)return"0"+F;else return F}G.zero2=L;function T(F){var J="";for(var M=0;M<F.length;M++)J+=L(F[M].toString(16));return J}G.toHex=T,G.encode=function(F,J){if(J==="hex")return T(F);else return F}}),fU=$0((Q)=>{var G=Q,I=tU(),L=UO(),T=mQ();G.assert=L,G.toArray=T.toArray,G.zero2=T.zero2,G.toHex=T.toHex,G.encode=T.encode;function F(H,C,R){var q=Array(Math.max(H.bitLength(),R)+1),P;for(P=0;P<q.length;P+=1)q[P]=0;var j=1<<C+1,k=H.clone();for(P=0;P<q.length;P++){var B,v=k.andln(j-1);if(k.isOdd()){if(v>(j>>1)-1)B=(j>>1)-v;else B=v;k.isubn(B)}else B=0;q[P]=B,k.iushrn(1)}return q}G.getNAF=F;function J(H,C){var R=[[],[]];H=H.clone(),C=C.clone();var q=0,P=0,j;while(H.cmpn(-q)>0||C.cmpn(-P)>0){var k=H.andln(3)+q&3,B=C.andln(3)+P&3;if(k===3)k=-1;if(B===3)B=-1;var v;if((k&1)===0)v=0;else if(j=H.andln(7)+q&7,(j===3||j===5)&&B===2)v=-k;else v=k;R[0].push(v);var g;if((B&1)===0)g=0;else if(j=C.andln(7)+P&7,(j===3||j===5)&&k===2)g=-B;else g=B;if(R[1].push(g),2*q===v+1)q=1-q;if(2*P===g+1)P=1-P;H.iushrn(1),C.iushrn(1)}return R}G.getJSF=J;function M(H,C,R){var q="_"+C;H.prototype[C]=function(){return this[q]!==void 0?this[q]:this[q]=R.call(this)}}G.cachedProperty=M;function z(H){return typeof H==="string"?G.toArray(H,"hex"):H}G.parseBytes=z;function W(H){return new I(H,"hex","le")}G.intFromLE=W}),sQ=$0((Q,G)=>{var I;G.exports=function(F){if(!I)I=new L(null);return I.generate(F)};function L(F){this.rand=F}if(G.exports.Rand=L,L.prototype.generate=function(F){return this._rand(F)},L.prototype._rand=function(F){if(this.rand.getBytes)return this.rand.getBytes(F);var J=new Uint8Array(F);for(var M=0;M<J.length;M++)J[M]=this.rand.getByte();return J},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)L.prototype._rand=function(F){var J=new Uint8Array(F);return self.crypto.getRandomValues(J),J};else if(self.msCrypto&&self.msCrypto.getRandomValues)L.prototype._rand=function(F){var J=new Uint8Array(F);return self.msCrypto.getRandomValues(J),J};else if(typeof window==="object")L.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(T=(_U(),h0(jU)),typeof T.randomBytes!=="function")throw Error("Not supported");L.prototype._rand=function(F){return T.randomBytes(F)}}catch(F){}var T}),XZ=$0((Q,G)=>{var I=tU(),L=fU(),T=L.getNAF,F=L.getJSF,J=L.assert;function M(W,H){this.type=W,this.p=new I(H.p,16),this.red=H.prime?I.red(H.prime):I.mont(this.p),this.zero=new I(0).toRed(this.red),this.one=new I(1).toRed(this.red),this.two=new I(2).toRed(this.red),this.n=H.n&&new I(H.n,16),this.g=H.g&&this.pointFromJSON(H.g,H.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var C=this.n&&this.p.div(this.n);if(!C||C.cmpn(100)>0)this.redN=null;else this._maxwellTrick=!0,this.redN=this.n.toRed(this.red)}G.exports=M,M.prototype.point=function(){throw Error("Not implemented")},M.prototype.validate=function(){throw Error("Not implemented")},M.prototype._fixedNafMul=function(W,H){J(W.precomputed);var C=W._getDoubles(),R=T(H,1,this._bitLength),q=(1<<C.step+1)-(C.step%2===0?2:1);q/=3;var P=[],j,k;for(j=0;j<R.length;j+=C.step){k=0;for(var B=j+C.step-1;B>=j;B--)k=(k<<1)+R[B];P.push(k)}var v=this.jpoint(null,null,null),g=this.jpoint(null,null,null);for(var f=q;f>0;f--){for(j=0;j<P.length;j++)if(k=P[j],k===f)g=g.mixedAdd(C.points[j]);else if(k===-f)g=g.mixedAdd(C.points[j].neg());v=v.add(g)}return v.toP()},M.prototype._wnafMul=function(W,H){var C=4,R=W._getNAFPoints(C);C=R.wnd;var q=R.points,P=T(H,C,this._bitLength),j=this.jpoint(null,null,null);for(var k=P.length-1;k>=0;k--){for(var B=0;k>=0&&P[k]===0;k--)B++;if(k>=0)B++;if(j=j.dblp(B),k<0)break;var v=P[k];if(J(v!==0),W.type==="affine")if(v>0)j=j.mixedAdd(q[v-1>>1]);else j=j.mixedAdd(q[-v-1>>1].neg());else if(v>0)j=j.add(q[v-1>>1]);else j=j.add(q[-v-1>>1].neg())}return W.type==="affine"?j.toP():j},M.prototype._wnafMulAdd=function(W,H,C,R,q){var P=this._wnafT1,j=this._wnafT2,k=this._wnafT3,B=0,v,g,f;for(v=0;v<R;v++){f=H[v];var w=f._getNAFPoints(W);P[v]=w.wnd,j[v]=w.points}for(v=R-1;v>=1;v-=2){var d=v-1,Y0=v;if(P[d]!==1||P[Y0]!==1){k[d]=T(C[d],P[d],this._bitLength),k[Y0]=T(C[Y0],P[Y0],this._bitLength),B=Math.max(k[d].length,B),B=Math.max(k[Y0].length,B);continue}var G0=[H[d],null,null,H[Y0]];if(H[d].y.cmp(H[Y0].y)===0)G0[1]=H[d].add(H[Y0]),G0[2]=H[d].toJ().mixedAdd(H[Y0].neg());else if(H[d].y.cmp(H[Y0].y.redNeg())===0)G0[1]=H[d].toJ().mixedAdd(H[Y0]),G0[2]=H[d].add(H[Y0].neg());else G0[1]=H[d].toJ().mixedAdd(H[Y0]),G0[2]=H[d].toJ().mixedAdd(H[Y0].neg());var J0=[-3,-1,-5,-7,0,7,5,1,3],u=F(C[d],C[Y0]);B=Math.max(u[0].length,B),k[d]=Array(B),k[Y0]=Array(B);for(g=0;g<B;g++){var O0=u[0][g]|0,U=u[1][g]|0;k[d][g]=J0[(O0+1)*3+(U+1)],k[Y0][g]=0,j[d]=G0}}var X=this.jpoint(null,null,null),$=this._wnafT4;for(v=B;v>=0;v--){var Z=0;while(v>=0){var Y=!0;for(g=0;g<R;g++)if($[g]=k[g][v]|0,$[g]!==0)Y=!1;if(!Y)break;Z++,v--}if(v>=0)Z++;if(X=X.dblp(Z),v<0)break;for(g=0;g<R;g++){var E=$[g];if(E===0)continue;else if(E>0)f=j[g][E-1>>1];else if(E<0)f=j[g][-E-1>>1].neg();if(f.type==="affine")X=X.mixedAdd(f);else X=X.add(f)}}for(v=0;v<R;v++)j[v]=null;if(q)return X;else return X.toP()};function z(W,H){this.curve=W,this.type=H,this.precomputed=null}M.BasePoint=z,z.prototype.eq=function(){throw Error("Not implemented")},z.prototype.validate=function(){return this.curve.validate(this)},M.prototype.decodePoint=function(W,H){W=L.toArray(W,H);var C=this.p.byteLength();if((W[0]===4||W[0]===6||W[0]===7)&&W.length-1===2*C){if(W[0]===6)J(W[W.length-1]%2===0);else if(W[0]===7)J(W[W.length-1]%2===1);var R=this.point(W.slice(1,1+C),W.slice(1+C,1+2*C));return R}else if((W[0]===2||W[0]===3)&&W.length-1===C)return this.pointFromX(W.slice(1,1+C),W[0]===3);throw Error("Unknown point format")},z.prototype.encodeCompressed=function(W){return this.encode(W,!0)},z.prototype._encode=function(W){var H=this.curve.p.byteLength(),C=this.getX().toArray("be",H);if(W)return[this.getY().isEven()?2:3].concat(C);return[4].concat(C,this.getY().toArray("be",H))},z.prototype.encode=function(W,H){return L.encode(this._encode(H),W)},z.prototype.precompute=function(W){if(this.precomputed)return this;var H={doubles:null,naf:null,beta:null};return H.naf=this._getNAFPoints(8),H.doubles=this._getDoubles(4,W),H.beta=this._getBeta(),this.precomputed=H,this},z.prototype._hasDoubles=function(W){if(!this.precomputed)return!1;var H=this.precomputed.doubles;if(!H)return!1;return H.points.length>=Math.ceil((W.bitLength()+1)/H.step)},z.prototype._getDoubles=function(W,H){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var C=[this],R=this;for(var q=0;q<H;q+=W){for(var P=0;P<W;P++)R=R.dbl();C.push(R)}return{step:W,points:C}},z.prototype._getNAFPoints=function(W){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var H=[this],C=(1<<W)-1,R=C===1?null:this.dbl();for(var q=1;q<C;q++)H[q]=H[q-1].add(R);return{wnd:W,points:H}},z.prototype._getBeta=function(){return null},z.prototype.dblp=function(W){var H=this;for(var C=0;C<W;C++)H=H.dbl();return H}}),AG=$0((Q,G)=>{if(typeof Object.create==="function")G.exports=function(I,L){if(L)I.super_=L,I.prototype=Object.create(L.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}})};else G.exports=function(I,L){if(L){I.super_=L;var T=function(){};T.prototype=L.prototype,I.prototype=new T,I.prototype.constructor=I}}}),BU=$0((Q,G)=>{try{if(I=(xQ(),h0(gQ)),typeof I.inherits!=="function")throw"";G.exports=I.inherits}catch(L){G.exports=AG()}var I}),VG=$0((Q,G)=>{var I=fU(),L=tU(),T=BU(),F=XZ(),J=I.assert;function M(H){F.call(this,"short",H),this.a=new L(H.a,16).toRed(this.red),this.b=new L(H.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(H),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}T(M,F),G.exports=M,M.prototype._getEndomorphism=function(H){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var C,R;if(H.beta)C=new L(H.beta,16).toRed(this.red);else{var q=this._getEndoRoots(this.p);C=q[0].cmp(q[1])<0?q[0]:q[1],C=C.toRed(this.red)}if(H.lambda)R=new L(H.lambda,16);else{var P=this._getEndoRoots(this.n);if(this.g.mul(P[0]).x.cmp(this.g.x.redMul(C))===0)R=P[0];else R=P[1],J(this.g.mul(R).x.cmp(this.g.x.redMul(C))===0)}var j;if(H.basis)j=H.basis.map(function(k){return{a:new L(k.a,16),b:new L(k.b,16)}});else j=this._getEndoBasis(R);return{beta:C,lambda:R,basis:j}},M.prototype._getEndoRoots=function(H){var C=H===this.p?this.red:L.mont(H),R=new L(2).toRed(C).redInvm(),q=R.redNeg(),P=new L(3).toRed(C).redNeg().redSqrt().redMul(R),j=q.redAdd(P).fromRed(),k=q.redSub(P).fromRed();return[j,k]},M.prototype._getEndoBasis=function(H){var C=this.n.ushrn(Math.floor(this.n.bitLength()/2)),R=H,q=this.n.clone(),P=new L(1),j=new L(0),k=new L(0),B=new L(1),v,g,f,w,d,Y0,G0,J0=0,u,O0;while(R.cmpn(0)!==0){var U=q.div(R);u=q.sub(U.mul(R)),O0=k.sub(U.mul(P));var X=B.sub(U.mul(j));if(!f&&u.cmp(C)<0)v=G0.neg(),g=P,f=u.neg(),w=O0;else if(f&&++J0===2)break;G0=u,q=R,R=u,k=P,P=O0,B=j,j=X}d=u.neg(),Y0=O0;var $=f.sqr().add(w.sqr()),Z=d.sqr().add(Y0.sqr());if(Z.cmp($)>=0)d=v,Y0=g;if(f.negative)f=f.neg(),w=w.neg();if(d.negative)d=d.neg(),Y0=Y0.neg();return[{a:f,b:w},{a:d,b:Y0}]},M.prototype._endoSplit=function(H){var C=this.endo.basis,R=C[0],q=C[1],P=q.b.mul(H).divRound(this.n),j=R.b.neg().mul(H).divRound(this.n),k=P.mul(R.a),B=j.mul(q.a),v=P.mul(R.b),g=j.mul(q.b),f=H.sub(k).sub(B),w=v.add(g).neg();return{k1:f,k2:w}},M.prototype.pointFromX=function(H,C){if(H=new L(H,16),!H.red)H=H.toRed(this.red);var R=H.redSqr().redMul(H).redIAdd(H.redMul(this.a)).redIAdd(this.b),q=R.redSqrt();if(q.redSqr().redSub(R).cmp(this.zero)!==0)throw Error("invalid point");var P=q.fromRed().isOdd();if(C&&!P||!C&&P)q=q.redNeg();return this.point(H,q)},M.prototype.validate=function(H){if(H.inf)return!0;var{x:C,y:R}=H,q=this.a.redMul(C),P=C.redSqr().redMul(C).redIAdd(q).redIAdd(this.b);return R.redSqr().redISub(P).cmpn(0)===0},M.prototype._endoWnafMulAdd=function(H,C,R){var q=this._endoWnafT1,P=this._endoWnafT2;for(var j=0;j<H.length;j++){var k=this._endoSplit(C[j]),B=H[j],v=B._getBeta();if(k.k1.negative)k.k1.ineg(),B=B.neg(!0);if(k.k2.negative)k.k2.ineg(),v=v.neg(!0);q[j*2]=B,q[j*2+1]=v,P[j*2]=k.k1,P[j*2+1]=k.k2}var g=this._wnafMulAdd(1,q,P,j*2,R);for(var f=0;f<j*2;f++)q[f]=null,P[f]=null;return g};function z(H,C,R,q){if(F.BasePoint.call(this,H,"affine"),C===null&&R===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new L(C,16),this.y=new L(R,16),q)this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=!1}}T(z,F.BasePoint),M.prototype.point=function(H,C,R){return new z(this,H,C,R)},M.prototype.pointFromJSON=function(H,C){return z.fromJSON(this,H,C)},z.prototype._getBeta=function(){if(!this.curve.endo)return;var H=this.precomputed;if(H&&H.beta)return H.beta;var C=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(H){var R=this.curve,q=function(P){return R.point(P.x.redMul(R.endo.beta),P.y)};H.beta=C,C.precomputed={beta:null,naf:H.naf&&{wnd:H.naf.wnd,points:H.naf.points.map(q)},doubles:H.doubles&&{step:H.doubles.step,points:H.doubles.points.map(q)}}}return C},z.prototype.toJSON=function(){if(!this.precomputed)return[this.x,this.y];return[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]},z.fromJSON=function(H,C,R){if(typeof C==="string")C=JSON.parse(C);var q=H.point(C[0],C[1],R);if(!C[2])return q;function P(k){return H.point(k[0],k[1],R)}var j=C[2];return q.precomputed={beta:null,doubles:j.doubles&&{step:j.doubles.step,points:[q].concat(j.doubles.points.map(P))},naf:j.naf&&{wnd:j.naf.wnd,points:[q].concat(j.naf.points.map(P))}},q},z.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},z.prototype.isInfinity=function(){return this.inf},z.prototype.add=function(H){if(this.inf)return H;if(H.inf)return this;if(this.eq(H))return this.dbl();if(this.neg().eq(H))return this.curve.point(null,null);if(this.x.cmp(H.x)===0)return this.curve.point(null,null);var C=this.y.redSub(H.y);if(C.cmpn(0)!==0)C=C.redMul(this.x.redSub(H.x).redInvm());var R=C.redSqr().redISub(this.x).redISub(H.x),q=C.redMul(this.x.redSub(R)).redISub(this.y);return this.curve.point(R,q)},z.prototype.dbl=function(){if(this.inf)return this;var H=this.y.redAdd(this.y);if(H.cmpn(0)===0)return this.curve.point(null,null);var C=this.curve.a,R=this.x.redSqr(),q=H.redInvm(),P=R.redAdd(R).redIAdd(R).redIAdd(C).redMul(q),j=P.redSqr().redISub(this.x.redAdd(this.x)),k=P.redMul(this.x.redSub(j)).redISub(this.y);return this.curve.point(j,k)},z.prototype.getX=function(){return this.x.fromRed()},z.prototype.getY=function(){return this.y.fromRed()},z.prototype.mul=function(H){if(H=new L(H,16),this.isInfinity())return this;else if(this._hasDoubles(H))return this.curve._fixedNafMul(this,H);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[H]);else return this.curve._wnafMul(this,H)},z.prototype.mulAdd=function(H,C,R){var q=[this,C],P=[H,R];if(this.curve.endo)return this.curve._endoWnafMulAdd(q,P);else return this.curve._wnafMulAdd(1,q,P,2)},z.prototype.jmulAdd=function(H,C,R){var q=[this,C],P=[H,R];if(this.curve.endo)return this.curve._endoWnafMulAdd(q,P,!0);else return this.curve._wnafMulAdd(1,q,P,2,!0)},z.prototype.eq=function(H){return this===H||this.inf===H.inf&&(this.inf||this.x.cmp(H.x)===0&&this.y.cmp(H.y)===0)},z.prototype.neg=function(H){if(this.inf)return this;var C=this.curve.point(this.x,this.y.redNeg());if(H&&this.precomputed){var R=this.precomputed,q=function(P){return P.neg()};C.precomputed={naf:R.naf&&{wnd:R.naf.wnd,points:R.naf.points.map(q)},doubles:R.doubles&&{step:R.doubles.step,points:R.doubles.points.map(q)}}}return C},z.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var H=this.curve.jpoint(this.x,this.y,this.curve.one);return H};function W(H,C,R,q){if(F.BasePoint.call(this,H,"jacobian"),C===null&&R===null&&q===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new L(0);else this.x=new L(C,16),this.y=new L(R,16),this.z=new L(q,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}T(W,F.BasePoint),M.prototype.jpoint=function(H,C,R){return new W(this,H,C,R)},W.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var H=this.z.redInvm(),C=H.redSqr(),R=this.x.redMul(C),q=this.y.redMul(C).redMul(H);return this.curve.point(R,q)},W.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},W.prototype.add=function(H){if(this.isInfinity())return H;if(H.isInfinity())return this;var C=H.z.redSqr(),R=this.z.redSqr(),q=this.x.redMul(C),P=H.x.redMul(R),j=this.y.redMul(C.redMul(H.z)),k=H.y.redMul(R.redMul(this.z)),B=q.redSub(P),v=j.redSub(k);if(B.cmpn(0)===0)if(v.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var g=B.redSqr(),f=g.redMul(B),w=q.redMul(g),d=v.redSqr().redIAdd(f).redISub(w).redISub(w),Y0=v.redMul(w.redISub(d)).redISub(j.redMul(f)),G0=this.z.redMul(H.z).redMul(B);return this.curve.jpoint(d,Y0,G0)},W.prototype.mixedAdd=function(H){if(this.isInfinity())return H.toJ();if(H.isInfinity())return this;var C=this.z.redSqr(),R=this.x,q=H.x.redMul(C),P=this.y,j=H.y.redMul(C).redMul(this.z),k=R.redSub(q),B=P.redSub(j);if(k.cmpn(0)===0)if(B.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var v=k.redSqr(),g=v.redMul(k),f=R.redMul(v),w=B.redSqr().redIAdd(g).redISub(f).redISub(f),d=B.redMul(f.redISub(w)).redISub(P.redMul(g)),Y0=this.z.redMul(k);return this.curve.jpoint(w,d,Y0)},W.prototype.dblp=function(H){if(H===0)return this;if(this.isInfinity())return this;if(!H)return this.dbl();var C;if(this.curve.zeroA||this.curve.threeA){var R=this;for(C=0;C<H;C++)R=R.dbl();return R}var q=this.curve.a,P=this.curve.tinv,j=this.x,k=this.y,B=this.z,v=B.redSqr().redSqr(),g=k.redAdd(k);for(C=0;C<H;C++){var f=j.redSqr(),w=g.redSqr(),d=w.redSqr(),Y0=f.redAdd(f).redIAdd(f).redIAdd(q.redMul(v)),G0=j.redMul(w),J0=Y0.redSqr().redISub(G0.redAdd(G0)),u=G0.redISub(J0),O0=Y0.redMul(u);O0=O0.redIAdd(O0).redISub(d);var U=g.redMul(B);if(C+1<H)v=v.redMul(d);j=J0,B=U,g=O0}return this.curve.jpoint(j,g.redMul(P),B)},W.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.zeroA)return this._zeroDbl();else if(this.curve.threeA)return this._threeDbl();else return this._dbl()},W.prototype._zeroDbl=function(){var H,C,R;if(this.zOne){var q=this.x.redSqr(),P=this.y.redSqr(),j=P.redSqr(),k=this.x.redAdd(P).redSqr().redISub(q).redISub(j);k=k.redIAdd(k);var B=q.redAdd(q).redIAdd(q),v=B.redSqr().redISub(k).redISub(k),g=j.redIAdd(j);g=g.redIAdd(g),g=g.redIAdd(g),H=v,C=B.redMul(k.redISub(v)).redISub(g),R=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),w=this.y.redSqr(),d=w.redSqr(),Y0=this.x.redAdd(w).redSqr().redISub(f).redISub(d);Y0=Y0.redIAdd(Y0);var G0=f.redAdd(f).redIAdd(f),J0=G0.redSqr(),u=d.redIAdd(d);u=u.redIAdd(u),u=u.redIAdd(u),H=J0.redISub(Y0).redISub(Y0),C=G0.redMul(Y0.redISub(H)).redISub(u),R=this.y.redMul(this.z),R=R.redIAdd(R)}return this.curve.jpoint(H,C,R)},W.prototype._threeDbl=function(){var H,C,R;if(this.zOne){var q=this.x.redSqr(),P=this.y.redSqr(),j=P.redSqr(),k=this.x.redAdd(P).redSqr().redISub(q).redISub(j);k=k.redIAdd(k);var B=q.redAdd(q).redIAdd(q).redIAdd(this.curve.a),v=B.redSqr().redISub(k).redISub(k);H=v;var g=j.redIAdd(j);g=g.redIAdd(g),g=g.redIAdd(g),C=B.redMul(k.redISub(v)).redISub(g),R=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),w=this.y.redSqr(),d=this.x.redMul(w),Y0=this.x.redSub(f).redMul(this.x.redAdd(f));Y0=Y0.redAdd(Y0).redIAdd(Y0);var G0=d.redIAdd(d);G0=G0.redIAdd(G0);var J0=G0.redAdd(G0);H=Y0.redSqr().redISub(J0),R=this.y.redAdd(this.z).redSqr().redISub(w).redISub(f);var u=w.redSqr();u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u),C=Y0.redMul(G0.redISub(H)).redISub(u)}return this.curve.jpoint(H,C,R)},W.prototype._dbl=function(){var H=this.curve.a,C=this.x,R=this.y,q=this.z,P=q.redSqr().redSqr(),j=C.redSqr(),k=R.redSqr(),B=j.redAdd(j).redIAdd(j).redIAdd(H.redMul(P)),v=C.redAdd(C);v=v.redIAdd(v);var g=v.redMul(k),f=B.redSqr().redISub(g.redAdd(g)),w=g.redISub(f),d=k.redSqr();d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var Y0=B.redMul(w).redISub(d),G0=R.redAdd(R).redMul(q);return this.curve.jpoint(f,Y0,G0)},W.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var H=this.x.redSqr(),C=this.y.redSqr(),R=this.z.redSqr(),q=C.redSqr(),P=H.redAdd(H).redIAdd(H),j=P.redSqr(),k=this.x.redAdd(C).redSqr().redISub(H).redISub(q);k=k.redIAdd(k),k=k.redAdd(k).redIAdd(k),k=k.redISub(j);var B=k.redSqr(),v=q.redIAdd(q);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var g=P.redIAdd(k).redSqr().redISub(j).redISub(B).redISub(v),f=C.redMul(g);f=f.redIAdd(f),f=f.redIAdd(f);var w=this.x.redMul(B).redISub(f);w=w.redIAdd(w),w=w.redIAdd(w);var d=this.y.redMul(g.redMul(v.redISub(g)).redISub(k.redMul(B)));d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var Y0=this.z.redAdd(k).redSqr().redISub(R).redISub(B);return this.curve.jpoint(w,d,Y0)},W.prototype.mul=function(H,C){return H=new L(H,C),this.curve._wnafMul(this,H)},W.prototype.eq=function(H){if(H.type==="affine")return this.eq(H.toJ());if(this===H)return!0;var C=this.z.redSqr(),R=H.z.redSqr();if(this.x.redMul(R).redISub(H.x.redMul(C)).cmpn(0)!==0)return!1;var q=C.redMul(this.z),P=R.redMul(H.z);return this.y.redMul(P).redISub(H.y.redMul(q)).cmpn(0)===0},W.prototype.eqXToP=function(H){var C=this.z.redSqr(),R=H.toRed(this.curve.red).redMul(C);if(this.x.cmp(R)===0)return!0;var q=H.clone(),P=this.curve.redN.redMul(C);for(;;){if(q.iadd(this.curve.n),q.cmp(this.curve.p)>=0)return!1;if(R.redIAdd(P),this.x.cmp(R)===0)return!0}},W.prototype.inspect=function(){if(this.isInfinity())return"<EC JPoint Infinity>";return"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},W.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),IG=$0((Q,G)=>{var I=tU(),L=BU(),T=XZ(),F=fU();function J(z){T.call(this,"mont",z),this.a=new I(z.a,16).toRed(this.red),this.b=new I(z.b,16).toRed(this.red),this.i4=new I(4).toRed(this.red).redInvm(),this.two=new I(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}L(J,T),G.exports=J,J.prototype.validate=function(z){var W=z.normalize().x,H=W.redSqr(),C=H.redMul(W).redAdd(H.redMul(this.a)).redAdd(W),R=C.redSqrt();return R.redSqr().cmp(C)===0};function M(z,W,H){if(T.BasePoint.call(this,z,"projective"),W===null&&H===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new I(W,16),this.z=new I(H,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}L(M,T.BasePoint),J.prototype.decodePoint=function(z,W){return this.point(F.toArray(z,W),1)},J.prototype.point=function(z,W){return new M(this,z,W)},J.prototype.pointFromJSON=function(z){return M.fromJSON(this,z)},M.prototype.precompute=function(){},M.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},M.fromJSON=function(z,W){return new M(z,W[0],W[1]||z.one)},M.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},M.prototype.isInfinity=function(){return this.z.cmpn(0)===0},M.prototype.dbl=function(){var z=this.x.redAdd(this.z),W=z.redSqr(),H=this.x.redSub(this.z),C=H.redSqr(),R=W.redSub(C),q=W.redMul(C),P=R.redMul(C.redAdd(this.curve.a24.redMul(R)));return this.curve.point(q,P)},M.prototype.add=function(){throw Error("Not supported on Montgomery curve")},M.prototype.diffAdd=function(z,W){var H=this.x.redAdd(this.z),C=this.x.redSub(this.z),R=z.x.redAdd(z.z),q=z.x.redSub(z.z),P=q.redMul(H),j=R.redMul(C),k=W.z.redMul(P.redAdd(j).redSqr()),B=W.x.redMul(P.redISub(j).redSqr());return this.curve.point(k,B)},M.prototype.mul=function(z){var W=z.clone(),H=this,C=this.curve.point(null,null),R=this;for(var q=[];W.cmpn(0)!==0;W.iushrn(1))q.push(W.andln(1));for(var P=q.length-1;P>=0;P--)if(q[P]===0)H=H.diffAdd(C,R),C=C.dbl();else C=H.diffAdd(C,R),H=H.dbl();return C},M.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},M.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},M.prototype.eq=function(z){return this.getX().cmp(z.getX())===0},M.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},M.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),EG=$0((Q,G)=>{var I=fU(),L=tU(),T=BU(),F=XZ(),J=I.assert;function M(W){this.twisted=(W.a|0)!==1,this.mOneA=this.twisted&&(W.a|0)===-1,this.extended=this.mOneA,F.call(this,"edwards",W),this.a=new L(W.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new L(W.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new L(W.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),J(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(W.c|0)===1}T(M,F),G.exports=M,M.prototype._mulA=function(W){if(this.mOneA)return W.redNeg();else return this.a.redMul(W)},M.prototype._mulC=function(W){if(this.oneC)return W;else return this.c.redMul(W)},M.prototype.jpoint=function(W,H,C,R){return this.point(W,H,C,R)},M.prototype.pointFromX=function(W,H){if(W=new L(W,16),!W.red)W=W.toRed(this.red);var C=W.redSqr(),R=this.c2.redSub(this.a.redMul(C)),q=this.one.redSub(this.c2.redMul(this.d).redMul(C)),P=R.redMul(q.redInvm()),j=P.redSqrt();if(j.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");var k=j.fromRed().isOdd();if(H&&!k||!H&&k)j=j.redNeg();return this.point(W,j)},M.prototype.pointFromY=function(W,H){if(W=new L(W,16),!W.red)W=W.toRed(this.red);var C=W.redSqr(),R=C.redSub(this.c2),q=C.redMul(this.d).redMul(this.c2).redSub(this.a),P=R.redMul(q.redInvm());if(P.cmp(this.zero)===0)if(H)throw Error("invalid point");else return this.point(this.zero,W);var j=P.redSqrt();if(j.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");if(j.fromRed().isOdd()!==H)j=j.redNeg();return this.point(j,W)},M.prototype.validate=function(W){if(W.isInfinity())return!0;W.normalize();var H=W.x.redSqr(),C=W.y.redSqr(),R=H.redMul(this.a).redAdd(C),q=this.c2.redMul(this.one.redAdd(this.d.redMul(H).redMul(C)));return R.cmp(q)===0};function z(W,H,C,R,q){if(F.BasePoint.call(this,W,"projective"),H===null&&C===null&&R===null)this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0;else{if(this.x=new L(H,16),this.y=new L(C,16),this.z=R?new L(R,16):this.curve.one,this.t=q&&new L(q,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);if(this.t&&!this.t.red)this.t=this.t.toRed(this.curve.red);if(this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t){if(this.t=this.x.redMul(this.y),!this.zOne)this.t=this.t.redMul(this.z.redInvm())}}}T(z,F.BasePoint),M.prototype.pointFromJSON=function(W){return z.fromJSON(this,W)},M.prototype.point=function(W,H,C,R){return new z(this,W,H,C,R)},z.fromJSON=function(W,H){return new z(W,H[0],H[1],H[2])},z.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},z.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},z.prototype._extDbl=function(){var W=this.x.redSqr(),H=this.y.redSqr(),C=this.z.redSqr();C=C.redIAdd(C);var R=this.curve._mulA(W),q=this.x.redAdd(this.y).redSqr().redISub(W).redISub(H),P=R.redAdd(H),j=P.redSub(C),k=R.redSub(H),B=q.redMul(j),v=P.redMul(k),g=q.redMul(k),f=j.redMul(P);return this.curve.point(B,v,f,g)},z.prototype._projDbl=function(){var W=this.x.redAdd(this.y).redSqr(),H=this.x.redSqr(),C=this.y.redSqr(),R,q,P,j,k,B;if(this.curve.twisted){j=this.curve._mulA(H);var v=j.redAdd(C);if(this.zOne)R=W.redSub(H).redSub(C).redMul(v.redSub(this.curve.two)),q=v.redMul(j.redSub(C)),P=v.redSqr().redSub(v).redSub(v);else k=this.z.redSqr(),B=v.redSub(k).redISub(k),R=W.redSub(H).redISub(C).redMul(B),q=v.redMul(j.redSub(C)),P=v.redMul(B)}else j=H.redAdd(C),k=this.curve._mulC(this.z).redSqr(),B=j.redSub(k).redSub(k),R=this.curve._mulC(W.redISub(j)).redMul(B),q=this.curve._mulC(j).redMul(H.redISub(C)),P=j.redMul(B);return this.curve.point(R,q,P)},z.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},z.prototype._extAdd=function(W){var H=this.y.redSub(this.x).redMul(W.y.redSub(W.x)),C=this.y.redAdd(this.x).redMul(W.y.redAdd(W.x)),R=this.t.redMul(this.curve.dd).redMul(W.t),q=this.z.redMul(W.z.redAdd(W.z)),P=C.redSub(H),j=q.redSub(R),k=q.redAdd(R),B=C.redAdd(H),v=P.redMul(j),g=k.redMul(B),f=P.redMul(B),w=j.redMul(k);return this.curve.point(v,g,w,f)},z.prototype._projAdd=function(W){var H=this.z.redMul(W.z),C=H.redSqr(),R=this.x.redMul(W.x),q=this.y.redMul(W.y),P=this.curve.d.redMul(R).redMul(q),j=C.redSub(P),k=C.redAdd(P),B=this.x.redAdd(this.y).redMul(W.x.redAdd(W.y)).redISub(R).redISub(q),v=H.redMul(j).redMul(B),g,f;if(this.curve.twisted)g=H.redMul(k).redMul(q.redSub(this.curve._mulA(R))),f=j.redMul(k);else g=H.redMul(k).redMul(q.redSub(R)),f=this.curve._mulC(j).redMul(k);return this.curve.point(v,g,f)},z.prototype.add=function(W){if(this.isInfinity())return W;if(W.isInfinity())return this;if(this.curve.extended)return this._extAdd(W);else return this._projAdd(W)},z.prototype.mul=function(W){if(this._hasDoubles(W))return this.curve._fixedNafMul(this,W);else return this.curve._wnafMul(this,W)},z.prototype.mulAdd=function(W,H,C){return this.curve._wnafMulAdd(1,[this,H],[W,C],2,!1)},z.prototype.jmulAdd=function(W,H,C){return this.curve._wnafMulAdd(1,[this,H],[W,C],2,!0)},z.prototype.normalize=function(){if(this.zOne)return this;var W=this.z.redInvm();if(this.x=this.x.redMul(W),this.y=this.y.redMul(W),this.t)this.t=this.t.redMul(W);return this.z=this.curve.one,this.zOne=!0,this},z.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},z.prototype.getX=function(){return this.normalize(),this.x.fromRed()},z.prototype.getY=function(){return this.normalize(),this.y.fromRed()},z.prototype.eq=function(W){return this===W||this.getX().cmp(W.getX())===0&&this.getY().cmp(W.getY())===0},z.prototype.eqXToP=function(W){var H=W.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(H)===0)return!0;var C=W.clone(),R=this.curve.redN.redMul(this.z);for(;;){if(C.iadd(this.curve.n),C.cmp(this.curve.p)>=0)return!1;if(H.redIAdd(R),this.x.cmp(H)===0)return!0}},z.prototype.toP=z.prototype.normalize,z.prototype.mixedAdd=z.prototype.add}),rQ=$0((Q)=>{var G=Q;G.base=XZ(),G.short=VG(),G.mont=IG(),G.edwards=EG()}),lU=$0((Q)=>{var G=UO(),I=BU();Q.inherits=I;function L(X,$){if((X.charCodeAt($)&64512)!==55296)return!1;if($<0||$+1>=X.length)return!1;return(X.charCodeAt($+1)&64512)===56320}function T(X,$){if(Array.isArray(X))return X.slice();if(!X)return[];var Z=[];if(typeof X==="string"){if(!$){var Y=0;for(var E=0;E<X.length;E++){var K=X.charCodeAt(E);if(K<128)Z[Y++]=K;else if(K<2048)Z[Y++]=K>>6|192,Z[Y++]=K&63|128;else if(L(X,E))K=65536+((K&1023)<<10)+(X.charCodeAt(++E)&1023),Z[Y++]=K>>18|240,Z[Y++]=K>>12&63|128,Z[Y++]=K>>6&63|128,Z[Y++]=K&63|128;else Z[Y++]=K>>12|224,Z[Y++]=K>>6&63|128,Z[Y++]=K&63|128}}else if($==="hex"){if(X=X.replace(/[^a-z0-9]+/ig,""),X.length%2!==0)X="0"+X;for(E=0;E<X.length;E+=2)Z.push(parseInt(X[E]+X[E+1],16))}}else for(E=0;E<X.length;E++)Z[E]=X[E]|0;return Z}Q.toArray=T;function F(X){var $="";for(var Z=0;Z<X.length;Z++)$+=z(X[Z].toString(16));return $}Q.toHex=F;function J(X){var $=X>>>24|X>>>8&65280|X<<8&16711680|(X&255)<<24;return $>>>0}Q.htonl=J;function M(X,$){var Z="";for(var Y=0;Y<X.length;Y++){var E=X[Y];if($==="little")E=J(E);Z+=W(E.toString(16))}return Z}Q.toHex32=M;function z(X){if(X.length===1)return"0"+X;else return X}Q.zero2=z;function W(X){if(X.length===7)return"0"+X;else if(X.length===6)return"00"+X;else if(X.length===5)return"000"+X;else if(X.length===4)return"0000"+X;else if(X.length===3)return"00000"+X;else if(X.length===2)return"000000"+X;else if(X.length===1)return"0000000"+X;else return X}Q.zero8=W;function H(X,$,Z,Y){var E=Z-$;G(E%4===0);var K=Array(E/4);for(var A=0,O=$;A<K.length;A++,O+=4){var V;if(Y==="big")V=X[O]<<24|X[O+1]<<16|X[O+2]<<8|X[O+3];else V=X[O+3]<<24|X[O+2]<<16|X[O+1]<<8|X[O];K[A]=V>>>0}return K}Q.join32=H;function C(X,$){var Z=Array(X.length*4);for(var Y=0,E=0;Y<X.length;Y++,E+=4){var K=X[Y];if($==="big")Z[E]=K>>>24,Z[E+1]=K>>>16&255,Z[E+2]=K>>>8&255,Z[E+3]=K&255;else Z[E+3]=K>>>24,Z[E+2]=K>>>16&255,Z[E+1]=K>>>8&255,Z[E]=K&255}return Z}Q.split32=C;function R(X,$){return X>>>$|X<<32-$}Q.rotr32=R;function q(X,$){return X<<$|X>>>32-$}Q.rotl32=q;function P(X,$){return X+$>>>0}Q.sum32=P;function j(X,$,Z){return X+$+Z>>>0}Q.sum32_3=j;function k(X,$,Z,Y){return X+$+Z+Y>>>0}Q.sum32_4=k;function B(X,$,Z,Y,E){return X+$+Z+Y+E>>>0}Q.sum32_5=B;function v(X,$,Z,Y){var E=X[$],K=X[$+1],A=Y+K>>>0,O=(A<Y?1:0)+Z+E;X[$]=O>>>0,X[$+1]=A}Q.sum64=v;function g(X,$,Z,Y){var E=$+Y>>>0,K=(E<$?1:0)+X+Z;return K>>>0}Q.sum64_hi=g;function f(X,$,Z,Y){var E=$+Y;return E>>>0}Q.sum64_lo=f;function w(X,$,Z,Y,E,K,A,O){var V=0,D=$;D=D+Y>>>0,V+=D<$?1:0,D=D+K>>>0,V+=D<K?1:0,D=D+O>>>0,V+=D<O?1:0;var S=X+Z+E+A+V;return S>>>0}Q.sum64_4_hi=w;function d(X,$,Z,Y,E,K,A,O){var V=$+Y+K+O;return V>>>0}Q.sum64_4_lo=d;function Y0(X,$,Z,Y,E,K,A,O,V,D){var S=0,_=$;_=_+Y>>>0,S+=_<$?1:0,_=_+K>>>0,S+=_<K?1:0,_=_+O>>>0,S+=_<O?1:0,_=_+D>>>0,S+=_<D?1:0;var N=X+Z+E+A+V+S;return N>>>0}Q.sum64_5_hi=Y0;function G0(X,$,Z,Y,E,K,A,O,V,D){var S=$+Y+K+O+D;return S>>>0}Q.sum64_5_lo=G0;function J0(X,$,Z){var Y=$<<32-Z|X>>>Z;return Y>>>0}Q.rotr64_hi=J0;function u(X,$,Z){var Y=X<<32-Z|$>>>Z;return Y>>>0}Q.rotr64_lo=u;function O0(X,$,Z){return X>>>Z}Q.shr64_hi=O0;function U(X,$,Z){var Y=X<<32-Z|$>>>Z;return Y>>>0}Q.shr64_lo=U}),jO=$0((Q)=>{var G=lU(),I=UO();function L(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Q.BlockHash=L,L.prototype.update=function(T,F){if(T=G.toArray(T,F),!this.pending)this.pending=T;else this.pending=this.pending.concat(T);if(this.pendingTotal+=T.length,this.pending.length>=this._delta8){T=this.pending;var J=T.length%this._delta8;if(this.pending=T.slice(T.length-J,T.length),this.pending.length===0)this.pending=null;T=G.join32(T,0,T.length-J,this.endian);for(var M=0;M<T.length;M+=this._delta32)this._update(T,M,M+this._delta32)}return this},L.prototype.digest=function(T){return this.update(this._pad()),I(this.pending===null),this._digest(T)},L.prototype._pad=function(){var T=this.pendingTotal,F=this._delta8,J=F-(T+this.padLength)%F,M=Array(J+this.padLength);M[0]=128;for(var z=1;z<J;z++)M[z]=0;if(T<<=3,this.endian==="big"){for(var W=8;W<this.padLength;W++)M[z++]=0;M[z++]=0,M[z++]=0,M[z++]=0,M[z++]=0,M[z++]=T>>>24&255,M[z++]=T>>>16&255,M[z++]=T>>>8&255,M[z++]=T&255}else{M[z++]=T&255,M[z++]=T>>>8&255,M[z++]=T>>>16&255,M[z++]=T>>>24&255,M[z++]=0,M[z++]=0,M[z++]=0,M[z++]=0;for(W=8;W<this.padLength;W++)M[z++]=0}return M}}),eQ=$0((Q)=>{var G=lU(),I=G.rotr32;function L(C,R,q,P){if(C===0)return T(R,q,P);if(C===1||C===3)return J(R,q,P);if(C===2)return F(R,q,P)}Q.ft_1=L;function T(C,R,q){return C&R^~C&q}Q.ch32=T;function F(C,R,q){return C&R^C&q^R&q}Q.maj32=F;function J(C,R,q){return C^R^q}Q.p32=J;function M(C){return I(C,2)^I(C,13)^I(C,22)}Q.s0_256=M;function z(C){return I(C,6)^I(C,11)^I(C,25)}Q.s1_256=z;function W(C){return I(C,7)^I(C,18)^C>>>3}Q.g0_256=W;function H(C){return I(C,17)^I(C,19)^C>>>10}Q.g1_256=H}),KG=$0((Q,G)=>{var I=lU(),L=jO(),T=eQ(),F=I.rotl32,J=I.sum32,M=I.sum32_5,z=T.ft_1,W=L.BlockHash,H=[1518500249,1859775393,2400959708,3395469782];function C(){if(!(this instanceof C))return new C;W.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}I.inherits(C,W),G.exports=C,C.blockSize=512,C.outSize=160,C.hmacStrength=80,C.padLength=64,C.prototype._update=function(R,q){var P=this.W;for(var j=0;j<16;j++)P[j]=R[q+j];for(;j<P.length;j++)P[j]=F(P[j-3]^P[j-8]^P[j-14]^P[j-16],1);var k=this.h[0],B=this.h[1],v=this.h[2],g=this.h[3],f=this.h[4];for(j=0;j<P.length;j++){var w=~~(j/20),d=M(F(k,5),z(w,B,v,g),f,P[j],H[w]);f=g,g=v,v=F(B,30),B=k,k=d}this.h[0]=J(this.h[0],k),this.h[1]=J(this.h[1],B),this.h[2]=J(this.h[2],v),this.h[3]=J(this.h[3],g),this.h[4]=J(this.h[4],f)},C.prototype._digest=function(R){if(R==="hex")return I.toHex32(this.h,"big");else return I.split32(this.h,"big")}}),aQ=$0((Q,G)=>{var I=lU(),L=jO(),T=eQ(),F=UO(),J=I.sum32,M=I.sum32_4,z=I.sum32_5,W=T.ch32,H=T.maj32,C=T.s0_256,R=T.s1_256,q=T.g0_256,P=T.g1_256,j=L.BlockHash,k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function B(){if(!(this instanceof B))return new B;j.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=k,this.W=Array(64)}I.inherits(B,j),G.exports=B,B.blockSize=512,B.outSize=256,B.hmacStrength=192,B.padLength=64,B.prototype._update=function(v,g){var f=this.W;for(var w=0;w<16;w++)f[w]=v[g+w];for(;w<f.length;w++)f[w]=M(P(f[w-2]),f[w-7],q(f[w-15]),f[w-16]);var d=this.h[0],Y0=this.h[1],G0=this.h[2],J0=this.h[3],u=this.h[4],O0=this.h[5],U=this.h[6],X=this.h[7];F(this.k.length===f.length);for(w=0;w<f.length;w++){var $=z(X,R(u),W(u,O0,U),this.k[w],f[w]),Z=J(C(d),H(d,Y0,G0));X=U,U=O0,O0=u,u=J(J0,$),J0=G0,G0=Y0,Y0=d,d=J($,Z)}this.h[0]=J(this.h[0],d),this.h[1]=J(this.h[1],Y0),this.h[2]=J(this.h[2],G0),this.h[3]=J(this.h[3],J0),this.h[4]=J(this.h[4],u),this.h[5]=J(this.h[5],O0),this.h[6]=J(this.h[6],U),this.h[7]=J(this.h[7],X)},B.prototype._digest=function(v){if(v==="hex")return I.toHex32(this.h,"big");else return I.split32(this.h,"big")}}),TG=$0((Q,G)=>{var I=lU(),L=aQ();function T(){if(!(this instanceof T))return new T;L.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}I.inherits(T,L),G.exports=T,T.blockSize=512,T.outSize=224,T.hmacStrength=192,T.padLength=64,T.prototype._digest=function(F){if(F==="hex")return I.toHex32(this.h.slice(0,7),"big");else return I.split32(this.h.slice(0,7),"big")}}),iQ=$0((Q,G)=>{var I=lU(),L=jO(),T=UO(),F=I.rotr64_hi,J=I.rotr64_lo,M=I.shr64_hi,z=I.shr64_lo,W=I.sum64,H=I.sum64_hi,C=I.sum64_lo,R=I.sum64_4_hi,q=I.sum64_4_lo,P=I.sum64_5_hi,j=I.sum64_5_lo,k=L.BlockHash,B=[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 v(){if(!(this instanceof v))return new v;k.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=B,this.W=Array(160)}I.inherits(v,k),G.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(Z,Y){var E=this.W;for(var K=0;K<32;K++)E[K]=Z[Y+K];for(;K<E.length;K+=2){var A=X(E[K-4],E[K-3]),O=$(E[K-4],E[K-3]),V=E[K-14],D=E[K-13],S=O0(E[K-30],E[K-29]),_=U(E[K-30],E[K-29]),N=E[K-32],p=E[K-31];E[K]=R(A,O,V,D,S,_,N,p),E[K+1]=q(A,O,V,D,S,_,N,p)}},v.prototype._update=function(Z,Y){this._prepareBlock(Z,Y);var E=this.W,K=this.h[0],A=this.h[1],O=this.h[2],V=this.h[3],D=this.h[4],S=this.h[5],_=this.h[6],N=this.h[7],p=this.h[8],n=this.h[9],V0=this.h[10],r=this.h[11],b=this.h[12],X0=this.h[13],t=this.h[14],i=this.h[15];T(this.k.length===E.length);for(var N0=0;N0<E.length;N0+=2){var y=t,h=i,Q0=J0(p,n),s=u(p,n),a=g(p,n,V0,r,b,X0),H0=f(p,n,V0,r,b,X0),c=this.k[N0],o=this.k[N0+1],x0=E[N0],m=E[N0+1],Z0=P(y,h,Q0,s,a,H0,c,o,x0,m),w0=j(y,h,Q0,s,a,H0,c,o,x0,m);y=Y0(K,A),h=G0(K,A),Q0=w(K,A,O,V,D,S),s=d(K,A,O,V,D,S);var K0=H(y,h,Q0,s),T0=C(y,h,Q0,s);t=b,i=X0,b=V0,X0=r,V0=p,r=n,p=H(_,N,Z0,w0),n=C(N,N,Z0,w0),_=D,N=S,D=O,S=V,O=K,V=A,K=H(Z0,w0,K0,T0),A=C(Z0,w0,K0,T0)}W(this.h,0,K,A),W(this.h,2,O,V),W(this.h,4,D,S),W(this.h,6,_,N),W(this.h,8,p,n),W(this.h,10,V0,r),W(this.h,12,b,X0),W(this.h,14,t,i)},v.prototype._digest=function(Z){if(Z==="hex")return I.toHex32(this.h,"big");else return I.split32(this.h,"big")};function g(Z,Y,E,K,A){var O=Z&E^~Z&A;if(O<0)O+=4294967296;return O}function f(Z,Y,E,K,A,O){var V=Y&K^~Y&O;if(V<0)V+=4294967296;return V}function w(Z,Y,E,K,A){var O=Z&E^Z&A^E&A;if(O<0)O+=4294967296;return O}function d(Z,Y,E,K,A,O){var V=Y&K^Y&O^K&O;if(V<0)V+=4294967296;return V}function Y0(Z,Y){var E=F(Z,Y,28),K=F(Y,Z,2),A=F(Y,Z,7),O=E^K^A;if(O<0)O+=4294967296;return O}function G0(Z,Y){var E=J(Z,Y,28),K=J(Y,Z,2),A=J(Y,Z,7),O=E^K^A;if(O<0)O+=4294967296;return O}function J0(Z,Y){var E=F(Z,Y,14),K=F(Z,Y,18),A=F(Y,Z,9),O=E^K^A;if(O<0)O+=4294967296;return O}function u(Z,Y){var E=J(Z,Y,14),K=J(Z,Y,18),A=J(Y,Z,9),O=E^K^A;if(O<0)O+=4294967296;return O}function O0(Z,Y){var E=F(Z,Y,1),K=F(Z,Y,8),A=M(Z,Y,7),O=E^K^A;if(O<0)O+=4294967296;return O}function U(Z,Y){var E=J(Z,Y,1),K=J(Z,Y,8),A=z(Z,Y,7),O=E^K^A;if(O<0)O+=4294967296;return O}function X(Z,Y){var E=F(Z,Y,19),K=F(Y,Z,29),A=M(Z,Y,6),O=E^K^A;if(O<0)O+=4294967296;return O}function $(Z,Y){var E=J(Z,Y,19),K=J(Y,Z,29),A=z(Z,Y,6),O=E^K^A;if(O<0)O+=4294967296;return O}}),CG=$0((Q,G)=>{var I=lU(),L=iQ();function T(){if(!(this instanceof T))return new T;L.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}I.inherits(T,L),G.exports=T,T.blockSize=1024,T.outSize=384,T.hmacStrength=192,T.padLength=128,T.prototype._digest=function(F){if(F==="hex")return I.toHex32(this.h.slice(0,12),"big");else return I.split32(this.h.slice(0,12),"big")}}),LG=$0((Q)=>{Q.sha1=KG(),Q.sha224=TG(),Q.sha256=aQ(),Q.sha384=CG(),Q.sha512=iQ()}),SG=$0((Q)=>{var G=lU(),I=jO(),L=G.rotl32,T=G.sum32,F=G.sum32_3,J=G.sum32_4,M=I.BlockHash;function z(){if(!(this instanceof z))return new z;M.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}G.inherits(z,M),Q.ripemd160=z,z.blockSize=512,z.outSize=160,z.hmacStrength=192,z.padLength=64,z.prototype._update=function(k,B){var v=this.h[0],g=this.h[1],f=this.h[2],w=this.h[3],d=this.h[4],Y0=v,G0=g,J0=f,u=w,O0=d;for(var U=0;U<80;U++){var X=T(L(J(v,W(U,g,f,w),k[R[U]+B],H(U)),P[U]),d);v=d,d=w,w=L(f,10),f=g,g=X,X=T(L(J(Y0,W(79-U,G0,J0,u),k[q[U]+B],C(U)),j[U]),O0),Y0=O0,O0=u,u=L(J0,10),J0=G0,G0=X}X=F(this.h[1],f,u),this.h[1]=F(this.h[2],w,O0),this.h[2]=F(this.h[3],d,Y0),this.h[3]=F(this.h[4],v,G0),this.h[4]=F(this.h[0],g,J0),this.h[0]=X},z.prototype._digest=function(k){if(k==="hex")return G.toHex32(this.h,"little");else return G.split32(this.h,"little")};function W(k,B,v,g){if(k<=15)return B^v^g;else if(k<=31)return B&v|~B&g;else if(k<=47)return(B|~v)^g;else if(k<=63)return B&g|v&~g;else return B^(v|~g)}function H(k){if(k<=15)return 0;else if(k<=31)return 1518500249;else if(k<=47)return 1859775393;else if(k<=63)return 2400959708;else return 2840853838}function C(k){if(k<=15)return 1352829926;else if(k<=31)return 1548603684;else if(k<=47)return 1836072691;else if(k<=63)return 2053994217;else return 0}var R=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],q=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],P=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],j=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]}),RG=$0((Q,G)=>{var I=lU(),L=UO();function T(F,J,M){if(!(this instanceof T))return new T(F,J,M);this.Hash=F,this.blockSize=F.blockSize/8,this.outSize=F.outSize/8,this.inner=null,this.outer=null,this._init(I.toArray(J,M))}G.exports=T,T.prototype._init=function(F){if(F.length>this.blockSize)F=new this.Hash().update(F).digest();L(F.length<=this.blockSize);for(var J=F.length;J<this.blockSize;J++)F.push(0);for(J=0;J<F.length;J++)F[J]^=54;this.inner=new this.Hash().update(F);for(J=0;J<F.length;J++)F[J]^=106;this.outer=new this.Hash().update(F)},T.prototype.update=function(F,J){return this.inner.update(F,J),this},T.prototype.digest=function(F){return this.outer.update(this.inner.digest()),this.outer.digest(F)}}),OX=$0((Q)=>{var G=Q;G.utils=lU(),G.common=jO(),G.sha=LG(),G.ripemd=SG(),G.hmac=RG(),G.sha1=G.sha.sha1,G.sha256=G.sha.sha256,G.sha224=G.sha.sha224,G.sha384=G.sha.sha384,G.sha512=G.sha.sha512,G.ripemd160=G.ripemd.ripemd160}),WG=$0((Q,G)=>{G.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}),ZX=$0((Q)=>{var G=Q,I=OX(),L=rQ(),T=fU(),F=T.assert;function J(W){if(W.type==="short")this.curve=new L.short(W);else if(W.type==="edwards")this.curve=new L.edwards(W);else this.curve=new L.mont(W);this.g=this.curve.g,this.n=this.curve.n,this.hash=W.hash,F(this.g.validate(),"Invalid curve"),F(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}G.PresetCurve=J;function M(W,H){Object.defineProperty(G,W,{configurable:!0,enumerable:!0,get:function(){var C=new J(H);return Object.defineProperty(G,W,{configurable:!0,enumerable:!0,value:C}),C}})}M("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:I.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),M("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:I.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),M("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:I.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),M("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:I.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"]}),M("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:I.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"]}),M("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:I.sha256,gRed:!1,g:["9"]}),M("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:I.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var z;try{z=WG()}catch(W){z=void 0}M("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:I.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",z]})}),HG=$0((Q,G)=>{var I=OX(),L=mQ(),T=UO();function F(J){if(!(this instanceof F))return new F(J);this.hash=J.hash,this.predResist=!!J.predResist,this.outLen=this.hash.outSize,this.minEntropy=J.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var M=L.toArray(J.entropy,J.entropyEnc||"hex"),z=L.toArray(J.nonce,J.nonceEnc||"hex"),W=L.toArray(J.pers,J.persEnc||"hex");T(M.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(M,z,W)}G.exports=F,F.prototype._init=function(J,M,z){var W=J.concat(M).concat(z);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var H=0;H<this.V.length;H++)this.K[H]=0,this.V[H]=1;this._update(W),this._reseed=1,this.reseedInterval=281474976710656},F.prototype._hmac=function(){return new I.hmac(this.hash,this.K)},F.prototype._update=function(J){var M=this._hmac().update(this.V).update([0]);if(J)M=M.update(J);if(this.K=M.digest(),this.V=this._hmac().update(this.V).digest(),!J)return;this.K=this._hmac().update(this.V).update([1]).update(J).digest(),this.V=this._hmac().update(this.V).digest()},F.prototype.reseed=function(J,M,z,W){if(typeof M!=="string")W=z,z=M,M=null;J=L.toArray(J,M),z=L.toArray(z,W),T(J.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(J.concat(z||[])),this._reseed=1},F.prototype.generate=function(J,M,z,W){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof M!=="string")W=z,z=M,M=null;if(z)z=L.toArray(z,W||"hex"),this._update(z);var H=[];while(H.length<J)this.V=this._hmac().update(this.V).digest(),H=H.concat(this.V);var C=H.slice(0,J);return this._update(z),this._reseed++,L.encode(C,M)}}),FG=$0((Q,G)=>{var I=tU(),L=fU(),T=L.assert;function F(J,M){if(this.ec=J,this.priv=null,this.pub=null,M.priv)this._importPrivate(M.priv,M.privEnc);if(M.pub)this._importPublic(M.pub,M.pubEnc)}G.exports=F,F.fromPublic=function(J,M,z){if(M instanceof F)return M;return new F(J,{pub:M,pubEnc:z})},F.fromPrivate=function(J,M,z){if(M instanceof F)return M;return new F(J,{priv:M,privEnc:z})},F.prototype.validate=function(){var J=this.getPublic();if(J.isInfinity())return{result:!1,reason:"Invalid public key"};if(!J.validate())return{result:!1,reason:"Public key is not a point"};if(!J.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},F.prototype.getPublic=function(J,M){if(typeof J==="string")M=J,J=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!M)return this.pub;return this.pub.encode(M,J)},F.prototype.getPrivate=function(J){if(J==="hex")return this.priv.toString(16,2);else return this.priv},F.prototype._importPrivate=function(J,M){this.priv=new I(J,M||16),this.priv=this.priv.umod(this.ec.curve.n)},F.prototype._importPublic=function(J,M){if(J.x||J.y){if(this.ec.curve.type==="mont")T(J.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")T(J.x&&J.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(J.x,J.y);return}this.pub=this.ec.curve.decodePoint(J,M)},F.prototype.derive=function(J){if(!J.validate())T(J.validate(),"public point not validated");return J.mul(this.priv).getX()},F.prototype.sign=function(J,M,z){return this.ec.sign(J,this,M,z)},F.prototype.verify=function(J,M,z){return this.ec.verify(J,M,this,void 0,z)},F.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),DG=$0((Q,G)=>{var I=tU(),L=fU(),T=L.assert;function F(H,C){if(H instanceof F)return H;if(this._importDER(H,C))return;if(T(H.r&&H.s,"Signature without r or s"),this.r=new I(H.r,16),this.s=new I(H.s,16),H.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=H.recoveryParam}G.exports=F;function J(){this.place=0}function M(H,C){var R=H[C.place++];if(!(R&128))return R;var q=R&15;if(q===0||q>4)return!1;if(H[C.place]===0)return!1;var P=0;for(var j=0,k=C.place;j<q;j++,k++)P<<=8,P|=H[k],P>>>=0;if(P<=127)return!1;return C.place=k,P}function z(H){var C=0,R=H.length-1;while(!H[C]&&!(H[C+1]&128)&&C<R)C++;if(C===0)return H;return H.slice(C)}F.prototype._importDER=function(H,C){H=L.toArray(H,C);var R=new J;if(H[R.place++]!==48)return!1;var q=M(H,R);if(q===!1)return!1;if(q+R.place!==H.length)return!1;if(H[R.place++]!==2)return!1;var P=M(H,R);if(P===!1)return!1;if((H[R.place]&128)!==0)return!1;var j=H.slice(R.place,P+R.place);if(R.place+=P,H[R.place++]!==2)return!1;var k=M(H,R);if(k===!1)return!1;if(H.length!==k+R.place)return!1;if((H[R.place]&128)!==0)return!1;var B=H.slice(R.place,k+R.place);if(j[0]===0)if(j[1]&128)j=j.slice(1);else return!1;if(B[0]===0)if(B[1]&128)B=B.slice(1);else return!1;return this.r=new I(j),this.s=new I(B),this.recoveryParam=null,!0};function W(H,C){if(C<128){H.push(C);return}var R=1+(Math.log(C)/Math.LN2>>>3);H.push(R|128);while(--R)H.push(C>>>(R<<3)&255);H.push(C)}F.prototype.toDER=function(H){var C=this.r.toArray(),R=this.s.toArray();if(C[0]&128)C=[0].concat(C);if(R[0]&128)R=[0].concat(R);C=z(C),R=z(R);while(!R[0]&&!(R[1]&128))R=R.slice(1);var q=[2];W(q,C.length),q=q.concat(C),q.push(2),W(q,R.length);var P=q.concat(R),j=[48];return W(j,P.length),j=j.concat(P),L.encode(j,H)}}),MG=$0((Q,G)=>{var I=tU(),L=HG(),T=fU(),F=ZX(),J=sQ(),M=T.assert,z=FG(),W=DG();function H(C){if(!(this instanceof H))return new H(C);if(typeof C==="string")M(Object.prototype.hasOwnProperty.call(F,C),"Unknown curve "+C),C=F[C];if(C instanceof F.PresetCurve)C={curve:C};this.curve=C.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=C.curve.g,this.g.precompute(C.curve.n.bitLength()+1),this.hash=C.hash||C.curve.hash}G.exports=H,H.prototype.keyPair=function(C){return new z(this,C)},H.prototype.keyFromPrivate=function(C,R){return z.fromPrivate(this,C,R)},H.prototype.keyFromPublic=function(C,R){return z.fromPublic(this,C,R)},H.prototype.genKeyPair=function(C){if(!C)C={};var R=new L({hash:this.hash,pers:C.pers,persEnc:C.persEnc||"utf8",entropy:C.entropy||J(this.hash.hmacStrength),entropyEnc:C.entropy&&C.entropyEnc||"utf8",nonce:this.n.toArray()}),q=this.n.byteLength(),P=this.n.sub(new I(2));for(;;){var j=new I(R.generate(q));if(j.cmp(P)>0)continue;return j.iaddn(1),this.keyFromPrivate(j)}},H.prototype._truncateToN=function(C,R,q){var P;if(I.isBN(C)||typeof C==="number")C=new I(C,16),P=C.byteLength();else if(typeof C==="object")P=C.length,C=new I(C,16);else{var j=C.toString();P=j.length+1>>>1,C=new I(j,16)}if(typeof q!=="number")q=P*8;var k=q-this.n.bitLength();if(k>0)C=C.ushrn(k);if(!R&&C.cmp(this.n)>=0)return C.sub(this.n);else return C},H.prototype.sign=function(C,R,q,P){if(typeof q==="object")P=q,q=null;if(!P)P={};if(typeof C!=="string"&&typeof C!=="number"&&!I.isBN(C)){M(typeof C==="object"&&C&&typeof C.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),M(C.length>>>0===C.length);for(var j=0;j<C.length;j++)M((C[j]&255)===C[j])}R=this.keyFromPrivate(R,q),C=this._truncateToN(C,!1,P.msgBitLength),M(!C.isNeg(),"Can not sign a negative message");var k=this.n.byteLength(),B=R.getPrivate().toArray("be",k),v=C.toArray("be",k);M(new I(v).eq(C),"Can not sign message");var g=new L({hash:this.hash,entropy:B,nonce:v,pers:P.pers,persEnc:P.persEnc||"utf8"}),f=this.n.sub(new I(1));for(var w=0;;w++){var d=P.k?P.k(w):new I(g.generate(this.n.byteLength()));if(d=this._truncateToN(d,!0),d.cmpn(1)<=0||d.cmp(f)>=0)continue;var Y0=this.g.mul(d);if(Y0.isInfinity())continue;var G0=Y0.getX(),J0=G0.umod(this.n);if(J0.cmpn(0)===0)continue;var u=d.invm(this.n).mul(J0.mul(R.getPrivate()).iadd(C));if(u=u.umod(this.n),u.cmpn(0)===0)continue;var O0=(Y0.getY().isOdd()?1:0)|(G0.cmp(J0)!==0?2:0);if(P.canonical&&u.cmp(this.nh)>0)u=this.n.sub(u),O0^=1;return new W({r:J0,s:u,recoveryParam:O0})}},H.prototype.verify=function(C,R,q,P,j){if(!j)j={};C=this._truncateToN(C,!1,j.msgBitLength),q=this.keyFromPublic(q,P),R=new W(R,"hex");var{r:k,s:B}=R;if(k.cmpn(1)<0||k.cmp(this.n)>=0)return!1;if(B.cmpn(1)<0||B.cmp(this.n)>=0)return!1;var v=B.invm(this.n),g=v.mul(C).umod(this.n),f=v.mul(k).umod(this.n),w;if(!this.curve._maxwellTrick){if(w=this.g.mulAdd(g,q.getPublic(),f),w.isInfinity())return!1;return w.getX().umod(this.n).cmp(k)===0}if(w=this.g.jmulAdd(g,q.getPublic(),f),w.isInfinity())return!1;return w.eqXToP(k)},H.prototype.recoverPubKey=function(C,R,q,P){M((3&q)===q,"The recovery param is more than two bits"),R=new W(R,P);var j=this.n,k=new I(C),B=R.r,v=R.s,g=q&1,f=q>>1;if(B.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw Error("Unable to find sencond key candinate");if(f)B=this.curve.pointFromX(B.add(this.curve.n),g);else B=this.curve.pointFromX(B,g);var w=R.r.invm(j),d=j.sub(k).mul(w).umod(j),Y0=v.mul(w).umod(j);return this.g.mulAdd(d,B,Y0)},H.prototype.getKeyRecoveryParam=function(C,R,q,P){if(R=new W(R,P),R.recoveryParam!==null)return R.recoveryParam;for(var j=0;j<4;j++){var k;try{k=this.recoverPubKey(C,R,j)}catch(B){continue}if(k.eq(q))return j}throw Error("Unable to find valid recovery factor")}}),zG=$0((Q,G)=>{var I=fU(),L=I.assert,T=I.parseBytes,F=I.cachedProperty;function J(M,z){if(this.eddsa=M,this._secret=T(z.secret),M.isPoint(z.pub))this._pub=z.pub;else this._pubBytes=T(z.pub)}J.fromPublic=function(M,z){if(z instanceof J)return z;return new J(M,{pub:z})},J.fromSecret=function(M,z){if(z instanceof J)return z;return new J(M,{secret:z})},J.prototype.secret=function(){return this._secret},F(J,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),F(J,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),F(J,"privBytes",function(){var M=this.eddsa,z=this.hash(),W=M.encodingLength-1,H=z.slice(0,M.encodingLength);return H[0]&=248,H[W]&=127,H[W]|=64,H}),F(J,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),F(J,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),F(J,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),J.prototype.sign=function(M){return L(this._secret,"KeyPair can only verify"),this.eddsa.sign(M,this)},J.prototype.verify=function(M,z){return this.eddsa.verify(M,z,this)},J.prototype.getSecret=function(M){return L(this._secret,"KeyPair is public only"),I.encode(this.secret(),M)},J.prototype.getPublic=function(M){return I.encode(this.pubBytes(),M)},G.exports=J}),qG=$0((Q,G)=>{var I=tU(),L=fU(),T=L.assert,F=L.cachedProperty,J=L.parseBytes;function M(z,W){if(this.eddsa=z,typeof W!=="object")W=J(W);if(Array.isArray(W))T(W.length===z.encodingLength*2,"Signature has invalid size"),W={R:W.slice(0,z.encodingLength),S:W.slice(z.encodingLength)};if(T(W.R&&W.S,"Signature without R or S"),z.isPoint(W.R))this._R=W.R;if(W.S instanceof I)this._S=W.S;this._Rencoded=Array.isArray(W.R)?W.R:W.Rencoded,this._Sencoded=Array.isArray(W.S)?W.S:W.Sencoded}F(M,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),F(M,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),F(M,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),F(M,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),M.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},M.prototype.toHex=function(){return L.encode(this.toBytes(),"hex").toUpperCase()},G.exports=M}),PG=$0((Q,G)=>{var I=OX(),L=ZX(),T=fU(),F=T.assert,J=T.parseBytes,M=zG(),z=qG();function W(H){if(F(H==="ed25519","only tested with ed25519 so far"),!(this instanceof W))return new W(H);H=L[H].curve,this.curve=H,this.g=H.g,this.g.precompute(H.n.bitLength()+1),this.pointClass=H.point().constructor,this.encodingLength=Math.ceil(H.n.bitLength()/8),this.hash=I.sha512}G.exports=W,W.prototype.sign=function(H,C){H=J(H);var R=this.keyFromSecret(C),q=this.hashInt(R.messagePrefix(),H),P=this.g.mul(q),j=this.encodePoint(P),k=this.hashInt(j,R.pubBytes(),H).mul(R.priv()),B=q.add(k).umod(this.curve.n);return this.makeSignature({R:P,S:B,Rencoded:j})},W.prototype.verify=function(H,C,R){if(H=J(H),C=this.makeSignature(C),C.S().gte(C.eddsa.curve.n)||C.S().isNeg())return!1;var q=this.keyFromPublic(R),P=this.hashInt(C.Rencoded(),q.pubBytes(),H),j=this.g.mul(C.S()),k=C.R().add(q.pub().mul(P));return k.eq(j)},W.prototype.hashInt=function(){var H=this.hash();for(var C=0;C<arguments.length;C++)H.update(arguments[C]);return T.intFromLE(H.digest()).umod(this.curve.n)},W.prototype.keyFromPublic=function(H){return M.fromPublic(this,H)},W.prototype.keyFromSecret=function(H){return M.fromSecret(this,H)},W.prototype.makeSignature=function(H){if(H instanceof z)return H;return new z(this,H)},W.prototype.encodePoint=function(H){var C=H.getY().toArray("le",this.encodingLength);return C[this.encodingLength-1]|=H.getX().isOdd()?128:0,C},W.prototype.decodePoint=function(H){H=T.parseBytes(H);var C=H.length-1,R=H.slice(0,C).concat(H[C]&-129),q=(H[C]&128)!==0,P=T.intFromLE(R);return this.curve.pointFromY(P,q)},W.prototype.encodeInt=function(H){return H.toArray("le",this.encodingLength)},W.prototype.decodeInt=function(H){return T.intFromLE(H)},W.prototype.isPoint=function(H){return H instanceof this.pointClass}}),kG=$0((Q)=>{var G=Q;G.version=GG().version,G.utils=fU(),G.rand=sQ(),G.curve=rQ(),G.curves=ZX(),G.ec=MG(),G.eddsa=PG()}),jG=$0((Q,G)=>{(function(I,L){function T(U,X){if(!U)throw Error(X||"Assertion failed")}function F(U,X){U.super_=X;var $=function(){};$.prototype=X.prototype,U.prototype=new $,U.prototype.constructor=U}function J(U,X,$){if(J.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")$=X,X=10;this._init(U||0,X||10,$||"be")}}if(typeof I==="object")I.exports=J;else L.BN=J;J.BN=J,J.wordSize=26;var M;try{if(typeof window<"u"&&typeof window.Buffer<"u")M=window.Buffer;else M=(LU(),h0(CU)).Buffer}catch(U){}J.isBN=function(U){if(U instanceof J)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===J.wordSize&&Array.isArray(U.words)},J.max=function(U,X){if(U.cmp(X)>0)return U;return X},J.min=function(U,X){if(U.cmp(X)<0)return U;return X},J.prototype._init=function(U,X,$){if(typeof U==="number")return this._initNumber(U,X,$);if(typeof U==="object")return this._initArray(U,X,$);if(X==="hex")X=16;T(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,$);else if(this._parseBase(U,X,Z),$==="le")this._initArray(this.toArray(),X,$)}},J.prototype._initNumber=function(U,X,$){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else T(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if($!=="le")return;this._initArray(this.toArray(),X,$)},J.prototype._initArray=function(U,X,$){if(T(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y,E,K=0;if($==="be"){for(Z=U.length-1,Y=0;Z>=0;Z-=3)if(E=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[Y]|=E<<K&67108863,this.words[Y+1]=E>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}else if($==="le"){for(Z=0,Y=0;Z<U.length;Z+=3)if(E=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[Y]|=E<<K&67108863,this.words[Y+1]=E>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}return this.strip()};function z(U,X){var $=U.charCodeAt(X);if($>=65&&$<=70)return $-55;else if($>=97&&$<=102)return $-87;else return $-48&15}function W(U,X,$){var Z=z(U,$);if($-1>=X)Z|=z(U,$-1)<<4;return Z}J.prototype._parseHex=function(U,X,$){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y=0,E=0,K;if($==="be")for(Z=U.length-1;Z>=X;Z-=2)if(K=W(U,X,Z)<<Y,this.words[E]|=K&67108863,Y>=18)Y-=18,E+=1,this.words[E]|=K>>>26;else Y+=8;else{var A=U.length-X;for(Z=A%2===0?X+1:X;Z<U.length;Z+=2)if(K=W(U,X,Z)<<Y,this.words[E]|=K&67108863,Y>=18)Y-=18,E+=1,this.words[E]|=K>>>26;else Y+=8}this.strip()};function H(U,X,$,Z){var Y=0,E=Math.min(U.length,$);for(var K=X;K<E;K++){var A=U.charCodeAt(K)-48;if(Y*=Z,A>=49)Y+=A-49+10;else if(A>=17)Y+=A-17+10;else Y+=A}return Y}J.prototype._parseBase=function(U,X,$){this.words=[0],this.length=1;for(var Z=0,Y=1;Y<=67108863;Y*=X)Z++;Z--,Y=Y/X|0;var E=U.length-$,K=E%Z,A=Math.min(E,E-K)+$,O=0;for(var V=$;V<A;V+=Z)if(O=H(U,V,V+Z,X),this.imuln(Y),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(K!==0){var D=1;O=H(U,V,U.length,X);for(V=0;V<K;V++)D*=X;if(this.imuln(D),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},J.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},J.prototype.clone=function(){var U=new J(null);return this.copy(U),U},J.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},J.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},J.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},J.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var C=["","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"],R=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(J.prototype.toString=function(U,X){U=U||10,X=X|0||1;var $;if(U===16||U==="hex"){$="";var Z=0,Y=0;for(var E=0;E<this.length;E++){var K=this.words[E],A=((K<<Z|Y)&16777215).toString(16);if(Y=K>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,E--;if(Y!==0||E!==this.length-1)$=C[6-A.length]+A+$;else $=A+$}if(Y!==0)$=Y.toString(16)+$;while($.length%X!==0)$="0"+$;if(this.negative!==0)$="-"+$;return $}if(U===(U|0)&&U>=2&&U<=36){var O=R[U],V=q[U];$="";var D=this.clone();D.negative=0;while(!D.isZero()){var S=D.modn(V).toString(U);if(D=D.idivn(V),!D.isZero())$=C[O-S.length]+S+$;else $=S+$}if(this.isZero())$="0"+$;while($.length%X!==0)$="0"+$;if(this.negative!==0)$="-"+$;return $}T(!1,"Base should be between 2 and 36")},J.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)T(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},J.prototype.toJSON=function(){return this.toString(16)},J.prototype.toBuffer=function(U,X){return T(typeof M<"u"),this.toArrayLike(M,U,X)},J.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},J.prototype.toArrayLike=function(U,X,$){var Z=this.byteLength(),Y=$||Math.max(1,Z);T(Z<=Y,"byte array longer than desired length"),T(Y>0,"Requested array length <= 0"),this.strip();var E=X==="le",K=new U(Y),A,O,V=this.clone();if(!E){for(O=0;O<Y-Z;O++)K[O]=0;for(O=0;!V.isZero();O++)A=V.andln(255),V.iushrn(8),K[Y-O-1]=A}else{for(O=0;!V.isZero();O++)A=V.andln(255),V.iushrn(8),K[O]=A;for(;O<Y;O++)K[O]=0}return K},Math.clz32)J.prototype._countBits=function(U){return 32-Math.clz32(U)};else J.prototype._countBits=function(U){var X=U,$=0;if(X>=4096)$+=13,X>>>=13;if(X>=64)$+=7,X>>>=7;if(X>=8)$+=4,X>>>=4;if(X>=2)$+=2,X>>>=2;return $+X};J.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,$=0;if((X&8191)===0)$+=13,X>>>=13;if((X&127)===0)$+=7,X>>>=7;if((X&15)===0)$+=4,X>>>=4;if((X&3)===0)$+=2,X>>>=2;if((X&1)===0)$++;return $},J.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var $=0;$<X.length;$++){var Z=$/26|0,Y=$%26;X[$]=(U.words[Z]&1<<Y)>>>Y}return X}J.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var $=this._zeroBits(this.words[X]);if(U+=$,$!==26)break}return U},J.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},J.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},J.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},J.prototype.isNeg=function(){return this.negative!==0},J.prototype.neg=function(){return this.clone().ineg()},J.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},J.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},J.prototype.ior=function(U){return T((this.negative|U.negative)===0),this.iuor(U)},J.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},J.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},J.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var $=0;$<X.length;$++)this.words[$]=this.words[$]&U.words[$];return this.length=X.length,this.strip()},J.prototype.iand=function(U){return T((this.negative|U.negative)===0),this.iuand(U)},J.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},J.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},J.prototype.iuxor=function(U){var X,$;if(this.length>U.length)X=this,$=U;else X=U,$=this;for(var Z=0;Z<$.length;Z++)this.words[Z]=X.words[Z]^$.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},J.prototype.ixor=function(U){return T((this.negative|U.negative)===0),this.iuxor(U)},J.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},J.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},J.prototype.inotn=function(U){T(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,$=U%26;if(this._expand(X),$>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if($>0)this.words[Z]=~this.words[Z]&67108863>>26-$;return this.strip()},J.prototype.notn=function(U){return this.clone().inotn(U)},J.prototype.setn=function(U,X){T(typeof U==="number"&&U>=0);var $=U/26|0,Z=U%26;if(this._expand($+1),X)this.words[$]=this.words[$]|1<<Z;else this.words[$]=this.words[$]&~(1<<Z);return this.strip()},J.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var $,Z;if(this.length>U.length)$=this,Z=U;else $=U,Z=this;var Y=0;for(var E=0;E<Z.length;E++)X=($.words[E]|0)+(Z.words[E]|0)+Y,this.words[E]=X&67108863,Y=X>>>26;for(;Y!==0&&E<$.length;E++)X=($.words[E]|0)+Y,this.words[E]=X&67108863,Y=X>>>26;if(this.length=$.length,Y!==0)this.words[this.length]=Y,this.length++;else if($!==this)for(;E<$.length;E++)this.words[E]=$.words[E];return this},J.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},J.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var $=this.cmp(U);if($===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Y;if($>0)Z=this,Y=U;else Z=U,Y=this;var E=0;for(var K=0;K<Y.length;K++)X=(Z.words[K]|0)-(Y.words[K]|0)+E,E=X>>26,this.words[K]=X&67108863;for(;E!==0&&K<Z.length;K++)X=(Z.words[K]|0)+E,E=X>>26,this.words[K]=X&67108863;if(E===0&&K<Z.length&&Z!==this)for(;K<Z.length;K++)this.words[K]=Z.words[K];if(this.length=Math.max(this.length,K),Z!==this)this.negative=1;return this.strip()},J.prototype.sub=function(U){return this.clone().isub(U)};function j(U,X,$){$.negative=X.negative^U.negative;var Z=U.length+X.length|0;$.length=Z,Z=Z-1|0;var Y=U.words[0]|0,E=X.words[0]|0,K=Y*E,A=K&67108863,O=K/67108864|0;$.words[0]=A;for(var V=1;V<Z;V++){var D=O>>>26,S=O&67108863,_=Math.min(V,X.length-1);for(var N=Math.max(0,V-U.length+1);N<=_;N++){var p=V-N|0;Y=U.words[p]|0,E=X.words[N]|0,K=Y*E+S,D+=K/67108864|0,S=K&67108863}$.words[V]=S|0,O=D|0}if(O!==0)$.words[V]=O|0;else $.length--;return $.strip()}var k=function(U,X,$){var Z=U.words,Y=X.words,E=$.words,K=0,A,O,V,D=Z[0]|0,S=D&8191,_=D>>>13,N=Z[1]|0,p=N&8191,n=N>>>13,V0=Z[2]|0,r=V0&8191,b=V0>>>13,X0=Z[3]|0,t=X0&8191,i=X0>>>13,N0=Z[4]|0,y=N0&8191,h=N0>>>13,Q0=Z[5]|0,s=Q0&8191,a=Q0>>>13,H0=Z[6]|0,c=H0&8191,o=H0>>>13,x0=Z[7]|0,m=x0&8191,Z0=x0>>>13,w0=Z[8]|0,K0=w0&8191,T0=w0>>>13,t0=Z[9]|0,I0=t0&8191,C0=t0>>>13,r0=Y[0]|0,R0=r0&8191,S0=r0>>>13,WU=Y[1]|0,F0=WU&8191,k0=WU>>>13,HU=Y[2]|0,j0=HU&8191,D0=HU>>>13,SU=Y[3]|0,_0=SU&8191,M0=SU>>>13,EU=Y[4]|0,v0=EU&8191,B0=EU>>>13,KU=Y[5]|0,z0=KU&8191,x=KU>>>13,l=Y[6]|0,e=l&8191,U0=l>>>13,f0=Y[7]|0,E0=f0&8191,L0=f0>>>13,m0=Y[8]|0,q0=m0&8191,g0=m0>>>13,RU=Y[9]|0,P0=RU&8191,W0=RU>>>13;$.negative=U.negative^X.negative,$.length=19,A=Math.imul(S,R0),O=Math.imul(S,S0),O=O+Math.imul(_,R0)|0,V=Math.imul(_,S0);var s0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(s0>>>26)|0,s0&=67108863,A=Math.imul(p,R0),O=Math.imul(p,S0),O=O+Math.imul(n,R0)|0,V=Math.imul(n,S0),A=A+Math.imul(S,F0)|0,O=O+Math.imul(S,k0)|0,O=O+Math.imul(_,F0)|0,V=V+Math.imul(_,k0)|0;var c0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,A=Math.imul(r,R0),O=Math.imul(r,S0),O=O+Math.imul(b,R0)|0,V=Math.imul(b,S0),A=A+Math.imul(p,F0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,F0)|0,V=V+Math.imul(n,k0)|0,A=A+Math.imul(S,j0)|0,O=O+Math.imul(S,D0)|0,O=O+Math.imul(_,j0)|0,V=V+Math.imul(_,D0)|0;var y0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,A=Math.imul(t,R0),O=Math.imul(t,S0),O=O+Math.imul(i,R0)|0,V=Math.imul(i,S0),A=A+Math.imul(r,F0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(b,F0)|0,V=V+Math.imul(b,k0)|0,A=A+Math.imul(p,j0)|0,O=O+Math.imul(p,D0)|0,O=O+Math.imul(n,j0)|0,V=V+Math.imul(n,D0)|0,A=A+Math.imul(S,_0)|0,O=O+Math.imul(S,M0)|0,O=O+Math.imul(_,_0)|0,V=V+Math.imul(_,M0)|0;var b0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(b0>>>26)|0,b0&=67108863,A=Math.imul(y,R0),O=Math.imul(y,S0),O=O+Math.imul(h,R0)|0,V=Math.imul(h,S0),A=A+Math.imul(t,F0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(i,F0)|0,V=V+Math.imul(i,k0)|0,A=A+Math.imul(r,j0)|0,O=O+Math.imul(r,D0)|0,O=O+Math.imul(b,j0)|0,V=V+Math.imul(b,D0)|0,A=A+Math.imul(p,_0)|0,O=O+Math.imul(p,M0)|0,O=O+Math.imul(n,_0)|0,V=V+Math.imul(n,M0)|0,A=A+Math.imul(S,v0)|0,O=O+Math.imul(S,B0)|0,O=O+Math.imul(_,v0)|0,V=V+Math.imul(_,B0)|0;var l0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,A=Math.imul(s,R0),O=Math.imul(s,S0),O=O+Math.imul(a,R0)|0,V=Math.imul(a,S0),A=A+Math.imul(y,F0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,F0)|0,V=V+Math.imul(h,k0)|0,A=A+Math.imul(t,j0)|0,O=O+Math.imul(t,D0)|0,O=O+Math.imul(i,j0)|0,V=V+Math.imul(i,D0)|0,A=A+Math.imul(r,_0)|0,O=O+Math.imul(r,M0)|0,O=O+Math.imul(b,_0)|0,V=V+Math.imul(b,M0)|0,A=A+Math.imul(p,v0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,v0)|0,V=V+Math.imul(n,B0)|0,A=A+Math.imul(S,z0)|0,O=O+Math.imul(S,x)|0,O=O+Math.imul(_,z0)|0,V=V+Math.imul(_,x)|0;var e0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(e0>>>26)|0,e0&=67108863,A=Math.imul(c,R0),O=Math.imul(c,S0),O=O+Math.imul(o,R0)|0,V=Math.imul(o,S0),A=A+Math.imul(s,F0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(a,F0)|0,V=V+Math.imul(a,k0)|0,A=A+Math.imul(y,j0)|0,O=O+Math.imul(y,D0)|0,O=O+Math.imul(h,j0)|0,V=V+Math.imul(h,D0)|0,A=A+Math.imul(t,_0)|0,O=O+Math.imul(t,M0)|0,O=O+Math.imul(i,_0)|0,V=V+Math.imul(i,M0)|0,A=A+Math.imul(r,v0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(b,v0)|0,V=V+Math.imul(b,B0)|0,A=A+Math.imul(p,z0)|0,O=O+Math.imul(p,x)|0,O=O+Math.imul(n,z0)|0,V=V+Math.imul(n,x)|0,A=A+Math.imul(S,e)|0,O=O+Math.imul(S,U0)|0,O=O+Math.imul(_,e)|0,V=V+Math.imul(_,U0)|0;var a0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(a0>>>26)|0,a0&=67108863,A=Math.imul(m,R0),O=Math.imul(m,S0),O=O+Math.imul(Z0,R0)|0,V=Math.imul(Z0,S0),A=A+Math.imul(c,F0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,F0)|0,V=V+Math.imul(o,k0)|0,A=A+Math.imul(s,j0)|0,O=O+Math.imul(s,D0)|0,O=O+Math.imul(a,j0)|0,V=V+Math.imul(a,D0)|0,A=A+Math.imul(y,_0)|0,O=O+Math.imul(y,M0)|0,O=O+Math.imul(h,_0)|0,V=V+Math.imul(h,M0)|0,A=A+Math.imul(t,v0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(i,v0)|0,V=V+Math.imul(i,B0)|0,A=A+Math.imul(r,z0)|0,O=O+Math.imul(r,x)|0,O=O+Math.imul(b,z0)|0,V=V+Math.imul(b,x)|0,A=A+Math.imul(p,e)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,e)|0,V=V+Math.imul(n,U0)|0,A=A+Math.imul(S,E0)|0,O=O+Math.imul(S,L0)|0,O=O+Math.imul(_,E0)|0,V=V+Math.imul(_,L0)|0;var i0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,A=Math.imul(K0,R0),O=Math.imul(K0,S0),O=O+Math.imul(T0,R0)|0,V=Math.imul(T0,S0),A=A+Math.imul(m,F0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(Z0,F0)|0,V=V+Math.imul(Z0,k0)|0,A=A+Math.imul(c,j0)|0,O=O+Math.imul(c,D0)|0,O=O+Math.imul(o,j0)|0,V=V+Math.imul(o,D0)|0,A=A+Math.imul(s,_0)|0,O=O+Math.imul(s,M0)|0,O=O+Math.imul(a,_0)|0,V=V+Math.imul(a,M0)|0,A=A+Math.imul(y,v0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,v0)|0,V=V+Math.imul(h,B0)|0,A=A+Math.imul(t,z0)|0,O=O+Math.imul(t,x)|0,O=O+Math.imul(i,z0)|0,V=V+Math.imul(i,x)|0,A=A+Math.imul(r,e)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(b,e)|0,V=V+Math.imul(b,U0)|0,A=A+Math.imul(p,E0)|0,O=O+Math.imul(p,L0)|0,O=O+Math.imul(n,E0)|0,V=V+Math.imul(n,L0)|0,A=A+Math.imul(S,q0)|0,O=O+Math.imul(S,g0)|0,O=O+Math.imul(_,q0)|0,V=V+Math.imul(_,g0)|0;var UU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,A=Math.imul(I0,R0),O=Math.imul(I0,S0),O=O+Math.imul(C0,R0)|0,V=Math.imul(C0,S0),A=A+Math.imul(K0,F0)|0,O=O+Math.imul(K0,k0)|0,O=O+Math.imul(T0,F0)|0,V=V+Math.imul(T0,k0)|0,A=A+Math.imul(m,j0)|0,O=O+Math.imul(m,D0)|0,O=O+Math.imul(Z0,j0)|0,V=V+Math.imul(Z0,D0)|0,A=A+Math.imul(c,_0)|0,O=O+Math.imul(c,M0)|0,O=O+Math.imul(o,_0)|0,V=V+Math.imul(o,M0)|0,A=A+Math.imul(s,v0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(a,v0)|0,V=V+Math.imul(a,B0)|0,A=A+Math.imul(y,z0)|0,O=O+Math.imul(y,x)|0,O=O+Math.imul(h,z0)|0,V=V+Math.imul(h,x)|0,A=A+Math.imul(t,e)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(i,e)|0,V=V+Math.imul(i,U0)|0,A=A+Math.imul(r,E0)|0,O=O+Math.imul(r,L0)|0,O=O+Math.imul(b,E0)|0,V=V+Math.imul(b,L0)|0,A=A+Math.imul(p,q0)|0,O=O+Math.imul(p,g0)|0,O=O+Math.imul(n,q0)|0,V=V+Math.imul(n,g0)|0,A=A+Math.imul(S,P0)|0,O=O+Math.imul(S,W0)|0,O=O+Math.imul(_,P0)|0,V=V+Math.imul(_,W0)|0;var OU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,A=Math.imul(I0,F0),O=Math.imul(I0,k0),O=O+Math.imul(C0,F0)|0,V=Math.imul(C0,k0),A=A+Math.imul(K0,j0)|0,O=O+Math.imul(K0,D0)|0,O=O+Math.imul(T0,j0)|0,V=V+Math.imul(T0,D0)|0,A=A+Math.imul(m,_0)|0,O=O+Math.imul(m,M0)|0,O=O+Math.imul(Z0,_0)|0,V=V+Math.imul(Z0,M0)|0,A=A+Math.imul(c,v0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,v0)|0,V=V+Math.imul(o,B0)|0,A=A+Math.imul(s,z0)|0,O=O+Math.imul(s,x)|0,O=O+Math.imul(a,z0)|0,V=V+Math.imul(a,x)|0,A=A+Math.imul(y,e)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,e)|0,V=V+Math.imul(h,U0)|0,A=A+Math.imul(t,E0)|0,O=O+Math.imul(t,L0)|0,O=O+Math.imul(i,E0)|0,V=V+Math.imul(i,L0)|0,A=A+Math.imul(r,q0)|0,O=O+Math.imul(r,g0)|0,O=O+Math.imul(b,q0)|0,V=V+Math.imul(b,g0)|0,A=A+Math.imul(p,P0)|0,O=O+Math.imul(p,W0)|0,O=O+Math.imul(n,P0)|0,V=V+Math.imul(n,W0)|0;var ZU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,A=Math.imul(I0,j0),O=Math.imul(I0,D0),O=O+Math.imul(C0,j0)|0,V=Math.imul(C0,D0),A=A+Math.imul(K0,_0)|0,O=O+Math.imul(K0,M0)|0,O=O+Math.imul(T0,_0)|0,V=V+Math.imul(T0,M0)|0,A=A+Math.imul(m,v0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(Z0,v0)|0,V=V+Math.imul(Z0,B0)|0,A=A+Math.imul(c,z0)|0,O=O+Math.imul(c,x)|0,O=O+Math.imul(o,z0)|0,V=V+Math.imul(o,x)|0,A=A+Math.imul(s,e)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(a,e)|0,V=V+Math.imul(a,U0)|0,A=A+Math.imul(y,E0)|0,O=O+Math.imul(y,L0)|0,O=O+Math.imul(h,E0)|0,V=V+Math.imul(h,L0)|0,A=A+Math.imul(t,q0)|0,O=O+Math.imul(t,g0)|0,O=O+Math.imul(i,q0)|0,V=V+Math.imul(i,g0)|0,A=A+Math.imul(r,P0)|0,O=O+Math.imul(r,W0)|0,O=O+Math.imul(b,P0)|0,V=V+Math.imul(b,W0)|0;var XU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,A=Math.imul(I0,_0),O=Math.imul(I0,M0),O=O+Math.imul(C0,_0)|0,V=Math.imul(C0,M0),A=A+Math.imul(K0,v0)|0,O=O+Math.imul(K0,B0)|0,O=O+Math.imul(T0,v0)|0,V=V+Math.imul(T0,B0)|0,A=A+Math.imul(m,z0)|0,O=O+Math.imul(m,x)|0,O=O+Math.imul(Z0,z0)|0,V=V+Math.imul(Z0,x)|0,A=A+Math.imul(c,e)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,e)|0,V=V+Math.imul(o,U0)|0,A=A+Math.imul(s,E0)|0,O=O+Math.imul(s,L0)|0,O=O+Math.imul(a,E0)|0,V=V+Math.imul(a,L0)|0,A=A+Math.imul(y,q0)|0,O=O+Math.imul(y,g0)|0,O=O+Math.imul(h,q0)|0,V=V+Math.imul(h,g0)|0,A=A+Math.imul(t,P0)|0,O=O+Math.imul(t,W0)|0,O=O+Math.imul(i,P0)|0,V=V+Math.imul(i,W0)|0;var QU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,A=Math.imul(I0,v0),O=Math.imul(I0,B0),O=O+Math.imul(C0,v0)|0,V=Math.imul(C0,B0),A=A+Math.imul(K0,z0)|0,O=O+Math.imul(K0,x)|0,O=O+Math.imul(T0,z0)|0,V=V+Math.imul(T0,x)|0,A=A+Math.imul(m,e)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(Z0,e)|0,V=V+Math.imul(Z0,U0)|0,A=A+Math.imul(c,E0)|0,O=O+Math.imul(c,L0)|0,O=O+Math.imul(o,E0)|0,V=V+Math.imul(o,L0)|0,A=A+Math.imul(s,q0)|0,O=O+Math.imul(s,g0)|0,O=O+Math.imul(a,q0)|0,V=V+Math.imul(a,g0)|0,A=A+Math.imul(y,P0)|0,O=O+Math.imul(y,W0)|0,O=O+Math.imul(h,P0)|0,V=V+Math.imul(h,W0)|0;var YU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,A=Math.imul(I0,z0),O=Math.imul(I0,x),O=O+Math.imul(C0,z0)|0,V=Math.imul(C0,x),A=A+Math.imul(K0,e)|0,O=O+Math.imul(K0,U0)|0,O=O+Math.imul(T0,e)|0,V=V+Math.imul(T0,U0)|0,A=A+Math.imul(m,E0)|0,O=O+Math.imul(m,L0)|0,O=O+Math.imul(Z0,E0)|0,V=V+Math.imul(Z0,L0)|0,A=A+Math.imul(c,q0)|0,O=O+Math.imul(c,g0)|0,O=O+Math.imul(o,q0)|0,V=V+Math.imul(o,g0)|0,A=A+Math.imul(s,P0)|0,O=O+Math.imul(s,W0)|0,O=O+Math.imul(a,P0)|0,V=V+Math.imul(a,W0)|0;var JU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,A=Math.imul(I0,e),O=Math.imul(I0,U0),O=O+Math.imul(C0,e)|0,V=Math.imul(C0,U0),A=A+Math.imul(K0,E0)|0,O=O+Math.imul(K0,L0)|0,O=O+Math.imul(T0,E0)|0,V=V+Math.imul(T0,L0)|0,A=A+Math.imul(m,q0)|0,O=O+Math.imul(m,g0)|0,O=O+Math.imul(Z0,q0)|0,V=V+Math.imul(Z0,g0)|0,A=A+Math.imul(c,P0)|0,O=O+Math.imul(c,W0)|0,O=O+Math.imul(o,P0)|0,V=V+Math.imul(o,W0)|0;var $U=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,A=Math.imul(I0,E0),O=Math.imul(I0,L0),O=O+Math.imul(C0,E0)|0,V=Math.imul(C0,L0),A=A+Math.imul(K0,q0)|0,O=O+Math.imul(K0,g0)|0,O=O+Math.imul(T0,q0)|0,V=V+Math.imul(T0,g0)|0,A=A+Math.imul(m,P0)|0,O=O+Math.imul(m,W0)|0,O=O+Math.imul(Z0,P0)|0,V=V+Math.imul(Z0,W0)|0;var GU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,A=Math.imul(I0,q0),O=Math.imul(I0,g0),O=O+Math.imul(C0,q0)|0,V=Math.imul(C0,g0),A=A+Math.imul(K0,P0)|0,O=O+Math.imul(K0,W0)|0,O=O+Math.imul(T0,P0)|0,V=V+Math.imul(T0,W0)|0;var AU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,A=Math.imul(I0,P0),O=Math.imul(I0,W0),O=O+Math.imul(C0,P0)|0,V=Math.imul(C0,W0);var VU=(K+A|0)+((O&8191)<<13)|0;if(K=(V+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,E[0]=s0,E[1]=c0,E[2]=y0,E[3]=b0,E[4]=l0,E[5]=e0,E[6]=a0,E[7]=i0,E[8]=UU,E[9]=OU,E[10]=ZU,E[11]=XU,E[12]=QU,E[13]=YU,E[14]=JU,E[15]=$U,E[16]=GU,E[17]=AU,E[18]=VU,K!==0)E[19]=K,$.length++;return $};if(!Math.imul)k=j;function B(U,X,$){$.negative=X.negative^U.negative,$.length=U.length+X.length;var Z=0,Y=0;for(var E=0;E<$.length-1;E++){var K=Y;Y=0;var A=Z&67108863,O=Math.min(E,X.length-1);for(var V=Math.max(0,E-U.length+1);V<=O;V++){var D=E-V,S=U.words[D]|0,_=X.words[V]|0,N=S*_,p=N&67108863;K=K+(N/67108864|0)|0,p=p+A|0,A=p&67108863,K=K+(p>>>26)|0,Y+=K>>>26,K&=67108863}$.words[E]=A,Z=K,K=Y}if(Z!==0)$.words[E]=Z;else $.length--;return $.strip()}function v(U,X,$){var Z=new g;return Z.mulp(U,X,$)}J.prototype.mulTo=function(U,X){var $,Z=this.length+U.length;if(this.length===10&&U.length===10)$=k(this,U,X);else if(Z<63)$=j(this,U,X);else if(Z<1024)$=B(this,U,X);else $=v(this,U,X);return $};function g(U,X){this.x=U,this.y=X}g.prototype.makeRBT=function(U){var X=Array(U),$=J.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,$,U);return X},g.prototype.revBin=function(U,X,$){if(U===0||U===$-1)return U;var Z=0;for(var Y=0;Y<X;Y++)Z|=(U&1)<<X-Y-1,U>>=1;return Z},g.prototype.permute=function(U,X,$,Z,Y,E){for(var K=0;K<E;K++)Z[K]=X[U[K]],Y[K]=$[U[K]]},g.prototype.transform=function(U,X,$,Z,Y,E){this.permute(E,U,X,$,Z,Y);for(var K=1;K<Y;K<<=1){var A=K<<1,O=Math.cos(2*Math.PI/A),V=Math.sin(2*Math.PI/A);for(var D=0;D<Y;D+=A){var S=O,_=V;for(var N=0;N<K;N++){var p=$[D+N],n=Z[D+N],V0=$[D+N+K],r=Z[D+N+K],b=S*V0-_*r;if(r=S*r+_*V0,V0=b,$[D+N]=p+V0,Z[D+N]=n+r,$[D+N+K]=p-V0,Z[D+N+K]=n-r,N!==A)b=O*S-V*_,_=O*_+V*S,S=b}}}},g.prototype.guessLen13b=function(U,X){var $=Math.max(X,U)|1,Z=$&1,Y=0;for($=$/2|0;$;$=$>>>1)Y++;return 1<<Y+1+Z},g.prototype.conjugate=function(U,X,$){if($<=1)return;for(var Z=0;Z<$/2;Z++){var Y=U[Z];U[Z]=U[$-Z-1],U[$-Z-1]=Y,Y=X[Z],X[Z]=-X[$-Z-1],X[$-Z-1]=-Y}},g.prototype.normalize13b=function(U,X){var $=0;for(var Z=0;Z<X/2;Z++){var Y=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+$;if(U[Z]=Y&67108863,Y<67108864)$=0;else $=Y/67108864|0}return U},g.prototype.convert13b=function(U,X,$,Z){var Y=0;for(var E=0;E<X;E++)Y=Y+(U[E]|0),$[2*E]=Y&8191,Y=Y>>>13,$[2*E+1]=Y&8191,Y=Y>>>13;for(E=2*X;E<Z;++E)$[E]=0;T(Y===0),T((Y&-8192)===0)},g.prototype.stub=function(U){var X=Array(U);for(var $=0;$<U;$++)X[$]=0;return X},g.prototype.mulp=function(U,X,$){var Z=2*this.guessLen13b(U.length,X.length),Y=this.makeRBT(Z),E=this.stub(Z),K=Array(Z),A=Array(Z),O=Array(Z),V=Array(Z),D=Array(Z),S=Array(Z),_=$.words;_.length=Z,this.convert13b(U.words,U.length,K,Z),this.convert13b(X.words,X.length,V,Z),this.transform(K,E,A,O,Z,Y),this.transform(V,E,D,S,Z,Y);for(var N=0;N<Z;N++){var p=A[N]*D[N]-O[N]*S[N];O[N]=A[N]*S[N]+O[N]*D[N],A[N]=p}return this.conjugate(A,O,Z),this.transform(A,O,_,E,Z,Y),this.conjugate(_,E,Z),this.normalize13b(_,Z),$.negative=U.negative^X.negative,$.length=U.length+X.length,$.strip()},J.prototype.mul=function(U){var X=new J(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},J.prototype.mulf=function(U){var X=new J(null);return X.words=Array(this.length+U.length),v(this,U,X)},J.prototype.imul=function(U){return this.clone().mulTo(U,this)},J.prototype.imuln=function(U){T(typeof U==="number"),T(U<67108864);var X=0;for(var $=0;$<this.length;$++){var Z=(this.words[$]|0)*U,Y=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=Y>>>26,this.words[$]=Y&67108863}if(X!==0)this.words[$]=X,this.length++;return this.length=U===0?1:this.length,this},J.prototype.muln=function(U){return this.clone().imuln(U)},J.prototype.sqr=function(){return this.mul(this)},J.prototype.isqr=function(){return this.imul(this.clone())},J.prototype.pow=function(U){var X=P(U);if(X.length===0)return new J(1);var $=this;for(var Z=0;Z<X.length;Z++,$=$.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var Y=$.sqr();Z<X.length;Z++,Y=Y.sqr()){if(X[Z]===0)continue;$=$.mul(Y)}return $},J.prototype.iushln=function(U){T(typeof U==="number"&&U>=0);var X=U%26,$=(U-X)/26,Z=67108863>>>26-X<<26-X,Y;if(X!==0){var E=0;for(Y=0;Y<this.length;Y++){var K=this.words[Y]&Z,A=(this.words[Y]|0)-K<<X;this.words[Y]=A|E,E=K>>>26-X}if(E)this.words[Y]=E,this.length++}if($!==0){for(Y=this.length-1;Y>=0;Y--)this.words[Y+$]=this.words[Y];for(Y=0;Y<$;Y++)this.words[Y]=0;this.length+=$}return this.strip()},J.prototype.ishln=function(U){return T(this.negative===0),this.iushln(U)},J.prototype.iushrn=function(U,X,$){T(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var Y=U%26,E=Math.min((U-Y)/26,this.length),K=67108863^67108863>>>Y<<Y,A=$;if(Z-=E,Z=Math.max(0,Z),A){for(var O=0;O<E;O++)A.words[O]=this.words[O];A.length=E}if(E===0);else if(this.length>E){this.length-=E;for(O=0;O<this.length;O++)this.words[O]=this.words[O+E]}else this.words[0]=0,this.length=1;var V=0;for(O=this.length-1;O>=0&&(V!==0||O>=Z);O--){var D=this.words[O]|0;this.words[O]=V<<26-Y|D>>>Y,V=D&K}if(A&&V!==0)A.words[A.length++]=V;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},J.prototype.ishrn=function(U,X,$){return T(this.negative===0),this.iushrn(U,X,$)},J.prototype.shln=function(U){return this.clone().ishln(U)},J.prototype.ushln=function(U){return this.clone().iushln(U)},J.prototype.shrn=function(U){return this.clone().ishrn(U)},J.prototype.ushrn=function(U){return this.clone().iushrn(U)},J.prototype.testn=function(U){T(typeof U==="number"&&U>=0);var X=U%26,$=(U-X)/26,Z=1<<X;if(this.length<=$)return!1;var Y=this.words[$];return!!(Y&Z)},J.prototype.imaskn=function(U){T(typeof U==="number"&&U>=0);var X=U%26,$=(U-X)/26;if(T(this.negative===0,"imaskn works only with positive numbers"),this.length<=$)return this;if(X!==0)$++;if(this.length=Math.min($,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},J.prototype.maskn=function(U){return this.clone().imaskn(U)},J.prototype.iaddn=function(U){if(T(typeof U==="number"),T(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},J.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},J.prototype.isubn=function(U){if(T(typeof U==="number"),T(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},J.prototype.addn=function(U){return this.clone().iaddn(U)},J.prototype.subn=function(U){return this.clone().isubn(U)},J.prototype.iabs=function(){return this.negative=0,this},J.prototype.abs=function(){return this.clone().iabs()},J.prototype._ishlnsubmul=function(U,X,$){var Z=U.length+$,Y;this._expand(Z);var E,K=0;for(Y=0;Y<U.length;Y++){E=(this.words[Y+$]|0)+K;var A=(U.words[Y]|0)*X;E-=A&67108863,K=(E>>26)-(A/67108864|0),this.words[Y+$]=E&67108863}for(;Y<this.length-$;Y++)E=(this.words[Y+$]|0)+K,K=E>>26,this.words[Y+$]=E&67108863;if(K===0)return this.strip();T(K===-1),K=0;for(Y=0;Y<this.length;Y++)E=-(this.words[Y]|0)+K,K=E>>26,this.words[Y]=E&67108863;return this.negative=1,this.strip()},J.prototype._wordDiv=function(U,X){var $=this.length-U.length,Z=this.clone(),Y=U,E=Y.words[Y.length-1]|0,K=this._countBits(E);if($=26-K,$!==0)Y=Y.ushln($),Z.iushln($),E=Y.words[Y.length-1]|0;var A=Z.length-Y.length,O;if(X!=="mod"){O=new J(null),O.length=A+1,O.words=Array(O.length);for(var V=0;V<O.length;V++)O.words[V]=0}var D=Z.clone()._ishlnsubmul(Y,1,A);if(D.negative===0){if(Z=D,O)O.words[A]=1}for(var S=A-1;S>=0;S--){var _=(Z.words[Y.length+S]|0)*67108864+(Z.words[Y.length+S-1]|0);_=Math.min(_/E|0,67108863),Z._ishlnsubmul(Y,_,S);while(Z.negative!==0)if(_--,Z.negative=0,Z._ishlnsubmul(Y,1,S),!Z.isZero())Z.negative^=1;if(O)O.words[S]=_}if(O)O.strip();if(Z.strip(),X!=="div"&&$!==0)Z.iushrn($);return{div:O||null,mod:Z}},J.prototype.divmod=function(U,X,$){if(T(!U.isZero()),this.isZero())return{div:new J(0),mod:new J(0)};var Z,Y,E;if(this.negative!==0&&U.negative===0){if(E=this.neg().divmod(U,X),X!=="mod")Z=E.div.neg();if(X!=="div"){if(Y=E.mod.neg(),$&&Y.negative!==0)Y.iadd(U)}return{div:Z,mod:Y}}if(this.negative===0&&U.negative!==0){if(E=this.divmod(U.neg(),X),X!=="mod")Z=E.div.neg();return{div:Z,mod:E.mod}}if((this.negative&U.negative)!==0){if(E=this.neg().divmod(U.neg(),X),X!=="div"){if(Y=E.mod.neg(),$&&Y.negative!==0)Y.isub(U)}return{div:E.div,mod:Y}}if(U.length>this.length||this.cmp(U)<0)return{div:new J(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new J(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new J(this.modn(U.words[0]))}}return this._wordDiv(U,X)},J.prototype.div=function(U){return this.divmod(U,"div",!1).div},J.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},J.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},J.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var $=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),Y=U.andln(1),E=$.cmp(Z);if(E<0||Y===1&&E===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},J.prototype.modn=function(U){T(U<=67108863);var X=67108864%U,$=0;for(var Z=this.length-1;Z>=0;Z--)$=(X*$+(this.words[Z]|0))%U;return $},J.prototype.idivn=function(U){T(U<=67108863);var X=0;for(var $=this.length-1;$>=0;$--){var Z=(this.words[$]|0)+X*67108864;this.words[$]=Z/U|0,X=Z%U}return this.strip()},J.prototype.divn=function(U){return this.clone().idivn(U)},J.prototype.egcd=function(U){T(U.negative===0),T(!U.isZero());var X=this,$=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),Y=new J(0),E=new J(0),K=new J(1),A=0;while(X.isEven()&&$.isEven())X.iushrn(1),$.iushrn(1),++A;var O=$.clone(),V=X.clone();while(!X.isZero()){for(var D=0,S=1;(X.words[0]&S)===0&&D<26;++D,S<<=1);if(D>0){X.iushrn(D);while(D-- >0){if(Z.isOdd()||Y.isOdd())Z.iadd(O),Y.isub(V);Z.iushrn(1),Y.iushrn(1)}}for(var _=0,N=1;($.words[0]&N)===0&&_<26;++_,N<<=1);if(_>0){$.iushrn(_);while(_-- >0){if(E.isOdd()||K.isOdd())E.iadd(O),K.isub(V);E.iushrn(1),K.iushrn(1)}}if(X.cmp($)>=0)X.isub($),Z.isub(E),Y.isub(K);else $.isub(X),E.isub(Z),K.isub(Y)}return{a:E,b:K,gcd:$.iushln(A)}},J.prototype._invmp=function(U){T(U.negative===0),T(!U.isZero());var X=this,$=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),Y=new J(0),E=$.clone();while(X.cmpn(1)>0&&$.cmpn(1)>0){for(var K=0,A=1;(X.words[0]&A)===0&&K<26;++K,A<<=1);if(K>0){X.iushrn(K);while(K-- >0){if(Z.isOdd())Z.iadd(E);Z.iushrn(1)}}for(var O=0,V=1;($.words[0]&V)===0&&O<26;++O,V<<=1);if(O>0){$.iushrn(O);while(O-- >0){if(Y.isOdd())Y.iadd(E);Y.iushrn(1)}}if(X.cmp($)>=0)X.isub($),Z.isub(Y);else $.isub(X),Y.isub(Z)}var D;if(X.cmpn(1)===0)D=Z;else D=Y;if(D.cmpn(0)<0)D.iadd(U);return D},J.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),$=U.clone();X.negative=0,$.negative=0;for(var Z=0;X.isEven()&&$.isEven();Z++)X.iushrn(1),$.iushrn(1);do{while(X.isEven())X.iushrn(1);while($.isEven())$.iushrn(1);var Y=X.cmp($);if(Y<0){var E=X;X=$,$=E}else if(Y===0||$.cmpn(1)===0)break;X.isub($)}while(!0);return $.iushln(Z)},J.prototype.invm=function(U){return this.egcd(U).a.umod(U)},J.prototype.isEven=function(){return(this.words[0]&1)===0},J.prototype.isOdd=function(){return(this.words[0]&1)===1},J.prototype.andln=function(U){return this.words[0]&U},J.prototype.bincn=function(U){T(typeof U==="number");var X=U%26,$=(U-X)/26,Z=1<<X;if(this.length<=$)return this._expand($+1),this.words[$]|=Z,this;var Y=Z;for(var E=$;Y!==0&&E<this.length;E++){var K=this.words[E]|0;K+=Y,Y=K>>>26,K&=67108863,this.words[E]=K}if(Y!==0)this.words[E]=Y,this.length++;return this},J.prototype.isZero=function(){return this.length===1&&this.words[0]===0},J.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var $;if(this.length>1)$=1;else{if(X)U=-U;T(U<=67108863,"Number is too big");var Z=this.words[0]|0;$=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-$|0;return $},J.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},J.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var $=this.length-1;$>=0;$--){var Z=this.words[$]|0,Y=U.words[$]|0;if(Z===Y)continue;if(Z<Y)X=-1;else if(Z>Y)X=1;break}return X},J.prototype.gtn=function(U){return this.cmpn(U)===1},J.prototype.gt=function(U){return this.cmp(U)===1},J.prototype.gten=function(U){return this.cmpn(U)>=0},J.prototype.gte=function(U){return this.cmp(U)>=0},J.prototype.ltn=function(U){return this.cmpn(U)===-1},J.prototype.lt=function(U){return this.cmp(U)===-1},J.prototype.lten=function(U){return this.cmpn(U)<=0},J.prototype.lte=function(U){return this.cmp(U)<=0},J.prototype.eqn=function(U){return this.cmpn(U)===0},J.prototype.eq=function(U){return this.cmp(U)===0},J.red=function(U){return new u(U)},J.prototype.toRed=function(U){return T(!this.red,"Already a number in reduction context"),T(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},J.prototype.fromRed=function(){return T(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},J.prototype._forceRed=function(U){return this.red=U,this},J.prototype.forceRed=function(U){return T(!this.red,"Already a number in reduction context"),this._forceRed(U)},J.prototype.redAdd=function(U){return T(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},J.prototype.redIAdd=function(U){return T(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},J.prototype.redSub=function(U){return T(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},J.prototype.redISub=function(U){return T(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},J.prototype.redShl=function(U){return T(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},J.prototype.redMul=function(U){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},J.prototype.redIMul=function(U){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},J.prototype.redSqr=function(){return T(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},J.prototype.redISqr=function(){return T(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},J.prototype.redSqrt=function(){return T(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},J.prototype.redInvm=function(){return T(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},J.prototype.redNeg=function(){return T(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},J.prototype.redPow=function(U){return T(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new J(X,16),this.n=this.p.bitLength(),this.k=new J(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new J(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,$;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),$=X.bitLength();while($>this.n);var Z=$<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}F(d,w),d.prototype.split=function(U,X){var $=4194303,Z=Math.min(U.length,9);for(var Y=0;Y<Z;Y++)X.words[Y]=U.words[Y];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var E=U.words[9];X.words[X.length++]=E&$;for(Y=10;Y<U.length;Y++){var K=U.words[Y]|0;U.words[Y-10]=(K&$)<<4|E>>>22,E=K}if(E>>>=22,U.words[Y-10]=E,E===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var $=0;$<U.length;$++){var Z=U.words[$]|0;X+=Z*977,U.words[$]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}F(Y0,w);function G0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}F(G0,w);function J0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}F(J0,w),J0.prototype.imulK=function(U){var X=0;for(var $=0;$<U.length;$++){var Z=(U.words[$]|0)*19+X,Y=Z&67108863;Z>>>=26,U.words[$]=Y,X=Z}if(X!==0)U.words[U.length++]=X;return U},J._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new G0;else if(U==="p25519")X=new J0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=J._prime(U);this.m=X.p,this.prime=X}else T(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){T(U.negative===0,"red works only with positives"),T(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){T((U.negative|X.negative)===0,"red works only with positives"),T(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var $=U.add(X);if($.cmp(this.m)>=0)$.isub(this.m);return $._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var $=U.iadd(X);if($.cmp(this.m)>=0)$.isub(this.m);return $},u.prototype.sub=function(U,X){this._verify2(U,X);var $=U.sub(X);if($.cmpn(0)<0)$.iadd(this.m);return $._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var $=U.isub(X);if($.cmpn(0)<0)$.iadd(this.m);return $},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(T(X%2===1),X===3){var $=this.m.add(new J(1)).iushrn(2);return this.pow(U,$)}var Z=this.m.subn(1),Y=0;while(!Z.isZero()&&Z.andln(1)===0)Y++,Z.iushrn(1);T(!Z.isZero());var E=new J(1).toRed(this),K=E.redNeg(),A=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new J(2*O*O).toRed(this);while(this.pow(O,A).cmp(K)!==0)O.redIAdd(K);var V=this.pow(O,Z),D=this.pow(U,Z.addn(1).iushrn(1)),S=this.pow(U,Z),_=Y;while(S.cmp(E)!==0){var N=S;for(var p=0;N.cmp(E)!==0;p++)N=N.redSqr();T(p<_);var n=this.pow(V,new J(1).iushln(_-p-1));D=D.redMul(n),V=n.redSqr(),S=S.redMul(V),_=p}return D},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new J(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var $=4,Z=Array(1<<$);Z[0]=new J(1).toRed(this),Z[1]=U;for(var Y=2;Y<Z.length;Y++)Z[Y]=this.mul(Z[Y-1],U);var E=Z[0],K=0,A=0,O=X.bitLength()%26;if(O===0)O=26;for(Y=X.length-1;Y>=0;Y--){var V=X.words[Y];for(var D=O-1;D>=0;D--){var S=V>>D&1;if(E!==Z[0])E=this.sqr(E);if(S===0&&K===0){A=0;continue}if(K<<=1,K|=S,A++,A!==$&&(Y!==0||D!==0))continue;E=this.mul(E,Z[K]),A=0,K=0}O=26}return E},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},J.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new J(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)}F(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var $=U.imul(X),Z=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=$.isub(Z).iushrn(this.shift),E=Y;if(Y.cmp(this.m)>=0)E=Y.isub(this.m);else if(Y.cmpn(0)<0)E=Y.iadd(this.m);return E._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new J(0)._forceRed(this);var $=U.mul(X),Z=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=$.isub(Z).iushrn(this.shift),E=Y;if(Y.cmp(this.m)>=0)E=Y.isub(this.m);else if(Y.cmpn(0)<0)E=Y.iadd(this.m);return E._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof G>"u"||G,Q)}),_G=$0((Q,G)=>{var I=kG(),L=jG();G.exports=function(M){return new F(M)};var T={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};T.p224=T.secp224r1,T.p256=T.secp256r1=T.prime256v1,T.p192=T.secp192r1=T.prime192v1,T.p384=T.secp384r1,T.p521=T.secp521r1;function F(M){if(this.curveType=T[M],!this.curveType)this.curveType={name:M};this.curve=new I.ec(this.curveType.name),this.keys=void 0}F.prototype.generateKeys=function(M,z){return this.keys=this.curve.genKeyPair(),this.getPublicKey(M,z)},F.prototype.computeSecret=function(M,z,W){if(z=z||"utf8",!Buffer.isBuffer(M))M=new Buffer(M,z);var H=this.curve.keyFromPublic(M).getPublic(),C=H.mul(this.keys.getPrivate()).getX();return J(C,W,this.curveType.byteLength)},F.prototype.getPublicKey=function(M,z){var W=this.keys.getPublic(z==="compressed",!0);if(z==="hybrid")if(W[W.length-1]%2)W[0]=7;else W[0]=6;return J(W,M)},F.prototype.getPrivateKey=function(M){return J(this.keys.getPrivate(),M)},F.prototype.setPublicKey=function(M,z){if(z=z||"utf8",!Buffer.isBuffer(M))M=new Buffer(M,z);return this.keys._importPublic(M),this},F.prototype.setPrivateKey=function(M,z){if(z=z||"utf8",!Buffer.isBuffer(M))M=new Buffer(M,z);var W=new L(M);return W=W.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(W),this};function J(M,z,W){if(!Array.isArray(M))M=M.toArray();var H=new Buffer(M);if(W&&H.length<W){var C=new Buffer(W-H.length);C.fill(0),H=Buffer.concat([C,H])}if(!z)return H;else return H.toString(z)}}),vG=$0((Q,G)=>{var I=(_U(),h0(jU)).createECDH;G.exports=I||_G()}),BG=$0((Q,G)=>{(function(I,L){function T(U,X){if(!U)throw Error(X||"Assertion failed")}function F(U,X){U.super_=X;var $=function(){};$.prototype=X.prototype,U.prototype=new $,U.prototype.constructor=U}function J(U,X,$){if(J.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")$=X,X=10;this._init(U||0,X||10,$||"be")}}if(typeof I==="object")I.exports=J;else L.BN=J;J.BN=J,J.wordSize=26;var M;try{if(typeof window<"u"&&typeof window.Buffer<"u")M=window.Buffer;else M=(LU(),h0(CU)).Buffer}catch(U){}J.isBN=function(U){if(U instanceof J)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===J.wordSize&&Array.isArray(U.words)},J.max=function(U,X){if(U.cmp(X)>0)return U;return X},J.min=function(U,X){if(U.cmp(X)<0)return U;return X},J.prototype._init=function(U,X,$){if(typeof U==="number")return this._initNumber(U,X,$);if(typeof U==="object")return this._initArray(U,X,$);if(X==="hex")X=16;T(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,$);else if(this._parseBase(U,X,Z),$==="le")this._initArray(this.toArray(),X,$)}},J.prototype._initNumber=function(U,X,$){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else T(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if($!=="le")return;this._initArray(this.toArray(),X,$)},J.prototype._initArray=function(U,X,$){if(T(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y,E,K=0;if($==="be"){for(Z=U.length-1,Y=0;Z>=0;Z-=3)if(E=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[Y]|=E<<K&67108863,this.words[Y+1]=E>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}else if($==="le"){for(Z=0,Y=0;Z<U.length;Z+=3)if(E=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[Y]|=E<<K&67108863,this.words[Y+1]=E>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}return this.strip()};function z(U,X){var $=U.charCodeAt(X);if($>=65&&$<=70)return $-55;else if($>=97&&$<=102)return $-87;else return $-48&15}function W(U,X,$){var Z=z(U,$);if($-1>=X)Z|=z(U,$-1)<<4;return Z}J.prototype._parseHex=function(U,X,$){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y=0,E=0,K;if($==="be")for(Z=U.length-1;Z>=X;Z-=2)if(K=W(U,X,Z)<<Y,this.words[E]|=K&67108863,Y>=18)Y-=18,E+=1,this.words[E]|=K>>>26;else Y+=8;else{var A=U.length-X;for(Z=A%2===0?X+1:X;Z<U.length;Z+=2)if(K=W(U,X,Z)<<Y,this.words[E]|=K&67108863,Y>=18)Y-=18,E+=1,this.words[E]|=K>>>26;else Y+=8}this.strip()};function H(U,X,$,Z){var Y=0,E=Math.min(U.length,$);for(var K=X;K<E;K++){var A=U.charCodeAt(K)-48;if(Y*=Z,A>=49)Y+=A-49+10;else if(A>=17)Y+=A-17+10;else Y+=A}return Y}J.prototype._parseBase=function(U,X,$){this.words=[0],this.length=1;for(var Z=0,Y=1;Y<=67108863;Y*=X)Z++;Z--,Y=Y/X|0;var E=U.length-$,K=E%Z,A=Math.min(E,E-K)+$,O=0;for(var V=$;V<A;V+=Z)if(O=H(U,V,V+Z,X),this.imuln(Y),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(K!==0){var D=1;O=H(U,V,U.length,X);for(V=0;V<K;V++)D*=X;if(this.imuln(D),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},J.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},J.prototype.clone=function(){var U=new J(null);return this.copy(U),U},J.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},J.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},J.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},J.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var C=["","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"],R=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(J.prototype.toString=function(U,X){U=U||10,X=X|0||1;var $;if(U===16||U==="hex"){$="";var Z=0,Y=0;for(var E=0;E<this.length;E++){var K=this.words[E],A=((K<<Z|Y)&16777215).toString(16);if(Y=K>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,E--;if(Y!==0||E!==this.length-1)$=C[6-A.length]+A+$;else $=A+$}if(Y!==0)$=Y.toString(16)+$;while($.length%X!==0)$="0"+$;if(this.negative!==0)$="-"+$;return $}if(U===(U|0)&&U>=2&&U<=36){var O=R[U],V=q[U];$="";var D=this.clone();D.negative=0;while(!D.isZero()){var S=D.modn(V).toString(U);if(D=D.idivn(V),!D.isZero())$=C[O-S.length]+S+$;else $=S+$}if(this.isZero())$="0"+$;while($.length%X!==0)$="0"+$;if(this.negative!==0)$="-"+$;return $}T(!1,"Base should be between 2 and 36")},J.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)T(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},J.prototype.toJSON=function(){return this.toString(16)},J.prototype.toBuffer=function(U,X){return T(typeof M<"u"),this.toArrayLike(M,U,X)},J.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},J.prototype.toArrayLike=function(U,X,$){var Z=this.byteLength(),Y=$||Math.max(1,Z);T(Z<=Y,"byte array longer than desired length"),T(Y>0,"Requested array length <= 0"),this.strip();var E=X==="le",K=new U(Y),A,O,V=this.clone();if(!E){for(O=0;O<Y-Z;O++)K[O]=0;for(O=0;!V.isZero();O++)A=V.andln(255),V.iushrn(8),K[Y-O-1]=A}else{for(O=0;!V.isZero();O++)A=V.andln(255),V.iushrn(8),K[O]=A;for(;O<Y;O++)K[O]=0}return K},Math.clz32)J.prototype._countBits=function(U){return 32-Math.clz32(U)};else J.prototype._countBits=function(U){var X=U,$=0;if(X>=4096)$+=13,X>>>=13;if(X>=64)$+=7,X>>>=7;if(X>=8)$+=4,X>>>=4;if(X>=2)$+=2,X>>>=2;return $+X};J.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,$=0;if((X&8191)===0)$+=13,X>>>=13;if((X&127)===0)$+=7,X>>>=7;if((X&15)===0)$+=4,X>>>=4;if((X&3)===0)$+=2,X>>>=2;if((X&1)===0)$++;return $},J.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var $=0;$<X.length;$++){var Z=$/26|0,Y=$%26;X[$]=(U.words[Z]&1<<Y)>>>Y}return X}J.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var $=this._zeroBits(this.words[X]);if(U+=$,$!==26)break}return U},J.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},J.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},J.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},J.prototype.isNeg=function(){return this.negative!==0},J.prototype.neg=function(){return this.clone().ineg()},J.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},J.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},J.prototype.ior=function(U){return T((this.negative|U.negative)===0),this.iuor(U)},J.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},J.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},J.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var $=0;$<X.length;$++)this.words[$]=this.words[$]&U.words[$];return this.length=X.length,this.strip()},J.prototype.iand=function(U){return T((this.negative|U.negative)===0),this.iuand(U)},J.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},J.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},J.prototype.iuxor=function(U){var X,$;if(this.length>U.length)X=this,$=U;else X=U,$=this;for(var Z=0;Z<$.length;Z++)this.words[Z]=X.words[Z]^$.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},J.prototype.ixor=function(U){return T((this.negative|U.negative)===0),this.iuxor(U)},J.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},J.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},J.prototype.inotn=function(U){T(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,$=U%26;if(this._expand(X),$>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if($>0)this.words[Z]=~this.words[Z]&67108863>>26-$;return this.strip()},J.prototype.notn=function(U){return this.clone().inotn(U)},J.prototype.setn=function(U,X){T(typeof U==="number"&&U>=0);var $=U/26|0,Z=U%26;if(this._expand($+1),X)this.words[$]=this.words[$]|1<<Z;else this.words[$]=this.words[$]&~(1<<Z);return this.strip()},J.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var $,Z;if(this.length>U.length)$=this,Z=U;else $=U,Z=this;var Y=0;for(var E=0;E<Z.length;E++)X=($.words[E]|0)+(Z.words[E]|0)+Y,this.words[E]=X&67108863,Y=X>>>26;for(;Y!==0&&E<$.length;E++)X=($.words[E]|0)+Y,this.words[E]=X&67108863,Y=X>>>26;if(this.length=$.length,Y!==0)this.words[this.length]=Y,this.length++;else if($!==this)for(;E<$.length;E++)this.words[E]=$.words[E];return this},J.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},J.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var $=this.cmp(U);if($===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Y;if($>0)Z=this,Y=U;else Z=U,Y=this;var E=0;for(var K=0;K<Y.length;K++)X=(Z.words[K]|0)-(Y.words[K]|0)+E,E=X>>26,this.words[K]=X&67108863;for(;E!==0&&K<Z.length;K++)X=(Z.words[K]|0)+E,E=X>>26,this.words[K]=X&67108863;if(E===0&&K<Z.length&&Z!==this)for(;K<Z.length;K++)this.words[K]=Z.words[K];if(this.length=Math.max(this.length,K),Z!==this)this.negative=1;return this.strip()},J.prototype.sub=function(U){return this.clone().isub(U)};function j(U,X,$){$.negative=X.negative^U.negative;var Z=U.length+X.length|0;$.length=Z,Z=Z-1|0;var Y=U.words[0]|0,E=X.words[0]|0,K=Y*E,A=K&67108863,O=K/67108864|0;$.words[0]=A;for(var V=1;V<Z;V++){var D=O>>>26,S=O&67108863,_=Math.min(V,X.length-1);for(var N=Math.max(0,V-U.length+1);N<=_;N++){var p=V-N|0;Y=U.words[p]|0,E=X.words[N]|0,K=Y*E+S,D+=K/67108864|0,S=K&67108863}$.words[V]=S|0,O=D|0}if(O!==0)$.words[V]=O|0;else $.length--;return $.strip()}var k=function(U,X,$){var Z=U.words,Y=X.words,E=$.words,K=0,A,O,V,D=Z[0]|0,S=D&8191,_=D>>>13,N=Z[1]|0,p=N&8191,n=N>>>13,V0=Z[2]|0,r=V0&8191,b=V0>>>13,X0=Z[3]|0,t=X0&8191,i=X0>>>13,N0=Z[4]|0,y=N0&8191,h=N0>>>13,Q0=Z[5]|0,s=Q0&8191,a=Q0>>>13,H0=Z[6]|0,c=H0&8191,o=H0>>>13,x0=Z[7]|0,m=x0&8191,Z0=x0>>>13,w0=Z[8]|0,K0=w0&8191,T0=w0>>>13,t0=Z[9]|0,I0=t0&8191,C0=t0>>>13,r0=Y[0]|0,R0=r0&8191,S0=r0>>>13,WU=Y[1]|0,F0=WU&8191,k0=WU>>>13,HU=Y[2]|0,j0=HU&8191,D0=HU>>>13,SU=Y[3]|0,_0=SU&8191,M0=SU>>>13,EU=Y[4]|0,v0=EU&8191,B0=EU>>>13,KU=Y[5]|0,z0=KU&8191,x=KU>>>13,l=Y[6]|0,e=l&8191,U0=l>>>13,f0=Y[7]|0,E0=f0&8191,L0=f0>>>13,m0=Y[8]|0,q0=m0&8191,g0=m0>>>13,RU=Y[9]|0,P0=RU&8191,W0=RU>>>13;$.negative=U.negative^X.negative,$.length=19,A=Math.imul(S,R0),O=Math.imul(S,S0),O=O+Math.imul(_,R0)|0,V=Math.imul(_,S0);var s0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(s0>>>26)|0,s0&=67108863,A=Math.imul(p,R0),O=Math.imul(p,S0),O=O+Math.imul(n,R0)|0,V=Math.imul(n,S0),A=A+Math.imul(S,F0)|0,O=O+Math.imul(S,k0)|0,O=O+Math.imul(_,F0)|0,V=V+Math.imul(_,k0)|0;var c0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,A=Math.imul(r,R0),O=Math.imul(r,S0),O=O+Math.imul(b,R0)|0,V=Math.imul(b,S0),A=A+Math.imul(p,F0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,F0)|0,V=V+Math.imul(n,k0)|0,A=A+Math.imul(S,j0)|0,O=O+Math.imul(S,D0)|0,O=O+Math.imul(_,j0)|0,V=V+Math.imul(_,D0)|0;var y0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,A=Math.imul(t,R0),O=Math.imul(t,S0),O=O+Math.imul(i,R0)|0,V=Math.imul(i,S0),A=A+Math.imul(r,F0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(b,F0)|0,V=V+Math.imul(b,k0)|0,A=A+Math.imul(p,j0)|0,O=O+Math.imul(p,D0)|0,O=O+Math.imul(n,j0)|0,V=V+Math.imul(n,D0)|0,A=A+Math.imul(S,_0)|0,O=O+Math.imul(S,M0)|0,O=O+Math.imul(_,_0)|0,V=V+Math.imul(_,M0)|0;var b0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(b0>>>26)|0,b0&=67108863,A=Math.imul(y,R0),O=Math.imul(y,S0),O=O+Math.imul(h,R0)|0,V=Math.imul(h,S0),A=A+Math.imul(t,F0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(i,F0)|0,V=V+Math.imul(i,k0)|0,A=A+Math.imul(r,j0)|0,O=O+Math.imul(r,D0)|0,O=O+Math.imul(b,j0)|0,V=V+Math.imul(b,D0)|0,A=A+Math.imul(p,_0)|0,O=O+Math.imul(p,M0)|0,O=O+Math.imul(n,_0)|0,V=V+Math.imul(n,M0)|0,A=A+Math.imul(S,v0)|0,O=O+Math.imul(S,B0)|0,O=O+Math.imul(_,v0)|0,V=V+Math.imul(_,B0)|0;var l0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,A=Math.imul(s,R0),O=Math.imul(s,S0),O=O+Math.imul(a,R0)|0,V=Math.imul(a,S0),A=A+Math.imul(y,F0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,F0)|0,V=V+Math.imul(h,k0)|0,A=A+Math.imul(t,j0)|0,O=O+Math.imul(t,D0)|0,O=O+Math.imul(i,j0)|0,V=V+Math.imul(i,D0)|0,A=A+Math.imul(r,_0)|0,O=O+Math.imul(r,M0)|0,O=O+Math.imul(b,_0)|0,V=V+Math.imul(b,M0)|0,A=A+Math.imul(p,v0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,v0)|0,V=V+Math.imul(n,B0)|0,A=A+Math.imul(S,z0)|0,O=O+Math.imul(S,x)|0,O=O+Math.imul(_,z0)|0,V=V+Math.imul(_,x)|0;var e0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(e0>>>26)|0,e0&=67108863,A=Math.imul(c,R0),O=Math.imul(c,S0),O=O+Math.imul(o,R0)|0,V=Math.imul(o,S0),A=A+Math.imul(s,F0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(a,F0)|0,V=V+Math.imul(a,k0)|0,A=A+Math.imul(y,j0)|0,O=O+Math.imul(y,D0)|0,O=O+Math.imul(h,j0)|0,V=V+Math.imul(h,D0)|0,A=A+Math.imul(t,_0)|0,O=O+Math.imul(t,M0)|0,O=O+Math.imul(i,_0)|0,V=V+Math.imul(i,M0)|0,A=A+Math.imul(r,v0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(b,v0)|0,V=V+Math.imul(b,B0)|0,A=A+Math.imul(p,z0)|0,O=O+Math.imul(p,x)|0,O=O+Math.imul(n,z0)|0,V=V+Math.imul(n,x)|0,A=A+Math.imul(S,e)|0,O=O+Math.imul(S,U0)|0,O=O+Math.imul(_,e)|0,V=V+Math.imul(_,U0)|0;var a0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(a0>>>26)|0,a0&=67108863,A=Math.imul(m,R0),O=Math.imul(m,S0),O=O+Math.imul(Z0,R0)|0,V=Math.imul(Z0,S0),A=A+Math.imul(c,F0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,F0)|0,V=V+Math.imul(o,k0)|0,A=A+Math.imul(s,j0)|0,O=O+Math.imul(s,D0)|0,O=O+Math.imul(a,j0)|0,V=V+Math.imul(a,D0)|0,A=A+Math.imul(y,_0)|0,O=O+Math.imul(y,M0)|0,O=O+Math.imul(h,_0)|0,V=V+Math.imul(h,M0)|0,A=A+Math.imul(t,v0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(i,v0)|0,V=V+Math.imul(i,B0)|0,A=A+Math.imul(r,z0)|0,O=O+Math.imul(r,x)|0,O=O+Math.imul(b,z0)|0,V=V+Math.imul(b,x)|0,A=A+Math.imul(p,e)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,e)|0,V=V+Math.imul(n,U0)|0,A=A+Math.imul(S,E0)|0,O=O+Math.imul(S,L0)|0,O=O+Math.imul(_,E0)|0,V=V+Math.imul(_,L0)|0;var i0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,A=Math.imul(K0,R0),O=Math.imul(K0,S0),O=O+Math.imul(T0,R0)|0,V=Math.imul(T0,S0),A=A+Math.imul(m,F0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(Z0,F0)|0,V=V+Math.imul(Z0,k0)|0,A=A+Math.imul(c,j0)|0,O=O+Math.imul(c,D0)|0,O=O+Math.imul(o,j0)|0,V=V+Math.imul(o,D0)|0,A=A+Math.imul(s,_0)|0,O=O+Math.imul(s,M0)|0,O=O+Math.imul(a,_0)|0,V=V+Math.imul(a,M0)|0,A=A+Math.imul(y,v0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,v0)|0,V=V+Math.imul(h,B0)|0,A=A+Math.imul(t,z0)|0,O=O+Math.imul(t,x)|0,O=O+Math.imul(i,z0)|0,V=V+Math.imul(i,x)|0,A=A+Math.imul(r,e)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(b,e)|0,V=V+Math.imul(b,U0)|0,A=A+Math.imul(p,E0)|0,O=O+Math.imul(p,L0)|0,O=O+Math.imul(n,E0)|0,V=V+Math.imul(n,L0)|0,A=A+Math.imul(S,q0)|0,O=O+Math.imul(S,g0)|0,O=O+Math.imul(_,q0)|0,V=V+Math.imul(_,g0)|0;var UU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,A=Math.imul(I0,R0),O=Math.imul(I0,S0),O=O+Math.imul(C0,R0)|0,V=Math.imul(C0,S0),A=A+Math.imul(K0,F0)|0,O=O+Math.imul(K0,k0)|0,O=O+Math.imul(T0,F0)|0,V=V+Math.imul(T0,k0)|0,A=A+Math.imul(m,j0)|0,O=O+Math.imul(m,D0)|0,O=O+Math.imul(Z0,j0)|0,V=V+Math.imul(Z0,D0)|0,A=A+Math.imul(c,_0)|0,O=O+Math.imul(c,M0)|0,O=O+Math.imul(o,_0)|0,V=V+Math.imul(o,M0)|0,A=A+Math.imul(s,v0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(a,v0)|0,V=V+Math.imul(a,B0)|0,A=A+Math.imul(y,z0)|0,O=O+Math.imul(y,x)|0,O=O+Math.imul(h,z0)|0,V=V+Math.imul(h,x)|0,A=A+Math.imul(t,e)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(i,e)|0,V=V+Math.imul(i,U0)|0,A=A+Math.imul(r,E0)|0,O=O+Math.imul(r,L0)|0,O=O+Math.imul(b,E0)|0,V=V+Math.imul(b,L0)|0,A=A+Math.imul(p,q0)|0,O=O+Math.imul(p,g0)|0,O=O+Math.imul(n,q0)|0,V=V+Math.imul(n,g0)|0,A=A+Math.imul(S,P0)|0,O=O+Math.imul(S,W0)|0,O=O+Math.imul(_,P0)|0,V=V+Math.imul(_,W0)|0;var OU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,A=Math.imul(I0,F0),O=Math.imul(I0,k0),O=O+Math.imul(C0,F0)|0,V=Math.imul(C0,k0),A=A+Math.imul(K0,j0)|0,O=O+Math.imul(K0,D0)|0,O=O+Math.imul(T0,j0)|0,V=V+Math.imul(T0,D0)|0,A=A+Math.imul(m,_0)|0,O=O+Math.imul(m,M0)|0,O=O+Math.imul(Z0,_0)|0,V=V+Math.imul(Z0,M0)|0,A=A+Math.imul(c,v0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,v0)|0,V=V+Math.imul(o,B0)|0,A=A+Math.imul(s,z0)|0,O=O+Math.imul(s,x)|0,O=O+Math.imul(a,z0)|0,V=V+Math.imul(a,x)|0,A=A+Math.imul(y,e)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,e)|0,V=V+Math.imul(h,U0)|0,A=A+Math.imul(t,E0)|0,O=O+Math.imul(t,L0)|0,O=O+Math.imul(i,E0)|0,V=V+Math.imul(i,L0)|0,A=A+Math.imul(r,q0)|0,O=O+Math.imul(r,g0)|0,O=O+Math.imul(b,q0)|0,V=V+Math.imul(b,g0)|0,A=A+Math.imul(p,P0)|0,O=O+Math.imul(p,W0)|0,O=O+Math.imul(n,P0)|0,V=V+Math.imul(n,W0)|0;var ZU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,A=Math.imul(I0,j0),O=Math.imul(I0,D0),O=O+Math.imul(C0,j0)|0,V=Math.imul(C0,D0),A=A+Math.imul(K0,_0)|0,O=O+Math.imul(K0,M0)|0,O=O+Math.imul(T0,_0)|0,V=V+Math.imul(T0,M0)|0,A=A+Math.imul(m,v0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(Z0,v0)|0,V=V+Math.imul(Z0,B0)|0,A=A+Math.imul(c,z0)|0,O=O+Math.imul(c,x)|0,O=O+Math.imul(o,z0)|0,V=V+Math.imul(o,x)|0,A=A+Math.imul(s,e)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(a,e)|0,V=V+Math.imul(a,U0)|0,A=A+Math.imul(y,E0)|0,O=O+Math.imul(y,L0)|0,O=O+Math.imul(h,E0)|0,V=V+Math.imul(h,L0)|0,A=A+Math.imul(t,q0)|0,O=O+Math.imul(t,g0)|0,O=O+Math.imul(i,q0)|0,V=V+Math.imul(i,g0)|0,A=A+Math.imul(r,P0)|0,O=O+Math.imul(r,W0)|0,O=O+Math.imul(b,P0)|0,V=V+Math.imul(b,W0)|0;var XU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,A=Math.imul(I0,_0),O=Math.imul(I0,M0),O=O+Math.imul(C0,_0)|0,V=Math.imul(C0,M0),A=A+Math.imul(K0,v0)|0,O=O+Math.imul(K0,B0)|0,O=O+Math.imul(T0,v0)|0,V=V+Math.imul(T0,B0)|0,A=A+Math.imul(m,z0)|0,O=O+Math.imul(m,x)|0,O=O+Math.imul(Z0,z0)|0,V=V+Math.imul(Z0,x)|0,A=A+Math.imul(c,e)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,e)|0,V=V+Math.imul(o,U0)|0,A=A+Math.imul(s,E0)|0,O=O+Math.imul(s,L0)|0,O=O+Math.imul(a,E0)|0,V=V+Math.imul(a,L0)|0,A=A+Math.imul(y,q0)|0,O=O+Math.imul(y,g0)|0,O=O+Math.imul(h,q0)|0,V=V+Math.imul(h,g0)|0,A=A+Math.imul(t,P0)|0,O=O+Math.imul(t,W0)|0,O=O+Math.imul(i,P0)|0,V=V+Math.imul(i,W0)|0;var QU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,A=Math.imul(I0,v0),O=Math.imul(I0,B0),O=O+Math.imul(C0,v0)|0,V=Math.imul(C0,B0),A=A+Math.imul(K0,z0)|0,O=O+Math.imul(K0,x)|0,O=O+Math.imul(T0,z0)|0,V=V+Math.imul(T0,x)|0,A=A+Math.imul(m,e)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(Z0,e)|0,V=V+Math.imul(Z0,U0)|0,A=A+Math.imul(c,E0)|0,O=O+Math.imul(c,L0)|0,O=O+Math.imul(o,E0)|0,V=V+Math.imul(o,L0)|0,A=A+Math.imul(s,q0)|0,O=O+Math.imul(s,g0)|0,O=O+Math.imul(a,q0)|0,V=V+Math.imul(a,g0)|0,A=A+Math.imul(y,P0)|0,O=O+Math.imul(y,W0)|0,O=O+Math.imul(h,P0)|0,V=V+Math.imul(h,W0)|0;var YU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,A=Math.imul(I0,z0),O=Math.imul(I0,x),O=O+Math.imul(C0,z0)|0,V=Math.imul(C0,x),A=A+Math.imul(K0,e)|0,O=O+Math.imul(K0,U0)|0,O=O+Math.imul(T0,e)|0,V=V+Math.imul(T0,U0)|0,A=A+Math.imul(m,E0)|0,O=O+Math.imul(m,L0)|0,O=O+Math.imul(Z0,E0)|0,V=V+Math.imul(Z0,L0)|0,A=A+Math.imul(c,q0)|0,O=O+Math.imul(c,g0)|0,O=O+Math.imul(o,q0)|0,V=V+Math.imul(o,g0)|0,A=A+Math.imul(s,P0)|0,O=O+Math.imul(s,W0)|0,O=O+Math.imul(a,P0)|0,V=V+Math.imul(a,W0)|0;var JU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,A=Math.imul(I0,e),O=Math.imul(I0,U0),O=O+Math.imul(C0,e)|0,V=Math.imul(C0,U0),A=A+Math.imul(K0,E0)|0,O=O+Math.imul(K0,L0)|0,O=O+Math.imul(T0,E0)|0,V=V+Math.imul(T0,L0)|0,A=A+Math.imul(m,q0)|0,O=O+Math.imul(m,g0)|0,O=O+Math.imul(Z0,q0)|0,V=V+Math.imul(Z0,g0)|0,A=A+Math.imul(c,P0)|0,O=O+Math.imul(c,W0)|0,O=O+Math.imul(o,P0)|0,V=V+Math.imul(o,W0)|0;var $U=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,A=Math.imul(I0,E0),O=Math.imul(I0,L0),O=O+Math.imul(C0,E0)|0,V=Math.imul(C0,L0),A=A+Math.imul(K0,q0)|0,O=O+Math.imul(K0,g0)|0,O=O+Math.imul(T0,q0)|0,V=V+Math.imul(T0,g0)|0,A=A+Math.imul(m,P0)|0,O=O+Math.imul(m,W0)|0,O=O+Math.imul(Z0,P0)|0,V=V+Math.imul(Z0,W0)|0;var GU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,A=Math.imul(I0,q0),O=Math.imul(I0,g0),O=O+Math.imul(C0,q0)|0,V=Math.imul(C0,g0),A=A+Math.imul(K0,P0)|0,O=O+Math.imul(K0,W0)|0,O=O+Math.imul(T0,P0)|0,V=V+Math.imul(T0,W0)|0;var AU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,A=Math.imul(I0,P0),O=Math.imul(I0,W0),O=O+Math.imul(C0,P0)|0,V=Math.imul(C0,W0);var VU=(K+A|0)+((O&8191)<<13)|0;if(K=(V+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,E[0]=s0,E[1]=c0,E[2]=y0,E[3]=b0,E[4]=l0,E[5]=e0,E[6]=a0,E[7]=i0,E[8]=UU,E[9]=OU,E[10]=ZU,E[11]=XU,E[12]=QU,E[13]=YU,E[14]=JU,E[15]=$U,E[16]=GU,E[17]=AU,E[18]=VU,K!==0)E[19]=K,$.length++;return $};if(!Math.imul)k=j;function B(U,X,$){$.negative=X.negative^U.negative,$.length=U.length+X.length;var Z=0,Y=0;for(var E=0;E<$.length-1;E++){var K=Y;Y=0;var A=Z&67108863,O=Math.min(E,X.length-1);for(var V=Math.max(0,E-U.length+1);V<=O;V++){var D=E-V,S=U.words[D]|0,_=X.words[V]|0,N=S*_,p=N&67108863;K=K+(N/67108864|0)|0,p=p+A|0,A=p&67108863,K=K+(p>>>26)|0,Y+=K>>>26,K&=67108863}$.words[E]=A,Z=K,K=Y}if(Z!==0)$.words[E]=Z;else $.length--;return $.strip()}function v(U,X,$){var Z=new g;return Z.mulp(U,X,$)}J.prototype.mulTo=function(U,X){var $,Z=this.length+U.length;if(this.length===10&&U.length===10)$=k(this,U,X);else if(Z<63)$=j(this,U,X);else if(Z<1024)$=B(this,U,X);else $=v(this,U,X);return $};function g(U,X){this.x=U,this.y=X}g.prototype.makeRBT=function(U){var X=Array(U),$=J.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,$,U);return X},g.prototype.revBin=function(U,X,$){if(U===0||U===$-1)return U;var Z=0;for(var Y=0;Y<X;Y++)Z|=(U&1)<<X-Y-1,U>>=1;return Z},g.prototype.permute=function(U,X,$,Z,Y,E){for(var K=0;K<E;K++)Z[K]=X[U[K]],Y[K]=$[U[K]]},g.prototype.transform=function(U,X,$,Z,Y,E){this.permute(E,U,X,$,Z,Y);for(var K=1;K<Y;K<<=1){var A=K<<1,O=Math.cos(2*Math.PI/A),V=Math.sin(2*Math.PI/A);for(var D=0;D<Y;D+=A){var S=O,_=V;for(var N=0;N<K;N++){var p=$[D+N],n=Z[D+N],V0=$[D+N+K],r=Z[D+N+K],b=S*V0-_*r;if(r=S*r+_*V0,V0=b,$[D+N]=p+V0,Z[D+N]=n+r,$[D+N+K]=p-V0,Z[D+N+K]=n-r,N!==A)b=O*S-V*_,_=O*_+V*S,S=b}}}},g.prototype.guessLen13b=function(U,X){var $=Math.max(X,U)|1,Z=$&1,Y=0;for($=$/2|0;$;$=$>>>1)Y++;return 1<<Y+1+Z},g.prototype.conjugate=function(U,X,$){if($<=1)return;for(var Z=0;Z<$/2;Z++){var Y=U[Z];U[Z]=U[$-Z-1],U[$-Z-1]=Y,Y=X[Z],X[Z]=-X[$-Z-1],X[$-Z-1]=-Y}},g.prototype.normalize13b=function(U,X){var $=0;for(var Z=0;Z<X/2;Z++){var Y=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+$;if(U[Z]=Y&67108863,Y<67108864)$=0;else $=Y/67108864|0}return U},g.prototype.convert13b=function(U,X,$,Z){var Y=0;for(var E=0;E<X;E++)Y=Y+(U[E]|0),$[2*E]=Y&8191,Y=Y>>>13,$[2*E+1]=Y&8191,Y=Y>>>13;for(E=2*X;E<Z;++E)$[E]=0;T(Y===0),T((Y&-8192)===0)},g.prototype.stub=function(U){var X=Array(U);for(var $=0;$<U;$++)X[$]=0;return X},g.prototype.mulp=function(U,X,$){var Z=2*this.guessLen13b(U.length,X.length),Y=this.makeRBT(Z),E=this.stub(Z),K=Array(Z),A=Array(Z),O=Array(Z),V=Array(Z),D=Array(Z),S=Array(Z),_=$.words;_.length=Z,this.convert13b(U.words,U.length,K,Z),this.convert13b(X.words,X.length,V,Z),this.transform(K,E,A,O,Z,Y),this.transform(V,E,D,S,Z,Y);for(var N=0;N<Z;N++){var p=A[N]*D[N]-O[N]*S[N];O[N]=A[N]*S[N]+O[N]*D[N],A[N]=p}return this.conjugate(A,O,Z),this.transform(A,O,_,E,Z,Y),this.conjugate(_,E,Z),this.normalize13b(_,Z),$.negative=U.negative^X.negative,$.length=U.length+X.length,$.strip()},J.prototype.mul=function(U){var X=new J(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},J.prototype.mulf=function(U){var X=new J(null);return X.words=Array(this.length+U.length),v(this,U,X)},J.prototype.imul=function(U){return this.clone().mulTo(U,this)},J.prototype.imuln=function(U){T(typeof U==="number"),T(U<67108864);var X=0;for(var $=0;$<this.length;$++){var Z=(this.words[$]|0)*U,Y=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=Y>>>26,this.words[$]=Y&67108863}if(X!==0)this.words[$]=X,this.length++;return this.length=U===0?1:this.length,this},J.prototype.muln=function(U){return this.clone().imuln(U)},J.prototype.sqr=function(){return this.mul(this)},J.prototype.isqr=function(){return this.imul(this.clone())},J.prototype.pow=function(U){var X=P(U);if(X.length===0)return new J(1);var $=this;for(var Z=0;Z<X.length;Z++,$=$.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var Y=$.sqr();Z<X.length;Z++,Y=Y.sqr()){if(X[Z]===0)continue;$=$.mul(Y)}return $},J.prototype.iushln=function(U){T(typeof U==="number"&&U>=0);var X=U%26,$=(U-X)/26,Z=67108863>>>26-X<<26-X,Y;if(X!==0){var E=0;for(Y=0;Y<this.length;Y++){var K=this.words[Y]&Z,A=(this.words[Y]|0)-K<<X;this.words[Y]=A|E,E=K>>>26-X}if(E)this.words[Y]=E,this.length++}if($!==0){for(Y=this.length-1;Y>=0;Y--)this.words[Y+$]=this.words[Y];for(Y=0;Y<$;Y++)this.words[Y]=0;this.length+=$}return this.strip()},J.prototype.ishln=function(U){return T(this.negative===0),this.iushln(U)},J.prototype.iushrn=function(U,X,$){T(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var Y=U%26,E=Math.min((U-Y)/26,this.length),K=67108863^67108863>>>Y<<Y,A=$;if(Z-=E,Z=Math.max(0,Z),A){for(var O=0;O<E;O++)A.words[O]=this.words[O];A.length=E}if(E===0);else if(this.length>E){this.length-=E;for(O=0;O<this.length;O++)this.words[O]=this.words[O+E]}else this.words[0]=0,this.length=1;var V=0;for(O=this.length-1;O>=0&&(V!==0||O>=Z);O--){var D=this.words[O]|0;this.words[O]=V<<26-Y|D>>>Y,V=D&K}if(A&&V!==0)A.words[A.length++]=V;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},J.prototype.ishrn=function(U,X,$){return T(this.negative===0),this.iushrn(U,X,$)},J.prototype.shln=function(U){return this.clone().ishln(U)},J.prototype.ushln=function(U){return this.clone().iushln(U)},J.prototype.shrn=function(U){return this.clone().ishrn(U)},J.prototype.ushrn=function(U){return this.clone().iushrn(U)},J.prototype.testn=function(U){T(typeof U==="number"&&U>=0);var X=U%26,$=(U-X)/26,Z=1<<X;if(this.length<=$)return!1;var Y=this.words[$];return!!(Y&Z)},J.prototype.imaskn=function(U){T(typeof U==="number"&&U>=0);var X=U%26,$=(U-X)/26;if(T(this.negative===0,"imaskn works only with positive numbers"),this.length<=$)return this;if(X!==0)$++;if(this.length=Math.min($,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},J.prototype.maskn=function(U){return this.clone().imaskn(U)},J.prototype.iaddn=function(U){if(T(typeof U==="number"),T(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},J.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},J.prototype.isubn=function(U){if(T(typeof U==="number"),T(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},J.prototype.addn=function(U){return this.clone().iaddn(U)},J.prototype.subn=function(U){return this.clone().isubn(U)},J.prototype.iabs=function(){return this.negative=0,this},J.prototype.abs=function(){return this.clone().iabs()},J.prototype._ishlnsubmul=function(U,X,$){var Z=U.length+$,Y;this._expand(Z);var E,K=0;for(Y=0;Y<U.length;Y++){E=(this.words[Y+$]|0)+K;var A=(U.words[Y]|0)*X;E-=A&67108863,K=(E>>26)-(A/67108864|0),this.words[Y+$]=E&67108863}for(;Y<this.length-$;Y++)E=(this.words[Y+$]|0)+K,K=E>>26,this.words[Y+$]=E&67108863;if(K===0)return this.strip();T(K===-1),K=0;for(Y=0;Y<this.length;Y++)E=-(this.words[Y]|0)+K,K=E>>26,this.words[Y]=E&67108863;return this.negative=1,this.strip()},J.prototype._wordDiv=function(U,X){var $=this.length-U.length,Z=this.clone(),Y=U,E=Y.words[Y.length-1]|0,K=this._countBits(E);if($=26-K,$!==0)Y=Y.ushln($),Z.iushln($),E=Y.words[Y.length-1]|0;var A=Z.length-Y.length,O;if(X!=="mod"){O=new J(null),O.length=A+1,O.words=Array(O.length);for(var V=0;V<O.length;V++)O.words[V]=0}var D=Z.clone()._ishlnsubmul(Y,1,A);if(D.negative===0){if(Z=D,O)O.words[A]=1}for(var S=A-1;S>=0;S--){var _=(Z.words[Y.length+S]|0)*67108864+(Z.words[Y.length+S-1]|0);_=Math.min(_/E|0,67108863),Z._ishlnsubmul(Y,_,S);while(Z.negative!==0)if(_--,Z.negative=0,Z._ishlnsubmul(Y,1,S),!Z.isZero())Z.negative^=1;if(O)O.words[S]=_}if(O)O.strip();if(Z.strip(),X!=="div"&&$!==0)Z.iushrn($);return{div:O||null,mod:Z}},J.prototype.divmod=function(U,X,$){if(T(!U.isZero()),this.isZero())return{div:new J(0),mod:new J(0)};var Z,Y,E;if(this.negative!==0&&U.negative===0){if(E=this.neg().divmod(U,X),X!=="mod")Z=E.div.neg();if(X!=="div"){if(Y=E.mod.neg(),$&&Y.negative!==0)Y.iadd(U)}return{div:Z,mod:Y}}if(this.negative===0&&U.negative!==0){if(E=this.divmod(U.neg(),X),X!=="mod")Z=E.div.neg();return{div:Z,mod:E.mod}}if((this.negative&U.negative)!==0){if(E=this.neg().divmod(U.neg(),X),X!=="div"){if(Y=E.mod.neg(),$&&Y.negative!==0)Y.isub(U)}return{div:E.div,mod:Y}}if(U.length>this.length||this.cmp(U)<0)return{div:new J(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new J(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new J(this.modn(U.words[0]))}}return this._wordDiv(U,X)},J.prototype.div=function(U){return this.divmod(U,"div",!1).div},J.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},J.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},J.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var $=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),Y=U.andln(1),E=$.cmp(Z);if(E<0||Y===1&&E===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},J.prototype.modn=function(U){T(U<=67108863);var X=67108864%U,$=0;for(var Z=this.length-1;Z>=0;Z--)$=(X*$+(this.words[Z]|0))%U;return $},J.prototype.idivn=function(U){T(U<=67108863);var X=0;for(var $=this.length-1;$>=0;$--){var Z=(this.words[$]|0)+X*67108864;this.words[$]=Z/U|0,X=Z%U}return this.strip()},J.prototype.divn=function(U){return this.clone().idivn(U)},J.prototype.egcd=function(U){T(U.negative===0),T(!U.isZero());var X=this,$=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),Y=new J(0),E=new J(0),K=new J(1),A=0;while(X.isEven()&&$.isEven())X.iushrn(1),$.iushrn(1),++A;var O=$.clone(),V=X.clone();while(!X.isZero()){for(var D=0,S=1;(X.words[0]&S)===0&&D<26;++D,S<<=1);if(D>0){X.iushrn(D);while(D-- >0){if(Z.isOdd()||Y.isOdd())Z.iadd(O),Y.isub(V);Z.iushrn(1),Y.iushrn(1)}}for(var _=0,N=1;($.words[0]&N)===0&&_<26;++_,N<<=1);if(_>0){$.iushrn(_);while(_-- >0){if(E.isOdd()||K.isOdd())E.iadd(O),K.isub(V);E.iushrn(1),K.iushrn(1)}}if(X.cmp($)>=0)X.isub($),Z.isub(E),Y.isub(K);else $.isub(X),E.isub(Z),K.isub(Y)}return{a:E,b:K,gcd:$.iushln(A)}},J.prototype._invmp=function(U){T(U.negative===0),T(!U.isZero());var X=this,$=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),Y=new J(0),E=$.clone();while(X.cmpn(1)>0&&$.cmpn(1)>0){for(var K=0,A=1;(X.words[0]&A)===0&&K<26;++K,A<<=1);if(K>0){X.iushrn(K);while(K-- >0){if(Z.isOdd())Z.iadd(E);Z.iushrn(1)}}for(var O=0,V=1;($.words[0]&V)===0&&O<26;++O,V<<=1);if(O>0){$.iushrn(O);while(O-- >0){if(Y.isOdd())Y.iadd(E);Y.iushrn(1)}}if(X.cmp($)>=0)X.isub($),Z.isub(Y);else $.isub(X),Y.isub(Z)}var D;if(X.cmpn(1)===0)D=Z;else D=Y;if(D.cmpn(0)<0)D.iadd(U);return D},J.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),$=U.clone();X.negative=0,$.negative=0;for(var Z=0;X.isEven()&&$.isEven();Z++)X.iushrn(1),$.iushrn(1);do{while(X.isEven())X.iushrn(1);while($.isEven())$.iushrn(1);var Y=X.cmp($);if(Y<0){var E=X;X=$,$=E}else if(Y===0||$.cmpn(1)===0)break;X.isub($)}while(!0);return $.iushln(Z)},J.prototype.invm=function(U){return this.egcd(U).a.umod(U)},J.prototype.isEven=function(){return(this.words[0]&1)===0},J.prototype.isOdd=function(){return(this.words[0]&1)===1},J.prototype.andln=function(U){return this.words[0]&U},J.prototype.bincn=function(U){T(typeof U==="number");var X=U%26,$=(U-X)/26,Z=1<<X;if(this.length<=$)return this._expand($+1),this.words[$]|=Z,this;var Y=Z;for(var E=$;Y!==0&&E<this.length;E++){var K=this.words[E]|0;K+=Y,Y=K>>>26,K&=67108863,this.words[E]=K}if(Y!==0)this.words[E]=Y,this.length++;return this},J.prototype.isZero=function(){return this.length===1&&this.words[0]===0},J.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var $;if(this.length>1)$=1;else{if(X)U=-U;T(U<=67108863,"Number is too big");var Z=this.words[0]|0;$=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-$|0;return $},J.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},J.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var $=this.length-1;$>=0;$--){var Z=this.words[$]|0,Y=U.words[$]|0;if(Z===Y)continue;if(Z<Y)X=-1;else if(Z>Y)X=1;break}return X},J.prototype.gtn=function(U){return this.cmpn(U)===1},J.prototype.gt=function(U){return this.cmp(U)===1},J.prototype.gten=function(U){return this.cmpn(U)>=0},J.prototype.gte=function(U){return this.cmp(U)>=0},J.prototype.ltn=function(U){return this.cmpn(U)===-1},J.prototype.lt=function(U){return this.cmp(U)===-1},J.prototype.lten=function(U){return this.cmpn(U)<=0},J.prototype.lte=function(U){return this.cmp(U)<=0},J.prototype.eqn=function(U){return this.cmpn(U)===0},J.prototype.eq=function(U){return this.cmp(U)===0},J.red=function(U){return new u(U)},J.prototype.toRed=function(U){return T(!this.red,"Already a number in reduction context"),T(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},J.prototype.fromRed=function(){return T(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},J.prototype._forceRed=function(U){return this.red=U,this},J.prototype.forceRed=function(U){return T(!this.red,"Already a number in reduction context"),this._forceRed(U)},J.prototype.redAdd=function(U){return T(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},J.prototype.redIAdd=function(U){return T(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},J.prototype.redSub=function(U){return T(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},J.prototype.redISub=function(U){return T(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},J.prototype.redShl=function(U){return T(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},J.prototype.redMul=function(U){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},J.prototype.redIMul=function(U){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},J.prototype.redSqr=function(){return T(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},J.prototype.redISqr=function(){return T(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},J.prototype.redSqrt=function(){return T(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},J.prototype.redInvm=function(){return T(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},J.prototype.redNeg=function(){return T(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},J.prototype.redPow=function(U){return T(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new J(X,16),this.n=this.p.bitLength(),this.k=new J(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new J(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,$;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),$=X.bitLength();while($>this.n);var Z=$<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}F(d,w),d.prototype.split=function(U,X){var $=4194303,Z=Math.min(U.length,9);for(var Y=0;Y<Z;Y++)X.words[Y]=U.words[Y];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var E=U.words[9];X.words[X.length++]=E&$;for(Y=10;Y<U.length;Y++){var K=U.words[Y]|0;U.words[Y-10]=(K&$)<<4|E>>>22,E=K}if(E>>>=22,U.words[Y-10]=E,E===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var $=0;$<U.length;$++){var Z=U.words[$]|0;X+=Z*977,U.words[$]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}F(Y0,w);function G0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}F(G0,w);function J0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}F(J0,w),J0.prototype.imulK=function(U){var X=0;for(var $=0;$<U.length;$++){var Z=(U.words[$]|0)*19+X,Y=Z&67108863;Z>>>=26,U.words[$]=Y,X=Z}if(X!==0)U.words[U.length++]=X;return U},J._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new G0;else if(U==="p25519")X=new J0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=J._prime(U);this.m=X.p,this.prime=X}else T(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){T(U.negative===0,"red works only with positives"),T(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){T((U.negative|X.negative)===0,"red works only with positives"),T(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var $=U.add(X);if($.cmp(this.m)>=0)$.isub(this.m);return $._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var $=U.iadd(X);if($.cmp(this.m)>=0)$.isub(this.m);return $},u.prototype.sub=function(U,X){this._verify2(U,X);var $=U.sub(X);if($.cmpn(0)<0)$.iadd(this.m);return $._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var $=U.isub(X);if($.cmpn(0)<0)$.iadd(this.m);return $},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(T(X%2===1),X===3){var $=this.m.add(new J(1)).iushrn(2);return this.pow(U,$)}var Z=this.m.subn(1),Y=0;while(!Z.isZero()&&Z.andln(1)===0)Y++,Z.iushrn(1);T(!Z.isZero());var E=new J(1).toRed(this),K=E.redNeg(),A=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new J(2*O*O).toRed(this);while(this.pow(O,A).cmp(K)!==0)O.redIAdd(K);var V=this.pow(O,Z),D=this.pow(U,Z.addn(1).iushrn(1)),S=this.pow(U,Z),_=Y;while(S.cmp(E)!==0){var N=S;for(var p=0;N.cmp(E)!==0;p++)N=N.redSqr();T(p<_);var n=this.pow(V,new J(1).iushln(_-p-1));D=D.redMul(n),V=n.redSqr(),S=S.redMul(V),_=p}return D},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new J(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var $=4,Z=Array(1<<$);Z[0]=new J(1).toRed(this),Z[1]=U;for(var Y=2;Y<Z.length;Y++)Z[Y]=this.mul(Z[Y-1],U);var E=Z[0],K=0,A=0,O=X.bitLength()%26;if(O===0)O=26;for(Y=X.length-1;Y>=0;Y--){var V=X.words[Y];for(var D=O-1;D>=0;D--){var S=V>>D&1;if(E!==Z[0])E=this.sqr(E);if(S===0&&K===0){A=0;continue}if(K<<=1,K|=S,A++,A!==$&&(Y!==0||D!==0))continue;E=this.mul(E,Z[K]),A=0,K=0}O=26}return E},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},J.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new J(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)}F(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var $=U.imul(X),Z=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=$.isub(Z).iushrn(this.shift),E=Y;if(Y.cmp(this.m)>=0)E=Y.isub(this.m);else if(Y.cmpn(0)<0)E=Y.iadd(this.m);return E._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new J(0)._forceRed(this);var $=U.mul(X),Z=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=$.isub(Z).iushrn(this.shift),E=Y;if(Y.cmp(this.m)>=0)E=Y.isub(this.m);else if(Y.cmpn(0)<0)E=Y.iadd(this.m);return E._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof G>"u"||G,Q)}),gG=$0((Q)=>{var G=_O(),I=BU(),L=Q;L.define=function(F,J){return new T(F,J)};function T(F,J){this.name=F,this.body=J,this.decoders={},this.encoders={}}T.prototype._createNamed=function(F){var J;try{J=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
|
|
1
|
+
var YC=Object.create;var{getPrototypeOf:SC,defineProperty:TO,getOwnPropertyNames:cA,getOwnPropertyDescriptor:VC}=Object,pA=Object.prototype.hasOwnProperty;function hA($){return this[$]}var LC,RC,DC=($,I,E)=>{var L=$!=null&&typeof $==="object";if(L){var S=I?LC??=new WeakMap:RC??=new WeakMap,K=S.get($);if(K)return K}E=$!=null?YC(SC($)):{};let Q=I||!$||!$.__esModule?TO(E,"default",{value:$,enumerable:!0}):E;for(let T of cA($))if(!pA.call(Q,T))TO(Q,T,{get:hA.bind($,T),enumerable:!0});if(L)S.set($,Q);return Q},l0=($)=>{var I=(yA??=new WeakMap).get($),E;if(I)return I;if(I=TO({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function"){for(var L of cA($))if(!pA.call(I,L))TO(I,L,{get:hA.bind($,L),enumerable:!(E=VC($,L))||E.enumerable})}return yA.set($,I),I},yA,KC=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var HC=($)=>$;function WC($,I){this[$]=HC.bind(null,I)}var qO=($,I)=>{for(var E in I)TO($,E,{get:I[E],enumerable:!0,configurable:!0,set:WC.bind(I,E)})};var PO=($,I)=>()=>($&&(I=$($=0)),I);var FC=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(I,E)=>(typeof require<"u"?require:I)[E]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')});var RU={};qO(RU,{transcode:()=>WQ,resolveObjectURL:()=>DQ,kStringMaxLength:()=>M$,kMaxLength:()=>_O,isUtf8:()=>KQ,isAscii:()=>HQ,default:()=>FQ,constants:()=>oC,btoa:()=>uC,atob:()=>lC,INSPECT_MAX_BYTES:()=>F$,File:()=>dC,Buffer:()=>G0,Blob:()=>bC});function wC($){var I=$.length;if(I%4>0)throw Error("Invalid string. Length must be a multiple of 4");var E=$.indexOf("=");if(E===-1)E=I;var L=E===I?0:4-E%4;return[E,L]}function yC($,I){return($+I)*3/4-I}function cC($){var I,E=wC($),L=E[0],S=E[1],K=new Uint8Array(yC(L,S)),Q=0,T=S>0?L-4:L,M;for(M=0;M<T;M+=4)I=fU[$.charCodeAt(M)]<<18|fU[$.charCodeAt(M+1)]<<12|fU[$.charCodeAt(M+2)]<<6|fU[$.charCodeAt(M+3)],K[Q++]=I>>16&255,K[Q++]=I>>8&255,K[Q++]=I&255;if(S===2)I=fU[$.charCodeAt(M)]<<2|fU[$.charCodeAt(M+1)]>>4,K[Q++]=I&255;if(S===1)I=fU[$.charCodeAt(M)]<<10|fU[$.charCodeAt(M+1)]<<4|fU[$.charCodeAt(M+2)]>>2,K[Q++]=I>>8&255,K[Q++]=I&255;return K}function pC($){return hU[$>>18&63]+hU[$>>12&63]+hU[$>>6&63]+hU[$&63]}function hC($,I,E){var L,S=[];for(var K=I;K<E;K+=3)L=($[K]<<16&16711680)+($[K+1]<<8&65280)+($[K+2]&255),S.push(pC(L));return S.join("")}function L$($){var I,E=$.length,L=E%3,S=[],K=16383;for(var Q=0,T=E-L;Q<T;Q+=K)S.push(hC($,Q,Q+K>T?T:Q+K));if(L===1)I=$[E-1],S.push(hU[I>>2]+hU[I<<4&63]+"==");else if(L===2)I=($[E-2]<<8)+$[E-1],S.push(hU[I>>10]+hU[I>>4&63]+hU[I<<2&63]+"=");return S.join("")}function sO($,I,E,L,S){var K,Q,T=S*8-L-1,M=(1<<T)-1,H=M>>1,F=-7,R=E?S-1:0,D=E?-1:1,q=$[I+R];R+=D,K=q&(1<<-F)-1,q>>=-F,F+=T;for(;F>0;K=K*256+$[I+R],R+=D,F-=8);Q=K&(1<<-F)-1,K>>=-F,F+=L;for(;F>0;Q=Q*256+$[I+R],R+=D,F-=8);if(K===0)K=1-H;else if(K===M)return Q?NaN:(q?-1:1)*(1/0);else Q=Q+Math.pow(2,L),K=K-H;return(q?-1:1)*Q*Math.pow(2,K-L)}function W$($,I,E,L,S,K){var Q,T,M,H=K*8-S-1,F=(1<<H)-1,R=F>>1,D=S===23?Math.pow(2,-24)-Math.pow(2,-77):0,q=L?0:K-1,P=L?1:-1,_=I<0||I===0&&1/I<0?1:0;if(I=Math.abs(I),isNaN(I)||I===1/0)T=isNaN(I)?1:0,Q=F;else{if(Q=Math.floor(Math.log(I)/Math.LN2),I*(M=Math.pow(2,-Q))<1)Q--,M*=2;if(Q+R>=1)I+=D/M;else I+=D*Math.pow(2,1-R);if(I*M>=2)Q++,M/=2;if(Q+R>=F)T=0,Q=F;else if(Q+R>=1)T=(I*M-1)*Math.pow(2,S),Q=Q+R;else T=I*Math.pow(2,R-1)*Math.pow(2,S),Q=0}for(;S>=8;$[E+q]=T&255,q+=P,T/=256,S-=8);Q=Q<<S|T,H+=S;for(;H>0;$[E+q]=Q&255,q+=P,Q/=256,H-=8);$[E+q-P]|=_*128}function oU($){if($>_O)throw RangeError('The value "'+$+'" is invalid for option "size"');let I=new Uint8Array($);return Object.setPrototypeOf(I,G0.prototype),I}function wZ($,I,E){return class extends E{constructor(){super();Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${$}]`,this.stack,delete this.name}get code(){return $}set code(L){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:L,writable:!0})}toString(){return`${this.name} [${$}]: ${this.message}`}}}function G0($,I,E){if(typeof $==="number"){if(typeof I==="string")throw TypeError('The "string" argument must be of type string. Received type number');return yZ($)}return z$($,I,E)}function z$($,I,E){if(typeof $==="string")return mC($,I);if(ArrayBuffer.isView($))return rC($);if($==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $);if(uU($,ArrayBuffer)||$&&uU($.buffer,ArrayBuffer))return NZ($,I,E);if(typeof SharedArrayBuffer<"u"&&(uU($,SharedArrayBuffer)||$&&uU($.buffer,SharedArrayBuffer)))return NZ($,I,E);if(typeof $==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let L=$.valueOf&&$.valueOf();if(L!=null&&L!==$)return G0.from(L,I,E);let S=eC($);if(S)return S;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof $[Symbol.toPrimitive]==="function")return G0.from($[Symbol.toPrimitive]("string"),I,E);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $)}function T$($){if(typeof $!=="number")throw TypeError('"size" argument must be of type number');else if($<0)throw RangeError('The value "'+$+'" is invalid for option "size"')}function sC($,I,E){if(T$($),$<=0)return oU($);if(I!==void 0)return typeof E==="string"?oU($).fill(I,E):oU($).fill(I);return oU($)}function yZ($){return T$($),oU($<0?0:cZ($)|0)}function mC($,I){if(typeof I!=="string"||I==="")I="utf8";if(!G0.isEncoding(I))throw TypeError("Unknown encoding: "+I);let E=q$($,I)|0,L=oU(E),S=L.write($,I);if(S!==E)L=L.slice(0,S);return L}function xZ($){let I=$.length<0?0:cZ($.length)|0,E=oU(I);for(let L=0;L<I;L+=1)E[L]=$[L]&255;return E}function rC($){if(uU($,Uint8Array)){let I=new Uint8Array($);return NZ(I.buffer,I.byteOffset,I.byteLength)}return xZ($)}function NZ($,I,E){if(I<0||$.byteLength<I)throw RangeError('"offset" is outside of buffer bounds');if($.byteLength<I+(E||0))throw RangeError('"length" is outside of buffer bounds');let L;if(I===void 0&&E===void 0)L=new Uint8Array($);else if(E===void 0)L=new Uint8Array($,I);else L=new Uint8Array($,I,E);return Object.setPrototypeOf(L,G0.prototype),L}function eC($){if(G0.isBuffer($)){let I=cZ($.length)|0,E=oU(I);if(E.length===0)return E;return $.copy(E,0,0,I),E}if($.length!==void 0){if(typeof $.length!=="number"||Number.isNaN($.length))return oU(0);return xZ($)}if($.type==="Buffer"&&Array.isArray($.data))return xZ($.data)}function cZ($){if($>=_O)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_O.toString(16)+" bytes");return $|0}function q$($,I){if(G0.isBuffer($))return $.length;if(ArrayBuffer.isView($)||uU($,ArrayBuffer))return $.byteLength;if(typeof $!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof $);let E=$.length,L=arguments.length>2&&arguments[2]===!0;if(!L&&E===0)return 0;let S=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return fZ($).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return N$($).length;default:if(S)return L?-1:fZ($).length;I=(""+I).toLowerCase(),S=!0}}function aC($,I,E){let L=!1;if(I===void 0||I<0)I=0;if(I>this.length)return"";if(E===void 0||E>this.length)E=this.length;if(E<=0)return"";if(E>>>=0,I>>>=0,E<=I)return"";if(!$)$="utf8";while(!0)switch($){case"hex":return XQ(this,I,E);case"utf8":case"utf-8":return k$(this,I,E);case"ascii":return CQ(this,I,E);case"latin1":case"binary":return QQ(this,I,E);case"base64":return $Q(this,I,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return GQ(this,I,E);default:if(L)throw TypeError("Unknown encoding: "+$);$=($+"").toLowerCase(),L=!0}}function IO($,I,E){let L=$[I];$[I]=$[E],$[E]=L}function P$($,I,E,L,S){if($.length===0)return-1;if(typeof E==="string")L=E,E=0;else if(E>2147483647)E=2147483647;else if(E<-2147483648)E=-2147483648;if(E=+E,Number.isNaN(E))E=S?0:$.length-1;if(E<0)E=$.length+E;if(E>=$.length)if(S)return-1;else E=$.length-1;else if(E<0)if(S)E=0;else return-1;if(typeof I==="string")I=G0.from(I,L);if(G0.isBuffer(I)){if(I.length===0)return-1;return D$($,I,E,L,S)}else if(typeof I==="number"){if(I=I&255,typeof Uint8Array.prototype.indexOf==="function")if(S)return Uint8Array.prototype.indexOf.call($,I,E);else return Uint8Array.prototype.lastIndexOf.call($,I,E);return D$($,[I],E,L,S)}throw TypeError("val must be string, number or Buffer")}function D$($,I,E,L,S){let K=1,Q=$.length,T=I.length;if(L!==void 0){if(L=String(L).toLowerCase(),L==="ucs2"||L==="ucs-2"||L==="utf16le"||L==="utf-16le"){if($.length<2||I.length<2)return-1;K=2,Q/=2,T/=2,E/=2}}function M(F,R){if(K===1)return F[R];else return F.readUInt16BE(R*K)}let H;if(S){let F=-1;for(H=E;H<Q;H++)if(M($,H)===M(I,F===-1?0:H-F)){if(F===-1)F=H;if(H-F+1===T)return F*K}else{if(F!==-1)H-=H-F;F=-1}}else{if(E+T>Q)E=Q-T;for(H=E;H>=0;H--){let F=!0;for(let R=0;R<T;R++)if(M($,H+R)!==M(I,R)){F=!1;break}if(F)return H}}return-1}function iC($,I,E,L){E=Number(E)||0;let S=$.length-E;if(!L)L=S;else if(L=Number(L),L>S)L=S;let K=I.length;if(L>K/2)L=K/2;let Q;for(Q=0;Q<L;++Q){let T=parseInt(I.substr(Q*2,2),16);if(Number.isNaN(T))return Q;$[E+Q]=T}return Q}function UQ($,I,E,L){return mO(fZ(I,$.length-E),$,E,L)}function OQ($,I,E,L){return mO(SQ(I),$,E,L)}function ZQ($,I,E,L){return mO(N$(I),$,E,L)}function AQ($,I,E,L){return mO(VQ(I,$.length-E),$,E,L)}function $Q($,I,E){if(I===0&&E===$.length)return L$($);else return L$($.slice(I,E))}function k$($,I,E){E=Math.min($.length,E);let L=[],S=I;while(S<E){let K=$[S],Q=null,T=K>239?4:K>223?3:K>191?2:1;if(S+T<=E){let M,H,F,R;switch(T){case 1:if(K<128)Q=K;break;case 2:if(M=$[S+1],(M&192)===128){if(R=(K&31)<<6|M&63,R>127)Q=R}break;case 3:if(M=$[S+1],H=$[S+2],(M&192)===128&&(H&192)===128){if(R=(K&15)<<12|(M&63)<<6|H&63,R>2047&&(R<55296||R>57343))Q=R}break;case 4:if(M=$[S+1],H=$[S+2],F=$[S+3],(M&192)===128&&(H&192)===128&&(F&192)===128){if(R=(K&15)<<18|(M&63)<<12|(H&63)<<6|F&63,R>65535&&R<1114112)Q=R}}}if(Q===null)Q=65533,T=1;else if(Q>65535)Q-=65536,L.push(Q>>>10&1023|55296),Q=56320|Q&1023;L.push(Q),S+=T}return IQ(L)}function IQ($){let I=$.length;if(I<=K$)return String.fromCharCode.apply(String,$);let E="",L=0;while(L<I)E+=String.fromCharCode.apply(String,$.slice(L,L+=K$));return E}function CQ($,I,E){let L="";E=Math.min($.length,E);for(let S=I;S<E;++S)L+=String.fromCharCode($[S]&127);return L}function QQ($,I,E){let L="";E=Math.min($.length,E);for(let S=I;S<E;++S)L+=String.fromCharCode($[S]);return L}function XQ($,I,E){let L=$.length;if(!I||I<0)I=0;if(!E||E<0||E>L)E=L;let S="";for(let K=I;K<E;++K)S+=LQ[$[K]];return S}function GQ($,I,E){let L=$.slice(I,E),S="";for(let K=0;K<L.length-1;K+=2)S+=String.fromCharCode(L[K]+L[K+1]*256);return S}function LU($,I,E){if($%1!==0||$<0)throw RangeError("offset is not uint");if($+I>E)throw RangeError("Trying to access beyond buffer length")}function kU($,I,E,L,S,K){if(!G0.isBuffer($))throw TypeError('"buffer" argument must be a Buffer instance');if(I>S||I<K)throw RangeError('"value" argument is out of bounds');if(E+L>$.length)throw RangeError("Index out of range")}function _$($,I,E,L,S){x$(I,L,S,$,E,7);let K=Number(I&BigInt(4294967295));$[E++]=K,K=K>>8,$[E++]=K,K=K>>8,$[E++]=K,K=K>>8,$[E++]=K;let Q=Number(I>>BigInt(32)&BigInt(4294967295));return $[E++]=Q,Q=Q>>8,$[E++]=Q,Q=Q>>8,$[E++]=Q,Q=Q>>8,$[E++]=Q,E}function j$($,I,E,L,S){x$(I,L,S,$,E,7);let K=Number(I&BigInt(4294967295));$[E+7]=K,K=K>>8,$[E+6]=K,K=K>>8,$[E+5]=K,K=K>>8,$[E+4]=K;let Q=Number(I>>BigInt(32)&BigInt(4294967295));return $[E+3]=Q,Q=Q>>8,$[E+2]=Q,Q=Q>>8,$[E+1]=Q,Q=Q>>8,$[E]=Q,E+8}function v$($,I,E,L,S,K){if(E+L>$.length)throw RangeError("Index out of range");if(E<0)throw RangeError("Index out of range")}function B$($,I,E,L,S){if(I=+I,E=E>>>0,!S)v$($,I,E,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return W$($,I,E,L,23,4),E+4}function g$($,I,E,L,S){if(I=+I,E=E>>>0,!S)v$($,I,E,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return W$($,I,E,L,52,8),E+8}function H$($){let I="",E=$.length,L=$[0]==="-"?1:0;for(;E>=L+4;E-=3)I=`_${$.slice(E-3,E)}${I}`;return`${$.slice(0,E)}${I}`}function EQ($,I,E){if(DO(I,"offset"),$[I]===void 0||$[I+E]===void 0)jO(I,$.length-(E+1))}function x$($,I,E,L,S,K){if($>E||$<I){let Q=typeof I==="bigint"?"n":"",T;if(K>3)if(I===0||I===BigInt(0))T=`>= 0${Q} and < 2${Q} ** ${(K+1)*8}${Q}`;else T=`>= -(2${Q} ** ${(K+1)*8-1}${Q}) and < 2 ** ${(K+1)*8-1}${Q}`;else T=`>= ${I}${Q} and <= ${E}${Q}`;throw new gZ("value",T,$)}EQ(L,S,K)}function DO($,I){if(typeof $!=="number")throw new tC(I,"number",$)}function jO($,I,E){if(Math.floor($)!==$)throw DO($,E),new gZ(E||"offset","an integer",$);if(I<0)throw new nC;throw new gZ(E||"offset",`>= ${E?1:0} and <= ${I}`,$)}function YQ($){if($=$.split("=")[0],$=$.trim().replace(JQ,""),$.length<2)return"";while($.length%4!==0)$=$+"=";return $}function fZ($,I){I=I||1/0;let E,L=$.length,S=null,K=[];for(let Q=0;Q<L;++Q){if(E=$.charCodeAt(Q),E>55295&&E<57344){if(!S){if(E>56319){if((I-=3)>-1)K.push(239,191,189);continue}else if(Q+1===L){if((I-=3)>-1)K.push(239,191,189);continue}S=E;continue}if(E<56320){if((I-=3)>-1)K.push(239,191,189);S=E;continue}E=(S-55296<<10|E-56320)+65536}else if(S){if((I-=3)>-1)K.push(239,191,189)}if(S=null,E<128){if((I-=1)<0)break;K.push(E)}else if(E<2048){if((I-=2)<0)break;K.push(E>>6|192,E&63|128)}else if(E<65536){if((I-=3)<0)break;K.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((I-=4)<0)break;K.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw Error("Invalid code point")}return K}function SQ($){let I=[];for(let E=0;E<$.length;++E)I.push($.charCodeAt(E)&255);return I}function VQ($,I){let E,L,S,K=[];for(let Q=0;Q<$.length;++Q){if((I-=2)<0)break;E=$.charCodeAt(Q),L=E>>8,S=E%256,K.push(S),K.push(L)}return K}function N$($){return cC(YQ($))}function mO($,I,E,L){let S;for(S=0;S<L;++S){if(S+E>=I.length||S>=$.length)break;I[S+E]=$[S]}return S}function uU($,I){return $ instanceof I||$!=null&&$.constructor!=null&&$.constructor.name!=null&&$.constructor.name===I.name}function eU($){return typeof BigInt>"u"?RQ:$}function RQ(){throw Error("BigInt not supported")}function pZ($){return()=>{throw Error($+" is not implemented for node:buffer browser polyfill")}}var hU,fU,BZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$O,V$,R$,F$=50,_O=2147483647,M$=536870888,uC,lC,dC,bC,oC,nC,tC,gZ,K$=4096,JQ,LQ,DQ,KQ,HQ=($)=>{for(let I of $)if(I.charCodeAt(0)>127)return!1;return!0},WQ,FQ;var DU=PO(()=>{hU=[],fU=[];for($O=0,V$=BZ.length;$O<V$;++$O)hU[$O]=BZ[$O],fU[BZ.charCodeAt($O)]=$O;fU[45]=62;fU[95]=63;R$=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,uC=globalThis.btoa,lC=globalThis.atob,dC=globalThis.File,bC=globalThis.Blob,oC={MAX_LENGTH:_O,MAX_STRING_LENGTH:M$};nC=wZ("ERR_BUFFER_OUT_OF_BOUNDS",function($){if($)return`${$} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),tC=wZ("ERR_INVALID_ARG_TYPE",function($,I){return`The "${$}" argument must be of type number. Received type ${typeof I}`},TypeError),gZ=wZ("ERR_OUT_OF_RANGE",function($,I,E){let L=`The value of "${$}" is out of range.`,S=E;if(Number.isInteger(E)&&Math.abs(E)>4294967296)S=H$(String(E));else if(typeof E==="bigint"){if(S=String(E),E>BigInt(2)**BigInt(32)||E<-(BigInt(2)**BigInt(32)))S=H$(S);S+="n"}return L+=` It must be ${I}. Received ${S}`,L},RangeError);Object.defineProperty(G0.prototype,"parent",{enumerable:!0,get:function(){if(!G0.isBuffer(this))return;return this.buffer}});Object.defineProperty(G0.prototype,"offset",{enumerable:!0,get:function(){if(!G0.isBuffer(this))return;return this.byteOffset}});G0.poolSize=8192;G0.from=function($,I,E){return z$($,I,E)};Object.setPrototypeOf(G0.prototype,Uint8Array.prototype);Object.setPrototypeOf(G0,Uint8Array);G0.alloc=function($,I,E){return sC($,I,E)};G0.allocUnsafe=function($){return yZ($)};G0.allocUnsafeSlow=function($){return yZ($)};G0.isBuffer=function($){return $!=null&&$._isBuffer===!0&&$!==G0.prototype};G0.compare=function($,I){if(uU($,Uint8Array))$=G0.from($,$.offset,$.byteLength);if(uU(I,Uint8Array))I=G0.from(I,I.offset,I.byteLength);if(!G0.isBuffer($)||!G0.isBuffer(I))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if($===I)return 0;let E=$.length,L=I.length;for(let S=0,K=Math.min(E,L);S<K;++S)if($[S]!==I[S]){E=$[S],L=I[S];break}if(E<L)return-1;if(L<E)return 1;return 0};G0.isEncoding=function($){switch(String($).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};G0.concat=function($,I){if(!Array.isArray($))throw TypeError('"list" argument must be an Array of Buffers');if($.length===0)return G0.alloc(0);let E;if(I===void 0){I=0;for(E=0;E<$.length;++E)I+=$[E].length}let L=G0.allocUnsafe(I),S=0;for(E=0;E<$.length;++E){let K=$[E];if(uU(K,Uint8Array))if(S+K.length>L.length){if(!G0.isBuffer(K))K=G0.from(K);K.copy(L,S)}else Uint8Array.prototype.set.call(L,K,S);else if(!G0.isBuffer(K))throw TypeError('"list" argument must be an Array of Buffers');else K.copy(L,S);S+=K.length}return L};G0.byteLength=q$;G0.prototype._isBuffer=!0;G0.prototype.swap16=function(){let $=this.length;if($%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<$;I+=2)IO(this,I,I+1);return this};G0.prototype.swap32=function(){let $=this.length;if($%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<$;I+=4)IO(this,I,I+3),IO(this,I+1,I+2);return this};G0.prototype.swap64=function(){let $=this.length;if($%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<$;I+=8)IO(this,I,I+7),IO(this,I+1,I+6),IO(this,I+2,I+5),IO(this,I+3,I+4);return this};G0.prototype.toString=function(){let $=this.length;if($===0)return"";if(arguments.length===0)return k$(this,0,$);return aC.apply(this,arguments)};G0.prototype.toLocaleString=G0.prototype.toString;G0.prototype.equals=function($){if(!G0.isBuffer($))throw TypeError("Argument must be a Buffer");if(this===$)return!0;return G0.compare(this,$)===0};G0.prototype.inspect=function(){let $="",I=F$;if($=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I)$+=" ... ";return"<Buffer "+$+">"};if(R$)G0.prototype[R$]=G0.prototype.inspect;G0.prototype.compare=function($,I,E,L,S){if(uU($,Uint8Array))$=G0.from($,$.offset,$.byteLength);if(!G0.isBuffer($))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof $);if(I===void 0)I=0;if(E===void 0)E=$?$.length:0;if(L===void 0)L=0;if(S===void 0)S=this.length;if(I<0||E>$.length||L<0||S>this.length)throw RangeError("out of range index");if(L>=S&&I>=E)return 0;if(L>=S)return-1;if(I>=E)return 1;if(I>>>=0,E>>>=0,L>>>=0,S>>>=0,this===$)return 0;let K=S-L,Q=E-I,T=Math.min(K,Q),M=this.slice(L,S),H=$.slice(I,E);for(let F=0;F<T;++F)if(M[F]!==H[F]){K=M[F],Q=H[F];break}if(K<Q)return-1;if(Q<K)return 1;return 0};G0.prototype.includes=function($,I,E){return this.indexOf($,I,E)!==-1};G0.prototype.indexOf=function($,I,E){return P$(this,$,I,E,!0)};G0.prototype.lastIndexOf=function($,I,E){return P$(this,$,I,E,!1)};G0.prototype.write=function($,I,E,L){if(I===void 0)L="utf8",E=this.length,I=0;else if(E===void 0&&typeof I==="string")L=I,E=this.length,I=0;else if(isFinite(I))if(I=I>>>0,isFinite(E)){if(E=E>>>0,L===void 0)L="utf8"}else L=E,E=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let S=this.length-I;if(E===void 0||E>S)E=S;if($.length>0&&(E<0||I<0)||I>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!L)L="utf8";let K=!1;for(;;)switch(L){case"hex":return iC(this,$,I,E);case"utf8":case"utf-8":return UQ(this,$,I,E);case"ascii":case"latin1":case"binary":return OQ(this,$,I,E);case"base64":return ZQ(this,$,I,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return AQ(this,$,I,E);default:if(K)throw TypeError("Unknown encoding: "+L);L=(""+L).toLowerCase(),K=!0}};G0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};G0.prototype.slice=function($,I){let E=this.length;if($=~~$,I=I===void 0?E:~~I,$<0){if($+=E,$<0)$=0}else if($>E)$=E;if(I<0){if(I+=E,I<0)I=0}else if(I>E)I=E;if(I<$)I=$;let L=this.subarray($,I);return Object.setPrototypeOf(L,G0.prototype),L};G0.prototype.readUintLE=G0.prototype.readUIntLE=function($,I,E){if($=$>>>0,I=I>>>0,!E)LU($,I,this.length);let L=this[$],S=1,K=0;while(++K<I&&(S*=256))L+=this[$+K]*S;return L};G0.prototype.readUintBE=G0.prototype.readUIntBE=function($,I,E){if($=$>>>0,I=I>>>0,!E)LU($,I,this.length);let L=this[$+--I],S=1;while(I>0&&(S*=256))L+=this[$+--I]*S;return L};G0.prototype.readUint8=G0.prototype.readUInt8=function($,I){if($=$>>>0,!I)LU($,1,this.length);return this[$]};G0.prototype.readUint16LE=G0.prototype.readUInt16LE=function($,I){if($=$>>>0,!I)LU($,2,this.length);return this[$]|this[$+1]<<8};G0.prototype.readUint16BE=G0.prototype.readUInt16BE=function($,I){if($=$>>>0,!I)LU($,2,this.length);return this[$]<<8|this[$+1]};G0.prototype.readUint32LE=G0.prototype.readUInt32LE=function($,I){if($=$>>>0,!I)LU($,4,this.length);return(this[$]|this[$+1]<<8|this[$+2]<<16)+this[$+3]*16777216};G0.prototype.readUint32BE=G0.prototype.readUInt32BE=function($,I){if($=$>>>0,!I)LU($,4,this.length);return this[$]*16777216+(this[$+1]<<16|this[$+2]<<8|this[$+3])};G0.prototype.readBigUInt64LE=eU(function($){$=$>>>0,DO($,"offset");let I=this[$],E=this[$+7];if(I===void 0||E===void 0)jO($,this.length-8);let L=I+this[++$]*256+this[++$]*65536+this[++$]*16777216,S=this[++$]+this[++$]*256+this[++$]*65536+E*16777216;return BigInt(L)+(BigInt(S)<<BigInt(32))});G0.prototype.readBigUInt64BE=eU(function($){$=$>>>0,DO($,"offset");let I=this[$],E=this[$+7];if(I===void 0||E===void 0)jO($,this.length-8);let L=I*16777216+this[++$]*65536+this[++$]*256+this[++$],S=this[++$]*16777216+this[++$]*65536+this[++$]*256+E;return(BigInt(L)<<BigInt(32))+BigInt(S)});G0.prototype.readIntLE=function($,I,E){if($=$>>>0,I=I>>>0,!E)LU($,I,this.length);let L=this[$],S=1,K=0;while(++K<I&&(S*=256))L+=this[$+K]*S;if(S*=128,L>=S)L-=Math.pow(2,8*I);return L};G0.prototype.readIntBE=function($,I,E){if($=$>>>0,I=I>>>0,!E)LU($,I,this.length);let L=I,S=1,K=this[$+--L];while(L>0&&(S*=256))K+=this[$+--L]*S;if(S*=128,K>=S)K-=Math.pow(2,8*I);return K};G0.prototype.readInt8=function($,I){if($=$>>>0,!I)LU($,1,this.length);if(!(this[$]&128))return this[$];return(255-this[$]+1)*-1};G0.prototype.readInt16LE=function($,I){if($=$>>>0,!I)LU($,2,this.length);let E=this[$]|this[$+1]<<8;return E&32768?E|4294901760:E};G0.prototype.readInt16BE=function($,I){if($=$>>>0,!I)LU($,2,this.length);let E=this[$+1]|this[$]<<8;return E&32768?E|4294901760:E};G0.prototype.readInt32LE=function($,I){if($=$>>>0,!I)LU($,4,this.length);return this[$]|this[$+1]<<8|this[$+2]<<16|this[$+3]<<24};G0.prototype.readInt32BE=function($,I){if($=$>>>0,!I)LU($,4,this.length);return this[$]<<24|this[$+1]<<16|this[$+2]<<8|this[$+3]};G0.prototype.readBigInt64LE=eU(function($){$=$>>>0,DO($,"offset");let I=this[$],E=this[$+7];if(I===void 0||E===void 0)jO($,this.length-8);let L=this[$+4]+this[$+5]*256+this[$+6]*65536+(E<<24);return(BigInt(L)<<BigInt(32))+BigInt(I+this[++$]*256+this[++$]*65536+this[++$]*16777216)});G0.prototype.readBigInt64BE=eU(function($){$=$>>>0,DO($,"offset");let I=this[$],E=this[$+7];if(I===void 0||E===void 0)jO($,this.length-8);let L=(I<<24)+this[++$]*65536+this[++$]*256+this[++$];return(BigInt(L)<<BigInt(32))+BigInt(this[++$]*16777216+this[++$]*65536+this[++$]*256+E)});G0.prototype.readFloatLE=function($,I){if($=$>>>0,!I)LU($,4,this.length);return sO(this,$,!0,23,4)};G0.prototype.readFloatBE=function($,I){if($=$>>>0,!I)LU($,4,this.length);return sO(this,$,!1,23,4)};G0.prototype.readDoubleLE=function($,I){if($=$>>>0,!I)LU($,8,this.length);return sO(this,$,!0,52,8)};G0.prototype.readDoubleBE=function($,I){if($=$>>>0,!I)LU($,8,this.length);return sO(this,$,!1,52,8)};G0.prototype.writeUintLE=G0.prototype.writeUIntLE=function($,I,E,L){if($=+$,I=I>>>0,E=E>>>0,!L){let Q=Math.pow(2,8*E)-1;kU(this,$,I,E,Q,0)}let S=1,K=0;this[I]=$&255;while(++K<E&&(S*=256))this[I+K]=$/S&255;return I+E};G0.prototype.writeUintBE=G0.prototype.writeUIntBE=function($,I,E,L){if($=+$,I=I>>>0,E=E>>>0,!L){let Q=Math.pow(2,8*E)-1;kU(this,$,I,E,Q,0)}let S=E-1,K=1;this[I+S]=$&255;while(--S>=0&&(K*=256))this[I+S]=$/K&255;return I+E};G0.prototype.writeUint8=G0.prototype.writeUInt8=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,1,255,0);return this[I]=$&255,I+1};G0.prototype.writeUint16LE=G0.prototype.writeUInt16LE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,2,65535,0);return this[I]=$&255,this[I+1]=$>>>8,I+2};G0.prototype.writeUint16BE=G0.prototype.writeUInt16BE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,2,65535,0);return this[I]=$>>>8,this[I+1]=$&255,I+2};G0.prototype.writeUint32LE=G0.prototype.writeUInt32LE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,4,4294967295,0);return this[I+3]=$>>>24,this[I+2]=$>>>16,this[I+1]=$>>>8,this[I]=$&255,I+4};G0.prototype.writeUint32BE=G0.prototype.writeUInt32BE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,4,4294967295,0);return this[I]=$>>>24,this[I+1]=$>>>16,this[I+2]=$>>>8,this[I+3]=$&255,I+4};G0.prototype.writeBigUInt64LE=eU(function($,I=0){return _$(this,$,I,BigInt(0),BigInt("0xffffffffffffffff"))});G0.prototype.writeBigUInt64BE=eU(function($,I=0){return j$(this,$,I,BigInt(0),BigInt("0xffffffffffffffff"))});G0.prototype.writeIntLE=function($,I,E,L){if($=+$,I=I>>>0,!L){let T=Math.pow(2,8*E-1);kU(this,$,I,E,T-1,-T)}let S=0,K=1,Q=0;this[I]=$&255;while(++S<E&&(K*=256)){if($<0&&Q===0&&this[I+S-1]!==0)Q=1;this[I+S]=($/K>>0)-Q&255}return I+E};G0.prototype.writeIntBE=function($,I,E,L){if($=+$,I=I>>>0,!L){let T=Math.pow(2,8*E-1);kU(this,$,I,E,T-1,-T)}let S=E-1,K=1,Q=0;this[I+S]=$&255;while(--S>=0&&(K*=256)){if($<0&&Q===0&&this[I+S+1]!==0)Q=1;this[I+S]=($/K>>0)-Q&255}return I+E};G0.prototype.writeInt8=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,1,127,-128);if($<0)$=255+$+1;return this[I]=$&255,I+1};G0.prototype.writeInt16LE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,2,32767,-32768);return this[I]=$&255,this[I+1]=$>>>8,I+2};G0.prototype.writeInt16BE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,2,32767,-32768);return this[I]=$>>>8,this[I+1]=$&255,I+2};G0.prototype.writeInt32LE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,4,2147483647,-2147483648);return this[I]=$&255,this[I+1]=$>>>8,this[I+2]=$>>>16,this[I+3]=$>>>24,I+4};G0.prototype.writeInt32BE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,4,2147483647,-2147483648);if($<0)$=4294967295+$+1;return this[I]=$>>>24,this[I+1]=$>>>16,this[I+2]=$>>>8,this[I+3]=$&255,I+4};G0.prototype.writeBigInt64LE=eU(function($,I=0){return _$(this,$,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});G0.prototype.writeBigInt64BE=eU(function($,I=0){return j$(this,$,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});G0.prototype.writeFloatLE=function($,I,E){return B$(this,$,I,!0,E)};G0.prototype.writeFloatBE=function($,I,E){return B$(this,$,I,!1,E)};G0.prototype.writeDoubleLE=function($,I,E){return g$(this,$,I,!0,E)};G0.prototype.writeDoubleBE=function($,I,E){return g$(this,$,I,!1,E)};G0.prototype.copy=function($,I,E,L){if(!G0.isBuffer($))throw TypeError("argument should be a Buffer");if(!E)E=0;if(!L&&L!==0)L=this.length;if(I>=$.length)I=$.length;if(!I)I=0;if(L>0&&L<E)L=E;if(L===E)return 0;if($.length===0||this.length===0)return 0;if(I<0)throw RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw RangeError("Index out of range");if(L<0)throw RangeError("sourceEnd out of bounds");if(L>this.length)L=this.length;if($.length-I<L-E)L=$.length-I+E;let S=L-E;if(this===$&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(I,E,L);else Uint8Array.prototype.set.call($,this.subarray(E,L),I);return S};G0.prototype.fill=function($,I,E,L){if(typeof $==="string"){if(typeof I==="string")L=I,I=0,E=this.length;else if(typeof E==="string")L=E,E=this.length;if(L!==void 0&&typeof L!=="string")throw TypeError("encoding must be a string");if(typeof L==="string"&&!G0.isEncoding(L))throw TypeError("Unknown encoding: "+L);if($.length===1){let K=$.charCodeAt(0);if(L==="utf8"&&K<128||L==="latin1")$=K}}else if(typeof $==="number")$=$&255;else if(typeof $==="boolean")$=Number($);if(I<0||this.length<I||this.length<E)throw RangeError("Out of range index");if(E<=I)return this;if(I=I>>>0,E=E===void 0?this.length:E>>>0,!$)$=0;let S;if(typeof $==="number")for(S=I;S<E;++S)this[S]=$;else{let K=G0.isBuffer($)?$:G0.from($,L),Q=K.length;if(Q===0)throw TypeError('The value "'+$+'" is invalid for argument "value"');for(S=0;S<E-I;++S)this[S+I]=K[S%Q]}return this};JQ=/[^+/0-9A-Za-z-_]/g;LQ=function(){let $=Array(256);for(let I=0;I<16;++I){let E=I*16;for(let L=0;L<16;++L)$[E+L]="0123456789abcdef"[I]+"0123456789abcdef"[L]}return $}();DQ=pZ("resolveObjectURL"),KQ=pZ("isUtf8"),WQ=pZ("transcode"),FQ=G0});var BO={};qO(BO,{setMaxListeners:()=>o$,once:()=>d$,listenerCount:()=>n$,init:()=>aU,getMaxListeners:()=>s$,getEventListeners:()=>b$,default:()=>vQ,captureRejectionSymbol:()=>p$,addAbortListener:()=>m$,EventEmitter:()=>aU});function h$($,I){var{_events:E}=$;if(I[0]??=Error("Unhandled error."),!E)throw I[0];var L=E[c$];if(L)for(var S of w$.call(L))S.apply($,I);var K=E.error;if(!K)throw I[0];for(var S of w$.call(K))S.apply($,I);return!0}function TQ($,I,E,L){I.then(void 0,function(S){queueMicrotask(()=>qQ($,S,E,L))})}function qQ($,I,E,L){if(typeof $[f$]==="function")$[f$](I,E,...L);else try{$[CO]=!1,$.emit("error",I)}finally{$[CO]=!0}}function u$($,I,E){E.warned=!0;let L=Error(`Possible EventEmitter memory leak detected. ${E.length} ${String(I)} listeners added to [${$.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);L.name="MaxListenersExceededWarning",L.emitter=$,L.type=I,L.count=E.length,console.warn(L)}function l$($,I,...E){this.removeListener($,I),I.apply(this,E)}function d$($,I,E){var L=E?.signal;if(t$(L,"options.signal"),L?.aborted)throw new hZ(void 0,{cause:L?.reason});let{resolve:S,reject:K,promise:Q}=$newPromiseCapability(Promise),T=(F)=>{if($.removeListener(I,M),L!=null)rO(L,"abort",H);K(F)},M=(...F)=>{if(typeof $.removeListener==="function")$.removeListener("error",T);if(L!=null)rO(L,"abort",H);S(F)};if(y$($,I,M,{once:!0}),I!=="error"&&typeof $.once==="function")$.once("error",T);function H(){rO($,I,M),rO($,"error",T),K(new hZ(void 0,{cause:L?.reason}))}if(L!=null)y$(L,"abort",H,{once:!0});return Q}function b$($,I){return $.listeners(I)}function o$($,...I){lZ($,"setMaxListeners",0);var E;if(I&&(E=I.length))for(let L=0;L<E;L++)I[L].setMaxListeners($);else QO=$}function n$($,I){return $.listenerCount(I)}function rO($,I,E,L){if(typeof $.removeListener==="function")$.removeListener(I,E);else $.removeEventListener(I,E,L)}function y$($,I,E,L){if(typeof $.on==="function")if(L.once)$.once(I,E);else $.on(I,E);else $.addEventListener(I,E,L)}function KO($,I,E){let L=TypeError(`The "${$}" argument must be of type ${I}. Received ${E}`);return L.code="ERR_INVALID_ARG_TYPE",L}function _Q($,I,E){let L=RangeError(`The "${$}" argument is out of range. It must be ${I}. Received ${E}`);return L.code="ERR_OUT_OF_RANGE",L}function t$($,I){if($!==void 0&&($===null||typeof $!=="object"||!("aborted"in $)))throw KO(I,"AbortSignal",$)}function lZ($,I,E,L){if(typeof $!=="number")throw KO(I,"number",$);if(E!=null&&$<E||L!=null&&$>L||(E!=null||L!=null)&&Number.isNaN($))throw _Q(I,`${E!=null?`>= ${E}`:""}${E!=null&&L!=null?" && ":""}${L!=null?`<= ${L}`:""}`,$)}function vO($){if(typeof $!=="function")throw TypeError("The listener must be a function")}function jQ($,I){if(typeof $!=="boolean")throw KO(I,"boolean",$)}function s$($){return $?._maxListeners??QO}function m$($,I){if($===void 0)throw KO("signal","AbortSignal",$);if(t$($,"signal"),typeof I!=="function")throw KO("listener","function",I);let E;if($.aborted)queueMicrotask(()=>I());else $.addEventListener("abort",I,{__proto__:null,once:!0}),E=()=>{$.removeEventListener("abort",I)};return{__proto__:null,[Symbol.dispose](){E?.()}}}var uZ,CO,c$,MQ,zQ,f$,p$,w$,QO=10,aU=function($){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[CO]=$?.captureRejections?Boolean($?.captureRejections):n0[CO])this.emit=kQ},n0,PQ=function($,...I){if($==="error")return h$(this,I);var{_events:E}=this;if(E===void 0)return!1;var L=E[$];if(L===void 0)return!1;let S=L.length>1?L.slice():L;for(let K=0,{length:Q}=S;K<Q;K++){let T=S[K];switch(I.length){case 0:T.call(this);break;case 1:T.call(this,I[0]);break;case 2:T.call(this,I[0],I[1]);break;case 3:T.call(this,I[0],I[1],I[2]);break;default:T.apply(this,I);break}}return!0},kQ=function($,...I){if($==="error")return h$(this,I);var{_events:E}=this;if(E===void 0)return!1;var L=E[$];if(L===void 0)return!1;let S=L.length>1?L.slice():L;for(let K=0,{length:Q}=S;K<Q;K++){let T=S[K],M;switch(I.length){case 0:M=T.call(this);break;case 1:M=T.call(this,I[0]);break;case 2:M=T.call(this,I[0],I[1]);break;case 3:M=T.call(this,I[0],I[1],I[2]);break;default:M=T.apply(this,I);break}if(M!==void 0&&typeof M?.then==="function"&&M.then===Promise.prototype.then)TQ(this,M,$,I)}return!0},hZ,vQ;var gO=PO(()=>{uZ=Symbol.for,CO=Symbol("kCapture"),c$=uZ("events.errorMonitor"),MQ=Symbol("events.maxEventTargetListeners"),zQ=Symbol("events.maxEventTargetListenersWarned"),f$=uZ("nodejs.rejection"),p$=uZ("nodejs.rejection"),w$=Array.prototype.slice,n0=aU.prototype={};n0._events=void 0;n0._eventsCount=0;n0._maxListeners=void 0;n0.setMaxListeners=function($){return lZ($,"setMaxListeners",0),this._maxListeners=$,this};n0.constructor=aU;n0.getMaxListeners=function(){return this?._maxListeners??QO};n0.emit=PQ;n0.addListener=function($,I){vO(I);var E=this._events;if(!E)E=this._events={__proto__:null},this._eventsCount=0;else if(E.newListener)this.emit("newListener",$,I.listener??I);var L=E[$];if(!L)E[$]=[I],this._eventsCount++;else{L.push(I);var S=this._maxListeners??QO;if(S>0&&L.length>S&&!L.warned)u$(this,$,L)}return this};n0.on=n0.addListener;n0.prependListener=function($,I){vO(I);var E=this._events;if(!E)E=this._events={__proto__:null},this._eventsCount=0;else if(E.newListener)this.emit("newListener",$,I.listener??I);var L=E[$];if(!L)E[$]=[I],this._eventsCount++;else{L.unshift(I);var S=this._maxListeners??QO;if(S>0&&L.length>S&&!L.warned)u$(this,$,L)}return this};n0.once=function($,I){vO(I);let E=l$.bind(this,$,I);return E.listener=I,this.addListener($,E),this};n0.prependOnceListener=function($,I){vO(I);let E=l$.bind(this,$,I);return E.listener=I,this.prependListener($,E),this};n0.removeListener=function($,I){vO(I);var{_events:E}=this;if(!E)return this;var L=E[$];if(!L)return this;var S=L.length;let K=-1;for(let Q=S-1;Q>=0;Q--)if(L[Q]===I||L[Q].listener===I){K=Q;break}if(K<0)return this;if(K===0)L.shift();else L.splice(K,1);if(L.length===0)delete E[$],this._eventsCount--;return this};n0.off=n0.removeListener;n0.removeAllListeners=function($){var{_events:I}=this;if($&&I){if(I[$])delete I[$],this._eventsCount--}else this._events={__proto__:null};return this};n0.listeners=function($){var{_events:I}=this;if(!I)return[];var E=I[$];if(!E)return[];return E.map((L)=>L.listener??L)};n0.rawListeners=function($){var{_events:I}=this;if(!I)return[];var E=I[$];if(!E)return[];return E.slice()};n0.listenerCount=function($){var{_events:I}=this;if(!I)return 0;return I[$]?.length??0};n0.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};n0[CO]=!1;hZ=class hZ extends Error{constructor($="The operation was aborted",I=void 0){if(I!==void 0&&typeof I!=="object")throw KO("options","Object",I);super($,I);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(aU,{captureRejections:{get(){return n0[CO]},set($){jQ($,"EventEmitter.captureRejections"),n0[CO]=$},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return QO},set:($)=>{lZ($,"defaultMaxListeners",0),QO=$}},kMaxEventTargetListeners:{value:MQ,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:zQ,enumerable:!1,configurable:!1,writable:!1}});Object.assign(aU,{once:d$,getEventListeners:b$,getMaxListeners:s$,setMaxListeners:o$,EventEmitter:aU,usingDomains:!1,captureRejectionSymbol:p$,errorMonitor:c$,addAbortListener:m$,init:aU,listenerCount:n$});vQ=aU});var UZ=KC((kY,AI)=>{var d0=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports),s0=d0(($,I)=>{class E extends Error{constructor(L){if(!Array.isArray(L))throw TypeError(`Expected input to be an Array, got ${typeof L}`);let S="";for(let K=0;K<L.length;K++)S+=` ${L[K].stack}
|
|
2
|
+
`;super(S);this.name="AggregateError",this.errors=L}}I.exports={AggregateError:E,ArrayIsArray(L){return Array.isArray(L)},ArrayPrototypeIncludes(L,S){return L.includes(S)},ArrayPrototypeIndexOf(L,S){return L.indexOf(S)},ArrayPrototypeJoin(L,S){return L.join(S)},ArrayPrototypeMap(L,S){return L.map(S)},ArrayPrototypePop(L,S){return L.pop(S)},ArrayPrototypePush(L,S){return L.push(S)},ArrayPrototypeSlice(L,S,K){return L.slice(S,K)},Error,FunctionPrototypeCall(L,S,...K){return L.call(S,...K)},FunctionPrototypeSymbolHasInstance(L,S){return Function.prototype[Symbol.hasInstance].call(L,S)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(L,S){return Object.defineProperties(L,S)},ObjectDefineProperty(L,S,K){return Object.defineProperty(L,S,K)},ObjectGetOwnPropertyDescriptor(L,S){return Object.getOwnPropertyDescriptor(L,S)},ObjectKeys(L){return Object.keys(L)},ObjectSetPrototypeOf(L,S){return Object.setPrototypeOf(L,S)},Promise,PromisePrototypeCatch(L,S){return L.catch(S)},PromisePrototypeThen(L,S,K){return L.then(S,K)},PromiseReject(L){return Promise.reject(L)},PromiseResolve(L){return Promise.resolve(L)},ReflectApply:Reflect.apply,RegExpPrototypeTest(L,S){return L.test(S)},SafeSet:Set,String,StringPrototypeSlice(L,S,K){return L.slice(S,K)},StringPrototypeToLowerCase(L){return L.toLowerCase()},StringPrototypeToUpperCase(L){return L.toUpperCase()},StringPrototypeTrim(L){return L.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(L,S,K){return L.set(S,K)},Boolean,Uint8Array}}),r$=d0(($,I)=>{I.exports={format(E,...L){return E.replace(/%([sdifj])/g,function(...[S,K]){let Q=L.shift();if(K==="f")return Q.toFixed(6);else if(K==="j")return JSON.stringify(Q);else if(K==="s"&&typeof Q==="object")return`${Q.constructor!==Object?Q.constructor.name:""} {}`.trim();else return Q.toString()})},inspect(E){switch(typeof E){case"string":if(E.includes("'")){if(!E.includes('"'))return`"${E}"`;else if(!E.includes("`")&&!E.includes("${"))return`\`${E}\``}return`'${E}'`;case"number":if(isNaN(E))return"NaN";else if(Object.is(E,-0))return String(E);return E;case"bigint":return`${String(E)}n`;case"boolean":case"undefined":return String(E);case"object":return"{}"}}}}),TU=d0(($,I)=>{var{format:E,inspect:L}=r$(),{AggregateError:S}=s0(),K=globalThis.AggregateError||S,Q=Symbol("kIsNodeError"),T=["string","function","number","object","Function","Object","boolean","bigint","symbol"],M=/^([A-Z][a-z0-9]*)+$/,H={};function F(B,v){if(!B)throw new H.ERR_INTERNAL_ASSERTION(v)}function R(B){let v="",g=B.length,f=B[0]==="-"?1:0;for(;g>=f+4;g-=3)v=`_${B.slice(g-3,g)}${v}`;return`${B.slice(0,g)}${v}`}function D(B,v,g){if(typeof v==="function")return F(v.length<=g.length,`Code: ${B}; The provided arguments length (${g.length}) does not match the required ones (${v.length}).`),v(...g);let f=(v.match(/%[dfijoOs]/g)||[]).length;if(F(f===g.length,`Code: ${B}; The provided arguments length (${g.length}) does not match the required ones (${f}).`),g.length===0)return v;return E(v,...g)}function q(B,v,g){if(!g)g=Error;class f extends g{constructor(...w){super(D(B,v,w))}toString(){return`${this.name} [${B}]: ${this.message}`}}Object.defineProperties(f.prototype,{name:{value:g.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${B}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),f.prototype.code=B,f.prototype[Q]=!0,H[B]=f}function P(B){let v="__node_internal_"+B.name;return Object.defineProperty(B,"name",{value:v}),B}function _(B,v){if(B&&v&&B!==v){if(Array.isArray(v.errors))return v.errors.push(B),v;let g=new K([v,B],v.message);return g.code=v.code,g}return B||v}class k extends Error{constructor(B="The operation was aborted",v=void 0){if(v!==void 0&&typeof v!=="object")throw new H.ERR_INVALID_ARG_TYPE("options","Object",v);super(B,v);this.code="ABORT_ERR",this.name="AbortError"}}q("ERR_ASSERTION","%s",Error),q("ERR_INVALID_ARG_TYPE",(B,v,g)=>{if(F(typeof B==="string","'name' must be a string"),!Array.isArray(v))v=[v];let f="The ";if(B.endsWith(" argument"))f+=`${B} `;else f+=`"${B}" ${B.includes(".")?"property":"argument"} `;f+="must be ";let w=[],b=[],I0=[];for(let C0 of v)if(F(typeof C0==="string","All expected entries have to be of type string"),T.includes(C0))w.push(C0.toLowerCase());else if(M.test(C0))b.push(C0);else F(C0!=="object",'The value "object" should be written as "Object"'),I0.push(C0);if(b.length>0){let C0=w.indexOf("object");if(C0!==-1)w.splice(w,C0,1),b.push("Object")}if(w.length>0){switch(w.length){case 1:f+=`of type ${w[0]}`;break;case 2:f+=`one of type ${w[0]} or ${w[1]}`;break;default:{let C0=w.pop();f+=`one of type ${w.join(", ")}, or ${C0}`}}if(b.length>0||I0.length>0)f+=" or "}if(b.length>0){switch(b.length){case 1:f+=`an instance of ${b[0]}`;break;case 2:f+=`an instance of ${b[0]} or ${b[1]}`;break;default:{let C0=b.pop();f+=`an instance of ${b.join(", ")}, or ${C0}`}}if(I0.length>0)f+=" or "}switch(I0.length){case 0:break;case 1:if(I0[0].toLowerCase()!==I0[0])f+="an ";f+=`${I0[0]}`;break;case 2:f+=`one of ${I0[0]} or ${I0[1]}`;break;default:{let C0=I0.pop();f+=`one of ${I0.join(", ")}, or ${C0}`}}if(g==null)f+=`. Received ${g}`;else if(typeof g==="function"&&g.name)f+=`. Received function ${g.name}`;else if(typeof g==="object"){var X0;if((X0=g.constructor)!==null&&X0!==void 0&&X0.name)f+=`. Received an instance of ${g.constructor.name}`;else{let C0=L(g,{depth:-1});f+=`. Received ${C0}`}}else{let C0=L(g,{colors:!1});if(C0.length>25)C0=`${C0.slice(0,25)}...`;f+=`. Received type ${typeof g} (${C0})`}return f},TypeError),q("ERR_INVALID_ARG_VALUE",(B,v,g="is invalid")=>{let f=L(v);if(f.length>128)f=f.slice(0,128)+"...";return`The ${B.includes(".")?"property":"argument"} '${B}' ${g}. Received ${f}`},TypeError),q("ERR_INVALID_RETURN_VALUE",(B,v,g)=>{var f;let w=g!==null&&g!==void 0&&(f=g.constructor)!==null&&f!==void 0&&f.name?`instance of ${g.constructor.name}`:`type ${typeof g}`;return`Expected ${B} to be returned from the "${v}" function but got ${w}.`},TypeError),q("ERR_MISSING_ARGS",(...B)=>{F(B.length>0,"At least one arg needs to be specified");let v,g=B.length;switch(B=(Array.isArray(B)?B:[B]).map((f)=>`"${f}"`).join(" or "),g){case 1:v+=`The ${B[0]} argument`;break;case 2:v+=`The ${B[0]} and ${B[1]} arguments`;break;default:{let f=B.pop();v+=`The ${B.join(", ")}, and ${f} arguments`}break}return`${v} must be specified`},TypeError),q("ERR_OUT_OF_RANGE",(B,v,g)=>{F(v,'Missing "range" argument');let f;if(Number.isInteger(g)&&Math.abs(g)>4294967296)f=R(String(g));else if(typeof g==="bigint"){f=String(g);let w=BigInt(2)**BigInt(32);if(g>w||g<-w)f=R(f);f+="n"}else f=L(g);return`The value of "${B}" is out of range. It must be ${v}. Received ${f}`},RangeError),q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),q("ERR_STREAM_WRITE_AFTER_END","write after end",Error),q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),I.exports={AbortError:k,aggregateTwoErrors:P(_),hideStackFrames:P,codes:H}}),BQ=d0(($,I)=>{Object.defineProperty($,"__esModule",{value:!0});var E=new WeakMap,L=new WeakMap;function S(u){let O0=E.get(u);return console.assert(O0!=null,"'this' is expected an Event object, but got",u),O0}function K(u){if(u.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",u.passiveListener);return}if(!u.event.cancelable)return;if(u.canceled=!0,typeof u.event.preventDefault==="function")u.event.preventDefault()}function Q(u,O0){E.set(this,{eventTarget:u,event:O0,eventPhase:2,currentTarget:u,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:O0.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let U=Object.keys(O0);for(let A=0;A<U.length;++A){let X=U[A];if(!(X in this))Object.defineProperty(this,X,T(X))}}if(Q.prototype={get type(){return S(this).event.type},get target(){return S(this).eventTarget},get currentTarget(){return S(this).currentTarget},composedPath(){let u=S(this).currentTarget;if(u==null)return[];return[u]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return S(this).eventPhase},stopPropagation(){let u=S(this);if(u.stopped=!0,typeof u.event.stopPropagation==="function")u.event.stopPropagation()},stopImmediatePropagation(){let u=S(this);if(u.stopped=!0,u.immediateStopped=!0,typeof u.event.stopImmediatePropagation==="function")u.event.stopImmediatePropagation()},get bubbles(){return Boolean(S(this).event.bubbles)},get cancelable(){return Boolean(S(this).event.cancelable)},preventDefault(){K(S(this))},get defaultPrevented(){return S(this).canceled},get composed(){return Boolean(S(this).event.composed)},get timeStamp(){return S(this).timeStamp},get srcElement(){return S(this).eventTarget},get cancelBubble(){return S(this).stopped},set cancelBubble(u){if(!u)return;let O0=S(this);if(O0.stopped=!0,typeof O0.event.cancelBubble==="boolean")O0.event.cancelBubble=!0},get returnValue(){return!S(this).canceled},set returnValue(u){if(!u)K(S(this))},initEvent(){}},Object.defineProperty(Q.prototype,"constructor",{value:Q,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(Q.prototype,window.Event.prototype),L.set(window.Event.prototype,Q);function T(u){return{get(){return S(this).event[u]},set(O0){S(this).event[u]=O0},configurable:!0,enumerable:!0}}function M(u){return{value(){let O0=S(this).event;return O0[u].apply(O0,arguments)},configurable:!0,enumerable:!0}}function H(u,O0){let U=Object.keys(O0);if(U.length===0)return u;function A(X,Z){u.call(this,X,Z)}A.prototype=Object.create(u.prototype,{constructor:{value:A,configurable:!0,writable:!0}});for(let X=0;X<U.length;++X){let Z=U[X];if(!(Z in u.prototype)){let C=typeof Object.getOwnPropertyDescriptor(O0,Z).value==="function";Object.defineProperty(A.prototype,Z,C?M(Z):T(Z))}}return A}function F(u){if(u==null||u===Object.prototype)return Q;let O0=L.get(u);if(O0==null)O0=H(F(Object.getPrototypeOf(u)),u),L.set(u,O0);return O0}function R(u,O0){return new(F(Object.getPrototypeOf(O0)))(u,O0)}function D(u){return S(u).immediateStopped}function q(u,O0){S(u).eventPhase=O0}function P(u,O0){S(u).currentTarget=O0}function _(u,O0){S(u).passiveListener=O0}var k=new WeakMap,B=1,v=2,g=3;function f(u){return u!==null&&typeof u==="object"}function w(u){let O0=k.get(u);if(O0==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return O0}function b(u){return{get(){let O0=w(this).get(u);while(O0!=null){if(O0.listenerType===g)return O0.listener;O0=O0.next}return null},set(O0){if(typeof O0!=="function"&&!f(O0))O0=null;let U=w(this),A=null,X=U.get(u);while(X!=null){if(X.listenerType===g)if(A!==null)A.next=X.next;else if(X.next!==null)U.set(u,X.next);else U.delete(u);else A=X;X=X.next}if(O0!==null){let Z={listener:O0,listenerType:g,passive:!1,once:!1,next:null};if(A===null)U.set(u,Z);else A.next=Z}},configurable:!0,enumerable:!0}}function I0(u,O0){Object.defineProperty(u,`on${O0}`,b(O0))}function X0(u){function O0(){C0.call(this)}O0.prototype=Object.create(C0.prototype,{constructor:{value:O0,configurable:!0,writable:!0}});for(let U=0;U<u.length;++U)I0(O0.prototype,u[U]);return O0}function C0(){if(this instanceof C0){k.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return X0(arguments[0]);if(arguments.length>0){let u=Array(arguments.length);for(let O0=0;O0<arguments.length;++O0)u[O0]=arguments[O0];return X0(u)}throw TypeError("Cannot call a class as a function")}if(C0.prototype={addEventListener(u,O0,U){if(O0==null)return;if(typeof O0!=="function"&&!f(O0))throw TypeError("'listener' should be a function or an object.");let A=w(this),X=f(U),Z=(X?Boolean(U.capture):Boolean(U))?B:v,C={listener:O0,listenerType:Z,passive:X&&Boolean(U.passive),once:X&&Boolean(U.once),next:null},Y=A.get(u);if(Y===void 0){A.set(u,C);return}let V=null;while(Y!=null){if(Y.listener===O0&&Y.listenerType===Z)return;V=Y,Y=Y.next}V.next=C},removeEventListener(u,O0,U){if(O0==null)return;let A=w(this),X=(f(U)?Boolean(U.capture):Boolean(U))?B:v,Z=null,C=A.get(u);while(C!=null){if(C.listener===O0&&C.listenerType===X){if(Z!==null)Z.next=C.next;else if(C.next!==null)A.set(u,C.next);else A.delete(u);return}Z=C,C=C.next}},dispatchEvent(u){if(u==null||typeof u.type!=="string")throw TypeError('"event.type" should be a string.');let O0=w(this),U=u.type,A=O0.get(U);if(A==null)return!0;let X=R(this,u),Z=null;while(A!=null){if(A.once)if(Z!==null)Z.next=A.next;else if(A.next!==null)O0.set(U,A.next);else O0.delete(U);else Z=A;if(_(X,A.passive?A.listener:null),typeof A.listener==="function")try{A.listener.call(this,X)}catch(C){if(typeof console<"u"&&typeof console.error==="function")console.error(C)}else if(A.listenerType!==g&&typeof A.listener.handleEvent==="function")A.listener.handleEvent(X);if(D(X))break;A=A.next}return _(X,null),q(X,0),P(X,null),!X.defaultPrevented}},Object.defineProperty(C0.prototype,"constructor",{value:C0,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(C0.prototype,window.EventTarget.prototype);$.defineEventAttribute=I0,$.EventTarget=C0,$.default=C0,I.exports=C0,I.exports.EventTarget=I.exports.default=C0,I.exports.defineEventAttribute=I0}),xO=d0(($,I)=>{Object.defineProperty($,"__esModule",{value:!0});var E=BQ();class L extends E.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let F=Q.get(this);if(typeof F!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return F}}E.defineEventAttribute(L.prototype,"abort");function S(){let F=Object.create(L.prototype);return E.EventTarget.call(F),Q.set(F,!1),F}function K(F){if(Q.get(F)!==!1)return;Q.set(F,!0),F.dispatchEvent({type:"abort"})}var Q=new WeakMap;if(Object.defineProperties(L.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(L.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class T{constructor(){M.set(this,S())}get signal(){return H(this)}abort(){K(H(this))}}var M=new WeakMap;function H(F){let R=M.get(F);if(R==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${F===null?"null":typeof F}`);return R}if(Object.defineProperties(T.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(T.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});$.AbortController=T,$.AbortSignal=L,$.default=T,I.exports=T,I.exports.AbortController=I.exports.default=T,I.exports.AbortSignal=L}),_U=d0(($,I)=>{var E=(DU(),l0(RU)),{format:L,inspect:S}=r$(),{codes:{ERR_INVALID_ARG_TYPE:K}}=TU(),{kResistStopPropagation:Q,AggregateError:T,SymbolDispose:M}=s0(),H=globalThis.AbortSignal||xO().AbortSignal,F=globalThis.AbortController||xO().AbortController,R=Object.getPrototypeOf(async function(){}).constructor,D=globalThis.Blob||E.Blob,q=typeof D<"u"?function(k){return k instanceof D}:function(k){return!1},P=(k,B)=>{if(k!==void 0&&(k===null||typeof k!=="object"||!("aborted"in k)))throw new K(B,"AbortSignal",k)},_=(k,B)=>{if(typeof k!=="function")throw new K(B,"Function",k)};I.exports={AggregateError:T,kEmptyObject:Object.freeze({}),once(k){let B=!1;return function(...v){if(B)return;B=!0,k.apply(this,v)}},createDeferredPromise:function(){let k,B;return{promise:new Promise((v,g)=>{k=v,B=g}),resolve:k,reject:B}},promisify(k){return new Promise((B,v)=>{k((g,...f)=>{if(g)return v(g);return B(...f)})})},debuglog(){return function(){}},format:L,inspect:S,types:{isAsyncFunction(k){return k instanceof R},isArrayBufferView(k){return ArrayBuffer.isView(k)}},isBlob:q,deprecate(k,B){return k},addAbortListener:(gO(),l0(BO)).addAbortListener||function(k,B){if(k===void 0)throw new K("signal","AbortSignal",k);P(k,"signal"),_(B,"listener");let v;if(k.aborted)queueMicrotask(()=>B());else k.addEventListener("abort",B,{__proto__:null,once:!0,[Q]:!0}),v=()=>{k.removeEventListener("abort",B)};return{__proto__:null,[M](){var g;(g=v)===null||g===void 0||g()}}},AbortSignalAny:H.any||function(k){if(k.length===1)return k[0];let B=new F,v=()=>B.abort();return k.forEach((g)=>{P(g,"signals"),g.addEventListener("abort",v,{once:!0})}),B.signal.addEventListener("abort",()=>{k.forEach((g)=>g.removeEventListener("abort",v))},{once:!0}),B.signal}},I.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),NO=d0(($,I)=>{var{ArrayIsArray:E,ArrayPrototypeIncludes:L,ArrayPrototypeJoin:S,ArrayPrototypeMap:K,NumberIsInteger:Q,NumberIsNaN:T,NumberMAX_SAFE_INTEGER:M,NumberMIN_SAFE_INTEGER:H,NumberParseInt:F,ObjectPrototypeHasOwnProperty:R,RegExpPrototypeExec:D,String:q,StringPrototypeToUpperCase:P,StringPrototypeTrim:_}=s0(),{hideStackFrames:k,codes:{ERR_SOCKET_BAD_PORT:B,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:g,ERR_OUT_OF_RANGE:f,ERR_UNKNOWN_SIGNAL:w}}=TU(),{normalizeEncoding:b}=_U(),{isAsyncFunction:I0,isArrayBufferView:X0}=_U().types,C0={};function u(c){return c===(c|0)}function O0(c){return c===c>>>0}var U=/^[0-7]+$/,A="must be a 32-bit unsigned integer or an octal string";function X(c,o,x0){if(typeof c>"u")c=x0;if(typeof c==="string"){if(D(U,c)===null)throw new g(o,c,A);c=F(c,8)}return Y(c,o),c}var Z=k((c,o,x0=H,s=M)=>{if(typeof c!=="number")throw new v(o,"number",c);if(!Q(c))throw new f(o,"an integer",c);if(c<x0||c>s)throw new f(o,`>= ${x0} && <= ${s}`,c)}),C=k((c,o,x0=-2147483648,s=2147483647)=>{if(typeof c!=="number")throw new v(o,"number",c);if(!Q(c))throw new f(o,"an integer",c);if(c<x0||c>s)throw new f(o,`>= ${x0} && <= ${s}`,c)}),Y=k((c,o,x0=!1)=>{if(typeof c!=="number")throw new v(o,"number",c);if(!Q(c))throw new f(o,"an integer",c);let s=x0?1:0,Z0=4294967295;if(c<s||c>Z0)throw new f(o,`>= ${s} && <= ${Z0}`,c)});function V(c,o){if(typeof c!=="string")throw new v(o,"string",c)}function G(c,o,x0=void 0,s){if(typeof c!=="number")throw new v(o,"number",c);if(x0!=null&&c<x0||s!=null&&c>s||(x0!=null||s!=null)&&T(c))throw new f(o,`${x0!=null?`>= ${x0}`:""}${x0!=null&&s!=null?" && ":""}${s!=null?`<= ${s}`:""}`,c)}var O=k((c,o,x0)=>{if(!L(x0,c)){let s="must be one of: "+S(K(x0,(Z0)=>typeof Z0==="string"?`'${Z0}'`:q(Z0)),", ");throw new g(o,c,s)}});function J(c,o){if(typeof c!=="boolean")throw new v(o,"boolean",c)}function z(c,o,x0){return c==null||!R(c,o)?x0:c[o]}var W=k((c,o,x0=null)=>{let s=z(x0,"allowArray",!1),Z0=z(x0,"allowFunction",!1);if(!z(x0,"nullable",!1)&&c===null||!s&&E(c)||typeof c!=="object"&&(!Z0||typeof c!=="function"))throw new v(o,"Object",c)}),j=k((c,o)=>{if(c!=null&&typeof c!=="object"&&typeof c!=="function")throw new v(o,"a dictionary",c)}),N=k((c,o,x0=0)=>{if(!E(c))throw new v(o,"Array",c);if(c.length<x0){let s=`must be longer than ${x0}`;throw new g(o,c,s)}});function p(c,o){N(c,o);for(let x0=0;x0<c.length;x0++)V(c[x0],`${o}[${x0}]`)}function n(c,o){N(c,o);for(let x0=0;x0<c.length;x0++)J(c[x0],`${o}[${x0}]`)}function E0(c,o){N(c,o);for(let x0=0;x0<c.length;x0++){let s=c[x0],Z0=`${o}[${x0}]`;if(s==null)throw new v(Z0,"AbortSignal",s);i(s,Z0)}}function r(c,o="signal"){if(V(c,o),C0[c]===void 0){if(C0[P(c)]!==void 0)throw new w(c+" (signals must use all capital letters)");throw new w(c)}}var d=k((c,o="buffer")=>{if(!X0(c))throw new v(o,["Buffer","TypedArray","DataView"],c)});function A0(c,o){let x0=b(o),s=c.length;if(x0==="hex"&&s%2!==0)throw new g("encoding",o,`is invalid for data of length ${s}`)}function t(c,o="Port",x0=!0){if(typeof c!=="number"&&typeof c!=="string"||typeof c==="string"&&_(c).length===0||+c!==+c>>>0||c>65535||c===0&&!x0)throw new B(o,c,x0);return c|0}var i=k((c,o)=>{if(c!==void 0&&(c===null||typeof c!=="object"||!("aborted"in c)))throw new v(o,"AbortSignal",c)}),N0=k((c,o)=>{if(typeof c!=="function")throw new v(o,"Function",c)}),y=k((c,o)=>{if(typeof c!=="function"||I0(c))throw new v(o,"Function",c)}),h=k((c,o)=>{if(c!==void 0)throw new v(o,"undefined",c)});function $0(c,o,x0){if(!L(x0,c))throw new v(o,`('${S(x0,"|")}')`,c)}var m=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function a(c,o){if(typeof c>"u"||!D(m,c))throw new g(o,c,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function W0(c){if(typeof c==="string")return a(c,"hints"),c;else if(E(c)){let o=c.length,x0="";if(o===0)return x0;for(let s=0;s<o;s++){let Z0=c[s];if(a(Z0,"hints"),x0+=Z0,s!==o-1)x0+=", "}return x0}throw new g("hints",c,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}I.exports={isInt32:u,isUint32:O0,parseFileMode:X,validateArray:N,validateStringArray:p,validateBooleanArray:n,validateAbortSignalArray:E0,validateBoolean:J,validateBuffer:d,validateDictionary:j,validateEncoding:A0,validateFunction:N0,validateInt32:C,validateInteger:Z,validateNumber:G,validateObject:W,validateOneOf:O,validatePlainFunction:y,validatePort:t,validateSignalName:r,validateString:V,validateUint32:Y,validateUndefined:h,validateUnion:$0,validateAbortSignal:i,validateLinkHeaderValue:W0}}),XO=d0(($,I)=>{I.exports=globalThis.process}),tU=d0(($,I)=>{var{SymbolAsyncIterator:E,SymbolIterator:L,SymbolFor:S}=s0(),K=S("nodejs.stream.destroyed"),Q=S("nodejs.stream.errored"),T=S("nodejs.stream.readable"),M=S("nodejs.stream.writable"),H=S("nodejs.stream.disturbed"),F=S("nodejs.webstream.isClosedPromise"),R=S("nodejs.webstream.controllerErrorFunction");function D(z,W=!1){var j;return!!(z&&typeof z.pipe==="function"&&typeof z.on==="function"&&(!W||typeof z.pause==="function"&&typeof z.resume==="function")&&(!z._writableState||((j=z._readableState)===null||j===void 0?void 0:j.readable)!==!1)&&(!z._writableState||z._readableState))}function q(z){var W;return!!(z&&typeof z.write==="function"&&typeof z.on==="function"&&(!z._readableState||((W=z._writableState)===null||W===void 0?void 0:W.writable)!==!1))}function P(z){return!!(z&&typeof z.pipe==="function"&&z._readableState&&typeof z.on==="function"&&typeof z.write==="function")}function _(z){return z&&(z._readableState||z._writableState||typeof z.write==="function"&&typeof z.on==="function"||typeof z.pipe==="function"&&typeof z.on==="function")}function k(z){return!!(z&&!_(z)&&typeof z.pipeThrough==="function"&&typeof z.getReader==="function"&&typeof z.cancel==="function")}function B(z){return!!(z&&!_(z)&&typeof z.getWriter==="function"&&typeof z.abort==="function")}function v(z){return!!(z&&!_(z)&&typeof z.readable==="object"&&typeof z.writable==="object")}function g(z){return k(z)||B(z)||v(z)}function f(z,W){if(z==null)return!1;if(W===!0)return typeof z[E]==="function";if(W===!1)return typeof z[L]==="function";return typeof z[E]==="function"||typeof z[L]==="function"}function w(z){if(!_(z))return null;let{_writableState:W,_readableState:j}=z,N=W||j;return!!(z.destroyed||z[K]||N!==null&&N!==void 0&&N.destroyed)}function b(z){if(!q(z))return null;if(z.writableEnded===!0)return!0;let W=z._writableState;if(W!==null&&W!==void 0&&W.errored)return!1;if(typeof(W===null||W===void 0?void 0:W.ended)!=="boolean")return null;return W.ended}function I0(z,W){if(!q(z))return null;if(z.writableFinished===!0)return!0;let j=z._writableState;if(j!==null&&j!==void 0&&j.errored)return!1;if(typeof(j===null||j===void 0?void 0:j.finished)!=="boolean")return null;return!!(j.finished||W===!1&&j.ended===!0&&j.length===0)}function X0(z){if(!D(z))return null;if(z.readableEnded===!0)return!0;let W=z._readableState;if(!W||W.errored)return!1;if(typeof(W===null||W===void 0?void 0:W.ended)!=="boolean")return null;return W.ended}function C0(z,W){if(!D(z))return null;let j=z._readableState;if(j!==null&&j!==void 0&&j.errored)return!1;if(typeof(j===null||j===void 0?void 0:j.endEmitted)!=="boolean")return null;return!!(j.endEmitted||W===!1&&j.ended===!0&&j.length===0)}function u(z){if(z&&z[T]!=null)return z[T];if(typeof(z===null||z===void 0?void 0:z.readable)!=="boolean")return null;if(w(z))return!1;return D(z)&&z.readable&&!C0(z)}function O0(z){if(z&&z[M]!=null)return z[M];if(typeof(z===null||z===void 0?void 0:z.writable)!=="boolean")return null;if(w(z))return!1;return q(z)&&z.writable&&!b(z)}function U(z,W){if(!_(z))return null;if(w(z))return!0;if((W===null||W===void 0?void 0:W.readable)!==!1&&u(z))return!1;if((W===null||W===void 0?void 0:W.writable)!==!1&&O0(z))return!1;return!0}function A(z){var W,j;if(!_(z))return null;if(z.writableErrored)return z.writableErrored;return(W=(j=z._writableState)===null||j===void 0?void 0:j.errored)!==null&&W!==void 0?W:null}function X(z){var W,j;if(!_(z))return null;if(z.readableErrored)return z.readableErrored;return(W=(j=z._readableState)===null||j===void 0?void 0:j.errored)!==null&&W!==void 0?W:null}function Z(z){if(!_(z))return null;if(typeof z.closed==="boolean")return z.closed;let{_writableState:W,_readableState:j}=z;if(typeof(W===null||W===void 0?void 0:W.closed)==="boolean"||typeof(j===null||j===void 0?void 0:j.closed)==="boolean")return(W===null||W===void 0?void 0:W.closed)||(j===null||j===void 0?void 0:j.closed);if(typeof z._closed==="boolean"&&C(z))return z._closed;return null}function C(z){return typeof z._closed==="boolean"&&typeof z._defaultKeepAlive==="boolean"&&typeof z._removedConnection==="boolean"&&typeof z._removedContLen==="boolean"}function Y(z){return typeof z._sent100==="boolean"&&C(z)}function V(z){var W;return typeof z._consuming==="boolean"&&typeof z._dumped==="boolean"&&((W=z.req)===null||W===void 0?void 0:W.upgradeOrConnect)===void 0}function G(z){if(!_(z))return null;let{_writableState:W,_readableState:j}=z,N=W||j;return!N&&Y(z)||!!(N&&N.autoDestroy&&N.emitClose&&N.closed===!1)}function O(z){var W;return!!(z&&((W=z[H])!==null&&W!==void 0?W:z.readableDidRead||z.readableAborted))}function J(z){var W,j,N,p,n,E0,r,d,A0,t;return!!(z&&((W=(j=(N=(p=(n=(E0=z[Q])!==null&&E0!==void 0?E0:z.readableErrored)!==null&&n!==void 0?n:z.writableErrored)!==null&&p!==void 0?p:(r=z._readableState)===null||r===void 0?void 0:r.errorEmitted)!==null&&N!==void 0?N:(d=z._writableState)===null||d===void 0?void 0:d.errorEmitted)!==null&&j!==void 0?j:(A0=z._readableState)===null||A0===void 0?void 0:A0.errored)!==null&&W!==void 0?W:(t=z._writableState)===null||t===void 0?void 0:t.errored))}I.exports={isDestroyed:w,kIsDestroyed:K,isDisturbed:O,kIsDisturbed:H,isErrored:J,kIsErrored:Q,isReadable:u,kIsReadable:T,kIsClosedPromise:F,kControllerErrorFunction:R,kIsWritable:M,isClosed:Z,isDuplexNodeStream:P,isFinished:U,isIterable:f,isReadableNodeStream:D,isReadableStream:k,isReadableEnded:X0,isReadableFinished:C0,isReadableErrored:X,isNodeStream:_,isWebStream:g,isWritable:O0,isWritableNodeStream:q,isWritableStream:B,isWritableEnded:b,isWritableFinished:I0,isWritableErrored:A,isServerRequest:V,isServerResponse:Y,willEmitClose:G,isTransformStream:v}}),iU=d0(($,I)=>{var E=XO(),{AbortError:L,codes:S}=TU(),{ERR_INVALID_ARG_TYPE:K,ERR_STREAM_PREMATURE_CLOSE:Q}=S,{kEmptyObject:T,once:M}=_U(),{validateAbortSignal:H,validateFunction:F,validateObject:R,validateBoolean:D}=NO(),{Promise:q,PromisePrototypeThen:P,SymbolDispose:_}=s0(),{isClosed:k,isReadable:B,isReadableNodeStream:v,isReadableStream:g,isReadableFinished:f,isReadableErrored:w,isWritable:b,isWritableNodeStream:I0,isWritableStream:X0,isWritableFinished:C0,isWritableErrored:u,isNodeStream:O0,willEmitClose:U,kIsClosedPromise:A}=tU(),X;function Z(O){return O.setHeader&&typeof O.abort==="function"}var C=()=>{};function Y(O,J,z){var W,j;if(arguments.length===2)z=J,J=T;else if(J==null)J=T;else R(J,"options");if(F(z,"callback"),H(J.signal,"options.signal"),z=M(z),g(O)||X0(O))return V(O,J,z);if(!O0(O))throw new K("stream",["ReadableStream","WritableStream","Stream"],O);let N=(W=J.readable)!==null&&W!==void 0?W:v(O),p=(j=J.writable)!==null&&j!==void 0?j:I0(O),n=O._writableState,E0=O._readableState,r=()=>{if(!O.writable)t()},d=U(O)&&v(O)===N&&I0(O)===p,A0=C0(O,!1),t=()=>{if(A0=!0,O.destroyed)d=!1;if(d&&(!O.readable||N))return;if(!N||i)z.call(O)},i=f(O,!1),N0=()=>{if(i=!0,O.destroyed)d=!1;if(d&&(!O.writable||p))return;if(!p||A0)z.call(O)},y=(c)=>{z.call(O,c)},h=k(O),$0=()=>{h=!0;let c=u(O)||w(O);if(c&&typeof c!=="boolean")return z.call(O,c);if(N&&!i&&v(O,!0)){if(!f(O,!1))return z.call(O,new Q)}if(p&&!A0){if(!C0(O,!1))return z.call(O,new Q)}z.call(O)},m=()=>{h=!0;let c=u(O)||w(O);if(c&&typeof c!=="boolean")return z.call(O,c);z.call(O)},a=()=>{O.req.on("finish",t)};if(Z(O)){if(O.on("complete",t),!d)O.on("abort",$0);if(O.req)a();else O.on("request",a)}else if(p&&!n)O.on("end",r),O.on("close",r);if(!d&&typeof O.aborted==="boolean")O.on("aborted",$0);if(O.on("end",N0),O.on("finish",t),J.error!==!1)O.on("error",y);if(O.on("close",$0),h)E.nextTick($0);else if(n!==null&&n!==void 0&&n.errorEmitted||E0!==null&&E0!==void 0&&E0.errorEmitted){if(!d)E.nextTick(m)}else if(!N&&(!d||B(O))&&(A0||b(O)===!1))E.nextTick(m);else if(!p&&(!d||b(O))&&(i||B(O)===!1))E.nextTick(m);else if(E0&&O.req&&O.aborted)E.nextTick(m);let W0=()=>{if(z=C,O.removeListener("aborted",$0),O.removeListener("complete",t),O.removeListener("abort",$0),O.removeListener("request",a),O.req)O.req.removeListener("finish",t);O.removeListener("end",r),O.removeListener("close",r),O.removeListener("finish",t),O.removeListener("end",N0),O.removeListener("error",y),O.removeListener("close",$0)};if(J.signal&&!h){let c=()=>{let o=z;W0(),o.call(O,new L(void 0,{cause:J.signal.reason}))};if(J.signal.aborted)E.nextTick(c);else{X=X||_U().addAbortListener;let o=X(J.signal,c),x0=z;z=M((...s)=>{o[_](),x0.apply(O,s)})}}return W0}function V(O,J,z){let W=!1,j=C;if(J.signal)if(j=()=>{W=!0,z.call(O,new L(void 0,{cause:J.signal.reason}))},J.signal.aborted)E.nextTick(j);else{X=X||_U().addAbortListener;let p=X(J.signal,j),n=z;z=M((...E0)=>{p[_](),n.apply(O,E0)})}let N=(...p)=>{if(!W)E.nextTick(()=>z.apply(O,p))};return P(O[A].promise,N,N),C}function G(O,J){var z;let W=!1;if(J===null)J=T;if((z=J)!==null&&z!==void 0&&z.cleanup)D(J.cleanup,"cleanup"),W=J.cleanup;return new q((j,N)=>{let p=Y(O,J,(n)=>{if(W)p();if(n)N(n);else j()})})}I.exports=Y,I.exports.finished=G}),HO=d0(($,I)=>{var E=XO(),{aggregateTwoErrors:L,codes:{ERR_MULTIPLE_CALLBACK:S},AbortError:K}=TU(),{Symbol:Q}=s0(),{kIsDestroyed:T,isDestroyed:M,isFinished:H,isServerRequest:F}=tU(),R=Q("kDestroy"),D=Q("kConstruct");function q(U,A,X){if(U){if(U.stack,A&&!A.errored)A.errored=U;if(X&&!X.errored)X.errored=U}}function P(U,A){let X=this._readableState,Z=this._writableState,C=Z||X;if(Z!==null&&Z!==void 0&&Z.destroyed||X!==null&&X!==void 0&&X.destroyed){if(typeof A==="function")A();return this}if(q(U,Z,X),Z)Z.destroyed=!0;if(X)X.destroyed=!0;if(!C.constructed)this.once(R,function(Y){_(this,L(Y,U),A)});else _(this,U,A);return this}function _(U,A,X){let Z=!1;function C(Y){if(Z)return;Z=!0;let{_readableState:V,_writableState:G}=U;if(q(Y,G,V),G)G.closed=!0;if(V)V.closed=!0;if(typeof X==="function")X(Y);if(Y)E.nextTick(k,U,Y);else E.nextTick(B,U)}try{U._destroy(A||null,C)}catch(Y){C(Y)}}function k(U,A){v(U,A),B(U)}function B(U){let{_readableState:A,_writableState:X}=U;if(X)X.closeEmitted=!0;if(A)A.closeEmitted=!0;if(X!==null&&X!==void 0&&X.emitClose||A!==null&&A!==void 0&&A.emitClose)U.emit("close")}function v(U,A){let{_readableState:X,_writableState:Z}=U;if(Z!==null&&Z!==void 0&&Z.errorEmitted||X!==null&&X!==void 0&&X.errorEmitted)return;if(Z)Z.errorEmitted=!0;if(X)X.errorEmitted=!0;U.emit("error",A)}function g(){let U=this._readableState,A=this._writableState;if(U)U.constructed=!0,U.closed=!1,U.closeEmitted=!1,U.destroyed=!1,U.errored=null,U.errorEmitted=!1,U.reading=!1,U.ended=U.readable===!1,U.endEmitted=U.readable===!1;if(A)A.constructed=!0,A.destroyed=!1,A.closed=!1,A.closeEmitted=!1,A.errored=null,A.errorEmitted=!1,A.finalCalled=!1,A.prefinished=!1,A.ended=A.writable===!1,A.ending=A.writable===!1,A.finished=A.writable===!1}function f(U,A,X){let{_readableState:Z,_writableState:C}=U;if(C!==null&&C!==void 0&&C.destroyed||Z!==null&&Z!==void 0&&Z.destroyed)return this;if(Z!==null&&Z!==void 0&&Z.autoDestroy||C!==null&&C!==void 0&&C.autoDestroy)U.destroy(A);else if(A){if(A.stack,C&&!C.errored)C.errored=A;if(Z&&!Z.errored)Z.errored=A;if(X)E.nextTick(v,U,A);else v(U,A)}}function w(U,A){if(typeof U._construct!=="function")return;let{_readableState:X,_writableState:Z}=U;if(X)X.constructed=!1;if(Z)Z.constructed=!1;if(U.once(D,A),U.listenerCount(D)>1)return;E.nextTick(b,U)}function b(U){let A=!1;function X(Z){if(A){f(U,Z!==null&&Z!==void 0?Z:new S);return}A=!0;let{_readableState:C,_writableState:Y}=U,V=Y||C;if(C)C.constructed=!0;if(Y)Y.constructed=!0;if(V.destroyed)U.emit(R,Z);else if(Z)f(U,Z,!0);else E.nextTick(I0,U)}try{U._construct((Z)=>{E.nextTick(X,Z)})}catch(Z){E.nextTick(X,Z)}}function I0(U){U.emit(D)}function X0(U){return(U===null||U===void 0?void 0:U.setHeader)&&typeof U.abort==="function"}function C0(U){U.emit("close")}function u(U,A){U.emit("error",A),E.nextTick(C0,U)}function O0(U,A){if(!U||M(U))return;if(!A&&!H(U))A=new K;if(F(U))U.socket=null,U.destroy(A);else if(X0(U))U.abort();else if(X0(U.req))U.req.abort();else if(typeof U.destroy==="function")U.destroy(A);else if(typeof U.close==="function")U.close();else if(A)E.nextTick(u,U,A);else E.nextTick(C0,U);if(!U.destroyed)U[T]=!0}I.exports={construct:w,destroyer:O0,destroy:P,undestroy:g,errorOrDestroy:f}}),dZ=d0(($,I)=>{var{ArrayIsArray:E,ObjectSetPrototypeOf:L}=s0(),{EventEmitter:S}=(gO(),l0(BO));function K(T){S.call(this,T)}L(K.prototype,S.prototype),L(K,S),K.prototype.pipe=function(T,M){let H=this;function F(B){if(T.writable&&T.write(B)===!1&&H.pause)H.pause()}H.on("data",F);function R(){if(H.readable&&H.resume)H.resume()}if(T.on("drain",R),!T._isStdio&&(!M||M.end!==!1))H.on("end",q),H.on("close",P);let D=!1;function q(){if(D)return;D=!0,T.end()}function P(){if(D)return;if(D=!0,typeof T.destroy==="function")T.destroy()}function _(B){if(k(),S.listenerCount(this,"error")===0)this.emit("error",B)}Q(H,"error",_),Q(T,"error",_);function k(){H.removeListener("data",F),T.removeListener("drain",R),H.removeListener("end",q),H.removeListener("close",P),H.removeListener("error",_),T.removeListener("error",_),H.removeListener("end",k),H.removeListener("close",k),T.removeListener("close",k)}return H.on("end",k),H.on("close",k),T.on("close",k),T.emit("pipe",H),T};function Q(T,M,H){if(typeof T.prependListener==="function")return T.prependListener(M,H);if(!T._events||!T._events[M])T.on(M,H);else if(E(T._events[M]))T._events[M].unshift(H);else T._events[M]=[H,T._events[M]]}I.exports={Stream:K,prependListener:Q}}),eO=d0(($,I)=>{var{SymbolDispose:E}=s0(),{AbortError:L,codes:S}=TU(),{isNodeStream:K,isWebStream:Q,kControllerErrorFunction:T}=tU(),M=iU(),{ERR_INVALID_ARG_TYPE:H}=S,F,R=(D,q)=>{if(typeof D!=="object"||!("aborted"in D))throw new H(q,"AbortSignal",D)};I.exports.addAbortSignal=function(D,q){if(R(D,"signal"),!K(q)&&!Q(q))throw new H("stream",["ReadableStream","WritableStream","Stream"],q);return I.exports.addAbortSignalNoValidate(D,q)},I.exports.addAbortSignalNoValidate=function(D,q){if(typeof D!=="object"||!("aborted"in D))return q;let P=K(q)?()=>{q.destroy(new L(void 0,{cause:D.reason}))}:()=>{q[T](new L(void 0,{cause:D.reason}))};if(D.aborted)P();else{F=F||_U().addAbortListener;let _=F(D,P);M(q,_[E])}return q}}),gQ=d0(($,I)=>{var{StringPrototypeSlice:E,SymbolIterator:L,TypedArrayPrototypeSet:S,Uint8Array:K}=s0(),{Buffer:Q}=(DU(),l0(RU)),{inspect:T}=_U();I.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(M){let H={data:M,next:null};if(this.length>0)this.tail.next=H;else this.head=H;this.tail=H,++this.length}unshift(M){let H={data:M,next:this.head};if(this.length===0)this.tail=H;this.head=H,++this.length}shift(){if(this.length===0)return;let M=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,M}clear(){this.head=this.tail=null,this.length=0}join(M){if(this.length===0)return"";let H=this.head,F=""+H.data;while((H=H.next)!==null)F+=M+H.data;return F}concat(M){if(this.length===0)return Q.alloc(0);let H=Q.allocUnsafe(M>>>0),F=this.head,R=0;while(F)S(H,F.data,R),R+=F.data.length,F=F.next;return H}consume(M,H){let F=this.head.data;if(M<F.length){let R=F.slice(0,M);return this.head.data=F.slice(M),R}if(M===F.length)return this.shift();return H?this._getString(M):this._getBuffer(M)}first(){return this.head.data}*[L](){for(let M=this.head;M;M=M.next)yield M.data}_getString(M){let H="",F=this.head,R=0;do{let D=F.data;if(M>D.length)H+=D,M-=D.length;else{if(M===D.length)if(H+=D,++R,F.next)this.head=F.next;else this.head=this.tail=null;else H+=E(D,0,M),this.head=F,F.data=E(D,M);break}++R}while((F=F.next)!==null);return this.length-=R,H}_getBuffer(M){let H=Q.allocUnsafe(M),F=M,R=this.head,D=0;do{let q=R.data;if(M>q.length)S(H,q,F-M),M-=q.length;else{if(M===q.length)if(S(H,q,F-M),++D,R.next)this.head=R.next;else this.head=this.tail=null;else S(H,new K(q.buffer,q.byteOffset,M),F-M),this.head=R,R.data=q.slice(M);break}++D}while((R=R.next)!==null);return this.length-=D,H}[Symbol.for("nodejs.util.inspect.custom")](M,H){return T(this,{...H,depth:0,customInspect:!1})}}}),aO=d0(($,I)=>{var{MathFloor:E,NumberIsInteger:L}=s0(),{validateInteger:S}=NO(),{ERR_INVALID_ARG_VALUE:K}=TU().codes,Q=16384,T=16;function M(D,q,P){return D.highWaterMark!=null?D.highWaterMark:q?D[P]:null}function H(D){return D?T:Q}function F(D,q){if(S(q,"value",0),D)T=q;else Q=q}function R(D,q,P,_){let k=M(q,_,P);if(k!=null){if(!L(k)||k<0){let B=_?`options.${P}`:"options.highWaterMark";throw new K(B,k)}return E(k)}return H(D.objectMode)}I.exports={getHighWaterMark:R,getDefaultHighWaterMark:H,setDefaultHighWaterMark:F}}),xQ=d0(($,I)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var E=(DU(),l0(RU)),L=E.Buffer;function S(Q,T){for(var M in Q)T[M]=Q[M]}if(L.from&&L.alloc&&L.allocUnsafe&&L.allocUnsafeSlow)I.exports=E;else S(E,$),$.Buffer=K;function K(Q,T,M){return L(Q,T,M)}K.prototype=Object.create(L.prototype),S(L,K),K.from=function(Q,T,M){if(typeof Q==="number")throw TypeError("Argument must not be a number");return L(Q,T,M)},K.alloc=function(Q,T,M){if(typeof Q!=="number")throw TypeError("Argument must be a number");var H=L(Q);if(T!==void 0)if(typeof M==="string")H.fill(T,M);else H.fill(T);else H.fill(0);return H},K.allocUnsafe=function(Q){if(typeof Q!=="number")throw TypeError("Argument must be a number");return L(Q)},K.allocUnsafeSlow=function(Q){if(typeof Q!=="number")throw TypeError("Argument must be a number");return E.SlowBuffer(Q)}}),NQ=d0(($)=>{var I=xQ().Buffer,E=I.isEncoding||function(v){switch(v=""+v,v&&v.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function L(v){if(!v)return"utf8";var g;while(!0)switch(v){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return v;default:if(g)return;v=(""+v).toLowerCase(),g=!0}}function S(v){var g=L(v);if(typeof g!=="string"&&(I.isEncoding===E||!E(v)))throw Error("Unknown encoding: "+v);return g||v}$.StringDecoder=K;function K(v){this.encoding=S(v);var g;switch(this.encoding){case"utf16le":this.text=D,this.end=q,g=4;break;case"utf8":this.fillLast=H,g=4;break;case"base64":this.text=P,this.end=_,g=3;break;default:this.write=k,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=I.allocUnsafe(g)}K.prototype.write=function(v){if(v.length===0)return"";var g,f;if(this.lastNeed){if(g=this.fillLast(v),g===void 0)return"";f=this.lastNeed,this.lastNeed=0}else f=0;if(f<v.length)return g?g+this.text(v,f):this.text(v,f);return g||""},K.prototype.end=R,K.prototype.text=F,K.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function Q(v){if(v<=127)return 0;else if(v>>5===6)return 2;else if(v>>4===14)return 3;else if(v>>3===30)return 4;return v>>6===2?-1:-2}function T(v,g,f){var w=g.length-1;if(w<f)return 0;var b=Q(g[w]);if(b>=0){if(b>0)v.lastNeed=b-1;return b}if(--w<f||b===-2)return 0;if(b=Q(g[w]),b>=0){if(b>0)v.lastNeed=b-2;return b}if(--w<f||b===-2)return 0;if(b=Q(g[w]),b>=0){if(b>0)if(b===2)b=0;else v.lastNeed=b-3;return b}return 0}function M(v,g,f){if((g[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&g.length>2){if((g[2]&192)!==128)return v.lastNeed=2,"�"}}}function H(v){var g=this.lastTotal-this.lastNeed,f=M(this,v,g);if(f!==void 0)return f;if(this.lastNeed<=v.length)return v.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,g,0,v.length),this.lastNeed-=v.length}function F(v,g){var f=T(this,v,g);if(!this.lastNeed)return v.toString("utf8",g);this.lastTotal=f;var w=v.length-(f-this.lastNeed);return v.copy(this.lastChar,0,w),v.toString("utf8",g,w)}function R(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed)return g+"�";return g}function D(v,g){if((v.length-g)%2===0){var f=v.toString("utf16le",g);if(f){var w=f.charCodeAt(f.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],f.slice(0,-1)}return f}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",g,v.length-1)}function q(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed){var f=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,f)}return g}function P(v,g){var f=(v.length-g)%3;if(f===0)return v.toString("base64",g);if(this.lastNeed=3-f,this.lastTotal=3,f===1)this.lastChar[0]=v[v.length-1];else this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1];return v.toString("base64",g,v.length-f)}function _(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed)return g+this.lastChar.toString("base64",0,3-this.lastNeed);return g}function k(v){return v.toString(this.encoding)}function B(v){return v&&v.length?this.write(v):""}}),e$=d0(($,I)=>{var E=XO(),{PromisePrototypeThen:L,SymbolAsyncIterator:S,SymbolIterator:K}=s0(),{Buffer:Q}=(DU(),l0(RU)),{ERR_INVALID_ARG_TYPE:T,ERR_STREAM_NULL_VALUES:M}=TU().codes;function H(F,R,D){let q;if(typeof R==="string"||R instanceof Q)return new F({objectMode:!0,...D,read(){this.push(R),this.push(null)}});let P;if(R&&R[S])P=!0,q=R[S]();else if(R&&R[K])P=!1,q=R[K]();else throw new T("iterable",["Iterable"],R);let _=new F({objectMode:!0,highWaterMark:1,...D}),k=!1;_._read=function(){if(!k)k=!0,v()},_._destroy=function(g,f){L(B(g),()=>E.nextTick(f,g),(w)=>E.nextTick(f,w||g))};async function B(g){let f=g!==void 0&&g!==null,w=typeof q.throw==="function";if(f&&w){let{value:b,done:I0}=await q.throw(g);if(await b,I0)return}if(typeof q.return==="function"){let{value:b}=await q.return();await b}}async function v(){for(;;){try{let{value:g,done:f}=P?await q.next():q.next();if(f)_.push(null);else{let w=g&&typeof g.then==="function"?await g:g;if(w===null)throw k=!1,new M;else if(_.push(w))continue;else k=!1}}catch(g){_.destroy(g)}break}}return _}I.exports=H}),iO=d0(($,I)=>{var E=XO(),{ArrayPrototypeIndexOf:L,NumberIsInteger:S,NumberIsNaN:K,NumberParseInt:Q,ObjectDefineProperties:T,ObjectKeys:M,ObjectSetPrototypeOf:H,Promise:F,SafeSet:R,SymbolAsyncDispose:D,SymbolAsyncIterator:q,Symbol:P}=s0();I.exports=s,s.ReadableState=x0;var{EventEmitter:_}=(gO(),l0(BO)),{Stream:k,prependListener:B}=dZ(),{Buffer:v}=(DU(),l0(RU)),{addAbortSignal:g}=eO(),f=iU(),w=_U().debuglog("stream",(x)=>{w=x}),b=gQ(),I0=HO(),{getHighWaterMark:X0,getDefaultHighWaterMark:C0}=aO(),{aggregateTwoErrors:u,codes:{ERR_INVALID_ARG_TYPE:O0,ERR_METHOD_NOT_IMPLEMENTED:U,ERR_OUT_OF_RANGE:A,ERR_STREAM_PUSH_AFTER_EOF:X,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Z},AbortError:C}=TU(),{validateObject:Y}=NO(),V=P("kPaused"),{StringDecoder:G}=NQ(),O=e$();H(s.prototype,k.prototype),H(s,k);var J=()=>{},{errorOrDestroy:z}=I0,W=1,j=2,N=4,p=8,n=16,E0=32,r=64,d=128,A0=256,t=512,i=1024,N0=2048,y=4096,h=8192,$0=16384,m=32768,a=65536,W0=131072,c=262144;function o(x){return{enumerable:!1,get(){return(this.state&x)!==0},set(l){if(l)this.state|=x;else this.state&=~x}}}T(x0.prototype,{objectMode:o(W),ended:o(j),endEmitted:o(N),reading:o(p),constructed:o(n),sync:o(E0),needReadable:o(r),emittedReadable:o(d),readableListening:o(A0),resumeScheduled:o(t),errorEmitted:o(i),emitClose:o(N0),autoDestroy:o(y),destroyed:o(h),closed:o($0),closeEmitted:o(m),multiAwaitDrain:o(a),readingMore:o(W0),dataEmitted:o(c)});function x0(x,l,e){if(typeof e!=="boolean")e=l instanceof nU();if(this.state=N0|y|n|E0,x&&x.objectMode)this.state|=W;if(e&&x&&x.readableObjectMode)this.state|=W;if(this.highWaterMark=x?X0(this,x,"readableHighWaterMark",e):C0(!1),this.buffer=new b,this.length=0,this.pipes=[],this.flowing=null,this[V]=null,x&&x.emitClose===!1)this.state&=~N0;if(x&&x.autoDestroy===!1)this.state&=~y;if(this.errored=null,this.defaultEncoding=x&&x.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,x&&x.encoding)this.decoder=new G(x.encoding),this.encoding=x.encoding}function s(x){if(!(this instanceof s))return new s(x);let l=this instanceof nU();if(this._readableState=new x0(x,this,l),x){if(typeof x.read==="function")this._read=x.read;if(typeof x.destroy==="function")this._destroy=x.destroy;if(typeof x.construct==="function")this._construct=x.construct;if(x.signal&&!l)g(x.signal,this)}k.call(this,x),I0.construct(this,()=>{if(this._readableState.needReadable)K0(this,this._readableState)})}s.prototype.destroy=I0.destroy,s.prototype._undestroy=I0.undestroy,s.prototype._destroy=function(x,l){l(x)},s.prototype[_.captureRejectionSymbol]=function(x){this.destroy(x)},s.prototype[D]=function(){let x;if(!this.destroyed)x=this.readableEnded?null:new C,this.destroy(x);return new F((l,e)=>f(this,(U0)=>U0&&U0!==x?e(U0):l(null)))},s.prototype.push=function(x,l){return Z0(this,x,l,!1)},s.prototype.unshift=function(x,l){return Z0(this,x,l,!0)};function Z0(x,l,e,U0){w("readableAddChunk",l);let f0=x._readableState,Y0;if((f0.state&W)===0){if(typeof l==="string"){if(e=e||f0.defaultEncoding,f0.encoding!==e)if(U0&&f0.encoding)l=v.from(l,e).toString(f0.encoding);else l=v.from(l,e),e=""}else if(l instanceof v)e="";else if(k._isUint8Array(l))l=k._uint8ArrayToBuffer(l),e="";else if(l!=null)Y0=new O0("chunk",["string","Buffer","Uint8Array"],l)}if(Y0)z(x,Y0);else if(l===null)f0.state&=~p,J0(x,f0);else if((f0.state&W)!==0||l&&l.length>0)if(U0)if((f0.state&N)!==0)z(x,new Z);else if(f0.destroyed||f0.errored)return!1;else w0(x,f0,l,!0);else if(f0.ended)z(x,new X);else if(f0.destroyed||f0.errored)return!1;else if(f0.state&=~p,f0.decoder&&!e)if(l=f0.decoder.write(l),f0.objectMode||l.length!==0)w0(x,f0,l,!1);else K0(x,f0);else w0(x,f0,l,!1);else if(!U0)f0.state&=~p,K0(x,f0);return!f0.ended&&(f0.length<f0.highWaterMark||f0.length===0)}function w0(x,l,e,U0){if(l.flowing&&l.length===0&&!l.sync&&x.listenerCount("data")>0){if((l.state&a)!==0)l.awaitDrainWriters.clear();else l.awaitDrainWriters=null;l.dataEmitted=!0,x.emit("data",e)}else{if(l.length+=l.objectMode?1:e.length,U0)l.buffer.unshift(e);else l.buffer.push(e);if((l.state&r)!==0)L0(x)}K0(x,l)}s.prototype.isPaused=function(){let x=this._readableState;return x[V]===!0||x.flowing===!1},s.prototype.setEncoding=function(x){let l=new G(x);this._readableState.decoder=l,this._readableState.encoding=this._readableState.decoder.encoding;let e=this._readableState.buffer,U0="";for(let f0 of e)U0+=l.write(f0);if(e.clear(),U0!=="")e.push(U0);return this._readableState.length=U0.length,this};var S0=1073741824;function V0(x){if(x>S0)throw new A("size","<= 1GiB",x);else x--,x|=x>>>1,x|=x>>>2,x|=x>>>4,x|=x>>>8,x|=x>>>16,x++;return x}function m0(x,l){if(x<=0||l.length===0&&l.ended)return 0;if((l.state&W)!==0)return 1;if(K(x)){if(l.flowing&&l.length)return l.buffer.first().length;return l.length}if(x<=l.length)return x;return l.ended?l.length:0}s.prototype.read=function(x){if(w("read",x),x===void 0)x=NaN;else if(!S(x))x=Q(x,10);let l=this._readableState,e=x;if(x>l.highWaterMark)l.highWaterMark=V0(x);if(x!==0)l.state&=~d;if(x===0&&l.needReadable&&((l.highWaterMark!==0?l.length>=l.highWaterMark:l.length>0)||l.ended)){if(w("read: emitReadable",l.length,l.ended),l.length===0&&l.ended)SU(this);else L0(this);return null}if(x=m0(x,l),x===0&&l.ended){if(l.length===0)SU(this);return null}let U0=(l.state&r)!==0;if(w("need readable",U0),l.length===0||l.length-x<l.highWaterMark)U0=!0,w("length less than watermark",U0);if(l.ended||l.reading||l.destroyed||l.errored||!l.constructed)U0=!1,w("reading, ended or constructing",U0);else if(U0){if(w("do read"),l.state|=p|E0,l.length===0)l.state|=r;try{this._read(l.highWaterMark)}catch(Y0){z(this,Y0)}if(l.state&=~E0,!l.reading)x=m0(e,l)}let f0;if(x>0)f0=z0(x,l);else f0=null;if(f0===null)l.needReadable=l.length<=l.highWaterMark,x=0;else if(l.length-=x,l.multiAwaitDrain)l.awaitDrainWriters.clear();else l.awaitDrainWriters=null;if(l.length===0){if(!l.ended)l.needReadable=!0;if(e!==x&&l.ended)SU(this)}if(f0!==null&&!l.errorEmitted&&!l.closeEmitted)l.dataEmitted=!0,this.emit("data",f0);return f0};function J0(x,l){if(w("onEofChunk"),l.ended)return;if(l.decoder){let e=l.decoder.end();if(e&&e.length)l.buffer.push(e),l.length+=l.objectMode?1:e.length}if(l.ended=!0,l.sync)L0(x);else l.needReadable=!1,l.emittedReadable=!0,a0(x)}function L0(x){let l=x._readableState;if(w("emitReadable",l.needReadable,l.emittedReadable),l.needReadable=!1,!l.emittedReadable)w("emitReadable",l.flowing),l.emittedReadable=!0,E.nextTick(a0,x)}function a0(x){let l=x._readableState;if(w("emitReadable_",l.destroyed,l.length,l.ended),!l.destroyed&&!l.errored&&(l.length||l.ended))x.emit("readable"),l.emittedReadable=!1;l.needReadable=!l.flowing&&!l.ended&&l.length<=l.highWaterMark,M0(x)}function K0(x,l){if(!l.readingMore&&l.constructed)l.readingMore=!0,E.nextTick(D0,x,l)}function D0(x,l){while(!l.reading&&!l.ended&&(l.length<l.highWaterMark||l.flowing&&l.length===0)){let e=l.length;if(w("maybeReadMore read 0"),x.read(0),e===l.length)break}l.readingMore=!1}s.prototype._read=function(x){throw new U("_read()")},s.prototype.pipe=function(x,l){let e=this,U0=this._readableState;if(U0.pipes.length===1){if(!U0.multiAwaitDrain)U0.multiAwaitDrain=!0,U0.awaitDrainWriters=new R(U0.awaitDrainWriters?[U0.awaitDrainWriters]:[])}U0.pipes.push(x),w("pipe count=%d opts=%j",U0.pipes.length,l);let f0=(!l||l.end!==!1)&&x!==E.stdout&&x!==E.stderr?R0:y0;if(U0.endEmitted)E.nextTick(f0);else e.once("end",f0);x.on("unpipe",Y0);function Y0(o0,b0){if(w("onunpipe"),o0===e){if(b0&&b0.hasUnpiped===!1)b0.hasUnpiped=!0,g0()}}function R0(){w("onend"),x.end()}let r0,q0=!1;function g0(){if(w("cleanup"),x.removeListener("close",e0),x.removeListener("finish",c0),r0)x.removeListener("drain",r0);if(x.removeListener("error",H0),x.removeListener("unpipe",Y0),e.removeListener("end",R0),e.removeListener("end",y0),e.removeListener("data",P0),q0=!0,r0&&U0.awaitDrainWriters&&(!x._writableState||x._writableState.needDrain))r0()}function HU(){if(!q0){if(U0.pipes.length===1&&U0.pipes[0]===x)w("false write response, pause",0),U0.awaitDrainWriters=x,U0.multiAwaitDrain=!1;else if(U0.pipes.length>1&&U0.pipes.includes(x))w("false write response, pause",U0.awaitDrainWriters.size),U0.awaitDrainWriters.add(x);e.pause()}if(!r0)r0=WU(e,x),x.on("drain",r0)}e.on("data",P0);function P0(o0){w("ondata");let b0=x.write(o0);if(w("dest.write",b0),b0===!1)HU()}function H0(o0){if(w("onerror",o0),y0(),x.removeListener("error",H0),x.listenerCount("error")===0){let b0=x._writableState||x._readableState;if(b0&&!b0.errorEmitted)z(x,o0);else x.emit("error",o0)}}B(x,"error",H0);function e0(){x.removeListener("finish",c0),y0()}x.once("close",e0);function c0(){w("onfinish"),x.removeListener("close",e0),y0()}x.once("finish",c0);function y0(){w("unpipe"),e.unpipe(x)}if(x.emit("pipe",e),x.writableNeedDrain===!0)HU();else if(!U0.flowing)w("pipe resume"),e.resume();return x};function WU(x,l){return function(){let e=x._readableState;if(e.awaitDrainWriters===l)w("pipeOnDrain",1),e.awaitDrainWriters=null;else if(e.multiAwaitDrain)w("pipeOnDrain",e.awaitDrainWriters.size),e.awaitDrainWriters.delete(l);if((!e.awaitDrainWriters||e.awaitDrainWriters.size===0)&&x.listenerCount("data"))x.resume()}}s.prototype.unpipe=function(x){let l=this._readableState,e={hasUnpiped:!1};if(l.pipes.length===0)return this;if(!x){let f0=l.pipes;l.pipes=[],this.pause();for(let Y0=0;Y0<f0.length;Y0++)f0[Y0].emit("unpipe",this,{hasUnpiped:!1});return this}let U0=L(l.pipes,x);if(U0===-1)return this;if(l.pipes.splice(U0,1),l.pipes.length===0)this.pause();return x.emit("unpipe",this,e),this},s.prototype.on=function(x,l){let e=k.prototype.on.call(this,x,l),U0=this._readableState;if(x==="data"){if(U0.readableListening=this.listenerCount("readable")>0,U0.flowing!==!1)this.resume()}else if(x==="readable"){if(!U0.endEmitted&&!U0.readableListening){if(U0.readableListening=U0.needReadable=!0,U0.flowing=!1,U0.emittedReadable=!1,w("on readable",U0.length,U0.reading),U0.length)L0(this);else if(!U0.reading)E.nextTick(k0,this)}}return e},s.prototype.addListener=s.prototype.on,s.prototype.removeListener=function(x,l){let e=k.prototype.removeListener.call(this,x,l);if(x==="readable")E.nextTick(F0,this);return e},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(x){let l=k.prototype.removeAllListeners.apply(this,arguments);if(x==="readable"||x===void 0)E.nextTick(F0,this);return l};function F0(x){let l=x._readableState;if(l.readableListening=x.listenerCount("readable")>0,l.resumeScheduled&&l[V]===!1)l.flowing=!0;else if(x.listenerCount("data")>0)x.resume();else if(!l.readableListening)l.flowing=null}function k0(x){w("readable nexttick read 0"),x.read(0)}s.prototype.resume=function(){let x=this._readableState;if(!x.flowing)w("resume"),x.flowing=!x.readableListening,FU(this,x);return x[V]=!1,this};function FU(x,l){if(!l.resumeScheduled)l.resumeScheduled=!0,E.nextTick(_0,x,l)}function _0(x,l){if(w("resume",l.reading),!l.reading)x.read(0);if(l.resumeScheduled=!1,x.emit("resume"),M0(x),l.flowing&&!l.reading)x.read(0)}s.prototype.pause=function(){if(w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)w("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[V]=!0,this};function M0(x){let l=x._readableState;w("flow",l.flowing);while(l.flowing&&x.read()!==null);}s.prototype.wrap=function(x){let l=!1;x.on("data",(U0)=>{if(!this.push(U0)&&x.pause)l=!0,x.pause()}),x.on("end",()=>{this.push(null)}),x.on("error",(U0)=>{z(this,U0)}),x.on("close",()=>{this.destroy()}),x.on("destroy",()=>{this.destroy()}),this._read=()=>{if(l&&x.resume)l=!1,x.resume()};let e=M(x);for(let U0=1;U0<e.length;U0++){let f0=e[U0];if(this[f0]===void 0&&typeof x[f0]==="function")this[f0]=x[f0].bind(x)}return this},s.prototype[q]=function(){return KU(this)},s.prototype.iterator=function(x){if(x!==void 0)Y(x,"options");return KU(this,x)};function KU(x,l){if(typeof x.read!=="function")x=s.wrap(x,{objectMode:!0});let e=j0(x,l);return e.stream=x,e}async function*j0(x,l){let e=J;function U0(R0){if(this===x)e(),e=J;else e=R0}x.on("readable",U0);let f0,Y0=f(x,{writable:!1},(R0)=>{f0=R0?u(f0,R0):null,e(),e=J});try{while(!0){let R0=x.destroyed?null:x.read();if(R0!==null)yield R0;else if(f0)throw f0;else if(f0===null)return;else await new F(U0)}}catch(R0){throw f0=u(f0,R0),f0}finally{if((f0||(l===null||l===void 0?void 0:l.destroyOnReturn)!==!1)&&(f0===void 0||x._readableState.autoDestroy))I0.destroyer(x,null);else x.off("readable",U0),Y0()}}T(s.prototype,{readable:{__proto__:null,get(){let x=this._readableState;return!!x&&x.readable!==!1&&!x.destroyed&&!x.errorEmitted&&!x.endEmitted},set(x){if(this._readableState)this._readableState.readable=!!x}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(x){if(this._readableState)this._readableState.flowing=x}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(x){if(!this._readableState)return;this._readableState.destroyed=x}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),T(x0.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[V]!==!1},set(x){this[V]=!!x}}}),s._fromList=z0;function z0(x,l){if(l.length===0)return null;let e;if(l.objectMode)e=l.buffer.shift();else if(!x||x>=l.length){if(l.decoder)e=l.buffer.join("");else if(l.buffer.length===1)e=l.buffer.first();else e=l.buffer.concat(l.length);l.buffer.clear()}else e=l.buffer.consume(x,l.decoder);return e}function SU(x){let l=x._readableState;if(w("endReadable",l.endEmitted),!l.endEmitted)l.ended=!0,E.nextTick(v0,l,x)}function v0(x,l){if(w("endReadableNT",x.endEmitted,x.length),!x.errored&&!x.closeEmitted&&!x.endEmitted&&x.length===0){if(x.endEmitted=!0,l.emit("end"),l.writable&&l.allowHalfOpen===!1)E.nextTick(B0,l);else if(x.autoDestroy){let e=l._writableState;if(!e||e.autoDestroy&&(e.finished||e.writable===!1))l.destroy()}}}function B0(x){if(x.writable&&!x.writableEnded&&!x.destroyed)x.end()}s.from=function(x,l){return O(s,x,l)};var VU;function T0(){if(VU===void 0)VU={};return VU}s.fromWeb=function(x,l){return T0().newStreamReadableFromReadableStream(x,l)},s.toWeb=function(x,l){return T0().newReadableStreamFromStreamReadable(x,l)},s.wrap=function(x,l){var e,U0;return new s({objectMode:(e=(U0=x.readableObjectMode)!==null&&U0!==void 0?U0:x.objectMode)!==null&&e!==void 0?e:!0,...l,destroy(f0,Y0){I0.destroyer(x,f0),Y0(f0)}}).wrap(x)}}),bZ=d0(($,I)=>{var E=XO(),{ArrayPrototypeSlice:L,Error:S,FunctionPrototypeSymbolHasInstance:K,ObjectDefineProperty:Q,ObjectDefineProperties:T,ObjectSetPrototypeOf:M,StringPrototypeToLowerCase:H,Symbol:F,SymbolHasInstance:R}=s0();I.exports=Y,Y.WritableState=Z;var{EventEmitter:D}=(gO(),l0(BO)),q=dZ().Stream,{Buffer:P}=(DU(),l0(RU)),_=HO(),{addAbortSignal:k}=eO(),{getHighWaterMark:B,getDefaultHighWaterMark:v}=aO(),{ERR_INVALID_ARG_TYPE:g,ERR_METHOD_NOT_IMPLEMENTED:f,ERR_MULTIPLE_CALLBACK:w,ERR_STREAM_CANNOT_PIPE:b,ERR_STREAM_DESTROYED:I0,ERR_STREAM_ALREADY_FINISHED:X0,ERR_STREAM_NULL_VALUES:C0,ERR_STREAM_WRITE_AFTER_END:u,ERR_UNKNOWN_ENCODING:O0}=TU().codes,{errorOrDestroy:U}=_;M(Y.prototype,q.prototype),M(Y,q);function A(){}var X=F("kOnFinished");function Z(y,h,$0){if(typeof $0!=="boolean")$0=h instanceof nU();if(this.objectMode=!!(y&&y.objectMode),$0)this.objectMode=this.objectMode||!!(y&&y.writableObjectMode);this.highWaterMark=y?B(this,y,"writableHighWaterMark",$0):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let m=!!(y&&y.decodeStrings===!1);this.decodeStrings=!m,this.defaultEncoding=y&&y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=z.bind(void 0,h),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,C(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!y||y.emitClose!==!1,this.autoDestroy=!y||y.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[X]=[]}function C(y){y.buffered=[],y.bufferedIndex=0,y.allBuffers=!0,y.allNoop=!0}Z.prototype.getBuffer=function(){return L(this.buffered,this.bufferedIndex)},Q(Z.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Y(y){let h=this instanceof nU();if(!h&&!K(Y,this))return new Y(y);if(this._writableState=new Z(y,this,h),y){if(typeof y.write==="function")this._write=y.write;if(typeof y.writev==="function")this._writev=y.writev;if(typeof y.destroy==="function")this._destroy=y.destroy;if(typeof y.final==="function")this._final=y.final;if(typeof y.construct==="function")this._construct=y.construct;if(y.signal)k(y.signal,this)}q.call(this,y),_.construct(this,()=>{let $0=this._writableState;if(!$0.writing)p(this,$0);d(this,$0)})}Q(Y,R,{__proto__:null,value:function(y){if(K(this,y))return!0;if(this!==Y)return!1;return y&&y._writableState instanceof Z}}),Y.prototype.pipe=function(){U(this,new b)};function V(y,h,$0,m){let a=y._writableState;if(typeof $0==="function")m=$0,$0=a.defaultEncoding;else{if(!$0)$0=a.defaultEncoding;else if($0!=="buffer"&&!P.isEncoding($0))throw new O0($0);if(typeof m!=="function")m=A}if(h===null)throw new C0;else if(!a.objectMode)if(typeof h==="string"){if(a.decodeStrings!==!1)h=P.from(h,$0),$0="buffer"}else if(h instanceof P)$0="buffer";else if(q._isUint8Array(h))h=q._uint8ArrayToBuffer(h),$0="buffer";else throw new g("chunk",["string","Buffer","Uint8Array"],h);let W0;if(a.ending)W0=new u;else if(a.destroyed)W0=new I0("write");if(W0)return E.nextTick(m,W0),U(y,W0,!0),W0;return a.pendingcb++,G(y,a,h,$0,m)}Y.prototype.write=function(y,h,$0){return V(this,y,h,$0)===!0},Y.prototype.cork=function(){this._writableState.corked++},Y.prototype.uncork=function(){let y=this._writableState;if(y.corked){if(y.corked--,!y.writing)p(this,y)}},Y.prototype.setDefaultEncoding=function(y){if(typeof y==="string")y=H(y);if(!P.isEncoding(y))throw new O0(y);return this._writableState.defaultEncoding=y,this};function G(y,h,$0,m,a){let W0=h.objectMode?1:$0.length;h.length+=W0;let c=h.length<h.highWaterMark;if(!c)h.needDrain=!0;if(h.writing||h.corked||h.errored||!h.constructed){if(h.buffered.push({chunk:$0,encoding:m,callback:a}),h.allBuffers&&m!=="buffer")h.allBuffers=!1;if(h.allNoop&&a!==A)h.allNoop=!1}else h.writelen=W0,h.writecb=a,h.writing=!0,h.sync=!0,y._write($0,m,h.onwrite),h.sync=!1;return c&&!h.errored&&!h.destroyed}function O(y,h,$0,m,a,W0,c){if(h.writelen=m,h.writecb=c,h.writing=!0,h.sync=!0,h.destroyed)h.onwrite(new I0("write"));else if($0)y._writev(a,h.onwrite);else y._write(a,W0,h.onwrite);h.sync=!1}function J(y,h,$0,m){--h.pendingcb,m($0),N(h),U(y,$0)}function z(y,h){let $0=y._writableState,m=$0.sync,a=$0.writecb;if(typeof a!=="function"){U(y,new w);return}if($0.writing=!1,$0.writecb=null,$0.length-=$0.writelen,$0.writelen=0,h){if(h.stack,!$0.errored)$0.errored=h;if(y._readableState&&!y._readableState.errored)y._readableState.errored=h;if(m)E.nextTick(J,y,$0,h,a);else J(y,$0,h,a)}else{if($0.buffered.length>$0.bufferedIndex)p(y,$0);if(m)if($0.afterWriteTickInfo!==null&&$0.afterWriteTickInfo.cb===a)$0.afterWriteTickInfo.count++;else $0.afterWriteTickInfo={count:1,cb:a,stream:y,state:$0},E.nextTick(W,$0.afterWriteTickInfo);else j(y,$0,1,a)}}function W({stream:y,state:h,count:$0,cb:m}){return h.afterWriteTickInfo=null,j(y,h,$0,m)}function j(y,h,$0,m){if(!h.ending&&!y.destroyed&&h.length===0&&h.needDrain)h.needDrain=!1,y.emit("drain");while($0-- >0)h.pendingcb--,m();if(h.destroyed)N(h);d(y,h)}function N(y){if(y.writing)return;for(let a=y.bufferedIndex;a<y.buffered.length;++a){var h;let{chunk:W0,callback:c}=y.buffered[a],o=y.objectMode?1:W0.length;y.length-=o,c((h=y.errored)!==null&&h!==void 0?h:new I0("write"))}let $0=y[X].splice(0);for(let a=0;a<$0.length;a++){var m;$0[a]((m=y.errored)!==null&&m!==void 0?m:new I0("end"))}C(y)}function p(y,h){if(h.corked||h.bufferProcessing||h.destroyed||!h.constructed)return;let{buffered:$0,bufferedIndex:m,objectMode:a}=h,W0=$0.length-m;if(!W0)return;let c=m;if(h.bufferProcessing=!0,W0>1&&y._writev){h.pendingcb-=W0-1;let o=h.allNoop?A:(s)=>{for(let Z0=c;Z0<$0.length;++Z0)$0[Z0].callback(s)},x0=h.allNoop&&c===0?$0:L($0,c);x0.allBuffers=h.allBuffers,O(y,h,!0,h.length,x0,"",o),C(h)}else{do{let{chunk:o,encoding:x0,callback:s}=$0[c];$0[c++]=null;let Z0=a?1:o.length;O(y,h,!1,Z0,o,x0,s)}while(c<$0.length&&!h.writing);if(c===$0.length)C(h);else if(c>256)$0.splice(0,c),h.bufferedIndex=0;else h.bufferedIndex=c}h.bufferProcessing=!1}Y.prototype._write=function(y,h,$0){if(this._writev)this._writev([{chunk:y,encoding:h}],$0);else throw new f("_write()")},Y.prototype._writev=null,Y.prototype.end=function(y,h,$0){let m=this._writableState;if(typeof y==="function")$0=y,y=null,h=null;else if(typeof h==="function")$0=h,h=null;let a;if(y!==null&&y!==void 0){let W0=V(this,y,h);if(W0 instanceof S)a=W0}if(m.corked)m.corked=1,this.uncork();if(a);else if(!m.errored&&!m.ending)m.ending=!0,d(this,m,!0),m.ended=!0;else if(m.finished)a=new X0("end");else if(m.destroyed)a=new I0("end");if(typeof $0==="function")if(a||m.finished)E.nextTick($0,a);else m[X].push($0);return this};function n(y){return y.ending&&!y.destroyed&&y.constructed&&y.length===0&&!y.errored&&y.buffered.length===0&&!y.finished&&!y.writing&&!y.errorEmitted&&!y.closeEmitted}function E0(y,h){let $0=!1;function m(a){if($0){U(y,a!==null&&a!==void 0?a:w());return}if($0=!0,h.pendingcb--,a){let W0=h[X].splice(0);for(let c=0;c<W0.length;c++)W0[c](a);U(y,a,h.sync)}else if(n(h))h.prefinished=!0,y.emit("prefinish"),h.pendingcb++,E.nextTick(A0,y,h)}h.sync=!0,h.pendingcb++;try{y._final(m)}catch(a){m(a)}h.sync=!1}function r(y,h){if(!h.prefinished&&!h.finalCalled)if(typeof y._final==="function"&&!h.destroyed)h.finalCalled=!0,E0(y,h);else h.prefinished=!0,y.emit("prefinish")}function d(y,h,$0){if(n(h)){if(r(y,h),h.pendingcb===0){if($0)h.pendingcb++,E.nextTick((m,a)=>{if(n(a))A0(m,a);else a.pendingcb--},y,h);else if(n(h))h.pendingcb++,A0(y,h)}}}function A0(y,h){h.pendingcb--,h.finished=!0;let $0=h[X].splice(0);for(let m=0;m<$0.length;m++)$0[m]();if(y.emit("finish"),h.autoDestroy){let m=y._readableState;if(!m||m.autoDestroy&&(m.endEmitted||m.readable===!1))y.destroy()}}T(Y.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(y){if(this._writableState)this._writableState.destroyed=y}},writable:{__proto__:null,get(){let y=this._writableState;return!!y&&y.writable!==!1&&!y.destroyed&&!y.errored&&!y.ending&&!y.ended},set(y){if(this._writableState)this._writableState.writable=!!y}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let y=this._writableState;if(!y)return!1;return!y.destroyed&&!y.ending&&y.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var t=_.destroy;Y.prototype.destroy=function(y,h){let $0=this._writableState;if(!$0.destroyed&&($0.bufferedIndex<$0.buffered.length||$0[X].length))E.nextTick(N,$0);return t.call(this,y,h),this},Y.prototype._undestroy=_.undestroy,Y.prototype._destroy=function(y,h){h(y)},Y.prototype[D.captureRejectionSymbol]=function(y){this.destroy(y)};var i;function N0(){if(i===void 0)i={};return i}Y.fromWeb=function(y,h){return N0().newStreamWritableFromWritableStream(y,h)},Y.toWeb=function(y){return N0().newWritableStreamFromStreamWritable(y)}}),fQ=d0(($,I)=>{var E=XO(),L=(DU(),l0(RU)),{isReadable:S,isWritable:K,isIterable:Q,isNodeStream:T,isReadableNodeStream:M,isWritableNodeStream:H,isDuplexNodeStream:F,isReadableStream:R,isWritableStream:D}=tU(),q=iU(),{AbortError:P,codes:{ERR_INVALID_ARG_TYPE:_,ERR_INVALID_RETURN_VALUE:k}}=TU(),{destroyer:B}=HO(),v=nU(),g=iO(),f=bZ(),{createDeferredPromise:w}=_U(),b=e$(),I0=globalThis.Blob||L.Blob,X0=typeof I0<"u"?function(X){return X instanceof I0}:function(X){return!1},C0=globalThis.AbortController||xO().AbortController,{FunctionPrototypeCall:u}=s0();class O0 extends v{constructor(X){super(X);if((X===null||X===void 0?void 0:X.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((X===null||X===void 0?void 0:X.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}I.exports=function X(Z,C){if(F(Z))return Z;if(M(Z))return A({readable:Z});if(H(Z))return A({writable:Z});if(T(Z))return A({writable:!1,readable:!1});if(R(Z))return A({readable:g.fromWeb(Z)});if(D(Z))return A({writable:f.fromWeb(Z)});if(typeof Z==="function"){let{value:V,write:G,final:O,destroy:J}=U(Z);if(Q(V))return b(O0,V,{objectMode:!0,write:G,final:O,destroy:J});let z=V===null||V===void 0?void 0:V.then;if(typeof z==="function"){let W,j=u(z,V,(N)=>{if(N!=null)throw new k("nully","body",N)},(N)=>{B(W,N)});return W=new O0({objectMode:!0,readable:!1,write:G,final(N){O(async()=>{try{await j,E.nextTick(N,null)}catch(p){E.nextTick(N,p)}})},destroy:J})}throw new k("Iterable, AsyncIterable or AsyncFunction",C,V)}if(X0(Z))return X(Z.arrayBuffer());if(Q(Z))return b(O0,Z,{objectMode:!0,writable:!1});if(R(Z===null||Z===void 0?void 0:Z.readable)&&D(Z===null||Z===void 0?void 0:Z.writable))return O0.fromWeb(Z);if(typeof(Z===null||Z===void 0?void 0:Z.writable)==="object"||typeof(Z===null||Z===void 0?void 0:Z.readable)==="object"){let V=Z!==null&&Z!==void 0&&Z.readable?M(Z===null||Z===void 0?void 0:Z.readable)?Z===null||Z===void 0?void 0:Z.readable:X(Z.readable):void 0,G=Z!==null&&Z!==void 0&&Z.writable?H(Z===null||Z===void 0?void 0:Z.writable)?Z===null||Z===void 0?void 0:Z.writable:X(Z.writable):void 0;return A({readable:V,writable:G})}let Y=Z===null||Z===void 0?void 0:Z.then;if(typeof Y==="function"){let V;return u(Y,Z,(G)=>{if(G!=null)V.push(G);V.push(null)},(G)=>{B(V,G)}),V=new O0({objectMode:!0,writable:!1,read(){}})}throw new _(C,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],Z)};function U(X){let{promise:Z,resolve:C}=w(),Y=new C0,V=Y.signal;return{value:X(async function*(){while(!0){let G=Z;Z=null;let{chunk:O,done:J,cb:z}=await G;if(E.nextTick(z),J)return;if(V.aborted)throw new P(void 0,{cause:V.reason});({promise:Z,resolve:C}=w()),yield O}}(),{signal:V}),write(G,O,J){let z=C;C=null,z({chunk:G,done:!1,cb:J})},final(G){let O=C;C=null,O({done:!0,cb:G})},destroy(G,O){Y.abort(),O(G)}}}function A(X){let Z=X.readable&&typeof X.readable.read!=="function"?g.wrap(X.readable):X.readable,C=X.writable,Y=!!S(Z),V=!!K(C),G,O,J,z,W;function j(N){let p=z;if(z=null,p)p(N);else if(N)W.destroy(N)}if(W=new O0({readableObjectMode:!!(Z!==null&&Z!==void 0&&Z.readableObjectMode),writableObjectMode:!!(C!==null&&C!==void 0&&C.writableObjectMode),readable:Y,writable:V}),V)q(C,(N)=>{if(V=!1,N)B(Z,N);j(N)}),W._write=function(N,p,n){if(C.write(N,p))n();else G=n},W._final=function(N){C.end(),O=N},C.on("drain",function(){if(G){let N=G;G=null,N()}}),C.on("finish",function(){if(O){let N=O;O=null,N()}});if(Y)q(Z,(N)=>{if(Y=!1,N)B(Z,N);j(N)}),Z.on("readable",function(){if(J){let N=J;J=null,N()}}),Z.on("end",function(){W.push(null)}),W._read=function(){while(!0){let N=Z.read();if(N===null){J=W._read;return}if(!W.push(N))return}};return W._destroy=function(N,p){if(!N&&z!==null)N=new P;if(J=null,G=null,O=null,z===null)p(N);else z=p,B(C,N),B(Z,N)},W}}),nU=d0(($,I)=>{var{ObjectDefineProperties:E,ObjectGetOwnPropertyDescriptor:L,ObjectKeys:S,ObjectSetPrototypeOf:K}=s0();I.exports=M;var Q=iO(),T=bZ();K(M.prototype,Q.prototype),K(M,Q);{let D=S(T.prototype);for(let q=0;q<D.length;q++){let P=D[q];if(!M.prototype[P])M.prototype[P]=T.prototype[P]}}function M(D){if(!(this instanceof M))return new M(D);if(Q.call(this,D),T.call(this,D),D){if(this.allowHalfOpen=D.allowHalfOpen!==!1,D.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(D.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}E(M.prototype,{writable:{__proto__:null,...L(T.prototype,"writable")},writableHighWaterMark:{__proto__:null,...L(T.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...L(T.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...L(T.prototype,"writableBuffer")},writableLength:{__proto__:null,...L(T.prototype,"writableLength")},writableFinished:{__proto__:null,...L(T.prototype,"writableFinished")},writableCorked:{__proto__:null,...L(T.prototype,"writableCorked")},writableEnded:{__proto__:null,...L(T.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...L(T.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(D){if(this._readableState&&this._writableState)this._readableState.destroyed=D,this._writableState.destroyed=D}}});var H;function F(){if(H===void 0)H={};return H}M.fromWeb=function(D,q){return F().newStreamDuplexFromReadableWritablePair(D,q)},M.toWeb=function(D){return F().newReadableWritablePairFromDuplex(D)};var R;M.from=function(D){if(!R)R=fQ();return R(D,"body")}}),a$=d0(($,I)=>{var{ObjectSetPrototypeOf:E,Symbol:L}=s0();I.exports=M;var{ERR_METHOD_NOT_IMPLEMENTED:S}=TU().codes,K=nU(),{getHighWaterMark:Q}=aO();E(M.prototype,K.prototype),E(M,K);var T=L("kCallback");function M(R){if(!(this instanceof M))return new M(R);let D=R?Q(this,R,"readableHighWaterMark",!0):null;if(D===0)R={...R,highWaterMark:null,readableHighWaterMark:D,writableHighWaterMark:R.writableHighWaterMark||0};if(K.call(this,R),this._readableState.sync=!1,this[T]=null,R){if(typeof R.transform==="function")this._transform=R.transform;if(typeof R.flush==="function")this._flush=R.flush}this.on("prefinish",F)}function H(R){if(typeof this._flush==="function"&&!this.destroyed)this._flush((D,q)=>{if(D){if(R)R(D);else this.destroy(D);return}if(q!=null)this.push(q);if(this.push(null),R)R()});else if(this.push(null),R)R()}function F(){if(this._final!==H)H.call(this)}M.prototype._final=H,M.prototype._transform=function(R,D,q){throw new S("_transform()")},M.prototype._write=function(R,D,q){let P=this._readableState,_=this._writableState,k=P.length;this._transform(R,D,(B,v)=>{if(B){q(B);return}if(v!=null)this.push(v);if(_.ended||k===P.length||P.length<P.highWaterMark)q();else this[T]=q})},M.prototype._read=function(){if(this[T]){let R=this[T];this[T]=null,R()}}}),i$=d0(($,I)=>{var{ObjectSetPrototypeOf:E}=s0();I.exports=S;var L=a$();E(S.prototype,L.prototype),E(S,L);function S(K){if(!(this instanceof S))return new S(K);L.call(this,K)}S.prototype._transform=function(K,Q,T){T(null,K)}}),oZ=d0(($,I)=>{var E=XO(),{ArrayIsArray:L,Promise:S,SymbolAsyncIterator:K,SymbolDispose:Q}=s0(),T=iU(),{once:M}=_U(),H=HO(),F=nU(),{aggregateTwoErrors:R,codes:{ERR_INVALID_ARG_TYPE:D,ERR_INVALID_RETURN_VALUE:q,ERR_MISSING_ARGS:P,ERR_STREAM_DESTROYED:_,ERR_STREAM_PREMATURE_CLOSE:k},AbortError:B}=TU(),{validateFunction:v,validateAbortSignal:g}=NO(),{isIterable:f,isReadable:w,isReadableNodeStream:b,isNodeStream:I0,isTransformStream:X0,isWebStream:C0,isReadableStream:u,isReadableFinished:O0}=tU(),U=globalThis.AbortController||xO().AbortController,A,X,Z;function C(N,p,n){let E0=!1;N.on("close",()=>{E0=!0});let r=T(N,{readable:p,writable:n},(d)=>{E0=!d});return{destroy:(d)=>{if(E0)return;E0=!0,H.destroyer(N,d||new _("pipe"))},cleanup:r}}function Y(N){return v(N[N.length-1],"streams[stream.length - 1]"),N.pop()}function V(N){if(f(N))return N;else if(b(N))return G(N);throw new D("val",["Readable","Iterable","AsyncIterable"],N)}async function*G(N){if(!X)X=iO();yield*X.prototype[K].call(N)}async function O(N,p,n,{end:E0}){let r,d=null,A0=(N0)=>{if(N0)r=N0;if(d){let y=d;d=null,y()}},t=()=>new S((N0,y)=>{if(r)y(r);else d=()=>{if(r)y(r);else N0()}});p.on("drain",A0);let i=T(p,{readable:!1},A0);try{if(p.writableNeedDrain)await t();for await(let N0 of N)if(!p.write(N0))await t();if(E0)p.end(),await t();n()}catch(N0){n(r!==N0?R(r,N0):N0)}finally{i(),p.off("drain",A0)}}async function J(N,p,n,{end:E0}){if(X0(p))p=p.writable;let r=p.getWriter();try{for await(let d of N)await r.ready,r.write(d).catch(()=>{});if(await r.ready,E0)await r.close();n()}catch(d){try{await r.abort(d),n(d)}catch(A0){n(A0)}}}function z(...N){return W(N,M(Y(N)))}function W(N,p,n){if(N.length===1&&L(N[0]))N=N[0];if(N.length<2)throw new P("streams");let E0=new U,r=E0.signal,d=n===null||n===void 0?void 0:n.signal,A0=[];g(d,"options.signal");function t(){a(new B)}Z=Z||_U().addAbortListener;let i;if(d)i=Z(d,t);let N0,y,h=[],$0=0;function m(s){a(s,--$0===0)}function a(s,Z0){var w0;if(s&&(!N0||N0.code==="ERR_STREAM_PREMATURE_CLOSE"))N0=s;if(!N0&&!Z0)return;while(h.length)h.shift()(N0);if((w0=i)===null||w0===void 0||w0[Q](),E0.abort(),Z0){if(!N0)A0.forEach((S0)=>S0());E.nextTick(p,N0,y)}}let W0;for(let s=0;s<N.length;s++){let Z0=N[s],w0=s<N.length-1,S0=s>0,V0=w0||(n===null||n===void 0?void 0:n.end)!==!1,m0=s===N.length-1;if(I0(Z0)){let J0=function(L0){if(L0&&L0.name!=="AbortError"&&L0.code!=="ERR_STREAM_PREMATURE_CLOSE")m(L0)};var c=J0;if(V0){let{destroy:L0,cleanup:a0}=C(Z0,w0,S0);if(h.push(L0),w(Z0)&&m0)A0.push(a0)}if(Z0.on("error",J0),w(Z0)&&m0)A0.push(()=>{Z0.removeListener("error",J0)})}if(s===0)if(typeof Z0==="function"){if(W0=Z0({signal:r}),!f(W0))throw new q("Iterable, AsyncIterable or Stream","source",W0)}else if(f(Z0)||b(Z0)||X0(Z0))W0=Z0;else W0=F.from(Z0);else if(typeof Z0==="function"){if(X0(W0)){var o;W0=V((o=W0)===null||o===void 0?void 0:o.readable)}else W0=V(W0);if(W0=Z0(W0,{signal:r}),w0){if(!f(W0,!0))throw new q("AsyncIterable",`transform[${s-1}]`,W0)}else{var x0;if(!A)A=i$();let J0=new A({objectMode:!0}),L0=(x0=W0)===null||x0===void 0?void 0:x0.then;if(typeof L0==="function")$0++,L0.call(W0,(D0)=>{if(y=D0,D0!=null)J0.write(D0);if(V0)J0.end();E.nextTick(m)},(D0)=>{J0.destroy(D0),E.nextTick(m,D0)});else if(f(W0,!0))$0++,O(W0,J0,m,{end:V0});else if(u(W0)||X0(W0)){let D0=W0.readable||W0;$0++,O(D0,J0,m,{end:V0})}else throw new q("AsyncIterable or Promise","destination",W0);W0=J0;let{destroy:a0,cleanup:K0}=C(W0,!1,!0);if(h.push(a0),m0)A0.push(K0)}}else if(I0(Z0)){if(b(W0)){$0+=2;let J0=j(W0,Z0,m,{end:V0});if(w(Z0)&&m0)A0.push(J0)}else if(X0(W0)||u(W0)){let J0=W0.readable||W0;$0++,O(J0,Z0,m,{end:V0})}else if(f(W0))$0++,O(W0,Z0,m,{end:V0});else throw new D("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],W0);W0=Z0}else if(C0(Z0)){if(b(W0))$0++,J(V(W0),Z0,m,{end:V0});else if(u(W0)||f(W0))$0++,J(W0,Z0,m,{end:V0});else if(X0(W0))$0++,J(W0.readable,Z0,m,{end:V0});else throw new D("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],W0);W0=Z0}else W0=F.from(Z0)}if(r!==null&&r!==void 0&&r.aborted||d!==null&&d!==void 0&&d.aborted)E.nextTick(t);return W0}function j(N,p,n,{end:E0}){let r=!1;if(p.on("close",()=>{if(!r)n(new k)}),N.pipe(p,{end:!1}),E0){let A0=function(){r=!0,p.end()};var d=A0;if(O0(N))E.nextTick(A0);else N.once("end",A0)}else n();return T(N,{readable:!0,writable:!1},(A0)=>{let t=N._readableState;if(A0&&A0.code==="ERR_STREAM_PREMATURE_CLOSE"&&t&&t.ended&&!t.errored&&!t.errorEmitted)N.once("end",n).once("error",n);else n(A0)}),T(p,{readable:!1,writable:!0},n)}I.exports={pipelineImpl:W,pipeline:z}}),UI=d0(($,I)=>{var{pipeline:E}=oZ(),L=nU(),{destroyer:S}=HO(),{isNodeStream:K,isReadable:Q,isWritable:T,isWebStream:M,isTransformStream:H,isWritableStream:F,isReadableStream:R}=tU(),{AbortError:D,codes:{ERR_INVALID_ARG_VALUE:q,ERR_MISSING_ARGS:P}}=TU(),_=iU();I.exports=function(...k){if(k.length===0)throw new P("streams");if(k.length===1)return L.from(k[0]);let B=[...k];if(typeof k[0]==="function")k[0]=L.from(k[0]);if(typeof k[k.length-1]==="function"){let U=k.length-1;k[U]=L.from(k[U])}for(let U=0;U<k.length;++U){if(!K(k[U])&&!M(k[U]))continue;if(U<k.length-1&&!(Q(k[U])||R(k[U])||H(k[U])))throw new q(`streams[${U}]`,B[U],"must be readable");if(U>0&&!(T(k[U])||F(k[U])||H(k[U])))throw new q(`streams[${U}]`,B[U],"must be writable")}let v,g,f,w,b;function I0(U){let A=w;if(w=null,A)A(U);else if(U)b.destroy(U);else if(!O0&&!u)b.destroy()}let X0=k[0],C0=E(k,I0),u=!!(T(X0)||F(X0)||H(X0)),O0=!!(Q(C0)||R(C0)||H(C0));if(b=new L({writableObjectMode:!!(X0!==null&&X0!==void 0&&X0.writableObjectMode),readableObjectMode:!!(C0!==null&&C0!==void 0&&C0.readableObjectMode),writable:u,readable:O0}),u){if(K(X0))b._write=function(A,X,Z){if(X0.write(A,X))Z();else v=Z},b._final=function(A){X0.end(),g=A},X0.on("drain",function(){if(v){let A=v;v=null,A()}});else if(M(X0)){let A=(H(X0)?X0.writable:X0).getWriter();b._write=async function(X,Z,C){try{await A.ready,A.write(X).catch(()=>{}),C()}catch(Y){C(Y)}},b._final=async function(X){try{await A.ready,A.close().catch(()=>{}),g=X}catch(Z){X(Z)}}}let U=H(C0)?C0.readable:C0;_(U,()=>{if(g){let A=g;g=null,A()}})}if(O0){if(K(C0))C0.on("readable",function(){if(f){let U=f;f=null,U()}}),C0.on("end",function(){b.push(null)}),b._read=function(){while(!0){let U=C0.read();if(U===null){f=b._read;return}if(!b.push(U))return}};else if(M(C0)){let U=(H(C0)?C0.readable:C0).getReader();b._read=async function(){while(!0)try{let{value:A,done:X}=await U.read();if(!b.push(A))return;if(X){b.push(null);return}}catch{return}}}}return b._destroy=function(U,A){if(!U&&w!==null)U=new D;if(f=null,v=null,g=null,w===null)A(U);else if(w=A,K(C0))S(C0,U)},b}}),wQ=d0(($,I)=>{var E=globalThis.AbortController||xO().AbortController,{codes:{ERR_INVALID_ARG_VALUE:L,ERR_INVALID_ARG_TYPE:S,ERR_MISSING_ARGS:K,ERR_OUT_OF_RANGE:Q},AbortError:T}=TU(),{validateAbortSignal:M,validateInteger:H,validateObject:F}=NO(),R=s0().Symbol("kWeak"),D=s0().Symbol("kResistStopPropagation"),{finished:q}=iU(),P=UI(),{addAbortSignalNoValidate:_}=eO(),{isWritable:k,isNodeStream:B}=tU(),{deprecate:v}=_U(),{ArrayPrototypePush:g,Boolean:f,MathFloor:w,Number:b,NumberIsNaN:I0,Promise:X0,PromiseReject:C0,PromiseResolve:u,PromisePrototypeThen:O0,Symbol:U}=s0(),A=U("kEmpty"),X=U("kEof");function Z(d,A0){if(A0!=null)F(A0,"options");if((A0===null||A0===void 0?void 0:A0.signal)!=null)M(A0.signal,"options.signal");if(B(d)&&!k(d))throw new L("stream",d,"must be writable");let t=P(this,d);if(A0!==null&&A0!==void 0&&A0.signal)_(A0.signal,t);return t}function C(d,A0){if(typeof d!=="function")throw new S("fn",["Function","AsyncFunction"],d);if(A0!=null)F(A0,"options");if((A0===null||A0===void 0?void 0:A0.signal)!=null)M(A0.signal,"options.signal");let t=1;if((A0===null||A0===void 0?void 0:A0.concurrency)!=null)t=w(A0.concurrency);let i=t-1;if((A0===null||A0===void 0?void 0:A0.highWaterMark)!=null)i=w(A0.highWaterMark);return H(t,"options.concurrency",1),H(i,"options.highWaterMark",0),i+=t,async function*(){let N0=_U().AbortSignalAny([A0===null||A0===void 0?void 0:A0.signal].filter(f)),y=this,h=[],$0={signal:N0},m,a,W0=!1,c=0;function o(){W0=!0,x0()}function x0(){c-=1,s()}function s(){if(a&&!W0&&c<t&&h.length<i)a(),a=null}async function Z0(){try{for await(let w0 of y){if(W0)return;if(N0.aborted)throw new T;try{if(w0=d(w0,$0),w0===A)continue;w0=u(w0)}catch(S0){w0=C0(S0)}if(c+=1,O0(w0,x0,o),h.push(w0),m)m(),m=null;if(!W0&&(h.length>=i||c>=t))await new X0((S0)=>{a=S0})}h.push(X)}catch(w0){let S0=C0(w0);O0(S0,x0,o),h.push(S0)}finally{if(W0=!0,m)m(),m=null}}Z0();try{while(!0){while(h.length>0){let w0=await h[0];if(w0===X)return;if(N0.aborted)throw new T;if(w0!==A)yield w0;h.shift(),s()}await new X0((w0)=>{m=w0})}}finally{if(W0=!0,a)a(),a=null}}.call(this)}function Y(d=void 0){if(d!=null)F(d,"options");if((d===null||d===void 0?void 0:d.signal)!=null)M(d.signal,"options.signal");return async function*(){let A0=0;for await(let i of this){var t;if(d!==null&&d!==void 0&&(t=d.signal)!==null&&t!==void 0&&t.aborted)throw new T({cause:d.signal.reason});yield[A0++,i]}}.call(this)}async function V(d,A0=void 0){for await(let t of z.call(this,d,A0))return!0;return!1}async function G(d,A0=void 0){if(typeof d!=="function")throw new S("fn",["Function","AsyncFunction"],d);return!await V.call(this,async(...t)=>{return!await d(...t)},A0)}async function O(d,A0){for await(let t of z.call(this,d,A0))return t;return}async function J(d,A0){if(typeof d!=="function")throw new S("fn",["Function","AsyncFunction"],d);async function t(i,N0){return await d(i,N0),A}for await(let i of C.call(this,t,A0));}function z(d,A0){if(typeof d!=="function")throw new S("fn",["Function","AsyncFunction"],d);async function t(i,N0){if(await d(i,N0))return i;return A}return C.call(this,t,A0)}class W extends K{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function j(d,A0,t){var i;if(typeof d!=="function")throw new S("reducer",["Function","AsyncFunction"],d);if(t!=null)F(t,"options");if((t===null||t===void 0?void 0:t.signal)!=null)M(t.signal,"options.signal");let N0=arguments.length>1;if(t!==null&&t!==void 0&&(i=t.signal)!==null&&i!==void 0&&i.aborted){let a=new T(void 0,{cause:t.signal.reason});throw this.once("error",()=>{}),await q(this.destroy(a)),a}let y=new E,h=y.signal;if(t!==null&&t!==void 0&&t.signal){let a={once:!0,[R]:this,[D]:!0};t.signal.addEventListener("abort",()=>y.abort(),a)}let $0=!1;try{for await(let a of this){var m;if($0=!0,t!==null&&t!==void 0&&(m=t.signal)!==null&&m!==void 0&&m.aborted)throw new T;if(!N0)A0=a,N0=!0;else A0=await d(A0,a,{signal:h})}if(!$0&&!N0)throw new W}finally{y.abort()}return A0}async function N(d){if(d!=null)F(d,"options");if((d===null||d===void 0?void 0:d.signal)!=null)M(d.signal,"options.signal");let A0=[];for await(let i of this){var t;if(d!==null&&d!==void 0&&(t=d.signal)!==null&&t!==void 0&&t.aborted)throw new T(void 0,{cause:d.signal.reason});g(A0,i)}return A0}function p(d,A0){let t=C.call(this,d,A0);return async function*(){for await(let i of t)yield*i}.call(this)}function n(d){if(d=b(d),I0(d))return 0;if(d<0)throw new Q("number",">= 0",d);return d}function E0(d,A0=void 0){if(A0!=null)F(A0,"options");if((A0===null||A0===void 0?void 0:A0.signal)!=null)M(A0.signal,"options.signal");return d=n(d),async function*(){var t;if(A0!==null&&A0!==void 0&&(t=A0.signal)!==null&&t!==void 0&&t.aborted)throw new T;for await(let N0 of this){var i;if(A0!==null&&A0!==void 0&&(i=A0.signal)!==null&&i!==void 0&&i.aborted)throw new T;if(d--<=0)yield N0}}.call(this)}function r(d,A0=void 0){if(A0!=null)F(A0,"options");if((A0===null||A0===void 0?void 0:A0.signal)!=null)M(A0.signal,"options.signal");return d=n(d),async function*(){var t;if(A0!==null&&A0!==void 0&&(t=A0.signal)!==null&&t!==void 0&&t.aborted)throw new T;for await(let N0 of this){var i;if(A0!==null&&A0!==void 0&&(i=A0.signal)!==null&&i!==void 0&&i.aborted)throw new T;if(d-- >0)yield N0;if(d<=0)return}}.call(this)}I.exports.streamReturningOperators={asIndexedPairs:v(Y,"readable.asIndexedPairs will be removed in a future version."),drop:E0,filter:z,flatMap:p,map:C,take:r,compose:Z},I.exports.promiseReturningOperators={every:G,forEach:J,reduce:j,toArray:N,some:V,find:O}}),OI=d0(($,I)=>{var{ArrayPrototypePop:E,Promise:L}=s0(),{isIterable:S,isNodeStream:K,isWebStream:Q}=tU(),{pipelineImpl:T}=oZ(),{finished:M}=iU();ZI();function H(...F){return new L((R,D)=>{let q,P,_=F[F.length-1];if(_&&typeof _==="object"&&!K(_)&&!S(_)&&!Q(_)){let k=E(F);q=k.signal,P=k.end}T(F,(k,B)=>{if(k)D(k);else R(B)},{signal:q,end:P})})}I.exports={finished:M,pipeline:H}}),ZI=d0(($,I)=>{var{Buffer:E}=(DU(),l0(RU)),{ObjectDefineProperty:L,ObjectKeys:S,ReflectApply:K}=s0(),{promisify:{custom:Q}}=_U(),{streamReturningOperators:T,promiseReturningOperators:M}=wQ(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:H}}=TU(),F=UI(),{setDefaultHighWaterMark:R,getDefaultHighWaterMark:D}=aO(),{pipeline:q}=oZ(),{destroyer:P}=HO(),_=iU(),k=OI(),B=tU(),v=I.exports=dZ().Stream;v.isDestroyed=B.isDestroyed,v.isDisturbed=B.isDisturbed,v.isErrored=B.isErrored,v.isReadable=B.isReadable,v.isWritable=B.isWritable,v.Readable=iO();for(let f of S(T)){let w=function(...I0){if(new.target)throw H();return v.Readable.from(K(b,this,I0))},b=T[f];L(w,"name",{__proto__:null,value:b.name}),L(w,"length",{__proto__:null,value:b.length}),L(v.Readable.prototype,f,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}for(let f of S(M)){let w=function(...I0){if(new.target)throw H();return K(b,this,I0)},b=M[f];L(w,"name",{__proto__:null,value:b.name}),L(w,"length",{__proto__:null,value:b.length}),L(v.Readable.prototype,f,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}v.Writable=bZ(),v.Duplex=nU(),v.Transform=a$(),v.PassThrough=i$(),v.pipeline=q;var{addAbortSignal:g}=eO();v.addAbortSignal=g,v.finished=_,v.destroy=P,v.compose=F,v.setDefaultHighWaterMark=R,v.getDefaultHighWaterMark=D,L(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return k}}),L(q,Q,{__proto__:null,enumerable:!0,get(){return k.pipeline}}),L(_,Q,{__proto__:null,enumerable:!0,get(){return k.finished}}),v.Stream=v,v._isUint8Array=function(f){return f instanceof Uint8Array},v._uint8ArrayToBuffer=function(f){return E.from(f.buffer,f.byteOffset,f.byteLength)}}),yQ=d0(($,I)=>{var E=UZ();{let L=ZI(),S=OI(),K=L.Readable.destroy;I.exports=L.Readable,I.exports._uint8ArrayToBuffer=L._uint8ArrayToBuffer,I.exports._isUint8Array=L._isUint8Array,I.exports.isDisturbed=L.isDisturbed,I.exports.isErrored=L.isErrored,I.exports.isReadable=L.isReadable,I.exports.Readable=L.Readable,I.exports.Writable=L.Writable,I.exports.Duplex=L.Duplex,I.exports.Transform=L.Transform,I.exports.PassThrough=L.PassThrough,I.exports.addAbortSignal=L.addAbortSignal,I.exports.finished=L.finished,I.exports.destroy=L.destroy,I.exports.destroy=K,I.exports.pipeline=L.pipeline,I.exports.compose=L.compose,Object.defineProperty(L,"promises",{configurable:!0,enumerable:!0,get(){return S}}),I.exports.Stream=L.Stream}I.exports.default=I.exports});AI.exports=yQ()});var EA={};qO(EA,{uptime:()=>QX,type:()=>JX,totalmem:()=>GX,tmpdir:()=>KI,tmpDir:()=>RX,release:()=>YX,platform:()=>LX,networkInterfaces:()=>SX,loadavg:()=>CX,hostname:()=>IX,homedir:()=>KX,getNetworkInterfaces:()=>DI,freemem:()=>XX,endianness:()=>$X,cpus:()=>EX,arch:()=>VX,EOL:()=>DX});var $X=function(){return"LE"},IX=function(){if(typeof location<"u")return location.hostname;else return""},CX=function(){return[]},QX=function(){return 0},XX=function(){return Number.MAX_VALUE},GX=function(){return Number.MAX_VALUE},EX=function(){return[]},JX=function(){return"Browser"},YX=function(){if(typeof navigator<"u")return navigator.appVersion;return""},DI=function(){return{}},SX,VX=function(){return"javascript"},LX=function(){return"browser"},KI=function(){return"/tmp"},RX,DX=`
|
|
3
|
+
`,KX=function(){return"/"};var JA=PO(()=>{SX=DI,RX=KI});var _I={};qO(_I,{types:()=>_X,promisify:()=>TI,log:()=>FI,isUndefined:()=>FO,isSymbol:()=>vX,isString:()=>QZ,isRegExp:()=>ZZ,isPrimitive:()=>BX,isObject:()=>MO,isNumber:()=>WI,isNullOrUndefined:()=>jX,isNull:()=>CZ,isFunction:()=>$Z,isError:()=>AZ,isDate:()=>LA,isBuffer:()=>gX,isBoolean:()=>DA,isArray:()=>HI,inspect:()=>JO,inherits:()=>MI,format:()=>RA,deprecate:()=>WX,default:()=>fX,debuglog:()=>FX,callbackifyOnRejected:()=>WA,callbackify:()=>qI,_extend:()=>HA,TextEncoder:()=>PI,TextDecoder:()=>kI});function RA($,...I){if(!QZ($)){var E=[$];for(var L=0;L<I.length;L++)E.push(JO(I[L]));return E.join(" ")}var L=0,S=I.length,K=String($).replace(HX,function(T){if(T==="%%")return"%";if(L>=S)return T;switch(T){case"%s":return String(I[L++]);case"%d":return Number(I[L++]);case"%j":try{return JSON.stringify(I[L++])}catch(M){return"[Circular]"}default:return T}});for(var Q=I[L];L<S;Q=I[++L])if(CZ(Q)||!MO(Q))K+=" "+Q;else K+=" "+JO(Q);return K}function WX($,I){if(typeof process>"u"||process?.noDeprecation===!0)return $;var E=!1;function L(...S){if(!E){if(process.throwDeprecation)throw Error(I);else if(process.traceDeprecation)console.trace(I);else console.error(I);E=!0}return $.apply(this,...S)}return L}function MX($,I){var E=JO.styles[I];if(E)return"\x1B["+JO.colors[E][0]+"m"+$+"\x1B["+JO.colors[E][1]+"m";else return $}function zX($,I){return $}function TX($){var I={};return $.forEach(function(E,L){I[E]=!0}),I}function IZ($,I,E){if($.customInspect&&I&&$Z(I.inspect)&&I.inspect!==JO&&!(I.constructor&&I.constructor.prototype===I)){var L=I.inspect(E,$);if(!QZ(L))L=IZ($,L,E);return L}var S=qX($,I);if(S)return S;var K=Object.keys(I),Q=TX(K);if($.showHidden)K=Object.getOwnPropertyNames(I);if(AZ(I)&&(K.indexOf("message")>=0||K.indexOf("description")>=0))return YA(I);if(K.length===0){if($Z(I)){var T=I.name?": "+I.name:"";return $.stylize("[Function"+T+"]","special")}if(ZZ(I))return $.stylize(RegExp.prototype.toString.call(I),"regexp");if(LA(I))return $.stylize(Date.prototype.toString.call(I),"date");if(AZ(I))return YA(I)}var M="",H=!1,F=["{","}"];if(HI(I))H=!0,F=["[","]"];if($Z(I)){var R=I.name?": "+I.name:"";M=" [Function"+R+"]"}if(ZZ(I))M=" "+RegExp.prototype.toString.call(I);if(LA(I))M=" "+Date.prototype.toUTCString.call(I);if(AZ(I))M=" "+YA(I);if(K.length===0&&(!H||I.length==0))return F[0]+M+F[1];if(E<0)if(ZZ(I))return $.stylize(RegExp.prototype.toString.call(I),"regexp");else return $.stylize("[Object]","special");$.seen.push(I);var D;if(H)D=PX($,I,E,Q,K);else D=K.map(function(q){return VA($,I,E,Q,q,H)});return $.seen.pop(),kX(D,M,F)}function qX($,I){if(FO(I))return $.stylize("undefined","undefined");if(QZ(I)){var E="'"+JSON.stringify(I).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(E,"string")}if(WI(I))return $.stylize(""+I,"number");if(DA(I))return $.stylize(""+I,"boolean");if(CZ(I))return $.stylize("null","null")}function YA($){return"["+Error.prototype.toString.call($)+"]"}function PX($,I,E,L,S){var K=[];for(var Q=0,T=I.length;Q<T;++Q)if(zI(I,String(Q)))K.push(VA($,I,E,L,String(Q),!0));else K.push("");return S.forEach(function(M){if(!M.match(/^\d+$/))K.push(VA($,I,E,L,M,!0))}),K}function VA($,I,E,L,S,K){var Q,T,M;if(M=Object.getOwnPropertyDescriptor(I,S)||{value:I[S]},M.get)if(M.set)T=$.stylize("[Getter/Setter]","special");else T=$.stylize("[Getter]","special");else if(M.set)T=$.stylize("[Setter]","special");if(!zI(L,S))Q="["+S+"]";if(!T)if($.seen.indexOf(M.value)<0){if(CZ(E))T=IZ($,M.value,null);else T=IZ($,M.value,E-1);if(T.indexOf(`
|
|
4
|
+
`)>-1)if(K)T=T.split(`
|
|
5
|
+
`).map(function(H){return" "+H}).join(`
|
|
6
|
+
`).slice(2);else T=`
|
|
7
|
+
`+T.split(`
|
|
8
|
+
`).map(function(H){return" "+H}).join(`
|
|
9
|
+
`)}else T=$.stylize("[Circular]","special");if(FO(Q)){if(K&&S.match(/^\d+$/))return T;if(Q=JSON.stringify(""+S),Q.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))Q=Q.slice(1,-1),Q=$.stylize(Q,"name");else Q=Q.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Q=$.stylize(Q,"string")}return Q+": "+T}function kX($,I,E){var L=0,S=$.reduce(function(K,Q){if(L++,Q.indexOf(`
|
|
10
|
+
`)>=0)L++;return K+Q.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(S>60)return E[0]+(I===""?"":I+`
|
|
11
|
+
`)+" "+$.join(`,
|
|
12
|
+
`)+" "+E[1];return E[0]+I+" "+$.join(", ")+" "+E[1]}function HI($){return Array.isArray($)}function DA($){return typeof $==="boolean"}function CZ($){return $===null}function jX($){return $==null}function WI($){return typeof $==="number"}function QZ($){return typeof $==="string"}function vX($){return typeof $==="symbol"}function FO($){return $===void 0}function ZZ($){return MO($)&&KA($)==="[object RegExp]"}function MO($){return typeof $==="object"&&$!==null}function LA($){return MO($)&&KA($)==="[object Date]"}function AZ($){return MO($)&&(KA($)==="[object Error]"||$ instanceof Error)}function $Z($){return typeof $==="function"}function BX($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}function gX($){return $ instanceof Buffer}function KA($){return Object.prototype.toString.call($)}function SA($){return $<10?"0"+$.toString(10):$.toString(10)}function NX(){var $=new Date,I=[SA($.getHours()),SA($.getMinutes()),SA($.getSeconds())].join(":");return[$.getDate(),xX[$.getMonth()],I].join(" ")}function FI(...$){console.log("%s - %s",NX(),RA.apply(null,$))}function MI($,I){if(I)$.super_=I,$.prototype=Object.create(I.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}})}function HA($,I){if(!I||!MO(I))return $;var E=Object.keys(I),L=E.length;while(L--)$[E[L]]=I[E[L]];return $}function zI($,I){return Object.prototype.hasOwnProperty.call($,I)}function WA($,I){if(!$){var E=Error("Promise was rejected with a falsy value");E.reason=$,$=E}return I($)}function qI($){if(typeof $!=="function")throw TypeError('The "original" argument must be of type Function');function I(...E){var L=E.pop();if(typeof L!=="function")throw TypeError("The last argument must be of type Function");var S=this,K=function(...Q){return L.apply(S,...Q)};$.apply(this,E).then(function(Q){process.nextTick(K.bind(null,null,Q))},function(Q){process.nextTick(WA.bind(null,Q,K))})}return Object.setPrototypeOf(I,Object.getPrototypeOf($)),Object.defineProperties(I,Object.getOwnPropertyDescriptors($)),I}var HX,FX,JO,_X=()=>{},xX,TI,PI,kI,fX;var jI=PO(()=>{HX=/%[sdj%]/g;FX=(($={},I={},E)=>((E=typeof process<"u"&&!1)&&(E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),I=new RegExp("^"+E+"$","i"),(L)=>{if(L=L.toUpperCase(),!$[L])if(I.test(L))$[L]=function(...S){console.error("%s: %s",L,pid,RA.apply(null,...S))};else $[L]=function(){};return $[L]}))(),JO=(($)=>($.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]},$.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},$.custom=Symbol.for("nodejs.util.inspect.custom"),$))(function($,I,...E){var L={seen:[],stylize:zX};if(E.length>=1)L.depth=E[0];if(E.length>=2)L.colors=E[1];if(DA(I))L.showHidden=I;else if(I)HA(L,I);if(FO(L.showHidden))L.showHidden=!1;if(FO(L.depth))L.depth=2;if(FO(L.colors))L.colors=!1;if(L.colors)L.stylize=MX;return IZ(L,$,L.depth)});xX=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];TI=(($)=>($.custom=Symbol.for("nodejs.util.promisify.custom"),$))(function($){if(typeof $!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&$[kCustomPromisifiedSymbol]){var I=$[kCustomPromisifiedSymbol];if(typeof I!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(I,kCustomPromisifiedSymbol,{value:I,enumerable:!1,writable:!1,configurable:!0}),I}function I(...E){var L,S,K=new Promise(function(Q,T){L=Q,S=T});E.push(function(Q,T){if(Q)S(Q);else L(T)});try{$.apply(this,E)}catch(Q){S(Q)}return K}if(Object.setPrototypeOf(I,Object.getPrototypeOf($)),kCustomPromisifiedSymbol)Object.defineProperty(I,kCustomPromisifiedSymbol,{value:I,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(I,Object.getOwnPropertyDescriptors($))});({TextEncoder:PI,TextDecoder:kI}=globalThis),fX={TextEncoder:PI,TextDecoder:kI,promisify:TI,log:FI,inherits:MI,_extend:HA,callbackifyOnRejected:WA,callbackify:qI}});var jU={};qO(jU,{webcrypto:()=>XJ,rng:()=>WE,randomUUID:()=>IJ,randomFillSync:()=>UJ,randomFill:()=>iE,randomBytes:()=>FE,publicEncrypt:()=>mE,publicDecrypt:()=>eE,pseudoRandomBytes:()=>HE,prng:()=>KE,privateEncrypt:()=>rE,privateDecrypt:()=>aE,pbkdf2Sync:()=>_E,pbkdf2:()=>kE,listCiphers:()=>cE,getRandomValues:()=>$J,getHashes:()=>PE,getDiffieHellman:()=>uE,getCurves:()=>QJ,getCiphers:()=>yE,default:()=>GJ,createVerify:()=>nE,createSign:()=>bE,createHmac:()=>qE,createHash:()=>zE,createECDH:()=>sE,createDiffieHellmanGroup:()=>hE,createDiffieHellman:()=>lE,createDecipheriv:()=>wE,createDecipher:()=>NE,createCredentials:()=>OJ,createCipheriv:()=>gE,createCipher:()=>vE,constants:()=>ZJ,Verify:()=>tE,Sign:()=>oE,Hmac:()=>TE,Hash:()=>ME,DiffieHellmanGroup:()=>pE,DiffieHellman:()=>dE,Decipheriv:()=>fE,Decipher:()=>xE,DEFAULT_ENCODING:()=>AJ,Cipheriv:()=>BE,Cipher:()=>jE});function QJ(){return CJ}var wX,yX,vI,cX,pX,hX=($,I,E)=>{E=$!=null?wX(yX($)):{};let L=I||!$||!$.__esModule?vI(E,"default",{value:$,enumerable:!0}):E;for(let S of cX($))if(!pX.call(L,S))vI(L,S,{get:()=>$[S],enumerable:!0});return L},Q0=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports),XZ,GZ,gI,uX,MA,zA,qU,lX,pO,xI,dX,bX,oX,nX,NI,tX,sX,mX,rX,eX,aX,iX,UG,OG,ZG,hO,EZ,fI,AG,wI,yI,$G,uO,TA,qA,IG,cI,PA,CG,pI,QG,hI,uI,XG,GG,EG,JG,YG,SG,VG,LG,RG,DG,KG,HG,WG,FG,kA,lI,MG,dI,zG,TG,qG,PG,sU,UO,bI,wU,oI,JZ,kG,gU,_G,jG,vG,nI,lU,lO,tI,BG,sI,gG,mI,xG,NG,fG,wG,_A,yG,jA,cG,pG,hG,uG,lG,dG,bG,oG,nG,tG,sG,mG,rG,eG,BI,aG,cO,iG,rI,eI,UE,OE,aI,ZE,AE,dO,$E,IE,CE,QE,XE,GE,iI,EE,UC,OC,ZC,vA,AC,JE,$C,YE,SE,FA,VE,LE,RE,DE,h0,KE,HE,WE,FE,ME,zE,TE,qE,PE,kE,_E,jE,vE,BE,gE,xE,NE,fE,wE,yE,cE,pE,hE,uE,lE,dE,bE,oE,nE,tE,sE,mE,rE,eE,aE,iE,UJ,OJ,ZJ,AJ="buffer",$J=($)=>{return crypto.getRandomValues($)},IJ=()=>{return crypto.randomUUID()},CJ,XJ,GJ;var vU=PO(()=>{wX=Object.create,{getPrototypeOf:yX,defineProperty:vI,getOwnPropertyNames:cX}=Object,pX=Object.prototype.hasOwnProperty,XZ=Q0(($,I)=>{I.exports=(vU(),l0(jU)).randomBytes}),GZ=Q0(($,I)=>{I.exports=(vU(),l0(jU)).createHash}),gI=Q0(($,I)=>{I.exports=(vU(),l0(jU)).createHmac}),uX=Q0(($,I)=>{I.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}}),MA=Q0(($,I)=>{var E=isFinite,L=Math.pow(2,30)-1;I.exports=function(S,K){if(typeof S!=="number")throw TypeError("Iterations not a number");if(S<0||!E(S))throw TypeError("Bad iterations");if(typeof K!=="number")throw TypeError("Key length not a number");if(K<0||K>L||K!==K)throw TypeError("Bad key length")}}),zA=Q0(($,I)=>{var E;if(globalThis.process&&globalThis.process.browser)E="utf-8";else if(globalThis.process&&globalThis.process.version)L=parseInt(process.version.split(".")[0].slice(1),10),E=L>=6?"utf-8":"binary";else E="utf-8";var L;I.exports=E}),qU=Q0(($,I)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var E=(DU(),l0(RU)),L=E.Buffer;function S(Q,T){for(var M in Q)T[M]=Q[M]}if(L.from&&L.alloc&&L.allocUnsafe&&L.allocUnsafeSlow)I.exports=E;else S(E,$),$.Buffer=K;function K(Q,T,M){return L(Q,T,M)}K.prototype=Object.create(L.prototype),S(L,K),K.from=function(Q,T,M){if(typeof Q==="number")throw TypeError("Argument must not be a number");return L(Q,T,M)},K.alloc=function(Q,T,M){if(typeof Q!=="number")throw TypeError("Argument must be a number");var H=L(Q);if(T!==void 0)if(typeof M==="string")H.fill(T,M);else H.fill(T);else H.fill(0);return H},K.allocUnsafe=function(Q){if(typeof Q!=="number")throw TypeError("Argument must be a number");return L(Q)},K.allocUnsafeSlow=function(Q){if(typeof Q!=="number")throw TypeError("Argument must be a number");return E.SlowBuffer(Q)}}),lX=Q0(($,I)=>{var E={}.toString;I.exports=Array.isArray||function(L){return E.call(L)=="[object Array]"}}),pO=Q0(($,I)=>{I.exports=TypeError}),xI=Q0(($,I)=>{I.exports=Object}),dX=Q0(($,I)=>{I.exports=Error}),bX=Q0(($,I)=>{I.exports=EvalError}),oX=Q0(($,I)=>{I.exports=RangeError}),nX=Q0(($,I)=>{I.exports=ReferenceError}),NI=Q0(($,I)=>{I.exports=SyntaxError}),tX=Q0(($,I)=>{I.exports=URIError}),sX=Q0(($,I)=>{I.exports=Math.abs}),mX=Q0(($,I)=>{I.exports=Math.floor}),rX=Q0(($,I)=>{I.exports=Math.max}),eX=Q0(($,I)=>{I.exports=Math.min}),aX=Q0(($,I)=>{I.exports=Math.pow}),iX=Q0(($,I)=>{I.exports=Math.round}),UG=Q0(($,I)=>{I.exports=Number.isNaN||function(E){return E!==E}}),OG=Q0(($,I)=>{var E=UG();I.exports=function(L){if(E(L)||L===0)return L;return L<0?-1:1}}),ZG=Q0(($,I)=>{I.exports=Object.getOwnPropertyDescriptor}),hO=Q0(($,I)=>{var E=ZG();if(E)try{E([],"length")}catch(L){E=null}I.exports=E}),EZ=Q0(($,I)=>{var E=Object.defineProperty||!1;if(E)try{E({},"a",{value:1})}catch(L){E=!1}I.exports=E}),fI=Q0(($,I)=>{I.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var E={},L=Symbol("test"),S=Object(L);if(typeof L==="string")return!1;if(Object.prototype.toString.call(L)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(S)!=="[object Symbol]")return!1;var K=42;E[L]=K;for(var Q in E)return!1;if(typeof Object.keys==="function"&&Object.keys(E).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(E).length!==0)return!1;var T=Object.getOwnPropertySymbols(E);if(T.length!==1||T[0]!==L)return!1;if(!Object.prototype.propertyIsEnumerable.call(E,L))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var M=Object.getOwnPropertyDescriptor(E,L);if(M.value!==K||M.enumerable!==!0)return!1}return!0}}),AG=Q0(($,I)=>{var E=typeof Symbol<"u"&&Symbol,L=fI();I.exports=function(){if(typeof E!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof E("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return L()}}),wI=Q0(($,I)=>{I.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),yI=Q0(($,I)=>{var E=xI();I.exports=E.getPrototypeOf||null}),$G=Q0(($,I)=>{var E="Function.prototype.bind called on incompatible ",L=Object.prototype.toString,S=Math.max,K="[object Function]",Q=function(H,F){var R=[];for(var D=0;D<H.length;D+=1)R[D]=H[D];for(var q=0;q<F.length;q+=1)R[q+H.length]=F[q];return R},T=function(H,F){var R=[];for(var D=F||0,q=0;D<H.length;D+=1,q+=1)R[q]=H[D];return R},M=function(H,F){var R="";for(var D=0;D<H.length;D+=1)if(R+=H[D],D+1<H.length)R+=F;return R};I.exports=function(H){var F=this;if(typeof F!=="function"||L.apply(F)!==K)throw TypeError(E+F);var R=T(arguments,1),D,q=function(){if(this instanceof D){var v=F.apply(this,Q(R,arguments));if(Object(v)===v)return v;return this}return F.apply(H,Q(R,arguments))},P=S(0,F.length-R.length),_=[];for(var k=0;k<P;k++)_[k]="$"+k;if(D=Function("binder","return function ("+M(_,",")+"){ return binder.apply(this,arguments); }")(q),F.prototype){var B=function(){};B.prototype=F.prototype,D.prototype=new B,B.prototype=null}return D}}),uO=Q0(($,I)=>{var E=$G();I.exports=Function.prototype.bind||E}),TA=Q0(($,I)=>{I.exports=Function.prototype.call}),qA=Q0(($,I)=>{I.exports=Function.prototype.apply}),IG=Q0(($,I)=>{I.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),cI=Q0(($,I)=>{var E=uO(),L=qA(),S=TA(),K=IG();I.exports=K||E.call(S,L)}),PA=Q0(($,I)=>{var E=uO(),L=pO(),S=TA(),K=cI();I.exports=function(Q){if(Q.length<1||typeof Q[0]!=="function")throw new L("a function is required");return K(E,S,Q)}}),CG=Q0(($,I)=>{var E=PA(),L=hO(),S;try{S=[].__proto__===Array.prototype}catch(M){if(!M||typeof M!=="object"||!("code"in M)||M.code!=="ERR_PROTO_ACCESS")throw M}var K=!!S&&L&&L(Object.prototype,"__proto__"),Q=Object,T=Q.getPrototypeOf;I.exports=K&&typeof K.get==="function"?E([K.get]):typeof T==="function"?function(M){return T(M==null?M:Q(M))}:!1}),pI=Q0(($,I)=>{var E=wI(),L=yI(),S=CG();I.exports=E?function(K){return E(K)}:L?function(K){if(!K||typeof K!=="object"&&typeof K!=="function")throw TypeError("getProto: not an object");return L(K)}:S?function(K){return S(K)}:null}),QG=Q0(($,I)=>{var E=Function.prototype.call,L=Object.prototype.hasOwnProperty,S=uO();I.exports=S.call(E,L)}),hI=Q0(($,I)=>{var E,L=xI(),S=dX(),K=bX(),Q=oX(),T=nX(),M=NI(),H=pO(),F=tX(),R=sX(),D=mX(),q=rX(),P=eX(),_=aX(),k=iX(),B=OG(),v=Function,g=function(A0){try{return v('"use strict"; return ('+A0+").constructor;")()}catch(t){}},f=hO(),w=EZ(),b=function(){throw new H},I0=f?function(){try{return arguments.callee,b}catch(A0){try{return f(arguments,"callee").get}catch(t){return b}}}():b,X0=AG()(),C0=pI(),u=yI(),O0=wI(),U=qA(),A=TA(),X={},Z=typeof Uint8Array>"u"||!C0?E:C0(Uint8Array),C={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?E:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?E:ArrayBuffer,"%ArrayIteratorPrototype%":X0&&C0?C0([][Symbol.iterator]()):E,"%AsyncFromSyncIteratorPrototype%":E,"%AsyncFunction%":X,"%AsyncGenerator%":X,"%AsyncGeneratorFunction%":X,"%AsyncIteratorPrototype%":X,"%Atomics%":typeof Atomics>"u"?E:Atomics,"%BigInt%":typeof BigInt>"u"?E:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?E:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?E:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?E:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":S,"%eval%":eval,"%EvalError%":K,"%Float16Array%":typeof Float16Array>"u"?E:Float16Array,"%Float32Array%":typeof Float32Array>"u"?E:Float32Array,"%Float64Array%":typeof Float64Array>"u"?E:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?E:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":X,"%Int8Array%":typeof Int8Array>"u"?E:Int8Array,"%Int16Array%":typeof Int16Array>"u"?E:Int16Array,"%Int32Array%":typeof Int32Array>"u"?E:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":X0&&C0?C0(C0([][Symbol.iterator]())):E,"%JSON%":typeof JSON==="object"?JSON:E,"%Map%":typeof Map>"u"?E:Map,"%MapIteratorPrototype%":typeof Map>"u"||!X0||!C0?E:C0(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":L,"%Object.getOwnPropertyDescriptor%":f,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?E:Promise,"%Proxy%":typeof Proxy>"u"?E:Proxy,"%RangeError%":Q,"%ReferenceError%":T,"%Reflect%":typeof Reflect>"u"?E:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?E:Set,"%SetIteratorPrototype%":typeof Set>"u"||!X0||!C0?E:C0(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?E:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":X0&&C0?C0(""[Symbol.iterator]()):E,"%Symbol%":X0?Symbol:E,"%SyntaxError%":M,"%ThrowTypeError%":I0,"%TypedArray%":Z,"%TypeError%":H,"%Uint8Array%":typeof Uint8Array>"u"?E:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?E:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?E:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?E:Uint32Array,"%URIError%":F,"%WeakMap%":typeof WeakMap>"u"?E:WeakMap,"%WeakRef%":typeof WeakRef>"u"?E:WeakRef,"%WeakSet%":typeof WeakSet>"u"?E:WeakSet,"%Function.prototype.call%":A,"%Function.prototype.apply%":U,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":u,"%Math.abs%":R,"%Math.floor%":D,"%Math.max%":q,"%Math.min%":P,"%Math.pow%":_,"%Math.round%":k,"%Math.sign%":B,"%Reflect.getPrototypeOf%":O0};if(C0)try{null.error}catch(A0){Y=C0(C0(A0)),C["%Error.prototype%"]=Y}var Y,V=function A0(t){var i;if(t==="%AsyncFunction%")i=g("async function () {}");else if(t==="%GeneratorFunction%")i=g("function* () {}");else if(t==="%AsyncGeneratorFunction%")i=g("async function* () {}");else if(t==="%AsyncGenerator%"){var N0=A0("%AsyncGeneratorFunction%");if(N0)i=N0.prototype}else if(t==="%AsyncIteratorPrototype%"){var y=A0("%AsyncGenerator%");if(y&&C0)i=C0(y.prototype)}return C[t]=i,i},G={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=uO(),J=QG(),z=O.call(A,Array.prototype.concat),W=O.call(U,Array.prototype.splice),j=O.call(A,String.prototype.replace),N=O.call(A,String.prototype.slice),p=O.call(A,RegExp.prototype.exec),n=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E0=/\\(\\)?/g,r=function(A0){var t=N(A0,0,1),i=N(A0,-1);if(t==="%"&&i!=="%")throw new M("invalid intrinsic syntax, expected closing `%`");else if(i==="%"&&t!=="%")throw new M("invalid intrinsic syntax, expected opening `%`");var N0=[];return j(A0,n,function(y,h,$0,m){N0[N0.length]=$0?j(m,E0,"$1"):h||y}),N0},d=function(A0,t){var i=A0,N0;if(J(G,i))N0=G[i],i="%"+N0[0]+"%";if(J(C,i)){var y=C[i];if(y===X)y=V(i);if(typeof y>"u"&&!t)throw new H("intrinsic "+A0+" exists, but is not available. Please file an issue!");return{alias:N0,name:i,value:y}}throw new M("intrinsic "+A0+" does not exist!")};I.exports=function(A0,t){if(typeof A0!=="string"||A0.length===0)throw new H("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!=="boolean")throw new H('"allowMissing" argument must be a boolean');if(p(/^%?[^%]*%?$/,A0)===null)throw new M("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=r(A0),N0=i.length>0?i[0]:"",y=d("%"+N0+"%",t),h=y.name,$0=y.value,m=!1,a=y.alias;if(a)N0=a[0],W(i,z([0,1],a));for(var W0=1,c=!0;W0<i.length;W0+=1){var o=i[W0],x0=N(o,0,1),s=N(o,-1);if((x0==='"'||x0==="'"||x0==="`"||(s==='"'||s==="'"||s==="`"))&&x0!==s)throw new M("property names with quotes must have matching quotes");if(o==="constructor"||!c)m=!0;if(N0+="."+o,h="%"+N0+"%",J(C,h))$0=C[h];else if($0!=null){if(!(o in $0)){if(!t)throw new H("base intrinsic for "+A0+" exists, but the property is not available.");return}if(f&&W0+1>=i.length){var Z0=f($0,o);if(c=!!Z0,c&&"get"in Z0&&!("originalValue"in Z0.get))$0=Z0.get;else $0=$0[o]}else c=J($0,o),$0=$0[o];if(c&&!m)C[h]=$0}}return $0}}),uI=Q0(($,I)=>{var E=hI(),L=PA(),S=L([E("%String.prototype.indexOf%")]);I.exports=function(K,Q){var T=E(K,!!Q);if(typeof T==="function"&&S(K,".prototype.")>-1)return L([T]);return T}}),XG=Q0(($,I)=>{var E=Function.prototype.toString,L=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,S,K;if(typeof L==="function"&&typeof Object.defineProperty==="function")try{S=Object.defineProperty({},"length",{get:function(){throw K}}),K={},L(function(){throw 42},null,S)}catch(f){if(f!==K)L=null}else L=null;var Q=/^\s*class\b/,T=function(f){try{var w=E.call(f);return Q.test(w)}catch(b){return!1}},M=function(f){try{if(T(f))return!1;return E.call(f),!0}catch(w){return!1}},H=Object.prototype.toString,F="[object Object]",R="[object Function]",D="[object GeneratorFunction]",q="[object HTMLAllCollection]",P="[object HTML document.all class]",_="[object HTMLCollection]",k=typeof Symbol==="function"&&!!Symbol.toStringTag,B=!(0 in[,]),v=function(){return!1};if(typeof document==="object"){if(g=document.all,H.call(g)===H.call(document.all))v=function(f){if((B||!f)&&(typeof f>"u"||typeof f==="object"))try{var w=H.call(f);return(w===q||w===P||w===_||w===F)&&f("")==null}catch(b){}return!1}}var g;I.exports=L?function(f){if(v(f))return!0;if(!f)return!1;if(typeof f!=="function"&&typeof f!=="object")return!1;try{L(f,null,S)}catch(w){if(w!==K)return!1}return!T(f)&&M(f)}:function(f){if(v(f))return!0;if(!f)return!1;if(typeof f!=="function"&&typeof f!=="object")return!1;if(k)return M(f);if(T(f))return!1;var w=H.call(f);if(w!==R&&w!==D&&!/^\[object HTML/.test(w))return!1;return M(f)}}),GG=Q0(($,I)=>{var E=XG(),L=Object.prototype.toString,S=Object.prototype.hasOwnProperty,K=function(H,F,R){for(var D=0,q=H.length;D<q;D++)if(S.call(H,D))if(R==null)F(H[D],D,H);else F.call(R,H[D],D,H)},Q=function(H,F,R){for(var D=0,q=H.length;D<q;D++)if(R==null)F(H.charAt(D),D,H);else F.call(R,H.charAt(D),D,H)},T=function(H,F,R){for(var D in H)if(S.call(H,D))if(R==null)F(H[D],D,H);else F.call(R,H[D],D,H)};function M(H){return L.call(H)==="[object Array]"}I.exports=function(H,F,R){if(!E(F))throw TypeError("iterator must be a function");var D;if(arguments.length>=3)D=R;if(M(H))K(H,F,D);else if(typeof H==="string")Q(H,F,D);else T(H,F,D)}}),EG=Q0(($,I)=>{I.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),JG=Q0(($,I)=>{var E=EG(),L=typeof globalThis>"u"?globalThis:globalThis;I.exports=function(){var S=[];for(var K=0;K<E.length;K++)if(typeof L[E[K]]==="function")S[S.length]=E[K];return S}}),YG=Q0(($,I)=>{var E=EZ(),L=NI(),S=pO(),K=hO();I.exports=function(Q,T,M){if(!Q||typeof Q!=="object"&&typeof Q!=="function")throw new S("`obj` must be an object or a function`");if(typeof T!=="string"&&typeof T!=="symbol")throw new S("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new S("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new S("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new S("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new S("`loose`, if provided, must be a boolean");var H=arguments.length>3?arguments[3]:null,F=arguments.length>4?arguments[4]:null,R=arguments.length>5?arguments[5]:null,D=arguments.length>6?arguments[6]:!1,q=!!K&&K(Q,T);if(E)E(Q,T,{configurable:R===null&&q?q.configurable:!R,enumerable:H===null&&q?q.enumerable:!H,value:M,writable:F===null&&q?q.writable:!F});else if(D||!H&&!F&&!R)Q[T]=M;else throw new L("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),SG=Q0(($,I)=>{var E=EZ(),L=function(){return!!E};L.hasArrayLengthDefineBug=function(){if(!E)return null;try{return E([],"length",{value:1}).length!==1}catch(S){return!0}},I.exports=L}),VG=Q0(($,I)=>{var E=hI(),L=YG(),S=SG()(),K=hO(),Q=pO(),T=E("%Math.floor%");I.exports=function(M,H){if(typeof M!=="function")throw new Q("`fn` is not a function");if(typeof H!=="number"||H<0||H>4294967295||T(H)!==H)throw new Q("`length` must be a positive 32-bit integer");var F=arguments.length>2&&!!arguments[2],R=!0,D=!0;if("length"in M&&K){var q=K(M,"length");if(q&&!q.configurable)R=!1;if(q&&!q.writable)D=!1}if(R||D||!F)if(S)L(M,"length",H,!0,!0);else L(M,"length",H);return M}}),LG=Q0(($,I)=>{var E=uO(),L=qA(),S=cI();I.exports=function(){return S(E,L,arguments)}}),RG=Q0(($,I)=>{var E=VG(),L=EZ(),S=PA(),K=LG();if(I.exports=function(Q){var T=S(arguments),M=Q.length-(arguments.length-1);return E(T,1+(M>0?M:0),!0)},L)L(I.exports,"apply",{value:K});else I.exports.apply=K}),DG=Q0(($,I)=>{var E=fI();I.exports=function(){return E()&&!!Symbol.toStringTag}}),KG=Q0(($,I)=>{var E=GG(),L=JG(),S=RG(),K=uI(),Q=hO(),T=pI(),M=K("Object.prototype.toString"),H=DG()(),F=typeof globalThis>"u"?globalThis:globalThis,R=L(),D=K("String.prototype.slice"),q=K("Array.prototype.indexOf",!0)||function(B,v){for(var g=0;g<B.length;g+=1)if(B[g]===v)return g;return-1},P={__proto__:null};if(H&&Q&&T)E(R,function(B){var v=new F[B];if(Symbol.toStringTag in v&&T){var g=T(v),f=Q(g,Symbol.toStringTag);if(!f&&g){var w=T(g);f=Q(w,Symbol.toStringTag)}P["$"+B]=S(f.get)}});else E(R,function(B){var v=new F[B],g=v.slice||v.set;if(g)P["$"+B]=S(g)});var _=function(B){var v=!1;return E(P,function(g,f){if(!v)try{if("$"+g(B)===f)v=D(f,1)}catch(w){}}),v},k=function(B){var v=!1;return E(P,function(g,f){if(!v)try{g(B),v=D(f,1)}catch(w){}}),v};I.exports=function(B){if(!B||typeof B!=="object")return!1;if(!H){var v=D(M(B),8,-1);if(q(R,v)>-1)return v;if(v!=="Object")return!1;return k(B)}if(!Q)return null;return _(B)}}),HG=Q0(($,I)=>{var E=KG();I.exports=function(L){return!!E(L)}}),WG=Q0(($,I)=>{var E=pO(),L=uI(),S=L("TypedArray.prototype.buffer",!0),K=HG();I.exports=S||function(Q){if(!K(Q))throw new E("Not a Typed Array");return Q.buffer}}),FG=Q0(($,I)=>{var E=qU().Buffer,L=lX(),S=WG(),K=ArrayBuffer.isView||function(H){try{return S(H),!0}catch(F){return!1}},Q=typeof Uint8Array<"u",T=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",M=T&&(E.prototype instanceof Uint8Array||E.TYPED_ARRAY_SUPPORT);I.exports=function(H,F){if(E.isBuffer(H)){if(H.constructor&&!("isBuffer"in H))return E.from(H);return H}if(typeof H==="string")return E.from(H,F);if(T&&K(H)){if(H.byteLength===0)return E.alloc(0);if(M){var R=E.from(H.buffer,H.byteOffset,H.byteLength);if(R.byteLength===H.byteLength)return R}var D=H instanceof Uint8Array?H:new Uint8Array(H.buffer,H.byteOffset,H.byteLength),q=E.from(D);if(q.length===H.byteLength)return q}if(Q&&H instanceof Uint8Array)return E.from(H);var P=L(H);if(P)for(var _=0;_<H.length;_+=1){var k=H[_];if(typeof k!=="number"||k<0||k>255||~~k!==k)throw RangeError("Array items must be numbers in the range 0-255.")}if(P||E.isBuffer(H)&&H.constructor&&typeof H.constructor.isBuffer==="function"&&H.constructor.isBuffer(H))return E.from(H);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),kA=Q0(($,I)=>{var E=qU().Buffer,L=FG(),S=typeof Uint8Array<"u",K=S&&typeof ArrayBuffer<"u",Q=K&&ArrayBuffer.isView;I.exports=function(T,M,H){if(typeof T==="string"||E.isBuffer(T)||S&&T instanceof Uint8Array||Q&&Q(T))return L(T,M);throw TypeError(H+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),lI=Q0(($,I)=>{var E={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},L={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},S=gI(),K=qU().Buffer,Q=MA(),T=zA(),M=kA();function H(F,R,D,q,P){Q(D,q),F=M(F,T,"Password"),R=M(R,T,"Salt");var _=(P||"sha1").toLowerCase(),k=L[_]||_,B=E[k];if(typeof B!=="number"||!B)throw TypeError("Digest algorithm not supported: "+P);var v=K.allocUnsafe(q),g=K.allocUnsafe(R.length+4);R.copy(g,0,0,R.length);var f=0,w=B,b=Math.ceil(q/w);for(var I0=1;I0<=b;I0++){g.writeUInt32BE(I0,R.length);var X0=S(k,F).update(g).digest(),C0=X0;for(var u=1;u<D;u++){C0=S(k,F).update(C0).digest();for(var O0=0;O0<w;O0++)X0[O0]^=C0[O0]}X0.copy(v,f),f+=w}return v}I.exports=H}),MG=Q0(($,I)=>{var E=qU().Buffer,L=MA(),S=zA(),K=lI(),Q=kA(),T,M=globalThis.crypto&&globalThis.crypto.subtle,H={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},F=[],R;function D(){if(R)return R;if(globalThis.process&&globalThis.process.nextTick)R=globalThis.process.nextTick;else if(globalThis.queueMicrotask)R=globalThis.queueMicrotask;else if(globalThis.setImmediate)R=globalThis.setImmediate;else R=globalThis.setTimeout;return R}function q(k,B,v,g,f){return M.importKey("raw",k,{name:"PBKDF2"},!1,["deriveBits"]).then(function(w){return M.deriveBits({name:"PBKDF2",salt:B,iterations:v,hash:{name:f}},w,g<<3)}).then(function(w){return E.from(w)})}function P(k){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!M||!M.importKey||!M.deriveBits)return Promise.resolve(!1);if(F[k]!==void 0)return F[k];T=T||E.alloc(8);var B=q(T,T,10,128,k).then(function(){return!0},function(){return!1});return F[k]=B,B}function _(k,B){k.then(function(v){D()(function(){B(null,v)})},function(v){D()(function(){B(v)})})}I.exports=function(k,B,v,g,f,w){if(typeof f==="function")w=f,f=void 0;if(L(v,g),k=Q(k,S,"Password"),B=Q(B,S,"Salt"),typeof w!=="function")throw Error("No callback provided to pbkdf2");f=f||"sha1";var b=H[f.toLowerCase()];if(!b||typeof globalThis.Promise!=="function"){D()(function(){var I0;try{I0=K(k,B,v,g,f)}catch(X0){w(X0);return}w(null,I0)});return}_(P(b).then(function(I0){if(I0)return q(k,B,v,g,b);return K(k,B,v,g,f)}),w)}}),dI=Q0(($)=>{var I=(vU(),l0(jU)),E=MA(),L=zA(),S=kA();function K(T,M,H,F,R,D){if(E(H,F),T=S(T,L,"Password"),M=S(M,L,"Salt"),typeof R==="function")D=R,R="sha1";if(typeof D!=="function")throw Error("No callback provided to pbkdf2");return I.pbkdf2(T,M,H,F,R,D)}function Q(T,M,H,F,R){return E(H,F),T=S(T,L,"Password"),M=S(M,L,"Salt"),R=R||"sha1",I.pbkdf2Sync(T,M,H,F,R)}if(!I.pbkdf2Sync||I.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)$.pbkdf2Sync=lI(),$.pbkdf2=MG();else $.pbkdf2Sync=Q,$.pbkdf2=K}),zG=Q0(($)=>{var I=(vU(),l0(jU));$.createCipher=$.Cipher=I.createCipher,$.createCipheriv=$.Cipheriv=I.createCipheriv,$.createDecipher=$.Decipher=I.createDecipher,$.createDecipheriv=$.Decipheriv=I.createDecipheriv,$.listCiphers=$.getCiphers=I.getCiphers}),TG=Q0(($)=>{var I=(vU(),l0(jU));$.DiffieHellmanGroup=I.DiffieHellmanGroup,$.createDiffieHellmanGroup=I.createDiffieHellmanGroup,$.getDiffieHellman=I.getDiffieHellman,$.createDiffieHellman=I.createDiffieHellman,$.DiffieHellman=I.DiffieHellman}),qG=Q0(($)=>{var I=(vU(),l0(jU));$.createSign=I.createSign,$.Sign=I.Sign,$.createVerify=I.createVerify,$.Verify=I.Verify}),PG=Q0(($,I)=>{I.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}}),sU=Q0(($,I)=>{(function(E,L){function S(U,A){if(!U)throw Error(A||"Assertion failed")}function K(U,A){U.super_=A;var X=function(){};X.prototype=A.prototype,U.prototype=new X,U.prototype.constructor=U}function Q(U,A,X){if(Q.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(A==="le"||A==="be")X=A,A=10;this._init(U||0,A||10,X||"be")}}if(typeof E==="object")E.exports=Q;else L.BN=Q;Q.BN=Q,Q.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(DU(),l0(RU)).Buffer}catch(U){}Q.isBN=function(U){if(U instanceof Q)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===Q.wordSize&&Array.isArray(U.words)},Q.max=function(U,A){if(U.cmp(A)>0)return U;return A},Q.min=function(U,A){if(U.cmp(A)<0)return U;return A},Q.prototype._init=function(U,A,X){if(typeof U==="number")return this._initNumber(U,A,X);if(typeof U==="object")return this._initArray(U,A,X);if(A==="hex")A=16;S(A===(A|0)&&A>=2&&A<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(A===16)this._parseHex(U,Z,X);else if(this._parseBase(U,A,Z),X==="le")this._initArray(this.toArray(),A,X)}},Q.prototype._initNumber=function(U,A,X){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else S(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),A,X)},Q.prototype._initArray=function(U,A,X){if(S(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C,Y,V=0;if(X==="be"){for(Z=U.length-1,C=0;Z>=0;Z-=3)if(Y=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}else if(X==="le"){for(Z=0,C=0;Z<U.length;Z+=3)if(Y=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}return this.strip()};function M(U,A){var X=U.charCodeAt(A);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(U,A,X){var Z=M(U,X);if(X-1>=A)Z|=M(U,X-1)<<4;return Z}Q.prototype._parseHex=function(U,A,X){this.length=Math.ceil((U.length-A)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C=0,Y=0,V;if(X==="be")for(Z=U.length-1;Z>=A;Z-=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8;else{var G=U.length-A;for(Z=G%2===0?A+1:A;Z<U.length;Z+=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8}this.strip()};function F(U,A,X,Z){var C=0,Y=Math.min(U.length,X);for(var V=A;V<Y;V++){var G=U.charCodeAt(V)-48;if(C*=Z,G>=49)C+=G-49+10;else if(G>=17)C+=G-17+10;else C+=G}return C}Q.prototype._parseBase=function(U,A,X){this.words=[0],this.length=1;for(var Z=0,C=1;C<=67108863;C*=A)Z++;Z--,C=C/A|0;var Y=U.length-X,V=Y%Z,G=Math.min(Y,Y-V)+X,O=0;for(var J=X;J<G;J+=Z)if(O=F(U,J,J+Z,A),this.imuln(C),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(V!==0){var z=1;O=F(U,J,U.length,A);for(J=0;J<V;J++)z*=A;if(this.imuln(z),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},Q.prototype.copy=function(U){U.words=Array(this.length);for(var A=0;A<this.length;A++)U.words[A]=this.words[A];U.length=this.length,U.negative=this.negative,U.red=this.red},Q.prototype.clone=function(){var U=new Q(null);return this.copy(U),U},Q.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},Q.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Q.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Q.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var R=["","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"],D=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Q.prototype.toString=function(U,A){U=U||10,A=A|0||1;var X;if(U===16||U==="hex"){X="";var Z=0,C=0;for(var Y=0;Y<this.length;Y++){var V=this.words[Y],G=((V<<Z|C)&16777215).toString(16);if(C=V>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,Y--;if(C!==0||Y!==this.length-1)X=R[6-G.length]+G+X;else X=G+X}if(C!==0)X=C.toString(16)+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(U===(U|0)&&U>=2&&U<=36){var O=D[U],J=q[U];X="";var z=this.clone();z.negative=0;while(!z.isZero()){var W=z.modn(J).toString(U);if(z=z.idivn(J),!z.isZero())X=R[O-W.length]+W+X;else X=W+X}if(this.isZero())X="0"+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}S(!1,"Base should be between 2 and 36")},Q.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)S(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},Q.prototype.toJSON=function(){return this.toString(16)},Q.prototype.toBuffer=function(U,A){return S(typeof T<"u"),this.toArrayLike(T,U,A)},Q.prototype.toArray=function(U,A){return this.toArrayLike(Array,U,A)},Q.prototype.toArrayLike=function(U,A,X){var Z=this.byteLength(),C=X||Math.max(1,Z);S(Z<=C,"byte array longer than desired length"),S(C>0,"Requested array length <= 0"),this.strip();var Y=A==="le",V=new U(C),G,O,J=this.clone();if(!Y){for(O=0;O<C-Z;O++)V[O]=0;for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[C-O-1]=G}else{for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[O]=G;for(;O<C;O++)V[O]=0}return V},Math.clz32)Q.prototype._countBits=function(U){return 32-Math.clz32(U)};else Q.prototype._countBits=function(U){var A=U,X=0;if(A>=4096)X+=13,A>>>=13;if(A>=64)X+=7,A>>>=7;if(A>=8)X+=4,A>>>=4;if(A>=2)X+=2,A>>>=2;return X+A};Q.prototype._zeroBits=function(U){if(U===0)return 26;var A=U,X=0;if((A&8191)===0)X+=13,A>>>=13;if((A&127)===0)X+=7,A>>>=7;if((A&15)===0)X+=4,A>>>=4;if((A&3)===0)X+=2,A>>>=2;if((A&1)===0)X++;return X},Q.prototype.bitLength=function(){var U=this.words[this.length-1],A=this._countBits(U);return(this.length-1)*26+A};function P(U){var A=Array(U.bitLength());for(var X=0;X<A.length;X++){var Z=X/26|0,C=X%26;A[X]=(U.words[Z]&1<<C)>>>C}return A}Q.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var A=0;A<this.length;A++){var X=this._zeroBits(this.words[A]);if(U+=X,X!==26)break}return U},Q.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Q.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},Q.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},Q.prototype.isNeg=function(){return this.negative!==0},Q.prototype.neg=function(){return this.clone().ineg()},Q.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Q.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var A=0;A<U.length;A++)this.words[A]=this.words[A]|U.words[A];return this.strip()},Q.prototype.ior=function(U){return S((this.negative|U.negative)===0),this.iuor(U)},Q.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},Q.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},Q.prototype.iuand=function(U){var A;if(this.length>U.length)A=U;else A=this;for(var X=0;X<A.length;X++)this.words[X]=this.words[X]&U.words[X];return this.length=A.length,this.strip()},Q.prototype.iand=function(U){return S((this.negative|U.negative)===0),this.iuand(U)},Q.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},Q.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},Q.prototype.iuxor=function(U){var A,X;if(this.length>U.length)A=this,X=U;else A=U,X=this;for(var Z=0;Z<X.length;Z++)this.words[Z]=A.words[Z]^X.words[Z];if(this!==A)for(;Z<A.length;Z++)this.words[Z]=A.words[Z];return this.length=A.length,this.strip()},Q.prototype.ixor=function(U){return S((this.negative|U.negative)===0),this.iuxor(U)},Q.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},Q.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},Q.prototype.inotn=function(U){S(typeof U==="number"&&U>=0);var A=Math.ceil(U/26)|0,X=U%26;if(this._expand(A),X>0)A--;for(var Z=0;Z<A;Z++)this.words[Z]=~this.words[Z]&67108863;if(X>0)this.words[Z]=~this.words[Z]&67108863>>26-X;return this.strip()},Q.prototype.notn=function(U){return this.clone().inotn(U)},Q.prototype.setn=function(U,A){S(typeof U==="number"&&U>=0);var X=U/26|0,Z=U%26;if(this._expand(X+1),A)this.words[X]=this.words[X]|1<<Z;else this.words[X]=this.words[X]&~(1<<Z);return this.strip()},Q.prototype.iadd=function(U){var A;if(this.negative!==0&&U.negative===0)return this.negative=0,A=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,A=this.isub(U),U.negative=1,A._normSign();var X,Z;if(this.length>U.length)X=this,Z=U;else X=U,Z=this;var C=0;for(var Y=0;Y<Z.length;Y++)A=(X.words[Y]|0)+(Z.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;for(;C!==0&&Y<X.length;Y++)A=(X.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;if(this.length=X.length,C!==0)this.words[this.length]=C,this.length++;else if(X!==this)for(;Y<X.length;Y++)this.words[Y]=X.words[Y];return this},Q.prototype.add=function(U){var A;if(U.negative!==0&&this.negative===0)return U.negative=0,A=this.sub(U),U.negative^=1,A;else if(U.negative===0&&this.negative!==0)return this.negative=0,A=U.sub(this),this.negative=1,A;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},Q.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var A=this.iadd(U);return U.negative=1,A._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var X=this.cmp(U);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,C;if(X>0)Z=this,C=U;else Z=U,C=this;var Y=0;for(var V=0;V<C.length;V++)A=(Z.words[V]|0)-(C.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;for(;Y!==0&&V<Z.length;V++)A=(Z.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;if(Y===0&&V<Z.length&&Z!==this)for(;V<Z.length;V++)this.words[V]=Z.words[V];if(this.length=Math.max(this.length,V),Z!==this)this.negative=1;return this.strip()},Q.prototype.sub=function(U){return this.clone().isub(U)};function _(U,A,X){X.negative=A.negative^U.negative;var Z=U.length+A.length|0;X.length=Z,Z=Z-1|0;var C=U.words[0]|0,Y=A.words[0]|0,V=C*Y,G=V&67108863,O=V/67108864|0;X.words[0]=G;for(var J=1;J<Z;J++){var z=O>>>26,W=O&67108863,j=Math.min(J,A.length-1);for(var N=Math.max(0,J-U.length+1);N<=j;N++){var p=J-N|0;C=U.words[p]|0,Y=A.words[N]|0,V=C*Y+W,z+=V/67108864|0,W=V&67108863}X.words[J]=W|0,O=z|0}if(O!==0)X.words[J]=O|0;else X.length--;return X.strip()}var k=function(U,A,X){var Z=U.words,C=A.words,Y=X.words,V=0,G,O,J,z=Z[0]|0,W=z&8191,j=z>>>13,N=Z[1]|0,p=N&8191,n=N>>>13,E0=Z[2]|0,r=E0&8191,d=E0>>>13,A0=Z[3]|0,t=A0&8191,i=A0>>>13,N0=Z[4]|0,y=N0&8191,h=N0>>>13,$0=Z[5]|0,m=$0&8191,a=$0>>>13,W0=Z[6]|0,c=W0&8191,o=W0>>>13,x0=Z[7]|0,s=x0&8191,Z0=x0>>>13,w0=Z[8]|0,S0=w0&8191,V0=w0>>>13,m0=Z[9]|0,J0=m0&8191,L0=m0>>>13,a0=C[0]|0,K0=a0&8191,D0=a0>>>13,WU=C[1]|0,F0=WU&8191,k0=WU>>>13,FU=C[2]|0,_0=FU&8191,M0=FU>>>13,KU=C[3]|0,j0=KU&8191,z0=KU>>>13,SU=C[4]|0,v0=SU&8191,B0=SU>>>13,VU=C[5]|0,T0=VU&8191,x=VU>>>13,l=C[6]|0,e=l&8191,U0=l>>>13,f0=C[7]|0,Y0=f0&8191,R0=f0>>>13,r0=C[8]|0,q0=r0&8191,g0=r0>>>13,HU=C[9]|0,P0=HU&8191,H0=HU>>>13;X.negative=U.negative^A.negative,X.length=19,G=Math.imul(W,K0),O=Math.imul(W,D0),O=O+Math.imul(j,K0)|0,J=Math.imul(j,D0);var e0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(e0>>>26)|0,e0&=67108863,G=Math.imul(p,K0),O=Math.imul(p,D0),O=O+Math.imul(n,K0)|0,J=Math.imul(n,D0),G=G+Math.imul(W,F0)|0,O=O+Math.imul(W,k0)|0,O=O+Math.imul(j,F0)|0,J=J+Math.imul(j,k0)|0;var c0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,K0),O=Math.imul(r,D0),O=O+Math.imul(d,K0)|0,J=Math.imul(d,D0),G=G+Math.imul(p,F0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,F0)|0,J=J+Math.imul(n,k0)|0,G=G+Math.imul(W,_0)|0,O=O+Math.imul(W,M0)|0,O=O+Math.imul(j,_0)|0,J=J+Math.imul(j,M0)|0;var y0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(t,K0),O=Math.imul(t,D0),O=O+Math.imul(i,K0)|0,J=Math.imul(i,D0),G=G+Math.imul(r,F0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(d,F0)|0,J=J+Math.imul(d,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,M0)|0,O=O+Math.imul(n,_0)|0,J=J+Math.imul(n,M0)|0,G=G+Math.imul(W,j0)|0,O=O+Math.imul(W,z0)|0,O=O+Math.imul(j,j0)|0,J=J+Math.imul(j,z0)|0;var o0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(o0>>>26)|0,o0&=67108863,G=Math.imul(y,K0),O=Math.imul(y,D0),O=O+Math.imul(h,K0)|0,J=Math.imul(h,D0),G=G+Math.imul(t,F0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(i,F0)|0,J=J+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,M0)|0,O=O+Math.imul(d,_0)|0,J=J+Math.imul(d,M0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,j0)|0,J=J+Math.imul(n,z0)|0,G=G+Math.imul(W,v0)|0,O=O+Math.imul(W,B0)|0,O=O+Math.imul(j,v0)|0,J=J+Math.imul(j,B0)|0;var b0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(b0>>>26)|0,b0&=67108863,G=Math.imul(m,K0),O=Math.imul(m,D0),O=O+Math.imul(a,K0)|0,J=Math.imul(a,D0),G=G+Math.imul(y,F0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,F0)|0,J=J+Math.imul(h,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,M0)|0,O=O+Math.imul(i,_0)|0,J=J+Math.imul(i,M0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(d,j0)|0,J=J+Math.imul(d,z0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,v0)|0,J=J+Math.imul(n,B0)|0,G=G+Math.imul(W,T0)|0,O=O+Math.imul(W,x)|0,O=O+Math.imul(j,T0)|0,J=J+Math.imul(j,x)|0;var i0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,K0),O=Math.imul(c,D0),O=O+Math.imul(o,K0)|0,J=Math.imul(o,D0),G=G+Math.imul(m,F0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(a,F0)|0,J=J+Math.imul(a,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,M0)|0,O=O+Math.imul(h,_0)|0,J=J+Math.imul(h,M0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(i,j0)|0,J=J+Math.imul(i,z0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(d,v0)|0,J=J+Math.imul(d,B0)|0,G=G+Math.imul(p,T0)|0,O=O+Math.imul(p,x)|0,O=O+Math.imul(n,T0)|0,J=J+Math.imul(n,x)|0,G=G+Math.imul(W,e)|0,O=O+Math.imul(W,U0)|0,O=O+Math.imul(j,e)|0,J=J+Math.imul(j,U0)|0;var UU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,K0),O=Math.imul(s,D0),O=O+Math.imul(Z0,K0)|0,J=Math.imul(Z0,D0),G=G+Math.imul(c,F0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,F0)|0,J=J+Math.imul(o,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,M0)|0,O=O+Math.imul(a,_0)|0,J=J+Math.imul(a,M0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,j0)|0,J=J+Math.imul(h,z0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(i,v0)|0,J=J+Math.imul(i,B0)|0,G=G+Math.imul(r,T0)|0,O=O+Math.imul(r,x)|0,O=O+Math.imul(d,T0)|0,J=J+Math.imul(d,x)|0,G=G+Math.imul(p,e)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,e)|0,J=J+Math.imul(n,U0)|0,G=G+Math.imul(W,Y0)|0,O=O+Math.imul(W,R0)|0,O=O+Math.imul(j,Y0)|0,J=J+Math.imul(j,R0)|0;var OU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(S0,K0),O=Math.imul(S0,D0),O=O+Math.imul(V0,K0)|0,J=Math.imul(V0,D0),G=G+Math.imul(s,F0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,F0)|0,J=J+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,M0)|0,O=O+Math.imul(o,_0)|0,J=J+Math.imul(o,M0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(a,j0)|0,J=J+Math.imul(a,z0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,v0)|0,J=J+Math.imul(h,B0)|0,G=G+Math.imul(t,T0)|0,O=O+Math.imul(t,x)|0,O=O+Math.imul(i,T0)|0,J=J+Math.imul(i,x)|0,G=G+Math.imul(r,e)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(d,e)|0,J=J+Math.imul(d,U0)|0,G=G+Math.imul(p,Y0)|0,O=O+Math.imul(p,R0)|0,O=O+Math.imul(n,Y0)|0,J=J+Math.imul(n,R0)|0,G=G+Math.imul(W,q0)|0,O=O+Math.imul(W,g0)|0,O=O+Math.imul(j,q0)|0,J=J+Math.imul(j,g0)|0;var ZU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(J0,K0),O=Math.imul(J0,D0),O=O+Math.imul(L0,K0)|0,J=Math.imul(L0,D0),G=G+Math.imul(S0,F0)|0,O=O+Math.imul(S0,k0)|0,O=O+Math.imul(V0,F0)|0,J=J+Math.imul(V0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,M0)|0,O=O+Math.imul(Z0,_0)|0,J=J+Math.imul(Z0,M0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,j0)|0,J=J+Math.imul(o,z0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(a,v0)|0,J=J+Math.imul(a,B0)|0,G=G+Math.imul(y,T0)|0,O=O+Math.imul(y,x)|0,O=O+Math.imul(h,T0)|0,J=J+Math.imul(h,x)|0,G=G+Math.imul(t,e)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(i,e)|0,J=J+Math.imul(i,U0)|0,G=G+Math.imul(r,Y0)|0,O=O+Math.imul(r,R0)|0,O=O+Math.imul(d,Y0)|0,J=J+Math.imul(d,R0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,g0)|0,O=O+Math.imul(n,q0)|0,J=J+Math.imul(n,g0)|0,G=G+Math.imul(W,P0)|0,O=O+Math.imul(W,H0)|0,O=O+Math.imul(j,P0)|0,J=J+Math.imul(j,H0)|0;var AU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(J0,F0),O=Math.imul(J0,k0),O=O+Math.imul(L0,F0)|0,J=Math.imul(L0,k0),G=G+Math.imul(S0,_0)|0,O=O+Math.imul(S0,M0)|0,O=O+Math.imul(V0,_0)|0,J=J+Math.imul(V0,M0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,j0)|0,J=J+Math.imul(Z0,z0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,v0)|0,J=J+Math.imul(o,B0)|0,G=G+Math.imul(m,T0)|0,O=O+Math.imul(m,x)|0,O=O+Math.imul(a,T0)|0,J=J+Math.imul(a,x)|0,G=G+Math.imul(y,e)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,e)|0,J=J+Math.imul(h,U0)|0,G=G+Math.imul(t,Y0)|0,O=O+Math.imul(t,R0)|0,O=O+Math.imul(i,Y0)|0,J=J+Math.imul(i,R0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,g0)|0,O=O+Math.imul(d,q0)|0,J=J+Math.imul(d,g0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,H0)|0,O=O+Math.imul(n,P0)|0,J=J+Math.imul(n,H0)|0;var $U=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(J0,_0),O=Math.imul(J0,M0),O=O+Math.imul(L0,_0)|0,J=Math.imul(L0,M0),G=G+Math.imul(S0,j0)|0,O=O+Math.imul(S0,z0)|0,O=O+Math.imul(V0,j0)|0,J=J+Math.imul(V0,z0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,v0)|0,J=J+Math.imul(Z0,B0)|0,G=G+Math.imul(c,T0)|0,O=O+Math.imul(c,x)|0,O=O+Math.imul(o,T0)|0,J=J+Math.imul(o,x)|0,G=G+Math.imul(m,e)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(a,e)|0,J=J+Math.imul(a,U0)|0,G=G+Math.imul(y,Y0)|0,O=O+Math.imul(y,R0)|0,O=O+Math.imul(h,Y0)|0,J=J+Math.imul(h,R0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,g0)|0,O=O+Math.imul(i,q0)|0,J=J+Math.imul(i,g0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,H0)|0,O=O+Math.imul(d,P0)|0,J=J+Math.imul(d,H0)|0;var IU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,G=Math.imul(J0,j0),O=Math.imul(J0,z0),O=O+Math.imul(L0,j0)|0,J=Math.imul(L0,z0),G=G+Math.imul(S0,v0)|0,O=O+Math.imul(S0,B0)|0,O=O+Math.imul(V0,v0)|0,J=J+Math.imul(V0,B0)|0,G=G+Math.imul(s,T0)|0,O=O+Math.imul(s,x)|0,O=O+Math.imul(Z0,T0)|0,J=J+Math.imul(Z0,x)|0,G=G+Math.imul(c,e)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,e)|0,J=J+Math.imul(o,U0)|0,G=G+Math.imul(m,Y0)|0,O=O+Math.imul(m,R0)|0,O=O+Math.imul(a,Y0)|0,J=J+Math.imul(a,R0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,g0)|0,O=O+Math.imul(h,q0)|0,J=J+Math.imul(h,g0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,H0)|0,O=O+Math.imul(i,P0)|0,J=J+Math.imul(i,H0)|0;var CU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(CU>>>26)|0,CU&=67108863,G=Math.imul(J0,v0),O=Math.imul(J0,B0),O=O+Math.imul(L0,v0)|0,J=Math.imul(L0,B0),G=G+Math.imul(S0,T0)|0,O=O+Math.imul(S0,x)|0,O=O+Math.imul(V0,T0)|0,J=J+Math.imul(V0,x)|0,G=G+Math.imul(s,e)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,e)|0,J=J+Math.imul(Z0,U0)|0,G=G+Math.imul(c,Y0)|0,O=O+Math.imul(c,R0)|0,O=O+Math.imul(o,Y0)|0,J=J+Math.imul(o,R0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,g0)|0,O=O+Math.imul(a,q0)|0,J=J+Math.imul(a,g0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,H0)|0,O=O+Math.imul(h,P0)|0,J=J+Math.imul(h,H0)|0;var QU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(J0,T0),O=Math.imul(J0,x),O=O+Math.imul(L0,T0)|0,J=Math.imul(L0,x),G=G+Math.imul(S0,e)|0,O=O+Math.imul(S0,U0)|0,O=O+Math.imul(V0,e)|0,J=J+Math.imul(V0,U0)|0,G=G+Math.imul(s,Y0)|0,O=O+Math.imul(s,R0)|0,O=O+Math.imul(Z0,Y0)|0,J=J+Math.imul(Z0,R0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,g0)|0,O=O+Math.imul(o,q0)|0,J=J+Math.imul(o,g0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,H0)|0,O=O+Math.imul(a,P0)|0,J=J+Math.imul(a,H0)|0;var XU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(J0,e),O=Math.imul(J0,U0),O=O+Math.imul(L0,e)|0,J=Math.imul(L0,U0),G=G+Math.imul(S0,Y0)|0,O=O+Math.imul(S0,R0)|0,O=O+Math.imul(V0,Y0)|0,J=J+Math.imul(V0,R0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,g0)|0,O=O+Math.imul(Z0,q0)|0,J=J+Math.imul(Z0,g0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,H0)|0,O=O+Math.imul(o,P0)|0,J=J+Math.imul(o,H0)|0;var GU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(J0,Y0),O=Math.imul(J0,R0),O=O+Math.imul(L0,Y0)|0,J=Math.imul(L0,R0),G=G+Math.imul(S0,q0)|0,O=O+Math.imul(S0,g0)|0,O=O+Math.imul(V0,q0)|0,J=J+Math.imul(V0,g0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,H0)|0,O=O+Math.imul(Z0,P0)|0,J=J+Math.imul(Z0,H0)|0;var EU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(J0,q0),O=Math.imul(J0,g0),O=O+Math.imul(L0,q0)|0,J=Math.imul(L0,g0),G=G+Math.imul(S0,P0)|0,O=O+Math.imul(S0,H0)|0,O=O+Math.imul(V0,P0)|0,J=J+Math.imul(V0,H0)|0;var JU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(J0,P0),O=Math.imul(J0,H0),O=O+Math.imul(L0,P0)|0,J=Math.imul(L0,H0);var YU=(V+G|0)+((O&8191)<<13)|0;if(V=(J+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,Y[0]=e0,Y[1]=c0,Y[2]=y0,Y[3]=o0,Y[4]=b0,Y[5]=i0,Y[6]=UU,Y[7]=OU,Y[8]=ZU,Y[9]=AU,Y[10]=$U,Y[11]=IU,Y[12]=CU,Y[13]=QU,Y[14]=XU,Y[15]=GU,Y[16]=EU,Y[17]=JU,Y[18]=YU,V!==0)Y[19]=V,X.length++;return X};if(!Math.imul)k=_;function B(U,A,X){X.negative=A.negative^U.negative,X.length=U.length+A.length;var Z=0,C=0;for(var Y=0;Y<X.length-1;Y++){var V=C;C=0;var G=Z&67108863,O=Math.min(Y,A.length-1);for(var J=Math.max(0,Y-U.length+1);J<=O;J++){var z=Y-J,W=U.words[z]|0,j=A.words[J]|0,N=W*j,p=N&67108863;V=V+(N/67108864|0)|0,p=p+G|0,G=p&67108863,V=V+(p>>>26)|0,C+=V>>>26,V&=67108863}X.words[Y]=G,Z=V,V=C}if(Z!==0)X.words[Y]=Z;else X.length--;return X.strip()}function v(U,A,X){var Z=new g;return Z.mulp(U,A,X)}Q.prototype.mulTo=function(U,A){var X,Z=this.length+U.length;if(this.length===10&&U.length===10)X=k(this,U,A);else if(Z<63)X=_(this,U,A);else if(Z<1024)X=B(this,U,A);else X=v(this,U,A);return X};function g(U,A){this.x=U,this.y=A}g.prototype.makeRBT=function(U){var A=Array(U),X=Q.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)A[Z]=this.revBin(Z,X,U);return A},g.prototype.revBin=function(U,A,X){if(U===0||U===X-1)return U;var Z=0;for(var C=0;C<A;C++)Z|=(U&1)<<A-C-1,U>>=1;return Z},g.prototype.permute=function(U,A,X,Z,C,Y){for(var V=0;V<Y;V++)Z[V]=A[U[V]],C[V]=X[U[V]]},g.prototype.transform=function(U,A,X,Z,C,Y){this.permute(Y,U,A,X,Z,C);for(var V=1;V<C;V<<=1){var G=V<<1,O=Math.cos(2*Math.PI/G),J=Math.sin(2*Math.PI/G);for(var z=0;z<C;z+=G){var W=O,j=J;for(var N=0;N<V;N++){var p=X[z+N],n=Z[z+N],E0=X[z+N+V],r=Z[z+N+V],d=W*E0-j*r;if(r=W*r+j*E0,E0=d,X[z+N]=p+E0,Z[z+N]=n+r,X[z+N+V]=p-E0,Z[z+N+V]=n-r,N!==G)d=O*W-J*j,j=O*j+J*W,W=d}}}},g.prototype.guessLen13b=function(U,A){var X=Math.max(A,U)|1,Z=X&1,C=0;for(X=X/2|0;X;X=X>>>1)C++;return 1<<C+1+Z},g.prototype.conjugate=function(U,A,X){if(X<=1)return;for(var Z=0;Z<X/2;Z++){var C=U[Z];U[Z]=U[X-Z-1],U[X-Z-1]=C,C=A[Z],A[Z]=-A[X-Z-1],A[X-Z-1]=-C}},g.prototype.normalize13b=function(U,A){var X=0;for(var Z=0;Z<A/2;Z++){var C=Math.round(U[2*Z+1]/A)*8192+Math.round(U[2*Z]/A)+X;if(U[Z]=C&67108863,C<67108864)X=0;else X=C/67108864|0}return U},g.prototype.convert13b=function(U,A,X,Z){var C=0;for(var Y=0;Y<A;Y++)C=C+(U[Y]|0),X[2*Y]=C&8191,C=C>>>13,X[2*Y+1]=C&8191,C=C>>>13;for(Y=2*A;Y<Z;++Y)X[Y]=0;S(C===0),S((C&-8192)===0)},g.prototype.stub=function(U){var A=Array(U);for(var X=0;X<U;X++)A[X]=0;return A},g.prototype.mulp=function(U,A,X){var Z=2*this.guessLen13b(U.length,A.length),C=this.makeRBT(Z),Y=this.stub(Z),V=Array(Z),G=Array(Z),O=Array(Z),J=Array(Z),z=Array(Z),W=Array(Z),j=X.words;j.length=Z,this.convert13b(U.words,U.length,V,Z),this.convert13b(A.words,A.length,J,Z),this.transform(V,Y,G,O,Z,C),this.transform(J,Y,z,W,Z,C);for(var N=0;N<Z;N++){var p=G[N]*z[N]-O[N]*W[N];O[N]=G[N]*W[N]+O[N]*z[N],G[N]=p}return this.conjugate(G,O,Z),this.transform(G,O,j,Y,Z,C),this.conjugate(j,Y,Z),this.normalize13b(j,Z),X.negative=U.negative^A.negative,X.length=U.length+A.length,X.strip()},Q.prototype.mul=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),this.mulTo(U,A)},Q.prototype.mulf=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),v(this,U,A)},Q.prototype.imul=function(U){return this.clone().mulTo(U,this)},Q.prototype.imuln=function(U){S(typeof U==="number"),S(U<67108864);var A=0;for(var X=0;X<this.length;X++){var Z=(this.words[X]|0)*U,C=(Z&67108863)+(A&67108863);A>>=26,A+=Z/67108864|0,A+=C>>>26,this.words[X]=C&67108863}if(A!==0)this.words[X]=A,this.length++;return this.length=U===0?1:this.length,this},Q.prototype.muln=function(U){return this.clone().imuln(U)},Q.prototype.sqr=function(){return this.mul(this)},Q.prototype.isqr=function(){return this.imul(this.clone())},Q.prototype.pow=function(U){var A=P(U);if(A.length===0)return new Q(1);var X=this;for(var Z=0;Z<A.length;Z++,X=X.sqr())if(A[Z]!==0)break;if(++Z<A.length)for(var C=X.sqr();Z<A.length;Z++,C=C.sqr()){if(A[Z]===0)continue;X=X.mul(C)}return X},Q.prototype.iushln=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=67108863>>>26-A<<26-A,C;if(A!==0){var Y=0;for(C=0;C<this.length;C++){var V=this.words[C]&Z,G=(this.words[C]|0)-V<<A;this.words[C]=G|Y,Y=V>>>26-A}if(Y)this.words[C]=Y,this.length++}if(X!==0){for(C=this.length-1;C>=0;C--)this.words[C+X]=this.words[C];for(C=0;C<X;C++)this.words[C]=0;this.length+=X}return this.strip()},Q.prototype.ishln=function(U){return S(this.negative===0),this.iushln(U)},Q.prototype.iushrn=function(U,A,X){S(typeof U==="number"&&U>=0);var Z;if(A)Z=(A-A%26)/26;else Z=0;var C=U%26,Y=Math.min((U-C)/26,this.length),V=67108863^67108863>>>C<<C,G=X;if(Z-=Y,Z=Math.max(0,Z),G){for(var O=0;O<Y;O++)G.words[O]=this.words[O];G.length=Y}if(Y===0);else if(this.length>Y){this.length-=Y;for(O=0;O<this.length;O++)this.words[O]=this.words[O+Y]}else this.words[0]=0,this.length=1;var J=0;for(O=this.length-1;O>=0&&(J!==0||O>=Z);O--){var z=this.words[O]|0;this.words[O]=J<<26-C|z>>>C,J=z&V}if(G&&J!==0)G.words[G.length++]=J;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Q.prototype.ishrn=function(U,A,X){return S(this.negative===0),this.iushrn(U,A,X)},Q.prototype.shln=function(U){return this.clone().ishln(U)},Q.prototype.ushln=function(U){return this.clone().iushln(U)},Q.prototype.shrn=function(U){return this.clone().ishrn(U)},Q.prototype.ushrn=function(U){return this.clone().iushrn(U)},Q.prototype.testn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return!1;var C=this.words[X];return!!(C&Z)},Q.prototype.imaskn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26;if(S(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(A!==0)X++;if(this.length=Math.min(X,this.length),A!==0){var Z=67108863^67108863>>>A<<A;this.words[this.length-1]&=Z}return this.strip()},Q.prototype.maskn=function(U){return this.clone().imaskn(U)},Q.prototype.iaddn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},Q.prototype._iaddn=function(U){this.words[0]+=U;for(var A=0;A<this.length&&this.words[A]>=67108864;A++)if(this.words[A]-=67108864,A===this.length-1)this.words[A+1]=1;else this.words[A+1]++;return this.length=Math.max(this.length,A+1),this},Q.prototype.isubn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var A=0;A<this.length&&this.words[A]<0;A++)this.words[A]+=67108864,this.words[A+1]-=1;return this.strip()},Q.prototype.addn=function(U){return this.clone().iaddn(U)},Q.prototype.subn=function(U){return this.clone().isubn(U)},Q.prototype.iabs=function(){return this.negative=0,this},Q.prototype.abs=function(){return this.clone().iabs()},Q.prototype._ishlnsubmul=function(U,A,X){var Z=U.length+X,C;this._expand(Z);var Y,V=0;for(C=0;C<U.length;C++){Y=(this.words[C+X]|0)+V;var G=(U.words[C]|0)*A;Y-=G&67108863,V=(Y>>26)-(G/67108864|0),this.words[C+X]=Y&67108863}for(;C<this.length-X;C++)Y=(this.words[C+X]|0)+V,V=Y>>26,this.words[C+X]=Y&67108863;if(V===0)return this.strip();S(V===-1),V=0;for(C=0;C<this.length;C++)Y=-(this.words[C]|0)+V,V=Y>>26,this.words[C]=Y&67108863;return this.negative=1,this.strip()},Q.prototype._wordDiv=function(U,A){var X=this.length-U.length,Z=this.clone(),C=U,Y=C.words[C.length-1]|0,V=this._countBits(Y);if(X=26-V,X!==0)C=C.ushln(X),Z.iushln(X),Y=C.words[C.length-1]|0;var G=Z.length-C.length,O;if(A!=="mod"){O=new Q(null),O.length=G+1,O.words=Array(O.length);for(var J=0;J<O.length;J++)O.words[J]=0}var z=Z.clone()._ishlnsubmul(C,1,G);if(z.negative===0){if(Z=z,O)O.words[G]=1}for(var W=G-1;W>=0;W--){var j=(Z.words[C.length+W]|0)*67108864+(Z.words[C.length+W-1]|0);j=Math.min(j/Y|0,67108863),Z._ishlnsubmul(C,j,W);while(Z.negative!==0)if(j--,Z.negative=0,Z._ishlnsubmul(C,1,W),!Z.isZero())Z.negative^=1;if(O)O.words[W]=j}if(O)O.strip();if(Z.strip(),A!=="div"&&X!==0)Z.iushrn(X);return{div:O||null,mod:Z}},Q.prototype.divmod=function(U,A,X){if(S(!U.isZero()),this.isZero())return{div:new Q(0),mod:new Q(0)};var Z,C,Y;if(this.negative!==0&&U.negative===0){if(Y=this.neg().divmod(U,A),A!=="mod")Z=Y.div.neg();if(A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.iadd(U)}return{div:Z,mod:C}}if(this.negative===0&&U.negative!==0){if(Y=this.divmod(U.neg(),A),A!=="mod")Z=Y.div.neg();return{div:Z,mod:Y.mod}}if((this.negative&U.negative)!==0){if(Y=this.neg().divmod(U.neg(),A),A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.isub(U)}return{div:Y.div,mod:C}}if(U.length>this.length||this.cmp(U)<0)return{div:new Q(0),mod:this};if(U.length===1){if(A==="div")return{div:this.divn(U.words[0]),mod:null};if(A==="mod")return{div:null,mod:new Q(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new Q(this.modn(U.words[0]))}}return this._wordDiv(U,A)},Q.prototype.div=function(U){return this.divmod(U,"div",!1).div},Q.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},Q.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},Q.prototype.divRound=function(U){var A=this.divmod(U);if(A.mod.isZero())return A.div;var X=A.div.negative!==0?A.mod.isub(U):A.mod,Z=U.ushrn(1),C=U.andln(1),Y=X.cmp(Z);if(Y<0||C===1&&Y===0)return A.div;return A.div.negative!==0?A.div.isubn(1):A.div.iaddn(1)},Q.prototype.modn=function(U){S(U<=67108863);var A=67108864%U,X=0;for(var Z=this.length-1;Z>=0;Z--)X=(A*X+(this.words[Z]|0))%U;return X},Q.prototype.idivn=function(U){S(U<=67108863);var A=0;for(var X=this.length-1;X>=0;X--){var Z=(this.words[X]|0)+A*67108864;this.words[X]=Z/U|0,A=Z%U}return this.strip()},Q.prototype.divn=function(U){return this.clone().idivn(U)},Q.prototype.egcd=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=new Q(0),V=new Q(1),G=0;while(A.isEven()&&X.isEven())A.iushrn(1),X.iushrn(1),++G;var O=X.clone(),J=A.clone();while(!A.isZero()){for(var z=0,W=1;(A.words[0]&W)===0&&z<26;++z,W<<=1);if(z>0){A.iushrn(z);while(z-- >0){if(Z.isOdd()||C.isOdd())Z.iadd(O),C.isub(J);Z.iushrn(1),C.iushrn(1)}}for(var j=0,N=1;(X.words[0]&N)===0&&j<26;++j,N<<=1);if(j>0){X.iushrn(j);while(j-- >0){if(Y.isOdd()||V.isOdd())Y.iadd(O),V.isub(J);Y.iushrn(1),V.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(Y),C.isub(V);else X.isub(A),Y.isub(Z),V.isub(C)}return{a:Y,b:V,gcd:X.iushln(G)}},Q.prototype._invmp=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=X.clone();while(A.cmpn(1)>0&&X.cmpn(1)>0){for(var V=0,G=1;(A.words[0]&G)===0&&V<26;++V,G<<=1);if(V>0){A.iushrn(V);while(V-- >0){if(Z.isOdd())Z.iadd(Y);Z.iushrn(1)}}for(var O=0,J=1;(X.words[0]&J)===0&&O<26;++O,J<<=1);if(O>0){X.iushrn(O);while(O-- >0){if(C.isOdd())C.iadd(Y);C.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(C);else X.isub(A),C.isub(Z)}var z;if(A.cmpn(1)===0)z=Z;else z=C;if(z.cmpn(0)<0)z.iadd(U);return z},Q.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var A=this.clone(),X=U.clone();A.negative=0,X.negative=0;for(var Z=0;A.isEven()&&X.isEven();Z++)A.iushrn(1),X.iushrn(1);do{while(A.isEven())A.iushrn(1);while(X.isEven())X.iushrn(1);var C=A.cmp(X);if(C<0){var Y=A;A=X,X=Y}else if(C===0||X.cmpn(1)===0)break;A.isub(X)}while(!0);return X.iushln(Z)},Q.prototype.invm=function(U){return this.egcd(U).a.umod(U)},Q.prototype.isEven=function(){return(this.words[0]&1)===0},Q.prototype.isOdd=function(){return(this.words[0]&1)===1},Q.prototype.andln=function(U){return this.words[0]&U},Q.prototype.bincn=function(U){S(typeof U==="number");var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return this._expand(X+1),this.words[X]|=Z,this;var C=Z;for(var Y=X;C!==0&&Y<this.length;Y++){var V=this.words[Y]|0;V+=C,C=V>>>26,V&=67108863,this.words[Y]=V}if(C!==0)this.words[Y]=C,this.length++;return this},Q.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Q.prototype.cmpn=function(U){var A=U<0;if(this.negative!==0&&!A)return-1;if(this.negative===0&&A)return 1;this.strip();var X;if(this.length>1)X=1;else{if(A)U=-U;S(U<=67108863,"Number is too big");var Z=this.words[0]|0;X=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-X|0;return X},Q.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var A=this.ucmp(U);if(this.negative!==0)return-A|0;return A},Q.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var A=0;for(var X=this.length-1;X>=0;X--){var Z=this.words[X]|0,C=U.words[X]|0;if(Z===C)continue;if(Z<C)A=-1;else if(Z>C)A=1;break}return A},Q.prototype.gtn=function(U){return this.cmpn(U)===1},Q.prototype.gt=function(U){return this.cmp(U)===1},Q.prototype.gten=function(U){return this.cmpn(U)>=0},Q.prototype.gte=function(U){return this.cmp(U)>=0},Q.prototype.ltn=function(U){return this.cmpn(U)===-1},Q.prototype.lt=function(U){return this.cmp(U)===-1},Q.prototype.lten=function(U){return this.cmpn(U)<=0},Q.prototype.lte=function(U){return this.cmp(U)<=0},Q.prototype.eqn=function(U){return this.cmpn(U)===0},Q.prototype.eq=function(U){return this.cmp(U)===0},Q.red=function(U){return new u(U)},Q.prototype.toRed=function(U){return S(!this.red,"Already a number in reduction context"),S(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},Q.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Q.prototype._forceRed=function(U){return this.red=U,this},Q.prototype.forceRed=function(U){return S(!this.red,"Already a number in reduction context"),this._forceRed(U)},Q.prototype.redAdd=function(U){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},Q.prototype.redIAdd=function(U){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},Q.prototype.redSub=function(U){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},Q.prototype.redISub=function(U){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},Q.prototype.redShl=function(U){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},Q.prototype.redMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},Q.prototype.redIMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},Q.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Q.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Q.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Q.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Q.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Q.prototype.redPow=function(U){return S(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,A){this.name=U,this.p=new Q(A,16),this.n=this.p.bitLength(),this.k=new Q(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new Q(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var A=U,X;do this.split(A,this.tmp),A=this.imulK(A),A=A.iadd(this.tmp),X=A.bitLength();while(X>this.n);var Z=X<this.n?-1:A.ucmp(this.p);if(Z===0)A.words[0]=0,A.length=1;else if(Z>0)A.isub(this.p);else if(A.strip!==void 0)A.strip();else A._strip();return A},w.prototype.split=function(U,A){U.iushrn(this.n,0,A)},w.prototype.imulK=function(U){return U.imul(this.k)};function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(b,w),b.prototype.split=function(U,A){var X=4194303,Z=Math.min(U.length,9);for(var C=0;C<Z;C++)A.words[C]=U.words[C];if(A.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var Y=U.words[9];A.words[A.length++]=Y&X;for(C=10;C<U.length;C++){var V=U.words[C]|0;U.words[C-10]=(V&X)<<4|Y>>>22,Y=V}if(Y>>>=22,U.words[C-10]=Y,Y===0&&U.length>10)U.length-=10;else U.length-=9},b.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var A=0;for(var X=0;X<U.length;X++){var Z=U.words[X]|0;A+=Z*977,U.words[X]=A&67108863,A=Z*64+(A/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function I0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(I0,w);function X0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K(X0,w);function C0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(C0,w),C0.prototype.imulK=function(U){var A=0;for(var X=0;X<U.length;X++){var Z=(U.words[X]|0)*19+A,C=Z&67108863;Z>>>=26,U.words[X]=C,A=Z}if(A!==0)U.words[U.length++]=A;return U},Q._prime=function(U){if(f[U])return f[U];var A;if(U==="k256")A=new b;else if(U==="p224")A=new I0;else if(U==="p192")A=new X0;else if(U==="p25519")A=new C0;else throw Error("Unknown prime "+U);return f[U]=A,A};function u(U){if(typeof U==="string"){var A=Q._prime(U);this.m=A.p,this.prime=A}else S(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){S(U.negative===0,"red works only with positives"),S(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,A){S((U.negative|A.negative)===0,"red works only with positives"),S(U.red&&U.red===A.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,A){this._verify2(U,A);var X=U.add(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},u.prototype.iadd=function(U,A){this._verify2(U,A);var X=U.iadd(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X},u.prototype.sub=function(U,A){this._verify2(U,A);var X=U.sub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},u.prototype.isub=function(U,A){this._verify2(U,A);var X=U.isub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X},u.prototype.shl=function(U,A){return this._verify1(U),this.imod(U.ushln(A))},u.prototype.imul=function(U,A){return this._verify2(U,A),this.imod(U.imul(A))},u.prototype.mul=function(U,A){return this._verify2(U,A),this.imod(U.mul(A))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var A=this.m.andln(3);if(S(A%2===1),A===3){var X=this.m.add(new Q(1)).iushrn(2);return this.pow(U,X)}var Z=this.m.subn(1),C=0;while(!Z.isZero()&&Z.andln(1)===0)C++,Z.iushrn(1);S(!Z.isZero());var Y=new Q(1).toRed(this),V=Y.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new Q(2*O*O).toRed(this);while(this.pow(O,G).cmp(V)!==0)O.redIAdd(V);var J=this.pow(O,Z),z=this.pow(U,Z.addn(1).iushrn(1)),W=this.pow(U,Z),j=C;while(W.cmp(Y)!==0){var N=W;for(var p=0;N.cmp(Y)!==0;p++)N=N.redSqr();S(p<j);var n=this.pow(J,new Q(1).iushln(j-p-1));z=z.redMul(n),J=n.redSqr(),W=W.redMul(J),j=p}return z},u.prototype.invm=function(U){var A=U._invmp(this.m);if(A.negative!==0)return A.negative=0,this.imod(A).redNeg();else return this.imod(A)},u.prototype.pow=function(U,A){if(A.isZero())return new Q(1).toRed(this);if(A.cmpn(1)===0)return U.clone();var X=4,Z=Array(1<<X);Z[0]=new Q(1).toRed(this),Z[1]=U;for(var C=2;C<Z.length;C++)Z[C]=this.mul(Z[C-1],U);var Y=Z[0],V=0,G=0,O=A.bitLength()%26;if(O===0)O=26;for(C=A.length-1;C>=0;C--){var J=A.words[C];for(var z=O-1;z>=0;z--){var W=J>>z&1;if(Y!==Z[0])Y=this.sqr(Y);if(W===0&&V===0){G=0;continue}if(V<<=1,V|=W,G++,G!==X&&(C!==0||z!==0))continue;Y=this.mul(Y,Z[V]),G=0,V=0}O=26}return Y},u.prototype.convertTo=function(U){var A=U.umod(this.m);return A===U?A.clone():A},u.prototype.convertFrom=function(U){var A=U.clone();return A.red=null,A},Q.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Q(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)}K(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var A=this.imod(U.mul(this.rinv));return A.red=null,A},O0.prototype.imul=function(U,A){if(U.isZero()||A.isZero())return U.words[0]=0,U.length=1,U;var X=U.imul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.mul=function(U,A){if(U.isZero()||A.isZero())return new Q(0)._forceRed(this);var X=U.mul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.invm=function(U){var A=this.imod(U._invmp(this.m).mul(this.r2));return A._forceRed(this)}})(typeof I>"u"||I,$)}),UO=Q0(($,I)=>{I.exports=E;function E(L,S){if(!L)throw Error(S||"Assertion failed")}E.equal=function(L,S,K){if(L!=S)throw Error(K||"Assertion failed: "+L+" != "+S)}}),bI=Q0(($)=>{var I=$;function E(K,Q){if(Array.isArray(K))return K.slice();if(!K)return[];var T=[];if(typeof K!=="string"){for(var M=0;M<K.length;M++)T[M]=K[M]|0;return T}if(Q==="hex"){if(K=K.replace(/[^a-z0-9]+/ig,""),K.length%2!==0)K="0"+K;for(var M=0;M<K.length;M+=2)T.push(parseInt(K[M]+K[M+1],16))}else for(var M=0;M<K.length;M++){var H=K.charCodeAt(M),F=H>>8,R=H&255;if(F)T.push(F,R);else T.push(R)}return T}I.toArray=E;function L(K){if(K.length===1)return"0"+K;else return K}I.zero2=L;function S(K){var Q="";for(var T=0;T<K.length;T++)Q+=L(K[T].toString(16));return Q}I.toHex=S,I.encode=function(K,Q){if(Q==="hex")return S(K);else return K}}),wU=Q0(($)=>{var I=$,E=sU(),L=UO(),S=bI();I.assert=L,I.toArray=S.toArray,I.zero2=S.zero2,I.toHex=S.toHex,I.encode=S.encode;function K(F,R,D){var q=Array(Math.max(F.bitLength(),D)+1),P;for(P=0;P<q.length;P+=1)q[P]=0;var _=1<<R+1,k=F.clone();for(P=0;P<q.length;P++){var B,v=k.andln(_-1);if(k.isOdd()){if(v>(_>>1)-1)B=(_>>1)-v;else B=v;k.isubn(B)}else B=0;q[P]=B,k.iushrn(1)}return q}I.getNAF=K;function Q(F,R){var D=[[],[]];F=F.clone(),R=R.clone();var q=0,P=0,_;while(F.cmpn(-q)>0||R.cmpn(-P)>0){var k=F.andln(3)+q&3,B=R.andln(3)+P&3;if(k===3)k=-1;if(B===3)B=-1;var v;if((k&1)===0)v=0;else if(_=F.andln(7)+q&7,(_===3||_===5)&&B===2)v=-k;else v=k;D[0].push(v);var g;if((B&1)===0)g=0;else if(_=R.andln(7)+P&7,(_===3||_===5)&&k===2)g=-B;else g=B;if(D[1].push(g),2*q===v+1)q=1-q;if(2*P===g+1)P=1-P;F.iushrn(1),R.iushrn(1)}return D}I.getJSF=Q;function T(F,R,D){var q="_"+R;F.prototype[R]=function(){return this[q]!==void 0?this[q]:this[q]=D.call(this)}}I.cachedProperty=T;function M(F){return typeof F==="string"?I.toArray(F,"hex"):F}I.parseBytes=M;function H(F){return new E(F,"hex","le")}I.intFromLE=H}),oI=Q0(($,I)=>{var E;I.exports=function(K){if(!E)E=new L(null);return E.generate(K)};function L(K){this.rand=K}if(I.exports.Rand=L,L.prototype.generate=function(K){return this._rand(K)},L.prototype._rand=function(K){if(this.rand.getBytes)return this.rand.getBytes(K);var Q=new Uint8Array(K);for(var T=0;T<Q.length;T++)Q[T]=this.rand.getByte();return Q},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)L.prototype._rand=function(K){var Q=new Uint8Array(K);return self.crypto.getRandomValues(Q),Q};else if(self.msCrypto&&self.msCrypto.getRandomValues)L.prototype._rand=function(K){var Q=new Uint8Array(K);return self.msCrypto.getRandomValues(Q),Q};else if(typeof window==="object")L.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(S=(vU(),l0(jU)),typeof S.randomBytes!=="function")throw Error("Not supported");L.prototype._rand=function(K){return S.randomBytes(K)}}catch(K){}var S}),JZ=Q0(($,I)=>{var E=sU(),L=wU(),S=L.getNAF,K=L.getJSF,Q=L.assert;function T(H,F){this.type=H,this.p=new E(F.p,16),this.red=F.prime?E.red(F.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=F.n&&new E(F.n,16),this.g=F.g&&this.pointFromJSON(F.g,F.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var R=this.n&&this.p.div(this.n);if(!R||R.cmpn(100)>0)this.redN=null;else this._maxwellTrick=!0,this.redN=this.n.toRed(this.red)}I.exports=T,T.prototype.point=function(){throw Error("Not implemented")},T.prototype.validate=function(){throw Error("Not implemented")},T.prototype._fixedNafMul=function(H,F){Q(H.precomputed);var R=H._getDoubles(),D=S(F,1,this._bitLength),q=(1<<R.step+1)-(R.step%2===0?2:1);q/=3;var P=[],_,k;for(_=0;_<D.length;_+=R.step){k=0;for(var B=_+R.step-1;B>=_;B--)k=(k<<1)+D[B];P.push(k)}var v=this.jpoint(null,null,null),g=this.jpoint(null,null,null);for(var f=q;f>0;f--){for(_=0;_<P.length;_++)if(k=P[_],k===f)g=g.mixedAdd(R.points[_]);else if(k===-f)g=g.mixedAdd(R.points[_].neg());v=v.add(g)}return v.toP()},T.prototype._wnafMul=function(H,F){var R=4,D=H._getNAFPoints(R);R=D.wnd;var q=D.points,P=S(F,R,this._bitLength),_=this.jpoint(null,null,null);for(var k=P.length-1;k>=0;k--){for(var B=0;k>=0&&P[k]===0;k--)B++;if(k>=0)B++;if(_=_.dblp(B),k<0)break;var v=P[k];if(Q(v!==0),H.type==="affine")if(v>0)_=_.mixedAdd(q[v-1>>1]);else _=_.mixedAdd(q[-v-1>>1].neg());else if(v>0)_=_.add(q[v-1>>1]);else _=_.add(q[-v-1>>1].neg())}return H.type==="affine"?_.toP():_},T.prototype._wnafMulAdd=function(H,F,R,D,q){var P=this._wnafT1,_=this._wnafT2,k=this._wnafT3,B=0,v,g,f;for(v=0;v<D;v++){f=F[v];var w=f._getNAFPoints(H);P[v]=w.wnd,_[v]=w.points}for(v=D-1;v>=1;v-=2){var b=v-1,I0=v;if(P[b]!==1||P[I0]!==1){k[b]=S(R[b],P[b],this._bitLength),k[I0]=S(R[I0],P[I0],this._bitLength),B=Math.max(k[b].length,B),B=Math.max(k[I0].length,B);continue}var X0=[F[b],null,null,F[I0]];if(F[b].y.cmp(F[I0].y)===0)X0[1]=F[b].add(F[I0]),X0[2]=F[b].toJ().mixedAdd(F[I0].neg());else if(F[b].y.cmp(F[I0].y.redNeg())===0)X0[1]=F[b].toJ().mixedAdd(F[I0]),X0[2]=F[b].add(F[I0].neg());else X0[1]=F[b].toJ().mixedAdd(F[I0]),X0[2]=F[b].toJ().mixedAdd(F[I0].neg());var C0=[-3,-1,-5,-7,0,7,5,1,3],u=K(R[b],R[I0]);B=Math.max(u[0].length,B),k[b]=Array(B),k[I0]=Array(B);for(g=0;g<B;g++){var O0=u[0][g]|0,U=u[1][g]|0;k[b][g]=C0[(O0+1)*3+(U+1)],k[I0][g]=0,_[b]=X0}}var A=this.jpoint(null,null,null),X=this._wnafT4;for(v=B;v>=0;v--){var Z=0;while(v>=0){var C=!0;for(g=0;g<D;g++)if(X[g]=k[g][v]|0,X[g]!==0)C=!1;if(!C)break;Z++,v--}if(v>=0)Z++;if(A=A.dblp(Z),v<0)break;for(g=0;g<D;g++){var Y=X[g];if(Y===0)continue;else if(Y>0)f=_[g][Y-1>>1];else if(Y<0)f=_[g][-Y-1>>1].neg();if(f.type==="affine")A=A.mixedAdd(f);else A=A.add(f)}}for(v=0;v<D;v++)_[v]=null;if(q)return A;else return A.toP()};function M(H,F){this.curve=H,this.type=F,this.precomputed=null}T.BasePoint=M,M.prototype.eq=function(){throw Error("Not implemented")},M.prototype.validate=function(){return this.curve.validate(this)},T.prototype.decodePoint=function(H,F){H=L.toArray(H,F);var R=this.p.byteLength();if((H[0]===4||H[0]===6||H[0]===7)&&H.length-1===2*R){if(H[0]===6)Q(H[H.length-1]%2===0);else if(H[0]===7)Q(H[H.length-1]%2===1);var D=this.point(H.slice(1,1+R),H.slice(1+R,1+2*R));return D}else if((H[0]===2||H[0]===3)&&H.length-1===R)return this.pointFromX(H.slice(1,1+R),H[0]===3);throw Error("Unknown point format")},M.prototype.encodeCompressed=function(H){return this.encode(H,!0)},M.prototype._encode=function(H){var F=this.curve.p.byteLength(),R=this.getX().toArray("be",F);if(H)return[this.getY().isEven()?2:3].concat(R);return[4].concat(R,this.getY().toArray("be",F))},M.prototype.encode=function(H,F){return L.encode(this._encode(F),H)},M.prototype.precompute=function(H){if(this.precomputed)return this;var F={doubles:null,naf:null,beta:null};return F.naf=this._getNAFPoints(8),F.doubles=this._getDoubles(4,H),F.beta=this._getBeta(),this.precomputed=F,this},M.prototype._hasDoubles=function(H){if(!this.precomputed)return!1;var F=this.precomputed.doubles;if(!F)return!1;return F.points.length>=Math.ceil((H.bitLength()+1)/F.step)},M.prototype._getDoubles=function(H,F){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var R=[this],D=this;for(var q=0;q<F;q+=H){for(var P=0;P<H;P++)D=D.dbl();R.push(D)}return{step:H,points:R}},M.prototype._getNAFPoints=function(H){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var F=[this],R=(1<<H)-1,D=R===1?null:this.dbl();for(var q=1;q<R;q++)F[q]=F[q-1].add(D);return{wnd:H,points:F}},M.prototype._getBeta=function(){return null},M.prototype.dblp=function(H){var F=this;for(var R=0;R<H;R++)F=F.dbl();return F}}),kG=Q0(($,I)=>{if(typeof Object.create==="function")I.exports=function(E,L){if(L)E.super_=L,E.prototype=Object.create(L.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}})};else I.exports=function(E,L){if(L){E.super_=L;var S=function(){};S.prototype=L.prototype,E.prototype=new S,E.prototype.constructor=E}}}),gU=Q0(($,I)=>{try{if(E=(jI(),l0(_I)),typeof E.inherits!=="function")throw"";I.exports=E.inherits}catch(L){I.exports=kG()}var E}),_G=Q0(($,I)=>{var E=wU(),L=sU(),S=gU(),K=JZ(),Q=E.assert;function T(F){K.call(this,"short",F),this.a=new L(F.a,16).toRed(this.red),this.b=new L(F.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(F),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}S(T,K),I.exports=T,T.prototype._getEndomorphism=function(F){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var R,D;if(F.beta)R=new L(F.beta,16).toRed(this.red);else{var q=this._getEndoRoots(this.p);R=q[0].cmp(q[1])<0?q[0]:q[1],R=R.toRed(this.red)}if(F.lambda)D=new L(F.lambda,16);else{var P=this._getEndoRoots(this.n);if(this.g.mul(P[0]).x.cmp(this.g.x.redMul(R))===0)D=P[0];else D=P[1],Q(this.g.mul(D).x.cmp(this.g.x.redMul(R))===0)}var _;if(F.basis)_=F.basis.map(function(k){return{a:new L(k.a,16),b:new L(k.b,16)}});else _=this._getEndoBasis(D);return{beta:R,lambda:D,basis:_}},T.prototype._getEndoRoots=function(F){var R=F===this.p?this.red:L.mont(F),D=new L(2).toRed(R).redInvm(),q=D.redNeg(),P=new L(3).toRed(R).redNeg().redSqrt().redMul(D),_=q.redAdd(P).fromRed(),k=q.redSub(P).fromRed();return[_,k]},T.prototype._getEndoBasis=function(F){var R=this.n.ushrn(Math.floor(this.n.bitLength()/2)),D=F,q=this.n.clone(),P=new L(1),_=new L(0),k=new L(0),B=new L(1),v,g,f,w,b,I0,X0,C0=0,u,O0;while(D.cmpn(0)!==0){var U=q.div(D);u=q.sub(U.mul(D)),O0=k.sub(U.mul(P));var A=B.sub(U.mul(_));if(!f&&u.cmp(R)<0)v=X0.neg(),g=P,f=u.neg(),w=O0;else if(f&&++C0===2)break;X0=u,q=D,D=u,k=P,P=O0,B=_,_=A}b=u.neg(),I0=O0;var X=f.sqr().add(w.sqr()),Z=b.sqr().add(I0.sqr());if(Z.cmp(X)>=0)b=v,I0=g;if(f.negative)f=f.neg(),w=w.neg();if(b.negative)b=b.neg(),I0=I0.neg();return[{a:f,b:w},{a:b,b:I0}]},T.prototype._endoSplit=function(F){var R=this.endo.basis,D=R[0],q=R[1],P=q.b.mul(F).divRound(this.n),_=D.b.neg().mul(F).divRound(this.n),k=P.mul(D.a),B=_.mul(q.a),v=P.mul(D.b),g=_.mul(q.b),f=F.sub(k).sub(B),w=v.add(g).neg();return{k1:f,k2:w}},T.prototype.pointFromX=function(F,R){if(F=new L(F,16),!F.red)F=F.toRed(this.red);var D=F.redSqr().redMul(F).redIAdd(F.redMul(this.a)).redIAdd(this.b),q=D.redSqrt();if(q.redSqr().redSub(D).cmp(this.zero)!==0)throw Error("invalid point");var P=q.fromRed().isOdd();if(R&&!P||!R&&P)q=q.redNeg();return this.point(F,q)},T.prototype.validate=function(F){if(F.inf)return!0;var{x:R,y:D}=F,q=this.a.redMul(R),P=R.redSqr().redMul(R).redIAdd(q).redIAdd(this.b);return D.redSqr().redISub(P).cmpn(0)===0},T.prototype._endoWnafMulAdd=function(F,R,D){var q=this._endoWnafT1,P=this._endoWnafT2;for(var _=0;_<F.length;_++){var k=this._endoSplit(R[_]),B=F[_],v=B._getBeta();if(k.k1.negative)k.k1.ineg(),B=B.neg(!0);if(k.k2.negative)k.k2.ineg(),v=v.neg(!0);q[_*2]=B,q[_*2+1]=v,P[_*2]=k.k1,P[_*2+1]=k.k2}var g=this._wnafMulAdd(1,q,P,_*2,D);for(var f=0;f<_*2;f++)q[f]=null,P[f]=null;return g};function M(F,R,D,q){if(K.BasePoint.call(this,F,"affine"),R===null&&D===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new L(R,16),this.y=new L(D,16),q)this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=!1}}S(M,K.BasePoint),T.prototype.point=function(F,R,D){return new M(this,F,R,D)},T.prototype.pointFromJSON=function(F,R){return M.fromJSON(this,F,R)},M.prototype._getBeta=function(){if(!this.curve.endo)return;var F=this.precomputed;if(F&&F.beta)return F.beta;var R=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(F){var D=this.curve,q=function(P){return D.point(P.x.redMul(D.endo.beta),P.y)};F.beta=R,R.precomputed={beta:null,naf:F.naf&&{wnd:F.naf.wnd,points:F.naf.points.map(q)},doubles:F.doubles&&{step:F.doubles.step,points:F.doubles.points.map(q)}}}return R},M.prototype.toJSON=function(){if(!this.precomputed)return[this.x,this.y];return[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]},M.fromJSON=function(F,R,D){if(typeof R==="string")R=JSON.parse(R);var q=F.point(R[0],R[1],D);if(!R[2])return q;function P(k){return F.point(k[0],k[1],D)}var _=R[2];return q.precomputed={beta:null,doubles:_.doubles&&{step:_.doubles.step,points:[q].concat(_.doubles.points.map(P))},naf:_.naf&&{wnd:_.naf.wnd,points:[q].concat(_.naf.points.map(P))}},q},M.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},M.prototype.isInfinity=function(){return this.inf},M.prototype.add=function(F){if(this.inf)return F;if(F.inf)return this;if(this.eq(F))return this.dbl();if(this.neg().eq(F))return this.curve.point(null,null);if(this.x.cmp(F.x)===0)return this.curve.point(null,null);var R=this.y.redSub(F.y);if(R.cmpn(0)!==0)R=R.redMul(this.x.redSub(F.x).redInvm());var D=R.redSqr().redISub(this.x).redISub(F.x),q=R.redMul(this.x.redSub(D)).redISub(this.y);return this.curve.point(D,q)},M.prototype.dbl=function(){if(this.inf)return this;var F=this.y.redAdd(this.y);if(F.cmpn(0)===0)return this.curve.point(null,null);var R=this.curve.a,D=this.x.redSqr(),q=F.redInvm(),P=D.redAdd(D).redIAdd(D).redIAdd(R).redMul(q),_=P.redSqr().redISub(this.x.redAdd(this.x)),k=P.redMul(this.x.redSub(_)).redISub(this.y);return this.curve.point(_,k)},M.prototype.getX=function(){return this.x.fromRed()},M.prototype.getY=function(){return this.y.fromRed()},M.prototype.mul=function(F){if(F=new L(F,16),this.isInfinity())return this;else if(this._hasDoubles(F))return this.curve._fixedNafMul(this,F);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[F]);else return this.curve._wnafMul(this,F)},M.prototype.mulAdd=function(F,R,D){var q=[this,R],P=[F,D];if(this.curve.endo)return this.curve._endoWnafMulAdd(q,P);else return this.curve._wnafMulAdd(1,q,P,2)},M.prototype.jmulAdd=function(F,R,D){var q=[this,R],P=[F,D];if(this.curve.endo)return this.curve._endoWnafMulAdd(q,P,!0);else return this.curve._wnafMulAdd(1,q,P,2,!0)},M.prototype.eq=function(F){return this===F||this.inf===F.inf&&(this.inf||this.x.cmp(F.x)===0&&this.y.cmp(F.y)===0)},M.prototype.neg=function(F){if(this.inf)return this;var R=this.curve.point(this.x,this.y.redNeg());if(F&&this.precomputed){var D=this.precomputed,q=function(P){return P.neg()};R.precomputed={naf:D.naf&&{wnd:D.naf.wnd,points:D.naf.points.map(q)},doubles:D.doubles&&{step:D.doubles.step,points:D.doubles.points.map(q)}}}return R},M.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var F=this.curve.jpoint(this.x,this.y,this.curve.one);return F};function H(F,R,D,q){if(K.BasePoint.call(this,F,"jacobian"),R===null&&D===null&&q===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new L(0);else this.x=new L(R,16),this.y=new L(D,16),this.z=new L(q,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}S(H,K.BasePoint),T.prototype.jpoint=function(F,R,D){return new H(this,F,R,D)},H.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var F=this.z.redInvm(),R=F.redSqr(),D=this.x.redMul(R),q=this.y.redMul(R).redMul(F);return this.curve.point(D,q)},H.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},H.prototype.add=function(F){if(this.isInfinity())return F;if(F.isInfinity())return this;var R=F.z.redSqr(),D=this.z.redSqr(),q=this.x.redMul(R),P=F.x.redMul(D),_=this.y.redMul(R.redMul(F.z)),k=F.y.redMul(D.redMul(this.z)),B=q.redSub(P),v=_.redSub(k);if(B.cmpn(0)===0)if(v.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var g=B.redSqr(),f=g.redMul(B),w=q.redMul(g),b=v.redSqr().redIAdd(f).redISub(w).redISub(w),I0=v.redMul(w.redISub(b)).redISub(_.redMul(f)),X0=this.z.redMul(F.z).redMul(B);return this.curve.jpoint(b,I0,X0)},H.prototype.mixedAdd=function(F){if(this.isInfinity())return F.toJ();if(F.isInfinity())return this;var R=this.z.redSqr(),D=this.x,q=F.x.redMul(R),P=this.y,_=F.y.redMul(R).redMul(this.z),k=D.redSub(q),B=P.redSub(_);if(k.cmpn(0)===0)if(B.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var v=k.redSqr(),g=v.redMul(k),f=D.redMul(v),w=B.redSqr().redIAdd(g).redISub(f).redISub(f),b=B.redMul(f.redISub(w)).redISub(P.redMul(g)),I0=this.z.redMul(k);return this.curve.jpoint(w,b,I0)},H.prototype.dblp=function(F){if(F===0)return this;if(this.isInfinity())return this;if(!F)return this.dbl();var R;if(this.curve.zeroA||this.curve.threeA){var D=this;for(R=0;R<F;R++)D=D.dbl();return D}var q=this.curve.a,P=this.curve.tinv,_=this.x,k=this.y,B=this.z,v=B.redSqr().redSqr(),g=k.redAdd(k);for(R=0;R<F;R++){var f=_.redSqr(),w=g.redSqr(),b=w.redSqr(),I0=f.redAdd(f).redIAdd(f).redIAdd(q.redMul(v)),X0=_.redMul(w),C0=I0.redSqr().redISub(X0.redAdd(X0)),u=X0.redISub(C0),O0=I0.redMul(u);O0=O0.redIAdd(O0).redISub(b);var U=g.redMul(B);if(R+1<F)v=v.redMul(b);_=C0,B=U,g=O0}return this.curve.jpoint(_,g.redMul(P),B)},H.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.zeroA)return this._zeroDbl();else if(this.curve.threeA)return this._threeDbl();else return this._dbl()},H.prototype._zeroDbl=function(){var F,R,D;if(this.zOne){var q=this.x.redSqr(),P=this.y.redSqr(),_=P.redSqr(),k=this.x.redAdd(P).redSqr().redISub(q).redISub(_);k=k.redIAdd(k);var B=q.redAdd(q).redIAdd(q),v=B.redSqr().redISub(k).redISub(k),g=_.redIAdd(_);g=g.redIAdd(g),g=g.redIAdd(g),F=v,R=B.redMul(k.redISub(v)).redISub(g),D=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),w=this.y.redSqr(),b=w.redSqr(),I0=this.x.redAdd(w).redSqr().redISub(f).redISub(b);I0=I0.redIAdd(I0);var X0=f.redAdd(f).redIAdd(f),C0=X0.redSqr(),u=b.redIAdd(b);u=u.redIAdd(u),u=u.redIAdd(u),F=C0.redISub(I0).redISub(I0),R=X0.redMul(I0.redISub(F)).redISub(u),D=this.y.redMul(this.z),D=D.redIAdd(D)}return this.curve.jpoint(F,R,D)},H.prototype._threeDbl=function(){var F,R,D;if(this.zOne){var q=this.x.redSqr(),P=this.y.redSqr(),_=P.redSqr(),k=this.x.redAdd(P).redSqr().redISub(q).redISub(_);k=k.redIAdd(k);var B=q.redAdd(q).redIAdd(q).redIAdd(this.curve.a),v=B.redSqr().redISub(k).redISub(k);F=v;var g=_.redIAdd(_);g=g.redIAdd(g),g=g.redIAdd(g),R=B.redMul(k.redISub(v)).redISub(g),D=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),w=this.y.redSqr(),b=this.x.redMul(w),I0=this.x.redSub(f).redMul(this.x.redAdd(f));I0=I0.redAdd(I0).redIAdd(I0);var X0=b.redIAdd(b);X0=X0.redIAdd(X0);var C0=X0.redAdd(X0);F=I0.redSqr().redISub(C0),D=this.y.redAdd(this.z).redSqr().redISub(w).redISub(f);var u=w.redSqr();u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u),R=I0.redMul(X0.redISub(F)).redISub(u)}return this.curve.jpoint(F,R,D)},H.prototype._dbl=function(){var F=this.curve.a,R=this.x,D=this.y,q=this.z,P=q.redSqr().redSqr(),_=R.redSqr(),k=D.redSqr(),B=_.redAdd(_).redIAdd(_).redIAdd(F.redMul(P)),v=R.redAdd(R);v=v.redIAdd(v);var g=v.redMul(k),f=B.redSqr().redISub(g.redAdd(g)),w=g.redISub(f),b=k.redSqr();b=b.redIAdd(b),b=b.redIAdd(b),b=b.redIAdd(b);var I0=B.redMul(w).redISub(b),X0=D.redAdd(D).redMul(q);return this.curve.jpoint(f,I0,X0)},H.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var F=this.x.redSqr(),R=this.y.redSqr(),D=this.z.redSqr(),q=R.redSqr(),P=F.redAdd(F).redIAdd(F),_=P.redSqr(),k=this.x.redAdd(R).redSqr().redISub(F).redISub(q);k=k.redIAdd(k),k=k.redAdd(k).redIAdd(k),k=k.redISub(_);var B=k.redSqr(),v=q.redIAdd(q);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var g=P.redIAdd(k).redSqr().redISub(_).redISub(B).redISub(v),f=R.redMul(g);f=f.redIAdd(f),f=f.redIAdd(f);var w=this.x.redMul(B).redISub(f);w=w.redIAdd(w),w=w.redIAdd(w);var b=this.y.redMul(g.redMul(v.redISub(g)).redISub(k.redMul(B)));b=b.redIAdd(b),b=b.redIAdd(b),b=b.redIAdd(b);var I0=this.z.redAdd(k).redSqr().redISub(D).redISub(B);return this.curve.jpoint(w,b,I0)},H.prototype.mul=function(F,R){return F=new L(F,R),this.curve._wnafMul(this,F)},H.prototype.eq=function(F){if(F.type==="affine")return this.eq(F.toJ());if(this===F)return!0;var R=this.z.redSqr(),D=F.z.redSqr();if(this.x.redMul(D).redISub(F.x.redMul(R)).cmpn(0)!==0)return!1;var q=R.redMul(this.z),P=D.redMul(F.z);return this.y.redMul(P).redISub(F.y.redMul(q)).cmpn(0)===0},H.prototype.eqXToP=function(F){var R=this.z.redSqr(),D=F.toRed(this.curve.red).redMul(R);if(this.x.cmp(D)===0)return!0;var q=F.clone(),P=this.curve.redN.redMul(R);for(;;){if(q.iadd(this.curve.n),q.cmp(this.curve.p)>=0)return!1;if(D.redIAdd(P),this.x.cmp(D)===0)return!0}},H.prototype.inspect=function(){if(this.isInfinity())return"<EC JPoint Infinity>";return"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},H.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),jG=Q0(($,I)=>{var E=sU(),L=gU(),S=JZ(),K=wU();function Q(M){S.call(this,"mont",M),this.a=new E(M.a,16).toRed(this.red),this.b=new E(M.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))}L(Q,S),I.exports=Q,Q.prototype.validate=function(M){var H=M.normalize().x,F=H.redSqr(),R=F.redMul(H).redAdd(F.redMul(this.a)).redAdd(H),D=R.redSqrt();return D.redSqr().cmp(R)===0};function T(M,H,F){if(S.BasePoint.call(this,M,"projective"),H===null&&F===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new E(H,16),this.z=new E(F,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}L(T,S.BasePoint),Q.prototype.decodePoint=function(M,H){return this.point(K.toArray(M,H),1)},Q.prototype.point=function(M,H){return new T(this,M,H)},Q.prototype.pointFromJSON=function(M){return T.fromJSON(this,M)},T.prototype.precompute=function(){},T.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},T.fromJSON=function(M,H){return new T(M,H[0],H[1]||M.one)},T.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},T.prototype.isInfinity=function(){return this.z.cmpn(0)===0},T.prototype.dbl=function(){var M=this.x.redAdd(this.z),H=M.redSqr(),F=this.x.redSub(this.z),R=F.redSqr(),D=H.redSub(R),q=H.redMul(R),P=D.redMul(R.redAdd(this.curve.a24.redMul(D)));return this.curve.point(q,P)},T.prototype.add=function(){throw Error("Not supported on Montgomery curve")},T.prototype.diffAdd=function(M,H){var F=this.x.redAdd(this.z),R=this.x.redSub(this.z),D=M.x.redAdd(M.z),q=M.x.redSub(M.z),P=q.redMul(F),_=D.redMul(R),k=H.z.redMul(P.redAdd(_).redSqr()),B=H.x.redMul(P.redISub(_).redSqr());return this.curve.point(k,B)},T.prototype.mul=function(M){var H=M.clone(),F=this,R=this.curve.point(null,null),D=this;for(var q=[];H.cmpn(0)!==0;H.iushrn(1))q.push(H.andln(1));for(var P=q.length-1;P>=0;P--)if(q[P]===0)F=F.diffAdd(R,D),R=R.dbl();else R=F.diffAdd(R,D),F=F.dbl();return R},T.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},T.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},T.prototype.eq=function(M){return this.getX().cmp(M.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()}}),vG=Q0(($,I)=>{var E=wU(),L=sU(),S=gU(),K=JZ(),Q=E.assert;function T(H){this.twisted=(H.a|0)!==1,this.mOneA=this.twisted&&(H.a|0)===-1,this.extended=this.mOneA,K.call(this,"edwards",H),this.a=new L(H.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new L(H.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new L(H.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Q(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(H.c|0)===1}S(T,K),I.exports=T,T.prototype._mulA=function(H){if(this.mOneA)return H.redNeg();else return this.a.redMul(H)},T.prototype._mulC=function(H){if(this.oneC)return H;else return this.c.redMul(H)},T.prototype.jpoint=function(H,F,R,D){return this.point(H,F,R,D)},T.prototype.pointFromX=function(H,F){if(H=new L(H,16),!H.red)H=H.toRed(this.red);var R=H.redSqr(),D=this.c2.redSub(this.a.redMul(R)),q=this.one.redSub(this.c2.redMul(this.d).redMul(R)),P=D.redMul(q.redInvm()),_=P.redSqrt();if(_.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");var k=_.fromRed().isOdd();if(F&&!k||!F&&k)_=_.redNeg();return this.point(H,_)},T.prototype.pointFromY=function(H,F){if(H=new L(H,16),!H.red)H=H.toRed(this.red);var R=H.redSqr(),D=R.redSub(this.c2),q=R.redMul(this.d).redMul(this.c2).redSub(this.a),P=D.redMul(q.redInvm());if(P.cmp(this.zero)===0)if(F)throw Error("invalid point");else return this.point(this.zero,H);var _=P.redSqrt();if(_.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");if(_.fromRed().isOdd()!==F)_=_.redNeg();return this.point(_,H)},T.prototype.validate=function(H){if(H.isInfinity())return!0;H.normalize();var F=H.x.redSqr(),R=H.y.redSqr(),D=F.redMul(this.a).redAdd(R),q=this.c2.redMul(this.one.redAdd(this.d.redMul(F).redMul(R)));return D.cmp(q)===0};function M(H,F,R,D,q){if(K.BasePoint.call(this,H,"projective"),F===null&&R===null&&D===null)this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0;else{if(this.x=new L(F,16),this.y=new L(R,16),this.z=D?new L(D,16):this.curve.one,this.t=q&&new L(q,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);if(this.t&&!this.t.red)this.t=this.t.toRed(this.curve.red);if(this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t){if(this.t=this.x.redMul(this.y),!this.zOne)this.t=this.t.redMul(this.z.redInvm())}}}S(M,K.BasePoint),T.prototype.pointFromJSON=function(H){return M.fromJSON(this,H)},T.prototype.point=function(H,F,R,D){return new M(this,H,F,R,D)},M.fromJSON=function(H,F){return new M(H,F[0],F[1],F[2])},M.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},M.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},M.prototype._extDbl=function(){var H=this.x.redSqr(),F=this.y.redSqr(),R=this.z.redSqr();R=R.redIAdd(R);var D=this.curve._mulA(H),q=this.x.redAdd(this.y).redSqr().redISub(H).redISub(F),P=D.redAdd(F),_=P.redSub(R),k=D.redSub(F),B=q.redMul(_),v=P.redMul(k),g=q.redMul(k),f=_.redMul(P);return this.curve.point(B,v,f,g)},M.prototype._projDbl=function(){var H=this.x.redAdd(this.y).redSqr(),F=this.x.redSqr(),R=this.y.redSqr(),D,q,P,_,k,B;if(this.curve.twisted){_=this.curve._mulA(F);var v=_.redAdd(R);if(this.zOne)D=H.redSub(F).redSub(R).redMul(v.redSub(this.curve.two)),q=v.redMul(_.redSub(R)),P=v.redSqr().redSub(v).redSub(v);else k=this.z.redSqr(),B=v.redSub(k).redISub(k),D=H.redSub(F).redISub(R).redMul(B),q=v.redMul(_.redSub(R)),P=v.redMul(B)}else _=F.redAdd(R),k=this.curve._mulC(this.z).redSqr(),B=_.redSub(k).redSub(k),D=this.curve._mulC(H.redISub(_)).redMul(B),q=this.curve._mulC(_).redMul(F.redISub(R)),P=_.redMul(B);return this.curve.point(D,q,P)},M.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},M.prototype._extAdd=function(H){var F=this.y.redSub(this.x).redMul(H.y.redSub(H.x)),R=this.y.redAdd(this.x).redMul(H.y.redAdd(H.x)),D=this.t.redMul(this.curve.dd).redMul(H.t),q=this.z.redMul(H.z.redAdd(H.z)),P=R.redSub(F),_=q.redSub(D),k=q.redAdd(D),B=R.redAdd(F),v=P.redMul(_),g=k.redMul(B),f=P.redMul(B),w=_.redMul(k);return this.curve.point(v,g,w,f)},M.prototype._projAdd=function(H){var F=this.z.redMul(H.z),R=F.redSqr(),D=this.x.redMul(H.x),q=this.y.redMul(H.y),P=this.curve.d.redMul(D).redMul(q),_=R.redSub(P),k=R.redAdd(P),B=this.x.redAdd(this.y).redMul(H.x.redAdd(H.y)).redISub(D).redISub(q),v=F.redMul(_).redMul(B),g,f;if(this.curve.twisted)g=F.redMul(k).redMul(q.redSub(this.curve._mulA(D))),f=_.redMul(k);else g=F.redMul(k).redMul(q.redSub(D)),f=this.curve._mulC(_).redMul(k);return this.curve.point(v,g,f)},M.prototype.add=function(H){if(this.isInfinity())return H;if(H.isInfinity())return this;if(this.curve.extended)return this._extAdd(H);else return this._projAdd(H)},M.prototype.mul=function(H){if(this._hasDoubles(H))return this.curve._fixedNafMul(this,H);else return this.curve._wnafMul(this,H)},M.prototype.mulAdd=function(H,F,R){return this.curve._wnafMulAdd(1,[this,F],[H,R],2,!1)},M.prototype.jmulAdd=function(H,F,R){return this.curve._wnafMulAdd(1,[this,F],[H,R],2,!0)},M.prototype.normalize=function(){if(this.zOne)return this;var H=this.z.redInvm();if(this.x=this.x.redMul(H),this.y=this.y.redMul(H),this.t)this.t=this.t.redMul(H);return this.z=this.curve.one,this.zOne=!0,this},M.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},M.prototype.getX=function(){return this.normalize(),this.x.fromRed()},M.prototype.getY=function(){return this.normalize(),this.y.fromRed()},M.prototype.eq=function(H){return this===H||this.getX().cmp(H.getX())===0&&this.getY().cmp(H.getY())===0},M.prototype.eqXToP=function(H){var F=H.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(F)===0)return!0;var R=H.clone(),D=this.curve.redN.redMul(this.z);for(;;){if(R.iadd(this.curve.n),R.cmp(this.curve.p)>=0)return!1;if(F.redIAdd(D),this.x.cmp(F)===0)return!0}},M.prototype.toP=M.prototype.normalize,M.prototype.mixedAdd=M.prototype.add}),nI=Q0(($)=>{var I=$;I.base=JZ(),I.short=_G(),I.mont=jG(),I.edwards=vG()}),lU=Q0(($)=>{var I=UO(),E=gU();$.inherits=E;function L(A,X){if((A.charCodeAt(X)&64512)!==55296)return!1;if(X<0||X+1>=A.length)return!1;return(A.charCodeAt(X+1)&64512)===56320}function S(A,X){if(Array.isArray(A))return A.slice();if(!A)return[];var Z=[];if(typeof A==="string"){if(!X){var C=0;for(var Y=0;Y<A.length;Y++){var V=A.charCodeAt(Y);if(V<128)Z[C++]=V;else if(V<2048)Z[C++]=V>>6|192,Z[C++]=V&63|128;else if(L(A,Y))V=65536+((V&1023)<<10)+(A.charCodeAt(++Y)&1023),Z[C++]=V>>18|240,Z[C++]=V>>12&63|128,Z[C++]=V>>6&63|128,Z[C++]=V&63|128;else Z[C++]=V>>12|224,Z[C++]=V>>6&63|128,Z[C++]=V&63|128}}else if(X==="hex"){if(A=A.replace(/[^a-z0-9]+/ig,""),A.length%2!==0)A="0"+A;for(Y=0;Y<A.length;Y+=2)Z.push(parseInt(A[Y]+A[Y+1],16))}}else for(Y=0;Y<A.length;Y++)Z[Y]=A[Y]|0;return Z}$.toArray=S;function K(A){var X="";for(var Z=0;Z<A.length;Z++)X+=M(A[Z].toString(16));return X}$.toHex=K;function Q(A){var X=A>>>24|A>>>8&65280|A<<8&16711680|(A&255)<<24;return X>>>0}$.htonl=Q;function T(A,X){var Z="";for(var C=0;C<A.length;C++){var Y=A[C];if(X==="little")Y=Q(Y);Z+=H(Y.toString(16))}return Z}$.toHex32=T;function M(A){if(A.length===1)return"0"+A;else return A}$.zero2=M;function H(A){if(A.length===7)return"0"+A;else if(A.length===6)return"00"+A;else if(A.length===5)return"000"+A;else if(A.length===4)return"0000"+A;else if(A.length===3)return"00000"+A;else if(A.length===2)return"000000"+A;else if(A.length===1)return"0000000"+A;else return A}$.zero8=H;function F(A,X,Z,C){var Y=Z-X;I(Y%4===0);var V=Array(Y/4);for(var G=0,O=X;G<V.length;G++,O+=4){var J;if(C==="big")J=A[O]<<24|A[O+1]<<16|A[O+2]<<8|A[O+3];else J=A[O+3]<<24|A[O+2]<<16|A[O+1]<<8|A[O];V[G]=J>>>0}return V}$.join32=F;function R(A,X){var Z=Array(A.length*4);for(var C=0,Y=0;C<A.length;C++,Y+=4){var V=A[C];if(X==="big")Z[Y]=V>>>24,Z[Y+1]=V>>>16&255,Z[Y+2]=V>>>8&255,Z[Y+3]=V&255;else Z[Y+3]=V>>>24,Z[Y+2]=V>>>16&255,Z[Y+1]=V>>>8&255,Z[Y]=V&255}return Z}$.split32=R;function D(A,X){return A>>>X|A<<32-X}$.rotr32=D;function q(A,X){return A<<X|A>>>32-X}$.rotl32=q;function P(A,X){return A+X>>>0}$.sum32=P;function _(A,X,Z){return A+X+Z>>>0}$.sum32_3=_;function k(A,X,Z,C){return A+X+Z+C>>>0}$.sum32_4=k;function B(A,X,Z,C,Y){return A+X+Z+C+Y>>>0}$.sum32_5=B;function v(A,X,Z,C){var Y=A[X],V=A[X+1],G=C+V>>>0,O=(G<C?1:0)+Z+Y;A[X]=O>>>0,A[X+1]=G}$.sum64=v;function g(A,X,Z,C){var Y=X+C>>>0,V=(Y<X?1:0)+A+Z;return V>>>0}$.sum64_hi=g;function f(A,X,Z,C){var Y=X+C;return Y>>>0}$.sum64_lo=f;function w(A,X,Z,C,Y,V,G,O){var J=0,z=X;z=z+C>>>0,J+=z<X?1:0,z=z+V>>>0,J+=z<V?1:0,z=z+O>>>0,J+=z<O?1:0;var W=A+Z+Y+G+J;return W>>>0}$.sum64_4_hi=w;function b(A,X,Z,C,Y,V,G,O){var J=X+C+V+O;return J>>>0}$.sum64_4_lo=b;function I0(A,X,Z,C,Y,V,G,O,J,z){var W=0,j=X;j=j+C>>>0,W+=j<X?1:0,j=j+V>>>0,W+=j<V?1:0,j=j+O>>>0,W+=j<O?1:0,j=j+z>>>0,W+=j<z?1:0;var N=A+Z+Y+G+J+W;return N>>>0}$.sum64_5_hi=I0;function X0(A,X,Z,C,Y,V,G,O,J,z){var W=X+C+V+O+z;return W>>>0}$.sum64_5_lo=X0;function C0(A,X,Z){var C=X<<32-Z|A>>>Z;return C>>>0}$.rotr64_hi=C0;function u(A,X,Z){var C=A<<32-Z|X>>>Z;return C>>>0}$.rotr64_lo=u;function O0(A,X,Z){return A>>>Z}$.shr64_hi=O0;function U(A,X,Z){var C=A<<32-Z|X>>>Z;return C>>>0}$.shr64_lo=U}),lO=Q0(($)=>{var I=lU(),E=UO();function L(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}$.BlockHash=L,L.prototype.update=function(S,K){if(S=I.toArray(S,K),!this.pending)this.pending=S;else this.pending=this.pending.concat(S);if(this.pendingTotal+=S.length,this.pending.length>=this._delta8){S=this.pending;var Q=S.length%this._delta8;if(this.pending=S.slice(S.length-Q,S.length),this.pending.length===0)this.pending=null;S=I.join32(S,0,S.length-Q,this.endian);for(var T=0;T<S.length;T+=this._delta32)this._update(S,T,T+this._delta32)}return this},L.prototype.digest=function(S){return this.update(this._pad()),E(this.pending===null),this._digest(S)},L.prototype._pad=function(){var S=this.pendingTotal,K=this._delta8,Q=K-(S+this.padLength)%K,T=Array(Q+this.padLength);T[0]=128;for(var M=1;M<Q;M++)T[M]=0;if(S<<=3,this.endian==="big"){for(var H=8;H<this.padLength;H++)T[M++]=0;T[M++]=0,T[M++]=0,T[M++]=0,T[M++]=0,T[M++]=S>>>24&255,T[M++]=S>>>16&255,T[M++]=S>>>8&255,T[M++]=S&255}else{T[M++]=S&255,T[M++]=S>>>8&255,T[M++]=S>>>16&255,T[M++]=S>>>24&255,T[M++]=0,T[M++]=0,T[M++]=0,T[M++]=0;for(H=8;H<this.padLength;H++)T[M++]=0}return T}}),tI=Q0(($)=>{var I=lU(),E=I.rotr32;function L(R,D,q,P){if(R===0)return S(D,q,P);if(R===1||R===3)return Q(D,q,P);if(R===2)return K(D,q,P)}$.ft_1=L;function S(R,D,q){return R&D^~R&q}$.ch32=S;function K(R,D,q){return R&D^R&q^D&q}$.maj32=K;function Q(R,D,q){return R^D^q}$.p32=Q;function T(R){return E(R,2)^E(R,13)^E(R,22)}$.s0_256=T;function M(R){return E(R,6)^E(R,11)^E(R,25)}$.s1_256=M;function H(R){return E(R,7)^E(R,18)^R>>>3}$.g0_256=H;function F(R){return E(R,17)^E(R,19)^R>>>10}$.g1_256=F}),BG=Q0(($,I)=>{var E=lU(),L=lO(),S=tI(),K=E.rotl32,Q=E.sum32,T=E.sum32_5,M=S.ft_1,H=L.BlockHash,F=[1518500249,1859775393,2400959708,3395469782];function R(){if(!(this instanceof R))return new R;H.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}E.inherits(R,H),I.exports=R,R.blockSize=512,R.outSize=160,R.hmacStrength=80,R.padLength=64,R.prototype._update=function(D,q){var P=this.W;for(var _=0;_<16;_++)P[_]=D[q+_];for(;_<P.length;_++)P[_]=K(P[_-3]^P[_-8]^P[_-14]^P[_-16],1);var k=this.h[0],B=this.h[1],v=this.h[2],g=this.h[3],f=this.h[4];for(_=0;_<P.length;_++){var w=~~(_/20),b=T(K(k,5),M(w,B,v,g),f,P[_],F[w]);f=g,g=v,v=K(B,30),B=k,k=b}this.h[0]=Q(this.h[0],k),this.h[1]=Q(this.h[1],B),this.h[2]=Q(this.h[2],v),this.h[3]=Q(this.h[3],g),this.h[4]=Q(this.h[4],f)},R.prototype._digest=function(D){if(D==="hex")return E.toHex32(this.h,"big");else return E.split32(this.h,"big")}}),sI=Q0(($,I)=>{var E=lU(),L=lO(),S=tI(),K=UO(),Q=E.sum32,T=E.sum32_4,M=E.sum32_5,H=S.ch32,F=S.maj32,R=S.s0_256,D=S.s1_256,q=S.g0_256,P=S.g1_256,_=L.BlockHash,k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function B(){if(!(this instanceof B))return new B;_.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=k,this.W=Array(64)}E.inherits(B,_),I.exports=B,B.blockSize=512,B.outSize=256,B.hmacStrength=192,B.padLength=64,B.prototype._update=function(v,g){var f=this.W;for(var w=0;w<16;w++)f[w]=v[g+w];for(;w<f.length;w++)f[w]=T(P(f[w-2]),f[w-7],q(f[w-15]),f[w-16]);var b=this.h[0],I0=this.h[1],X0=this.h[2],C0=this.h[3],u=this.h[4],O0=this.h[5],U=this.h[6],A=this.h[7];K(this.k.length===f.length);for(w=0;w<f.length;w++){var X=M(A,D(u),H(u,O0,U),this.k[w],f[w]),Z=Q(R(b),F(b,I0,X0));A=U,U=O0,O0=u,u=Q(C0,X),C0=X0,X0=I0,I0=b,b=Q(X,Z)}this.h[0]=Q(this.h[0],b),this.h[1]=Q(this.h[1],I0),this.h[2]=Q(this.h[2],X0),this.h[3]=Q(this.h[3],C0),this.h[4]=Q(this.h[4],u),this.h[5]=Q(this.h[5],O0),this.h[6]=Q(this.h[6],U),this.h[7]=Q(this.h[7],A)},B.prototype._digest=function(v){if(v==="hex")return E.toHex32(this.h,"big");else return E.split32(this.h,"big")}}),gG=Q0(($,I)=>{var E=lU(),L=sI();function S(){if(!(this instanceof S))return new S;L.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}E.inherits(S,L),I.exports=S,S.blockSize=512,S.outSize=224,S.hmacStrength=192,S.padLength=64,S.prototype._digest=function(K){if(K==="hex")return E.toHex32(this.h.slice(0,7),"big");else return E.split32(this.h.slice(0,7),"big")}}),mI=Q0(($,I)=>{var E=lU(),L=lO(),S=UO(),K=E.rotr64_hi,Q=E.rotr64_lo,T=E.shr64_hi,M=E.shr64_lo,H=E.sum64,F=E.sum64_hi,R=E.sum64_lo,D=E.sum64_4_hi,q=E.sum64_4_lo,P=E.sum64_5_hi,_=E.sum64_5_lo,k=L.BlockHash,B=[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 v(){if(!(this instanceof v))return new v;k.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=B,this.W=Array(160)}E.inherits(v,k),I.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(Z,C){var Y=this.W;for(var V=0;V<32;V++)Y[V]=Z[C+V];for(;V<Y.length;V+=2){var G=A(Y[V-4],Y[V-3]),O=X(Y[V-4],Y[V-3]),J=Y[V-14],z=Y[V-13],W=O0(Y[V-30],Y[V-29]),j=U(Y[V-30],Y[V-29]),N=Y[V-32],p=Y[V-31];Y[V]=D(G,O,J,z,W,j,N,p),Y[V+1]=q(G,O,J,z,W,j,N,p)}},v.prototype._update=function(Z,C){this._prepareBlock(Z,C);var Y=this.W,V=this.h[0],G=this.h[1],O=this.h[2],J=this.h[3],z=this.h[4],W=this.h[5],j=this.h[6],N=this.h[7],p=this.h[8],n=this.h[9],E0=this.h[10],r=this.h[11],d=this.h[12],A0=this.h[13],t=this.h[14],i=this.h[15];S(this.k.length===Y.length);for(var N0=0;N0<Y.length;N0+=2){var y=t,h=i,$0=C0(p,n),m=u(p,n),a=g(p,n,E0,r,d,A0),W0=f(p,n,E0,r,d,A0),c=this.k[N0],o=this.k[N0+1],x0=Y[N0],s=Y[N0+1],Z0=P(y,h,$0,m,a,W0,c,o,x0,s),w0=_(y,h,$0,m,a,W0,c,o,x0,s);y=I0(V,G),h=X0(V,G),$0=w(V,G,O,J,z,W),m=b(V,G,O,J,z,W);var S0=F(y,h,$0,m),V0=R(y,h,$0,m);t=d,i=A0,d=E0,A0=r,E0=p,r=n,p=F(j,N,Z0,w0),n=R(N,N,Z0,w0),j=z,N=W,z=O,W=J,O=V,J=G,V=F(Z0,w0,S0,V0),G=R(Z0,w0,S0,V0)}H(this.h,0,V,G),H(this.h,2,O,J),H(this.h,4,z,W),H(this.h,6,j,N),H(this.h,8,p,n),H(this.h,10,E0,r),H(this.h,12,d,A0),H(this.h,14,t,i)},v.prototype._digest=function(Z){if(Z==="hex")return E.toHex32(this.h,"big");else return E.split32(this.h,"big")};function g(Z,C,Y,V,G){var O=Z&Y^~Z&G;if(O<0)O+=4294967296;return O}function f(Z,C,Y,V,G,O){var J=C&V^~C&O;if(J<0)J+=4294967296;return J}function w(Z,C,Y,V,G){var O=Z&Y^Z&G^Y&G;if(O<0)O+=4294967296;return O}function b(Z,C,Y,V,G,O){var J=C&V^C&O^V&O;if(J<0)J+=4294967296;return J}function I0(Z,C){var Y=K(Z,C,28),V=K(C,Z,2),G=K(C,Z,7),O=Y^V^G;if(O<0)O+=4294967296;return O}function X0(Z,C){var Y=Q(Z,C,28),V=Q(C,Z,2),G=Q(C,Z,7),O=Y^V^G;if(O<0)O+=4294967296;return O}function C0(Z,C){var Y=K(Z,C,14),V=K(Z,C,18),G=K(C,Z,9),O=Y^V^G;if(O<0)O+=4294967296;return O}function u(Z,C){var Y=Q(Z,C,14),V=Q(Z,C,18),G=Q(C,Z,9),O=Y^V^G;if(O<0)O+=4294967296;return O}function O0(Z,C){var Y=K(Z,C,1),V=K(Z,C,8),G=T(Z,C,7),O=Y^V^G;if(O<0)O+=4294967296;return O}function U(Z,C){var Y=Q(Z,C,1),V=Q(Z,C,8),G=M(Z,C,7),O=Y^V^G;if(O<0)O+=4294967296;return O}function A(Z,C){var Y=K(Z,C,19),V=K(C,Z,29),G=T(Z,C,6),O=Y^V^G;if(O<0)O+=4294967296;return O}function X(Z,C){var Y=Q(Z,C,19),V=Q(C,Z,29),G=M(Z,C,6),O=Y^V^G;if(O<0)O+=4294967296;return O}}),xG=Q0(($,I)=>{var E=lU(),L=mI();function S(){if(!(this instanceof S))return new S;L.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}E.inherits(S,L),I.exports=S,S.blockSize=1024,S.outSize=384,S.hmacStrength=192,S.padLength=128,S.prototype._digest=function(K){if(K==="hex")return E.toHex32(this.h.slice(0,12),"big");else return E.split32(this.h.slice(0,12),"big")}}),NG=Q0(($)=>{$.sha1=BG(),$.sha224=gG(),$.sha256=sI(),$.sha384=xG(),$.sha512=mI()}),fG=Q0(($)=>{var I=lU(),E=lO(),L=I.rotl32,S=I.sum32,K=I.sum32_3,Q=I.sum32_4,T=E.BlockHash;function M(){if(!(this instanceof M))return new M;T.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}I.inherits(M,T),$.ripemd160=M,M.blockSize=512,M.outSize=160,M.hmacStrength=192,M.padLength=64,M.prototype._update=function(k,B){var v=this.h[0],g=this.h[1],f=this.h[2],w=this.h[3],b=this.h[4],I0=v,X0=g,C0=f,u=w,O0=b;for(var U=0;U<80;U++){var A=S(L(Q(v,H(U,g,f,w),k[D[U]+B],F(U)),P[U]),b);v=b,b=w,w=L(f,10),f=g,g=A,A=S(L(Q(I0,H(79-U,X0,C0,u),k[q[U]+B],R(U)),_[U]),O0),I0=O0,O0=u,u=L(C0,10),C0=X0,X0=A}A=K(this.h[1],f,u),this.h[1]=K(this.h[2],w,O0),this.h[2]=K(this.h[3],b,I0),this.h[3]=K(this.h[4],v,X0),this.h[4]=K(this.h[0],g,C0),this.h[0]=A},M.prototype._digest=function(k){if(k==="hex")return I.toHex32(this.h,"little");else return I.split32(this.h,"little")};function H(k,B,v,g){if(k<=15)return B^v^g;else if(k<=31)return B&v|~B&g;else if(k<=47)return(B|~v)^g;else if(k<=63)return B&g|v&~g;else return B^(v|~g)}function F(k){if(k<=15)return 0;else if(k<=31)return 1518500249;else if(k<=47)return 1859775393;else if(k<=63)return 2400959708;else return 2840853838}function R(k){if(k<=15)return 1352829926;else if(k<=31)return 1548603684;else if(k<=47)return 1836072691;else if(k<=63)return 2053994217;else return 0}var D=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],q=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],P=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],_=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]}),wG=Q0(($,I)=>{var E=lU(),L=UO();function S(K,Q,T){if(!(this instanceof S))return new S(K,Q,T);this.Hash=K,this.blockSize=K.blockSize/8,this.outSize=K.outSize/8,this.inner=null,this.outer=null,this._init(E.toArray(Q,T))}I.exports=S,S.prototype._init=function(K){if(K.length>this.blockSize)K=new this.Hash().update(K).digest();L(K.length<=this.blockSize);for(var Q=K.length;Q<this.blockSize;Q++)K.push(0);for(Q=0;Q<K.length;Q++)K[Q]^=54;this.inner=new this.Hash().update(K);for(Q=0;Q<K.length;Q++)K[Q]^=106;this.outer=new this.Hash().update(K)},S.prototype.update=function(K,Q){return this.inner.update(K,Q),this},S.prototype.digest=function(K){return this.outer.update(this.inner.digest()),this.outer.digest(K)}}),_A=Q0(($)=>{var I=$;I.utils=lU(),I.common=lO(),I.sha=NG(),I.ripemd=fG(),I.hmac=wG(),I.sha1=I.sha.sha1,I.sha256=I.sha.sha256,I.sha224=I.sha.sha224,I.sha384=I.sha.sha384,I.sha512=I.sha.sha512,I.ripemd160=I.ripemd.ripemd160}),yG=Q0(($,I)=>{I.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}),jA=Q0(($)=>{var I=$,E=_A(),L=nI(),S=wU(),K=S.assert;function Q(H){if(H.type==="short")this.curve=new L.short(H);else if(H.type==="edwards")this.curve=new L.edwards(H);else this.curve=new L.mont(H);this.g=this.curve.g,this.n=this.curve.n,this.hash=H.hash,K(this.g.validate(),"Invalid curve"),K(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}I.PresetCurve=Q;function T(H,F){Object.defineProperty(I,H,{configurable:!0,enumerable:!0,get:function(){var R=new Q(F);return Object.defineProperty(I,H,{configurable:!0,enumerable:!0,value:R}),R}})}T("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:E.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),T("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:E.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),T("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:E.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),T("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:E.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"]}),T("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:E.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"]}),T("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:E.sha256,gRed:!1,g:["9"]}),T("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:E.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var M;try{M=yG()}catch(H){M=void 0}T("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:E.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",M]})}),cG=Q0(($,I)=>{var E=_A(),L=bI(),S=UO();function K(Q){if(!(this instanceof K))return new K(Q);this.hash=Q.hash,this.predResist=!!Q.predResist,this.outLen=this.hash.outSize,this.minEntropy=Q.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var T=L.toArray(Q.entropy,Q.entropyEnc||"hex"),M=L.toArray(Q.nonce,Q.nonceEnc||"hex"),H=L.toArray(Q.pers,Q.persEnc||"hex");S(T.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(T,M,H)}I.exports=K,K.prototype._init=function(Q,T,M){var H=Q.concat(T).concat(M);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var F=0;F<this.V.length;F++)this.K[F]=0,this.V[F]=1;this._update(H),this._reseed=1,this.reseedInterval=281474976710656},K.prototype._hmac=function(){return new E.hmac(this.hash,this.K)},K.prototype._update=function(Q){var T=this._hmac().update(this.V).update([0]);if(Q)T=T.update(Q);if(this.K=T.digest(),this.V=this._hmac().update(this.V).digest(),!Q)return;this.K=this._hmac().update(this.V).update([1]).update(Q).digest(),this.V=this._hmac().update(this.V).digest()},K.prototype.reseed=function(Q,T,M,H){if(typeof T!=="string")H=M,M=T,T=null;Q=L.toArray(Q,T),M=L.toArray(M,H),S(Q.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(Q.concat(M||[])),this._reseed=1},K.prototype.generate=function(Q,T,M,H){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof T!=="string")H=M,M=T,T=null;if(M)M=L.toArray(M,H||"hex"),this._update(M);var F=[];while(F.length<Q)this.V=this._hmac().update(this.V).digest(),F=F.concat(this.V);var R=F.slice(0,Q);return this._update(M),this._reseed++,L.encode(R,T)}}),pG=Q0(($,I)=>{var E=sU(),L=wU(),S=L.assert;function K(Q,T){if(this.ec=Q,this.priv=null,this.pub=null,T.priv)this._importPrivate(T.priv,T.privEnc);if(T.pub)this._importPublic(T.pub,T.pubEnc)}I.exports=K,K.fromPublic=function(Q,T,M){if(T instanceof K)return T;return new K(Q,{pub:T,pubEnc:M})},K.fromPrivate=function(Q,T,M){if(T instanceof K)return T;return new K(Q,{priv:T,privEnc:M})},K.prototype.validate=function(){var Q=this.getPublic();if(Q.isInfinity())return{result:!1,reason:"Invalid public key"};if(!Q.validate())return{result:!1,reason:"Public key is not a point"};if(!Q.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},K.prototype.getPublic=function(Q,T){if(typeof Q==="string")T=Q,Q=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!T)return this.pub;return this.pub.encode(T,Q)},K.prototype.getPrivate=function(Q){if(Q==="hex")return this.priv.toString(16,2);else return this.priv},K.prototype._importPrivate=function(Q,T){this.priv=new E(Q,T||16),this.priv=this.priv.umod(this.ec.curve.n)},K.prototype._importPublic=function(Q,T){if(Q.x||Q.y){if(this.ec.curve.type==="mont")S(Q.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")S(Q.x&&Q.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(Q.x,Q.y);return}this.pub=this.ec.curve.decodePoint(Q,T)},K.prototype.derive=function(Q){if(!Q.validate())S(Q.validate(),"public point not validated");return Q.mul(this.priv).getX()},K.prototype.sign=function(Q,T,M){return this.ec.sign(Q,this,T,M)},K.prototype.verify=function(Q,T,M){return this.ec.verify(Q,T,this,void 0,M)},K.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),hG=Q0(($,I)=>{var E=sU(),L=wU(),S=L.assert;function K(F,R){if(F instanceof K)return F;if(this._importDER(F,R))return;if(S(F.r&&F.s,"Signature without r or s"),this.r=new E(F.r,16),this.s=new E(F.s,16),F.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=F.recoveryParam}I.exports=K;function Q(){this.place=0}function T(F,R){var D=F[R.place++];if(!(D&128))return D;var q=D&15;if(q===0||q>4)return!1;if(F[R.place]===0)return!1;var P=0;for(var _=0,k=R.place;_<q;_++,k++)P<<=8,P|=F[k],P>>>=0;if(P<=127)return!1;return R.place=k,P}function M(F){var R=0,D=F.length-1;while(!F[R]&&!(F[R+1]&128)&&R<D)R++;if(R===0)return F;return F.slice(R)}K.prototype._importDER=function(F,R){F=L.toArray(F,R);var D=new Q;if(F[D.place++]!==48)return!1;var q=T(F,D);if(q===!1)return!1;if(q+D.place!==F.length)return!1;if(F[D.place++]!==2)return!1;var P=T(F,D);if(P===!1)return!1;if((F[D.place]&128)!==0)return!1;var _=F.slice(D.place,P+D.place);if(D.place+=P,F[D.place++]!==2)return!1;var k=T(F,D);if(k===!1)return!1;if(F.length!==k+D.place)return!1;if((F[D.place]&128)!==0)return!1;var B=F.slice(D.place,k+D.place);if(_[0]===0)if(_[1]&128)_=_.slice(1);else return!1;if(B[0]===0)if(B[1]&128)B=B.slice(1);else return!1;return this.r=new E(_),this.s=new E(B),this.recoveryParam=null,!0};function H(F,R){if(R<128){F.push(R);return}var D=1+(Math.log(R)/Math.LN2>>>3);F.push(D|128);while(--D)F.push(R>>>(D<<3)&255);F.push(R)}K.prototype.toDER=function(F){var R=this.r.toArray(),D=this.s.toArray();if(R[0]&128)R=[0].concat(R);if(D[0]&128)D=[0].concat(D);R=M(R),D=M(D);while(!D[0]&&!(D[1]&128))D=D.slice(1);var q=[2];H(q,R.length),q=q.concat(R),q.push(2),H(q,D.length);var P=q.concat(D),_=[48];return H(_,P.length),_=_.concat(P),L.encode(_,F)}}),uG=Q0(($,I)=>{var E=sU(),L=cG(),S=wU(),K=jA(),Q=oI(),T=S.assert,M=pG(),H=hG();function F(R){if(!(this instanceof F))return new F(R);if(typeof R==="string")T(Object.prototype.hasOwnProperty.call(K,R),"Unknown curve "+R),R=K[R];if(R instanceof K.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}I.exports=F,F.prototype.keyPair=function(R){return new M(this,R)},F.prototype.keyFromPrivate=function(R,D){return M.fromPrivate(this,R,D)},F.prototype.keyFromPublic=function(R,D){return M.fromPublic(this,R,D)},F.prototype.genKeyPair=function(R){if(!R)R={};var D=new L({hash:this.hash,pers:R.pers,persEnc:R.persEnc||"utf8",entropy:R.entropy||Q(this.hash.hmacStrength),entropyEnc:R.entropy&&R.entropyEnc||"utf8",nonce:this.n.toArray()}),q=this.n.byteLength(),P=this.n.sub(new E(2));for(;;){var _=new E(D.generate(q));if(_.cmp(P)>0)continue;return _.iaddn(1),this.keyFromPrivate(_)}},F.prototype._truncateToN=function(R,D,q){var P;if(E.isBN(R)||typeof R==="number")R=new E(R,16),P=R.byteLength();else if(typeof R==="object")P=R.length,R=new E(R,16);else{var _=R.toString();P=_.length+1>>>1,R=new E(_,16)}if(typeof q!=="number")q=P*8;var k=q-this.n.bitLength();if(k>0)R=R.ushrn(k);if(!D&&R.cmp(this.n)>=0)return R.sub(this.n);else return R},F.prototype.sign=function(R,D,q,P){if(typeof q==="object")P=q,q=null;if(!P)P={};if(typeof R!=="string"&&typeof R!=="number"&&!E.isBN(R)){T(typeof R==="object"&&R&&typeof R.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),T(R.length>>>0===R.length);for(var _=0;_<R.length;_++)T((R[_]&255)===R[_])}D=this.keyFromPrivate(D,q),R=this._truncateToN(R,!1,P.msgBitLength),T(!R.isNeg(),"Can not sign a negative message");var k=this.n.byteLength(),B=D.getPrivate().toArray("be",k),v=R.toArray("be",k);T(new E(v).eq(R),"Can not sign message");var g=new L({hash:this.hash,entropy:B,nonce:v,pers:P.pers,persEnc:P.persEnc||"utf8"}),f=this.n.sub(new E(1));for(var w=0;;w++){var b=P.k?P.k(w):new E(g.generate(this.n.byteLength()));if(b=this._truncateToN(b,!0),b.cmpn(1)<=0||b.cmp(f)>=0)continue;var I0=this.g.mul(b);if(I0.isInfinity())continue;var X0=I0.getX(),C0=X0.umod(this.n);if(C0.cmpn(0)===0)continue;var u=b.invm(this.n).mul(C0.mul(D.getPrivate()).iadd(R));if(u=u.umod(this.n),u.cmpn(0)===0)continue;var O0=(I0.getY().isOdd()?1:0)|(X0.cmp(C0)!==0?2:0);if(P.canonical&&u.cmp(this.nh)>0)u=this.n.sub(u),O0^=1;return new H({r:C0,s:u,recoveryParam:O0})}},F.prototype.verify=function(R,D,q,P,_){if(!_)_={};R=this._truncateToN(R,!1,_.msgBitLength),q=this.keyFromPublic(q,P),D=new H(D,"hex");var{r:k,s:B}=D;if(k.cmpn(1)<0||k.cmp(this.n)>=0)return!1;if(B.cmpn(1)<0||B.cmp(this.n)>=0)return!1;var v=B.invm(this.n),g=v.mul(R).umod(this.n),f=v.mul(k).umod(this.n),w;if(!this.curve._maxwellTrick){if(w=this.g.mulAdd(g,q.getPublic(),f),w.isInfinity())return!1;return w.getX().umod(this.n).cmp(k)===0}if(w=this.g.jmulAdd(g,q.getPublic(),f),w.isInfinity())return!1;return w.eqXToP(k)},F.prototype.recoverPubKey=function(R,D,q,P){T((3&q)===q,"The recovery param is more than two bits"),D=new H(D,P);var _=this.n,k=new E(R),B=D.r,v=D.s,g=q&1,f=q>>1;if(B.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw Error("Unable to find sencond key candinate");if(f)B=this.curve.pointFromX(B.add(this.curve.n),g);else B=this.curve.pointFromX(B,g);var w=D.r.invm(_),b=_.sub(k).mul(w).umod(_),I0=v.mul(w).umod(_);return this.g.mulAdd(b,B,I0)},F.prototype.getKeyRecoveryParam=function(R,D,q,P){if(D=new H(D,P),D.recoveryParam!==null)return D.recoveryParam;for(var _=0;_<4;_++){var k;try{k=this.recoverPubKey(R,D,_)}catch(B){continue}if(k.eq(q))return _}throw Error("Unable to find valid recovery factor")}}),lG=Q0(($,I)=>{var E=wU(),L=E.assert,S=E.parseBytes,K=E.cachedProperty;function Q(T,M){if(this.eddsa=T,this._secret=S(M.secret),T.isPoint(M.pub))this._pub=M.pub;else this._pubBytes=S(M.pub)}Q.fromPublic=function(T,M){if(M instanceof Q)return M;return new Q(T,{pub:M})},Q.fromSecret=function(T,M){if(M instanceof Q)return M;return new Q(T,{secret:M})},Q.prototype.secret=function(){return this._secret},K(Q,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),K(Q,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),K(Q,"privBytes",function(){var T=this.eddsa,M=this.hash(),H=T.encodingLength-1,F=M.slice(0,T.encodingLength);return F[0]&=248,F[H]&=127,F[H]|=64,F}),K(Q,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),K(Q,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),K(Q,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),Q.prototype.sign=function(T){return L(this._secret,"KeyPair can only verify"),this.eddsa.sign(T,this)},Q.prototype.verify=function(T,M){return this.eddsa.verify(T,M,this)},Q.prototype.getSecret=function(T){return L(this._secret,"KeyPair is public only"),E.encode(this.secret(),T)},Q.prototype.getPublic=function(T){return E.encode(this.pubBytes(),T)},I.exports=Q}),dG=Q0(($,I)=>{var E=sU(),L=wU(),S=L.assert,K=L.cachedProperty,Q=L.parseBytes;function T(M,H){if(this.eddsa=M,typeof H!=="object")H=Q(H);if(Array.isArray(H))S(H.length===M.encodingLength*2,"Signature has invalid size"),H={R:H.slice(0,M.encodingLength),S:H.slice(M.encodingLength)};if(S(H.R&&H.S,"Signature without R or S"),M.isPoint(H.R))this._R=H.R;if(H.S instanceof E)this._S=H.S;this._Rencoded=Array.isArray(H.R)?H.R:H.Rencoded,this._Sencoded=Array.isArray(H.S)?H.S:H.Sencoded}K(T,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),K(T,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),K(T,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),K(T,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),T.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},T.prototype.toHex=function(){return L.encode(this.toBytes(),"hex").toUpperCase()},I.exports=T}),bG=Q0(($,I)=>{var E=_A(),L=jA(),S=wU(),K=S.assert,Q=S.parseBytes,T=lG(),M=dG();function H(F){if(K(F==="ed25519","only tested with ed25519 so far"),!(this instanceof H))return new H(F);F=L[F].curve,this.curve=F,this.g=F.g,this.g.precompute(F.n.bitLength()+1),this.pointClass=F.point().constructor,this.encodingLength=Math.ceil(F.n.bitLength()/8),this.hash=E.sha512}I.exports=H,H.prototype.sign=function(F,R){F=Q(F);var D=this.keyFromSecret(R),q=this.hashInt(D.messagePrefix(),F),P=this.g.mul(q),_=this.encodePoint(P),k=this.hashInt(_,D.pubBytes(),F).mul(D.priv()),B=q.add(k).umod(this.curve.n);return this.makeSignature({R:P,S:B,Rencoded:_})},H.prototype.verify=function(F,R,D){if(F=Q(F),R=this.makeSignature(R),R.S().gte(R.eddsa.curve.n)||R.S().isNeg())return!1;var q=this.keyFromPublic(D),P=this.hashInt(R.Rencoded(),q.pubBytes(),F),_=this.g.mul(R.S()),k=R.R().add(q.pub().mul(P));return k.eq(_)},H.prototype.hashInt=function(){var F=this.hash();for(var R=0;R<arguments.length;R++)F.update(arguments[R]);return S.intFromLE(F.digest()).umod(this.curve.n)},H.prototype.keyFromPublic=function(F){return T.fromPublic(this,F)},H.prototype.keyFromSecret=function(F){return T.fromSecret(this,F)},H.prototype.makeSignature=function(F){if(F instanceof M)return F;return new M(this,F)},H.prototype.encodePoint=function(F){var R=F.getY().toArray("le",this.encodingLength);return R[this.encodingLength-1]|=F.getX().isOdd()?128:0,R},H.prototype.decodePoint=function(F){F=S.parseBytes(F);var R=F.length-1,D=F.slice(0,R).concat(F[R]&-129),q=(F[R]&128)!==0,P=S.intFromLE(D);return this.curve.pointFromY(P,q)},H.prototype.encodeInt=function(F){return F.toArray("le",this.encodingLength)},H.prototype.decodeInt=function(F){return S.intFromLE(F)},H.prototype.isPoint=function(F){return F instanceof this.pointClass}}),oG=Q0(($)=>{var I=$;I.version=PG().version,I.utils=wU(),I.rand=oI(),I.curve=nI(),I.curves=jA(),I.ec=uG(),I.eddsa=bG()}),nG=Q0(($,I)=>{(function(E,L){function S(U,A){if(!U)throw Error(A||"Assertion failed")}function K(U,A){U.super_=A;var X=function(){};X.prototype=A.prototype,U.prototype=new X,U.prototype.constructor=U}function Q(U,A,X){if(Q.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(A==="le"||A==="be")X=A,A=10;this._init(U||0,A||10,X||"be")}}if(typeof E==="object")E.exports=Q;else L.BN=Q;Q.BN=Q,Q.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(DU(),l0(RU)).Buffer}catch(U){}Q.isBN=function(U){if(U instanceof Q)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===Q.wordSize&&Array.isArray(U.words)},Q.max=function(U,A){if(U.cmp(A)>0)return U;return A},Q.min=function(U,A){if(U.cmp(A)<0)return U;return A},Q.prototype._init=function(U,A,X){if(typeof U==="number")return this._initNumber(U,A,X);if(typeof U==="object")return this._initArray(U,A,X);if(A==="hex")A=16;S(A===(A|0)&&A>=2&&A<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(A===16)this._parseHex(U,Z,X);else if(this._parseBase(U,A,Z),X==="le")this._initArray(this.toArray(),A,X)}},Q.prototype._initNumber=function(U,A,X){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else S(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),A,X)},Q.prototype._initArray=function(U,A,X){if(S(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C,Y,V=0;if(X==="be"){for(Z=U.length-1,C=0;Z>=0;Z-=3)if(Y=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}else if(X==="le"){for(Z=0,C=0;Z<U.length;Z+=3)if(Y=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}return this.strip()};function M(U,A){var X=U.charCodeAt(A);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(U,A,X){var Z=M(U,X);if(X-1>=A)Z|=M(U,X-1)<<4;return Z}Q.prototype._parseHex=function(U,A,X){this.length=Math.ceil((U.length-A)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C=0,Y=0,V;if(X==="be")for(Z=U.length-1;Z>=A;Z-=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8;else{var G=U.length-A;for(Z=G%2===0?A+1:A;Z<U.length;Z+=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8}this.strip()};function F(U,A,X,Z){var C=0,Y=Math.min(U.length,X);for(var V=A;V<Y;V++){var G=U.charCodeAt(V)-48;if(C*=Z,G>=49)C+=G-49+10;else if(G>=17)C+=G-17+10;else C+=G}return C}Q.prototype._parseBase=function(U,A,X){this.words=[0],this.length=1;for(var Z=0,C=1;C<=67108863;C*=A)Z++;Z--,C=C/A|0;var Y=U.length-X,V=Y%Z,G=Math.min(Y,Y-V)+X,O=0;for(var J=X;J<G;J+=Z)if(O=F(U,J,J+Z,A),this.imuln(C),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(V!==0){var z=1;O=F(U,J,U.length,A);for(J=0;J<V;J++)z*=A;if(this.imuln(z),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},Q.prototype.copy=function(U){U.words=Array(this.length);for(var A=0;A<this.length;A++)U.words[A]=this.words[A];U.length=this.length,U.negative=this.negative,U.red=this.red},Q.prototype.clone=function(){var U=new Q(null);return this.copy(U),U},Q.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},Q.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Q.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Q.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var R=["","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"],D=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Q.prototype.toString=function(U,A){U=U||10,A=A|0||1;var X;if(U===16||U==="hex"){X="";var Z=0,C=0;for(var Y=0;Y<this.length;Y++){var V=this.words[Y],G=((V<<Z|C)&16777215).toString(16);if(C=V>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,Y--;if(C!==0||Y!==this.length-1)X=R[6-G.length]+G+X;else X=G+X}if(C!==0)X=C.toString(16)+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(U===(U|0)&&U>=2&&U<=36){var O=D[U],J=q[U];X="";var z=this.clone();z.negative=0;while(!z.isZero()){var W=z.modn(J).toString(U);if(z=z.idivn(J),!z.isZero())X=R[O-W.length]+W+X;else X=W+X}if(this.isZero())X="0"+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}S(!1,"Base should be between 2 and 36")},Q.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)S(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},Q.prototype.toJSON=function(){return this.toString(16)},Q.prototype.toBuffer=function(U,A){return S(typeof T<"u"),this.toArrayLike(T,U,A)},Q.prototype.toArray=function(U,A){return this.toArrayLike(Array,U,A)},Q.prototype.toArrayLike=function(U,A,X){var Z=this.byteLength(),C=X||Math.max(1,Z);S(Z<=C,"byte array longer than desired length"),S(C>0,"Requested array length <= 0"),this.strip();var Y=A==="le",V=new U(C),G,O,J=this.clone();if(!Y){for(O=0;O<C-Z;O++)V[O]=0;for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[C-O-1]=G}else{for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[O]=G;for(;O<C;O++)V[O]=0}return V},Math.clz32)Q.prototype._countBits=function(U){return 32-Math.clz32(U)};else Q.prototype._countBits=function(U){var A=U,X=0;if(A>=4096)X+=13,A>>>=13;if(A>=64)X+=7,A>>>=7;if(A>=8)X+=4,A>>>=4;if(A>=2)X+=2,A>>>=2;return X+A};Q.prototype._zeroBits=function(U){if(U===0)return 26;var A=U,X=0;if((A&8191)===0)X+=13,A>>>=13;if((A&127)===0)X+=7,A>>>=7;if((A&15)===0)X+=4,A>>>=4;if((A&3)===0)X+=2,A>>>=2;if((A&1)===0)X++;return X},Q.prototype.bitLength=function(){var U=this.words[this.length-1],A=this._countBits(U);return(this.length-1)*26+A};function P(U){var A=Array(U.bitLength());for(var X=0;X<A.length;X++){var Z=X/26|0,C=X%26;A[X]=(U.words[Z]&1<<C)>>>C}return A}Q.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var A=0;A<this.length;A++){var X=this._zeroBits(this.words[A]);if(U+=X,X!==26)break}return U},Q.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Q.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},Q.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},Q.prototype.isNeg=function(){return this.negative!==0},Q.prototype.neg=function(){return this.clone().ineg()},Q.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Q.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var A=0;A<U.length;A++)this.words[A]=this.words[A]|U.words[A];return this.strip()},Q.prototype.ior=function(U){return S((this.negative|U.negative)===0),this.iuor(U)},Q.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},Q.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},Q.prototype.iuand=function(U){var A;if(this.length>U.length)A=U;else A=this;for(var X=0;X<A.length;X++)this.words[X]=this.words[X]&U.words[X];return this.length=A.length,this.strip()},Q.prototype.iand=function(U){return S((this.negative|U.negative)===0),this.iuand(U)},Q.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},Q.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},Q.prototype.iuxor=function(U){var A,X;if(this.length>U.length)A=this,X=U;else A=U,X=this;for(var Z=0;Z<X.length;Z++)this.words[Z]=A.words[Z]^X.words[Z];if(this!==A)for(;Z<A.length;Z++)this.words[Z]=A.words[Z];return this.length=A.length,this.strip()},Q.prototype.ixor=function(U){return S((this.negative|U.negative)===0),this.iuxor(U)},Q.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},Q.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},Q.prototype.inotn=function(U){S(typeof U==="number"&&U>=0);var A=Math.ceil(U/26)|0,X=U%26;if(this._expand(A),X>0)A--;for(var Z=0;Z<A;Z++)this.words[Z]=~this.words[Z]&67108863;if(X>0)this.words[Z]=~this.words[Z]&67108863>>26-X;return this.strip()},Q.prototype.notn=function(U){return this.clone().inotn(U)},Q.prototype.setn=function(U,A){S(typeof U==="number"&&U>=0);var X=U/26|0,Z=U%26;if(this._expand(X+1),A)this.words[X]=this.words[X]|1<<Z;else this.words[X]=this.words[X]&~(1<<Z);return this.strip()},Q.prototype.iadd=function(U){var A;if(this.negative!==0&&U.negative===0)return this.negative=0,A=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,A=this.isub(U),U.negative=1,A._normSign();var X,Z;if(this.length>U.length)X=this,Z=U;else X=U,Z=this;var C=0;for(var Y=0;Y<Z.length;Y++)A=(X.words[Y]|0)+(Z.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;for(;C!==0&&Y<X.length;Y++)A=(X.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;if(this.length=X.length,C!==0)this.words[this.length]=C,this.length++;else if(X!==this)for(;Y<X.length;Y++)this.words[Y]=X.words[Y];return this},Q.prototype.add=function(U){var A;if(U.negative!==0&&this.negative===0)return U.negative=0,A=this.sub(U),U.negative^=1,A;else if(U.negative===0&&this.negative!==0)return this.negative=0,A=U.sub(this),this.negative=1,A;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},Q.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var A=this.iadd(U);return U.negative=1,A._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var X=this.cmp(U);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,C;if(X>0)Z=this,C=U;else Z=U,C=this;var Y=0;for(var V=0;V<C.length;V++)A=(Z.words[V]|0)-(C.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;for(;Y!==0&&V<Z.length;V++)A=(Z.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;if(Y===0&&V<Z.length&&Z!==this)for(;V<Z.length;V++)this.words[V]=Z.words[V];if(this.length=Math.max(this.length,V),Z!==this)this.negative=1;return this.strip()},Q.prototype.sub=function(U){return this.clone().isub(U)};function _(U,A,X){X.negative=A.negative^U.negative;var Z=U.length+A.length|0;X.length=Z,Z=Z-1|0;var C=U.words[0]|0,Y=A.words[0]|0,V=C*Y,G=V&67108863,O=V/67108864|0;X.words[0]=G;for(var J=1;J<Z;J++){var z=O>>>26,W=O&67108863,j=Math.min(J,A.length-1);for(var N=Math.max(0,J-U.length+1);N<=j;N++){var p=J-N|0;C=U.words[p]|0,Y=A.words[N]|0,V=C*Y+W,z+=V/67108864|0,W=V&67108863}X.words[J]=W|0,O=z|0}if(O!==0)X.words[J]=O|0;else X.length--;return X.strip()}var k=function(U,A,X){var Z=U.words,C=A.words,Y=X.words,V=0,G,O,J,z=Z[0]|0,W=z&8191,j=z>>>13,N=Z[1]|0,p=N&8191,n=N>>>13,E0=Z[2]|0,r=E0&8191,d=E0>>>13,A0=Z[3]|0,t=A0&8191,i=A0>>>13,N0=Z[4]|0,y=N0&8191,h=N0>>>13,$0=Z[5]|0,m=$0&8191,a=$0>>>13,W0=Z[6]|0,c=W0&8191,o=W0>>>13,x0=Z[7]|0,s=x0&8191,Z0=x0>>>13,w0=Z[8]|0,S0=w0&8191,V0=w0>>>13,m0=Z[9]|0,J0=m0&8191,L0=m0>>>13,a0=C[0]|0,K0=a0&8191,D0=a0>>>13,WU=C[1]|0,F0=WU&8191,k0=WU>>>13,FU=C[2]|0,_0=FU&8191,M0=FU>>>13,KU=C[3]|0,j0=KU&8191,z0=KU>>>13,SU=C[4]|0,v0=SU&8191,B0=SU>>>13,VU=C[5]|0,T0=VU&8191,x=VU>>>13,l=C[6]|0,e=l&8191,U0=l>>>13,f0=C[7]|0,Y0=f0&8191,R0=f0>>>13,r0=C[8]|0,q0=r0&8191,g0=r0>>>13,HU=C[9]|0,P0=HU&8191,H0=HU>>>13;X.negative=U.negative^A.negative,X.length=19,G=Math.imul(W,K0),O=Math.imul(W,D0),O=O+Math.imul(j,K0)|0,J=Math.imul(j,D0);var e0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(e0>>>26)|0,e0&=67108863,G=Math.imul(p,K0),O=Math.imul(p,D0),O=O+Math.imul(n,K0)|0,J=Math.imul(n,D0),G=G+Math.imul(W,F0)|0,O=O+Math.imul(W,k0)|0,O=O+Math.imul(j,F0)|0,J=J+Math.imul(j,k0)|0;var c0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,K0),O=Math.imul(r,D0),O=O+Math.imul(d,K0)|0,J=Math.imul(d,D0),G=G+Math.imul(p,F0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,F0)|0,J=J+Math.imul(n,k0)|0,G=G+Math.imul(W,_0)|0,O=O+Math.imul(W,M0)|0,O=O+Math.imul(j,_0)|0,J=J+Math.imul(j,M0)|0;var y0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(t,K0),O=Math.imul(t,D0),O=O+Math.imul(i,K0)|0,J=Math.imul(i,D0),G=G+Math.imul(r,F0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(d,F0)|0,J=J+Math.imul(d,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,M0)|0,O=O+Math.imul(n,_0)|0,J=J+Math.imul(n,M0)|0,G=G+Math.imul(W,j0)|0,O=O+Math.imul(W,z0)|0,O=O+Math.imul(j,j0)|0,J=J+Math.imul(j,z0)|0;var o0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(o0>>>26)|0,o0&=67108863,G=Math.imul(y,K0),O=Math.imul(y,D0),O=O+Math.imul(h,K0)|0,J=Math.imul(h,D0),G=G+Math.imul(t,F0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(i,F0)|0,J=J+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,M0)|0,O=O+Math.imul(d,_0)|0,J=J+Math.imul(d,M0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,j0)|0,J=J+Math.imul(n,z0)|0,G=G+Math.imul(W,v0)|0,O=O+Math.imul(W,B0)|0,O=O+Math.imul(j,v0)|0,J=J+Math.imul(j,B0)|0;var b0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(b0>>>26)|0,b0&=67108863,G=Math.imul(m,K0),O=Math.imul(m,D0),O=O+Math.imul(a,K0)|0,J=Math.imul(a,D0),G=G+Math.imul(y,F0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,F0)|0,J=J+Math.imul(h,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,M0)|0,O=O+Math.imul(i,_0)|0,J=J+Math.imul(i,M0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(d,j0)|0,J=J+Math.imul(d,z0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,v0)|0,J=J+Math.imul(n,B0)|0,G=G+Math.imul(W,T0)|0,O=O+Math.imul(W,x)|0,O=O+Math.imul(j,T0)|0,J=J+Math.imul(j,x)|0;var i0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,K0),O=Math.imul(c,D0),O=O+Math.imul(o,K0)|0,J=Math.imul(o,D0),G=G+Math.imul(m,F0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(a,F0)|0,J=J+Math.imul(a,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,M0)|0,O=O+Math.imul(h,_0)|0,J=J+Math.imul(h,M0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(i,j0)|0,J=J+Math.imul(i,z0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(d,v0)|0,J=J+Math.imul(d,B0)|0,G=G+Math.imul(p,T0)|0,O=O+Math.imul(p,x)|0,O=O+Math.imul(n,T0)|0,J=J+Math.imul(n,x)|0,G=G+Math.imul(W,e)|0,O=O+Math.imul(W,U0)|0,O=O+Math.imul(j,e)|0,J=J+Math.imul(j,U0)|0;var UU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,K0),O=Math.imul(s,D0),O=O+Math.imul(Z0,K0)|0,J=Math.imul(Z0,D0),G=G+Math.imul(c,F0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,F0)|0,J=J+Math.imul(o,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,M0)|0,O=O+Math.imul(a,_0)|0,J=J+Math.imul(a,M0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,j0)|0,J=J+Math.imul(h,z0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(i,v0)|0,J=J+Math.imul(i,B0)|0,G=G+Math.imul(r,T0)|0,O=O+Math.imul(r,x)|0,O=O+Math.imul(d,T0)|0,J=J+Math.imul(d,x)|0,G=G+Math.imul(p,e)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,e)|0,J=J+Math.imul(n,U0)|0,G=G+Math.imul(W,Y0)|0,O=O+Math.imul(W,R0)|0,O=O+Math.imul(j,Y0)|0,J=J+Math.imul(j,R0)|0;var OU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(S0,K0),O=Math.imul(S0,D0),O=O+Math.imul(V0,K0)|0,J=Math.imul(V0,D0),G=G+Math.imul(s,F0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,F0)|0,J=J+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,M0)|0,O=O+Math.imul(o,_0)|0,J=J+Math.imul(o,M0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(a,j0)|0,J=J+Math.imul(a,z0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,v0)|0,J=J+Math.imul(h,B0)|0,G=G+Math.imul(t,T0)|0,O=O+Math.imul(t,x)|0,O=O+Math.imul(i,T0)|0,J=J+Math.imul(i,x)|0,G=G+Math.imul(r,e)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(d,e)|0,J=J+Math.imul(d,U0)|0,G=G+Math.imul(p,Y0)|0,O=O+Math.imul(p,R0)|0,O=O+Math.imul(n,Y0)|0,J=J+Math.imul(n,R0)|0,G=G+Math.imul(W,q0)|0,O=O+Math.imul(W,g0)|0,O=O+Math.imul(j,q0)|0,J=J+Math.imul(j,g0)|0;var ZU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(J0,K0),O=Math.imul(J0,D0),O=O+Math.imul(L0,K0)|0,J=Math.imul(L0,D0),G=G+Math.imul(S0,F0)|0,O=O+Math.imul(S0,k0)|0,O=O+Math.imul(V0,F0)|0,J=J+Math.imul(V0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,M0)|0,O=O+Math.imul(Z0,_0)|0,J=J+Math.imul(Z0,M0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,j0)|0,J=J+Math.imul(o,z0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(a,v0)|0,J=J+Math.imul(a,B0)|0,G=G+Math.imul(y,T0)|0,O=O+Math.imul(y,x)|0,O=O+Math.imul(h,T0)|0,J=J+Math.imul(h,x)|0,G=G+Math.imul(t,e)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(i,e)|0,J=J+Math.imul(i,U0)|0,G=G+Math.imul(r,Y0)|0,O=O+Math.imul(r,R0)|0,O=O+Math.imul(d,Y0)|0,J=J+Math.imul(d,R0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,g0)|0,O=O+Math.imul(n,q0)|0,J=J+Math.imul(n,g0)|0,G=G+Math.imul(W,P0)|0,O=O+Math.imul(W,H0)|0,O=O+Math.imul(j,P0)|0,J=J+Math.imul(j,H0)|0;var AU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(J0,F0),O=Math.imul(J0,k0),O=O+Math.imul(L0,F0)|0,J=Math.imul(L0,k0),G=G+Math.imul(S0,_0)|0,O=O+Math.imul(S0,M0)|0,O=O+Math.imul(V0,_0)|0,J=J+Math.imul(V0,M0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,j0)|0,J=J+Math.imul(Z0,z0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,v0)|0,J=J+Math.imul(o,B0)|0,G=G+Math.imul(m,T0)|0,O=O+Math.imul(m,x)|0,O=O+Math.imul(a,T0)|0,J=J+Math.imul(a,x)|0,G=G+Math.imul(y,e)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,e)|0,J=J+Math.imul(h,U0)|0,G=G+Math.imul(t,Y0)|0,O=O+Math.imul(t,R0)|0,O=O+Math.imul(i,Y0)|0,J=J+Math.imul(i,R0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,g0)|0,O=O+Math.imul(d,q0)|0,J=J+Math.imul(d,g0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,H0)|0,O=O+Math.imul(n,P0)|0,J=J+Math.imul(n,H0)|0;var $U=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(J0,_0),O=Math.imul(J0,M0),O=O+Math.imul(L0,_0)|0,J=Math.imul(L0,M0),G=G+Math.imul(S0,j0)|0,O=O+Math.imul(S0,z0)|0,O=O+Math.imul(V0,j0)|0,J=J+Math.imul(V0,z0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,v0)|0,J=J+Math.imul(Z0,B0)|0,G=G+Math.imul(c,T0)|0,O=O+Math.imul(c,x)|0,O=O+Math.imul(o,T0)|0,J=J+Math.imul(o,x)|0,G=G+Math.imul(m,e)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(a,e)|0,J=J+Math.imul(a,U0)|0,G=G+Math.imul(y,Y0)|0,O=O+Math.imul(y,R0)|0,O=O+Math.imul(h,Y0)|0,J=J+Math.imul(h,R0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,g0)|0,O=O+Math.imul(i,q0)|0,J=J+Math.imul(i,g0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,H0)|0,O=O+Math.imul(d,P0)|0,J=J+Math.imul(d,H0)|0;var IU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,G=Math.imul(J0,j0),O=Math.imul(J0,z0),O=O+Math.imul(L0,j0)|0,J=Math.imul(L0,z0),G=G+Math.imul(S0,v0)|0,O=O+Math.imul(S0,B0)|0,O=O+Math.imul(V0,v0)|0,J=J+Math.imul(V0,B0)|0,G=G+Math.imul(s,T0)|0,O=O+Math.imul(s,x)|0,O=O+Math.imul(Z0,T0)|0,J=J+Math.imul(Z0,x)|0,G=G+Math.imul(c,e)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,e)|0,J=J+Math.imul(o,U0)|0,G=G+Math.imul(m,Y0)|0,O=O+Math.imul(m,R0)|0,O=O+Math.imul(a,Y0)|0,J=J+Math.imul(a,R0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,g0)|0,O=O+Math.imul(h,q0)|0,J=J+Math.imul(h,g0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,H0)|0,O=O+Math.imul(i,P0)|0,J=J+Math.imul(i,H0)|0;var CU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(CU>>>26)|0,CU&=67108863,G=Math.imul(J0,v0),O=Math.imul(J0,B0),O=O+Math.imul(L0,v0)|0,J=Math.imul(L0,B0),G=G+Math.imul(S0,T0)|0,O=O+Math.imul(S0,x)|0,O=O+Math.imul(V0,T0)|0,J=J+Math.imul(V0,x)|0,G=G+Math.imul(s,e)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,e)|0,J=J+Math.imul(Z0,U0)|0,G=G+Math.imul(c,Y0)|0,O=O+Math.imul(c,R0)|0,O=O+Math.imul(o,Y0)|0,J=J+Math.imul(o,R0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,g0)|0,O=O+Math.imul(a,q0)|0,J=J+Math.imul(a,g0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,H0)|0,O=O+Math.imul(h,P0)|0,J=J+Math.imul(h,H0)|0;var QU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(J0,T0),O=Math.imul(J0,x),O=O+Math.imul(L0,T0)|0,J=Math.imul(L0,x),G=G+Math.imul(S0,e)|0,O=O+Math.imul(S0,U0)|0,O=O+Math.imul(V0,e)|0,J=J+Math.imul(V0,U0)|0,G=G+Math.imul(s,Y0)|0,O=O+Math.imul(s,R0)|0,O=O+Math.imul(Z0,Y0)|0,J=J+Math.imul(Z0,R0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,g0)|0,O=O+Math.imul(o,q0)|0,J=J+Math.imul(o,g0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,H0)|0,O=O+Math.imul(a,P0)|0,J=J+Math.imul(a,H0)|0;var XU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(J0,e),O=Math.imul(J0,U0),O=O+Math.imul(L0,e)|0,J=Math.imul(L0,U0),G=G+Math.imul(S0,Y0)|0,O=O+Math.imul(S0,R0)|0,O=O+Math.imul(V0,Y0)|0,J=J+Math.imul(V0,R0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,g0)|0,O=O+Math.imul(Z0,q0)|0,J=J+Math.imul(Z0,g0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,H0)|0,O=O+Math.imul(o,P0)|0,J=J+Math.imul(o,H0)|0;var GU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(J0,Y0),O=Math.imul(J0,R0),O=O+Math.imul(L0,Y0)|0,J=Math.imul(L0,R0),G=G+Math.imul(S0,q0)|0,O=O+Math.imul(S0,g0)|0,O=O+Math.imul(V0,q0)|0,J=J+Math.imul(V0,g0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,H0)|0,O=O+Math.imul(Z0,P0)|0,J=J+Math.imul(Z0,H0)|0;var EU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(J0,q0),O=Math.imul(J0,g0),O=O+Math.imul(L0,q0)|0,J=Math.imul(L0,g0),G=G+Math.imul(S0,P0)|0,O=O+Math.imul(S0,H0)|0,O=O+Math.imul(V0,P0)|0,J=J+Math.imul(V0,H0)|0;var JU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(J0,P0),O=Math.imul(J0,H0),O=O+Math.imul(L0,P0)|0,J=Math.imul(L0,H0);var YU=(V+G|0)+((O&8191)<<13)|0;if(V=(J+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,Y[0]=e0,Y[1]=c0,Y[2]=y0,Y[3]=o0,Y[4]=b0,Y[5]=i0,Y[6]=UU,Y[7]=OU,Y[8]=ZU,Y[9]=AU,Y[10]=$U,Y[11]=IU,Y[12]=CU,Y[13]=QU,Y[14]=XU,Y[15]=GU,Y[16]=EU,Y[17]=JU,Y[18]=YU,V!==0)Y[19]=V,X.length++;return X};if(!Math.imul)k=_;function B(U,A,X){X.negative=A.negative^U.negative,X.length=U.length+A.length;var Z=0,C=0;for(var Y=0;Y<X.length-1;Y++){var V=C;C=0;var G=Z&67108863,O=Math.min(Y,A.length-1);for(var J=Math.max(0,Y-U.length+1);J<=O;J++){var z=Y-J,W=U.words[z]|0,j=A.words[J]|0,N=W*j,p=N&67108863;V=V+(N/67108864|0)|0,p=p+G|0,G=p&67108863,V=V+(p>>>26)|0,C+=V>>>26,V&=67108863}X.words[Y]=G,Z=V,V=C}if(Z!==0)X.words[Y]=Z;else X.length--;return X.strip()}function v(U,A,X){var Z=new g;return Z.mulp(U,A,X)}Q.prototype.mulTo=function(U,A){var X,Z=this.length+U.length;if(this.length===10&&U.length===10)X=k(this,U,A);else if(Z<63)X=_(this,U,A);else if(Z<1024)X=B(this,U,A);else X=v(this,U,A);return X};function g(U,A){this.x=U,this.y=A}g.prototype.makeRBT=function(U){var A=Array(U),X=Q.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)A[Z]=this.revBin(Z,X,U);return A},g.prototype.revBin=function(U,A,X){if(U===0||U===X-1)return U;var Z=0;for(var C=0;C<A;C++)Z|=(U&1)<<A-C-1,U>>=1;return Z},g.prototype.permute=function(U,A,X,Z,C,Y){for(var V=0;V<Y;V++)Z[V]=A[U[V]],C[V]=X[U[V]]},g.prototype.transform=function(U,A,X,Z,C,Y){this.permute(Y,U,A,X,Z,C);for(var V=1;V<C;V<<=1){var G=V<<1,O=Math.cos(2*Math.PI/G),J=Math.sin(2*Math.PI/G);for(var z=0;z<C;z+=G){var W=O,j=J;for(var N=0;N<V;N++){var p=X[z+N],n=Z[z+N],E0=X[z+N+V],r=Z[z+N+V],d=W*E0-j*r;if(r=W*r+j*E0,E0=d,X[z+N]=p+E0,Z[z+N]=n+r,X[z+N+V]=p-E0,Z[z+N+V]=n-r,N!==G)d=O*W-J*j,j=O*j+J*W,W=d}}}},g.prototype.guessLen13b=function(U,A){var X=Math.max(A,U)|1,Z=X&1,C=0;for(X=X/2|0;X;X=X>>>1)C++;return 1<<C+1+Z},g.prototype.conjugate=function(U,A,X){if(X<=1)return;for(var Z=0;Z<X/2;Z++){var C=U[Z];U[Z]=U[X-Z-1],U[X-Z-1]=C,C=A[Z],A[Z]=-A[X-Z-1],A[X-Z-1]=-C}},g.prototype.normalize13b=function(U,A){var X=0;for(var Z=0;Z<A/2;Z++){var C=Math.round(U[2*Z+1]/A)*8192+Math.round(U[2*Z]/A)+X;if(U[Z]=C&67108863,C<67108864)X=0;else X=C/67108864|0}return U},g.prototype.convert13b=function(U,A,X,Z){var C=0;for(var Y=0;Y<A;Y++)C=C+(U[Y]|0),X[2*Y]=C&8191,C=C>>>13,X[2*Y+1]=C&8191,C=C>>>13;for(Y=2*A;Y<Z;++Y)X[Y]=0;S(C===0),S((C&-8192)===0)},g.prototype.stub=function(U){var A=Array(U);for(var X=0;X<U;X++)A[X]=0;return A},g.prototype.mulp=function(U,A,X){var Z=2*this.guessLen13b(U.length,A.length),C=this.makeRBT(Z),Y=this.stub(Z),V=Array(Z),G=Array(Z),O=Array(Z),J=Array(Z),z=Array(Z),W=Array(Z),j=X.words;j.length=Z,this.convert13b(U.words,U.length,V,Z),this.convert13b(A.words,A.length,J,Z),this.transform(V,Y,G,O,Z,C),this.transform(J,Y,z,W,Z,C);for(var N=0;N<Z;N++){var p=G[N]*z[N]-O[N]*W[N];O[N]=G[N]*W[N]+O[N]*z[N],G[N]=p}return this.conjugate(G,O,Z),this.transform(G,O,j,Y,Z,C),this.conjugate(j,Y,Z),this.normalize13b(j,Z),X.negative=U.negative^A.negative,X.length=U.length+A.length,X.strip()},Q.prototype.mul=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),this.mulTo(U,A)},Q.prototype.mulf=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),v(this,U,A)},Q.prototype.imul=function(U){return this.clone().mulTo(U,this)},Q.prototype.imuln=function(U){S(typeof U==="number"),S(U<67108864);var A=0;for(var X=0;X<this.length;X++){var Z=(this.words[X]|0)*U,C=(Z&67108863)+(A&67108863);A>>=26,A+=Z/67108864|0,A+=C>>>26,this.words[X]=C&67108863}if(A!==0)this.words[X]=A,this.length++;return this.length=U===0?1:this.length,this},Q.prototype.muln=function(U){return this.clone().imuln(U)},Q.prototype.sqr=function(){return this.mul(this)},Q.prototype.isqr=function(){return this.imul(this.clone())},Q.prototype.pow=function(U){var A=P(U);if(A.length===0)return new Q(1);var X=this;for(var Z=0;Z<A.length;Z++,X=X.sqr())if(A[Z]!==0)break;if(++Z<A.length)for(var C=X.sqr();Z<A.length;Z++,C=C.sqr()){if(A[Z]===0)continue;X=X.mul(C)}return X},Q.prototype.iushln=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=67108863>>>26-A<<26-A,C;if(A!==0){var Y=0;for(C=0;C<this.length;C++){var V=this.words[C]&Z,G=(this.words[C]|0)-V<<A;this.words[C]=G|Y,Y=V>>>26-A}if(Y)this.words[C]=Y,this.length++}if(X!==0){for(C=this.length-1;C>=0;C--)this.words[C+X]=this.words[C];for(C=0;C<X;C++)this.words[C]=0;this.length+=X}return this.strip()},Q.prototype.ishln=function(U){return S(this.negative===0),this.iushln(U)},Q.prototype.iushrn=function(U,A,X){S(typeof U==="number"&&U>=0);var Z;if(A)Z=(A-A%26)/26;else Z=0;var C=U%26,Y=Math.min((U-C)/26,this.length),V=67108863^67108863>>>C<<C,G=X;if(Z-=Y,Z=Math.max(0,Z),G){for(var O=0;O<Y;O++)G.words[O]=this.words[O];G.length=Y}if(Y===0);else if(this.length>Y){this.length-=Y;for(O=0;O<this.length;O++)this.words[O]=this.words[O+Y]}else this.words[0]=0,this.length=1;var J=0;for(O=this.length-1;O>=0&&(J!==0||O>=Z);O--){var z=this.words[O]|0;this.words[O]=J<<26-C|z>>>C,J=z&V}if(G&&J!==0)G.words[G.length++]=J;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Q.prototype.ishrn=function(U,A,X){return S(this.negative===0),this.iushrn(U,A,X)},Q.prototype.shln=function(U){return this.clone().ishln(U)},Q.prototype.ushln=function(U){return this.clone().iushln(U)},Q.prototype.shrn=function(U){return this.clone().ishrn(U)},Q.prototype.ushrn=function(U){return this.clone().iushrn(U)},Q.prototype.testn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return!1;var C=this.words[X];return!!(C&Z)},Q.prototype.imaskn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26;if(S(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(A!==0)X++;if(this.length=Math.min(X,this.length),A!==0){var Z=67108863^67108863>>>A<<A;this.words[this.length-1]&=Z}return this.strip()},Q.prototype.maskn=function(U){return this.clone().imaskn(U)},Q.prototype.iaddn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},Q.prototype._iaddn=function(U){this.words[0]+=U;for(var A=0;A<this.length&&this.words[A]>=67108864;A++)if(this.words[A]-=67108864,A===this.length-1)this.words[A+1]=1;else this.words[A+1]++;return this.length=Math.max(this.length,A+1),this},Q.prototype.isubn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var A=0;A<this.length&&this.words[A]<0;A++)this.words[A]+=67108864,this.words[A+1]-=1;return this.strip()},Q.prototype.addn=function(U){return this.clone().iaddn(U)},Q.prototype.subn=function(U){return this.clone().isubn(U)},Q.prototype.iabs=function(){return this.negative=0,this},Q.prototype.abs=function(){return this.clone().iabs()},Q.prototype._ishlnsubmul=function(U,A,X){var Z=U.length+X,C;this._expand(Z);var Y,V=0;for(C=0;C<U.length;C++){Y=(this.words[C+X]|0)+V;var G=(U.words[C]|0)*A;Y-=G&67108863,V=(Y>>26)-(G/67108864|0),this.words[C+X]=Y&67108863}for(;C<this.length-X;C++)Y=(this.words[C+X]|0)+V,V=Y>>26,this.words[C+X]=Y&67108863;if(V===0)return this.strip();S(V===-1),V=0;for(C=0;C<this.length;C++)Y=-(this.words[C]|0)+V,V=Y>>26,this.words[C]=Y&67108863;return this.negative=1,this.strip()},Q.prototype._wordDiv=function(U,A){var X=this.length-U.length,Z=this.clone(),C=U,Y=C.words[C.length-1]|0,V=this._countBits(Y);if(X=26-V,X!==0)C=C.ushln(X),Z.iushln(X),Y=C.words[C.length-1]|0;var G=Z.length-C.length,O;if(A!=="mod"){O=new Q(null),O.length=G+1,O.words=Array(O.length);for(var J=0;J<O.length;J++)O.words[J]=0}var z=Z.clone()._ishlnsubmul(C,1,G);if(z.negative===0){if(Z=z,O)O.words[G]=1}for(var W=G-1;W>=0;W--){var j=(Z.words[C.length+W]|0)*67108864+(Z.words[C.length+W-1]|0);j=Math.min(j/Y|0,67108863),Z._ishlnsubmul(C,j,W);while(Z.negative!==0)if(j--,Z.negative=0,Z._ishlnsubmul(C,1,W),!Z.isZero())Z.negative^=1;if(O)O.words[W]=j}if(O)O.strip();if(Z.strip(),A!=="div"&&X!==0)Z.iushrn(X);return{div:O||null,mod:Z}},Q.prototype.divmod=function(U,A,X){if(S(!U.isZero()),this.isZero())return{div:new Q(0),mod:new Q(0)};var Z,C,Y;if(this.negative!==0&&U.negative===0){if(Y=this.neg().divmod(U,A),A!=="mod")Z=Y.div.neg();if(A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.iadd(U)}return{div:Z,mod:C}}if(this.negative===0&&U.negative!==0){if(Y=this.divmod(U.neg(),A),A!=="mod")Z=Y.div.neg();return{div:Z,mod:Y.mod}}if((this.negative&U.negative)!==0){if(Y=this.neg().divmod(U.neg(),A),A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.isub(U)}return{div:Y.div,mod:C}}if(U.length>this.length||this.cmp(U)<0)return{div:new Q(0),mod:this};if(U.length===1){if(A==="div")return{div:this.divn(U.words[0]),mod:null};if(A==="mod")return{div:null,mod:new Q(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new Q(this.modn(U.words[0]))}}return this._wordDiv(U,A)},Q.prototype.div=function(U){return this.divmod(U,"div",!1).div},Q.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},Q.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},Q.prototype.divRound=function(U){var A=this.divmod(U);if(A.mod.isZero())return A.div;var X=A.div.negative!==0?A.mod.isub(U):A.mod,Z=U.ushrn(1),C=U.andln(1),Y=X.cmp(Z);if(Y<0||C===1&&Y===0)return A.div;return A.div.negative!==0?A.div.isubn(1):A.div.iaddn(1)},Q.prototype.modn=function(U){S(U<=67108863);var A=67108864%U,X=0;for(var Z=this.length-1;Z>=0;Z--)X=(A*X+(this.words[Z]|0))%U;return X},Q.prototype.idivn=function(U){S(U<=67108863);var A=0;for(var X=this.length-1;X>=0;X--){var Z=(this.words[X]|0)+A*67108864;this.words[X]=Z/U|0,A=Z%U}return this.strip()},Q.prototype.divn=function(U){return this.clone().idivn(U)},Q.prototype.egcd=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=new Q(0),V=new Q(1),G=0;while(A.isEven()&&X.isEven())A.iushrn(1),X.iushrn(1),++G;var O=X.clone(),J=A.clone();while(!A.isZero()){for(var z=0,W=1;(A.words[0]&W)===0&&z<26;++z,W<<=1);if(z>0){A.iushrn(z);while(z-- >0){if(Z.isOdd()||C.isOdd())Z.iadd(O),C.isub(J);Z.iushrn(1),C.iushrn(1)}}for(var j=0,N=1;(X.words[0]&N)===0&&j<26;++j,N<<=1);if(j>0){X.iushrn(j);while(j-- >0){if(Y.isOdd()||V.isOdd())Y.iadd(O),V.isub(J);Y.iushrn(1),V.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(Y),C.isub(V);else X.isub(A),Y.isub(Z),V.isub(C)}return{a:Y,b:V,gcd:X.iushln(G)}},Q.prototype._invmp=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=X.clone();while(A.cmpn(1)>0&&X.cmpn(1)>0){for(var V=0,G=1;(A.words[0]&G)===0&&V<26;++V,G<<=1);if(V>0){A.iushrn(V);while(V-- >0){if(Z.isOdd())Z.iadd(Y);Z.iushrn(1)}}for(var O=0,J=1;(X.words[0]&J)===0&&O<26;++O,J<<=1);if(O>0){X.iushrn(O);while(O-- >0){if(C.isOdd())C.iadd(Y);C.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(C);else X.isub(A),C.isub(Z)}var z;if(A.cmpn(1)===0)z=Z;else z=C;if(z.cmpn(0)<0)z.iadd(U);return z},Q.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var A=this.clone(),X=U.clone();A.negative=0,X.negative=0;for(var Z=0;A.isEven()&&X.isEven();Z++)A.iushrn(1),X.iushrn(1);do{while(A.isEven())A.iushrn(1);while(X.isEven())X.iushrn(1);var C=A.cmp(X);if(C<0){var Y=A;A=X,X=Y}else if(C===0||X.cmpn(1)===0)break;A.isub(X)}while(!0);return X.iushln(Z)},Q.prototype.invm=function(U){return this.egcd(U).a.umod(U)},Q.prototype.isEven=function(){return(this.words[0]&1)===0},Q.prototype.isOdd=function(){return(this.words[0]&1)===1},Q.prototype.andln=function(U){return this.words[0]&U},Q.prototype.bincn=function(U){S(typeof U==="number");var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return this._expand(X+1),this.words[X]|=Z,this;var C=Z;for(var Y=X;C!==0&&Y<this.length;Y++){var V=this.words[Y]|0;V+=C,C=V>>>26,V&=67108863,this.words[Y]=V}if(C!==0)this.words[Y]=C,this.length++;return this},Q.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Q.prototype.cmpn=function(U){var A=U<0;if(this.negative!==0&&!A)return-1;if(this.negative===0&&A)return 1;this.strip();var X;if(this.length>1)X=1;else{if(A)U=-U;S(U<=67108863,"Number is too big");var Z=this.words[0]|0;X=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-X|0;return X},Q.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var A=this.ucmp(U);if(this.negative!==0)return-A|0;return A},Q.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var A=0;for(var X=this.length-1;X>=0;X--){var Z=this.words[X]|0,C=U.words[X]|0;if(Z===C)continue;if(Z<C)A=-1;else if(Z>C)A=1;break}return A},Q.prototype.gtn=function(U){return this.cmpn(U)===1},Q.prototype.gt=function(U){return this.cmp(U)===1},Q.prototype.gten=function(U){return this.cmpn(U)>=0},Q.prototype.gte=function(U){return this.cmp(U)>=0},Q.prototype.ltn=function(U){return this.cmpn(U)===-1},Q.prototype.lt=function(U){return this.cmp(U)===-1},Q.prototype.lten=function(U){return this.cmpn(U)<=0},Q.prototype.lte=function(U){return this.cmp(U)<=0},Q.prototype.eqn=function(U){return this.cmpn(U)===0},Q.prototype.eq=function(U){return this.cmp(U)===0},Q.red=function(U){return new u(U)},Q.prototype.toRed=function(U){return S(!this.red,"Already a number in reduction context"),S(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},Q.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Q.prototype._forceRed=function(U){return this.red=U,this},Q.prototype.forceRed=function(U){return S(!this.red,"Already a number in reduction context"),this._forceRed(U)},Q.prototype.redAdd=function(U){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},Q.prototype.redIAdd=function(U){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},Q.prototype.redSub=function(U){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},Q.prototype.redISub=function(U){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},Q.prototype.redShl=function(U){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},Q.prototype.redMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},Q.prototype.redIMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},Q.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Q.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Q.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Q.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Q.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Q.prototype.redPow=function(U){return S(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,A){this.name=U,this.p=new Q(A,16),this.n=this.p.bitLength(),this.k=new Q(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new Q(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var A=U,X;do this.split(A,this.tmp),A=this.imulK(A),A=A.iadd(this.tmp),X=A.bitLength();while(X>this.n);var Z=X<this.n?-1:A.ucmp(this.p);if(Z===0)A.words[0]=0,A.length=1;else if(Z>0)A.isub(this.p);else if(A.strip!==void 0)A.strip();else A._strip();return A},w.prototype.split=function(U,A){U.iushrn(this.n,0,A)},w.prototype.imulK=function(U){return U.imul(this.k)};function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(b,w),b.prototype.split=function(U,A){var X=4194303,Z=Math.min(U.length,9);for(var C=0;C<Z;C++)A.words[C]=U.words[C];if(A.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var Y=U.words[9];A.words[A.length++]=Y&X;for(C=10;C<U.length;C++){var V=U.words[C]|0;U.words[C-10]=(V&X)<<4|Y>>>22,Y=V}if(Y>>>=22,U.words[C-10]=Y,Y===0&&U.length>10)U.length-=10;else U.length-=9},b.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var A=0;for(var X=0;X<U.length;X++){var Z=U.words[X]|0;A+=Z*977,U.words[X]=A&67108863,A=Z*64+(A/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function I0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(I0,w);function X0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K(X0,w);function C0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(C0,w),C0.prototype.imulK=function(U){var A=0;for(var X=0;X<U.length;X++){var Z=(U.words[X]|0)*19+A,C=Z&67108863;Z>>>=26,U.words[X]=C,A=Z}if(A!==0)U.words[U.length++]=A;return U},Q._prime=function(U){if(f[U])return f[U];var A;if(U==="k256")A=new b;else if(U==="p224")A=new I0;else if(U==="p192")A=new X0;else if(U==="p25519")A=new C0;else throw Error("Unknown prime "+U);return f[U]=A,A};function u(U){if(typeof U==="string"){var A=Q._prime(U);this.m=A.p,this.prime=A}else S(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){S(U.negative===0,"red works only with positives"),S(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,A){S((U.negative|A.negative)===0,"red works only with positives"),S(U.red&&U.red===A.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,A){this._verify2(U,A);var X=U.add(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},u.prototype.iadd=function(U,A){this._verify2(U,A);var X=U.iadd(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X},u.prototype.sub=function(U,A){this._verify2(U,A);var X=U.sub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},u.prototype.isub=function(U,A){this._verify2(U,A);var X=U.isub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X},u.prototype.shl=function(U,A){return this._verify1(U),this.imod(U.ushln(A))},u.prototype.imul=function(U,A){return this._verify2(U,A),this.imod(U.imul(A))},u.prototype.mul=function(U,A){return this._verify2(U,A),this.imod(U.mul(A))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var A=this.m.andln(3);if(S(A%2===1),A===3){var X=this.m.add(new Q(1)).iushrn(2);return this.pow(U,X)}var Z=this.m.subn(1),C=0;while(!Z.isZero()&&Z.andln(1)===0)C++,Z.iushrn(1);S(!Z.isZero());var Y=new Q(1).toRed(this),V=Y.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new Q(2*O*O).toRed(this);while(this.pow(O,G).cmp(V)!==0)O.redIAdd(V);var J=this.pow(O,Z),z=this.pow(U,Z.addn(1).iushrn(1)),W=this.pow(U,Z),j=C;while(W.cmp(Y)!==0){var N=W;for(var p=0;N.cmp(Y)!==0;p++)N=N.redSqr();S(p<j);var n=this.pow(J,new Q(1).iushln(j-p-1));z=z.redMul(n),J=n.redSqr(),W=W.redMul(J),j=p}return z},u.prototype.invm=function(U){var A=U._invmp(this.m);if(A.negative!==0)return A.negative=0,this.imod(A).redNeg();else return this.imod(A)},u.prototype.pow=function(U,A){if(A.isZero())return new Q(1).toRed(this);if(A.cmpn(1)===0)return U.clone();var X=4,Z=Array(1<<X);Z[0]=new Q(1).toRed(this),Z[1]=U;for(var C=2;C<Z.length;C++)Z[C]=this.mul(Z[C-1],U);var Y=Z[0],V=0,G=0,O=A.bitLength()%26;if(O===0)O=26;for(C=A.length-1;C>=0;C--){var J=A.words[C];for(var z=O-1;z>=0;z--){var W=J>>z&1;if(Y!==Z[0])Y=this.sqr(Y);if(W===0&&V===0){G=0;continue}if(V<<=1,V|=W,G++,G!==X&&(C!==0||z!==0))continue;Y=this.mul(Y,Z[V]),G=0,V=0}O=26}return Y},u.prototype.convertTo=function(U){var A=U.umod(this.m);return A===U?A.clone():A},u.prototype.convertFrom=function(U){var A=U.clone();return A.red=null,A},Q.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Q(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)}K(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var A=this.imod(U.mul(this.rinv));return A.red=null,A},O0.prototype.imul=function(U,A){if(U.isZero()||A.isZero())return U.words[0]=0,U.length=1,U;var X=U.imul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.mul=function(U,A){if(U.isZero()||A.isZero())return new Q(0)._forceRed(this);var X=U.mul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.invm=function(U){var A=this.imod(U._invmp(this.m).mul(this.r2));return A._forceRed(this)}})(typeof I>"u"||I,$)}),tG=Q0(($,I)=>{var E=oG(),L=nG();I.exports=function(T){return new K(T)};var S={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};S.p224=S.secp224r1,S.p256=S.secp256r1=S.prime256v1,S.p192=S.secp192r1=S.prime192v1,S.p384=S.secp384r1,S.p521=S.secp521r1;function K(T){if(this.curveType=S[T],!this.curveType)this.curveType={name:T};this.curve=new E.ec(this.curveType.name),this.keys=void 0}K.prototype.generateKeys=function(T,M){return this.keys=this.curve.genKeyPair(),this.getPublicKey(T,M)},K.prototype.computeSecret=function(T,M,H){if(M=M||"utf8",!Buffer.isBuffer(T))T=new Buffer(T,M);var F=this.curve.keyFromPublic(T).getPublic(),R=F.mul(this.keys.getPrivate()).getX();return Q(R,H,this.curveType.byteLength)},K.prototype.getPublicKey=function(T,M){var H=this.keys.getPublic(M==="compressed",!0);if(M==="hybrid")if(H[H.length-1]%2)H[0]=7;else H[0]=6;return Q(H,T)},K.prototype.getPrivateKey=function(T){return Q(this.keys.getPrivate(),T)},K.prototype.setPublicKey=function(T,M){if(M=M||"utf8",!Buffer.isBuffer(T))T=new Buffer(T,M);return this.keys._importPublic(T),this},K.prototype.setPrivateKey=function(T,M){if(M=M||"utf8",!Buffer.isBuffer(T))T=new Buffer(T,M);var H=new L(T);return H=H.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(H),this};function Q(T,M,H){if(!Array.isArray(T))T=T.toArray();var F=new Buffer(T);if(H&&F.length<H){var R=new Buffer(H-F.length);R.fill(0),F=Buffer.concat([R,F])}if(!M)return F;else return F.toString(M)}}),sG=Q0(($,I)=>{var E=(vU(),l0(jU)).createECDH;I.exports=E||tG()}),mG=Q0(($,I)=>{(function(E,L){function S(U,A){if(!U)throw Error(A||"Assertion failed")}function K(U,A){U.super_=A;var X=function(){};X.prototype=A.prototype,U.prototype=new X,U.prototype.constructor=U}function Q(U,A,X){if(Q.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(A==="le"||A==="be")X=A,A=10;this._init(U||0,A||10,X||"be")}}if(typeof E==="object")E.exports=Q;else L.BN=Q;Q.BN=Q,Q.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(DU(),l0(RU)).Buffer}catch(U){}Q.isBN=function(U){if(U instanceof Q)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===Q.wordSize&&Array.isArray(U.words)},Q.max=function(U,A){if(U.cmp(A)>0)return U;return A},Q.min=function(U,A){if(U.cmp(A)<0)return U;return A},Q.prototype._init=function(U,A,X){if(typeof U==="number")return this._initNumber(U,A,X);if(typeof U==="object")return this._initArray(U,A,X);if(A==="hex")A=16;S(A===(A|0)&&A>=2&&A<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(A===16)this._parseHex(U,Z,X);else if(this._parseBase(U,A,Z),X==="le")this._initArray(this.toArray(),A,X)}},Q.prototype._initNumber=function(U,A,X){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else S(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),A,X)},Q.prototype._initArray=function(U,A,X){if(S(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C,Y,V=0;if(X==="be"){for(Z=U.length-1,C=0;Z>=0;Z-=3)if(Y=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}else if(X==="le"){for(Z=0,C=0;Z<U.length;Z+=3)if(Y=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}return this.strip()};function M(U,A){var X=U.charCodeAt(A);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(U,A,X){var Z=M(U,X);if(X-1>=A)Z|=M(U,X-1)<<4;return Z}Q.prototype._parseHex=function(U,A,X){this.length=Math.ceil((U.length-A)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C=0,Y=0,V;if(X==="be")for(Z=U.length-1;Z>=A;Z-=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8;else{var G=U.length-A;for(Z=G%2===0?A+1:A;Z<U.length;Z+=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8}this.strip()};function F(U,A,X,Z){var C=0,Y=Math.min(U.length,X);for(var V=A;V<Y;V++){var G=U.charCodeAt(V)-48;if(C*=Z,G>=49)C+=G-49+10;else if(G>=17)C+=G-17+10;else C+=G}return C}Q.prototype._parseBase=function(U,A,X){this.words=[0],this.length=1;for(var Z=0,C=1;C<=67108863;C*=A)Z++;Z--,C=C/A|0;var Y=U.length-X,V=Y%Z,G=Math.min(Y,Y-V)+X,O=0;for(var J=X;J<G;J+=Z)if(O=F(U,J,J+Z,A),this.imuln(C),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(V!==0){var z=1;O=F(U,J,U.length,A);for(J=0;J<V;J++)z*=A;if(this.imuln(z),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},Q.prototype.copy=function(U){U.words=Array(this.length);for(var A=0;A<this.length;A++)U.words[A]=this.words[A];U.length=this.length,U.negative=this.negative,U.red=this.red},Q.prototype.clone=function(){var U=new Q(null);return this.copy(U),U},Q.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},Q.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Q.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Q.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var R=["","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"],D=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Q.prototype.toString=function(U,A){U=U||10,A=A|0||1;var X;if(U===16||U==="hex"){X="";var Z=0,C=0;for(var Y=0;Y<this.length;Y++){var V=this.words[Y],G=((V<<Z|C)&16777215).toString(16);if(C=V>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,Y--;if(C!==0||Y!==this.length-1)X=R[6-G.length]+G+X;else X=G+X}if(C!==0)X=C.toString(16)+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(U===(U|0)&&U>=2&&U<=36){var O=D[U],J=q[U];X="";var z=this.clone();z.negative=0;while(!z.isZero()){var W=z.modn(J).toString(U);if(z=z.idivn(J),!z.isZero())X=R[O-W.length]+W+X;else X=W+X}if(this.isZero())X="0"+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}S(!1,"Base should be between 2 and 36")},Q.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)S(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},Q.prototype.toJSON=function(){return this.toString(16)},Q.prototype.toBuffer=function(U,A){return S(typeof T<"u"),this.toArrayLike(T,U,A)},Q.prototype.toArray=function(U,A){return this.toArrayLike(Array,U,A)},Q.prototype.toArrayLike=function(U,A,X){var Z=this.byteLength(),C=X||Math.max(1,Z);S(Z<=C,"byte array longer than desired length"),S(C>0,"Requested array length <= 0"),this.strip();var Y=A==="le",V=new U(C),G,O,J=this.clone();if(!Y){for(O=0;O<C-Z;O++)V[O]=0;for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[C-O-1]=G}else{for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[O]=G;for(;O<C;O++)V[O]=0}return V},Math.clz32)Q.prototype._countBits=function(U){return 32-Math.clz32(U)};else Q.prototype._countBits=function(U){var A=U,X=0;if(A>=4096)X+=13,A>>>=13;if(A>=64)X+=7,A>>>=7;if(A>=8)X+=4,A>>>=4;if(A>=2)X+=2,A>>>=2;return X+A};Q.prototype._zeroBits=function(U){if(U===0)return 26;var A=U,X=0;if((A&8191)===0)X+=13,A>>>=13;if((A&127)===0)X+=7,A>>>=7;if((A&15)===0)X+=4,A>>>=4;if((A&3)===0)X+=2,A>>>=2;if((A&1)===0)X++;return X},Q.prototype.bitLength=function(){var U=this.words[this.length-1],A=this._countBits(U);return(this.length-1)*26+A};function P(U){var A=Array(U.bitLength());for(var X=0;X<A.length;X++){var Z=X/26|0,C=X%26;A[X]=(U.words[Z]&1<<C)>>>C}return A}Q.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var A=0;A<this.length;A++){var X=this._zeroBits(this.words[A]);if(U+=X,X!==26)break}return U},Q.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Q.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},Q.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},Q.prototype.isNeg=function(){return this.negative!==0},Q.prototype.neg=function(){return this.clone().ineg()},Q.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Q.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var A=0;A<U.length;A++)this.words[A]=this.words[A]|U.words[A];return this.strip()},Q.prototype.ior=function(U){return S((this.negative|U.negative)===0),this.iuor(U)},Q.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},Q.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},Q.prototype.iuand=function(U){var A;if(this.length>U.length)A=U;else A=this;for(var X=0;X<A.length;X++)this.words[X]=this.words[X]&U.words[X];return this.length=A.length,this.strip()},Q.prototype.iand=function(U){return S((this.negative|U.negative)===0),this.iuand(U)},Q.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},Q.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},Q.prototype.iuxor=function(U){var A,X;if(this.length>U.length)A=this,X=U;else A=U,X=this;for(var Z=0;Z<X.length;Z++)this.words[Z]=A.words[Z]^X.words[Z];if(this!==A)for(;Z<A.length;Z++)this.words[Z]=A.words[Z];return this.length=A.length,this.strip()},Q.prototype.ixor=function(U){return S((this.negative|U.negative)===0),this.iuxor(U)},Q.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},Q.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},Q.prototype.inotn=function(U){S(typeof U==="number"&&U>=0);var A=Math.ceil(U/26)|0,X=U%26;if(this._expand(A),X>0)A--;for(var Z=0;Z<A;Z++)this.words[Z]=~this.words[Z]&67108863;if(X>0)this.words[Z]=~this.words[Z]&67108863>>26-X;return this.strip()},Q.prototype.notn=function(U){return this.clone().inotn(U)},Q.prototype.setn=function(U,A){S(typeof U==="number"&&U>=0);var X=U/26|0,Z=U%26;if(this._expand(X+1),A)this.words[X]=this.words[X]|1<<Z;else this.words[X]=this.words[X]&~(1<<Z);return this.strip()},Q.prototype.iadd=function(U){var A;if(this.negative!==0&&U.negative===0)return this.negative=0,A=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,A=this.isub(U),U.negative=1,A._normSign();var X,Z;if(this.length>U.length)X=this,Z=U;else X=U,Z=this;var C=0;for(var Y=0;Y<Z.length;Y++)A=(X.words[Y]|0)+(Z.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;for(;C!==0&&Y<X.length;Y++)A=(X.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;if(this.length=X.length,C!==0)this.words[this.length]=C,this.length++;else if(X!==this)for(;Y<X.length;Y++)this.words[Y]=X.words[Y];return this},Q.prototype.add=function(U){var A;if(U.negative!==0&&this.negative===0)return U.negative=0,A=this.sub(U),U.negative^=1,A;else if(U.negative===0&&this.negative!==0)return this.negative=0,A=U.sub(this),this.negative=1,A;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},Q.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var A=this.iadd(U);return U.negative=1,A._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var X=this.cmp(U);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,C;if(X>0)Z=this,C=U;else Z=U,C=this;var Y=0;for(var V=0;V<C.length;V++)A=(Z.words[V]|0)-(C.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;for(;Y!==0&&V<Z.length;V++)A=(Z.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;if(Y===0&&V<Z.length&&Z!==this)for(;V<Z.length;V++)this.words[V]=Z.words[V];if(this.length=Math.max(this.length,V),Z!==this)this.negative=1;return this.strip()},Q.prototype.sub=function(U){return this.clone().isub(U)};function _(U,A,X){X.negative=A.negative^U.negative;var Z=U.length+A.length|0;X.length=Z,Z=Z-1|0;var C=U.words[0]|0,Y=A.words[0]|0,V=C*Y,G=V&67108863,O=V/67108864|0;X.words[0]=G;for(var J=1;J<Z;J++){var z=O>>>26,W=O&67108863,j=Math.min(J,A.length-1);for(var N=Math.max(0,J-U.length+1);N<=j;N++){var p=J-N|0;C=U.words[p]|0,Y=A.words[N]|0,V=C*Y+W,z+=V/67108864|0,W=V&67108863}X.words[J]=W|0,O=z|0}if(O!==0)X.words[J]=O|0;else X.length--;return X.strip()}var k=function(U,A,X){var Z=U.words,C=A.words,Y=X.words,V=0,G,O,J,z=Z[0]|0,W=z&8191,j=z>>>13,N=Z[1]|0,p=N&8191,n=N>>>13,E0=Z[2]|0,r=E0&8191,d=E0>>>13,A0=Z[3]|0,t=A0&8191,i=A0>>>13,N0=Z[4]|0,y=N0&8191,h=N0>>>13,$0=Z[5]|0,m=$0&8191,a=$0>>>13,W0=Z[6]|0,c=W0&8191,o=W0>>>13,x0=Z[7]|0,s=x0&8191,Z0=x0>>>13,w0=Z[8]|0,S0=w0&8191,V0=w0>>>13,m0=Z[9]|0,J0=m0&8191,L0=m0>>>13,a0=C[0]|0,K0=a0&8191,D0=a0>>>13,WU=C[1]|0,F0=WU&8191,k0=WU>>>13,FU=C[2]|0,_0=FU&8191,M0=FU>>>13,KU=C[3]|0,j0=KU&8191,z0=KU>>>13,SU=C[4]|0,v0=SU&8191,B0=SU>>>13,VU=C[5]|0,T0=VU&8191,x=VU>>>13,l=C[6]|0,e=l&8191,U0=l>>>13,f0=C[7]|0,Y0=f0&8191,R0=f0>>>13,r0=C[8]|0,q0=r0&8191,g0=r0>>>13,HU=C[9]|0,P0=HU&8191,H0=HU>>>13;X.negative=U.negative^A.negative,X.length=19,G=Math.imul(W,K0),O=Math.imul(W,D0),O=O+Math.imul(j,K0)|0,J=Math.imul(j,D0);var e0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(e0>>>26)|0,e0&=67108863,G=Math.imul(p,K0),O=Math.imul(p,D0),O=O+Math.imul(n,K0)|0,J=Math.imul(n,D0),G=G+Math.imul(W,F0)|0,O=O+Math.imul(W,k0)|0,O=O+Math.imul(j,F0)|0,J=J+Math.imul(j,k0)|0;var c0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,K0),O=Math.imul(r,D0),O=O+Math.imul(d,K0)|0,J=Math.imul(d,D0),G=G+Math.imul(p,F0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,F0)|0,J=J+Math.imul(n,k0)|0,G=G+Math.imul(W,_0)|0,O=O+Math.imul(W,M0)|0,O=O+Math.imul(j,_0)|0,J=J+Math.imul(j,M0)|0;var y0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(t,K0),O=Math.imul(t,D0),O=O+Math.imul(i,K0)|0,J=Math.imul(i,D0),G=G+Math.imul(r,F0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(d,F0)|0,J=J+Math.imul(d,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,M0)|0,O=O+Math.imul(n,_0)|0,J=J+Math.imul(n,M0)|0,G=G+Math.imul(W,j0)|0,O=O+Math.imul(W,z0)|0,O=O+Math.imul(j,j0)|0,J=J+Math.imul(j,z0)|0;var o0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(o0>>>26)|0,o0&=67108863,G=Math.imul(y,K0),O=Math.imul(y,D0),O=O+Math.imul(h,K0)|0,J=Math.imul(h,D0),G=G+Math.imul(t,F0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(i,F0)|0,J=J+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,M0)|0,O=O+Math.imul(d,_0)|0,J=J+Math.imul(d,M0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,j0)|0,J=J+Math.imul(n,z0)|0,G=G+Math.imul(W,v0)|0,O=O+Math.imul(W,B0)|0,O=O+Math.imul(j,v0)|0,J=J+Math.imul(j,B0)|0;var b0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(b0>>>26)|0,b0&=67108863,G=Math.imul(m,K0),O=Math.imul(m,D0),O=O+Math.imul(a,K0)|0,J=Math.imul(a,D0),G=G+Math.imul(y,F0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,F0)|0,J=J+Math.imul(h,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,M0)|0,O=O+Math.imul(i,_0)|0,J=J+Math.imul(i,M0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(d,j0)|0,J=J+Math.imul(d,z0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,v0)|0,J=J+Math.imul(n,B0)|0,G=G+Math.imul(W,T0)|0,O=O+Math.imul(W,x)|0,O=O+Math.imul(j,T0)|0,J=J+Math.imul(j,x)|0;var i0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,K0),O=Math.imul(c,D0),O=O+Math.imul(o,K0)|0,J=Math.imul(o,D0),G=G+Math.imul(m,F0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(a,F0)|0,J=J+Math.imul(a,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,M0)|0,O=O+Math.imul(h,_0)|0,J=J+Math.imul(h,M0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(i,j0)|0,J=J+Math.imul(i,z0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(d,v0)|0,J=J+Math.imul(d,B0)|0,G=G+Math.imul(p,T0)|0,O=O+Math.imul(p,x)|0,O=O+Math.imul(n,T0)|0,J=J+Math.imul(n,x)|0,G=G+Math.imul(W,e)|0,O=O+Math.imul(W,U0)|0,O=O+Math.imul(j,e)|0,J=J+Math.imul(j,U0)|0;var UU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,K0),O=Math.imul(s,D0),O=O+Math.imul(Z0,K0)|0,J=Math.imul(Z0,D0),G=G+Math.imul(c,F0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,F0)|0,J=J+Math.imul(o,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,M0)|0,O=O+Math.imul(a,_0)|0,J=J+Math.imul(a,M0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,j0)|0,J=J+Math.imul(h,z0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(i,v0)|0,J=J+Math.imul(i,B0)|0,G=G+Math.imul(r,T0)|0,O=O+Math.imul(r,x)|0,O=O+Math.imul(d,T0)|0,J=J+Math.imul(d,x)|0,G=G+Math.imul(p,e)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,e)|0,J=J+Math.imul(n,U0)|0,G=G+Math.imul(W,Y0)|0,O=O+Math.imul(W,R0)|0,O=O+Math.imul(j,Y0)|0,J=J+Math.imul(j,R0)|0;var OU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(S0,K0),O=Math.imul(S0,D0),O=O+Math.imul(V0,K0)|0,J=Math.imul(V0,D0),G=G+Math.imul(s,F0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,F0)|0,J=J+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,M0)|0,O=O+Math.imul(o,_0)|0,J=J+Math.imul(o,M0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(a,j0)|0,J=J+Math.imul(a,z0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,v0)|0,J=J+Math.imul(h,B0)|0,G=G+Math.imul(t,T0)|0,O=O+Math.imul(t,x)|0,O=O+Math.imul(i,T0)|0,J=J+Math.imul(i,x)|0,G=G+Math.imul(r,e)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(d,e)|0,J=J+Math.imul(d,U0)|0,G=G+Math.imul(p,Y0)|0,O=O+Math.imul(p,R0)|0,O=O+Math.imul(n,Y0)|0,J=J+Math.imul(n,R0)|0,G=G+Math.imul(W,q0)|0,O=O+Math.imul(W,g0)|0,O=O+Math.imul(j,q0)|0,J=J+Math.imul(j,g0)|0;var ZU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(J0,K0),O=Math.imul(J0,D0),O=O+Math.imul(L0,K0)|0,J=Math.imul(L0,D0),G=G+Math.imul(S0,F0)|0,O=O+Math.imul(S0,k0)|0,O=O+Math.imul(V0,F0)|0,J=J+Math.imul(V0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,M0)|0,O=O+Math.imul(Z0,_0)|0,J=J+Math.imul(Z0,M0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,j0)|0,J=J+Math.imul(o,z0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(a,v0)|0,J=J+Math.imul(a,B0)|0,G=G+Math.imul(y,T0)|0,O=O+Math.imul(y,x)|0,O=O+Math.imul(h,T0)|0,J=J+Math.imul(h,x)|0,G=G+Math.imul(t,e)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(i,e)|0,J=J+Math.imul(i,U0)|0,G=G+Math.imul(r,Y0)|0,O=O+Math.imul(r,R0)|0,O=O+Math.imul(d,Y0)|0,J=J+Math.imul(d,R0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,g0)|0,O=O+Math.imul(n,q0)|0,J=J+Math.imul(n,g0)|0,G=G+Math.imul(W,P0)|0,O=O+Math.imul(W,H0)|0,O=O+Math.imul(j,P0)|0,J=J+Math.imul(j,H0)|0;var AU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(J0,F0),O=Math.imul(J0,k0),O=O+Math.imul(L0,F0)|0,J=Math.imul(L0,k0),G=G+Math.imul(S0,_0)|0,O=O+Math.imul(S0,M0)|0,O=O+Math.imul(V0,_0)|0,J=J+Math.imul(V0,M0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,j0)|0,J=J+Math.imul(Z0,z0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,v0)|0,J=J+Math.imul(o,B0)|0,G=G+Math.imul(m,T0)|0,O=O+Math.imul(m,x)|0,O=O+Math.imul(a,T0)|0,J=J+Math.imul(a,x)|0,G=G+Math.imul(y,e)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,e)|0,J=J+Math.imul(h,U0)|0,G=G+Math.imul(t,Y0)|0,O=O+Math.imul(t,R0)|0,O=O+Math.imul(i,Y0)|0,J=J+Math.imul(i,R0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,g0)|0,O=O+Math.imul(d,q0)|0,J=J+Math.imul(d,g0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,H0)|0,O=O+Math.imul(n,P0)|0,J=J+Math.imul(n,H0)|0;var $U=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(J0,_0),O=Math.imul(J0,M0),O=O+Math.imul(L0,_0)|0,J=Math.imul(L0,M0),G=G+Math.imul(S0,j0)|0,O=O+Math.imul(S0,z0)|0,O=O+Math.imul(V0,j0)|0,J=J+Math.imul(V0,z0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,v0)|0,J=J+Math.imul(Z0,B0)|0,G=G+Math.imul(c,T0)|0,O=O+Math.imul(c,x)|0,O=O+Math.imul(o,T0)|0,J=J+Math.imul(o,x)|0,G=G+Math.imul(m,e)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(a,e)|0,J=J+Math.imul(a,U0)|0,G=G+Math.imul(y,Y0)|0,O=O+Math.imul(y,R0)|0,O=O+Math.imul(h,Y0)|0,J=J+Math.imul(h,R0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,g0)|0,O=O+Math.imul(i,q0)|0,J=J+Math.imul(i,g0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,H0)|0,O=O+Math.imul(d,P0)|0,J=J+Math.imul(d,H0)|0;var IU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,G=Math.imul(J0,j0),O=Math.imul(J0,z0),O=O+Math.imul(L0,j0)|0,J=Math.imul(L0,z0),G=G+Math.imul(S0,v0)|0,O=O+Math.imul(S0,B0)|0,O=O+Math.imul(V0,v0)|0,J=J+Math.imul(V0,B0)|0,G=G+Math.imul(s,T0)|0,O=O+Math.imul(s,x)|0,O=O+Math.imul(Z0,T0)|0,J=J+Math.imul(Z0,x)|0,G=G+Math.imul(c,e)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,e)|0,J=J+Math.imul(o,U0)|0,G=G+Math.imul(m,Y0)|0,O=O+Math.imul(m,R0)|0,O=O+Math.imul(a,Y0)|0,J=J+Math.imul(a,R0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,g0)|0,O=O+Math.imul(h,q0)|0,J=J+Math.imul(h,g0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,H0)|0,O=O+Math.imul(i,P0)|0,J=J+Math.imul(i,H0)|0;var CU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(CU>>>26)|0,CU&=67108863,G=Math.imul(J0,v0),O=Math.imul(J0,B0),O=O+Math.imul(L0,v0)|0,J=Math.imul(L0,B0),G=G+Math.imul(S0,T0)|0,O=O+Math.imul(S0,x)|0,O=O+Math.imul(V0,T0)|0,J=J+Math.imul(V0,x)|0,G=G+Math.imul(s,e)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,e)|0,J=J+Math.imul(Z0,U0)|0,G=G+Math.imul(c,Y0)|0,O=O+Math.imul(c,R0)|0,O=O+Math.imul(o,Y0)|0,J=J+Math.imul(o,R0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,g0)|0,O=O+Math.imul(a,q0)|0,J=J+Math.imul(a,g0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,H0)|0,O=O+Math.imul(h,P0)|0,J=J+Math.imul(h,H0)|0;var QU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(J0,T0),O=Math.imul(J0,x),O=O+Math.imul(L0,T0)|0,J=Math.imul(L0,x),G=G+Math.imul(S0,e)|0,O=O+Math.imul(S0,U0)|0,O=O+Math.imul(V0,e)|0,J=J+Math.imul(V0,U0)|0,G=G+Math.imul(s,Y0)|0,O=O+Math.imul(s,R0)|0,O=O+Math.imul(Z0,Y0)|0,J=J+Math.imul(Z0,R0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,g0)|0,O=O+Math.imul(o,q0)|0,J=J+Math.imul(o,g0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,H0)|0,O=O+Math.imul(a,P0)|0,J=J+Math.imul(a,H0)|0;var XU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(J0,e),O=Math.imul(J0,U0),O=O+Math.imul(L0,e)|0,J=Math.imul(L0,U0),G=G+Math.imul(S0,Y0)|0,O=O+Math.imul(S0,R0)|0,O=O+Math.imul(V0,Y0)|0,J=J+Math.imul(V0,R0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,g0)|0,O=O+Math.imul(Z0,q0)|0,J=J+Math.imul(Z0,g0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,H0)|0,O=O+Math.imul(o,P0)|0,J=J+Math.imul(o,H0)|0;var GU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(J0,Y0),O=Math.imul(J0,R0),O=O+Math.imul(L0,Y0)|0,J=Math.imul(L0,R0),G=G+Math.imul(S0,q0)|0,O=O+Math.imul(S0,g0)|0,O=O+Math.imul(V0,q0)|0,J=J+Math.imul(V0,g0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,H0)|0,O=O+Math.imul(Z0,P0)|0,J=J+Math.imul(Z0,H0)|0;var EU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(J0,q0),O=Math.imul(J0,g0),O=O+Math.imul(L0,q0)|0,J=Math.imul(L0,g0),G=G+Math.imul(S0,P0)|0,O=O+Math.imul(S0,H0)|0,O=O+Math.imul(V0,P0)|0,J=J+Math.imul(V0,H0)|0;var JU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(J0,P0),O=Math.imul(J0,H0),O=O+Math.imul(L0,P0)|0,J=Math.imul(L0,H0);var YU=(V+G|0)+((O&8191)<<13)|0;if(V=(J+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,Y[0]=e0,Y[1]=c0,Y[2]=y0,Y[3]=o0,Y[4]=b0,Y[5]=i0,Y[6]=UU,Y[7]=OU,Y[8]=ZU,Y[9]=AU,Y[10]=$U,Y[11]=IU,Y[12]=CU,Y[13]=QU,Y[14]=XU,Y[15]=GU,Y[16]=EU,Y[17]=JU,Y[18]=YU,V!==0)Y[19]=V,X.length++;return X};if(!Math.imul)k=_;function B(U,A,X){X.negative=A.negative^U.negative,X.length=U.length+A.length;var Z=0,C=0;for(var Y=0;Y<X.length-1;Y++){var V=C;C=0;var G=Z&67108863,O=Math.min(Y,A.length-1);for(var J=Math.max(0,Y-U.length+1);J<=O;J++){var z=Y-J,W=U.words[z]|0,j=A.words[J]|0,N=W*j,p=N&67108863;V=V+(N/67108864|0)|0,p=p+G|0,G=p&67108863,V=V+(p>>>26)|0,C+=V>>>26,V&=67108863}X.words[Y]=G,Z=V,V=C}if(Z!==0)X.words[Y]=Z;else X.length--;return X.strip()}function v(U,A,X){var Z=new g;return Z.mulp(U,A,X)}Q.prototype.mulTo=function(U,A){var X,Z=this.length+U.length;if(this.length===10&&U.length===10)X=k(this,U,A);else if(Z<63)X=_(this,U,A);else if(Z<1024)X=B(this,U,A);else X=v(this,U,A);return X};function g(U,A){this.x=U,this.y=A}g.prototype.makeRBT=function(U){var A=Array(U),X=Q.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)A[Z]=this.revBin(Z,X,U);return A},g.prototype.revBin=function(U,A,X){if(U===0||U===X-1)return U;var Z=0;for(var C=0;C<A;C++)Z|=(U&1)<<A-C-1,U>>=1;return Z},g.prototype.permute=function(U,A,X,Z,C,Y){for(var V=0;V<Y;V++)Z[V]=A[U[V]],C[V]=X[U[V]]},g.prototype.transform=function(U,A,X,Z,C,Y){this.permute(Y,U,A,X,Z,C);for(var V=1;V<C;V<<=1){var G=V<<1,O=Math.cos(2*Math.PI/G),J=Math.sin(2*Math.PI/G);for(var z=0;z<C;z+=G){var W=O,j=J;for(var N=0;N<V;N++){var p=X[z+N],n=Z[z+N],E0=X[z+N+V],r=Z[z+N+V],d=W*E0-j*r;if(r=W*r+j*E0,E0=d,X[z+N]=p+E0,Z[z+N]=n+r,X[z+N+V]=p-E0,Z[z+N+V]=n-r,N!==G)d=O*W-J*j,j=O*j+J*W,W=d}}}},g.prototype.guessLen13b=function(U,A){var X=Math.max(A,U)|1,Z=X&1,C=0;for(X=X/2|0;X;X=X>>>1)C++;return 1<<C+1+Z},g.prototype.conjugate=function(U,A,X){if(X<=1)return;for(var Z=0;Z<X/2;Z++){var C=U[Z];U[Z]=U[X-Z-1],U[X-Z-1]=C,C=A[Z],A[Z]=-A[X-Z-1],A[X-Z-1]=-C}},g.prototype.normalize13b=function(U,A){var X=0;for(var Z=0;Z<A/2;Z++){var C=Math.round(U[2*Z+1]/A)*8192+Math.round(U[2*Z]/A)+X;if(U[Z]=C&67108863,C<67108864)X=0;else X=C/67108864|0}return U},g.prototype.convert13b=function(U,A,X,Z){var C=0;for(var Y=0;Y<A;Y++)C=C+(U[Y]|0),X[2*Y]=C&8191,C=C>>>13,X[2*Y+1]=C&8191,C=C>>>13;for(Y=2*A;Y<Z;++Y)X[Y]=0;S(C===0),S((C&-8192)===0)},g.prototype.stub=function(U){var A=Array(U);for(var X=0;X<U;X++)A[X]=0;return A},g.prototype.mulp=function(U,A,X){var Z=2*this.guessLen13b(U.length,A.length),C=this.makeRBT(Z),Y=this.stub(Z),V=Array(Z),G=Array(Z),O=Array(Z),J=Array(Z),z=Array(Z),W=Array(Z),j=X.words;j.length=Z,this.convert13b(U.words,U.length,V,Z),this.convert13b(A.words,A.length,J,Z),this.transform(V,Y,G,O,Z,C),this.transform(J,Y,z,W,Z,C);for(var N=0;N<Z;N++){var p=G[N]*z[N]-O[N]*W[N];O[N]=G[N]*W[N]+O[N]*z[N],G[N]=p}return this.conjugate(G,O,Z),this.transform(G,O,j,Y,Z,C),this.conjugate(j,Y,Z),this.normalize13b(j,Z),X.negative=U.negative^A.negative,X.length=U.length+A.length,X.strip()},Q.prototype.mul=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),this.mulTo(U,A)},Q.prototype.mulf=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),v(this,U,A)},Q.prototype.imul=function(U){return this.clone().mulTo(U,this)},Q.prototype.imuln=function(U){S(typeof U==="number"),S(U<67108864);var A=0;for(var X=0;X<this.length;X++){var Z=(this.words[X]|0)*U,C=(Z&67108863)+(A&67108863);A>>=26,A+=Z/67108864|0,A+=C>>>26,this.words[X]=C&67108863}if(A!==0)this.words[X]=A,this.length++;return this.length=U===0?1:this.length,this},Q.prototype.muln=function(U){return this.clone().imuln(U)},Q.prototype.sqr=function(){return this.mul(this)},Q.prototype.isqr=function(){return this.imul(this.clone())},Q.prototype.pow=function(U){var A=P(U);if(A.length===0)return new Q(1);var X=this;for(var Z=0;Z<A.length;Z++,X=X.sqr())if(A[Z]!==0)break;if(++Z<A.length)for(var C=X.sqr();Z<A.length;Z++,C=C.sqr()){if(A[Z]===0)continue;X=X.mul(C)}return X},Q.prototype.iushln=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=67108863>>>26-A<<26-A,C;if(A!==0){var Y=0;for(C=0;C<this.length;C++){var V=this.words[C]&Z,G=(this.words[C]|0)-V<<A;this.words[C]=G|Y,Y=V>>>26-A}if(Y)this.words[C]=Y,this.length++}if(X!==0){for(C=this.length-1;C>=0;C--)this.words[C+X]=this.words[C];for(C=0;C<X;C++)this.words[C]=0;this.length+=X}return this.strip()},Q.prototype.ishln=function(U){return S(this.negative===0),this.iushln(U)},Q.prototype.iushrn=function(U,A,X){S(typeof U==="number"&&U>=0);var Z;if(A)Z=(A-A%26)/26;else Z=0;var C=U%26,Y=Math.min((U-C)/26,this.length),V=67108863^67108863>>>C<<C,G=X;if(Z-=Y,Z=Math.max(0,Z),G){for(var O=0;O<Y;O++)G.words[O]=this.words[O];G.length=Y}if(Y===0);else if(this.length>Y){this.length-=Y;for(O=0;O<this.length;O++)this.words[O]=this.words[O+Y]}else this.words[0]=0,this.length=1;var J=0;for(O=this.length-1;O>=0&&(J!==0||O>=Z);O--){var z=this.words[O]|0;this.words[O]=J<<26-C|z>>>C,J=z&V}if(G&&J!==0)G.words[G.length++]=J;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Q.prototype.ishrn=function(U,A,X){return S(this.negative===0),this.iushrn(U,A,X)},Q.prototype.shln=function(U){return this.clone().ishln(U)},Q.prototype.ushln=function(U){return this.clone().iushln(U)},Q.prototype.shrn=function(U){return this.clone().ishrn(U)},Q.prototype.ushrn=function(U){return this.clone().iushrn(U)},Q.prototype.testn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return!1;var C=this.words[X];return!!(C&Z)},Q.prototype.imaskn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26;if(S(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(A!==0)X++;if(this.length=Math.min(X,this.length),A!==0){var Z=67108863^67108863>>>A<<A;this.words[this.length-1]&=Z}return this.strip()},Q.prototype.maskn=function(U){return this.clone().imaskn(U)},Q.prototype.iaddn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},Q.prototype._iaddn=function(U){this.words[0]+=U;for(var A=0;A<this.length&&this.words[A]>=67108864;A++)if(this.words[A]-=67108864,A===this.length-1)this.words[A+1]=1;else this.words[A+1]++;return this.length=Math.max(this.length,A+1),this},Q.prototype.isubn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var A=0;A<this.length&&this.words[A]<0;A++)this.words[A]+=67108864,this.words[A+1]-=1;return this.strip()},Q.prototype.addn=function(U){return this.clone().iaddn(U)},Q.prototype.subn=function(U){return this.clone().isubn(U)},Q.prototype.iabs=function(){return this.negative=0,this},Q.prototype.abs=function(){return this.clone().iabs()},Q.prototype._ishlnsubmul=function(U,A,X){var Z=U.length+X,C;this._expand(Z);var Y,V=0;for(C=0;C<U.length;C++){Y=(this.words[C+X]|0)+V;var G=(U.words[C]|0)*A;Y-=G&67108863,V=(Y>>26)-(G/67108864|0),this.words[C+X]=Y&67108863}for(;C<this.length-X;C++)Y=(this.words[C+X]|0)+V,V=Y>>26,this.words[C+X]=Y&67108863;if(V===0)return this.strip();S(V===-1),V=0;for(C=0;C<this.length;C++)Y=-(this.words[C]|0)+V,V=Y>>26,this.words[C]=Y&67108863;return this.negative=1,this.strip()},Q.prototype._wordDiv=function(U,A){var X=this.length-U.length,Z=this.clone(),C=U,Y=C.words[C.length-1]|0,V=this._countBits(Y);if(X=26-V,X!==0)C=C.ushln(X),Z.iushln(X),Y=C.words[C.length-1]|0;var G=Z.length-C.length,O;if(A!=="mod"){O=new Q(null),O.length=G+1,O.words=Array(O.length);for(var J=0;J<O.length;J++)O.words[J]=0}var z=Z.clone()._ishlnsubmul(C,1,G);if(z.negative===0){if(Z=z,O)O.words[G]=1}for(var W=G-1;W>=0;W--){var j=(Z.words[C.length+W]|0)*67108864+(Z.words[C.length+W-1]|0);j=Math.min(j/Y|0,67108863),Z._ishlnsubmul(C,j,W);while(Z.negative!==0)if(j--,Z.negative=0,Z._ishlnsubmul(C,1,W),!Z.isZero())Z.negative^=1;if(O)O.words[W]=j}if(O)O.strip();if(Z.strip(),A!=="div"&&X!==0)Z.iushrn(X);return{div:O||null,mod:Z}},Q.prototype.divmod=function(U,A,X){if(S(!U.isZero()),this.isZero())return{div:new Q(0),mod:new Q(0)};var Z,C,Y;if(this.negative!==0&&U.negative===0){if(Y=this.neg().divmod(U,A),A!=="mod")Z=Y.div.neg();if(A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.iadd(U)}return{div:Z,mod:C}}if(this.negative===0&&U.negative!==0){if(Y=this.divmod(U.neg(),A),A!=="mod")Z=Y.div.neg();return{div:Z,mod:Y.mod}}if((this.negative&U.negative)!==0){if(Y=this.neg().divmod(U.neg(),A),A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.isub(U)}return{div:Y.div,mod:C}}if(U.length>this.length||this.cmp(U)<0)return{div:new Q(0),mod:this};if(U.length===1){if(A==="div")return{div:this.divn(U.words[0]),mod:null};if(A==="mod")return{div:null,mod:new Q(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new Q(this.modn(U.words[0]))}}return this._wordDiv(U,A)},Q.prototype.div=function(U){return this.divmod(U,"div",!1).div},Q.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},Q.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},Q.prototype.divRound=function(U){var A=this.divmod(U);if(A.mod.isZero())return A.div;var X=A.div.negative!==0?A.mod.isub(U):A.mod,Z=U.ushrn(1),C=U.andln(1),Y=X.cmp(Z);if(Y<0||C===1&&Y===0)return A.div;return A.div.negative!==0?A.div.isubn(1):A.div.iaddn(1)},Q.prototype.modn=function(U){S(U<=67108863);var A=67108864%U,X=0;for(var Z=this.length-1;Z>=0;Z--)X=(A*X+(this.words[Z]|0))%U;return X},Q.prototype.idivn=function(U){S(U<=67108863);var A=0;for(var X=this.length-1;X>=0;X--){var Z=(this.words[X]|0)+A*67108864;this.words[X]=Z/U|0,A=Z%U}return this.strip()},Q.prototype.divn=function(U){return this.clone().idivn(U)},Q.prototype.egcd=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=new Q(0),V=new Q(1),G=0;while(A.isEven()&&X.isEven())A.iushrn(1),X.iushrn(1),++G;var O=X.clone(),J=A.clone();while(!A.isZero()){for(var z=0,W=1;(A.words[0]&W)===0&&z<26;++z,W<<=1);if(z>0){A.iushrn(z);while(z-- >0){if(Z.isOdd()||C.isOdd())Z.iadd(O),C.isub(J);Z.iushrn(1),C.iushrn(1)}}for(var j=0,N=1;(X.words[0]&N)===0&&j<26;++j,N<<=1);if(j>0){X.iushrn(j);while(j-- >0){if(Y.isOdd()||V.isOdd())Y.iadd(O),V.isub(J);Y.iushrn(1),V.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(Y),C.isub(V);else X.isub(A),Y.isub(Z),V.isub(C)}return{a:Y,b:V,gcd:X.iushln(G)}},Q.prototype._invmp=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=X.clone();while(A.cmpn(1)>0&&X.cmpn(1)>0){for(var V=0,G=1;(A.words[0]&G)===0&&V<26;++V,G<<=1);if(V>0){A.iushrn(V);while(V-- >0){if(Z.isOdd())Z.iadd(Y);Z.iushrn(1)}}for(var O=0,J=1;(X.words[0]&J)===0&&O<26;++O,J<<=1);if(O>0){X.iushrn(O);while(O-- >0){if(C.isOdd())C.iadd(Y);C.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(C);else X.isub(A),C.isub(Z)}var z;if(A.cmpn(1)===0)z=Z;else z=C;if(z.cmpn(0)<0)z.iadd(U);return z},Q.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var A=this.clone(),X=U.clone();A.negative=0,X.negative=0;for(var Z=0;A.isEven()&&X.isEven();Z++)A.iushrn(1),X.iushrn(1);do{while(A.isEven())A.iushrn(1);while(X.isEven())X.iushrn(1);var C=A.cmp(X);if(C<0){var Y=A;A=X,X=Y}else if(C===0||X.cmpn(1)===0)break;A.isub(X)}while(!0);return X.iushln(Z)},Q.prototype.invm=function(U){return this.egcd(U).a.umod(U)},Q.prototype.isEven=function(){return(this.words[0]&1)===0},Q.prototype.isOdd=function(){return(this.words[0]&1)===1},Q.prototype.andln=function(U){return this.words[0]&U},Q.prototype.bincn=function(U){S(typeof U==="number");var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return this._expand(X+1),this.words[X]|=Z,this;var C=Z;for(var Y=X;C!==0&&Y<this.length;Y++){var V=this.words[Y]|0;V+=C,C=V>>>26,V&=67108863,this.words[Y]=V}if(C!==0)this.words[Y]=C,this.length++;return this},Q.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Q.prototype.cmpn=function(U){var A=U<0;if(this.negative!==0&&!A)return-1;if(this.negative===0&&A)return 1;this.strip();var X;if(this.length>1)X=1;else{if(A)U=-U;S(U<=67108863,"Number is too big");var Z=this.words[0]|0;X=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-X|0;return X},Q.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var A=this.ucmp(U);if(this.negative!==0)return-A|0;return A},Q.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var A=0;for(var X=this.length-1;X>=0;X--){var Z=this.words[X]|0,C=U.words[X]|0;if(Z===C)continue;if(Z<C)A=-1;else if(Z>C)A=1;break}return A},Q.prototype.gtn=function(U){return this.cmpn(U)===1},Q.prototype.gt=function(U){return this.cmp(U)===1},Q.prototype.gten=function(U){return this.cmpn(U)>=0},Q.prototype.gte=function(U){return this.cmp(U)>=0},Q.prototype.ltn=function(U){return this.cmpn(U)===-1},Q.prototype.lt=function(U){return this.cmp(U)===-1},Q.prototype.lten=function(U){return this.cmpn(U)<=0},Q.prototype.lte=function(U){return this.cmp(U)<=0},Q.prototype.eqn=function(U){return this.cmpn(U)===0},Q.prototype.eq=function(U){return this.cmp(U)===0},Q.red=function(U){return new u(U)},Q.prototype.toRed=function(U){return S(!this.red,"Already a number in reduction context"),S(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},Q.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Q.prototype._forceRed=function(U){return this.red=U,this},Q.prototype.forceRed=function(U){return S(!this.red,"Already a number in reduction context"),this._forceRed(U)},Q.prototype.redAdd=function(U){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},Q.prototype.redIAdd=function(U){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},Q.prototype.redSub=function(U){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},Q.prototype.redISub=function(U){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},Q.prototype.redShl=function(U){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},Q.prototype.redMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},Q.prototype.redIMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},Q.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Q.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Q.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Q.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Q.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Q.prototype.redPow=function(U){return S(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,A){this.name=U,this.p=new Q(A,16),this.n=this.p.bitLength(),this.k=new Q(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new Q(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var A=U,X;do this.split(A,this.tmp),A=this.imulK(A),A=A.iadd(this.tmp),X=A.bitLength();while(X>this.n);var Z=X<this.n?-1:A.ucmp(this.p);if(Z===0)A.words[0]=0,A.length=1;else if(Z>0)A.isub(this.p);else if(A.strip!==void 0)A.strip();else A._strip();return A},w.prototype.split=function(U,A){U.iushrn(this.n,0,A)},w.prototype.imulK=function(U){return U.imul(this.k)};function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(b,w),b.prototype.split=function(U,A){var X=4194303,Z=Math.min(U.length,9);for(var C=0;C<Z;C++)A.words[C]=U.words[C];if(A.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var Y=U.words[9];A.words[A.length++]=Y&X;for(C=10;C<U.length;C++){var V=U.words[C]|0;U.words[C-10]=(V&X)<<4|Y>>>22,Y=V}if(Y>>>=22,U.words[C-10]=Y,Y===0&&U.length>10)U.length-=10;else U.length-=9},b.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var A=0;for(var X=0;X<U.length;X++){var Z=U.words[X]|0;A+=Z*977,U.words[X]=A&67108863,A=Z*64+(A/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function I0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(I0,w);function X0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K(X0,w);function C0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(C0,w),C0.prototype.imulK=function(U){var A=0;for(var X=0;X<U.length;X++){var Z=(U.words[X]|0)*19+A,C=Z&67108863;Z>>>=26,U.words[X]=C,A=Z}if(A!==0)U.words[U.length++]=A;return U},Q._prime=function(U){if(f[U])return f[U];var A;if(U==="k256")A=new b;else if(U==="p224")A=new I0;else if(U==="p192")A=new X0;else if(U==="p25519")A=new C0;else throw Error("Unknown prime "+U);return f[U]=A,A};function u(U){if(typeof U==="string"){var A=Q._prime(U);this.m=A.p,this.prime=A}else S(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){S(U.negative===0,"red works only with positives"),S(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,A){S((U.negative|A.negative)===0,"red works only with positives"),S(U.red&&U.red===A.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,A){this._verify2(U,A);var X=U.add(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},u.prototype.iadd=function(U,A){this._verify2(U,A);var X=U.iadd(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X},u.prototype.sub=function(U,A){this._verify2(U,A);var X=U.sub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},u.prototype.isub=function(U,A){this._verify2(U,A);var X=U.isub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X},u.prototype.shl=function(U,A){return this._verify1(U),this.imod(U.ushln(A))},u.prototype.imul=function(U,A){return this._verify2(U,A),this.imod(U.imul(A))},u.prototype.mul=function(U,A){return this._verify2(U,A),this.imod(U.mul(A))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var A=this.m.andln(3);if(S(A%2===1),A===3){var X=this.m.add(new Q(1)).iushrn(2);return this.pow(U,X)}var Z=this.m.subn(1),C=0;while(!Z.isZero()&&Z.andln(1)===0)C++,Z.iushrn(1);S(!Z.isZero());var Y=new Q(1).toRed(this),V=Y.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new Q(2*O*O).toRed(this);while(this.pow(O,G).cmp(V)!==0)O.redIAdd(V);var J=this.pow(O,Z),z=this.pow(U,Z.addn(1).iushrn(1)),W=this.pow(U,Z),j=C;while(W.cmp(Y)!==0){var N=W;for(var p=0;N.cmp(Y)!==0;p++)N=N.redSqr();S(p<j);var n=this.pow(J,new Q(1).iushln(j-p-1));z=z.redMul(n),J=n.redSqr(),W=W.redMul(J),j=p}return z},u.prototype.invm=function(U){var A=U._invmp(this.m);if(A.negative!==0)return A.negative=0,this.imod(A).redNeg();else return this.imod(A)},u.prototype.pow=function(U,A){if(A.isZero())return new Q(1).toRed(this);if(A.cmpn(1)===0)return U.clone();var X=4,Z=Array(1<<X);Z[0]=new Q(1).toRed(this),Z[1]=U;for(var C=2;C<Z.length;C++)Z[C]=this.mul(Z[C-1],U);var Y=Z[0],V=0,G=0,O=A.bitLength()%26;if(O===0)O=26;for(C=A.length-1;C>=0;C--){var J=A.words[C];for(var z=O-1;z>=0;z--){var W=J>>z&1;if(Y!==Z[0])Y=this.sqr(Y);if(W===0&&V===0){G=0;continue}if(V<<=1,V|=W,G++,G!==X&&(C!==0||z!==0))continue;Y=this.mul(Y,Z[V]),G=0,V=0}O=26}return Y},u.prototype.convertTo=function(U){var A=U.umod(this.m);return A===U?A.clone():A},u.prototype.convertFrom=function(U){var A=U.clone();return A.red=null,A},Q.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Q(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)}K(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var A=this.imod(U.mul(this.rinv));return A.red=null,A},O0.prototype.imul=function(U,A){if(U.isZero()||A.isZero())return U.words[0]=0,U.length=1,U;var X=U.imul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.mul=function(U,A){if(U.isZero()||A.isZero())return new Q(0)._forceRed(this);var X=U.mul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.invm=function(U){var A=this.imod(U._invmp(this.m).mul(this.r2));return A._forceRed(this)}})(typeof I>"u"||I,$)}),rG=Q0(($)=>{var I=dO(),E=gU(),L=$;L.define=function(K,Q){return new S(K,Q)};function S(K,Q){this.name=K,this.body=Q,this.decoders={},this.encoders={}}S.prototype._createNamed=function(K){var Q;try{Q=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
|
|
13
13
|
this._initNamed(entity);
|
|
14
|
-
})`)}catch(M){J=function(z){this._initNamed(z)}}return I(J,F),J.prototype._initNamed=function(M){F.call(this,M)},new J(this)},T.prototype._getDecoder=function(F){if(F=F||"der",!this.decoders.hasOwnProperty(F))this.decoders[F]=this._createNamed(G.decoders[F]);return this.decoders[F]},T.prototype.decode=function(F,J,M){return this._getDecoder(J).decode(F,M)},T.prototype._getEncoder=function(F){if(F=F||"der",!this.encoders.hasOwnProperty(F))this.encoders[F]=this._createNamed(G.encoders[F]);return this.encoders[F]},T.prototype.encode=function(F,J,M){return this._getEncoder(J).encode(F,M)}}),xG=$0((Q)=>{var G=BU();function I(T){this._reporterState={obj:null,path:[],options:T||{},errors:[]}}Q.Reporter=I,I.prototype.isError=function(T){return T instanceof L},I.prototype.save=function(){var T=this._reporterState;return{obj:T.obj,pathLen:T.path.length}},I.prototype.restore=function(T){var F=this._reporterState;F.obj=T.obj,F.path=F.path.slice(0,T.pathLen)},I.prototype.enterKey=function(T){return this._reporterState.path.push(T)},I.prototype.exitKey=function(T){var F=this._reporterState;F.path=F.path.slice(0,T-1)},I.prototype.leaveKey=function(T,F,J){var M=this._reporterState;if(this.exitKey(T),M.obj!==null)M.obj[F]=J},I.prototype.path=function(){return this._reporterState.path.join("/")},I.prototype.enterObject=function(){var T=this._reporterState,F=T.obj;return T.obj={},F},I.prototype.leaveObject=function(T){var F=this._reporterState,J=F.obj;return F.obj=T,J},I.prototype.error=function(T){var F,J=this._reporterState,M=T instanceof L;if(M)F=T;else F=new L(J.path.map(function(z){return"["+JSON.stringify(z)+"]"}).join(""),T.message||T,T.stack);if(!J.options.partial)throw F;if(!M)J.errors.push(F);return F},I.prototype.wrapResult=function(T){var F=this._reporterState;if(!F.options.partial)return T;return{result:this.isError(T)?null:T,errors:F.errors}};function L(T,F){this.path=T,this.rethrow(F)}G(L,Error),L.prototype.rethrow=function(T){if(this.message=T+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,L);if(!this.stack)try{throw Error(this.message)}catch(F){this.stack=F.stack}return this}}),fQ=$0((Q)=>{var G=BU(),I=zO().Reporter,L=(LU(),h0(CU)).Buffer;function T(J,M){if(I.call(this,M),!L.isBuffer(J)){this.error("Input not Buffer");return}this.base=J,this.offset=0,this.length=J.length}G(T,I),Q.DecoderBuffer=T,T.prototype.save=function(){return{offset:this.offset,reporter:I.prototype.save.call(this)}},T.prototype.restore=function(J){var M=new T(this.base);return M.offset=J.offset,M.length=this.offset,this.offset=J.offset,I.prototype.restore.call(this,J.reporter),M},T.prototype.isEmpty=function(){return this.offset===this.length},T.prototype.readUInt8=function(J){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(J||"DecoderBuffer overrun")},T.prototype.skip=function(J,M){if(!(this.offset+J<=this.length))return this.error(M||"DecoderBuffer overrun");var z=new T(this.base);return z._reporterState=this._reporterState,z.offset=this.offset,z.length=this.offset+J,this.offset+=J,z},T.prototype.raw=function(J){return this.base.slice(J?J.offset:this.offset,this.length)};function F(J,M){if(Array.isArray(J))this.length=0,this.value=J.map(function(z){if(!(z instanceof F))z=new F(z,M);return this.length+=z.length,z},this);else if(typeof J==="number"){if(!(0<=J&&J<=255))return M.error("non-byte EncoderBuffer value");this.value=J,this.length=1}else if(typeof J==="string")this.value=J,this.length=L.byteLength(J);else if(L.isBuffer(J))this.value=J,this.length=J.length;else return M.error("Unsupported type: "+typeof J)}Q.EncoderBuffer=F,F.prototype.join=function(J,M){if(!J)J=new L(this.length);if(!M)M=0;if(this.length===0)return J;if(Array.isArray(this.value))this.value.forEach(function(z){z.join(J,M),M+=z.length});else{if(typeof this.value==="number")J[M]=this.value;else if(typeof this.value==="string")J.write(this.value,M);else if(L.isBuffer(this.value))this.value.copy(J,M);M+=this.length}return J}}),NG=$0((Q,G)=>{var I=zO().Reporter,L=zO().EncoderBuffer,T=zO().DecoderBuffer,F=UO(),J=["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"],M=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(J),z=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function W(C,R){var q={};if(this._baseState=q,q.enc=C,q.parent=R||null,q.children=null,q.tag=null,q.args=null,q.reverseArgs=null,q.choice=null,q.optional=!1,q.any=!1,q.obj=!1,q.use=null,q.useDecoder=null,q.key=null,q.default=null,q.explicit=null,q.implicit=null,q.contains=null,!q.parent)q.children=[],this._wrap()}G.exports=W;var H=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];W.prototype.clone=function(){var C=this._baseState,R={};H.forEach(function(P){R[P]=C[P]});var q=new this.constructor(R.parent);return q._baseState=R,q},W.prototype._wrap=function(){var C=this._baseState;M.forEach(function(R){this[R]=function(){var q=new this.constructor(this);return C.children.push(q),q[R].apply(q,arguments)}},this)},W.prototype._init=function(C){var R=this._baseState;F(R.parent===null),C.call(this),R.children=R.children.filter(function(q){return q._baseState.parent===this},this),F.equal(R.children.length,1,"Root node can have only one child")},W.prototype._useArgs=function(C){var R=this._baseState,q=C.filter(function(P){return P instanceof this.constructor},this);if(C=C.filter(function(P){return!(P instanceof this.constructor)},this),q.length!==0)F(R.children===null),R.children=q,q.forEach(function(P){P._baseState.parent=this},this);if(C.length!==0)F(R.args===null),R.args=C,R.reverseArgs=C.map(function(P){if(typeof P!=="object"||P.constructor!==Object)return P;var j={};return Object.keys(P).forEach(function(k){if(k==(k|0))k|=0;var B=P[k];j[B]=k}),j})},z.forEach(function(C){W.prototype[C]=function(){var R=this._baseState;throw Error(C+" not implemented for encoding: "+R.enc)}}),J.forEach(function(C){W.prototype[C]=function(){var R=this._baseState,q=Array.prototype.slice.call(arguments);return F(R.tag===null),R.tag=C,this._useArgs(q),this}}),W.prototype.use=function(C){F(C);var R=this._baseState;return F(R.use===null),R.use=C,this},W.prototype.optional=function(){var C=this._baseState;return C.optional=!0,this},W.prototype.def=function(C){var R=this._baseState;return F(R.default===null),R.default=C,R.optional=!0,this},W.prototype.explicit=function(C){var R=this._baseState;return F(R.explicit===null&&R.implicit===null),R.explicit=C,this},W.prototype.implicit=function(C){var R=this._baseState;return F(R.explicit===null&&R.implicit===null),R.implicit=C,this},W.prototype.obj=function(){var C=this._baseState,R=Array.prototype.slice.call(arguments);if(C.obj=!0,R.length!==0)this._useArgs(R);return this},W.prototype.key=function(C){var R=this._baseState;return F(R.key===null),R.key=C,this},W.prototype.any=function(){var C=this._baseState;return C.any=!0,this},W.prototype.choice=function(C){var R=this._baseState;return F(R.choice===null),R.choice=C,this._useArgs(Object.keys(C).map(function(q){return C[q]})),this},W.prototype.contains=function(C){var R=this._baseState;return F(R.use===null),R.contains=C,this},W.prototype._decode=function(C,R){var q=this._baseState;if(q.parent===null)return C.wrapResult(q.children[0]._decode(C,R));var P=q.default,j=!0,k=null;if(q.key!==null)k=C.enterKey(q.key);if(q.optional){var B=null;if(q.explicit!==null)B=q.explicit;else if(q.implicit!==null)B=q.implicit;else if(q.tag!==null)B=q.tag;if(B===null&&!q.any){var v=C.save();try{if(q.choice===null)this._decodeGeneric(q.tag,C,R);else this._decodeChoice(C,R);j=!0}catch(G0){j=!1}C.restore(v)}else if(j=this._peekTag(C,B,q.any),C.isError(j))return j}var g;if(q.obj&&j)g=C.enterObject();if(j){if(q.explicit!==null){var f=this._decodeTag(C,q.explicit);if(C.isError(f))return f;C=f}var w=C.offset;if(q.use===null&&q.choice===null){if(q.any)var v=C.save();var d=this._decodeTag(C,q.implicit!==null?q.implicit:q.tag,q.any);if(C.isError(d))return d;if(q.any)P=C.raw(v);else C=d}if(R&&R.track&&q.tag!==null)R.track(C.path(),w,C.length,"tagged");if(R&&R.track&&q.tag!==null)R.track(C.path(),C.offset,C.length,"content");if(q.any)P=P;else if(q.choice===null)P=this._decodeGeneric(q.tag,C,R);else P=this._decodeChoice(C,R);if(C.isError(P))return P;if(!q.any&&q.choice===null&&q.children!==null)q.children.forEach(function(G0){G0._decode(C,R)});if(q.contains&&(q.tag==="octstr"||q.tag==="bitstr")){var Y0=new T(P);P=this._getUse(q.contains,C._reporterState.obj)._decode(Y0,R)}}if(q.obj&&j)P=C.leaveObject(g);if(q.key!==null&&(P!==null||j===!0))C.leaveKey(k,q.key,P);else if(k!==null)C.exitKey(k);return P},W.prototype._decodeGeneric=function(C,R,q){var P=this._baseState;if(C==="seq"||C==="set")return null;if(C==="seqof"||C==="setof")return this._decodeList(R,C,P.args[0],q);else if(/str$/.test(C))return this._decodeStr(R,C,q);else if(C==="objid"&&P.args)return this._decodeObjid(R,P.args[0],P.args[1],q);else if(C==="objid")return this._decodeObjid(R,null,null,q);else if(C==="gentime"||C==="utctime")return this._decodeTime(R,C,q);else if(C==="null_")return this._decodeNull(R,q);else if(C==="bool")return this._decodeBool(R,q);else if(C==="objDesc")return this._decodeStr(R,C,q);else if(C==="int"||C==="enum")return this._decodeInt(R,P.args&&P.args[0],q);if(P.use!==null)return this._getUse(P.use,R._reporterState.obj)._decode(R,q);else return R.error("unknown tag: "+C)},W.prototype._getUse=function(C,R){var q=this._baseState;if(q.useDecoder=this._use(C,R),F(q.useDecoder._baseState.parent===null),q.useDecoder=q.useDecoder._baseState.children[0],q.implicit!==q.useDecoder._baseState.implicit)q.useDecoder=q.useDecoder.clone(),q.useDecoder._baseState.implicit=q.implicit;return q.useDecoder},W.prototype._decodeChoice=function(C,R){var q=this._baseState,P=null,j=!1;if(Object.keys(q.choice).some(function(k){var B=C.save(),v=q.choice[k];try{var g=v._decode(C,R);if(C.isError(g))return!1;P={type:k,value:g},j=!0}catch(f){return C.restore(B),!1}return!0},this),!j)return C.error("Choice not matched");return P},W.prototype._createEncoderBuffer=function(C){return new L(C,this.reporter)},W.prototype._encode=function(C,R,q){var P=this._baseState;if(P.default!==null&&P.default===C)return;var j=this._encodeValue(C,R,q);if(j===void 0)return;if(this._skipDefault(j,R,q))return;return j},W.prototype._encodeValue=function(C,R,q){var P=this._baseState;if(P.parent===null)return P.children[0]._encode(C,R||new I);var v=null;if(this.reporter=R,P.optional&&C===void 0)if(P.default!==null)C=P.default;else return;var j=null,k=!1;if(P.any)v=this._createEncoderBuffer(C);else if(P.choice)v=this._encodeChoice(C,R);else if(P.contains)j=this._getUse(P.contains,q)._encode(C,R),k=!0;else if(P.children)j=P.children.map(function(w){if(w._baseState.tag==="null_")return w._encode(null,R,C);if(w._baseState.key===null)return R.error("Child should have a key");var d=R.enterKey(w._baseState.key);if(typeof C!=="object")return R.error("Child expected, but input is not object");var Y0=w._encode(C[w._baseState.key],R,C);return R.leaveKey(d),Y0},this).filter(function(w){return w}),j=this._createEncoderBuffer(j);else if(P.tag==="seqof"||P.tag==="setof"){if(!(P.args&&P.args.length===1))return R.error("Too many args for : "+P.tag);if(!Array.isArray(C))return R.error("seqof/setof, but data is not Array");var B=this.clone();B._baseState.implicit=null,j=this._createEncoderBuffer(C.map(function(w){var d=this._baseState;return this._getUse(d.args[0],C)._encode(w,R)},B))}else if(P.use!==null)v=this._getUse(P.use,q)._encode(C,R);else j=this._encodePrimitive(P.tag,C),k=!0;var v;if(!P.any&&P.choice===null){var g=P.implicit!==null?P.implicit:P.tag,f=P.implicit===null?"universal":"context";if(g===null){if(P.use===null)R.error("Tag could be omitted only for .use()")}else if(P.use===null)v=this._encodeComposite(g,k,f,j)}if(P.explicit!==null)v=this._encodeComposite(P.explicit,!1,"context",v);return v},W.prototype._encodeChoice=function(C,R){var q=this._baseState,P=q.choice[C.type];if(!P)F(!1,C.type+" not found in "+JSON.stringify(Object.keys(q.choice)));return P._encode(C.value,R)},W.prototype._encodePrimitive=function(C,R){var q=this._baseState;if(/str$/.test(C))return this._encodeStr(R,C);else if(C==="objid"&&q.args)return this._encodeObjid(R,q.reverseArgs[0],q.args[1]);else if(C==="objid")return this._encodeObjid(R,null,null);else if(C==="gentime"||C==="utctime")return this._encodeTime(R,C);else if(C==="null_")return this._encodeNull();else if(C==="int"||C==="enum")return this._encodeInt(R,q.args&&q.reverseArgs[0]);else if(C==="bool")return this._encodeBool(R);else if(C==="objDesc")return this._encodeStr(R,C);else throw Error("Unsupported tag: "+C)},W.prototype._isNumstr=function(C){return/^[0-9 ]*$/.test(C)},W.prototype._isPrintstr=function(C){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(C)}}),zO=$0((Q)=>{var G=Q;G.Reporter=xG().Reporter,G.DecoderBuffer=fQ().DecoderBuffer,G.EncoderBuffer=fQ().EncoderBuffer,G.Node=NG()}),fG=$0((Q)=>{var G=UY();Q.tagClass={0:"universal",1:"application",2:"context",3:"private"},Q.tagClassByName=G._reverse(Q.tagClass),Q.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"},Q.tagByName=G._reverse(Q.tag)}),UY=$0((Q)=>{var G=Q;G._reverse=function(I){var L={};return Object.keys(I).forEach(function(T){if((T|0)==T)T=T|0;var F=I[T];L[F]=T}),L},G.der=fG()}),OY=$0((Q,G)=>{var I=BU(),L=_O(),T=L.base,F=L.bignum,J=L.constants.der;function M(C){this.enc="der",this.name=C.name,this.entity=C,this.tree=new z,this.tree._init(C.body)}G.exports=M,M.prototype.decode=function(C,R){if(!(C instanceof T.DecoderBuffer))C=new T.DecoderBuffer(C,R);return this.tree._decode(C,R)};function z(C){T.Node.call(this,"der",C)}I(z,T.Node),z.prototype._peekTag=function(C,R,q){if(C.isEmpty())return!1;var P=C.save(),j=W(C,'Failed to peek tag: "'+R+'"');if(C.isError(j))return j;return C.restore(P),j.tag===R||j.tagStr===R||j.tagStr+"of"===R||q},z.prototype._decodeTag=function(C,R,q){var P=W(C,'Failed to decode tag of "'+R+'"');if(C.isError(P))return P;var j=H(C,P.primitive,'Failed to get length of "'+R+'"');if(C.isError(j))return j;if(!q&&P.tag!==R&&P.tagStr!==R&&P.tagStr+"of"!==R)return C.error('Failed to match tag: "'+R+'"');if(P.primitive||j!==null)return C.skip(j,'Failed to match body of: "'+R+'"');var k=C.save(),B=this._skipUntilEnd(C,'Failed to skip indefinite length body: "'+this.tag+'"');if(C.isError(B))return B;return j=C.offset-k.offset,C.restore(k),C.skip(j,'Failed to match body of: "'+R+'"')},z.prototype._skipUntilEnd=function(C,R){while(!0){var q=W(C,R);if(C.isError(q))return q;var P=H(C,q.primitive,R);if(C.isError(P))return P;var j;if(q.primitive||P!==null)j=C.skip(P);else j=this._skipUntilEnd(C,R);if(C.isError(j))return j;if(q.tagStr==="end")break}},z.prototype._decodeList=function(C,R,q,P){var j=[];while(!C.isEmpty()){var k=this._peekTag(C,"end");if(C.isError(k))return k;var B=q.decode(C,"der",P);if(C.isError(B)&&k)break;j.push(B)}return j},z.prototype._decodeStr=function(C,R){if(R==="bitstr"){var q=C.readUInt8();if(C.isError(q))return q;return{unused:q,data:C.raw()}}else if(R==="bmpstr"){var P=C.raw();if(P.length%2===1)return C.error("Decoding of string type: bmpstr length mismatch");var j="";for(var k=0;k<P.length/2;k++)j+=String.fromCharCode(P.readUInt16BE(k*2));return j}else if(R==="numstr"){var B=C.raw().toString("ascii");if(!this._isNumstr(B))return C.error("Decoding of string type: numstr unsupported characters");return B}else if(R==="octstr")return C.raw();else if(R==="objDesc")return C.raw();else if(R==="printstr"){var v=C.raw().toString("ascii");if(!this._isPrintstr(v))return C.error("Decoding of string type: printstr unsupported characters");return v}else if(/str$/.test(R))return C.raw().toString();else return C.error("Decoding of string type: "+R+" unsupported")},z.prototype._decodeObjid=function(C,R,q){var P,j=[],k=0;while(!C.isEmpty()){var B=C.readUInt8();if(k<<=7,k|=B&127,(B&128)===0)j.push(k),k=0}if(B&128)j.push(k);var v=j[0]/40|0,g=j[0]%40;if(q)P=j;else P=[v,g].concat(j.slice(1));if(R){var f=R[P.join(" ")];if(f===void 0)f=R[P.join(".")];if(f!==void 0)P=f}return P},z.prototype._decodeTime=function(C,R){var q=C.raw().toString();if(R==="gentime")var P=q.slice(0,4)|0,j=q.slice(4,6)|0,k=q.slice(6,8)|0,B=q.slice(8,10)|0,v=q.slice(10,12)|0,g=q.slice(12,14)|0;else if(R==="utctime"){var P=q.slice(0,2)|0,j=q.slice(2,4)|0,k=q.slice(4,6)|0,B=q.slice(6,8)|0,v=q.slice(8,10)|0,g=q.slice(10,12)|0;if(P<70)P=2000+P;else P=1900+P}else return C.error("Decoding "+R+" time is not supported yet");return Date.UTC(P,j-1,k,B,v,g,0)},z.prototype._decodeNull=function(C){return null},z.prototype._decodeBool=function(C){var R=C.readUInt8();if(C.isError(R))return R;else return R!==0},z.prototype._decodeInt=function(C,R){var q=C.raw(),P=new F(q);if(R)P=R[P.toString(10)]||P;return P},z.prototype._use=function(C,R){if(typeof C==="function")C=C(R);return C._getDecoder("der").tree};function W(C,R){var q=C.readUInt8(R);if(C.isError(q))return q;var P=J.tagClass[q>>6],j=(q&32)===0;if((q&31)===31){var k=q;q=0;while((k&128)===128){if(k=C.readUInt8(R),C.isError(k))return k;q<<=7,q|=k&127}}else q&=31;var B=J.tag[q];return{cls:P,primitive:j,tag:q,tagStr:B}}function H(C,R,q){var P=C.readUInt8(q);if(C.isError(P))return P;if(!R&&P===128)return null;if((P&128)===0)return P;var j=P&127;if(j>4)return C.error("length octect is too long");P=0;for(var k=0;k<j;k++){P<<=8;var B=C.readUInt8(q);if(C.isError(B))return B;P|=B}return P}}),wG=$0((Q,G)=>{var I=BU(),L=(LU(),h0(CU)).Buffer,T=OY();function F(J){T.call(this,J),this.enc="pem"}I(F,T),G.exports=F,F.prototype.decode=function(J,M){var z=J.toString().split(/[\r\n]+/g),W=M.label.toUpperCase(),H=/^-----(BEGIN|END) ([^-]+)-----$/,C=-1,R=-1;for(var q=0;q<z.length;q++){var P=z[q].match(H);if(P===null)continue;if(P[2]!==W)continue;if(C===-1){if(P[1]!=="BEGIN")break;C=q}else{if(P[1]!=="END")break;R=q;break}}if(C===-1||R===-1)throw Error("PEM section not found for: "+W);var j=z.slice(C+1,R).join("");j.replace(/[^a-z0-9\+\/=]+/gi,"");var k=new L(j,"base64");return T.prototype.decode.call(this,k,M)}}),yG=$0((Q)=>{var G=Q;G.der=OY(),G.pem=wG()}),ZY=$0((Q,G)=>{var I=BU(),L=(LU(),h0(CU)).Buffer,T=_O(),F=T.base,J=T.constants.der;function M(C){this.enc="der",this.name=C.name,this.entity=C,this.tree=new z,this.tree._init(C.body)}G.exports=M,M.prototype.encode=function(C,R){return this.tree._encode(C,R).join()};function z(C){F.Node.call(this,"der",C)}I(z,F.Node),z.prototype._encodeComposite=function(C,R,q,P){var j=H(C,R,q,this.reporter);if(P.length<128){var v=new L(2);return v[0]=j,v[1]=P.length,this._createEncoderBuffer([v,P])}var k=1;for(var B=P.length;B>=256;B>>=8)k++;var v=new L(2+k);v[0]=j,v[1]=128|k;for(var B=1+k,g=P.length;g>0;B--,g>>=8)v[B]=g&255;return this._createEncoderBuffer([v,P])},z.prototype._encodeStr=function(C,R){if(R==="bitstr")return this._createEncoderBuffer([C.unused|0,C.data]);else if(R==="bmpstr"){var q=new L(C.length*2);for(var P=0;P<C.length;P++)q.writeUInt16BE(C.charCodeAt(P),P*2);return this._createEncoderBuffer(q)}else if(R==="numstr"){if(!this._isNumstr(C))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(C)}else if(R==="printstr"){if(!this._isPrintstr(C))return this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark");return this._createEncoderBuffer(C)}else if(/str$/.test(R))return this._createEncoderBuffer(C);else if(R==="objDesc")return this._createEncoderBuffer(C);else return this.reporter.error("Encoding of string type: "+R+" unsupported")},z.prototype._encodeObjid=function(C,R,q){if(typeof C==="string"){if(!R)return this.reporter.error("string objid given, but no values map found");if(!R.hasOwnProperty(C))return this.reporter.error("objid not found in values map");C=R[C].split(/[\s\.]+/g);for(var P=0;P<C.length;P++)C[P]|=0}else if(Array.isArray(C)){C=C.slice();for(var P=0;P<C.length;P++)C[P]|=0}if(!Array.isArray(C))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(C));if(!q){if(C[1]>=40)return this.reporter.error("Second objid identifier OOB");C.splice(0,2,C[0]*40+C[1])}var j=0;for(var P=0;P<C.length;P++){var k=C[P];for(j++;k>=128;k>>=7)j++}var B=new L(j),v=B.length-1;for(var P=C.length-1;P>=0;P--){var k=C[P];B[v--]=k&127;while((k>>=7)>0)B[v--]=128|k&127}return this._createEncoderBuffer(B)};function W(C){if(C<10)return"0"+C;else return C}z.prototype._encodeTime=function(C,R){var q,P=new Date(C);if(R==="gentime")q=[W(P.getFullYear()),W(P.getUTCMonth()+1),W(P.getUTCDate()),W(P.getUTCHours()),W(P.getUTCMinutes()),W(P.getUTCSeconds()),"Z"].join("");else if(R==="utctime")q=[W(P.getFullYear()%100),W(P.getUTCMonth()+1),W(P.getUTCDate()),W(P.getUTCHours()),W(P.getUTCMinutes()),W(P.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+R+" time is not supported yet");return this._encodeStr(q,"octstr")},z.prototype._encodeNull=function(){return this._createEncoderBuffer("")},z.prototype._encodeInt=function(C,R){if(typeof C==="string"){if(!R)return this.reporter.error("String int or enum given, but no values map");if(!R.hasOwnProperty(C))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(C));C=R[C]}if(typeof C!=="number"&&!L.isBuffer(C)){var q=C.toArray();if(!C.sign&&q[0]&128)q.unshift(0);C=new L(q)}if(L.isBuffer(C)){var P=C.length;if(C.length===0)P++;var k=new L(P);if(C.copy(k),C.length===0)k[0]=0;return this._createEncoderBuffer(k)}if(C<128)return this._createEncoderBuffer(C);if(C<256)return this._createEncoderBuffer([0,C]);var P=1;for(var j=C;j>=256;j>>=8)P++;var k=Array(P);for(var j=k.length-1;j>=0;j--)k[j]=C&255,C>>=8;if(k[0]&128)k.unshift(0);return this._createEncoderBuffer(new L(k))},z.prototype._encodeBool=function(C){return this._createEncoderBuffer(C?255:0)},z.prototype._use=function(C,R){if(typeof C==="function")C=C(R);return C._getEncoder("der").tree},z.prototype._skipDefault=function(C,R,q){var P=this._baseState,j;if(P.default===null)return!1;var k=C.join();if(P.defaultBuffer===void 0)P.defaultBuffer=this._encodeValue(P.default,R,q).join();if(k.length!==P.defaultBuffer.length)return!1;for(j=0;j<k.length;j++)if(k[j]!==P.defaultBuffer[j])return!1;return!0};function H(C,R,q,P){var j;if(C==="seqof")C="seq";else if(C==="setof")C="set";if(J.tagByName.hasOwnProperty(C))j=J.tagByName[C];else if(typeof C==="number"&&(C|0)===C)j=C;else return P.error("Unknown tag: "+C);if(j>=31)return P.error("Multi-octet tag encoding unsupported");if(!R)j|=32;return j|=J.tagClassByName[q||"universal"]<<6,j}}),cG=$0((Q,G)=>{var I=BU(),L=ZY();function T(F){L.call(this,F),this.enc="pem"}I(T,L),G.exports=T,T.prototype.encode=function(F,J){var M=L.prototype.encode.call(this,F),z=M.toString("base64"),W=["-----BEGIN "+J.label+"-----"];for(var H=0;H<z.length;H+=64)W.push(z.slice(H,H+64));return W.push("-----END "+J.label+"-----"),W.join(`
|
|
15
|
-
`)}}),pG=$0((Q)=>{var G=Q;G.der=ZY(),G.pem=cG()}),_O=$0((Q)=>{var G=Q;G.bignum=BG(),G.define=gG().define,G.base=zO(),G.constants=UY(),G.decoders=yG(),G.encoders=pG()}),hG=$0((Q,G)=>{var I=_O(),L=I.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),T=I.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),F=I.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),J=I.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(F),this.key("subjectPublicKey").bitstr())}),M=I.define("RelativeDistinguishedName",function(){this.setof(T)}),z=I.define("RDNSequence",function(){this.seqof(M)}),W=I.define("Name",function(){this.choice({rdnSequence:this.use(z)})}),H=I.define("Validity",function(){this.seq().obj(this.key("notBefore").use(L),this.key("notAfter").use(L))}),C=I.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),R=I.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(F),this.key("issuer").use(W),this.key("validity").use(H),this.key("subject").use(W),this.key("subjectPublicKeyInfo").use(J),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(C).optional())}),q=I.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(R),this.key("signatureAlgorithm").use(F),this.key("signatureValue").bitstr())});G.exports=q}),uG=$0((Q)=>{var G=_O();Q.certificate=hG();var I=G.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});Q.RSAPrivateKey=I;var L=G.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});Q.RSAPublicKey=L;var T=G.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),F=G.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(T),this.key("subjectPublicKey").bitstr())});Q.PublicKey=F;var J=G.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(T),this.key("subjectPrivateKey").octstr())});Q.PrivateKey=J;var M=G.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});Q.EncryptedPrivateKey=M;var z=G.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});Q.DSAPrivateKey=z,Q.DSAparam=G.define("DSAparam",function(){this.int()});var W=G.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),H=G.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(W),this.key("publicKey").optional().explicit(1).bitstr())});Q.ECPrivateKey=H,Q.signature=G.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),lG=$0((Q,G)=>{G.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}}),bG=$0((Q,G)=>{var I=MU().Buffer,L=bO().Transform,T=BU();function F(W){L.call(this),this._block=I.allocUnsafe(W),this._blockSize=W,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}T(F,L),F.prototype._transform=function(W,H,C){var R=null;try{this.update(W,H)}catch(q){R=q}C(R)},F.prototype._flush=function(W){var H=null;try{this.push(this.digest())}catch(C){H=C}W(H)};var J=typeof Uint8Array<"u",M=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(I.prototype instanceof Uint8Array||I.TYPED_ARRAY_SUPPORT);function z(W,H){if(W instanceof I)return W;if(typeof W==="string")return I.from(W,H);if(M&&ArrayBuffer.isView(W)){if(W.byteLength===0)return I.alloc(0);var C=I.from(W.buffer,W.byteOffset,W.byteLength);if(C.byteLength===W.byteLength)return C}if(J&&W instanceof Uint8Array)return I.from(W);if(I.isBuffer(W)&&W.constructor&&typeof W.constructor.isBuffer==="function"&&W.constructor.isBuffer(W))return I.from(W);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}F.prototype.update=function(W,H){if(this._finalized)throw Error("Digest already called");W=z(W,H);var C=this._block,R=0;while(this._blockOffset+W.length-R>=this._blockSize){for(var q=this._blockOffset;q<this._blockSize;)C[q++]=W[R++];this._update(),this._blockOffset=0}while(R<W.length)C[this._blockOffset++]=W[R++];for(var P=0,j=W.length*8;j>0;++P)if(this._length[P]+=j,j=this._length[P]/4294967296|0,j>0)this._length[P]-=4294967296*j;return this},F.prototype._update=function(){throw Error("_update is not implemented")},F.prototype.digest=function(W){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var H=this._digest();if(W!==void 0)H=H.toString(W);this._block.fill(0),this._blockOffset=0;for(var C=0;C<4;++C)this._length[C]=0;return H},F.prototype._digest=function(){throw Error("_digest is not implemented")},G.exports=F}),dG=$0((Q,G)=>{var I=BU(),L=bG(),T=MU().Buffer,F=Array(16);function J(){L.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}I(J,L),J.prototype._update=function(){var R=F;for(var q=0;q<16;++q)R[q]=this._block.readInt32LE(q*4);var P=this._a,j=this._b,k=this._c,B=this._d;P=z(P,j,k,B,R[0],3614090360,7),B=z(B,P,j,k,R[1],3905402710,12),k=z(k,B,P,j,R[2],606105819,17),j=z(j,k,B,P,R[3],3250441966,22),P=z(P,j,k,B,R[4],4118548399,7),B=z(B,P,j,k,R[5],1200080426,12),k=z(k,B,P,j,R[6],2821735955,17),j=z(j,k,B,P,R[7],4249261313,22),P=z(P,j,k,B,R[8],1770035416,7),B=z(B,P,j,k,R[9],2336552879,12),k=z(k,B,P,j,R[10],4294925233,17),j=z(j,k,B,P,R[11],2304563134,22),P=z(P,j,k,B,R[12],1804603682,7),B=z(B,P,j,k,R[13],4254626195,12),k=z(k,B,P,j,R[14],2792965006,17),j=z(j,k,B,P,R[15],1236535329,22),P=W(P,j,k,B,R[1],4129170786,5),B=W(B,P,j,k,R[6],3225465664,9),k=W(k,B,P,j,R[11],643717713,14),j=W(j,k,B,P,R[0],3921069994,20),P=W(P,j,k,B,R[5],3593408605,5),B=W(B,P,j,k,R[10],38016083,9),k=W(k,B,P,j,R[15],3634488961,14),j=W(j,k,B,P,R[4],3889429448,20),P=W(P,j,k,B,R[9],568446438,5),B=W(B,P,j,k,R[14],3275163606,9),k=W(k,B,P,j,R[3],4107603335,14),j=W(j,k,B,P,R[8],1163531501,20),P=W(P,j,k,B,R[13],2850285829,5),B=W(B,P,j,k,R[2],4243563512,9),k=W(k,B,P,j,R[7],1735328473,14),j=W(j,k,B,P,R[12],2368359562,20),P=H(P,j,k,B,R[5],4294588738,4),B=H(B,P,j,k,R[8],2272392833,11),k=H(k,B,P,j,R[11],1839030562,16),j=H(j,k,B,P,R[14],4259657740,23),P=H(P,j,k,B,R[1],2763975236,4),B=H(B,P,j,k,R[4],1272893353,11),k=H(k,B,P,j,R[7],4139469664,16),j=H(j,k,B,P,R[10],3200236656,23),P=H(P,j,k,B,R[13],681279174,4),B=H(B,P,j,k,R[0],3936430074,11),k=H(k,B,P,j,R[3],3572445317,16),j=H(j,k,B,P,R[6],76029189,23),P=H(P,j,k,B,R[9],3654602809,4),B=H(B,P,j,k,R[12],3873151461,11),k=H(k,B,P,j,R[15],530742520,16),j=H(j,k,B,P,R[2],3299628645,23),P=C(P,j,k,B,R[0],4096336452,6),B=C(B,P,j,k,R[7],1126891415,10),k=C(k,B,P,j,R[14],2878612391,15),j=C(j,k,B,P,R[5],4237533241,21),P=C(P,j,k,B,R[12],1700485571,6),B=C(B,P,j,k,R[3],2399980690,10),k=C(k,B,P,j,R[10],4293915773,15),j=C(j,k,B,P,R[1],2240044497,21),P=C(P,j,k,B,R[8],1873313359,6),B=C(B,P,j,k,R[15],4264355552,10),k=C(k,B,P,j,R[6],2734768916,15),j=C(j,k,B,P,R[13],1309151649,21),P=C(P,j,k,B,R[4],4149444226,6),B=C(B,P,j,k,R[11],3174756917,10),k=C(k,B,P,j,R[2],718787259,15),j=C(j,k,B,P,R[9],3951481745,21),this._a=this._a+P|0,this._b=this._b+j|0,this._c=this._c+k|0,this._d=this._d+B|0},J.prototype._digest=function(){if(this._block[this._blockOffset++]=128,this._blockOffset>56)this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0;this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var R=T.allocUnsafe(16);return R.writeInt32LE(this._a,0),R.writeInt32LE(this._b,4),R.writeInt32LE(this._c,8),R.writeInt32LE(this._d,12),R};function M(R,q){return R<<q|R>>>32-q}function z(R,q,P,j,k,B,v){return M(R+(q&P|~q&j)+k+B|0,v)+q|0}function W(R,q,P,j,k,B,v){return M(R+(q&j|P&~j)+k+B|0,v)+q|0}function H(R,q,P,j,k,B,v){return M(R+(q^P^j)+k+B|0,v)+q|0}function C(R,q,P,j,k,B,v){return M(R+(P^(q|~j))+k+B|0,v)+q|0}G.exports=J}),oG=$0((Q,G)=>{var I=MU().Buffer,L=dG();function T(F,J,M,z){if(!I.isBuffer(F))F=I.from(F,"binary");if(J){if(!I.isBuffer(J))J=I.from(J,"binary");if(J.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var W=M/8,H=I.alloc(W),C=I.alloc(z||0),R=I.alloc(0);while(W>0||z>0){var q=new L;if(q.update(R),q.update(F),J)q.update(J);R=q.digest();var P=0;if(W>0){var j=H.length-W;P=Math.min(W,R.length),R.copy(H,j,0,P),W-=P}if(P<R.length&&z>0){var k=C.length-z,B=Math.min(z,R.length-P);R.copy(C,k,P,P+B),z-=B}}return R.fill(0),{key:H,iv:C}}G.exports=T}),XY=$0((Q)=>{var G=(_U(),h0(jU));Q.createCipher=Q.Cipher=G.createCipher,Q.createCipheriv=Q.Cipheriv=G.createCipheriv,Q.createDecipher=Q.Decipher=G.createDecipher,Q.createDecipheriv=Q.Decipheriv=G.createDecipheriv,Q.listCiphers=Q.getCiphers=G.getCiphers}),nG=$0((Q,G)=>{var I=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,L=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,T=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,F=oG(),J=XY(),M=MU().Buffer;G.exports=function(z,W){var H=z.toString(),C=H.match(I),R;if(!C){var q=H.match(T);R=M.from(q[2].replace(/[\r\n]/g,""),"base64")}else{var P="aes"+C[1],j=M.from(C[2],"hex"),k=M.from(C[3].replace(/[\r\n]/g,""),"base64"),B=F(W,j.slice(0,8),parseInt(C[1],10)).key,v=[],g=J.createDecipheriv(P,B,j);v.push(g.update(k)),v.push(g.final()),R=M.concat(v)}var f=H.match(L)[1];return{tag:f,data:R}}}),QY=$0((Q,G)=>{var I=uG(),L=lG(),T=nG(),F=XY(),J=tQ().pbkdf2Sync,M=MU().Buffer;function z(H,C){var R=H.algorithm.decrypt.kde.kdeparams.salt,q=parseInt(H.algorithm.decrypt.kde.kdeparams.iters.toString(),10),P=L[H.algorithm.decrypt.cipher.algo.join(".")],j=H.algorithm.decrypt.cipher.iv,k=H.subjectPrivateKey,B=parseInt(P.split("-")[1],10)/8,v=J(C,R,q,B,"sha1"),g=F.createDecipheriv(P,v,j),f=[];return f.push(g.update(k)),f.push(g.final()),M.concat(f)}function W(H){var C;if(typeof H==="object"&&!M.isBuffer(H))C=H.passphrase,H=H.key;if(typeof H==="string")H=M.from(H);var R=T(H,C),q=R.tag,P=R.data,j,k;switch(q){case"CERTIFICATE":k=I.certificate.decode(P,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!k)k=I.PublicKey.decode(P,"der");switch(j=k.algorithm.algorithm.join("."),j){case"1.2.840.113549.1.1.1":return I.RSAPublicKey.decode(k.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return k.subjectPrivateKey=k.subjectPublicKey,{type:"ec",data:k};case"1.2.840.10040.4.1":return k.algorithm.params.pub_key=I.DSAparam.decode(k.subjectPublicKey.data,"der"),{type:"dsa",data:k.algorithm.params};default:throw Error("unknown key id "+j)}case"ENCRYPTED PRIVATE KEY":P=I.EncryptedPrivateKey.decode(P,"der"),P=z(P,C);case"PRIVATE KEY":switch(k=I.PrivateKey.decode(P,"der"),j=k.algorithm.algorithm.join("."),j){case"1.2.840.113549.1.1.1":return I.RSAPrivateKey.decode(k.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:k.algorithm.curve,privateKey:I.ECPrivateKey.decode(k.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return k.algorithm.params.priv_key=I.DSAparam.decode(k.subjectPrivateKey,"der"),{type:"dsa",params:k.algorithm.params};default:throw Error("unknown key id "+j)}case"RSA PUBLIC KEY":return I.RSAPublicKey.decode(P,"der");case"RSA PRIVATE KEY":return I.RSAPrivateKey.decode(P,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:I.DSAPrivateKey.decode(P,"der")};case"EC PRIVATE KEY":return P=I.ECPrivateKey.decode(P,"der"),{curve:P.parameters.value,privateKey:P.privateKey};default:throw Error("unknown key type "+q)}}W.signature=I.signature,G.exports=W}),YY=$0((Q,G)=>{var I=OZ(),L=MU().Buffer;G.exports=function(F,J){var M=L.alloc(0),z=0,W;while(M.length<J)W=T(z++),M=L.concat([M,I("sha1").update(F).update(W).digest()]);return M.slice(0,J)};function T(F){var J=L.allocUnsafe(4);return J.writeUInt32BE(F,0),J}}),JY=$0((Q,G)=>{G.exports=function(I,L){var T=I.length,F=-1;while(++F<T)I[F]^=L[F];return I}}),XX=$0((Q,G)=>{(function(I,L){function T(U,X){if(!U)throw Error(X||"Assertion failed")}function F(U,X){U.super_=X;var $=function(){};$.prototype=X.prototype,U.prototype=new $,U.prototype.constructor=U}function J(U,X,$){if(J.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")$=X,X=10;this._init(U||0,X||10,$||"be")}}if(typeof I==="object")I.exports=J;else L.BN=J;J.BN=J,J.wordSize=26;var M;try{if(typeof window<"u"&&typeof window.Buffer<"u")M=window.Buffer;else M=(LU(),h0(CU)).Buffer}catch(U){}J.isBN=function(U){if(U instanceof J)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===J.wordSize&&Array.isArray(U.words)},J.max=function(U,X){if(U.cmp(X)>0)return U;return X},J.min=function(U,X){if(U.cmp(X)<0)return U;return X},J.prototype._init=function(U,X,$){if(typeof U==="number")return this._initNumber(U,X,$);if(typeof U==="object")return this._initArray(U,X,$);if(X==="hex")X=16;T(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,$);else if(this._parseBase(U,X,Z),$==="le")this._initArray(this.toArray(),X,$)}},J.prototype._initNumber=function(U,X,$){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else T(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if($!=="le")return;this._initArray(this.toArray(),X,$)},J.prototype._initArray=function(U,X,$){if(T(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y,E,K=0;if($==="be"){for(Z=U.length-1,Y=0;Z>=0;Z-=3)if(E=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[Y]|=E<<K&67108863,this.words[Y+1]=E>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}else if($==="le"){for(Z=0,Y=0;Z<U.length;Z+=3)if(E=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[Y]|=E<<K&67108863,this.words[Y+1]=E>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}return this.strip()};function z(U,X){var $=U.charCodeAt(X);if($>=65&&$<=70)return $-55;else if($>=97&&$<=102)return $-87;else return $-48&15}function W(U,X,$){var Z=z(U,$);if($-1>=X)Z|=z(U,$-1)<<4;return Z}J.prototype._parseHex=function(U,X,$){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y=0,E=0,K;if($==="be")for(Z=U.length-1;Z>=X;Z-=2)if(K=W(U,X,Z)<<Y,this.words[E]|=K&67108863,Y>=18)Y-=18,E+=1,this.words[E]|=K>>>26;else Y+=8;else{var A=U.length-X;for(Z=A%2===0?X+1:X;Z<U.length;Z+=2)if(K=W(U,X,Z)<<Y,this.words[E]|=K&67108863,Y>=18)Y-=18,E+=1,this.words[E]|=K>>>26;else Y+=8}this.strip()};function H(U,X,$,Z){var Y=0,E=Math.min(U.length,$);for(var K=X;K<E;K++){var A=U.charCodeAt(K)-48;if(Y*=Z,A>=49)Y+=A-49+10;else if(A>=17)Y+=A-17+10;else Y+=A}return Y}J.prototype._parseBase=function(U,X,$){this.words=[0],this.length=1;for(var Z=0,Y=1;Y<=67108863;Y*=X)Z++;Z--,Y=Y/X|0;var E=U.length-$,K=E%Z,A=Math.min(E,E-K)+$,O=0;for(var V=$;V<A;V+=Z)if(O=H(U,V,V+Z,X),this.imuln(Y),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(K!==0){var D=1;O=H(U,V,U.length,X);for(V=0;V<K;V++)D*=X;if(this.imuln(D),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},J.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},J.prototype.clone=function(){var U=new J(null);return this.copy(U),U},J.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},J.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},J.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},J.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var C=["","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"],R=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(J.prototype.toString=function(U,X){U=U||10,X=X|0||1;var $;if(U===16||U==="hex"){$="";var Z=0,Y=0;for(var E=0;E<this.length;E++){var K=this.words[E],A=((K<<Z|Y)&16777215).toString(16);if(Y=K>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,E--;if(Y!==0||E!==this.length-1)$=C[6-A.length]+A+$;else $=A+$}if(Y!==0)$=Y.toString(16)+$;while($.length%X!==0)$="0"+$;if(this.negative!==0)$="-"+$;return $}if(U===(U|0)&&U>=2&&U<=36){var O=R[U],V=q[U];$="";var D=this.clone();D.negative=0;while(!D.isZero()){var S=D.modn(V).toString(U);if(D=D.idivn(V),!D.isZero())$=C[O-S.length]+S+$;else $=S+$}if(this.isZero())$="0"+$;while($.length%X!==0)$="0"+$;if(this.negative!==0)$="-"+$;return $}T(!1,"Base should be between 2 and 36")},J.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)T(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},J.prototype.toJSON=function(){return this.toString(16)},J.prototype.toBuffer=function(U,X){return T(typeof M<"u"),this.toArrayLike(M,U,X)},J.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},J.prototype.toArrayLike=function(U,X,$){var Z=this.byteLength(),Y=$||Math.max(1,Z);T(Z<=Y,"byte array longer than desired length"),T(Y>0,"Requested array length <= 0"),this.strip();var E=X==="le",K=new U(Y),A,O,V=this.clone();if(!E){for(O=0;O<Y-Z;O++)K[O]=0;for(O=0;!V.isZero();O++)A=V.andln(255),V.iushrn(8),K[Y-O-1]=A}else{for(O=0;!V.isZero();O++)A=V.andln(255),V.iushrn(8),K[O]=A;for(;O<Y;O++)K[O]=0}return K},Math.clz32)J.prototype._countBits=function(U){return 32-Math.clz32(U)};else J.prototype._countBits=function(U){var X=U,$=0;if(X>=4096)$+=13,X>>>=13;if(X>=64)$+=7,X>>>=7;if(X>=8)$+=4,X>>>=4;if(X>=2)$+=2,X>>>=2;return $+X};J.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,$=0;if((X&8191)===0)$+=13,X>>>=13;if((X&127)===0)$+=7,X>>>=7;if((X&15)===0)$+=4,X>>>=4;if((X&3)===0)$+=2,X>>>=2;if((X&1)===0)$++;return $},J.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var $=0;$<X.length;$++){var Z=$/26|0,Y=$%26;X[$]=(U.words[Z]&1<<Y)>>>Y}return X}J.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var $=this._zeroBits(this.words[X]);if(U+=$,$!==26)break}return U},J.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},J.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},J.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},J.prototype.isNeg=function(){return this.negative!==0},J.prototype.neg=function(){return this.clone().ineg()},J.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},J.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},J.prototype.ior=function(U){return T((this.negative|U.negative)===0),this.iuor(U)},J.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},J.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},J.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var $=0;$<X.length;$++)this.words[$]=this.words[$]&U.words[$];return this.length=X.length,this.strip()},J.prototype.iand=function(U){return T((this.negative|U.negative)===0),this.iuand(U)},J.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},J.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},J.prototype.iuxor=function(U){var X,$;if(this.length>U.length)X=this,$=U;else X=U,$=this;for(var Z=0;Z<$.length;Z++)this.words[Z]=X.words[Z]^$.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},J.prototype.ixor=function(U){return T((this.negative|U.negative)===0),this.iuxor(U)},J.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},J.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},J.prototype.inotn=function(U){T(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,$=U%26;if(this._expand(X),$>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if($>0)this.words[Z]=~this.words[Z]&67108863>>26-$;return this.strip()},J.prototype.notn=function(U){return this.clone().inotn(U)},J.prototype.setn=function(U,X){T(typeof U==="number"&&U>=0);var $=U/26|0,Z=U%26;if(this._expand($+1),X)this.words[$]=this.words[$]|1<<Z;else this.words[$]=this.words[$]&~(1<<Z);return this.strip()},J.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var $,Z;if(this.length>U.length)$=this,Z=U;else $=U,Z=this;var Y=0;for(var E=0;E<Z.length;E++)X=($.words[E]|0)+(Z.words[E]|0)+Y,this.words[E]=X&67108863,Y=X>>>26;for(;Y!==0&&E<$.length;E++)X=($.words[E]|0)+Y,this.words[E]=X&67108863,Y=X>>>26;if(this.length=$.length,Y!==0)this.words[this.length]=Y,this.length++;else if($!==this)for(;E<$.length;E++)this.words[E]=$.words[E];return this},J.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},J.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var $=this.cmp(U);if($===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Y;if($>0)Z=this,Y=U;else Z=U,Y=this;var E=0;for(var K=0;K<Y.length;K++)X=(Z.words[K]|0)-(Y.words[K]|0)+E,E=X>>26,this.words[K]=X&67108863;for(;E!==0&&K<Z.length;K++)X=(Z.words[K]|0)+E,E=X>>26,this.words[K]=X&67108863;if(E===0&&K<Z.length&&Z!==this)for(;K<Z.length;K++)this.words[K]=Z.words[K];if(this.length=Math.max(this.length,K),Z!==this)this.negative=1;return this.strip()},J.prototype.sub=function(U){return this.clone().isub(U)};function j(U,X,$){$.negative=X.negative^U.negative;var Z=U.length+X.length|0;$.length=Z,Z=Z-1|0;var Y=U.words[0]|0,E=X.words[0]|0,K=Y*E,A=K&67108863,O=K/67108864|0;$.words[0]=A;for(var V=1;V<Z;V++){var D=O>>>26,S=O&67108863,_=Math.min(V,X.length-1);for(var N=Math.max(0,V-U.length+1);N<=_;N++){var p=V-N|0;Y=U.words[p]|0,E=X.words[N]|0,K=Y*E+S,D+=K/67108864|0,S=K&67108863}$.words[V]=S|0,O=D|0}if(O!==0)$.words[V]=O|0;else $.length--;return $.strip()}var k=function(U,X,$){var Z=U.words,Y=X.words,E=$.words,K=0,A,O,V,D=Z[0]|0,S=D&8191,_=D>>>13,N=Z[1]|0,p=N&8191,n=N>>>13,V0=Z[2]|0,r=V0&8191,b=V0>>>13,X0=Z[3]|0,t=X0&8191,i=X0>>>13,N0=Z[4]|0,y=N0&8191,h=N0>>>13,Q0=Z[5]|0,s=Q0&8191,a=Q0>>>13,H0=Z[6]|0,c=H0&8191,o=H0>>>13,x0=Z[7]|0,m=x0&8191,Z0=x0>>>13,w0=Z[8]|0,K0=w0&8191,T0=w0>>>13,t0=Z[9]|0,I0=t0&8191,C0=t0>>>13,r0=Y[0]|0,R0=r0&8191,S0=r0>>>13,WU=Y[1]|0,F0=WU&8191,k0=WU>>>13,HU=Y[2]|0,j0=HU&8191,D0=HU>>>13,SU=Y[3]|0,_0=SU&8191,M0=SU>>>13,EU=Y[4]|0,v0=EU&8191,B0=EU>>>13,KU=Y[5]|0,z0=KU&8191,x=KU>>>13,l=Y[6]|0,e=l&8191,U0=l>>>13,f0=Y[7]|0,E0=f0&8191,L0=f0>>>13,m0=Y[8]|0,q0=m0&8191,g0=m0>>>13,RU=Y[9]|0,P0=RU&8191,W0=RU>>>13;$.negative=U.negative^X.negative,$.length=19,A=Math.imul(S,R0),O=Math.imul(S,S0),O=O+Math.imul(_,R0)|0,V=Math.imul(_,S0);var s0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(s0>>>26)|0,s0&=67108863,A=Math.imul(p,R0),O=Math.imul(p,S0),O=O+Math.imul(n,R0)|0,V=Math.imul(n,S0),A=A+Math.imul(S,F0)|0,O=O+Math.imul(S,k0)|0,O=O+Math.imul(_,F0)|0,V=V+Math.imul(_,k0)|0;var c0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,A=Math.imul(r,R0),O=Math.imul(r,S0),O=O+Math.imul(b,R0)|0,V=Math.imul(b,S0),A=A+Math.imul(p,F0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,F0)|0,V=V+Math.imul(n,k0)|0,A=A+Math.imul(S,j0)|0,O=O+Math.imul(S,D0)|0,O=O+Math.imul(_,j0)|0,V=V+Math.imul(_,D0)|0;var y0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,A=Math.imul(t,R0),O=Math.imul(t,S0),O=O+Math.imul(i,R0)|0,V=Math.imul(i,S0),A=A+Math.imul(r,F0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(b,F0)|0,V=V+Math.imul(b,k0)|0,A=A+Math.imul(p,j0)|0,O=O+Math.imul(p,D0)|0,O=O+Math.imul(n,j0)|0,V=V+Math.imul(n,D0)|0,A=A+Math.imul(S,_0)|0,O=O+Math.imul(S,M0)|0,O=O+Math.imul(_,_0)|0,V=V+Math.imul(_,M0)|0;var b0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(b0>>>26)|0,b0&=67108863,A=Math.imul(y,R0),O=Math.imul(y,S0),O=O+Math.imul(h,R0)|0,V=Math.imul(h,S0),A=A+Math.imul(t,F0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(i,F0)|0,V=V+Math.imul(i,k0)|0,A=A+Math.imul(r,j0)|0,O=O+Math.imul(r,D0)|0,O=O+Math.imul(b,j0)|0,V=V+Math.imul(b,D0)|0,A=A+Math.imul(p,_0)|0,O=O+Math.imul(p,M0)|0,O=O+Math.imul(n,_0)|0,V=V+Math.imul(n,M0)|0,A=A+Math.imul(S,v0)|0,O=O+Math.imul(S,B0)|0,O=O+Math.imul(_,v0)|0,V=V+Math.imul(_,B0)|0;var l0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,A=Math.imul(s,R0),O=Math.imul(s,S0),O=O+Math.imul(a,R0)|0,V=Math.imul(a,S0),A=A+Math.imul(y,F0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,F0)|0,V=V+Math.imul(h,k0)|0,A=A+Math.imul(t,j0)|0,O=O+Math.imul(t,D0)|0,O=O+Math.imul(i,j0)|0,V=V+Math.imul(i,D0)|0,A=A+Math.imul(r,_0)|0,O=O+Math.imul(r,M0)|0,O=O+Math.imul(b,_0)|0,V=V+Math.imul(b,M0)|0,A=A+Math.imul(p,v0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,v0)|0,V=V+Math.imul(n,B0)|0,A=A+Math.imul(S,z0)|0,O=O+Math.imul(S,x)|0,O=O+Math.imul(_,z0)|0,V=V+Math.imul(_,x)|0;var e0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(e0>>>26)|0,e0&=67108863,A=Math.imul(c,R0),O=Math.imul(c,S0),O=O+Math.imul(o,R0)|0,V=Math.imul(o,S0),A=A+Math.imul(s,F0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(a,F0)|0,V=V+Math.imul(a,k0)|0,A=A+Math.imul(y,j0)|0,O=O+Math.imul(y,D0)|0,O=O+Math.imul(h,j0)|0,V=V+Math.imul(h,D0)|0,A=A+Math.imul(t,_0)|0,O=O+Math.imul(t,M0)|0,O=O+Math.imul(i,_0)|0,V=V+Math.imul(i,M0)|0,A=A+Math.imul(r,v0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(b,v0)|0,V=V+Math.imul(b,B0)|0,A=A+Math.imul(p,z0)|0,O=O+Math.imul(p,x)|0,O=O+Math.imul(n,z0)|0,V=V+Math.imul(n,x)|0,A=A+Math.imul(S,e)|0,O=O+Math.imul(S,U0)|0,O=O+Math.imul(_,e)|0,V=V+Math.imul(_,U0)|0;var a0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(a0>>>26)|0,a0&=67108863,A=Math.imul(m,R0),O=Math.imul(m,S0),O=O+Math.imul(Z0,R0)|0,V=Math.imul(Z0,S0),A=A+Math.imul(c,F0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,F0)|0,V=V+Math.imul(o,k0)|0,A=A+Math.imul(s,j0)|0,O=O+Math.imul(s,D0)|0,O=O+Math.imul(a,j0)|0,V=V+Math.imul(a,D0)|0,A=A+Math.imul(y,_0)|0,O=O+Math.imul(y,M0)|0,O=O+Math.imul(h,_0)|0,V=V+Math.imul(h,M0)|0,A=A+Math.imul(t,v0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(i,v0)|0,V=V+Math.imul(i,B0)|0,A=A+Math.imul(r,z0)|0,O=O+Math.imul(r,x)|0,O=O+Math.imul(b,z0)|0,V=V+Math.imul(b,x)|0,A=A+Math.imul(p,e)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,e)|0,V=V+Math.imul(n,U0)|0,A=A+Math.imul(S,E0)|0,O=O+Math.imul(S,L0)|0,O=O+Math.imul(_,E0)|0,V=V+Math.imul(_,L0)|0;var i0=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,A=Math.imul(K0,R0),O=Math.imul(K0,S0),O=O+Math.imul(T0,R0)|0,V=Math.imul(T0,S0),A=A+Math.imul(m,F0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(Z0,F0)|0,V=V+Math.imul(Z0,k0)|0,A=A+Math.imul(c,j0)|0,O=O+Math.imul(c,D0)|0,O=O+Math.imul(o,j0)|0,V=V+Math.imul(o,D0)|0,A=A+Math.imul(s,_0)|0,O=O+Math.imul(s,M0)|0,O=O+Math.imul(a,_0)|0,V=V+Math.imul(a,M0)|0,A=A+Math.imul(y,v0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,v0)|0,V=V+Math.imul(h,B0)|0,A=A+Math.imul(t,z0)|0,O=O+Math.imul(t,x)|0,O=O+Math.imul(i,z0)|0,V=V+Math.imul(i,x)|0,A=A+Math.imul(r,e)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(b,e)|0,V=V+Math.imul(b,U0)|0,A=A+Math.imul(p,E0)|0,O=O+Math.imul(p,L0)|0,O=O+Math.imul(n,E0)|0,V=V+Math.imul(n,L0)|0,A=A+Math.imul(S,q0)|0,O=O+Math.imul(S,g0)|0,O=O+Math.imul(_,q0)|0,V=V+Math.imul(_,g0)|0;var UU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,A=Math.imul(I0,R0),O=Math.imul(I0,S0),O=O+Math.imul(C0,R0)|0,V=Math.imul(C0,S0),A=A+Math.imul(K0,F0)|0,O=O+Math.imul(K0,k0)|0,O=O+Math.imul(T0,F0)|0,V=V+Math.imul(T0,k0)|0,A=A+Math.imul(m,j0)|0,O=O+Math.imul(m,D0)|0,O=O+Math.imul(Z0,j0)|0,V=V+Math.imul(Z0,D0)|0,A=A+Math.imul(c,_0)|0,O=O+Math.imul(c,M0)|0,O=O+Math.imul(o,_0)|0,V=V+Math.imul(o,M0)|0,A=A+Math.imul(s,v0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(a,v0)|0,V=V+Math.imul(a,B0)|0,A=A+Math.imul(y,z0)|0,O=O+Math.imul(y,x)|0,O=O+Math.imul(h,z0)|0,V=V+Math.imul(h,x)|0,A=A+Math.imul(t,e)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(i,e)|0,V=V+Math.imul(i,U0)|0,A=A+Math.imul(r,E0)|0,O=O+Math.imul(r,L0)|0,O=O+Math.imul(b,E0)|0,V=V+Math.imul(b,L0)|0,A=A+Math.imul(p,q0)|0,O=O+Math.imul(p,g0)|0,O=O+Math.imul(n,q0)|0,V=V+Math.imul(n,g0)|0,A=A+Math.imul(S,P0)|0,O=O+Math.imul(S,W0)|0,O=O+Math.imul(_,P0)|0,V=V+Math.imul(_,W0)|0;var OU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,A=Math.imul(I0,F0),O=Math.imul(I0,k0),O=O+Math.imul(C0,F0)|0,V=Math.imul(C0,k0),A=A+Math.imul(K0,j0)|0,O=O+Math.imul(K0,D0)|0,O=O+Math.imul(T0,j0)|0,V=V+Math.imul(T0,D0)|0,A=A+Math.imul(m,_0)|0,O=O+Math.imul(m,M0)|0,O=O+Math.imul(Z0,_0)|0,V=V+Math.imul(Z0,M0)|0,A=A+Math.imul(c,v0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,v0)|0,V=V+Math.imul(o,B0)|0,A=A+Math.imul(s,z0)|0,O=O+Math.imul(s,x)|0,O=O+Math.imul(a,z0)|0,V=V+Math.imul(a,x)|0,A=A+Math.imul(y,e)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,e)|0,V=V+Math.imul(h,U0)|0,A=A+Math.imul(t,E0)|0,O=O+Math.imul(t,L0)|0,O=O+Math.imul(i,E0)|0,V=V+Math.imul(i,L0)|0,A=A+Math.imul(r,q0)|0,O=O+Math.imul(r,g0)|0,O=O+Math.imul(b,q0)|0,V=V+Math.imul(b,g0)|0,A=A+Math.imul(p,P0)|0,O=O+Math.imul(p,W0)|0,O=O+Math.imul(n,P0)|0,V=V+Math.imul(n,W0)|0;var ZU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,A=Math.imul(I0,j0),O=Math.imul(I0,D0),O=O+Math.imul(C0,j0)|0,V=Math.imul(C0,D0),A=A+Math.imul(K0,_0)|0,O=O+Math.imul(K0,M0)|0,O=O+Math.imul(T0,_0)|0,V=V+Math.imul(T0,M0)|0,A=A+Math.imul(m,v0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(Z0,v0)|0,V=V+Math.imul(Z0,B0)|0,A=A+Math.imul(c,z0)|0,O=O+Math.imul(c,x)|0,O=O+Math.imul(o,z0)|0,V=V+Math.imul(o,x)|0,A=A+Math.imul(s,e)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(a,e)|0,V=V+Math.imul(a,U0)|0,A=A+Math.imul(y,E0)|0,O=O+Math.imul(y,L0)|0,O=O+Math.imul(h,E0)|0,V=V+Math.imul(h,L0)|0,A=A+Math.imul(t,q0)|0,O=O+Math.imul(t,g0)|0,O=O+Math.imul(i,q0)|0,V=V+Math.imul(i,g0)|0,A=A+Math.imul(r,P0)|0,O=O+Math.imul(r,W0)|0,O=O+Math.imul(b,P0)|0,V=V+Math.imul(b,W0)|0;var XU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,A=Math.imul(I0,_0),O=Math.imul(I0,M0),O=O+Math.imul(C0,_0)|0,V=Math.imul(C0,M0),A=A+Math.imul(K0,v0)|0,O=O+Math.imul(K0,B0)|0,O=O+Math.imul(T0,v0)|0,V=V+Math.imul(T0,B0)|0,A=A+Math.imul(m,z0)|0,O=O+Math.imul(m,x)|0,O=O+Math.imul(Z0,z0)|0,V=V+Math.imul(Z0,x)|0,A=A+Math.imul(c,e)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,e)|0,V=V+Math.imul(o,U0)|0,A=A+Math.imul(s,E0)|0,O=O+Math.imul(s,L0)|0,O=O+Math.imul(a,E0)|0,V=V+Math.imul(a,L0)|0,A=A+Math.imul(y,q0)|0,O=O+Math.imul(y,g0)|0,O=O+Math.imul(h,q0)|0,V=V+Math.imul(h,g0)|0,A=A+Math.imul(t,P0)|0,O=O+Math.imul(t,W0)|0,O=O+Math.imul(i,P0)|0,V=V+Math.imul(i,W0)|0;var QU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,A=Math.imul(I0,v0),O=Math.imul(I0,B0),O=O+Math.imul(C0,v0)|0,V=Math.imul(C0,B0),A=A+Math.imul(K0,z0)|0,O=O+Math.imul(K0,x)|0,O=O+Math.imul(T0,z0)|0,V=V+Math.imul(T0,x)|0,A=A+Math.imul(m,e)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(Z0,e)|0,V=V+Math.imul(Z0,U0)|0,A=A+Math.imul(c,E0)|0,O=O+Math.imul(c,L0)|0,O=O+Math.imul(o,E0)|0,V=V+Math.imul(o,L0)|0,A=A+Math.imul(s,q0)|0,O=O+Math.imul(s,g0)|0,O=O+Math.imul(a,q0)|0,V=V+Math.imul(a,g0)|0,A=A+Math.imul(y,P0)|0,O=O+Math.imul(y,W0)|0,O=O+Math.imul(h,P0)|0,V=V+Math.imul(h,W0)|0;var YU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,A=Math.imul(I0,z0),O=Math.imul(I0,x),O=O+Math.imul(C0,z0)|0,V=Math.imul(C0,x),A=A+Math.imul(K0,e)|0,O=O+Math.imul(K0,U0)|0,O=O+Math.imul(T0,e)|0,V=V+Math.imul(T0,U0)|0,A=A+Math.imul(m,E0)|0,O=O+Math.imul(m,L0)|0,O=O+Math.imul(Z0,E0)|0,V=V+Math.imul(Z0,L0)|0,A=A+Math.imul(c,q0)|0,O=O+Math.imul(c,g0)|0,O=O+Math.imul(o,q0)|0,V=V+Math.imul(o,g0)|0,A=A+Math.imul(s,P0)|0,O=O+Math.imul(s,W0)|0,O=O+Math.imul(a,P0)|0,V=V+Math.imul(a,W0)|0;var JU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,A=Math.imul(I0,e),O=Math.imul(I0,U0),O=O+Math.imul(C0,e)|0,V=Math.imul(C0,U0),A=A+Math.imul(K0,E0)|0,O=O+Math.imul(K0,L0)|0,O=O+Math.imul(T0,E0)|0,V=V+Math.imul(T0,L0)|0,A=A+Math.imul(m,q0)|0,O=O+Math.imul(m,g0)|0,O=O+Math.imul(Z0,q0)|0,V=V+Math.imul(Z0,g0)|0,A=A+Math.imul(c,P0)|0,O=O+Math.imul(c,W0)|0,O=O+Math.imul(o,P0)|0,V=V+Math.imul(o,W0)|0;var $U=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,A=Math.imul(I0,E0),O=Math.imul(I0,L0),O=O+Math.imul(C0,E0)|0,V=Math.imul(C0,L0),A=A+Math.imul(K0,q0)|0,O=O+Math.imul(K0,g0)|0,O=O+Math.imul(T0,q0)|0,V=V+Math.imul(T0,g0)|0,A=A+Math.imul(m,P0)|0,O=O+Math.imul(m,W0)|0,O=O+Math.imul(Z0,P0)|0,V=V+Math.imul(Z0,W0)|0;var GU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,A=Math.imul(I0,q0),O=Math.imul(I0,g0),O=O+Math.imul(C0,q0)|0,V=Math.imul(C0,g0),A=A+Math.imul(K0,P0)|0,O=O+Math.imul(K0,W0)|0,O=O+Math.imul(T0,P0)|0,V=V+Math.imul(T0,W0)|0;var AU=(K+A|0)+((O&8191)<<13)|0;K=(V+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,A=Math.imul(I0,P0),O=Math.imul(I0,W0),O=O+Math.imul(C0,P0)|0,V=Math.imul(C0,W0);var VU=(K+A|0)+((O&8191)<<13)|0;if(K=(V+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,E[0]=s0,E[1]=c0,E[2]=y0,E[3]=b0,E[4]=l0,E[5]=e0,E[6]=a0,E[7]=i0,E[8]=UU,E[9]=OU,E[10]=ZU,E[11]=XU,E[12]=QU,E[13]=YU,E[14]=JU,E[15]=$U,E[16]=GU,E[17]=AU,E[18]=VU,K!==0)E[19]=K,$.length++;return $};if(!Math.imul)k=j;function B(U,X,$){$.negative=X.negative^U.negative,$.length=U.length+X.length;var Z=0,Y=0;for(var E=0;E<$.length-1;E++){var K=Y;Y=0;var A=Z&67108863,O=Math.min(E,X.length-1);for(var V=Math.max(0,E-U.length+1);V<=O;V++){var D=E-V,S=U.words[D]|0,_=X.words[V]|0,N=S*_,p=N&67108863;K=K+(N/67108864|0)|0,p=p+A|0,A=p&67108863,K=K+(p>>>26)|0,Y+=K>>>26,K&=67108863}$.words[E]=A,Z=K,K=Y}if(Z!==0)$.words[E]=Z;else $.length--;return $.strip()}function v(U,X,$){var Z=new g;return Z.mulp(U,X,$)}J.prototype.mulTo=function(U,X){var $,Z=this.length+U.length;if(this.length===10&&U.length===10)$=k(this,U,X);else if(Z<63)$=j(this,U,X);else if(Z<1024)$=B(this,U,X);else $=v(this,U,X);return $};function g(U,X){this.x=U,this.y=X}g.prototype.makeRBT=function(U){var X=Array(U),$=J.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,$,U);return X},g.prototype.revBin=function(U,X,$){if(U===0||U===$-1)return U;var Z=0;for(var Y=0;Y<X;Y++)Z|=(U&1)<<X-Y-1,U>>=1;return Z},g.prototype.permute=function(U,X,$,Z,Y,E){for(var K=0;K<E;K++)Z[K]=X[U[K]],Y[K]=$[U[K]]},g.prototype.transform=function(U,X,$,Z,Y,E){this.permute(E,U,X,$,Z,Y);for(var K=1;K<Y;K<<=1){var A=K<<1,O=Math.cos(2*Math.PI/A),V=Math.sin(2*Math.PI/A);for(var D=0;D<Y;D+=A){var S=O,_=V;for(var N=0;N<K;N++){var p=$[D+N],n=Z[D+N],V0=$[D+N+K],r=Z[D+N+K],b=S*V0-_*r;if(r=S*r+_*V0,V0=b,$[D+N]=p+V0,Z[D+N]=n+r,$[D+N+K]=p-V0,Z[D+N+K]=n-r,N!==A)b=O*S-V*_,_=O*_+V*S,S=b}}}},g.prototype.guessLen13b=function(U,X){var $=Math.max(X,U)|1,Z=$&1,Y=0;for($=$/2|0;$;$=$>>>1)Y++;return 1<<Y+1+Z},g.prototype.conjugate=function(U,X,$){if($<=1)return;for(var Z=0;Z<$/2;Z++){var Y=U[Z];U[Z]=U[$-Z-1],U[$-Z-1]=Y,Y=X[Z],X[Z]=-X[$-Z-1],X[$-Z-1]=-Y}},g.prototype.normalize13b=function(U,X){var $=0;for(var Z=0;Z<X/2;Z++){var Y=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+$;if(U[Z]=Y&67108863,Y<67108864)$=0;else $=Y/67108864|0}return U},g.prototype.convert13b=function(U,X,$,Z){var Y=0;for(var E=0;E<X;E++)Y=Y+(U[E]|0),$[2*E]=Y&8191,Y=Y>>>13,$[2*E+1]=Y&8191,Y=Y>>>13;for(E=2*X;E<Z;++E)$[E]=0;T(Y===0),T((Y&-8192)===0)},g.prototype.stub=function(U){var X=Array(U);for(var $=0;$<U;$++)X[$]=0;return X},g.prototype.mulp=function(U,X,$){var Z=2*this.guessLen13b(U.length,X.length),Y=this.makeRBT(Z),E=this.stub(Z),K=Array(Z),A=Array(Z),O=Array(Z),V=Array(Z),D=Array(Z),S=Array(Z),_=$.words;_.length=Z,this.convert13b(U.words,U.length,K,Z),this.convert13b(X.words,X.length,V,Z),this.transform(K,E,A,O,Z,Y),this.transform(V,E,D,S,Z,Y);for(var N=0;N<Z;N++){var p=A[N]*D[N]-O[N]*S[N];O[N]=A[N]*S[N]+O[N]*D[N],A[N]=p}return this.conjugate(A,O,Z),this.transform(A,O,_,E,Z,Y),this.conjugate(_,E,Z),this.normalize13b(_,Z),$.negative=U.negative^X.negative,$.length=U.length+X.length,$.strip()},J.prototype.mul=function(U){var X=new J(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},J.prototype.mulf=function(U){var X=new J(null);return X.words=Array(this.length+U.length),v(this,U,X)},J.prototype.imul=function(U){return this.clone().mulTo(U,this)},J.prototype.imuln=function(U){T(typeof U==="number"),T(U<67108864);var X=0;for(var $=0;$<this.length;$++){var Z=(this.words[$]|0)*U,Y=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=Y>>>26,this.words[$]=Y&67108863}if(X!==0)this.words[$]=X,this.length++;return this.length=U===0?1:this.length,this},J.prototype.muln=function(U){return this.clone().imuln(U)},J.prototype.sqr=function(){return this.mul(this)},J.prototype.isqr=function(){return this.imul(this.clone())},J.prototype.pow=function(U){var X=P(U);if(X.length===0)return new J(1);var $=this;for(var Z=0;Z<X.length;Z++,$=$.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var Y=$.sqr();Z<X.length;Z++,Y=Y.sqr()){if(X[Z]===0)continue;$=$.mul(Y)}return $},J.prototype.iushln=function(U){T(typeof U==="number"&&U>=0);var X=U%26,$=(U-X)/26,Z=67108863>>>26-X<<26-X,Y;if(X!==0){var E=0;for(Y=0;Y<this.length;Y++){var K=this.words[Y]&Z,A=(this.words[Y]|0)-K<<X;this.words[Y]=A|E,E=K>>>26-X}if(E)this.words[Y]=E,this.length++}if($!==0){for(Y=this.length-1;Y>=0;Y--)this.words[Y+$]=this.words[Y];for(Y=0;Y<$;Y++)this.words[Y]=0;this.length+=$}return this.strip()},J.prototype.ishln=function(U){return T(this.negative===0),this.iushln(U)},J.prototype.iushrn=function(U,X,$){T(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var Y=U%26,E=Math.min((U-Y)/26,this.length),K=67108863^67108863>>>Y<<Y,A=$;if(Z-=E,Z=Math.max(0,Z),A){for(var O=0;O<E;O++)A.words[O]=this.words[O];A.length=E}if(E===0);else if(this.length>E){this.length-=E;for(O=0;O<this.length;O++)this.words[O]=this.words[O+E]}else this.words[0]=0,this.length=1;var V=0;for(O=this.length-1;O>=0&&(V!==0||O>=Z);O--){var D=this.words[O]|0;this.words[O]=V<<26-Y|D>>>Y,V=D&K}if(A&&V!==0)A.words[A.length++]=V;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},J.prototype.ishrn=function(U,X,$){return T(this.negative===0),this.iushrn(U,X,$)},J.prototype.shln=function(U){return this.clone().ishln(U)},J.prototype.ushln=function(U){return this.clone().iushln(U)},J.prototype.shrn=function(U){return this.clone().ishrn(U)},J.prototype.ushrn=function(U){return this.clone().iushrn(U)},J.prototype.testn=function(U){T(typeof U==="number"&&U>=0);var X=U%26,$=(U-X)/26,Z=1<<X;if(this.length<=$)return!1;var Y=this.words[$];return!!(Y&Z)},J.prototype.imaskn=function(U){T(typeof U==="number"&&U>=0);var X=U%26,$=(U-X)/26;if(T(this.negative===0,"imaskn works only with positive numbers"),this.length<=$)return this;if(X!==0)$++;if(this.length=Math.min($,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},J.prototype.maskn=function(U){return this.clone().imaskn(U)},J.prototype.iaddn=function(U){if(T(typeof U==="number"),T(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},J.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},J.prototype.isubn=function(U){if(T(typeof U==="number"),T(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},J.prototype.addn=function(U){return this.clone().iaddn(U)},J.prototype.subn=function(U){return this.clone().isubn(U)},J.prototype.iabs=function(){return this.negative=0,this},J.prototype.abs=function(){return this.clone().iabs()},J.prototype._ishlnsubmul=function(U,X,$){var Z=U.length+$,Y;this._expand(Z);var E,K=0;for(Y=0;Y<U.length;Y++){E=(this.words[Y+$]|0)+K;var A=(U.words[Y]|0)*X;E-=A&67108863,K=(E>>26)-(A/67108864|0),this.words[Y+$]=E&67108863}for(;Y<this.length-$;Y++)E=(this.words[Y+$]|0)+K,K=E>>26,this.words[Y+$]=E&67108863;if(K===0)return this.strip();T(K===-1),K=0;for(Y=0;Y<this.length;Y++)E=-(this.words[Y]|0)+K,K=E>>26,this.words[Y]=E&67108863;return this.negative=1,this.strip()},J.prototype._wordDiv=function(U,X){var $=this.length-U.length,Z=this.clone(),Y=U,E=Y.words[Y.length-1]|0,K=this._countBits(E);if($=26-K,$!==0)Y=Y.ushln($),Z.iushln($),E=Y.words[Y.length-1]|0;var A=Z.length-Y.length,O;if(X!=="mod"){O=new J(null),O.length=A+1,O.words=Array(O.length);for(var V=0;V<O.length;V++)O.words[V]=0}var D=Z.clone()._ishlnsubmul(Y,1,A);if(D.negative===0){if(Z=D,O)O.words[A]=1}for(var S=A-1;S>=0;S--){var _=(Z.words[Y.length+S]|0)*67108864+(Z.words[Y.length+S-1]|0);_=Math.min(_/E|0,67108863),Z._ishlnsubmul(Y,_,S);while(Z.negative!==0)if(_--,Z.negative=0,Z._ishlnsubmul(Y,1,S),!Z.isZero())Z.negative^=1;if(O)O.words[S]=_}if(O)O.strip();if(Z.strip(),X!=="div"&&$!==0)Z.iushrn($);return{div:O||null,mod:Z}},J.prototype.divmod=function(U,X,$){if(T(!U.isZero()),this.isZero())return{div:new J(0),mod:new J(0)};var Z,Y,E;if(this.negative!==0&&U.negative===0){if(E=this.neg().divmod(U,X),X!=="mod")Z=E.div.neg();if(X!=="div"){if(Y=E.mod.neg(),$&&Y.negative!==0)Y.iadd(U)}return{div:Z,mod:Y}}if(this.negative===0&&U.negative!==0){if(E=this.divmod(U.neg(),X),X!=="mod")Z=E.div.neg();return{div:Z,mod:E.mod}}if((this.negative&U.negative)!==0){if(E=this.neg().divmod(U.neg(),X),X!=="div"){if(Y=E.mod.neg(),$&&Y.negative!==0)Y.isub(U)}return{div:E.div,mod:Y}}if(U.length>this.length||this.cmp(U)<0)return{div:new J(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new J(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new J(this.modn(U.words[0]))}}return this._wordDiv(U,X)},J.prototype.div=function(U){return this.divmod(U,"div",!1).div},J.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},J.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},J.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var $=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),Y=U.andln(1),E=$.cmp(Z);if(E<0||Y===1&&E===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},J.prototype.modn=function(U){T(U<=67108863);var X=67108864%U,$=0;for(var Z=this.length-1;Z>=0;Z--)$=(X*$+(this.words[Z]|0))%U;return $},J.prototype.idivn=function(U){T(U<=67108863);var X=0;for(var $=this.length-1;$>=0;$--){var Z=(this.words[$]|0)+X*67108864;this.words[$]=Z/U|0,X=Z%U}return this.strip()},J.prototype.divn=function(U){return this.clone().idivn(U)},J.prototype.egcd=function(U){T(U.negative===0),T(!U.isZero());var X=this,$=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),Y=new J(0),E=new J(0),K=new J(1),A=0;while(X.isEven()&&$.isEven())X.iushrn(1),$.iushrn(1),++A;var O=$.clone(),V=X.clone();while(!X.isZero()){for(var D=0,S=1;(X.words[0]&S)===0&&D<26;++D,S<<=1);if(D>0){X.iushrn(D);while(D-- >0){if(Z.isOdd()||Y.isOdd())Z.iadd(O),Y.isub(V);Z.iushrn(1),Y.iushrn(1)}}for(var _=0,N=1;($.words[0]&N)===0&&_<26;++_,N<<=1);if(_>0){$.iushrn(_);while(_-- >0){if(E.isOdd()||K.isOdd())E.iadd(O),K.isub(V);E.iushrn(1),K.iushrn(1)}}if(X.cmp($)>=0)X.isub($),Z.isub(E),Y.isub(K);else $.isub(X),E.isub(Z),K.isub(Y)}return{a:E,b:K,gcd:$.iushln(A)}},J.prototype._invmp=function(U){T(U.negative===0),T(!U.isZero());var X=this,$=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),Y=new J(0),E=$.clone();while(X.cmpn(1)>0&&$.cmpn(1)>0){for(var K=0,A=1;(X.words[0]&A)===0&&K<26;++K,A<<=1);if(K>0){X.iushrn(K);while(K-- >0){if(Z.isOdd())Z.iadd(E);Z.iushrn(1)}}for(var O=0,V=1;($.words[0]&V)===0&&O<26;++O,V<<=1);if(O>0){$.iushrn(O);while(O-- >0){if(Y.isOdd())Y.iadd(E);Y.iushrn(1)}}if(X.cmp($)>=0)X.isub($),Z.isub(Y);else $.isub(X),Y.isub(Z)}var D;if(X.cmpn(1)===0)D=Z;else D=Y;if(D.cmpn(0)<0)D.iadd(U);return D},J.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),$=U.clone();X.negative=0,$.negative=0;for(var Z=0;X.isEven()&&$.isEven();Z++)X.iushrn(1),$.iushrn(1);do{while(X.isEven())X.iushrn(1);while($.isEven())$.iushrn(1);var Y=X.cmp($);if(Y<0){var E=X;X=$,$=E}else if(Y===0||$.cmpn(1)===0)break;X.isub($)}while(!0);return $.iushln(Z)},J.prototype.invm=function(U){return this.egcd(U).a.umod(U)},J.prototype.isEven=function(){return(this.words[0]&1)===0},J.prototype.isOdd=function(){return(this.words[0]&1)===1},J.prototype.andln=function(U){return this.words[0]&U},J.prototype.bincn=function(U){T(typeof U==="number");var X=U%26,$=(U-X)/26,Z=1<<X;if(this.length<=$)return this._expand($+1),this.words[$]|=Z,this;var Y=Z;for(var E=$;Y!==0&&E<this.length;E++){var K=this.words[E]|0;K+=Y,Y=K>>>26,K&=67108863,this.words[E]=K}if(Y!==0)this.words[E]=Y,this.length++;return this},J.prototype.isZero=function(){return this.length===1&&this.words[0]===0},J.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var $;if(this.length>1)$=1;else{if(X)U=-U;T(U<=67108863,"Number is too big");var Z=this.words[0]|0;$=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-$|0;return $},J.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},J.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var $=this.length-1;$>=0;$--){var Z=this.words[$]|0,Y=U.words[$]|0;if(Z===Y)continue;if(Z<Y)X=-1;else if(Z>Y)X=1;break}return X},J.prototype.gtn=function(U){return this.cmpn(U)===1},J.prototype.gt=function(U){return this.cmp(U)===1},J.prototype.gten=function(U){return this.cmpn(U)>=0},J.prototype.gte=function(U){return this.cmp(U)>=0},J.prototype.ltn=function(U){return this.cmpn(U)===-1},J.prototype.lt=function(U){return this.cmp(U)===-1},J.prototype.lten=function(U){return this.cmpn(U)<=0},J.prototype.lte=function(U){return this.cmp(U)<=0},J.prototype.eqn=function(U){return this.cmpn(U)===0},J.prototype.eq=function(U){return this.cmp(U)===0},J.red=function(U){return new u(U)},J.prototype.toRed=function(U){return T(!this.red,"Already a number in reduction context"),T(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},J.prototype.fromRed=function(){return T(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},J.prototype._forceRed=function(U){return this.red=U,this},J.prototype.forceRed=function(U){return T(!this.red,"Already a number in reduction context"),this._forceRed(U)},J.prototype.redAdd=function(U){return T(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},J.prototype.redIAdd=function(U){return T(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},J.prototype.redSub=function(U){return T(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},J.prototype.redISub=function(U){return T(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},J.prototype.redShl=function(U){return T(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},J.prototype.redMul=function(U){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},J.prototype.redIMul=function(U){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},J.prototype.redSqr=function(){return T(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},J.prototype.redISqr=function(){return T(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},J.prototype.redSqrt=function(){return T(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},J.prototype.redInvm=function(){return T(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},J.prototype.redNeg=function(){return T(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},J.prototype.redPow=function(U){return T(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new J(X,16),this.n=this.p.bitLength(),this.k=new J(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new J(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,$;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),$=X.bitLength();while($>this.n);var Z=$<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}F(d,w),d.prototype.split=function(U,X){var $=4194303,Z=Math.min(U.length,9);for(var Y=0;Y<Z;Y++)X.words[Y]=U.words[Y];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var E=U.words[9];X.words[X.length++]=E&$;for(Y=10;Y<U.length;Y++){var K=U.words[Y]|0;U.words[Y-10]=(K&$)<<4|E>>>22,E=K}if(E>>>=22,U.words[Y-10]=E,E===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var $=0;$<U.length;$++){var Z=U.words[$]|0;X+=Z*977,U.words[$]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}F(Y0,w);function G0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}F(G0,w);function J0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}F(J0,w),J0.prototype.imulK=function(U){var X=0;for(var $=0;$<U.length;$++){var Z=(U.words[$]|0)*19+X,Y=Z&67108863;Z>>>=26,U.words[$]=Y,X=Z}if(X!==0)U.words[U.length++]=X;return U},J._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new G0;else if(U==="p25519")X=new J0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=J._prime(U);this.m=X.p,this.prime=X}else T(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){T(U.negative===0,"red works only with positives"),T(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){T((U.negative|X.negative)===0,"red works only with positives"),T(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var $=U.add(X);if($.cmp(this.m)>=0)$.isub(this.m);return $._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var $=U.iadd(X);if($.cmp(this.m)>=0)$.isub(this.m);return $},u.prototype.sub=function(U,X){this._verify2(U,X);var $=U.sub(X);if($.cmpn(0)<0)$.iadd(this.m);return $._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var $=U.isub(X);if($.cmpn(0)<0)$.iadd(this.m);return $},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(T(X%2===1),X===3){var $=this.m.add(new J(1)).iushrn(2);return this.pow(U,$)}var Z=this.m.subn(1),Y=0;while(!Z.isZero()&&Z.andln(1)===0)Y++,Z.iushrn(1);T(!Z.isZero());var E=new J(1).toRed(this),K=E.redNeg(),A=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new J(2*O*O).toRed(this);while(this.pow(O,A).cmp(K)!==0)O.redIAdd(K);var V=this.pow(O,Z),D=this.pow(U,Z.addn(1).iushrn(1)),S=this.pow(U,Z),_=Y;while(S.cmp(E)!==0){var N=S;for(var p=0;N.cmp(E)!==0;p++)N=N.redSqr();T(p<_);var n=this.pow(V,new J(1).iushln(_-p-1));D=D.redMul(n),V=n.redSqr(),S=S.redMul(V),_=p}return D},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new J(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var $=4,Z=Array(1<<$);Z[0]=new J(1).toRed(this),Z[1]=U;for(var Y=2;Y<Z.length;Y++)Z[Y]=this.mul(Z[Y-1],U);var E=Z[0],K=0,A=0,O=X.bitLength()%26;if(O===0)O=26;for(Y=X.length-1;Y>=0;Y--){var V=X.words[Y];for(var D=O-1;D>=0;D--){var S=V>>D&1;if(E!==Z[0])E=this.sqr(E);if(S===0&&K===0){A=0;continue}if(K<<=1,K|=S,A++,A!==$&&(Y!==0||D!==0))continue;E=this.mul(E,Z[K]),A=0,K=0}O=26}return E},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},J.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new J(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)}F(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var $=U.imul(X),Z=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=$.isub(Z).iushrn(this.shift),E=Y;if(Y.cmp(this.m)>=0)E=Y.isub(this.m);else if(Y.cmpn(0)<0)E=Y.iadd(this.m);return E._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new J(0)._forceRed(this);var $=U.mul(X),Z=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=$.isub(Z).iushrn(this.shift),E=Y;if(Y.cmp(this.m)>=0)E=Y.isub(this.m);else if(Y.cmpn(0)<0)E=Y.iadd(this.m);return E._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof G>"u"||G,Q)}),$Y=$0((Q,G)=>{var I=XX(),L=MU().Buffer;function T(F,J){return L.from(F.toRed(I.mont(J.modulus)).redPow(new I(J.publicExponent)).fromRed().toArray())}G.exports=T}),tG=$0((Q,G)=>{(function(I,L){function T(Z,Y){if(!Z)throw Error(Y||"Assertion failed")}function F(Z,Y){Z.super_=Y;var E=function(){};E.prototype=Y.prototype,Z.prototype=new E,Z.prototype.constructor=Z}function J(Z,Y,E){if(J.isBN(Z))return Z;if(this.negative=0,this.words=null,this.length=0,this.red=null,Z!==null){if(Y==="le"||Y==="be")E=Y,Y=10;this._init(Z||0,Y||10,E||"be")}}if(typeof I==="object")I.exports=J;else L.BN=J;J.BN=J,J.wordSize=26;var M;try{if(typeof window<"u"&&typeof window.Buffer<"u")M=window.Buffer;else M=(LU(),h0(CU)).Buffer}catch(Z){}J.isBN=function(Z){if(Z instanceof J)return!0;return Z!==null&&typeof Z==="object"&&Z.constructor.wordSize===J.wordSize&&Array.isArray(Z.words)},J.max=function(Z,Y){if(Z.cmp(Y)>0)return Z;return Y},J.min=function(Z,Y){if(Z.cmp(Y)<0)return Z;return Y},J.prototype._init=function(Z,Y,E){if(typeof Z==="number")return this._initNumber(Z,Y,E);if(typeof Z==="object")return this._initArray(Z,Y,E);if(Y==="hex")Y=16;T(Y===(Y|0)&&Y>=2&&Y<=36),Z=Z.toString().replace(/\s+/g,"");var K=0;if(Z[0]==="-")K++,this.negative=1;if(K<Z.length){if(Y===16)this._parseHex(Z,K,E);else if(this._parseBase(Z,Y,K),E==="le")this._initArray(this.toArray(),Y,E)}},J.prototype._initNumber=function(Z,Y,E){if(Z<0)this.negative=1,Z=-Z;if(Z<67108864)this.words=[Z&67108863],this.length=1;else if(Z<4503599627370496)this.words=[Z&67108863,Z/67108864&67108863],this.length=2;else T(Z<9007199254740992),this.words=[Z&67108863,Z/67108864&67108863,1],this.length=3;if(E!=="le")return;this._initArray(this.toArray(),Y,E)},J.prototype._initArray=function(Z,Y,E){if(T(typeof Z.length==="number"),Z.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Z.length/3),this.words=Array(this.length);for(var K=0;K<this.length;K++)this.words[K]=0;var A,O,V=0;if(E==="be"){for(K=Z.length-1,A=0;K>=0;K-=3)if(O=Z[K]|Z[K-1]<<8|Z[K-2]<<16,this.words[A]|=O<<V&67108863,this.words[A+1]=O>>>26-V&67108863,V+=24,V>=26)V-=26,A++}else if(E==="le"){for(K=0,A=0;K<Z.length;K+=3)if(O=Z[K]|Z[K+1]<<8|Z[K+2]<<16,this.words[A]|=O<<V&67108863,this.words[A+1]=O>>>26-V&67108863,V+=24,V>=26)V-=26,A++}return this._strip()};function z(Z,Y){var E=Z.charCodeAt(Y);if(E>=48&&E<=57)return E-48;else if(E>=65&&E<=70)return E-55;else if(E>=97&&E<=102)return E-87;else T(!1,"Invalid character in "+Z)}function W(Z,Y,E){var K=z(Z,E);if(E-1>=Y)K|=z(Z,E-1)<<4;return K}J.prototype._parseHex=function(Z,Y,E){this.length=Math.ceil((Z.length-Y)/6),this.words=Array(this.length);for(var K=0;K<this.length;K++)this.words[K]=0;var A=0,O=0,V;if(E==="be")for(K=Z.length-1;K>=Y;K-=2)if(V=W(Z,Y,K)<<A,this.words[O]|=V&67108863,A>=18)A-=18,O+=1,this.words[O]|=V>>>26;else A+=8;else{var D=Z.length-Y;for(K=D%2===0?Y+1:Y;K<Z.length;K+=2)if(V=W(Z,Y,K)<<A,this.words[O]|=V&67108863,A>=18)A-=18,O+=1,this.words[O]|=V>>>26;else A+=8}this._strip()};function H(Z,Y,E,K){var A=0,O=0,V=Math.min(Z.length,E);for(var D=Y;D<V;D++){var S=Z.charCodeAt(D)-48;if(A*=K,S>=49)O=S-49+10;else if(S>=17)O=S-17+10;else O=S;T(S>=0&&O<K,"Invalid character"),A+=O}return A}J.prototype._parseBase=function(Z,Y,E){this.words=[0],this.length=1;for(var K=0,A=1;A<=67108863;A*=Y)K++;K--,A=A/Y|0;var O=Z.length-E,V=O%K,D=Math.min(O,O-V)+E,S=0;for(var _=E;_<D;_+=K)if(S=H(Z,_,_+K,Y),this.imuln(A),this.words[0]+S<67108864)this.words[0]+=S;else this._iaddn(S);if(V!==0){var N=1;S=H(Z,_,Z.length,Y);for(_=0;_<V;_++)N*=Y;if(this.imuln(N),this.words[0]+S<67108864)this.words[0]+=S;else this._iaddn(S)}this._strip()},J.prototype.copy=function(Z){Z.words=Array(this.length);for(var Y=0;Y<this.length;Y++)Z.words[Y]=this.words[Y];Z.length=this.length,Z.negative=this.negative,Z.red=this.red};function C(Z,Y){Z.words=Y.words,Z.length=Y.length,Z.negative=Y.negative,Z.red=Y.red}if(J.prototype._move=function(Z){C(Z,this)},J.prototype.clone=function(){var Z=new J(null);return this.copy(Z),Z},J.prototype._expand=function(Z){while(this.length<Z)this.words[this.length++]=0;return this},J.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},J.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{J.prototype[Symbol.for("nodejs.util.inspect.custom")]=R}catch(Z){J.prototype.inspect=R}else J.prototype.inspect=R;function R(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var q=["","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"],P=[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],j=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(J.prototype.toString=function(Z,Y){Z=Z||10,Y=Y|0||1;var E;if(Z===16||Z==="hex"){E="";var K=0,A=0;for(var O=0;O<this.length;O++){var V=this.words[O],D=((V<<K|A)&16777215).toString(16);if(A=V>>>24-K&16777215,K+=2,K>=26)K-=26,O--;if(A!==0||O!==this.length-1)E=q[6-D.length]+D+E;else E=D+E}if(A!==0)E=A.toString(16)+E;while(E.length%Y!==0)E="0"+E;if(this.negative!==0)E="-"+E;return E}if(Z===(Z|0)&&Z>=2&&Z<=36){var S=P[Z],_=j[Z];E="";var N=this.clone();N.negative=0;while(!N.isZero()){var p=N.modrn(_).toString(Z);if(N=N.idivn(_),!N.isZero())E=q[S-p.length]+p+E;else E=p+E}if(this.isZero())E="0"+E;while(E.length%Y!==0)E="0"+E;if(this.negative!==0)E="-"+E;return E}T(!1,"Base should be between 2 and 36")},J.prototype.toNumber=function(){var Z=this.words[0];if(this.length===2)Z+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Z+=4503599627370496+this.words[1]*67108864;else if(this.length>2)T(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Z:Z},J.prototype.toJSON=function(){return this.toString(16,2)},M)J.prototype.toBuffer=function(Z,Y){return this.toArrayLike(M,Z,Y)};J.prototype.toArray=function(Z,Y){return this.toArrayLike(Array,Z,Y)};var k=function(Z,Y){if(Z.allocUnsafe)return Z.allocUnsafe(Y);return new Z(Y)};if(J.prototype.toArrayLike=function(Z,Y,E){this._strip();var K=this.byteLength(),A=E||Math.max(1,K);T(K<=A,"byte array longer than desired length"),T(A>0,"Requested array length <= 0");var O=k(Z,A),V=Y==="le"?"LE":"BE";return this["_toArrayLike"+V](O,K),O},J.prototype._toArrayLikeLE=function(Z,Y){var E=0,K=0;for(var A=0,O=0;A<this.length;A++){var V=this.words[A]<<O|K;if(Z[E++]=V&255,E<Z.length)Z[E++]=V>>8&255;if(E<Z.length)Z[E++]=V>>16&255;if(O===6){if(E<Z.length)Z[E++]=V>>24&255;K=0,O=0}else K=V>>>24,O+=2}if(E<Z.length){Z[E++]=K;while(E<Z.length)Z[E++]=0}},J.prototype._toArrayLikeBE=function(Z,Y){var E=Z.length-1,K=0;for(var A=0,O=0;A<this.length;A++){var V=this.words[A]<<O|K;if(Z[E--]=V&255,E>=0)Z[E--]=V>>8&255;if(E>=0)Z[E--]=V>>16&255;if(O===6){if(E>=0)Z[E--]=V>>24&255;K=0,O=0}else K=V>>>24,O+=2}if(E>=0){Z[E--]=K;while(E>=0)Z[E--]=0}},Math.clz32)J.prototype._countBits=function(Z){return 32-Math.clz32(Z)};else J.prototype._countBits=function(Z){var Y=Z,E=0;if(Y>=4096)E+=13,Y>>>=13;if(Y>=64)E+=7,Y>>>=7;if(Y>=8)E+=4,Y>>>=4;if(Y>=2)E+=2,Y>>>=2;return E+Y};J.prototype._zeroBits=function(Z){if(Z===0)return 26;var Y=Z,E=0;if((Y&8191)===0)E+=13,Y>>>=13;if((Y&127)===0)E+=7,Y>>>=7;if((Y&15)===0)E+=4,Y>>>=4;if((Y&3)===0)E+=2,Y>>>=2;if((Y&1)===0)E++;return E},J.prototype.bitLength=function(){var Z=this.words[this.length-1],Y=this._countBits(Z);return(this.length-1)*26+Y};function B(Z){var Y=Array(Z.bitLength());for(var E=0;E<Y.length;E++){var K=E/26|0,A=E%26;Y[E]=Z.words[K]>>>A&1}return Y}J.prototype.zeroBits=function(){if(this.isZero())return 0;var Z=0;for(var Y=0;Y<this.length;Y++){var E=this._zeroBits(this.words[Y]);if(Z+=E,E!==26)break}return Z},J.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},J.prototype.toTwos=function(Z){if(this.negative!==0)return this.abs().inotn(Z).iaddn(1);return this.clone()},J.prototype.fromTwos=function(Z){if(this.testn(Z-1))return this.notn(Z).iaddn(1).ineg();return this.clone()},J.prototype.isNeg=function(){return this.negative!==0},J.prototype.neg=function(){return this.clone().ineg()},J.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},J.prototype.iuor=function(Z){while(this.length<Z.length)this.words[this.length++]=0;for(var Y=0;Y<Z.length;Y++)this.words[Y]=this.words[Y]|Z.words[Y];return this._strip()},J.prototype.ior=function(Z){return T((this.negative|Z.negative)===0),this.iuor(Z)},J.prototype.or=function(Z){if(this.length>Z.length)return this.clone().ior(Z);return Z.clone().ior(this)},J.prototype.uor=function(Z){if(this.length>Z.length)return this.clone().iuor(Z);return Z.clone().iuor(this)},J.prototype.iuand=function(Z){var Y;if(this.length>Z.length)Y=Z;else Y=this;for(var E=0;E<Y.length;E++)this.words[E]=this.words[E]&Z.words[E];return this.length=Y.length,this._strip()},J.prototype.iand=function(Z){return T((this.negative|Z.negative)===0),this.iuand(Z)},J.prototype.and=function(Z){if(this.length>Z.length)return this.clone().iand(Z);return Z.clone().iand(this)},J.prototype.uand=function(Z){if(this.length>Z.length)return this.clone().iuand(Z);return Z.clone().iuand(this)},J.prototype.iuxor=function(Z){var Y,E;if(this.length>Z.length)Y=this,E=Z;else Y=Z,E=this;for(var K=0;K<E.length;K++)this.words[K]=Y.words[K]^E.words[K];if(this!==Y)for(;K<Y.length;K++)this.words[K]=Y.words[K];return this.length=Y.length,this._strip()},J.prototype.ixor=function(Z){return T((this.negative|Z.negative)===0),this.iuxor(Z)},J.prototype.xor=function(Z){if(this.length>Z.length)return this.clone().ixor(Z);return Z.clone().ixor(this)},J.prototype.uxor=function(Z){if(this.length>Z.length)return this.clone().iuxor(Z);return Z.clone().iuxor(this)},J.prototype.inotn=function(Z){T(typeof Z==="number"&&Z>=0);var Y=Math.ceil(Z/26)|0,E=Z%26;if(this._expand(Y),E>0)Y--;for(var K=0;K<Y;K++)this.words[K]=~this.words[K]&67108863;if(E>0)this.words[K]=~this.words[K]&67108863>>26-E;return this._strip()},J.prototype.notn=function(Z){return this.clone().inotn(Z)},J.prototype.setn=function(Z,Y){T(typeof Z==="number"&&Z>=0);var E=Z/26|0,K=Z%26;if(this._expand(E+1),Y)this.words[E]=this.words[E]|1<<K;else this.words[E]=this.words[E]&~(1<<K);return this._strip()},J.prototype.iadd=function(Z){var Y;if(this.negative!==0&&Z.negative===0)return this.negative=0,Y=this.isub(Z),this.negative^=1,this._normSign();else if(this.negative===0&&Z.negative!==0)return Z.negative=0,Y=this.isub(Z),Z.negative=1,Y._normSign();var E,K;if(this.length>Z.length)E=this,K=Z;else E=Z,K=this;var A=0;for(var O=0;O<K.length;O++)Y=(E.words[O]|0)+(K.words[O]|0)+A,this.words[O]=Y&67108863,A=Y>>>26;for(;A!==0&&O<E.length;O++)Y=(E.words[O]|0)+A,this.words[O]=Y&67108863,A=Y>>>26;if(this.length=E.length,A!==0)this.words[this.length]=A,this.length++;else if(E!==this)for(;O<E.length;O++)this.words[O]=E.words[O];return this},J.prototype.add=function(Z){var Y;if(Z.negative!==0&&this.negative===0)return Z.negative=0,Y=this.sub(Z),Z.negative^=1,Y;else if(Z.negative===0&&this.negative!==0)return this.negative=0,Y=Z.sub(this),this.negative=1,Y;if(this.length>Z.length)return this.clone().iadd(Z);return Z.clone().iadd(this)},J.prototype.isub=function(Z){if(Z.negative!==0){Z.negative=0;var Y=this.iadd(Z);return Z.negative=1,Y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Z),this.negative=1,this._normSign();var E=this.cmp(Z);if(E===0)return this.negative=0,this.length=1,this.words[0]=0,this;var K,A;if(E>0)K=this,A=Z;else K=Z,A=this;var O=0;for(var V=0;V<A.length;V++)Y=(K.words[V]|0)-(A.words[V]|0)+O,O=Y>>26,this.words[V]=Y&67108863;for(;O!==0&&V<K.length;V++)Y=(K.words[V]|0)+O,O=Y>>26,this.words[V]=Y&67108863;if(O===0&&V<K.length&&K!==this)for(;V<K.length;V++)this.words[V]=K.words[V];if(this.length=Math.max(this.length,V),K!==this)this.negative=1;return this._strip()},J.prototype.sub=function(Z){return this.clone().isub(Z)};function v(Z,Y,E){E.negative=Y.negative^Z.negative;var K=Z.length+Y.length|0;E.length=K,K=K-1|0;var A=Z.words[0]|0,O=Y.words[0]|0,V=A*O,D=V&67108863,S=V/67108864|0;E.words[0]=D;for(var _=1;_<K;_++){var N=S>>>26,p=S&67108863,n=Math.min(_,Y.length-1);for(var V0=Math.max(0,_-Z.length+1);V0<=n;V0++){var r=_-V0|0;A=Z.words[r]|0,O=Y.words[V0]|0,V=A*O+p,N+=V/67108864|0,p=V&67108863}E.words[_]=p|0,S=N|0}if(S!==0)E.words[_]=S|0;else E.length--;return E._strip()}var g=function(Z,Y,E){var K=Z.words,A=Y.words,O=E.words,V=0,D,S,_,N=K[0]|0,p=N&8191,n=N>>>13,V0=K[1]|0,r=V0&8191,b=V0>>>13,X0=K[2]|0,t=X0&8191,i=X0>>>13,N0=K[3]|0,y=N0&8191,h=N0>>>13,Q0=K[4]|0,s=Q0&8191,a=Q0>>>13,H0=K[5]|0,c=H0&8191,o=H0>>>13,x0=K[6]|0,m=x0&8191,Z0=x0>>>13,w0=K[7]|0,K0=w0&8191,T0=w0>>>13,t0=K[8]|0,I0=t0&8191,C0=t0>>>13,r0=K[9]|0,R0=r0&8191,S0=r0>>>13,WU=A[0]|0,F0=WU&8191,k0=WU>>>13,HU=A[1]|0,j0=HU&8191,D0=HU>>>13,SU=A[2]|0,_0=SU&8191,M0=SU>>>13,EU=A[3]|0,v0=EU&8191,B0=EU>>>13,KU=A[4]|0,z0=KU&8191,x=KU>>>13,l=A[5]|0,e=l&8191,U0=l>>>13,f0=A[6]|0,E0=f0&8191,L0=f0>>>13,m0=A[7]|0,q0=m0&8191,g0=m0>>>13,RU=A[8]|0,P0=RU&8191,W0=RU>>>13,s0=A[9]|0,c0=s0&8191,y0=s0>>>13;E.negative=Z.negative^Y.negative,E.length=19,D=Math.imul(p,F0),S=Math.imul(p,k0),S=S+Math.imul(n,F0)|0,_=Math.imul(n,k0);var b0=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(b0>>>26)|0,b0&=67108863,D=Math.imul(r,F0),S=Math.imul(r,k0),S=S+Math.imul(b,F0)|0,_=Math.imul(b,k0),D=D+Math.imul(p,j0)|0,S=S+Math.imul(p,D0)|0,S=S+Math.imul(n,j0)|0,_=_+Math.imul(n,D0)|0;var l0=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(l0>>>26)|0,l0&=67108863,D=Math.imul(t,F0),S=Math.imul(t,k0),S=S+Math.imul(i,F0)|0,_=Math.imul(i,k0),D=D+Math.imul(r,j0)|0,S=S+Math.imul(r,D0)|0,S=S+Math.imul(b,j0)|0,_=_+Math.imul(b,D0)|0,D=D+Math.imul(p,_0)|0,S=S+Math.imul(p,M0)|0,S=S+Math.imul(n,_0)|0,_=_+Math.imul(n,M0)|0;var e0=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(e0>>>26)|0,e0&=67108863,D=Math.imul(y,F0),S=Math.imul(y,k0),S=S+Math.imul(h,F0)|0,_=Math.imul(h,k0),D=D+Math.imul(t,j0)|0,S=S+Math.imul(t,D0)|0,S=S+Math.imul(i,j0)|0,_=_+Math.imul(i,D0)|0,D=D+Math.imul(r,_0)|0,S=S+Math.imul(r,M0)|0,S=S+Math.imul(b,_0)|0,_=_+Math.imul(b,M0)|0,D=D+Math.imul(p,v0)|0,S=S+Math.imul(p,B0)|0,S=S+Math.imul(n,v0)|0,_=_+Math.imul(n,B0)|0;var a0=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(a0>>>26)|0,a0&=67108863,D=Math.imul(s,F0),S=Math.imul(s,k0),S=S+Math.imul(a,F0)|0,_=Math.imul(a,k0),D=D+Math.imul(y,j0)|0,S=S+Math.imul(y,D0)|0,S=S+Math.imul(h,j0)|0,_=_+Math.imul(h,D0)|0,D=D+Math.imul(t,_0)|0,S=S+Math.imul(t,M0)|0,S=S+Math.imul(i,_0)|0,_=_+Math.imul(i,M0)|0,D=D+Math.imul(r,v0)|0,S=S+Math.imul(r,B0)|0,S=S+Math.imul(b,v0)|0,_=_+Math.imul(b,B0)|0,D=D+Math.imul(p,z0)|0,S=S+Math.imul(p,x)|0,S=S+Math.imul(n,z0)|0,_=_+Math.imul(n,x)|0;var i0=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(i0>>>26)|0,i0&=67108863,D=Math.imul(c,F0),S=Math.imul(c,k0),S=S+Math.imul(o,F0)|0,_=Math.imul(o,k0),D=D+Math.imul(s,j0)|0,S=S+Math.imul(s,D0)|0,S=S+Math.imul(a,j0)|0,_=_+Math.imul(a,D0)|0,D=D+Math.imul(y,_0)|0,S=S+Math.imul(y,M0)|0,S=S+Math.imul(h,_0)|0,_=_+Math.imul(h,M0)|0,D=D+Math.imul(t,v0)|0,S=S+Math.imul(t,B0)|0,S=S+Math.imul(i,v0)|0,_=_+Math.imul(i,B0)|0,D=D+Math.imul(r,z0)|0,S=S+Math.imul(r,x)|0,S=S+Math.imul(b,z0)|0,_=_+Math.imul(b,x)|0,D=D+Math.imul(p,e)|0,S=S+Math.imul(p,U0)|0,S=S+Math.imul(n,e)|0,_=_+Math.imul(n,U0)|0;var UU=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(UU>>>26)|0,UU&=67108863,D=Math.imul(m,F0),S=Math.imul(m,k0),S=S+Math.imul(Z0,F0)|0,_=Math.imul(Z0,k0),D=D+Math.imul(c,j0)|0,S=S+Math.imul(c,D0)|0,S=S+Math.imul(o,j0)|0,_=_+Math.imul(o,D0)|0,D=D+Math.imul(s,_0)|0,S=S+Math.imul(s,M0)|0,S=S+Math.imul(a,_0)|0,_=_+Math.imul(a,M0)|0,D=D+Math.imul(y,v0)|0,S=S+Math.imul(y,B0)|0,S=S+Math.imul(h,v0)|0,_=_+Math.imul(h,B0)|0,D=D+Math.imul(t,z0)|0,S=S+Math.imul(t,x)|0,S=S+Math.imul(i,z0)|0,_=_+Math.imul(i,x)|0,D=D+Math.imul(r,e)|0,S=S+Math.imul(r,U0)|0,S=S+Math.imul(b,e)|0,_=_+Math.imul(b,U0)|0,D=D+Math.imul(p,E0)|0,S=S+Math.imul(p,L0)|0,S=S+Math.imul(n,E0)|0,_=_+Math.imul(n,L0)|0;var OU=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(OU>>>26)|0,OU&=67108863,D=Math.imul(K0,F0),S=Math.imul(K0,k0),S=S+Math.imul(T0,F0)|0,_=Math.imul(T0,k0),D=D+Math.imul(m,j0)|0,S=S+Math.imul(m,D0)|0,S=S+Math.imul(Z0,j0)|0,_=_+Math.imul(Z0,D0)|0,D=D+Math.imul(c,_0)|0,S=S+Math.imul(c,M0)|0,S=S+Math.imul(o,_0)|0,_=_+Math.imul(o,M0)|0,D=D+Math.imul(s,v0)|0,S=S+Math.imul(s,B0)|0,S=S+Math.imul(a,v0)|0,_=_+Math.imul(a,B0)|0,D=D+Math.imul(y,z0)|0,S=S+Math.imul(y,x)|0,S=S+Math.imul(h,z0)|0,_=_+Math.imul(h,x)|0,D=D+Math.imul(t,e)|0,S=S+Math.imul(t,U0)|0,S=S+Math.imul(i,e)|0,_=_+Math.imul(i,U0)|0,D=D+Math.imul(r,E0)|0,S=S+Math.imul(r,L0)|0,S=S+Math.imul(b,E0)|0,_=_+Math.imul(b,L0)|0,D=D+Math.imul(p,q0)|0,S=S+Math.imul(p,g0)|0,S=S+Math.imul(n,q0)|0,_=_+Math.imul(n,g0)|0;var ZU=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,D=Math.imul(I0,F0),S=Math.imul(I0,k0),S=S+Math.imul(C0,F0)|0,_=Math.imul(C0,k0),D=D+Math.imul(K0,j0)|0,S=S+Math.imul(K0,D0)|0,S=S+Math.imul(T0,j0)|0,_=_+Math.imul(T0,D0)|0,D=D+Math.imul(m,_0)|0,S=S+Math.imul(m,M0)|0,S=S+Math.imul(Z0,_0)|0,_=_+Math.imul(Z0,M0)|0,D=D+Math.imul(c,v0)|0,S=S+Math.imul(c,B0)|0,S=S+Math.imul(o,v0)|0,_=_+Math.imul(o,B0)|0,D=D+Math.imul(s,z0)|0,S=S+Math.imul(s,x)|0,S=S+Math.imul(a,z0)|0,_=_+Math.imul(a,x)|0,D=D+Math.imul(y,e)|0,S=S+Math.imul(y,U0)|0,S=S+Math.imul(h,e)|0,_=_+Math.imul(h,U0)|0,D=D+Math.imul(t,E0)|0,S=S+Math.imul(t,L0)|0,S=S+Math.imul(i,E0)|0,_=_+Math.imul(i,L0)|0,D=D+Math.imul(r,q0)|0,S=S+Math.imul(r,g0)|0,S=S+Math.imul(b,q0)|0,_=_+Math.imul(b,g0)|0,D=D+Math.imul(p,P0)|0,S=S+Math.imul(p,W0)|0,S=S+Math.imul(n,P0)|0,_=_+Math.imul(n,W0)|0;var XU=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(XU>>>26)|0,XU&=67108863,D=Math.imul(R0,F0),S=Math.imul(R0,k0),S=S+Math.imul(S0,F0)|0,_=Math.imul(S0,k0),D=D+Math.imul(I0,j0)|0,S=S+Math.imul(I0,D0)|0,S=S+Math.imul(C0,j0)|0,_=_+Math.imul(C0,D0)|0,D=D+Math.imul(K0,_0)|0,S=S+Math.imul(K0,M0)|0,S=S+Math.imul(T0,_0)|0,_=_+Math.imul(T0,M0)|0,D=D+Math.imul(m,v0)|0,S=S+Math.imul(m,B0)|0,S=S+Math.imul(Z0,v0)|0,_=_+Math.imul(Z0,B0)|0,D=D+Math.imul(c,z0)|0,S=S+Math.imul(c,x)|0,S=S+Math.imul(o,z0)|0,_=_+Math.imul(o,x)|0,D=D+Math.imul(s,e)|0,S=S+Math.imul(s,U0)|0,S=S+Math.imul(a,e)|0,_=_+Math.imul(a,U0)|0,D=D+Math.imul(y,E0)|0,S=S+Math.imul(y,L0)|0,S=S+Math.imul(h,E0)|0,_=_+Math.imul(h,L0)|0,D=D+Math.imul(t,q0)|0,S=S+Math.imul(t,g0)|0,S=S+Math.imul(i,q0)|0,_=_+Math.imul(i,g0)|0,D=D+Math.imul(r,P0)|0,S=S+Math.imul(r,W0)|0,S=S+Math.imul(b,P0)|0,_=_+Math.imul(b,W0)|0,D=D+Math.imul(p,c0)|0,S=S+Math.imul(p,y0)|0,S=S+Math.imul(n,c0)|0,_=_+Math.imul(n,y0)|0;var QU=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(QU>>>26)|0,QU&=67108863,D=Math.imul(R0,j0),S=Math.imul(R0,D0),S=S+Math.imul(S0,j0)|0,_=Math.imul(S0,D0),D=D+Math.imul(I0,_0)|0,S=S+Math.imul(I0,M0)|0,S=S+Math.imul(C0,_0)|0,_=_+Math.imul(C0,M0)|0,D=D+Math.imul(K0,v0)|0,S=S+Math.imul(K0,B0)|0,S=S+Math.imul(T0,v0)|0,_=_+Math.imul(T0,B0)|0,D=D+Math.imul(m,z0)|0,S=S+Math.imul(m,x)|0,S=S+Math.imul(Z0,z0)|0,_=_+Math.imul(Z0,x)|0,D=D+Math.imul(c,e)|0,S=S+Math.imul(c,U0)|0,S=S+Math.imul(o,e)|0,_=_+Math.imul(o,U0)|0,D=D+Math.imul(s,E0)|0,S=S+Math.imul(s,L0)|0,S=S+Math.imul(a,E0)|0,_=_+Math.imul(a,L0)|0,D=D+Math.imul(y,q0)|0,S=S+Math.imul(y,g0)|0,S=S+Math.imul(h,q0)|0,_=_+Math.imul(h,g0)|0,D=D+Math.imul(t,P0)|0,S=S+Math.imul(t,W0)|0,S=S+Math.imul(i,P0)|0,_=_+Math.imul(i,W0)|0,D=D+Math.imul(r,c0)|0,S=S+Math.imul(r,y0)|0,S=S+Math.imul(b,c0)|0,_=_+Math.imul(b,y0)|0;var YU=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(YU>>>26)|0,YU&=67108863,D=Math.imul(R0,_0),S=Math.imul(R0,M0),S=S+Math.imul(S0,_0)|0,_=Math.imul(S0,M0),D=D+Math.imul(I0,v0)|0,S=S+Math.imul(I0,B0)|0,S=S+Math.imul(C0,v0)|0,_=_+Math.imul(C0,B0)|0,D=D+Math.imul(K0,z0)|0,S=S+Math.imul(K0,x)|0,S=S+Math.imul(T0,z0)|0,_=_+Math.imul(T0,x)|0,D=D+Math.imul(m,e)|0,S=S+Math.imul(m,U0)|0,S=S+Math.imul(Z0,e)|0,_=_+Math.imul(Z0,U0)|0,D=D+Math.imul(c,E0)|0,S=S+Math.imul(c,L0)|0,S=S+Math.imul(o,E0)|0,_=_+Math.imul(o,L0)|0,D=D+Math.imul(s,q0)|0,S=S+Math.imul(s,g0)|0,S=S+Math.imul(a,q0)|0,_=_+Math.imul(a,g0)|0,D=D+Math.imul(y,P0)|0,S=S+Math.imul(y,W0)|0,S=S+Math.imul(h,P0)|0,_=_+Math.imul(h,W0)|0,D=D+Math.imul(t,c0)|0,S=S+Math.imul(t,y0)|0,S=S+Math.imul(i,c0)|0,_=_+Math.imul(i,y0)|0;var JU=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(JU>>>26)|0,JU&=67108863,D=Math.imul(R0,v0),S=Math.imul(R0,B0),S=S+Math.imul(S0,v0)|0,_=Math.imul(S0,B0),D=D+Math.imul(I0,z0)|0,S=S+Math.imul(I0,x)|0,S=S+Math.imul(C0,z0)|0,_=_+Math.imul(C0,x)|0,D=D+Math.imul(K0,e)|0,S=S+Math.imul(K0,U0)|0,S=S+Math.imul(T0,e)|0,_=_+Math.imul(T0,U0)|0,D=D+Math.imul(m,E0)|0,S=S+Math.imul(m,L0)|0,S=S+Math.imul(Z0,E0)|0,_=_+Math.imul(Z0,L0)|0,D=D+Math.imul(c,q0)|0,S=S+Math.imul(c,g0)|0,S=S+Math.imul(o,q0)|0,_=_+Math.imul(o,g0)|0,D=D+Math.imul(s,P0)|0,S=S+Math.imul(s,W0)|0,S=S+Math.imul(a,P0)|0,_=_+Math.imul(a,W0)|0,D=D+Math.imul(y,c0)|0,S=S+Math.imul(y,y0)|0,S=S+Math.imul(h,c0)|0,_=_+Math.imul(h,y0)|0;var $U=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+($U>>>26)|0,$U&=67108863,D=Math.imul(R0,z0),S=Math.imul(R0,x),S=S+Math.imul(S0,z0)|0,_=Math.imul(S0,x),D=D+Math.imul(I0,e)|0,S=S+Math.imul(I0,U0)|0,S=S+Math.imul(C0,e)|0,_=_+Math.imul(C0,U0)|0,D=D+Math.imul(K0,E0)|0,S=S+Math.imul(K0,L0)|0,S=S+Math.imul(T0,E0)|0,_=_+Math.imul(T0,L0)|0,D=D+Math.imul(m,q0)|0,S=S+Math.imul(m,g0)|0,S=S+Math.imul(Z0,q0)|0,_=_+Math.imul(Z0,g0)|0,D=D+Math.imul(c,P0)|0,S=S+Math.imul(c,W0)|0,S=S+Math.imul(o,P0)|0,_=_+Math.imul(o,W0)|0,D=D+Math.imul(s,c0)|0,S=S+Math.imul(s,y0)|0,S=S+Math.imul(a,c0)|0,_=_+Math.imul(a,y0)|0;var GU=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(GU>>>26)|0,GU&=67108863,D=Math.imul(R0,e),S=Math.imul(R0,U0),S=S+Math.imul(S0,e)|0,_=Math.imul(S0,U0),D=D+Math.imul(I0,E0)|0,S=S+Math.imul(I0,L0)|0,S=S+Math.imul(C0,E0)|0,_=_+Math.imul(C0,L0)|0,D=D+Math.imul(K0,q0)|0,S=S+Math.imul(K0,g0)|0,S=S+Math.imul(T0,q0)|0,_=_+Math.imul(T0,g0)|0,D=D+Math.imul(m,P0)|0,S=S+Math.imul(m,W0)|0,S=S+Math.imul(Z0,P0)|0,_=_+Math.imul(Z0,W0)|0,D=D+Math.imul(c,c0)|0,S=S+Math.imul(c,y0)|0,S=S+Math.imul(o,c0)|0,_=_+Math.imul(o,y0)|0;var AU=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(AU>>>26)|0,AU&=67108863,D=Math.imul(R0,E0),S=Math.imul(R0,L0),S=S+Math.imul(S0,E0)|0,_=Math.imul(S0,L0),D=D+Math.imul(I0,q0)|0,S=S+Math.imul(I0,g0)|0,S=S+Math.imul(C0,q0)|0,_=_+Math.imul(C0,g0)|0,D=D+Math.imul(K0,P0)|0,S=S+Math.imul(K0,W0)|0,S=S+Math.imul(T0,P0)|0,_=_+Math.imul(T0,W0)|0,D=D+Math.imul(m,c0)|0,S=S+Math.imul(m,y0)|0,S=S+Math.imul(Z0,c0)|0,_=_+Math.imul(Z0,y0)|0;var VU=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(VU>>>26)|0,VU&=67108863,D=Math.imul(R0,q0),S=Math.imul(R0,g0),S=S+Math.imul(S0,q0)|0,_=Math.imul(S0,g0),D=D+Math.imul(I0,P0)|0,S=S+Math.imul(I0,W0)|0,S=S+Math.imul(C0,P0)|0,_=_+Math.imul(C0,W0)|0,D=D+Math.imul(K0,c0)|0,S=S+Math.imul(K0,y0)|0,S=S+Math.imul(T0,c0)|0,_=_+Math.imul(T0,y0)|0;var GZ=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(GZ>>>26)|0,GZ&=67108863,D=Math.imul(R0,P0),S=Math.imul(R0,W0),S=S+Math.imul(S0,P0)|0,_=Math.imul(S0,W0),D=D+Math.imul(I0,c0)|0,S=S+Math.imul(I0,y0)|0,S=S+Math.imul(C0,c0)|0,_=_+Math.imul(C0,y0)|0;var AZ=(V+D|0)+((S&8191)<<13)|0;V=(_+(S>>>13)|0)+(AZ>>>26)|0,AZ&=67108863,D=Math.imul(R0,c0),S=Math.imul(R0,y0),S=S+Math.imul(S0,c0)|0,_=Math.imul(S0,y0);var VZ=(V+D|0)+((S&8191)<<13)|0;if(V=(_+(S>>>13)|0)+(VZ>>>26)|0,VZ&=67108863,O[0]=b0,O[1]=l0,O[2]=e0,O[3]=a0,O[4]=i0,O[5]=UU,O[6]=OU,O[7]=ZU,O[8]=XU,O[9]=QU,O[10]=YU,O[11]=JU,O[12]=$U,O[13]=GU,O[14]=AU,O[15]=VU,O[16]=GZ,O[17]=AZ,O[18]=VZ,V!==0)O[19]=V,E.length++;return E};if(!Math.imul)g=v;function f(Z,Y,E){E.negative=Y.negative^Z.negative,E.length=Z.length+Y.length;var K=0,A=0;for(var O=0;O<E.length-1;O++){var V=A;A=0;var D=K&67108863,S=Math.min(O,Y.length-1);for(var _=Math.max(0,O-Z.length+1);_<=S;_++){var N=O-_,p=Z.words[N]|0,n=Y.words[_]|0,V0=p*n,r=V0&67108863;V=V+(V0/67108864|0)|0,r=r+D|0,D=r&67108863,V=V+(r>>>26)|0,A+=V>>>26,V&=67108863}E.words[O]=D,K=V,V=A}if(K!==0)E.words[O]=K;else E.length--;return E._strip()}function w(Z,Y,E){return f(Z,Y,E)}J.prototype.mulTo=function(Z,Y){var E,K=this.length+Z.length;if(this.length===10&&Z.length===10)E=g(this,Z,Y);else if(K<63)E=v(this,Z,Y);else if(K<1024)E=f(this,Z,Y);else E=w(this,Z,Y);return E};function d(Z,Y){this.x=Z,this.y=Y}d.prototype.makeRBT=function(Z){var Y=Array(Z),E=J.prototype._countBits(Z)-1;for(var K=0;K<Z;K++)Y[K]=this.revBin(K,E,Z);return Y},d.prototype.revBin=function(Z,Y,E){if(Z===0||Z===E-1)return Z;var K=0;for(var A=0;A<Y;A++)K|=(Z&1)<<Y-A-1,Z>>=1;return K},d.prototype.permute=function(Z,Y,E,K,A,O){for(var V=0;V<O;V++)K[V]=Y[Z[V]],A[V]=E[Z[V]]},d.prototype.transform=function(Z,Y,E,K,A,O){this.permute(O,Z,Y,E,K,A);for(var V=1;V<A;V<<=1){var D=V<<1,S=Math.cos(2*Math.PI/D),_=Math.sin(2*Math.PI/D);for(var N=0;N<A;N+=D){var p=S,n=_;for(var V0=0;V0<V;V0++){var r=E[N+V0],b=K[N+V0],X0=E[N+V0+V],t=K[N+V0+V],i=p*X0-n*t;if(t=p*t+n*X0,X0=i,E[N+V0]=r+X0,K[N+V0]=b+t,E[N+V0+V]=r-X0,K[N+V0+V]=b-t,V0!==D)i=S*p-_*n,n=S*n+_*p,p=i}}}},d.prototype.guessLen13b=function(Z,Y){var E=Math.max(Y,Z)|1,K=E&1,A=0;for(E=E/2|0;E;E=E>>>1)A++;return 1<<A+1+K},d.prototype.conjugate=function(Z,Y,E){if(E<=1)return;for(var K=0;K<E/2;K++){var A=Z[K];Z[K]=Z[E-K-1],Z[E-K-1]=A,A=Y[K],Y[K]=-Y[E-K-1],Y[E-K-1]=-A}},d.prototype.normalize13b=function(Z,Y){var E=0;for(var K=0;K<Y/2;K++){var A=Math.round(Z[2*K+1]/Y)*8192+Math.round(Z[2*K]/Y)+E;if(Z[K]=A&67108863,A<67108864)E=0;else E=A/67108864|0}return Z},d.prototype.convert13b=function(Z,Y,E,K){var A=0;for(var O=0;O<Y;O++)A=A+(Z[O]|0),E[2*O]=A&8191,A=A>>>13,E[2*O+1]=A&8191,A=A>>>13;for(O=2*Y;O<K;++O)E[O]=0;T(A===0),T((A&-8192)===0)},d.prototype.stub=function(Z){var Y=Array(Z);for(var E=0;E<Z;E++)Y[E]=0;return Y},d.prototype.mulp=function(Z,Y,E){var K=2*this.guessLen13b(Z.length,Y.length),A=this.makeRBT(K),O=this.stub(K),V=Array(K),D=Array(K),S=Array(K),_=Array(K),N=Array(K),p=Array(K),n=E.words;n.length=K,this.convert13b(Z.words,Z.length,V,K),this.convert13b(Y.words,Y.length,_,K),this.transform(V,O,D,S,K,A),this.transform(_,O,N,p,K,A);for(var V0=0;V0<K;V0++){var r=D[V0]*N[V0]-S[V0]*p[V0];S[V0]=D[V0]*p[V0]+S[V0]*N[V0],D[V0]=r}return this.conjugate(D,S,K),this.transform(D,S,n,O,K,A),this.conjugate(n,O,K),this.normalize13b(n,K),E.negative=Z.negative^Y.negative,E.length=Z.length+Y.length,E._strip()},J.prototype.mul=function(Z){var Y=new J(null);return Y.words=Array(this.length+Z.length),this.mulTo(Z,Y)},J.prototype.mulf=function(Z){var Y=new J(null);return Y.words=Array(this.length+Z.length),w(this,Z,Y)},J.prototype.imul=function(Z){return this.clone().mulTo(Z,this)},J.prototype.imuln=function(Z){var Y=Z<0;if(Y)Z=-Z;T(typeof Z==="number"),T(Z<67108864);var E=0;for(var K=0;K<this.length;K++){var A=(this.words[K]|0)*Z,O=(A&67108863)+(E&67108863);E>>=26,E+=A/67108864|0,E+=O>>>26,this.words[K]=O&67108863}if(E!==0)this.words[K]=E,this.length++;return this.length=Z===0?1:this.length,Y?this.ineg():this},J.prototype.muln=function(Z){return this.clone().imuln(Z)},J.prototype.sqr=function(){return this.mul(this)},J.prototype.isqr=function(){return this.imul(this.clone())},J.prototype.pow=function(Z){var Y=B(Z);if(Y.length===0)return new J(1);var E=this;for(var K=0;K<Y.length;K++,E=E.sqr())if(Y[K]!==0)break;if(++K<Y.length)for(var A=E.sqr();K<Y.length;K++,A=A.sqr()){if(Y[K]===0)continue;E=E.mul(A)}return E},J.prototype.iushln=function(Z){T(typeof Z==="number"&&Z>=0);var Y=Z%26,E=(Z-Y)/26,K=67108863>>>26-Y<<26-Y,A;if(Y!==0){var O=0;for(A=0;A<this.length;A++){var V=this.words[A]&K,D=(this.words[A]|0)-V<<Y;this.words[A]=D|O,O=V>>>26-Y}if(O)this.words[A]=O,this.length++}if(E!==0){for(A=this.length-1;A>=0;A--)this.words[A+E]=this.words[A];for(A=0;A<E;A++)this.words[A]=0;this.length+=E}return this._strip()},J.prototype.ishln=function(Z){return T(this.negative===0),this.iushln(Z)},J.prototype.iushrn=function(Z,Y,E){T(typeof Z==="number"&&Z>=0);var K;if(Y)K=(Y-Y%26)/26;else K=0;var A=Z%26,O=Math.min((Z-A)/26,this.length),V=67108863^67108863>>>A<<A,D=E;if(K-=O,K=Math.max(0,K),D){for(var S=0;S<O;S++)D.words[S]=this.words[S];D.length=O}if(O===0);else if(this.length>O){this.length-=O;for(S=0;S<this.length;S++)this.words[S]=this.words[S+O]}else this.words[0]=0,this.length=1;var _=0;for(S=this.length-1;S>=0&&(_!==0||S>=K);S--){var N=this.words[S]|0;this.words[S]=_<<26-A|N>>>A,_=N&V}if(D&&_!==0)D.words[D.length++]=_;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},J.prototype.ishrn=function(Z,Y,E){return T(this.negative===0),this.iushrn(Z,Y,E)},J.prototype.shln=function(Z){return this.clone().ishln(Z)},J.prototype.ushln=function(Z){return this.clone().iushln(Z)},J.prototype.shrn=function(Z){return this.clone().ishrn(Z)},J.prototype.ushrn=function(Z){return this.clone().iushrn(Z)},J.prototype.testn=function(Z){T(typeof Z==="number"&&Z>=0);var Y=Z%26,E=(Z-Y)/26,K=1<<Y;if(this.length<=E)return!1;var A=this.words[E];return!!(A&K)},J.prototype.imaskn=function(Z){T(typeof Z==="number"&&Z>=0);var Y=Z%26,E=(Z-Y)/26;if(T(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(Y!==0)E++;if(this.length=Math.min(E,this.length),Y!==0){var K=67108863^67108863>>>Y<<Y;this.words[this.length-1]&=K}return this._strip()},J.prototype.maskn=function(Z){return this.clone().imaskn(Z)},J.prototype.iaddn=function(Z){if(T(typeof Z==="number"),T(Z<67108864),Z<0)return this.isubn(-Z);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=Z)return this.words[0]=Z-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Z),this.negative=1,this}return this._iaddn(Z)},J.prototype._iaddn=function(Z){this.words[0]+=Z;for(var Y=0;Y<this.length&&this.words[Y]>=67108864;Y++)if(this.words[Y]-=67108864,Y===this.length-1)this.words[Y+1]=1;else this.words[Y+1]++;return this.length=Math.max(this.length,Y+1),this},J.prototype.isubn=function(Z){if(T(typeof Z==="number"),T(Z<67108864),Z<0)return this.iaddn(-Z);if(this.negative!==0)return this.negative=0,this.iaddn(Z),this.negative=1,this;if(this.words[0]-=Z,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Y=0;Y<this.length&&this.words[Y]<0;Y++)this.words[Y]+=67108864,this.words[Y+1]-=1;return this._strip()},J.prototype.addn=function(Z){return this.clone().iaddn(Z)},J.prototype.subn=function(Z){return this.clone().isubn(Z)},J.prototype.iabs=function(){return this.negative=0,this},J.prototype.abs=function(){return this.clone().iabs()},J.prototype._ishlnsubmul=function(Z,Y,E){var K=Z.length+E,A;this._expand(K);var O,V=0;for(A=0;A<Z.length;A++){O=(this.words[A+E]|0)+V;var D=(Z.words[A]|0)*Y;O-=D&67108863,V=(O>>26)-(D/67108864|0),this.words[A+E]=O&67108863}for(;A<this.length-E;A++)O=(this.words[A+E]|0)+V,V=O>>26,this.words[A+E]=O&67108863;if(V===0)return this._strip();T(V===-1),V=0;for(A=0;A<this.length;A++)O=-(this.words[A]|0)+V,V=O>>26,this.words[A]=O&67108863;return this.negative=1,this._strip()},J.prototype._wordDiv=function(Z,Y){var E=this.length-Z.length,K=this.clone(),A=Z,O=A.words[A.length-1]|0,V=this._countBits(O);if(E=26-V,E!==0)A=A.ushln(E),K.iushln(E),O=A.words[A.length-1]|0;var D=K.length-A.length,S;if(Y!=="mod"){S=new J(null),S.length=D+1,S.words=Array(S.length);for(var _=0;_<S.length;_++)S.words[_]=0}var N=K.clone()._ishlnsubmul(A,1,D);if(N.negative===0){if(K=N,S)S.words[D]=1}for(var p=D-1;p>=0;p--){var n=(K.words[A.length+p]|0)*67108864+(K.words[A.length+p-1]|0);n=Math.min(n/O|0,67108863),K._ishlnsubmul(A,n,p);while(K.negative!==0)if(n--,K.negative=0,K._ishlnsubmul(A,1,p),!K.isZero())K.negative^=1;if(S)S.words[p]=n}if(S)S._strip();if(K._strip(),Y!=="div"&&E!==0)K.iushrn(E);return{div:S||null,mod:K}},J.prototype.divmod=function(Z,Y,E){if(T(!Z.isZero()),this.isZero())return{div:new J(0),mod:new J(0)};var K,A,O;if(this.negative!==0&&Z.negative===0){if(O=this.neg().divmod(Z,Y),Y!=="mod")K=O.div.neg();if(Y!=="div"){if(A=O.mod.neg(),E&&A.negative!==0)A.iadd(Z)}return{div:K,mod:A}}if(this.negative===0&&Z.negative!==0){if(O=this.divmod(Z.neg(),Y),Y!=="mod")K=O.div.neg();return{div:K,mod:O.mod}}if((this.negative&Z.negative)!==0){if(O=this.neg().divmod(Z.neg(),Y),Y!=="div"){if(A=O.mod.neg(),E&&A.negative!==0)A.isub(Z)}return{div:O.div,mod:A}}if(Z.length>this.length||this.cmp(Z)<0)return{div:new J(0),mod:this};if(Z.length===1){if(Y==="div")return{div:this.divn(Z.words[0]),mod:null};if(Y==="mod")return{div:null,mod:new J(this.modrn(Z.words[0]))};return{div:this.divn(Z.words[0]),mod:new J(this.modrn(Z.words[0]))}}return this._wordDiv(Z,Y)},J.prototype.div=function(Z){return this.divmod(Z,"div",!1).div},J.prototype.mod=function(Z){return this.divmod(Z,"mod",!1).mod},J.prototype.umod=function(Z){return this.divmod(Z,"mod",!0).mod},J.prototype.divRound=function(Z){var Y=this.divmod(Z);if(Y.mod.isZero())return Y.div;var E=Y.div.negative!==0?Y.mod.isub(Z):Y.mod,K=Z.ushrn(1),A=Z.andln(1),O=E.cmp(K);if(O<0||A===1&&O===0)return Y.div;return Y.div.negative!==0?Y.div.isubn(1):Y.div.iaddn(1)},J.prototype.modrn=function(Z){var Y=Z<0;if(Y)Z=-Z;T(Z<=67108863);var E=67108864%Z,K=0;for(var A=this.length-1;A>=0;A--)K=(E*K+(this.words[A]|0))%Z;return Y?-K:K},J.prototype.modn=function(Z){return this.modrn(Z)},J.prototype.idivn=function(Z){var Y=Z<0;if(Y)Z=-Z;T(Z<=67108863);var E=0;for(var K=this.length-1;K>=0;K--){var A=(this.words[K]|0)+E*67108864;this.words[K]=A/Z|0,E=A%Z}return this._strip(),Y?this.ineg():this},J.prototype.divn=function(Z){return this.clone().idivn(Z)},J.prototype.egcd=function(Z){T(Z.negative===0),T(!Z.isZero());var Y=this,E=Z.clone();if(Y.negative!==0)Y=Y.umod(Z);else Y=Y.clone();var K=new J(1),A=new J(0),O=new J(0),V=new J(1),D=0;while(Y.isEven()&&E.isEven())Y.iushrn(1),E.iushrn(1),++D;var S=E.clone(),_=Y.clone();while(!Y.isZero()){for(var N=0,p=1;(Y.words[0]&p)===0&&N<26;++N,p<<=1);if(N>0){Y.iushrn(N);while(N-- >0){if(K.isOdd()||A.isOdd())K.iadd(S),A.isub(_);K.iushrn(1),A.iushrn(1)}}for(var n=0,V0=1;(E.words[0]&V0)===0&&n<26;++n,V0<<=1);if(n>0){E.iushrn(n);while(n-- >0){if(O.isOdd()||V.isOdd())O.iadd(S),V.isub(_);O.iushrn(1),V.iushrn(1)}}if(Y.cmp(E)>=0)Y.isub(E),K.isub(O),A.isub(V);else E.isub(Y),O.isub(K),V.isub(A)}return{a:O,b:V,gcd:E.iushln(D)}},J.prototype._invmp=function(Z){T(Z.negative===0),T(!Z.isZero());var Y=this,E=Z.clone();if(Y.negative!==0)Y=Y.umod(Z);else Y=Y.clone();var K=new J(1),A=new J(0),O=E.clone();while(Y.cmpn(1)>0&&E.cmpn(1)>0){for(var V=0,D=1;(Y.words[0]&D)===0&&V<26;++V,D<<=1);if(V>0){Y.iushrn(V);while(V-- >0){if(K.isOdd())K.iadd(O);K.iushrn(1)}}for(var S=0,_=1;(E.words[0]&_)===0&&S<26;++S,_<<=1);if(S>0){E.iushrn(S);while(S-- >0){if(A.isOdd())A.iadd(O);A.iushrn(1)}}if(Y.cmp(E)>=0)Y.isub(E),K.isub(A);else E.isub(Y),A.isub(K)}var N;if(Y.cmpn(1)===0)N=K;else N=A;if(N.cmpn(0)<0)N.iadd(Z);return N},J.prototype.gcd=function(Z){if(this.isZero())return Z.abs();if(Z.isZero())return this.abs();var Y=this.clone(),E=Z.clone();Y.negative=0,E.negative=0;for(var K=0;Y.isEven()&&E.isEven();K++)Y.iushrn(1),E.iushrn(1);do{while(Y.isEven())Y.iushrn(1);while(E.isEven())E.iushrn(1);var A=Y.cmp(E);if(A<0){var O=Y;Y=E,E=O}else if(A===0||E.cmpn(1)===0)break;Y.isub(E)}while(!0);return E.iushln(K)},J.prototype.invm=function(Z){return this.egcd(Z).a.umod(Z)},J.prototype.isEven=function(){return(this.words[0]&1)===0},J.prototype.isOdd=function(){return(this.words[0]&1)===1},J.prototype.andln=function(Z){return this.words[0]&Z},J.prototype.bincn=function(Z){T(typeof Z==="number");var Y=Z%26,E=(Z-Y)/26,K=1<<Y;if(this.length<=E)return this._expand(E+1),this.words[E]|=K,this;var A=K;for(var O=E;A!==0&&O<this.length;O++){var V=this.words[O]|0;V+=A,A=V>>>26,V&=67108863,this.words[O]=V}if(A!==0)this.words[O]=A,this.length++;return this},J.prototype.isZero=function(){return this.length===1&&this.words[0]===0},J.prototype.cmpn=function(Z){var Y=Z<0;if(this.negative!==0&&!Y)return-1;if(this.negative===0&&Y)return 1;this._strip();var E;if(this.length>1)E=1;else{if(Y)Z=-Z;T(Z<=67108863,"Number is too big");var K=this.words[0]|0;E=K===Z?0:K<Z?-1:1}if(this.negative!==0)return-E|0;return E},J.prototype.cmp=function(Z){if(this.negative!==0&&Z.negative===0)return-1;if(this.negative===0&&Z.negative!==0)return 1;var Y=this.ucmp(Z);if(this.negative!==0)return-Y|0;return Y},J.prototype.ucmp=function(Z){if(this.length>Z.length)return 1;if(this.length<Z.length)return-1;var Y=0;for(var E=this.length-1;E>=0;E--){var K=this.words[E]|0,A=Z.words[E]|0;if(K===A)continue;if(K<A)Y=-1;else if(K>A)Y=1;break}return Y},J.prototype.gtn=function(Z){return this.cmpn(Z)===1},J.prototype.gt=function(Z){return this.cmp(Z)===1},J.prototype.gten=function(Z){return this.cmpn(Z)>=0},J.prototype.gte=function(Z){return this.cmp(Z)>=0},J.prototype.ltn=function(Z){return this.cmpn(Z)===-1},J.prototype.lt=function(Z){return this.cmp(Z)===-1},J.prototype.lten=function(Z){return this.cmpn(Z)<=0},J.prototype.lte=function(Z){return this.cmp(Z)<=0},J.prototype.eqn=function(Z){return this.cmpn(Z)===0},J.prototype.eq=function(Z){return this.cmp(Z)===0},J.red=function(Z){return new X(Z)},J.prototype.toRed=function(Z){return T(!this.red,"Already a number in reduction context"),T(this.negative===0,"red works only with positives"),Z.convertTo(this)._forceRed(Z)},J.prototype.fromRed=function(){return T(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},J.prototype._forceRed=function(Z){return this.red=Z,this},J.prototype.forceRed=function(Z){return T(!this.red,"Already a number in reduction context"),this._forceRed(Z)},J.prototype.redAdd=function(Z){return T(this.red,"redAdd works only with red numbers"),this.red.add(this,Z)},J.prototype.redIAdd=function(Z){return T(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Z)},J.prototype.redSub=function(Z){return T(this.red,"redSub works only with red numbers"),this.red.sub(this,Z)},J.prototype.redISub=function(Z){return T(this.red,"redISub works only with red numbers"),this.red.isub(this,Z)},J.prototype.redShl=function(Z){return T(this.red,"redShl works only with red numbers"),this.red.shl(this,Z)},J.prototype.redMul=function(Z){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,Z),this.red.mul(this,Z)},J.prototype.redIMul=function(Z){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,Z),this.red.imul(this,Z)},J.prototype.redSqr=function(){return T(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},J.prototype.redISqr=function(){return T(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},J.prototype.redSqrt=function(){return T(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},J.prototype.redInvm=function(){return T(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},J.prototype.redNeg=function(){return T(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},J.prototype.redPow=function(Z){return T(this.red&&!Z.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Z)};var Y0={k256:null,p224:null,p192:null,p25519:null};function G0(Z,Y){this.name=Z,this.p=new J(Y,16),this.n=this.p.bitLength(),this.k=new J(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}G0.prototype._tmp=function(){var Z=new J(null);return Z.words=Array(Math.ceil(this.n/13)),Z},G0.prototype.ireduce=function(Z){var Y=Z,E;do this.split(Y,this.tmp),Y=this.imulK(Y),Y=Y.iadd(this.tmp),E=Y.bitLength();while(E>this.n);var K=E<this.n?-1:Y.ucmp(this.p);if(K===0)Y.words[0]=0,Y.length=1;else if(K>0)Y.isub(this.p);else if(Y.strip!==void 0)Y.strip();else Y._strip();return Y},G0.prototype.split=function(Z,Y){Z.iushrn(this.n,0,Y)},G0.prototype.imulK=function(Z){return Z.imul(this.k)};function J0(){G0.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}F(J0,G0),J0.prototype.split=function(Z,Y){var E=4194303,K=Math.min(Z.length,9);for(var A=0;A<K;A++)Y.words[A]=Z.words[A];if(Y.length=K,Z.length<=9){Z.words[0]=0,Z.length=1;return}var O=Z.words[9];Y.words[Y.length++]=O&E;for(A=10;A<Z.length;A++){var V=Z.words[A]|0;Z.words[A-10]=(V&E)<<4|O>>>22,O=V}if(O>>>=22,Z.words[A-10]=O,O===0&&Z.length>10)Z.length-=10;else Z.length-=9},J0.prototype.imulK=function(Z){Z.words[Z.length]=0,Z.words[Z.length+1]=0,Z.length+=2;var Y=0;for(var E=0;E<Z.length;E++){var K=Z.words[E]|0;Y+=K*977,Z.words[E]=Y&67108863,Y=K*64+(Y/67108864|0)}if(Z.words[Z.length-1]===0){if(Z.length--,Z.words[Z.length-1]===0)Z.length--}return Z};function u(){G0.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}F(u,G0);function O0(){G0.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}F(O0,G0);function U(){G0.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}F(U,G0),U.prototype.imulK=function(Z){var Y=0;for(var E=0;E<Z.length;E++){var K=(Z.words[E]|0)*19+Y,A=K&67108863;K>>>=26,Z.words[E]=A,Y=K}if(Y!==0)Z.words[Z.length++]=Y;return Z},J._prime=function(Z){if(Y0[Z])return Y0[Z];var Y;if(Z==="k256")Y=new J0;else if(Z==="p224")Y=new u;else if(Z==="p192")Y=new O0;else if(Z==="p25519")Y=new U;else throw Error("Unknown prime "+Z);return Y0[Z]=Y,Y};function X(Z){if(typeof Z==="string"){var Y=J._prime(Z);this.m=Y.p,this.prime=Y}else T(Z.gtn(1),"modulus must be greater than 1"),this.m=Z,this.prime=null}X.prototype._verify1=function(Z){T(Z.negative===0,"red works only with positives"),T(Z.red,"red works only with red numbers")},X.prototype._verify2=function(Z,Y){T((Z.negative|Y.negative)===0,"red works only with positives"),T(Z.red&&Z.red===Y.red,"red works only with red numbers")},X.prototype.imod=function(Z){if(this.prime)return this.prime.ireduce(Z)._forceRed(this);return C(Z,Z.umod(this.m)._forceRed(this)),Z},X.prototype.neg=function(Z){if(Z.isZero())return Z.clone();return this.m.sub(Z)._forceRed(this)},X.prototype.add=function(Z,Y){this._verify2(Z,Y);var E=Z.add(Y);if(E.cmp(this.m)>=0)E.isub(this.m);return E._forceRed(this)},X.prototype.iadd=function(Z,Y){this._verify2(Z,Y);var E=Z.iadd(Y);if(E.cmp(this.m)>=0)E.isub(this.m);return E},X.prototype.sub=function(Z,Y){this._verify2(Z,Y);var E=Z.sub(Y);if(E.cmpn(0)<0)E.iadd(this.m);return E._forceRed(this)},X.prototype.isub=function(Z,Y){this._verify2(Z,Y);var E=Z.isub(Y);if(E.cmpn(0)<0)E.iadd(this.m);return E},X.prototype.shl=function(Z,Y){return this._verify1(Z),this.imod(Z.ushln(Y))},X.prototype.imul=function(Z,Y){return this._verify2(Z,Y),this.imod(Z.imul(Y))},X.prototype.mul=function(Z,Y){return this._verify2(Z,Y),this.imod(Z.mul(Y))},X.prototype.isqr=function(Z){return this.imul(Z,Z.clone())},X.prototype.sqr=function(Z){return this.mul(Z,Z)},X.prototype.sqrt=function(Z){if(Z.isZero())return Z.clone();var Y=this.m.andln(3);if(T(Y%2===1),Y===3){var E=this.m.add(new J(1)).iushrn(2);return this.pow(Z,E)}var K=this.m.subn(1),A=0;while(!K.isZero()&&K.andln(1)===0)A++,K.iushrn(1);T(!K.isZero());var O=new J(1).toRed(this),V=O.redNeg(),D=this.m.subn(1).iushrn(1),S=this.m.bitLength();S=new J(2*S*S).toRed(this);while(this.pow(S,D).cmp(V)!==0)S.redIAdd(V);var _=this.pow(S,K),N=this.pow(Z,K.addn(1).iushrn(1)),p=this.pow(Z,K),n=A;while(p.cmp(O)!==0){var V0=p;for(var r=0;V0.cmp(O)!==0;r++)V0=V0.redSqr();T(r<n);var b=this.pow(_,new J(1).iushln(n-r-1));N=N.redMul(b),_=b.redSqr(),p=p.redMul(_),n=r}return N},X.prototype.invm=function(Z){var Y=Z._invmp(this.m);if(Y.negative!==0)return Y.negative=0,this.imod(Y).redNeg();else return this.imod(Y)},X.prototype.pow=function(Z,Y){if(Y.isZero())return new J(1).toRed(this);if(Y.cmpn(1)===0)return Z.clone();var E=4,K=Array(1<<E);K[0]=new J(1).toRed(this),K[1]=Z;for(var A=2;A<K.length;A++)K[A]=this.mul(K[A-1],Z);var O=K[0],V=0,D=0,S=Y.bitLength()%26;if(S===0)S=26;for(A=Y.length-1;A>=0;A--){var _=Y.words[A];for(var N=S-1;N>=0;N--){var p=_>>N&1;if(O!==K[0])O=this.sqr(O);if(p===0&&V===0){D=0;continue}if(V<<=1,V|=p,D++,D!==E&&(A!==0||N!==0))continue;O=this.mul(O,K[V]),D=0,V=0}S=26}return O},X.prototype.convertTo=function(Z){var Y=Z.umod(this.m);return Y===Z?Y.clone():Y},X.prototype.convertFrom=function(Z){var Y=Z.clone();return Y.red=null,Y},J.mont=function(Z){return new $(Z)};function $(Z){if(X.call(this,Z),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new J(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)}F($,X),$.prototype.convertTo=function(Z){return this.imod(Z.ushln(this.shift))},$.prototype.convertFrom=function(Z){var Y=this.imod(Z.mul(this.rinv));return Y.red=null,Y},$.prototype.imul=function(Z,Y){if(Z.isZero()||Y.isZero())return Z.words[0]=0,Z.length=1,Z;var E=Z.imul(Y),K=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=E.isub(K).iushrn(this.shift),O=A;if(A.cmp(this.m)>=0)O=A.isub(this.m);else if(A.cmpn(0)<0)O=A.iadd(this.m);return O._forceRed(this)},$.prototype.mul=function(Z,Y){if(Z.isZero()||Y.isZero())return new J(0)._forceRed(this);var E=Z.mul(Y),K=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=E.isub(K).iushrn(this.shift),O=A;if(A.cmp(this.m)>=0)O=A.isub(this.m);else if(A.cmpn(0)<0)O=A.iadd(this.m);return O._forceRed(this)},$.prototype.invm=function(Z){var Y=this.imod(Z._invmp(this.m).mul(this.r2));return Y._forceRed(this)}})(typeof G>"u"||G,Q)}),GY=$0((Q,G)=>{var I=tG(),L=UZ(),T=MU().Buffer;function F(z){var W=z.modulus.byteLength(),H;do H=new I(L(W));while(H.cmp(z.modulus)>=0||!H.umod(z.prime1)||!H.umod(z.prime2));return H}function J(z){var W=F(z),H=W.toRed(I.mont(z.modulus)).redPow(new I(z.publicExponent)).fromRed();return{blinder:H,unblinder:W.invm(z.modulus)}}function M(z,W){var H=J(W),C=W.modulus.byteLength(),R=new I(z).mul(H.blinder).umod(W.modulus),q=R.toRed(I.mont(W.prime1)),P=R.toRed(I.mont(W.prime2)),j=W.coefficient,k=W.prime1,B=W.prime2,v=q.redPow(W.exponent1).fromRed(),g=P.redPow(W.exponent2).fromRed(),f=v.isub(g).imul(j).umod(k).imul(B);return g.iadd(f).imul(H.unblinder).umod(W.modulus).toArrayLike(T,"be",C)}M.getr=F,G.exports=M}),mG=$0((Q,G)=>{var I=QY(),L=UZ(),T=OZ(),F=YY(),J=JY(),M=XX(),z=$Y(),W=GY(),H=MU().Buffer;G.exports=function(P,j,k){var B;if(P.padding)B=P.padding;else if(k)B=1;else B=4;var v=I(P),g;if(B===4)g=C(v,j);else if(B===1)g=R(v,j,k);else if(B===3){if(g=new M(j),g.cmp(v.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(k)return W(g,v);else return z(g,v)};function C(P,j){var k=P.modulus.byteLength(),B=j.length,v=T("sha1").update(H.alloc(0)).digest(),g=v.length,f=2*g;if(B>k-f-2)throw Error("message too long");var w=H.alloc(k-B-f-2),d=k-g-1,Y0=L(g),G0=J(H.concat([v,w,H.alloc(1,1),j],d),F(Y0,d)),J0=J(Y0,F(G0,g));return new M(H.concat([H.alloc(1),J0,G0],k))}function R(P,j,k){var B=j.length,v=P.modulus.byteLength();if(B>v-11)throw Error("message too long");var g;if(k)g=H.alloc(v-B-3,255);else g=q(v-B-3);return new M(H.concat([H.from([0,k?1:2]),g,H.alloc(1),j],v))}function q(P){var j=H.allocUnsafe(P),k=0,B=L(P*2),v=0,g;while(k<P){if(v===B.length)B=L(P*2),v=0;if(g=B[v++],g)j[k++]=g}return j}}),sG=$0((Q,G)=>{var I=QY(),L=YY(),T=JY(),F=XX(),J=GY(),M=OZ(),z=$Y(),W=MU().Buffer;G.exports=function(q,P,j){var k;if(q.padding)k=q.padding;else if(j)k=1;else k=4;var B=I(q),v=B.modulus.byteLength();if(P.length>v||new F(P).cmp(B.modulus)>=0)throw Error("decryption error");var g;if(j)g=z(new F(P),B);else g=J(P,B);var f=W.alloc(v-g.length);if(g=W.concat([f,g],v),k===4)return H(B,g);else if(k===1)return C(B,g,j);else if(k===3)return g;else throw Error("unknown padding")};function H(q,P){var j=q.modulus.byteLength(),k=M("sha1").update(W.alloc(0)).digest(),B=k.length;if(P[0]!==0)throw Error("decryption error");var v=P.slice(1,B+1),g=P.slice(B+1),f=T(v,L(g,B)),w=T(g,L(f,j-B-1));if(R(k,w.slice(0,B)))throw Error("decryption error");var d=B;while(w[d]===0)d++;if(w[d++]!==1)throw Error("decryption error");return w.slice(d)}function C(q,P,j){var k=P.slice(0,2),B=2,v=0;while(P[B++]!==0)if(B>=P.length){v++;break}var g=P.slice(2,B-1);if(k.toString("hex")!=="0002"&&!j||k.toString("hex")!=="0001"&&j)v++;if(g.length<8)v++;if(v)throw Error("decryption error");return P.slice(B)}function R(q,P){q=W.from(q),P=W.from(P);var j=0,k=q.length;if(q.length!==P.length)j++,k=Math.min(q.length,P.length);var B=-1;while(++B<k)j+=q[B]^P[B];return j}}),mZ=$0((Q)=>{Q.publicEncrypt=mG(),Q.privateDecrypt=sG(),Q.privateEncrypt=function(G,I){return Q.publicEncrypt(G,I,!0)},Q.publicDecrypt=function(G,I){return Q.privateDecrypt(G,I,!0)}}),rG=$0((Q)=>{var G=(_U(),h0(jU));if(typeof G.publicEncrypt!=="function")G=mZ();if(Q.publicEncrypt=G.publicEncrypt,Q.privateDecrypt=G.privateDecrypt,typeof G.privateEncrypt!=="function")Q.privateEncrypt=mZ().privateEncrypt;else Q.privateEncrypt=G.privateEncrypt;if(typeof G.publicDecrypt!=="function")Q.publicDecrypt=mZ().publicDecrypt;else Q.publicDecrypt=G.publicDecrypt}),eG=$0((Q)=>{var G=MU(),I=UZ(),L=G.Buffer,T=G.kMaxLength,F=globalThis.crypto||globalThis.msCrypto,J=Math.pow(2,32)-1;function M(R,q){if(typeof R!=="number"||R!==R)throw TypeError("offset must be a number");if(R>J||R<0)throw TypeError("offset must be a uint32");if(R>T||R>q)throw RangeError("offset out of range")}function z(R,q,P){if(typeof R!=="number"||R!==R)throw TypeError("size must be a number");if(R>J||R<0)throw TypeError("size must be a uint32");if(R+q>P||R>T)throw RangeError("buffer too small")}F&&F.getRandomValues,Q.randomFill=W,Q.randomFillSync=C;function W(R,q,P,j){if(!L.isBuffer(R)&&!(R instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof q==="function")j=q,q=0,P=R.length;else if(typeof P==="function")j=P,P=R.length-q;else if(typeof j!=="function")throw TypeError('"cb" argument must be a function');return M(q,R.length),z(P,q,R.length),H(R,q,P,j)}function H(R,q,P,j){if(!1)var k,B;if(j){I(P,function(g,f){if(g)return j(g);f.copy(R,q),j(null,R)});return}var v=I(P);return v.copy(R,q),R}function C(R,q,P){if(typeof q>"u")q=0;if(!L.isBuffer(R)&&!(R instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(M(q,R.length),P===void 0)P=R.length-q;return z(P,q,R.length),H(R,q,P)}}),aG=$0((Q,G)=>{var I=(_U(),h0(jU));if(typeof I.randomFill==="function"&&typeof I.randomFillSync==="function")Q.randomFill=I.randomFill,Q.randomFillSync=I.randomFillSync;else G.exports=eG()}),iG=$0((Q)=>{Q.randomBytes=Q.rng=Q.pseudoRandomBytes=Q.prng=UZ(),Q.createHash=Q.Hash=OZ(),Q.createHmac=Q.Hmac=wQ();var G=M$(),I=Object.keys(G),L=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(I);Q.getHashes=function(){return L};var T=tQ();Q.pbkdf2=T.pbkdf2,Q.pbkdf2Sync=T.pbkdf2Sync;var F=YG();Q.Cipher=F.Cipher,Q.createCipher=F.createCipher,Q.Cipheriv=F.Cipheriv,Q.createCipheriv=F.createCipheriv,Q.Decipher=F.Decipher,Q.createDecipher=F.createDecipher,Q.Decipheriv=F.Decipheriv,Q.createDecipheriv=F.createDecipheriv,Q.getCiphers=F.getCiphers,Q.listCiphers=F.listCiphers;var J=JG();Q.DiffieHellmanGroup=J.DiffieHellmanGroup,Q.createDiffieHellmanGroup=J.createDiffieHellmanGroup,Q.getDiffieHellman=J.getDiffieHellman,Q.createDiffieHellman=J.createDiffieHellman,Q.DiffieHellman=J.DiffieHellman;var M=$G();Q.createSign=M.createSign,Q.Sign=M.Sign,Q.createVerify=M.createVerify,Q.Verify=M.Verify,Q.createECDH=vG();var z=rG();Q.publicEncrypt=z.publicEncrypt,Q.privateEncrypt=z.privateEncrypt,Q.publicDecrypt=z.publicDecrypt,Q.privateDecrypt=z.privateDecrypt;var W=aG();Q.randomFill=W.randomFill,Q.randomFillSync=W.randomFillSync,Q.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
|
|
14
|
+
})`)}catch(T){Q=function(M){this._initNamed(M)}}return E(Q,K),Q.prototype._initNamed=function(T){K.call(this,T)},new Q(this)},S.prototype._getDecoder=function(K){if(K=K||"der",!this.decoders.hasOwnProperty(K))this.decoders[K]=this._createNamed(I.decoders[K]);return this.decoders[K]},S.prototype.decode=function(K,Q,T){return this._getDecoder(Q).decode(K,T)},S.prototype._getEncoder=function(K){if(K=K||"der",!this.encoders.hasOwnProperty(K))this.encoders[K]=this._createNamed(I.encoders[K]);return this.encoders[K]},S.prototype.encode=function(K,Q,T){return this._getEncoder(Q).encode(K,T)}}),eG=Q0(($)=>{var I=gU();function E(S){this._reporterState={obj:null,path:[],options:S||{},errors:[]}}$.Reporter=E,E.prototype.isError=function(S){return S instanceof L},E.prototype.save=function(){var S=this._reporterState;return{obj:S.obj,pathLen:S.path.length}},E.prototype.restore=function(S){var K=this._reporterState;K.obj=S.obj,K.path=K.path.slice(0,S.pathLen)},E.prototype.enterKey=function(S){return this._reporterState.path.push(S)},E.prototype.exitKey=function(S){var K=this._reporterState;K.path=K.path.slice(0,S-1)},E.prototype.leaveKey=function(S,K,Q){var T=this._reporterState;if(this.exitKey(S),T.obj!==null)T.obj[K]=Q},E.prototype.path=function(){return this._reporterState.path.join("/")},E.prototype.enterObject=function(){var S=this._reporterState,K=S.obj;return S.obj={},K},E.prototype.leaveObject=function(S){var K=this._reporterState,Q=K.obj;return K.obj=S,Q},E.prototype.error=function(S){var K,Q=this._reporterState,T=S instanceof L;if(T)K=S;else K=new L(Q.path.map(function(M){return"["+JSON.stringify(M)+"]"}).join(""),S.message||S,S.stack);if(!Q.options.partial)throw K;if(!T)Q.errors.push(K);return K},E.prototype.wrapResult=function(S){var K=this._reporterState;if(!K.options.partial)return S;return{result:this.isError(S)?null:S,errors:K.errors}};function L(S,K){this.path=S,this.rethrow(K)}I(L,Error),L.prototype.rethrow=function(S){if(this.message=S+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,L);if(!this.stack)try{throw Error(this.message)}catch(K){this.stack=K.stack}return this}}),BI=Q0(($)=>{var I=gU(),E=cO().Reporter,L=(DU(),l0(RU)).Buffer;function S(Q,T){if(E.call(this,T),!L.isBuffer(Q)){this.error("Input not Buffer");return}this.base=Q,this.offset=0,this.length=Q.length}I(S,E),$.DecoderBuffer=S,S.prototype.save=function(){return{offset:this.offset,reporter:E.prototype.save.call(this)}},S.prototype.restore=function(Q){var T=new S(this.base);return T.offset=Q.offset,T.length=this.offset,this.offset=Q.offset,E.prototype.restore.call(this,Q.reporter),T},S.prototype.isEmpty=function(){return this.offset===this.length},S.prototype.readUInt8=function(Q){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(Q||"DecoderBuffer overrun")},S.prototype.skip=function(Q,T){if(!(this.offset+Q<=this.length))return this.error(T||"DecoderBuffer overrun");var M=new S(this.base);return M._reporterState=this._reporterState,M.offset=this.offset,M.length=this.offset+Q,this.offset+=Q,M},S.prototype.raw=function(Q){return this.base.slice(Q?Q.offset:this.offset,this.length)};function K(Q,T){if(Array.isArray(Q))this.length=0,this.value=Q.map(function(M){if(!(M instanceof K))M=new K(M,T);return this.length+=M.length,M},this);else if(typeof Q==="number"){if(!(0<=Q&&Q<=255))return T.error("non-byte EncoderBuffer value");this.value=Q,this.length=1}else if(typeof Q==="string")this.value=Q,this.length=L.byteLength(Q);else if(L.isBuffer(Q))this.value=Q,this.length=Q.length;else return T.error("Unsupported type: "+typeof Q)}$.EncoderBuffer=K,K.prototype.join=function(Q,T){if(!Q)Q=new L(this.length);if(!T)T=0;if(this.length===0)return Q;if(Array.isArray(this.value))this.value.forEach(function(M){M.join(Q,T),T+=M.length});else{if(typeof this.value==="number")Q[T]=this.value;else if(typeof this.value==="string")Q.write(this.value,T);else if(L.isBuffer(this.value))this.value.copy(Q,T);T+=this.length}return Q}}),aG=Q0(($,I)=>{var E=cO().Reporter,L=cO().EncoderBuffer,S=cO().DecoderBuffer,K=UO(),Q=["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"],T=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(Q),M=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function H(R,D){var q={};if(this._baseState=q,q.enc=R,q.parent=D||null,q.children=null,q.tag=null,q.args=null,q.reverseArgs=null,q.choice=null,q.optional=!1,q.any=!1,q.obj=!1,q.use=null,q.useDecoder=null,q.key=null,q.default=null,q.explicit=null,q.implicit=null,q.contains=null,!q.parent)q.children=[],this._wrap()}I.exports=H;var F=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];H.prototype.clone=function(){var R=this._baseState,D={};F.forEach(function(P){D[P]=R[P]});var q=new this.constructor(D.parent);return q._baseState=D,q},H.prototype._wrap=function(){var R=this._baseState;T.forEach(function(D){this[D]=function(){var q=new this.constructor(this);return R.children.push(q),q[D].apply(q,arguments)}},this)},H.prototype._init=function(R){var D=this._baseState;K(D.parent===null),R.call(this),D.children=D.children.filter(function(q){return q._baseState.parent===this},this),K.equal(D.children.length,1,"Root node can have only one child")},H.prototype._useArgs=function(R){var D=this._baseState,q=R.filter(function(P){return P instanceof this.constructor},this);if(R=R.filter(function(P){return!(P instanceof this.constructor)},this),q.length!==0)K(D.children===null),D.children=q,q.forEach(function(P){P._baseState.parent=this},this);if(R.length!==0)K(D.args===null),D.args=R,D.reverseArgs=R.map(function(P){if(typeof P!=="object"||P.constructor!==Object)return P;var _={};return Object.keys(P).forEach(function(k){if(k==(k|0))k|=0;var B=P[k];_[B]=k}),_})},M.forEach(function(R){H.prototype[R]=function(){var D=this._baseState;throw Error(R+" not implemented for encoding: "+D.enc)}}),Q.forEach(function(R){H.prototype[R]=function(){var D=this._baseState,q=Array.prototype.slice.call(arguments);return K(D.tag===null),D.tag=R,this._useArgs(q),this}}),H.prototype.use=function(R){K(R);var D=this._baseState;return K(D.use===null),D.use=R,this},H.prototype.optional=function(){var R=this._baseState;return R.optional=!0,this},H.prototype.def=function(R){var D=this._baseState;return K(D.default===null),D.default=R,D.optional=!0,this},H.prototype.explicit=function(R){var D=this._baseState;return K(D.explicit===null&&D.implicit===null),D.explicit=R,this},H.prototype.implicit=function(R){var D=this._baseState;return K(D.explicit===null&&D.implicit===null),D.implicit=R,this},H.prototype.obj=function(){var R=this._baseState,D=Array.prototype.slice.call(arguments);if(R.obj=!0,D.length!==0)this._useArgs(D);return this},H.prototype.key=function(R){var D=this._baseState;return K(D.key===null),D.key=R,this},H.prototype.any=function(){var R=this._baseState;return R.any=!0,this},H.prototype.choice=function(R){var D=this._baseState;return K(D.choice===null),D.choice=R,this._useArgs(Object.keys(R).map(function(q){return R[q]})),this},H.prototype.contains=function(R){var D=this._baseState;return K(D.use===null),D.contains=R,this},H.prototype._decode=function(R,D){var q=this._baseState;if(q.parent===null)return R.wrapResult(q.children[0]._decode(R,D));var P=q.default,_=!0,k=null;if(q.key!==null)k=R.enterKey(q.key);if(q.optional){var B=null;if(q.explicit!==null)B=q.explicit;else if(q.implicit!==null)B=q.implicit;else if(q.tag!==null)B=q.tag;if(B===null&&!q.any){var v=R.save();try{if(q.choice===null)this._decodeGeneric(q.tag,R,D);else this._decodeChoice(R,D);_=!0}catch(X0){_=!1}R.restore(v)}else if(_=this._peekTag(R,B,q.any),R.isError(_))return _}var g;if(q.obj&&_)g=R.enterObject();if(_){if(q.explicit!==null){var f=this._decodeTag(R,q.explicit);if(R.isError(f))return f;R=f}var w=R.offset;if(q.use===null&&q.choice===null){if(q.any)var v=R.save();var b=this._decodeTag(R,q.implicit!==null?q.implicit:q.tag,q.any);if(R.isError(b))return b;if(q.any)P=R.raw(v);else R=b}if(D&&D.track&&q.tag!==null)D.track(R.path(),w,R.length,"tagged");if(D&&D.track&&q.tag!==null)D.track(R.path(),R.offset,R.length,"content");if(q.any)P=P;else if(q.choice===null)P=this._decodeGeneric(q.tag,R,D);else P=this._decodeChoice(R,D);if(R.isError(P))return P;if(!q.any&&q.choice===null&&q.children!==null)q.children.forEach(function(X0){X0._decode(R,D)});if(q.contains&&(q.tag==="octstr"||q.tag==="bitstr")){var I0=new S(P);P=this._getUse(q.contains,R._reporterState.obj)._decode(I0,D)}}if(q.obj&&_)P=R.leaveObject(g);if(q.key!==null&&(P!==null||_===!0))R.leaveKey(k,q.key,P);else if(k!==null)R.exitKey(k);return P},H.prototype._decodeGeneric=function(R,D,q){var P=this._baseState;if(R==="seq"||R==="set")return null;if(R==="seqof"||R==="setof")return this._decodeList(D,R,P.args[0],q);else if(/str$/.test(R))return this._decodeStr(D,R,q);else if(R==="objid"&&P.args)return this._decodeObjid(D,P.args[0],P.args[1],q);else if(R==="objid")return this._decodeObjid(D,null,null,q);else if(R==="gentime"||R==="utctime")return this._decodeTime(D,R,q);else if(R==="null_")return this._decodeNull(D,q);else if(R==="bool")return this._decodeBool(D,q);else if(R==="objDesc")return this._decodeStr(D,R,q);else if(R==="int"||R==="enum")return this._decodeInt(D,P.args&&P.args[0],q);if(P.use!==null)return this._getUse(P.use,D._reporterState.obj)._decode(D,q);else return D.error("unknown tag: "+R)},H.prototype._getUse=function(R,D){var q=this._baseState;if(q.useDecoder=this._use(R,D),K(q.useDecoder._baseState.parent===null),q.useDecoder=q.useDecoder._baseState.children[0],q.implicit!==q.useDecoder._baseState.implicit)q.useDecoder=q.useDecoder.clone(),q.useDecoder._baseState.implicit=q.implicit;return q.useDecoder},H.prototype._decodeChoice=function(R,D){var q=this._baseState,P=null,_=!1;if(Object.keys(q.choice).some(function(k){var B=R.save(),v=q.choice[k];try{var g=v._decode(R,D);if(R.isError(g))return!1;P={type:k,value:g},_=!0}catch(f){return R.restore(B),!1}return!0},this),!_)return R.error("Choice not matched");return P},H.prototype._createEncoderBuffer=function(R){return new L(R,this.reporter)},H.prototype._encode=function(R,D,q){var P=this._baseState;if(P.default!==null&&P.default===R)return;var _=this._encodeValue(R,D,q);if(_===void 0)return;if(this._skipDefault(_,D,q))return;return _},H.prototype._encodeValue=function(R,D,q){var P=this._baseState;if(P.parent===null)return P.children[0]._encode(R,D||new E);var v=null;if(this.reporter=D,P.optional&&R===void 0)if(P.default!==null)R=P.default;else return;var _=null,k=!1;if(P.any)v=this._createEncoderBuffer(R);else if(P.choice)v=this._encodeChoice(R,D);else if(P.contains)_=this._getUse(P.contains,q)._encode(R,D),k=!0;else if(P.children)_=P.children.map(function(w){if(w._baseState.tag==="null_")return w._encode(null,D,R);if(w._baseState.key===null)return D.error("Child should have a key");var b=D.enterKey(w._baseState.key);if(typeof R!=="object")return D.error("Child expected, but input is not object");var I0=w._encode(R[w._baseState.key],D,R);return D.leaveKey(b),I0},this).filter(function(w){return w}),_=this._createEncoderBuffer(_);else if(P.tag==="seqof"||P.tag==="setof"){if(!(P.args&&P.args.length===1))return D.error("Too many args for : "+P.tag);if(!Array.isArray(R))return D.error("seqof/setof, but data is not Array");var B=this.clone();B._baseState.implicit=null,_=this._createEncoderBuffer(R.map(function(w){var b=this._baseState;return this._getUse(b.args[0],R)._encode(w,D)},B))}else if(P.use!==null)v=this._getUse(P.use,q)._encode(R,D);else _=this._encodePrimitive(P.tag,R),k=!0;var v;if(!P.any&&P.choice===null){var g=P.implicit!==null?P.implicit:P.tag,f=P.implicit===null?"universal":"context";if(g===null){if(P.use===null)D.error("Tag could be omitted only for .use()")}else if(P.use===null)v=this._encodeComposite(g,k,f,_)}if(P.explicit!==null)v=this._encodeComposite(P.explicit,!1,"context",v);return v},H.prototype._encodeChoice=function(R,D){var q=this._baseState,P=q.choice[R.type];if(!P)K(!1,R.type+" not found in "+JSON.stringify(Object.keys(q.choice)));return P._encode(R.value,D)},H.prototype._encodePrimitive=function(R,D){var q=this._baseState;if(/str$/.test(R))return this._encodeStr(D,R);else if(R==="objid"&&q.args)return this._encodeObjid(D,q.reverseArgs[0],q.args[1]);else if(R==="objid")return this._encodeObjid(D,null,null);else if(R==="gentime"||R==="utctime")return this._encodeTime(D,R);else if(R==="null_")return this._encodeNull();else if(R==="int"||R==="enum")return this._encodeInt(D,q.args&&q.reverseArgs[0]);else if(R==="bool")return this._encodeBool(D);else if(R==="objDesc")return this._encodeStr(D,R);else throw Error("Unsupported tag: "+R)},H.prototype._isNumstr=function(R){return/^[0-9 ]*$/.test(R)},H.prototype._isPrintstr=function(R){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(R)}}),cO=Q0(($)=>{var I=$;I.Reporter=eG().Reporter,I.DecoderBuffer=BI().DecoderBuffer,I.EncoderBuffer=BI().EncoderBuffer,I.Node=aG()}),iG=Q0(($)=>{var I=rI();$.tagClass={0:"universal",1:"application",2:"context",3:"private"},$.tagClassByName=I._reverse($.tagClass),$.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"},$.tagByName=I._reverse($.tag)}),rI=Q0(($)=>{var I=$;I._reverse=function(E){var L={};return Object.keys(E).forEach(function(S){if((S|0)==S)S=S|0;var K=E[S];L[K]=S}),L},I.der=iG()}),eI=Q0(($,I)=>{var E=gU(),L=dO(),S=L.base,K=L.bignum,Q=L.constants.der;function T(R){this.enc="der",this.name=R.name,this.entity=R,this.tree=new M,this.tree._init(R.body)}I.exports=T,T.prototype.decode=function(R,D){if(!(R instanceof S.DecoderBuffer))R=new S.DecoderBuffer(R,D);return this.tree._decode(R,D)};function M(R){S.Node.call(this,"der",R)}E(M,S.Node),M.prototype._peekTag=function(R,D,q){if(R.isEmpty())return!1;var P=R.save(),_=H(R,'Failed to peek tag: "'+D+'"');if(R.isError(_))return _;return R.restore(P),_.tag===D||_.tagStr===D||_.tagStr+"of"===D||q},M.prototype._decodeTag=function(R,D,q){var P=H(R,'Failed to decode tag of "'+D+'"');if(R.isError(P))return P;var _=F(R,P.primitive,'Failed to get length of "'+D+'"');if(R.isError(_))return _;if(!q&&P.tag!==D&&P.tagStr!==D&&P.tagStr+"of"!==D)return R.error('Failed to match tag: "'+D+'"');if(P.primitive||_!==null)return R.skip(_,'Failed to match body of: "'+D+'"');var k=R.save(),B=this._skipUntilEnd(R,'Failed to skip indefinite length body: "'+this.tag+'"');if(R.isError(B))return B;return _=R.offset-k.offset,R.restore(k),R.skip(_,'Failed to match body of: "'+D+'"')},M.prototype._skipUntilEnd=function(R,D){while(!0){var q=H(R,D);if(R.isError(q))return q;var P=F(R,q.primitive,D);if(R.isError(P))return P;var _;if(q.primitive||P!==null)_=R.skip(P);else _=this._skipUntilEnd(R,D);if(R.isError(_))return _;if(q.tagStr==="end")break}},M.prototype._decodeList=function(R,D,q,P){var _=[];while(!R.isEmpty()){var k=this._peekTag(R,"end");if(R.isError(k))return k;var B=q.decode(R,"der",P);if(R.isError(B)&&k)break;_.push(B)}return _},M.prototype._decodeStr=function(R,D){if(D==="bitstr"){var q=R.readUInt8();if(R.isError(q))return q;return{unused:q,data:R.raw()}}else if(D==="bmpstr"){var P=R.raw();if(P.length%2===1)return R.error("Decoding of string type: bmpstr length mismatch");var _="";for(var k=0;k<P.length/2;k++)_+=String.fromCharCode(P.readUInt16BE(k*2));return _}else if(D==="numstr"){var B=R.raw().toString("ascii");if(!this._isNumstr(B))return R.error("Decoding of string type: numstr unsupported characters");return B}else if(D==="octstr")return R.raw();else if(D==="objDesc")return R.raw();else if(D==="printstr"){var v=R.raw().toString("ascii");if(!this._isPrintstr(v))return R.error("Decoding of string type: printstr unsupported characters");return v}else if(/str$/.test(D))return R.raw().toString();else return R.error("Decoding of string type: "+D+" unsupported")},M.prototype._decodeObjid=function(R,D,q){var P,_=[],k=0;while(!R.isEmpty()){var B=R.readUInt8();if(k<<=7,k|=B&127,(B&128)===0)_.push(k),k=0}if(B&128)_.push(k);var v=_[0]/40|0,g=_[0]%40;if(q)P=_;else P=[v,g].concat(_.slice(1));if(D){var f=D[P.join(" ")];if(f===void 0)f=D[P.join(".")];if(f!==void 0)P=f}return P},M.prototype._decodeTime=function(R,D){var q=R.raw().toString();if(D==="gentime")var P=q.slice(0,4)|0,_=q.slice(4,6)|0,k=q.slice(6,8)|0,B=q.slice(8,10)|0,v=q.slice(10,12)|0,g=q.slice(12,14)|0;else if(D==="utctime"){var P=q.slice(0,2)|0,_=q.slice(2,4)|0,k=q.slice(4,6)|0,B=q.slice(6,8)|0,v=q.slice(8,10)|0,g=q.slice(10,12)|0;if(P<70)P=2000+P;else P=1900+P}else return R.error("Decoding "+D+" time is not supported yet");return Date.UTC(P,_-1,k,B,v,g,0)},M.prototype._decodeNull=function(R){return null},M.prototype._decodeBool=function(R){var D=R.readUInt8();if(R.isError(D))return D;else return D!==0},M.prototype._decodeInt=function(R,D){var q=R.raw(),P=new K(q);if(D)P=D[P.toString(10)]||P;return P},M.prototype._use=function(R,D){if(typeof R==="function")R=R(D);return R._getDecoder("der").tree};function H(R,D){var q=R.readUInt8(D);if(R.isError(q))return q;var P=Q.tagClass[q>>6],_=(q&32)===0;if((q&31)===31){var k=q;q=0;while((k&128)===128){if(k=R.readUInt8(D),R.isError(k))return k;q<<=7,q|=k&127}}else q&=31;var B=Q.tag[q];return{cls:P,primitive:_,tag:q,tagStr:B}}function F(R,D,q){var P=R.readUInt8(q);if(R.isError(P))return P;if(!D&&P===128)return null;if((P&128)===0)return P;var _=P&127;if(_>4)return R.error("length octect is too long");P=0;for(var k=0;k<_;k++){P<<=8;var B=R.readUInt8(q);if(R.isError(B))return B;P|=B}return P}}),UE=Q0(($,I)=>{var E=gU(),L=(DU(),l0(RU)).Buffer,S=eI();function K(Q){S.call(this,Q),this.enc="pem"}E(K,S),I.exports=K,K.prototype.decode=function(Q,T){var M=Q.toString().split(/[\r\n]+/g),H=T.label.toUpperCase(),F=/^-----(BEGIN|END) ([^-]+)-----$/,R=-1,D=-1;for(var q=0;q<M.length;q++){var P=M[q].match(F);if(P===null)continue;if(P[2]!==H)continue;if(R===-1){if(P[1]!=="BEGIN")break;R=q}else{if(P[1]!=="END")break;D=q;break}}if(R===-1||D===-1)throw Error("PEM section not found for: "+H);var _=M.slice(R+1,D).join("");_.replace(/[^a-z0-9\+\/=]+/gi,"");var k=new L(_,"base64");return S.prototype.decode.call(this,k,T)}}),OE=Q0(($)=>{var I=$;I.der=eI(),I.pem=UE()}),aI=Q0(($,I)=>{var E=gU(),L=(DU(),l0(RU)).Buffer,S=dO(),K=S.base,Q=S.constants.der;function T(R){this.enc="der",this.name=R.name,this.entity=R,this.tree=new M,this.tree._init(R.body)}I.exports=T,T.prototype.encode=function(R,D){return this.tree._encode(R,D).join()};function M(R){K.Node.call(this,"der",R)}E(M,K.Node),M.prototype._encodeComposite=function(R,D,q,P){var _=F(R,D,q,this.reporter);if(P.length<128){var v=new L(2);return v[0]=_,v[1]=P.length,this._createEncoderBuffer([v,P])}var k=1;for(var B=P.length;B>=256;B>>=8)k++;var v=new L(2+k);v[0]=_,v[1]=128|k;for(var B=1+k,g=P.length;g>0;B--,g>>=8)v[B]=g&255;return this._createEncoderBuffer([v,P])},M.prototype._encodeStr=function(R,D){if(D==="bitstr")return this._createEncoderBuffer([R.unused|0,R.data]);else if(D==="bmpstr"){var q=new L(R.length*2);for(var P=0;P<R.length;P++)q.writeUInt16BE(R.charCodeAt(P),P*2);return this._createEncoderBuffer(q)}else if(D==="numstr"){if(!this._isNumstr(R))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(R)}else if(D==="printstr"){if(!this._isPrintstr(R))return this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark");return this._createEncoderBuffer(R)}else if(/str$/.test(D))return this._createEncoderBuffer(R);else if(D==="objDesc")return this._createEncoderBuffer(R);else return this.reporter.error("Encoding of string type: "+D+" unsupported")},M.prototype._encodeObjid=function(R,D,q){if(typeof R==="string"){if(!D)return this.reporter.error("string objid given, but no values map found");if(!D.hasOwnProperty(R))return this.reporter.error("objid not found in values map");R=D[R].split(/[\s\.]+/g);for(var P=0;P<R.length;P++)R[P]|=0}else if(Array.isArray(R)){R=R.slice();for(var P=0;P<R.length;P++)R[P]|=0}if(!Array.isArray(R))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(R));if(!q){if(R[1]>=40)return this.reporter.error("Second objid identifier OOB");R.splice(0,2,R[0]*40+R[1])}var _=0;for(var P=0;P<R.length;P++){var k=R[P];for(_++;k>=128;k>>=7)_++}var B=new L(_),v=B.length-1;for(var P=R.length-1;P>=0;P--){var k=R[P];B[v--]=k&127;while((k>>=7)>0)B[v--]=128|k&127}return this._createEncoderBuffer(B)};function H(R){if(R<10)return"0"+R;else return R}M.prototype._encodeTime=function(R,D){var q,P=new Date(R);if(D==="gentime")q=[H(P.getFullYear()),H(P.getUTCMonth()+1),H(P.getUTCDate()),H(P.getUTCHours()),H(P.getUTCMinutes()),H(P.getUTCSeconds()),"Z"].join("");else if(D==="utctime")q=[H(P.getFullYear()%100),H(P.getUTCMonth()+1),H(P.getUTCDate()),H(P.getUTCHours()),H(P.getUTCMinutes()),H(P.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+D+" time is not supported yet");return this._encodeStr(q,"octstr")},M.prototype._encodeNull=function(){return this._createEncoderBuffer("")},M.prototype._encodeInt=function(R,D){if(typeof R==="string"){if(!D)return this.reporter.error("String int or enum given, but no values map");if(!D.hasOwnProperty(R))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(R));R=D[R]}if(typeof R!=="number"&&!L.isBuffer(R)){var q=R.toArray();if(!R.sign&&q[0]&128)q.unshift(0);R=new L(q)}if(L.isBuffer(R)){var P=R.length;if(R.length===0)P++;var k=new L(P);if(R.copy(k),R.length===0)k[0]=0;return this._createEncoderBuffer(k)}if(R<128)return this._createEncoderBuffer(R);if(R<256)return this._createEncoderBuffer([0,R]);var P=1;for(var _=R;_>=256;_>>=8)P++;var k=Array(P);for(var _=k.length-1;_>=0;_--)k[_]=R&255,R>>=8;if(k[0]&128)k.unshift(0);return this._createEncoderBuffer(new L(k))},M.prototype._encodeBool=function(R){return this._createEncoderBuffer(R?255:0)},M.prototype._use=function(R,D){if(typeof R==="function")R=R(D);return R._getEncoder("der").tree},M.prototype._skipDefault=function(R,D,q){var P=this._baseState,_;if(P.default===null)return!1;var k=R.join();if(P.defaultBuffer===void 0)P.defaultBuffer=this._encodeValue(P.default,D,q).join();if(k.length!==P.defaultBuffer.length)return!1;for(_=0;_<k.length;_++)if(k[_]!==P.defaultBuffer[_])return!1;return!0};function F(R,D,q,P){var _;if(R==="seqof")R="seq";else if(R==="setof")R="set";if(Q.tagByName.hasOwnProperty(R))_=Q.tagByName[R];else if(typeof R==="number"&&(R|0)===R)_=R;else return P.error("Unknown tag: "+R);if(_>=31)return P.error("Multi-octet tag encoding unsupported");if(!D)_|=32;return _|=Q.tagClassByName[q||"universal"]<<6,_}}),ZE=Q0(($,I)=>{var E=gU(),L=aI();function S(K){L.call(this,K),this.enc="pem"}E(S,L),I.exports=S,S.prototype.encode=function(K,Q){var T=L.prototype.encode.call(this,K),M=T.toString("base64"),H=["-----BEGIN "+Q.label+"-----"];for(var F=0;F<M.length;F+=64)H.push(M.slice(F,F+64));return H.push("-----END "+Q.label+"-----"),H.join(`
|
|
15
|
+
`)}}),AE=Q0(($)=>{var I=$;I.der=aI(),I.pem=ZE()}),dO=Q0(($)=>{var I=$;I.bignum=mG(),I.define=rG().define,I.base=cO(),I.constants=rI(),I.decoders=OE(),I.encoders=AE()}),$E=Q0(($,I)=>{var E=dO(),L=E.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),S=E.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),K=E.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),Q=E.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(K),this.key("subjectPublicKey").bitstr())}),T=E.define("RelativeDistinguishedName",function(){this.setof(S)}),M=E.define("RDNSequence",function(){this.seqof(T)}),H=E.define("Name",function(){this.choice({rdnSequence:this.use(M)})}),F=E.define("Validity",function(){this.seq().obj(this.key("notBefore").use(L),this.key("notAfter").use(L))}),R=E.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),D=E.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(K),this.key("issuer").use(H),this.key("validity").use(F),this.key("subject").use(H),this.key("subjectPublicKeyInfo").use(Q),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(R).optional())}),q=E.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(D),this.key("signatureAlgorithm").use(K),this.key("signatureValue").bitstr())});I.exports=q}),IE=Q0(($)=>{var I=dO();$.certificate=$E();var E=I.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});$.RSAPrivateKey=E;var L=I.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});$.RSAPublicKey=L;var S=I.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),K=I.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(S),this.key("subjectPublicKey").bitstr())});$.PublicKey=K;var Q=I.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(S),this.key("subjectPrivateKey").octstr())});$.PrivateKey=Q;var T=I.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});$.EncryptedPrivateKey=T;var M=I.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});$.DSAPrivateKey=M,$.DSAparam=I.define("DSAparam",function(){this.int()});var H=I.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),F=I.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(H),this.key("publicKey").optional().explicit(1).bitstr())});$.ECPrivateKey=F,$.signature=I.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),CE=Q0(($,I)=>{I.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}}),QE=Q0(($,I)=>{var E=qU().Buffer,L=UZ().Transform,S=gU();function K(H){L.call(this),this._block=E.allocUnsafe(H),this._blockSize=H,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}S(K,L),K.prototype._transform=function(H,F,R){var D=null;try{this.update(H,F)}catch(q){D=q}R(D)},K.prototype._flush=function(H){var F=null;try{this.push(this.digest())}catch(R){F=R}H(F)};var Q=typeof Uint8Array<"u",T=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(E.prototype instanceof Uint8Array||E.TYPED_ARRAY_SUPPORT);function M(H,F){if(H instanceof E)return H;if(typeof H==="string")return E.from(H,F);if(T&&ArrayBuffer.isView(H)){if(H.byteLength===0)return E.alloc(0);var R=E.from(H.buffer,H.byteOffset,H.byteLength);if(R.byteLength===H.byteLength)return R}if(Q&&H instanceof Uint8Array)return E.from(H);if(E.isBuffer(H)&&H.constructor&&typeof H.constructor.isBuffer==="function"&&H.constructor.isBuffer(H))return E.from(H);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}K.prototype.update=function(H,F){if(this._finalized)throw Error("Digest already called");H=M(H,F);var R=this._block,D=0;while(this._blockOffset+H.length-D>=this._blockSize){for(var q=this._blockOffset;q<this._blockSize;)R[q++]=H[D++];this._update(),this._blockOffset=0}while(D<H.length)R[this._blockOffset++]=H[D++];for(var P=0,_=H.length*8;_>0;++P)if(this._length[P]+=_,_=this._length[P]/4294967296|0,_>0)this._length[P]-=4294967296*_;return this},K.prototype._update=function(){throw Error("_update is not implemented")},K.prototype.digest=function(H){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var F=this._digest();if(H!==void 0)F=F.toString(H);this._block.fill(0),this._blockOffset=0;for(var R=0;R<4;++R)this._length[R]=0;return F},K.prototype._digest=function(){throw Error("_digest is not implemented")},I.exports=K}),XE=Q0(($,I)=>{var E=gU(),L=QE(),S=qU().Buffer,K=Array(16);function Q(){L.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}E(Q,L),Q.prototype._update=function(){var D=K;for(var q=0;q<16;++q)D[q]=this._block.readInt32LE(q*4);var P=this._a,_=this._b,k=this._c,B=this._d;P=M(P,_,k,B,D[0],3614090360,7),B=M(B,P,_,k,D[1],3905402710,12),k=M(k,B,P,_,D[2],606105819,17),_=M(_,k,B,P,D[3],3250441966,22),P=M(P,_,k,B,D[4],4118548399,7),B=M(B,P,_,k,D[5],1200080426,12),k=M(k,B,P,_,D[6],2821735955,17),_=M(_,k,B,P,D[7],4249261313,22),P=M(P,_,k,B,D[8],1770035416,7),B=M(B,P,_,k,D[9],2336552879,12),k=M(k,B,P,_,D[10],4294925233,17),_=M(_,k,B,P,D[11],2304563134,22),P=M(P,_,k,B,D[12],1804603682,7),B=M(B,P,_,k,D[13],4254626195,12),k=M(k,B,P,_,D[14],2792965006,17),_=M(_,k,B,P,D[15],1236535329,22),P=H(P,_,k,B,D[1],4129170786,5),B=H(B,P,_,k,D[6],3225465664,9),k=H(k,B,P,_,D[11],643717713,14),_=H(_,k,B,P,D[0],3921069994,20),P=H(P,_,k,B,D[5],3593408605,5),B=H(B,P,_,k,D[10],38016083,9),k=H(k,B,P,_,D[15],3634488961,14),_=H(_,k,B,P,D[4],3889429448,20),P=H(P,_,k,B,D[9],568446438,5),B=H(B,P,_,k,D[14],3275163606,9),k=H(k,B,P,_,D[3],4107603335,14),_=H(_,k,B,P,D[8],1163531501,20),P=H(P,_,k,B,D[13],2850285829,5),B=H(B,P,_,k,D[2],4243563512,9),k=H(k,B,P,_,D[7],1735328473,14),_=H(_,k,B,P,D[12],2368359562,20),P=F(P,_,k,B,D[5],4294588738,4),B=F(B,P,_,k,D[8],2272392833,11),k=F(k,B,P,_,D[11],1839030562,16),_=F(_,k,B,P,D[14],4259657740,23),P=F(P,_,k,B,D[1],2763975236,4),B=F(B,P,_,k,D[4],1272893353,11),k=F(k,B,P,_,D[7],4139469664,16),_=F(_,k,B,P,D[10],3200236656,23),P=F(P,_,k,B,D[13],681279174,4),B=F(B,P,_,k,D[0],3936430074,11),k=F(k,B,P,_,D[3],3572445317,16),_=F(_,k,B,P,D[6],76029189,23),P=F(P,_,k,B,D[9],3654602809,4),B=F(B,P,_,k,D[12],3873151461,11),k=F(k,B,P,_,D[15],530742520,16),_=F(_,k,B,P,D[2],3299628645,23),P=R(P,_,k,B,D[0],4096336452,6),B=R(B,P,_,k,D[7],1126891415,10),k=R(k,B,P,_,D[14],2878612391,15),_=R(_,k,B,P,D[5],4237533241,21),P=R(P,_,k,B,D[12],1700485571,6),B=R(B,P,_,k,D[3],2399980690,10),k=R(k,B,P,_,D[10],4293915773,15),_=R(_,k,B,P,D[1],2240044497,21),P=R(P,_,k,B,D[8],1873313359,6),B=R(B,P,_,k,D[15],4264355552,10),k=R(k,B,P,_,D[6],2734768916,15),_=R(_,k,B,P,D[13],1309151649,21),P=R(P,_,k,B,D[4],4149444226,6),B=R(B,P,_,k,D[11],3174756917,10),k=R(k,B,P,_,D[2],718787259,15),_=R(_,k,B,P,D[9],3951481745,21),this._a=this._a+P|0,this._b=this._b+_|0,this._c=this._c+k|0,this._d=this._d+B|0},Q.prototype._digest=function(){if(this._block[this._blockOffset++]=128,this._blockOffset>56)this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0;this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var D=S.allocUnsafe(16);return D.writeInt32LE(this._a,0),D.writeInt32LE(this._b,4),D.writeInt32LE(this._c,8),D.writeInt32LE(this._d,12),D};function T(D,q){return D<<q|D>>>32-q}function M(D,q,P,_,k,B,v){return T(D+(q&P|~q&_)+k+B|0,v)+q|0}function H(D,q,P,_,k,B,v){return T(D+(q&_|P&~_)+k+B|0,v)+q|0}function F(D,q,P,_,k,B,v){return T(D+(q^P^_)+k+B|0,v)+q|0}function R(D,q,P,_,k,B,v){return T(D+(P^(q|~_))+k+B|0,v)+q|0}I.exports=Q}),GE=Q0(($,I)=>{var E=qU().Buffer,L=XE();function S(K,Q,T,M){if(!E.isBuffer(K))K=E.from(K,"binary");if(Q){if(!E.isBuffer(Q))Q=E.from(Q,"binary");if(Q.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var H=T/8,F=E.alloc(H),R=E.alloc(M||0),D=E.alloc(0);while(H>0||M>0){var q=new L;if(q.update(D),q.update(K),Q)q.update(Q);D=q.digest();var P=0;if(H>0){var _=F.length-H;P=Math.min(H,D.length),D.copy(F,_,0,P),H-=P}if(P<D.length&&M>0){var k=R.length-M,B=Math.min(M,D.length-P);D.copy(R,k,P,P+B),M-=B}}return D.fill(0),{key:F,iv:R}}I.exports=S}),iI=Q0(($)=>{var I=(vU(),l0(jU));$.createCipher=$.Cipher=I.createCipher,$.createCipheriv=$.Cipheriv=I.createCipheriv,$.createDecipher=$.Decipher=I.createDecipher,$.createDecipheriv=$.Decipheriv=I.createDecipheriv,$.listCiphers=$.getCiphers=I.getCiphers}),EE=Q0(($,I)=>{var E=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,L=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,S=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,K=GE(),Q=iI(),T=qU().Buffer;I.exports=function(M,H){var F=M.toString(),R=F.match(E),D;if(!R){var q=F.match(S);D=T.from(q[2].replace(/[\r\n]/g,""),"base64")}else{var P="aes"+R[1],_=T.from(R[2],"hex"),k=T.from(R[3].replace(/[\r\n]/g,""),"base64"),B=K(H,_.slice(0,8),parseInt(R[1],10)).key,v=[],g=Q.createDecipheriv(P,B,_);v.push(g.update(k)),v.push(g.final()),D=T.concat(v)}var f=F.match(L)[1];return{tag:f,data:D}}}),UC=Q0(($,I)=>{var E=IE(),L=CE(),S=EE(),K=iI(),Q=dI().pbkdf2Sync,T=qU().Buffer;function M(F,R){var D=F.algorithm.decrypt.kde.kdeparams.salt,q=parseInt(F.algorithm.decrypt.kde.kdeparams.iters.toString(),10),P=L[F.algorithm.decrypt.cipher.algo.join(".")],_=F.algorithm.decrypt.cipher.iv,k=F.subjectPrivateKey,B=parseInt(P.split("-")[1],10)/8,v=Q(R,D,q,B,"sha1"),g=K.createDecipheriv(P,v,_),f=[];return f.push(g.update(k)),f.push(g.final()),T.concat(f)}function H(F){var R;if(typeof F==="object"&&!T.isBuffer(F))R=F.passphrase,F=F.key;if(typeof F==="string")F=T.from(F);var D=S(F,R),q=D.tag,P=D.data,_,k;switch(q){case"CERTIFICATE":k=E.certificate.decode(P,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!k)k=E.PublicKey.decode(P,"der");switch(_=k.algorithm.algorithm.join("."),_){case"1.2.840.113549.1.1.1":return E.RSAPublicKey.decode(k.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return k.subjectPrivateKey=k.subjectPublicKey,{type:"ec",data:k};case"1.2.840.10040.4.1":return k.algorithm.params.pub_key=E.DSAparam.decode(k.subjectPublicKey.data,"der"),{type:"dsa",data:k.algorithm.params};default:throw Error("unknown key id "+_)}case"ENCRYPTED PRIVATE KEY":P=E.EncryptedPrivateKey.decode(P,"der"),P=M(P,R);case"PRIVATE KEY":switch(k=E.PrivateKey.decode(P,"der"),_=k.algorithm.algorithm.join("."),_){case"1.2.840.113549.1.1.1":return E.RSAPrivateKey.decode(k.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:k.algorithm.curve,privateKey:E.ECPrivateKey.decode(k.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return k.algorithm.params.priv_key=E.DSAparam.decode(k.subjectPrivateKey,"der"),{type:"dsa",params:k.algorithm.params};default:throw Error("unknown key id "+_)}case"RSA PUBLIC KEY":return E.RSAPublicKey.decode(P,"der");case"RSA PRIVATE KEY":return E.RSAPrivateKey.decode(P,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:E.DSAPrivateKey.decode(P,"der")};case"EC PRIVATE KEY":return P=E.ECPrivateKey.decode(P,"der"),{curve:P.parameters.value,privateKey:P.privateKey};default:throw Error("unknown key type "+q)}}H.signature=E.signature,I.exports=H}),OC=Q0(($,I)=>{var E=GZ(),L=qU().Buffer;I.exports=function(K,Q){var T=L.alloc(0),M=0,H;while(T.length<Q)H=S(M++),T=L.concat([T,E("sha1").update(K).update(H).digest()]);return T.slice(0,Q)};function S(K){var Q=L.allocUnsafe(4);return Q.writeUInt32BE(K,0),Q}}),ZC=Q0(($,I)=>{I.exports=function(E,L){var S=E.length,K=-1;while(++K<S)E[K]^=L[K];return E}}),vA=Q0(($,I)=>{(function(E,L){function S(U,A){if(!U)throw Error(A||"Assertion failed")}function K(U,A){U.super_=A;var X=function(){};X.prototype=A.prototype,U.prototype=new X,U.prototype.constructor=U}function Q(U,A,X){if(Q.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(A==="le"||A==="be")X=A,A=10;this._init(U||0,A||10,X||"be")}}if(typeof E==="object")E.exports=Q;else L.BN=Q;Q.BN=Q,Q.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(DU(),l0(RU)).Buffer}catch(U){}Q.isBN=function(U){if(U instanceof Q)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===Q.wordSize&&Array.isArray(U.words)},Q.max=function(U,A){if(U.cmp(A)>0)return U;return A},Q.min=function(U,A){if(U.cmp(A)<0)return U;return A},Q.prototype._init=function(U,A,X){if(typeof U==="number")return this._initNumber(U,A,X);if(typeof U==="object")return this._initArray(U,A,X);if(A==="hex")A=16;S(A===(A|0)&&A>=2&&A<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(A===16)this._parseHex(U,Z,X);else if(this._parseBase(U,A,Z),X==="le")this._initArray(this.toArray(),A,X)}},Q.prototype._initNumber=function(U,A,X){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else S(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),A,X)},Q.prototype._initArray=function(U,A,X){if(S(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C,Y,V=0;if(X==="be"){for(Z=U.length-1,C=0;Z>=0;Z-=3)if(Y=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}else if(X==="le"){for(Z=0,C=0;Z<U.length;Z+=3)if(Y=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}return this.strip()};function M(U,A){var X=U.charCodeAt(A);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(U,A,X){var Z=M(U,X);if(X-1>=A)Z|=M(U,X-1)<<4;return Z}Q.prototype._parseHex=function(U,A,X){this.length=Math.ceil((U.length-A)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C=0,Y=0,V;if(X==="be")for(Z=U.length-1;Z>=A;Z-=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8;else{var G=U.length-A;for(Z=G%2===0?A+1:A;Z<U.length;Z+=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8}this.strip()};function F(U,A,X,Z){var C=0,Y=Math.min(U.length,X);for(var V=A;V<Y;V++){var G=U.charCodeAt(V)-48;if(C*=Z,G>=49)C+=G-49+10;else if(G>=17)C+=G-17+10;else C+=G}return C}Q.prototype._parseBase=function(U,A,X){this.words=[0],this.length=1;for(var Z=0,C=1;C<=67108863;C*=A)Z++;Z--,C=C/A|0;var Y=U.length-X,V=Y%Z,G=Math.min(Y,Y-V)+X,O=0;for(var J=X;J<G;J+=Z)if(O=F(U,J,J+Z,A),this.imuln(C),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(V!==0){var z=1;O=F(U,J,U.length,A);for(J=0;J<V;J++)z*=A;if(this.imuln(z),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},Q.prototype.copy=function(U){U.words=Array(this.length);for(var A=0;A<this.length;A++)U.words[A]=this.words[A];U.length=this.length,U.negative=this.negative,U.red=this.red},Q.prototype.clone=function(){var U=new Q(null);return this.copy(U),U},Q.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},Q.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Q.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Q.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var R=["","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"],D=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Q.prototype.toString=function(U,A){U=U||10,A=A|0||1;var X;if(U===16||U==="hex"){X="";var Z=0,C=0;for(var Y=0;Y<this.length;Y++){var V=this.words[Y],G=((V<<Z|C)&16777215).toString(16);if(C=V>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,Y--;if(C!==0||Y!==this.length-1)X=R[6-G.length]+G+X;else X=G+X}if(C!==0)X=C.toString(16)+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(U===(U|0)&&U>=2&&U<=36){var O=D[U],J=q[U];X="";var z=this.clone();z.negative=0;while(!z.isZero()){var W=z.modn(J).toString(U);if(z=z.idivn(J),!z.isZero())X=R[O-W.length]+W+X;else X=W+X}if(this.isZero())X="0"+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}S(!1,"Base should be between 2 and 36")},Q.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)S(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},Q.prototype.toJSON=function(){return this.toString(16)},Q.prototype.toBuffer=function(U,A){return S(typeof T<"u"),this.toArrayLike(T,U,A)},Q.prototype.toArray=function(U,A){return this.toArrayLike(Array,U,A)},Q.prototype.toArrayLike=function(U,A,X){var Z=this.byteLength(),C=X||Math.max(1,Z);S(Z<=C,"byte array longer than desired length"),S(C>0,"Requested array length <= 0"),this.strip();var Y=A==="le",V=new U(C),G,O,J=this.clone();if(!Y){for(O=0;O<C-Z;O++)V[O]=0;for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[C-O-1]=G}else{for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[O]=G;for(;O<C;O++)V[O]=0}return V},Math.clz32)Q.prototype._countBits=function(U){return 32-Math.clz32(U)};else Q.prototype._countBits=function(U){var A=U,X=0;if(A>=4096)X+=13,A>>>=13;if(A>=64)X+=7,A>>>=7;if(A>=8)X+=4,A>>>=4;if(A>=2)X+=2,A>>>=2;return X+A};Q.prototype._zeroBits=function(U){if(U===0)return 26;var A=U,X=0;if((A&8191)===0)X+=13,A>>>=13;if((A&127)===0)X+=7,A>>>=7;if((A&15)===0)X+=4,A>>>=4;if((A&3)===0)X+=2,A>>>=2;if((A&1)===0)X++;return X},Q.prototype.bitLength=function(){var U=this.words[this.length-1],A=this._countBits(U);return(this.length-1)*26+A};function P(U){var A=Array(U.bitLength());for(var X=0;X<A.length;X++){var Z=X/26|0,C=X%26;A[X]=(U.words[Z]&1<<C)>>>C}return A}Q.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var A=0;A<this.length;A++){var X=this._zeroBits(this.words[A]);if(U+=X,X!==26)break}return U},Q.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Q.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},Q.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},Q.prototype.isNeg=function(){return this.negative!==0},Q.prototype.neg=function(){return this.clone().ineg()},Q.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Q.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var A=0;A<U.length;A++)this.words[A]=this.words[A]|U.words[A];return this.strip()},Q.prototype.ior=function(U){return S((this.negative|U.negative)===0),this.iuor(U)},Q.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},Q.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},Q.prototype.iuand=function(U){var A;if(this.length>U.length)A=U;else A=this;for(var X=0;X<A.length;X++)this.words[X]=this.words[X]&U.words[X];return this.length=A.length,this.strip()},Q.prototype.iand=function(U){return S((this.negative|U.negative)===0),this.iuand(U)},Q.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},Q.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},Q.prototype.iuxor=function(U){var A,X;if(this.length>U.length)A=this,X=U;else A=U,X=this;for(var Z=0;Z<X.length;Z++)this.words[Z]=A.words[Z]^X.words[Z];if(this!==A)for(;Z<A.length;Z++)this.words[Z]=A.words[Z];return this.length=A.length,this.strip()},Q.prototype.ixor=function(U){return S((this.negative|U.negative)===0),this.iuxor(U)},Q.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},Q.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},Q.prototype.inotn=function(U){S(typeof U==="number"&&U>=0);var A=Math.ceil(U/26)|0,X=U%26;if(this._expand(A),X>0)A--;for(var Z=0;Z<A;Z++)this.words[Z]=~this.words[Z]&67108863;if(X>0)this.words[Z]=~this.words[Z]&67108863>>26-X;return this.strip()},Q.prototype.notn=function(U){return this.clone().inotn(U)},Q.prototype.setn=function(U,A){S(typeof U==="number"&&U>=0);var X=U/26|0,Z=U%26;if(this._expand(X+1),A)this.words[X]=this.words[X]|1<<Z;else this.words[X]=this.words[X]&~(1<<Z);return this.strip()},Q.prototype.iadd=function(U){var A;if(this.negative!==0&&U.negative===0)return this.negative=0,A=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,A=this.isub(U),U.negative=1,A._normSign();var X,Z;if(this.length>U.length)X=this,Z=U;else X=U,Z=this;var C=0;for(var Y=0;Y<Z.length;Y++)A=(X.words[Y]|0)+(Z.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;for(;C!==0&&Y<X.length;Y++)A=(X.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;if(this.length=X.length,C!==0)this.words[this.length]=C,this.length++;else if(X!==this)for(;Y<X.length;Y++)this.words[Y]=X.words[Y];return this},Q.prototype.add=function(U){var A;if(U.negative!==0&&this.negative===0)return U.negative=0,A=this.sub(U),U.negative^=1,A;else if(U.negative===0&&this.negative!==0)return this.negative=0,A=U.sub(this),this.negative=1,A;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},Q.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var A=this.iadd(U);return U.negative=1,A._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var X=this.cmp(U);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,C;if(X>0)Z=this,C=U;else Z=U,C=this;var Y=0;for(var V=0;V<C.length;V++)A=(Z.words[V]|0)-(C.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;for(;Y!==0&&V<Z.length;V++)A=(Z.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;if(Y===0&&V<Z.length&&Z!==this)for(;V<Z.length;V++)this.words[V]=Z.words[V];if(this.length=Math.max(this.length,V),Z!==this)this.negative=1;return this.strip()},Q.prototype.sub=function(U){return this.clone().isub(U)};function _(U,A,X){X.negative=A.negative^U.negative;var Z=U.length+A.length|0;X.length=Z,Z=Z-1|0;var C=U.words[0]|0,Y=A.words[0]|0,V=C*Y,G=V&67108863,O=V/67108864|0;X.words[0]=G;for(var J=1;J<Z;J++){var z=O>>>26,W=O&67108863,j=Math.min(J,A.length-1);for(var N=Math.max(0,J-U.length+1);N<=j;N++){var p=J-N|0;C=U.words[p]|0,Y=A.words[N]|0,V=C*Y+W,z+=V/67108864|0,W=V&67108863}X.words[J]=W|0,O=z|0}if(O!==0)X.words[J]=O|0;else X.length--;return X.strip()}var k=function(U,A,X){var Z=U.words,C=A.words,Y=X.words,V=0,G,O,J,z=Z[0]|0,W=z&8191,j=z>>>13,N=Z[1]|0,p=N&8191,n=N>>>13,E0=Z[2]|0,r=E0&8191,d=E0>>>13,A0=Z[3]|0,t=A0&8191,i=A0>>>13,N0=Z[4]|0,y=N0&8191,h=N0>>>13,$0=Z[5]|0,m=$0&8191,a=$0>>>13,W0=Z[6]|0,c=W0&8191,o=W0>>>13,x0=Z[7]|0,s=x0&8191,Z0=x0>>>13,w0=Z[8]|0,S0=w0&8191,V0=w0>>>13,m0=Z[9]|0,J0=m0&8191,L0=m0>>>13,a0=C[0]|0,K0=a0&8191,D0=a0>>>13,WU=C[1]|0,F0=WU&8191,k0=WU>>>13,FU=C[2]|0,_0=FU&8191,M0=FU>>>13,KU=C[3]|0,j0=KU&8191,z0=KU>>>13,SU=C[4]|0,v0=SU&8191,B0=SU>>>13,VU=C[5]|0,T0=VU&8191,x=VU>>>13,l=C[6]|0,e=l&8191,U0=l>>>13,f0=C[7]|0,Y0=f0&8191,R0=f0>>>13,r0=C[8]|0,q0=r0&8191,g0=r0>>>13,HU=C[9]|0,P0=HU&8191,H0=HU>>>13;X.negative=U.negative^A.negative,X.length=19,G=Math.imul(W,K0),O=Math.imul(W,D0),O=O+Math.imul(j,K0)|0,J=Math.imul(j,D0);var e0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(e0>>>26)|0,e0&=67108863,G=Math.imul(p,K0),O=Math.imul(p,D0),O=O+Math.imul(n,K0)|0,J=Math.imul(n,D0),G=G+Math.imul(W,F0)|0,O=O+Math.imul(W,k0)|0,O=O+Math.imul(j,F0)|0,J=J+Math.imul(j,k0)|0;var c0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,K0),O=Math.imul(r,D0),O=O+Math.imul(d,K0)|0,J=Math.imul(d,D0),G=G+Math.imul(p,F0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,F0)|0,J=J+Math.imul(n,k0)|0,G=G+Math.imul(W,_0)|0,O=O+Math.imul(W,M0)|0,O=O+Math.imul(j,_0)|0,J=J+Math.imul(j,M0)|0;var y0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(t,K0),O=Math.imul(t,D0),O=O+Math.imul(i,K0)|0,J=Math.imul(i,D0),G=G+Math.imul(r,F0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(d,F0)|0,J=J+Math.imul(d,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,M0)|0,O=O+Math.imul(n,_0)|0,J=J+Math.imul(n,M0)|0,G=G+Math.imul(W,j0)|0,O=O+Math.imul(W,z0)|0,O=O+Math.imul(j,j0)|0,J=J+Math.imul(j,z0)|0;var o0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(o0>>>26)|0,o0&=67108863,G=Math.imul(y,K0),O=Math.imul(y,D0),O=O+Math.imul(h,K0)|0,J=Math.imul(h,D0),G=G+Math.imul(t,F0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(i,F0)|0,J=J+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,M0)|0,O=O+Math.imul(d,_0)|0,J=J+Math.imul(d,M0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,j0)|0,J=J+Math.imul(n,z0)|0,G=G+Math.imul(W,v0)|0,O=O+Math.imul(W,B0)|0,O=O+Math.imul(j,v0)|0,J=J+Math.imul(j,B0)|0;var b0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(b0>>>26)|0,b0&=67108863,G=Math.imul(m,K0),O=Math.imul(m,D0),O=O+Math.imul(a,K0)|0,J=Math.imul(a,D0),G=G+Math.imul(y,F0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,F0)|0,J=J+Math.imul(h,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,M0)|0,O=O+Math.imul(i,_0)|0,J=J+Math.imul(i,M0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(d,j0)|0,J=J+Math.imul(d,z0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,v0)|0,J=J+Math.imul(n,B0)|0,G=G+Math.imul(W,T0)|0,O=O+Math.imul(W,x)|0,O=O+Math.imul(j,T0)|0,J=J+Math.imul(j,x)|0;var i0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,K0),O=Math.imul(c,D0),O=O+Math.imul(o,K0)|0,J=Math.imul(o,D0),G=G+Math.imul(m,F0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(a,F0)|0,J=J+Math.imul(a,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,M0)|0,O=O+Math.imul(h,_0)|0,J=J+Math.imul(h,M0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(i,j0)|0,J=J+Math.imul(i,z0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(d,v0)|0,J=J+Math.imul(d,B0)|0,G=G+Math.imul(p,T0)|0,O=O+Math.imul(p,x)|0,O=O+Math.imul(n,T0)|0,J=J+Math.imul(n,x)|0,G=G+Math.imul(W,e)|0,O=O+Math.imul(W,U0)|0,O=O+Math.imul(j,e)|0,J=J+Math.imul(j,U0)|0;var UU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,K0),O=Math.imul(s,D0),O=O+Math.imul(Z0,K0)|0,J=Math.imul(Z0,D0),G=G+Math.imul(c,F0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,F0)|0,J=J+Math.imul(o,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,M0)|0,O=O+Math.imul(a,_0)|0,J=J+Math.imul(a,M0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,j0)|0,J=J+Math.imul(h,z0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(i,v0)|0,J=J+Math.imul(i,B0)|0,G=G+Math.imul(r,T0)|0,O=O+Math.imul(r,x)|0,O=O+Math.imul(d,T0)|0,J=J+Math.imul(d,x)|0,G=G+Math.imul(p,e)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,e)|0,J=J+Math.imul(n,U0)|0,G=G+Math.imul(W,Y0)|0,O=O+Math.imul(W,R0)|0,O=O+Math.imul(j,Y0)|0,J=J+Math.imul(j,R0)|0;var OU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(S0,K0),O=Math.imul(S0,D0),O=O+Math.imul(V0,K0)|0,J=Math.imul(V0,D0),G=G+Math.imul(s,F0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,F0)|0,J=J+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,M0)|0,O=O+Math.imul(o,_0)|0,J=J+Math.imul(o,M0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(a,j0)|0,J=J+Math.imul(a,z0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,v0)|0,J=J+Math.imul(h,B0)|0,G=G+Math.imul(t,T0)|0,O=O+Math.imul(t,x)|0,O=O+Math.imul(i,T0)|0,J=J+Math.imul(i,x)|0,G=G+Math.imul(r,e)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(d,e)|0,J=J+Math.imul(d,U0)|0,G=G+Math.imul(p,Y0)|0,O=O+Math.imul(p,R0)|0,O=O+Math.imul(n,Y0)|0,J=J+Math.imul(n,R0)|0,G=G+Math.imul(W,q0)|0,O=O+Math.imul(W,g0)|0,O=O+Math.imul(j,q0)|0,J=J+Math.imul(j,g0)|0;var ZU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(J0,K0),O=Math.imul(J0,D0),O=O+Math.imul(L0,K0)|0,J=Math.imul(L0,D0),G=G+Math.imul(S0,F0)|0,O=O+Math.imul(S0,k0)|0,O=O+Math.imul(V0,F0)|0,J=J+Math.imul(V0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,M0)|0,O=O+Math.imul(Z0,_0)|0,J=J+Math.imul(Z0,M0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,j0)|0,J=J+Math.imul(o,z0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(a,v0)|0,J=J+Math.imul(a,B0)|0,G=G+Math.imul(y,T0)|0,O=O+Math.imul(y,x)|0,O=O+Math.imul(h,T0)|0,J=J+Math.imul(h,x)|0,G=G+Math.imul(t,e)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(i,e)|0,J=J+Math.imul(i,U0)|0,G=G+Math.imul(r,Y0)|0,O=O+Math.imul(r,R0)|0,O=O+Math.imul(d,Y0)|0,J=J+Math.imul(d,R0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,g0)|0,O=O+Math.imul(n,q0)|0,J=J+Math.imul(n,g0)|0,G=G+Math.imul(W,P0)|0,O=O+Math.imul(W,H0)|0,O=O+Math.imul(j,P0)|0,J=J+Math.imul(j,H0)|0;var AU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(J0,F0),O=Math.imul(J0,k0),O=O+Math.imul(L0,F0)|0,J=Math.imul(L0,k0),G=G+Math.imul(S0,_0)|0,O=O+Math.imul(S0,M0)|0,O=O+Math.imul(V0,_0)|0,J=J+Math.imul(V0,M0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,j0)|0,J=J+Math.imul(Z0,z0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,v0)|0,J=J+Math.imul(o,B0)|0,G=G+Math.imul(m,T0)|0,O=O+Math.imul(m,x)|0,O=O+Math.imul(a,T0)|0,J=J+Math.imul(a,x)|0,G=G+Math.imul(y,e)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,e)|0,J=J+Math.imul(h,U0)|0,G=G+Math.imul(t,Y0)|0,O=O+Math.imul(t,R0)|0,O=O+Math.imul(i,Y0)|0,J=J+Math.imul(i,R0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,g0)|0,O=O+Math.imul(d,q0)|0,J=J+Math.imul(d,g0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,H0)|0,O=O+Math.imul(n,P0)|0,J=J+Math.imul(n,H0)|0;var $U=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(J0,_0),O=Math.imul(J0,M0),O=O+Math.imul(L0,_0)|0,J=Math.imul(L0,M0),G=G+Math.imul(S0,j0)|0,O=O+Math.imul(S0,z0)|0,O=O+Math.imul(V0,j0)|0,J=J+Math.imul(V0,z0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,v0)|0,J=J+Math.imul(Z0,B0)|0,G=G+Math.imul(c,T0)|0,O=O+Math.imul(c,x)|0,O=O+Math.imul(o,T0)|0,J=J+Math.imul(o,x)|0,G=G+Math.imul(m,e)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(a,e)|0,J=J+Math.imul(a,U0)|0,G=G+Math.imul(y,Y0)|0,O=O+Math.imul(y,R0)|0,O=O+Math.imul(h,Y0)|0,J=J+Math.imul(h,R0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,g0)|0,O=O+Math.imul(i,q0)|0,J=J+Math.imul(i,g0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,H0)|0,O=O+Math.imul(d,P0)|0,J=J+Math.imul(d,H0)|0;var IU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,G=Math.imul(J0,j0),O=Math.imul(J0,z0),O=O+Math.imul(L0,j0)|0,J=Math.imul(L0,z0),G=G+Math.imul(S0,v0)|0,O=O+Math.imul(S0,B0)|0,O=O+Math.imul(V0,v0)|0,J=J+Math.imul(V0,B0)|0,G=G+Math.imul(s,T0)|0,O=O+Math.imul(s,x)|0,O=O+Math.imul(Z0,T0)|0,J=J+Math.imul(Z0,x)|0,G=G+Math.imul(c,e)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,e)|0,J=J+Math.imul(o,U0)|0,G=G+Math.imul(m,Y0)|0,O=O+Math.imul(m,R0)|0,O=O+Math.imul(a,Y0)|0,J=J+Math.imul(a,R0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,g0)|0,O=O+Math.imul(h,q0)|0,J=J+Math.imul(h,g0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,H0)|0,O=O+Math.imul(i,P0)|0,J=J+Math.imul(i,H0)|0;var CU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(CU>>>26)|0,CU&=67108863,G=Math.imul(J0,v0),O=Math.imul(J0,B0),O=O+Math.imul(L0,v0)|0,J=Math.imul(L0,B0),G=G+Math.imul(S0,T0)|0,O=O+Math.imul(S0,x)|0,O=O+Math.imul(V0,T0)|0,J=J+Math.imul(V0,x)|0,G=G+Math.imul(s,e)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,e)|0,J=J+Math.imul(Z0,U0)|0,G=G+Math.imul(c,Y0)|0,O=O+Math.imul(c,R0)|0,O=O+Math.imul(o,Y0)|0,J=J+Math.imul(o,R0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,g0)|0,O=O+Math.imul(a,q0)|0,J=J+Math.imul(a,g0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,H0)|0,O=O+Math.imul(h,P0)|0,J=J+Math.imul(h,H0)|0;var QU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(J0,T0),O=Math.imul(J0,x),O=O+Math.imul(L0,T0)|0,J=Math.imul(L0,x),G=G+Math.imul(S0,e)|0,O=O+Math.imul(S0,U0)|0,O=O+Math.imul(V0,e)|0,J=J+Math.imul(V0,U0)|0,G=G+Math.imul(s,Y0)|0,O=O+Math.imul(s,R0)|0,O=O+Math.imul(Z0,Y0)|0,J=J+Math.imul(Z0,R0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,g0)|0,O=O+Math.imul(o,q0)|0,J=J+Math.imul(o,g0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,H0)|0,O=O+Math.imul(a,P0)|0,J=J+Math.imul(a,H0)|0;var XU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(J0,e),O=Math.imul(J0,U0),O=O+Math.imul(L0,e)|0,J=Math.imul(L0,U0),G=G+Math.imul(S0,Y0)|0,O=O+Math.imul(S0,R0)|0,O=O+Math.imul(V0,Y0)|0,J=J+Math.imul(V0,R0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,g0)|0,O=O+Math.imul(Z0,q0)|0,J=J+Math.imul(Z0,g0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,H0)|0,O=O+Math.imul(o,P0)|0,J=J+Math.imul(o,H0)|0;var GU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(J0,Y0),O=Math.imul(J0,R0),O=O+Math.imul(L0,Y0)|0,J=Math.imul(L0,R0),G=G+Math.imul(S0,q0)|0,O=O+Math.imul(S0,g0)|0,O=O+Math.imul(V0,q0)|0,J=J+Math.imul(V0,g0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,H0)|0,O=O+Math.imul(Z0,P0)|0,J=J+Math.imul(Z0,H0)|0;var EU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(J0,q0),O=Math.imul(J0,g0),O=O+Math.imul(L0,q0)|0,J=Math.imul(L0,g0),G=G+Math.imul(S0,P0)|0,O=O+Math.imul(S0,H0)|0,O=O+Math.imul(V0,P0)|0,J=J+Math.imul(V0,H0)|0;var JU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(J0,P0),O=Math.imul(J0,H0),O=O+Math.imul(L0,P0)|0,J=Math.imul(L0,H0);var YU=(V+G|0)+((O&8191)<<13)|0;if(V=(J+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,Y[0]=e0,Y[1]=c0,Y[2]=y0,Y[3]=o0,Y[4]=b0,Y[5]=i0,Y[6]=UU,Y[7]=OU,Y[8]=ZU,Y[9]=AU,Y[10]=$U,Y[11]=IU,Y[12]=CU,Y[13]=QU,Y[14]=XU,Y[15]=GU,Y[16]=EU,Y[17]=JU,Y[18]=YU,V!==0)Y[19]=V,X.length++;return X};if(!Math.imul)k=_;function B(U,A,X){X.negative=A.negative^U.negative,X.length=U.length+A.length;var Z=0,C=0;for(var Y=0;Y<X.length-1;Y++){var V=C;C=0;var G=Z&67108863,O=Math.min(Y,A.length-1);for(var J=Math.max(0,Y-U.length+1);J<=O;J++){var z=Y-J,W=U.words[z]|0,j=A.words[J]|0,N=W*j,p=N&67108863;V=V+(N/67108864|0)|0,p=p+G|0,G=p&67108863,V=V+(p>>>26)|0,C+=V>>>26,V&=67108863}X.words[Y]=G,Z=V,V=C}if(Z!==0)X.words[Y]=Z;else X.length--;return X.strip()}function v(U,A,X){var Z=new g;return Z.mulp(U,A,X)}Q.prototype.mulTo=function(U,A){var X,Z=this.length+U.length;if(this.length===10&&U.length===10)X=k(this,U,A);else if(Z<63)X=_(this,U,A);else if(Z<1024)X=B(this,U,A);else X=v(this,U,A);return X};function g(U,A){this.x=U,this.y=A}g.prototype.makeRBT=function(U){var A=Array(U),X=Q.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)A[Z]=this.revBin(Z,X,U);return A},g.prototype.revBin=function(U,A,X){if(U===0||U===X-1)return U;var Z=0;for(var C=0;C<A;C++)Z|=(U&1)<<A-C-1,U>>=1;return Z},g.prototype.permute=function(U,A,X,Z,C,Y){for(var V=0;V<Y;V++)Z[V]=A[U[V]],C[V]=X[U[V]]},g.prototype.transform=function(U,A,X,Z,C,Y){this.permute(Y,U,A,X,Z,C);for(var V=1;V<C;V<<=1){var G=V<<1,O=Math.cos(2*Math.PI/G),J=Math.sin(2*Math.PI/G);for(var z=0;z<C;z+=G){var W=O,j=J;for(var N=0;N<V;N++){var p=X[z+N],n=Z[z+N],E0=X[z+N+V],r=Z[z+N+V],d=W*E0-j*r;if(r=W*r+j*E0,E0=d,X[z+N]=p+E0,Z[z+N]=n+r,X[z+N+V]=p-E0,Z[z+N+V]=n-r,N!==G)d=O*W-J*j,j=O*j+J*W,W=d}}}},g.prototype.guessLen13b=function(U,A){var X=Math.max(A,U)|1,Z=X&1,C=0;for(X=X/2|0;X;X=X>>>1)C++;return 1<<C+1+Z},g.prototype.conjugate=function(U,A,X){if(X<=1)return;for(var Z=0;Z<X/2;Z++){var C=U[Z];U[Z]=U[X-Z-1],U[X-Z-1]=C,C=A[Z],A[Z]=-A[X-Z-1],A[X-Z-1]=-C}},g.prototype.normalize13b=function(U,A){var X=0;for(var Z=0;Z<A/2;Z++){var C=Math.round(U[2*Z+1]/A)*8192+Math.round(U[2*Z]/A)+X;if(U[Z]=C&67108863,C<67108864)X=0;else X=C/67108864|0}return U},g.prototype.convert13b=function(U,A,X,Z){var C=0;for(var Y=0;Y<A;Y++)C=C+(U[Y]|0),X[2*Y]=C&8191,C=C>>>13,X[2*Y+1]=C&8191,C=C>>>13;for(Y=2*A;Y<Z;++Y)X[Y]=0;S(C===0),S((C&-8192)===0)},g.prototype.stub=function(U){var A=Array(U);for(var X=0;X<U;X++)A[X]=0;return A},g.prototype.mulp=function(U,A,X){var Z=2*this.guessLen13b(U.length,A.length),C=this.makeRBT(Z),Y=this.stub(Z),V=Array(Z),G=Array(Z),O=Array(Z),J=Array(Z),z=Array(Z),W=Array(Z),j=X.words;j.length=Z,this.convert13b(U.words,U.length,V,Z),this.convert13b(A.words,A.length,J,Z),this.transform(V,Y,G,O,Z,C),this.transform(J,Y,z,W,Z,C);for(var N=0;N<Z;N++){var p=G[N]*z[N]-O[N]*W[N];O[N]=G[N]*W[N]+O[N]*z[N],G[N]=p}return this.conjugate(G,O,Z),this.transform(G,O,j,Y,Z,C),this.conjugate(j,Y,Z),this.normalize13b(j,Z),X.negative=U.negative^A.negative,X.length=U.length+A.length,X.strip()},Q.prototype.mul=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),this.mulTo(U,A)},Q.prototype.mulf=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),v(this,U,A)},Q.prototype.imul=function(U){return this.clone().mulTo(U,this)},Q.prototype.imuln=function(U){S(typeof U==="number"),S(U<67108864);var A=0;for(var X=0;X<this.length;X++){var Z=(this.words[X]|0)*U,C=(Z&67108863)+(A&67108863);A>>=26,A+=Z/67108864|0,A+=C>>>26,this.words[X]=C&67108863}if(A!==0)this.words[X]=A,this.length++;return this.length=U===0?1:this.length,this},Q.prototype.muln=function(U){return this.clone().imuln(U)},Q.prototype.sqr=function(){return this.mul(this)},Q.prototype.isqr=function(){return this.imul(this.clone())},Q.prototype.pow=function(U){var A=P(U);if(A.length===0)return new Q(1);var X=this;for(var Z=0;Z<A.length;Z++,X=X.sqr())if(A[Z]!==0)break;if(++Z<A.length)for(var C=X.sqr();Z<A.length;Z++,C=C.sqr()){if(A[Z]===0)continue;X=X.mul(C)}return X},Q.prototype.iushln=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=67108863>>>26-A<<26-A,C;if(A!==0){var Y=0;for(C=0;C<this.length;C++){var V=this.words[C]&Z,G=(this.words[C]|0)-V<<A;this.words[C]=G|Y,Y=V>>>26-A}if(Y)this.words[C]=Y,this.length++}if(X!==0){for(C=this.length-1;C>=0;C--)this.words[C+X]=this.words[C];for(C=0;C<X;C++)this.words[C]=0;this.length+=X}return this.strip()},Q.prototype.ishln=function(U){return S(this.negative===0),this.iushln(U)},Q.prototype.iushrn=function(U,A,X){S(typeof U==="number"&&U>=0);var Z;if(A)Z=(A-A%26)/26;else Z=0;var C=U%26,Y=Math.min((U-C)/26,this.length),V=67108863^67108863>>>C<<C,G=X;if(Z-=Y,Z=Math.max(0,Z),G){for(var O=0;O<Y;O++)G.words[O]=this.words[O];G.length=Y}if(Y===0);else if(this.length>Y){this.length-=Y;for(O=0;O<this.length;O++)this.words[O]=this.words[O+Y]}else this.words[0]=0,this.length=1;var J=0;for(O=this.length-1;O>=0&&(J!==0||O>=Z);O--){var z=this.words[O]|0;this.words[O]=J<<26-C|z>>>C,J=z&V}if(G&&J!==0)G.words[G.length++]=J;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Q.prototype.ishrn=function(U,A,X){return S(this.negative===0),this.iushrn(U,A,X)},Q.prototype.shln=function(U){return this.clone().ishln(U)},Q.prototype.ushln=function(U){return this.clone().iushln(U)},Q.prototype.shrn=function(U){return this.clone().ishrn(U)},Q.prototype.ushrn=function(U){return this.clone().iushrn(U)},Q.prototype.testn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return!1;var C=this.words[X];return!!(C&Z)},Q.prototype.imaskn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26;if(S(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(A!==0)X++;if(this.length=Math.min(X,this.length),A!==0){var Z=67108863^67108863>>>A<<A;this.words[this.length-1]&=Z}return this.strip()},Q.prototype.maskn=function(U){return this.clone().imaskn(U)},Q.prototype.iaddn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},Q.prototype._iaddn=function(U){this.words[0]+=U;for(var A=0;A<this.length&&this.words[A]>=67108864;A++)if(this.words[A]-=67108864,A===this.length-1)this.words[A+1]=1;else this.words[A+1]++;return this.length=Math.max(this.length,A+1),this},Q.prototype.isubn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var A=0;A<this.length&&this.words[A]<0;A++)this.words[A]+=67108864,this.words[A+1]-=1;return this.strip()},Q.prototype.addn=function(U){return this.clone().iaddn(U)},Q.prototype.subn=function(U){return this.clone().isubn(U)},Q.prototype.iabs=function(){return this.negative=0,this},Q.prototype.abs=function(){return this.clone().iabs()},Q.prototype._ishlnsubmul=function(U,A,X){var Z=U.length+X,C;this._expand(Z);var Y,V=0;for(C=0;C<U.length;C++){Y=(this.words[C+X]|0)+V;var G=(U.words[C]|0)*A;Y-=G&67108863,V=(Y>>26)-(G/67108864|0),this.words[C+X]=Y&67108863}for(;C<this.length-X;C++)Y=(this.words[C+X]|0)+V,V=Y>>26,this.words[C+X]=Y&67108863;if(V===0)return this.strip();S(V===-1),V=0;for(C=0;C<this.length;C++)Y=-(this.words[C]|0)+V,V=Y>>26,this.words[C]=Y&67108863;return this.negative=1,this.strip()},Q.prototype._wordDiv=function(U,A){var X=this.length-U.length,Z=this.clone(),C=U,Y=C.words[C.length-1]|0,V=this._countBits(Y);if(X=26-V,X!==0)C=C.ushln(X),Z.iushln(X),Y=C.words[C.length-1]|0;var G=Z.length-C.length,O;if(A!=="mod"){O=new Q(null),O.length=G+1,O.words=Array(O.length);for(var J=0;J<O.length;J++)O.words[J]=0}var z=Z.clone()._ishlnsubmul(C,1,G);if(z.negative===0){if(Z=z,O)O.words[G]=1}for(var W=G-1;W>=0;W--){var j=(Z.words[C.length+W]|0)*67108864+(Z.words[C.length+W-1]|0);j=Math.min(j/Y|0,67108863),Z._ishlnsubmul(C,j,W);while(Z.negative!==0)if(j--,Z.negative=0,Z._ishlnsubmul(C,1,W),!Z.isZero())Z.negative^=1;if(O)O.words[W]=j}if(O)O.strip();if(Z.strip(),A!=="div"&&X!==0)Z.iushrn(X);return{div:O||null,mod:Z}},Q.prototype.divmod=function(U,A,X){if(S(!U.isZero()),this.isZero())return{div:new Q(0),mod:new Q(0)};var Z,C,Y;if(this.negative!==0&&U.negative===0){if(Y=this.neg().divmod(U,A),A!=="mod")Z=Y.div.neg();if(A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.iadd(U)}return{div:Z,mod:C}}if(this.negative===0&&U.negative!==0){if(Y=this.divmod(U.neg(),A),A!=="mod")Z=Y.div.neg();return{div:Z,mod:Y.mod}}if((this.negative&U.negative)!==0){if(Y=this.neg().divmod(U.neg(),A),A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.isub(U)}return{div:Y.div,mod:C}}if(U.length>this.length||this.cmp(U)<0)return{div:new Q(0),mod:this};if(U.length===1){if(A==="div")return{div:this.divn(U.words[0]),mod:null};if(A==="mod")return{div:null,mod:new Q(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new Q(this.modn(U.words[0]))}}return this._wordDiv(U,A)},Q.prototype.div=function(U){return this.divmod(U,"div",!1).div},Q.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},Q.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},Q.prototype.divRound=function(U){var A=this.divmod(U);if(A.mod.isZero())return A.div;var X=A.div.negative!==0?A.mod.isub(U):A.mod,Z=U.ushrn(1),C=U.andln(1),Y=X.cmp(Z);if(Y<0||C===1&&Y===0)return A.div;return A.div.negative!==0?A.div.isubn(1):A.div.iaddn(1)},Q.prototype.modn=function(U){S(U<=67108863);var A=67108864%U,X=0;for(var Z=this.length-1;Z>=0;Z--)X=(A*X+(this.words[Z]|0))%U;return X},Q.prototype.idivn=function(U){S(U<=67108863);var A=0;for(var X=this.length-1;X>=0;X--){var Z=(this.words[X]|0)+A*67108864;this.words[X]=Z/U|0,A=Z%U}return this.strip()},Q.prototype.divn=function(U){return this.clone().idivn(U)},Q.prototype.egcd=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=new Q(0),V=new Q(1),G=0;while(A.isEven()&&X.isEven())A.iushrn(1),X.iushrn(1),++G;var O=X.clone(),J=A.clone();while(!A.isZero()){for(var z=0,W=1;(A.words[0]&W)===0&&z<26;++z,W<<=1);if(z>0){A.iushrn(z);while(z-- >0){if(Z.isOdd()||C.isOdd())Z.iadd(O),C.isub(J);Z.iushrn(1),C.iushrn(1)}}for(var j=0,N=1;(X.words[0]&N)===0&&j<26;++j,N<<=1);if(j>0){X.iushrn(j);while(j-- >0){if(Y.isOdd()||V.isOdd())Y.iadd(O),V.isub(J);Y.iushrn(1),V.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(Y),C.isub(V);else X.isub(A),Y.isub(Z),V.isub(C)}return{a:Y,b:V,gcd:X.iushln(G)}},Q.prototype._invmp=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=X.clone();while(A.cmpn(1)>0&&X.cmpn(1)>0){for(var V=0,G=1;(A.words[0]&G)===0&&V<26;++V,G<<=1);if(V>0){A.iushrn(V);while(V-- >0){if(Z.isOdd())Z.iadd(Y);Z.iushrn(1)}}for(var O=0,J=1;(X.words[0]&J)===0&&O<26;++O,J<<=1);if(O>0){X.iushrn(O);while(O-- >0){if(C.isOdd())C.iadd(Y);C.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(C);else X.isub(A),C.isub(Z)}var z;if(A.cmpn(1)===0)z=Z;else z=C;if(z.cmpn(0)<0)z.iadd(U);return z},Q.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var A=this.clone(),X=U.clone();A.negative=0,X.negative=0;for(var Z=0;A.isEven()&&X.isEven();Z++)A.iushrn(1),X.iushrn(1);do{while(A.isEven())A.iushrn(1);while(X.isEven())X.iushrn(1);var C=A.cmp(X);if(C<0){var Y=A;A=X,X=Y}else if(C===0||X.cmpn(1)===0)break;A.isub(X)}while(!0);return X.iushln(Z)},Q.prototype.invm=function(U){return this.egcd(U).a.umod(U)},Q.prototype.isEven=function(){return(this.words[0]&1)===0},Q.prototype.isOdd=function(){return(this.words[0]&1)===1},Q.prototype.andln=function(U){return this.words[0]&U},Q.prototype.bincn=function(U){S(typeof U==="number");var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return this._expand(X+1),this.words[X]|=Z,this;var C=Z;for(var Y=X;C!==0&&Y<this.length;Y++){var V=this.words[Y]|0;V+=C,C=V>>>26,V&=67108863,this.words[Y]=V}if(C!==0)this.words[Y]=C,this.length++;return this},Q.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Q.prototype.cmpn=function(U){var A=U<0;if(this.negative!==0&&!A)return-1;if(this.negative===0&&A)return 1;this.strip();var X;if(this.length>1)X=1;else{if(A)U=-U;S(U<=67108863,"Number is too big");var Z=this.words[0]|0;X=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-X|0;return X},Q.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var A=this.ucmp(U);if(this.negative!==0)return-A|0;return A},Q.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var A=0;for(var X=this.length-1;X>=0;X--){var Z=this.words[X]|0,C=U.words[X]|0;if(Z===C)continue;if(Z<C)A=-1;else if(Z>C)A=1;break}return A},Q.prototype.gtn=function(U){return this.cmpn(U)===1},Q.prototype.gt=function(U){return this.cmp(U)===1},Q.prototype.gten=function(U){return this.cmpn(U)>=0},Q.prototype.gte=function(U){return this.cmp(U)>=0},Q.prototype.ltn=function(U){return this.cmpn(U)===-1},Q.prototype.lt=function(U){return this.cmp(U)===-1},Q.prototype.lten=function(U){return this.cmpn(U)<=0},Q.prototype.lte=function(U){return this.cmp(U)<=0},Q.prototype.eqn=function(U){return this.cmpn(U)===0},Q.prototype.eq=function(U){return this.cmp(U)===0},Q.red=function(U){return new u(U)},Q.prototype.toRed=function(U){return S(!this.red,"Already a number in reduction context"),S(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},Q.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Q.prototype._forceRed=function(U){return this.red=U,this},Q.prototype.forceRed=function(U){return S(!this.red,"Already a number in reduction context"),this._forceRed(U)},Q.prototype.redAdd=function(U){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},Q.prototype.redIAdd=function(U){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},Q.prototype.redSub=function(U){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},Q.prototype.redISub=function(U){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},Q.prototype.redShl=function(U){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},Q.prototype.redMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},Q.prototype.redIMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},Q.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Q.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Q.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Q.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Q.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Q.prototype.redPow=function(U){return S(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,A){this.name=U,this.p=new Q(A,16),this.n=this.p.bitLength(),this.k=new Q(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new Q(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var A=U,X;do this.split(A,this.tmp),A=this.imulK(A),A=A.iadd(this.tmp),X=A.bitLength();while(X>this.n);var Z=X<this.n?-1:A.ucmp(this.p);if(Z===0)A.words[0]=0,A.length=1;else if(Z>0)A.isub(this.p);else if(A.strip!==void 0)A.strip();else A._strip();return A},w.prototype.split=function(U,A){U.iushrn(this.n,0,A)},w.prototype.imulK=function(U){return U.imul(this.k)};function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(b,w),b.prototype.split=function(U,A){var X=4194303,Z=Math.min(U.length,9);for(var C=0;C<Z;C++)A.words[C]=U.words[C];if(A.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var Y=U.words[9];A.words[A.length++]=Y&X;for(C=10;C<U.length;C++){var V=U.words[C]|0;U.words[C-10]=(V&X)<<4|Y>>>22,Y=V}if(Y>>>=22,U.words[C-10]=Y,Y===0&&U.length>10)U.length-=10;else U.length-=9},b.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var A=0;for(var X=0;X<U.length;X++){var Z=U.words[X]|0;A+=Z*977,U.words[X]=A&67108863,A=Z*64+(A/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function I0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(I0,w);function X0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K(X0,w);function C0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(C0,w),C0.prototype.imulK=function(U){var A=0;for(var X=0;X<U.length;X++){var Z=(U.words[X]|0)*19+A,C=Z&67108863;Z>>>=26,U.words[X]=C,A=Z}if(A!==0)U.words[U.length++]=A;return U},Q._prime=function(U){if(f[U])return f[U];var A;if(U==="k256")A=new b;else if(U==="p224")A=new I0;else if(U==="p192")A=new X0;else if(U==="p25519")A=new C0;else throw Error("Unknown prime "+U);return f[U]=A,A};function u(U){if(typeof U==="string"){var A=Q._prime(U);this.m=A.p,this.prime=A}else S(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){S(U.negative===0,"red works only with positives"),S(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,A){S((U.negative|A.negative)===0,"red works only with positives"),S(U.red&&U.red===A.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,A){this._verify2(U,A);var X=U.add(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},u.prototype.iadd=function(U,A){this._verify2(U,A);var X=U.iadd(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X},u.prototype.sub=function(U,A){this._verify2(U,A);var X=U.sub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},u.prototype.isub=function(U,A){this._verify2(U,A);var X=U.isub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X},u.prototype.shl=function(U,A){return this._verify1(U),this.imod(U.ushln(A))},u.prototype.imul=function(U,A){return this._verify2(U,A),this.imod(U.imul(A))},u.prototype.mul=function(U,A){return this._verify2(U,A),this.imod(U.mul(A))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var A=this.m.andln(3);if(S(A%2===1),A===3){var X=this.m.add(new Q(1)).iushrn(2);return this.pow(U,X)}var Z=this.m.subn(1),C=0;while(!Z.isZero()&&Z.andln(1)===0)C++,Z.iushrn(1);S(!Z.isZero());var Y=new Q(1).toRed(this),V=Y.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new Q(2*O*O).toRed(this);while(this.pow(O,G).cmp(V)!==0)O.redIAdd(V);var J=this.pow(O,Z),z=this.pow(U,Z.addn(1).iushrn(1)),W=this.pow(U,Z),j=C;while(W.cmp(Y)!==0){var N=W;for(var p=0;N.cmp(Y)!==0;p++)N=N.redSqr();S(p<j);var n=this.pow(J,new Q(1).iushln(j-p-1));z=z.redMul(n),J=n.redSqr(),W=W.redMul(J),j=p}return z},u.prototype.invm=function(U){var A=U._invmp(this.m);if(A.negative!==0)return A.negative=0,this.imod(A).redNeg();else return this.imod(A)},u.prototype.pow=function(U,A){if(A.isZero())return new Q(1).toRed(this);if(A.cmpn(1)===0)return U.clone();var X=4,Z=Array(1<<X);Z[0]=new Q(1).toRed(this),Z[1]=U;for(var C=2;C<Z.length;C++)Z[C]=this.mul(Z[C-1],U);var Y=Z[0],V=0,G=0,O=A.bitLength()%26;if(O===0)O=26;for(C=A.length-1;C>=0;C--){var J=A.words[C];for(var z=O-1;z>=0;z--){var W=J>>z&1;if(Y!==Z[0])Y=this.sqr(Y);if(W===0&&V===0){G=0;continue}if(V<<=1,V|=W,G++,G!==X&&(C!==0||z!==0))continue;Y=this.mul(Y,Z[V]),G=0,V=0}O=26}return Y},u.prototype.convertTo=function(U){var A=U.umod(this.m);return A===U?A.clone():A},u.prototype.convertFrom=function(U){var A=U.clone();return A.red=null,A},Q.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Q(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)}K(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var A=this.imod(U.mul(this.rinv));return A.red=null,A},O0.prototype.imul=function(U,A){if(U.isZero()||A.isZero())return U.words[0]=0,U.length=1,U;var X=U.imul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.mul=function(U,A){if(U.isZero()||A.isZero())return new Q(0)._forceRed(this);var X=U.mul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.invm=function(U){var A=this.imod(U._invmp(this.m).mul(this.r2));return A._forceRed(this)}})(typeof I>"u"||I,$)}),AC=Q0(($,I)=>{var E=vA(),L=qU().Buffer;function S(K,Q){return L.from(K.toRed(E.mont(Q.modulus)).redPow(new E(Q.publicExponent)).fromRed().toArray())}I.exports=S}),JE=Q0(($,I)=>{(function(E,L){function S(Z,C){if(!Z)throw Error(C||"Assertion failed")}function K(Z,C){Z.super_=C;var Y=function(){};Y.prototype=C.prototype,Z.prototype=new Y,Z.prototype.constructor=Z}function Q(Z,C,Y){if(Q.isBN(Z))return Z;if(this.negative=0,this.words=null,this.length=0,this.red=null,Z!==null){if(C==="le"||C==="be")Y=C,C=10;this._init(Z||0,C||10,Y||"be")}}if(typeof E==="object")E.exports=Q;else L.BN=Q;Q.BN=Q,Q.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(DU(),l0(RU)).Buffer}catch(Z){}Q.isBN=function(Z){if(Z instanceof Q)return!0;return Z!==null&&typeof Z==="object"&&Z.constructor.wordSize===Q.wordSize&&Array.isArray(Z.words)},Q.max=function(Z,C){if(Z.cmp(C)>0)return Z;return C},Q.min=function(Z,C){if(Z.cmp(C)<0)return Z;return C},Q.prototype._init=function(Z,C,Y){if(typeof Z==="number")return this._initNumber(Z,C,Y);if(typeof Z==="object")return this._initArray(Z,C,Y);if(C==="hex")C=16;S(C===(C|0)&&C>=2&&C<=36),Z=Z.toString().replace(/\s+/g,"");var V=0;if(Z[0]==="-")V++,this.negative=1;if(V<Z.length){if(C===16)this._parseHex(Z,V,Y);else if(this._parseBase(Z,C,V),Y==="le")this._initArray(this.toArray(),C,Y)}},Q.prototype._initNumber=function(Z,C,Y){if(Z<0)this.negative=1,Z=-Z;if(Z<67108864)this.words=[Z&67108863],this.length=1;else if(Z<4503599627370496)this.words=[Z&67108863,Z/67108864&67108863],this.length=2;else S(Z<9007199254740992),this.words=[Z&67108863,Z/67108864&67108863,1],this.length=3;if(Y!=="le")return;this._initArray(this.toArray(),C,Y)},Q.prototype._initArray=function(Z,C,Y){if(S(typeof Z.length==="number"),Z.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Z.length/3),this.words=Array(this.length);for(var V=0;V<this.length;V++)this.words[V]=0;var G,O,J=0;if(Y==="be"){for(V=Z.length-1,G=0;V>=0;V-=3)if(O=Z[V]|Z[V-1]<<8|Z[V-2]<<16,this.words[G]|=O<<J&67108863,this.words[G+1]=O>>>26-J&67108863,J+=24,J>=26)J-=26,G++}else if(Y==="le"){for(V=0,G=0;V<Z.length;V+=3)if(O=Z[V]|Z[V+1]<<8|Z[V+2]<<16,this.words[G]|=O<<J&67108863,this.words[G+1]=O>>>26-J&67108863,J+=24,J>=26)J-=26,G++}return this._strip()};function M(Z,C){var Y=Z.charCodeAt(C);if(Y>=48&&Y<=57)return Y-48;else if(Y>=65&&Y<=70)return Y-55;else if(Y>=97&&Y<=102)return Y-87;else S(!1,"Invalid character in "+Z)}function H(Z,C,Y){var V=M(Z,Y);if(Y-1>=C)V|=M(Z,Y-1)<<4;return V}Q.prototype._parseHex=function(Z,C,Y){this.length=Math.ceil((Z.length-C)/6),this.words=Array(this.length);for(var V=0;V<this.length;V++)this.words[V]=0;var G=0,O=0,J;if(Y==="be")for(V=Z.length-1;V>=C;V-=2)if(J=H(Z,C,V)<<G,this.words[O]|=J&67108863,G>=18)G-=18,O+=1,this.words[O]|=J>>>26;else G+=8;else{var z=Z.length-C;for(V=z%2===0?C+1:C;V<Z.length;V+=2)if(J=H(Z,C,V)<<G,this.words[O]|=J&67108863,G>=18)G-=18,O+=1,this.words[O]|=J>>>26;else G+=8}this._strip()};function F(Z,C,Y,V){var G=0,O=0,J=Math.min(Z.length,Y);for(var z=C;z<J;z++){var W=Z.charCodeAt(z)-48;if(G*=V,W>=49)O=W-49+10;else if(W>=17)O=W-17+10;else O=W;S(W>=0&&O<V,"Invalid character"),G+=O}return G}Q.prototype._parseBase=function(Z,C,Y){this.words=[0],this.length=1;for(var V=0,G=1;G<=67108863;G*=C)V++;V--,G=G/C|0;var O=Z.length-Y,J=O%V,z=Math.min(O,O-J)+Y,W=0;for(var j=Y;j<z;j+=V)if(W=F(Z,j,j+V,C),this.imuln(G),this.words[0]+W<67108864)this.words[0]+=W;else this._iaddn(W);if(J!==0){var N=1;W=F(Z,j,Z.length,C);for(j=0;j<J;j++)N*=C;if(this.imuln(N),this.words[0]+W<67108864)this.words[0]+=W;else this._iaddn(W)}this._strip()},Q.prototype.copy=function(Z){Z.words=Array(this.length);for(var C=0;C<this.length;C++)Z.words[C]=this.words[C];Z.length=this.length,Z.negative=this.negative,Z.red=this.red};function R(Z,C){Z.words=C.words,Z.length=C.length,Z.negative=C.negative,Z.red=C.red}if(Q.prototype._move=function(Z){R(Z,this)},Q.prototype.clone=function(){var Z=new Q(null);return this.copy(Z),Z},Q.prototype._expand=function(Z){while(this.length<Z)this.words[this.length++]=0;return this},Q.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Q.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{Q.prototype[Symbol.for("nodejs.util.inspect.custom")]=D}catch(Z){Q.prototype.inspect=D}else Q.prototype.inspect=D;function D(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var q=["","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"],P=[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],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Q.prototype.toString=function(Z,C){Z=Z||10,C=C|0||1;var Y;if(Z===16||Z==="hex"){Y="";var V=0,G=0;for(var O=0;O<this.length;O++){var J=this.words[O],z=((J<<V|G)&16777215).toString(16);if(G=J>>>24-V&16777215,V+=2,V>=26)V-=26,O--;if(G!==0||O!==this.length-1)Y=q[6-z.length]+z+Y;else Y=z+Y}if(G!==0)Y=G.toString(16)+Y;while(Y.length%C!==0)Y="0"+Y;if(this.negative!==0)Y="-"+Y;return Y}if(Z===(Z|0)&&Z>=2&&Z<=36){var W=P[Z],j=_[Z];Y="";var N=this.clone();N.negative=0;while(!N.isZero()){var p=N.modrn(j).toString(Z);if(N=N.idivn(j),!N.isZero())Y=q[W-p.length]+p+Y;else Y=p+Y}if(this.isZero())Y="0"+Y;while(Y.length%C!==0)Y="0"+Y;if(this.negative!==0)Y="-"+Y;return Y}S(!1,"Base should be between 2 and 36")},Q.prototype.toNumber=function(){var Z=this.words[0];if(this.length===2)Z+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Z+=4503599627370496+this.words[1]*67108864;else if(this.length>2)S(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Z:Z},Q.prototype.toJSON=function(){return this.toString(16,2)},T)Q.prototype.toBuffer=function(Z,C){return this.toArrayLike(T,Z,C)};Q.prototype.toArray=function(Z,C){return this.toArrayLike(Array,Z,C)};var k=function(Z,C){if(Z.allocUnsafe)return Z.allocUnsafe(C);return new Z(C)};if(Q.prototype.toArrayLike=function(Z,C,Y){this._strip();var V=this.byteLength(),G=Y||Math.max(1,V);S(V<=G,"byte array longer than desired length"),S(G>0,"Requested array length <= 0");var O=k(Z,G),J=C==="le"?"LE":"BE";return this["_toArrayLike"+J](O,V),O},Q.prototype._toArrayLikeLE=function(Z,C){var Y=0,V=0;for(var G=0,O=0;G<this.length;G++){var J=this.words[G]<<O|V;if(Z[Y++]=J&255,Y<Z.length)Z[Y++]=J>>8&255;if(Y<Z.length)Z[Y++]=J>>16&255;if(O===6){if(Y<Z.length)Z[Y++]=J>>24&255;V=0,O=0}else V=J>>>24,O+=2}if(Y<Z.length){Z[Y++]=V;while(Y<Z.length)Z[Y++]=0}},Q.prototype._toArrayLikeBE=function(Z,C){var Y=Z.length-1,V=0;for(var G=0,O=0;G<this.length;G++){var J=this.words[G]<<O|V;if(Z[Y--]=J&255,Y>=0)Z[Y--]=J>>8&255;if(Y>=0)Z[Y--]=J>>16&255;if(O===6){if(Y>=0)Z[Y--]=J>>24&255;V=0,O=0}else V=J>>>24,O+=2}if(Y>=0){Z[Y--]=V;while(Y>=0)Z[Y--]=0}},Math.clz32)Q.prototype._countBits=function(Z){return 32-Math.clz32(Z)};else Q.prototype._countBits=function(Z){var C=Z,Y=0;if(C>=4096)Y+=13,C>>>=13;if(C>=64)Y+=7,C>>>=7;if(C>=8)Y+=4,C>>>=4;if(C>=2)Y+=2,C>>>=2;return Y+C};Q.prototype._zeroBits=function(Z){if(Z===0)return 26;var C=Z,Y=0;if((C&8191)===0)Y+=13,C>>>=13;if((C&127)===0)Y+=7,C>>>=7;if((C&15)===0)Y+=4,C>>>=4;if((C&3)===0)Y+=2,C>>>=2;if((C&1)===0)Y++;return Y},Q.prototype.bitLength=function(){var Z=this.words[this.length-1],C=this._countBits(Z);return(this.length-1)*26+C};function B(Z){var C=Array(Z.bitLength());for(var Y=0;Y<C.length;Y++){var V=Y/26|0,G=Y%26;C[Y]=Z.words[V]>>>G&1}return C}Q.prototype.zeroBits=function(){if(this.isZero())return 0;var Z=0;for(var C=0;C<this.length;C++){var Y=this._zeroBits(this.words[C]);if(Z+=Y,Y!==26)break}return Z},Q.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Q.prototype.toTwos=function(Z){if(this.negative!==0)return this.abs().inotn(Z).iaddn(1);return this.clone()},Q.prototype.fromTwos=function(Z){if(this.testn(Z-1))return this.notn(Z).iaddn(1).ineg();return this.clone()},Q.prototype.isNeg=function(){return this.negative!==0},Q.prototype.neg=function(){return this.clone().ineg()},Q.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Q.prototype.iuor=function(Z){while(this.length<Z.length)this.words[this.length++]=0;for(var C=0;C<Z.length;C++)this.words[C]=this.words[C]|Z.words[C];return this._strip()},Q.prototype.ior=function(Z){return S((this.negative|Z.negative)===0),this.iuor(Z)},Q.prototype.or=function(Z){if(this.length>Z.length)return this.clone().ior(Z);return Z.clone().ior(this)},Q.prototype.uor=function(Z){if(this.length>Z.length)return this.clone().iuor(Z);return Z.clone().iuor(this)},Q.prototype.iuand=function(Z){var C;if(this.length>Z.length)C=Z;else C=this;for(var Y=0;Y<C.length;Y++)this.words[Y]=this.words[Y]&Z.words[Y];return this.length=C.length,this._strip()},Q.prototype.iand=function(Z){return S((this.negative|Z.negative)===0),this.iuand(Z)},Q.prototype.and=function(Z){if(this.length>Z.length)return this.clone().iand(Z);return Z.clone().iand(this)},Q.prototype.uand=function(Z){if(this.length>Z.length)return this.clone().iuand(Z);return Z.clone().iuand(this)},Q.prototype.iuxor=function(Z){var C,Y;if(this.length>Z.length)C=this,Y=Z;else C=Z,Y=this;for(var V=0;V<Y.length;V++)this.words[V]=C.words[V]^Y.words[V];if(this!==C)for(;V<C.length;V++)this.words[V]=C.words[V];return this.length=C.length,this._strip()},Q.prototype.ixor=function(Z){return S((this.negative|Z.negative)===0),this.iuxor(Z)},Q.prototype.xor=function(Z){if(this.length>Z.length)return this.clone().ixor(Z);return Z.clone().ixor(this)},Q.prototype.uxor=function(Z){if(this.length>Z.length)return this.clone().iuxor(Z);return Z.clone().iuxor(this)},Q.prototype.inotn=function(Z){S(typeof Z==="number"&&Z>=0);var C=Math.ceil(Z/26)|0,Y=Z%26;if(this._expand(C),Y>0)C--;for(var V=0;V<C;V++)this.words[V]=~this.words[V]&67108863;if(Y>0)this.words[V]=~this.words[V]&67108863>>26-Y;return this._strip()},Q.prototype.notn=function(Z){return this.clone().inotn(Z)},Q.prototype.setn=function(Z,C){S(typeof Z==="number"&&Z>=0);var Y=Z/26|0,V=Z%26;if(this._expand(Y+1),C)this.words[Y]=this.words[Y]|1<<V;else this.words[Y]=this.words[Y]&~(1<<V);return this._strip()},Q.prototype.iadd=function(Z){var C;if(this.negative!==0&&Z.negative===0)return this.negative=0,C=this.isub(Z),this.negative^=1,this._normSign();else if(this.negative===0&&Z.negative!==0)return Z.negative=0,C=this.isub(Z),Z.negative=1,C._normSign();var Y,V;if(this.length>Z.length)Y=this,V=Z;else Y=Z,V=this;var G=0;for(var O=0;O<V.length;O++)C=(Y.words[O]|0)+(V.words[O]|0)+G,this.words[O]=C&67108863,G=C>>>26;for(;G!==0&&O<Y.length;O++)C=(Y.words[O]|0)+G,this.words[O]=C&67108863,G=C>>>26;if(this.length=Y.length,G!==0)this.words[this.length]=G,this.length++;else if(Y!==this)for(;O<Y.length;O++)this.words[O]=Y.words[O];return this},Q.prototype.add=function(Z){var C;if(Z.negative!==0&&this.negative===0)return Z.negative=0,C=this.sub(Z),Z.negative^=1,C;else if(Z.negative===0&&this.negative!==0)return this.negative=0,C=Z.sub(this),this.negative=1,C;if(this.length>Z.length)return this.clone().iadd(Z);return Z.clone().iadd(this)},Q.prototype.isub=function(Z){if(Z.negative!==0){Z.negative=0;var C=this.iadd(Z);return Z.negative=1,C._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Z),this.negative=1,this._normSign();var Y=this.cmp(Z);if(Y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var V,G;if(Y>0)V=this,G=Z;else V=Z,G=this;var O=0;for(var J=0;J<G.length;J++)C=(V.words[J]|0)-(G.words[J]|0)+O,O=C>>26,this.words[J]=C&67108863;for(;O!==0&&J<V.length;J++)C=(V.words[J]|0)+O,O=C>>26,this.words[J]=C&67108863;if(O===0&&J<V.length&&V!==this)for(;J<V.length;J++)this.words[J]=V.words[J];if(this.length=Math.max(this.length,J),V!==this)this.negative=1;return this._strip()},Q.prototype.sub=function(Z){return this.clone().isub(Z)};function v(Z,C,Y){Y.negative=C.negative^Z.negative;var V=Z.length+C.length|0;Y.length=V,V=V-1|0;var G=Z.words[0]|0,O=C.words[0]|0,J=G*O,z=J&67108863,W=J/67108864|0;Y.words[0]=z;for(var j=1;j<V;j++){var N=W>>>26,p=W&67108863,n=Math.min(j,C.length-1);for(var E0=Math.max(0,j-Z.length+1);E0<=n;E0++){var r=j-E0|0;G=Z.words[r]|0,O=C.words[E0]|0,J=G*O+p,N+=J/67108864|0,p=J&67108863}Y.words[j]=p|0,W=N|0}if(W!==0)Y.words[j]=W|0;else Y.length--;return Y._strip()}var g=function(Z,C,Y){var V=Z.words,G=C.words,O=Y.words,J=0,z,W,j,N=V[0]|0,p=N&8191,n=N>>>13,E0=V[1]|0,r=E0&8191,d=E0>>>13,A0=V[2]|0,t=A0&8191,i=A0>>>13,N0=V[3]|0,y=N0&8191,h=N0>>>13,$0=V[4]|0,m=$0&8191,a=$0>>>13,W0=V[5]|0,c=W0&8191,o=W0>>>13,x0=V[6]|0,s=x0&8191,Z0=x0>>>13,w0=V[7]|0,S0=w0&8191,V0=w0>>>13,m0=V[8]|0,J0=m0&8191,L0=m0>>>13,a0=V[9]|0,K0=a0&8191,D0=a0>>>13,WU=G[0]|0,F0=WU&8191,k0=WU>>>13,FU=G[1]|0,_0=FU&8191,M0=FU>>>13,KU=G[2]|0,j0=KU&8191,z0=KU>>>13,SU=G[3]|0,v0=SU&8191,B0=SU>>>13,VU=G[4]|0,T0=VU&8191,x=VU>>>13,l=G[5]|0,e=l&8191,U0=l>>>13,f0=G[6]|0,Y0=f0&8191,R0=f0>>>13,r0=G[7]|0,q0=r0&8191,g0=r0>>>13,HU=G[8]|0,P0=HU&8191,H0=HU>>>13,e0=G[9]|0,c0=e0&8191,y0=e0>>>13;Y.negative=Z.negative^C.negative,Y.length=19,z=Math.imul(p,F0),W=Math.imul(p,k0),W=W+Math.imul(n,F0)|0,j=Math.imul(n,k0);var o0=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(o0>>>26)|0,o0&=67108863,z=Math.imul(r,F0),W=Math.imul(r,k0),W=W+Math.imul(d,F0)|0,j=Math.imul(d,k0),z=z+Math.imul(p,_0)|0,W=W+Math.imul(p,M0)|0,W=W+Math.imul(n,_0)|0,j=j+Math.imul(n,M0)|0;var b0=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(b0>>>26)|0,b0&=67108863,z=Math.imul(t,F0),W=Math.imul(t,k0),W=W+Math.imul(i,F0)|0,j=Math.imul(i,k0),z=z+Math.imul(r,_0)|0,W=W+Math.imul(r,M0)|0,W=W+Math.imul(d,_0)|0,j=j+Math.imul(d,M0)|0,z=z+Math.imul(p,j0)|0,W=W+Math.imul(p,z0)|0,W=W+Math.imul(n,j0)|0,j=j+Math.imul(n,z0)|0;var i0=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(i0>>>26)|0,i0&=67108863,z=Math.imul(y,F0),W=Math.imul(y,k0),W=W+Math.imul(h,F0)|0,j=Math.imul(h,k0),z=z+Math.imul(t,_0)|0,W=W+Math.imul(t,M0)|0,W=W+Math.imul(i,_0)|0,j=j+Math.imul(i,M0)|0,z=z+Math.imul(r,j0)|0,W=W+Math.imul(r,z0)|0,W=W+Math.imul(d,j0)|0,j=j+Math.imul(d,z0)|0,z=z+Math.imul(p,v0)|0,W=W+Math.imul(p,B0)|0,W=W+Math.imul(n,v0)|0,j=j+Math.imul(n,B0)|0;var UU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(UU>>>26)|0,UU&=67108863,z=Math.imul(m,F0),W=Math.imul(m,k0),W=W+Math.imul(a,F0)|0,j=Math.imul(a,k0),z=z+Math.imul(y,_0)|0,W=W+Math.imul(y,M0)|0,W=W+Math.imul(h,_0)|0,j=j+Math.imul(h,M0)|0,z=z+Math.imul(t,j0)|0,W=W+Math.imul(t,z0)|0,W=W+Math.imul(i,j0)|0,j=j+Math.imul(i,z0)|0,z=z+Math.imul(r,v0)|0,W=W+Math.imul(r,B0)|0,W=W+Math.imul(d,v0)|0,j=j+Math.imul(d,B0)|0,z=z+Math.imul(p,T0)|0,W=W+Math.imul(p,x)|0,W=W+Math.imul(n,T0)|0,j=j+Math.imul(n,x)|0;var OU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(OU>>>26)|0,OU&=67108863,z=Math.imul(c,F0),W=Math.imul(c,k0),W=W+Math.imul(o,F0)|0,j=Math.imul(o,k0),z=z+Math.imul(m,_0)|0,W=W+Math.imul(m,M0)|0,W=W+Math.imul(a,_0)|0,j=j+Math.imul(a,M0)|0,z=z+Math.imul(y,j0)|0,W=W+Math.imul(y,z0)|0,W=W+Math.imul(h,j0)|0,j=j+Math.imul(h,z0)|0,z=z+Math.imul(t,v0)|0,W=W+Math.imul(t,B0)|0,W=W+Math.imul(i,v0)|0,j=j+Math.imul(i,B0)|0,z=z+Math.imul(r,T0)|0,W=W+Math.imul(r,x)|0,W=W+Math.imul(d,T0)|0,j=j+Math.imul(d,x)|0,z=z+Math.imul(p,e)|0,W=W+Math.imul(p,U0)|0,W=W+Math.imul(n,e)|0,j=j+Math.imul(n,U0)|0;var ZU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,z=Math.imul(s,F0),W=Math.imul(s,k0),W=W+Math.imul(Z0,F0)|0,j=Math.imul(Z0,k0),z=z+Math.imul(c,_0)|0,W=W+Math.imul(c,M0)|0,W=W+Math.imul(o,_0)|0,j=j+Math.imul(o,M0)|0,z=z+Math.imul(m,j0)|0,W=W+Math.imul(m,z0)|0,W=W+Math.imul(a,j0)|0,j=j+Math.imul(a,z0)|0,z=z+Math.imul(y,v0)|0,W=W+Math.imul(y,B0)|0,W=W+Math.imul(h,v0)|0,j=j+Math.imul(h,B0)|0,z=z+Math.imul(t,T0)|0,W=W+Math.imul(t,x)|0,W=W+Math.imul(i,T0)|0,j=j+Math.imul(i,x)|0,z=z+Math.imul(r,e)|0,W=W+Math.imul(r,U0)|0,W=W+Math.imul(d,e)|0,j=j+Math.imul(d,U0)|0,z=z+Math.imul(p,Y0)|0,W=W+Math.imul(p,R0)|0,W=W+Math.imul(n,Y0)|0,j=j+Math.imul(n,R0)|0;var AU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(AU>>>26)|0,AU&=67108863,z=Math.imul(S0,F0),W=Math.imul(S0,k0),W=W+Math.imul(V0,F0)|0,j=Math.imul(V0,k0),z=z+Math.imul(s,_0)|0,W=W+Math.imul(s,M0)|0,W=W+Math.imul(Z0,_0)|0,j=j+Math.imul(Z0,M0)|0,z=z+Math.imul(c,j0)|0,W=W+Math.imul(c,z0)|0,W=W+Math.imul(o,j0)|0,j=j+Math.imul(o,z0)|0,z=z+Math.imul(m,v0)|0,W=W+Math.imul(m,B0)|0,W=W+Math.imul(a,v0)|0,j=j+Math.imul(a,B0)|0,z=z+Math.imul(y,T0)|0,W=W+Math.imul(y,x)|0,W=W+Math.imul(h,T0)|0,j=j+Math.imul(h,x)|0,z=z+Math.imul(t,e)|0,W=W+Math.imul(t,U0)|0,W=W+Math.imul(i,e)|0,j=j+Math.imul(i,U0)|0,z=z+Math.imul(r,Y0)|0,W=W+Math.imul(r,R0)|0,W=W+Math.imul(d,Y0)|0,j=j+Math.imul(d,R0)|0,z=z+Math.imul(p,q0)|0,W=W+Math.imul(p,g0)|0,W=W+Math.imul(n,q0)|0,j=j+Math.imul(n,g0)|0;var $U=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+($U>>>26)|0,$U&=67108863,z=Math.imul(J0,F0),W=Math.imul(J0,k0),W=W+Math.imul(L0,F0)|0,j=Math.imul(L0,k0),z=z+Math.imul(S0,_0)|0,W=W+Math.imul(S0,M0)|0,W=W+Math.imul(V0,_0)|0,j=j+Math.imul(V0,M0)|0,z=z+Math.imul(s,j0)|0,W=W+Math.imul(s,z0)|0,W=W+Math.imul(Z0,j0)|0,j=j+Math.imul(Z0,z0)|0,z=z+Math.imul(c,v0)|0,W=W+Math.imul(c,B0)|0,W=W+Math.imul(o,v0)|0,j=j+Math.imul(o,B0)|0,z=z+Math.imul(m,T0)|0,W=W+Math.imul(m,x)|0,W=W+Math.imul(a,T0)|0,j=j+Math.imul(a,x)|0,z=z+Math.imul(y,e)|0,W=W+Math.imul(y,U0)|0,W=W+Math.imul(h,e)|0,j=j+Math.imul(h,U0)|0,z=z+Math.imul(t,Y0)|0,W=W+Math.imul(t,R0)|0,W=W+Math.imul(i,Y0)|0,j=j+Math.imul(i,R0)|0,z=z+Math.imul(r,q0)|0,W=W+Math.imul(r,g0)|0,W=W+Math.imul(d,q0)|0,j=j+Math.imul(d,g0)|0,z=z+Math.imul(p,P0)|0,W=W+Math.imul(p,H0)|0,W=W+Math.imul(n,P0)|0,j=j+Math.imul(n,H0)|0;var IU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(IU>>>26)|0,IU&=67108863,z=Math.imul(K0,F0),W=Math.imul(K0,k0),W=W+Math.imul(D0,F0)|0,j=Math.imul(D0,k0),z=z+Math.imul(J0,_0)|0,W=W+Math.imul(J0,M0)|0,W=W+Math.imul(L0,_0)|0,j=j+Math.imul(L0,M0)|0,z=z+Math.imul(S0,j0)|0,W=W+Math.imul(S0,z0)|0,W=W+Math.imul(V0,j0)|0,j=j+Math.imul(V0,z0)|0,z=z+Math.imul(s,v0)|0,W=W+Math.imul(s,B0)|0,W=W+Math.imul(Z0,v0)|0,j=j+Math.imul(Z0,B0)|0,z=z+Math.imul(c,T0)|0,W=W+Math.imul(c,x)|0,W=W+Math.imul(o,T0)|0,j=j+Math.imul(o,x)|0,z=z+Math.imul(m,e)|0,W=W+Math.imul(m,U0)|0,W=W+Math.imul(a,e)|0,j=j+Math.imul(a,U0)|0,z=z+Math.imul(y,Y0)|0,W=W+Math.imul(y,R0)|0,W=W+Math.imul(h,Y0)|0,j=j+Math.imul(h,R0)|0,z=z+Math.imul(t,q0)|0,W=W+Math.imul(t,g0)|0,W=W+Math.imul(i,q0)|0,j=j+Math.imul(i,g0)|0,z=z+Math.imul(r,P0)|0,W=W+Math.imul(r,H0)|0,W=W+Math.imul(d,P0)|0,j=j+Math.imul(d,H0)|0,z=z+Math.imul(p,c0)|0,W=W+Math.imul(p,y0)|0,W=W+Math.imul(n,c0)|0,j=j+Math.imul(n,y0)|0;var CU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(CU>>>26)|0,CU&=67108863,z=Math.imul(K0,_0),W=Math.imul(K0,M0),W=W+Math.imul(D0,_0)|0,j=Math.imul(D0,M0),z=z+Math.imul(J0,j0)|0,W=W+Math.imul(J0,z0)|0,W=W+Math.imul(L0,j0)|0,j=j+Math.imul(L0,z0)|0,z=z+Math.imul(S0,v0)|0,W=W+Math.imul(S0,B0)|0,W=W+Math.imul(V0,v0)|0,j=j+Math.imul(V0,B0)|0,z=z+Math.imul(s,T0)|0,W=W+Math.imul(s,x)|0,W=W+Math.imul(Z0,T0)|0,j=j+Math.imul(Z0,x)|0,z=z+Math.imul(c,e)|0,W=W+Math.imul(c,U0)|0,W=W+Math.imul(o,e)|0,j=j+Math.imul(o,U0)|0,z=z+Math.imul(m,Y0)|0,W=W+Math.imul(m,R0)|0,W=W+Math.imul(a,Y0)|0,j=j+Math.imul(a,R0)|0,z=z+Math.imul(y,q0)|0,W=W+Math.imul(y,g0)|0,W=W+Math.imul(h,q0)|0,j=j+Math.imul(h,g0)|0,z=z+Math.imul(t,P0)|0,W=W+Math.imul(t,H0)|0,W=W+Math.imul(i,P0)|0,j=j+Math.imul(i,H0)|0,z=z+Math.imul(r,c0)|0,W=W+Math.imul(r,y0)|0,W=W+Math.imul(d,c0)|0,j=j+Math.imul(d,y0)|0;var QU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(QU>>>26)|0,QU&=67108863,z=Math.imul(K0,j0),W=Math.imul(K0,z0),W=W+Math.imul(D0,j0)|0,j=Math.imul(D0,z0),z=z+Math.imul(J0,v0)|0,W=W+Math.imul(J0,B0)|0,W=W+Math.imul(L0,v0)|0,j=j+Math.imul(L0,B0)|0,z=z+Math.imul(S0,T0)|0,W=W+Math.imul(S0,x)|0,W=W+Math.imul(V0,T0)|0,j=j+Math.imul(V0,x)|0,z=z+Math.imul(s,e)|0,W=W+Math.imul(s,U0)|0,W=W+Math.imul(Z0,e)|0,j=j+Math.imul(Z0,U0)|0,z=z+Math.imul(c,Y0)|0,W=W+Math.imul(c,R0)|0,W=W+Math.imul(o,Y0)|0,j=j+Math.imul(o,R0)|0,z=z+Math.imul(m,q0)|0,W=W+Math.imul(m,g0)|0,W=W+Math.imul(a,q0)|0,j=j+Math.imul(a,g0)|0,z=z+Math.imul(y,P0)|0,W=W+Math.imul(y,H0)|0,W=W+Math.imul(h,P0)|0,j=j+Math.imul(h,H0)|0,z=z+Math.imul(t,c0)|0,W=W+Math.imul(t,y0)|0,W=W+Math.imul(i,c0)|0,j=j+Math.imul(i,y0)|0;var XU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(XU>>>26)|0,XU&=67108863,z=Math.imul(K0,v0),W=Math.imul(K0,B0),W=W+Math.imul(D0,v0)|0,j=Math.imul(D0,B0),z=z+Math.imul(J0,T0)|0,W=W+Math.imul(J0,x)|0,W=W+Math.imul(L0,T0)|0,j=j+Math.imul(L0,x)|0,z=z+Math.imul(S0,e)|0,W=W+Math.imul(S0,U0)|0,W=W+Math.imul(V0,e)|0,j=j+Math.imul(V0,U0)|0,z=z+Math.imul(s,Y0)|0,W=W+Math.imul(s,R0)|0,W=W+Math.imul(Z0,Y0)|0,j=j+Math.imul(Z0,R0)|0,z=z+Math.imul(c,q0)|0,W=W+Math.imul(c,g0)|0,W=W+Math.imul(o,q0)|0,j=j+Math.imul(o,g0)|0,z=z+Math.imul(m,P0)|0,W=W+Math.imul(m,H0)|0,W=W+Math.imul(a,P0)|0,j=j+Math.imul(a,H0)|0,z=z+Math.imul(y,c0)|0,W=W+Math.imul(y,y0)|0,W=W+Math.imul(h,c0)|0,j=j+Math.imul(h,y0)|0;var GU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(GU>>>26)|0,GU&=67108863,z=Math.imul(K0,T0),W=Math.imul(K0,x),W=W+Math.imul(D0,T0)|0,j=Math.imul(D0,x),z=z+Math.imul(J0,e)|0,W=W+Math.imul(J0,U0)|0,W=W+Math.imul(L0,e)|0,j=j+Math.imul(L0,U0)|0,z=z+Math.imul(S0,Y0)|0,W=W+Math.imul(S0,R0)|0,W=W+Math.imul(V0,Y0)|0,j=j+Math.imul(V0,R0)|0,z=z+Math.imul(s,q0)|0,W=W+Math.imul(s,g0)|0,W=W+Math.imul(Z0,q0)|0,j=j+Math.imul(Z0,g0)|0,z=z+Math.imul(c,P0)|0,W=W+Math.imul(c,H0)|0,W=W+Math.imul(o,P0)|0,j=j+Math.imul(o,H0)|0,z=z+Math.imul(m,c0)|0,W=W+Math.imul(m,y0)|0,W=W+Math.imul(a,c0)|0,j=j+Math.imul(a,y0)|0;var EU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(EU>>>26)|0,EU&=67108863,z=Math.imul(K0,e),W=Math.imul(K0,U0),W=W+Math.imul(D0,e)|0,j=Math.imul(D0,U0),z=z+Math.imul(J0,Y0)|0,W=W+Math.imul(J0,R0)|0,W=W+Math.imul(L0,Y0)|0,j=j+Math.imul(L0,R0)|0,z=z+Math.imul(S0,q0)|0,W=W+Math.imul(S0,g0)|0,W=W+Math.imul(V0,q0)|0,j=j+Math.imul(V0,g0)|0,z=z+Math.imul(s,P0)|0,W=W+Math.imul(s,H0)|0,W=W+Math.imul(Z0,P0)|0,j=j+Math.imul(Z0,H0)|0,z=z+Math.imul(c,c0)|0,W=W+Math.imul(c,y0)|0,W=W+Math.imul(o,c0)|0,j=j+Math.imul(o,y0)|0;var JU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(JU>>>26)|0,JU&=67108863,z=Math.imul(K0,Y0),W=Math.imul(K0,R0),W=W+Math.imul(D0,Y0)|0,j=Math.imul(D0,R0),z=z+Math.imul(J0,q0)|0,W=W+Math.imul(J0,g0)|0,W=W+Math.imul(L0,q0)|0,j=j+Math.imul(L0,g0)|0,z=z+Math.imul(S0,P0)|0,W=W+Math.imul(S0,H0)|0,W=W+Math.imul(V0,P0)|0,j=j+Math.imul(V0,H0)|0,z=z+Math.imul(s,c0)|0,W=W+Math.imul(s,y0)|0,W=W+Math.imul(Z0,c0)|0,j=j+Math.imul(Z0,y0)|0;var YU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(YU>>>26)|0,YU&=67108863,z=Math.imul(K0,q0),W=Math.imul(K0,g0),W=W+Math.imul(D0,q0)|0,j=Math.imul(D0,g0),z=z+Math.imul(J0,P0)|0,W=W+Math.imul(J0,H0)|0,W=W+Math.imul(L0,P0)|0,j=j+Math.imul(L0,H0)|0,z=z+Math.imul(S0,c0)|0,W=W+Math.imul(S0,y0)|0,W=W+Math.imul(V0,c0)|0,j=j+Math.imul(V0,y0)|0;var MZ=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(MZ>>>26)|0,MZ&=67108863,z=Math.imul(K0,P0),W=Math.imul(K0,H0),W=W+Math.imul(D0,P0)|0,j=Math.imul(D0,H0),z=z+Math.imul(J0,c0)|0,W=W+Math.imul(J0,y0)|0,W=W+Math.imul(L0,c0)|0,j=j+Math.imul(L0,y0)|0;var zZ=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(zZ>>>26)|0,zZ&=67108863,z=Math.imul(K0,c0),W=Math.imul(K0,y0),W=W+Math.imul(D0,c0)|0,j=Math.imul(D0,y0);var TZ=(J+z|0)+((W&8191)<<13)|0;if(J=(j+(W>>>13)|0)+(TZ>>>26)|0,TZ&=67108863,O[0]=o0,O[1]=b0,O[2]=i0,O[3]=UU,O[4]=OU,O[5]=ZU,O[6]=AU,O[7]=$U,O[8]=IU,O[9]=CU,O[10]=QU,O[11]=XU,O[12]=GU,O[13]=EU,O[14]=JU,O[15]=YU,O[16]=MZ,O[17]=zZ,O[18]=TZ,J!==0)O[19]=J,Y.length++;return Y};if(!Math.imul)g=v;function f(Z,C,Y){Y.negative=C.negative^Z.negative,Y.length=Z.length+C.length;var V=0,G=0;for(var O=0;O<Y.length-1;O++){var J=G;G=0;var z=V&67108863,W=Math.min(O,C.length-1);for(var j=Math.max(0,O-Z.length+1);j<=W;j++){var N=O-j,p=Z.words[N]|0,n=C.words[j]|0,E0=p*n,r=E0&67108863;J=J+(E0/67108864|0)|0,r=r+z|0,z=r&67108863,J=J+(r>>>26)|0,G+=J>>>26,J&=67108863}Y.words[O]=z,V=J,J=G}if(V!==0)Y.words[O]=V;else Y.length--;return Y._strip()}function w(Z,C,Y){return f(Z,C,Y)}Q.prototype.mulTo=function(Z,C){var Y,V=this.length+Z.length;if(this.length===10&&Z.length===10)Y=g(this,Z,C);else if(V<63)Y=v(this,Z,C);else if(V<1024)Y=f(this,Z,C);else Y=w(this,Z,C);return Y};function b(Z,C){this.x=Z,this.y=C}b.prototype.makeRBT=function(Z){var C=Array(Z),Y=Q.prototype._countBits(Z)-1;for(var V=0;V<Z;V++)C[V]=this.revBin(V,Y,Z);return C},b.prototype.revBin=function(Z,C,Y){if(Z===0||Z===Y-1)return Z;var V=0;for(var G=0;G<C;G++)V|=(Z&1)<<C-G-1,Z>>=1;return V},b.prototype.permute=function(Z,C,Y,V,G,O){for(var J=0;J<O;J++)V[J]=C[Z[J]],G[J]=Y[Z[J]]},b.prototype.transform=function(Z,C,Y,V,G,O){this.permute(O,Z,C,Y,V,G);for(var J=1;J<G;J<<=1){var z=J<<1,W=Math.cos(2*Math.PI/z),j=Math.sin(2*Math.PI/z);for(var N=0;N<G;N+=z){var p=W,n=j;for(var E0=0;E0<J;E0++){var r=Y[N+E0],d=V[N+E0],A0=Y[N+E0+J],t=V[N+E0+J],i=p*A0-n*t;if(t=p*t+n*A0,A0=i,Y[N+E0]=r+A0,V[N+E0]=d+t,Y[N+E0+J]=r-A0,V[N+E0+J]=d-t,E0!==z)i=W*p-j*n,n=W*n+j*p,p=i}}}},b.prototype.guessLen13b=function(Z,C){var Y=Math.max(C,Z)|1,V=Y&1,G=0;for(Y=Y/2|0;Y;Y=Y>>>1)G++;return 1<<G+1+V},b.prototype.conjugate=function(Z,C,Y){if(Y<=1)return;for(var V=0;V<Y/2;V++){var G=Z[V];Z[V]=Z[Y-V-1],Z[Y-V-1]=G,G=C[V],C[V]=-C[Y-V-1],C[Y-V-1]=-G}},b.prototype.normalize13b=function(Z,C){var Y=0;for(var V=0;V<C/2;V++){var G=Math.round(Z[2*V+1]/C)*8192+Math.round(Z[2*V]/C)+Y;if(Z[V]=G&67108863,G<67108864)Y=0;else Y=G/67108864|0}return Z},b.prototype.convert13b=function(Z,C,Y,V){var G=0;for(var O=0;O<C;O++)G=G+(Z[O]|0),Y[2*O]=G&8191,G=G>>>13,Y[2*O+1]=G&8191,G=G>>>13;for(O=2*C;O<V;++O)Y[O]=0;S(G===0),S((G&-8192)===0)},b.prototype.stub=function(Z){var C=Array(Z);for(var Y=0;Y<Z;Y++)C[Y]=0;return C},b.prototype.mulp=function(Z,C,Y){var V=2*this.guessLen13b(Z.length,C.length),G=this.makeRBT(V),O=this.stub(V),J=Array(V),z=Array(V),W=Array(V),j=Array(V),N=Array(V),p=Array(V),n=Y.words;n.length=V,this.convert13b(Z.words,Z.length,J,V),this.convert13b(C.words,C.length,j,V),this.transform(J,O,z,W,V,G),this.transform(j,O,N,p,V,G);for(var E0=0;E0<V;E0++){var r=z[E0]*N[E0]-W[E0]*p[E0];W[E0]=z[E0]*p[E0]+W[E0]*N[E0],z[E0]=r}return this.conjugate(z,W,V),this.transform(z,W,n,O,V,G),this.conjugate(n,O,V),this.normalize13b(n,V),Y.negative=Z.negative^C.negative,Y.length=Z.length+C.length,Y._strip()},Q.prototype.mul=function(Z){var C=new Q(null);return C.words=Array(this.length+Z.length),this.mulTo(Z,C)},Q.prototype.mulf=function(Z){var C=new Q(null);return C.words=Array(this.length+Z.length),w(this,Z,C)},Q.prototype.imul=function(Z){return this.clone().mulTo(Z,this)},Q.prototype.imuln=function(Z){var C=Z<0;if(C)Z=-Z;S(typeof Z==="number"),S(Z<67108864);var Y=0;for(var V=0;V<this.length;V++){var G=(this.words[V]|0)*Z,O=(G&67108863)+(Y&67108863);Y>>=26,Y+=G/67108864|0,Y+=O>>>26,this.words[V]=O&67108863}if(Y!==0)this.words[V]=Y,this.length++;return this.length=Z===0?1:this.length,C?this.ineg():this},Q.prototype.muln=function(Z){return this.clone().imuln(Z)},Q.prototype.sqr=function(){return this.mul(this)},Q.prototype.isqr=function(){return this.imul(this.clone())},Q.prototype.pow=function(Z){var C=B(Z);if(C.length===0)return new Q(1);var Y=this;for(var V=0;V<C.length;V++,Y=Y.sqr())if(C[V]!==0)break;if(++V<C.length)for(var G=Y.sqr();V<C.length;V++,G=G.sqr()){if(C[V]===0)continue;Y=Y.mul(G)}return Y},Q.prototype.iushln=function(Z){S(typeof Z==="number"&&Z>=0);var C=Z%26,Y=(Z-C)/26,V=67108863>>>26-C<<26-C,G;if(C!==0){var O=0;for(G=0;G<this.length;G++){var J=this.words[G]&V,z=(this.words[G]|0)-J<<C;this.words[G]=z|O,O=J>>>26-C}if(O)this.words[G]=O,this.length++}if(Y!==0){for(G=this.length-1;G>=0;G--)this.words[G+Y]=this.words[G];for(G=0;G<Y;G++)this.words[G]=0;this.length+=Y}return this._strip()},Q.prototype.ishln=function(Z){return S(this.negative===0),this.iushln(Z)},Q.prototype.iushrn=function(Z,C,Y){S(typeof Z==="number"&&Z>=0);var V;if(C)V=(C-C%26)/26;else V=0;var G=Z%26,O=Math.min((Z-G)/26,this.length),J=67108863^67108863>>>G<<G,z=Y;if(V-=O,V=Math.max(0,V),z){for(var W=0;W<O;W++)z.words[W]=this.words[W];z.length=O}if(O===0);else if(this.length>O){this.length-=O;for(W=0;W<this.length;W++)this.words[W]=this.words[W+O]}else this.words[0]=0,this.length=1;var j=0;for(W=this.length-1;W>=0&&(j!==0||W>=V);W--){var N=this.words[W]|0;this.words[W]=j<<26-G|N>>>G,j=N&J}if(z&&j!==0)z.words[z.length++]=j;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},Q.prototype.ishrn=function(Z,C,Y){return S(this.negative===0),this.iushrn(Z,C,Y)},Q.prototype.shln=function(Z){return this.clone().ishln(Z)},Q.prototype.ushln=function(Z){return this.clone().iushln(Z)},Q.prototype.shrn=function(Z){return this.clone().ishrn(Z)},Q.prototype.ushrn=function(Z){return this.clone().iushrn(Z)},Q.prototype.testn=function(Z){S(typeof Z==="number"&&Z>=0);var C=Z%26,Y=(Z-C)/26,V=1<<C;if(this.length<=Y)return!1;var G=this.words[Y];return!!(G&V)},Q.prototype.imaskn=function(Z){S(typeof Z==="number"&&Z>=0);var C=Z%26,Y=(Z-C)/26;if(S(this.negative===0,"imaskn works only with positive numbers"),this.length<=Y)return this;if(C!==0)Y++;if(this.length=Math.min(Y,this.length),C!==0){var V=67108863^67108863>>>C<<C;this.words[this.length-1]&=V}return this._strip()},Q.prototype.maskn=function(Z){return this.clone().imaskn(Z)},Q.prototype.iaddn=function(Z){if(S(typeof Z==="number"),S(Z<67108864),Z<0)return this.isubn(-Z);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=Z)return this.words[0]=Z-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Z),this.negative=1,this}return this._iaddn(Z)},Q.prototype._iaddn=function(Z){this.words[0]+=Z;for(var C=0;C<this.length&&this.words[C]>=67108864;C++)if(this.words[C]-=67108864,C===this.length-1)this.words[C+1]=1;else this.words[C+1]++;return this.length=Math.max(this.length,C+1),this},Q.prototype.isubn=function(Z){if(S(typeof Z==="number"),S(Z<67108864),Z<0)return this.iaddn(-Z);if(this.negative!==0)return this.negative=0,this.iaddn(Z),this.negative=1,this;if(this.words[0]-=Z,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var C=0;C<this.length&&this.words[C]<0;C++)this.words[C]+=67108864,this.words[C+1]-=1;return this._strip()},Q.prototype.addn=function(Z){return this.clone().iaddn(Z)},Q.prototype.subn=function(Z){return this.clone().isubn(Z)},Q.prototype.iabs=function(){return this.negative=0,this},Q.prototype.abs=function(){return this.clone().iabs()},Q.prototype._ishlnsubmul=function(Z,C,Y){var V=Z.length+Y,G;this._expand(V);var O,J=0;for(G=0;G<Z.length;G++){O=(this.words[G+Y]|0)+J;var z=(Z.words[G]|0)*C;O-=z&67108863,J=(O>>26)-(z/67108864|0),this.words[G+Y]=O&67108863}for(;G<this.length-Y;G++)O=(this.words[G+Y]|0)+J,J=O>>26,this.words[G+Y]=O&67108863;if(J===0)return this._strip();S(J===-1),J=0;for(G=0;G<this.length;G++)O=-(this.words[G]|0)+J,J=O>>26,this.words[G]=O&67108863;return this.negative=1,this._strip()},Q.prototype._wordDiv=function(Z,C){var Y=this.length-Z.length,V=this.clone(),G=Z,O=G.words[G.length-1]|0,J=this._countBits(O);if(Y=26-J,Y!==0)G=G.ushln(Y),V.iushln(Y),O=G.words[G.length-1]|0;var z=V.length-G.length,W;if(C!=="mod"){W=new Q(null),W.length=z+1,W.words=Array(W.length);for(var j=0;j<W.length;j++)W.words[j]=0}var N=V.clone()._ishlnsubmul(G,1,z);if(N.negative===0){if(V=N,W)W.words[z]=1}for(var p=z-1;p>=0;p--){var n=(V.words[G.length+p]|0)*67108864+(V.words[G.length+p-1]|0);n=Math.min(n/O|0,67108863),V._ishlnsubmul(G,n,p);while(V.negative!==0)if(n--,V.negative=0,V._ishlnsubmul(G,1,p),!V.isZero())V.negative^=1;if(W)W.words[p]=n}if(W)W._strip();if(V._strip(),C!=="div"&&Y!==0)V.iushrn(Y);return{div:W||null,mod:V}},Q.prototype.divmod=function(Z,C,Y){if(S(!Z.isZero()),this.isZero())return{div:new Q(0),mod:new Q(0)};var V,G,O;if(this.negative!==0&&Z.negative===0){if(O=this.neg().divmod(Z,C),C!=="mod")V=O.div.neg();if(C!=="div"){if(G=O.mod.neg(),Y&&G.negative!==0)G.iadd(Z)}return{div:V,mod:G}}if(this.negative===0&&Z.negative!==0){if(O=this.divmod(Z.neg(),C),C!=="mod")V=O.div.neg();return{div:V,mod:O.mod}}if((this.negative&Z.negative)!==0){if(O=this.neg().divmod(Z.neg(),C),C!=="div"){if(G=O.mod.neg(),Y&&G.negative!==0)G.isub(Z)}return{div:O.div,mod:G}}if(Z.length>this.length||this.cmp(Z)<0)return{div:new Q(0),mod:this};if(Z.length===1){if(C==="div")return{div:this.divn(Z.words[0]),mod:null};if(C==="mod")return{div:null,mod:new Q(this.modrn(Z.words[0]))};return{div:this.divn(Z.words[0]),mod:new Q(this.modrn(Z.words[0]))}}return this._wordDiv(Z,C)},Q.prototype.div=function(Z){return this.divmod(Z,"div",!1).div},Q.prototype.mod=function(Z){return this.divmod(Z,"mod",!1).mod},Q.prototype.umod=function(Z){return this.divmod(Z,"mod",!0).mod},Q.prototype.divRound=function(Z){var C=this.divmod(Z);if(C.mod.isZero())return C.div;var Y=C.div.negative!==0?C.mod.isub(Z):C.mod,V=Z.ushrn(1),G=Z.andln(1),O=Y.cmp(V);if(O<0||G===1&&O===0)return C.div;return C.div.negative!==0?C.div.isubn(1):C.div.iaddn(1)},Q.prototype.modrn=function(Z){var C=Z<0;if(C)Z=-Z;S(Z<=67108863);var Y=67108864%Z,V=0;for(var G=this.length-1;G>=0;G--)V=(Y*V+(this.words[G]|0))%Z;return C?-V:V},Q.prototype.modn=function(Z){return this.modrn(Z)},Q.prototype.idivn=function(Z){var C=Z<0;if(C)Z=-Z;S(Z<=67108863);var Y=0;for(var V=this.length-1;V>=0;V--){var G=(this.words[V]|0)+Y*67108864;this.words[V]=G/Z|0,Y=G%Z}return this._strip(),C?this.ineg():this},Q.prototype.divn=function(Z){return this.clone().idivn(Z)},Q.prototype.egcd=function(Z){S(Z.negative===0),S(!Z.isZero());var C=this,Y=Z.clone();if(C.negative!==0)C=C.umod(Z);else C=C.clone();var V=new Q(1),G=new Q(0),O=new Q(0),J=new Q(1),z=0;while(C.isEven()&&Y.isEven())C.iushrn(1),Y.iushrn(1),++z;var W=Y.clone(),j=C.clone();while(!C.isZero()){for(var N=0,p=1;(C.words[0]&p)===0&&N<26;++N,p<<=1);if(N>0){C.iushrn(N);while(N-- >0){if(V.isOdd()||G.isOdd())V.iadd(W),G.isub(j);V.iushrn(1),G.iushrn(1)}}for(var n=0,E0=1;(Y.words[0]&E0)===0&&n<26;++n,E0<<=1);if(n>0){Y.iushrn(n);while(n-- >0){if(O.isOdd()||J.isOdd())O.iadd(W),J.isub(j);O.iushrn(1),J.iushrn(1)}}if(C.cmp(Y)>=0)C.isub(Y),V.isub(O),G.isub(J);else Y.isub(C),O.isub(V),J.isub(G)}return{a:O,b:J,gcd:Y.iushln(z)}},Q.prototype._invmp=function(Z){S(Z.negative===0),S(!Z.isZero());var C=this,Y=Z.clone();if(C.negative!==0)C=C.umod(Z);else C=C.clone();var V=new Q(1),G=new Q(0),O=Y.clone();while(C.cmpn(1)>0&&Y.cmpn(1)>0){for(var J=0,z=1;(C.words[0]&z)===0&&J<26;++J,z<<=1);if(J>0){C.iushrn(J);while(J-- >0){if(V.isOdd())V.iadd(O);V.iushrn(1)}}for(var W=0,j=1;(Y.words[0]&j)===0&&W<26;++W,j<<=1);if(W>0){Y.iushrn(W);while(W-- >0){if(G.isOdd())G.iadd(O);G.iushrn(1)}}if(C.cmp(Y)>=0)C.isub(Y),V.isub(G);else Y.isub(C),G.isub(V)}var N;if(C.cmpn(1)===0)N=V;else N=G;if(N.cmpn(0)<0)N.iadd(Z);return N},Q.prototype.gcd=function(Z){if(this.isZero())return Z.abs();if(Z.isZero())return this.abs();var C=this.clone(),Y=Z.clone();C.negative=0,Y.negative=0;for(var V=0;C.isEven()&&Y.isEven();V++)C.iushrn(1),Y.iushrn(1);do{while(C.isEven())C.iushrn(1);while(Y.isEven())Y.iushrn(1);var G=C.cmp(Y);if(G<0){var O=C;C=Y,Y=O}else if(G===0||Y.cmpn(1)===0)break;C.isub(Y)}while(!0);return Y.iushln(V)},Q.prototype.invm=function(Z){return this.egcd(Z).a.umod(Z)},Q.prototype.isEven=function(){return(this.words[0]&1)===0},Q.prototype.isOdd=function(){return(this.words[0]&1)===1},Q.prototype.andln=function(Z){return this.words[0]&Z},Q.prototype.bincn=function(Z){S(typeof Z==="number");var C=Z%26,Y=(Z-C)/26,V=1<<C;if(this.length<=Y)return this._expand(Y+1),this.words[Y]|=V,this;var G=V;for(var O=Y;G!==0&&O<this.length;O++){var J=this.words[O]|0;J+=G,G=J>>>26,J&=67108863,this.words[O]=J}if(G!==0)this.words[O]=G,this.length++;return this},Q.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Q.prototype.cmpn=function(Z){var C=Z<0;if(this.negative!==0&&!C)return-1;if(this.negative===0&&C)return 1;this._strip();var Y;if(this.length>1)Y=1;else{if(C)Z=-Z;S(Z<=67108863,"Number is too big");var V=this.words[0]|0;Y=V===Z?0:V<Z?-1:1}if(this.negative!==0)return-Y|0;return Y},Q.prototype.cmp=function(Z){if(this.negative!==0&&Z.negative===0)return-1;if(this.negative===0&&Z.negative!==0)return 1;var C=this.ucmp(Z);if(this.negative!==0)return-C|0;return C},Q.prototype.ucmp=function(Z){if(this.length>Z.length)return 1;if(this.length<Z.length)return-1;var C=0;for(var Y=this.length-1;Y>=0;Y--){var V=this.words[Y]|0,G=Z.words[Y]|0;if(V===G)continue;if(V<G)C=-1;else if(V>G)C=1;break}return C},Q.prototype.gtn=function(Z){return this.cmpn(Z)===1},Q.prototype.gt=function(Z){return this.cmp(Z)===1},Q.prototype.gten=function(Z){return this.cmpn(Z)>=0},Q.prototype.gte=function(Z){return this.cmp(Z)>=0},Q.prototype.ltn=function(Z){return this.cmpn(Z)===-1},Q.prototype.lt=function(Z){return this.cmp(Z)===-1},Q.prototype.lten=function(Z){return this.cmpn(Z)<=0},Q.prototype.lte=function(Z){return this.cmp(Z)<=0},Q.prototype.eqn=function(Z){return this.cmpn(Z)===0},Q.prototype.eq=function(Z){return this.cmp(Z)===0},Q.red=function(Z){return new A(Z)},Q.prototype.toRed=function(Z){return S(!this.red,"Already a number in reduction context"),S(this.negative===0,"red works only with positives"),Z.convertTo(this)._forceRed(Z)},Q.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Q.prototype._forceRed=function(Z){return this.red=Z,this},Q.prototype.forceRed=function(Z){return S(!this.red,"Already a number in reduction context"),this._forceRed(Z)},Q.prototype.redAdd=function(Z){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,Z)},Q.prototype.redIAdd=function(Z){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Z)},Q.prototype.redSub=function(Z){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,Z)},Q.prototype.redISub=function(Z){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,Z)},Q.prototype.redShl=function(Z){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,Z)},Q.prototype.redMul=function(Z){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,Z),this.red.mul(this,Z)},Q.prototype.redIMul=function(Z){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,Z),this.red.imul(this,Z)},Q.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Q.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Q.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Q.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Q.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Q.prototype.redPow=function(Z){return S(this.red&&!Z.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Z)};var I0={k256:null,p224:null,p192:null,p25519:null};function X0(Z,C){this.name=Z,this.p=new Q(C,16),this.n=this.p.bitLength(),this.k=new Q(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}X0.prototype._tmp=function(){var Z=new Q(null);return Z.words=Array(Math.ceil(this.n/13)),Z},X0.prototype.ireduce=function(Z){var C=Z,Y;do this.split(C,this.tmp),C=this.imulK(C),C=C.iadd(this.tmp),Y=C.bitLength();while(Y>this.n);var V=Y<this.n?-1:C.ucmp(this.p);if(V===0)C.words[0]=0,C.length=1;else if(V>0)C.isub(this.p);else if(C.strip!==void 0)C.strip();else C._strip();return C},X0.prototype.split=function(Z,C){Z.iushrn(this.n,0,C)},X0.prototype.imulK=function(Z){return Z.imul(this.k)};function C0(){X0.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(C0,X0),C0.prototype.split=function(Z,C){var Y=4194303,V=Math.min(Z.length,9);for(var G=0;G<V;G++)C.words[G]=Z.words[G];if(C.length=V,Z.length<=9){Z.words[0]=0,Z.length=1;return}var O=Z.words[9];C.words[C.length++]=O&Y;for(G=10;G<Z.length;G++){var J=Z.words[G]|0;Z.words[G-10]=(J&Y)<<4|O>>>22,O=J}if(O>>>=22,Z.words[G-10]=O,O===0&&Z.length>10)Z.length-=10;else Z.length-=9},C0.prototype.imulK=function(Z){Z.words[Z.length]=0,Z.words[Z.length+1]=0,Z.length+=2;var C=0;for(var Y=0;Y<Z.length;Y++){var V=Z.words[Y]|0;C+=V*977,Z.words[Y]=C&67108863,C=V*64+(C/67108864|0)}if(Z.words[Z.length-1]===0){if(Z.length--,Z.words[Z.length-1]===0)Z.length--}return Z};function u(){X0.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(u,X0);function O0(){X0.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K(O0,X0);function U(){X0.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(U,X0),U.prototype.imulK=function(Z){var C=0;for(var Y=0;Y<Z.length;Y++){var V=(Z.words[Y]|0)*19+C,G=V&67108863;V>>>=26,Z.words[Y]=G,C=V}if(C!==0)Z.words[Z.length++]=C;return Z},Q._prime=function(Z){if(I0[Z])return I0[Z];var C;if(Z==="k256")C=new C0;else if(Z==="p224")C=new u;else if(Z==="p192")C=new O0;else if(Z==="p25519")C=new U;else throw Error("Unknown prime "+Z);return I0[Z]=C,C};function A(Z){if(typeof Z==="string"){var C=Q._prime(Z);this.m=C.p,this.prime=C}else S(Z.gtn(1),"modulus must be greater than 1"),this.m=Z,this.prime=null}A.prototype._verify1=function(Z){S(Z.negative===0,"red works only with positives"),S(Z.red,"red works only with red numbers")},A.prototype._verify2=function(Z,C){S((Z.negative|C.negative)===0,"red works only with positives"),S(Z.red&&Z.red===C.red,"red works only with red numbers")},A.prototype.imod=function(Z){if(this.prime)return this.prime.ireduce(Z)._forceRed(this);return R(Z,Z.umod(this.m)._forceRed(this)),Z},A.prototype.neg=function(Z){if(Z.isZero())return Z.clone();return this.m.sub(Z)._forceRed(this)},A.prototype.add=function(Z,C){this._verify2(Z,C);var Y=Z.add(C);if(Y.cmp(this.m)>=0)Y.isub(this.m);return Y._forceRed(this)},A.prototype.iadd=function(Z,C){this._verify2(Z,C);var Y=Z.iadd(C);if(Y.cmp(this.m)>=0)Y.isub(this.m);return Y},A.prototype.sub=function(Z,C){this._verify2(Z,C);var Y=Z.sub(C);if(Y.cmpn(0)<0)Y.iadd(this.m);return Y._forceRed(this)},A.prototype.isub=function(Z,C){this._verify2(Z,C);var Y=Z.isub(C);if(Y.cmpn(0)<0)Y.iadd(this.m);return Y},A.prototype.shl=function(Z,C){return this._verify1(Z),this.imod(Z.ushln(C))},A.prototype.imul=function(Z,C){return this._verify2(Z,C),this.imod(Z.imul(C))},A.prototype.mul=function(Z,C){return this._verify2(Z,C),this.imod(Z.mul(C))},A.prototype.isqr=function(Z){return this.imul(Z,Z.clone())},A.prototype.sqr=function(Z){return this.mul(Z,Z)},A.prototype.sqrt=function(Z){if(Z.isZero())return Z.clone();var C=this.m.andln(3);if(S(C%2===1),C===3){var Y=this.m.add(new Q(1)).iushrn(2);return this.pow(Z,Y)}var V=this.m.subn(1),G=0;while(!V.isZero()&&V.andln(1)===0)G++,V.iushrn(1);S(!V.isZero());var O=new Q(1).toRed(this),J=O.redNeg(),z=this.m.subn(1).iushrn(1),W=this.m.bitLength();W=new Q(2*W*W).toRed(this);while(this.pow(W,z).cmp(J)!==0)W.redIAdd(J);var j=this.pow(W,V),N=this.pow(Z,V.addn(1).iushrn(1)),p=this.pow(Z,V),n=G;while(p.cmp(O)!==0){var E0=p;for(var r=0;E0.cmp(O)!==0;r++)E0=E0.redSqr();S(r<n);var d=this.pow(j,new Q(1).iushln(n-r-1));N=N.redMul(d),j=d.redSqr(),p=p.redMul(j),n=r}return N},A.prototype.invm=function(Z){var C=Z._invmp(this.m);if(C.negative!==0)return C.negative=0,this.imod(C).redNeg();else return this.imod(C)},A.prototype.pow=function(Z,C){if(C.isZero())return new Q(1).toRed(this);if(C.cmpn(1)===0)return Z.clone();var Y=4,V=Array(1<<Y);V[0]=new Q(1).toRed(this),V[1]=Z;for(var G=2;G<V.length;G++)V[G]=this.mul(V[G-1],Z);var O=V[0],J=0,z=0,W=C.bitLength()%26;if(W===0)W=26;for(G=C.length-1;G>=0;G--){var j=C.words[G];for(var N=W-1;N>=0;N--){var p=j>>N&1;if(O!==V[0])O=this.sqr(O);if(p===0&&J===0){z=0;continue}if(J<<=1,J|=p,z++,z!==Y&&(G!==0||N!==0))continue;O=this.mul(O,V[J]),z=0,J=0}W=26}return O},A.prototype.convertTo=function(Z){var C=Z.umod(this.m);return C===Z?C.clone():C},A.prototype.convertFrom=function(Z){var C=Z.clone();return C.red=null,C},Q.mont=function(Z){return new X(Z)};function X(Z){if(A.call(this,Z),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Q(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)}K(X,A),X.prototype.convertTo=function(Z){return this.imod(Z.ushln(this.shift))},X.prototype.convertFrom=function(Z){var C=this.imod(Z.mul(this.rinv));return C.red=null,C},X.prototype.imul=function(Z,C){if(Z.isZero()||C.isZero())return Z.words[0]=0,Z.length=1,Z;var Y=Z.imul(C),V=Y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=Y.isub(V).iushrn(this.shift),O=G;if(G.cmp(this.m)>=0)O=G.isub(this.m);else if(G.cmpn(0)<0)O=G.iadd(this.m);return O._forceRed(this)},X.prototype.mul=function(Z,C){if(Z.isZero()||C.isZero())return new Q(0)._forceRed(this);var Y=Z.mul(C),V=Y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=Y.isub(V).iushrn(this.shift),O=G;if(G.cmp(this.m)>=0)O=G.isub(this.m);else if(G.cmpn(0)<0)O=G.iadd(this.m);return O._forceRed(this)},X.prototype.invm=function(Z){var C=this.imod(Z._invmp(this.m).mul(this.r2));return C._forceRed(this)}})(typeof I>"u"||I,$)}),$C=Q0(($,I)=>{var E=JE(),L=XZ(),S=qU().Buffer;function K(M){var H=M.modulus.byteLength(),F;do F=new E(L(H));while(F.cmp(M.modulus)>=0||!F.umod(M.prime1)||!F.umod(M.prime2));return F}function Q(M){var H=K(M),F=H.toRed(E.mont(M.modulus)).redPow(new E(M.publicExponent)).fromRed();return{blinder:F,unblinder:H.invm(M.modulus)}}function T(M,H){var F=Q(H),R=H.modulus.byteLength(),D=new E(M).mul(F.blinder).umod(H.modulus),q=D.toRed(E.mont(H.prime1)),P=D.toRed(E.mont(H.prime2)),_=H.coefficient,k=H.prime1,B=H.prime2,v=q.redPow(H.exponent1).fromRed(),g=P.redPow(H.exponent2).fromRed(),f=v.isub(g).imul(_).umod(k).imul(B);return g.iadd(f).imul(F.unblinder).umod(H.modulus).toArrayLike(S,"be",R)}T.getr=K,I.exports=T}),YE=Q0(($,I)=>{var E=UC(),L=XZ(),S=GZ(),K=OC(),Q=ZC(),T=vA(),M=AC(),H=$C(),F=qU().Buffer;I.exports=function(P,_,k){var B;if(P.padding)B=P.padding;else if(k)B=1;else B=4;var v=E(P),g;if(B===4)g=R(v,_);else if(B===1)g=D(v,_,k);else if(B===3){if(g=new T(_),g.cmp(v.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(k)return H(g,v);else return M(g,v)};function R(P,_){var k=P.modulus.byteLength(),B=_.length,v=S("sha1").update(F.alloc(0)).digest(),g=v.length,f=2*g;if(B>k-f-2)throw Error("message too long");var w=F.alloc(k-B-f-2),b=k-g-1,I0=L(g),X0=Q(F.concat([v,w,F.alloc(1,1),_],b),K(I0,b)),C0=Q(I0,K(X0,g));return new T(F.concat([F.alloc(1),C0,X0],k))}function D(P,_,k){var B=_.length,v=P.modulus.byteLength();if(B>v-11)throw Error("message too long");var g;if(k)g=F.alloc(v-B-3,255);else g=q(v-B-3);return new T(F.concat([F.from([0,k?1:2]),g,F.alloc(1),_],v))}function q(P){var _=F.allocUnsafe(P),k=0,B=L(P*2),v=0,g;while(k<P){if(v===B.length)B=L(P*2),v=0;if(g=B[v++],g)_[k++]=g}return _}}),SE=Q0(($,I)=>{var E=UC(),L=OC(),S=ZC(),K=vA(),Q=$C(),T=GZ(),M=AC(),H=qU().Buffer;I.exports=function(q,P,_){var k;if(q.padding)k=q.padding;else if(_)k=1;else k=4;var B=E(q),v=B.modulus.byteLength();if(P.length>v||new K(P).cmp(B.modulus)>=0)throw Error("decryption error");var g;if(_)g=M(new K(P),B);else g=Q(P,B);var f=H.alloc(v-g.length);if(g=H.concat([f,g],v),k===4)return F(B,g);else if(k===1)return R(B,g,_);else if(k===3)return g;else throw Error("unknown padding")};function F(q,P){var _=q.modulus.byteLength(),k=T("sha1").update(H.alloc(0)).digest(),B=k.length;if(P[0]!==0)throw Error("decryption error");var v=P.slice(1,B+1),g=P.slice(B+1),f=S(v,L(g,B)),w=S(g,L(f,_-B-1));if(D(k,w.slice(0,B)))throw Error("decryption error");var b=B;while(w[b]===0)b++;if(w[b++]!==1)throw Error("decryption error");return w.slice(b)}function R(q,P,_){var k=P.slice(0,2),B=2,v=0;while(P[B++]!==0)if(B>=P.length){v++;break}var g=P.slice(2,B-1);if(k.toString("hex")!=="0002"&&!_||k.toString("hex")!=="0001"&&_)v++;if(g.length<8)v++;if(v)throw Error("decryption error");return P.slice(B)}function D(q,P){q=H.from(q),P=H.from(P);var _=0,k=q.length;if(q.length!==P.length)_++,k=Math.min(q.length,P.length);var B=-1;while(++B<k)_+=q[B]^P[B];return _}}),FA=Q0(($)=>{$.publicEncrypt=YE(),$.privateDecrypt=SE(),$.privateEncrypt=function(I,E){return $.publicEncrypt(I,E,!0)},$.publicDecrypt=function(I,E){return $.privateDecrypt(I,E,!0)}}),VE=Q0(($)=>{var I=(vU(),l0(jU));if(typeof I.publicEncrypt!=="function")I=FA();if($.publicEncrypt=I.publicEncrypt,$.privateDecrypt=I.privateDecrypt,typeof I.privateEncrypt!=="function")$.privateEncrypt=FA().privateEncrypt;else $.privateEncrypt=I.privateEncrypt;if(typeof I.publicDecrypt!=="function")$.publicDecrypt=FA().publicDecrypt;else $.publicDecrypt=I.publicDecrypt}),LE=Q0(($)=>{var I=qU(),E=XZ(),L=I.Buffer,S=I.kMaxLength,K=globalThis.crypto||globalThis.msCrypto,Q=Math.pow(2,32)-1;function T(D,q){if(typeof D!=="number"||D!==D)throw TypeError("offset must be a number");if(D>Q||D<0)throw TypeError("offset must be a uint32");if(D>S||D>q)throw RangeError("offset out of range")}function M(D,q,P){if(typeof D!=="number"||D!==D)throw TypeError("size must be a number");if(D>Q||D<0)throw TypeError("size must be a uint32");if(D+q>P||D>S)throw RangeError("buffer too small")}K&&K.getRandomValues,$.randomFill=H,$.randomFillSync=R;function H(D,q,P,_){if(!L.isBuffer(D)&&!(D instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof q==="function")_=q,q=0,P=D.length;else if(typeof P==="function")_=P,P=D.length-q;else if(typeof _!=="function")throw TypeError('"cb" argument must be a function');return T(q,D.length),M(P,q,D.length),F(D,q,P,_)}function F(D,q,P,_){if(!1)var k,B;if(_){E(P,function(g,f){if(g)return _(g);f.copy(D,q),_(null,D)});return}var v=E(P);return v.copy(D,q),D}function R(D,q,P){if(typeof q>"u")q=0;if(!L.isBuffer(D)&&!(D instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(T(q,D.length),P===void 0)P=D.length-q;return M(P,q,D.length),F(D,q,P)}}),RE=Q0(($,I)=>{var E=(vU(),l0(jU));if(typeof E.randomFill==="function"&&typeof E.randomFillSync==="function")$.randomFill=E.randomFill,$.randomFillSync=E.randomFillSync;else I.exports=LE()}),DE=Q0(($)=>{$.randomBytes=$.rng=$.pseudoRandomBytes=$.prng=XZ(),$.createHash=$.Hash=GZ(),$.createHmac=$.Hmac=gI();var I=uX(),E=Object.keys(I),L=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(E);$.getHashes=function(){return L};var S=dI();$.pbkdf2=S.pbkdf2,$.pbkdf2Sync=S.pbkdf2Sync;var K=zG();$.Cipher=K.Cipher,$.createCipher=K.createCipher,$.Cipheriv=K.Cipheriv,$.createCipheriv=K.createCipheriv,$.Decipher=K.Decipher,$.createDecipher=K.createDecipher,$.Decipheriv=K.Decipheriv,$.createDecipheriv=K.createDecipheriv,$.getCiphers=K.getCiphers,$.listCiphers=K.listCiphers;var Q=TG();$.DiffieHellmanGroup=Q.DiffieHellmanGroup,$.createDiffieHellmanGroup=Q.createDiffieHellmanGroup,$.getDiffieHellman=Q.getDiffieHellman,$.createDiffieHellman=Q.createDiffieHellman,$.DiffieHellman=Q.DiffieHellman;var T=qG();$.createSign=T.createSign,$.Sign=T.Sign,$.createVerify=T.createVerify,$.Verify=T.Verify,$.createECDH=sG();var M=VE();$.publicEncrypt=M.publicEncrypt,$.privateEncrypt=M.privateEncrypt,$.publicDecrypt=M.publicDecrypt,$.privateDecrypt=M.privateDecrypt;var H=RE();$.randomFill=H.randomFill,$.randomFillSync=H.randomFillSync,$.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
|
|
16
16
|
we accept pull requests
|
|
17
|
-
https://github.com/browserify/crypto-browserify`)}
|
|
18
|
-
`);if(
|
|
19
|
-
`),
|
|
20
|
-
`),values:{healthyContainers:M,unhealthyContainers:J.length-M},data:{reports:J}}}};import{logger as FY}from"@elizaos/core";var gO=null,DY=60000,CX={name:"elizacloud_credits",description:"ElizaCloud credit balance",dynamic:!0,position:91,async get(Q,G,I){let L=Q.getService("CLOUD_AUTH");if(!L?.isAuthenticated())return{text:""};if(gO&&Date.now()-gO.at<DY)return TX(gO.value);let{data:T}=await L.getClient().get("/credits/balance");if(gO={value:T.balance,at:Date.now()},T.balance<1)FY.warn(`[CloudCredits] Low balance: $${T.balance.toFixed(2)}`);return TX(T.balance)}};function TX(Q){let G=Q<2,I=Q<0.5,L=`ElizaCloud credits: $${Q.toFixed(2)}`;if(I)L+=" (CRITICAL)";else if(G)L+=" (LOW)";return{text:L,values:{cloudCredits:Q,cloudCreditsLow:G,cloudCreditsCritical:I}}}import{logger as pU}from"@elizaos/core";import{logger as xO}from"@elizaos/core";function MY(Q){if(typeof process>"u")return;let G=process.env[Q];return G===void 0?void 0:String(G)}function o0(Q,G,I){let L=Q.getSetting(G);if(L!==void 0&&L!==null)return String(L);return MY(G)??I}function mU(){return typeof globalThis<"u"&&typeof globalThis.document<"u"}function LX(Q){return mU()&&!!o0(Q,"ELIZAOS_CLOUD_BROWSER_BASE_URL")}function cU(Q,G=!1){if(mU())return{};let I=G?zY(Q):sU(Q);return I?{Authorization:`Bearer ${I}`}:{}}function xU(Q){let G=o0(Q,"ELIZAOS_CLOUD_BROWSER_BASE_URL");return mU()&&G?G:o0(Q,"ELIZAOS_CLOUD_BASE_URL","https://www.elizacloud.ai/api/v1")}function SX(Q){let G=mU()?o0(Q,"ELIZAOS_CLOUD_BROWSER_EMBEDDING_URL")||o0(Q,"ELIZAOS_CLOUD_BROWSER_BASE_URL"):o0(Q,"ELIZAOS_CLOUD_EMBEDDING_URL");if(G)return xO.debug(`[ELIZAOS_CLOUD] Using specific embedding base URL: ${G}`),G;return xO.debug("[ELIZAOS_CLOUD] Falling back to general base URL for embeddings."),xU(Q)}function sU(Q){return o0(Q,"ELIZAOS_CLOUD_API_KEY")}function zY(Q){let G=o0(Q,"ELIZAOS_CLOUD_EMBEDDING_API_KEY");if(G)return xO.debug("[ELIZAOS_CLOUD] Using specific embedding API key (present)"),G;return xO.debug("[ELIZAOS_CLOUD] Falling back to general API key for embeddings."),sU(Q)}function NO(Q){return o0(Q,"ELIZAOS_CLOUD_SMALL_MODEL")??o0(Q,"SMALL_MODEL","gpt-5-mini")}function fO(Q){return o0(Q,"ELIZAOS_CLOUD_LARGE_MODEL")??o0(Q,"LARGE_MODEL","gpt-5")}function RX(Q){return o0(Q,"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL","gpt-5-mini")??"gpt-5-mini"}function WX(Q){return o0(Q,"ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL","google/gemini-2.5-flash-image")??"google/gemini-2.5-flash-image"}function HX(Q){let G=o0(Q,"ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY","false");return String(G).toLowerCase()==="true"}function FX(Q,G){(async()=>{try{if(!sU(G)&&!mU()){pU.warn("ELIZAOS_CLOUD_API_KEY is not set in environment - ElizaOS Cloud functionality will be limited"),pU.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys");return}try{let I=xU(G),L=await fetch(`${I}/models`,{headers:{...cU(G)}});if(!L.ok)pU.warn(`ElizaOS Cloud API key validation failed: ${L.statusText}`),pU.warn("ElizaOS Cloud functionality will be limited until a valid API key is provided"),pU.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys");else pU.log("ElizaOS Cloud API key validated successfully")}catch(I){let L=I instanceof Error?I.message:String(I);pU.warn(`Error validating ElizaOS Cloud API key: ${L}`),pU.warn("ElizaOS Cloud functionality will be limited until a valid API key is provided")}}catch(I){let L=I?.errors?.map((T)=>T.message).join(", ")||(I instanceof Error?I.message:String(I));pU.warn(`ElizaOS Cloud plugin configuration issue: ${L} - You need to configure the ELIZAOS_CLOUD_API_KEY in your environment variables`),pU.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys")}})()}import{logger as FU,ModelType as PY,VECTOR_DIMS as DX}from"@elizaos/core";import{EventType as qY}from"@elizaos/core";function bU(Q,G,I,L){let T=Number(L.inputTokens||0),F=Number(L.outputTokens||0),J=Number(L.totalTokens!=null?L.totalTokens:T+F);Q.emitEvent(qY.MODEL_USED,{runtime:Q,source:"elizacloud",type:G,tokens:{prompt:T,completion:F,total:J}})}var wO=100;function kY(Q){return{remainingRequests:parseInt(Q.headers.get("x-ratelimit-remaining-requests")||"",10)||void 0,remainingTokens:parseInt(Q.headers.get("x-ratelimit-remaining-tokens")||"",10)||void 0,limitRequests:parseInt(Q.headers.get("x-ratelimit-limit-requests")||"",10)||void 0,limitTokens:parseInt(Q.headers.get("x-ratelimit-limit-tokens")||"",10)||void 0,resetRequests:Q.headers.get("x-ratelimit-reset-requests")||void 0,resetTokens:Q.headers.get("x-ratelimit-reset-tokens")||void 0,retryAfter:parseInt(Q.headers.get("retry-after")||"",10)||void 0}}function MX(Q){let G=o0(Q,"ELIZAOS_CLOUD_EMBEDDING_MODEL","text-embedding-3-small"),I=Number.parseInt(o0(Q,"ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS","1536")||"1536",10);if(!Object.values(DX).includes(I)){let L=`Invalid embedding dimension: ${I}. Must be one of: ${Object.values(DX).join(", ")}`;throw FU.error(L),Error(L)}return{embeddingModelName:G,embeddingDimension:I}}function rU(Q,G){let I=Array(Q).fill(0);return I[0]=G,I}async function EZ(Q,G){let{embeddingDimension:I}=MX(Q);if(G===null)return FU.debug("Creating test embedding for initialization"),rU(I,0.1);let L;if(typeof G==="string")L=G;else if(typeof G==="object"&&G.text)L=G.text;else return FU.warn("Invalid input format for embedding"),rU(I,0.2);if(!L.trim())return FU.warn("Empty text for embedding"),rU(I,0.3);return(await zX(Q,[L]))[0]}async function zX(Q,G){let{embeddingModelName:I,embeddingDimension:L}=MX(Q),T=SX(Q);if(!G||G.length===0)return FU.warn("[BatchEmbeddings] Empty texts array"),[];let F=[],J=Array(G.length);for(let M=0;M<G.length;M++){let z=G[M]?.trim();if(z)F.push({text:z,originalIndex:M});else J[M]=rU(L,0.3)}if(F.length===0)return FU.warn("[BatchEmbeddings] All texts were empty"),J;for(let M=0;M<F.length;M+=wO){let z=Math.min(M+wO,F.length),W=F.slice(M,z),H=W.map((C)=>C.text);FU.info(`[BatchEmbeddings] Processing batch ${Math.floor(M/wO)+1}/${Math.ceil(F.length/wO)}: ${W.length} texts`);try{let C=await fetch(`${T}/embeddings`,{method:"POST",headers:{...cU(Q,!0),"Content-Type":"application/json"},body:JSON.stringify({model:I,input:H})}),R=kY(C);if(R.remainingRequests!==void 0&&R.remainingRequests<50)FU.warn(`[BatchEmbeddings] Rate limit: ${R.remainingRequests}/${R.limitRequests} requests remaining`);if(C.status===429){let P=R.retryAfter||30;FU.warn(`[BatchEmbeddings] Rate limited, waiting ${P}s...`),await new Promise((B)=>setTimeout(B,P*1000));let j=await fetch(`${T}/embeddings`,{method:"POST",headers:{...cU(Q,!0),"Content-Type":"application/json"},body:JSON.stringify({model:I,input:H})});if(!j.ok){FU.error(`[BatchEmbeddings] Retry failed: ${j.status}`);for(let B of W)J[B.originalIndex]=rU(L,0.4);continue}let k=await j.json();if(k?.data){for(let B of k.data){let v=W[B.index].originalIndex;J[v]=B.embedding}FU.info(`[BatchEmbeddings] Retry successful for ${W.length} embeddings`)}continue}if(!C.ok){FU.error(`[BatchEmbeddings] API error: ${C.status} - ${C.statusText}`);for(let P of W)J[P.originalIndex]=rU(L,0.4);continue}let q=await C.json();if(!q?.data||!Array.isArray(q.data)){FU.error("[BatchEmbeddings] API returned invalid structure");for(let P of W)J[P.originalIndex]=rU(L,0.5);continue}for(let P of q.data){let j=W[P.index].originalIndex;J[j]=P.embedding}if(q.usage){let P={inputTokens:q.usage.prompt_tokens,outputTokens:0,totalTokens:q.usage.total_tokens};bU(Q,PY.TEXT_EMBEDDING,`batch:${W.length}`,P)}FU.debug(`[BatchEmbeddings] Got ${W.length} embeddings (${L}d), remaining: ${R.remainingRequests??"unknown"}`)}catch(C){let R=C instanceof Error?C.message:String(C);FU.error(`[BatchEmbeddings] Error: ${R}`);for(let q of W)J[q.originalIndex]=rU(L,0.6)}}return J}import{logger as dO,ModelType as BJ}from"@elizaos/core";import{logger as CQ}from"@elizaos/core";import{JSONParseError as vJ}from"ai";function jZ(){return async({text:Q,error:G})=>{try{if(G instanceof vJ){let I=Q.replace(/```json\n|\n```|```/g,"");return JSON.parse(I),I}return null}catch(I){let L=I instanceof Error?I.message:String(I);return CQ.warn(`Failed to repair JSON text: ${L}`),null}}}async function LQ(Q){try{let{Readable:G}=await Promise.resolve().then(() => EY(bO(),1)),I=Q.getReader();return new G({async read(){try{let{done:L,value:T}=await I.read();if(L)this.push(null);else this.push(T)}catch(L){this.destroy(L)}},destroy(L,T){I.cancel().finally(()=>T(L))}})}catch(G){let I=G instanceof Error?G.message:String(G);throw CQ.error(`Failed to load node:stream module: ${I}`),Error("Cannot convert stream: node:stream module unavailable. This feature requires a Node.js environment.")}}function SQ(Q){let I=Q.match(/title[:\s]+(.+?)(?:\n|$)/i)?.[1]?.trim()||"Image Analysis",L=Q.replace(/title[:\s]+(.+?)(?:\n|$)/i,"").trim();return{title:I,description:L}}async function _Z(Q,G){let I=G.count||1,L=G.size||"1024x1024",T=G.prompt,F=WX(Q);dO.log(`[ELIZAOS_CLOUD] Using IMAGE model: ${F}`);let J=xU(Q),z={"1024x1024":"1:1","1792x1024":"16:9","1024x1792":"9:16"}[L]||"1:1";try{let W=`${J}/generate-image`,H={prompt:T,numImages:I,aspectRatio:z,model:F},C=await fetch(W,{method:"POST",headers:{...cU(Q),"Content-Type":"application/json"},body:JSON.stringify(H)});if(!C.ok){let j=await C.text();throw Error(`Failed to generate image: ${C.status} ${j}`)}return(await C.json()).images.map((j)=>({url:j.url||j.image}))}catch(W){let H=W instanceof Error?W.message:String(W);throw dO.error(`[ELIZAOS_CLOUD] Image generation error: ${H}`),W}}async function vZ(Q,G){let I,L,T=RX(Q);dO.log(`[ELIZAOS_CLOUD] Using IMAGE_DESCRIPTION model: ${T}`);let F=Number.parseInt(o0(Q,"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS","8192")||"8192",10);if(typeof G==="string")I=G,L="Please analyze this image and provide a title and detailed description.";else I=G.imageUrl,L=G.prompt||"Please analyze this image and provide a title and detailed description.";let J=[{role:"user",content:[{type:"text",text:L},{type:"image_url",image_url:{url:I}}]}],M=xU(Q);try{let z={model:T,messages:J,max_tokens:F},W=await fetch(`${M}/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",...cU(Q)},body:JSON.stringify(z)});if(!W.ok)throw Error(`ElizaOS Cloud API error: ${W.status}`);let H=await W.json(),C=H.choices?.[0]?.message?.content;if(H.usage)bU(Q,BJ.IMAGE_DESCRIPTION,typeof G==="string"?G:G.prompt||"",{inputTokens:H.usage.prompt_tokens,outputTokens:H.usage.completion_tokens,totalTokens:H.usage.total_tokens});if(!C)return{title:"Failed to analyze image",description:"No response from API"};return SQ(C)}catch(z){let W=z instanceof Error?z.message:String(z);return dO.error(`Error analyzing image: ${W}`),{title:"Failed to analyze image",description:`Error: ${W}`}}}import{logger as VO,ModelType as RQ}from"@elizaos/core";import{generateObject as xJ,JSONParseError as NJ}from"ai";import{createOpenAI as gJ}from"@ai-sdk/openai";function oO(Q){let G=xU(Q),I=sU(Q)??(LX(Q)?"eliza-proxy":void 0);return gJ({apiKey:I??"",baseURL:G})}async function WQ(Q,G,I,L){let T=oO(Q),F=L(Q);VO.log(`[ELIZAOS_CLOUD] Using ${I} model: ${F}`);let J=G.temperature??0;try{let M=T.languageModel(F),{object:z,usage:W}=await xJ({model:M,output:"no-schema",prompt:G.prompt,temperature:J,experimental_repairText:jZ()});if(W)bU(Q,I,G.prompt,W);return z}catch(M){if(M instanceof NJ){VO.error(`[generateObject] Failed to parse JSON: ${M.message}`);let W=await jZ()({text:M.text,error:M});if(W)try{let H=JSON.parse(W);return VO.info("[generateObject] Successfully repaired JSON."),H}catch(H){let C=H instanceof Error?H.message:String(H);throw VO.error(`[generateObject] Failed to parse repaired JSON: ${C}`),H}else throw VO.error("[generateObject] JSON repair failed."),M}else{let z=M instanceof Error?M.message:String(M);throw VO.error(`[generateObject] Error: ${z}`),M}}}async function BZ(Q,G){return WQ(Q,G,RQ.OBJECT_SMALL,NO)}async function gZ(Q,G){return WQ(Q,G,RQ.OBJECT_LARGE,fO)}import{logger as eV}from"@elizaos/core";async function xZ(Q,G){let I=o0(Q,"ELIZAOS_CLOUD_TTS_MODEL","gpt-5-mini-tts"),L=o0(Q,"ELIZAOS_CLOUD_TTS_VOICE","nova"),T=o0(Q,"ELIZAOS_CLOUD_TTS_INSTRUCTIONS",""),F=xU(Q),J=G.model||I,M=G.voice||L,z=G.instructions??T,W=G.format||"mp3";try{let H=await fetch(`${F}/audio/speech`,{method:"POST",headers:{...cU(Q),"Content-Type":"application/json",...W==="mp3"?{Accept:"audio/mpeg"}:{}},body:JSON.stringify({model:J,voice:M,input:G.text,format:W,...z&&{instructions:z}})});if(!H.ok){let C=await H.text();throw Error(`ElizaOS Cloud TTS error ${H.status}: ${C}`)}if(!H.body)throw Error("ElizaOS Cloud TTS response body is null");if(!mU())return await LQ(H.body);return H.body}catch(H){let C=H instanceof Error?H.message:String(H);throw Error(`Failed to fetch speech from ElizaOS Cloud TTS: ${C}`)}}import{logger as nO,ModelType as tO}from"@elizaos/core";import{generateText as fJ,streamText as wJ}from"ai";function yJ(Q,G,I){let{prompt:L,stopSequences:T=[]}=I,F=I.temperature??0.7,J=I.frequencyPenalty??0.7,M=I.presencePenalty??0.7,z=I.maxTokens??8192,W=oO(Q),H=G===tO.TEXT_SMALL?NO(Q):fO(Q),C=G===tO.TEXT_SMALL?"TEXT_SMALL":"TEXT_LARGE",R=HX(Q);return{generateParams:{model:W.languageModel(H),prompt:L,system:Q.character.system??void 0,temperature:F,maxOutputTokens:z,frequencyPenalty:J,presencePenalty:M,stopSequences:T,experimental_telemetry:{isEnabled:R}},modelName:H,modelLabel:C,prompt:L}}function cJ(Q,G,I,L,T){nO.debug(`[ELIZAOS_CLOUD] Streaming text with ${T} model`);let F=wJ(I);return{textStream:F.textStream,text:Promise.resolve(F.text),usage:Promise.resolve(F.usage).then((J)=>{if(J){bU(Q,G,L,J);let M=J.inputTokens??0,z=J.outputTokens??0;return{promptTokens:M,completionTokens:z,totalTokens:M+z}}return}),finishReason:Promise.resolve(F.finishReason)}}async function HQ(Q,G,I){let{generateParams:L,modelName:T,modelLabel:F,prompt:J}=yJ(Q,G,I);if(nO.debug(`[ELIZAOS_CLOUD] Generating text with ${F} model: ${T}`),I.stream)return cJ(Q,G,L,J,F);nO.log(`[ELIZAOS_CLOUD] Using ${F} model: ${T}`),nO.log(J);let M=await fJ(L);if(M.usage)bU(Q,G,J,M.usage);return M.text}async function NZ(Q,G){return HQ(Q,tO.TEXT_SMALL,G)}async function fZ(Q,G){return HQ(Q,tO.TEXT_LARGE,G)}import{logger as vO,Service as nA}from"@elizaos/core";import{logger as pJ}from"@elizaos/core";class wZ{baseUrl;apiKey;constructor(Q,G){this.baseUrl=Q.replace(/\/+$/,""),this.apiKey=G}setApiKey(Q){this.apiKey=Q}setBaseUrl(Q){this.baseUrl=Q.replace(/\/+$/,"")}getBaseUrl(){return this.baseUrl}getApiKey(){return this.apiKey}buildWsUrl(Q){return`${this.baseUrl.replace(/^http/,"ws")}${Q}`}async get(Q){return this.request("GET",Q)}async post(Q,G){return this.request("POST",Q,G)}async delete(Q){return this.request("DELETE",Q)}async postUnauthenticated(Q,G){return this.request("POST",Q,G,!0)}async request(Q,G,I,L=!1){let T=`${this.baseUrl}${G}`;pJ.debug(`[CloudAPI] ${Q} ${T}`);let F={"Content-Type":"application/json",Accept:"application/json"};if(!L&&this.apiKey)F.Authorization=`Bearer ${this.apiKey}`;let J=await fetch(T,{method:Q,headers:F,...I?{body:JSON.stringify(I)}:{}});return this.handleResponse(J)}async handleResponse(Q){if(!(Q.headers.get("content-type")??"").includes("application/json")){if(!Q.ok)throw new LO(Q.status,{success:!1,error:`HTTP ${Q.status}: ${Q.statusText}`});return{success:!0}}let I=await Q.json();if(!Q.ok){let L=I;throw Q.status===402?new IZ(L):new LO(Q.status,L)}return I}}async function tA(){let Q=await Promise.resolve().then(() => (cZ(),yZ)),G=await Promise.resolve().then(() => (_U(),jU)),I=Q.cpus(),L=[Q.hostname(),Q.platform(),Q.arch(),I[0]?.model??"?",I.length,Q.totalmem()].join(":");return G.createHash("sha256").update(L).digest("hex")}function mA(){if(typeof process>"u")return"web";return{darwin:"macos",win32:"windows",linux:"linux"}[process.platform]??"linux"}class QZ extends nA{static serviceType="CLOUD_AUTH";capabilityDescription="ElizaCloud device authentication and session management";client;credentials=null;constructor(Q){super(Q);this.client=new wZ(qU.baseUrl)}static async start(Q){let G=new QZ(Q);return await G.initialize(),G}async stop(){this.credentials=null}async initialize(){let Q=String(this.runtime.getSetting("ELIZAOS_CLOUD_BASE_URL")??qU.baseUrl);this.client.setBaseUrl(Q);let G=this.runtime.getSetting("ELIZAOS_CLOUD_API_KEY");if(G){let L=String(G);if(this.client.setApiKey(L),await this.validateApiKey(L)){this.credentials={apiKey:L,userId:String(this.runtime.getSetting("ELIZAOS_CLOUD_USER_ID")??""),organizationId:String(this.runtime.getSetting("ELIZAOS_CLOUD_ORG_ID")??""),authenticatedAt:Date.now()},vO.info("[CloudAuth] Authenticated with existing API key");return}vO.warn("[CloudAuth] Existing API key invalid, attempting device auth")}let I=this.runtime.getSetting("ELIZAOS_CLOUD_ENABLED");if(I==="true"||I==="1")await this.authenticateWithDevice();else vO.info("[CloudAuth] Cloud not enabled (set ELIZAOS_CLOUD_ENABLED=true)")}async validateApiKey(Q){return(await fetch(`${this.client.getBaseUrl()}/models`,{headers:{Authorization:`Bearer ${Q}`}})).ok}async authenticateWithDevice(){let Q=await tA(),G=mA(),I=process.env.ELIZAOS_CLOUD_APP_VERSION??"2.0.0-alpha",L=await Promise.resolve().then(() => (cZ(),yZ));vO.info(`[CloudAuth] Authenticating device (platform=${G})`);let T=await this.client.postUnauthenticated("/device-auth",{deviceId:Q,platform:G,appVersion:I,deviceName:L.hostname()});this.credentials={apiKey:T.data.apiKey,userId:T.data.userId,organizationId:T.data.organizationId,authenticatedAt:Date.now()},this.client.setApiKey(T.data.apiKey);let F=T.data.isNew?"New account created":"Authenticated";return vO.info(`[CloudAuth] ${F} (credits: $${T.data.credits.toFixed(2)})`),this.credentials}isAuthenticated(){return this.credentials!==null}getCredentials(){return this.credentials}getApiKey(){return this.credentials?.apiKey??this.client.getApiKey()}getClient(){return this.client}getUserId(){return this.credentials?.userId}getOrganizationId(){return this.credentials?.organizationId}}import{logger as gU,Service as sA}from"@elizaos/core";class YZ extends sA{static serviceType="CLOUD_BACKUP";capabilityDescription="ElizaCloud agent state backup and restore";authService;autoBackups=new Map;maxSnapshots=qU.backup.maxSnapshots;backupIntervalMs=qU.backup.autoBackupIntervalMs;static async start(Q){let G=new YZ(Q);return await G.initialize(),G}async stop(){for(let[,Q]of this.autoBackups)clearInterval(Q.timer);this.autoBackups.clear(),gU.info("[CloudBackup] Service stopped")}async initialize(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q){gU.warn("[CloudBackup] CloudAuthService not available");return}this.authService=Q,gU.info("[CloudBackup] Service initialized")}async createSnapshot(Q,G="manual",I){let T=await this.authService.getClient().post(`/agent-state/${Q}/snapshot`,{snapshotType:G,metadata:I});gU.info(`[CloudBackup] Created ${G} snapshot for container ${Q} (id=${T.data.id}, size=${rA(T.data.sizeBytes)})`);let F=this.autoBackups.get(Q);if(F)F.lastBackupAt=Date.now();return T.data}async listSnapshots(Q){return(await this.authService.getClient().get(`/agent-state/${Q}/snapshots`)).data}async restoreSnapshot(Q,G){await this.authService.getClient().post(`/agent-state/${Q}/restore`,{snapshotId:G}),gU.info(`[CloudBackup] Restored snapshot ${G} for container ${Q}`)}async getLatestSnapshot(Q){let G=await this.listSnapshots(Q);if(G.length===0)return null;return G.sort((I,L)=>new Date(L.created_at).getTime()-new Date(I.created_at).getTime()),G[0]}scheduleAutoBackup(Q,G){if(this.autoBackups.has(Q)){gU.debug(`[CloudBackup] Auto-backup already scheduled for ${Q}`);return}let I=G??this.backupIntervalMs,L=setInterval(()=>{gU.debug(`[CloudBackup] Running auto-backup for container ${Q}`),this.createSnapshot(Q,"auto",{trigger:"scheduled",scheduledIntervalMs:I}).then(()=>this.pruneSnapshots(Q)).catch((T)=>{gU.error(`[CloudBackup] Auto-backup failed for ${Q}: ${T.message}`)})},I);this.autoBackups.set(Q,{containerId:Q,timer:L,lastBackupAt:null}),gU.info(`[CloudBackup] Scheduled auto-backup for ${Q} every ${Math.round(I/60000)} minutes`)}cancelAutoBackup(Q){let G=this.autoBackups.get(Q);if(!G)return;clearInterval(G.timer),this.autoBackups.delete(Q),gU.info(`[CloudBackup] Cancelled auto-backup for ${Q}`)}async createPreEvictionSnapshot(Q){return gU.info(`[CloudBackup] Creating pre-eviction snapshot for ${Q}`),this.createSnapshot(Q,"pre-eviction",{trigger:"billing-eviction",createdAt:new Date().toISOString()})}async pruneSnapshots(Q){let L=(await this.listSnapshots(Q)).filter((F)=>F.snapshotType==="auto").sort((F,J)=>new Date(J.created_at).getTime()-new Date(F.created_at).getTime()).slice(this.maxSnapshots);if(L.length===0)return;let T=this.authService.getClient();for(let F of L)await T.delete(`/agent-state/${Q}/snapshots/${F.id}`),gU.debug(`[CloudBackup] Pruned old auto snapshot ${F.id} for ${Q}`);gU.info(`[CloudBackup] Pruned ${L.length} old auto snapshot(s) for ${Q}`)}isAutoBackupScheduled(Q){return this.autoBackups.has(Q)}getLastBackupTime(Q){return this.autoBackups.get(Q)?.lastBackupAt??null}}function rA(Q){if(Q<1024)return`${Q} B`;if(Q<1048576)return`${(Q/1024).toFixed(1)} KB`;if(Q<1073741824)return`${(Q/1048576).toFixed(1)} MB`;return`${(Q/1073741824).toFixed(1)} GB`}import{logger as wU,Service as eA}from"@elizaos/core";import{WebSocket as QX}from"undici";class JZ extends eA{static serviceType="CLOUD_BRIDGE";capabilityDescription="WebSocket bridge to cloud-hosted ElizaOS agents";authService;bridgeConfig=qU.bridge;connections=new Map;static async start(Q){let G=new JZ(Q);return await G.initialize(),G}async stop(){for(let[Q]of this.connections)await this.disconnect(Q);wU.info("[CloudBridge] Service stopped")}async initialize(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q){wU.warn("[CloudBridge] CloudAuthService not available");return}this.authService=Q,wU.info("[CloudBridge] Service initialized")}async connect(Q){if(this.connections.has(Q)){let G=this.connections.get(Q);if(G.state==="connected"||G.state==="connecting"){wU.debug(`[CloudBridge] Already connected/connecting to ${Q}`);return}}await this.establishConnection(Q,0)}async disconnect(Q){let G=this.connections.get(Q);if(!G)return;if(G.heartbeatTimer)clearInterval(G.heartbeatTimer);if(G.reconnectTimer)clearTimeout(G.reconnectTimer);for(let[,I]of G.pendingRequests)clearTimeout(I.timeout),I.reject(Error("Bridge disconnected"));if(G.pendingRequests.clear(),G.ws.readyState===QX.OPEN||G.ws.readyState===QX.CONNECTING)G.ws.close(1000,"Client disconnect");this.connections.delete(Q),wU.info(`[CloudBridge] Disconnected from ${Q}`)}async establishConnection(Q,G){let I=this.authService.getClient(),L=this.authService.getApiKey(),T=I.buildWsUrl(`/agent-bridge/${Q}`),F=L?`${T}?token=${encodeURIComponent(L)}`:T,J={ws:new QX(F),state:"connecting",connectedAt:null,lastHeartbeat:null,reconnectAttempts:G,heartbeatTimer:null,reconnectTimer:null,handlers:this.connections.get(Q)?.handlers??new Set,pendingRequests:new Map,nextRequestId:1};this.connections.set(Q,J),J.ws.addEventListener("open",()=>{J.state="connected",J.connectedAt=Date.now(),J.reconnectAttempts=0,wU.info(`[CloudBridge] Connected to agent ${Q}`),J.heartbeatTimer=setInterval(()=>{this.sendHeartbeat(Q)},this.bridgeConfig.heartbeatIntervalMs)}),J.ws.addEventListener("message",(M)=>{let z=M.data,W=typeof z==="string"?z:z instanceof Buffer?z.toString("utf-8"):String(z),H=JSON.parse(W);if(H.method==="heartbeat.ack"){J.lastHeartbeat=Date.now();return}if(H.id!==void 0&&!H.method){let C=J.pendingRequests.get(H.id);if(C){if(clearTimeout(C.timeout),J.pendingRequests.delete(H.id),H.error)C.reject(Error(H.error.message));else C.resolve(H.result);return}}for(let C of J.handlers)C(H)}),J.ws.addEventListener("close",(M)=>{if(J.state="disconnected",J.heartbeatTimer)clearInterval(J.heartbeatTimer);if(M.code===1000){wU.info(`[CloudBridge] Clean disconnect from ${Q}`);return}wU.warn(`[CloudBridge] Connection lost to ${Q} (code=${M.code}, reason=${M.reason})`),this.scheduleReconnect(Q,J.reconnectAttempts+1)}),J.ws.addEventListener("error",()=>{wU.error(`[CloudBridge] WebSocket error for ${Q}`)})}scheduleReconnect(Q,G){if(G>this.bridgeConfig.maxReconnectAttempts){wU.error(`[CloudBridge] Max reconnect attempts (${this.bridgeConfig.maxReconnectAttempts}) reached for ${Q}`),this.connections.delete(Q);return}let I=this.bridgeConfig.reconnectIntervalMs,L=Math.min(I*2**Math.min(G,5),120000),T=Math.floor(Math.random()*1000);wU.info(`[CloudBridge] Reconnecting to ${Q} in ${Math.round((L+T)/1000)}s (attempt ${G})`);let F=this.connections.get(Q);if(F)F.state="reconnecting",F.reconnectTimer=setTimeout(()=>{this.establishConnection(Q,G)},L+T)}sendHeartbeat(Q){let G=this.connections.get(Q);if(!G||G.state!=="connected")return;let I={jsonrpc:"2.0",method:"heartbeat",params:{timestamp:Date.now()}};G.ws.send(JSON.stringify(I))}async sendRequest(Q,G,I,L=60000){let T=this.connections.get(Q);if(!T||T.state!=="connected")throw Error(`Not connected to container ${Q}`);let F=T.nextRequestId++,J={jsonrpc:"2.0",id:F,method:G,params:I};return new Promise((M,z)=>{let W=setTimeout(()=>{T.pendingRequests.delete(F),z(Error(`Request ${G} timed out after ${L}ms`))},L);T.pendingRequests.set(F,{resolve:M,reject:z,timeout:W}),T.ws.send(JSON.stringify(J))})}sendNotification(Q,G,I){let L=this.connections.get(Q);if(!L||L.state!=="connected")throw Error(`Not connected to container ${Q}`);let T={jsonrpc:"2.0",method:G,params:I};L.ws.send(JSON.stringify(T))}async sendChatMessage(Q,G,I,L){return await this.sendRequest(Q,"message.send",{text:G,roomId:I,metadata:L})}async getAgentStatus(Q){return await this.sendRequest(Q,"status.get",{})}async updateAgentConfig(Q,G){await this.sendRequest(Q,"config.update",G)}onMessage(Q,G){let I=this.connections.get(Q);if(!I)I={ws:null,state:"disconnected",connectedAt:null,lastHeartbeat:null,reconnectAttempts:0,heartbeatTimer:null,reconnectTimer:null,handlers:new Set,pendingRequests:new Map,nextRequestId:1},this.connections.set(Q,I);return I.handlers.add(G),()=>{I.handlers.delete(G)}}getConnectionState(Q){return this.connections.get(Q)?.state??"disconnected"}getConnectionInfo(Q){let G=this.connections.get(Q);if(!G)return null;return{containerId:Q,state:G.state,connectedAt:G.connectedAt,lastHeartbeat:G.lastHeartbeat,reconnectAttempts:G.reconnectAttempts}}getConnectedContainerIds(){let Q=[];for(let[G,I]of this.connections)if(I.state==="connected")Q.push(G);return Q}}import{logger as yU,Service as aA}from"@elizaos/core";class $Z extends aA{static serviceType="CLOUD_CONTAINER";capabilityDescription="ElizaCloud container provisioning and lifecycle management";authService;containerDefaults=qU.container;tracked=new Map;static async start(Q){let G=new $Z(Q);return await G.initialize(),G}async stop(){for(let[,Q]of this.tracked){if(Q.pollingTimer)clearTimeout(Q.pollingTimer);if(Q.healthTimer)clearInterval(Q.healthTimer)}this.tracked.clear()}async initialize(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q){yU.warn("[CloudContainer] CloudAuthService not available, container operations will fail");return}if(this.authService=Q,this.authService.isAuthenticated()){let G=await this.listContainers();for(let I of G){if(this.tracked.set(I.id,{container:I,pollingTimer:null,healthTimer:null}),I.status==="pending"||I.status==="building"||I.status==="deploying")this.startPolling(I.id);if(I.status==="running")this.startHealthMonitoring(I.id)}yU.info(`[CloudContainer] Loaded ${G.length} existing container(s)`)}}getClient(){return this.authService.getClient()}async createContainer(Q){let G=this.getClient(),I=this.containerDefaults,L={name:Q.name,project_name:Q.project_name,description:Q.description,port:Q.port??I.defaultPort,desired_count:Q.desired_count??1,cpu:Q.cpu??I.defaultCpu,memory:Q.memory??I.defaultMemory,environment_vars:Q.environment_vars??{},health_check_path:Q.health_check_path??"/health",ecr_image_uri:Q.ecr_image_uri,ecr_repository_uri:Q.ecr_repository_uri,image_tag:Q.image_tag,architecture:Q.architecture??I.defaultArchitecture},T=await G.post("/containers",L);return this.tracked.set(T.data.id,{container:T.data,pollingTimer:null,healthTimer:null}),this.startPolling(T.data.id),yU.info(`[CloudContainer] Created container "${Q.name}" (id=${T.data.id}, stack=${T.stackName})`),T}async listContainers(){return(await this.getClient().get("/containers")).data}async getContainer(Q){let I=await this.getClient().get(`/containers/${Q}`),L=this.tracked.get(Q);if(L)L.container=I.data;return I.data}async deleteContainer(Q){await this.getClient().delete(`/containers/${Q}`);let I=this.tracked.get(Q);if(I){if(I.pollingTimer)clearTimeout(I.pollingTimer);if(I.healthTimer)clearInterval(I.healthTimer);this.tracked.delete(Q)}yU.info(`[CloudContainer] Deleted container ${Q}`)}startPolling(Q){let G=this.tracked.get(Q);if(!G)return;let I=0,L=120,T=5000,F=30000,J=async()=>{if(I++,I>L){yU.error(`[CloudContainer] Polling timed out for container ${Q} after ${L} attempts`);return}let M=await this.getContainer(Q),z=M.status;if(yU.debug(`[CloudContainer] Poll #${I} for ${Q}: status=${z}`),z==="running"){yU.info(`[CloudContainer] Container ${Q} is now running at ${M.load_balancer_url}`),this.startHealthMonitoring(Q);return}if(z==="failed"||z==="stopped"||z==="suspended"){if(yU.warn(`[CloudContainer] Container ${Q} reached terminal state: ${z}`),M.error_message)yU.error(`[CloudContainer] Error: ${M.error_message}`);return}let W=Math.min(T*2**Math.min(I-1,3),F);G.pollingTimer=setTimeout(J,W)};G.pollingTimer=setTimeout(J,T)}async waitForDeployment(Q,G=900000){let I=Date.now()+G,L=5000,T=30000;while(Date.now()<I){let F=await this.getContainer(Q);if(F.status==="running")return F;if(F.status==="failed")throw Error(`Container deployment failed: ${F.error_message??"unknown error"}`);if(F.status==="stopped"||F.status==="suspended")throw Error(`Container reached terminal state: ${F.status}`);await new Promise((J)=>setTimeout(J,L)),L=Math.min(L*1.5,T)}throw Error(`Container deployment timed out after ${Math.round(G/1000)}s`)}startHealthMonitoring(Q){let G=this.tracked.get(Q);if(!G||G.healthTimer)return;let I=60000;G.healthTimer=setInterval(()=>{this.getContainerHealth(Q).then((L)=>{if(!L.data.healthy)yU.warn(`[CloudContainer] Container ${Q} unhealthy: ${L.data.status}`)}).catch((L)=>{yU.error(`[CloudContainer] Health check failed for ${Q}: ${L.message}`)})},I)}async getContainerHealth(Q){return this.getClient().get(`/containers/${Q}/health`)}getTrackedContainers(){return Array.from(this.tracked.values()).map((Q)=>Q.container)}getTrackedContainer(Q){return this.tracked.get(Q)?.container}isContainerRunning(Q){return this.tracked.get(Q)?.container.status==="running"}getContainerUrl(Q){return this.tracked.get(Q)?.container.load_balancer_url??null}}function iA(){if(typeof process>"u")return{};return process.env}var zU=iA(),UV={name:"elizaOSCloud",description:"ElizaOS Cloud plugin — Multi-model AI generation, container provisioning, agent bridge, and billing management",config:{ELIZAOS_CLOUD_API_KEY:zU.ELIZAOS_CLOUD_API_KEY??null,ELIZAOS_CLOUD_BASE_URL:zU.ELIZAOS_CLOUD_BASE_URL??null,ELIZAOS_CLOUD_ENABLED:zU.ELIZAOS_CLOUD_ENABLED??null,ELIZAOS_CLOUD_SMALL_MODEL:zU.ELIZAOS_CLOUD_SMALL_MODEL??null,ELIZAOS_CLOUD_LARGE_MODEL:zU.ELIZAOS_CLOUD_LARGE_MODEL??null,SMALL_MODEL:zU.SMALL_MODEL??null,LARGE_MODEL:zU.LARGE_MODEL??null,ELIZAOS_CLOUD_EMBEDDING_MODEL:zU.ELIZAOS_CLOUD_EMBEDDING_MODEL??null,ELIZAOS_CLOUD_EMBEDDING_API_KEY:zU.ELIZAOS_CLOUD_EMBEDDING_API_KEY??null,ELIZAOS_CLOUD_EMBEDDING_URL:zU.ELIZAOS_CLOUD_EMBEDDING_URL??null,ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS:zU.ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS??null,ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL:zU.ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL??null,ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS:zU.ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS??null,ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY:zU.ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY??null,ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL:zU.ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL??null},async init(Q,G){FX(Q,G)},services:[QZ,$Z,JZ,YZ],actions:[VX,AX,IX,GX],providers:[EX,CX,KX],models:{[IU.TEXT_EMBEDDING]:EZ,[IU.TEXT_SMALL]:NZ,[IU.TEXT_LARGE]:fZ,[IU.IMAGE]:_Z,[IU.IMAGE_DESCRIPTION]:vZ,[IU.OBJECT_SMALL]:BZ,[IU.OBJECT_LARGE]:gZ},tests:[{name:"ELIZAOS_CLOUD_plugin_tests",tests:[{name:"ELIZAOS_CLOUD_test_url_and_api_key_validation",fn:async(Q)=>{let G=xU(Q),I=await fetch(`${G}/models`,{headers:{Authorization:`Bearer ${sU(Q)}`}}),L=await I.json();if(vU.log({data:L?.data?.length??"N/A"},"Models Available"),!I.ok)throw Error(`Failed to validate OpenAI API key: ${I.statusText}`)}},{name:"ELIZAOS_CLOUD_test_text_embedding",fn:async(Q)=>{let G=await Q.useModel(IU.TEXT_EMBEDDING,{text:"Hello, world!"});vU.log({embedding:G},"embedding")}},{name:"ELIZAOS_CLOUD_test_text_large",fn:async(Q)=>{let G=await Q.useModel(IU.TEXT_LARGE,{prompt:"What is the nature of reality in 10 words?"});if(G.length===0)throw Error("Failed to generate text");vU.log({text:G},"generated with test_text_large")}},{name:"ELIZAOS_CLOUD_test_text_small",fn:async(Q)=>{let G=await Q.useModel(IU.TEXT_SMALL,{prompt:"What is the nature of reality in 10 words?"});if(G.length===0)throw Error("Failed to generate text");vU.log({text:G},"generated with test_text_small")}},{name:"ELIZAOS_CLOUD_test_image_generation",fn:async(Q)=>{vU.log("ELIZAOS_CLOUD_test_image_generation");let G=await Q.useModel(IU.IMAGE,{prompt:"A beautiful sunset over a calm ocean",count:1,size:"1024x1024"});vU.log({image:G},"generated with test_image_generation")}},{name:"image-description",fn:async(Q)=>{vU.log("ELIZAOS_CLOUD_test_image_description");let G=await Q.useModel(IU.IMAGE_DESCRIPTION,"https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg/537px-Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg");if(G&&typeof G==="object"&&"title"in G&&"description"in G)vU.log({result:G},"Image description");else vU.error(`Invalid image description result format: ${JSON.stringify(G)}`)}},{name:"ELIZAOS_CLOUD_test_transcription",fn:async(Q)=>{vU.log("ELIZAOS_CLOUD_test_transcription");let I=await(await fetch("https://upload.wikimedia.org/wikipedia/en/4/40/Chris_Benoit_Voice_Message.ogg")).arrayBuffer(),L=await Q.useModel(IU.TRANSCRIPTION,Buffer.from(new Uint8Array(I)));vU.log({transcription:L},"generated with test_transcription")}},{name:"ELIZAOS_CLOUD_test_text_tokenizer_encode",fn:async(Q)=>{let I=await Q.useModel(IU.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer encode!",modelType:IU.TEXT_SMALL});if(!Array.isArray(I)||I.length===0)throw Error("Failed to tokenize text: expected non-empty array of tokens");vU.log({tokens:I},"Tokenized output")}},{name:"ELIZAOS_CLOUD_test_text_tokenizer_decode",fn:async(Q)=>{let I=await Q.useModel(IU.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer decode!",modelType:IU.TEXT_SMALL}),L=await Q.useModel(IU.TEXT_TOKENIZER_DECODE,{tokens:I,modelType:IU.TEXT_SMALL});if(L!=="Hello tokenizer decode!")throw Error(`Decoded text does not match original. Expected "Hello tokenizer decode!", got "${L}"`);vU.log({decodedText:L},"Decoded text")}},{name:"ELIZAOS_CLOUD_test_text_to_speech",fn:async(Q)=>{if(!await xZ(Q,{text:"Hello, this is a test for text-to-speech."}))throw Error("Failed to generate speech");vU.log("Generated speech successfully")}}]}]},OV=UV;export{UV as elizaOSCloudPlugin,OV as default};
|
|
17
|
+
https://github.com/browserify/crypto-browserify`)},$.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}}),h0=hX(DE(),1),KE=h0.prng,HE=h0.pseudoRandomBytes,WE=h0.rng,FE=h0.randomBytes,ME=h0.Hash,zE=h0.createHash,TE=h0.Hmac,qE=h0.createHmac,PE=h0.getHashes,kE=h0.pbkdf2,_E=h0.pbkdf2Sync,jE=h0.Cipher,vE=h0.createCipher,BE=h0.Cipheriv,gE=h0.createCipheriv,xE=h0.Decipher,NE=h0.createDecipher,fE=h0.Decipheriv,wE=h0.createDecipheriv,yE=h0.getCiphers,cE=h0.listCiphers,pE=h0.DiffieHellmanGroup,hE=h0.createDiffieHellmanGroup,uE=h0.getDiffieHellman,lE=h0.createDiffieHellman,dE=h0.DiffieHellman,bE=h0.createSign,oE=h0.Sign,nE=h0.createVerify,tE=h0.Verify,sE=h0.createECDH,mE=h0.publicEncrypt,rE=h0.privateEncrypt,eE=h0.publicDecrypt,aE=h0.privateDecrypt,iE=h0.randomFill,UJ=h0.randomFillSync,OJ=h0.createCredentials,ZJ=h0.constants,CJ=["p192","p224","p256","p384","p521","curve25519","ed25519","secp256k1","secp224r1","prime256v1","prime192v1","ed25519","secp384r1","secp521r1"];XJ=crypto,GJ=crypto});import{logger as BU,ModelType as t0}from"@elizaos/core";var uA={name:"CHECK_CLOUD_CREDITS",description:"Check ElizaCloud credit balance, container costs, and estimated remaining runtime.",descriptionCompressed:"Check ElizaCloud credits, container costs, remaining runtime.",similes:["check credits","check balance","how much credit","cloud billing"],tags:["cloud","billing"],parameters:[{name:"detailed",description:"Include transaction history",required:!1,schema:{type:"boolean"}}],validate:async($,I,E,L)=>{let K=(typeof I?.content?.text==="string"?I.content.text:"").toLowerCase(),Q=["check","cloud","credits"],T=Q.length>0&&Q.some((k)=>k.length>0&&K.includes(k)),M=/\b(?:check|cloud|credits)\b/i,H=Boolean(K.match(M)),F=String(I?.content?.source??""),R="",D=Boolean(F||E||$?.agentId||$?.getService),q=L&&typeof L==="object"?L:{},P=K.trim().length>0||Object.keys(q).length>0||Boolean(I?.content&&typeof I.content==="object");if(!(T&&H&&D&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _($))}catch{return!1}},async handler($,I,E,L,S){let K=$.getService("CLOUD_AUTH"),Q=$.getService("CLOUD_CONTAINER"),T=K.getClient(),M=L?.detailed===!0||I.metadata?.detailed===!0,{data:{balance:H}}=await T.get("/credits/balance"),F=Q?.getTrackedContainers().filter((_)=>_.status==="running").length??0,R=F*0.67,D=R>0?H/R:null,q=[`ElizaCloud credits: $${H.toFixed(2)}`,F>0?`Active containers: ${F} ($${R.toFixed(2)}/day) — ~${D?.toFixed(1)} days remaining`:"No active containers."];if(M){let{data:_}=await T.get("/credits/summary");q.push(`Total spent: $${_.totalSpent.toFixed(2)} | Total added: $${_.totalAdded.toFixed(2)}`);for(let k of _.recentTransactions.slice(0,10)){let B=k.amount>=0?"+":"";q.push(` ${B}$${k.amount.toFixed(2)} — ${k.description} (${new Date(k.created_at).toLocaleDateString()})`)}}let P=q.join(`
|
|
18
|
+
`);if(S)await S({text:P,actions:["CHECK_CLOUD_CREDITS"]});return{success:!0,text:P,data:{balance:H,runningContainers:F,dailyCost:R,estimatedDaysRemaining:D}}}};function OO($){let I=$??{},E=I.parameters&&typeof I.parameters==="object"?I.parameters:{};return{...I,...E}}function YO($){let I=OO($).confirmed;return I===!0||I==="true"}function SO($,I){return{success:!1,text:$,data:{requiresConfirmation:!0,preview:$,...I}}}function MC($,I){let E=OO(I);if(E.containerId)return String(E.containerId);let L=$.metadata?.actionParams;return L?.containerId?String(L.containerId):null}var lA={name:"FREEZE_CLOUD_AGENT",description:"Freeze a cloud agent: snapshot state, disconnect bridge, stop container.",descriptionCompressed:"Freeze cloud agent: snapshot, disconnect, stop container.",similes:["freeze agent","hibernate agent","pause agent","stop cloud agent"],tags:["cloud","container","backup"],parameters:[{name:"containerId",description:"ID of the container to freeze",required:!0,schema:{type:"string"}},{name:"confirmed",description:"Must be true to freeze the cloud agent after preview.",required:!1,schema:{type:"boolean",default:!1}}],validate:async($,I,E,L)=>{let K=(typeof I?.content?.text==="string"?I.content.text:"").toLowerCase(),Q=["freeze","cloud"],T=Q.length>0&&Q.some((k)=>k.length>0&&K.includes(k)),M=/\b(?:freeze|cloud)\b/i,H=Boolean(K.match(M)),F=String(I?.content?.source??""),R="",D=Boolean(F||E||$?.agentId||$?.getService),q=L&&typeof L==="object"?L:{},P=K.trim().length>0||Object.keys(q).length>0||Boolean(I?.content&&typeof I.content==="object");if(!(T&&H&&D&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _($))}catch{return!1}},async handler($,I,E,L,S){let K=$.getService("CLOUD_CONTAINER"),Q=$.getService("CLOUD_BRIDGE"),T=$.getService("CLOUD_BACKUP"),M=MC(I,L);if(!M)return{success:!1,error:"Missing containerId"};let H=await K.getContainer(M);if(H.status!=="running")return{success:!1,error:`Container not running (status: ${H.status})`};let F=["Confirmation required before freezing Eliza Cloud agent:",`Container: ${H.name}`,`ID: ${M}`,"Effects: create snapshot, disconnect bridge, stop container."].join(`
|
|
19
|
+
`);if(!YO(L))return await S?.({text:F,actions:["FREEZE_CLOUD_AGENT"]}),SO(F,{containerId:M,containerName:H.name});let R=async(q)=>{if(S)await S({text:q,actions:["FREEZE_CLOUD_AGENT"]})};await R(`Freezing "${H.name}"... Creating snapshot.`);let D=null;if(T)D=(await T.createSnapshot(M,"manual",{trigger:"user-freeze",containerName:H.name})).id,T.cancelAutoBackup(M);if(Q)await Q.disconnect(M);return await K.deleteContainer(M),await R(`"${H.name}" frozen.${D?` Snapshot: ${D}`:""}`),{success:!0,text:`Agent "${H.name}" frozen`,data:{containerId:M,containerName:H.name,snapshotId:D}}}};import{logger as TC}from"@elizaos/core";import{CloudApiError as tJ,InsufficientCreditsError as sJ}from"@elizaos/cloud-sdk";var PU={enabled:!1,baseUrl:"https://www.elizacloud.ai/api/v1",inferenceMode:"cloud",autoProvision:!1,bridge:{reconnectIntervalMs:3000,maxReconnectAttempts:20,heartbeatIntervalMs:30000},backup:{autoBackupIntervalMs:3600000,maxSnapshots:10},container:{defaultImage:"elizaos/agent:latest",defaultArchitecture:"arm64",defaultCpu:1792,defaultMemory:1792,defaultPort:3000}};var zC=["OPENAI_API_KEY","ANTHROPIC_API_KEY","GROQ_API_KEY","ELIZAOS_CLOUD_API_KEY","NANO_MODEL","MEDIUM_MODEL","SMALL_MODEL","LARGE_MODEL","MEGA_MODEL","RESPONSE_HANDLER_MODEL","ACTION_PLANNER_MODEL","SHOULD_RESPOND_MODEL","PLANNER_MODEL","RESPONSE_MODEL","ELIZAOS_CLOUD_SMALL_MODEL","ELIZAOS_CLOUD_NANO_MODEL","ELIZAOS_CLOUD_MEDIUM_MODEL","ELIZAOS_CLOUD_LARGE_MODEL","ELIZAOS_CLOUD_MEGA_MODEL","ELIZAOS_CLOUD_RESPONSE_HANDLER_MODEL","ELIZAOS_CLOUD_ACTION_PLANNER_MODEL","ELIZAOS_CLOUD_SHOULD_RESPOND_MODEL","ELIZAOS_CLOUD_PLANNER_MODEL","ELIZAOS_CLOUD_RESPONSE_MODEL"];function oO($){let I={};for(let E of zC){let L=$.getSetting(E);if(L)I[E]=String(L)}return I}function qC($,I){let E=OO(I);if(Object.keys(E).length>0)return E;let L=$.metadata;if(L?.actionParams)return L.actionParams;let S=$.content?.text??"",K=S.match(/name[:\s]+["']?([^"',]+)["']?/i)?.[1]?.trim(),Q=S.match(/project[:\s]+["']?([^"',\s]+)["']?/i)?.[1]?.trim();return{name:K,project_name:Q}}var dA={name:"PROVISION_CLOUD_AGENT",description:"Deploy an ElizaOS agent to ElizaCloud. Provisions a container, waits for deployment, connects the bridge, and starts auto-backup.",descriptionCompressed:"Deploy agent to ElizaCloud. Provisions container, connects bridge, starts backup.",similes:["deploy agent to cloud","launch cloud agent","start remote agent","provision container"],tags:["cloud","container","deployment"],parameters:[{name:"name",description:"Human-readable name for the cloud agent",required:!0,schema:{type:"string"}},{name:"project_name",description:"Unique project identifier (lowercase, no spaces)",required:!0,schema:{type:"string"}},{name:"description",description:"Optional description",required:!1,schema:{type:"string"}},{name:"environment_vars",description:"Additional environment variables",required:!1,schema:{type:"object"}},{name:"auto_backup",description:"Enable periodic auto-backup (default: true)",required:!1,schema:{type:"boolean"}},{name:"confirmed",description:"Must be true to provision the cloud agent after preview.",required:!1,schema:{type:"boolean",default:!1}}],validate:async($,I,E,L)=>{let K=(typeof I?.content?.text==="string"?I.content.text:"").toLowerCase(),Q=["provision","cloud"],T=Q.length>0&&Q.some((k)=>k.length>0&&K.includes(k)),M=/\b(?:provision|cloud)\b/i,H=Boolean(K.match(M)),F=String(I?.content?.source??""),R="",D=Boolean(F||E||$?.agentId||$?.getService),q=L&&typeof L==="object"?L:{},P=K.trim().length>0||Object.keys(q).length>0||Boolean(I?.content&&typeof I.content==="object");if(!(T&&H&&D&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _($))}catch{return!1}},async handler($,I,E,L,S){let K=$.getService("CLOUD_AUTH"),Q=$.getService("CLOUD_CONTAINER"),T=$.getService("CLOUD_BRIDGE"),M=$.getService("CLOUD_BACKUP");if(!K?.isAuthenticated()||!Q)return{success:!1,error:"ElizaCloud not authenticated or container service unavailable"};let H=qC(I,L);if(!H.name||!H.project_name)return{success:!1,error:"Missing required parameters: name and project_name"};let F=H.auto_backup!==!1,R=["Confirmation required before provisioning Eliza Cloud agent:",`Name: ${String(H.name)}`,`Project: ${String(H.project_name)}`,`Auto-backup: ${F?"enabled":"disabled"}`].join(`
|
|
20
|
+
`);if(!YO(L))return await S?.({text:R,actions:["PROVISION_CLOUD_AGENT"]}),SO(R,{name:String(H.name),project_name:String(H.project_name),auto_backup:F});let D=async(v)=>{if(S)await S({text:v,actions:["PROVISION_CLOUD_AGENT"]})};await D(`Provisioning cloud agent "${H.name}"... This typically takes 8-12 minutes.`);let q=PU.container,P={name:H.name,project_name:H.project_name,description:H.description,port:q.defaultPort,cpu:q.defaultCpu,memory:q.defaultMemory,architecture:q.defaultArchitecture,ecr_image_uri:q.defaultImage,environment_vars:{...oO($),...H.environment_vars},health_check_path:"/health"},_=await Q.createContainer(P),k=_.data.id;await D(`Container created (id: ${k}). Credits: -$${_.creditsDeducted.toFixed(2)} ($${_.creditsRemaining.toFixed(2)} remaining).`);let B=await Q.waitForDeployment(k);if(await D(`Container running at ${B.load_balancer_url}`),T)await T.connect(k),TC.info(`[PROVISION] Bridge connected to ${k}`);if(F&&M)M.scheduleAutoBackup(k);return await D(`Agent "${H.name}" deployed.${F?" Auto-backup enabled.":""}`),{success:!0,text:`Cloud agent "${H.name}" deployed`,data:{containerId:k,containerUrl:B.load_balancer_url,status:B.status,creditsDeducted:_.creditsDeducted,creditsRemaining:_.creditsRemaining,bridgeConnected:T?.getConnectionState(k)==="connected",autoBackupEnabled:F}}}};function PC($,I){let E=OO(I);if(Object.keys(E).length>0)return E;return $.metadata?.actionParams??{}}async function kC($,I,E){let S=(await I.listContainers()).filter((Q)=>Q.project_name===E).map((Q)=>Q.id),K=[];for(let Q of S)K.push(...await $.listSnapshots(Q));return K.sort((Q,T)=>new Date(T.created_at).getTime()-new Date(Q.created_at).getTime()),K[0]??null}var bA={name:"RESUME_CLOUD_AGENT",description:"Resume a frozen cloud agent from snapshot. Re-provisions, restores state, reconnects bridge.",descriptionCompressed:"Resume frozen cloud agent from snapshot.",similes:["resume agent","unfreeze agent","restart cloud agent","restore agent"],tags:["cloud","container","restore"],parameters:[{name:"name",description:"Name for the restored agent",required:!0,schema:{type:"string"}},{name:"project_name",description:"Project identifier (must match original)",required:!0,schema:{type:"string"}},{name:"snapshotId",description:"Specific snapshot ID (defaults to latest)",required:!1,schema:{type:"string"}},{name:"environment_vars",description:"Additional environment variables",required:!1,schema:{type:"object"}},{name:"confirmed",description:"Must be true to resume the cloud agent after preview.",required:!1,schema:{type:"boolean",default:!1}}],validate:async($,I,E,L)=>{let K=(typeof I?.content?.text==="string"?I.content.text:"").toLowerCase(),Q=["resume","cloud"],T=Q.length>0&&Q.some((k)=>k.length>0&&K.includes(k)),M=/\b(?:resume|cloud)\b/i,H=Boolean(K.match(M)),F=String(I?.content?.source??""),R="",D=Boolean(F||E||$?.agentId||$?.getService),q=L&&typeof L==="object"?L:{},P=K.trim().length>0||Object.keys(q).length>0||Boolean(I?.content&&typeof I.content==="object");if(!(T&&H&&D&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _($))}catch{return!1}},async handler($,I,E,L,S){let K=$.getService("CLOUD_CONTAINER"),Q=$.getService("CLOUD_BRIDGE"),T=$.getService("CLOUD_BACKUP"),M=PC(I,L);if(!M.name||!M.project_name)return{success:!1,error:"Missing required parameters: name and project_name"};let H=typeof M.snapshotId==="string"&&M.snapshotId.length>0?M.snapshotId:null,F=["Confirmation required before resuming Eliza Cloud agent:",`Name: ${String(M.name)}`,`Project: ${String(M.project_name)}`,`Snapshot: ${H??"latest available"}`].join(`
|
|
21
|
+
`);if(!YO(L))return await S?.({text:F,actions:["RESUME_CLOUD_AGENT"]}),SO(F,{name:String(M.name),project_name:String(M.project_name),snapshotId:H});let R=async(v)=>{if(S)await S({text:v,actions:["RESUME_CLOUD_AGENT"]})};await R(`Resuming cloud agent "${M.name}"...`);let D=PU.container,q={name:M.name,project_name:M.project_name,port:D.defaultPort,cpu:D.defaultCpu,memory:D.defaultMemory,architecture:D.defaultArchitecture,ecr_image_uri:D.defaultImage,environment_vars:{...oO($),...M.environment_vars},health_check_path:"/health"},P=await K.createContainer(q),_=P.data.id;await R(`Container re-provisioned (${_}). Waiting for infrastructure...`);let k=await K.waitForDeployment(_),B=null;if(T){let v=H??void 0;if(v)await T.restoreSnapshot(_,v),B=v;else{let g=await kC(T,K,M.project_name);if(g)await T.restoreSnapshot(_,g.id),B=g.id}T.scheduleAutoBackup(_)}if(Q)await Q.connect(_);return await R(`Agent "${M.name}" resumed at ${k.load_balancer_url}.`+(B?` Restored snapshot ${B}.`:" No snapshot to restore.")),{success:!0,text:`Cloud agent "${M.name}" resumed`,data:{containerId:_,containerUrl:k.load_balancer_url,restoredSnapshotId:B,creditsDeducted:P.creditsDeducted,creditsRemaining:P.creditsRemaining}}}};var oA={name:"elizacloud_status",description:"ElizaCloud container and connection status",descriptionCompressed:"ElizaCloud container/connection status.",dynamic:!0,position:90,async get($,I,E){if(!$.getService("CLOUD_AUTH")?.isAuthenticated())return{text:"ElizaCloud: Not authenticated",values:{cloudAuthenticated:!1}};let S=$.getService("CLOUD_CONTAINER"),K=$.getService("CLOUD_BRIDGE"),Q=S?.getTrackedContainers()??[],T=K?.getConnectedContainerIds()??[],M=Q.filter((D)=>D.status==="running").length,H=Q.filter((D)=>D.status==="pending"||D.status==="building"||D.status==="deploying").length,F=Q.map((D)=>({id:D.id,name:D.name,status:D.status,url:D.load_balancer_url,billing:D.billing_status,bridged:T.includes(D.id)}));return{text:[`ElizaCloud: ${Q.length} container(s), ${M} running, ${T.length} bridged`,...F.map((D)=>` - ${D.name} [${D.status}]${D.url?` @ ${D.url}`:""}${D.bridged?" (bridged)":""}`)].join(`
|
|
22
|
+
`),values:{cloudAuthenticated:!0,totalContainers:Q.length,runningContainers:M,deployingContainers:H},data:{containers:F}}}};var nA={name:"elizacloud_health",description:"ElizaCloud container health",descriptionCompressed:"ElizaCloud container health.",dynamic:!0,position:92,private:!0,async get($,I,E){if(!$.getService("CLOUD_AUTH")?.isAuthenticated())return{text:""};let K=$.getService("CLOUD_CONTAINER")?.getTrackedContainers().filter((H)=>H.status==="running")??[];if(K.length===0)return{text:"No running containers.",values:{healthyContainers:0}};let Q=K.map((H)=>({id:H.id,name:H.name,healthy:H.status==="running"&&H.billing_status==="active"&&!H.error_message,status:H.status,billing:H.billing_status})),T=Q.filter((H)=>H.healthy).length;return{text:[`Health: ${T}/${Q.length} healthy`,...Q.map((H)=>` - ${H.name}: ${H.healthy?"OK":"UNHEALTHY"} (status=${H.status}, billing=${H.billing})`)].join(`
|
|
23
|
+
`),values:{healthyContainers:T,unhealthyContainers:Q.length-T},data:{reports:Q}}}};import{logger as tA}from"@elizaos/core";var qZ="https://www.elizacloud.ai/dashboard/settings?tab=billing",sA=new WeakMap,_C=60000,mA={name:"elizacloud_credits",description:"ElizaCloud credit balance",descriptionCompressed:"ElizaCloud credit balance.",dynamic:!0,position:91,async get($,I,E){let L=$.getService("CLOUD_AUTH");if(!L?.isAuthenticated())return{text:""};let S=sA.get($);if(S&&Date.now()-S.at<_C)return PZ(S.value);let K;try{let{data:Q}=await L.getClient().get("/credits/balance");K=Q.balance}catch(Q){if(tA.warn(`[CloudCredits] Failed to fetch balance: ${Q instanceof Error?Q.message:Q}`),S)return PZ(S.value);return{text:""}}if(sA.set($,{value:K,at:Date.now()}),K<1)tA.warn(`[CloudCredits] Low balance: $${K.toFixed(2)}`);return PZ(K)}};function PZ($){let I=$<2,E=$<0.5,L=`ElizaCloud credits: $${$.toFixed(2)}`;if(E)L+=` (CRITICAL — top up at ${qZ})`;else if(I)L+=` (LOW — top up at ${qZ})`;return{text:L,values:{cloudCredits:$,cloudCreditsLow:I,cloudCreditsCritical:E,cloudTopUpUrl:qZ}}}var rA=new WeakMap,aA={name:"elizacloud_models",description:"Available AI models from ElizaCloud grouped by provider",descriptionCompressed:"Available AI models from ElizaCloud by provider.",dynamic:!0,position:92,async get($,I,E){let L=$.getService("CLOUD_MODEL_REGISTRY");if(!L)return{text:""};let S=rA.get($);if(S&&Date.now()-S.at<300000)return eA(S.value);let K=await L.getModelsByProvider();if(Object.keys(K).length===0)return{text:""};return rA.set($,{value:K,at:Date.now()}),eA(K)}};function eA($){let I=Object.keys($).sort(),E=Object.values($).reduce((L,S)=>L+S.length,0);return{text:`ElizaCloud: ${E} models (${I.join(", ")})`,values:{cloudModelProviders:I.join(","),cloudModelCount:E}}}import{logger as AO}from"@elizaos/core";import{logger as nO}from"@elizaos/core";function jC($){if(typeof process>"u")return;let I=process.env[$];return I===void 0?void 0:String(I)}function p0($,I,E){let L=$.getSetting(I);if(L!==void 0&&L!==null)return String(L);return jC(I)??E}function bU(){return typeof globalThis<"u"&&typeof globalThis.document<"u"}function iA($){return bU()&&!!p0($,"ELIZAOS_CLOUD_BROWSER_BASE_URL")}function VO($){let I=p0($,"ELIZAOS_CLOUD_BROWSER_BASE_URL");return bU()&&I?I:p0($,"ELIZAOS_CLOUD_BASE_URL","https://www.elizacloud.ai/api/v1")}function U$($){let I=bU()?p0($,"ELIZAOS_CLOUD_BROWSER_EMBEDDING_URL")||p0($,"ELIZAOS_CLOUD_BROWSER_BASE_URL"):p0($,"ELIZAOS_CLOUD_EMBEDDING_URL");if(I)return nO.debug(`[ELIZAOS_CLOUD] Using specific embedding base URL: ${I}`),I;return nO.debug("[ELIZAOS_CLOUD] Falling back to general base URL for embeddings."),VO($)}function ZO($){return p0($,"ELIZAOS_CLOUD_API_KEY")}function O$($){let I=p0($,"ELIZAOS_CLOUD_EMBEDDING_API_KEY");if(I)return nO.debug("[ELIZAOS_CLOUD] Using specific embedding API key (present)"),I;return nO.debug("[ELIZAOS_CLOUD] Falling back to general API key for embeddings."),ZO($)}function LO($){return p0($,"ELIZAOS_CLOUD_SMALL_MODEL")??p0($,"SMALL_MODEL","openai/gpt-5.4-mini")}function kZ($){return p0($,"ELIZAOS_CLOUD_NANO_MODEL")??p0($,"NANO_MODEL")??LO($)}function _Z($){return p0($,"ELIZAOS_CLOUD_MEDIUM_MODEL")??p0($,"MEDIUM_MODEL")??LO($)}function RO($){return p0($,"ELIZAOS_CLOUD_LARGE_MODEL")??p0($,"LARGE_MODEL","anthropic/claude-sonnet-4.6")}function Z$($){return p0($,"ELIZAOS_CLOUD_MEGA_MODEL")??p0($,"MEGA_MODEL")??RO($)}function A$($){return p0($,"ELIZAOS_CLOUD_RESPONSE_HANDLER_MODEL")??p0($,"ELIZAOS_CLOUD_SHOULD_RESPOND_MODEL")??p0($,"RESPONSE_HANDLER_MODEL")??p0($,"SHOULD_RESPOND_MODEL")??kZ($)}function $$($){return p0($,"ELIZAOS_CLOUD_ACTION_PLANNER_MODEL")??p0($,"ELIZAOS_CLOUD_PLANNER_MODEL")??p0($,"ACTION_PLANNER_MODEL")??p0($,"PLANNER_MODEL")??_Z($)}function I$($){return p0($,"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL","gpt-5.4-mini")}function C$($){return p0($,"ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL","google/gemini-2.5-flash-image")??"google/gemini-2.5-flash-image"}function Q$($){return p0($,"ELIZAOS_CLOUD_RESEARCH_MODEL")??p0($,"RESEARCH_MODEL","o3-deep-research")}function X$($){let I=p0($,"ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY","false");return String(I).toLowerCase()==="true"}import{CloudApiClient as vC,ElizaCloudClient as BC}from"@elizaos/cloud-sdk";function jZ($){return $.replace(/\/+$/,"")}function gC($){let I=jZ($);return I.endsWith("/api/v1")?I.slice(0,-7):I}function G$($,I=!1){if(bU())return;return I?O$($):ZO($)}function NU($,I=!1){let E=I?U$($):VO($);return new vC(jZ(E),G$($,I))}function kO($){let I=jZ(VO($));return new BC({apiBaseUrl:I,baseUrl:gC(I),apiKey:G$($)})}function E$($,I){(async()=>{try{if(!ZO(I)&&!bU()){AO.warn("ELIZAOS_CLOUD_API_KEY is not set in environment - ElizaOS Cloud functionality will be limited"),AO.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys");return}try{await NU(I).get("/models"),AO.log("ElizaOS Cloud API key validated successfully")}catch(E){let L=E instanceof Error?E.message:String(E);AO.warn(`ElizaOS Cloud API key validation failed: ${L}`),AO.warn("ElizaOS Cloud functionality will be limited until a valid API key is provided")}}catch(E){let L=E?.errors?.map((S)=>S.message).join(", ")||(E instanceof Error?E.message:String(E));AO.warn(`ElizaOS Cloud plugin configuration issue: ${L} - You need to configure the ELIZAOS_CLOUD_API_KEY in your environment variables`),AO.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys")}})()}import{logger as zU,ModelType as NC,VECTOR_DIMS as J$}from"@elizaos/core";import{EventType as xC}from"@elizaos/core";function pU($,I,E,L){let S=Number(L.inputTokens||0),K=Number(L.outputTokens||0),Q=Number(L.totalTokens!=null?L.totalTokens:S+K),T={runtime:$,source:"elizacloud",type:I,tokens:{prompt:S,completion:K,total:Q}};$.emitEvent(xC.MODEL_USED,T)}var tO=100;function fC($){return{remainingRequests:parseInt($.headers.get("x-ratelimit-remaining-requests")||"",10)||void 0,remainingTokens:parseInt($.headers.get("x-ratelimit-remaining-tokens")||"",10)||void 0,limitRequests:parseInt($.headers.get("x-ratelimit-limit-requests")||"",10)||void 0,limitTokens:parseInt($.headers.get("x-ratelimit-limit-tokens")||"",10)||void 0,resetRequests:$.headers.get("x-ratelimit-reset-requests")||void 0,resetTokens:$.headers.get("x-ratelimit-reset-tokens")||void 0,retryAfter:parseInt($.headers.get("retry-after")||"",10)||void 0}}function Y$($){let I=p0($,"ELIZAOS_CLOUD_EMBEDDING_MODEL","text-embedding-3-small"),E=Number.parseInt(p0($,"ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS","1536")||"1536",10);if(!Object.values(J$).includes(E)){let L=`Invalid embedding dimension: ${E}. Must be one of: ${Object.values(J$).join(", ")}`;throw zU.error(L),Error(L)}return{embeddingModelName:I,embeddingDimension:E}}function rU($,I){let E=Array($).fill(0);return E[0]=I,E}async function vZ($,I){let{embeddingDimension:E}=Y$($);if(I===null)return zU.debug("Creating test embedding for initialization"),rU(E,0.1);let L;if(typeof I==="string")L=I;else if(typeof I==="object"&&I.text)L=I.text;else return zU.warn("Invalid input format for embedding"),rU(E,0.2);if(!L.trim())return zU.warn("Empty text for embedding"),rU(E,0.3);return(await S$($,[L]))[0]}async function S$($,I){let{embeddingModelName:E,embeddingDimension:L}=Y$($),S=NU($,!0);if(!I||I.length===0)return zU.warn("[BatchEmbeddings] Empty texts array"),[];let K=[],Q=Array(I.length);for(let T=0;T<I.length;T++){let M=I[T]?.trim();if(M)K.push({text:M,originalIndex:T});else Q[T]=rU(L,0.3)}if(K.length===0)return zU.warn("[BatchEmbeddings] All texts were empty"),Q;for(let T=0;T<K.length;T+=tO){let M=Math.min(T+tO,K.length),H=K.slice(T,M),F=H.map((R)=>R.text);zU.info(`[BatchEmbeddings] Processing batch ${Math.floor(T/tO)+1}/${Math.ceil(K.length/tO)}: ${H.length} texts`);try{let R=await S.requestRaw("POST","/embeddings",{json:{model:E,input:F}}),D=fC(R);if(D.remainingRequests!==void 0&&D.remainingRequests<50)zU.warn(`[BatchEmbeddings] Rate limit: ${D.remainingRequests}/${D.limitRequests} requests remaining`);if(R.status===429){let P=D.retryAfter||30;zU.warn(`[BatchEmbeddings] Rate limited, waiting ${P}s...`),await new Promise((B)=>setTimeout(B,P*1000));let _=await S.requestRaw("POST","/embeddings",{json:{model:E,input:F}});if(!_.ok){zU.error(`[BatchEmbeddings] Retry failed: ${_.status}`);for(let B of H)Q[B.originalIndex]=rU(L,0.4);continue}let k=await _.json();if(k?.data){for(let B of k.data){let v=H[B.index].originalIndex;Q[v]=B.embedding}zU.info(`[BatchEmbeddings] Retry successful for ${H.length} embeddings`)}continue}if(!R.ok){zU.error(`[BatchEmbeddings] API error: ${R.status} - ${R.statusText}`);for(let P of H)Q[P.originalIndex]=rU(L,0.4);continue}let q=await R.json();if(!q?.data||!Array.isArray(q.data)){zU.error("[BatchEmbeddings] API returned invalid structure");for(let P of H)Q[P.originalIndex]=rU(L,0.5);continue}for(let P of q.data){let _=H[P.index].originalIndex;Q[_]=P.embedding}if(q.usage){let P={inputTokens:q.usage.prompt_tokens,outputTokens:0,totalTokens:q.usage.total_tokens};pU($,NC.TEXT_EMBEDDING,`batch:${H.length}`,P)}zU.debug(`[BatchEmbeddings] Got ${H.length} embeddings (${L}d), remaining: ${D.remainingRequests??"unknown"}`)}catch(R){let D=R instanceof Error?R.message:String(R);zU.error(`[BatchEmbeddings] Error: ${D}`);for(let q of H)Q[q.originalIndex]=rU(L,0.6)}}return Q}import{logger as fO,ModelType as pQ}from"@elizaos/core";import{logger as $I}from"@elizaos/core";import{JSONParseError as cQ}from"ai";function II(){return async({text:$,error:I})=>{try{if(I instanceof cQ){let E=$.replace(/```json\n|\n```|```/g,"");return JSON.parse(E),E}return null}catch(E){let L=E instanceof Error?E.message:String(E);return $I.warn(`Failed to repair JSON text: ${L}`),null}}}async function CI($){try{let{Readable:I}=await Promise.resolve().then(() => DC(UZ(),1)),E=$.getReader();return new I({async read(){try{let{done:L,value:S}=await E.read();if(L)this.push(null);else this.push(S)}catch(L){this.destroy(L)}},destroy(L,S){E.cancel().finally(()=>S(L))}})}catch(I){let E=I instanceof Error?I.message:String(I);throw $I.error(`Failed to load node:stream module: ${E}`),Error("Cannot convert stream: node:stream module unavailable. This feature requires a Node.js environment.")}}function QI($){let E=$.match(/title[:\s]+(.+?)(?:\n|$)/i)?.[1]?.trim()||"Image Analysis",L=$.replace(/title[:\s]+(.+?)(?:\n|$)/i,"").trim();return{title:E,description:L}}async function nZ($,I){let E=I.count||1,L=I.size||"1024x1024",S=I.prompt,K=C$($);fO.log(`[ELIZAOS_CLOUD] Using IMAGE model: ${K}`);let T={"1024x1024":"1:1","1792x1024":"16:9","1024x1792":"9:16"}[L]||"1:1";try{let M={prompt:S,numImages:E,aspectRatio:T,model:K};return(await kO($).generateImage(M)).images.map((R)=>({url:R.url||R.image}))}catch(M){let H=M instanceof Error?M.message:String(M);throw fO.error(`[ELIZAOS_CLOUD] Image generation error: ${H}`),M}}async function tZ($,I){let E,L,S=I$($);fO.log(`[ELIZAOS_CLOUD] Using IMAGE_DESCRIPTION model: ${S}`);let K=Number.parseInt(p0($,"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS","8192")||"8192",10);if(typeof I==="string")E=I,L="Please analyze this image and provide a title and detailed description.";else E=I.imageUrl,L=I.prompt||"Please analyze this image and provide a title and detailed description.";let Q=[{role:"user",content:[{type:"text",text:L},{type:"image_url",image_url:{url:E}}]}],T=kO($);try{let M={model:S,messages:Q,max_tokens:K},H=null;for(let D=0;D<3;D++){if(H=await T.routes.postApiV1ChatCompletionsRaw({json:M}),H.status===429&&D<2){let q=(D+1)*2000;fO.warn(`[ELIZAOS_CLOUD] Image analysis rate-limited (429), retrying in ${q/1000}s...`),await new Promise((P)=>setTimeout(P,q));continue}break}if(!H?.ok){let D=H?.status??0;if(D===402)throw Error("Eliza Cloud credits exhausted — top up at https://www.elizacloud.ai/dashboard/settings?tab=billing");throw Error(`ElizaOS Cloud API error: ${D}`)}let F=await H.json(),R=F.choices?.[0]?.message?.content;if(F.usage)pU($,pQ.IMAGE_DESCRIPTION,typeof I==="string"?I:I.prompt||"",{inputTokens:F.usage.prompt_tokens,outputTokens:F.usage.completion_tokens,totalTokens:F.usage.total_tokens});if(!R)return{title:"Failed to analyze image",description:"No response from API"};return QI(R)}catch(M){let H=M instanceof Error?M.message:String(M);return fO.error(`Error analyzing image: ${H}`),{title:"Failed to analyze image",description:`Error: ${H}`}}}import{logger as wO,ModelType as XI}from"@elizaos/core";function WO($){if(!$||typeof $!=="object"||Array.isArray($))return null;return $}function sZ($){if(Array.isArray($))return $;if(typeof $==="string")return[{type:"text",text:$}];return $&&typeof $==="object"?[$]:[]}function mZ($){if(typeof $==="string")return[$];let I=WO($);if(!I)return[];let E=typeof I.text==="string"?I.text:typeof I.output_text==="string"?I.output_text:typeof I.content==="string"?I.content:"",L=typeof I.type==="string"?I.type:void 0;if(E&&(!L||L==="output_text"||L==="text"))return[E];return[]}function hQ($){let I=WO($);if(!I)return[];let E=sZ(I.content);if(E.length>0)return E.flatMap(mZ);let L=WO(I.message);if(L)return sZ(L.content).flatMap(mZ);let S=typeof I.type==="string"?I.type:void 0,K=typeof I.text==="string"?I.text:typeof I.output_text==="string"?I.output_text:"";if(K&&(S==="output_text"||S==="text"))return[K];return[]}function uQ($){let I=WO($);if(!I)return[];if(typeof I.text==="string"&&I.text)return[I.text];let E=WO(I.message);if(!E)return[];return sZ(E.content).flatMap(mZ)}function OZ($){let I=WO($);if(!I)return"";let E=[];if(typeof I.output_text==="string"&&I.output_text)E.push(I.output_text);if(Array.isArray(I.output))E.push(...I.output.flatMap(hQ));if(Array.isArray(I.choices))E.push(...I.choices.flatMap(uQ));return E.join("")}var lQ=["o1","o3","o4","deepseek-r1","deepseek-reasoner","claude-opus-4.7","claude-opus-4-7","gpt-5"];function dQ($){let I=$.toLowerCase();return lQ.some((E)=>I.includes(E))}async function GI($,I,E,L){let S=L($);wO.log(`[ELIZAOS_CLOUD] Using ${E} model: ${S}`);let K=dQ(S),Q=[];if($.character.system)Q.push({role:"system",content:[{type:"input_text",text:$.character.system}]});Q.push({role:"user",content:[{type:"input_text",text:I.prompt}]});let T={model:S,input:Q,max_output_tokens:I.maxTokens??8192,text:{format:{type:"json_object"}}};if(!K&&typeof I.temperature==="number")T.temperature=I.temperature;let M=await NU($).requestRaw("POST","/responses",{json:T}),H=await M.text(),F={};if(H)try{F=JSON.parse(H)}catch(D){wO.error(`[generateObject] Failed to parse Eliza Cloud JSON: ${D instanceof Error?D.message:String(D)}`)}if(!M.ok){let D=typeof F==="object"&&F?F.error:void 0,q=typeof D?.message==="string"&&D.message.trim()?D.message.trim():`elizaOS Cloud error ${M.status}`,P=Error(q);if(P.status=M.status,D)P.error=D;throw P}if(F.usage)pU($,E,I.prompt,{inputTokens:F.usage.input_tokens??0,outputTokens:F.usage.output_tokens??0,totalTokens:F.usage.total_tokens??0});let R=OZ(F);if(!R.trim())throw Error("Object generation returned empty response");R=R.replace(/^[\s]*```(?:json)?\s*\n?/i,"").replace(/\n?```\s*$/i,"").trim();try{return JSON.parse(R)}catch(D){let P=await II()({text:R,error:D});if(P)try{let k=JSON.parse(P);return wO.info("[generateObject] Successfully repaired JSON."),k}catch(k){let B=k instanceof Error?k.message:String(k);throw wO.error(`[generateObject] Failed to parse repaired JSON: ${B}`),k}let _=D instanceof Error?D.message:String(D);throw wO.error(`[generateObject] Failed to parse JSON: ${_}`),D}}async function rZ($,I){return GI($,I,XI.OBJECT_SMALL,LO)}async function eZ($,I){return GI($,I,XI.OBJECT_LARGE,RO)}import{logger as bQ,ModelType as oQ}from"@elizaos/core";function nQ($){if(typeof $!=="string")return $;return[{role:"user",content:[{type:"input_text",text:$}]}]}function tQ($,I){try{let E=JSON.parse(I),L=E.error?.message;if(E.error?.param==="tools.0.type"&&L?.includes('expected "function"'))return Error(`Research API error: ${$} Eliza Cloud /responses rejected deep-research tool types; the provider currently only accepts function tools on this route`)}catch{}return Error(`Research API error: ${$} ${I}`)}function sQ($){return $.filter((I)=>I.url!==void 0).map((I)=>({url:I.url,title:I.title??"",startIndex:I.start_index??0,endIndex:I.end_index??0}))}function mQ($){let I=[];for(let E of $)switch(E.type){case"web_search_call":I.push({id:E.id??"",type:"web_search_call",status:E.status??"completed",action:{type:E.action?.type??"search",query:E.action?.query,url:E.action?.url}});break;case"file_search_call":I.push({id:E.id??"",type:"file_search_call",status:E.status??"completed",query:E.query??"",results:E.results?.map((L)=>({fileId:L.file_id,fileName:L.file_name,score:L.score}))});break;case"code_interpreter_call":I.push({id:E.id??"",type:"code_interpreter_call",status:E.status??"completed",code:E.code??"",output:E.output});break;case"mcp_tool_call":I.push({id:E.id??"",type:"mcp_tool_call",status:E.status??"completed",serverLabel:E.server_label??"",toolName:E.tool_name??"",arguments:E.arguments??{},result:E.result});break;case"message":{let L=E.content??[];I.push({type:"message",content:L.filter((S)=>S.type==="output_text").map((S)=>({type:"output_text",text:S.text??"",annotations:sQ(S.annotations??[])}))});break}}return I}async function aZ($,I){let E=I.model??Q$($);bQ.log(`[ELIZAOS_CLOUD] Using RESEARCH model: ${E}`);let L=I.tools??[{type:"web_search_preview"}],S={model:E,input:nQ(I.input),tools:L};if(I.instructions)S.instructions=I.instructions;if(I.background!==void 0)S.background=I.background;if(I.maxToolCalls!==void 0)S.max_tool_calls=I.maxToolCalls;if(I.reasoningSummary)S.reasoning={summary:I.reasoningSummary};let K=await NU($).requestRaw("POST","/responses",{json:S});if(!K.ok){let F=await K.text();throw tQ(K.status,F)}let Q=await K.json();if(Q.usage)pU($,oQ.RESEARCH,I.input,{inputTokens:Q.usage.input_tokens,outputTokens:Q.usage.output_tokens,totalTokens:Q.usage.total_tokens});let T=mQ(Q.output),M="",H=[];for(let F of T)if(F.type==="message"){for(let R of F.content)if(R.type==="output_text")M+=R.text,H.push(...R.annotations)}return{id:Q.id,text:M,annotations:H,outputItems:T,status:Q.status}}import{logger as aY}from"@elizaos/core";async function iZ($,I){let E=p0($,"ELIZAOS_CLOUD_TTS_MODEL","gpt-5-mini-tts"),L=p0($,"ELIZAOS_CLOUD_TTS_VOICE","nova"),S=I.model||E,K=I.voice||L,Q=I.format||"mp3",T=S.startsWith("elevenlabs/")?S.split("/").slice(1).join("/"):S.startsWith("eleven_")?S:void 0,M=K&&K!=="nova"?K:void 0;try{let H=await kO($).routes.postApiV1VoiceTts({headers:{...Q==="mp3"?{Accept:"audio/mpeg"}:{}},json:{text:I.text,...M?{voiceId:M}:{},...T?{modelId:T}:{}}});if(!H.ok){let F=await H.text();throw Error(`ElizaOS Cloud TTS error ${H.status}: ${F}`)}if(!H.body)throw Error("ElizaOS Cloud TTS response body is null");if(!bU())return await CI(H.body);return H.body}catch(H){let F=H instanceof Error?H.message:String(H);throw Error(`Failed to fetch speech from ElizaOS Cloud TTS: ${F}`)}}import{logger as yO,ModelType as GO}from"@elizaos/core";import{createOpenAI as rQ}from"@ai-sdk/openai";function EI($){let I=VO($),E=ZO($)??(iA($)?"eliza-proxy":void 0);return rQ({apiKey:E??"",baseURL:I})}var JI=GO.TEXT_NANO??"TEXT_NANO",YI=GO.TEXT_MEDIUM??"TEXT_MEDIUM",SI=GO.TEXT_SMALL,VI=GO.TEXT_LARGE,LI=GO.TEXT_MEGA??"TEXT_MEGA",UA=GO.RESPONSE_HANDLER??"RESPONSE_HANDLER",OA=GO.ACTION_PLANNER??"ACTION_PLANNER",eQ=["o1","o3","o4","deepseek-r1","deepseek-reasoner","claude-opus-4.7","claude-opus-4-7","gpt-5"],aQ=["openai/","anthropic/"];function iQ($){let I=[{type:"text",text:$.prompt}];for(let E of $.attachments??[])I.push({type:"file",data:E.data,mediaType:E.mediaType,...E.filename?{filename:E.filename}:{}});return I}function RI($){let I=$.toLowerCase();return eQ.some((E)=>I.includes(E))}function UX($){let I=$.toLowerCase();return!aQ.some((E)=>I.startsWith(E))}function OX($){switch($){case UA:return"should_respond";case OA:return"action_planner";default:return"response"}}function ZX($,I){switch(I){case JI:return kZ($);case YI:return _Z($);case SI:return LO($);case VI:return RO($);case LI:return Z$($);case UA:return A$($);case OA:return $$($);default:return RO($)}}function AX($,I,E){let L=E,{prompt:S}=E,K=E.maxTokens??8192,Q=EI($),T=ZX($,I),M=X$($),H=(L.attachments?.length??0)>0?iQ(L):void 0,F=Q.chat(T),D=!RI(T)&&UX(T)&&Array.isArray(E.stopSequences)&&E.stopSequences.length>0?E.stopSequences:void 0;return{generateParams:{model:F,...H?{messages:[{role:"user",content:H}]}:{prompt:S},system:$.character.system??void 0,...D?{stopSequences:D}:{},maxOutputTokens:K,experimental_telemetry:{isEnabled:M}},modelName:T,modelType:I,prompt:S}}async function EO($,I,E){let{modelName:L,prompt:S}=AX($,I,E);if(yO.debug(`[ELIZAOS_CLOUD] Generating text with ${I} model: ${L}`),E.stream)yO.debug("[ELIZAOS_CLOUD] Streaming text disabled for responses compatibility; falling back to buffered response.");yO.log(`[ELIZAOS_CLOUD] Using ${I} model: ${L}`),yO.log(S);let K=RI(L),Q=[];if($.character.system)Q.push({role:"system",content:[{type:"input_text",text:$.character.system}]});Q.push({role:"user",content:[{type:"input_text",text:S}]});let T={model:L,input:Q,max_output_tokens:E.maxTokens??8192};if(!K&&typeof E.temperature==="number")T.temperature=E.temperature;let M=await NU($).requestRaw("POST","/responses",{headers:{"X-Eliza-Llm-Purpose":OX(I),"X-Eliza-Model-Type":I},json:T}),H=await M.text(),F={};if(H)try{F=JSON.parse(H)}catch(D){yO.error(`[ELIZAOS_CLOUD] Failed to parse responses JSON: ${D instanceof Error?D.message:String(D)}`)}if(!M.ok){let D=typeof F==="object"&&F?F.error:void 0,q=typeof D?.message==="string"&&D.message.trim()?D.message.trim():`elizaOS Cloud error ${M.status}`,P=Error(q);if(P.status=M.status,D)P.error=D;throw P}if(F.usage)pU($,I,S,{inputTokens:F.usage.input_tokens??0,outputTokens:F.usage.output_tokens??0,totalTokens:F.usage.total_tokens??0});let R=OZ(F);if(!R.trim())throw Error("elizaOS Cloud returned no text response");return R}async function ZA($,I){return EO($,SI,I)}async function AA($,I){return EO($,JI,I)}async function $A($,I){return EO($,YI,I)}async function IA($,I){return EO($,VI,I)}async function CA($,I){return EO($,LI,I)}async function QA($,I){return EO($,UA,I)}async function XA($,I){return EO($,OA,I)}import{logger as mU,Service as EJ}from"@elizaos/core";import{resolveApiSecurityConfig as xS,resolveDesktopApiPort as NS}from"@elizaos/shared";import{createRemoteJWKSet as wS,jwtVerify as yS}from"jose";import{CloudApiClient as GA,CloudApiError as _S,ElizaCloudHttpClient as jS,InsufficientCreditsError as vS}from"@elizaos/cloud-sdk";async function JJ(){let $=await Promise.resolve().then(() => (JA(),EA)),I=await Promise.resolve().then(() => (vU(),jU)),E=$.cpus(),L=[$.hostname(),$.platform(),$.arch(),E[0]?.model??"?",E.length,$.totalmem()].join(":");return I.createHash("sha256").update(L).digest("hex")}function YJ(){if(typeof process>"u")return"web";return{darwin:"macos",win32:"windows",linux:"linux"}[process.platform]??"linux"}class YZ extends EJ{static serviceType="CLOUD_AUTH";capabilityDescription="Eliza Cloud device authentication and SSO session helpers";client;credentials=null;constructor($){super($);this.client=new GA(PU.baseUrl)}static async start($){let I=new YZ($);return await I.initialize(),I}async stop(){this.credentials=null}async initialize(){let $=String(this.runtime.getSetting("ELIZAOS_CLOUD_BASE_URL")??PU.baseUrl);this.client.setBaseUrl($);let I=this.runtime.getSetting("ELIZAOS_CLOUD_API_KEY");if(I){let L=String(I);this.client.setApiKey(L),this.credentials={apiKey:L,userId:String(this.runtime.getSetting("ELIZAOS_CLOUD_USER_ID")??""),organizationId:String(this.runtime.getSetting("ELIZAOS_CLOUD_ORG_ID")??this.runtime.getSetting("ELIZA_CLOUD_ORGANIZATION_ID")??""),authenticatedAt:Date.now()},mU.info("[CloudAuth] Authenticated with saved API key"),this.validateApiKey(L).then((S)=>{if(!S)mU.warn("[CloudAuth] Saved API key could not be validated (cloud may be unreachable or key revoked) — model calls will use the key anyway")}).catch(()=>{});return}let E=this.runtime.getSetting("ELIZAOS_CLOUD_ENABLED");if(E==="true"||E==="1")try{await this.authenticateWithDevice()}catch(L){let S=L instanceof Error?L.message:String(L);mU.warn(`[CloudAuth] Device auth failed (cloud may be unreachable): ${S}`),mU.info("[CloudAuth] Service will start unauthenticated — cloud features disabled until connectivity is restored")}else mU.info("[CloudAuth] Cloud not enabled (set ELIZAOS_CLOUD_ENABLED=true)")}async validateApiKey($){try{return await new GA(this.client.getBaseUrl(),$).get("/models",{timeoutMs:1e4}),!0}catch(I){let E=I instanceof Error?I.message:String(I);return mU.warn(`[CloudAuth] Could not reach cloud API to validate key: ${E}`),!1}}async authenticateWithDevice(){let $=await JJ(),I=YJ(),E=process.env.ELIZAOS_CLOUD_APP_VERSION??"2.0.0-alpha",L=await Promise.resolve().then(() => (JA(),EA));mU.info(`[CloudAuth] Authenticating device (platform=${I})`);let S=await this.client.postUnauthenticated("/device-auth",{deviceId:$,platform:I,appVersion:E,deviceName:L.hostname()});this.credentials={apiKey:S.data.apiKey,userId:S.data.userId,organizationId:S.data.organizationId,authenticatedAt:Date.now()},this.client.setApiKey(S.data.apiKey);let K=S.data.isNew?"New account created":"Authenticated";return mU.info(`[CloudAuth] ${K} (credits: $${S.data.credits.toFixed(2)})`),this.credentials}authenticateWithApiKey($){let I=$.apiKey.trim();if(!I)throw Error("Eliza Cloud API key is required");return this.client.setApiKey(I),this.credentials={apiKey:I,userId:$.userId??"",organizationId:$.organizationId??"",authenticatedAt:Date.now()},mU.info("[CloudAuth] Authenticated with API key"),this.credentials}clearAuth(){this.credentials=null,this.client.setApiKey(void 0)}isAuthenticated(){return this.credentials!==null}getCredentials(){return this.credentials}getApiKey(){return this.credentials?.apiKey??this.client.getApiKey()}getClient(){return this.client}getUserId(){return this.credentials?.userId}getOrganizationId(){return this.credentials?.organizationId}}import{logger as xU,Service as SJ}from"@elizaos/core";class SZ extends SJ{static serviceType="CLOUD_BACKUP";capabilityDescription="ElizaCloud agent state backup and restore";authService;autoBackups=new Map;maxSnapshots=PU.backup.maxSnapshots;backupIntervalMs=PU.backup.autoBackupIntervalMs;static async start($){let I=new SZ($);return await I.initialize(),I}async stop(){for(let[,$]of this.autoBackups)clearInterval($.timer);this.autoBackups.clear(),xU.info("[CloudBackup] Service stopped")}async initialize(){let $=this.runtime.getService("CLOUD_AUTH");if(!$){xU.debug("[CloudBackup] CloudAuthService not available");return}this.authService=$,xU.info("[CloudBackup] Service initialized")}async createSnapshot($,I="manual",E){let S=await this.authService.getClient().post(`/agent-state/${$}/snapshot`,{snapshotType:I,metadata:E});xU.info(`[CloudBackup] Created ${I} snapshot for container ${$} (id=${S.data.id}, size=${VJ(S.data.sizeBytes)})`);let K=this.autoBackups.get($);if(K)K.lastBackupAt=Date.now();return S.data}async listSnapshots($){return(await this.authService.getClient().get(`/agent-state/${$}/snapshots`)).data}async restoreSnapshot($,I){await this.authService.getClient().post(`/agent-state/${$}/restore`,{snapshotId:I}),xU.info(`[CloudBackup] Restored snapshot ${I} for container ${$}`)}async getLatestSnapshot($){let I=await this.listSnapshots($);if(I.length===0)return null;return I.sort((E,L)=>new Date(L.created_at).getTime()-new Date(E.created_at).getTime()),I[0]}scheduleAutoBackup($,I){if(this.autoBackups.has($)){xU.debug(`[CloudBackup] Auto-backup already scheduled for ${$}`);return}let E=I??this.backupIntervalMs,L=setInterval(()=>{xU.debug(`[CloudBackup] Running auto-backup for container ${$}`),this.createSnapshot($,"auto",{trigger:"scheduled",scheduledIntervalMs:E}).then(()=>this.pruneSnapshots($)).catch((S)=>{xU.error(`[CloudBackup] Auto-backup failed for ${$}: ${S.message}`)})},E);this.autoBackups.set($,{containerId:$,timer:L,lastBackupAt:null}),xU.info(`[CloudBackup] Scheduled auto-backup for ${$} every ${Math.round(E/60000)} minutes`)}cancelAutoBackup($){let I=this.autoBackups.get($);if(!I)return;clearInterval(I.timer),this.autoBackups.delete($),xU.info(`[CloudBackup] Cancelled auto-backup for ${$}`)}async createPreEvictionSnapshot($){return xU.info(`[CloudBackup] Creating pre-eviction snapshot for ${$}`),this.createSnapshot($,"pre-eviction",{trigger:"billing-eviction",createdAt:new Date().toISOString()})}async pruneSnapshots($){let L=(await this.listSnapshots($)).filter((K)=>K.snapshotType==="auto").sort((K,Q)=>new Date(Q.created_at).getTime()-new Date(K.created_at).getTime()).slice(this.maxSnapshots);if(L.length===0)return;let S=this.authService.getClient();for(let K of L)await S.delete(`/agent-state/${$}/snapshots/${K.id}`),xU.debug(`[CloudBackup] Pruned old auto snapshot ${K.id} for ${$}`);xU.info(`[CloudBackup] Pruned ${L.length} old auto snapshot(s) for ${$}`)}isAutoBackupScheduled($){return this.autoBackups.has($)}getLastBackupTime($){return this.autoBackups.get($)?.lastBackupAt??null}}function VJ($){if($<1024)return`${$} B`;if($<1048576)return`${($/1024).toFixed(1)} KB`;if($<1073741824)return`${($/1048576).toFixed(1)} MB`;return`${($/1073741824).toFixed(1)} GB`}import{logger as IC,Service as LJ}from"@elizaos/core";function RJ(){if(typeof process>"u")return{};return process.env}function VZ($,I){if($&&typeof $.getSetting==="function"){let L=$.getSetting(I);if(typeof L==="string"&&L.length>0)return L}let E=RJ()[I];if(typeof E==="string"&&E.length>0)return E;return null}function DJ($){let I=$.length;while(I>0&&$.charCodeAt(I-1)===47)I-=1;return I===$.length?$:$.slice(0,I)}class LZ extends LJ{static serviceType="CLOUD_BOOTSTRAP";capabilityDescription="Exposes Eliza Cloud bootstrap-token trust anchor (issuer, JWKS URL, revocation list URL, expected container id) to app-core";static async start($){let I=new LZ($),E=VZ($,"ELIZA_CLOUD_ISSUER"),L=VZ($,"ELIZA_CLOUD_CONTAINER_ID");if(E)IC.info(`[CloudBootstrap] Trust anchor configured (issuer=${E}, containerId=${L??"<unset>"})`);else IC.debug("[CloudBootstrap] ELIZA_CLOUD_ISSUER unset — bootstrap-token verification will reject until configured");return I}async stop(){}getExpectedIssuer(){let $=VZ(this.runtime,"ELIZA_CLOUD_ISSUER");if(!$)throw Error("ELIZA_CLOUD_ISSUER is not configured — bootstrap-token verification cannot proceed");return DJ($)}getJwksUrl(){return`${this.getExpectedIssuer()}/.well-known/jwks.json`}getRevocationListUrl(){return`${this.getExpectedIssuer()}/.well-known/revocations.json`}getExpectedContainerId(){return VZ(this.runtime,"ELIZA_CLOUD_CONTAINER_ID")}}import{logger as yU,Service as KJ}from"@elizaos/core";import{WebSocket as BA}from"undici";class RZ extends KJ{static serviceType="CLOUD_BRIDGE";capabilityDescription="WebSocket bridge to cloud-hosted ElizaOS agents";authService;bridgeConfig=PU.bridge;connections=new Map;static async start($){let I=new RZ($);return await I.initialize(),I}async stop(){for(let[$]of this.connections)await this.disconnect($);yU.info("[CloudBridge] Service stopped")}async initialize(){let $=this.runtime.getService("CLOUD_AUTH");if(!$){yU.debug("[CloudBridge] CloudAuthService not available");return}this.authService=$,yU.info("[CloudBridge] Service initialized")}async connect($){let I=this.connections.get($);if(I){if(I.state==="connected"||I.state==="connecting"){yU.debug(`[CloudBridge] Already connected/connecting to ${$}`);return}}await this.establishConnection($,0)}async disconnect($){let I=this.connections.get($);if(!I)return;if(I.heartbeatTimer)clearInterval(I.heartbeatTimer);if(I.reconnectTimer)clearTimeout(I.reconnectTimer);for(let[,E]of I.pendingRequests)clearTimeout(E.timeout),E.reject(Error("Bridge disconnected"));if(I.pendingRequests.clear(),I.ws.readyState===BA.OPEN||I.ws.readyState===BA.CONNECTING)I.ws.close(1000,"Client disconnect");this.connections.delete($),yU.info(`[CloudBridge] Disconnected from ${$}`)}async establishConnection($,I){let E=this.authService.getClient(),L=this.authService.getApiKey(),S=E.buildWsUrl(`/agent-bridge/${$}`),K=L?`${S}?token=${encodeURIComponent(L)}`:S,Q={ws:new BA(K),state:"connecting",connectedAt:null,lastHeartbeat:null,reconnectAttempts:I,heartbeatTimer:null,reconnectTimer:null,handlers:this.connections.get($)?.handlers??new Set,pendingRequests:new Map,nextRequestId:1};this.connections.set($,Q),Q.ws.addEventListener("open",()=>{Q.state="connected",Q.connectedAt=Date.now(),Q.reconnectAttempts=0,yU.info(`[CloudBridge] Connected to agent ${$}`),Q.heartbeatTimer=setInterval(()=>{this.sendHeartbeat($)},this.bridgeConfig.heartbeatIntervalMs)}),Q.ws.addEventListener("message",(T)=>{let M=T.data,H=typeof M==="string"?M:M instanceof Buffer?M.toString("utf-8"):String(M),F=JSON.parse(H);if(F.method==="heartbeat.ack"){Q.lastHeartbeat=Date.now();return}if(F.id!==void 0&&!F.method){let R=Q.pendingRequests.get(F.id);if(R){if(clearTimeout(R.timeout),Q.pendingRequests.delete(F.id),F.error)R.reject(Error(F.error.message));else R.resolve(F.result);return}}for(let R of Q.handlers)R(F)}),Q.ws.addEventListener("close",(T)=>{if(Q.state="disconnected",Q.heartbeatTimer)clearInterval(Q.heartbeatTimer);if(T.code===1000){yU.info(`[CloudBridge] Clean disconnect from ${$}`);return}yU.warn(`[CloudBridge] Connection lost to ${$} (code=${T.code}, reason=${T.reason})`),this.scheduleReconnect($,Q.reconnectAttempts+1)}),Q.ws.addEventListener("error",()=>{yU.error(`[CloudBridge] WebSocket error for ${$}`)})}scheduleReconnect($,I){if(I>this.bridgeConfig.maxReconnectAttempts){yU.error(`[CloudBridge] Max reconnect attempts (${this.bridgeConfig.maxReconnectAttempts}) reached for ${$}`),this.connections.delete($);return}let E=this.bridgeConfig.reconnectIntervalMs,L=Math.min(E*2**Math.min(I,5),120000),S=Math.floor(Math.random()*1000);yU.info(`[CloudBridge] Reconnecting to ${$} in ${Math.round((L+S)/1000)}s (attempt ${I})`);let K=this.connections.get($);if(K)K.state="reconnecting",K.reconnectTimer=setTimeout(()=>{this.establishConnection($,I)},L+S)}sendHeartbeat($){let I=this.connections.get($);if(!I||I.state!=="connected")return;let E={jsonrpc:"2.0",method:"heartbeat",params:{timestamp:Date.now()}};I.ws.send(JSON.stringify(E))}async sendRequest($,I,E,L=60000){let S=this.connections.get($);if(!S||S.state!=="connected")throw Error(`Not connected to container ${$}`);let K=S.nextRequestId++,Q={jsonrpc:"2.0",id:K,method:I,params:E};return new Promise((T,M)=>{let H=setTimeout(()=>{S.pendingRequests.delete(K),M(Error(`Request ${I} timed out after ${L}ms`))},L);S.pendingRequests.set(K,{resolve:T,reject:M,timeout:H}),S.ws.send(JSON.stringify(Q))})}sendNotification($,I,E){let L=this.connections.get($);if(!L||L.state!=="connected")throw Error(`Not connected to container ${$}`);let S={jsonrpc:"2.0",method:I,params:E};L.ws.send(JSON.stringify(S))}async sendChatMessage($,I,E,L){return await this.sendRequest($,"message.send",{text:I,roomId:E,metadata:L})}async getAgentStatus($){return await this.sendRequest($,"status.get",{})}async updateAgentConfig($,I){await this.sendRequest($,"config.update",I)}onMessage($,I){let E=this.connections.get($);if(!E)E={ws:null,state:"disconnected",connectedAt:null,lastHeartbeat:null,reconnectAttempts:0,heartbeatTimer:null,reconnectTimer:null,handlers:new Set,pendingRequests:new Map,nextRequestId:1},this.connections.set($,E);return E.handlers.add(I),()=>{E.handlers.delete(I)}}getConnectionState($){return this.connections.get($)?.state??"disconnected"}getConnectionInfo($){let I=this.connections.get($);if(!I)return null;return{containerId:$,state:I.state,connectedAt:I.connectedAt,lastHeartbeat:I.lastHeartbeat,reconnectAttempts:I.reconnectAttempts}}getConnectedContainerIds(){let $=[];for(let[I,E]of this.connections)if(E.state==="connected")$.push(I);return $}}import{logger as cU,Service as HJ}from"@elizaos/core";class DZ extends HJ{static serviceType="CLOUD_CONTAINER";capabilityDescription="ElizaCloud container provisioning and lifecycle management";authService;containerDefaults=PU.container;tracked=new Map;static async start($){let I=new DZ($);return await I.initialize(),I}async stop(){for(let[,$]of this.tracked){if($.pollingTimer)clearTimeout($.pollingTimer);if($.healthTimer)clearInterval($.healthTimer)}this.tracked.clear()}async initialize(){let $=this.runtime.getService("CLOUD_AUTH");if(!$){cU.debug("[CloudContainer] CloudAuthService not available, container operations will fail");return}if(this.authService=$,this.authService.isAuthenticated()){let I=await this.listContainers();for(let E of I){if(this.tracked.set(E.id,{container:E,pollingTimer:null,healthTimer:null}),E.status==="pending"||E.status==="building"||E.status==="deploying")this.startPolling(E.id);if(E.status==="running")this.startHealthMonitoring(E.id)}cU.info(`[CloudContainer] Loaded ${I.length} existing container(s)`)}}getClient(){return this.authService.getClient()}async createContainer($){let I=this.getClient(),E=this.containerDefaults,L={name:$.name,project_name:$.project_name,description:$.description,port:$.port??E.defaultPort,desired_count:$.desired_count??1,cpu:$.cpu??E.defaultCpu,memory:$.memory??E.defaultMemory,environment_vars:$.environment_vars??{},health_check_path:$.health_check_path??"/health",ecr_image_uri:$.ecr_image_uri,ecr_repository_uri:$.ecr_repository_uri,image_tag:$.image_tag,architecture:$.architecture??E.defaultArchitecture},S=await I.post("/containers",L);return this.tracked.set(S.data.id,{container:S.data,pollingTimer:null,healthTimer:null}),this.startPolling(S.data.id),cU.info(`[CloudContainer] Created container "${$.name}" (id=${S.data.id}, stack=${S.stackName})`),S}async listContainers(){return(await this.getClient().get("/containers")).data}async getContainer($){let E=await this.getClient().get(`/containers/${$}`),L=this.tracked.get($);if(L)L.container=E.data;return E.data}async deleteContainer($){await this.getClient().delete(`/containers/${$}`);let E=this.tracked.get($);if(E){if(E.pollingTimer)clearTimeout(E.pollingTimer);if(E.healthTimer)clearInterval(E.healthTimer);this.tracked.delete($)}cU.info(`[CloudContainer] Deleted container ${$}`)}startPolling($){let I=this.tracked.get($);if(!I)return;let E=0,L=120,S=5000,K=30000,Q=async()=>{if(E++,E>L){cU.error(`[CloudContainer] Polling timed out for container ${$} after ${L} attempts`);return}let T=await this.getContainer($),M=T.status;if(cU.debug(`[CloudContainer] Poll #${E} for ${$}: status=${M}`),M==="running"){cU.info(`[CloudContainer] Container ${$} is now running at ${T.load_balancer_url}`),this.startHealthMonitoring($);return}if(M==="failed"||M==="stopped"||M==="suspended"){if(cU.warn(`[CloudContainer] Container ${$} reached terminal state: ${M}`),T.error_message)cU.error(`[CloudContainer] Error: ${T.error_message}`);return}let H=Math.min(S*2**Math.min(E-1,3),K);I.pollingTimer=setTimeout(Q,H)};I.pollingTimer=setTimeout(Q,S)}async waitForDeployment($,I=900000){let E=Date.now()+I,L=5000,S=30000;while(Date.now()<E){let K=await this.getContainer($);if(K.status==="running")return K;if(K.status==="failed")throw Error(`Container deployment failed: ${K.error_message??"unknown error"}`);if(K.status==="stopped"||K.status==="suspended")throw Error(`Container reached terminal state: ${K.status}`);await new Promise((Q)=>setTimeout(Q,L)),L=Math.min(L*1.5,S)}throw Error(`Container deployment timed out after ${Math.round(I/1000)}s`)}startHealthMonitoring($){let I=this.tracked.get($);if(!I||I.healthTimer)return;let E=60000;I.healthTimer=setInterval(()=>{this.getContainerHealth($).then((L)=>{if(!L.data.healthy)cU.warn(`[CloudContainer] Container ${$} unhealthy: ${L.data.status}`)}).catch((L)=>{cU.error(`[CloudContainer] Health check failed for ${$}: ${L.message}`)})},E)}async getContainerHealth($){return this.getClient().get(`/containers/${$}/health`)}getTrackedContainers(){return Array.from(this.tracked.values()).map(($)=>$.container)}getTrackedContainer($){return this.tracked.get($)?.container}isContainerRunning($){return this.tracked.get($)?.container.status==="running"}getContainerUrl($){return this.tracked.get($)?.container.load_balancer_url??null}}import{ChannelType as gA,ContentType as KZ,createMessageMemory as CC,createUniqueUuid as zO,logger as dU,Service as WJ}from"@elizaos/core";var NA=25000,FJ=NA+5000,MJ=2000,QC=250;function xA($){return new Promise((I)=>setTimeout(I,$))}function fA($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function zJ($){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test($)}function MU($){return typeof $==="string"&&$.trim()?$.trim():void 0}function TJ($){let I=MU($)?.toUpperCase();return I&&I in gA?gA[I]:gA.DM}function qJ(){if(typeof process>"u")return!1;return process.env.ELIZA_CLOUD_PROVISIONED==="1"}function PJ(){return typeof process<"u"&&typeof process.versions?.node==="string"}function XC($){if(!Array.isArray($))return;let I=$.map((E,L)=>{if(!fA(E))return null;let S=MU(E.url);if(!S)return null;let K=MU(E.type)?.toLowerCase();return{id:MU(E.id)??`${L}:${S}`,url:S,source:MU(E.source),title:MU(E.title),description:MU(E.description),text:MU(E.text),contentType:K==="image"?KZ.IMAGE:K==="video"?KZ.VIDEO:K==="audio"?KZ.AUDIO:K==="document"?KZ.DOCUMENT:void 0}}).filter((E)=>E!==null);return I.length>0?I:void 0}function bO($){return fA($)?$:void 0}function GC($){if(!fA($))return;return JSON.parse(JSON.stringify($))}function kJ($,I){let E=bO(I.params),L=bO(E?.sender),S=MU(E?.source)??"eliza_cloud_gateway",K=typeof E?.text==="string"?E.text:"",Q=MU(L?.id)??`${S}:anonymous`,T=MU(L?.username)??Q,M=MU(L?.displayName)??MU(L?.name)??T,H=MU(E?.roomId)??`${S}:${Q}:${String(I.id??Date.now())}:${$.agentId}`;if(!K.trim()&&!XC(E?.attachments)?.length)return null;return{text:K.trim()||" ",roomKey:H,channelType:TJ(E?.channelType),source:S,senderId:Q,senderUserName:T,senderName:M,attachments:XC(E?.attachments),senderMetadata:bO(L?.metadata),transportMetadata:bO(E?.metadata)}}function _J($,I,E){let L=bO(I?.discord),S=MU(L?.guildId);if(S)return`gateway:${$}:guild:${S}`;let K=MU(I?.threadId);if(K)return`gateway:${$}:thread:${K}`;return`gateway:${$}:room:${E}`}class HZ extends Error{constructor(){super("Gateway relay session missing");this.name="SessionMissingError"}}class WZ extends WJ{static serviceType="CLOUD_MANAGED_GATEWAY_RELAY";capabilityDescription="Registers a local Eliza runtime with the cloud managed gateway and handles inbound relay traffic";authService=null;loopPromise=null;currentSessionId=null;stopping=!1;activeAbortController=null;relayStatus="idle";lastSeenAt=null;static async start($){let I=new WZ($);return await I.initialize(),I}async stop(){if(this.stopping=!0,this.relayStatus="stopped",this.activeAbortController?.abort(),this.loopPromise)await this.loopPromise.catch((I)=>{dU.debug(`[CloudManagedGatewayRelay] Ignoring relay loop shutdown error: ${I instanceof Error?I.message:String(I)}`)});let $=this.currentSessionId;if(this.currentSessionId=null,$)await this.disconnectSession($)}async initialize(){if(!PJ()){dU.debug("[CloudManagedGatewayRelay] Skipping gateway relay outside Node.js runtime"),this.relayStatus="stopped";return}if(qJ()){dU.debug("[CloudManagedGatewayRelay] Skipping local relay inside provisioned cloud runtime"),this.relayStatus="stopped";return}if(!this.runtime.messageService){dU.debug("[CloudManagedGatewayRelay] Skipping gateway relay without message service"),this.relayStatus="idle";return}let $=this.runtime.getService("CLOUD_AUTH");if(!$){dU.debug("[CloudManagedGatewayRelay] CloudAuthService not available"),this.relayStatus="idle";return}if(this.authService=$,!this.authService.isAuthenticated()){dU.debug("[CloudManagedGatewayRelay] Skipping gateway relay while cloud auth is inactive"),this.relayStatus="idle";return}this.startRelayLoopIfReady()}getSessionInfo(){let $=this.authService,I=this.stopping||this.relayStatus==="stopped"?"stopped":$?.isAuthenticated()===!1?"idle":this.relayStatus;return{sessionId:this.currentSessionId,organizationId:$?.getOrganizationId()??null,userId:$?.getUserId()??null,agentName:this.getAgentName(),platform:"local-runtime",lastSeenAt:this.lastSeenAt,status:I}}startRelayLoopIfReady(){if(this.loopPromise&&!this.stopping)return!0;let $=this.authService??this.runtime.getService("CLOUD_AUTH");if(!$?.isAuthenticated()||!this.runtime.messageService)return this.relayStatus="idle",!1;return this.authService=$,this.stopping=!1,this.relayStatus="idle",this.loopPromise=this.runLoop(),dU.info("[CloudManagedGatewayRelay] Local gateway relay loop started"),!0}async runLoop(){while(!this.stopping)try{if(!this.currentSessionId){this.currentSessionId=await this.registerSession(),this.relayStatus="registered",this.lastSeenAt=new Date().toISOString();continue}this.relayStatus="polling";let $=await this.pollNextRequest(this.currentSessionId);if(this.lastSeenAt=new Date().toISOString(),!$){this.relayStatus="registered",await xA(QC);continue}let I=await this.handleRequest($.rpc);await this.submitResponse(this.currentSessionId,$.requestId,I),this.relayStatus="registered"}catch($){if(this.stopping)return;if($ instanceof HZ){this.currentSessionId=null,this.relayStatus="idle",await xA(QC);continue}this.relayStatus="error",dU.warn(`[CloudManagedGatewayRelay] Relay loop error: ${$ instanceof Error?$.message:String($)}`),await xA(MJ)}}getAgentName(){return this.runtime.character?.name?.trim()||"Eliza"}getClient(){let $=this.authService?.getClient();if(!$)throw Error("Cloud API client is unavailable");return $}async requestJson($,I){let E=I.timeoutMs??FJ,L=new AbortController,S=setTimeout(()=>L.abort(),E);this.activeAbortController=L;try{let K=await this.getClient().requestRaw(I.method,$,{headers:{Accept:"application/json"},json:I.json,query:I.query,signal:L.signal}),Q=await K.json().catch(()=>({}));return{status:K.status,body:Q}}finally{if(clearTimeout(S),this.activeAbortController===L)this.activeAbortController=null}}async registerSession(){let{status:$,body:I}=await this.requestJson("/eliza/gateway-relay/sessions",{method:"POST",json:{runtimeAgentId:this.runtime.agentId,agentName:this.getAgentName()}});if($>=400||!I?.success||!I.data?.session?.id)throw Error(`Failed to register gateway relay session (status=${$})`);return dU.info(`[CloudManagedGatewayRelay] Registered local runtime for managed gateway (${I.data.session.id})`),I.data.session.id}async disconnectSession($){try{await this.requestJson(`/eliza/gateway-relay/sessions/${encodeURIComponent($)}`,{method:"DELETE",timeoutMs:1e4})}catch(I){dU.debug(`[CloudManagedGatewayRelay] Failed to disconnect relay session ${$}: ${I instanceof Error?I.message:String(I)}`)}}async pollNextRequest($){let{status:I,body:E}=await this.requestJson(`/eliza/gateway-relay/sessions/${encodeURIComponent($)}/next`,{method:"GET",query:{timeoutMs:NA},timeoutMs:NA+5000});if(I===404)throw new HZ;if(I>=400||!E?.success)throw Error(`Failed to poll gateway relay session ${$} (status=${I})`);return E.data?.request??null}async submitResponse($,I,E){let{status:L,body:S}=await this.requestJson(`/eliza/gateway-relay/sessions/${encodeURIComponent($)}/responses`,{method:"POST",json:{requestId:I,response:E}});if(L===404)throw new HZ;if(L>=400||S?.success===!1)throw Error(`Failed to submit gateway relay response (status=${L})`)}async handleRequest($){switch($.method){case"heartbeat":return{jsonrpc:"2.0",id:$.id,result:{timestamp:Date.now()}};case"status.get":return{jsonrpc:"2.0",id:$.id,result:{status:"running",runtimeAgentId:this.runtime.agentId,agentName:this.getAgentName()}};case"message.send":return this.handleMessageSend($);default:return{jsonrpc:"2.0",id:$.id,error:{code:-32601,message:`Unsupported relay method: ${$.method}`}}}}async handleMessageSend($){if(!this.runtime.messageService)return{jsonrpc:"2.0",id:$.id,error:{code:-32603,message:"Message service is not available"}};let I=kJ(this.runtime,$);if(!I)return{jsonrpc:"2.0",id:$.id,error:{code:-32602,message:"Invalid message relay payload"}};let E=zJ(I.roomKey)?I.roomKey:zO(this.runtime,I.roomKey),L=zO(this.runtime,_J(I.source,I.transportMetadata,I.roomKey)),S=zO(this.runtime,`${I.source}:${I.senderId}`),K=zO(this.runtime,`eliza-cloud-gateway:${I.source}`),Q=zO(this.runtime,`${I.source}:${I.roomKey}:${String($.id??Date.now())}:inbound`),T=GC(I.transportMetadata);await this.runtime.ensureConnection({entityId:S,roomId:E,roomName:I.roomKey,worldId:L,worldName:I.source,userName:I.senderUserName,name:I.senderName,source:I.source,channelId:I.roomKey,type:I.channelType,messageServerId:K,metadata:T});let M=CC({id:Q,entityId:S,agentId:this.runtime.agentId,roomId:E,content:{text:I.text,source:I.source,channelType:I.channelType,...I.attachments?{attachments:I.attachments}:{}}});M.metadata={...M.metadata,entityName:I.senderName,entityUserName:I.senderUserName,...I.senderMetadata?{gatewaySender:GC(I.senderMetadata)}:{},...I.transportMetadata?{gatewayMetadata:T}:{}};let H=[],F=async(R)=>{let D=typeof R.text==="string"?R.text:"";if(D.trim())H.push(D);let q=CC({id:zO(this.runtime,`${I.source}:${I.roomKey}:${String($.id??Date.now())}:response:${H.length}`),entityId:this.runtime.agentId,agentId:this.runtime.agentId,roomId:E,content:{...R,text:D,source:I.source,channelType:I.channelType}});return await this.runtime.createMemory(q,"messages"),[q]};try{let R=await this.runtime.messageService.handleMessage(this.runtime,M,F),D=H[H.length-1]??(typeof R.responseContent?.text==="string"?R.responseContent.text:void 0);return{jsonrpc:"2.0",id:$.id,result:{didRespond:R.didRespond,...D?{text:D}:{},runtimeAgentId:this.runtime.agentId}}}catch(R){return{jsonrpc:"2.0",id:$.id,error:{code:-32603,message:R instanceof Error?R.message:String(R)}}}}}import{logger as wA,Service as jJ}from"@elizaos/core";var EC=1800000,vJ=[["gpt-","openai"],["o1","openai"],["o3","openai"],["o4","openai"],["dall-e","openai"],["whisper","openai"],["tts","openai"],["claude-","anthropic"],["gemini-","google"],["llama","meta"],["deepseek","deepseek"],["grok","xai"],["kimi","moonshot"]];function BJ($){if($.includes("/"))return $.split("/")[0];let I=$.toLowerCase();for(let[E,L]of vJ)if(I.startsWith(E))return L;return"unknown"}function gJ($){if($.includes("/"))return $.split("/").slice(1).join("/");return $}class FZ extends jJ{static serviceType="CLOUD_MODEL_REGISTRY";capabilityDescription="Discovers and caches available AI models from ElizaCloud";models=[];byProvider={};lastFetchedAt=0;fetchPromise=null;static async start($){let I=new FZ($);return await I.initialize(),I}async stop(){this.models=[],this.byProvider={},this.lastFetchedAt=0}async initialize(){if(!this.runtime.getService("CLOUD_AUTH")?.isAuthenticated()){wA.info("[CloudModelRegistry] Auth not available, will fetch models on first access");return}await this.fetchModels(),this.validateConfiguredModels()}async fetchModels(){if(this.fetchPromise){await this.fetchPromise;return}this.fetchPromise=this.doFetchModels(),await this.fetchPromise,this.fetchPromise=null}async doFetchModels(){let $=this.runtime.getService("CLOUD_AUTH");if(!$?.isAuthenticated())return;let L=(await $.getClient().get("/models")).data??[];this.models=L.map((S)=>({id:S.id,provider:BJ(S.id),name:gJ(S.id),createdAt:S.created})),this.byProvider={};for(let S of this.models){if(!this.byProvider[S.provider])this.byProvider[S.provider]=[];this.byProvider[S.provider].push(S)}this.lastFetchedAt=Date.now(),wA.info(`[CloudModelRegistry] Loaded ${this.models.length} models from ${Object.keys(this.byProvider).length} providers`)}validateConfiguredModels(){if(this.models.length===0)return;let $=new Set(this.models.map((L)=>L.id)),I=new Set(this.models.map((L)=>L.name)),E=[{key:"ELIZAOS_CLOUD_NANO_MODEL",label:"nano model"},{key:"ELIZAOS_CLOUD_MEDIUM_MODEL",label:"medium model"},{key:"ELIZAOS_CLOUD_SMALL_MODEL",label:"small model"},{key:"ELIZAOS_CLOUD_LARGE_MODEL",label:"large model"},{key:"ELIZAOS_CLOUD_MEGA_MODEL",label:"mega model"},{key:"ELIZAOS_CLOUD_RESPONSE_HANDLER_MODEL",label:"response handler model"},{key:"ELIZAOS_CLOUD_ACTION_PLANNER_MODEL",label:"action planner model"},{key:"ELIZAOS_CLOUD_RESPONSE_MODEL",label:"response model"},{key:"ELIZAOS_CLOUD_RESEARCH_MODEL",label:"research model"},{key:"ELIZAOS_CLOUD_EMBEDDING_MODEL",label:"embedding model"},{key:"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL",label:"image description model"},{key:"ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL",label:"image generation model"},{key:"ELIZAOS_CLOUD_TTS_MODEL",label:"TTS model"},{key:"ELIZAOS_CLOUD_TRANSCRIPTION_MODEL",label:"transcription model"}];for(let{key:L,label:S}of E){let K=this.runtime.getSetting(L);if(K&&typeof K==="string"){if(!($.has(K)||I.has(K)))wA.warn(`[CloudModelRegistry] Configured ${S} "${K}" not found in available models. It may still work if the gateway supports it, but check your configuration.`)}}}async getAvailableModels(){if(Date.now()-this.lastFetchedAt>EC)await this.fetchModels();return this.models}async getModelsByProvider(){if(Date.now()-this.lastFetchedAt>EC)await this.fetchModels();return this.byProvider}}var xJ=t0.TEXT_NANO??"TEXT_NANO",NJ=t0.TEXT_MEDIUM??"TEXT_MEDIUM",fJ=t0.TEXT_MEGA??"TEXT_MEGA",wJ=t0.RESPONSE_HANDLER??"RESPONSE_HANDLER",yJ=t0.ACTION_PLANNER??"ACTION_PLANNER";function cJ(){if(typeof process>"u")return{};return process.env}var u0=cJ(),pJ={name:"elizaOSCloud",description:"ElizaOS Cloud plugin — Multi-model AI generation, container provisioning, agent bridge, and billing management",config:{ELIZAOS_CLOUD_API_KEY:u0.ELIZAOS_CLOUD_API_KEY??null,ELIZAOS_CLOUD_BASE_URL:u0.ELIZAOS_CLOUD_BASE_URL??null,ELIZAOS_CLOUD_ENABLED:u0.ELIZAOS_CLOUD_ENABLED??null,ELIZAOS_CLOUD_NANO_MODEL:u0.ELIZAOS_CLOUD_NANO_MODEL??null,ELIZAOS_CLOUD_MEDIUM_MODEL:u0.ELIZAOS_CLOUD_MEDIUM_MODEL??null,ELIZAOS_CLOUD_SMALL_MODEL:u0.ELIZAOS_CLOUD_SMALL_MODEL??null,ELIZAOS_CLOUD_LARGE_MODEL:u0.ELIZAOS_CLOUD_LARGE_MODEL??null,ELIZAOS_CLOUD_MEGA_MODEL:u0.ELIZAOS_CLOUD_MEGA_MODEL??null,ELIZAOS_CLOUD_RESPONSE_HANDLER_MODEL:u0.ELIZAOS_CLOUD_RESPONSE_HANDLER_MODEL??null,ELIZAOS_CLOUD_SHOULD_RESPOND_MODEL:u0.ELIZAOS_CLOUD_SHOULD_RESPOND_MODEL??null,ELIZAOS_CLOUD_ACTION_PLANNER_MODEL:u0.ELIZAOS_CLOUD_ACTION_PLANNER_MODEL??null,ELIZAOS_CLOUD_PLANNER_MODEL:u0.ELIZAOS_CLOUD_PLANNER_MODEL??null,ELIZAOS_CLOUD_RESPONSE_MODEL:u0.ELIZAOS_CLOUD_RESPONSE_MODEL??null,NANO_MODEL:u0.NANO_MODEL??null,MEDIUM_MODEL:u0.MEDIUM_MODEL??null,SMALL_MODEL:u0.SMALL_MODEL??null,LARGE_MODEL:u0.LARGE_MODEL??null,MEGA_MODEL:u0.MEGA_MODEL??null,RESPONSE_HANDLER_MODEL:u0.RESPONSE_HANDLER_MODEL??null,SHOULD_RESPOND_MODEL:u0.SHOULD_RESPOND_MODEL??null,ACTION_PLANNER_MODEL:u0.ACTION_PLANNER_MODEL??null,PLANNER_MODEL:u0.PLANNER_MODEL??null,RESPONSE_MODEL:u0.RESPONSE_MODEL??null,ELIZAOS_CLOUD_RESEARCH_MODEL:u0.ELIZAOS_CLOUD_RESEARCH_MODEL??null,RESEARCH_MODEL:u0.RESEARCH_MODEL??null,ELIZAOS_CLOUD_EMBEDDING_MODEL:u0.ELIZAOS_CLOUD_EMBEDDING_MODEL??null,ELIZAOS_CLOUD_EMBEDDING_API_KEY:u0.ELIZAOS_CLOUD_EMBEDDING_API_KEY??null,ELIZAOS_CLOUD_EMBEDDING_URL:u0.ELIZAOS_CLOUD_EMBEDDING_URL??null,ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS:u0.ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS??null,ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL:u0.ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL??null,ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS:u0.ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS??null,ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL:u0.ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL??null,ELIZAOS_CLOUD_TTS_MODEL:u0.ELIZAOS_CLOUD_TTS_MODEL??null,ELIZAOS_CLOUD_TRANSCRIPTION_MODEL:u0.ELIZAOS_CLOUD_TRANSCRIPTION_MODEL??null,ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY:u0.ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY??null},async init($,I){E$($,I)},services:[YZ,LZ,WZ,FZ,DZ,RZ,SZ],actions:[dA,lA,bA,uA],providers:[oA,mA,nA,aA],models:{[t0.TEXT_EMBEDDING]:vZ,[xJ]:AA,[NJ]:$A,[t0.TEXT_SMALL]:ZA,[t0.TEXT_LARGE]:IA,[fJ]:CA,[wJ]:QA,[yJ]:XA,[t0.RESEARCH]:aZ,[t0.IMAGE]:nZ,[t0.IMAGE_DESCRIPTION]:tZ,[t0.OBJECT_SMALL]:rZ,[t0.OBJECT_LARGE]:eZ},tests:[{name:"ELIZAOS_CLOUD_plugin_tests",tests:[{name:"ELIZAOS_CLOUD_test_url_and_api_key_validation",fn:async($)=>{let I=await NU($).get("/models");BU.log({data:I.data?.length??"N/A"},"Models Available")}},{name:"ELIZAOS_CLOUD_test_text_embedding",fn:async($)=>{let I=await $.useModel(t0.TEXT_EMBEDDING,{text:"Hello, world!"});BU.log({embedding:I},"embedding")}},{name:"ELIZAOS_CLOUD_test_text_large",fn:async($)=>{let I=await $.useModel(t0.TEXT_LARGE,{prompt:"What is the nature of reality in 10 words?"});if(I.length===0)throw Error("Failed to generate text");BU.log({text:I},"generated with test_text_large")}},{name:"ELIZAOS_CLOUD_test_text_small",fn:async($)=>{let I=await $.useModel(t0.TEXT_SMALL,{prompt:"What is the nature of reality in 10 words?"});if(I.length===0)throw Error("Failed to generate text");BU.log({text:I},"generated with test_text_small")}},{name:"ELIZAOS_CLOUD_test_image_generation",fn:async($)=>{BU.log("ELIZAOS_CLOUD_test_image_generation");let I=await $.useModel(t0.IMAGE,{prompt:"A beautiful sunset over a calm ocean",count:1,size:"1024x1024"});BU.log({image:I},"generated with test_image_generation")}},{name:"image-description",fn:async($)=>{BU.log("ELIZAOS_CLOUD_test_image_description");let I=await $.useModel(t0.IMAGE_DESCRIPTION,"https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg/537px-Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg");if(I&&typeof I==="object"&&"title"in I&&"description"in I)BU.log({result:I},"Image description");else BU.error(`Invalid image description result format: ${JSON.stringify(I)}`)}},{name:"ELIZAOS_CLOUD_test_transcription",fn:async($)=>{BU.log("ELIZAOS_CLOUD_test_transcription");let E=await(await fetch("https://upload.wikimedia.org/wikipedia/en/4/40/Chris_Benoit_Voice_Message.ogg")).arrayBuffer(),L=await $.useModel(t0.TRANSCRIPTION,Buffer.from(new Uint8Array(E)));BU.log({transcription:L},"generated with test_transcription")}},{name:"ELIZAOS_CLOUD_test_text_tokenizer_encode",fn:async($)=>{let E=await $.useModel(t0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer encode!",modelType:t0.TEXT_SMALL});if(!Array.isArray(E)||E.length===0)throw Error("Failed to tokenize text: expected non-empty array of tokens");BU.log({tokens:E},"Tokenized output")}},{name:"ELIZAOS_CLOUD_test_text_tokenizer_decode",fn:async($)=>{let E=await $.useModel(t0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer decode!",modelType:t0.TEXT_SMALL}),L=await $.useModel(t0.TEXT_TOKENIZER_DECODE,{tokens:E,modelType:t0.TEXT_SMALL});if(L!=="Hello tokenizer decode!")throw Error(`Decoded text does not match original. Expected "Hello tokenizer decode!", got "${L}"`);BU.log({decodedText:L},"Decoded text")}},{name:"ELIZAOS_CLOUD_test_text_to_speech",fn:async($)=>{if(!await iZ($,{text:"Hello, this is a test for text-to-speech."}))throw Error("Failed to generate speech");BU.log("Generated speech successfully")}}]}]},JC=pJ;var PV=JC;export{pJ as elizaOSCloudPlugin,PV as default};
|
|
21
24
|
|
|
22
|
-
//# debugId=
|
|
25
|
+
//# debugId=7EA6E3A1F2E5911964756E2164756E21
|