dna-api 0.1.1
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.
Potentially problematic release.
This version of dna-api might be problematic. Click here for more details.
- package/build.ts +10 -0
- package/dist/index.d.ts +355 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +57 -0
- package/package.json +47 -0
- package/src/index.ts +832 -0
- package/tsconfig.build.json +109 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var FO=Object.create;var{getPrototypeOf:KO,defineProperty:GU,getOwnPropertyNames:T$,getOwnPropertyDescriptor:EO}=Object,R$=Object.prototype.hasOwnProperty;var zO=(X,Z,U)=>{U=X!=null?FO(KO(X)):{};let Q=Z||!X||!X.__esModule?GU(U,"default",{value:X,enumerable:!0}):U;for(let G of T$(X))if(!R$.call(Q,G))GU(Q,G,{get:()=>X[G],enumerable:!0});return Q},A$=new WeakMap,WX=(X)=>{var Z=A$.get(X),U;if(Z)return Z;if(Z=GU({},"__esModule",{value:!0}),X&&typeof X==="object"||typeof X==="function")T$(X).map((Q)=>!R$.call(Z,Q)&&GU(Z,Q,{get:()=>X[Q],enumerable:!(U=EO(X,Q))||U.enumerable}));return A$.set(X,Z),Z},QX=(X,Z)=>()=>(Z||X((Z={exports:{}}).exports,Z),Z.exports);var yU=(X,Z)=>{for(var U in Z)GU(X,U,{get:Z[U],enumerable:!0,configurable:!0,set:(Q)=>Z[U]=()=>Q})};var fU=(X,Z)=>()=>(X&&(Z=X(X=0)),Z);var DO=((X)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(X,{get:(Z,U)=>(typeof require<"u"?require:Z)[U]}):X)(function(X){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+X+'" is not supported')});var GX=QX((SD,P$)=>{P$.exports={options:{usePureJavaScript:!1}}});var I$=QX((LD,L$)=>{var yJ={};L$.exports=yJ;var S$={};yJ.encode=function(X,Z,U){if(typeof Z!=="string")throw TypeError('"alphabet" must be a string.');if(U!==void 0&&typeof U!=="number")throw TypeError('"maxline" must be a number.');var Q="";if(!(X instanceof Uint8Array))Q=qO(X,Z);else{var G=0,O=Z.length,Y=Z.charAt(0),K=[0];for(G=0;G<X.length;++G){for(var A=0,D=X[G];A<K.length;++A)D+=K[A]<<8,K[A]=D%O,D=D/O|0;while(D>0)K.push(D%O),D=D/O|0}for(G=0;X[G]===0&&G<X.length-1;++G)Q+=Y;for(G=K.length-1;G>=0;--G)Q+=Z[K[G]]}if(U){var C=new RegExp(".{1,"+U+"}","g");Q=Q.match(C).join(`\r
|
|
2
|
+
`)}return Q};yJ.decode=function(X,Z){if(typeof X!=="string")throw TypeError('"input" must be a string.');if(typeof Z!=="string")throw TypeError('"alphabet" must be a string.');var U=S$[Z];if(!U){U=S$[Z]=[];for(var Q=0;Q<Z.length;++Q)U[Z.charCodeAt(Q)]=Q}X=X.replace(/\s/g,"");var G=Z.length,O=Z.charAt(0),Y=[0];for(var Q=0;Q<X.length;Q++){var K=U[X.charCodeAt(Q)];if(K===void 0)return;for(var A=0,D=K;A<Y.length;++A)D+=Y[A]*G,Y[A]=D&255,D>>=8;while(D>0)Y.push(D&255),D>>=8}for(var C=0;X[C]===O&&C<X.length-1;++C)Y.push(0);if(typeof Buffer<"u")return Buffer.from(Y.reverse());return new Uint8Array(Y.reverse())};function qO(X,Z){var U=0,Q=Z.length,G=Z.charAt(0),O=[0];for(U=0;U<X.length();++U){for(var Y=0,K=X.at(U);Y<O.length;++Y)K+=O[Y]<<8,O[Y]=K%Q,K=K/Q|0;while(K>0)O.push(K%Q),K=K/Q|0}var A="";for(U=0;X.at(U)===0&&U<X.length()-1;++U)A+=G;for(U=O.length-1;U>=0;--U)A+=Z[O[U]];return A}});var DX=QX((ID,k$)=>{var j$=GX(),N$=I$(),G0=k$.exports=j$.util=j$.util||{};(function(){if(typeof process<"u"&&process.nextTick,typeof setImmediate==="function"){G0.setImmediate=function(){return setImmediate.apply(void 0,arguments)},G0.nextTick=function(K){return setImmediate(K)};return}if(G0.setImmediate=function(K){setTimeout(K,0)},typeof window<"u"&&typeof window.postMessage==="function"){let K=function(A){if(A.source===window&&A.data===X){A.stopPropagation();var D=Z.slice();Z.length=0,D.forEach(function(C){C()})}};var Y=K,X="forge.setImmediate",Z=[];G0.setImmediate=function(A){if(Z.push(A),Z.length===1)window.postMessage(X,"*")},window.addEventListener("message",K,!0)}if(typeof MutationObserver<"u"){var U=Date.now(),Q=!0,G=document.createElement("div"),Z=[];new MutationObserver(function(){var A=Z.slice();Z.length=0,A.forEach(function(D){D()})}).observe(G,{attributes:!0});var O=G0.setImmediate;G0.setImmediate=function(A){if(Date.now()-U>15)U=Date.now(),O(A);else if(Z.push(A),Z.length===1)G.setAttribute("a",Q=!Q)}}G0.nextTick=G0.setImmediate})();G0.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;G0.globalScope=function(){if(G0.isNodejs)return global;return typeof self>"u"?window:self}();G0.isArray=Array.isArray||function(X){return Object.prototype.toString.call(X)==="[object Array]"};G0.isArrayBuffer=function(X){return typeof ArrayBuffer<"u"&&X instanceof ArrayBuffer};G0.isArrayBufferView=function(X){return X&&G0.isArrayBuffer(X.buffer)&&X.byteLength!==void 0};function VU(X){if(!(X===8||X===16||X===24||X===32))throw Error("Only 8, 16, 24, or 32 bits supported: "+X)}G0.ByteBuffer=fJ;function fJ(X){if(this.data="",this.read=0,typeof X==="string")this.data=X;else if(G0.isArrayBuffer(X)||G0.isArrayBufferView(X))if(typeof Buffer<"u"&&X instanceof Buffer)this.data=X.toString("binary");else{var Z=new Uint8Array(X);try{this.data=String.fromCharCode.apply(null,Z)}catch(Q){for(var U=0;U<Z.length;++U)this.putByte(Z[U])}}else if(X instanceof fJ||typeof X==="object"&&typeof X.data==="string"&&typeof X.read==="number")this.data=X.data,this.read=X.read;this._constructedStringLength=0}G0.ByteStringBuffer=fJ;var MO=4096;G0.ByteStringBuffer.prototype._optimizeConstructedString=function(X){if(this._constructedStringLength+=X,this._constructedStringLength>MO)this.data.substr(0,1),this._constructedStringLength=0};G0.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};G0.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};G0.ByteStringBuffer.prototype.putByte=function(X){return this.putBytes(String.fromCharCode(X))};G0.ByteStringBuffer.prototype.fillWithByte=function(X,Z){X=String.fromCharCode(X);var U=this.data;while(Z>0){if(Z&1)U+=X;if(Z>>>=1,Z>0)X+=X}return this.data=U,this._optimizeConstructedString(Z),this};G0.ByteStringBuffer.prototype.putBytes=function(X){return this.data+=X,this._optimizeConstructedString(X.length),this};G0.ByteStringBuffer.prototype.putString=function(X){return this.putBytes(G0.encodeUtf8(X))};G0.ByteStringBuffer.prototype.putInt16=function(X){return this.putBytes(String.fromCharCode(X>>8&255)+String.fromCharCode(X&255))};G0.ByteStringBuffer.prototype.putInt24=function(X){return this.putBytes(String.fromCharCode(X>>16&255)+String.fromCharCode(X>>8&255)+String.fromCharCode(X&255))};G0.ByteStringBuffer.prototype.putInt32=function(X){return this.putBytes(String.fromCharCode(X>>24&255)+String.fromCharCode(X>>16&255)+String.fromCharCode(X>>8&255)+String.fromCharCode(X&255))};G0.ByteStringBuffer.prototype.putInt16Le=function(X){return this.putBytes(String.fromCharCode(X&255)+String.fromCharCode(X>>8&255))};G0.ByteStringBuffer.prototype.putInt24Le=function(X){return this.putBytes(String.fromCharCode(X&255)+String.fromCharCode(X>>8&255)+String.fromCharCode(X>>16&255))};G0.ByteStringBuffer.prototype.putInt32Le=function(X){return this.putBytes(String.fromCharCode(X&255)+String.fromCharCode(X>>8&255)+String.fromCharCode(X>>16&255)+String.fromCharCode(X>>24&255))};G0.ByteStringBuffer.prototype.putInt=function(X,Z){VU(Z);var U="";do Z-=8,U+=String.fromCharCode(X>>Z&255);while(Z>0);return this.putBytes(U)};G0.ByteStringBuffer.prototype.putSignedInt=function(X,Z){if(X<0)X+=2<<Z-1;return this.putInt(X,Z)};G0.ByteStringBuffer.prototype.putBuffer=function(X){return this.putBytes(X.getBytes())};G0.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};G0.ByteStringBuffer.prototype.getInt16=function(){var X=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,X};G0.ByteStringBuffer.prototype.getInt24=function(){var X=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,X};G0.ByteStringBuffer.prototype.getInt32=function(){var X=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,X};G0.ByteStringBuffer.prototype.getInt16Le=function(){var X=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,X};G0.ByteStringBuffer.prototype.getInt24Le=function(){var X=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,X};G0.ByteStringBuffer.prototype.getInt32Le=function(){var X=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,X};G0.ByteStringBuffer.prototype.getInt=function(X){VU(X);var Z=0;do Z=(Z<<8)+this.data.charCodeAt(this.read++),X-=8;while(X>0);return Z};G0.ByteStringBuffer.prototype.getSignedInt=function(X){var Z=this.getInt(X),U=2<<X-2;if(Z>=U)Z-=U<<1;return Z};G0.ByteStringBuffer.prototype.getBytes=function(X){var Z;if(X)X=Math.min(this.length(),X),Z=this.data.slice(this.read,this.read+X),this.read+=X;else if(X===0)Z="";else Z=this.read===0?this.data:this.data.slice(this.read),this.clear();return Z};G0.ByteStringBuffer.prototype.bytes=function(X){return typeof X>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+X)};G0.ByteStringBuffer.prototype.at=function(X){return this.data.charCodeAt(this.read+X)};G0.ByteStringBuffer.prototype.setAt=function(X,Z){return this.data=this.data.substr(0,this.read+X)+String.fromCharCode(Z)+this.data.substr(this.read+X+1),this};G0.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};G0.ByteStringBuffer.prototype.copy=function(){var X=G0.createBuffer(this.data);return X.read=this.read,X};G0.ByteStringBuffer.prototype.compact=function(){if(this.read>0)this.data=this.data.slice(this.read),this.read=0;return this};G0.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};G0.ByteStringBuffer.prototype.truncate=function(X){var Z=Math.max(0,this.length()-X);return this.data=this.data.substr(this.read,Z),this.read=0,this};G0.ByteStringBuffer.prototype.toHex=function(){var X="";for(var Z=this.read;Z<this.data.length;++Z){var U=this.data.charCodeAt(Z);if(U<16)X+="0";X+=U.toString(16)}return X};G0.ByteStringBuffer.prototype.toString=function(){return G0.decodeUtf8(this.bytes())};function CO(X,Z){Z=Z||{},this.read=Z.readOffset||0,this.growSize=Z.growSize||1024;var U=G0.isArrayBuffer(X),Q=G0.isArrayBufferView(X);if(U||Q){if(U)this.data=new DataView(X);else this.data=new DataView(X.buffer,X.byteOffset,X.byteLength);this.write="writeOffset"in Z?Z.writeOffset:this.data.byteLength;return}if(this.data=new DataView(new ArrayBuffer(0)),this.write=0,X!==null&&X!==void 0)this.putBytes(X);if("writeOffset"in Z)this.write=Z.writeOffset}G0.DataBuffer=CO;G0.DataBuffer.prototype.length=function(){return this.write-this.read};G0.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};G0.DataBuffer.prototype.accommodate=function(X,Z){if(this.length()>=X)return this;Z=Math.max(Z||this.growSize,X);var U=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),Q=new Uint8Array(this.length()+Z);return Q.set(U),this.data=new DataView(Q.buffer),this};G0.DataBuffer.prototype.putByte=function(X){return this.accommodate(1),this.data.setUint8(this.write++,X),this};G0.DataBuffer.prototype.fillWithByte=function(X,Z){this.accommodate(Z);for(var U=0;U<Z;++U)this.data.setUint8(X);return this};G0.DataBuffer.prototype.putBytes=function(X,Z){if(G0.isArrayBufferView(X)){var U=new Uint8Array(X.buffer,X.byteOffset,X.byteLength),Q=U.byteLength-U.byteOffset;this.accommodate(Q);var G=new Uint8Array(this.data.buffer,this.write);return G.set(U),this.write+=Q,this}if(G0.isArrayBuffer(X)){var U=new Uint8Array(X);this.accommodate(U.byteLength);var G=new Uint8Array(this.data.buffer);return G.set(U,this.write),this.write+=U.byteLength,this}if(X instanceof G0.DataBuffer||typeof X==="object"&&typeof X.read==="number"&&typeof X.write==="number"&&G0.isArrayBufferView(X.data)){var U=new Uint8Array(X.data.byteLength,X.read,X.length());this.accommodate(U.byteLength);var G=new Uint8Array(X.data.byteLength,this.write);return G.set(U),this.write+=U.byteLength,this}if(X instanceof G0.ByteStringBuffer)X=X.data,Z="binary";if(Z=Z||"binary",typeof X==="string"){var O;if(Z==="hex")return this.accommodate(Math.ceil(X.length/2)),O=new Uint8Array(this.data.buffer,this.write),this.write+=G0.binary.hex.decode(X,O,this.write),this;if(Z==="base64")return this.accommodate(Math.ceil(X.length/4)*3),O=new Uint8Array(this.data.buffer,this.write),this.write+=G0.binary.base64.decode(X,O,this.write),this;if(Z==="utf8")X=G0.encodeUtf8(X),Z="binary";if(Z==="binary"||Z==="raw")return this.accommodate(X.length),O=new Uint8Array(this.data.buffer,this.write),this.write+=G0.binary.raw.decode(O),this;if(Z==="utf16")return this.accommodate(X.length*2),O=new Uint16Array(this.data.buffer,this.write),this.write+=G0.text.utf16.encode(O),this;throw Error("Invalid encoding: "+Z)}throw Error("Invalid parameter: "+X)};G0.DataBuffer.prototype.putBuffer=function(X){return this.putBytes(X),X.clear(),this};G0.DataBuffer.prototype.putString=function(X){return this.putBytes(X,"utf16")};G0.DataBuffer.prototype.putInt16=function(X){return this.accommodate(2),this.data.setInt16(this.write,X),this.write+=2,this};G0.DataBuffer.prototype.putInt24=function(X){return this.accommodate(3),this.data.setInt16(this.write,X>>8&65535),this.data.setInt8(this.write,X>>16&255),this.write+=3,this};G0.DataBuffer.prototype.putInt32=function(X){return this.accommodate(4),this.data.setInt32(this.write,X),this.write+=4,this};G0.DataBuffer.prototype.putInt16Le=function(X){return this.accommodate(2),this.data.setInt16(this.write,X,!0),this.write+=2,this};G0.DataBuffer.prototype.putInt24Le=function(X){return this.accommodate(3),this.data.setInt8(this.write,X>>16&255),this.data.setInt16(this.write,X>>8&65535,!0),this.write+=3,this};G0.DataBuffer.prototype.putInt32Le=function(X){return this.accommodate(4),this.data.setInt32(this.write,X,!0),this.write+=4,this};G0.DataBuffer.prototype.putInt=function(X,Z){VU(Z),this.accommodate(Z/8);do Z-=8,this.data.setInt8(this.write++,X>>Z&255);while(Z>0);return this};G0.DataBuffer.prototype.putSignedInt=function(X,Z){if(VU(Z),this.accommodate(Z/8),X<0)X+=2<<Z-1;return this.putInt(X,Z)};G0.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};G0.DataBuffer.prototype.getInt16=function(){var X=this.data.getInt16(this.read);return this.read+=2,X};G0.DataBuffer.prototype.getInt24=function(){var X=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,X};G0.DataBuffer.prototype.getInt32=function(){var X=this.data.getInt32(this.read);return this.read+=4,X};G0.DataBuffer.prototype.getInt16Le=function(){var X=this.data.getInt16(this.read,!0);return this.read+=2,X};G0.DataBuffer.prototype.getInt24Le=function(){var X=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,X};G0.DataBuffer.prototype.getInt32Le=function(){var X=this.data.getInt32(this.read,!0);return this.read+=4,X};G0.DataBuffer.prototype.getInt=function(X){VU(X);var Z=0;do Z=(Z<<8)+this.data.getInt8(this.read++),X-=8;while(X>0);return Z};G0.DataBuffer.prototype.getSignedInt=function(X){var Z=this.getInt(X),U=2<<X-2;if(Z>=U)Z-=U<<1;return Z};G0.DataBuffer.prototype.getBytes=function(X){var Z;if(X)X=Math.min(this.length(),X),Z=this.data.slice(this.read,this.read+X),this.read+=X;else if(X===0)Z="";else Z=this.read===0?this.data:this.data.slice(this.read),this.clear();return Z};G0.DataBuffer.prototype.bytes=function(X){return typeof X>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+X)};G0.DataBuffer.prototype.at=function(X){return this.data.getUint8(this.read+X)};G0.DataBuffer.prototype.setAt=function(X,Z){return this.data.setUint8(X,Z),this};G0.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};G0.DataBuffer.prototype.copy=function(){return new G0.DataBuffer(this)};G0.DataBuffer.prototype.compact=function(){if(this.read>0){var X=new Uint8Array(this.data.buffer,this.read),Z=new Uint8Array(X.byteLength);Z.set(X),this.data=new DataView(Z),this.write-=this.read,this.read=0}return this};G0.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};G0.DataBuffer.prototype.truncate=function(X){return this.write=Math.max(0,this.length()-X),this.read=Math.min(this.read,this.write),this};G0.DataBuffer.prototype.toHex=function(){var X="";for(var Z=this.read;Z<this.data.byteLength;++Z){var U=this.data.getUint8(Z);if(U<16)X+="0";X+=U.toString(16)}return X};G0.DataBuffer.prototype.toString=function(X){var Z=new Uint8Array(this.data,this.read,this.length());if(X=X||"utf8",X==="binary"||X==="raw")return G0.binary.raw.encode(Z);if(X==="hex")return G0.binary.hex.encode(Z);if(X==="base64")return G0.binary.base64.encode(Z);if(X==="utf8")return G0.text.utf8.decode(Z);if(X==="utf16")return G0.text.utf16.decode(Z);throw Error("Invalid encoding: "+X)};G0.createBuffer=function(X,Z){if(Z=Z||"raw",X!==void 0&&Z==="utf8")X=G0.encodeUtf8(X);return new G0.ByteBuffer(X)};G0.fillString=function(X,Z){var U="";while(Z>0){if(Z&1)U+=X;if(Z>>>=1,Z>0)X+=X}return U};G0.xorBytes=function(X,Z,U){var Q="",G="",O="",Y=0,K=0;for(;U>0;--U,++Y){if(G=X.charCodeAt(Y)^Z.charCodeAt(Y),K>=10)Q+=O,O="",K=0;O+=String.fromCharCode(G),++K}return Q+=O,Q};G0.hexToBytes=function(X){var Z="",U=0;if(X.length&!0)U=1,Z+=String.fromCharCode(parseInt(X[0],16));for(;U<X.length;U+=2)Z+=String.fromCharCode(parseInt(X.substr(U,2),16));return Z};G0.bytesToHex=function(X){return G0.createBuffer(X).toHex()};G0.int32ToBytes=function(X){return String.fromCharCode(X>>24&255)+String.fromCharCode(X>>16&255)+String.fromCharCode(X>>8&255)+String.fromCharCode(X&255)};var $Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",GQ=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],B$="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";G0.encode64=function(X,Z){var U="",Q="",G,O,Y,K=0;while(K<X.length){if(G=X.charCodeAt(K++),O=X.charCodeAt(K++),Y=X.charCodeAt(K++),U+=$Q.charAt(G>>2),U+=$Q.charAt((G&3)<<4|O>>4),isNaN(O))U+="==";else U+=$Q.charAt((O&15)<<2|Y>>6),U+=isNaN(Y)?"=":$Q.charAt(Y&63);if(Z&&U.length>Z)Q+=U.substr(0,Z)+`\r
|
|
3
|
+
`,U=U.substr(Z)}return Q+=U,Q};G0.decode64=function(X){X=X.replace(/[^A-Za-z0-9\+\/\=]/g,"");var Z="",U,Q,G,O,Y=0;while(Y<X.length)if(U=GQ[X.charCodeAt(Y++)-43],Q=GQ[X.charCodeAt(Y++)-43],G=GQ[X.charCodeAt(Y++)-43],O=GQ[X.charCodeAt(Y++)-43],Z+=String.fromCharCode(U<<2|Q>>4),G!==64){if(Z+=String.fromCharCode((Q&15)<<4|G>>2),O!==64)Z+=String.fromCharCode((G&3)<<6|O)}return Z};G0.encodeUtf8=function(X){return unescape(encodeURIComponent(X))};G0.decodeUtf8=function(X){return decodeURIComponent(escape(X))};G0.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:N$.encode,decode:N$.decode}};G0.binary.raw.encode=function(X){return String.fromCharCode.apply(null,X)};G0.binary.raw.decode=function(X,Z,U){var Q=Z;if(!Q)Q=new Uint8Array(X.length);U=U||0;var G=U;for(var O=0;O<X.length;++O)Q[G++]=X.charCodeAt(O);return Z?G-U:Q};G0.binary.hex.encode=G0.bytesToHex;G0.binary.hex.decode=function(X,Z,U){var Q=Z;if(!Q)Q=new Uint8Array(Math.ceil(X.length/2));U=U||0;var G=0,O=U;if(X.length&1)G=1,Q[O++]=parseInt(X[0],16);for(;G<X.length;G+=2)Q[O++]=parseInt(X.substr(G,2),16);return Z?O-U:Q};G0.binary.base64.encode=function(X,Z){var U="",Q="",G,O,Y,K=0;while(K<X.byteLength){if(G=X[K++],O=X[K++],Y=X[K++],U+=$Q.charAt(G>>2),U+=$Q.charAt((G&3)<<4|O>>4),isNaN(O))U+="==";else U+=$Q.charAt((O&15)<<2|Y>>6),U+=isNaN(Y)?"=":$Q.charAt(Y&63);if(Z&&U.length>Z)Q+=U.substr(0,Z)+`\r
|
|
4
|
+
`,U=U.substr(Z)}return Q+=U,Q};G0.binary.base64.decode=function(X,Z,U){var Q=Z;if(!Q)Q=new Uint8Array(Math.ceil(X.length/4)*3);X=X.replace(/[^A-Za-z0-9\+\/\=]/g,""),U=U||0;var G,O,Y,K,A=0,D=U;while(A<X.length)if(G=GQ[X.charCodeAt(A++)-43],O=GQ[X.charCodeAt(A++)-43],Y=GQ[X.charCodeAt(A++)-43],K=GQ[X.charCodeAt(A++)-43],Q[D++]=G<<2|O>>4,Y!==64){if(Q[D++]=(O&15)<<4|Y>>2,K!==64)Q[D++]=(Y&3)<<6|K}return Z?D-U:Q.subarray(0,D)};G0.binary.base58.encode=function(X,Z){return G0.binary.baseN.encode(X,B$,Z)};G0.binary.base58.decode=function(X,Z){return G0.binary.baseN.decode(X,B$,Z)};G0.text={utf8:{},utf16:{}};G0.text.utf8.encode=function(X,Z,U){X=G0.encodeUtf8(X);var Q=Z;if(!Q)Q=new Uint8Array(X.length);U=U||0;var G=U;for(var O=0;O<X.length;++O)Q[G++]=X.charCodeAt(O);return Z?G-U:Q};G0.text.utf8.decode=function(X){return G0.decodeUtf8(String.fromCharCode.apply(null,X))};G0.text.utf16.encode=function(X,Z,U){var Q=Z;if(!Q)Q=new Uint8Array(X.length*2);var G=new Uint16Array(Q.buffer);U=U||0;var O=U,Y=U;for(var K=0;K<X.length;++K)G[Y++]=X.charCodeAt(K),O+=2;return Z?O-U:Q};G0.text.utf16.decode=function(X){return String.fromCharCode.apply(null,new Uint16Array(X.buffer))};G0.deflate=function(X,Z,U){if(Z=G0.decode64(X.deflate(G0.encode64(Z)).rval),U){var Q=2,G=Z.charCodeAt(1);if(G&32)Q=6;Z=Z.substring(Q,Z.length-4)}return Z};G0.inflate=function(X,Z,U){var Q=X.inflate(G0.encode64(Z)).rval;return Q===null?null:G0.decode64(Q)};var gJ=function(X,Z,U){if(!X)throw Error("WebStorage not available.");var Q;if(U===null)Q=X.removeItem(Z);else U=G0.encode64(JSON.stringify(U)),Q=X.setItem(Z,U);if(typeof Q<"u"&&Q.rval!==!0){var G=Error(Q.error.message);throw G.id=Q.error.id,G.name=Q.error.name,G}},hJ=function(X,Z){if(!X)throw Error("WebStorage not available.");var U=X.getItem(Z);if(X.init)if(U.rval===null){if(U.error){var Q=Error(U.error.message);throw Q.id=U.error.id,Q.name=U.error.name,Q}U=null}else U=U.rval;if(U!==null)U=JSON.parse(G0.decode64(U));return U},AO=function(X,Z,U,Q){var G=hJ(X,Z);if(G===null)G={};G[U]=Q,gJ(X,Z,G)},TO=function(X,Z,U){var Q=hJ(X,Z);if(Q!==null)Q=U in Q?Q[U]:null;return Q},RO=function(X,Z,U){var Q=hJ(X,Z);if(Q!==null&&U in Q){delete Q[U];var G=!0;for(var O in Q){G=!1;break}if(G)Q=null;gJ(X,Z,Q)}},PO=function(X,Z){gJ(X,Z,null)},gU=function(X,Z,U){var Q=null;if(typeof U>"u")U=["web","flash"];var G,O=!1,Y=null;for(var K in U){G=U[K];try{if(G==="flash"||G==="both"){if(Z[0]===null)throw Error("Flash local storage not available.");Q=X.apply(this,Z),O=G==="flash"}if(G==="web"||G==="both")Z[0]=localStorage,Q=X.apply(this,Z),O=!0}catch(A){Y=A}if(O)break}if(!O)throw Y;return Q};G0.setItem=function(X,Z,U,Q,G){gU(AO,arguments,G)};G0.getItem=function(X,Z,U,Q){return gU(TO,arguments,Q)};G0.removeItem=function(X,Z,U,Q){gU(RO,arguments,Q)};G0.clearItems=function(X,Z,U){gU(PO,arguments,U)};G0.isEmpty=function(X){for(var Z in X)if(X.hasOwnProperty(Z))return!1;return!0};G0.format=function(X){var Z=/%./g,U,Q,G=0,O=[],Y=0;while(U=Z.exec(X)){if(Q=X.substring(Y,Z.lastIndex-2),Q.length>0)O.push(Q);Y=Z.lastIndex;var K=U[0][1];switch(K){case"s":case"o":if(G<arguments.length)O.push(arguments[G+++1]);else O.push("<?>");break;case"%":O.push("%");break;default:O.push("<%"+K+"?>")}}return O.push(X.substring(Y)),O.join("")};G0.formatNumber=function(X,Z,U,Q){var G=X,O=isNaN(Z=Math.abs(Z))?2:Z,Y=U===void 0?",":U,K=Q===void 0?".":Q,A=G<0?"-":"",D=parseInt(G=Math.abs(+G||0).toFixed(O),10)+"",C=D.length>3?D.length%3:0;return A+(C?D.substr(0,C)+K:"")+D.substr(C).replace(/(\d{3})(?=\d)/g,"$1"+K)+(O?Y+Math.abs(G-D).toFixed(O).slice(2):"")};G0.formatSize=function(X){if(X>=1073741824)X=G0.formatNumber(X/1073741824,2,".","")+" GiB";else if(X>=1048576)X=G0.formatNumber(X/1048576,2,".","")+" MiB";else if(X>=1024)X=G0.formatNumber(X/1024,0)+" KiB";else X=G0.formatNumber(X,0)+" bytes";return X};G0.bytesFromIP=function(X){if(X.indexOf(".")!==-1)return G0.bytesFromIPv4(X);if(X.indexOf(":")!==-1)return G0.bytesFromIPv6(X);return null};G0.bytesFromIPv4=function(X){if(X=X.split("."),X.length!==4)return null;var Z=G0.createBuffer();for(var U=0;U<X.length;++U){var Q=parseInt(X[U],10);if(isNaN(Q))return null;Z.putByte(Q)}return Z.getBytes()};G0.bytesFromIPv6=function(X){var Z=0;X=X.split(":").filter(function(Y){if(Y.length===0)++Z;return!0});var U=(8-X.length+Z)*2,Q=G0.createBuffer();for(var G=0;G<8;++G){if(!X[G]||X[G].length===0){Q.fillWithByte(0,U),U=0;continue}var O=G0.hexToBytes(X[G]);if(O.length<2)Q.putByte(0);Q.putBytes(O)}return Q.getBytes()};G0.bytesToIP=function(X){if(X.length===4)return G0.bytesToIPv4(X);if(X.length===16)return G0.bytesToIPv6(X);return null};G0.bytesToIPv4=function(X){if(X.length!==4)return null;var Z=[];for(var U=0;U<X.length;++U)Z.push(X.charCodeAt(U));return Z.join(".")};G0.bytesToIPv6=function(X){if(X.length!==16)return null;var Z=[],U=[],Q=0;for(var G=0;G<X.length;G+=2){var O=G0.bytesToHex(X[G]+X[G+1]);while(O[0]==="0"&&O!=="0")O=O.substr(1);if(O==="0"){var Y=U[U.length-1],K=Z.length;if(!Y||K!==Y.end+1)U.push({start:K,end:K});else if(Y.end=K,Y.end-Y.start>U[Q].end-U[Q].start)Q=U.length-1}Z.push(O)}if(U.length>0){var A=U[Q];if(A.end-A.start>0){if(Z.splice(A.start,A.end-A.start+1,""),A.start===0)Z.unshift("");if(A.end===7)Z.push("")}}return Z.join(":")};G0.estimateCores=function(X,Z){if(typeof X==="function")Z=X,X={};if(X=X||{},"cores"in G0&&!X.update)return Z(null,G0.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return G0.cores=navigator.hardwareConcurrency,Z(null,G0.cores);if(typeof Worker>"u")return G0.cores=1,Z(null,G0.cores);if(typeof Blob>"u")return G0.cores=2,Z(null,G0.cores);var U=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(Y){var K=Date.now(),A=K+4;while(Date.now()<A);self.postMessage({st:K,et:A})})}.toString(),")()"],{type:"application/javascript"}));Q([],5,16);function Q(Y,K,A){if(K===0){var D=Math.floor(Y.reduce(function(C,z){return C+z},0)/Y.length);return G0.cores=Math.max(1,D),URL.revokeObjectURL(U),Z(null,G0.cores)}G(A,function(C,z){Y.push(O(A,z)),Q(Y,K-1,A)})}function G(Y,K){var A=[],D=[];for(var C=0;C<Y;++C){var z=new Worker(U);z.addEventListener("message",function(R){if(D.push(R.data),D.length===Y){for(var S=0;S<Y;++S)A[S].terminate();K(null,D)}}),A.push(z)}for(var C=0;C<Y;++C)A[C].postMessage(C)}function O(Y,K){var A=[];for(var D=0;D<Y;++D){var C=K[D],z=A[D]=[];for(var R=0;R<Y;++R){if(D===R)continue;var S=K[R];if(C.st>S.st&&C.st<S.et||S.st>C.st&&S.st<C.et)z.push(R)}}return A.reduce(function(P,N){return Math.max(P,N.length)},0)}}});var hU=QX((jD,x$)=>{var eX=GX();DX();x$.exports=eX.cipher=eX.cipher||{};eX.cipher.algorithms=eX.cipher.algorithms||{};eX.cipher.createCipher=function(X,Z){var U=X;if(typeof U==="string"){if(U=eX.cipher.getAlgorithm(U),U)U=U()}if(!U)throw Error("Unsupported algorithm: "+X);return new eX.cipher.BlockCipher({algorithm:U,key:Z,decrypt:!1})};eX.cipher.createDecipher=function(X,Z){var U=X;if(typeof U==="string"){if(U=eX.cipher.getAlgorithm(U),U)U=U()}if(!U)throw Error("Unsupported algorithm: "+X);return new eX.cipher.BlockCipher({algorithm:U,key:Z,decrypt:!0})};eX.cipher.registerAlgorithm=function(X,Z){X=X.toUpperCase(),eX.cipher.algorithms[X]=Z};eX.cipher.getAlgorithm=function(X){if(X=X.toUpperCase(),X in eX.cipher.algorithms)return eX.cipher.algorithms[X];return null};var pJ=eX.cipher.BlockCipher=function(X){this.algorithm=X.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=X.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=X.decrypt,this.algorithm.initialize(X)};pJ.prototype.start=function(X){X=X||{};var Z={};for(var U in X)Z[U]=X[U];Z.decrypt=this._decrypt,this._finish=!1,this._input=eX.util.createBuffer(),this.output=X.output||eX.util.createBuffer(),this.mode.start(Z)};pJ.prototype.update=function(X){if(X)this._input.putBuffer(X);while(!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish);this._input.compact()};pJ.prototype.finish=function(X){if(X&&(this.mode.name==="ECB"||this.mode.name==="CBC"))this.mode.pad=function(U){return X(this.blockSize,U,!1)},this.mode.unpad=function(U){return X(this.blockSize,U,!0)};var Z={};if(Z.decrypt=this._decrypt,Z.overflow=this._input.length()%this.blockSize,!this._decrypt&&this.mode.pad){if(!this.mode.pad(this._input,Z))return!1}if(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad){if(!this.mode.unpad(this.output,Z))return!1}if(this.mode.afterFinish){if(!this.mode.afterFinish(this.output,Z))return!1}return!0}});var uJ=QX((ND,w$)=>{var XZ=GX();DX();XZ.cipher=XZ.cipher||{};var OX=w$.exports=XZ.cipher.modes=XZ.cipher.modes||{};OX.ecb=function(X){X=X||{},this.name="ECB",this.cipher=X.cipher,this.blockSize=X.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints)};OX.ecb.prototype.start=function(X){};OX.ecb.prototype.encrypt=function(X,Z,U){if(X.length()<this.blockSize&&!(U&&X.length()>0))return!0;for(var Q=0;Q<this._ints;++Q)this._inBlock[Q]=X.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var Q=0;Q<this._ints;++Q)Z.putInt32(this._outBlock[Q])};OX.ecb.prototype.decrypt=function(X,Z,U){if(X.length()<this.blockSize&&!(U&&X.length()>0))return!0;for(var Q=0;Q<this._ints;++Q)this._inBlock[Q]=X.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var Q=0;Q<this._ints;++Q)Z.putInt32(this._outBlock[Q])};OX.ecb.prototype.pad=function(X,Z){var U=X.length()===this.blockSize?this.blockSize:this.blockSize-X.length();return X.fillWithByte(U,U),!0};OX.ecb.prototype.unpad=function(X,Z){if(Z.overflow>0)return!1;var U=X.length(),Q=X.at(U-1);if(Q>this.blockSize<<2)return!1;return X.truncate(Q),!0};OX.cbc=function(X){X=X||{},this.name="CBC",this.cipher=X.cipher,this.blockSize=X.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints)};OX.cbc.prototype.start=function(X){if(X.iv===null){if(!this._prev)throw Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if(!("iv"in X))throw Error("Invalid IV parameter.");else this._iv=pU(X.iv,this.blockSize),this._prev=this._iv.slice(0)};OX.cbc.prototype.encrypt=function(X,Z,U){if(X.length()<this.blockSize&&!(U&&X.length()>0))return!0;for(var Q=0;Q<this._ints;++Q)this._inBlock[Q]=this._prev[Q]^X.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var Q=0;Q<this._ints;++Q)Z.putInt32(this._outBlock[Q]);this._prev=this._outBlock};OX.cbc.prototype.decrypt=function(X,Z,U){if(X.length()<this.blockSize&&!(U&&X.length()>0))return!0;for(var Q=0;Q<this._ints;++Q)this._inBlock[Q]=X.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var Q=0;Q<this._ints;++Q)Z.putInt32(this._prev[Q]^this._outBlock[Q]);this._prev=this._inBlock.slice(0)};OX.cbc.prototype.pad=function(X,Z){var U=X.length()===this.blockSize?this.blockSize:this.blockSize-X.length();return X.fillWithByte(U,U),!0};OX.cbc.prototype.unpad=function(X,Z){if(Z.overflow>0)return!1;var U=X.length(),Q=X.at(U-1);if(Q>this.blockSize<<2)return!1;return X.truncate(Q),!0};OX.cfb=function(X){X=X||{},this.name="CFB",this.cipher=X.cipher,this.blockSize=X.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=Array(this._ints),this._partialBlock=Array(this._ints),this._partialOutput=XZ.util.createBuffer(),this._partialBytes=0};OX.cfb.prototype.start=function(X){if(!("iv"in X))throw Error("Invalid IV parameter.");this._iv=pU(X.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};OX.cfb.prototype.encrypt=function(X,Z,U){var Q=X.length();if(Q===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&Q>=this.blockSize){for(var G=0;G<this._ints;++G)this._inBlock[G]=X.getInt32()^this._outBlock[G],Z.putInt32(this._inBlock[G]);return}var O=(this.blockSize-Q)%this.blockSize;if(O>0)O=this.blockSize-O;this._partialOutput.clear();for(var G=0;G<this._ints;++G)this._partialBlock[G]=X.getInt32()^this._outBlock[G],this._partialOutput.putInt32(this._partialBlock[G]);if(O>0)X.read-=this.blockSize;else for(var G=0;G<this._ints;++G)this._inBlock[G]=this._partialBlock[G];if(this._partialBytes>0)this._partialOutput.getBytes(this._partialBytes);if(O>0&&!U)return Z.putBytes(this._partialOutput.getBytes(O-this._partialBytes)),this._partialBytes=O,!0;Z.putBytes(this._partialOutput.getBytes(Q-this._partialBytes)),this._partialBytes=0};OX.cfb.prototype.decrypt=function(X,Z,U){var Q=X.length();if(Q===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&Q>=this.blockSize){for(var G=0;G<this._ints;++G)this._inBlock[G]=X.getInt32(),Z.putInt32(this._inBlock[G]^this._outBlock[G]);return}var O=(this.blockSize-Q)%this.blockSize;if(O>0)O=this.blockSize-O;this._partialOutput.clear();for(var G=0;G<this._ints;++G)this._partialBlock[G]=X.getInt32(),this._partialOutput.putInt32(this._partialBlock[G]^this._outBlock[G]);if(O>0)X.read-=this.blockSize;else for(var G=0;G<this._ints;++G)this._inBlock[G]=this._partialBlock[G];if(this._partialBytes>0)this._partialOutput.getBytes(this._partialBytes);if(O>0&&!U)return Z.putBytes(this._partialOutput.getBytes(O-this._partialBytes)),this._partialBytes=O,!0;Z.putBytes(this._partialOutput.getBytes(Q-this._partialBytes)),this._partialBytes=0};OX.ofb=function(X){X=X||{},this.name="OFB",this.cipher=X.cipher,this.blockSize=X.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=Array(this._ints),this._partialOutput=XZ.util.createBuffer(),this._partialBytes=0};OX.ofb.prototype.start=function(X){if(!("iv"in X))throw Error("Invalid IV parameter.");this._iv=pU(X.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};OX.ofb.prototype.encrypt=function(X,Z,U){var Q=X.length();if(X.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&Q>=this.blockSize){for(var G=0;G<this._ints;++G)Z.putInt32(X.getInt32()^this._outBlock[G]),this._inBlock[G]=this._outBlock[G];return}var O=(this.blockSize-Q)%this.blockSize;if(O>0)O=this.blockSize-O;this._partialOutput.clear();for(var G=0;G<this._ints;++G)this._partialOutput.putInt32(X.getInt32()^this._outBlock[G]);if(O>0)X.read-=this.blockSize;else for(var G=0;G<this._ints;++G)this._inBlock[G]=this._outBlock[G];if(this._partialBytes>0)this._partialOutput.getBytes(this._partialBytes);if(O>0&&!U)return Z.putBytes(this._partialOutput.getBytes(O-this._partialBytes)),this._partialBytes=O,!0;Z.putBytes(this._partialOutput.getBytes(Q-this._partialBytes)),this._partialBytes=0};OX.ofb.prototype.decrypt=OX.ofb.prototype.encrypt;OX.ctr=function(X){X=X||{},this.name="CTR",this.cipher=X.cipher,this.blockSize=X.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=Array(this._ints),this._partialOutput=XZ.util.createBuffer(),this._partialBytes=0};OX.ctr.prototype.start=function(X){if(!("iv"in X))throw Error("Invalid IV parameter.");this._iv=pU(X.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};OX.ctr.prototype.encrypt=function(X,Z,U){var Q=X.length();if(Q===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&Q>=this.blockSize)for(var G=0;G<this._ints;++G)Z.putInt32(X.getInt32()^this._outBlock[G]);else{var O=(this.blockSize-Q)%this.blockSize;if(O>0)O=this.blockSize-O;this._partialOutput.clear();for(var G=0;G<this._ints;++G)this._partialOutput.putInt32(X.getInt32()^this._outBlock[G]);if(O>0)X.read-=this.blockSize;if(this._partialBytes>0)this._partialOutput.getBytes(this._partialBytes);if(O>0&&!U)return Z.putBytes(this._partialOutput.getBytes(O-this._partialBytes)),this._partialBytes=O,!0;Z.putBytes(this._partialOutput.getBytes(Q-this._partialBytes)),this._partialBytes=0}cU(this._inBlock)};OX.ctr.prototype.decrypt=OX.ctr.prototype.encrypt;OX.gcm=function(X){X=X||{},this.name="GCM",this.cipher=X.cipher,this.blockSize=X.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints),this._partialOutput=XZ.util.createBuffer(),this._partialBytes=0,this._R=3774873600};OX.gcm.prototype.start=function(X){if(!("iv"in X))throw Error("Invalid IV parameter.");var Z=XZ.util.createBuffer(X.iv);this._cipherLength=0;var U;if("additionalData"in X)U=XZ.util.createBuffer(X.additionalData);else U=XZ.util.createBuffer();if("tagLength"in X)this._tagLength=X.tagLength;else this._tagLength=128;if(this._tag=null,X.decrypt){if(this._tag=XZ.util.createBuffer(X.tag).getBytes(),this._tag.length!==this._tagLength/8)throw Error("Authentication tag does not match tag length.")}this._hashBlock=Array(this._ints),this.tag=null,this._hashSubkey=Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var Q=Z.length();if(Q===12)this._j0=[Z.getInt32(),Z.getInt32(),Z.getInt32(),1];else{this._j0=[0,0,0,0];while(Z.length()>0)this._j0=this.ghash(this._hashSubkey,this._j0,[Z.getInt32(),Z.getInt32(),Z.getInt32(),Z.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(cJ(Q*8)))}this._inBlock=this._j0.slice(0),cU(this._inBlock),this._partialBytes=0,U=XZ.util.createBuffer(U),this._aDataLength=cJ(U.length()*8);var G=U.length()%this.blockSize;if(G)U.fillWithByte(0,this.blockSize-G);this._s=[0,0,0,0];while(U.length()>0)this._s=this.ghash(this._hashSubkey,this._s,[U.getInt32(),U.getInt32(),U.getInt32(),U.getInt32()])};OX.gcm.prototype.encrypt=function(X,Z,U){var Q=X.length();if(Q===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&Q>=this.blockSize){for(var G=0;G<this._ints;++G)Z.putInt32(this._outBlock[G]^=X.getInt32());this._cipherLength+=this.blockSize}else{var O=(this.blockSize-Q)%this.blockSize;if(O>0)O=this.blockSize-O;this._partialOutput.clear();for(var G=0;G<this._ints;++G)this._partialOutput.putInt32(X.getInt32()^this._outBlock[G]);if(O<=0||U){if(U){var Y=Q%this.blockSize;this._cipherLength+=Y,this._partialOutput.truncate(this.blockSize-Y)}else this._cipherLength+=this.blockSize;for(var G=0;G<this._ints;++G)this._outBlock[G]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0)this._partialOutput.getBytes(this._partialBytes);if(O>0&&!U)return X.read-=this.blockSize,Z.putBytes(this._partialOutput.getBytes(O-this._partialBytes)),this._partialBytes=O,!0;Z.putBytes(this._partialOutput.getBytes(Q-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),cU(this._inBlock)};OX.gcm.prototype.decrypt=function(X,Z,U){var Q=X.length();if(Q<this.blockSize&&!(U&&Q>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),cU(this._inBlock),this._hashBlock[0]=X.getInt32(),this._hashBlock[1]=X.getInt32(),this._hashBlock[2]=X.getInt32(),this._hashBlock[3]=X.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var G=0;G<this._ints;++G)Z.putInt32(this._outBlock[G]^this._hashBlock[G]);if(Q<this.blockSize)this._cipherLength+=Q%this.blockSize;else this._cipherLength+=this.blockSize};OX.gcm.prototype.afterFinish=function(X,Z){var U=!0;if(Z.decrypt&&Z.overflow)X.truncate(this.blockSize-Z.overflow);this.tag=XZ.util.createBuffer();var Q=this._aDataLength.concat(cJ(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,Q);var G=[];this.cipher.encrypt(this._j0,G);for(var O=0;O<this._ints;++O)this.tag.putInt32(this._s[O]^G[O]);if(this.tag.truncate(this.tag.length()%(this._tagLength/8)),Z.decrypt&&this.tag.bytes()!==this._tag)U=!1;return U};OX.gcm.prototype.multiply=function(X,Z){var U=[0,0,0,0],Q=Z.slice(0);for(var G=0;G<128;++G){var O=X[G/32|0]&1<<31-G%32;if(O)U[0]^=Q[0],U[1]^=Q[1],U[2]^=Q[2],U[3]^=Q[3];this.pow(Q,Q)}return U};OX.gcm.prototype.pow=function(X,Z){var U=X[3]&1;for(var Q=3;Q>0;--Q)Z[Q]=X[Q]>>>1|(X[Q-1]&1)<<31;if(Z[0]=X[0]>>>1,U)Z[0]^=this._R};OX.gcm.prototype.tableMultiply=function(X){var Z=[0,0,0,0];for(var U=0;U<32;++U){var Q=U/8|0,G=X[Q]>>>(7-U%8)*4&15,O=this._m[U][G];Z[0]^=O[0],Z[1]^=O[1],Z[2]^=O[2],Z[3]^=O[3]}return Z};OX.gcm.prototype.ghash=function(X,Z,U){return Z[0]^=U[0],Z[1]^=U[1],Z[2]^=U[2],Z[3]^=U[3],this.tableMultiply(Z)};OX.gcm.prototype.generateHashTable=function(X,Z){var U=8/Z,Q=4*U,G=16*U,O=Array(G);for(var Y=0;Y<G;++Y){var K=[0,0,0,0],A=Y/Q|0,D=(Q-1-Y%Q)*Z;K[A]=1<<Z-1<<D,O[Y]=this.generateSubHashTable(this.multiply(K,X),Z)}return O};OX.gcm.prototype.generateSubHashTable=function(X,Z){var U=1<<Z,Q=U>>>1,G=Array(U);G[Q]=X.slice(0);var O=Q>>>1;while(O>0)this.pow(G[2*O],G[O]=[]),O>>=1;O=2;while(O<Q){for(var Y=1;Y<O;++Y){var K=G[O],A=G[Y];G[O+Y]=[K[0]^A[0],K[1]^A[1],K[2]^A[2],K[3]^A[3]]}O*=2}G[0]=[0,0,0,0];for(O=Q+1;O<U;++O){var D=G[O^Q];G[O]=[X[0]^D[0],X[1]^D[1],X[2]^D[2],X[3]^D[3]]}return G};function pU(X,Z){if(typeof X==="string")X=XZ.util.createBuffer(X);if(XZ.util.isArray(X)&&X.length>4){var U=X;X=XZ.util.createBuffer();for(var Q=0;Q<U.length;++Q)X.putByte(U[Q])}if(X.length()<Z)throw Error("Invalid IV length; got "+X.length()+" bytes and expected "+Z+" bytes.");if(!XZ.util.isArray(X)){var G=[],O=Z/4;for(var Q=0;Q<O;++Q)G.push(X.getInt32());X=G}return X}function cU(X){X[X.length-1]=X[X.length-1]+1&4294967295}function cJ(X){return[X/4294967296|0,X&4294967295]}});var VQ=QX((BD,f$)=>{var PX=GX();hU();uJ();DX();f$.exports=PX.aes=PX.aes||{};PX.aes.startEncrypting=function(X,Z,U,Q){var G=uU({key:X,output:U,decrypt:!1,mode:Q});return G.start(Z),G};PX.aes.createEncryptionCipher=function(X,Z){return uU({key:X,output:null,decrypt:!1,mode:Z})};PX.aes.startDecrypting=function(X,Z,U,Q){var G=uU({key:X,output:U,decrypt:!0,mode:Q});return G.start(Z),G};PX.aes.createDecryptionCipher=function(X,Z){return uU({key:X,output:null,decrypt:!0,mode:Z})};PX.aes.Algorithm=function(X,Z){if(!lJ)_$();var U=this;U.name=X,U.mode=new Z({blockSize:16,cipher:{encrypt:function(Q,G){return dJ(U._w,Q,G,!1)},decrypt:function(Q,G){return dJ(U._w,Q,G,!0)}}}),U._init=!1};PX.aes.Algorithm.prototype.initialize=function(X){if(this._init)return;var Z=X.key,U;if(typeof Z==="string"&&(Z.length===16||Z.length===24||Z.length===32))Z=PX.util.createBuffer(Z);else if(PX.util.isArray(Z)&&(Z.length===16||Z.length===24||Z.length===32)){U=Z,Z=PX.util.createBuffer();for(var Q=0;Q<U.length;++Q)Z.putByte(U[Q])}if(!PX.util.isArray(Z)){U=Z,Z=[];var G=U.length();if(G===16||G===24||G===32){G=G>>>2;for(var Q=0;Q<G;++Q)Z.push(U.getInt32())}}if(!PX.util.isArray(Z)||!(Z.length===4||Z.length===6||Z.length===8))throw Error("Invalid key parameter.");var O=this.mode.name,Y=["CFB","OFB","CTR","GCM"].indexOf(O)!==-1;this._w=y$(Z,X.decrypt&&!Y),this._init=!0};PX.aes._expandKey=function(X,Z){if(!lJ)_$();return y$(X,Z)};PX.aes._updateBlock=dJ;uQ("AES-ECB",PX.cipher.modes.ecb);uQ("AES-CBC",PX.cipher.modes.cbc);uQ("AES-CFB",PX.cipher.modes.cfb);uQ("AES-OFB",PX.cipher.modes.ofb);uQ("AES-CTR",PX.cipher.modes.ctr);uQ("AES-GCM",PX.cipher.modes.gcm);function uQ(X,Z){var U=function(){return new PX.aes.Algorithm(X,Z)};PX.cipher.registerAlgorithm(X,U)}var lJ=!1,cQ=4,zZ,bJ,v$,RQ,gZ;function _$(){lJ=!0,v$=[0,1,2,4,8,16,32,64,128,27,54];var X=Array(256);for(var Z=0;Z<128;++Z)X[Z]=Z<<1,X[Z+128]=Z+128<<1^283;zZ=Array(256),bJ=Array(256),RQ=[,,,,],gZ=[,,,,];for(var Z=0;Z<4;++Z)RQ[Z]=Array(256),gZ[Z]=Array(256);var U=0,Q=0,G,O,Y,K,A,D,C;for(var Z=0;Z<256;++Z){K=Q^Q<<1^Q<<2^Q<<3^Q<<4,K=K>>8^K&255^99,zZ[U]=K,bJ[K]=U,A=X[K],G=X[U],O=X[G],Y=X[O],D=A<<24^K<<16^K<<8^(K^A),C=(G^O^Y)<<24^(U^Y)<<16^(U^O^Y)<<8^(U^G^Y);for(var z=0;z<4;++z)RQ[z][U]=D,gZ[z][K]=C,D=D<<24|D>>>8,C=C<<24|C>>>8;if(U===0)U=Q=1;else U=G^X[X[X[G^Y]]],Q^=X[X[Q]]}}function y$(X,Z){var U=X.slice(0),Q,G=1,O=U.length,Y=O+6+1,K=cQ*Y;for(var A=O;A<K;++A){if(Q=U[A-1],A%O===0)Q=zZ[Q>>>16&255]<<24^zZ[Q>>>8&255]<<16^zZ[Q&255]<<8^zZ[Q>>>24]^v$[G]<<24,G++;else if(O>6&&A%O===4)Q=zZ[Q>>>24]<<24^zZ[Q>>>16&255]<<16^zZ[Q>>>8&255]<<8^zZ[Q&255];U[A]=U[A-O]^Q}if(Z){var D,C=gZ[0],z=gZ[1],R=gZ[2],S=gZ[3],P=U.slice(0);K=U.length;for(var A=0,N=K-cQ;A<K;A+=cQ,N-=cQ)if(A===0||A===K-cQ)P[A]=U[N],P[A+1]=U[N+3],P[A+2]=U[N+2],P[A+3]=U[N+1];else for(var I=0;I<cQ;++I)D=U[N+I],P[A+(3&-I)]=C[zZ[D>>>24]]^z[zZ[D>>>16&255]]^R[zZ[D>>>8&255]]^S[zZ[D&255]];U=P}return U}function dJ(X,Z,U,Q){var G=X.length/4-1,O,Y,K,A,D;if(Q)O=gZ[0],Y=gZ[1],K=gZ[2],A=gZ[3],D=bJ;else O=RQ[0],Y=RQ[1],K=RQ[2],A=RQ[3],D=zZ;var C,z,R,S,P,N,I;C=Z[0]^X[0],z=Z[Q?3:1]^X[1],R=Z[2]^X[2],S=Z[Q?1:3]^X[3];var B=3;for(var k=1;k<G;++k)P=O[C>>>24]^Y[z>>>16&255]^K[R>>>8&255]^A[S&255]^X[++B],N=O[z>>>24]^Y[R>>>16&255]^K[S>>>8&255]^A[C&255]^X[++B],I=O[R>>>24]^Y[S>>>16&255]^K[C>>>8&255]^A[z&255]^X[++B],S=O[S>>>24]^Y[C>>>16&255]^K[z>>>8&255]^A[R&255]^X[++B],C=P,z=N,R=I;U[0]=D[C>>>24]<<24^D[z>>>16&255]<<16^D[R>>>8&255]<<8^D[S&255]^X[++B],U[Q?3:1]=D[z>>>24]<<24^D[R>>>16&255]<<16^D[S>>>8&255]<<8^D[C&255]^X[++B],U[2]=D[R>>>24]<<24^D[S>>>16&255]<<16^D[C>>>8&255]<<8^D[z&255]^X[++B],U[Q?1:3]=D[S>>>24]<<24^D[C>>>16&255]<<16^D[z>>>8&255]<<8^D[R&255]^X[++B]}function uU(X){X=X||{};var Z=(X.mode||"CBC").toUpperCase(),U="AES-"+Z,Q;if(X.decrypt)Q=PX.cipher.createDecipher(U,X.key);else Q=PX.cipher.createCipher(U,X.key);var G=Q.start;return Q.start=function(O,Y){var K=null;if(Y instanceof PX.util.ByteBuffer)K=Y,Y={};Y=Y||{},Y.output=K,Y.iv=O,G.call(Q,Y)},Q}});var WQ=QX((kD,g$)=>{var WU=GX();WU.pki=WU.pki||{};var mJ=g$.exports=WU.pki.oids=WU.oids=WU.oids||{};function m0(X,Z){mJ[X]=Z,mJ[Z]=X}function MX(X,Z){mJ[X]=Z}m0("1.2.840.113549.1.1.1","rsaEncryption");m0("1.2.840.113549.1.1.4","md5WithRSAEncryption");m0("1.2.840.113549.1.1.5","sha1WithRSAEncryption");m0("1.2.840.113549.1.1.7","RSAES-OAEP");m0("1.2.840.113549.1.1.8","mgf1");m0("1.2.840.113549.1.1.9","pSpecified");m0("1.2.840.113549.1.1.10","RSASSA-PSS");m0("1.2.840.113549.1.1.11","sha256WithRSAEncryption");m0("1.2.840.113549.1.1.12","sha384WithRSAEncryption");m0("1.2.840.113549.1.1.13","sha512WithRSAEncryption");m0("1.3.101.112","EdDSA25519");m0("1.2.840.10040.4.3","dsa-with-sha1");m0("1.3.14.3.2.7","desCBC");m0("1.3.14.3.2.26","sha1");m0("1.3.14.3.2.29","sha1WithRSASignature");m0("2.16.840.1.101.3.4.2.1","sha256");m0("2.16.840.1.101.3.4.2.2","sha384");m0("2.16.840.1.101.3.4.2.3","sha512");m0("2.16.840.1.101.3.4.2.4","sha224");m0("2.16.840.1.101.3.4.2.5","sha512-224");m0("2.16.840.1.101.3.4.2.6","sha512-256");m0("1.2.840.113549.2.2","md2");m0("1.2.840.113549.2.5","md5");m0("1.2.840.113549.1.7.1","data");m0("1.2.840.113549.1.7.2","signedData");m0("1.2.840.113549.1.7.3","envelopedData");m0("1.2.840.113549.1.7.4","signedAndEnvelopedData");m0("1.2.840.113549.1.7.5","digestedData");m0("1.2.840.113549.1.7.6","encryptedData");m0("1.2.840.113549.1.9.1","emailAddress");m0("1.2.840.113549.1.9.2","unstructuredName");m0("1.2.840.113549.1.9.3","contentType");m0("1.2.840.113549.1.9.4","messageDigest");m0("1.2.840.113549.1.9.5","signingTime");m0("1.2.840.113549.1.9.6","counterSignature");m0("1.2.840.113549.1.9.7","challengePassword");m0("1.2.840.113549.1.9.8","unstructuredAddress");m0("1.2.840.113549.1.9.14","extensionRequest");m0("1.2.840.113549.1.9.20","friendlyName");m0("1.2.840.113549.1.9.21","localKeyId");m0("1.2.840.113549.1.9.22.1","x509Certificate");m0("1.2.840.113549.1.12.10.1.1","keyBag");m0("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");m0("1.2.840.113549.1.12.10.1.3","certBag");m0("1.2.840.113549.1.12.10.1.4","crlBag");m0("1.2.840.113549.1.12.10.1.5","secretBag");m0("1.2.840.113549.1.12.10.1.6","safeContentsBag");m0("1.2.840.113549.1.5.13","pkcs5PBES2");m0("1.2.840.113549.1.5.12","pkcs5PBKDF2");m0("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");m0("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");m0("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");m0("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");m0("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");m0("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");m0("1.2.840.113549.2.7","hmacWithSHA1");m0("1.2.840.113549.2.8","hmacWithSHA224");m0("1.2.840.113549.2.9","hmacWithSHA256");m0("1.2.840.113549.2.10","hmacWithSHA384");m0("1.2.840.113549.2.11","hmacWithSHA512");m0("1.2.840.113549.3.7","des-EDE3-CBC");m0("2.16.840.1.101.3.4.1.2","aes128-CBC");m0("2.16.840.1.101.3.4.1.22","aes192-CBC");m0("2.16.840.1.101.3.4.1.42","aes256-CBC");m0("2.5.4.3","commonName");m0("2.5.4.4","surname");m0("2.5.4.5","serialNumber");m0("2.5.4.6","countryName");m0("2.5.4.7","localityName");m0("2.5.4.8","stateOrProvinceName");m0("2.5.4.9","streetAddress");m0("2.5.4.10","organizationName");m0("2.5.4.11","organizationalUnitName");m0("2.5.4.12","title");m0("2.5.4.13","description");m0("2.5.4.15","businessCategory");m0("2.5.4.17","postalCode");m0("2.5.4.42","givenName");m0("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");m0("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");m0("2.16.840.1.113730.1.1","nsCertType");m0("2.16.840.1.113730.1.13","nsComment");MX("2.5.29.1","authorityKeyIdentifier");MX("2.5.29.2","keyAttributes");MX("2.5.29.3","certificatePolicies");MX("2.5.29.4","keyUsageRestriction");MX("2.5.29.5","policyMapping");MX("2.5.29.6","subtreesConstraint");MX("2.5.29.7","subjectAltName");MX("2.5.29.8","issuerAltName");MX("2.5.29.9","subjectDirectoryAttributes");MX("2.5.29.10","basicConstraints");MX("2.5.29.11","nameConstraints");MX("2.5.29.12","policyConstraints");MX("2.5.29.13","basicConstraints");m0("2.5.29.14","subjectKeyIdentifier");m0("2.5.29.15","keyUsage");MX("2.5.29.16","privateKeyUsagePeriod");m0("2.5.29.17","subjectAltName");m0("2.5.29.18","issuerAltName");m0("2.5.29.19","basicConstraints");MX("2.5.29.20","cRLNumber");MX("2.5.29.21","cRLReason");MX("2.5.29.22","expirationDate");MX("2.5.29.23","instructionCode");MX("2.5.29.24","invalidityDate");MX("2.5.29.25","cRLDistributionPoints");MX("2.5.29.26","issuingDistributionPoint");MX("2.5.29.27","deltaCRLIndicator");MX("2.5.29.28","issuingDistributionPoint");MX("2.5.29.29","certificateIssuer");MX("2.5.29.30","nameConstraints");m0("2.5.29.31","cRLDistributionPoints");m0("2.5.29.32","certificatePolicies");MX("2.5.29.33","policyMappings");MX("2.5.29.34","policyConstraints");m0("2.5.29.35","authorityKeyIdentifier");MX("2.5.29.36","policyConstraints");m0("2.5.29.37","extKeyUsage");MX("2.5.29.46","freshestCRL");MX("2.5.29.54","inhibitAnyPolicy");m0("1.3.6.1.4.1.11129.2.4.2","timestampList");m0("1.3.6.1.5.5.7.1.1","authorityInfoAccess");m0("1.3.6.1.5.5.7.3.1","serverAuth");m0("1.3.6.1.5.5.7.3.2","clientAuth");m0("1.3.6.1.5.5.7.3.3","codeSigning");m0("1.3.6.1.5.5.7.3.4","emailProtection");m0("1.3.6.1.5.5.7.3.8","timeStamping")});var hZ=QX((xD,p$)=>{var LX=GX();DX();WQ();var r0=p$.exports=LX.asn1=LX.asn1||{};r0.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};r0.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};r0.maxDepth=256;r0.create=function(X,Z,U,Q,G){if(LX.util.isArray(Q)){var O=[];for(var Y=0;Y<Q.length;++Y)if(Q[Y]!==void 0)O.push(Q[Y]);Q=O}var K={tagClass:X,type:Z,constructed:U,composed:U||LX.util.isArray(Q),value:Q};if(G&&"bitStringContents"in G)K.bitStringContents=G.bitStringContents,K.original=r0.copy(K);return K};r0.copy=function(X,Z){var U;if(LX.util.isArray(X)){U=[];for(var Q=0;Q<X.length;++Q)U.push(r0.copy(X[Q],Z));return U}if(typeof X==="string")return X;if(U={tagClass:X.tagClass,type:X.type,constructed:X.constructed,composed:X.composed,value:r0.copy(X.value,Z)},Z&&!Z.excludeBitStringContents)U.bitStringContents=X.bitStringContents;return U};r0.equals=function(X,Z,U){if(LX.util.isArray(X)){if(!LX.util.isArray(Z))return!1;if(X.length!==Z.length)return!1;for(var Q=0;Q<X.length;++Q)if(!r0.equals(X[Q],Z[Q]))return!1;return!0}if(typeof X!==typeof Z)return!1;if(typeof X==="string")return X===Z;var G=X.tagClass===Z.tagClass&&X.type===Z.type&&X.constructed===Z.constructed&&X.composed===Z.composed&&r0.equals(X.value,Z.value);if(U&&U.includeBitStringContents)G=G&&X.bitStringContents===Z.bitStringContents;return G};r0.getBerValueLength=function(X){var Z=X.getByte();if(Z===128)return;var U,Q=Z&128;if(!Q)U=Z;else U=X.getInt((Z&127)<<3);return U};function OU(X,Z,U){if(U>Z){var Q=Error("Too few bytes to parse DER.");throw Q.available=X.length(),Q.remaining=Z,Q.requested=U,Q}}var SO=function(X,Z){var U=X.getByte();if(Z--,U===128)return;var Q,G=U&128;if(!G)Q=U;else{var O=U&127;OU(X,Z,O),Q=X.getInt(O<<3)}if(Q<0)throw Error("Negative length: "+Q);return Q};r0.fromDer=function(X,Z){if(Z===void 0)Z={strict:!0,parseAllBytes:!0,decodeBitStrings:!0};if(typeof Z==="boolean")Z={strict:Z,parseAllBytes:!0,decodeBitStrings:!0};if(!("strict"in Z))Z.strict=!0;if(!("parseAllBytes"in Z))Z.parseAllBytes=!0;if(!("decodeBitStrings"in Z))Z.decodeBitStrings=!0;if(!("maxDepth"in Z))Z.maxDepth=r0.maxDepth;if(typeof X==="string")X=LX.util.createBuffer(X);var U=X.length(),Q=bU(X,X.length(),0,Z);if(Z.parseAllBytes&&X.length()!==0){var G=Error("Unparsed DER bytes remain after ASN.1 parsing.");throw G.byteCount=U,G.remaining=X.length(),G}return Q};function bU(X,Z,U,Q){if(U>=Q.maxDepth)throw Error("ASN.1 parsing error: Max depth exceeded.");var G;OU(X,Z,2);var O=X.getByte();Z--;var Y=O&192,K=O&31;G=X.length();var A=SO(X,Z);if(Z-=G-X.length(),A!==void 0&&A>Z){if(Q.strict){var D=Error("Too few bytes to read ASN.1 value.");throw D.available=X.length(),D.remaining=Z,D.requested=A,D}A=Z}var C,z,R=(O&32)===32;if(R)if(C=[],A===void 0)for(;;){if(OU(X,Z,2),X.bytes(2)===String.fromCharCode(0,0)){X.getBytes(2),Z-=2;break}G=X.length(),C.push(bU(X,Z,U+1,Q)),Z-=G-X.length()}else while(A>0)G=X.length(),C.push(bU(X,A,U+1,Q)),Z-=G-X.length(),A-=G-X.length();if(C===void 0&&Y===r0.Class.UNIVERSAL&&K===r0.Type.BITSTRING)z=X.bytes(A);if(C===void 0&&Q.decodeBitStrings&&Y===r0.Class.UNIVERSAL&&K===r0.Type.BITSTRING&&A>1){var S=X.read,P=Z,N=0;if(K===r0.Type.BITSTRING)OU(X,Z,1),N=X.getByte(),Z--;if(N===0)try{G=X.length();var I={strict:!0,decodeBitStrings:!0},B=bU(X,Z,U+1,I),k=G-X.length();if(Z-=k,K==r0.Type.BITSTRING)k++;var w=B.tagClass;if(k===A&&(w===r0.Class.UNIVERSAL||w===r0.Class.CONTEXT_SPECIFIC))C=[B]}catch(_){}if(C===void 0)X.read=S,Z=P}if(C===void 0){if(A===void 0){if(Q.strict)throw Error("Non-constructed ASN.1 object of indefinite length.");A=Z}if(K===r0.Type.BMPSTRING){C="";for(;A>0;A-=2)OU(X,Z,2),C+=String.fromCharCode(X.getInt16()),Z-=2}else C=X.getBytes(A),Z-=A}var v=z===void 0?null:{bitStringContents:z};return r0.create(Y,K,R,C,v)}r0.toDer=function(X){var Z=LX.util.createBuffer(),U=X.tagClass|X.type,Q=LX.util.createBuffer(),G=!1;if("bitStringContents"in X){if(G=!0,X.original)G=r0.equals(X,X.original)}if(G)Q.putBytes(X.bitStringContents);else if(X.composed){if(X.constructed)U|=32;else Q.putByte(0);for(var O=0;O<X.value.length;++O)if(X.value[O]!==void 0)Q.putBuffer(r0.toDer(X.value[O]))}else if(X.type===r0.Type.BMPSTRING)for(var O=0;O<X.value.length;++O)Q.putInt16(X.value.charCodeAt(O));else if(X.type===r0.Type.INTEGER&&X.value.length>1&&(X.value.charCodeAt(0)===0&&(X.value.charCodeAt(1)&128)===0||X.value.charCodeAt(0)===255&&(X.value.charCodeAt(1)&128)===128))Q.putBytes(X.value.substr(1));else Q.putBytes(X.value);if(Z.putByte(U),Q.length()<=127)Z.putByte(Q.length()&127);else{var Y=Q.length(),K="";do K+=String.fromCharCode(Y&255),Y=Y>>>8;while(Y>0);Z.putByte(K.length|128);for(var O=K.length-1;O>=0;--O)Z.putByte(K.charCodeAt(O))}return Z.putBuffer(Q),Z};r0.oidToDer=function(X){var Z=X.split("."),U=LX.util.createBuffer();U.putByte(40*parseInt(Z[0],10)+parseInt(Z[1],10));var Q,G,O,Y;for(var K=2;K<Z.length;++K){if(Q=!0,G=[],O=parseInt(Z[K],10),O>4294967295)throw Error("OID value too large; max is 32-bits.");do{if(Y=O&127,O=O>>>7,!Q)Y|=128;G.push(Y),Q=!1}while(O>0);for(var A=G.length-1;A>=0;--A)U.putByte(G[A])}return U};r0.derToOid=function(X){var Z;if(typeof X==="string")X=LX.util.createBuffer(X);var U=X.getByte();Z=Math.floor(U/40)+"."+U%40;var Q=0;while(X.length()>0){if(Q>70368744177663)throw Error("OID value too large; max is 53-bits.");if(U=X.getByte(),Q=Q*128,U&128)Q+=U&127;else Z+="."+(Q+U),Q=0}return Z};r0.utcTimeToDate=function(X){var Z=new Date,U=parseInt(X.substr(0,2),10);U=U>=50?1900+U:2000+U;var Q=parseInt(X.substr(2,2),10)-1,G=parseInt(X.substr(4,2),10),O=parseInt(X.substr(6,2),10),Y=parseInt(X.substr(8,2),10),K=0;if(X.length>11){var A=X.charAt(10),D=10;if(A!=="+"&&A!=="-")K=parseInt(X.substr(10,2),10),D+=2}if(Z.setUTCFullYear(U,Q,G),Z.setUTCHours(O,Y,K,0),D){if(A=X.charAt(D),A==="+"||A==="-"){var C=parseInt(X.substr(D+1,2),10),z=parseInt(X.substr(D+4,2),10),R=C*60+z;if(R*=60000,A==="+")Z.setTime(+Z-R);else Z.setTime(+Z+R)}}return Z};r0.generalizedTimeToDate=function(X){var Z=new Date,U=parseInt(X.substr(0,4),10),Q=parseInt(X.substr(4,2),10)-1,G=parseInt(X.substr(6,2),10),O=parseInt(X.substr(8,2),10),Y=parseInt(X.substr(10,2),10),K=parseInt(X.substr(12,2),10),A=0,D=0,C=!1;if(X.charAt(X.length-1)==="Z")C=!0;var z=X.length-5,R=X.charAt(z);if(R==="+"||R==="-"){var S=parseInt(X.substr(z+1,2),10),P=parseInt(X.substr(z+4,2),10);if(D=S*60+P,D*=60000,R==="+")D*=-1;C=!0}if(X.charAt(14)===".")A=parseFloat(X.substr(14),10)*1000;if(C)Z.setUTCFullYear(U,Q,G),Z.setUTCHours(O,Y,K,A),Z.setTime(+Z+D);else Z.setFullYear(U,Q,G),Z.setHours(O,Y,K,A);return Z};r0.dateToUtcTime=function(X){if(typeof X==="string")return X;var Z="",U=[];U.push((""+X.getUTCFullYear()).substr(2)),U.push(""+(X.getUTCMonth()+1)),U.push(""+X.getUTCDate()),U.push(""+X.getUTCHours()),U.push(""+X.getUTCMinutes()),U.push(""+X.getUTCSeconds());for(var Q=0;Q<U.length;++Q){if(U[Q].length<2)Z+="0";Z+=U[Q]}return Z+="Z",Z};r0.dateToGeneralizedTime=function(X){if(typeof X==="string")return X;var Z="",U=[];U.push(""+X.getUTCFullYear()),U.push(""+(X.getUTCMonth()+1)),U.push(""+X.getUTCDate()),U.push(""+X.getUTCHours()),U.push(""+X.getUTCMinutes()),U.push(""+X.getUTCSeconds());for(var Q=0;Q<U.length;++Q){if(U[Q].length<2)Z+="0";Z+=U[Q]}return Z+="Z",Z};r0.integerToDer=function(X){var Z=LX.util.createBuffer();if(X>=-128&&X<128)return Z.putSignedInt(X,8);if(X>=-32768&&X<32768)return Z.putSignedInt(X,16);if(X>=-8388608&&X<8388608)return Z.putSignedInt(X,24);if(X>=-2147483648&&X<2147483648)return Z.putSignedInt(X,32);var U=Error("Integer too large; max is 32-bits.");throw U.integer=X,U};r0.derToInteger=function(X){if(typeof X==="string")X=LX.util.createBuffer(X);var Z=X.length()*8;if(Z>32)throw Error("Integer too large; max is 32-bits.");return X.getSignedInt(Z)};r0.validate=function(X,Z,U,Q){var G=!1;if((X.tagClass===Z.tagClass||typeof Z.tagClass>"u")&&(X.type===Z.type||typeof Z.type>"u")){if(X.constructed===Z.constructed||typeof Z.constructed>"u"){if(G=!0,Z.value&&LX.util.isArray(Z.value)){var O=0;for(var Y=0;G&&Y<Z.value.length;++Y){var K=Z.value[Y];G=!!K.optional;var A=X.value[O];if(!A){if(!K.optional){if(G=!1,Q)Q.push("["+Z.name+'] Missing required element. Expected tag class "'+K.tagClass+'", type "'+K.type+'"')}continue}var D=typeof K.tagClass<"u"&&typeof K.type<"u";if(D&&(A.tagClass!==K.tagClass||A.type!==K.type))if(K.optional){G=!0;continue}else{if(G=!1,Q)Q.push("["+Z.name+"] Tag mismatch. Expected ("+K.tagClass+","+K.type+"), got ("+A.tagClass+","+A.type+")");break}var C=r0.validate(A,K,U,Q);if(C)++O,G=!0;else if(K.optional)G=!0;else{G=!1;break}}}if(G&&U){if(Z.capture)U[Z.capture]=X.value;if(Z.captureAsn1)U[Z.captureAsn1]=X;if(Z.captureBitStringContents&&"bitStringContents"in X)U[Z.captureBitStringContents]=X.bitStringContents;if(Z.captureBitStringValue&&"bitStringContents"in X){var z;if(X.bitStringContents.length<2)U[Z.captureBitStringValue]="";else{var R=X.bitStringContents.charCodeAt(0);if(R!==0)throw Error("captureBitStringValue only supported for zero unused bits");U[Z.captureBitStringValue]=X.bitStringContents.slice(1)}}}}else if(Q)Q.push("["+Z.name+'] Expected constructed "'+Z.constructed+'", got "'+X.constructed+'"')}else if(Q){if(X.tagClass!==Z.tagClass)Q.push("["+Z.name+'] Expected tag class "'+Z.tagClass+'", got "'+X.tagClass+'"');if(X.type!==Z.type)Q.push("["+Z.name+'] Expected type "'+Z.type+'", got "'+X.type+'"')}return G};var h$=/[^\\u0000-\\u00ff]/;r0.prettyPrint=function(X,Z,U){var Q="";if(Z=Z||0,U=U||2,Z>0)Q+=`
|
|
5
|
+
`;var G="";for(var O=0;O<Z*U;++O)G+=" ";switch(Q+=G+"Tag: ",X.tagClass){case r0.Class.UNIVERSAL:Q+="Universal:";break;case r0.Class.APPLICATION:Q+="Application:";break;case r0.Class.CONTEXT_SPECIFIC:Q+="Context-Specific:";break;case r0.Class.PRIVATE:Q+="Private:";break}if(X.tagClass===r0.Class.UNIVERSAL)switch(Q+=X.type,X.type){case r0.Type.NONE:Q+=" (None)";break;case r0.Type.BOOLEAN:Q+=" (Boolean)";break;case r0.Type.INTEGER:Q+=" (Integer)";break;case r0.Type.BITSTRING:Q+=" (Bit string)";break;case r0.Type.OCTETSTRING:Q+=" (Octet string)";break;case r0.Type.NULL:Q+=" (Null)";break;case r0.Type.OID:Q+=" (Object Identifier)";break;case r0.Type.ODESC:Q+=" (Object Descriptor)";break;case r0.Type.EXTERNAL:Q+=" (External or Instance of)";break;case r0.Type.REAL:Q+=" (Real)";break;case r0.Type.ENUMERATED:Q+=" (Enumerated)";break;case r0.Type.EMBEDDED:Q+=" (Embedded PDV)";break;case r0.Type.UTF8:Q+=" (UTF8)";break;case r0.Type.ROID:Q+=" (Relative Object Identifier)";break;case r0.Type.SEQUENCE:Q+=" (Sequence)";break;case r0.Type.SET:Q+=" (Set)";break;case r0.Type.PRINTABLESTRING:Q+=" (Printable String)";break;case r0.Type.IA5String:Q+=" (IA5String (ASCII))";break;case r0.Type.UTCTIME:Q+=" (UTC time)";break;case r0.Type.GENERALIZEDTIME:Q+=" (Generalized time)";break;case r0.Type.BMPSTRING:Q+=" (BMP String)";break}else Q+=X.type;if(Q+=`
|
|
6
|
+
`,Q+=G+"Constructed: "+X.constructed+`
|
|
7
|
+
`,X.composed){var Y=0,K="";for(var O=0;O<X.value.length;++O)if(X.value[O]!==void 0){if(Y+=1,K+=r0.prettyPrint(X.value[O],Z+1,U),O+1<X.value.length)K+=","}Q+=G+"Sub values: "+Y+K}else{if(Q+=G+"Value: ",X.type===r0.Type.OID){var A=r0.derToOid(X.value);if(Q+=A,LX.pki&&LX.pki.oids){if(A in LX.pki.oids)Q+=" ("+LX.pki.oids[A]+") "}}if(X.type===r0.Type.INTEGER)try{Q+=r0.derToInteger(X.value)}catch(C){Q+="0x"+LX.util.bytesToHex(X.value)}else if(X.type===r0.Type.BITSTRING){if(X.value.length>1)Q+="0x"+LX.util.bytesToHex(X.value.slice(1));else Q+="(none)";if(X.value.length>0){var D=X.value.charCodeAt(0);if(D==1)Q+=" (1 unused bit shown)";else if(D>1)Q+=" ("+D+" unused bits shown)"}}else if(X.type===r0.Type.OCTETSTRING){if(!h$.test(X.value))Q+="("+X.value+") ";Q+="0x"+LX.util.bytesToHex(X.value)}else if(X.type===r0.Type.UTF8)try{Q+=LX.util.decodeUtf8(X.value)}catch(C){if(C.message==="URI malformed")Q+="0x"+LX.util.bytesToHex(X.value)+" (malformed UTF8)";else throw C}else if(X.type===r0.Type.PRINTABLESTRING||X.type===r0.Type.IA5String)Q+=X.value;else if(h$.test(X.value))Q+="0x"+LX.util.bytesToHex(X.value);else if(X.value.length===0)Q+="[null]";else Q+=X.value}return Q}});var cZ=QX((wD,c$)=>{var dU=GX();c$.exports=dU.md=dU.md||{};dU.md.algorithms=dU.md.algorithms||{}});var bQ=QX((vD,u$)=>{var iZ=GX();cZ();DX();var LO=u$.exports=iZ.hmac=iZ.hmac||{};LO.create=function(){var X=null,Z=null,U=null,Q=null,G={};return G.start=function(O,Y){if(O!==null)if(typeof O==="string")if(O=O.toLowerCase(),O in iZ.md.algorithms)Z=iZ.md.algorithms[O].create();else throw Error('Unknown hash algorithm "'+O+'"');else Z=O;if(Y===null)Y=X;else{if(typeof Y==="string")Y=iZ.util.createBuffer(Y);else if(iZ.util.isArray(Y)){var K=Y;Y=iZ.util.createBuffer();for(var A=0;A<K.length;++A)Y.putByte(K[A])}var D=Y.length();if(D>Z.blockLength)Z.start(),Z.update(Y.bytes()),Y=Z.digest();U=iZ.util.createBuffer(),Q=iZ.util.createBuffer(),D=Y.length();for(var A=0;A<D;++A){var K=Y.at(A);U.putByte(54^K),Q.putByte(92^K)}if(D<Z.blockLength){var K=Z.blockLength-D;for(var A=0;A<K;++A)U.putByte(54),Q.putByte(92)}X=Y,U=U.bytes(),Q=Q.bytes()}Z.start(),Z.update(U)},G.update=function(O){Z.update(O)},G.getMac=function(){var O=Z.digest().bytes();return Z.start(),Z.update(Q),Z.update(O),Z.digest()},G.digest=G.getMac,G}});var mU=QX((_D,m$)=>{var uZ=GX();cZ();DX();var d$=m$.exports=uZ.md5=uZ.md5||{};uZ.md.md5=uZ.md.algorithms.md5=d$;d$.create=function(){if(!l$)IO();var X=null,Z=uZ.util.createBuffer(),U=Array(16),Q={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return Q.start=function(){Q.messageLength=0,Q.fullMessageLength=Q.messageLength64=[];var G=Q.messageLengthSize/4;for(var O=0;O<G;++O)Q.fullMessageLength.push(0);return Z=uZ.util.createBuffer(),X={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},Q},Q.start(),Q.update=function(G,O){if(O==="utf8")G=uZ.util.encodeUtf8(G);var Y=G.length;Q.messageLength+=Y,Y=[Y/4294967296>>>0,Y>>>0];for(var K=Q.fullMessageLength.length-1;K>=0;--K)Q.fullMessageLength[K]+=Y[1],Y[1]=Y[0]+(Q.fullMessageLength[K]/4294967296>>>0),Q.fullMessageLength[K]=Q.fullMessageLength[K]>>>0,Y[0]=Y[1]/4294967296>>>0;if(Z.putBytes(G),b$(X,U,Z),Z.read>2048||Z.length()===0)Z.compact();return Q},Q.digest=function(){var G=uZ.util.createBuffer();G.putBytes(Z.bytes());var O=Q.fullMessageLength[Q.fullMessageLength.length-1]+Q.messageLengthSize,Y=O&Q.blockLength-1;G.putBytes(oJ.substr(0,Q.blockLength-Y));var K,A=0;for(var D=Q.fullMessageLength.length-1;D>=0;--D)K=Q.fullMessageLength[D]*8+A,A=K/4294967296>>>0,G.putInt32Le(K>>>0);var C={h0:X.h0,h1:X.h1,h2:X.h2,h3:X.h3};b$(C,U,G);var z=uZ.util.createBuffer();return z.putInt32Le(C.h0),z.putInt32Le(C.h1),z.putInt32Le(C.h2),z.putInt32Le(C.h3),z},Q};var oJ=null,lU=null,HU=null,dQ=null,l$=!1;function IO(){oJ=String.fromCharCode(128),oJ+=uZ.util.fillString(String.fromCharCode(0),64),lU=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],HU=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],dQ=Array(64);for(var X=0;X<64;++X)dQ[X]=Math.floor(Math.abs(Math.sin(X+1))*4294967296);l$=!0}function b$(X,Z,U){var Q,G,O,Y,K,A,D,C,z=U.length();while(z>=64){G=X.h0,O=X.h1,Y=X.h2,K=X.h3;for(C=0;C<16;++C)Z[C]=U.getInt32Le(),A=K^O&(Y^K),Q=G+A+dQ[C]+Z[C],D=HU[C],G=K,K=Y,Y=O,O+=Q<<D|Q>>>32-D;for(;C<32;++C)A=Y^K&(O^Y),Q=G+A+dQ[C]+Z[lU[C]],D=HU[C],G=K,K=Y,Y=O,O+=Q<<D|Q>>>32-D;for(;C<48;++C)A=O^Y^K,Q=G+A+dQ[C]+Z[lU[C]],D=HU[C],G=K,K=Y,Y=O,O+=Q<<D|Q>>>32-D;for(;C<64;++C)A=Y^(O|~K),Q=G+A+dQ[C]+Z[lU[C]],D=HU[C],G=K,K=Y,Y=O,O+=Q<<D|Q>>>32-D;X.h0=X.h0+G|0,X.h1=X.h1+O|0,X.h2=X.h2+Y|0,X.h3=X.h3+K|0,z-=64}}});var PQ=QX((yD,n$)=>{var nU=GX();DX();var o$=n$.exports=nU.pem=nU.pem||{};o$.encode=function(X,Z){Z=Z||{};var U="-----BEGIN "+X.type+`-----\r
|
|
8
|
+
`,Q;if(X.procType)Q={name:"Proc-Type",values:[String(X.procType.version),X.procType.type]},U+=oU(Q);if(X.contentDomain)Q={name:"Content-Domain",values:[X.contentDomain]},U+=oU(Q);if(X.dekInfo){if(Q={name:"DEK-Info",values:[X.dekInfo.algorithm]},X.dekInfo.parameters)Q.values.push(X.dekInfo.parameters);U+=oU(Q)}if(X.headers)for(var G=0;G<X.headers.length;++G)U+=oU(X.headers[G]);if(X.procType)U+=`\r
|
|
9
|
+
`;return U+=nU.util.encode64(X.body,Z.maxline||64)+`\r
|
|
10
|
+
`,U+="-----END "+X.type+`-----\r
|
|
11
|
+
`,U};o$.decode=function(X){var Z=[],U=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,Q=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,G=/\r?\n/,O;while(!0){if(O=U.exec(X),!O)break;var Y=O[1];if(Y==="NEW CERTIFICATE REQUEST")Y="CERTIFICATE REQUEST";var K={type:Y,procType:null,contentDomain:null,dekInfo:null,headers:[],body:nU.util.decode64(O[3])};if(Z.push(K),!O[2])continue;var A=O[2].split(G),D=0;while(O&&D<A.length){var C=A[D].replace(/\s+$/,"");for(var z=D+1;z<A.length;++z){var R=A[z];if(!/\s/.test(R[0]))break;C+=R,D=z}if(O=C.match(Q),O){var S={name:O[1],values:[]},P=O[2].split(",");for(var N=0;N<P.length;++N)S.values.push(jO(P[N]));if(!K.procType){if(S.name!=="Proc-Type")throw Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');else if(S.values.length!==2)throw Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');K.procType={version:P[0],type:P[1]}}else if(!K.contentDomain&&S.name==="Content-Domain")K.contentDomain=P[0]||"";else if(!K.dekInfo&&S.name==="DEK-Info"){if(S.values.length===0)throw Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');K.dekInfo={algorithm:P[0],parameters:P[1]||null}}else K.headers.push(S)}++D}if(K.procType==="ENCRYPTED"&&!K.dekInfo)throw Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}if(Z.length===0)throw Error("Invalid PEM formatted message.");return Z};function oU(X){var Z=X.name+": ",U=[],Q=function(A,D){return" "+D};for(var G=0;G<X.values.length;++G)U.push(X.values[G].replace(/^(\S+\r\n)/,Q));Z+=U.join(",")+`\r
|
|
12
|
+
`;var O=0,Y=-1;for(var G=0;G<Z.length;++G,++O)if(O>65&&Y!==-1){var K=Z[Y];if(K===",")++Y,Z=Z.substr(0,Y)+`\r
|
|
13
|
+
`+Z.substr(Y);else Z=Z.substr(0,Y)+`\r
|
|
14
|
+
`+K+Z.substr(Y+1);O=G-Y-1,Y=-1,++G}else if(Z[G]===" "||Z[G]==="\t"||Z[G]===",")Y=G;return Z}function jO(X){return X.replace(/^\s+/,"")}});var FU=QX((fD,r$)=>{var NX=GX();hU();uJ();DX();r$.exports=NX.des=NX.des||{};NX.des.startEncrypting=function(X,Z,U,Q){var G=sU({key:X,output:U,decrypt:!1,mode:Q||(Z===null?"ECB":"CBC")});return G.start(Z),G};NX.des.createEncryptionCipher=function(X,Z){return sU({key:X,output:null,decrypt:!1,mode:Z})};NX.des.startDecrypting=function(X,Z,U,Q){var G=sU({key:X,output:U,decrypt:!0,mode:Q||(Z===null?"ECB":"CBC")});return G.start(Z),G};NX.des.createDecryptionCipher=function(X,Z){return sU({key:X,output:null,decrypt:!0,mode:Z})};NX.des.Algorithm=function(X,Z){var U=this;U.name=X,U.mode=new Z({blockSize:8,cipher:{encrypt:function(Q,G){return s$(U._keys,Q,G,!1)},decrypt:function(Q,G){return s$(U._keys,Q,G,!0)}}}),U._init=!1};NX.des.Algorithm.prototype.initialize=function(X){if(this._init)return;var Z=NX.util.createBuffer(X.key);if(this.name.indexOf("3DES")===0){if(Z.length()!==24)throw Error("Invalid Triple-DES key size: "+Z.length()*8)}this._keys=fO(Z),this._init=!0};bZ("DES-ECB",NX.cipher.modes.ecb);bZ("DES-CBC",NX.cipher.modes.cbc);bZ("DES-CFB",NX.cipher.modes.cfb);bZ("DES-OFB",NX.cipher.modes.ofb);bZ("DES-CTR",NX.cipher.modes.ctr);bZ("3DES-ECB",NX.cipher.modes.ecb);bZ("3DES-CBC",NX.cipher.modes.cbc);bZ("3DES-CFB",NX.cipher.modes.cfb);bZ("3DES-OFB",NX.cipher.modes.ofb);bZ("3DES-CTR",NX.cipher.modes.ctr);function bZ(X,Z){var U=function(){return new NX.des.Algorithm(X,Z)};NX.cipher.registerAlgorithm(X,U)}var NO=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],BO=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],kO=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],xO=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],wO=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],vO=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],_O=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],yO=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function fO(X){var Z=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],U=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],Q=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],G=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],O=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],Y=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],K=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],A=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],D=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],C=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],z=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],R=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],S=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],P=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],N=X.length()>8?3:1,I=[],B=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],k=0,w;for(var v=0;v<N;v++){var _=X.getInt32(),u=X.getInt32();w=(_>>>4^u)&252645135,u^=w,_^=w<<4,w=(u>>>-16^_)&65535,_^=w,u^=w<<-16,w=(_>>>2^u)&858993459,u^=w,_^=w<<2,w=(u>>>-16^_)&65535,_^=w,u^=w<<-16,w=(_>>>1^u)&1431655765,u^=w,_^=w<<1,w=(u>>>8^_)&16711935,_^=w,u^=w<<8,w=(_>>>1^u)&1431655765,u^=w,_^=w<<1,w=_<<8|u>>>20&240,_=u<<24|u<<8&16711680|u>>>8&65280|u>>>24&240,u=w;for(var J0=0;J0<B.length;++J0){if(B[J0])_=_<<2|_>>>26,u=u<<2|u>>>26;else _=_<<1|_>>>27,u=u<<1|u>>>27;_&=-15,u&=-15;var H0=Z[_>>>28]|U[_>>>24&15]|Q[_>>>20&15]|G[_>>>16&15]|O[_>>>12&15]|Y[_>>>8&15]|K[_>>>4&15],V0=A[u>>>28]|D[u>>>24&15]|C[u>>>20&15]|z[u>>>16&15]|R[u>>>12&15]|S[u>>>8&15]|P[u>>>4&15];w=(V0>>>16^H0)&65535,I[k++]=H0^w,I[k++]=V0^w<<16}}return I}function s$(X,Z,U,Q){var G=X.length===32?3:9,O;if(G===3)O=Q?[30,-2,-2]:[0,32,2];else O=Q?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var Y,K=Z[0],A=Z[1];Y=(K>>>4^A)&252645135,A^=Y,K^=Y<<4,Y=(K>>>16^A)&65535,A^=Y,K^=Y<<16,Y=(A>>>2^K)&858993459,K^=Y,A^=Y<<2,Y=(A>>>8^K)&16711935,K^=Y,A^=Y<<8,Y=(K>>>1^A)&1431655765,A^=Y,K^=Y<<1,K=K<<1|K>>>31,A=A<<1|A>>>31;for(var D=0;D<G;D+=3){var C=O[D+1],z=O[D+2];for(var R=O[D];R!=C;R+=z){var S=A^X[R],P=(A>>>4|A<<28)^X[R+1];Y=K,K=A,A=Y^(BO[S>>>24&63]|xO[S>>>16&63]|vO[S>>>8&63]|yO[S&63]|NO[P>>>24&63]|kO[P>>>16&63]|wO[P>>>8&63]|_O[P&63])}Y=K,K=A,A=Y}K=K>>>1|K<<31,A=A>>>1|A<<31,Y=(K>>>1^A)&1431655765,A^=Y,K^=Y<<1,Y=(A>>>8^K)&16711935,K^=Y,A^=Y<<8,Y=(A>>>2^K)&858993459,K^=Y,A^=Y<<2,Y=(K>>>16^A)&65535,A^=Y,K^=Y<<16,Y=(K>>>4^A)&252645135,A^=Y,K^=Y<<4,U[0]=K,U[1]=A}function sU(X){X=X||{};var Z=(X.mode||"CBC").toUpperCase(),U="DES-"+Z,Q;if(X.decrypt)Q=NX.cipher.createDecipher(U,X.key);else Q=NX.cipher.createCipher(U,X.key);var G=Q.start;return Q.start=function(O,Y){var K=null;if(Y instanceof NX.util.ByteBuffer)K=Y,Y={};Y=Y||{},Y.output=K,Y.iv=O,G.call(Q,Y)},Q}});var QZ={};yU(QZ,{transcode:()=>TH,resolveObjectURL:()=>MH,kStringMaxLength:()=>JG,kMaxLength:()=>KU,isUtf8:()=>CH,isAscii:()=>AH,default:()=>RH,constants:()=>oO,btoa:()=>bO,atob:()=>dO,INSPECT_MAX_BYTES:()=>UG,File:()=>lO,Buffer:()=>M0,Blob:()=>mO});function gO(X){var Z=X.length;if(Z%4>0)throw Error("Invalid string. Length must be a multiple of 4");var U=X.indexOf("=");if(U===-1)U=Z;var Q=U===Z?0:4-U%4;return[U,Q]}function hO(X,Z){return(X+Z)*3/4-Z}function pO(X){var Z,U=gO(X),Q=U[0],G=U[1],O=new Uint8Array(hO(Q,G)),Y=0,K=G>0?Q-4:Q,A;for(A=0;A<K;A+=4)Z=NZ[X.charCodeAt(A)]<<18|NZ[X.charCodeAt(A+1)]<<12|NZ[X.charCodeAt(A+2)]<<6|NZ[X.charCodeAt(A+3)],O[Y++]=Z>>16&255,O[Y++]=Z>>8&255,O[Y++]=Z&255;if(G===2)Z=NZ[X.charCodeAt(A)]<<2|NZ[X.charCodeAt(A+1)]>>4,O[Y++]=Z&255;if(G===1)Z=NZ[X.charCodeAt(A)]<<10|NZ[X.charCodeAt(A+1)]<<4|NZ[X.charCodeAt(A+2)]>>2,O[Y++]=Z>>8&255,O[Y++]=Z&255;return O}function cO(X){return dZ[X>>18&63]+dZ[X>>12&63]+dZ[X>>6&63]+dZ[X&63]}function uO(X,Z,U){var Q,G=[];for(var O=Z;O<U;O+=3)Q=(X[O]<<16&16711680)+(X[O+1]<<8&65280)+(X[O+2]&255),G.push(cO(Q));return G.join("")}function t$(X){var Z,U=X.length,Q=U%3,G=[],O=16383;for(var Y=0,K=U-Q;Y<K;Y+=O)G.push(uO(X,Y,Y+O>K?K:Y+O));if(Q===1)Z=X[U-1],G.push(dZ[Z>>2]+dZ[Z<<4&63]+"==");else if(Q===2)Z=(X[U-2]<<8)+X[U-1],G.push(dZ[Z>>10]+dZ[Z>>4&63]+dZ[Z<<2&63]+"=");return G.join("")}function rU(X,Z,U,Q,G){var O,Y,K=G*8-Q-1,A=(1<<K)-1,D=A>>1,C=-7,z=U?G-1:0,R=U?-1:1,S=X[Z+z];z+=R,O=S&(1<<-C)-1,S>>=-C,C+=K;for(;C>0;O=O*256+X[Z+z],z+=R,C-=8);Y=O&(1<<-C)-1,O>>=-C,C+=Q;for(;C>0;Y=Y*256+X[Z+z],z+=R,C-=8);if(O===0)O=1-D;else if(O===A)return Y?NaN:(S?-1:1)*(1/0);else Y=Y+Math.pow(2,Q),O=O-D;return(S?-1:1)*Y*Math.pow(2,O-Q)}function QG(X,Z,U,Q,G,O){var Y,K,A,D=O*8-G-1,C=(1<<D)-1,z=C>>1,R=G===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=Q?0:O-1,P=Q?1:-1,N=Z<0||Z===0&&1/Z<0?1:0;if(Z=Math.abs(Z),isNaN(Z)||Z===1/0)K=isNaN(Z)?1:0,Y=C;else{if(Y=Math.floor(Math.log(Z)/Math.LN2),Z*(A=Math.pow(2,-Y))<1)Y--,A*=2;if(Y+z>=1)Z+=R/A;else Z+=R*Math.pow(2,1-z);if(Z*A>=2)Y++,A/=2;if(Y+z>=C)K=0,Y=C;else if(Y+z>=1)K=(Z*A-1)*Math.pow(2,G),Y=Y+z;else K=Z*Math.pow(2,z-1)*Math.pow(2,G),Y=0}for(;G>=8;X[U+S]=K&255,S+=P,K/=256,G-=8);Y=Y<<G|K,D+=G;for(;D>0;X[U+S]=Y&255,S+=P,Y/=256,D-=8);X[U+S-P]|=N*128}function eZ(X){if(X>KU)throw RangeError('The value "'+X+'" is invalid for option "size"');let Z=new Uint8Array(X);return Object.setPrototypeOf(Z,M0.prototype),Z}function iJ(X,Z,U){return class extends U{constructor(){super();Object.defineProperty(this,"message",{value:Z.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${X}]`,this.stack,delete this.name}get code(){return X}set code(Q){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Q,writable:!0})}toString(){return`${this.name} [${X}]: ${this.message}`}}}function M0(X,Z,U){if(typeof X==="number"){if(typeof Z==="string")throw TypeError('The "string" argument must be of type string. Received type number');return eJ(X)}return YG(X,Z,U)}function YG(X,Z,U){if(typeof X==="string")return aO(X,Z);if(ArrayBuffer.isView(X))return tO(X);if(X==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof X);if(lZ(X,ArrayBuffer)||X&&lZ(X.buffer,ArrayBuffer))return aJ(X,Z,U);if(typeof SharedArrayBuffer<"u"&&(lZ(X,SharedArrayBuffer)||X&&lZ(X.buffer,SharedArrayBuffer)))return aJ(X,Z,U);if(typeof X==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let Q=X.valueOf&&X.valueOf();if(Q!=null&&Q!==X)return M0.from(Q,Z,U);let G=iO(X);if(G)return G;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof X[Symbol.toPrimitive]==="function")return M0.from(X[Symbol.toPrimitive]("string"),Z,U);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof X)}function $G(X){if(typeof X!=="number")throw TypeError('"size" argument must be of type number');else if(X<0)throw RangeError('The value "'+X+'" is invalid for option "size"')}function rO(X,Z,U){if($G(X),X<=0)return eZ(X);if(Z!==void 0)return typeof U==="string"?eZ(X).fill(Z,U):eZ(X).fill(Z);return eZ(X)}function eJ(X){return $G(X),eZ(X<0?0:XY(X)|0)}function aO(X,Z){if(typeof Z!=="string"||Z==="")Z="utf8";if(!M0.isEncoding(Z))throw TypeError("Unknown encoding: "+Z);let U=GG(X,Z)|0,Q=eZ(U),G=Q.write(X,Z);if(G!==U)Q=Q.slice(0,G);return Q}function rJ(X){let Z=X.length<0?0:XY(X.length)|0,U=eZ(Z);for(let Q=0;Q<Z;Q+=1)U[Q]=X[Q]&255;return U}function tO(X){if(lZ(X,Uint8Array)){let Z=new Uint8Array(X);return aJ(Z.buffer,Z.byteOffset,Z.byteLength)}return rJ(X)}function aJ(X,Z,U){if(Z<0||X.byteLength<Z)throw RangeError('"offset" is outside of buffer bounds');if(X.byteLength<Z+(U||0))throw RangeError('"length" is outside of buffer bounds');let Q;if(Z===void 0&&U===void 0)Q=new Uint8Array(X);else if(U===void 0)Q=new Uint8Array(X,Z);else Q=new Uint8Array(X,Z,U);return Object.setPrototypeOf(Q,M0.prototype),Q}function iO(X){if(M0.isBuffer(X)){let Z=XY(X.length)|0,U=eZ(Z);if(U.length===0)return U;return X.copy(U,0,0,Z),U}if(X.length!==void 0){if(typeof X.length!=="number"||Number.isNaN(X.length))return eZ(0);return rJ(X)}if(X.type==="Buffer"&&Array.isArray(X.data))return rJ(X.data)}function XY(X){if(X>=KU)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+KU.toString(16)+" bytes");return X|0}function GG(X,Z){if(M0.isBuffer(X))return X.length;if(ArrayBuffer.isView(X)||lZ(X,ArrayBuffer))return X.byteLength;if(typeof X!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof X);let U=X.length,Q=arguments.length>2&&arguments[2]===!0;if(!Q&&U===0)return 0;let G=!1;for(;;)switch(Z){case"ascii":case"latin1":case"binary":return U;case"utf8":case"utf-8":return tJ(X).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U*2;case"hex":return U>>>1;case"base64":return DG(X).length;default:if(G)return Q?-1:tJ(X).length;Z=(""+Z).toLowerCase(),G=!0}}function eO(X,Z,U){let Q=!1;if(Z===void 0||Z<0)Z=0;if(Z>this.length)return"";if(U===void 0||U>this.length)U=this.length;if(U<=0)return"";if(U>>>=0,Z>>>=0,U<=Z)return"";if(!X)X="utf8";while(!0)switch(X){case"hex":return WH(this,Z,U);case"utf8":case"utf-8":return WG(this,Z,U);case"ascii":return GH(this,Z,U);case"latin1":case"binary":return VH(this,Z,U);case"base64":return YH(this,Z,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return OH(this,Z,U);default:if(Q)throw TypeError("Unknown encoding: "+X);X=(X+"").toLowerCase(),Q=!0}}function LQ(X,Z,U){let Q=X[Z];X[Z]=X[U],X[U]=Q}function VG(X,Z,U,Q,G){if(X.length===0)return-1;if(typeof U==="string")Q=U,U=0;else if(U>2147483647)U=2147483647;else if(U<-2147483648)U=-2147483648;if(U=+U,Number.isNaN(U))U=G?0:X.length-1;if(U<0)U=X.length+U;if(U>=X.length)if(G)return-1;else U=X.length-1;else if(U<0)if(G)U=0;else return-1;if(typeof Z==="string")Z=M0.from(Z,Q);if(M0.isBuffer(Z)){if(Z.length===0)return-1;return e$(X,Z,U,Q,G)}else if(typeof Z==="number"){if(Z=Z&255,typeof Uint8Array.prototype.indexOf==="function")if(G)return Uint8Array.prototype.indexOf.call(X,Z,U);else return Uint8Array.prototype.lastIndexOf.call(X,Z,U);return e$(X,[Z],U,Q,G)}throw TypeError("val must be string, number or Buffer")}function e$(X,Z,U,Q,G){let O=1,Y=X.length,K=Z.length;if(Q!==void 0){if(Q=String(Q).toLowerCase(),Q==="ucs2"||Q==="ucs-2"||Q==="utf16le"||Q==="utf-16le"){if(X.length<2||Z.length<2)return-1;O=2,Y/=2,K/=2,U/=2}}function A(C,z){if(O===1)return C[z];else return C.readUInt16BE(z*O)}let D;if(G){let C=-1;for(D=U;D<Y;D++)if(A(X,D)===A(Z,C===-1?0:D-C)){if(C===-1)C=D;if(D-C+1===K)return C*O}else{if(C!==-1)D-=D-C;C=-1}}else{if(U+K>Y)U=Y-K;for(D=U;D>=0;D--){let C=!0;for(let z=0;z<K;z++)if(A(X,D+z)!==A(Z,z)){C=!1;break}if(C)return D}}return-1}function XH(X,Z,U,Q){U=Number(U)||0;let G=X.length-U;if(!Q)Q=G;else if(Q=Number(Q),Q>G)Q=G;let O=Z.length;if(Q>O/2)Q=O/2;let Y;for(Y=0;Y<Q;++Y){let K=parseInt(Z.substr(Y*2,2),16);if(Number.isNaN(K))return Y;X[U+Y]=K}return Y}function ZH(X,Z,U,Q){return aU(tJ(Z,X.length-U),X,U,Q)}function QH(X,Z,U,Q){return aU(EH(Z),X,U,Q)}function UH(X,Z,U,Q){return aU(DG(Z),X,U,Q)}function JH(X,Z,U,Q){return aU(zH(Z,X.length-U),X,U,Q)}function YH(X,Z,U){if(Z===0&&U===X.length)return t$(X);else return t$(X.slice(Z,U))}function WG(X,Z,U){U=Math.min(X.length,U);let Q=[],G=Z;while(G<U){let O=X[G],Y=null,K=O>239?4:O>223?3:O>191?2:1;if(G+K<=U){let A,D,C,z;switch(K){case 1:if(O<128)Y=O;break;case 2:if(A=X[G+1],(A&192)===128){if(z=(O&31)<<6|A&63,z>127)Y=z}break;case 3:if(A=X[G+1],D=X[G+2],(A&192)===128&&(D&192)===128){if(z=(O&15)<<12|(A&63)<<6|D&63,z>2047&&(z<55296||z>57343))Y=z}break;case 4:if(A=X[G+1],D=X[G+2],C=X[G+3],(A&192)===128&&(D&192)===128&&(C&192)===128){if(z=(O&15)<<18|(A&63)<<12|(D&63)<<6|C&63,z>65535&&z<1114112)Y=z}}}if(Y===null)Y=65533,K=1;else if(Y>65535)Y-=65536,Q.push(Y>>>10&1023|55296),Y=56320|Y&1023;Q.push(Y),G+=K}return $H(Q)}function $H(X){let Z=X.length;if(Z<=XG)return String.fromCharCode.apply(String,X);let U="",Q=0;while(Q<Z)U+=String.fromCharCode.apply(String,X.slice(Q,Q+=XG));return U}function GH(X,Z,U){let Q="";U=Math.min(X.length,U);for(let G=Z;G<U;++G)Q+=String.fromCharCode(X[G]&127);return Q}function VH(X,Z,U){let Q="";U=Math.min(X.length,U);for(let G=Z;G<U;++G)Q+=String.fromCharCode(X[G]);return Q}function WH(X,Z,U){let Q=X.length;if(!Z||Z<0)Z=0;if(!U||U<0||U>Q)U=Q;let G="";for(let O=Z;O<U;++O)G+=DH[X[O]];return G}function OH(X,Z,U){let Q=X.slice(Z,U),G="";for(let O=0;O<Q.length-1;O+=2)G+=String.fromCharCode(Q[O]+Q[O+1]*256);return G}function ZZ(X,Z,U){if(X%1!==0||X<0)throw RangeError("offset is not uint");if(X+Z>U)throw RangeError("Trying to access beyond buffer length")}function TZ(X,Z,U,Q,G,O){if(!M0.isBuffer(X))throw TypeError('"buffer" argument must be a Buffer instance');if(Z>G||Z<O)throw RangeError('"value" argument is out of bounds');if(U+Q>X.length)throw RangeError("Index out of range")}function OG(X,Z,U,Q,G){zG(Z,Q,G,X,U,7);let O=Number(Z&BigInt(4294967295));X[U++]=O,O=O>>8,X[U++]=O,O=O>>8,X[U++]=O,O=O>>8,X[U++]=O;let Y=Number(Z>>BigInt(32)&BigInt(4294967295));return X[U++]=Y,Y=Y>>8,X[U++]=Y,Y=Y>>8,X[U++]=Y,Y=Y>>8,X[U++]=Y,U}function HG(X,Z,U,Q,G){zG(Z,Q,G,X,U,7);let O=Number(Z&BigInt(4294967295));X[U+7]=O,O=O>>8,X[U+6]=O,O=O>>8,X[U+5]=O,O=O>>8,X[U+4]=O;let Y=Number(Z>>BigInt(32)&BigInt(4294967295));return X[U+3]=Y,Y=Y>>8,X[U+2]=Y,Y=Y>>8,X[U+1]=Y,Y=Y>>8,X[U]=Y,U+8}function FG(X,Z,U,Q,G,O){if(U+Q>X.length)throw RangeError("Index out of range");if(U<0)throw RangeError("Index out of range")}function KG(X,Z,U,Q,G){if(Z=+Z,U=U>>>0,!G)FG(X,Z,U,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return QG(X,Z,U,Q,23,4),U+4}function EG(X,Z,U,Q,G){if(Z=+Z,U=U>>>0,!G)FG(X,Z,U,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return QG(X,Z,U,Q,52,8),U+8}function ZG(X){let Z="",U=X.length,Q=X[0]==="-"?1:0;for(;U>=Q+4;U-=3)Z=`_${X.slice(U-3,U)}${Z}`;return`${X.slice(0,U)}${Z}`}function HH(X,Z,U){if(lQ(Z,"offset"),X[Z]===void 0||X[Z+U]===void 0)EU(Z,X.length-(U+1))}function zG(X,Z,U,Q,G,O){if(X>U||X<Z){let Y=typeof Z==="bigint"?"n":"",K;if(O>3)if(Z===0||Z===BigInt(0))K=`>= 0${Y} and < 2${Y} ** ${(O+1)*8}${Y}`;else K=`>= -(2${Y} ** ${(O+1)*8-1}${Y}) and < 2 ** ${(O+1)*8-1}${Y}`;else K=`>= ${Z}${Y} and <= ${U}${Y}`;throw new sJ("value",K,X)}HH(Q,G,O)}function lQ(X,Z){if(typeof X!=="number")throw new sO(Z,"number",X)}function EU(X,Z,U){if(Math.floor(X)!==X)throw lQ(X,U),new sJ(U||"offset","an integer",X);if(Z<0)throw new nO;throw new sJ(U||"offset",`>= ${U?1:0} and <= ${Z}`,X)}function KH(X){if(X=X.split("=")[0],X=X.trim().replace(FH,""),X.length<2)return"";while(X.length%4!==0)X=X+"=";return X}function tJ(X,Z){Z=Z||1/0;let U,Q=X.length,G=null,O=[];for(let Y=0;Y<Q;++Y){if(U=X.charCodeAt(Y),U>55295&&U<57344){if(!G){if(U>56319){if((Z-=3)>-1)O.push(239,191,189);continue}else if(Y+1===Q){if((Z-=3)>-1)O.push(239,191,189);continue}G=U;continue}if(U<56320){if((Z-=3)>-1)O.push(239,191,189);G=U;continue}U=(G-55296<<10|U-56320)+65536}else if(G){if((Z-=3)>-1)O.push(239,191,189)}if(G=null,U<128){if((Z-=1)<0)break;O.push(U)}else if(U<2048){if((Z-=2)<0)break;O.push(U>>6|192,U&63|128)}else if(U<65536){if((Z-=3)<0)break;O.push(U>>12|224,U>>6&63|128,U&63|128)}else if(U<1114112){if((Z-=4)<0)break;O.push(U>>18|240,U>>12&63|128,U>>6&63|128,U&63|128)}else throw Error("Invalid code point")}return O}function EH(X){let Z=[];for(let U=0;U<X.length;++U)Z.push(X.charCodeAt(U)&255);return Z}function zH(X,Z){let U,Q,G,O=[];for(let Y=0;Y<X.length;++Y){if((Z-=2)<0)break;U=X.charCodeAt(Y),Q=U>>8,G=U%256,O.push(G),O.push(Q)}return O}function DG(X){return pO(KH(X))}function aU(X,Z,U,Q){let G;for(G=0;G<Q;++G){if(G+U>=Z.length||G>=X.length)break;Z[G+U]=X[G]}return G}function lZ(X,Z){return X instanceof Z||X!=null&&X.constructor!=null&&X.constructor.name!=null&&X.constructor.name===Z.name}function OQ(X){return typeof BigInt>"u"?qH:X}function qH(){throw Error("BigInt not supported")}function ZY(X){return()=>{throw Error(X+" is not implemented for node:buffer browser polyfill")}}var dZ,NZ,nJ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",SQ,a$,i$,UG=50,KU=2147483647,JG=536870888,bO,dO,lO,mO,oO,nO,sO,sJ,XG=4096,FH,DH,MH,CH,AH=(X)=>{for(let Z of X)if(Z.charCodeAt(0)>127)return!1;return!0},TH,RH;var UZ=fU(()=>{dZ=[],NZ=[];for(SQ=0,a$=nJ.length;SQ<a$;++SQ)dZ[SQ]=nJ[SQ],NZ[nJ.charCodeAt(SQ)]=SQ;NZ[45]=62;NZ[95]=63;i$=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,bO=globalThis.btoa,dO=globalThis.atob,lO=globalThis.File,mO=globalThis.Blob,oO={MAX_LENGTH:KU,MAX_STRING_LENGTH:JG};nO=iJ("ERR_BUFFER_OUT_OF_BOUNDS",function(X){if(X)return`${X} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),sO=iJ("ERR_INVALID_ARG_TYPE",function(X,Z){return`The "${X}" argument must be of type number. Received type ${typeof Z}`},TypeError),sJ=iJ("ERR_OUT_OF_RANGE",function(X,Z,U){let Q=`The value of "${X}" is out of range.`,G=U;if(Number.isInteger(U)&&Math.abs(U)>4294967296)G=ZG(String(U));else if(typeof U==="bigint"){if(G=String(U),U>BigInt(2)**BigInt(32)||U<-(BigInt(2)**BigInt(32)))G=ZG(G);G+="n"}return Q+=` It must be ${Z}. Received ${G}`,Q},RangeError);Object.defineProperty(M0.prototype,"parent",{enumerable:!0,get:function(){if(!M0.isBuffer(this))return;return this.buffer}});Object.defineProperty(M0.prototype,"offset",{enumerable:!0,get:function(){if(!M0.isBuffer(this))return;return this.byteOffset}});M0.poolSize=8192;M0.from=function(X,Z,U){return YG(X,Z,U)};Object.setPrototypeOf(M0.prototype,Uint8Array.prototype);Object.setPrototypeOf(M0,Uint8Array);M0.alloc=function(X,Z,U){return rO(X,Z,U)};M0.allocUnsafe=function(X){return eJ(X)};M0.allocUnsafeSlow=function(X){return eJ(X)};M0.isBuffer=function(X){return X!=null&&X._isBuffer===!0&&X!==M0.prototype};M0.compare=function(X,Z){if(lZ(X,Uint8Array))X=M0.from(X,X.offset,X.byteLength);if(lZ(Z,Uint8Array))Z=M0.from(Z,Z.offset,Z.byteLength);if(!M0.isBuffer(X)||!M0.isBuffer(Z))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(X===Z)return 0;let U=X.length,Q=Z.length;for(let G=0,O=Math.min(U,Q);G<O;++G)if(X[G]!==Z[G]){U=X[G],Q=Z[G];break}if(U<Q)return-1;if(Q<U)return 1;return 0};M0.isEncoding=function(X){switch(String(X).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}};M0.concat=function(X,Z){if(!Array.isArray(X))throw TypeError('"list" argument must be an Array of Buffers');if(X.length===0)return M0.alloc(0);let U;if(Z===void 0){Z=0;for(U=0;U<X.length;++U)Z+=X[U].length}let Q=M0.allocUnsafe(Z),G=0;for(U=0;U<X.length;++U){let O=X[U];if(lZ(O,Uint8Array))if(G+O.length>Q.length){if(!M0.isBuffer(O))O=M0.from(O);O.copy(Q,G)}else Uint8Array.prototype.set.call(Q,O,G);else if(!M0.isBuffer(O))throw TypeError('"list" argument must be an Array of Buffers');else O.copy(Q,G);G+=O.length}return Q};M0.byteLength=GG;M0.prototype._isBuffer=!0;M0.prototype.swap16=function(){let X=this.length;if(X%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let Z=0;Z<X;Z+=2)LQ(this,Z,Z+1);return this};M0.prototype.swap32=function(){let X=this.length;if(X%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let Z=0;Z<X;Z+=4)LQ(this,Z,Z+3),LQ(this,Z+1,Z+2);return this};M0.prototype.swap64=function(){let X=this.length;if(X%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let Z=0;Z<X;Z+=8)LQ(this,Z,Z+7),LQ(this,Z+1,Z+6),LQ(this,Z+2,Z+5),LQ(this,Z+3,Z+4);return this};M0.prototype.toString=function(){let X=this.length;if(X===0)return"";if(arguments.length===0)return WG(this,0,X);return eO.apply(this,arguments)};M0.prototype.toLocaleString=M0.prototype.toString;M0.prototype.equals=function(X){if(!M0.isBuffer(X))throw TypeError("Argument must be a Buffer");if(this===X)return!0;return M0.compare(this,X)===0};M0.prototype.inspect=function(){let X="",Z=UG;if(X=this.toString("hex",0,Z).replace(/(.{2})/g,"$1 ").trim(),this.length>Z)X+=" ... ";return"<Buffer "+X+">"};if(i$)M0.prototype[i$]=M0.prototype.inspect;M0.prototype.compare=function(X,Z,U,Q,G){if(lZ(X,Uint8Array))X=M0.from(X,X.offset,X.byteLength);if(!M0.isBuffer(X))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof X);if(Z===void 0)Z=0;if(U===void 0)U=X?X.length:0;if(Q===void 0)Q=0;if(G===void 0)G=this.length;if(Z<0||U>X.length||Q<0||G>this.length)throw RangeError("out of range index");if(Q>=G&&Z>=U)return 0;if(Q>=G)return-1;if(Z>=U)return 1;if(Z>>>=0,U>>>=0,Q>>>=0,G>>>=0,this===X)return 0;let O=G-Q,Y=U-Z,K=Math.min(O,Y),A=this.slice(Q,G),D=X.slice(Z,U);for(let C=0;C<K;++C)if(A[C]!==D[C]){O=A[C],Y=D[C];break}if(O<Y)return-1;if(Y<O)return 1;return 0};M0.prototype.includes=function(X,Z,U){return this.indexOf(X,Z,U)!==-1};M0.prototype.indexOf=function(X,Z,U){return VG(this,X,Z,U,!0)};M0.prototype.lastIndexOf=function(X,Z,U){return VG(this,X,Z,U,!1)};M0.prototype.write=function(X,Z,U,Q){if(Z===void 0)Q="utf8",U=this.length,Z=0;else if(U===void 0&&typeof Z==="string")Q=Z,U=this.length,Z=0;else if(isFinite(Z))if(Z=Z>>>0,isFinite(U)){if(U=U>>>0,Q===void 0)Q="utf8"}else Q=U,U=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let G=this.length-Z;if(U===void 0||U>G)U=G;if(X.length>0&&(U<0||Z<0)||Z>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!Q)Q="utf8";let O=!1;for(;;)switch(Q){case"hex":return XH(this,X,Z,U);case"utf8":case"utf-8":return ZH(this,X,Z,U);case"ascii":case"latin1":case"binary":return QH(this,X,Z,U);case"base64":return UH(this,X,Z,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return JH(this,X,Z,U);default:if(O)throw TypeError("Unknown encoding: "+Q);Q=(""+Q).toLowerCase(),O=!0}};M0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};M0.prototype.slice=function(X,Z){let U=this.length;if(X=~~X,Z=Z===void 0?U:~~Z,X<0){if(X+=U,X<0)X=0}else if(X>U)X=U;if(Z<0){if(Z+=U,Z<0)Z=0}else if(Z>U)Z=U;if(Z<X)Z=X;let Q=this.subarray(X,Z);return Object.setPrototypeOf(Q,M0.prototype),Q};M0.prototype.readUintLE=M0.prototype.readUIntLE=function(X,Z,U){if(X=X>>>0,Z=Z>>>0,!U)ZZ(X,Z,this.length);let Q=this[X],G=1,O=0;while(++O<Z&&(G*=256))Q+=this[X+O]*G;return Q};M0.prototype.readUintBE=M0.prototype.readUIntBE=function(X,Z,U){if(X=X>>>0,Z=Z>>>0,!U)ZZ(X,Z,this.length);let Q=this[X+--Z],G=1;while(Z>0&&(G*=256))Q+=this[X+--Z]*G;return Q};M0.prototype.readUint8=M0.prototype.readUInt8=function(X,Z){if(X=X>>>0,!Z)ZZ(X,1,this.length);return this[X]};M0.prototype.readUint16LE=M0.prototype.readUInt16LE=function(X,Z){if(X=X>>>0,!Z)ZZ(X,2,this.length);return this[X]|this[X+1]<<8};M0.prototype.readUint16BE=M0.prototype.readUInt16BE=function(X,Z){if(X=X>>>0,!Z)ZZ(X,2,this.length);return this[X]<<8|this[X+1]};M0.prototype.readUint32LE=M0.prototype.readUInt32LE=function(X,Z){if(X=X>>>0,!Z)ZZ(X,4,this.length);return(this[X]|this[X+1]<<8|this[X+2]<<16)+this[X+3]*16777216};M0.prototype.readUint32BE=M0.prototype.readUInt32BE=function(X,Z){if(X=X>>>0,!Z)ZZ(X,4,this.length);return this[X]*16777216+(this[X+1]<<16|this[X+2]<<8|this[X+3])};M0.prototype.readBigUInt64LE=OQ(function(X){X=X>>>0,lQ(X,"offset");let Z=this[X],U=this[X+7];if(Z===void 0||U===void 0)EU(X,this.length-8);let Q=Z+this[++X]*256+this[++X]*65536+this[++X]*16777216,G=this[++X]+this[++X]*256+this[++X]*65536+U*16777216;return BigInt(Q)+(BigInt(G)<<BigInt(32))});M0.prototype.readBigUInt64BE=OQ(function(X){X=X>>>0,lQ(X,"offset");let Z=this[X],U=this[X+7];if(Z===void 0||U===void 0)EU(X,this.length-8);let Q=Z*16777216+this[++X]*65536+this[++X]*256+this[++X],G=this[++X]*16777216+this[++X]*65536+this[++X]*256+U;return(BigInt(Q)<<BigInt(32))+BigInt(G)});M0.prototype.readIntLE=function(X,Z,U){if(X=X>>>0,Z=Z>>>0,!U)ZZ(X,Z,this.length);let Q=this[X],G=1,O=0;while(++O<Z&&(G*=256))Q+=this[X+O]*G;if(G*=128,Q>=G)Q-=Math.pow(2,8*Z);return Q};M0.prototype.readIntBE=function(X,Z,U){if(X=X>>>0,Z=Z>>>0,!U)ZZ(X,Z,this.length);let Q=Z,G=1,O=this[X+--Q];while(Q>0&&(G*=256))O+=this[X+--Q]*G;if(G*=128,O>=G)O-=Math.pow(2,8*Z);return O};M0.prototype.readInt8=function(X,Z){if(X=X>>>0,!Z)ZZ(X,1,this.length);if(!(this[X]&128))return this[X];return(255-this[X]+1)*-1};M0.prototype.readInt16LE=function(X,Z){if(X=X>>>0,!Z)ZZ(X,2,this.length);let U=this[X]|this[X+1]<<8;return U&32768?U|4294901760:U};M0.prototype.readInt16BE=function(X,Z){if(X=X>>>0,!Z)ZZ(X,2,this.length);let U=this[X+1]|this[X]<<8;return U&32768?U|4294901760:U};M0.prototype.readInt32LE=function(X,Z){if(X=X>>>0,!Z)ZZ(X,4,this.length);return this[X]|this[X+1]<<8|this[X+2]<<16|this[X+3]<<24};M0.prototype.readInt32BE=function(X,Z){if(X=X>>>0,!Z)ZZ(X,4,this.length);return this[X]<<24|this[X+1]<<16|this[X+2]<<8|this[X+3]};M0.prototype.readBigInt64LE=OQ(function(X){X=X>>>0,lQ(X,"offset");let Z=this[X],U=this[X+7];if(Z===void 0||U===void 0)EU(X,this.length-8);let Q=this[X+4]+this[X+5]*256+this[X+6]*65536+(U<<24);return(BigInt(Q)<<BigInt(32))+BigInt(Z+this[++X]*256+this[++X]*65536+this[++X]*16777216)});M0.prototype.readBigInt64BE=OQ(function(X){X=X>>>0,lQ(X,"offset");let Z=this[X],U=this[X+7];if(Z===void 0||U===void 0)EU(X,this.length-8);let Q=(Z<<24)+this[++X]*65536+this[++X]*256+this[++X];return(BigInt(Q)<<BigInt(32))+BigInt(this[++X]*16777216+this[++X]*65536+this[++X]*256+U)});M0.prototype.readFloatLE=function(X,Z){if(X=X>>>0,!Z)ZZ(X,4,this.length);return rU(this,X,!0,23,4)};M0.prototype.readFloatBE=function(X,Z){if(X=X>>>0,!Z)ZZ(X,4,this.length);return rU(this,X,!1,23,4)};M0.prototype.readDoubleLE=function(X,Z){if(X=X>>>0,!Z)ZZ(X,8,this.length);return rU(this,X,!0,52,8)};M0.prototype.readDoubleBE=function(X,Z){if(X=X>>>0,!Z)ZZ(X,8,this.length);return rU(this,X,!1,52,8)};M0.prototype.writeUintLE=M0.prototype.writeUIntLE=function(X,Z,U,Q){if(X=+X,Z=Z>>>0,U=U>>>0,!Q){let Y=Math.pow(2,8*U)-1;TZ(this,X,Z,U,Y,0)}let G=1,O=0;this[Z]=X&255;while(++O<U&&(G*=256))this[Z+O]=X/G&255;return Z+U};M0.prototype.writeUintBE=M0.prototype.writeUIntBE=function(X,Z,U,Q){if(X=+X,Z=Z>>>0,U=U>>>0,!Q){let Y=Math.pow(2,8*U)-1;TZ(this,X,Z,U,Y,0)}let G=U-1,O=1;this[Z+G]=X&255;while(--G>=0&&(O*=256))this[Z+G]=X/O&255;return Z+U};M0.prototype.writeUint8=M0.prototype.writeUInt8=function(X,Z,U){if(X=+X,Z=Z>>>0,!U)TZ(this,X,Z,1,255,0);return this[Z]=X&255,Z+1};M0.prototype.writeUint16LE=M0.prototype.writeUInt16LE=function(X,Z,U){if(X=+X,Z=Z>>>0,!U)TZ(this,X,Z,2,65535,0);return this[Z]=X&255,this[Z+1]=X>>>8,Z+2};M0.prototype.writeUint16BE=M0.prototype.writeUInt16BE=function(X,Z,U){if(X=+X,Z=Z>>>0,!U)TZ(this,X,Z,2,65535,0);return this[Z]=X>>>8,this[Z+1]=X&255,Z+2};M0.prototype.writeUint32LE=M0.prototype.writeUInt32LE=function(X,Z,U){if(X=+X,Z=Z>>>0,!U)TZ(this,X,Z,4,4294967295,0);return this[Z+3]=X>>>24,this[Z+2]=X>>>16,this[Z+1]=X>>>8,this[Z]=X&255,Z+4};M0.prototype.writeUint32BE=M0.prototype.writeUInt32BE=function(X,Z,U){if(X=+X,Z=Z>>>0,!U)TZ(this,X,Z,4,4294967295,0);return this[Z]=X>>>24,this[Z+1]=X>>>16,this[Z+2]=X>>>8,this[Z+3]=X&255,Z+4};M0.prototype.writeBigUInt64LE=OQ(function(X,Z=0){return OG(this,X,Z,BigInt(0),BigInt("0xffffffffffffffff"))});M0.prototype.writeBigUInt64BE=OQ(function(X,Z=0){return HG(this,X,Z,BigInt(0),BigInt("0xffffffffffffffff"))});M0.prototype.writeIntLE=function(X,Z,U,Q){if(X=+X,Z=Z>>>0,!Q){let K=Math.pow(2,8*U-1);TZ(this,X,Z,U,K-1,-K)}let G=0,O=1,Y=0;this[Z]=X&255;while(++G<U&&(O*=256)){if(X<0&&Y===0&&this[Z+G-1]!==0)Y=1;this[Z+G]=(X/O>>0)-Y&255}return Z+U};M0.prototype.writeIntBE=function(X,Z,U,Q){if(X=+X,Z=Z>>>0,!Q){let K=Math.pow(2,8*U-1);TZ(this,X,Z,U,K-1,-K)}let G=U-1,O=1,Y=0;this[Z+G]=X&255;while(--G>=0&&(O*=256)){if(X<0&&Y===0&&this[Z+G+1]!==0)Y=1;this[Z+G]=(X/O>>0)-Y&255}return Z+U};M0.prototype.writeInt8=function(X,Z,U){if(X=+X,Z=Z>>>0,!U)TZ(this,X,Z,1,127,-128);if(X<0)X=255+X+1;return this[Z]=X&255,Z+1};M0.prototype.writeInt16LE=function(X,Z,U){if(X=+X,Z=Z>>>0,!U)TZ(this,X,Z,2,32767,-32768);return this[Z]=X&255,this[Z+1]=X>>>8,Z+2};M0.prototype.writeInt16BE=function(X,Z,U){if(X=+X,Z=Z>>>0,!U)TZ(this,X,Z,2,32767,-32768);return this[Z]=X>>>8,this[Z+1]=X&255,Z+2};M0.prototype.writeInt32LE=function(X,Z,U){if(X=+X,Z=Z>>>0,!U)TZ(this,X,Z,4,2147483647,-2147483648);return this[Z]=X&255,this[Z+1]=X>>>8,this[Z+2]=X>>>16,this[Z+3]=X>>>24,Z+4};M0.prototype.writeInt32BE=function(X,Z,U){if(X=+X,Z=Z>>>0,!U)TZ(this,X,Z,4,2147483647,-2147483648);if(X<0)X=4294967295+X+1;return this[Z]=X>>>24,this[Z+1]=X>>>16,this[Z+2]=X>>>8,this[Z+3]=X&255,Z+4};M0.prototype.writeBigInt64LE=OQ(function(X,Z=0){return OG(this,X,Z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});M0.prototype.writeBigInt64BE=OQ(function(X,Z=0){return HG(this,X,Z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});M0.prototype.writeFloatLE=function(X,Z,U){return KG(this,X,Z,!0,U)};M0.prototype.writeFloatBE=function(X,Z,U){return KG(this,X,Z,!1,U)};M0.prototype.writeDoubleLE=function(X,Z,U){return EG(this,X,Z,!0,U)};M0.prototype.writeDoubleBE=function(X,Z,U){return EG(this,X,Z,!1,U)};M0.prototype.copy=function(X,Z,U,Q){if(!M0.isBuffer(X))throw TypeError("argument should be a Buffer");if(!U)U=0;if(!Q&&Q!==0)Q=this.length;if(Z>=X.length)Z=X.length;if(!Z)Z=0;if(Q>0&&Q<U)Q=U;if(Q===U)return 0;if(X.length===0||this.length===0)return 0;if(Z<0)throw RangeError("targetStart out of bounds");if(U<0||U>=this.length)throw RangeError("Index out of range");if(Q<0)throw RangeError("sourceEnd out of bounds");if(Q>this.length)Q=this.length;if(X.length-Z<Q-U)Q=X.length-Z+U;let G=Q-U;if(this===X&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(Z,U,Q);else Uint8Array.prototype.set.call(X,this.subarray(U,Q),Z);return G};M0.prototype.fill=function(X,Z,U,Q){if(typeof X==="string"){if(typeof Z==="string")Q=Z,Z=0,U=this.length;else if(typeof U==="string")Q=U,U=this.length;if(Q!==void 0&&typeof Q!=="string")throw TypeError("encoding must be a string");if(typeof Q==="string"&&!M0.isEncoding(Q))throw TypeError("Unknown encoding: "+Q);if(X.length===1){let O=X.charCodeAt(0);if(Q==="utf8"&&O<128||Q==="latin1")X=O}}else if(typeof X==="number")X=X&255;else if(typeof X==="boolean")X=Number(X);if(Z<0||this.length<Z||this.length<U)throw RangeError("Out of range index");if(U<=Z)return this;if(Z=Z>>>0,U=U===void 0?this.length:U>>>0,!X)X=0;let G;if(typeof X==="number")for(G=Z;G<U;++G)this[G]=X;else{let O=M0.isBuffer(X)?X:M0.from(X,Q),Y=O.length;if(Y===0)throw TypeError('The value "'+X+'" is invalid for argument "value"');for(G=0;G<U-Z;++G)this[G+Z]=O[G%Y]}return this};FH=/[^+/0-9A-Za-z-_]/g;DH=function(){let X=Array(256);for(let Z=0;Z<16;++Z){let U=Z*16;for(let Q=0;Q<16;++Q)X[U+Q]="0123456789abcdef"[Z]+"0123456789abcdef"[Q]}return X}();MH=ZY("resolveObjectURL"),CH=ZY("isUtf8"),TH=ZY("transcode"),RH=M0});var IG={};yU(IG,{types:()=>wH,promisify:()=>RG,log:()=>CG,isUndefined:()=>mQ,isSymbol:()=>_H,isString:()=>QJ,isRegExp:()=>tU,isPrimitive:()=>yH,isObject:()=>oQ,isNumber:()=>MG,isNullOrUndefined:()=>vH,isNull:()=>ZJ,isFunction:()=>eU,isError:()=>iU,isDate:()=>YY,isBuffer:()=>fH,isBoolean:()=>GY,isArray:()=>qG,inspect:()=>IQ,inherits:()=>AG,format:()=>$Y,deprecate:()=>SH,default:()=>pH,debuglog:()=>LH,callbackifyOnRejected:()=>OY,callbackify:()=>PG,_extend:()=>WY,TextEncoder:()=>SG,TextDecoder:()=>LG});function $Y(X,...Z){if(!QJ(X)){var U=[X];for(var Q=0;Q<Z.length;Q++)U.push(IQ(Z[Q]));return U.join(" ")}var Q=0,G=Z.length,O=String(X).replace(PH,function(K){if(K==="%%")return"%";if(Q>=G)return K;switch(K){case"%s":return String(Z[Q++]);case"%d":return Number(Z[Q++]);case"%j":try{return JSON.stringify(Z[Q++])}catch(A){return"[Circular]"}default:return K}});for(var Y=Z[Q];Q<G;Y=Z[++Q])if(ZJ(Y)||!oQ(Y))O+=" "+Y;else O+=" "+IQ(Y);return O}function SH(X,Z){if(typeof process>"u"||process?.noDeprecation===!0)return X;var U=!1;function Q(...G){if(!U){if(process.throwDeprecation)throw Error(Z);else if(process.traceDeprecation)console.trace(Z);else console.error(Z);U=!0}return X.apply(this,...G)}return Q}function IH(X,Z){var U=IQ.styles[Z];if(U)return"\x1B["+IQ.colors[U][0]+"m"+X+"\x1B["+IQ.colors[U][1]+"m";else return X}function jH(X,Z){return X}function NH(X){var Z={};return X.forEach(function(U,Q){Z[U]=!0}),Z}function XJ(X,Z,U){if(X.customInspect&&Z&&eU(Z.inspect)&&Z.inspect!==IQ&&!(Z.constructor&&Z.constructor.prototype===Z)){var Q=Z.inspect(U,X);if(!QJ(Q))Q=XJ(X,Q,U);return Q}var G=BH(X,Z);if(G)return G;var O=Object.keys(Z),Y=NH(O);if(X.showHidden)O=Object.getOwnPropertyNames(Z);if(iU(Z)&&(O.indexOf("message")>=0||O.indexOf("description")>=0))return QY(Z);if(O.length===0){if(eU(Z)){var K=Z.name?": "+Z.name:"";return X.stylize("[Function"+K+"]","special")}if(tU(Z))return X.stylize(RegExp.prototype.toString.call(Z),"regexp");if(YY(Z))return X.stylize(Date.prototype.toString.call(Z),"date");if(iU(Z))return QY(Z)}var A="",D=!1,C=["{","}"];if(qG(Z))D=!0,C=["[","]"];if(eU(Z)){var z=Z.name?": "+Z.name:"";A=" [Function"+z+"]"}if(tU(Z))A=" "+RegExp.prototype.toString.call(Z);if(YY(Z))A=" "+Date.prototype.toUTCString.call(Z);if(iU(Z))A=" "+QY(Z);if(O.length===0&&(!D||Z.length==0))return C[0]+A+C[1];if(U<0)if(tU(Z))return X.stylize(RegExp.prototype.toString.call(Z),"regexp");else return X.stylize("[Object]","special");X.seen.push(Z);var R;if(D)R=kH(X,Z,U,Y,O);else R=O.map(function(S){return JY(X,Z,U,Y,S,D)});return X.seen.pop(),xH(R,A,C)}function BH(X,Z){if(mQ(Z))return X.stylize("undefined","undefined");if(QJ(Z)){var U="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return X.stylize(U,"string")}if(MG(Z))return X.stylize(""+Z,"number");if(GY(Z))return X.stylize(""+Z,"boolean");if(ZJ(Z))return X.stylize("null","null")}function QY(X){return"["+Error.prototype.toString.call(X)+"]"}function kH(X,Z,U,Q,G){var O=[];for(var Y=0,K=Z.length;Y<K;++Y)if(TG(Z,String(Y)))O.push(JY(X,Z,U,Q,String(Y),!0));else O.push("");return G.forEach(function(A){if(!A.match(/^\d+$/))O.push(JY(X,Z,U,Q,A,!0))}),O}function JY(X,Z,U,Q,G,O){var Y,K,A;if(A=Object.getOwnPropertyDescriptor(Z,G)||{value:Z[G]},A.get)if(A.set)K=X.stylize("[Getter/Setter]","special");else K=X.stylize("[Getter]","special");else if(A.set)K=X.stylize("[Setter]","special");if(!TG(Q,G))Y="["+G+"]";if(!K)if(X.seen.indexOf(A.value)<0){if(ZJ(U))K=XJ(X,A.value,null);else K=XJ(X,A.value,U-1);if(K.indexOf(`
|
|
15
|
+
`)>-1)if(O)K=K.split(`
|
|
16
|
+
`).map(function(D){return" "+D}).join(`
|
|
17
|
+
`).slice(2);else K=`
|
|
18
|
+
`+K.split(`
|
|
19
|
+
`).map(function(D){return" "+D}).join(`
|
|
20
|
+
`)}else K=X.stylize("[Circular]","special");if(mQ(Y)){if(O&&G.match(/^\d+$/))return K;if(Y=JSON.stringify(""+G),Y.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))Y=Y.slice(1,-1),Y=X.stylize(Y,"name");else Y=Y.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Y=X.stylize(Y,"string")}return Y+": "+K}function xH(X,Z,U){var Q=0,G=X.reduce(function(O,Y){if(Q++,Y.indexOf(`
|
|
21
|
+
`)>=0)Q++;return O+Y.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(G>60)return U[0]+(Z===""?"":Z+`
|
|
22
|
+
`)+" "+X.join(`,
|
|
23
|
+
`)+" "+U[1];return U[0]+Z+" "+X.join(", ")+" "+U[1]}function qG(X){return Array.isArray(X)}function GY(X){return typeof X==="boolean"}function ZJ(X){return X===null}function vH(X){return X==null}function MG(X){return typeof X==="number"}function QJ(X){return typeof X==="string"}function _H(X){return typeof X==="symbol"}function mQ(X){return X===void 0}function tU(X){return oQ(X)&&VY(X)==="[object RegExp]"}function oQ(X){return typeof X==="object"&&X!==null}function YY(X){return oQ(X)&&VY(X)==="[object Date]"}function iU(X){return oQ(X)&&(VY(X)==="[object Error]"||X instanceof Error)}function eU(X){return typeof X==="function"}function yH(X){return X===null||typeof X==="boolean"||typeof X==="number"||typeof X==="string"||typeof X==="symbol"||typeof X>"u"}function fH(X){return X instanceof Buffer}function VY(X){return Object.prototype.toString.call(X)}function UY(X){return X<10?"0"+X.toString(10):X.toString(10)}function hH(){var X=new Date,Z=[UY(X.getHours()),UY(X.getMinutes()),UY(X.getSeconds())].join(":");return[X.getDate(),gH[X.getMonth()],Z].join(" ")}function CG(...X){console.log("%s - %s",hH(),$Y.apply(null,X))}function AG(X,Z){if(Z)X.super_=Z,X.prototype=Object.create(Z.prototype,{constructor:{value:X,enumerable:!1,writable:!0,configurable:!0}})}function WY(X,Z){if(!Z||!oQ(Z))return X;var U=Object.keys(Z),Q=U.length;while(Q--)X[U[Q]]=Z[U[Q]];return X}function TG(X,Z){return Object.prototype.hasOwnProperty.call(X,Z)}function OY(X,Z){if(!X){var U=Error("Promise was rejected with a falsy value");U.reason=X,X=U}return Z(X)}function PG(X){if(typeof X!=="function")throw TypeError('The "original" argument must be of type Function');function Z(...U){var Q=U.pop();if(typeof Q!=="function")throw TypeError("The last argument must be of type Function");var G=this,O=function(...Y){return Q.apply(G,...Y)};X.apply(this,U).then(function(Y){process.nextTick(O.bind(null,null,Y))},function(Y){process.nextTick(OY.bind(null,Y,O))})}return Object.setPrototypeOf(Z,Object.getPrototypeOf(X)),Object.defineProperties(Z,Object.getOwnPropertyDescriptors(X)),Z}var PH,LH,IQ,wH=()=>{},gH,RG,SG,LG,pH;var jG=fU(()=>{PH=/%[sdj%]/g;LH=((X={},Z={},U)=>((U=typeof process<"u"&&!1)&&(U=U.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),Z=new RegExp("^"+U+"$","i"),(Q)=>{if(Q=Q.toUpperCase(),!X[Q])if(Z.test(Q))X[Q]=function(...G){console.error("%s: %s",Q,pid,$Y.apply(null,...G))};else X[Q]=function(){};return X[Q]}))(),IQ=((X)=>(X.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]},X.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},X.custom=Symbol.for("nodejs.util.inspect.custom"),X))(function(X,Z,...U){var Q={seen:[],stylize:jH};if(U.length>=1)Q.depth=U[0];if(U.length>=2)Q.colors=U[1];if(GY(Z))Q.showHidden=Z;else if(Z)WY(Q,Z);if(mQ(Q.showHidden))Q.showHidden=!1;if(mQ(Q.depth))Q.depth=2;if(mQ(Q.colors))Q.colors=!1;if(Q.colors)Q.stylize=IH;return XJ(Q,X,Q.depth)});gH=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];RG=((X)=>(X.custom=Symbol.for("nodejs.util.promisify.custom"),X))(function(X){if(typeof X!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&X[kCustomPromisifiedSymbol]){var Z=X[kCustomPromisifiedSymbol];if(typeof Z!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(Z,kCustomPromisifiedSymbol,{value:Z,enumerable:!1,writable:!1,configurable:!0}),Z}function Z(...U){var Q,G,O=new Promise(function(Y,K){Q=Y,G=K});U.push(function(Y,K){if(Y)G(Y);else Q(K)});try{X.apply(this,U)}catch(Y){G(Y)}return O}if(Object.setPrototypeOf(Z,Object.getPrototypeOf(X)),kCustomPromisifiedSymbol)Object.defineProperty(Z,kCustomPromisifiedSymbol,{value:Z,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(Z,Object.getOwnPropertyDescriptors(X))});({TextEncoder:SG,TextDecoder:LG}=globalThis),pH={TextEncoder:SG,TextDecoder:LG,promisify:RG,log:CG,inherits:AG,_extend:WY,callbackifyOnRejected:OY,callbackify:PG}});var DU={};yU(DU,{setMaxListeners:()=>hG,once:()=>fG,listenerCount:()=>pG,init:()=>HQ,getMaxListeners:()=>uG,getEventListeners:()=>gG,default:()=>sH,captureRejectionSymbol:()=>wG,addAbortListener:()=>bG,EventEmitter:()=>HQ});function vG(X,Z){var{_events:U}=X;if(Z[0]??=Error("Unhandled error."),!U)throw Z[0];var Q=U[xG];if(Q)for(var G of BG.call(Q))G.apply(X,Z);var O=U.error;if(!O)throw Z[0];for(var G of BG.call(O))G.apply(X,Z);return!0}function bH(X,Z,U,Q){Z.then(void 0,function(G){queueMicrotask(()=>dH(X,G,U,Q))})}function dH(X,Z,U,Q){if(typeof X[NG]==="function")X[NG](Z,U,...Q);else try{X[jQ]=!1,X.emit("error",Z)}finally{X[jQ]=!0}}function _G(X,Z,U){U.warned=!0;let Q=Error(`Possible EventEmitter memory leak detected. ${U.length} ${String(Z)} listeners added to [${X.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);Q.name="MaxListenersExceededWarning",Q.emitter=X,Q.type=Z,Q.count=U.length,console.warn(Q)}function yG(X,Z,...U){this.removeListener(X,Z),Z.apply(this,U)}function fG(X,Z,U){var Q=U?.signal;if(cG(Q,"options.signal"),Q?.aborted)throw new HY(void 0,{cause:Q?.reason});let{resolve:G,reject:O,promise:Y}=$newPromiseCapability(Promise),K=(C)=>{if(X.removeListener(Z,A),Q!=null)UJ(Q,"abort",D);O(C)},A=(...C)=>{if(typeof X.removeListener==="function")X.removeListener("error",K);if(Q!=null)UJ(Q,"abort",D);G(C)};if(kG(X,Z,A,{once:!0}),Z!=="error"&&typeof X.once==="function")X.once("error",K);function D(){UJ(X,Z,A),UJ(X,"error",K),O(new HY(void 0,{cause:Q?.reason}))}if(Q!=null)kG(Q,"abort",D,{once:!0});return Y}function gG(X,Z){return X.listeners(Z)}function hG(X,...Z){KY(X,"setMaxListeners",0);var U;if(Z&&(U=Z.length))for(let Q=0;Q<U;Q++)Z[Q].setMaxListeners(X);else NQ=X}function pG(X,Z){return X.listenerCount(Z)}function UJ(X,Z,U,Q){if(typeof X.removeListener==="function")X.removeListener(Z,U);else X.removeEventListener(Z,U,Q)}function kG(X,Z,U,Q){if(typeof X.on==="function")if(Q.once)X.once(Z,U);else X.on(Z,U);else X.addEventListener(Z,U,Q)}function nQ(X,Z,U){let Q=TypeError(`The "${X}" argument must be of type ${Z}. Received ${U}`);return Q.code="ERR_INVALID_ARG_TYPE",Q}function oH(X,Z,U){let Q=RangeError(`The "${X}" argument is out of range. It must be ${Z}. Received ${U}`);return Q.code="ERR_OUT_OF_RANGE",Q}function cG(X,Z){if(X!==void 0&&(X===null||typeof X!=="object"||!("aborted"in X)))throw nQ(Z,"AbortSignal",X)}function KY(X,Z,U,Q){if(typeof X!=="number")throw nQ(Z,"number",X);if(U!=null&&X<U||Q!=null&&X>Q||(U!=null||Q!=null)&&Number.isNaN(X))throw oH(Z,`${U!=null?`>= ${U}`:""}${U!=null&&Q!=null?" && ":""}${Q!=null?`<= ${Q}`:""}`,X)}function zU(X){if(typeof X!=="function")throw TypeError("The listener must be a function")}function nH(X,Z){if(typeof X!=="boolean")throw nQ(Z,"boolean",X)}function uG(X){return X?._maxListeners??NQ}function bG(X,Z){if(X===void 0)throw nQ("signal","AbortSignal",X);if(cG(X,"signal"),typeof Z!=="function")throw nQ("listener","function",Z);let U;if(X.aborted)queueMicrotask(()=>Z());else X.addEventListener("abort",Z,{__proto__:null,once:!0}),U=()=>{X.removeEventListener("abort",Z)};return{__proto__:null,[Symbol.dispose](){U?.()}}}var FY,jQ,xG,cH,uH,NG,wG,BG,NQ=10,HQ=function(X){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[jQ]=X?.captureRejections?Boolean(X?.captureRejections):IX[jQ])this.emit=mH},IX,lH=function(X,...Z){if(X==="error")return vG(this,Z);var{_events:U}=this;if(U===void 0)return!1;var Q=U[X];if(Q===void 0)return!1;let G=Q.length>1?Q.slice():Q;for(let O=0,{length:Y}=G;O<Y;O++){let K=G[O];switch(Z.length){case 0:K.call(this);break;case 1:K.call(this,Z[0]);break;case 2:K.call(this,Z[0],Z[1]);break;case 3:K.call(this,Z[0],Z[1],Z[2]);break;default:K.apply(this,Z);break}}return!0},mH=function(X,...Z){if(X==="error")return vG(this,Z);var{_events:U}=this;if(U===void 0)return!1;var Q=U[X];if(Q===void 0)return!1;let G=Q.length>1?Q.slice():Q;for(let O=0,{length:Y}=G;O<Y;O++){let K=G[O],A;switch(Z.length){case 0:A=K.call(this);break;case 1:A=K.call(this,Z[0]);break;case 2:A=K.call(this,Z[0],Z[1]);break;case 3:A=K.call(this,Z[0],Z[1],Z[2]);break;default:A=K.apply(this,Z);break}if(A!==void 0&&typeof A?.then==="function"&&A.then===Promise.prototype.then)bH(this,A,X,Z)}return!0},HY,sH;var qU=fU(()=>{FY=Symbol.for,jQ=Symbol("kCapture"),xG=FY("events.errorMonitor"),cH=Symbol("events.maxEventTargetListeners"),uH=Symbol("events.maxEventTargetListenersWarned"),NG=FY("nodejs.rejection"),wG=FY("nodejs.rejection"),BG=Array.prototype.slice,IX=HQ.prototype={};IX._events=void 0;IX._eventsCount=0;IX._maxListeners=void 0;IX.setMaxListeners=function(X){return KY(X,"setMaxListeners",0),this._maxListeners=X,this};IX.constructor=HQ;IX.getMaxListeners=function(){return this?._maxListeners??NQ};IX.emit=lH;IX.addListener=function(X,Z){zU(Z);var U=this._events;if(!U)U=this._events={__proto__:null},this._eventsCount=0;else if(U.newListener)this.emit("newListener",X,Z.listener??Z);var Q=U[X];if(!Q)U[X]=[Z],this._eventsCount++;else{Q.push(Z);var G=this._maxListeners??NQ;if(G>0&&Q.length>G&&!Q.warned)_G(this,X,Q)}return this};IX.on=IX.addListener;IX.prependListener=function(X,Z){zU(Z);var U=this._events;if(!U)U=this._events={__proto__:null},this._eventsCount=0;else if(U.newListener)this.emit("newListener",X,Z.listener??Z);var Q=U[X];if(!Q)U[X]=[Z],this._eventsCount++;else{Q.unshift(Z);var G=this._maxListeners??NQ;if(G>0&&Q.length>G&&!Q.warned)_G(this,X,Q)}return this};IX.once=function(X,Z){zU(Z);let U=yG.bind(this,X,Z);return U.listener=Z,this.addListener(X,U),this};IX.prependOnceListener=function(X,Z){zU(Z);let U=yG.bind(this,X,Z);return U.listener=Z,this.prependListener(X,U),this};IX.removeListener=function(X,Z){zU(Z);var{_events:U}=this;if(!U)return this;var Q=U[X];if(!Q)return this;var G=Q.length;let O=-1;for(let Y=G-1;Y>=0;Y--)if(Q[Y]===Z||Q[Y].listener===Z){O=Y;break}if(O<0)return this;if(O===0)Q.shift();else Q.splice(O,1);if(Q.length===0)delete U[X],this._eventsCount--;return this};IX.off=IX.removeListener;IX.removeAllListeners=function(X){var{_events:Z}=this;if(X&&Z){if(Z[X])delete Z[X],this._eventsCount--}else this._events={__proto__:null};return this};IX.listeners=function(X){var{_events:Z}=this;if(!Z)return[];var U=Z[X];if(!U)return[];return U.map((Q)=>Q.listener??Q)};IX.rawListeners=function(X){var{_events:Z}=this;if(!Z)return[];var U=Z[X];if(!U)return[];return U.slice()};IX.listenerCount=function(X){var{_events:Z}=this;if(!Z)return 0;return Z[X]?.length??0};IX.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};IX[jQ]=!1;HY=class HY extends Error{constructor(X="The operation was aborted",Z=void 0){if(Z!==void 0&&typeof Z!=="object")throw nQ("options","Object",Z);super(X,Z);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(HQ,{captureRejections:{get(){return IX[jQ]},set(X){nH(X,"EventEmitter.captureRejections"),IX[jQ]=X},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return NQ},set:(X)=>{KY(X,"defaultMaxListeners",0),NQ=X}},kMaxEventTargetListeners:{value:cH,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:uH,enumerable:!1,configurable:!1,writable:!1}});Object.assign(HQ,{once:fG,getEventListeners:gG,getMaxListeners:uG,setMaxListeners:hG,EventEmitter:HQ,usingDomains:!1,captureRejectionSymbol:wG,errorMonitor:xG,addAbortListener:bG,init:HQ,listenerCount:pG});sH=HQ});var qY=QX((hD,aG)=>{var CX=(X,Z)=>()=>(Z||X((Z={exports:{}}).exports,Z),Z.exports),BX=CX((X,Z)=>{class U extends Error{constructor(Q){if(!Array.isArray(Q))throw TypeError(`Expected input to be an Array, got ${typeof Q}`);let G="";for(let O=0;O<Q.length;O++)G+=` ${Q[O].stack}
|
|
24
|
+
`;super(G);this.name="AggregateError",this.errors=Q}}Z.exports={AggregateError:U,ArrayIsArray(Q){return Array.isArray(Q)},ArrayPrototypeIncludes(Q,G){return Q.includes(G)},ArrayPrototypeIndexOf(Q,G){return Q.indexOf(G)},ArrayPrototypeJoin(Q,G){return Q.join(G)},ArrayPrototypeMap(Q,G){return Q.map(G)},ArrayPrototypePop(Q,G){return Q.pop(G)},ArrayPrototypePush(Q,G){return Q.push(G)},ArrayPrototypeSlice(Q,G,O){return Q.slice(G,O)},Error,FunctionPrototypeCall(Q,G,...O){return Q.call(G,...O)},FunctionPrototypeSymbolHasInstance(Q,G){return Function.prototype[Symbol.hasInstance].call(Q,G)},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(Q,G){return Object.defineProperties(Q,G)},ObjectDefineProperty(Q,G,O){return Object.defineProperty(Q,G,O)},ObjectGetOwnPropertyDescriptor(Q,G){return Object.getOwnPropertyDescriptor(Q,G)},ObjectKeys(Q){return Object.keys(Q)},ObjectSetPrototypeOf(Q,G){return Object.setPrototypeOf(Q,G)},Promise,PromisePrototypeCatch(Q,G){return Q.catch(G)},PromisePrototypeThen(Q,G,O){return Q.then(G,O)},PromiseReject(Q){return Promise.reject(Q)},PromiseResolve(Q){return Promise.resolve(Q)},ReflectApply:Reflect.apply,RegExpPrototypeTest(Q,G){return Q.test(G)},SafeSet:Set,String,StringPrototypeSlice(Q,G,O){return Q.slice(G,O)},StringPrototypeToLowerCase(Q){return Q.toLowerCase()},StringPrototypeToUpperCase(Q){return Q.toUpperCase()},StringPrototypeTrim(Q){return Q.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(Q,G,O){return Q.set(G,O)},Boolean,Uint8Array}}),dG=CX((X,Z)=>{Z.exports={format(U,...Q){return U.replace(/%([sdifj])/g,function(...[G,O]){let Y=Q.shift();if(O==="f")return Y.toFixed(6);else if(O==="j")return JSON.stringify(Y);else if(O==="s"&&typeof Y==="object")return`${Y.constructor!==Object?Y.constructor.name:""} {}`.trim();else return Y.toString()})},inspect(U){switch(typeof U){case"string":if(U.includes("'")){if(!U.includes('"'))return`"${U}"`;else if(!U.includes("`")&&!U.includes("${"))return`\`${U}\``}return`'${U}'`;case"number":if(isNaN(U))return"NaN";else if(Object.is(U,-0))return String(U);return U;case"bigint":return`${String(U)}n`;case"boolean":case"undefined":return String(U);case"object":return"{}"}}}}),DZ=CX((X,Z)=>{var{format:U,inspect:Q}=dG(),{AggregateError:G}=BX(),O=globalThis.AggregateError||G,Y=Symbol("kIsNodeError"),K=["string","function","number","object","Function","Object","boolean","bigint","symbol"],A=/^([A-Z][a-z0-9]*)+$/,D={};function C(B,k){if(!B)throw new D.ERR_INTERNAL_ASSERTION(k)}function z(B){let k="",w=B.length,v=B[0]==="-"?1:0;for(;w>=v+4;w-=3)k=`_${B.slice(w-3,w)}${k}`;return`${B.slice(0,w)}${k}`}function R(B,k,w){if(typeof k==="function")return C(k.length<=w.length,`Code: ${B}; The provided arguments length (${w.length}) does not match the required ones (${k.length}).`),k(...w);let v=(k.match(/%[dfijoOs]/g)||[]).length;if(C(v===w.length,`Code: ${B}; The provided arguments length (${w.length}) does not match the required ones (${v}).`),w.length===0)return k;return U(k,...w)}function S(B,k,w){if(!w)w=Error;class v extends w{constructor(..._){super(R(B,k,_))}toString(){return`${this.name} [${B}]: ${this.message}`}}Object.defineProperties(v.prototype,{name:{value:w.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${B}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),v.prototype.code=B,v.prototype[Y]=!0,D[B]=v}function P(B){let k="__node_internal_"+B.name;return Object.defineProperty(B,"name",{value:k}),B}function N(B,k){if(B&&k&&B!==k){if(Array.isArray(k.errors))return k.errors.push(B),k;let w=new O([k,B],k.message);return w.code=k.code,w}return B||k}class I extends Error{constructor(B="The operation was aborted",k=void 0){if(k!==void 0&&typeof k!=="object")throw new D.ERR_INVALID_ARG_TYPE("options","Object",k);super(B,k);this.code="ABORT_ERR",this.name="AbortError"}}S("ERR_ASSERTION","%s",Error),S("ERR_INVALID_ARG_TYPE",(B,k,w)=>{if(C(typeof B==="string","'name' must be a string"),!Array.isArray(k))k=[k];let v="The ";if(B.endsWith(" argument"))v+=`${B} `;else v+=`"${B}" ${B.includes(".")?"property":"argument"} `;v+="must be ";let _=[],u=[],J0=[];for(let V0 of k)if(C(typeof V0==="string","All expected entries have to be of type string"),K.includes(V0))_.push(V0.toLowerCase());else if(A.test(V0))u.push(V0);else C(V0!=="object",'The value "object" should be written as "Object"'),J0.push(V0);if(u.length>0){let V0=_.indexOf("object");if(V0!==-1)_.splice(_,V0,1),u.push("Object")}if(_.length>0){switch(_.length){case 1:v+=`of type ${_[0]}`;break;case 2:v+=`one of type ${_[0]} or ${_[1]}`;break;default:{let V0=_.pop();v+=`one of type ${_.join(", ")}, or ${V0}`}}if(u.length>0||J0.length>0)v+=" or "}if(u.length>0){switch(u.length){case 1:v+=`an instance of ${u[0]}`;break;case 2:v+=`an instance of ${u[0]} or ${u[1]}`;break;default:{let V0=u.pop();v+=`an instance of ${u.join(", ")}, or ${V0}`}}if(J0.length>0)v+=" or "}switch(J0.length){case 0:break;case 1:if(J0[0].toLowerCase()!==J0[0])v+="an ";v+=`${J0[0]}`;break;case 2:v+=`one of ${J0[0]} or ${J0[1]}`;break;default:{let V0=J0.pop();v+=`one of ${J0.join(", ")}, or ${V0}`}}if(w==null)v+=`. Received ${w}`;else if(typeof w==="function"&&w.name)v+=`. Received function ${w.name}`;else if(typeof w==="object"){var H0;if((H0=w.constructor)!==null&&H0!==void 0&&H0.name)v+=`. Received an instance of ${w.constructor.name}`;else{let V0=Q(w,{depth:-1});v+=`. Received ${V0}`}}else{let V0=Q(w,{colors:!1});if(V0.length>25)V0=`${V0.slice(0,25)}...`;v+=`. Received type ${typeof w} (${V0})`}return v},TypeError),S("ERR_INVALID_ARG_VALUE",(B,k,w="is invalid")=>{let v=Q(k);if(v.length>128)v=v.slice(0,128)+"...";return`The ${B.includes(".")?"property":"argument"} '${B}' ${w}. Received ${v}`},TypeError),S("ERR_INVALID_RETURN_VALUE",(B,k,w)=>{var v;let _=w!==null&&w!==void 0&&(v=w.constructor)!==null&&v!==void 0&&v.name?`instance of ${w.constructor.name}`:`type ${typeof w}`;return`Expected ${B} to be returned from the "${k}" function but got ${_}.`},TypeError),S("ERR_MISSING_ARGS",(...B)=>{C(B.length>0,"At least one arg needs to be specified");let k,w=B.length;switch(B=(Array.isArray(B)?B:[B]).map((v)=>`"${v}"`).join(" or "),w){case 1:k+=`The ${B[0]} argument`;break;case 2:k+=`The ${B[0]} and ${B[1]} arguments`;break;default:{let v=B.pop();k+=`The ${B.join(", ")}, and ${v} arguments`}break}return`${k} must be specified`},TypeError),S("ERR_OUT_OF_RANGE",(B,k,w)=>{C(k,'Missing "range" argument');let v;if(Number.isInteger(w)&&Math.abs(w)>4294967296)v=z(String(w));else if(typeof w==="bigint"){v=String(w);let _=BigInt(2)**BigInt(32);if(w>_||w<-_)v=z(v);v+="n"}else v=Q(w);return`The value of "${B}" is out of range. It must be ${k}. Received ${v}`},RangeError),S("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),S("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),S("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),S("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),S("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),S("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),S("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),S("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),S("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),S("ERR_STREAM_WRITE_AFTER_END","write after end",Error),S("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Z.exports={AbortError:I,aggregateTwoErrors:P(N),hideStackFrames:P,codes:D}}),rH=CX((X,Z)=>{Object.defineProperty(X,"__esModule",{value:!0});var U=new WeakMap,Q=new WeakMap;function G(l){let U0=U.get(l);return console.assert(U0!=null,"'this' is expected an Event object, but got",l),U0}function O(l){if(l.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",l.passiveListener);return}if(!l.event.cancelable)return;if(l.canceled=!0,typeof l.event.preventDefault==="function")l.event.preventDefault()}function Y(l,U0){U.set(this,{eventTarget:l,event:U0,eventPhase:2,currentTarget:l,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:U0.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let J=Object.keys(U0);for(let W=0;W<J.length;++W){let F=J[W];if(!(F in this))Object.defineProperty(this,F,K(F))}}if(Y.prototype={get type(){return G(this).event.type},get target(){return G(this).eventTarget},get currentTarget(){return G(this).currentTarget},composedPath(){let l=G(this).currentTarget;if(l==null)return[];return[l]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return G(this).eventPhase},stopPropagation(){let l=G(this);if(l.stopped=!0,typeof l.event.stopPropagation==="function")l.event.stopPropagation()},stopImmediatePropagation(){let l=G(this);if(l.stopped=!0,l.immediateStopped=!0,typeof l.event.stopImmediatePropagation==="function")l.event.stopImmediatePropagation()},get bubbles(){return Boolean(G(this).event.bubbles)},get cancelable(){return Boolean(G(this).event.cancelable)},preventDefault(){O(G(this))},get defaultPrevented(){return G(this).canceled},get composed(){return Boolean(G(this).event.composed)},get timeStamp(){return G(this).timeStamp},get srcElement(){return G(this).eventTarget},get cancelBubble(){return G(this).stopped},set cancelBubble(l){if(!l)return;let U0=G(this);if(U0.stopped=!0,typeof U0.event.cancelBubble==="boolean")U0.event.cancelBubble=!0},get returnValue(){return!G(this).canceled},set returnValue(l){if(!l)O(G(this))},initEvent(){}},Object.defineProperty(Y.prototype,"constructor",{value:Y,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(Y.prototype,window.Event.prototype),Q.set(window.Event.prototype,Y);function K(l){return{get(){return G(this).event[l]},set(U0){G(this).event[l]=U0},configurable:!0,enumerable:!0}}function A(l){return{value(){let U0=G(this).event;return U0[l].apply(U0,arguments)},configurable:!0,enumerable:!0}}function D(l,U0){let J=Object.keys(U0);if(J.length===0)return l;function W(F,V){l.call(this,F,V)}W.prototype=Object.create(l.prototype,{constructor:{value:W,configurable:!0,writable:!0}});for(let F=0;F<J.length;++F){let V=J[F];if(!(V in l.prototype)){let H=typeof Object.getOwnPropertyDescriptor(U0,V).value==="function";Object.defineProperty(W.prototype,V,H?A(V):K(V))}}return W}function C(l){if(l==null||l===Object.prototype)return Y;let U0=Q.get(l);if(U0==null)U0=D(C(Object.getPrototypeOf(l)),l),Q.set(l,U0);return U0}function z(l,U0){return new(C(Object.getPrototypeOf(U0)))(l,U0)}function R(l){return G(l).immediateStopped}function S(l,U0){G(l).eventPhase=U0}function P(l,U0){G(l).currentTarget=U0}function N(l,U0){G(l).passiveListener=U0}var I=new WeakMap,B=1,k=2,w=3;function v(l){return l!==null&&typeof l==="object"}function _(l){let U0=I.get(l);if(U0==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return U0}function u(l){return{get(){let U0=_(this).get(l);while(U0!=null){if(U0.listenerType===w)return U0.listener;U0=U0.next}return null},set(U0){if(typeof U0!=="function"&&!v(U0))U0=null;let J=_(this),W=null,F=J.get(l);while(F!=null){if(F.listenerType===w)if(W!==null)W.next=F.next;else if(F.next!==null)J.set(l,F.next);else J.delete(l);else W=F;F=F.next}if(U0!==null){let V={listener:U0,listenerType:w,passive:!1,once:!1,next:null};if(W===null)J.set(l,V);else W.next=V}},configurable:!0,enumerable:!0}}function J0(l,U0){Object.defineProperty(l,`on${U0}`,u(U0))}function H0(l){function U0(){V0.call(this)}U0.prototype=Object.create(V0.prototype,{constructor:{value:U0,configurable:!0,writable:!0}});for(let J=0;J<l.length;++J)J0(U0.prototype,l[J]);return U0}function V0(){if(this instanceof V0){I.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return H0(arguments[0]);if(arguments.length>0){let l=Array(arguments.length);for(let U0=0;U0<arguments.length;++U0)l[U0]=arguments[U0];return H0(l)}throw TypeError("Cannot call a class as a function")}if(V0.prototype={addEventListener(l,U0,J){if(U0==null)return;if(typeof U0!=="function"&&!v(U0))throw TypeError("'listener' should be a function or an object.");let W=_(this),F=v(J),V=(F?Boolean(J.capture):Boolean(J))?B:k,H={listener:U0,listenerType:V,passive:F&&Boolean(J.passive),once:F&&Boolean(J.once),next:null},M=W.get(l);if(M===void 0){W.set(l,H);return}let T=null;while(M!=null){if(M.listener===U0&&M.listenerType===V)return;T=M,M=M.next}T.next=H},removeEventListener(l,U0,J){if(U0==null)return;let W=_(this),F=(v(J)?Boolean(J.capture):Boolean(J))?B:k,V=null,H=W.get(l);while(H!=null){if(H.listener===U0&&H.listenerType===F){if(V!==null)V.next=H.next;else if(H.next!==null)W.set(l,H.next);else W.delete(l);return}V=H,H=H.next}},dispatchEvent(l){if(l==null||typeof l.type!=="string")throw TypeError('"event.type" should be a string.');let U0=_(this),J=l.type,W=U0.get(J);if(W==null)return!0;let F=z(this,l),V=null;while(W!=null){if(W.once)if(V!==null)V.next=W.next;else if(W.next!==null)U0.set(J,W.next);else U0.delete(J);else V=W;if(N(F,W.passive?W.listener:null),typeof W.listener==="function")try{W.listener.call(this,F)}catch(H){if(typeof console<"u"&&typeof console.error==="function")console.error(H)}else if(W.listenerType!==w&&typeof W.listener.handleEvent==="function")W.listener.handleEvent(F);if(R(F))break;W=W.next}return N(F,null),S(F,0),P(F,null),!F.defaultPrevented}},Object.defineProperty(V0.prototype,"constructor",{value:V0,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(V0.prototype,window.EventTarget.prototype);X.defineEventAttribute=J0,X.EventTarget=V0,X.default=V0,Z.exports=V0,Z.exports.EventTarget=Z.exports.default=V0,Z.exports.defineEventAttribute=J0}),MU=CX((X,Z)=>{Object.defineProperty(X,"__esModule",{value:!0});var U=rH();class Q extends U.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let C=Y.get(this);if(typeof C!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return C}}U.defineEventAttribute(Q.prototype,"abort");function G(){let C=Object.create(Q.prototype);return U.EventTarget.call(C),Y.set(C,!1),C}function O(C){if(Y.get(C)!==!1)return;Y.set(C,!0),C.dispatchEvent({type:"abort"})}var Y=new WeakMap;if(Object.defineProperties(Q.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(Q.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class K{constructor(){A.set(this,G())}get signal(){return D(this)}abort(){O(D(this))}}var A=new WeakMap;function D(C){let z=A.get(C);if(z==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${C===null?"null":typeof C}`);return z}if(Object.defineProperties(K.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(K.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});X.AbortController=K,X.AbortSignal=Q,X.default=K,Z.exports=K,Z.exports.AbortController=Z.exports.default=K,Z.exports.AbortSignal=Q}),RZ=CX((X,Z)=>{var U=(UZ(),WX(QZ)),{format:Q,inspect:G}=dG(),{codes:{ERR_INVALID_ARG_TYPE:O}}=DZ(),{kResistStopPropagation:Y,AggregateError:K,SymbolDispose:A}=BX(),D=globalThis.AbortSignal||MU().AbortSignal,C=globalThis.AbortController||MU().AbortController,z=Object.getPrototypeOf(async function(){}).constructor,R=globalThis.Blob||U.Blob,S=typeof R<"u"?function(I){return I instanceof R}:function(I){return!1},P=(I,B)=>{if(I!==void 0&&(I===null||typeof I!=="object"||!("aborted"in I)))throw new O(B,"AbortSignal",I)},N=(I,B)=>{if(typeof I!=="function")throw new O(B,"Function",I)};Z.exports={AggregateError:K,kEmptyObject:Object.freeze({}),once(I){let B=!1;return function(...k){if(B)return;B=!0,I.apply(this,k)}},createDeferredPromise:function(){let I,B;return{promise:new Promise((k,w)=>{I=k,B=w}),resolve:I,reject:B}},promisify(I){return new Promise((B,k)=>{I((w,...v)=>{if(w)return k(w);return B(...v)})})},debuglog(){return function(){}},format:Q,inspect:G,types:{isAsyncFunction(I){return I instanceof z},isArrayBufferView(I){return ArrayBuffer.isView(I)}},isBlob:S,deprecate(I,B){return I},addAbortListener:(qU(),WX(DU)).addAbortListener||function(I,B){if(I===void 0)throw new O("signal","AbortSignal",I);P(I,"signal"),N(B,"listener");let k;if(I.aborted)queueMicrotask(()=>B());else I.addEventListener("abort",B,{__proto__:null,once:!0,[Y]:!0}),k=()=>{I.removeEventListener("abort",B)};return{__proto__:null,[A](){var w;(w=k)===null||w===void 0||w()}}},AbortSignalAny:D.any||function(I){if(I.length===1)return I[0];let B=new C,k=()=>B.abort();return I.forEach((w)=>{P(w,"signals"),w.addEventListener("abort",k,{once:!0})}),B.signal.addEventListener("abort",()=>{I.forEach((w)=>w.removeEventListener("abort",k))},{once:!0}),B.signal}},Z.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),CU=CX((X,Z)=>{var{ArrayIsArray:U,ArrayPrototypeIncludes:Q,ArrayPrototypeJoin:G,ArrayPrototypeMap:O,NumberIsInteger:Y,NumberIsNaN:K,NumberMAX_SAFE_INTEGER:A,NumberMIN_SAFE_INTEGER:D,NumberParseInt:C,ObjectPrototypeHasOwnProperty:z,RegExpPrototypeExec:R,String:S,StringPrototypeToUpperCase:P,StringPrototypeTrim:N}=BX(),{hideStackFrames:I,codes:{ERR_SOCKET_BAD_PORT:B,ERR_INVALID_ARG_TYPE:k,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:v,ERR_UNKNOWN_SIGNAL:_}}=DZ(),{normalizeEncoding:u}=RZ(),{isAsyncFunction:J0,isArrayBufferView:H0}=RZ().types,V0={};function l(d){return d===(d|0)}function U0(d){return d===d>>>0}var J=/^[0-7]+$/,W="must be a 32-bit unsigned integer or an octal string";function F(d,t,l0){if(typeof d>"u")d=l0;if(typeof d==="string"){if(R(J,d)===null)throw new w(t,d,W);d=C(d,8)}return M(d,t),d}var V=I((d,t,l0=D,e=A)=>{if(typeof d!=="number")throw new k(t,"number",d);if(!Y(d))throw new v(t,"an integer",d);if(d<l0||d>e)throw new v(t,`>= ${l0} && <= ${e}`,d)}),H=I((d,t,l0=-2147483648,e=2147483647)=>{if(typeof d!=="number")throw new k(t,"number",d);if(!Y(d))throw new v(t,"an integer",d);if(d<l0||d>e)throw new v(t,`>= ${l0} && <= ${e}`,d)}),M=I((d,t,l0=!1)=>{if(typeof d!=="number")throw new k(t,"number",d);if(!Y(d))throw new v(t,"an integer",d);let e=l0?1:0,F0=4294967295;if(d<e||d>F0)throw new v(t,`>= ${e} && <= ${F0}`,d)});function T(d,t){if(typeof d!=="string")throw new k(t,"string",d)}function E(d,t,l0=void 0,e){if(typeof d!=="number")throw new k(t,"number",d);if(l0!=null&&d<l0||e!=null&&d>e||(l0!=null||e!=null)&&K(d))throw new v(t,`${l0!=null?`>= ${l0}`:""}${l0!=null&&e!=null?" && ":""}${e!=null?`<= ${e}`:""}`,d)}var $=I((d,t,l0)=>{if(!Q(l0,d)){let e="must be one of: "+G(O(l0,(F0)=>typeof F0==="string"?`'${F0}'`:S(F0)),", ");throw new w(t,d,e)}});function q(d,t){if(typeof d!=="boolean")throw new k(t,"boolean",d)}function j(d,t,l0){return d==null||!z(d,t)?l0:d[t]}var L=I((d,t,l0=null)=>{let e=j(l0,"allowArray",!1),F0=j(l0,"allowFunction",!1);if(!j(l0,"nullable",!1)&&d===null||!e&&U(d)||typeof d!=="object"&&(!F0||typeof d!=="function"))throw new k(t,"Object",d)}),x=I((d,t)=>{if(d!=null&&typeof d!=="object"&&typeof d!=="function")throw new k(t,"a dictionary",d)}),f=I((d,t,l0=0)=>{if(!U(d))throw new k(t,"Array",d);if(d.length<l0){let e=`must be longer than ${l0}`;throw new w(t,d,e)}});function b(d,t){f(d,t);for(let l0=0;l0<d.length;l0++)T(d[l0],`${t}[${l0}]`)}function s(d,t){f(d,t);for(let l0=0;l0<d.length;l0++)q(d[l0],`${t}[${l0}]`)}function z0(d,t){f(d,t);for(let l0=0;l0<d.length;l0++){let e=d[l0],F0=`${t}[${l0}]`;if(e==null)throw new k(F0,"AbortSignal",e);X0(e,F0)}}function i(d,t="signal"){if(T(d,t),V0[d]===void 0){if(V0[P(d)]!==void 0)throw new _(d+" (signals must use all capital letters)");throw new _(d)}}var o=I((d,t="buffer")=>{if(!H0(d))throw new k(t,["Buffer","TypedArray","DataView"],d)});function W0(d,t){let l0=u(t),e=d.length;if(l0==="hex"&&e%2!==0)throw new w("encoding",t,`is invalid for data of length ${e}`)}function r(d,t="Port",l0=!0){if(typeof d!=="number"&&typeof d!=="string"||typeof d==="string"&&N(d).length===0||+d!==+d>>>0||d>65535||d===0&&!l0)throw new B(t,d,l0);return d|0}var X0=I((d,t)=>{if(d!==void 0&&(d===null||typeof d!=="object"||!("aborted"in d)))throw new k(t,"AbortSignal",d)}),d0=I((d,t)=>{if(typeof d!=="function")throw new k(t,"Function",d)}),c=I((d,t)=>{if(typeof d!=="function"||J0(d))throw new k(t,"Function",d)}),m=I((d,t)=>{if(d!==void 0)throw new k(t,"undefined",d)});function E0(d,t,l0){if(!Q(l0,d))throw new k(t,`('${G(l0,"|")}')`,d)}var Z0=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function $0(d,t){if(typeof d>"u"||!R(Z0,d))throw new w(t,d,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function N0(d){if(typeof d==="string")return $0(d,"hints"),d;else if(U(d)){let t=d.length,l0="";if(t===0)return l0;for(let e=0;e<t;e++){let F0=d[e];if($0(F0,"hints"),l0+=F0,e!==t-1)l0+=", "}return l0}throw new w("hints",d,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}Z.exports={isInt32:l,isUint32:U0,parseFileMode:F,validateArray:f,validateStringArray:b,validateBooleanArray:s,validateAbortSignalArray:z0,validateBoolean:q,validateBuffer:o,validateDictionary:x,validateEncoding:W0,validateFunction:d0,validateInt32:H,validateInteger:V,validateNumber:E,validateObject:L,validateOneOf:$,validatePlainFunction:c,validatePort:r,validateSignalName:i,validateString:T,validateUint32:M,validateUndefined:m,validateUnion:E0,validateAbortSignal:X0,validateLinkHeaderValue:N0}}),BQ=CX((X,Z)=>{Z.exports=globalThis.process}),ZQ=CX((X,Z)=>{var{SymbolAsyncIterator:U,SymbolIterator:Q,SymbolFor:G}=BX(),O=G("nodejs.stream.destroyed"),Y=G("nodejs.stream.errored"),K=G("nodejs.stream.readable"),A=G("nodejs.stream.writable"),D=G("nodejs.stream.disturbed"),C=G("nodejs.webstream.isClosedPromise"),z=G("nodejs.webstream.controllerErrorFunction");function R(j,L=!1){var x;return!!(j&&typeof j.pipe==="function"&&typeof j.on==="function"&&(!L||typeof j.pause==="function"&&typeof j.resume==="function")&&(!j._writableState||((x=j._readableState)===null||x===void 0?void 0:x.readable)!==!1)&&(!j._writableState||j._readableState))}function S(j){var L;return!!(j&&typeof j.write==="function"&&typeof j.on==="function"&&(!j._readableState||((L=j._writableState)===null||L===void 0?void 0:L.writable)!==!1))}function P(j){return!!(j&&typeof j.pipe==="function"&&j._readableState&&typeof j.on==="function"&&typeof j.write==="function")}function N(j){return j&&(j._readableState||j._writableState||typeof j.write==="function"&&typeof j.on==="function"||typeof j.pipe==="function"&&typeof j.on==="function")}function I(j){return!!(j&&!N(j)&&typeof j.pipeThrough==="function"&&typeof j.getReader==="function"&&typeof j.cancel==="function")}function B(j){return!!(j&&!N(j)&&typeof j.getWriter==="function"&&typeof j.abort==="function")}function k(j){return!!(j&&!N(j)&&typeof j.readable==="object"&&typeof j.writable==="object")}function w(j){return I(j)||B(j)||k(j)}function v(j,L){if(j==null)return!1;if(L===!0)return typeof j[U]==="function";if(L===!1)return typeof j[Q]==="function";return typeof j[U]==="function"||typeof j[Q]==="function"}function _(j){if(!N(j))return null;let{_writableState:L,_readableState:x}=j,f=L||x;return!!(j.destroyed||j[O]||f!==null&&f!==void 0&&f.destroyed)}function u(j){if(!S(j))return null;if(j.writableEnded===!0)return!0;let L=j._writableState;if(L!==null&&L!==void 0&&L.errored)return!1;if(typeof(L===null||L===void 0?void 0:L.ended)!=="boolean")return null;return L.ended}function J0(j,L){if(!S(j))return null;if(j.writableFinished===!0)return!0;let x=j._writableState;if(x!==null&&x!==void 0&&x.errored)return!1;if(typeof(x===null||x===void 0?void 0:x.finished)!=="boolean")return null;return!!(x.finished||L===!1&&x.ended===!0&&x.length===0)}function H0(j){if(!R(j))return null;if(j.readableEnded===!0)return!0;let L=j._readableState;if(!L||L.errored)return!1;if(typeof(L===null||L===void 0?void 0:L.ended)!=="boolean")return null;return L.ended}function V0(j,L){if(!R(j))return null;let x=j._readableState;if(x!==null&&x!==void 0&&x.errored)return!1;if(typeof(x===null||x===void 0?void 0:x.endEmitted)!=="boolean")return null;return!!(x.endEmitted||L===!1&&x.ended===!0&&x.length===0)}function l(j){if(j&&j[K]!=null)return j[K];if(typeof(j===null||j===void 0?void 0:j.readable)!=="boolean")return null;if(_(j))return!1;return R(j)&&j.readable&&!V0(j)}function U0(j){if(j&&j[A]!=null)return j[A];if(typeof(j===null||j===void 0?void 0:j.writable)!=="boolean")return null;if(_(j))return!1;return S(j)&&j.writable&&!u(j)}function J(j,L){if(!N(j))return null;if(_(j))return!0;if((L===null||L===void 0?void 0:L.readable)!==!1&&l(j))return!1;if((L===null||L===void 0?void 0:L.writable)!==!1&&U0(j))return!1;return!0}function W(j){var L,x;if(!N(j))return null;if(j.writableErrored)return j.writableErrored;return(L=(x=j._writableState)===null||x===void 0?void 0:x.errored)!==null&&L!==void 0?L:null}function F(j){var L,x;if(!N(j))return null;if(j.readableErrored)return j.readableErrored;return(L=(x=j._readableState)===null||x===void 0?void 0:x.errored)!==null&&L!==void 0?L:null}function V(j){if(!N(j))return null;if(typeof j.closed==="boolean")return j.closed;let{_writableState:L,_readableState:x}=j;if(typeof(L===null||L===void 0?void 0:L.closed)==="boolean"||typeof(x===null||x===void 0?void 0:x.closed)==="boolean")return(L===null||L===void 0?void 0:L.closed)||(x===null||x===void 0?void 0:x.closed);if(typeof j._closed==="boolean"&&H(j))return j._closed;return null}function H(j){return typeof j._closed==="boolean"&&typeof j._defaultKeepAlive==="boolean"&&typeof j._removedConnection==="boolean"&&typeof j._removedContLen==="boolean"}function M(j){return typeof j._sent100==="boolean"&&H(j)}function T(j){var L;return typeof j._consuming==="boolean"&&typeof j._dumped==="boolean"&&((L=j.req)===null||L===void 0?void 0:L.upgradeOrConnect)===void 0}function E(j){if(!N(j))return null;let{_writableState:L,_readableState:x}=j,f=L||x;return!f&&M(j)||!!(f&&f.autoDestroy&&f.emitClose&&f.closed===!1)}function $(j){var L;return!!(j&&((L=j[D])!==null&&L!==void 0?L:j.readableDidRead||j.readableAborted))}function q(j){var L,x,f,b,s,z0,i,o,W0,r;return!!(j&&((L=(x=(f=(b=(s=(z0=j[Y])!==null&&z0!==void 0?z0:j.readableErrored)!==null&&s!==void 0?s:j.writableErrored)!==null&&b!==void 0?b:(i=j._readableState)===null||i===void 0?void 0:i.errorEmitted)!==null&&f!==void 0?f:(o=j._writableState)===null||o===void 0?void 0:o.errorEmitted)!==null&&x!==void 0?x:(W0=j._readableState)===null||W0===void 0?void 0:W0.errored)!==null&&L!==void 0?L:(r=j._writableState)===null||r===void 0?void 0:r.errored))}Z.exports={isDestroyed:_,kIsDestroyed:O,isDisturbed:$,kIsDisturbed:D,isErrored:q,kIsErrored:Y,isReadable:l,kIsReadable:K,kIsClosedPromise:C,kControllerErrorFunction:z,kIsWritable:A,isClosed:V,isDuplexNodeStream:P,isFinished:J,isIterable:v,isReadableNodeStream:R,isReadableStream:I,isReadableEnded:H0,isReadableFinished:V0,isReadableErrored:F,isNodeStream:N,isWebStream:w,isWritable:U0,isWritableNodeStream:S,isWritableStream:B,isWritableEnded:u,isWritableFinished:J0,isWritableErrored:W,isServerRequest:T,isServerResponse:M,willEmitClose:E,isTransformStream:k}}),FQ=CX((X,Z)=>{var U=BQ(),{AbortError:Q,codes:G}=DZ(),{ERR_INVALID_ARG_TYPE:O,ERR_STREAM_PREMATURE_CLOSE:Y}=G,{kEmptyObject:K,once:A}=RZ(),{validateAbortSignal:D,validateFunction:C,validateObject:z,validateBoolean:R}=CU(),{Promise:S,PromisePrototypeThen:P,SymbolDispose:N}=BX(),{isClosed:I,isReadable:B,isReadableNodeStream:k,isReadableStream:w,isReadableFinished:v,isReadableErrored:_,isWritable:u,isWritableNodeStream:J0,isWritableStream:H0,isWritableFinished:V0,isWritableErrored:l,isNodeStream:U0,willEmitClose:J,kIsClosedPromise:W}=ZQ(),F;function V($){return $.setHeader&&typeof $.abort==="function"}var H=()=>{};function M($,q,j){var L,x;if(arguments.length===2)j=q,q=K;else if(q==null)q=K;else z(q,"options");if(C(j,"callback"),D(q.signal,"options.signal"),j=A(j),w($)||H0($))return T($,q,j);if(!U0($))throw new O("stream",["ReadableStream","WritableStream","Stream"],$);let f=(L=q.readable)!==null&&L!==void 0?L:k($),b=(x=q.writable)!==null&&x!==void 0?x:J0($),s=$._writableState,z0=$._readableState,i=()=>{if(!$.writable)r()},o=J($)&&k($)===f&&J0($)===b,W0=V0($,!1),r=()=>{if(W0=!0,$.destroyed)o=!1;if(o&&(!$.readable||f))return;if(!f||X0)j.call($)},X0=v($,!1),d0=()=>{if(X0=!0,$.destroyed)o=!1;if(o&&(!$.writable||b))return;if(!b||W0)j.call($)},c=(d)=>{j.call($,d)},m=I($),E0=()=>{m=!0;let d=l($)||_($);if(d&&typeof d!=="boolean")return j.call($,d);if(f&&!X0&&k($,!0)){if(!v($,!1))return j.call($,new Y)}if(b&&!W0){if(!V0($,!1))return j.call($,new Y)}j.call($)},Z0=()=>{m=!0;let d=l($)||_($);if(d&&typeof d!=="boolean")return j.call($,d);j.call($)},$0=()=>{$.req.on("finish",r)};if(V($)){if($.on("complete",r),!o)$.on("abort",E0);if($.req)$0();else $.on("request",$0)}else if(b&&!s)$.on("end",i),$.on("close",i);if(!o&&typeof $.aborted==="boolean")$.on("aborted",E0);if($.on("end",d0),$.on("finish",r),q.error!==!1)$.on("error",c);if($.on("close",E0),m)U.nextTick(E0);else if(s!==null&&s!==void 0&&s.errorEmitted||z0!==null&&z0!==void 0&&z0.errorEmitted){if(!o)U.nextTick(Z0)}else if(!f&&(!o||B($))&&(W0||u($)===!1))U.nextTick(Z0);else if(!b&&(!o||u($))&&(X0||B($)===!1))U.nextTick(Z0);else if(z0&&$.req&&$.aborted)U.nextTick(Z0);let N0=()=>{if(j=H,$.removeListener("aborted",E0),$.removeListener("complete",r),$.removeListener("abort",E0),$.removeListener("request",$0),$.req)$.req.removeListener("finish",r);$.removeListener("end",i),$.removeListener("close",i),$.removeListener("finish",r),$.removeListener("end",d0),$.removeListener("error",c),$.removeListener("close",E0)};if(q.signal&&!m){let d=()=>{let t=j;N0(),t.call($,new Q(void 0,{cause:q.signal.reason}))};if(q.signal.aborted)U.nextTick(d);else{F=F||RZ().addAbortListener;let t=F(q.signal,d),l0=j;j=A((...e)=>{t[N](),l0.apply($,e)})}}return N0}function T($,q,j){let L=!1,x=H;if(q.signal)if(x=()=>{L=!0,j.call($,new Q(void 0,{cause:q.signal.reason}))},q.signal.aborted)U.nextTick(x);else{F=F||RZ().addAbortListener;let b=F(q.signal,x),s=j;j=A((...z0)=>{b[N](),s.apply($,z0)})}let f=(...b)=>{if(!L)U.nextTick(()=>j.apply($,b))};return P($[W].promise,f,f),H}function E($,q){var j;let L=!1;if(q===null)q=K;if((j=q)!==null&&j!==void 0&&j.cleanup)R(q.cleanup,"cleanup"),L=q.cleanup;return new S((x,f)=>{let b=M($,q,(s)=>{if(L)b();if(s)f(s);else x()})})}Z.exports=M,Z.exports.finished=E}),sQ=CX((X,Z)=>{var U=BQ(),{aggregateTwoErrors:Q,codes:{ERR_MULTIPLE_CALLBACK:G},AbortError:O}=DZ(),{Symbol:Y}=BX(),{kIsDestroyed:K,isDestroyed:A,isFinished:D,isServerRequest:C}=ZQ(),z=Y("kDestroy"),R=Y("kConstruct");function S(J,W,F){if(J){if(J.stack,W&&!W.errored)W.errored=J;if(F&&!F.errored)F.errored=J}}function P(J,W){let F=this._readableState,V=this._writableState,H=V||F;if(V!==null&&V!==void 0&&V.destroyed||F!==null&&F!==void 0&&F.destroyed){if(typeof W==="function")W();return this}if(S(J,V,F),V)V.destroyed=!0;if(F)F.destroyed=!0;if(!H.constructed)this.once(z,function(M){N(this,Q(M,J),W)});else N(this,J,W);return this}function N(J,W,F){let V=!1;function H(M){if(V)return;V=!0;let{_readableState:T,_writableState:E}=J;if(S(M,E,T),E)E.closed=!0;if(T)T.closed=!0;if(typeof F==="function")F(M);if(M)U.nextTick(I,J,M);else U.nextTick(B,J)}try{J._destroy(W||null,H)}catch(M){H(M)}}function I(J,W){k(J,W),B(J)}function B(J){let{_readableState:W,_writableState:F}=J;if(F)F.closeEmitted=!0;if(W)W.closeEmitted=!0;if(F!==null&&F!==void 0&&F.emitClose||W!==null&&W!==void 0&&W.emitClose)J.emit("close")}function k(J,W){let{_readableState:F,_writableState:V}=J;if(V!==null&&V!==void 0&&V.errorEmitted||F!==null&&F!==void 0&&F.errorEmitted)return;if(V)V.errorEmitted=!0;if(F)F.errorEmitted=!0;J.emit("error",W)}function w(){let J=this._readableState,W=this._writableState;if(J)J.constructed=!0,J.closed=!1,J.closeEmitted=!1,J.destroyed=!1,J.errored=null,J.errorEmitted=!1,J.reading=!1,J.ended=J.readable===!1,J.endEmitted=J.readable===!1;if(W)W.constructed=!0,W.destroyed=!1,W.closed=!1,W.closeEmitted=!1,W.errored=null,W.errorEmitted=!1,W.finalCalled=!1,W.prefinished=!1,W.ended=W.writable===!1,W.ending=W.writable===!1,W.finished=W.writable===!1}function v(J,W,F){let{_readableState:V,_writableState:H}=J;if(H!==null&&H!==void 0&&H.destroyed||V!==null&&V!==void 0&&V.destroyed)return this;if(V!==null&&V!==void 0&&V.autoDestroy||H!==null&&H!==void 0&&H.autoDestroy)J.destroy(W);else if(W){if(W.stack,H&&!H.errored)H.errored=W;if(V&&!V.errored)V.errored=W;if(F)U.nextTick(k,J,W);else k(J,W)}}function _(J,W){if(typeof J._construct!=="function")return;let{_readableState:F,_writableState:V}=J;if(F)F.constructed=!1;if(V)V.constructed=!1;if(J.once(R,W),J.listenerCount(R)>1)return;U.nextTick(u,J)}function u(J){let W=!1;function F(V){if(W){v(J,V!==null&&V!==void 0?V:new G);return}W=!0;let{_readableState:H,_writableState:M}=J,T=M||H;if(H)H.constructed=!0;if(M)M.constructed=!0;if(T.destroyed)J.emit(z,V);else if(V)v(J,V,!0);else U.nextTick(J0,J)}try{J._construct((V)=>{U.nextTick(F,V)})}catch(V){U.nextTick(F,V)}}function J0(J){J.emit(R)}function H0(J){return(J===null||J===void 0?void 0:J.setHeader)&&typeof J.abort==="function"}function V0(J){J.emit("close")}function l(J,W){J.emit("error",W),U.nextTick(V0,J)}function U0(J,W){if(!J||A(J))return;if(!W&&!D(J))W=new O;if(C(J))J.socket=null,J.destroy(W);else if(H0(J))J.abort();else if(H0(J.req))J.req.abort();else if(typeof J.destroy==="function")J.destroy(W);else if(typeof J.close==="function")J.close();else if(W)U.nextTick(l,J,W);else U.nextTick(V0,J);if(!J.destroyed)J[K]=!0}Z.exports={construct:_,destroyer:U0,destroy:P,undestroy:w,errorOrDestroy:v}}),EY=CX((X,Z)=>{var{ArrayIsArray:U,ObjectSetPrototypeOf:Q}=BX(),{EventEmitter:G}=(qU(),WX(DU));function O(K){G.call(this,K)}Q(O.prototype,G.prototype),Q(O,G),O.prototype.pipe=function(K,A){let D=this;function C(B){if(K.writable&&K.write(B)===!1&&D.pause)D.pause()}D.on("data",C);function z(){if(D.readable&&D.resume)D.resume()}if(K.on("drain",z),!K._isStdio&&(!A||A.end!==!1))D.on("end",S),D.on("close",P);let R=!1;function S(){if(R)return;R=!0,K.end()}function P(){if(R)return;if(R=!0,typeof K.destroy==="function")K.destroy()}function N(B){if(I(),G.listenerCount(this,"error")===0)this.emit("error",B)}Y(D,"error",N),Y(K,"error",N);function I(){D.removeListener("data",C),K.removeListener("drain",z),D.removeListener("end",S),D.removeListener("close",P),D.removeListener("error",N),K.removeListener("error",N),D.removeListener("end",I),D.removeListener("close",I),K.removeListener("close",I)}return D.on("end",I),D.on("close",I),K.on("close",I),K.emit("pipe",D),K};function Y(K,A,D){if(typeof K.prependListener==="function")return K.prependListener(A,D);if(!K._events||!K._events[A])K.on(A,D);else if(U(K._events[A]))K._events[A].unshift(D);else K._events[A]=[D,K._events[A]]}Z.exports={Stream:O,prependListener:Y}}),JJ=CX((X,Z)=>{var{SymbolDispose:U}=BX(),{AbortError:Q,codes:G}=DZ(),{isNodeStream:O,isWebStream:Y,kControllerErrorFunction:K}=ZQ(),A=FQ(),{ERR_INVALID_ARG_TYPE:D}=G,C,z=(R,S)=>{if(typeof R!=="object"||!("aborted"in R))throw new D(S,"AbortSignal",R)};Z.exports.addAbortSignal=function(R,S){if(z(R,"signal"),!O(S)&&!Y(S))throw new D("stream",["ReadableStream","WritableStream","Stream"],S);return Z.exports.addAbortSignalNoValidate(R,S)},Z.exports.addAbortSignalNoValidate=function(R,S){if(typeof R!=="object"||!("aborted"in R))return S;let P=O(S)?()=>{S.destroy(new Q(void 0,{cause:R.reason}))}:()=>{S[K](new Q(void 0,{cause:R.reason}))};if(R.aborted)P();else{C=C||RZ().addAbortListener;let N=C(R,P);A(S,N[U])}return S}}),aH=CX((X,Z)=>{var{StringPrototypeSlice:U,SymbolIterator:Q,TypedArrayPrototypeSet:G,Uint8Array:O}=BX(),{Buffer:Y}=(UZ(),WX(QZ)),{inspect:K}=RZ();Z.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(A){let D={data:A,next:null};if(this.length>0)this.tail.next=D;else this.head=D;this.tail=D,++this.length}unshift(A){let D={data:A,next:this.head};if(this.length===0)this.tail=D;this.head=D,++this.length}shift(){if(this.length===0)return;let A=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,A}clear(){this.head=this.tail=null,this.length=0}join(A){if(this.length===0)return"";let D=this.head,C=""+D.data;while((D=D.next)!==null)C+=A+D.data;return C}concat(A){if(this.length===0)return Y.alloc(0);let D=Y.allocUnsafe(A>>>0),C=this.head,z=0;while(C)G(D,C.data,z),z+=C.data.length,C=C.next;return D}consume(A,D){let C=this.head.data;if(A<C.length){let z=C.slice(0,A);return this.head.data=C.slice(A),z}if(A===C.length)return this.shift();return D?this._getString(A):this._getBuffer(A)}first(){return this.head.data}*[Q](){for(let A=this.head;A;A=A.next)yield A.data}_getString(A){let D="",C=this.head,z=0;do{let R=C.data;if(A>R.length)D+=R,A-=R.length;else{if(A===R.length)if(D+=R,++z,C.next)this.head=C.next;else this.head=this.tail=null;else D+=U(R,0,A),this.head=C,C.data=U(R,A);break}++z}while((C=C.next)!==null);return this.length-=z,D}_getBuffer(A){let D=Y.allocUnsafe(A),C=A,z=this.head,R=0;do{let S=z.data;if(A>S.length)G(D,S,C-A),A-=S.length;else{if(A===S.length)if(G(D,S,C-A),++R,z.next)this.head=z.next;else this.head=this.tail=null;else G(D,new O(S.buffer,S.byteOffset,A),C-A),this.head=z,z.data=S.slice(A);break}++R}while((z=z.next)!==null);return this.length-=R,D}[Symbol.for("nodejs.util.inspect.custom")](A,D){return K(this,{...D,depth:0,customInspect:!1})}}}),YJ=CX((X,Z)=>{var{MathFloor:U,NumberIsInteger:Q}=BX(),{validateInteger:G}=CU(),{ERR_INVALID_ARG_VALUE:O}=DZ().codes,Y=16384,K=16;function A(R,S,P){return R.highWaterMark!=null?R.highWaterMark:S?R[P]:null}function D(R){return R?K:Y}function C(R,S){if(G(S,"value",0),R)K=S;else Y=S}function z(R,S,P,N){let I=A(S,N,P);if(I!=null){if(!Q(I)||I<0){let B=N?`options.${P}`:"options.highWaterMark";throw new O(B,I)}return U(I)}return D(R.objectMode)}Z.exports={getHighWaterMark:z,getDefaultHighWaterMark:D,setDefaultHighWaterMark:C}}),tH=CX((X,Z)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var U=(UZ(),WX(QZ)),Q=U.Buffer;function G(Y,K){for(var A in Y)K[A]=Y[A]}if(Q.from&&Q.alloc&&Q.allocUnsafe&&Q.allocUnsafeSlow)Z.exports=U;else G(U,X),X.Buffer=O;function O(Y,K,A){return Q(Y,K,A)}O.prototype=Object.create(Q.prototype),G(Q,O),O.from=function(Y,K,A){if(typeof Y==="number")throw TypeError("Argument must not be a number");return Q(Y,K,A)},O.alloc=function(Y,K,A){if(typeof Y!=="number")throw TypeError("Argument must be a number");var D=Q(Y);if(K!==void 0)if(typeof A==="string")D.fill(K,A);else D.fill(K);else D.fill(0);return D},O.allocUnsafe=function(Y){if(typeof Y!=="number")throw TypeError("Argument must be a number");return Q(Y)},O.allocUnsafeSlow=function(Y){if(typeof Y!=="number")throw TypeError("Argument must be a number");return U.SlowBuffer(Y)}}),iH=CX((X)=>{var Z=tH().Buffer,U=Z.isEncoding||function(k){switch(k=""+k,k&&k.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 Q(k){if(!k)return"utf8";var w;while(!0)switch(k){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 k;default:if(w)return;k=(""+k).toLowerCase(),w=!0}}function G(k){var w=Q(k);if(typeof w!=="string"&&(Z.isEncoding===U||!U(k)))throw Error("Unknown encoding: "+k);return w||k}X.StringDecoder=O;function O(k){this.encoding=G(k);var w;switch(this.encoding){case"utf16le":this.text=R,this.end=S,w=4;break;case"utf8":this.fillLast=D,w=4;break;case"base64":this.text=P,this.end=N,w=3;break;default:this.write=I,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Z.allocUnsafe(w)}O.prototype.write=function(k){if(k.length===0)return"";var w,v;if(this.lastNeed){if(w=this.fillLast(k),w===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;if(v<k.length)return w?w+this.text(k,v):this.text(k,v);return w||""},O.prototype.end=z,O.prototype.text=C,O.prototype.fillLast=function(k){if(this.lastNeed<=k.length)return k.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);k.copy(this.lastChar,this.lastTotal-this.lastNeed,0,k.length),this.lastNeed-=k.length};function Y(k){if(k<=127)return 0;else if(k>>5===6)return 2;else if(k>>4===14)return 3;else if(k>>3===30)return 4;return k>>6===2?-1:-2}function K(k,w,v){var _=w.length-1;if(_<v)return 0;var u=Y(w[_]);if(u>=0){if(u>0)k.lastNeed=u-1;return u}if(--_<v||u===-2)return 0;if(u=Y(w[_]),u>=0){if(u>0)k.lastNeed=u-2;return u}if(--_<v||u===-2)return 0;if(u=Y(w[_]),u>=0){if(u>0)if(u===2)u=0;else k.lastNeed=u-3;return u}return 0}function A(k,w,v){if((w[0]&192)!==128)return k.lastNeed=0,"�";if(k.lastNeed>1&&w.length>1){if((w[1]&192)!==128)return k.lastNeed=1,"�";if(k.lastNeed>2&&w.length>2){if((w[2]&192)!==128)return k.lastNeed=2,"�"}}}function D(k){var w=this.lastTotal-this.lastNeed,v=A(this,k,w);if(v!==void 0)return v;if(this.lastNeed<=k.length)return k.copy(this.lastChar,w,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);k.copy(this.lastChar,w,0,k.length),this.lastNeed-=k.length}function C(k,w){var v=K(this,k,w);if(!this.lastNeed)return k.toString("utf8",w);this.lastTotal=v;var _=k.length-(v-this.lastNeed);return k.copy(this.lastChar,0,_),k.toString("utf8",w,_)}function z(k){var w=k&&k.length?this.write(k):"";if(this.lastNeed)return w+"�";return w}function R(k,w){if((k.length-w)%2===0){var v=k.toString("utf16le",w);if(v){var _=v.charCodeAt(v.length-1);if(_>=55296&&_<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=k[k.length-2],this.lastChar[1]=k[k.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=k[k.length-1],k.toString("utf16le",w,k.length-1)}function S(k){var w=k&&k.length?this.write(k):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return w+this.lastChar.toString("utf16le",0,v)}return w}function P(k,w){var v=(k.length-w)%3;if(v===0)return k.toString("base64",w);if(this.lastNeed=3-v,this.lastTotal=3,v===1)this.lastChar[0]=k[k.length-1];else this.lastChar[0]=k[k.length-2],this.lastChar[1]=k[k.length-1];return k.toString("base64",w,k.length-v)}function N(k){var w=k&&k.length?this.write(k):"";if(this.lastNeed)return w+this.lastChar.toString("base64",0,3-this.lastNeed);return w}function I(k){return k.toString(this.encoding)}function B(k){return k&&k.length?this.write(k):""}}),lG=CX((X,Z)=>{var U=BQ(),{PromisePrototypeThen:Q,SymbolAsyncIterator:G,SymbolIterator:O}=BX(),{Buffer:Y}=(UZ(),WX(QZ)),{ERR_INVALID_ARG_TYPE:K,ERR_STREAM_NULL_VALUES:A}=DZ().codes;function D(C,z,R){let S;if(typeof z==="string"||z instanceof Y)return new C({objectMode:!0,...R,read(){this.push(z),this.push(null)}});let P;if(z&&z[G])P=!0,S=z[G]();else if(z&&z[O])P=!1,S=z[O]();else throw new K("iterable",["Iterable"],z);let N=new C({objectMode:!0,highWaterMark:1,...R}),I=!1;N._read=function(){if(!I)I=!0,k()},N._destroy=function(w,v){Q(B(w),()=>U.nextTick(v,w),(_)=>U.nextTick(v,_||w))};async function B(w){let v=w!==void 0&&w!==null,_=typeof S.throw==="function";if(v&&_){let{value:u,done:J0}=await S.throw(w);if(await u,J0)return}if(typeof S.return==="function"){let{value:u}=await S.return();await u}}async function k(){for(;;){try{let{value:w,done:v}=P?await S.next():S.next();if(v)N.push(null);else{let _=w&&typeof w.then==="function"?await w:w;if(_===null)throw I=!1,new A;else if(N.push(_))continue;else I=!1}}catch(w){N.destroy(w)}break}}return N}Z.exports=D}),$J=CX((X,Z)=>{var U=BQ(),{ArrayPrototypeIndexOf:Q,NumberIsInteger:G,NumberIsNaN:O,NumberParseInt:Y,ObjectDefineProperties:K,ObjectKeys:A,ObjectSetPrototypeOf:D,Promise:C,SafeSet:z,SymbolAsyncDispose:R,SymbolAsyncIterator:S,Symbol:P}=BX();Z.exports=e,e.ReadableState=l0;var{EventEmitter:N}=(qU(),WX(DU)),{Stream:I,prependListener:B}=EY(),{Buffer:k}=(UZ(),WX(QZ)),{addAbortSignal:w}=JJ(),v=FQ(),_=RZ().debuglog("stream",(y)=>{_=y}),u=aH(),J0=sQ(),{getHighWaterMark:H0,getDefaultHighWaterMark:V0}=YJ(),{aggregateTwoErrors:l,codes:{ERR_INVALID_ARG_TYPE:U0,ERR_METHOD_NOT_IMPLEMENTED:J,ERR_OUT_OF_RANGE:W,ERR_STREAM_PUSH_AFTER_EOF:F,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:V},AbortError:H}=DZ(),{validateObject:M}=CU(),T=P("kPaused"),{StringDecoder:E}=iH(),$=lG();D(e.prototype,I.prototype),D(e,I);var q=()=>{},{errorOrDestroy:j}=J0,L=1,x=2,f=4,b=8,s=16,z0=32,i=64,o=128,W0=256,r=512,X0=1024,d0=2048,c=4096,m=8192,E0=16384,Z0=32768,$0=65536,N0=131072,d=262144;function t(y){return{enumerable:!1,get(){return(this.state&y)!==0},set(n){if(n)this.state|=y;else this.state&=~y}}}K(l0.prototype,{objectMode:t(L),ended:t(x),endEmitted:t(f),reading:t(b),constructed:t(s),sync:t(z0),needReadable:t(i),emittedReadable:t(o),readableListening:t(W0),resumeScheduled:t(r),errorEmitted:t(X0),emitClose:t(d0),autoDestroy:t(c),destroyed:t(m),closed:t(E0),closeEmitted:t(Z0),multiAwaitDrain:t($0),readingMore:t(N0),dataEmitted:t(d)});function l0(y,n,Y0){if(typeof Y0!=="boolean")Y0=n instanceof XQ();if(this.state=d0|c|s|z0,y&&y.objectMode)this.state|=L;if(Y0&&y&&y.readableObjectMode)this.state|=L;if(this.highWaterMark=y?H0(this,y,"readableHighWaterMark",Y0):V0(!1),this.buffer=new u,this.length=0,this.pipes=[],this.flowing=null,this[T]=null,y&&y.emitClose===!1)this.state&=~d0;if(y&&y.autoDestroy===!1)this.state&=~c;if(this.errored=null,this.defaultEncoding=y&&y.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,y&&y.encoding)this.decoder=new E(y.encoding),this.encoding=y.encoding}function e(y){if(!(this instanceof e))return new e(y);let n=this instanceof XQ();if(this._readableState=new l0(y,this,n),y){if(typeof y.read==="function")this._read=y.read;if(typeof y.destroy==="function")this._destroy=y.destroy;if(typeof y.construct==="function")this._construct=y.construct;if(y.signal&&!n)w(y.signal,this)}I.call(this,y),J0.construct(this,()=>{if(this._readableState.needReadable)I0(this,this._readableState)})}e.prototype.destroy=J0.destroy,e.prototype._undestroy=J0.undestroy,e.prototype._destroy=function(y,n){n(y)},e.prototype[N.captureRejectionSymbol]=function(y){this.destroy(y)},e.prototype[R]=function(){let y;if(!this.destroyed)y=this.readableEnded?null:new H,this.destroy(y);return new C((n,Y0)=>v(this,(O0)=>O0&&O0!==y?Y0(O0):n(null)))},e.prototype.push=function(y,n){return F0(this,y,n,!1)},e.prototype.unshift=function(y,n){return F0(this,y,n,!0)};function F0(y,n,Y0,O0){_("readableAddChunk",n);let n0=y._readableState,A0;if((n0.state&L)===0){if(typeof n==="string"){if(Y0=Y0||n0.defaultEncoding,n0.encoding!==Y0)if(O0&&n0.encoding)n=k.from(n,Y0).toString(n0.encoding);else n=k.from(n,Y0),Y0=""}else if(n instanceof k)Y0="";else if(I._isUint8Array(n))n=I._uint8ArrayToBuffer(n),Y0="";else if(n!=null)A0=new U0("chunk",["string","Buffer","Uint8Array"],n)}if(A0)j(y,A0);else if(n===null)n0.state&=~b,C0(y,n0);else if((n0.state&L)!==0||n&&n.length>0)if(O0)if((n0.state&f)!==0)j(y,new V);else if(n0.destroyed||n0.errored)return!1;else ZX(y,n0,n,!0);else if(n0.ended)j(y,new F);else if(n0.destroyed||n0.errored)return!1;else if(n0.state&=~b,n0.decoder&&!Y0)if(n=n0.decoder.write(n),n0.objectMode||n.length!==0)ZX(y,n0,n,!1);else I0(y,n0);else ZX(y,n0,n,!1);else if(!O0)n0.state&=~b,I0(y,n0);return!n0.ended&&(n0.length<n0.highWaterMark||n0.length===0)}function ZX(y,n,Y0,O0){if(n.flowing&&n.length===0&&!n.sync&&y.listenerCount("data")>0){if((n.state&$0)!==0)n.awaitDrainWriters.clear();else n.awaitDrainWriters=null;n.dataEmitted=!0,y.emit("data",Y0)}else{if(n.length+=n.objectMode?1:Y0.length,O0)n.buffer.unshift(Y0);else n.buffer.push(Y0);if((n.state&i)!==0)P0(y)}I0(y,n)}e.prototype.isPaused=function(){let y=this._readableState;return y[T]===!0||y.flowing===!1},e.prototype.setEncoding=function(y){let n=new E(y);this._readableState.decoder=n,this._readableState.encoding=this._readableState.decoder.encoding;let Y0=this._readableState.buffer,O0="";for(let n0 of Y0)O0+=n.write(n0);if(Y0.clear(),O0!=="")Y0.push(O0);return this._readableState.length=O0.length,this};var T0=1073741824;function R0(y){if(y>T0)throw new W("size","<= 1GiB",y);else y--,y|=y>>>1,y|=y>>>2,y|=y>>>4,y|=y>>>8,y|=y>>>16,y++;return y}function kX(y,n){if(y<=0||n.length===0&&n.ended)return 0;if((n.state&L)!==0)return 1;if(O(y)){if(n.flowing&&n.length)return n.buffer.first().length;return n.length}if(y<=n.length)return y;return n.ended?n.length:0}e.prototype.read=function(y){if(_("read",y),y===void 0)y=NaN;else if(!G(y))y=Y(y,10);let n=this._readableState,Y0=y;if(y>n.highWaterMark)n.highWaterMark=R0(y);if(y!==0)n.state&=~o;if(y===0&&n.needReadable&&((n.highWaterMark!==0?n.length>=n.highWaterMark:n.length>0)||n.ended)){if(_("read: emitReadable",n.length,n.ended),n.length===0&&n.ended)tX(this);else P0(this);return null}if(y=kX(y,n),y===0&&n.ended){if(n.length===0)tX(this);return null}let O0=(n.state&i)!==0;if(_("need readable",O0),n.length===0||n.length-y<n.highWaterMark)O0=!0,_("length less than watermark",O0);if(n.ended||n.reading||n.destroyed||n.errored||!n.constructed)O0=!1,_("reading, ended or constructing",O0);else if(O0){if(_("do read"),n.state|=b|z0,n.length===0)n.state|=i;try{this._read(n.highWaterMark)}catch(A0){j(this,A0)}if(n.state&=~z0,!n.reading)y=kX(Y0,n)}let n0;if(y>0)n0=x0(y,n);else n0=null;if(n0===null)n.needReadable=n.length<=n.highWaterMark,y=0;else if(n.length-=y,n.multiAwaitDrain)n.awaitDrainWriters.clear();else n.awaitDrainWriters=null;if(n.length===0){if(!n.ended)n.needReadable=!0;if(Y0!==y&&n.ended)tX(this)}if(n0!==null&&!n.errorEmitted&&!n.closeEmitted)n.dataEmitted=!0,this.emit("data",n0);return n0};function C0(y,n){if(_("onEofChunk"),n.ended)return;if(n.decoder){let Y0=n.decoder.end();if(Y0&&Y0.length)n.buffer.push(Y0),n.length+=n.objectMode?1:Y0.length}if(n.ended=!0,n.sync)P0(y);else n.needReadable=!1,n.emittedReadable=!0,_X(y)}function P0(y){let n=y._readableState;if(_("emitReadable",n.needReadable,n.emittedReadable),n.needReadable=!1,!n.emittedReadable)_("emitReadable",n.flowing),n.emittedReadable=!0,U.nextTick(_X,y)}function _X(y){let n=y._readableState;if(_("emitReadable_",n.destroyed,n.length,n.ended),!n.destroyed&&!n.errored&&(n.length||n.ended))y.emit("readable"),n.emittedReadable=!1;n.needReadable=!n.flowing&&!n.ended&&n.length<=n.highWaterMark,k0(y)}function I0(y,n){if(!n.readingMore&&n.constructed)n.readingMore=!0,U.nextTick(L0,y,n)}function L0(y,n){while(!n.reading&&!n.ended&&(n.length<n.highWaterMark||n.flowing&&n.length===0)){let Y0=n.length;if(_("maybeReadMore read 0"),y.read(0),Y0===n.length)break}n.readingMore=!1}e.prototype._read=function(y){throw new J("_read()")},e.prototype.pipe=function(y,n){let Y0=this,O0=this._readableState;if(O0.pipes.length===1){if(!O0.multiAwaitDrain)O0.multiAwaitDrain=!0,O0.awaitDrainWriters=new z(O0.awaitDrainWriters?[O0.awaitDrainWriters]:[])}O0.pipes.push(y),_("pipe count=%d opts=%j",O0.pipes.length,n);let n0=(!n||n.end!==!1)&&y!==U.stdout&&y!==U.stderr?S0:JX;if(O0.endEmitted)U.nextTick(n0);else Y0.once("end",n0);y.on("unpipe",A0);function A0(TX,AX){if(_("onunpipe"),TX===Y0){if(AX&&AX.hasUnpiped===!1)AX.hasUnpiped=!0,c0()}}function S0(){_("onend"),y.end()}let xX,v0=!1;function c0(){if(_("cleanup"),y.removeListener("close",wX),y.removeListener("finish",$X),xX)y.removeListener("drain",xX);if(y.removeListener("error",j0),y.removeListener("unpipe",A0),Y0.removeListener("end",S0),Y0.removeListener("end",JX),Y0.removeListener("data",_0),v0=!0,xX&&O0.awaitDrainWriters&&(!y._writableState||y._writableState.needDrain))xX()}function GZ(){if(!v0){if(O0.pipes.length===1&&O0.pipes[0]===y)_("false write response, pause",0),O0.awaitDrainWriters=y,O0.multiAwaitDrain=!1;else if(O0.pipes.length>1&&O0.pipes.includes(y))_("false write response, pause",O0.awaitDrainWriters.size),O0.awaitDrainWriters.add(y);Y0.pause()}if(!xX)xX=HZ(Y0,y),y.on("drain",xX)}Y0.on("data",_0);function _0(TX){_("ondata");let AX=y.write(TX);if(_("dest.write",AX),AX===!1)GZ()}function j0(TX){if(_("onerror",TX),JX(),y.removeListener("error",j0),y.listenerCount("error")===0){let AX=y._writableState||y._readableState;if(AX&&!AX.errorEmitted)j(y,TX);else y.emit("error",TX)}}B(y,"error",j0);function wX(){y.removeListener("finish",$X),JX()}y.once("close",wX);function $X(){_("onfinish"),y.removeListener("close",wX),JX()}y.once("finish",$X);function JX(){_("unpipe"),Y0.unpipe(y)}if(y.emit("pipe",Y0),y.writableNeedDrain===!0)GZ();else if(!O0.flowing)_("pipe resume"),Y0.resume();return y};function HZ(y,n){return function(){let Y0=y._readableState;if(Y0.awaitDrainWriters===n)_("pipeOnDrain",1),Y0.awaitDrainWriters=null;else if(Y0.multiAwaitDrain)_("pipeOnDrain",Y0.awaitDrainWriters.size),Y0.awaitDrainWriters.delete(n);if((!Y0.awaitDrainWriters||Y0.awaitDrainWriters.size===0)&&y.listenerCount("data"))y.resume()}}e.prototype.unpipe=function(y){let n=this._readableState,Y0={hasUnpiped:!1};if(n.pipes.length===0)return this;if(!y){let n0=n.pipes;n.pipes=[],this.pause();for(let A0=0;A0<n0.length;A0++)n0[A0].emit("unpipe",this,{hasUnpiped:!1});return this}let O0=Q(n.pipes,y);if(O0===-1)return this;if(n.pipes.splice(O0,1),n.pipes.length===0)this.pause();return y.emit("unpipe",this,Y0),this},e.prototype.on=function(y,n){let Y0=I.prototype.on.call(this,y,n),O0=this._readableState;if(y==="data"){if(O0.readableListening=this.listenerCount("readable")>0,O0.flowing!==!1)this.resume()}else if(y==="readable"){if(!O0.endEmitted&&!O0.readableListening){if(O0.readableListening=O0.needReadable=!0,O0.flowing=!1,O0.emittedReadable=!1,_("on readable",O0.length,O0.reading),O0.length)P0(this);else if(!O0.reading)U.nextTick(y0,this)}}return Y0},e.prototype.addListener=e.prototype.on,e.prototype.removeListener=function(y,n){let Y0=I.prototype.removeListener.call(this,y,n);if(y==="readable")U.nextTick(B0,this);return Y0},e.prototype.off=e.prototype.removeListener,e.prototype.removeAllListeners=function(y){let n=I.prototype.removeAllListeners.apply(this,arguments);if(y==="readable"||y===void 0)U.nextTick(B0,this);return n};function B0(y){let n=y._readableState;if(n.readableListening=y.listenerCount("readable")>0,n.resumeScheduled&&n[T]===!1)n.flowing=!0;else if(y.listenerCount("data")>0)y.resume();else if(!n.readableListening)n.flowing=null}function y0(y){_("readable nexttick read 0"),y.read(0)}e.prototype.resume=function(){let y=this._readableState;if(!y.flowing)_("resume"),y.flowing=!y.readableListening,FZ(this,y);return y[T]=!1,this};function FZ(y,n){if(!n.resumeScheduled)n.resumeScheduled=!0,U.nextTick(f0,y,n)}function f0(y,n){if(_("resume",n.reading),!n.reading)y.read(0);if(n.resumeScheduled=!1,y.emit("resume"),k0(y),n.flowing&&!n.reading)y.read(0)}e.prototype.pause=function(){if(_("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)_("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[T]=!0,this};function k0(y){let n=y._readableState;_("flow",n.flowing);while(n.flowing&&y.read()!==null);}e.prototype.wrap=function(y){let n=!1;y.on("data",(O0)=>{if(!this.push(O0)&&y.pause)n=!0,y.pause()}),y.on("end",()=>{this.push(null)}),y.on("error",(O0)=>{j(this,O0)}),y.on("close",()=>{this.destroy()}),y.on("destroy",()=>{this.destroy()}),this._read=()=>{if(n&&y.resume)n=!1,y.resume()};let Y0=A(y);for(let O0=1;O0<Y0.length;O0++){let n0=Y0[O0];if(this[n0]===void 0&&typeof y[n0]==="function")this[n0]=y[n0].bind(y)}return this},e.prototype[S]=function(){return $Z(this)},e.prototype.iterator=function(y){if(y!==void 0)M(y,"options");return $Z(this,y)};function $Z(y,n){if(typeof y.read!=="function")y=e.wrap(y,{objectMode:!0});let Y0=g0(y,n);return Y0.stream=y,Y0}async function*g0(y,n){let Y0=q;function O0(S0){if(this===y)Y0(),Y0=q;else Y0=S0}y.on("readable",O0);let n0,A0=v(y,{writable:!1},(S0)=>{n0=S0?l(n0,S0):null,Y0(),Y0=q});try{while(!0){let S0=y.destroyed?null:y.read();if(S0!==null)yield S0;else if(n0)throw n0;else if(n0===null)return;else await new C(O0)}}catch(S0){throw n0=l(n0,S0),n0}finally{if((n0||(n===null||n===void 0?void 0:n.destroyOnReturn)!==!1)&&(n0===void 0||y._readableState.autoDestroy))J0.destroyer(y,null);else y.off("readable",O0),A0()}}K(e.prototype,{readable:{__proto__:null,get(){let y=this._readableState;return!!y&&y.readable!==!1&&!y.destroyed&&!y.errorEmitted&&!y.endEmitted},set(y){if(this._readableState)this._readableState.readable=!!y}},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(y){if(this._readableState)this._readableState.flowing=y}},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(y){if(!this._readableState)return;this._readableState.destroyed=y}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),K(l0.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[T]!==!1},set(y){this[T]=!!y}}}),e._fromList=x0;function x0(y,n){if(n.length===0)return null;let Y0;if(n.objectMode)Y0=n.buffer.shift();else if(!y||y>=n.length){if(n.decoder)Y0=n.buffer.join("");else if(n.buffer.length===1)Y0=n.buffer.first();else Y0=n.buffer.concat(n.length);n.buffer.clear()}else Y0=n.buffer.consume(y,n.decoder);return Y0}function tX(y){let n=y._readableState;if(_("endReadable",n.endEmitted),!n.endEmitted)n.ended=!0,U.nextTick(h0,n,y)}function h0(y,n){if(_("endReadableNT",y.endEmitted,y.length),!y.errored&&!y.closeEmitted&&!y.endEmitted&&y.length===0){if(y.endEmitted=!0,n.emit("end"),n.writable&&n.allowHalfOpen===!1)U.nextTick(p0,n);else if(y.autoDestroy){let Y0=n._writableState;if(!Y0||Y0.autoDestroy&&(Y0.finished||Y0.writable===!1))n.destroy()}}}function p0(y){if(y.writable&&!y.writableEnded&&!y.destroyed)y.end()}e.from=function(y,n){return $(e,y,n)};var iX;function w0(){if(iX===void 0)iX={};return iX}e.fromWeb=function(y,n){return w0().newStreamReadableFromReadableStream(y,n)},e.toWeb=function(y,n){return w0().newReadableStreamFromStreamReadable(y,n)},e.wrap=function(y,n){var Y0,O0;return new e({objectMode:(Y0=(O0=y.readableObjectMode)!==null&&O0!==void 0?O0:y.objectMode)!==null&&Y0!==void 0?Y0:!0,...n,destroy(n0,A0){J0.destroyer(y,n0),A0(n0)}}).wrap(y)}}),zY=CX((X,Z)=>{var U=BQ(),{ArrayPrototypeSlice:Q,Error:G,FunctionPrototypeSymbolHasInstance:O,ObjectDefineProperty:Y,ObjectDefineProperties:K,ObjectSetPrototypeOf:A,StringPrototypeToLowerCase:D,Symbol:C,SymbolHasInstance:z}=BX();Z.exports=M,M.WritableState=V;var{EventEmitter:R}=(qU(),WX(DU)),S=EY().Stream,{Buffer:P}=(UZ(),WX(QZ)),N=sQ(),{addAbortSignal:I}=JJ(),{getHighWaterMark:B,getDefaultHighWaterMark:k}=YJ(),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:v,ERR_MULTIPLE_CALLBACK:_,ERR_STREAM_CANNOT_PIPE:u,ERR_STREAM_DESTROYED:J0,ERR_STREAM_ALREADY_FINISHED:H0,ERR_STREAM_NULL_VALUES:V0,ERR_STREAM_WRITE_AFTER_END:l,ERR_UNKNOWN_ENCODING:U0}=DZ().codes,{errorOrDestroy:J}=N;A(M.prototype,S.prototype),A(M,S);function W(){}var F=C("kOnFinished");function V(c,m,E0){if(typeof E0!=="boolean")E0=m instanceof XQ();if(this.objectMode=!!(c&&c.objectMode),E0)this.objectMode=this.objectMode||!!(c&&c.writableObjectMode);this.highWaterMark=c?B(this,c,"writableHighWaterMark",E0):k(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let Z0=!!(c&&c.decodeStrings===!1);this.decodeStrings=!Z0,this.defaultEncoding=c&&c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=j.bind(void 0,m),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,H(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!c||c.emitClose!==!1,this.autoDestroy=!c||c.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[F]=[]}function H(c){c.buffered=[],c.bufferedIndex=0,c.allBuffers=!0,c.allNoop=!0}V.prototype.getBuffer=function(){return Q(this.buffered,this.bufferedIndex)},Y(V.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function M(c){let m=this instanceof XQ();if(!m&&!O(M,this))return new M(c);if(this._writableState=new V(c,this,m),c){if(typeof c.write==="function")this._write=c.write;if(typeof c.writev==="function")this._writev=c.writev;if(typeof c.destroy==="function")this._destroy=c.destroy;if(typeof c.final==="function")this._final=c.final;if(typeof c.construct==="function")this._construct=c.construct;if(c.signal)I(c.signal,this)}S.call(this,c),N.construct(this,()=>{let E0=this._writableState;if(!E0.writing)b(this,E0);o(this,E0)})}Y(M,z,{__proto__:null,value:function(c){if(O(this,c))return!0;if(this!==M)return!1;return c&&c._writableState instanceof V}}),M.prototype.pipe=function(){J(this,new u)};function T(c,m,E0,Z0){let $0=c._writableState;if(typeof E0==="function")Z0=E0,E0=$0.defaultEncoding;else{if(!E0)E0=$0.defaultEncoding;else if(E0!=="buffer"&&!P.isEncoding(E0))throw new U0(E0);if(typeof Z0!=="function")Z0=W}if(m===null)throw new V0;else if(!$0.objectMode)if(typeof m==="string"){if($0.decodeStrings!==!1)m=P.from(m,E0),E0="buffer"}else if(m instanceof P)E0="buffer";else if(S._isUint8Array(m))m=S._uint8ArrayToBuffer(m),E0="buffer";else throw new w("chunk",["string","Buffer","Uint8Array"],m);let N0;if($0.ending)N0=new l;else if($0.destroyed)N0=new J0("write");if(N0)return U.nextTick(Z0,N0),J(c,N0,!0),N0;return $0.pendingcb++,E(c,$0,m,E0,Z0)}M.prototype.write=function(c,m,E0){return T(this,c,m,E0)===!0},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){let c=this._writableState;if(c.corked){if(c.corked--,!c.writing)b(this,c)}},M.prototype.setDefaultEncoding=function(c){if(typeof c==="string")c=D(c);if(!P.isEncoding(c))throw new U0(c);return this._writableState.defaultEncoding=c,this};function E(c,m,E0,Z0,$0){let N0=m.objectMode?1:E0.length;m.length+=N0;let d=m.length<m.highWaterMark;if(!d)m.needDrain=!0;if(m.writing||m.corked||m.errored||!m.constructed){if(m.buffered.push({chunk:E0,encoding:Z0,callback:$0}),m.allBuffers&&Z0!=="buffer")m.allBuffers=!1;if(m.allNoop&&$0!==W)m.allNoop=!1}else m.writelen=N0,m.writecb=$0,m.writing=!0,m.sync=!0,c._write(E0,Z0,m.onwrite),m.sync=!1;return d&&!m.errored&&!m.destroyed}function $(c,m,E0,Z0,$0,N0,d){if(m.writelen=Z0,m.writecb=d,m.writing=!0,m.sync=!0,m.destroyed)m.onwrite(new J0("write"));else if(E0)c._writev($0,m.onwrite);else c._write($0,N0,m.onwrite);m.sync=!1}function q(c,m,E0,Z0){--m.pendingcb,Z0(E0),f(m),J(c,E0)}function j(c,m){let E0=c._writableState,Z0=E0.sync,$0=E0.writecb;if(typeof $0!=="function"){J(c,new _);return}if(E0.writing=!1,E0.writecb=null,E0.length-=E0.writelen,E0.writelen=0,m){if(m.stack,!E0.errored)E0.errored=m;if(c._readableState&&!c._readableState.errored)c._readableState.errored=m;if(Z0)U.nextTick(q,c,E0,m,$0);else q(c,E0,m,$0)}else{if(E0.buffered.length>E0.bufferedIndex)b(c,E0);if(Z0)if(E0.afterWriteTickInfo!==null&&E0.afterWriteTickInfo.cb===$0)E0.afterWriteTickInfo.count++;else E0.afterWriteTickInfo={count:1,cb:$0,stream:c,state:E0},U.nextTick(L,E0.afterWriteTickInfo);else x(c,E0,1,$0)}}function L({stream:c,state:m,count:E0,cb:Z0}){return m.afterWriteTickInfo=null,x(c,m,E0,Z0)}function x(c,m,E0,Z0){if(!m.ending&&!c.destroyed&&m.length===0&&m.needDrain)m.needDrain=!1,c.emit("drain");while(E0-- >0)m.pendingcb--,Z0();if(m.destroyed)f(m);o(c,m)}function f(c){if(c.writing)return;for(let $0=c.bufferedIndex;$0<c.buffered.length;++$0){var m;let{chunk:N0,callback:d}=c.buffered[$0],t=c.objectMode?1:N0.length;c.length-=t,d((m=c.errored)!==null&&m!==void 0?m:new J0("write"))}let E0=c[F].splice(0);for(let $0=0;$0<E0.length;$0++){var Z0;E0[$0]((Z0=c.errored)!==null&&Z0!==void 0?Z0:new J0("end"))}H(c)}function b(c,m){if(m.corked||m.bufferProcessing||m.destroyed||!m.constructed)return;let{buffered:E0,bufferedIndex:Z0,objectMode:$0}=m,N0=E0.length-Z0;if(!N0)return;let d=Z0;if(m.bufferProcessing=!0,N0>1&&c._writev){m.pendingcb-=N0-1;let t=m.allNoop?W:(e)=>{for(let F0=d;F0<E0.length;++F0)E0[F0].callback(e)},l0=m.allNoop&&d===0?E0:Q(E0,d);l0.allBuffers=m.allBuffers,$(c,m,!0,m.length,l0,"",t),H(m)}else{do{let{chunk:t,encoding:l0,callback:e}=E0[d];E0[d++]=null;let F0=$0?1:t.length;$(c,m,!1,F0,t,l0,e)}while(d<E0.length&&!m.writing);if(d===E0.length)H(m);else if(d>256)E0.splice(0,d),m.bufferedIndex=0;else m.bufferedIndex=d}m.bufferProcessing=!1}M.prototype._write=function(c,m,E0){if(this._writev)this._writev([{chunk:c,encoding:m}],E0);else throw new v("_write()")},M.prototype._writev=null,M.prototype.end=function(c,m,E0){let Z0=this._writableState;if(typeof c==="function")E0=c,c=null,m=null;else if(typeof m==="function")E0=m,m=null;let $0;if(c!==null&&c!==void 0){let N0=T(this,c,m);if(N0 instanceof G)$0=N0}if(Z0.corked)Z0.corked=1,this.uncork();if($0);else if(!Z0.errored&&!Z0.ending)Z0.ending=!0,o(this,Z0,!0),Z0.ended=!0;else if(Z0.finished)$0=new H0("end");else if(Z0.destroyed)$0=new J0("end");if(typeof E0==="function")if($0||Z0.finished)U.nextTick(E0,$0);else Z0[F].push(E0);return this};function s(c){return c.ending&&!c.destroyed&&c.constructed&&c.length===0&&!c.errored&&c.buffered.length===0&&!c.finished&&!c.writing&&!c.errorEmitted&&!c.closeEmitted}function z0(c,m){let E0=!1;function Z0($0){if(E0){J(c,$0!==null&&$0!==void 0?$0:_());return}if(E0=!0,m.pendingcb--,$0){let N0=m[F].splice(0);for(let d=0;d<N0.length;d++)N0[d]($0);J(c,$0,m.sync)}else if(s(m))m.prefinished=!0,c.emit("prefinish"),m.pendingcb++,U.nextTick(W0,c,m)}m.sync=!0,m.pendingcb++;try{c._final(Z0)}catch($0){Z0($0)}m.sync=!1}function i(c,m){if(!m.prefinished&&!m.finalCalled)if(typeof c._final==="function"&&!m.destroyed)m.finalCalled=!0,z0(c,m);else m.prefinished=!0,c.emit("prefinish")}function o(c,m,E0){if(s(m)){if(i(c,m),m.pendingcb===0){if(E0)m.pendingcb++,U.nextTick((Z0,$0)=>{if(s($0))W0(Z0,$0);else $0.pendingcb--},c,m);else if(s(m))m.pendingcb++,W0(c,m)}}}function W0(c,m){m.pendingcb--,m.finished=!0;let E0=m[F].splice(0);for(let Z0=0;Z0<E0.length;Z0++)E0[Z0]();if(c.emit("finish"),m.autoDestroy){let Z0=c._readableState;if(!Z0||Z0.autoDestroy&&(Z0.endEmitted||Z0.readable===!1))c.destroy()}}K(M.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(c){if(this._writableState)this._writableState.destroyed=c}},writable:{__proto__:null,get(){let c=this._writableState;return!!c&&c.writable!==!1&&!c.destroyed&&!c.errored&&!c.ending&&!c.ended},set(c){if(this._writableState)this._writableState.writable=!!c}},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 c=this._writableState;if(!c)return!1;return!c.destroyed&&!c.ending&&c.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 r=N.destroy;M.prototype.destroy=function(c,m){let E0=this._writableState;if(!E0.destroyed&&(E0.bufferedIndex<E0.buffered.length||E0[F].length))U.nextTick(f,E0);return r.call(this,c,m),this},M.prototype._undestroy=N.undestroy,M.prototype._destroy=function(c,m){m(c)},M.prototype[R.captureRejectionSymbol]=function(c){this.destroy(c)};var X0;function d0(){if(X0===void 0)X0={};return X0}M.fromWeb=function(c,m){return d0().newStreamWritableFromWritableStream(c,m)},M.toWeb=function(c){return d0().newWritableStreamFromStreamWritable(c)}}),eH=CX((X,Z)=>{var U=BQ(),Q=(UZ(),WX(QZ)),{isReadable:G,isWritable:O,isIterable:Y,isNodeStream:K,isReadableNodeStream:A,isWritableNodeStream:D,isDuplexNodeStream:C,isReadableStream:z,isWritableStream:R}=ZQ(),S=FQ(),{AbortError:P,codes:{ERR_INVALID_ARG_TYPE:N,ERR_INVALID_RETURN_VALUE:I}}=DZ(),{destroyer:B}=sQ(),k=XQ(),w=$J(),v=zY(),{createDeferredPromise:_}=RZ(),u=lG(),J0=globalThis.Blob||Q.Blob,H0=typeof J0<"u"?function(F){return F instanceof J0}:function(F){return!1},V0=globalThis.AbortController||MU().AbortController,{FunctionPrototypeCall:l}=BX();class U0 extends k{constructor(F){super(F);if((F===null||F===void 0?void 0:F.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((F===null||F===void 0?void 0:F.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}Z.exports=function F(V,H){if(C(V))return V;if(A(V))return W({readable:V});if(D(V))return W({writable:V});if(K(V))return W({writable:!1,readable:!1});if(z(V))return W({readable:w.fromWeb(V)});if(R(V))return W({writable:v.fromWeb(V)});if(typeof V==="function"){let{value:T,write:E,final:$,destroy:q}=J(V);if(Y(T))return u(U0,T,{objectMode:!0,write:E,final:$,destroy:q});let j=T===null||T===void 0?void 0:T.then;if(typeof j==="function"){let L,x=l(j,T,(f)=>{if(f!=null)throw new I("nully","body",f)},(f)=>{B(L,f)});return L=new U0({objectMode:!0,readable:!1,write:E,final(f){$(async()=>{try{await x,U.nextTick(f,null)}catch(b){U.nextTick(f,b)}})},destroy:q})}throw new I("Iterable, AsyncIterable or AsyncFunction",H,T)}if(H0(V))return F(V.arrayBuffer());if(Y(V))return u(U0,V,{objectMode:!0,writable:!1});if(z(V===null||V===void 0?void 0:V.readable)&&R(V===null||V===void 0?void 0:V.writable))return U0.fromWeb(V);if(typeof(V===null||V===void 0?void 0:V.writable)==="object"||typeof(V===null||V===void 0?void 0:V.readable)==="object"){let T=V!==null&&V!==void 0&&V.readable?A(V===null||V===void 0?void 0:V.readable)?V===null||V===void 0?void 0:V.readable:F(V.readable):void 0,E=V!==null&&V!==void 0&&V.writable?D(V===null||V===void 0?void 0:V.writable)?V===null||V===void 0?void 0:V.writable:F(V.writable):void 0;return W({readable:T,writable:E})}let M=V===null||V===void 0?void 0:V.then;if(typeof M==="function"){let T;return l(M,V,(E)=>{if(E!=null)T.push(E);T.push(null)},(E)=>{B(T,E)}),T=new U0({objectMode:!0,writable:!1,read(){}})}throw new N(H,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],V)};function J(F){let{promise:V,resolve:H}=_(),M=new V0,T=M.signal;return{value:F(async function*(){while(!0){let E=V;V=null;let{chunk:$,done:q,cb:j}=await E;if(U.nextTick(j),q)return;if(T.aborted)throw new P(void 0,{cause:T.reason});({promise:V,resolve:H}=_()),yield $}}(),{signal:T}),write(E,$,q){let j=H;H=null,j({chunk:E,done:!1,cb:q})},final(E){let $=H;H=null,$({done:!0,cb:E})},destroy(E,$){M.abort(),$(E)}}}function W(F){let V=F.readable&&typeof F.readable.read!=="function"?w.wrap(F.readable):F.readable,H=F.writable,M=!!G(V),T=!!O(H),E,$,q,j,L;function x(f){let b=j;if(j=null,b)b(f);else if(f)L.destroy(f)}if(L=new U0({readableObjectMode:!!(V!==null&&V!==void 0&&V.readableObjectMode),writableObjectMode:!!(H!==null&&H!==void 0&&H.writableObjectMode),readable:M,writable:T}),T)S(H,(f)=>{if(T=!1,f)B(V,f);x(f)}),L._write=function(f,b,s){if(H.write(f,b))s();else E=s},L._final=function(f){H.end(),$=f},H.on("drain",function(){if(E){let f=E;E=null,f()}}),H.on("finish",function(){if($){let f=$;$=null,f()}});if(M)S(V,(f)=>{if(M=!1,f)B(V,f);x(f)}),V.on("readable",function(){if(q){let f=q;q=null,f()}}),V.on("end",function(){L.push(null)}),L._read=function(){while(!0){let f=V.read();if(f===null){q=L._read;return}if(!L.push(f))return}};return L._destroy=function(f,b){if(!f&&j!==null)f=new P;if(q=null,E=null,$=null,j===null)b(f);else j=b,B(H,f),B(V,f)},L}}),XQ=CX((X,Z)=>{var{ObjectDefineProperties:U,ObjectGetOwnPropertyDescriptor:Q,ObjectKeys:G,ObjectSetPrototypeOf:O}=BX();Z.exports=A;var Y=$J(),K=zY();O(A.prototype,Y.prototype),O(A,Y);{let R=G(K.prototype);for(let S=0;S<R.length;S++){let P=R[S];if(!A.prototype[P])A.prototype[P]=K.prototype[P]}}function A(R){if(!(this instanceof A))return new A(R);if(Y.call(this,R),K.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}U(A.prototype,{writable:{__proto__:null,...Q(K.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Q(K.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Q(K.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Q(K.prototype,"writableBuffer")},writableLength:{__proto__:null,...Q(K.prototype,"writableLength")},writableFinished:{__proto__:null,...Q(K.prototype,"writableFinished")},writableCorked:{__proto__:null,...Q(K.prototype,"writableCorked")},writableEnded:{__proto__:null,...Q(K.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Q(K.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 D;function C(){if(D===void 0)D={};return D}A.fromWeb=function(R,S){return C().newStreamDuplexFromReadableWritablePair(R,S)},A.toWeb=function(R){return C().newReadableWritablePairFromDuplex(R)};var z;A.from=function(R){if(!z)z=eH();return z(R,"body")}}),mG=CX((X,Z)=>{var{ObjectSetPrototypeOf:U,Symbol:Q}=BX();Z.exports=A;var{ERR_METHOD_NOT_IMPLEMENTED:G}=DZ().codes,O=XQ(),{getHighWaterMark:Y}=YJ();U(A.prototype,O.prototype),U(A,O);var K=Q("kCallback");function A(z){if(!(this instanceof A))return new A(z);let R=z?Y(this,z,"readableHighWaterMark",!0):null;if(R===0)z={...z,highWaterMark:null,readableHighWaterMark:R,writableHighWaterMark:z.writableHighWaterMark||0};if(O.call(this,z),this._readableState.sync=!1,this[K]=null,z){if(typeof z.transform==="function")this._transform=z.transform;if(typeof z.flush==="function")this._flush=z.flush}this.on("prefinish",C)}function D(z){if(typeof this._flush==="function"&&!this.destroyed)this._flush((R,S)=>{if(R){if(z)z(R);else this.destroy(R);return}if(S!=null)this.push(S);if(this.push(null),z)z()});else if(this.push(null),z)z()}function C(){if(this._final!==D)D.call(this)}A.prototype._final=D,A.prototype._transform=function(z,R,S){throw new G("_transform()")},A.prototype._write=function(z,R,S){let P=this._readableState,N=this._writableState,I=P.length;this._transform(z,R,(B,k)=>{if(B){S(B);return}if(k!=null)this.push(k);if(N.ended||I===P.length||P.length<P.highWaterMark)S();else this[K]=S})},A.prototype._read=function(){if(this[K]){let z=this[K];this[K]=null,z()}}}),oG=CX((X,Z)=>{var{ObjectSetPrototypeOf:U}=BX();Z.exports=G;var Q=mG();U(G.prototype,Q.prototype),U(G,Q);function G(O){if(!(this instanceof G))return new G(O);Q.call(this,O)}G.prototype._transform=function(O,Y,K){K(null,O)}}),DY=CX((X,Z)=>{var U=BQ(),{ArrayIsArray:Q,Promise:G,SymbolAsyncIterator:O,SymbolDispose:Y}=BX(),K=FQ(),{once:A}=RZ(),D=sQ(),C=XQ(),{aggregateTwoErrors:z,codes:{ERR_INVALID_ARG_TYPE:R,ERR_INVALID_RETURN_VALUE:S,ERR_MISSING_ARGS:P,ERR_STREAM_DESTROYED:N,ERR_STREAM_PREMATURE_CLOSE:I},AbortError:B}=DZ(),{validateFunction:k,validateAbortSignal:w}=CU(),{isIterable:v,isReadable:_,isReadableNodeStream:u,isNodeStream:J0,isTransformStream:H0,isWebStream:V0,isReadableStream:l,isReadableFinished:U0}=ZQ(),J=globalThis.AbortController||MU().AbortController,W,F,V;function H(f,b,s){let z0=!1;f.on("close",()=>{z0=!0});let i=K(f,{readable:b,writable:s},(o)=>{z0=!o});return{destroy:(o)=>{if(z0)return;z0=!0,D.destroyer(f,o||new N("pipe"))},cleanup:i}}function M(f){return k(f[f.length-1],"streams[stream.length - 1]"),f.pop()}function T(f){if(v(f))return f;else if(u(f))return E(f);throw new R("val",["Readable","Iterable","AsyncIterable"],f)}async function*E(f){if(!F)F=$J();yield*F.prototype[O].call(f)}async function $(f,b,s,{end:z0}){let i,o=null,W0=(d0)=>{if(d0)i=d0;if(o){let c=o;o=null,c()}},r=()=>new G((d0,c)=>{if(i)c(i);else o=()=>{if(i)c(i);else d0()}});b.on("drain",W0);let X0=K(b,{readable:!1},W0);try{if(b.writableNeedDrain)await r();for await(let d0 of f)if(!b.write(d0))await r();if(z0)b.end(),await r();s()}catch(d0){s(i!==d0?z(i,d0):d0)}finally{X0(),b.off("drain",W0)}}async function q(f,b,s,{end:z0}){if(H0(b))b=b.writable;let i=b.getWriter();try{for await(let o of f)await i.ready,i.write(o).catch(()=>{});if(await i.ready,z0)await i.close();s()}catch(o){try{await i.abort(o),s(o)}catch(W0){s(W0)}}}function j(...f){return L(f,A(M(f)))}function L(f,b,s){if(f.length===1&&Q(f[0]))f=f[0];if(f.length<2)throw new P("streams");let z0=new J,i=z0.signal,o=s===null||s===void 0?void 0:s.signal,W0=[];w(o,"options.signal");function r(){$0(new B)}V=V||RZ().addAbortListener;let X0;if(o)X0=V(o,r);let d0,c,m=[],E0=0;function Z0(e){$0(e,--E0===0)}function $0(e,F0){var ZX;if(e&&(!d0||d0.code==="ERR_STREAM_PREMATURE_CLOSE"))d0=e;if(!d0&&!F0)return;while(m.length)m.shift()(d0);if((ZX=X0)===null||ZX===void 0||ZX[Y](),z0.abort(),F0){if(!d0)W0.forEach((T0)=>T0());U.nextTick(b,d0,c)}}let N0;for(let e=0;e<f.length;e++){let F0=f[e],ZX=e<f.length-1,T0=e>0,R0=ZX||(s===null||s===void 0?void 0:s.end)!==!1,kX=e===f.length-1;if(J0(F0)){let C0=function(P0){if(P0&&P0.name!=="AbortError"&&P0.code!=="ERR_STREAM_PREMATURE_CLOSE")Z0(P0)};var d=C0;if(R0){let{destroy:P0,cleanup:_X}=H(F0,ZX,T0);if(m.push(P0),_(F0)&&kX)W0.push(_X)}if(F0.on("error",C0),_(F0)&&kX)W0.push(()=>{F0.removeListener("error",C0)})}if(e===0)if(typeof F0==="function"){if(N0=F0({signal:i}),!v(N0))throw new S("Iterable, AsyncIterable or Stream","source",N0)}else if(v(F0)||u(F0)||H0(F0))N0=F0;else N0=C.from(F0);else if(typeof F0==="function"){if(H0(N0)){var t;N0=T((t=N0)===null||t===void 0?void 0:t.readable)}else N0=T(N0);if(N0=F0(N0,{signal:i}),ZX){if(!v(N0,!0))throw new S("AsyncIterable",`transform[${e-1}]`,N0)}else{var l0;if(!W)W=oG();let C0=new W({objectMode:!0}),P0=(l0=N0)===null||l0===void 0?void 0:l0.then;if(typeof P0==="function")E0++,P0.call(N0,(L0)=>{if(c=L0,L0!=null)C0.write(L0);if(R0)C0.end();U.nextTick(Z0)},(L0)=>{C0.destroy(L0),U.nextTick(Z0,L0)});else if(v(N0,!0))E0++,$(N0,C0,Z0,{end:R0});else if(l(N0)||H0(N0)){let L0=N0.readable||N0;E0++,$(L0,C0,Z0,{end:R0})}else throw new S("AsyncIterable or Promise","destination",N0);N0=C0;let{destroy:_X,cleanup:I0}=H(N0,!1,!0);if(m.push(_X),kX)W0.push(I0)}}else if(J0(F0)){if(u(N0)){E0+=2;let C0=x(N0,F0,Z0,{end:R0});if(_(F0)&&kX)W0.push(C0)}else if(H0(N0)||l(N0)){let C0=N0.readable||N0;E0++,$(C0,F0,Z0,{end:R0})}else if(v(N0))E0++,$(N0,F0,Z0,{end:R0});else throw new R("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],N0);N0=F0}else if(V0(F0)){if(u(N0))E0++,q(T(N0),F0,Z0,{end:R0});else if(l(N0)||v(N0))E0++,q(N0,F0,Z0,{end:R0});else if(H0(N0))E0++,q(N0.readable,F0,Z0,{end:R0});else throw new R("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],N0);N0=F0}else N0=C.from(F0)}if(i!==null&&i!==void 0&&i.aborted||o!==null&&o!==void 0&&o.aborted)U.nextTick(r);return N0}function x(f,b,s,{end:z0}){let i=!1;if(b.on("close",()=>{if(!i)s(new I)}),f.pipe(b,{end:!1}),z0){let W0=function(){i=!0,b.end()};var o=W0;if(U0(f))U.nextTick(W0);else f.once("end",W0)}else s();return K(f,{readable:!0,writable:!1},(W0)=>{let r=f._readableState;if(W0&&W0.code==="ERR_STREAM_PREMATURE_CLOSE"&&r&&r.ended&&!r.errored&&!r.errorEmitted)f.once("end",s).once("error",s);else s(W0)}),K(b,{readable:!1,writable:!0},s)}Z.exports={pipelineImpl:L,pipeline:j}}),nG=CX((X,Z)=>{var{pipeline:U}=DY(),Q=XQ(),{destroyer:G}=sQ(),{isNodeStream:O,isReadable:Y,isWritable:K,isWebStream:A,isTransformStream:D,isWritableStream:C,isReadableStream:z}=ZQ(),{AbortError:R,codes:{ERR_INVALID_ARG_VALUE:S,ERR_MISSING_ARGS:P}}=DZ(),N=FQ();Z.exports=function(...I){if(I.length===0)throw new P("streams");if(I.length===1)return Q.from(I[0]);let B=[...I];if(typeof I[0]==="function")I[0]=Q.from(I[0]);if(typeof I[I.length-1]==="function"){let J=I.length-1;I[J]=Q.from(I[J])}for(let J=0;J<I.length;++J){if(!O(I[J])&&!A(I[J]))continue;if(J<I.length-1&&!(Y(I[J])||z(I[J])||D(I[J])))throw new S(`streams[${J}]`,B[J],"must be readable");if(J>0&&!(K(I[J])||C(I[J])||D(I[J])))throw new S(`streams[${J}]`,B[J],"must be writable")}let k,w,v,_,u;function J0(J){let W=_;if(_=null,W)W(J);else if(J)u.destroy(J);else if(!U0&&!l)u.destroy()}let H0=I[0],V0=U(I,J0),l=!!(K(H0)||C(H0)||D(H0)),U0=!!(Y(V0)||z(V0)||D(V0));if(u=new Q({writableObjectMode:!!(H0!==null&&H0!==void 0&&H0.writableObjectMode),readableObjectMode:!!(V0!==null&&V0!==void 0&&V0.readableObjectMode),writable:l,readable:U0}),l){if(O(H0))u._write=function(W,F,V){if(H0.write(W,F))V();else k=V},u._final=function(W){H0.end(),w=W},H0.on("drain",function(){if(k){let W=k;k=null,W()}});else if(A(H0)){let W=(D(H0)?H0.writable:H0).getWriter();u._write=async function(F,V,H){try{await W.ready,W.write(F).catch(()=>{}),H()}catch(M){H(M)}},u._final=async function(F){try{await W.ready,W.close().catch(()=>{}),w=F}catch(V){F(V)}}}let J=D(V0)?V0.readable:V0;N(J,()=>{if(w){let W=w;w=null,W()}})}if(U0){if(O(V0))V0.on("readable",function(){if(v){let J=v;v=null,J()}}),V0.on("end",function(){u.push(null)}),u._read=function(){while(!0){let J=V0.read();if(J===null){v=u._read;return}if(!u.push(J))return}};else if(A(V0)){let J=(D(V0)?V0.readable:V0).getReader();u._read=async function(){while(!0)try{let{value:W,done:F}=await J.read();if(!u.push(W))return;if(F){u.push(null);return}}catch{return}}}}return u._destroy=function(J,W){if(!J&&_!==null)J=new R;if(v=null,k=null,w=null,_===null)W(J);else if(_=W,O(V0))G(V0,J)},u}}),XF=CX((X,Z)=>{var U=globalThis.AbortController||MU().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Q,ERR_INVALID_ARG_TYPE:G,ERR_MISSING_ARGS:O,ERR_OUT_OF_RANGE:Y},AbortError:K}=DZ(),{validateAbortSignal:A,validateInteger:D,validateObject:C}=CU(),z=BX().Symbol("kWeak"),R=BX().Symbol("kResistStopPropagation"),{finished:S}=FQ(),P=nG(),{addAbortSignalNoValidate:N}=JJ(),{isWritable:I,isNodeStream:B}=ZQ(),{deprecate:k}=RZ(),{ArrayPrototypePush:w,Boolean:v,MathFloor:_,Number:u,NumberIsNaN:J0,Promise:H0,PromiseReject:V0,PromiseResolve:l,PromisePrototypeThen:U0,Symbol:J}=BX(),W=J("kEmpty"),F=J("kEof");function V(o,W0){if(W0!=null)C(W0,"options");if((W0===null||W0===void 0?void 0:W0.signal)!=null)A(W0.signal,"options.signal");if(B(o)&&!I(o))throw new Q("stream",o,"must be writable");let r=P(this,o);if(W0!==null&&W0!==void 0&&W0.signal)N(W0.signal,r);return r}function H(o,W0){if(typeof o!=="function")throw new G("fn",["Function","AsyncFunction"],o);if(W0!=null)C(W0,"options");if((W0===null||W0===void 0?void 0:W0.signal)!=null)A(W0.signal,"options.signal");let r=1;if((W0===null||W0===void 0?void 0:W0.concurrency)!=null)r=_(W0.concurrency);let X0=r-1;if((W0===null||W0===void 0?void 0:W0.highWaterMark)!=null)X0=_(W0.highWaterMark);return D(r,"options.concurrency",1),D(X0,"options.highWaterMark",0),X0+=r,async function*(){let d0=RZ().AbortSignalAny([W0===null||W0===void 0?void 0:W0.signal].filter(v)),c=this,m=[],E0={signal:d0},Z0,$0,N0=!1,d=0;function t(){N0=!0,l0()}function l0(){d-=1,e()}function e(){if($0&&!N0&&d<r&&m.length<X0)$0(),$0=null}async function F0(){try{for await(let ZX of c){if(N0)return;if(d0.aborted)throw new K;try{if(ZX=o(ZX,E0),ZX===W)continue;ZX=l(ZX)}catch(T0){ZX=V0(T0)}if(d+=1,U0(ZX,l0,t),m.push(ZX),Z0)Z0(),Z0=null;if(!N0&&(m.length>=X0||d>=r))await new H0((T0)=>{$0=T0})}m.push(F)}catch(ZX){let T0=V0(ZX);U0(T0,l0,t),m.push(T0)}finally{if(N0=!0,Z0)Z0(),Z0=null}}F0();try{while(!0){while(m.length>0){let ZX=await m[0];if(ZX===F)return;if(d0.aborted)throw new K;if(ZX!==W)yield ZX;m.shift(),e()}await new H0((ZX)=>{Z0=ZX})}}finally{if(N0=!0,$0)$0(),$0=null}}.call(this)}function M(o=void 0){if(o!=null)C(o,"options");if((o===null||o===void 0?void 0:o.signal)!=null)A(o.signal,"options.signal");return async function*(){let W0=0;for await(let X0 of this){var r;if(o!==null&&o!==void 0&&(r=o.signal)!==null&&r!==void 0&&r.aborted)throw new K({cause:o.signal.reason});yield[W0++,X0]}}.call(this)}async function T(o,W0=void 0){for await(let r of j.call(this,o,W0))return!0;return!1}async function E(o,W0=void 0){if(typeof o!=="function")throw new G("fn",["Function","AsyncFunction"],o);return!await T.call(this,async(...r)=>{return!await o(...r)},W0)}async function $(o,W0){for await(let r of j.call(this,o,W0))return r;return}async function q(o,W0){if(typeof o!=="function")throw new G("fn",["Function","AsyncFunction"],o);async function r(X0,d0){return await o(X0,d0),W}for await(let X0 of H.call(this,r,W0));}function j(o,W0){if(typeof o!=="function")throw new G("fn",["Function","AsyncFunction"],o);async function r(X0,d0){if(await o(X0,d0))return X0;return W}return H.call(this,r,W0)}class L extends O{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function x(o,W0,r){var X0;if(typeof o!=="function")throw new G("reducer",["Function","AsyncFunction"],o);if(r!=null)C(r,"options");if((r===null||r===void 0?void 0:r.signal)!=null)A(r.signal,"options.signal");let d0=arguments.length>1;if(r!==null&&r!==void 0&&(X0=r.signal)!==null&&X0!==void 0&&X0.aborted){let $0=new K(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await S(this.destroy($0)),$0}let c=new U,m=c.signal;if(r!==null&&r!==void 0&&r.signal){let $0={once:!0,[z]:this,[R]:!0};r.signal.addEventListener("abort",()=>c.abort(),$0)}let E0=!1;try{for await(let $0 of this){var Z0;if(E0=!0,r!==null&&r!==void 0&&(Z0=r.signal)!==null&&Z0!==void 0&&Z0.aborted)throw new K;if(!d0)W0=$0,d0=!0;else W0=await o(W0,$0,{signal:m})}if(!E0&&!d0)throw new L}finally{c.abort()}return W0}async function f(o){if(o!=null)C(o,"options");if((o===null||o===void 0?void 0:o.signal)!=null)A(o.signal,"options.signal");let W0=[];for await(let X0 of this){var r;if(o!==null&&o!==void 0&&(r=o.signal)!==null&&r!==void 0&&r.aborted)throw new K(void 0,{cause:o.signal.reason});w(W0,X0)}return W0}function b(o,W0){let r=H.call(this,o,W0);return async function*(){for await(let X0 of r)yield*X0}.call(this)}function s(o){if(o=u(o),J0(o))return 0;if(o<0)throw new Y("number",">= 0",o);return o}function z0(o,W0=void 0){if(W0!=null)C(W0,"options");if((W0===null||W0===void 0?void 0:W0.signal)!=null)A(W0.signal,"options.signal");return o=s(o),async function*(){var r;if(W0!==null&&W0!==void 0&&(r=W0.signal)!==null&&r!==void 0&&r.aborted)throw new K;for await(let d0 of this){var X0;if(W0!==null&&W0!==void 0&&(X0=W0.signal)!==null&&X0!==void 0&&X0.aborted)throw new K;if(o--<=0)yield d0}}.call(this)}function i(o,W0=void 0){if(W0!=null)C(W0,"options");if((W0===null||W0===void 0?void 0:W0.signal)!=null)A(W0.signal,"options.signal");return o=s(o),async function*(){var r;if(W0!==null&&W0!==void 0&&(r=W0.signal)!==null&&r!==void 0&&r.aborted)throw new K;for await(let d0 of this){var X0;if(W0!==null&&W0!==void 0&&(X0=W0.signal)!==null&&X0!==void 0&&X0.aborted)throw new K;if(o-- >0)yield d0;if(o<=0)return}}.call(this)}Z.exports.streamReturningOperators={asIndexedPairs:k(M,"readable.asIndexedPairs will be removed in a future version."),drop:z0,filter:j,flatMap:b,map:H,take:i,compose:V},Z.exports.promiseReturningOperators={every:E,forEach:q,reduce:x,toArray:f,some:T,find:$}}),sG=CX((X,Z)=>{var{ArrayPrototypePop:U,Promise:Q}=BX(),{isIterable:G,isNodeStream:O,isWebStream:Y}=ZQ(),{pipelineImpl:K}=DY(),{finished:A}=FQ();rG();function D(...C){return new Q((z,R)=>{let S,P,N=C[C.length-1];if(N&&typeof N==="object"&&!O(N)&&!G(N)&&!Y(N)){let I=U(C);S=I.signal,P=I.end}K(C,(I,B)=>{if(I)R(I);else z(B)},{signal:S,end:P})})}Z.exports={finished:A,pipeline:D}}),rG=CX((X,Z)=>{var{Buffer:U}=(UZ(),WX(QZ)),{ObjectDefineProperty:Q,ObjectKeys:G,ReflectApply:O}=BX(),{promisify:{custom:Y}}=RZ(),{streamReturningOperators:K,promiseReturningOperators:A}=XF(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:D}}=DZ(),C=nG(),{setDefaultHighWaterMark:z,getDefaultHighWaterMark:R}=YJ(),{pipeline:S}=DY(),{destroyer:P}=sQ(),N=FQ(),I=sG(),B=ZQ(),k=Z.exports=EY().Stream;k.isDestroyed=B.isDestroyed,k.isDisturbed=B.isDisturbed,k.isErrored=B.isErrored,k.isReadable=B.isReadable,k.isWritable=B.isWritable,k.Readable=$J();for(let v of G(K)){let _=function(...J0){if(new.target)throw D();return k.Readable.from(O(u,this,J0))},u=K[v];Q(_,"name",{__proto__:null,value:u.name}),Q(_,"length",{__proto__:null,value:u.length}),Q(k.Readable.prototype,v,{__proto__:null,value:_,enumerable:!1,configurable:!0,writable:!0})}for(let v of G(A)){let _=function(...J0){if(new.target)throw D();return O(u,this,J0)},u=A[v];Q(_,"name",{__proto__:null,value:u.name}),Q(_,"length",{__proto__:null,value:u.length}),Q(k.Readable.prototype,v,{__proto__:null,value:_,enumerable:!1,configurable:!0,writable:!0})}k.Writable=zY(),k.Duplex=XQ(),k.Transform=mG(),k.PassThrough=oG(),k.pipeline=S;var{addAbortSignal:w}=JJ();k.addAbortSignal=w,k.finished=N,k.destroy=P,k.compose=C,k.setDefaultHighWaterMark=z,k.getDefaultHighWaterMark=R,Q(k,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return I}}),Q(S,Y,{__proto__:null,enumerable:!0,get(){return I.pipeline}}),Q(N,Y,{__proto__:null,enumerable:!0,get(){return I.finished}}),k.Stream=k,k._isUint8Array=function(v){return v instanceof Uint8Array},k._uint8ArrayToBuffer=function(v){return U.from(v.buffer,v.byteOffset,v.byteLength)}}),ZF=CX((X,Z)=>{var U=qY();{let Q=rG(),G=sG(),O=Q.Readable.destroy;Z.exports=Q.Readable,Z.exports._uint8ArrayToBuffer=Q._uint8ArrayToBuffer,Z.exports._isUint8Array=Q._isUint8Array,Z.exports.isDisturbed=Q.isDisturbed,Z.exports.isErrored=Q.isErrored,Z.exports.isReadable=Q.isReadable,Z.exports.Readable=Q.Readable,Z.exports.Writable=Q.Writable,Z.exports.Duplex=Q.Duplex,Z.exports.Transform=Q.Transform,Z.exports.PassThrough=Q.PassThrough,Z.exports.addAbortSignal=Q.addAbortSignal,Z.exports.finished=Q.finished,Z.exports.destroy=Q.destroy,Z.exports.destroy=O,Z.exports.pipeline=Q.pipeline,Z.exports.compose=Q.compose,Object.defineProperty(Q,"promises",{configurable:!0,enumerable:!0,get(){return G}}),Z.exports.Stream=Q.Stream}Z.exports.default=Z.exports});aG.exports=ZF()});var KZ={};yU(KZ,{webcrypto:()=>N1,rng:()=>cK,randomUUID:()=>L1,randomFillSync:()=>A1,randomFill:()=>C1,randomBytes:()=>uK,publicEncrypt:()=>z1,publicDecrypt:()=>q1,pseudoRandomBytes:()=>pK,prng:()=>hK,privateEncrypt:()=>D1,privateDecrypt:()=>M1,pbkdf2Sync:()=>sK,pbkdf2:()=>nK,listCiphers:()=>J1,getRandomValues:()=>S1,getHashes:()=>oK,getDiffieHellman:()=>G1,getCurves:()=>j1,getCiphers:()=>U1,default:()=>B1,createVerify:()=>F1,createSign:()=>O1,createHmac:()=>mK,createHash:()=>dK,createECDH:()=>E1,createDiffieHellmanGroup:()=>$1,createDiffieHellman:()=>V1,createDecipheriv:()=>Q1,createDecipher:()=>X1,createCredentials:()=>T1,createCipheriv:()=>iK,createCipher:()=>aK,constants:()=>R1,Verify:()=>K1,Sign:()=>H1,Hmac:()=>lK,Hash:()=>bK,DiffieHellmanGroup:()=>Y1,DiffieHellman:()=>W1,Decipheriv:()=>Z1,Decipher:()=>eK,DEFAULT_ENCODING:()=>P1,Cipheriv:()=>tK,Cipher:()=>rK});function j1(){return I1}var QF,UF,tG,JF,YF,$F=(X,Z,U)=>{U=X!=null?QF(UF(X)):{};let Q=Z||!X||!X.__esModule?tG(U,"default",{value:X,enumerable:!0}):U;for(let G of JF(X))if(!YF.call(Q,G))tG(Q,G,{get:()=>X[G],enumerable:!0});return Q},D0=(X,Z)=>()=>(Z||X((Z={exports:{}}).exports,Z),Z.exports),GJ,VJ,eG,GF,CY,AY,qZ,VF,TU,XV,WF,OF,HF,FF,ZV,KF,EF,zF,DF,qF,MF,CF,AF,TF,RF,RU,WJ,QV,PF,UV,JV,SF,PU,TY,RY,LF,YV,PY,IF,$V,jF,GV,VV,NF,BF,kF,xF,wF,vF,_F,yF,fF,gF,hF,pF,cF,uF,SY,WV,bF,OV,dF,lF,mF,oF,QQ,KQ,HV,BZ,FV,OJ,nF,LZ,sF,rF,aF,KV,mZ,SU,EV,tF,zV,iF,DV,eF,XK,ZK,QK,LY,UK,IY,JK,YK,$K,GK,VK,WK,OK,HK,FK,KK,EK,zK,DK,qK,iG,MK,AU,CK,qV,MV,AK,TK,CV,RK,PK,LU,SK,LK,IK,jK,NK,BK,AV,kK,TV,RV,PV,jY,SV,xK,LV,wK,vK,MY,_K,yK,fK,gK,VX,hK,pK,cK,uK,bK,dK,lK,mK,oK,nK,sK,rK,aK,tK,iK,eK,X1,Z1,Q1,U1,J1,Y1,$1,G1,V1,W1,O1,H1,F1,K1,E1,z1,D1,q1,M1,C1,A1,T1,R1,P1="buffer",S1=(X)=>{return crypto.getRandomValues(X)},L1=()=>{return crypto.randomUUID()},I1,N1,B1;var EZ=fU(()=>{QF=Object.create,{getPrototypeOf:UF,defineProperty:tG,getOwnPropertyNames:JF}=Object,YF=Object.prototype.hasOwnProperty,GJ=D0((X,Z)=>{Z.exports=(EZ(),WX(KZ)).randomBytes}),VJ=D0((X,Z)=>{Z.exports=(EZ(),WX(KZ)).createHash}),eG=D0((X,Z)=>{Z.exports=(EZ(),WX(KZ)).createHmac}),GF=D0((X,Z)=>{Z.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"}}}),CY=D0((X,Z)=>{var U=isFinite,Q=Math.pow(2,30)-1;Z.exports=function(G,O){if(typeof G!=="number")throw TypeError("Iterations not a number");if(G<0||!U(G))throw TypeError("Bad iterations");if(typeof O!=="number")throw TypeError("Key length not a number");if(O<0||O>Q||O!==O)throw TypeError("Bad key length")}}),AY=D0((X,Z)=>{var U;if(globalThis.process&&globalThis.process.browser)U="utf-8";else if(globalThis.process&&globalThis.process.version)Q=parseInt(process.version.split(".")[0].slice(1),10),U=Q>=6?"utf-8":"binary";else U="utf-8";var Q;Z.exports=U}),qZ=D0((X,Z)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var U=(UZ(),WX(QZ)),Q=U.Buffer;function G(Y,K){for(var A in Y)K[A]=Y[A]}if(Q.from&&Q.alloc&&Q.allocUnsafe&&Q.allocUnsafeSlow)Z.exports=U;else G(U,X),X.Buffer=O;function O(Y,K,A){return Q(Y,K,A)}O.prototype=Object.create(Q.prototype),G(Q,O),O.from=function(Y,K,A){if(typeof Y==="number")throw TypeError("Argument must not be a number");return Q(Y,K,A)},O.alloc=function(Y,K,A){if(typeof Y!=="number")throw TypeError("Argument must be a number");var D=Q(Y);if(K!==void 0)if(typeof A==="string")D.fill(K,A);else D.fill(K);else D.fill(0);return D},O.allocUnsafe=function(Y){if(typeof Y!=="number")throw TypeError("Argument must be a number");return Q(Y)},O.allocUnsafeSlow=function(Y){if(typeof Y!=="number")throw TypeError("Argument must be a number");return U.SlowBuffer(Y)}}),VF=D0((X,Z)=>{var U={}.toString;Z.exports=Array.isArray||function(Q){return U.call(Q)=="[object Array]"}}),TU=D0((X,Z)=>{Z.exports=TypeError}),XV=D0((X,Z)=>{Z.exports=Object}),WF=D0((X,Z)=>{Z.exports=Error}),OF=D0((X,Z)=>{Z.exports=EvalError}),HF=D0((X,Z)=>{Z.exports=RangeError}),FF=D0((X,Z)=>{Z.exports=ReferenceError}),ZV=D0((X,Z)=>{Z.exports=SyntaxError}),KF=D0((X,Z)=>{Z.exports=URIError}),EF=D0((X,Z)=>{Z.exports=Math.abs}),zF=D0((X,Z)=>{Z.exports=Math.floor}),DF=D0((X,Z)=>{Z.exports=Math.max}),qF=D0((X,Z)=>{Z.exports=Math.min}),MF=D0((X,Z)=>{Z.exports=Math.pow}),CF=D0((X,Z)=>{Z.exports=Math.round}),AF=D0((X,Z)=>{Z.exports=Number.isNaN||function(U){return U!==U}}),TF=D0((X,Z)=>{var U=AF();Z.exports=function(Q){if(U(Q)||Q===0)return Q;return Q<0?-1:1}}),RF=D0((X,Z)=>{Z.exports=Object.getOwnPropertyDescriptor}),RU=D0((X,Z)=>{var U=RF();if(U)try{U([],"length")}catch(Q){U=null}Z.exports=U}),WJ=D0((X,Z)=>{var U=Object.defineProperty||!1;if(U)try{U({},"a",{value:1})}catch(Q){U=!1}Z.exports=U}),QV=D0((X,Z)=>{Z.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var U={},Q=Symbol("test"),G=Object(Q);if(typeof Q==="string")return!1;if(Object.prototype.toString.call(Q)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(G)!=="[object Symbol]")return!1;var O=42;U[Q]=O;for(var Y in U)return!1;if(typeof Object.keys==="function"&&Object.keys(U).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(U).length!==0)return!1;var K=Object.getOwnPropertySymbols(U);if(K.length!==1||K[0]!==Q)return!1;if(!Object.prototype.propertyIsEnumerable.call(U,Q))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var A=Object.getOwnPropertyDescriptor(U,Q);if(A.value!==O||A.enumerable!==!0)return!1}return!0}}),PF=D0((X,Z)=>{var U=typeof Symbol<"u"&&Symbol,Q=QV();Z.exports=function(){if(typeof U!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof U("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return Q()}}),UV=D0((X,Z)=>{Z.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),JV=D0((X,Z)=>{var U=XV();Z.exports=U.getPrototypeOf||null}),SF=D0((X,Z)=>{var U="Function.prototype.bind called on incompatible ",Q=Object.prototype.toString,G=Math.max,O="[object Function]",Y=function(D,C){var z=[];for(var R=0;R<D.length;R+=1)z[R]=D[R];for(var S=0;S<C.length;S+=1)z[S+D.length]=C[S];return z},K=function(D,C){var z=[];for(var R=C||0,S=0;R<D.length;R+=1,S+=1)z[S]=D[R];return z},A=function(D,C){var z="";for(var R=0;R<D.length;R+=1)if(z+=D[R],R+1<D.length)z+=C;return z};Z.exports=function(D){var C=this;if(typeof C!=="function"||Q.apply(C)!==O)throw TypeError(U+C);var z=K(arguments,1),R,S=function(){if(this instanceof R){var k=C.apply(this,Y(z,arguments));if(Object(k)===k)return k;return this}return C.apply(D,Y(z,arguments))},P=G(0,C.length-z.length),N=[];for(var I=0;I<P;I++)N[I]="$"+I;if(R=Function("binder","return function ("+A(N,",")+"){ return binder.apply(this,arguments); }")(S),C.prototype){var B=function(){};B.prototype=C.prototype,R.prototype=new B,B.prototype=null}return R}}),PU=D0((X,Z)=>{var U=SF();Z.exports=Function.prototype.bind||U}),TY=D0((X,Z)=>{Z.exports=Function.prototype.call}),RY=D0((X,Z)=>{Z.exports=Function.prototype.apply}),LF=D0((X,Z)=>{Z.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),YV=D0((X,Z)=>{var U=PU(),Q=RY(),G=TY(),O=LF();Z.exports=O||U.call(G,Q)}),PY=D0((X,Z)=>{var U=PU(),Q=TU(),G=TY(),O=YV();Z.exports=function(Y){if(Y.length<1||typeof Y[0]!=="function")throw new Q("a function is required");return O(U,G,Y)}}),IF=D0((X,Z)=>{var U=PY(),Q=RU(),G;try{G=[].__proto__===Array.prototype}catch(A){if(!A||typeof A!=="object"||!("code"in A)||A.code!=="ERR_PROTO_ACCESS")throw A}var O=!!G&&Q&&Q(Object.prototype,"__proto__"),Y=Object,K=Y.getPrototypeOf;Z.exports=O&&typeof O.get==="function"?U([O.get]):typeof K==="function"?function(A){return K(A==null?A:Y(A))}:!1}),$V=D0((X,Z)=>{var U=UV(),Q=JV(),G=IF();Z.exports=U?function(O){return U(O)}:Q?function(O){if(!O||typeof O!=="object"&&typeof O!=="function")throw TypeError("getProto: not an object");return Q(O)}:G?function(O){return G(O)}:null}),jF=D0((X,Z)=>{var U=Function.prototype.call,Q=Object.prototype.hasOwnProperty,G=PU();Z.exports=G.call(U,Q)}),GV=D0((X,Z)=>{var U,Q=XV(),G=WF(),O=OF(),Y=HF(),K=FF(),A=ZV(),D=TU(),C=KF(),z=EF(),R=zF(),S=DF(),P=qF(),N=MF(),I=CF(),B=TF(),k=Function,w=function(W0){try{return k('"use strict"; return ('+W0+").constructor;")()}catch(r){}},v=RU(),_=WJ(),u=function(){throw new D},J0=v?function(){try{return arguments.callee,u}catch(W0){try{return v(arguments,"callee").get}catch(r){return u}}}():u,H0=PF()(),V0=$V(),l=JV(),U0=UV(),J=RY(),W=TY(),F={},V=typeof Uint8Array>"u"||!V0?U:V0(Uint8Array),H={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":H0&&V0?V0([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":F,"%AsyncGenerator%":F,"%AsyncGeneratorFunction%":F,"%AsyncIteratorPrototype%":F,"%Atomics%":typeof Atomics>"u"?U:Atomics,"%BigInt%":typeof BigInt>"u"?U:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?U:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?U:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?U:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":G,"%eval%":eval,"%EvalError%":O,"%Float16Array%":typeof Float16Array>"u"?U:Float16Array,"%Float32Array%":typeof Float32Array>"u"?U:Float32Array,"%Float64Array%":typeof Float64Array>"u"?U:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?U:FinalizationRegistry,"%Function%":k,"%GeneratorFunction%":F,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":H0&&V0?V0(V0([][Symbol.iterator]())):U,"%JSON%":typeof JSON==="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!H0||!V0?U:V0(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Q,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":Y,"%ReferenceError%":K,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!H0||!V0?U:V0(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":H0&&V0?V0(""[Symbol.iterator]()):U,"%Symbol%":H0?Symbol:U,"%SyntaxError%":A,"%ThrowTypeError%":J0,"%TypedArray%":V,"%TypeError%":D,"%Uint8Array%":typeof Uint8Array>"u"?U:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?U:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?U:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?U:Uint32Array,"%URIError%":C,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet,"%Function.prototype.call%":W,"%Function.prototype.apply%":J,"%Object.defineProperty%":_,"%Object.getPrototypeOf%":l,"%Math.abs%":z,"%Math.floor%":R,"%Math.max%":S,"%Math.min%":P,"%Math.pow%":N,"%Math.round%":I,"%Math.sign%":B,"%Reflect.getPrototypeOf%":U0};if(V0)try{null.error}catch(W0){M=V0(V0(W0)),H["%Error.prototype%"]=M}var M,T=function W0(r){var X0;if(r==="%AsyncFunction%")X0=w("async function () {}");else if(r==="%GeneratorFunction%")X0=w("function* () {}");else if(r==="%AsyncGeneratorFunction%")X0=w("async function* () {}");else if(r==="%AsyncGenerator%"){var d0=W0("%AsyncGeneratorFunction%");if(d0)X0=d0.prototype}else if(r==="%AsyncIteratorPrototype%"){var c=W0("%AsyncGenerator%");if(c&&V0)X0=V0(c.prototype)}return H[r]=X0,X0},E={__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"]},$=PU(),q=jF(),j=$.call(W,Array.prototype.concat),L=$.call(J,Array.prototype.splice),x=$.call(W,String.prototype.replace),f=$.call(W,String.prototype.slice),b=$.call(W,RegExp.prototype.exec),s=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,z0=/\\(\\)?/g,i=function(W0){var r=f(W0,0,1),X0=f(W0,-1);if(r==="%"&&X0!=="%")throw new A("invalid intrinsic syntax, expected closing `%`");else if(X0==="%"&&r!=="%")throw new A("invalid intrinsic syntax, expected opening `%`");var d0=[];return x(W0,s,function(c,m,E0,Z0){d0[d0.length]=E0?x(Z0,z0,"$1"):m||c}),d0},o=function(W0,r){var X0=W0,d0;if(q(E,X0))d0=E[X0],X0="%"+d0[0]+"%";if(q(H,X0)){var c=H[X0];if(c===F)c=T(X0);if(typeof c>"u"&&!r)throw new D("intrinsic "+W0+" exists, but is not available. Please file an issue!");return{alias:d0,name:X0,value:c}}throw new A("intrinsic "+W0+" does not exist!")};Z.exports=function(W0,r){if(typeof W0!=="string"||W0.length===0)throw new D("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!=="boolean")throw new D('"allowMissing" argument must be a boolean');if(b(/^%?[^%]*%?$/,W0)===null)throw new A("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var X0=i(W0),d0=X0.length>0?X0[0]:"",c=o("%"+d0+"%",r),m=c.name,E0=c.value,Z0=!1,$0=c.alias;if($0)d0=$0[0],L(X0,j([0,1],$0));for(var N0=1,d=!0;N0<X0.length;N0+=1){var t=X0[N0],l0=f(t,0,1),e=f(t,-1);if((l0==='"'||l0==="'"||l0==="`"||(e==='"'||e==="'"||e==="`"))&&l0!==e)throw new A("property names with quotes must have matching quotes");if(t==="constructor"||!d)Z0=!0;if(d0+="."+t,m="%"+d0+"%",q(H,m))E0=H[m];else if(E0!=null){if(!(t in E0)){if(!r)throw new D("base intrinsic for "+W0+" exists, but the property is not available.");return}if(v&&N0+1>=X0.length){var F0=v(E0,t);if(d=!!F0,d&&"get"in F0&&!("originalValue"in F0.get))E0=F0.get;else E0=E0[t]}else d=q(E0,t),E0=E0[t];if(d&&!Z0)H[m]=E0}}return E0}}),VV=D0((X,Z)=>{var U=GV(),Q=PY(),G=Q([U("%String.prototype.indexOf%")]);Z.exports=function(O,Y){var K=U(O,!!Y);if(typeof K==="function"&&G(O,".prototype.")>-1)return Q([K]);return K}}),NF=D0((X,Z)=>{var U=Function.prototype.toString,Q=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,G,O;if(typeof Q==="function"&&typeof Object.defineProperty==="function")try{G=Object.defineProperty({},"length",{get:function(){throw O}}),O={},Q(function(){throw 42},null,G)}catch(v){if(v!==O)Q=null}else Q=null;var Y=/^\s*class\b/,K=function(v){try{var _=U.call(v);return Y.test(_)}catch(u){return!1}},A=function(v){try{if(K(v))return!1;return U.call(v),!0}catch(_){return!1}},D=Object.prototype.toString,C="[object Object]",z="[object Function]",R="[object GeneratorFunction]",S="[object HTMLAllCollection]",P="[object HTML document.all class]",N="[object HTMLCollection]",I=typeof Symbol==="function"&&!!Symbol.toStringTag,B=!(0 in[,]),k=function(){return!1};if(typeof document==="object"){if(w=document.all,D.call(w)===D.call(document.all))k=function(v){if((B||!v)&&(typeof v>"u"||typeof v==="object"))try{var _=D.call(v);return(_===S||_===P||_===N||_===C)&&v("")==null}catch(u){}return!1}}var w;Z.exports=Q?function(v){if(k(v))return!0;if(!v)return!1;if(typeof v!=="function"&&typeof v!=="object")return!1;try{Q(v,null,G)}catch(_){if(_!==O)return!1}return!K(v)&&A(v)}:function(v){if(k(v))return!0;if(!v)return!1;if(typeof v!=="function"&&typeof v!=="object")return!1;if(I)return A(v);if(K(v))return!1;var _=D.call(v);if(_!==z&&_!==R&&!/^\[object HTML/.test(_))return!1;return A(v)}}),BF=D0((X,Z)=>{var U=NF(),Q=Object.prototype.toString,G=Object.prototype.hasOwnProperty,O=function(D,C,z){for(var R=0,S=D.length;R<S;R++)if(G.call(D,R))if(z==null)C(D[R],R,D);else C.call(z,D[R],R,D)},Y=function(D,C,z){for(var R=0,S=D.length;R<S;R++)if(z==null)C(D.charAt(R),R,D);else C.call(z,D.charAt(R),R,D)},K=function(D,C,z){for(var R in D)if(G.call(D,R))if(z==null)C(D[R],R,D);else C.call(z,D[R],R,D)};function A(D){return Q.call(D)==="[object Array]"}Z.exports=function(D,C,z){if(!U(C))throw TypeError("iterator must be a function");var R;if(arguments.length>=3)R=z;if(A(D))O(D,C,R);else if(typeof D==="string")Y(D,C,R);else K(D,C,R)}}),kF=D0((X,Z)=>{Z.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),xF=D0((X,Z)=>{var U=kF(),Q=typeof globalThis>"u"?globalThis:globalThis;Z.exports=function(){var G=[];for(var O=0;O<U.length;O++)if(typeof Q[U[O]]==="function")G[G.length]=U[O];return G}}),wF=D0((X,Z)=>{var U=WJ(),Q=ZV(),G=TU(),O=RU();Z.exports=function(Y,K,A){if(!Y||typeof Y!=="object"&&typeof Y!=="function")throw new G("`obj` must be an object or a function`");if(typeof K!=="string"&&typeof K!=="symbol")throw new G("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new G("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new G("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new G("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new G("`loose`, if provided, must be a boolean");var D=arguments.length>3?arguments[3]:null,C=arguments.length>4?arguments[4]:null,z=arguments.length>5?arguments[5]:null,R=arguments.length>6?arguments[6]:!1,S=!!O&&O(Y,K);if(U)U(Y,K,{configurable:z===null&&S?S.configurable:!z,enumerable:D===null&&S?S.enumerable:!D,value:A,writable:C===null&&S?S.writable:!C});else if(R||!D&&!C&&!z)Y[K]=A;else throw new Q("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),vF=D0((X,Z)=>{var U=WJ(),Q=function(){return!!U};Q.hasArrayLengthDefineBug=function(){if(!U)return null;try{return U([],"length",{value:1}).length!==1}catch(G){return!0}},Z.exports=Q}),_F=D0((X,Z)=>{var U=GV(),Q=wF(),G=vF()(),O=RU(),Y=TU(),K=U("%Math.floor%");Z.exports=function(A,D){if(typeof A!=="function")throw new Y("`fn` is not a function");if(typeof D!=="number"||D<0||D>4294967295||K(D)!==D)throw new Y("`length` must be a positive 32-bit integer");var C=arguments.length>2&&!!arguments[2],z=!0,R=!0;if("length"in A&&O){var S=O(A,"length");if(S&&!S.configurable)z=!1;if(S&&!S.writable)R=!1}if(z||R||!C)if(G)Q(A,"length",D,!0,!0);else Q(A,"length",D);return A}}),yF=D0((X,Z)=>{var U=PU(),Q=RY(),G=YV();Z.exports=function(){return G(U,Q,arguments)}}),fF=D0((X,Z)=>{var U=_F(),Q=WJ(),G=PY(),O=yF();if(Z.exports=function(Y){var K=G(arguments),A=Y.length-(arguments.length-1);return U(K,1+(A>0?A:0),!0)},Q)Q(Z.exports,"apply",{value:O});else Z.exports.apply=O}),gF=D0((X,Z)=>{var U=QV();Z.exports=function(){return U()&&!!Symbol.toStringTag}}),hF=D0((X,Z)=>{var U=BF(),Q=xF(),G=fF(),O=VV(),Y=RU(),K=$V(),A=O("Object.prototype.toString"),D=gF()(),C=typeof globalThis>"u"?globalThis:globalThis,z=Q(),R=O("String.prototype.slice"),S=O("Array.prototype.indexOf",!0)||function(B,k){for(var w=0;w<B.length;w+=1)if(B[w]===k)return w;return-1},P={__proto__:null};if(D&&Y&&K)U(z,function(B){var k=new C[B];if(Symbol.toStringTag in k&&K){var w=K(k),v=Y(w,Symbol.toStringTag);if(!v&&w){var _=K(w);v=Y(_,Symbol.toStringTag)}P["$"+B]=G(v.get)}});else U(z,function(B){var k=new C[B],w=k.slice||k.set;if(w)P["$"+B]=G(w)});var N=function(B){var k=!1;return U(P,function(w,v){if(!k)try{if("$"+w(B)===v)k=R(v,1)}catch(_){}}),k},I=function(B){var k=!1;return U(P,function(w,v){if(!k)try{w(B),k=R(v,1)}catch(_){}}),k};Z.exports=function(B){if(!B||typeof B!=="object")return!1;if(!D){var k=R(A(B),8,-1);if(S(z,k)>-1)return k;if(k!=="Object")return!1;return I(B)}if(!Y)return null;return N(B)}}),pF=D0((X,Z)=>{var U=hF();Z.exports=function(Q){return!!U(Q)}}),cF=D0((X,Z)=>{var U=TU(),Q=VV(),G=Q("TypedArray.prototype.buffer",!0),O=pF();Z.exports=G||function(Y){if(!O(Y))throw new U("Not a Typed Array");return Y.buffer}}),uF=D0((X,Z)=>{var U=qZ().Buffer,Q=VF(),G=cF(),O=ArrayBuffer.isView||function(D){try{return G(D),!0}catch(C){return!1}},Y=typeof Uint8Array<"u",K=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",A=K&&(U.prototype instanceof Uint8Array||U.TYPED_ARRAY_SUPPORT);Z.exports=function(D,C){if(U.isBuffer(D)){if(D.constructor&&!("isBuffer"in D))return U.from(D);return D}if(typeof D==="string")return U.from(D,C);if(K&&O(D)){if(D.byteLength===0)return U.alloc(0);if(A){var z=U.from(D.buffer,D.byteOffset,D.byteLength);if(z.byteLength===D.byteLength)return z}var R=D instanceof Uint8Array?D:new Uint8Array(D.buffer,D.byteOffset,D.byteLength),S=U.from(R);if(S.length===D.byteLength)return S}if(Y&&D instanceof Uint8Array)return U.from(D);var P=Q(D);if(P)for(var N=0;N<D.length;N+=1){var I=D[N];if(typeof I!=="number"||I<0||I>255||~~I!==I)throw RangeError("Array items must be numbers in the range 0-255.")}if(P||U.isBuffer(D)&&D.constructor&&typeof D.constructor.isBuffer==="function"&&D.constructor.isBuffer(D))return U.from(D);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),SY=D0((X,Z)=>{var U=qZ().Buffer,Q=uF(),G=typeof Uint8Array<"u",O=G&&typeof ArrayBuffer<"u",Y=O&&ArrayBuffer.isView;Z.exports=function(K,A,D){if(typeof K==="string"||U.isBuffer(K)||G&&K instanceof Uint8Array||Y&&Y(K))return Q(K,A);throw TypeError(D+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),WV=D0((X,Z)=>{var U={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},Q={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},G=eG(),O=qZ().Buffer,Y=CY(),K=AY(),A=SY();function D(C,z,R,S,P){Y(R,S),C=A(C,K,"Password"),z=A(z,K,"Salt");var N=(P||"sha1").toLowerCase(),I=Q[N]||N,B=U[I];if(typeof B!=="number"||!B)throw TypeError("Digest algorithm not supported: "+P);var k=O.allocUnsafe(S),w=O.allocUnsafe(z.length+4);z.copy(w,0,0,z.length);var v=0,_=B,u=Math.ceil(S/_);for(var J0=1;J0<=u;J0++){w.writeUInt32BE(J0,z.length);var H0=G(I,C).update(w).digest(),V0=H0;for(var l=1;l<R;l++){V0=G(I,C).update(V0).digest();for(var U0=0;U0<_;U0++)H0[U0]^=V0[U0]}H0.copy(k,v),v+=_}return k}Z.exports=D}),bF=D0((X,Z)=>{var U=qZ().Buffer,Q=CY(),G=AY(),O=WV(),Y=SY(),K,A=globalThis.crypto&&globalThis.crypto.subtle,D={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"},C=[],z;function R(){if(z)return z;if(globalThis.process&&globalThis.process.nextTick)z=globalThis.process.nextTick;else if(globalThis.queueMicrotask)z=globalThis.queueMicrotask;else if(globalThis.setImmediate)z=globalThis.setImmediate;else z=globalThis.setTimeout;return z}function S(I,B,k,w,v){return A.importKey("raw",I,{name:"PBKDF2"},!1,["deriveBits"]).then(function(_){return A.deriveBits({name:"PBKDF2",salt:B,iterations:k,hash:{name:v}},_,w<<3)}).then(function(_){return U.from(_)})}function P(I){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!A||!A.importKey||!A.deriveBits)return Promise.resolve(!1);if(C[I]!==void 0)return C[I];K=K||U.alloc(8);var B=S(K,K,10,128,I).then(function(){return!0},function(){return!1});return C[I]=B,B}function N(I,B){I.then(function(k){R()(function(){B(null,k)})},function(k){R()(function(){B(k)})})}Z.exports=function(I,B,k,w,v,_){if(typeof v==="function")_=v,v=void 0;if(Q(k,w),I=Y(I,G,"Password"),B=Y(B,G,"Salt"),typeof _!=="function")throw Error("No callback provided to pbkdf2");v=v||"sha1";var u=D[v.toLowerCase()];if(!u||typeof globalThis.Promise!=="function"){R()(function(){var J0;try{J0=O(I,B,k,w,v)}catch(H0){_(H0);return}_(null,J0)});return}N(P(u).then(function(J0){if(J0)return S(I,B,k,w,u);return O(I,B,k,w,v)}),_)}}),OV=D0((X)=>{var Z=(EZ(),WX(KZ)),U=CY(),Q=AY(),G=SY();function O(K,A,D,C,z,R){if(U(D,C),K=G(K,Q,"Password"),A=G(A,Q,"Salt"),typeof z==="function")R=z,z="sha1";if(typeof R!=="function")throw Error("No callback provided to pbkdf2");return Z.pbkdf2(K,A,D,C,z,R)}function Y(K,A,D,C,z){return U(D,C),K=G(K,Q,"Password"),A=G(A,Q,"Salt"),z=z||"sha1",Z.pbkdf2Sync(K,A,D,C,z)}if(!Z.pbkdf2Sync||Z.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)X.pbkdf2Sync=WV(),X.pbkdf2=bF();else X.pbkdf2Sync=Y,X.pbkdf2=O}),dF=D0((X)=>{var Z=(EZ(),WX(KZ));X.createCipher=X.Cipher=Z.createCipher,X.createCipheriv=X.Cipheriv=Z.createCipheriv,X.createDecipher=X.Decipher=Z.createDecipher,X.createDecipheriv=X.Decipheriv=Z.createDecipheriv,X.listCiphers=X.getCiphers=Z.getCiphers}),lF=D0((X)=>{var Z=(EZ(),WX(KZ));X.DiffieHellmanGroup=Z.DiffieHellmanGroup,X.createDiffieHellmanGroup=Z.createDiffieHellmanGroup,X.getDiffieHellman=Z.getDiffieHellman,X.createDiffieHellman=Z.createDiffieHellman,X.DiffieHellman=Z.DiffieHellman}),mF=D0((X)=>{var Z=(EZ(),WX(KZ));X.createSign=Z.createSign,X.Sign=Z.Sign,X.createVerify=Z.createVerify,X.Verify=Z.Verify}),oF=D0((X,Z)=>{Z.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"}}}),QQ=D0((X,Z)=>{(function(U,Q){function G(J,W){if(!J)throw Error(W||"Assertion failed")}function O(J,W){J.super_=W;var F=function(){};F.prototype=W.prototype,J.prototype=new F,J.prototype.constructor=J}function Y(J,W,F){if(Y.isBN(J))return J;if(this.negative=0,this.words=null,this.length=0,this.red=null,J!==null){if(W==="le"||W==="be")F=W,W=10;this._init(J||0,W||10,F||"be")}}if(typeof U==="object")U.exports=Y;else Q.BN=Y;Y.BN=Y,Y.wordSize=26;var K;try{if(typeof window<"u"&&typeof window.Buffer<"u")K=window.Buffer;else K=(UZ(),WX(QZ)).Buffer}catch(J){}Y.isBN=function(J){if(J instanceof Y)return!0;return J!==null&&typeof J==="object"&&J.constructor.wordSize===Y.wordSize&&Array.isArray(J.words)},Y.max=function(J,W){if(J.cmp(W)>0)return J;return W},Y.min=function(J,W){if(J.cmp(W)<0)return J;return W},Y.prototype._init=function(J,W,F){if(typeof J==="number")return this._initNumber(J,W,F);if(typeof J==="object")return this._initArray(J,W,F);if(W==="hex")W=16;G(W===(W|0)&&W>=2&&W<=36),J=J.toString().replace(/\s+/g,"");var V=0;if(J[0]==="-")V++,this.negative=1;if(V<J.length){if(W===16)this._parseHex(J,V,F);else if(this._parseBase(J,W,V),F==="le")this._initArray(this.toArray(),W,F)}},Y.prototype._initNumber=function(J,W,F){if(J<0)this.negative=1,J=-J;if(J<67108864)this.words=[J&67108863],this.length=1;else if(J<4503599627370496)this.words=[J&67108863,J/67108864&67108863],this.length=2;else G(J<9007199254740992),this.words=[J&67108863,J/67108864&67108863,1],this.length=3;if(F!=="le")return;this._initArray(this.toArray(),W,F)},Y.prototype._initArray=function(J,W,F){if(G(typeof J.length==="number"),J.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(J.length/3),this.words=Array(this.length);for(var V=0;V<this.length;V++)this.words[V]=0;var H,M,T=0;if(F==="be"){for(V=J.length-1,H=0;V>=0;V-=3)if(M=J[V]|J[V-1]<<8|J[V-2]<<16,this.words[H]|=M<<T&67108863,this.words[H+1]=M>>>26-T&67108863,T+=24,T>=26)T-=26,H++}else if(F==="le"){for(V=0,H=0;V<J.length;V+=3)if(M=J[V]|J[V+1]<<8|J[V+2]<<16,this.words[H]|=M<<T&67108863,this.words[H+1]=M>>>26-T&67108863,T+=24,T>=26)T-=26,H++}return this.strip()};function A(J,W){var F=J.charCodeAt(W);if(F>=65&&F<=70)return F-55;else if(F>=97&&F<=102)return F-87;else return F-48&15}function D(J,W,F){var V=A(J,F);if(F-1>=W)V|=A(J,F-1)<<4;return V}Y.prototype._parseHex=function(J,W,F){this.length=Math.ceil((J.length-W)/6),this.words=Array(this.length);for(var V=0;V<this.length;V++)this.words[V]=0;var H=0,M=0,T;if(F==="be")for(V=J.length-1;V>=W;V-=2)if(T=D(J,W,V)<<H,this.words[M]|=T&67108863,H>=18)H-=18,M+=1,this.words[M]|=T>>>26;else H+=8;else{var E=J.length-W;for(V=E%2===0?W+1:W;V<J.length;V+=2)if(T=D(J,W,V)<<H,this.words[M]|=T&67108863,H>=18)H-=18,M+=1,this.words[M]|=T>>>26;else H+=8}this.strip()};function C(J,W,F,V){var H=0,M=Math.min(J.length,F);for(var T=W;T<M;T++){var E=J.charCodeAt(T)-48;if(H*=V,E>=49)H+=E-49+10;else if(E>=17)H+=E-17+10;else H+=E}return H}Y.prototype._parseBase=function(J,W,F){this.words=[0],this.length=1;for(var V=0,H=1;H<=67108863;H*=W)V++;V--,H=H/W|0;var M=J.length-F,T=M%V,E=Math.min(M,M-T)+F,$=0;for(var q=F;q<E;q+=V)if($=C(J,q,q+V,W),this.imuln(H),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($);if(T!==0){var j=1;$=C(J,q,J.length,W);for(q=0;q<T;q++)j*=W;if(this.imuln(j),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($)}this.strip()},Y.prototype.copy=function(J){J.words=Array(this.length);for(var W=0;W<this.length;W++)J.words[W]=this.words[W];J.length=this.length,J.negative=this.negative,J.red=this.red},Y.prototype.clone=function(){var J=new Y(null);return this.copy(J),J},Y.prototype._expand=function(J){while(this.length<J)this.words[this.length++]=0;return this},Y.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Y.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Y.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var z=["","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],S=[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(Y.prototype.toString=function(J,W){J=J||10,W=W|0||1;var F;if(J===16||J==="hex"){F="";var V=0,H=0;for(var M=0;M<this.length;M++){var T=this.words[M],E=((T<<V|H)&16777215).toString(16);if(H=T>>>24-V&16777215,V+=2,V>=26)V-=26,M--;if(H!==0||M!==this.length-1)F=z[6-E.length]+E+F;else F=E+F}if(H!==0)F=H.toString(16)+F;while(F.length%W!==0)F="0"+F;if(this.negative!==0)F="-"+F;return F}if(J===(J|0)&&J>=2&&J<=36){var $=R[J],q=S[J];F="";var j=this.clone();j.negative=0;while(!j.isZero()){var L=j.modn(q).toString(J);if(j=j.idivn(q),!j.isZero())F=z[$-L.length]+L+F;else F=L+F}if(this.isZero())F="0"+F;while(F.length%W!==0)F="0"+F;if(this.negative!==0)F="-"+F;return F}G(!1,"Base should be between 2 and 36")},Y.prototype.toNumber=function(){var J=this.words[0];if(this.length===2)J+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)J+=4503599627370496+this.words[1]*67108864;else if(this.length>2)G(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-J:J},Y.prototype.toJSON=function(){return this.toString(16)},Y.prototype.toBuffer=function(J,W){return G(typeof K<"u"),this.toArrayLike(K,J,W)},Y.prototype.toArray=function(J,W){return this.toArrayLike(Array,J,W)},Y.prototype.toArrayLike=function(J,W,F){var V=this.byteLength(),H=F||Math.max(1,V);G(V<=H,"byte array longer than desired length"),G(H>0,"Requested array length <= 0"),this.strip();var M=W==="le",T=new J(H),E,$,q=this.clone();if(!M){for($=0;$<H-V;$++)T[$]=0;for($=0;!q.isZero();$++)E=q.andln(255),q.iushrn(8),T[H-$-1]=E}else{for($=0;!q.isZero();$++)E=q.andln(255),q.iushrn(8),T[$]=E;for(;$<H;$++)T[$]=0}return T},Math.clz32)Y.prototype._countBits=function(J){return 32-Math.clz32(J)};else Y.prototype._countBits=function(J){var W=J,F=0;if(W>=4096)F+=13,W>>>=13;if(W>=64)F+=7,W>>>=7;if(W>=8)F+=4,W>>>=4;if(W>=2)F+=2,W>>>=2;return F+W};Y.prototype._zeroBits=function(J){if(J===0)return 26;var W=J,F=0;if((W&8191)===0)F+=13,W>>>=13;if((W&127)===0)F+=7,W>>>=7;if((W&15)===0)F+=4,W>>>=4;if((W&3)===0)F+=2,W>>>=2;if((W&1)===0)F++;return F},Y.prototype.bitLength=function(){var J=this.words[this.length-1],W=this._countBits(J);return(this.length-1)*26+W};function P(J){var W=Array(J.bitLength());for(var F=0;F<W.length;F++){var V=F/26|0,H=F%26;W[F]=(J.words[V]&1<<H)>>>H}return W}Y.prototype.zeroBits=function(){if(this.isZero())return 0;var J=0;for(var W=0;W<this.length;W++){var F=this._zeroBits(this.words[W]);if(J+=F,F!==26)break}return J},Y.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Y.prototype.toTwos=function(J){if(this.negative!==0)return this.abs().inotn(J).iaddn(1);return this.clone()},Y.prototype.fromTwos=function(J){if(this.testn(J-1))return this.notn(J).iaddn(1).ineg();return this.clone()},Y.prototype.isNeg=function(){return this.negative!==0},Y.prototype.neg=function(){return this.clone().ineg()},Y.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Y.prototype.iuor=function(J){while(this.length<J.length)this.words[this.length++]=0;for(var W=0;W<J.length;W++)this.words[W]=this.words[W]|J.words[W];return this.strip()},Y.prototype.ior=function(J){return G((this.negative|J.negative)===0),this.iuor(J)},Y.prototype.or=function(J){if(this.length>J.length)return this.clone().ior(J);return J.clone().ior(this)},Y.prototype.uor=function(J){if(this.length>J.length)return this.clone().iuor(J);return J.clone().iuor(this)},Y.prototype.iuand=function(J){var W;if(this.length>J.length)W=J;else W=this;for(var F=0;F<W.length;F++)this.words[F]=this.words[F]&J.words[F];return this.length=W.length,this.strip()},Y.prototype.iand=function(J){return G((this.negative|J.negative)===0),this.iuand(J)},Y.prototype.and=function(J){if(this.length>J.length)return this.clone().iand(J);return J.clone().iand(this)},Y.prototype.uand=function(J){if(this.length>J.length)return this.clone().iuand(J);return J.clone().iuand(this)},Y.prototype.iuxor=function(J){var W,F;if(this.length>J.length)W=this,F=J;else W=J,F=this;for(var V=0;V<F.length;V++)this.words[V]=W.words[V]^F.words[V];if(this!==W)for(;V<W.length;V++)this.words[V]=W.words[V];return this.length=W.length,this.strip()},Y.prototype.ixor=function(J){return G((this.negative|J.negative)===0),this.iuxor(J)},Y.prototype.xor=function(J){if(this.length>J.length)return this.clone().ixor(J);return J.clone().ixor(this)},Y.prototype.uxor=function(J){if(this.length>J.length)return this.clone().iuxor(J);return J.clone().iuxor(this)},Y.prototype.inotn=function(J){G(typeof J==="number"&&J>=0);var W=Math.ceil(J/26)|0,F=J%26;if(this._expand(W),F>0)W--;for(var V=0;V<W;V++)this.words[V]=~this.words[V]&67108863;if(F>0)this.words[V]=~this.words[V]&67108863>>26-F;return this.strip()},Y.prototype.notn=function(J){return this.clone().inotn(J)},Y.prototype.setn=function(J,W){G(typeof J==="number"&&J>=0);var F=J/26|0,V=J%26;if(this._expand(F+1),W)this.words[F]=this.words[F]|1<<V;else this.words[F]=this.words[F]&~(1<<V);return this.strip()},Y.prototype.iadd=function(J){var W;if(this.negative!==0&&J.negative===0)return this.negative=0,W=this.isub(J),this.negative^=1,this._normSign();else if(this.negative===0&&J.negative!==0)return J.negative=0,W=this.isub(J),J.negative=1,W._normSign();var F,V;if(this.length>J.length)F=this,V=J;else F=J,V=this;var H=0;for(var M=0;M<V.length;M++)W=(F.words[M]|0)+(V.words[M]|0)+H,this.words[M]=W&67108863,H=W>>>26;for(;H!==0&&M<F.length;M++)W=(F.words[M]|0)+H,this.words[M]=W&67108863,H=W>>>26;if(this.length=F.length,H!==0)this.words[this.length]=H,this.length++;else if(F!==this)for(;M<F.length;M++)this.words[M]=F.words[M];return this},Y.prototype.add=function(J){var W;if(J.negative!==0&&this.negative===0)return J.negative=0,W=this.sub(J),J.negative^=1,W;else if(J.negative===0&&this.negative!==0)return this.negative=0,W=J.sub(this),this.negative=1,W;if(this.length>J.length)return this.clone().iadd(J);return J.clone().iadd(this)},Y.prototype.isub=function(J){if(J.negative!==0){J.negative=0;var W=this.iadd(J);return J.negative=1,W._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(J),this.negative=1,this._normSign();var F=this.cmp(J);if(F===0)return this.negative=0,this.length=1,this.words[0]=0,this;var V,H;if(F>0)V=this,H=J;else V=J,H=this;var M=0;for(var T=0;T<H.length;T++)W=(V.words[T]|0)-(H.words[T]|0)+M,M=W>>26,this.words[T]=W&67108863;for(;M!==0&&T<V.length;T++)W=(V.words[T]|0)+M,M=W>>26,this.words[T]=W&67108863;if(M===0&&T<V.length&&V!==this)for(;T<V.length;T++)this.words[T]=V.words[T];if(this.length=Math.max(this.length,T),V!==this)this.negative=1;return this.strip()},Y.prototype.sub=function(J){return this.clone().isub(J)};function N(J,W,F){F.negative=W.negative^J.negative;var V=J.length+W.length|0;F.length=V,V=V-1|0;var H=J.words[0]|0,M=W.words[0]|0,T=H*M,E=T&67108863,$=T/67108864|0;F.words[0]=E;for(var q=1;q<V;q++){var j=$>>>26,L=$&67108863,x=Math.min(q,W.length-1);for(var f=Math.max(0,q-J.length+1);f<=x;f++){var b=q-f|0;H=J.words[b]|0,M=W.words[f]|0,T=H*M+L,j+=T/67108864|0,L=T&67108863}F.words[q]=L|0,$=j|0}if($!==0)F.words[q]=$|0;else F.length--;return F.strip()}var I=function(J,W,F){var V=J.words,H=W.words,M=F.words,T=0,E,$,q,j=V[0]|0,L=j&8191,x=j>>>13,f=V[1]|0,b=f&8191,s=f>>>13,z0=V[2]|0,i=z0&8191,o=z0>>>13,W0=V[3]|0,r=W0&8191,X0=W0>>>13,d0=V[4]|0,c=d0&8191,m=d0>>>13,E0=V[5]|0,Z0=E0&8191,$0=E0>>>13,N0=V[6]|0,d=N0&8191,t=N0>>>13,l0=V[7]|0,e=l0&8191,F0=l0>>>13,ZX=V[8]|0,T0=ZX&8191,R0=ZX>>>13,kX=V[9]|0,C0=kX&8191,P0=kX>>>13,_X=H[0]|0,I0=_X&8191,L0=_X>>>13,HZ=H[1]|0,B0=HZ&8191,y0=HZ>>>13,FZ=H[2]|0,f0=FZ&8191,k0=FZ>>>13,$Z=H[3]|0,g0=$Z&8191,x0=$Z>>>13,tX=H[4]|0,h0=tX&8191,p0=tX>>>13,iX=H[5]|0,w0=iX&8191,y=iX>>>13,n=H[6]|0,Y0=n&8191,O0=n>>>13,n0=H[7]|0,A0=n0&8191,S0=n0>>>13,xX=H[8]|0,v0=xX&8191,c0=xX>>>13,GZ=H[9]|0,_0=GZ&8191,j0=GZ>>>13;F.negative=J.negative^W.negative,F.length=19,E=Math.imul(L,I0),$=Math.imul(L,L0),$=$+Math.imul(x,I0)|0,q=Math.imul(x,L0);var wX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(wX>>>26)|0,wX&=67108863,E=Math.imul(b,I0),$=Math.imul(b,L0),$=$+Math.imul(s,I0)|0,q=Math.imul(s,L0),E=E+Math.imul(L,B0)|0,$=$+Math.imul(L,y0)|0,$=$+Math.imul(x,B0)|0,q=q+Math.imul(x,y0)|0;var $X=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+($X>>>26)|0,$X&=67108863,E=Math.imul(i,I0),$=Math.imul(i,L0),$=$+Math.imul(o,I0)|0,q=Math.imul(o,L0),E=E+Math.imul(b,B0)|0,$=$+Math.imul(b,y0)|0,$=$+Math.imul(s,B0)|0,q=q+Math.imul(s,y0)|0,E=E+Math.imul(L,f0)|0,$=$+Math.imul(L,k0)|0,$=$+Math.imul(x,f0)|0,q=q+Math.imul(x,k0)|0;var JX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(JX>>>26)|0,JX&=67108863,E=Math.imul(r,I0),$=Math.imul(r,L0),$=$+Math.imul(X0,I0)|0,q=Math.imul(X0,L0),E=E+Math.imul(i,B0)|0,$=$+Math.imul(i,y0)|0,$=$+Math.imul(o,B0)|0,q=q+Math.imul(o,y0)|0,E=E+Math.imul(b,f0)|0,$=$+Math.imul(b,k0)|0,$=$+Math.imul(s,f0)|0,q=q+Math.imul(s,k0)|0,E=E+Math.imul(L,g0)|0,$=$+Math.imul(L,x0)|0,$=$+Math.imul(x,g0)|0,q=q+Math.imul(x,x0)|0;var TX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(TX>>>26)|0,TX&=67108863,E=Math.imul(c,I0),$=Math.imul(c,L0),$=$+Math.imul(m,I0)|0,q=Math.imul(m,L0),E=E+Math.imul(r,B0)|0,$=$+Math.imul(r,y0)|0,$=$+Math.imul(X0,B0)|0,q=q+Math.imul(X0,y0)|0,E=E+Math.imul(i,f0)|0,$=$+Math.imul(i,k0)|0,$=$+Math.imul(o,f0)|0,q=q+Math.imul(o,k0)|0,E=E+Math.imul(b,g0)|0,$=$+Math.imul(b,x0)|0,$=$+Math.imul(s,g0)|0,q=q+Math.imul(s,x0)|0,E=E+Math.imul(L,h0)|0,$=$+Math.imul(L,p0)|0,$=$+Math.imul(x,h0)|0,q=q+Math.imul(x,p0)|0;var AX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(AX>>>26)|0,AX&=67108863,E=Math.imul(Z0,I0),$=Math.imul(Z0,L0),$=$+Math.imul($0,I0)|0,q=Math.imul($0,L0),E=E+Math.imul(c,B0)|0,$=$+Math.imul(c,y0)|0,$=$+Math.imul(m,B0)|0,q=q+Math.imul(m,y0)|0,E=E+Math.imul(r,f0)|0,$=$+Math.imul(r,k0)|0,$=$+Math.imul(X0,f0)|0,q=q+Math.imul(X0,k0)|0,E=E+Math.imul(i,g0)|0,$=$+Math.imul(i,x0)|0,$=$+Math.imul(o,g0)|0,q=q+Math.imul(o,x0)|0,E=E+Math.imul(b,h0)|0,$=$+Math.imul(b,p0)|0,$=$+Math.imul(s,h0)|0,q=q+Math.imul(s,p0)|0,E=E+Math.imul(L,w0)|0,$=$+Math.imul(L,y)|0,$=$+Math.imul(x,w0)|0,q=q+Math.imul(x,y)|0;var fX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(fX>>>26)|0,fX&=67108863,E=Math.imul(d,I0),$=Math.imul(d,L0),$=$+Math.imul(t,I0)|0,q=Math.imul(t,L0),E=E+Math.imul(Z0,B0)|0,$=$+Math.imul(Z0,y0)|0,$=$+Math.imul($0,B0)|0,q=q+Math.imul($0,y0)|0,E=E+Math.imul(c,f0)|0,$=$+Math.imul(c,k0)|0,$=$+Math.imul(m,f0)|0,q=q+Math.imul(m,k0)|0,E=E+Math.imul(r,g0)|0,$=$+Math.imul(r,x0)|0,$=$+Math.imul(X0,g0)|0,q=q+Math.imul(X0,x0)|0,E=E+Math.imul(i,h0)|0,$=$+Math.imul(i,p0)|0,$=$+Math.imul(o,h0)|0,q=q+Math.imul(o,p0)|0,E=E+Math.imul(b,w0)|0,$=$+Math.imul(b,y)|0,$=$+Math.imul(s,w0)|0,q=q+Math.imul(s,y)|0,E=E+Math.imul(L,Y0)|0,$=$+Math.imul(L,O0)|0,$=$+Math.imul(x,Y0)|0,q=q+Math.imul(x,O0)|0;var gX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(gX>>>26)|0,gX&=67108863,E=Math.imul(e,I0),$=Math.imul(e,L0),$=$+Math.imul(F0,I0)|0,q=Math.imul(F0,L0),E=E+Math.imul(d,B0)|0,$=$+Math.imul(d,y0)|0,$=$+Math.imul(t,B0)|0,q=q+Math.imul(t,y0)|0,E=E+Math.imul(Z0,f0)|0,$=$+Math.imul(Z0,k0)|0,$=$+Math.imul($0,f0)|0,q=q+Math.imul($0,k0)|0,E=E+Math.imul(c,g0)|0,$=$+Math.imul(c,x0)|0,$=$+Math.imul(m,g0)|0,q=q+Math.imul(m,x0)|0,E=E+Math.imul(r,h0)|0,$=$+Math.imul(r,p0)|0,$=$+Math.imul(X0,h0)|0,q=q+Math.imul(X0,p0)|0,E=E+Math.imul(i,w0)|0,$=$+Math.imul(i,y)|0,$=$+Math.imul(o,w0)|0,q=q+Math.imul(o,y)|0,E=E+Math.imul(b,Y0)|0,$=$+Math.imul(b,O0)|0,$=$+Math.imul(s,Y0)|0,q=q+Math.imul(s,O0)|0,E=E+Math.imul(L,A0)|0,$=$+Math.imul(L,S0)|0,$=$+Math.imul(x,A0)|0,q=q+Math.imul(x,S0)|0;var hX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(hX>>>26)|0,hX&=67108863,E=Math.imul(T0,I0),$=Math.imul(T0,L0),$=$+Math.imul(R0,I0)|0,q=Math.imul(R0,L0),E=E+Math.imul(e,B0)|0,$=$+Math.imul(e,y0)|0,$=$+Math.imul(F0,B0)|0,q=q+Math.imul(F0,y0)|0,E=E+Math.imul(d,f0)|0,$=$+Math.imul(d,k0)|0,$=$+Math.imul(t,f0)|0,q=q+Math.imul(t,k0)|0,E=E+Math.imul(Z0,g0)|0,$=$+Math.imul(Z0,x0)|0,$=$+Math.imul($0,g0)|0,q=q+Math.imul($0,x0)|0,E=E+Math.imul(c,h0)|0,$=$+Math.imul(c,p0)|0,$=$+Math.imul(m,h0)|0,q=q+Math.imul(m,p0)|0,E=E+Math.imul(r,w0)|0,$=$+Math.imul(r,y)|0,$=$+Math.imul(X0,w0)|0,q=q+Math.imul(X0,y)|0,E=E+Math.imul(i,Y0)|0,$=$+Math.imul(i,O0)|0,$=$+Math.imul(o,Y0)|0,q=q+Math.imul(o,O0)|0,E=E+Math.imul(b,A0)|0,$=$+Math.imul(b,S0)|0,$=$+Math.imul(s,A0)|0,q=q+Math.imul(s,S0)|0,E=E+Math.imul(L,v0)|0,$=$+Math.imul(L,c0)|0,$=$+Math.imul(x,v0)|0,q=q+Math.imul(x,c0)|0;var pX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(pX>>>26)|0,pX&=67108863,E=Math.imul(C0,I0),$=Math.imul(C0,L0),$=$+Math.imul(P0,I0)|0,q=Math.imul(P0,L0),E=E+Math.imul(T0,B0)|0,$=$+Math.imul(T0,y0)|0,$=$+Math.imul(R0,B0)|0,q=q+Math.imul(R0,y0)|0,E=E+Math.imul(e,f0)|0,$=$+Math.imul(e,k0)|0,$=$+Math.imul(F0,f0)|0,q=q+Math.imul(F0,k0)|0,E=E+Math.imul(d,g0)|0,$=$+Math.imul(d,x0)|0,$=$+Math.imul(t,g0)|0,q=q+Math.imul(t,x0)|0,E=E+Math.imul(Z0,h0)|0,$=$+Math.imul(Z0,p0)|0,$=$+Math.imul($0,h0)|0,q=q+Math.imul($0,p0)|0,E=E+Math.imul(c,w0)|0,$=$+Math.imul(c,y)|0,$=$+Math.imul(m,w0)|0,q=q+Math.imul(m,y)|0,E=E+Math.imul(r,Y0)|0,$=$+Math.imul(r,O0)|0,$=$+Math.imul(X0,Y0)|0,q=q+Math.imul(X0,O0)|0,E=E+Math.imul(i,A0)|0,$=$+Math.imul(i,S0)|0,$=$+Math.imul(o,A0)|0,q=q+Math.imul(o,S0)|0,E=E+Math.imul(b,v0)|0,$=$+Math.imul(b,c0)|0,$=$+Math.imul(s,v0)|0,q=q+Math.imul(s,c0)|0,E=E+Math.imul(L,_0)|0,$=$+Math.imul(L,j0)|0,$=$+Math.imul(x,_0)|0,q=q+Math.imul(x,j0)|0;var cX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(cX>>>26)|0,cX&=67108863,E=Math.imul(C0,B0),$=Math.imul(C0,y0),$=$+Math.imul(P0,B0)|0,q=Math.imul(P0,y0),E=E+Math.imul(T0,f0)|0,$=$+Math.imul(T0,k0)|0,$=$+Math.imul(R0,f0)|0,q=q+Math.imul(R0,k0)|0,E=E+Math.imul(e,g0)|0,$=$+Math.imul(e,x0)|0,$=$+Math.imul(F0,g0)|0,q=q+Math.imul(F0,x0)|0,E=E+Math.imul(d,h0)|0,$=$+Math.imul(d,p0)|0,$=$+Math.imul(t,h0)|0,q=q+Math.imul(t,p0)|0,E=E+Math.imul(Z0,w0)|0,$=$+Math.imul(Z0,y)|0,$=$+Math.imul($0,w0)|0,q=q+Math.imul($0,y)|0,E=E+Math.imul(c,Y0)|0,$=$+Math.imul(c,O0)|0,$=$+Math.imul(m,Y0)|0,q=q+Math.imul(m,O0)|0,E=E+Math.imul(r,A0)|0,$=$+Math.imul(r,S0)|0,$=$+Math.imul(X0,A0)|0,q=q+Math.imul(X0,S0)|0,E=E+Math.imul(i,v0)|0,$=$+Math.imul(i,c0)|0,$=$+Math.imul(o,v0)|0,q=q+Math.imul(o,c0)|0,E=E+Math.imul(b,_0)|0,$=$+Math.imul(b,j0)|0,$=$+Math.imul(s,_0)|0,q=q+Math.imul(s,j0)|0;var uX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(uX>>>26)|0,uX&=67108863,E=Math.imul(C0,f0),$=Math.imul(C0,k0),$=$+Math.imul(P0,f0)|0,q=Math.imul(P0,k0),E=E+Math.imul(T0,g0)|0,$=$+Math.imul(T0,x0)|0,$=$+Math.imul(R0,g0)|0,q=q+Math.imul(R0,x0)|0,E=E+Math.imul(e,h0)|0,$=$+Math.imul(e,p0)|0,$=$+Math.imul(F0,h0)|0,q=q+Math.imul(F0,p0)|0,E=E+Math.imul(d,w0)|0,$=$+Math.imul(d,y)|0,$=$+Math.imul(t,w0)|0,q=q+Math.imul(t,y)|0,E=E+Math.imul(Z0,Y0)|0,$=$+Math.imul(Z0,O0)|0,$=$+Math.imul($0,Y0)|0,q=q+Math.imul($0,O0)|0,E=E+Math.imul(c,A0)|0,$=$+Math.imul(c,S0)|0,$=$+Math.imul(m,A0)|0,q=q+Math.imul(m,S0)|0,E=E+Math.imul(r,v0)|0,$=$+Math.imul(r,c0)|0,$=$+Math.imul(X0,v0)|0,q=q+Math.imul(X0,c0)|0,E=E+Math.imul(i,_0)|0,$=$+Math.imul(i,j0)|0,$=$+Math.imul(o,_0)|0,q=q+Math.imul(o,j0)|0;var bX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(bX>>>26)|0,bX&=67108863,E=Math.imul(C0,g0),$=Math.imul(C0,x0),$=$+Math.imul(P0,g0)|0,q=Math.imul(P0,x0),E=E+Math.imul(T0,h0)|0,$=$+Math.imul(T0,p0)|0,$=$+Math.imul(R0,h0)|0,q=q+Math.imul(R0,p0)|0,E=E+Math.imul(e,w0)|0,$=$+Math.imul(e,y)|0,$=$+Math.imul(F0,w0)|0,q=q+Math.imul(F0,y)|0,E=E+Math.imul(d,Y0)|0,$=$+Math.imul(d,O0)|0,$=$+Math.imul(t,Y0)|0,q=q+Math.imul(t,O0)|0,E=E+Math.imul(Z0,A0)|0,$=$+Math.imul(Z0,S0)|0,$=$+Math.imul($0,A0)|0,q=q+Math.imul($0,S0)|0,E=E+Math.imul(c,v0)|0,$=$+Math.imul(c,c0)|0,$=$+Math.imul(m,v0)|0,q=q+Math.imul(m,c0)|0,E=E+Math.imul(r,_0)|0,$=$+Math.imul(r,j0)|0,$=$+Math.imul(X0,_0)|0,q=q+Math.imul(X0,j0)|0;var dX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(dX>>>26)|0,dX&=67108863,E=Math.imul(C0,h0),$=Math.imul(C0,p0),$=$+Math.imul(P0,h0)|0,q=Math.imul(P0,p0),E=E+Math.imul(T0,w0)|0,$=$+Math.imul(T0,y)|0,$=$+Math.imul(R0,w0)|0,q=q+Math.imul(R0,y)|0,E=E+Math.imul(e,Y0)|0,$=$+Math.imul(e,O0)|0,$=$+Math.imul(F0,Y0)|0,q=q+Math.imul(F0,O0)|0,E=E+Math.imul(d,A0)|0,$=$+Math.imul(d,S0)|0,$=$+Math.imul(t,A0)|0,q=q+Math.imul(t,S0)|0,E=E+Math.imul(Z0,v0)|0,$=$+Math.imul(Z0,c0)|0,$=$+Math.imul($0,v0)|0,q=q+Math.imul($0,c0)|0,E=E+Math.imul(c,_0)|0,$=$+Math.imul(c,j0)|0,$=$+Math.imul(m,_0)|0,q=q+Math.imul(m,j0)|0;var lX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(lX>>>26)|0,lX&=67108863,E=Math.imul(C0,w0),$=Math.imul(C0,y),$=$+Math.imul(P0,w0)|0,q=Math.imul(P0,y),E=E+Math.imul(T0,Y0)|0,$=$+Math.imul(T0,O0)|0,$=$+Math.imul(R0,Y0)|0,q=q+Math.imul(R0,O0)|0,E=E+Math.imul(e,A0)|0,$=$+Math.imul(e,S0)|0,$=$+Math.imul(F0,A0)|0,q=q+Math.imul(F0,S0)|0,E=E+Math.imul(d,v0)|0,$=$+Math.imul(d,c0)|0,$=$+Math.imul(t,v0)|0,q=q+Math.imul(t,c0)|0,E=E+Math.imul(Z0,_0)|0,$=$+Math.imul(Z0,j0)|0,$=$+Math.imul($0,_0)|0,q=q+Math.imul($0,j0)|0;var mX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(mX>>>26)|0,mX&=67108863,E=Math.imul(C0,Y0),$=Math.imul(C0,O0),$=$+Math.imul(P0,Y0)|0,q=Math.imul(P0,O0),E=E+Math.imul(T0,A0)|0,$=$+Math.imul(T0,S0)|0,$=$+Math.imul(R0,A0)|0,q=q+Math.imul(R0,S0)|0,E=E+Math.imul(e,v0)|0,$=$+Math.imul(e,c0)|0,$=$+Math.imul(F0,v0)|0,q=q+Math.imul(F0,c0)|0,E=E+Math.imul(d,_0)|0,$=$+Math.imul(d,j0)|0,$=$+Math.imul(t,_0)|0,q=q+Math.imul(t,j0)|0;var oX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(oX>>>26)|0,oX&=67108863,E=Math.imul(C0,A0),$=Math.imul(C0,S0),$=$+Math.imul(P0,A0)|0,q=Math.imul(P0,S0),E=E+Math.imul(T0,v0)|0,$=$+Math.imul(T0,c0)|0,$=$+Math.imul(R0,v0)|0,q=q+Math.imul(R0,c0)|0,E=E+Math.imul(e,_0)|0,$=$+Math.imul(e,j0)|0,$=$+Math.imul(F0,_0)|0,q=q+Math.imul(F0,j0)|0;var nX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(nX>>>26)|0,nX&=67108863,E=Math.imul(C0,v0),$=Math.imul(C0,c0),$=$+Math.imul(P0,v0)|0,q=Math.imul(P0,c0),E=E+Math.imul(T0,_0)|0,$=$+Math.imul(T0,j0)|0,$=$+Math.imul(R0,_0)|0,q=q+Math.imul(R0,j0)|0;var sX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(sX>>>26)|0,sX&=67108863,E=Math.imul(C0,_0),$=Math.imul(C0,j0),$=$+Math.imul(P0,_0)|0,q=Math.imul(P0,j0);var rX=(T+E|0)+(($&8191)<<13)|0;if(T=(q+($>>>13)|0)+(rX>>>26)|0,rX&=67108863,M[0]=wX,M[1]=$X,M[2]=JX,M[3]=TX,M[4]=AX,M[5]=fX,M[6]=gX,M[7]=hX,M[8]=pX,M[9]=cX,M[10]=uX,M[11]=bX,M[12]=dX,M[13]=lX,M[14]=mX,M[15]=oX,M[16]=nX,M[17]=sX,M[18]=rX,T!==0)M[19]=T,F.length++;return F};if(!Math.imul)I=N;function B(J,W,F){F.negative=W.negative^J.negative,F.length=J.length+W.length;var V=0,H=0;for(var M=0;M<F.length-1;M++){var T=H;H=0;var E=V&67108863,$=Math.min(M,W.length-1);for(var q=Math.max(0,M-J.length+1);q<=$;q++){var j=M-q,L=J.words[j]|0,x=W.words[q]|0,f=L*x,b=f&67108863;T=T+(f/67108864|0)|0,b=b+E|0,E=b&67108863,T=T+(b>>>26)|0,H+=T>>>26,T&=67108863}F.words[M]=E,V=T,T=H}if(V!==0)F.words[M]=V;else F.length--;return F.strip()}function k(J,W,F){var V=new w;return V.mulp(J,W,F)}Y.prototype.mulTo=function(J,W){var F,V=this.length+J.length;if(this.length===10&&J.length===10)F=I(this,J,W);else if(V<63)F=N(this,J,W);else if(V<1024)F=B(this,J,W);else F=k(this,J,W);return F};function w(J,W){this.x=J,this.y=W}w.prototype.makeRBT=function(J){var W=Array(J),F=Y.prototype._countBits(J)-1;for(var V=0;V<J;V++)W[V]=this.revBin(V,F,J);return W},w.prototype.revBin=function(J,W,F){if(J===0||J===F-1)return J;var V=0;for(var H=0;H<W;H++)V|=(J&1)<<W-H-1,J>>=1;return V},w.prototype.permute=function(J,W,F,V,H,M){for(var T=0;T<M;T++)V[T]=W[J[T]],H[T]=F[J[T]]},w.prototype.transform=function(J,W,F,V,H,M){this.permute(M,J,W,F,V,H);for(var T=1;T<H;T<<=1){var E=T<<1,$=Math.cos(2*Math.PI/E),q=Math.sin(2*Math.PI/E);for(var j=0;j<H;j+=E){var L=$,x=q;for(var f=0;f<T;f++){var b=F[j+f],s=V[j+f],z0=F[j+f+T],i=V[j+f+T],o=L*z0-x*i;if(i=L*i+x*z0,z0=o,F[j+f]=b+z0,V[j+f]=s+i,F[j+f+T]=b-z0,V[j+f+T]=s-i,f!==E)o=$*L-q*x,x=$*x+q*L,L=o}}}},w.prototype.guessLen13b=function(J,W){var F=Math.max(W,J)|1,V=F&1,H=0;for(F=F/2|0;F;F=F>>>1)H++;return 1<<H+1+V},w.prototype.conjugate=function(J,W,F){if(F<=1)return;for(var V=0;V<F/2;V++){var H=J[V];J[V]=J[F-V-1],J[F-V-1]=H,H=W[V],W[V]=-W[F-V-1],W[F-V-1]=-H}},w.prototype.normalize13b=function(J,W){var F=0;for(var V=0;V<W/2;V++){var H=Math.round(J[2*V+1]/W)*8192+Math.round(J[2*V]/W)+F;if(J[V]=H&67108863,H<67108864)F=0;else F=H/67108864|0}return J},w.prototype.convert13b=function(J,W,F,V){var H=0;for(var M=0;M<W;M++)H=H+(J[M]|0),F[2*M]=H&8191,H=H>>>13,F[2*M+1]=H&8191,H=H>>>13;for(M=2*W;M<V;++M)F[M]=0;G(H===0),G((H&-8192)===0)},w.prototype.stub=function(J){var W=Array(J);for(var F=0;F<J;F++)W[F]=0;return W},w.prototype.mulp=function(J,W,F){var V=2*this.guessLen13b(J.length,W.length),H=this.makeRBT(V),M=this.stub(V),T=Array(V),E=Array(V),$=Array(V),q=Array(V),j=Array(V),L=Array(V),x=F.words;x.length=V,this.convert13b(J.words,J.length,T,V),this.convert13b(W.words,W.length,q,V),this.transform(T,M,E,$,V,H),this.transform(q,M,j,L,V,H);for(var f=0;f<V;f++){var b=E[f]*j[f]-$[f]*L[f];$[f]=E[f]*L[f]+$[f]*j[f],E[f]=b}return this.conjugate(E,$,V),this.transform(E,$,x,M,V,H),this.conjugate(x,M,V),this.normalize13b(x,V),F.negative=J.negative^W.negative,F.length=J.length+W.length,F.strip()},Y.prototype.mul=function(J){var W=new Y(null);return W.words=Array(this.length+J.length),this.mulTo(J,W)},Y.prototype.mulf=function(J){var W=new Y(null);return W.words=Array(this.length+J.length),k(this,J,W)},Y.prototype.imul=function(J){return this.clone().mulTo(J,this)},Y.prototype.imuln=function(J){G(typeof J==="number"),G(J<67108864);var W=0;for(var F=0;F<this.length;F++){var V=(this.words[F]|0)*J,H=(V&67108863)+(W&67108863);W>>=26,W+=V/67108864|0,W+=H>>>26,this.words[F]=H&67108863}if(W!==0)this.words[F]=W,this.length++;return this.length=J===0?1:this.length,this},Y.prototype.muln=function(J){return this.clone().imuln(J)},Y.prototype.sqr=function(){return this.mul(this)},Y.prototype.isqr=function(){return this.imul(this.clone())},Y.prototype.pow=function(J){var W=P(J);if(W.length===0)return new Y(1);var F=this;for(var V=0;V<W.length;V++,F=F.sqr())if(W[V]!==0)break;if(++V<W.length)for(var H=F.sqr();V<W.length;V++,H=H.sqr()){if(W[V]===0)continue;F=F.mul(H)}return F},Y.prototype.iushln=function(J){G(typeof J==="number"&&J>=0);var W=J%26,F=(J-W)/26,V=67108863>>>26-W<<26-W,H;if(W!==0){var M=0;for(H=0;H<this.length;H++){var T=this.words[H]&V,E=(this.words[H]|0)-T<<W;this.words[H]=E|M,M=T>>>26-W}if(M)this.words[H]=M,this.length++}if(F!==0){for(H=this.length-1;H>=0;H--)this.words[H+F]=this.words[H];for(H=0;H<F;H++)this.words[H]=0;this.length+=F}return this.strip()},Y.prototype.ishln=function(J){return G(this.negative===0),this.iushln(J)},Y.prototype.iushrn=function(J,W,F){G(typeof J==="number"&&J>=0);var V;if(W)V=(W-W%26)/26;else V=0;var H=J%26,M=Math.min((J-H)/26,this.length),T=67108863^67108863>>>H<<H,E=F;if(V-=M,V=Math.max(0,V),E){for(var $=0;$<M;$++)E.words[$]=this.words[$];E.length=M}if(M===0);else if(this.length>M){this.length-=M;for($=0;$<this.length;$++)this.words[$]=this.words[$+M]}else this.words[0]=0,this.length=1;var q=0;for($=this.length-1;$>=0&&(q!==0||$>=V);$--){var j=this.words[$]|0;this.words[$]=q<<26-H|j>>>H,q=j&T}if(E&&q!==0)E.words[E.length++]=q;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Y.prototype.ishrn=function(J,W,F){return G(this.negative===0),this.iushrn(J,W,F)},Y.prototype.shln=function(J){return this.clone().ishln(J)},Y.prototype.ushln=function(J){return this.clone().iushln(J)},Y.prototype.shrn=function(J){return this.clone().ishrn(J)},Y.prototype.ushrn=function(J){return this.clone().iushrn(J)},Y.prototype.testn=function(J){G(typeof J==="number"&&J>=0);var W=J%26,F=(J-W)/26,V=1<<W;if(this.length<=F)return!1;var H=this.words[F];return!!(H&V)},Y.prototype.imaskn=function(J){G(typeof J==="number"&&J>=0);var W=J%26,F=(J-W)/26;if(G(this.negative===0,"imaskn works only with positive numbers"),this.length<=F)return this;if(W!==0)F++;if(this.length=Math.min(F,this.length),W!==0){var V=67108863^67108863>>>W<<W;this.words[this.length-1]&=V}return this.strip()},Y.prototype.maskn=function(J){return this.clone().imaskn(J)},Y.prototype.iaddn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.isubn(-J);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<J)return this.words[0]=J-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(J),this.negative=1,this}return this._iaddn(J)},Y.prototype._iaddn=function(J){this.words[0]+=J;for(var W=0;W<this.length&&this.words[W]>=67108864;W++)if(this.words[W]-=67108864,W===this.length-1)this.words[W+1]=1;else this.words[W+1]++;return this.length=Math.max(this.length,W+1),this},Y.prototype.isubn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.iaddn(-J);if(this.negative!==0)return this.negative=0,this.iaddn(J),this.negative=1,this;if(this.words[0]-=J,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var W=0;W<this.length&&this.words[W]<0;W++)this.words[W]+=67108864,this.words[W+1]-=1;return this.strip()},Y.prototype.addn=function(J){return this.clone().iaddn(J)},Y.prototype.subn=function(J){return this.clone().isubn(J)},Y.prototype.iabs=function(){return this.negative=0,this},Y.prototype.abs=function(){return this.clone().iabs()},Y.prototype._ishlnsubmul=function(J,W,F){var V=J.length+F,H;this._expand(V);var M,T=0;for(H=0;H<J.length;H++){M=(this.words[H+F]|0)+T;var E=(J.words[H]|0)*W;M-=E&67108863,T=(M>>26)-(E/67108864|0),this.words[H+F]=M&67108863}for(;H<this.length-F;H++)M=(this.words[H+F]|0)+T,T=M>>26,this.words[H+F]=M&67108863;if(T===0)return this.strip();G(T===-1),T=0;for(H=0;H<this.length;H++)M=-(this.words[H]|0)+T,T=M>>26,this.words[H]=M&67108863;return this.negative=1,this.strip()},Y.prototype._wordDiv=function(J,W){var F=this.length-J.length,V=this.clone(),H=J,M=H.words[H.length-1]|0,T=this._countBits(M);if(F=26-T,F!==0)H=H.ushln(F),V.iushln(F),M=H.words[H.length-1]|0;var E=V.length-H.length,$;if(W!=="mod"){$=new Y(null),$.length=E+1,$.words=Array($.length);for(var q=0;q<$.length;q++)$.words[q]=0}var j=V.clone()._ishlnsubmul(H,1,E);if(j.negative===0){if(V=j,$)$.words[E]=1}for(var L=E-1;L>=0;L--){var x=(V.words[H.length+L]|0)*67108864+(V.words[H.length+L-1]|0);x=Math.min(x/M|0,67108863),V._ishlnsubmul(H,x,L);while(V.negative!==0)if(x--,V.negative=0,V._ishlnsubmul(H,1,L),!V.isZero())V.negative^=1;if($)$.words[L]=x}if($)$.strip();if(V.strip(),W!=="div"&&F!==0)V.iushrn(F);return{div:$||null,mod:V}},Y.prototype.divmod=function(J,W,F){if(G(!J.isZero()),this.isZero())return{div:new Y(0),mod:new Y(0)};var V,H,M;if(this.negative!==0&&J.negative===0){if(M=this.neg().divmod(J,W),W!=="mod")V=M.div.neg();if(W!=="div"){if(H=M.mod.neg(),F&&H.negative!==0)H.iadd(J)}return{div:V,mod:H}}if(this.negative===0&&J.negative!==0){if(M=this.divmod(J.neg(),W),W!=="mod")V=M.div.neg();return{div:V,mod:M.mod}}if((this.negative&J.negative)!==0){if(M=this.neg().divmod(J.neg(),W),W!=="div"){if(H=M.mod.neg(),F&&H.negative!==0)H.isub(J)}return{div:M.div,mod:H}}if(J.length>this.length||this.cmp(J)<0)return{div:new Y(0),mod:this};if(J.length===1){if(W==="div")return{div:this.divn(J.words[0]),mod:null};if(W==="mod")return{div:null,mod:new Y(this.modn(J.words[0]))};return{div:this.divn(J.words[0]),mod:new Y(this.modn(J.words[0]))}}return this._wordDiv(J,W)},Y.prototype.div=function(J){return this.divmod(J,"div",!1).div},Y.prototype.mod=function(J){return this.divmod(J,"mod",!1).mod},Y.prototype.umod=function(J){return this.divmod(J,"mod",!0).mod},Y.prototype.divRound=function(J){var W=this.divmod(J);if(W.mod.isZero())return W.div;var F=W.div.negative!==0?W.mod.isub(J):W.mod,V=J.ushrn(1),H=J.andln(1),M=F.cmp(V);if(M<0||H===1&&M===0)return W.div;return W.div.negative!==0?W.div.isubn(1):W.div.iaddn(1)},Y.prototype.modn=function(J){G(J<=67108863);var W=67108864%J,F=0;for(var V=this.length-1;V>=0;V--)F=(W*F+(this.words[V]|0))%J;return F},Y.prototype.idivn=function(J){G(J<=67108863);var W=0;for(var F=this.length-1;F>=0;F--){var V=(this.words[F]|0)+W*67108864;this.words[F]=V/J|0,W=V%J}return this.strip()},Y.prototype.divn=function(J){return this.clone().idivn(J)},Y.prototype.egcd=function(J){G(J.negative===0),G(!J.isZero());var W=this,F=J.clone();if(W.negative!==0)W=W.umod(J);else W=W.clone();var V=new Y(1),H=new Y(0),M=new Y(0),T=new Y(1),E=0;while(W.isEven()&&F.isEven())W.iushrn(1),F.iushrn(1),++E;var $=F.clone(),q=W.clone();while(!W.isZero()){for(var j=0,L=1;(W.words[0]&L)===0&&j<26;++j,L<<=1);if(j>0){W.iushrn(j);while(j-- >0){if(V.isOdd()||H.isOdd())V.iadd($),H.isub(q);V.iushrn(1),H.iushrn(1)}}for(var x=0,f=1;(F.words[0]&f)===0&&x<26;++x,f<<=1);if(x>0){F.iushrn(x);while(x-- >0){if(M.isOdd()||T.isOdd())M.iadd($),T.isub(q);M.iushrn(1),T.iushrn(1)}}if(W.cmp(F)>=0)W.isub(F),V.isub(M),H.isub(T);else F.isub(W),M.isub(V),T.isub(H)}return{a:M,b:T,gcd:F.iushln(E)}},Y.prototype._invmp=function(J){G(J.negative===0),G(!J.isZero());var W=this,F=J.clone();if(W.negative!==0)W=W.umod(J);else W=W.clone();var V=new Y(1),H=new Y(0),M=F.clone();while(W.cmpn(1)>0&&F.cmpn(1)>0){for(var T=0,E=1;(W.words[0]&E)===0&&T<26;++T,E<<=1);if(T>0){W.iushrn(T);while(T-- >0){if(V.isOdd())V.iadd(M);V.iushrn(1)}}for(var $=0,q=1;(F.words[0]&q)===0&&$<26;++$,q<<=1);if($>0){F.iushrn($);while($-- >0){if(H.isOdd())H.iadd(M);H.iushrn(1)}}if(W.cmp(F)>=0)W.isub(F),V.isub(H);else F.isub(W),H.isub(V)}var j;if(W.cmpn(1)===0)j=V;else j=H;if(j.cmpn(0)<0)j.iadd(J);return j},Y.prototype.gcd=function(J){if(this.isZero())return J.abs();if(J.isZero())return this.abs();var W=this.clone(),F=J.clone();W.negative=0,F.negative=0;for(var V=0;W.isEven()&&F.isEven();V++)W.iushrn(1),F.iushrn(1);do{while(W.isEven())W.iushrn(1);while(F.isEven())F.iushrn(1);var H=W.cmp(F);if(H<0){var M=W;W=F,F=M}else if(H===0||F.cmpn(1)===0)break;W.isub(F)}while(!0);return F.iushln(V)},Y.prototype.invm=function(J){return this.egcd(J).a.umod(J)},Y.prototype.isEven=function(){return(this.words[0]&1)===0},Y.prototype.isOdd=function(){return(this.words[0]&1)===1},Y.prototype.andln=function(J){return this.words[0]&J},Y.prototype.bincn=function(J){G(typeof J==="number");var W=J%26,F=(J-W)/26,V=1<<W;if(this.length<=F)return this._expand(F+1),this.words[F]|=V,this;var H=V;for(var M=F;H!==0&&M<this.length;M++){var T=this.words[M]|0;T+=H,H=T>>>26,T&=67108863,this.words[M]=T}if(H!==0)this.words[M]=H,this.length++;return this},Y.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Y.prototype.cmpn=function(J){var W=J<0;if(this.negative!==0&&!W)return-1;if(this.negative===0&&W)return 1;this.strip();var F;if(this.length>1)F=1;else{if(W)J=-J;G(J<=67108863,"Number is too big");var V=this.words[0]|0;F=V===J?0:V<J?-1:1}if(this.negative!==0)return-F|0;return F},Y.prototype.cmp=function(J){if(this.negative!==0&&J.negative===0)return-1;if(this.negative===0&&J.negative!==0)return 1;var W=this.ucmp(J);if(this.negative!==0)return-W|0;return W},Y.prototype.ucmp=function(J){if(this.length>J.length)return 1;if(this.length<J.length)return-1;var W=0;for(var F=this.length-1;F>=0;F--){var V=this.words[F]|0,H=J.words[F]|0;if(V===H)continue;if(V<H)W=-1;else if(V>H)W=1;break}return W},Y.prototype.gtn=function(J){return this.cmpn(J)===1},Y.prototype.gt=function(J){return this.cmp(J)===1},Y.prototype.gten=function(J){return this.cmpn(J)>=0},Y.prototype.gte=function(J){return this.cmp(J)>=0},Y.prototype.ltn=function(J){return this.cmpn(J)===-1},Y.prototype.lt=function(J){return this.cmp(J)===-1},Y.prototype.lten=function(J){return this.cmpn(J)<=0},Y.prototype.lte=function(J){return this.cmp(J)<=0},Y.prototype.eqn=function(J){return this.cmpn(J)===0},Y.prototype.eq=function(J){return this.cmp(J)===0},Y.red=function(J){return new l(J)},Y.prototype.toRed=function(J){return G(!this.red,"Already a number in reduction context"),G(this.negative===0,"red works only with positives"),J.convertTo(this)._forceRed(J)},Y.prototype.fromRed=function(){return G(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Y.prototype._forceRed=function(J){return this.red=J,this},Y.prototype.forceRed=function(J){return G(!this.red,"Already a number in reduction context"),this._forceRed(J)},Y.prototype.redAdd=function(J){return G(this.red,"redAdd works only with red numbers"),this.red.add(this,J)},Y.prototype.redIAdd=function(J){return G(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,J)},Y.prototype.redSub=function(J){return G(this.red,"redSub works only with red numbers"),this.red.sub(this,J)},Y.prototype.redISub=function(J){return G(this.red,"redISub works only with red numbers"),this.red.isub(this,J)},Y.prototype.redShl=function(J){return G(this.red,"redShl works only with red numbers"),this.red.shl(this,J)},Y.prototype.redMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.mul(this,J)},Y.prototype.redIMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.imul(this,J)},Y.prototype.redSqr=function(){return G(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Y.prototype.redISqr=function(){return G(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Y.prototype.redSqrt=function(){return G(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Y.prototype.redInvm=function(){return G(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Y.prototype.redNeg=function(){return G(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Y.prototype.redPow=function(J){return G(this.red&&!J.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,J)};var v={k256:null,p224:null,p192:null,p25519:null};function _(J,W){this.name=J,this.p=new Y(W,16),this.n=this.p.bitLength(),this.k=new Y(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}_.prototype._tmp=function(){var J=new Y(null);return J.words=Array(Math.ceil(this.n/13)),J},_.prototype.ireduce=function(J){var W=J,F;do this.split(W,this.tmp),W=this.imulK(W),W=W.iadd(this.tmp),F=W.bitLength();while(F>this.n);var V=F<this.n?-1:W.ucmp(this.p);if(V===0)W.words[0]=0,W.length=1;else if(V>0)W.isub(this.p);else if(W.strip!==void 0)W.strip();else W._strip();return W},_.prototype.split=function(J,W){J.iushrn(this.n,0,W)},_.prototype.imulK=function(J){return J.imul(this.k)};function u(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(u,_),u.prototype.split=function(J,W){var F=4194303,V=Math.min(J.length,9);for(var H=0;H<V;H++)W.words[H]=J.words[H];if(W.length=V,J.length<=9){J.words[0]=0,J.length=1;return}var M=J.words[9];W.words[W.length++]=M&F;for(H=10;H<J.length;H++){var T=J.words[H]|0;J.words[H-10]=(T&F)<<4|M>>>22,M=T}if(M>>>=22,J.words[H-10]=M,M===0&&J.length>10)J.length-=10;else J.length-=9},u.prototype.imulK=function(J){J.words[J.length]=0,J.words[J.length+1]=0,J.length+=2;var W=0;for(var F=0;F<J.length;F++){var V=J.words[F]|0;W+=V*977,J.words[F]=W&67108863,W=V*64+(W/67108864|0)}if(J.words[J.length-1]===0){if(J.length--,J.words[J.length-1]===0)J.length--}return J};function J0(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(J0,_);function H0(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(H0,_);function V0(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(V0,_),V0.prototype.imulK=function(J){var W=0;for(var F=0;F<J.length;F++){var V=(J.words[F]|0)*19+W,H=V&67108863;V>>>=26,J.words[F]=H,W=V}if(W!==0)J.words[J.length++]=W;return J},Y._prime=function(J){if(v[J])return v[J];var W;if(J==="k256")W=new u;else if(J==="p224")W=new J0;else if(J==="p192")W=new H0;else if(J==="p25519")W=new V0;else throw Error("Unknown prime "+J);return v[J]=W,W};function l(J){if(typeof J==="string"){var W=Y._prime(J);this.m=W.p,this.prime=W}else G(J.gtn(1),"modulus must be greater than 1"),this.m=J,this.prime=null}l.prototype._verify1=function(J){G(J.negative===0,"red works only with positives"),G(J.red,"red works only with red numbers")},l.prototype._verify2=function(J,W){G((J.negative|W.negative)===0,"red works only with positives"),G(J.red&&J.red===W.red,"red works only with red numbers")},l.prototype.imod=function(J){if(this.prime)return this.prime.ireduce(J)._forceRed(this);return J.umod(this.m)._forceRed(this)},l.prototype.neg=function(J){if(J.isZero())return J.clone();return this.m.sub(J)._forceRed(this)},l.prototype.add=function(J,W){this._verify2(J,W);var F=J.add(W);if(F.cmp(this.m)>=0)F.isub(this.m);return F._forceRed(this)},l.prototype.iadd=function(J,W){this._verify2(J,W);var F=J.iadd(W);if(F.cmp(this.m)>=0)F.isub(this.m);return F},l.prototype.sub=function(J,W){this._verify2(J,W);var F=J.sub(W);if(F.cmpn(0)<0)F.iadd(this.m);return F._forceRed(this)},l.prototype.isub=function(J,W){this._verify2(J,W);var F=J.isub(W);if(F.cmpn(0)<0)F.iadd(this.m);return F},l.prototype.shl=function(J,W){return this._verify1(J),this.imod(J.ushln(W))},l.prototype.imul=function(J,W){return this._verify2(J,W),this.imod(J.imul(W))},l.prototype.mul=function(J,W){return this._verify2(J,W),this.imod(J.mul(W))},l.prototype.isqr=function(J){return this.imul(J,J.clone())},l.prototype.sqr=function(J){return this.mul(J,J)},l.prototype.sqrt=function(J){if(J.isZero())return J.clone();var W=this.m.andln(3);if(G(W%2===1),W===3){var F=this.m.add(new Y(1)).iushrn(2);return this.pow(J,F)}var V=this.m.subn(1),H=0;while(!V.isZero()&&V.andln(1)===0)H++,V.iushrn(1);G(!V.isZero());var M=new Y(1).toRed(this),T=M.redNeg(),E=this.m.subn(1).iushrn(1),$=this.m.bitLength();$=new Y(2*$*$).toRed(this);while(this.pow($,E).cmp(T)!==0)$.redIAdd(T);var q=this.pow($,V),j=this.pow(J,V.addn(1).iushrn(1)),L=this.pow(J,V),x=H;while(L.cmp(M)!==0){var f=L;for(var b=0;f.cmp(M)!==0;b++)f=f.redSqr();G(b<x);var s=this.pow(q,new Y(1).iushln(x-b-1));j=j.redMul(s),q=s.redSqr(),L=L.redMul(q),x=b}return j},l.prototype.invm=function(J){var W=J._invmp(this.m);if(W.negative!==0)return W.negative=0,this.imod(W).redNeg();else return this.imod(W)},l.prototype.pow=function(J,W){if(W.isZero())return new Y(1).toRed(this);if(W.cmpn(1)===0)return J.clone();var F=4,V=Array(1<<F);V[0]=new Y(1).toRed(this),V[1]=J;for(var H=2;H<V.length;H++)V[H]=this.mul(V[H-1],J);var M=V[0],T=0,E=0,$=W.bitLength()%26;if($===0)$=26;for(H=W.length-1;H>=0;H--){var q=W.words[H];for(var j=$-1;j>=0;j--){var L=q>>j&1;if(M!==V[0])M=this.sqr(M);if(L===0&&T===0){E=0;continue}if(T<<=1,T|=L,E++,E!==F&&(H!==0||j!==0))continue;M=this.mul(M,V[T]),E=0,T=0}$=26}return M},l.prototype.convertTo=function(J){var W=J.umod(this.m);return W===J?W.clone():W},l.prototype.convertFrom=function(J){var W=J.clone();return W.red=null,W},Y.mont=function(J){return new U0(J)};function U0(J){if(l.call(this,J),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Y(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)}O(U0,l),U0.prototype.convertTo=function(J){return this.imod(J.ushln(this.shift))},U0.prototype.convertFrom=function(J){var W=this.imod(J.mul(this.rinv));return W.red=null,W},U0.prototype.imul=function(J,W){if(J.isZero()||W.isZero())return J.words[0]=0,J.length=1,J;var F=J.imul(W),V=F.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),H=F.isub(V).iushrn(this.shift),M=H;if(H.cmp(this.m)>=0)M=H.isub(this.m);else if(H.cmpn(0)<0)M=H.iadd(this.m);return M._forceRed(this)},U0.prototype.mul=function(J,W){if(J.isZero()||W.isZero())return new Y(0)._forceRed(this);var F=J.mul(W),V=F.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),H=F.isub(V).iushrn(this.shift),M=H;if(H.cmp(this.m)>=0)M=H.isub(this.m);else if(H.cmpn(0)<0)M=H.iadd(this.m);return M._forceRed(this)},U0.prototype.invm=function(J){var W=this.imod(J._invmp(this.m).mul(this.r2));return W._forceRed(this)}})(typeof Z>"u"||Z,X)}),KQ=D0((X,Z)=>{Z.exports=U;function U(Q,G){if(!Q)throw Error(G||"Assertion failed")}U.equal=function(Q,G,O){if(Q!=G)throw Error(O||"Assertion failed: "+Q+" != "+G)}}),HV=D0((X)=>{var Z=X;function U(O,Y){if(Array.isArray(O))return O.slice();if(!O)return[];var K=[];if(typeof O!=="string"){for(var A=0;A<O.length;A++)K[A]=O[A]|0;return K}if(Y==="hex"){if(O=O.replace(/[^a-z0-9]+/ig,""),O.length%2!==0)O="0"+O;for(var A=0;A<O.length;A+=2)K.push(parseInt(O[A]+O[A+1],16))}else for(var A=0;A<O.length;A++){var D=O.charCodeAt(A),C=D>>8,z=D&255;if(C)K.push(C,z);else K.push(z)}return K}Z.toArray=U;function Q(O){if(O.length===1)return"0"+O;else return O}Z.zero2=Q;function G(O){var Y="";for(var K=0;K<O.length;K++)Y+=Q(O[K].toString(16));return Y}Z.toHex=G,Z.encode=function(O,Y){if(Y==="hex")return G(O);else return O}}),BZ=D0((X)=>{var Z=X,U=QQ(),Q=KQ(),G=HV();Z.assert=Q,Z.toArray=G.toArray,Z.zero2=G.zero2,Z.toHex=G.toHex,Z.encode=G.encode;function O(C,z,R){var S=Array(Math.max(C.bitLength(),R)+1),P;for(P=0;P<S.length;P+=1)S[P]=0;var N=1<<z+1,I=C.clone();for(P=0;P<S.length;P++){var B,k=I.andln(N-1);if(I.isOdd()){if(k>(N>>1)-1)B=(N>>1)-k;else B=k;I.isubn(B)}else B=0;S[P]=B,I.iushrn(1)}return S}Z.getNAF=O;function Y(C,z){var R=[[],[]];C=C.clone(),z=z.clone();var S=0,P=0,N;while(C.cmpn(-S)>0||z.cmpn(-P)>0){var I=C.andln(3)+S&3,B=z.andln(3)+P&3;if(I===3)I=-1;if(B===3)B=-1;var k;if((I&1)===0)k=0;else if(N=C.andln(7)+S&7,(N===3||N===5)&&B===2)k=-I;else k=I;R[0].push(k);var w;if((B&1)===0)w=0;else if(N=z.andln(7)+P&7,(N===3||N===5)&&I===2)w=-B;else w=B;if(R[1].push(w),2*S===k+1)S=1-S;if(2*P===w+1)P=1-P;C.iushrn(1),z.iushrn(1)}return R}Z.getJSF=Y;function K(C,z,R){var S="_"+z;C.prototype[z]=function(){return this[S]!==void 0?this[S]:this[S]=R.call(this)}}Z.cachedProperty=K;function A(C){return typeof C==="string"?Z.toArray(C,"hex"):C}Z.parseBytes=A;function D(C){return new U(C,"hex","le")}Z.intFromLE=D}),FV=D0((X,Z)=>{var U;Z.exports=function(O){if(!U)U=new Q(null);return U.generate(O)};function Q(O){this.rand=O}if(Z.exports.Rand=Q,Q.prototype.generate=function(O){return this._rand(O)},Q.prototype._rand=function(O){if(this.rand.getBytes)return this.rand.getBytes(O);var Y=new Uint8Array(O);for(var K=0;K<Y.length;K++)Y[K]=this.rand.getByte();return Y},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)Q.prototype._rand=function(O){var Y=new Uint8Array(O);return self.crypto.getRandomValues(Y),Y};else if(self.msCrypto&&self.msCrypto.getRandomValues)Q.prototype._rand=function(O){var Y=new Uint8Array(O);return self.msCrypto.getRandomValues(Y),Y};else if(typeof window==="object")Q.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(G=(EZ(),WX(KZ)),typeof G.randomBytes!=="function")throw Error("Not supported");Q.prototype._rand=function(O){return G.randomBytes(O)}}catch(O){}var G}),OJ=D0((X,Z)=>{var U=QQ(),Q=BZ(),G=Q.getNAF,O=Q.getJSF,Y=Q.assert;function K(D,C){this.type=D,this.p=new U(C.p,16),this.red=C.prime?U.red(C.prime):U.mont(this.p),this.zero=new U(0).toRed(this.red),this.one=new U(1).toRed(this.red),this.two=new U(2).toRed(this.red),this.n=C.n&&new U(C.n,16),this.g=C.g&&this.pointFromJSON(C.g,C.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var z=this.n&&this.p.div(this.n);if(!z||z.cmpn(100)>0)this.redN=null;else this._maxwellTrick=!0,this.redN=this.n.toRed(this.red)}Z.exports=K,K.prototype.point=function(){throw Error("Not implemented")},K.prototype.validate=function(){throw Error("Not implemented")},K.prototype._fixedNafMul=function(D,C){Y(D.precomputed);var z=D._getDoubles(),R=G(C,1,this._bitLength),S=(1<<z.step+1)-(z.step%2===0?2:1);S/=3;var P=[],N,I;for(N=0;N<R.length;N+=z.step){I=0;for(var B=N+z.step-1;B>=N;B--)I=(I<<1)+R[B];P.push(I)}var k=this.jpoint(null,null,null),w=this.jpoint(null,null,null);for(var v=S;v>0;v--){for(N=0;N<P.length;N++)if(I=P[N],I===v)w=w.mixedAdd(z.points[N]);else if(I===-v)w=w.mixedAdd(z.points[N].neg());k=k.add(w)}return k.toP()},K.prototype._wnafMul=function(D,C){var z=4,R=D._getNAFPoints(z);z=R.wnd;var S=R.points,P=G(C,z,this._bitLength),N=this.jpoint(null,null,null);for(var I=P.length-1;I>=0;I--){for(var B=0;I>=0&&P[I]===0;I--)B++;if(I>=0)B++;if(N=N.dblp(B),I<0)break;var k=P[I];if(Y(k!==0),D.type==="affine")if(k>0)N=N.mixedAdd(S[k-1>>1]);else N=N.mixedAdd(S[-k-1>>1].neg());else if(k>0)N=N.add(S[k-1>>1]);else N=N.add(S[-k-1>>1].neg())}return D.type==="affine"?N.toP():N},K.prototype._wnafMulAdd=function(D,C,z,R,S){var P=this._wnafT1,N=this._wnafT2,I=this._wnafT3,B=0,k,w,v;for(k=0;k<R;k++){v=C[k];var _=v._getNAFPoints(D);P[k]=_.wnd,N[k]=_.points}for(k=R-1;k>=1;k-=2){var u=k-1,J0=k;if(P[u]!==1||P[J0]!==1){I[u]=G(z[u],P[u],this._bitLength),I[J0]=G(z[J0],P[J0],this._bitLength),B=Math.max(I[u].length,B),B=Math.max(I[J0].length,B);continue}var H0=[C[u],null,null,C[J0]];if(C[u].y.cmp(C[J0].y)===0)H0[1]=C[u].add(C[J0]),H0[2]=C[u].toJ().mixedAdd(C[J0].neg());else if(C[u].y.cmp(C[J0].y.redNeg())===0)H0[1]=C[u].toJ().mixedAdd(C[J0]),H0[2]=C[u].add(C[J0].neg());else H0[1]=C[u].toJ().mixedAdd(C[J0]),H0[2]=C[u].toJ().mixedAdd(C[J0].neg());var V0=[-3,-1,-5,-7,0,7,5,1,3],l=O(z[u],z[J0]);B=Math.max(l[0].length,B),I[u]=Array(B),I[J0]=Array(B);for(w=0;w<B;w++){var U0=l[0][w]|0,J=l[1][w]|0;I[u][w]=V0[(U0+1)*3+(J+1)],I[J0][w]=0,N[u]=H0}}var W=this.jpoint(null,null,null),F=this._wnafT4;for(k=B;k>=0;k--){var V=0;while(k>=0){var H=!0;for(w=0;w<R;w++)if(F[w]=I[w][k]|0,F[w]!==0)H=!1;if(!H)break;V++,k--}if(k>=0)V++;if(W=W.dblp(V),k<0)break;for(w=0;w<R;w++){var M=F[w];if(M===0)continue;else if(M>0)v=N[w][M-1>>1];else if(M<0)v=N[w][-M-1>>1].neg();if(v.type==="affine")W=W.mixedAdd(v);else W=W.add(v)}}for(k=0;k<R;k++)N[k]=null;if(S)return W;else return W.toP()};function A(D,C){this.curve=D,this.type=C,this.precomputed=null}K.BasePoint=A,A.prototype.eq=function(){throw Error("Not implemented")},A.prototype.validate=function(){return this.curve.validate(this)},K.prototype.decodePoint=function(D,C){D=Q.toArray(D,C);var z=this.p.byteLength();if((D[0]===4||D[0]===6||D[0]===7)&&D.length-1===2*z){if(D[0]===6)Y(D[D.length-1]%2===0);else if(D[0]===7)Y(D[D.length-1]%2===1);var R=this.point(D.slice(1,1+z),D.slice(1+z,1+2*z));return R}else if((D[0]===2||D[0]===3)&&D.length-1===z)return this.pointFromX(D.slice(1,1+z),D[0]===3);throw Error("Unknown point format")},A.prototype.encodeCompressed=function(D){return this.encode(D,!0)},A.prototype._encode=function(D){var C=this.curve.p.byteLength(),z=this.getX().toArray("be",C);if(D)return[this.getY().isEven()?2:3].concat(z);return[4].concat(z,this.getY().toArray("be",C))},A.prototype.encode=function(D,C){return Q.encode(this._encode(C),D)},A.prototype.precompute=function(D){if(this.precomputed)return this;var C={doubles:null,naf:null,beta:null};return C.naf=this._getNAFPoints(8),C.doubles=this._getDoubles(4,D),C.beta=this._getBeta(),this.precomputed=C,this},A.prototype._hasDoubles=function(D){if(!this.precomputed)return!1;var C=this.precomputed.doubles;if(!C)return!1;return C.points.length>=Math.ceil((D.bitLength()+1)/C.step)},A.prototype._getDoubles=function(D,C){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var z=[this],R=this;for(var S=0;S<C;S+=D){for(var P=0;P<D;P++)R=R.dbl();z.push(R)}return{step:D,points:z}},A.prototype._getNAFPoints=function(D){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var C=[this],z=(1<<D)-1,R=z===1?null:this.dbl();for(var S=1;S<z;S++)C[S]=C[S-1].add(R);return{wnd:D,points:C}},A.prototype._getBeta=function(){return null},A.prototype.dblp=function(D){var C=this;for(var z=0;z<D;z++)C=C.dbl();return C}}),nF=D0((X,Z)=>{if(typeof Object.create==="function")Z.exports=function(U,Q){if(Q)U.super_=Q,U.prototype=Object.create(Q.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}})};else Z.exports=function(U,Q){if(Q){U.super_=Q;var G=function(){};G.prototype=Q.prototype,U.prototype=new G,U.prototype.constructor=U}}}),LZ=D0((X,Z)=>{try{if(U=(jG(),WX(IG)),typeof U.inherits!=="function")throw"";Z.exports=U.inherits}catch(Q){Z.exports=nF()}var U}),sF=D0((X,Z)=>{var U=BZ(),Q=QQ(),G=LZ(),O=OJ(),Y=U.assert;function K(C){O.call(this,"short",C),this.a=new Q(C.a,16).toRed(this.red),this.b=new Q(C.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(C),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}G(K,O),Z.exports=K,K.prototype._getEndomorphism=function(C){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var z,R;if(C.beta)z=new Q(C.beta,16).toRed(this.red);else{var S=this._getEndoRoots(this.p);z=S[0].cmp(S[1])<0?S[0]:S[1],z=z.toRed(this.red)}if(C.lambda)R=new Q(C.lambda,16);else{var P=this._getEndoRoots(this.n);if(this.g.mul(P[0]).x.cmp(this.g.x.redMul(z))===0)R=P[0];else R=P[1],Y(this.g.mul(R).x.cmp(this.g.x.redMul(z))===0)}var N;if(C.basis)N=C.basis.map(function(I){return{a:new Q(I.a,16),b:new Q(I.b,16)}});else N=this._getEndoBasis(R);return{beta:z,lambda:R,basis:N}},K.prototype._getEndoRoots=function(C){var z=C===this.p?this.red:Q.mont(C),R=new Q(2).toRed(z).redInvm(),S=R.redNeg(),P=new Q(3).toRed(z).redNeg().redSqrt().redMul(R),N=S.redAdd(P).fromRed(),I=S.redSub(P).fromRed();return[N,I]},K.prototype._getEndoBasis=function(C){var z=this.n.ushrn(Math.floor(this.n.bitLength()/2)),R=C,S=this.n.clone(),P=new Q(1),N=new Q(0),I=new Q(0),B=new Q(1),k,w,v,_,u,J0,H0,V0=0,l,U0;while(R.cmpn(0)!==0){var J=S.div(R);l=S.sub(J.mul(R)),U0=I.sub(J.mul(P));var W=B.sub(J.mul(N));if(!v&&l.cmp(z)<0)k=H0.neg(),w=P,v=l.neg(),_=U0;else if(v&&++V0===2)break;H0=l,S=R,R=l,I=P,P=U0,B=N,N=W}u=l.neg(),J0=U0;var F=v.sqr().add(_.sqr()),V=u.sqr().add(J0.sqr());if(V.cmp(F)>=0)u=k,J0=w;if(v.negative)v=v.neg(),_=_.neg();if(u.negative)u=u.neg(),J0=J0.neg();return[{a:v,b:_},{a:u,b:J0}]},K.prototype._endoSplit=function(C){var z=this.endo.basis,R=z[0],S=z[1],P=S.b.mul(C).divRound(this.n),N=R.b.neg().mul(C).divRound(this.n),I=P.mul(R.a),B=N.mul(S.a),k=P.mul(R.b),w=N.mul(S.b),v=C.sub(I).sub(B),_=k.add(w).neg();return{k1:v,k2:_}},K.prototype.pointFromX=function(C,z){if(C=new Q(C,16),!C.red)C=C.toRed(this.red);var R=C.redSqr().redMul(C).redIAdd(C.redMul(this.a)).redIAdd(this.b),S=R.redSqrt();if(S.redSqr().redSub(R).cmp(this.zero)!==0)throw Error("invalid point");var P=S.fromRed().isOdd();if(z&&!P||!z&&P)S=S.redNeg();return this.point(C,S)},K.prototype.validate=function(C){if(C.inf)return!0;var{x:z,y:R}=C,S=this.a.redMul(z),P=z.redSqr().redMul(z).redIAdd(S).redIAdd(this.b);return R.redSqr().redISub(P).cmpn(0)===0},K.prototype._endoWnafMulAdd=function(C,z,R){var S=this._endoWnafT1,P=this._endoWnafT2;for(var N=0;N<C.length;N++){var I=this._endoSplit(z[N]),B=C[N],k=B._getBeta();if(I.k1.negative)I.k1.ineg(),B=B.neg(!0);if(I.k2.negative)I.k2.ineg(),k=k.neg(!0);S[N*2]=B,S[N*2+1]=k,P[N*2]=I.k1,P[N*2+1]=I.k2}var w=this._wnafMulAdd(1,S,P,N*2,R);for(var v=0;v<N*2;v++)S[v]=null,P[v]=null;return w};function A(C,z,R,S){if(O.BasePoint.call(this,C,"affine"),z===null&&R===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new Q(z,16),this.y=new Q(R,16),S)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}}G(A,O.BasePoint),K.prototype.point=function(C,z,R){return new A(this,C,z,R)},K.prototype.pointFromJSON=function(C,z){return A.fromJSON(this,C,z)},A.prototype._getBeta=function(){if(!this.curve.endo)return;var C=this.precomputed;if(C&&C.beta)return C.beta;var z=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(C){var R=this.curve,S=function(P){return R.point(P.x.redMul(R.endo.beta),P.y)};C.beta=z,z.precomputed={beta:null,naf:C.naf&&{wnd:C.naf.wnd,points:C.naf.points.map(S)},doubles:C.doubles&&{step:C.doubles.step,points:C.doubles.points.map(S)}}}return z},A.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)}}]},A.fromJSON=function(C,z,R){if(typeof z==="string")z=JSON.parse(z);var S=C.point(z[0],z[1],R);if(!z[2])return S;function P(I){return C.point(I[0],I[1],R)}var N=z[2];return S.precomputed={beta:null,doubles:N.doubles&&{step:N.doubles.step,points:[S].concat(N.doubles.points.map(P))},naf:N.naf&&{wnd:N.naf.wnd,points:[S].concat(N.naf.points.map(P))}},S},A.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)+">"},A.prototype.isInfinity=function(){return this.inf},A.prototype.add=function(C){if(this.inf)return C;if(C.inf)return this;if(this.eq(C))return this.dbl();if(this.neg().eq(C))return this.curve.point(null,null);if(this.x.cmp(C.x)===0)return this.curve.point(null,null);var z=this.y.redSub(C.y);if(z.cmpn(0)!==0)z=z.redMul(this.x.redSub(C.x).redInvm());var R=z.redSqr().redISub(this.x).redISub(C.x),S=z.redMul(this.x.redSub(R)).redISub(this.y);return this.curve.point(R,S)},A.prototype.dbl=function(){if(this.inf)return this;var C=this.y.redAdd(this.y);if(C.cmpn(0)===0)return this.curve.point(null,null);var z=this.curve.a,R=this.x.redSqr(),S=C.redInvm(),P=R.redAdd(R).redIAdd(R).redIAdd(z).redMul(S),N=P.redSqr().redISub(this.x.redAdd(this.x)),I=P.redMul(this.x.redSub(N)).redISub(this.y);return this.curve.point(N,I)},A.prototype.getX=function(){return this.x.fromRed()},A.prototype.getY=function(){return this.y.fromRed()},A.prototype.mul=function(C){if(C=new Q(C,16),this.isInfinity())return this;else if(this._hasDoubles(C))return this.curve._fixedNafMul(this,C);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[C]);else return this.curve._wnafMul(this,C)},A.prototype.mulAdd=function(C,z,R){var S=[this,z],P=[C,R];if(this.curve.endo)return this.curve._endoWnafMulAdd(S,P);else return this.curve._wnafMulAdd(1,S,P,2)},A.prototype.jmulAdd=function(C,z,R){var S=[this,z],P=[C,R];if(this.curve.endo)return this.curve._endoWnafMulAdd(S,P,!0);else return this.curve._wnafMulAdd(1,S,P,2,!0)},A.prototype.eq=function(C){return this===C||this.inf===C.inf&&(this.inf||this.x.cmp(C.x)===0&&this.y.cmp(C.y)===0)},A.prototype.neg=function(C){if(this.inf)return this;var z=this.curve.point(this.x,this.y.redNeg());if(C&&this.precomputed){var R=this.precomputed,S=function(P){return P.neg()};z.precomputed={naf:R.naf&&{wnd:R.naf.wnd,points:R.naf.points.map(S)},doubles:R.doubles&&{step:R.doubles.step,points:R.doubles.points.map(S)}}}return z},A.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var C=this.curve.jpoint(this.x,this.y,this.curve.one);return C};function D(C,z,R,S){if(O.BasePoint.call(this,C,"jacobian"),z===null&&R===null&&S===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new Q(0);else this.x=new Q(z,16),this.y=new Q(R,16),this.z=new Q(S,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}G(D,O.BasePoint),K.prototype.jpoint=function(C,z,R){return new D(this,C,z,R)},D.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var C=this.z.redInvm(),z=C.redSqr(),R=this.x.redMul(z),S=this.y.redMul(z).redMul(C);return this.curve.point(R,S)},D.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},D.prototype.add=function(C){if(this.isInfinity())return C;if(C.isInfinity())return this;var z=C.z.redSqr(),R=this.z.redSqr(),S=this.x.redMul(z),P=C.x.redMul(R),N=this.y.redMul(z.redMul(C.z)),I=C.y.redMul(R.redMul(this.z)),B=S.redSub(P),k=N.redSub(I);if(B.cmpn(0)===0)if(k.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var w=B.redSqr(),v=w.redMul(B),_=S.redMul(w),u=k.redSqr().redIAdd(v).redISub(_).redISub(_),J0=k.redMul(_.redISub(u)).redISub(N.redMul(v)),H0=this.z.redMul(C.z).redMul(B);return this.curve.jpoint(u,J0,H0)},D.prototype.mixedAdd=function(C){if(this.isInfinity())return C.toJ();if(C.isInfinity())return this;var z=this.z.redSqr(),R=this.x,S=C.x.redMul(z),P=this.y,N=C.y.redMul(z).redMul(this.z),I=R.redSub(S),B=P.redSub(N);if(I.cmpn(0)===0)if(B.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var k=I.redSqr(),w=k.redMul(I),v=R.redMul(k),_=B.redSqr().redIAdd(w).redISub(v).redISub(v),u=B.redMul(v.redISub(_)).redISub(P.redMul(w)),J0=this.z.redMul(I);return this.curve.jpoint(_,u,J0)},D.prototype.dblp=function(C){if(C===0)return this;if(this.isInfinity())return this;if(!C)return this.dbl();var z;if(this.curve.zeroA||this.curve.threeA){var R=this;for(z=0;z<C;z++)R=R.dbl();return R}var S=this.curve.a,P=this.curve.tinv,N=this.x,I=this.y,B=this.z,k=B.redSqr().redSqr(),w=I.redAdd(I);for(z=0;z<C;z++){var v=N.redSqr(),_=w.redSqr(),u=_.redSqr(),J0=v.redAdd(v).redIAdd(v).redIAdd(S.redMul(k)),H0=N.redMul(_),V0=J0.redSqr().redISub(H0.redAdd(H0)),l=H0.redISub(V0),U0=J0.redMul(l);U0=U0.redIAdd(U0).redISub(u);var J=w.redMul(B);if(z+1<C)k=k.redMul(u);N=V0,B=J,w=U0}return this.curve.jpoint(N,w.redMul(P),B)},D.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()},D.prototype._zeroDbl=function(){var C,z,R;if(this.zOne){var S=this.x.redSqr(),P=this.y.redSqr(),N=P.redSqr(),I=this.x.redAdd(P).redSqr().redISub(S).redISub(N);I=I.redIAdd(I);var B=S.redAdd(S).redIAdd(S),k=B.redSqr().redISub(I).redISub(I),w=N.redIAdd(N);w=w.redIAdd(w),w=w.redIAdd(w),C=k,z=B.redMul(I.redISub(k)).redISub(w),R=this.y.redAdd(this.y)}else{var v=this.x.redSqr(),_=this.y.redSqr(),u=_.redSqr(),J0=this.x.redAdd(_).redSqr().redISub(v).redISub(u);J0=J0.redIAdd(J0);var H0=v.redAdd(v).redIAdd(v),V0=H0.redSqr(),l=u.redIAdd(u);l=l.redIAdd(l),l=l.redIAdd(l),C=V0.redISub(J0).redISub(J0),z=H0.redMul(J0.redISub(C)).redISub(l),R=this.y.redMul(this.z),R=R.redIAdd(R)}return this.curve.jpoint(C,z,R)},D.prototype._threeDbl=function(){var C,z,R;if(this.zOne){var S=this.x.redSqr(),P=this.y.redSqr(),N=P.redSqr(),I=this.x.redAdd(P).redSqr().redISub(S).redISub(N);I=I.redIAdd(I);var B=S.redAdd(S).redIAdd(S).redIAdd(this.curve.a),k=B.redSqr().redISub(I).redISub(I);C=k;var w=N.redIAdd(N);w=w.redIAdd(w),w=w.redIAdd(w),z=B.redMul(I.redISub(k)).redISub(w),R=this.y.redAdd(this.y)}else{var v=this.z.redSqr(),_=this.y.redSqr(),u=this.x.redMul(_),J0=this.x.redSub(v).redMul(this.x.redAdd(v));J0=J0.redAdd(J0).redIAdd(J0);var H0=u.redIAdd(u);H0=H0.redIAdd(H0);var V0=H0.redAdd(H0);C=J0.redSqr().redISub(V0),R=this.y.redAdd(this.z).redSqr().redISub(_).redISub(v);var l=_.redSqr();l=l.redIAdd(l),l=l.redIAdd(l),l=l.redIAdd(l),z=J0.redMul(H0.redISub(C)).redISub(l)}return this.curve.jpoint(C,z,R)},D.prototype._dbl=function(){var C=this.curve.a,z=this.x,R=this.y,S=this.z,P=S.redSqr().redSqr(),N=z.redSqr(),I=R.redSqr(),B=N.redAdd(N).redIAdd(N).redIAdd(C.redMul(P)),k=z.redAdd(z);k=k.redIAdd(k);var w=k.redMul(I),v=B.redSqr().redISub(w.redAdd(w)),_=w.redISub(v),u=I.redSqr();u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u);var J0=B.redMul(_).redISub(u),H0=R.redAdd(R).redMul(S);return this.curve.jpoint(v,J0,H0)},D.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var C=this.x.redSqr(),z=this.y.redSqr(),R=this.z.redSqr(),S=z.redSqr(),P=C.redAdd(C).redIAdd(C),N=P.redSqr(),I=this.x.redAdd(z).redSqr().redISub(C).redISub(S);I=I.redIAdd(I),I=I.redAdd(I).redIAdd(I),I=I.redISub(N);var B=I.redSqr(),k=S.redIAdd(S);k=k.redIAdd(k),k=k.redIAdd(k),k=k.redIAdd(k);var w=P.redIAdd(I).redSqr().redISub(N).redISub(B).redISub(k),v=z.redMul(w);v=v.redIAdd(v),v=v.redIAdd(v);var _=this.x.redMul(B).redISub(v);_=_.redIAdd(_),_=_.redIAdd(_);var u=this.y.redMul(w.redMul(k.redISub(w)).redISub(I.redMul(B)));u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u);var J0=this.z.redAdd(I).redSqr().redISub(R).redISub(B);return this.curve.jpoint(_,u,J0)},D.prototype.mul=function(C,z){return C=new Q(C,z),this.curve._wnafMul(this,C)},D.prototype.eq=function(C){if(C.type==="affine")return this.eq(C.toJ());if(this===C)return!0;var z=this.z.redSqr(),R=C.z.redSqr();if(this.x.redMul(R).redISub(C.x.redMul(z)).cmpn(0)!==0)return!1;var S=z.redMul(this.z),P=R.redMul(C.z);return this.y.redMul(P).redISub(C.y.redMul(S)).cmpn(0)===0},D.prototype.eqXToP=function(C){var z=this.z.redSqr(),R=C.toRed(this.curve.red).redMul(z);if(this.x.cmp(R)===0)return!0;var S=C.clone(),P=this.curve.redN.redMul(z);for(;;){if(S.iadd(this.curve.n),S.cmp(this.curve.p)>=0)return!1;if(R.redIAdd(P),this.x.cmp(R)===0)return!0}},D.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)+">"},D.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),rF=D0((X,Z)=>{var U=QQ(),Q=LZ(),G=OJ(),O=BZ();function Y(A){G.call(this,"mont",A),this.a=new U(A.a,16).toRed(this.red),this.b=new U(A.b,16).toRed(this.red),this.i4=new U(4).toRed(this.red).redInvm(),this.two=new U(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Q(Y,G),Z.exports=Y,Y.prototype.validate=function(A){var D=A.normalize().x,C=D.redSqr(),z=C.redMul(D).redAdd(C.redMul(this.a)).redAdd(D),R=z.redSqrt();return R.redSqr().cmp(z)===0};function K(A,D,C){if(G.BasePoint.call(this,A,"projective"),D===null&&C===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new U(D,16),this.z=new U(C,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}Q(K,G.BasePoint),Y.prototype.decodePoint=function(A,D){return this.point(O.toArray(A,D),1)},Y.prototype.point=function(A,D){return new K(this,A,D)},Y.prototype.pointFromJSON=function(A){return K.fromJSON(this,A)},K.prototype.precompute=function(){},K.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},K.fromJSON=function(A,D){return new K(A,D[0],D[1]||A.one)},K.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)+">"},K.prototype.isInfinity=function(){return this.z.cmpn(0)===0},K.prototype.dbl=function(){var A=this.x.redAdd(this.z),D=A.redSqr(),C=this.x.redSub(this.z),z=C.redSqr(),R=D.redSub(z),S=D.redMul(z),P=R.redMul(z.redAdd(this.curve.a24.redMul(R)));return this.curve.point(S,P)},K.prototype.add=function(){throw Error("Not supported on Montgomery curve")},K.prototype.diffAdd=function(A,D){var C=this.x.redAdd(this.z),z=this.x.redSub(this.z),R=A.x.redAdd(A.z),S=A.x.redSub(A.z),P=S.redMul(C),N=R.redMul(z),I=D.z.redMul(P.redAdd(N).redSqr()),B=D.x.redMul(P.redISub(N).redSqr());return this.curve.point(I,B)},K.prototype.mul=function(A){var D=A.clone(),C=this,z=this.curve.point(null,null),R=this;for(var S=[];D.cmpn(0)!==0;D.iushrn(1))S.push(D.andln(1));for(var P=S.length-1;P>=0;P--)if(S[P]===0)C=C.diffAdd(z,R),z=z.dbl();else z=C.diffAdd(z,R),C=C.dbl();return z},K.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},K.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},K.prototype.eq=function(A){return this.getX().cmp(A.getX())===0},K.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},K.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),aF=D0((X,Z)=>{var U=BZ(),Q=QQ(),G=LZ(),O=OJ(),Y=U.assert;function K(D){this.twisted=(D.a|0)!==1,this.mOneA=this.twisted&&(D.a|0)===-1,this.extended=this.mOneA,O.call(this,"edwards",D),this.a=new Q(D.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Q(D.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Q(D.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Y(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(D.c|0)===1}G(K,O),Z.exports=K,K.prototype._mulA=function(D){if(this.mOneA)return D.redNeg();else return this.a.redMul(D)},K.prototype._mulC=function(D){if(this.oneC)return D;else return this.c.redMul(D)},K.prototype.jpoint=function(D,C,z,R){return this.point(D,C,z,R)},K.prototype.pointFromX=function(D,C){if(D=new Q(D,16),!D.red)D=D.toRed(this.red);var z=D.redSqr(),R=this.c2.redSub(this.a.redMul(z)),S=this.one.redSub(this.c2.redMul(this.d).redMul(z)),P=R.redMul(S.redInvm()),N=P.redSqrt();if(N.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");var I=N.fromRed().isOdd();if(C&&!I||!C&&I)N=N.redNeg();return this.point(D,N)},K.prototype.pointFromY=function(D,C){if(D=new Q(D,16),!D.red)D=D.toRed(this.red);var z=D.redSqr(),R=z.redSub(this.c2),S=z.redMul(this.d).redMul(this.c2).redSub(this.a),P=R.redMul(S.redInvm());if(P.cmp(this.zero)===0)if(C)throw Error("invalid point");else return this.point(this.zero,D);var N=P.redSqrt();if(N.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");if(N.fromRed().isOdd()!==C)N=N.redNeg();return this.point(N,D)},K.prototype.validate=function(D){if(D.isInfinity())return!0;D.normalize();var C=D.x.redSqr(),z=D.y.redSqr(),R=C.redMul(this.a).redAdd(z),S=this.c2.redMul(this.one.redAdd(this.d.redMul(C).redMul(z)));return R.cmp(S)===0};function A(D,C,z,R,S){if(O.BasePoint.call(this,D,"projective"),C===null&&z===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 Q(C,16),this.y=new Q(z,16),this.z=R?new Q(R,16):this.curve.one,this.t=S&&new Q(S,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())}}}G(A,O.BasePoint),K.prototype.pointFromJSON=function(D){return A.fromJSON(this,D)},K.prototype.point=function(D,C,z,R){return new A(this,D,C,z,R)},A.fromJSON=function(D,C){return new A(D,C[0],C[1],C[2])},A.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)+">"},A.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},A.prototype._extDbl=function(){var D=this.x.redSqr(),C=this.y.redSqr(),z=this.z.redSqr();z=z.redIAdd(z);var R=this.curve._mulA(D),S=this.x.redAdd(this.y).redSqr().redISub(D).redISub(C),P=R.redAdd(C),N=P.redSub(z),I=R.redSub(C),B=S.redMul(N),k=P.redMul(I),w=S.redMul(I),v=N.redMul(P);return this.curve.point(B,k,v,w)},A.prototype._projDbl=function(){var D=this.x.redAdd(this.y).redSqr(),C=this.x.redSqr(),z=this.y.redSqr(),R,S,P,N,I,B;if(this.curve.twisted){N=this.curve._mulA(C);var k=N.redAdd(z);if(this.zOne)R=D.redSub(C).redSub(z).redMul(k.redSub(this.curve.two)),S=k.redMul(N.redSub(z)),P=k.redSqr().redSub(k).redSub(k);else I=this.z.redSqr(),B=k.redSub(I).redISub(I),R=D.redSub(C).redISub(z).redMul(B),S=k.redMul(N.redSub(z)),P=k.redMul(B)}else N=C.redAdd(z),I=this.curve._mulC(this.z).redSqr(),B=N.redSub(I).redSub(I),R=this.curve._mulC(D.redISub(N)).redMul(B),S=this.curve._mulC(N).redMul(C.redISub(z)),P=N.redMul(B);return this.curve.point(R,S,P)},A.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},A.prototype._extAdd=function(D){var C=this.y.redSub(this.x).redMul(D.y.redSub(D.x)),z=this.y.redAdd(this.x).redMul(D.y.redAdd(D.x)),R=this.t.redMul(this.curve.dd).redMul(D.t),S=this.z.redMul(D.z.redAdd(D.z)),P=z.redSub(C),N=S.redSub(R),I=S.redAdd(R),B=z.redAdd(C),k=P.redMul(N),w=I.redMul(B),v=P.redMul(B),_=N.redMul(I);return this.curve.point(k,w,_,v)},A.prototype._projAdd=function(D){var C=this.z.redMul(D.z),z=C.redSqr(),R=this.x.redMul(D.x),S=this.y.redMul(D.y),P=this.curve.d.redMul(R).redMul(S),N=z.redSub(P),I=z.redAdd(P),B=this.x.redAdd(this.y).redMul(D.x.redAdd(D.y)).redISub(R).redISub(S),k=C.redMul(N).redMul(B),w,v;if(this.curve.twisted)w=C.redMul(I).redMul(S.redSub(this.curve._mulA(R))),v=N.redMul(I);else w=C.redMul(I).redMul(S.redSub(R)),v=this.curve._mulC(N).redMul(I);return this.curve.point(k,w,v)},A.prototype.add=function(D){if(this.isInfinity())return D;if(D.isInfinity())return this;if(this.curve.extended)return this._extAdd(D);else return this._projAdd(D)},A.prototype.mul=function(D){if(this._hasDoubles(D))return this.curve._fixedNafMul(this,D);else return this.curve._wnafMul(this,D)},A.prototype.mulAdd=function(D,C,z){return this.curve._wnafMulAdd(1,[this,C],[D,z],2,!1)},A.prototype.jmulAdd=function(D,C,z){return this.curve._wnafMulAdd(1,[this,C],[D,z],2,!0)},A.prototype.normalize=function(){if(this.zOne)return this;var D=this.z.redInvm();if(this.x=this.x.redMul(D),this.y=this.y.redMul(D),this.t)this.t=this.t.redMul(D);return this.z=this.curve.one,this.zOne=!0,this},A.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},A.prototype.getX=function(){return this.normalize(),this.x.fromRed()},A.prototype.getY=function(){return this.normalize(),this.y.fromRed()},A.prototype.eq=function(D){return this===D||this.getX().cmp(D.getX())===0&&this.getY().cmp(D.getY())===0},A.prototype.eqXToP=function(D){var C=D.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(C)===0)return!0;var z=D.clone(),R=this.curve.redN.redMul(this.z);for(;;){if(z.iadd(this.curve.n),z.cmp(this.curve.p)>=0)return!1;if(C.redIAdd(R),this.x.cmp(C)===0)return!0}},A.prototype.toP=A.prototype.normalize,A.prototype.mixedAdd=A.prototype.add}),KV=D0((X)=>{var Z=X;Z.base=OJ(),Z.short=sF(),Z.mont=rF(),Z.edwards=aF()}),mZ=D0((X)=>{var Z=KQ(),U=LZ();X.inherits=U;function Q(W,F){if((W.charCodeAt(F)&64512)!==55296)return!1;if(F<0||F+1>=W.length)return!1;return(W.charCodeAt(F+1)&64512)===56320}function G(W,F){if(Array.isArray(W))return W.slice();if(!W)return[];var V=[];if(typeof W==="string"){if(!F){var H=0;for(var M=0;M<W.length;M++){var T=W.charCodeAt(M);if(T<128)V[H++]=T;else if(T<2048)V[H++]=T>>6|192,V[H++]=T&63|128;else if(Q(W,M))T=65536+((T&1023)<<10)+(W.charCodeAt(++M)&1023),V[H++]=T>>18|240,V[H++]=T>>12&63|128,V[H++]=T>>6&63|128,V[H++]=T&63|128;else V[H++]=T>>12|224,V[H++]=T>>6&63|128,V[H++]=T&63|128}}else if(F==="hex"){if(W=W.replace(/[^a-z0-9]+/ig,""),W.length%2!==0)W="0"+W;for(M=0;M<W.length;M+=2)V.push(parseInt(W[M]+W[M+1],16))}}else for(M=0;M<W.length;M++)V[M]=W[M]|0;return V}X.toArray=G;function O(W){var F="";for(var V=0;V<W.length;V++)F+=A(W[V].toString(16));return F}X.toHex=O;function Y(W){var F=W>>>24|W>>>8&65280|W<<8&16711680|(W&255)<<24;return F>>>0}X.htonl=Y;function K(W,F){var V="";for(var H=0;H<W.length;H++){var M=W[H];if(F==="little")M=Y(M);V+=D(M.toString(16))}return V}X.toHex32=K;function A(W){if(W.length===1)return"0"+W;else return W}X.zero2=A;function D(W){if(W.length===7)return"0"+W;else if(W.length===6)return"00"+W;else if(W.length===5)return"000"+W;else if(W.length===4)return"0000"+W;else if(W.length===3)return"00000"+W;else if(W.length===2)return"000000"+W;else if(W.length===1)return"0000000"+W;else return W}X.zero8=D;function C(W,F,V,H){var M=V-F;Z(M%4===0);var T=Array(M/4);for(var E=0,$=F;E<T.length;E++,$+=4){var q;if(H==="big")q=W[$]<<24|W[$+1]<<16|W[$+2]<<8|W[$+3];else q=W[$+3]<<24|W[$+2]<<16|W[$+1]<<8|W[$];T[E]=q>>>0}return T}X.join32=C;function z(W,F){var V=Array(W.length*4);for(var H=0,M=0;H<W.length;H++,M+=4){var T=W[H];if(F==="big")V[M]=T>>>24,V[M+1]=T>>>16&255,V[M+2]=T>>>8&255,V[M+3]=T&255;else V[M+3]=T>>>24,V[M+2]=T>>>16&255,V[M+1]=T>>>8&255,V[M]=T&255}return V}X.split32=z;function R(W,F){return W>>>F|W<<32-F}X.rotr32=R;function S(W,F){return W<<F|W>>>32-F}X.rotl32=S;function P(W,F){return W+F>>>0}X.sum32=P;function N(W,F,V){return W+F+V>>>0}X.sum32_3=N;function I(W,F,V,H){return W+F+V+H>>>0}X.sum32_4=I;function B(W,F,V,H,M){return W+F+V+H+M>>>0}X.sum32_5=B;function k(W,F,V,H){var M=W[F],T=W[F+1],E=H+T>>>0,$=(E<H?1:0)+V+M;W[F]=$>>>0,W[F+1]=E}X.sum64=k;function w(W,F,V,H){var M=F+H>>>0,T=(M<F?1:0)+W+V;return T>>>0}X.sum64_hi=w;function v(W,F,V,H){var M=F+H;return M>>>0}X.sum64_lo=v;function _(W,F,V,H,M,T,E,$){var q=0,j=F;j=j+H>>>0,q+=j<F?1:0,j=j+T>>>0,q+=j<T?1:0,j=j+$>>>0,q+=j<$?1:0;var L=W+V+M+E+q;return L>>>0}X.sum64_4_hi=_;function u(W,F,V,H,M,T,E,$){var q=F+H+T+$;return q>>>0}X.sum64_4_lo=u;function J0(W,F,V,H,M,T,E,$,q,j){var L=0,x=F;x=x+H>>>0,L+=x<F?1:0,x=x+T>>>0,L+=x<T?1:0,x=x+$>>>0,L+=x<$?1:0,x=x+j>>>0,L+=x<j?1:0;var f=W+V+M+E+q+L;return f>>>0}X.sum64_5_hi=J0;function H0(W,F,V,H,M,T,E,$,q,j){var L=F+H+T+$+j;return L>>>0}X.sum64_5_lo=H0;function V0(W,F,V){var H=F<<32-V|W>>>V;return H>>>0}X.rotr64_hi=V0;function l(W,F,V){var H=W<<32-V|F>>>V;return H>>>0}X.rotr64_lo=l;function U0(W,F,V){return W>>>V}X.shr64_hi=U0;function J(W,F,V){var H=W<<32-V|F>>>V;return H>>>0}X.shr64_lo=J}),SU=D0((X)=>{var Z=mZ(),U=KQ();function Q(){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}X.BlockHash=Q,Q.prototype.update=function(G,O){if(G=Z.toArray(G,O),!this.pending)this.pending=G;else this.pending=this.pending.concat(G);if(this.pendingTotal+=G.length,this.pending.length>=this._delta8){G=this.pending;var Y=G.length%this._delta8;if(this.pending=G.slice(G.length-Y,G.length),this.pending.length===0)this.pending=null;G=Z.join32(G,0,G.length-Y,this.endian);for(var K=0;K<G.length;K+=this._delta32)this._update(G,K,K+this._delta32)}return this},Q.prototype.digest=function(G){return this.update(this._pad()),U(this.pending===null),this._digest(G)},Q.prototype._pad=function(){var G=this.pendingTotal,O=this._delta8,Y=O-(G+this.padLength)%O,K=Array(Y+this.padLength);K[0]=128;for(var A=1;A<Y;A++)K[A]=0;if(G<<=3,this.endian==="big"){for(var D=8;D<this.padLength;D++)K[A++]=0;K[A++]=0,K[A++]=0,K[A++]=0,K[A++]=0,K[A++]=G>>>24&255,K[A++]=G>>>16&255,K[A++]=G>>>8&255,K[A++]=G&255}else{K[A++]=G&255,K[A++]=G>>>8&255,K[A++]=G>>>16&255,K[A++]=G>>>24&255,K[A++]=0,K[A++]=0,K[A++]=0,K[A++]=0;for(D=8;D<this.padLength;D++)K[A++]=0}return K}}),EV=D0((X)=>{var Z=mZ(),U=Z.rotr32;function Q(z,R,S,P){if(z===0)return G(R,S,P);if(z===1||z===3)return Y(R,S,P);if(z===2)return O(R,S,P)}X.ft_1=Q;function G(z,R,S){return z&R^~z&S}X.ch32=G;function O(z,R,S){return z&R^z&S^R&S}X.maj32=O;function Y(z,R,S){return z^R^S}X.p32=Y;function K(z){return U(z,2)^U(z,13)^U(z,22)}X.s0_256=K;function A(z){return U(z,6)^U(z,11)^U(z,25)}X.s1_256=A;function D(z){return U(z,7)^U(z,18)^z>>>3}X.g0_256=D;function C(z){return U(z,17)^U(z,19)^z>>>10}X.g1_256=C}),tF=D0((X,Z)=>{var U=mZ(),Q=SU(),G=EV(),O=U.rotl32,Y=U.sum32,K=U.sum32_5,A=G.ft_1,D=Q.BlockHash,C=[1518500249,1859775393,2400959708,3395469782];function z(){if(!(this instanceof z))return new z;D.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}U.inherits(z,D),Z.exports=z,z.blockSize=512,z.outSize=160,z.hmacStrength=80,z.padLength=64,z.prototype._update=function(R,S){var P=this.W;for(var N=0;N<16;N++)P[N]=R[S+N];for(;N<P.length;N++)P[N]=O(P[N-3]^P[N-8]^P[N-14]^P[N-16],1);var I=this.h[0],B=this.h[1],k=this.h[2],w=this.h[3],v=this.h[4];for(N=0;N<P.length;N++){var _=~~(N/20),u=K(O(I,5),A(_,B,k,w),v,P[N],C[_]);v=w,w=k,k=O(B,30),B=I,I=u}this.h[0]=Y(this.h[0],I),this.h[1]=Y(this.h[1],B),this.h[2]=Y(this.h[2],k),this.h[3]=Y(this.h[3],w),this.h[4]=Y(this.h[4],v)},z.prototype._digest=function(R){if(R==="hex")return U.toHex32(this.h,"big");else return U.split32(this.h,"big")}}),zV=D0((X,Z)=>{var U=mZ(),Q=SU(),G=EV(),O=KQ(),Y=U.sum32,K=U.sum32_4,A=U.sum32_5,D=G.ch32,C=G.maj32,z=G.s0_256,R=G.s1_256,S=G.g0_256,P=G.g1_256,N=Q.BlockHash,I=[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;N.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=I,this.W=Array(64)}U.inherits(B,N),Z.exports=B,B.blockSize=512,B.outSize=256,B.hmacStrength=192,B.padLength=64,B.prototype._update=function(k,w){var v=this.W;for(var _=0;_<16;_++)v[_]=k[w+_];for(;_<v.length;_++)v[_]=K(P(v[_-2]),v[_-7],S(v[_-15]),v[_-16]);var u=this.h[0],J0=this.h[1],H0=this.h[2],V0=this.h[3],l=this.h[4],U0=this.h[5],J=this.h[6],W=this.h[7];O(this.k.length===v.length);for(_=0;_<v.length;_++){var F=A(W,R(l),D(l,U0,J),this.k[_],v[_]),V=Y(z(u),C(u,J0,H0));W=J,J=U0,U0=l,l=Y(V0,F),V0=H0,H0=J0,J0=u,u=Y(F,V)}this.h[0]=Y(this.h[0],u),this.h[1]=Y(this.h[1],J0),this.h[2]=Y(this.h[2],H0),this.h[3]=Y(this.h[3],V0),this.h[4]=Y(this.h[4],l),this.h[5]=Y(this.h[5],U0),this.h[6]=Y(this.h[6],J),this.h[7]=Y(this.h[7],W)},B.prototype._digest=function(k){if(k==="hex")return U.toHex32(this.h,"big");else return U.split32(this.h,"big")}}),iF=D0((X,Z)=>{var U=mZ(),Q=zV();function G(){if(!(this instanceof G))return new G;Q.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}U.inherits(G,Q),Z.exports=G,G.blockSize=512,G.outSize=224,G.hmacStrength=192,G.padLength=64,G.prototype._digest=function(O){if(O==="hex")return U.toHex32(this.h.slice(0,7),"big");else return U.split32(this.h.slice(0,7),"big")}}),DV=D0((X,Z)=>{var U=mZ(),Q=SU(),G=KQ(),O=U.rotr64_hi,Y=U.rotr64_lo,K=U.shr64_hi,A=U.shr64_lo,D=U.sum64,C=U.sum64_hi,z=U.sum64_lo,R=U.sum64_4_hi,S=U.sum64_4_lo,P=U.sum64_5_hi,N=U.sum64_5_lo,I=Q.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 k(){if(!(this instanceof k))return new k;I.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)}U.inherits(k,I),Z.exports=k,k.blockSize=1024,k.outSize=512,k.hmacStrength=192,k.padLength=128,k.prototype._prepareBlock=function(V,H){var M=this.W;for(var T=0;T<32;T++)M[T]=V[H+T];for(;T<M.length;T+=2){var E=W(M[T-4],M[T-3]),$=F(M[T-4],M[T-3]),q=M[T-14],j=M[T-13],L=U0(M[T-30],M[T-29]),x=J(M[T-30],M[T-29]),f=M[T-32],b=M[T-31];M[T]=R(E,$,q,j,L,x,f,b),M[T+1]=S(E,$,q,j,L,x,f,b)}},k.prototype._update=function(V,H){this._prepareBlock(V,H);var M=this.W,T=this.h[0],E=this.h[1],$=this.h[2],q=this.h[3],j=this.h[4],L=this.h[5],x=this.h[6],f=this.h[7],b=this.h[8],s=this.h[9],z0=this.h[10],i=this.h[11],o=this.h[12],W0=this.h[13],r=this.h[14],X0=this.h[15];G(this.k.length===M.length);for(var d0=0;d0<M.length;d0+=2){var c=r,m=X0,E0=V0(b,s),Z0=l(b,s),$0=w(b,s,z0,i,o,W0),N0=v(b,s,z0,i,o,W0),d=this.k[d0],t=this.k[d0+1],l0=M[d0],e=M[d0+1],F0=P(c,m,E0,Z0,$0,N0,d,t,l0,e),ZX=N(c,m,E0,Z0,$0,N0,d,t,l0,e);c=J0(T,E),m=H0(T,E),E0=_(T,E,$,q,j,L),Z0=u(T,E,$,q,j,L);var T0=C(c,m,E0,Z0),R0=z(c,m,E0,Z0);r=o,X0=W0,o=z0,W0=i,z0=b,i=s,b=C(x,f,F0,ZX),s=z(f,f,F0,ZX),x=j,f=L,j=$,L=q,$=T,q=E,T=C(F0,ZX,T0,R0),E=z(F0,ZX,T0,R0)}D(this.h,0,T,E),D(this.h,2,$,q),D(this.h,4,j,L),D(this.h,6,x,f),D(this.h,8,b,s),D(this.h,10,z0,i),D(this.h,12,o,W0),D(this.h,14,r,X0)},k.prototype._digest=function(V){if(V==="hex")return U.toHex32(this.h,"big");else return U.split32(this.h,"big")};function w(V,H,M,T,E){var $=V&M^~V&E;if($<0)$+=4294967296;return $}function v(V,H,M,T,E,$){var q=H&T^~H&$;if(q<0)q+=4294967296;return q}function _(V,H,M,T,E){var $=V&M^V&E^M&E;if($<0)$+=4294967296;return $}function u(V,H,M,T,E,$){var q=H&T^H&$^T&$;if(q<0)q+=4294967296;return q}function J0(V,H){var M=O(V,H,28),T=O(H,V,2),E=O(H,V,7),$=M^T^E;if($<0)$+=4294967296;return $}function H0(V,H){var M=Y(V,H,28),T=Y(H,V,2),E=Y(H,V,7),$=M^T^E;if($<0)$+=4294967296;return $}function V0(V,H){var M=O(V,H,14),T=O(V,H,18),E=O(H,V,9),$=M^T^E;if($<0)$+=4294967296;return $}function l(V,H){var M=Y(V,H,14),T=Y(V,H,18),E=Y(H,V,9),$=M^T^E;if($<0)$+=4294967296;return $}function U0(V,H){var M=O(V,H,1),T=O(V,H,8),E=K(V,H,7),$=M^T^E;if($<0)$+=4294967296;return $}function J(V,H){var M=Y(V,H,1),T=Y(V,H,8),E=A(V,H,7),$=M^T^E;if($<0)$+=4294967296;return $}function W(V,H){var M=O(V,H,19),T=O(H,V,29),E=K(V,H,6),$=M^T^E;if($<0)$+=4294967296;return $}function F(V,H){var M=Y(V,H,19),T=Y(H,V,29),E=A(V,H,6),$=M^T^E;if($<0)$+=4294967296;return $}}),eF=D0((X,Z)=>{var U=mZ(),Q=DV();function G(){if(!(this instanceof G))return new G;Q.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}U.inherits(G,Q),Z.exports=G,G.blockSize=1024,G.outSize=384,G.hmacStrength=192,G.padLength=128,G.prototype._digest=function(O){if(O==="hex")return U.toHex32(this.h.slice(0,12),"big");else return U.split32(this.h.slice(0,12),"big")}}),XK=D0((X)=>{X.sha1=tF(),X.sha224=iF(),X.sha256=zV(),X.sha384=eF(),X.sha512=DV()}),ZK=D0((X)=>{var Z=mZ(),U=SU(),Q=Z.rotl32,G=Z.sum32,O=Z.sum32_3,Y=Z.sum32_4,K=U.BlockHash;function A(){if(!(this instanceof A))return new A;K.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Z.inherits(A,K),X.ripemd160=A,A.blockSize=512,A.outSize=160,A.hmacStrength=192,A.padLength=64,A.prototype._update=function(I,B){var k=this.h[0],w=this.h[1],v=this.h[2],_=this.h[3],u=this.h[4],J0=k,H0=w,V0=v,l=_,U0=u;for(var J=0;J<80;J++){var W=G(Q(Y(k,D(J,w,v,_),I[R[J]+B],C(J)),P[J]),u);k=u,u=_,_=Q(v,10),v=w,w=W,W=G(Q(Y(J0,D(79-J,H0,V0,l),I[S[J]+B],z(J)),N[J]),U0),J0=U0,U0=l,l=Q(V0,10),V0=H0,H0=W}W=O(this.h[1],v,l),this.h[1]=O(this.h[2],_,U0),this.h[2]=O(this.h[3],u,J0),this.h[3]=O(this.h[4],k,H0),this.h[4]=O(this.h[0],w,V0),this.h[0]=W},A.prototype._digest=function(I){if(I==="hex")return Z.toHex32(this.h,"little");else return Z.split32(this.h,"little")};function D(I,B,k,w){if(I<=15)return B^k^w;else if(I<=31)return B&k|~B&w;else if(I<=47)return(B|~k)^w;else if(I<=63)return B&w|k&~w;else return B^(k|~w)}function C(I){if(I<=15)return 0;else if(I<=31)return 1518500249;else if(I<=47)return 1859775393;else if(I<=63)return 2400959708;else return 2840853838}function z(I){if(I<=15)return 1352829926;else if(I<=31)return 1548603684;else if(I<=47)return 1836072691;else if(I<=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],S=[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],N=[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]}),QK=D0((X,Z)=>{var U=mZ(),Q=KQ();function G(O,Y,K){if(!(this instanceof G))return new G(O,Y,K);this.Hash=O,this.blockSize=O.blockSize/8,this.outSize=O.outSize/8,this.inner=null,this.outer=null,this._init(U.toArray(Y,K))}Z.exports=G,G.prototype._init=function(O){if(O.length>this.blockSize)O=new this.Hash().update(O).digest();Q(O.length<=this.blockSize);for(var Y=O.length;Y<this.blockSize;Y++)O.push(0);for(Y=0;Y<O.length;Y++)O[Y]^=54;this.inner=new this.Hash().update(O);for(Y=0;Y<O.length;Y++)O[Y]^=106;this.outer=new this.Hash().update(O)},G.prototype.update=function(O,Y){return this.inner.update(O,Y),this},G.prototype.digest=function(O){return this.outer.update(this.inner.digest()),this.outer.digest(O)}}),LY=D0((X)=>{var Z=X;Z.utils=mZ(),Z.common=SU(),Z.sha=XK(),Z.ripemd=ZK(),Z.hmac=QK(),Z.sha1=Z.sha.sha1,Z.sha256=Z.sha.sha256,Z.sha224=Z.sha.sha224,Z.sha384=Z.sha.sha384,Z.sha512=Z.sha.sha512,Z.ripemd160=Z.ripemd.ripemd160}),UK=D0((X,Z)=>{Z.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"]]}}}),IY=D0((X)=>{var Z=X,U=LY(),Q=KV(),G=BZ(),O=G.assert;function Y(D){if(D.type==="short")this.curve=new Q.short(D);else if(D.type==="edwards")this.curve=new Q.edwards(D);else this.curve=new Q.mont(D);this.g=this.curve.g,this.n=this.curve.n,this.hash=D.hash,O(this.g.validate(),"Invalid curve"),O(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}Z.PresetCurve=Y;function K(D,C){Object.defineProperty(Z,D,{configurable:!0,enumerable:!0,get:function(){var z=new Y(C);return Object.defineProperty(Z,D,{configurable:!0,enumerable:!0,value:z}),z}})}K("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:U.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),K("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:U.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),K("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:U.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),K("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:U.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"]}),K("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:U.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"]}),K("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:U.sha256,gRed:!1,g:["9"]}),K("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:U.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var A;try{A=UK()}catch(D){A=void 0}K("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:U.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",A]})}),JK=D0((X,Z)=>{var U=LY(),Q=HV(),G=KQ();function O(Y){if(!(this instanceof O))return new O(Y);this.hash=Y.hash,this.predResist=!!Y.predResist,this.outLen=this.hash.outSize,this.minEntropy=Y.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var K=Q.toArray(Y.entropy,Y.entropyEnc||"hex"),A=Q.toArray(Y.nonce,Y.nonceEnc||"hex"),D=Q.toArray(Y.pers,Y.persEnc||"hex");G(K.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(K,A,D)}Z.exports=O,O.prototype._init=function(Y,K,A){var D=Y.concat(K).concat(A);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var C=0;C<this.V.length;C++)this.K[C]=0,this.V[C]=1;this._update(D),this._reseed=1,this.reseedInterval=281474976710656},O.prototype._hmac=function(){return new U.hmac(this.hash,this.K)},O.prototype._update=function(Y){var K=this._hmac().update(this.V).update([0]);if(Y)K=K.update(Y);if(this.K=K.digest(),this.V=this._hmac().update(this.V).digest(),!Y)return;this.K=this._hmac().update(this.V).update([1]).update(Y).digest(),this.V=this._hmac().update(this.V).digest()},O.prototype.reseed=function(Y,K,A,D){if(typeof K!=="string")D=A,A=K,K=null;Y=Q.toArray(Y,K),A=Q.toArray(A,D),G(Y.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(Y.concat(A||[])),this._reseed=1},O.prototype.generate=function(Y,K,A,D){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof K!=="string")D=A,A=K,K=null;if(A)A=Q.toArray(A,D||"hex"),this._update(A);var C=[];while(C.length<Y)this.V=this._hmac().update(this.V).digest(),C=C.concat(this.V);var z=C.slice(0,Y);return this._update(A),this._reseed++,Q.encode(z,K)}}),YK=D0((X,Z)=>{var U=QQ(),Q=BZ(),G=Q.assert;function O(Y,K){if(this.ec=Y,this.priv=null,this.pub=null,K.priv)this._importPrivate(K.priv,K.privEnc);if(K.pub)this._importPublic(K.pub,K.pubEnc)}Z.exports=O,O.fromPublic=function(Y,K,A){if(K instanceof O)return K;return new O(Y,{pub:K,pubEnc:A})},O.fromPrivate=function(Y,K,A){if(K instanceof O)return K;return new O(Y,{priv:K,privEnc:A})},O.prototype.validate=function(){var Y=this.getPublic();if(Y.isInfinity())return{result:!1,reason:"Invalid public key"};if(!Y.validate())return{result:!1,reason:"Public key is not a point"};if(!Y.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},O.prototype.getPublic=function(Y,K){if(typeof Y==="string")K=Y,Y=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!K)return this.pub;return this.pub.encode(K,Y)},O.prototype.getPrivate=function(Y){if(Y==="hex")return this.priv.toString(16,2);else return this.priv},O.prototype._importPrivate=function(Y,K){this.priv=new U(Y,K||16),this.priv=this.priv.umod(this.ec.curve.n)},O.prototype._importPublic=function(Y,K){if(Y.x||Y.y){if(this.ec.curve.type==="mont")G(Y.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")G(Y.x&&Y.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(Y.x,Y.y);return}this.pub=this.ec.curve.decodePoint(Y,K)},O.prototype.derive=function(Y){if(!Y.validate())G(Y.validate(),"public point not validated");return Y.mul(this.priv).getX()},O.prototype.sign=function(Y,K,A){return this.ec.sign(Y,this,K,A)},O.prototype.verify=function(Y,K,A){return this.ec.verify(Y,K,this,void 0,A)},O.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),$K=D0((X,Z)=>{var U=QQ(),Q=BZ(),G=Q.assert;function O(C,z){if(C instanceof O)return C;if(this._importDER(C,z))return;if(G(C.r&&C.s,"Signature without r or s"),this.r=new U(C.r,16),this.s=new U(C.s,16),C.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=C.recoveryParam}Z.exports=O;function Y(){this.place=0}function K(C,z){var R=C[z.place++];if(!(R&128))return R;var S=R&15;if(S===0||S>4)return!1;if(C[z.place]===0)return!1;var P=0;for(var N=0,I=z.place;N<S;N++,I++)P<<=8,P|=C[I],P>>>=0;if(P<=127)return!1;return z.place=I,P}function A(C){var z=0,R=C.length-1;while(!C[z]&&!(C[z+1]&128)&&z<R)z++;if(z===0)return C;return C.slice(z)}O.prototype._importDER=function(C,z){C=Q.toArray(C,z);var R=new Y;if(C[R.place++]!==48)return!1;var S=K(C,R);if(S===!1)return!1;if(S+R.place!==C.length)return!1;if(C[R.place++]!==2)return!1;var P=K(C,R);if(P===!1)return!1;if((C[R.place]&128)!==0)return!1;var N=C.slice(R.place,P+R.place);if(R.place+=P,C[R.place++]!==2)return!1;var I=K(C,R);if(I===!1)return!1;if(C.length!==I+R.place)return!1;if((C[R.place]&128)!==0)return!1;var B=C.slice(R.place,I+R.place);if(N[0]===0)if(N[1]&128)N=N.slice(1);else return!1;if(B[0]===0)if(B[1]&128)B=B.slice(1);else return!1;return this.r=new U(N),this.s=new U(B),this.recoveryParam=null,!0};function D(C,z){if(z<128){C.push(z);return}var R=1+(Math.log(z)/Math.LN2>>>3);C.push(R|128);while(--R)C.push(z>>>(R<<3)&255);C.push(z)}O.prototype.toDER=function(C){var z=this.r.toArray(),R=this.s.toArray();if(z[0]&128)z=[0].concat(z);if(R[0]&128)R=[0].concat(R);z=A(z),R=A(R);while(!R[0]&&!(R[1]&128))R=R.slice(1);var S=[2];D(S,z.length),S=S.concat(z),S.push(2),D(S,R.length);var P=S.concat(R),N=[48];return D(N,P.length),N=N.concat(P),Q.encode(N,C)}}),GK=D0((X,Z)=>{var U=QQ(),Q=JK(),G=BZ(),O=IY(),Y=FV(),K=G.assert,A=YK(),D=$K();function C(z){if(!(this instanceof C))return new C(z);if(typeof z==="string")K(Object.prototype.hasOwnProperty.call(O,z),"Unknown curve "+z),z=O[z];if(z instanceof O.PresetCurve)z={curve:z};this.curve=z.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=z.curve.g,this.g.precompute(z.curve.n.bitLength()+1),this.hash=z.hash||z.curve.hash}Z.exports=C,C.prototype.keyPair=function(z){return new A(this,z)},C.prototype.keyFromPrivate=function(z,R){return A.fromPrivate(this,z,R)},C.prototype.keyFromPublic=function(z,R){return A.fromPublic(this,z,R)},C.prototype.genKeyPair=function(z){if(!z)z={};var R=new Q({hash:this.hash,pers:z.pers,persEnc:z.persEnc||"utf8",entropy:z.entropy||Y(this.hash.hmacStrength),entropyEnc:z.entropy&&z.entropyEnc||"utf8",nonce:this.n.toArray()}),S=this.n.byteLength(),P=this.n.sub(new U(2));for(;;){var N=new U(R.generate(S));if(N.cmp(P)>0)continue;return N.iaddn(1),this.keyFromPrivate(N)}},C.prototype._truncateToN=function(z,R,S){var P;if(U.isBN(z)||typeof z==="number")z=new U(z,16),P=z.byteLength();else if(typeof z==="object")P=z.length,z=new U(z,16);else{var N=z.toString();P=N.length+1>>>1,z=new U(N,16)}if(typeof S!=="number")S=P*8;var I=S-this.n.bitLength();if(I>0)z=z.ushrn(I);if(!R&&z.cmp(this.n)>=0)return z.sub(this.n);else return z},C.prototype.sign=function(z,R,S,P){if(typeof S==="object")P=S,S=null;if(!P)P={};if(typeof z!=="string"&&typeof z!=="number"&&!U.isBN(z)){K(typeof z==="object"&&z&&typeof z.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),K(z.length>>>0===z.length);for(var N=0;N<z.length;N++)K((z[N]&255)===z[N])}R=this.keyFromPrivate(R,S),z=this._truncateToN(z,!1,P.msgBitLength),K(!z.isNeg(),"Can not sign a negative message");var I=this.n.byteLength(),B=R.getPrivate().toArray("be",I),k=z.toArray("be",I);K(new U(k).eq(z),"Can not sign message");var w=new Q({hash:this.hash,entropy:B,nonce:k,pers:P.pers,persEnc:P.persEnc||"utf8"}),v=this.n.sub(new U(1));for(var _=0;;_++){var u=P.k?P.k(_):new U(w.generate(this.n.byteLength()));if(u=this._truncateToN(u,!0),u.cmpn(1)<=0||u.cmp(v)>=0)continue;var J0=this.g.mul(u);if(J0.isInfinity())continue;var H0=J0.getX(),V0=H0.umod(this.n);if(V0.cmpn(0)===0)continue;var l=u.invm(this.n).mul(V0.mul(R.getPrivate()).iadd(z));if(l=l.umod(this.n),l.cmpn(0)===0)continue;var U0=(J0.getY().isOdd()?1:0)|(H0.cmp(V0)!==0?2:0);if(P.canonical&&l.cmp(this.nh)>0)l=this.n.sub(l),U0^=1;return new D({r:V0,s:l,recoveryParam:U0})}},C.prototype.verify=function(z,R,S,P,N){if(!N)N={};z=this._truncateToN(z,!1,N.msgBitLength),S=this.keyFromPublic(S,P),R=new D(R,"hex");var{r:I,s:B}=R;if(I.cmpn(1)<0||I.cmp(this.n)>=0)return!1;if(B.cmpn(1)<0||B.cmp(this.n)>=0)return!1;var k=B.invm(this.n),w=k.mul(z).umod(this.n),v=k.mul(I).umod(this.n),_;if(!this.curve._maxwellTrick){if(_=this.g.mulAdd(w,S.getPublic(),v),_.isInfinity())return!1;return _.getX().umod(this.n).cmp(I)===0}if(_=this.g.jmulAdd(w,S.getPublic(),v),_.isInfinity())return!1;return _.eqXToP(I)},C.prototype.recoverPubKey=function(z,R,S,P){K((3&S)===S,"The recovery param is more than two bits"),R=new D(R,P);var N=this.n,I=new U(z),B=R.r,k=R.s,w=S&1,v=S>>1;if(B.cmp(this.curve.p.umod(this.curve.n))>=0&&v)throw Error("Unable to find sencond key candinate");if(v)B=this.curve.pointFromX(B.add(this.curve.n),w);else B=this.curve.pointFromX(B,w);var _=R.r.invm(N),u=N.sub(I).mul(_).umod(N),J0=k.mul(_).umod(N);return this.g.mulAdd(u,B,J0)},C.prototype.getKeyRecoveryParam=function(z,R,S,P){if(R=new D(R,P),R.recoveryParam!==null)return R.recoveryParam;for(var N=0;N<4;N++){var I;try{I=this.recoverPubKey(z,R,N)}catch(B){continue}if(I.eq(S))return N}throw Error("Unable to find valid recovery factor")}}),VK=D0((X,Z)=>{var U=BZ(),Q=U.assert,G=U.parseBytes,O=U.cachedProperty;function Y(K,A){if(this.eddsa=K,this._secret=G(A.secret),K.isPoint(A.pub))this._pub=A.pub;else this._pubBytes=G(A.pub)}Y.fromPublic=function(K,A){if(A instanceof Y)return A;return new Y(K,{pub:A})},Y.fromSecret=function(K,A){if(A instanceof Y)return A;return new Y(K,{secret:A})},Y.prototype.secret=function(){return this._secret},O(Y,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),O(Y,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),O(Y,"privBytes",function(){var K=this.eddsa,A=this.hash(),D=K.encodingLength-1,C=A.slice(0,K.encodingLength);return C[0]&=248,C[D]&=127,C[D]|=64,C}),O(Y,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),O(Y,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),O(Y,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),Y.prototype.sign=function(K){return Q(this._secret,"KeyPair can only verify"),this.eddsa.sign(K,this)},Y.prototype.verify=function(K,A){return this.eddsa.verify(K,A,this)},Y.prototype.getSecret=function(K){return Q(this._secret,"KeyPair is public only"),U.encode(this.secret(),K)},Y.prototype.getPublic=function(K){return U.encode(this.pubBytes(),K)},Z.exports=Y}),WK=D0((X,Z)=>{var U=QQ(),Q=BZ(),G=Q.assert,O=Q.cachedProperty,Y=Q.parseBytes;function K(A,D){if(this.eddsa=A,typeof D!=="object")D=Y(D);if(Array.isArray(D))G(D.length===A.encodingLength*2,"Signature has invalid size"),D={R:D.slice(0,A.encodingLength),S:D.slice(A.encodingLength)};if(G(D.R&&D.S,"Signature without R or S"),A.isPoint(D.R))this._R=D.R;if(D.S instanceof U)this._S=D.S;this._Rencoded=Array.isArray(D.R)?D.R:D.Rencoded,this._Sencoded=Array.isArray(D.S)?D.S:D.Sencoded}O(K,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),O(K,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),O(K,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),O(K,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),K.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},K.prototype.toHex=function(){return Q.encode(this.toBytes(),"hex").toUpperCase()},Z.exports=K}),OK=D0((X,Z)=>{var U=LY(),Q=IY(),G=BZ(),O=G.assert,Y=G.parseBytes,K=VK(),A=WK();function D(C){if(O(C==="ed25519","only tested with ed25519 so far"),!(this instanceof D))return new D(C);C=Q[C].curve,this.curve=C,this.g=C.g,this.g.precompute(C.n.bitLength()+1),this.pointClass=C.point().constructor,this.encodingLength=Math.ceil(C.n.bitLength()/8),this.hash=U.sha512}Z.exports=D,D.prototype.sign=function(C,z){C=Y(C);var R=this.keyFromSecret(z),S=this.hashInt(R.messagePrefix(),C),P=this.g.mul(S),N=this.encodePoint(P),I=this.hashInt(N,R.pubBytes(),C).mul(R.priv()),B=S.add(I).umod(this.curve.n);return this.makeSignature({R:P,S:B,Rencoded:N})},D.prototype.verify=function(C,z,R){if(C=Y(C),z=this.makeSignature(z),z.S().gte(z.eddsa.curve.n)||z.S().isNeg())return!1;var S=this.keyFromPublic(R),P=this.hashInt(z.Rencoded(),S.pubBytes(),C),N=this.g.mul(z.S()),I=z.R().add(S.pub().mul(P));return I.eq(N)},D.prototype.hashInt=function(){var C=this.hash();for(var z=0;z<arguments.length;z++)C.update(arguments[z]);return G.intFromLE(C.digest()).umod(this.curve.n)},D.prototype.keyFromPublic=function(C){return K.fromPublic(this,C)},D.prototype.keyFromSecret=function(C){return K.fromSecret(this,C)},D.prototype.makeSignature=function(C){if(C instanceof A)return C;return new A(this,C)},D.prototype.encodePoint=function(C){var z=C.getY().toArray("le",this.encodingLength);return z[this.encodingLength-1]|=C.getX().isOdd()?128:0,z},D.prototype.decodePoint=function(C){C=G.parseBytes(C);var z=C.length-1,R=C.slice(0,z).concat(C[z]&-129),S=(C[z]&128)!==0,P=G.intFromLE(R);return this.curve.pointFromY(P,S)},D.prototype.encodeInt=function(C){return C.toArray("le",this.encodingLength)},D.prototype.decodeInt=function(C){return G.intFromLE(C)},D.prototype.isPoint=function(C){return C instanceof this.pointClass}}),HK=D0((X)=>{var Z=X;Z.version=oF().version,Z.utils=BZ(),Z.rand=FV(),Z.curve=KV(),Z.curves=IY(),Z.ec=GK(),Z.eddsa=OK()}),FK=D0((X,Z)=>{(function(U,Q){function G(J,W){if(!J)throw Error(W||"Assertion failed")}function O(J,W){J.super_=W;var F=function(){};F.prototype=W.prototype,J.prototype=new F,J.prototype.constructor=J}function Y(J,W,F){if(Y.isBN(J))return J;if(this.negative=0,this.words=null,this.length=0,this.red=null,J!==null){if(W==="le"||W==="be")F=W,W=10;this._init(J||0,W||10,F||"be")}}if(typeof U==="object")U.exports=Y;else Q.BN=Y;Y.BN=Y,Y.wordSize=26;var K;try{if(typeof window<"u"&&typeof window.Buffer<"u")K=window.Buffer;else K=(UZ(),WX(QZ)).Buffer}catch(J){}Y.isBN=function(J){if(J instanceof Y)return!0;return J!==null&&typeof J==="object"&&J.constructor.wordSize===Y.wordSize&&Array.isArray(J.words)},Y.max=function(J,W){if(J.cmp(W)>0)return J;return W},Y.min=function(J,W){if(J.cmp(W)<0)return J;return W},Y.prototype._init=function(J,W,F){if(typeof J==="number")return this._initNumber(J,W,F);if(typeof J==="object")return this._initArray(J,W,F);if(W==="hex")W=16;G(W===(W|0)&&W>=2&&W<=36),J=J.toString().replace(/\s+/g,"");var V=0;if(J[0]==="-")V++,this.negative=1;if(V<J.length){if(W===16)this._parseHex(J,V,F);else if(this._parseBase(J,W,V),F==="le")this._initArray(this.toArray(),W,F)}},Y.prototype._initNumber=function(J,W,F){if(J<0)this.negative=1,J=-J;if(J<67108864)this.words=[J&67108863],this.length=1;else if(J<4503599627370496)this.words=[J&67108863,J/67108864&67108863],this.length=2;else G(J<9007199254740992),this.words=[J&67108863,J/67108864&67108863,1],this.length=3;if(F!=="le")return;this._initArray(this.toArray(),W,F)},Y.prototype._initArray=function(J,W,F){if(G(typeof J.length==="number"),J.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(J.length/3),this.words=Array(this.length);for(var V=0;V<this.length;V++)this.words[V]=0;var H,M,T=0;if(F==="be"){for(V=J.length-1,H=0;V>=0;V-=3)if(M=J[V]|J[V-1]<<8|J[V-2]<<16,this.words[H]|=M<<T&67108863,this.words[H+1]=M>>>26-T&67108863,T+=24,T>=26)T-=26,H++}else if(F==="le"){for(V=0,H=0;V<J.length;V+=3)if(M=J[V]|J[V+1]<<8|J[V+2]<<16,this.words[H]|=M<<T&67108863,this.words[H+1]=M>>>26-T&67108863,T+=24,T>=26)T-=26,H++}return this.strip()};function A(J,W){var F=J.charCodeAt(W);if(F>=65&&F<=70)return F-55;else if(F>=97&&F<=102)return F-87;else return F-48&15}function D(J,W,F){var V=A(J,F);if(F-1>=W)V|=A(J,F-1)<<4;return V}Y.prototype._parseHex=function(J,W,F){this.length=Math.ceil((J.length-W)/6),this.words=Array(this.length);for(var V=0;V<this.length;V++)this.words[V]=0;var H=0,M=0,T;if(F==="be")for(V=J.length-1;V>=W;V-=2)if(T=D(J,W,V)<<H,this.words[M]|=T&67108863,H>=18)H-=18,M+=1,this.words[M]|=T>>>26;else H+=8;else{var E=J.length-W;for(V=E%2===0?W+1:W;V<J.length;V+=2)if(T=D(J,W,V)<<H,this.words[M]|=T&67108863,H>=18)H-=18,M+=1,this.words[M]|=T>>>26;else H+=8}this.strip()};function C(J,W,F,V){var H=0,M=Math.min(J.length,F);for(var T=W;T<M;T++){var E=J.charCodeAt(T)-48;if(H*=V,E>=49)H+=E-49+10;else if(E>=17)H+=E-17+10;else H+=E}return H}Y.prototype._parseBase=function(J,W,F){this.words=[0],this.length=1;for(var V=0,H=1;H<=67108863;H*=W)V++;V--,H=H/W|0;var M=J.length-F,T=M%V,E=Math.min(M,M-T)+F,$=0;for(var q=F;q<E;q+=V)if($=C(J,q,q+V,W),this.imuln(H),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($);if(T!==0){var j=1;$=C(J,q,J.length,W);for(q=0;q<T;q++)j*=W;if(this.imuln(j),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($)}this.strip()},Y.prototype.copy=function(J){J.words=Array(this.length);for(var W=0;W<this.length;W++)J.words[W]=this.words[W];J.length=this.length,J.negative=this.negative,J.red=this.red},Y.prototype.clone=function(){var J=new Y(null);return this.copy(J),J},Y.prototype._expand=function(J){while(this.length<J)this.words[this.length++]=0;return this},Y.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Y.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Y.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var z=["","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],S=[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(Y.prototype.toString=function(J,W){J=J||10,W=W|0||1;var F;if(J===16||J==="hex"){F="";var V=0,H=0;for(var M=0;M<this.length;M++){var T=this.words[M],E=((T<<V|H)&16777215).toString(16);if(H=T>>>24-V&16777215,V+=2,V>=26)V-=26,M--;if(H!==0||M!==this.length-1)F=z[6-E.length]+E+F;else F=E+F}if(H!==0)F=H.toString(16)+F;while(F.length%W!==0)F="0"+F;if(this.negative!==0)F="-"+F;return F}if(J===(J|0)&&J>=2&&J<=36){var $=R[J],q=S[J];F="";var j=this.clone();j.negative=0;while(!j.isZero()){var L=j.modn(q).toString(J);if(j=j.idivn(q),!j.isZero())F=z[$-L.length]+L+F;else F=L+F}if(this.isZero())F="0"+F;while(F.length%W!==0)F="0"+F;if(this.negative!==0)F="-"+F;return F}G(!1,"Base should be between 2 and 36")},Y.prototype.toNumber=function(){var J=this.words[0];if(this.length===2)J+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)J+=4503599627370496+this.words[1]*67108864;else if(this.length>2)G(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-J:J},Y.prototype.toJSON=function(){return this.toString(16)},Y.prototype.toBuffer=function(J,W){return G(typeof K<"u"),this.toArrayLike(K,J,W)},Y.prototype.toArray=function(J,W){return this.toArrayLike(Array,J,W)},Y.prototype.toArrayLike=function(J,W,F){var V=this.byteLength(),H=F||Math.max(1,V);G(V<=H,"byte array longer than desired length"),G(H>0,"Requested array length <= 0"),this.strip();var M=W==="le",T=new J(H),E,$,q=this.clone();if(!M){for($=0;$<H-V;$++)T[$]=0;for($=0;!q.isZero();$++)E=q.andln(255),q.iushrn(8),T[H-$-1]=E}else{for($=0;!q.isZero();$++)E=q.andln(255),q.iushrn(8),T[$]=E;for(;$<H;$++)T[$]=0}return T},Math.clz32)Y.prototype._countBits=function(J){return 32-Math.clz32(J)};else Y.prototype._countBits=function(J){var W=J,F=0;if(W>=4096)F+=13,W>>>=13;if(W>=64)F+=7,W>>>=7;if(W>=8)F+=4,W>>>=4;if(W>=2)F+=2,W>>>=2;return F+W};Y.prototype._zeroBits=function(J){if(J===0)return 26;var W=J,F=0;if((W&8191)===0)F+=13,W>>>=13;if((W&127)===0)F+=7,W>>>=7;if((W&15)===0)F+=4,W>>>=4;if((W&3)===0)F+=2,W>>>=2;if((W&1)===0)F++;return F},Y.prototype.bitLength=function(){var J=this.words[this.length-1],W=this._countBits(J);return(this.length-1)*26+W};function P(J){var W=Array(J.bitLength());for(var F=0;F<W.length;F++){var V=F/26|0,H=F%26;W[F]=(J.words[V]&1<<H)>>>H}return W}Y.prototype.zeroBits=function(){if(this.isZero())return 0;var J=0;for(var W=0;W<this.length;W++){var F=this._zeroBits(this.words[W]);if(J+=F,F!==26)break}return J},Y.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Y.prototype.toTwos=function(J){if(this.negative!==0)return this.abs().inotn(J).iaddn(1);return this.clone()},Y.prototype.fromTwos=function(J){if(this.testn(J-1))return this.notn(J).iaddn(1).ineg();return this.clone()},Y.prototype.isNeg=function(){return this.negative!==0},Y.prototype.neg=function(){return this.clone().ineg()},Y.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Y.prototype.iuor=function(J){while(this.length<J.length)this.words[this.length++]=0;for(var W=0;W<J.length;W++)this.words[W]=this.words[W]|J.words[W];return this.strip()},Y.prototype.ior=function(J){return G((this.negative|J.negative)===0),this.iuor(J)},Y.prototype.or=function(J){if(this.length>J.length)return this.clone().ior(J);return J.clone().ior(this)},Y.prototype.uor=function(J){if(this.length>J.length)return this.clone().iuor(J);return J.clone().iuor(this)},Y.prototype.iuand=function(J){var W;if(this.length>J.length)W=J;else W=this;for(var F=0;F<W.length;F++)this.words[F]=this.words[F]&J.words[F];return this.length=W.length,this.strip()},Y.prototype.iand=function(J){return G((this.negative|J.negative)===0),this.iuand(J)},Y.prototype.and=function(J){if(this.length>J.length)return this.clone().iand(J);return J.clone().iand(this)},Y.prototype.uand=function(J){if(this.length>J.length)return this.clone().iuand(J);return J.clone().iuand(this)},Y.prototype.iuxor=function(J){var W,F;if(this.length>J.length)W=this,F=J;else W=J,F=this;for(var V=0;V<F.length;V++)this.words[V]=W.words[V]^F.words[V];if(this!==W)for(;V<W.length;V++)this.words[V]=W.words[V];return this.length=W.length,this.strip()},Y.prototype.ixor=function(J){return G((this.negative|J.negative)===0),this.iuxor(J)},Y.prototype.xor=function(J){if(this.length>J.length)return this.clone().ixor(J);return J.clone().ixor(this)},Y.prototype.uxor=function(J){if(this.length>J.length)return this.clone().iuxor(J);return J.clone().iuxor(this)},Y.prototype.inotn=function(J){G(typeof J==="number"&&J>=0);var W=Math.ceil(J/26)|0,F=J%26;if(this._expand(W),F>0)W--;for(var V=0;V<W;V++)this.words[V]=~this.words[V]&67108863;if(F>0)this.words[V]=~this.words[V]&67108863>>26-F;return this.strip()},Y.prototype.notn=function(J){return this.clone().inotn(J)},Y.prototype.setn=function(J,W){G(typeof J==="number"&&J>=0);var F=J/26|0,V=J%26;if(this._expand(F+1),W)this.words[F]=this.words[F]|1<<V;else this.words[F]=this.words[F]&~(1<<V);return this.strip()},Y.prototype.iadd=function(J){var W;if(this.negative!==0&&J.negative===0)return this.negative=0,W=this.isub(J),this.negative^=1,this._normSign();else if(this.negative===0&&J.negative!==0)return J.negative=0,W=this.isub(J),J.negative=1,W._normSign();var F,V;if(this.length>J.length)F=this,V=J;else F=J,V=this;var H=0;for(var M=0;M<V.length;M++)W=(F.words[M]|0)+(V.words[M]|0)+H,this.words[M]=W&67108863,H=W>>>26;for(;H!==0&&M<F.length;M++)W=(F.words[M]|0)+H,this.words[M]=W&67108863,H=W>>>26;if(this.length=F.length,H!==0)this.words[this.length]=H,this.length++;else if(F!==this)for(;M<F.length;M++)this.words[M]=F.words[M];return this},Y.prototype.add=function(J){var W;if(J.negative!==0&&this.negative===0)return J.negative=0,W=this.sub(J),J.negative^=1,W;else if(J.negative===0&&this.negative!==0)return this.negative=0,W=J.sub(this),this.negative=1,W;if(this.length>J.length)return this.clone().iadd(J);return J.clone().iadd(this)},Y.prototype.isub=function(J){if(J.negative!==0){J.negative=0;var W=this.iadd(J);return J.negative=1,W._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(J),this.negative=1,this._normSign();var F=this.cmp(J);if(F===0)return this.negative=0,this.length=1,this.words[0]=0,this;var V,H;if(F>0)V=this,H=J;else V=J,H=this;var M=0;for(var T=0;T<H.length;T++)W=(V.words[T]|0)-(H.words[T]|0)+M,M=W>>26,this.words[T]=W&67108863;for(;M!==0&&T<V.length;T++)W=(V.words[T]|0)+M,M=W>>26,this.words[T]=W&67108863;if(M===0&&T<V.length&&V!==this)for(;T<V.length;T++)this.words[T]=V.words[T];if(this.length=Math.max(this.length,T),V!==this)this.negative=1;return this.strip()},Y.prototype.sub=function(J){return this.clone().isub(J)};function N(J,W,F){F.negative=W.negative^J.negative;var V=J.length+W.length|0;F.length=V,V=V-1|0;var H=J.words[0]|0,M=W.words[0]|0,T=H*M,E=T&67108863,$=T/67108864|0;F.words[0]=E;for(var q=1;q<V;q++){var j=$>>>26,L=$&67108863,x=Math.min(q,W.length-1);for(var f=Math.max(0,q-J.length+1);f<=x;f++){var b=q-f|0;H=J.words[b]|0,M=W.words[f]|0,T=H*M+L,j+=T/67108864|0,L=T&67108863}F.words[q]=L|0,$=j|0}if($!==0)F.words[q]=$|0;else F.length--;return F.strip()}var I=function(J,W,F){var V=J.words,H=W.words,M=F.words,T=0,E,$,q,j=V[0]|0,L=j&8191,x=j>>>13,f=V[1]|0,b=f&8191,s=f>>>13,z0=V[2]|0,i=z0&8191,o=z0>>>13,W0=V[3]|0,r=W0&8191,X0=W0>>>13,d0=V[4]|0,c=d0&8191,m=d0>>>13,E0=V[5]|0,Z0=E0&8191,$0=E0>>>13,N0=V[6]|0,d=N0&8191,t=N0>>>13,l0=V[7]|0,e=l0&8191,F0=l0>>>13,ZX=V[8]|0,T0=ZX&8191,R0=ZX>>>13,kX=V[9]|0,C0=kX&8191,P0=kX>>>13,_X=H[0]|0,I0=_X&8191,L0=_X>>>13,HZ=H[1]|0,B0=HZ&8191,y0=HZ>>>13,FZ=H[2]|0,f0=FZ&8191,k0=FZ>>>13,$Z=H[3]|0,g0=$Z&8191,x0=$Z>>>13,tX=H[4]|0,h0=tX&8191,p0=tX>>>13,iX=H[5]|0,w0=iX&8191,y=iX>>>13,n=H[6]|0,Y0=n&8191,O0=n>>>13,n0=H[7]|0,A0=n0&8191,S0=n0>>>13,xX=H[8]|0,v0=xX&8191,c0=xX>>>13,GZ=H[9]|0,_0=GZ&8191,j0=GZ>>>13;F.negative=J.negative^W.negative,F.length=19,E=Math.imul(L,I0),$=Math.imul(L,L0),$=$+Math.imul(x,I0)|0,q=Math.imul(x,L0);var wX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(wX>>>26)|0,wX&=67108863,E=Math.imul(b,I0),$=Math.imul(b,L0),$=$+Math.imul(s,I0)|0,q=Math.imul(s,L0),E=E+Math.imul(L,B0)|0,$=$+Math.imul(L,y0)|0,$=$+Math.imul(x,B0)|0,q=q+Math.imul(x,y0)|0;var $X=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+($X>>>26)|0,$X&=67108863,E=Math.imul(i,I0),$=Math.imul(i,L0),$=$+Math.imul(o,I0)|0,q=Math.imul(o,L0),E=E+Math.imul(b,B0)|0,$=$+Math.imul(b,y0)|0,$=$+Math.imul(s,B0)|0,q=q+Math.imul(s,y0)|0,E=E+Math.imul(L,f0)|0,$=$+Math.imul(L,k0)|0,$=$+Math.imul(x,f0)|0,q=q+Math.imul(x,k0)|0;var JX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(JX>>>26)|0,JX&=67108863,E=Math.imul(r,I0),$=Math.imul(r,L0),$=$+Math.imul(X0,I0)|0,q=Math.imul(X0,L0),E=E+Math.imul(i,B0)|0,$=$+Math.imul(i,y0)|0,$=$+Math.imul(o,B0)|0,q=q+Math.imul(o,y0)|0,E=E+Math.imul(b,f0)|0,$=$+Math.imul(b,k0)|0,$=$+Math.imul(s,f0)|0,q=q+Math.imul(s,k0)|0,E=E+Math.imul(L,g0)|0,$=$+Math.imul(L,x0)|0,$=$+Math.imul(x,g0)|0,q=q+Math.imul(x,x0)|0;var TX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(TX>>>26)|0,TX&=67108863,E=Math.imul(c,I0),$=Math.imul(c,L0),$=$+Math.imul(m,I0)|0,q=Math.imul(m,L0),E=E+Math.imul(r,B0)|0,$=$+Math.imul(r,y0)|0,$=$+Math.imul(X0,B0)|0,q=q+Math.imul(X0,y0)|0,E=E+Math.imul(i,f0)|0,$=$+Math.imul(i,k0)|0,$=$+Math.imul(o,f0)|0,q=q+Math.imul(o,k0)|0,E=E+Math.imul(b,g0)|0,$=$+Math.imul(b,x0)|0,$=$+Math.imul(s,g0)|0,q=q+Math.imul(s,x0)|0,E=E+Math.imul(L,h0)|0,$=$+Math.imul(L,p0)|0,$=$+Math.imul(x,h0)|0,q=q+Math.imul(x,p0)|0;var AX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(AX>>>26)|0,AX&=67108863,E=Math.imul(Z0,I0),$=Math.imul(Z0,L0),$=$+Math.imul($0,I0)|0,q=Math.imul($0,L0),E=E+Math.imul(c,B0)|0,$=$+Math.imul(c,y0)|0,$=$+Math.imul(m,B0)|0,q=q+Math.imul(m,y0)|0,E=E+Math.imul(r,f0)|0,$=$+Math.imul(r,k0)|0,$=$+Math.imul(X0,f0)|0,q=q+Math.imul(X0,k0)|0,E=E+Math.imul(i,g0)|0,$=$+Math.imul(i,x0)|0,$=$+Math.imul(o,g0)|0,q=q+Math.imul(o,x0)|0,E=E+Math.imul(b,h0)|0,$=$+Math.imul(b,p0)|0,$=$+Math.imul(s,h0)|0,q=q+Math.imul(s,p0)|0,E=E+Math.imul(L,w0)|0,$=$+Math.imul(L,y)|0,$=$+Math.imul(x,w0)|0,q=q+Math.imul(x,y)|0;var fX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(fX>>>26)|0,fX&=67108863,E=Math.imul(d,I0),$=Math.imul(d,L0),$=$+Math.imul(t,I0)|0,q=Math.imul(t,L0),E=E+Math.imul(Z0,B0)|0,$=$+Math.imul(Z0,y0)|0,$=$+Math.imul($0,B0)|0,q=q+Math.imul($0,y0)|0,E=E+Math.imul(c,f0)|0,$=$+Math.imul(c,k0)|0,$=$+Math.imul(m,f0)|0,q=q+Math.imul(m,k0)|0,E=E+Math.imul(r,g0)|0,$=$+Math.imul(r,x0)|0,$=$+Math.imul(X0,g0)|0,q=q+Math.imul(X0,x0)|0,E=E+Math.imul(i,h0)|0,$=$+Math.imul(i,p0)|0,$=$+Math.imul(o,h0)|0,q=q+Math.imul(o,p0)|0,E=E+Math.imul(b,w0)|0,$=$+Math.imul(b,y)|0,$=$+Math.imul(s,w0)|0,q=q+Math.imul(s,y)|0,E=E+Math.imul(L,Y0)|0,$=$+Math.imul(L,O0)|0,$=$+Math.imul(x,Y0)|0,q=q+Math.imul(x,O0)|0;var gX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(gX>>>26)|0,gX&=67108863,E=Math.imul(e,I0),$=Math.imul(e,L0),$=$+Math.imul(F0,I0)|0,q=Math.imul(F0,L0),E=E+Math.imul(d,B0)|0,$=$+Math.imul(d,y0)|0,$=$+Math.imul(t,B0)|0,q=q+Math.imul(t,y0)|0,E=E+Math.imul(Z0,f0)|0,$=$+Math.imul(Z0,k0)|0,$=$+Math.imul($0,f0)|0,q=q+Math.imul($0,k0)|0,E=E+Math.imul(c,g0)|0,$=$+Math.imul(c,x0)|0,$=$+Math.imul(m,g0)|0,q=q+Math.imul(m,x0)|0,E=E+Math.imul(r,h0)|0,$=$+Math.imul(r,p0)|0,$=$+Math.imul(X0,h0)|0,q=q+Math.imul(X0,p0)|0,E=E+Math.imul(i,w0)|0,$=$+Math.imul(i,y)|0,$=$+Math.imul(o,w0)|0,q=q+Math.imul(o,y)|0,E=E+Math.imul(b,Y0)|0,$=$+Math.imul(b,O0)|0,$=$+Math.imul(s,Y0)|0,q=q+Math.imul(s,O0)|0,E=E+Math.imul(L,A0)|0,$=$+Math.imul(L,S0)|0,$=$+Math.imul(x,A0)|0,q=q+Math.imul(x,S0)|0;var hX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(hX>>>26)|0,hX&=67108863,E=Math.imul(T0,I0),$=Math.imul(T0,L0),$=$+Math.imul(R0,I0)|0,q=Math.imul(R0,L0),E=E+Math.imul(e,B0)|0,$=$+Math.imul(e,y0)|0,$=$+Math.imul(F0,B0)|0,q=q+Math.imul(F0,y0)|0,E=E+Math.imul(d,f0)|0,$=$+Math.imul(d,k0)|0,$=$+Math.imul(t,f0)|0,q=q+Math.imul(t,k0)|0,E=E+Math.imul(Z0,g0)|0,$=$+Math.imul(Z0,x0)|0,$=$+Math.imul($0,g0)|0,q=q+Math.imul($0,x0)|0,E=E+Math.imul(c,h0)|0,$=$+Math.imul(c,p0)|0,$=$+Math.imul(m,h0)|0,q=q+Math.imul(m,p0)|0,E=E+Math.imul(r,w0)|0,$=$+Math.imul(r,y)|0,$=$+Math.imul(X0,w0)|0,q=q+Math.imul(X0,y)|0,E=E+Math.imul(i,Y0)|0,$=$+Math.imul(i,O0)|0,$=$+Math.imul(o,Y0)|0,q=q+Math.imul(o,O0)|0,E=E+Math.imul(b,A0)|0,$=$+Math.imul(b,S0)|0,$=$+Math.imul(s,A0)|0,q=q+Math.imul(s,S0)|0,E=E+Math.imul(L,v0)|0,$=$+Math.imul(L,c0)|0,$=$+Math.imul(x,v0)|0,q=q+Math.imul(x,c0)|0;var pX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(pX>>>26)|0,pX&=67108863,E=Math.imul(C0,I0),$=Math.imul(C0,L0),$=$+Math.imul(P0,I0)|0,q=Math.imul(P0,L0),E=E+Math.imul(T0,B0)|0,$=$+Math.imul(T0,y0)|0,$=$+Math.imul(R0,B0)|0,q=q+Math.imul(R0,y0)|0,E=E+Math.imul(e,f0)|0,$=$+Math.imul(e,k0)|0,$=$+Math.imul(F0,f0)|0,q=q+Math.imul(F0,k0)|0,E=E+Math.imul(d,g0)|0,$=$+Math.imul(d,x0)|0,$=$+Math.imul(t,g0)|0,q=q+Math.imul(t,x0)|0,E=E+Math.imul(Z0,h0)|0,$=$+Math.imul(Z0,p0)|0,$=$+Math.imul($0,h0)|0,q=q+Math.imul($0,p0)|0,E=E+Math.imul(c,w0)|0,$=$+Math.imul(c,y)|0,$=$+Math.imul(m,w0)|0,q=q+Math.imul(m,y)|0,E=E+Math.imul(r,Y0)|0,$=$+Math.imul(r,O0)|0,$=$+Math.imul(X0,Y0)|0,q=q+Math.imul(X0,O0)|0,E=E+Math.imul(i,A0)|0,$=$+Math.imul(i,S0)|0,$=$+Math.imul(o,A0)|0,q=q+Math.imul(o,S0)|0,E=E+Math.imul(b,v0)|0,$=$+Math.imul(b,c0)|0,$=$+Math.imul(s,v0)|0,q=q+Math.imul(s,c0)|0,E=E+Math.imul(L,_0)|0,$=$+Math.imul(L,j0)|0,$=$+Math.imul(x,_0)|0,q=q+Math.imul(x,j0)|0;var cX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(cX>>>26)|0,cX&=67108863,E=Math.imul(C0,B0),$=Math.imul(C0,y0),$=$+Math.imul(P0,B0)|0,q=Math.imul(P0,y0),E=E+Math.imul(T0,f0)|0,$=$+Math.imul(T0,k0)|0,$=$+Math.imul(R0,f0)|0,q=q+Math.imul(R0,k0)|0,E=E+Math.imul(e,g0)|0,$=$+Math.imul(e,x0)|0,$=$+Math.imul(F0,g0)|0,q=q+Math.imul(F0,x0)|0,E=E+Math.imul(d,h0)|0,$=$+Math.imul(d,p0)|0,$=$+Math.imul(t,h0)|0,q=q+Math.imul(t,p0)|0,E=E+Math.imul(Z0,w0)|0,$=$+Math.imul(Z0,y)|0,$=$+Math.imul($0,w0)|0,q=q+Math.imul($0,y)|0,E=E+Math.imul(c,Y0)|0,$=$+Math.imul(c,O0)|0,$=$+Math.imul(m,Y0)|0,q=q+Math.imul(m,O0)|0,E=E+Math.imul(r,A0)|0,$=$+Math.imul(r,S0)|0,$=$+Math.imul(X0,A0)|0,q=q+Math.imul(X0,S0)|0,E=E+Math.imul(i,v0)|0,$=$+Math.imul(i,c0)|0,$=$+Math.imul(o,v0)|0,q=q+Math.imul(o,c0)|0,E=E+Math.imul(b,_0)|0,$=$+Math.imul(b,j0)|0,$=$+Math.imul(s,_0)|0,q=q+Math.imul(s,j0)|0;var uX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(uX>>>26)|0,uX&=67108863,E=Math.imul(C0,f0),$=Math.imul(C0,k0),$=$+Math.imul(P0,f0)|0,q=Math.imul(P0,k0),E=E+Math.imul(T0,g0)|0,$=$+Math.imul(T0,x0)|0,$=$+Math.imul(R0,g0)|0,q=q+Math.imul(R0,x0)|0,E=E+Math.imul(e,h0)|0,$=$+Math.imul(e,p0)|0,$=$+Math.imul(F0,h0)|0,q=q+Math.imul(F0,p0)|0,E=E+Math.imul(d,w0)|0,$=$+Math.imul(d,y)|0,$=$+Math.imul(t,w0)|0,q=q+Math.imul(t,y)|0,E=E+Math.imul(Z0,Y0)|0,$=$+Math.imul(Z0,O0)|0,$=$+Math.imul($0,Y0)|0,q=q+Math.imul($0,O0)|0,E=E+Math.imul(c,A0)|0,$=$+Math.imul(c,S0)|0,$=$+Math.imul(m,A0)|0,q=q+Math.imul(m,S0)|0,E=E+Math.imul(r,v0)|0,$=$+Math.imul(r,c0)|0,$=$+Math.imul(X0,v0)|0,q=q+Math.imul(X0,c0)|0,E=E+Math.imul(i,_0)|0,$=$+Math.imul(i,j0)|0,$=$+Math.imul(o,_0)|0,q=q+Math.imul(o,j0)|0;var bX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(bX>>>26)|0,bX&=67108863,E=Math.imul(C0,g0),$=Math.imul(C0,x0),$=$+Math.imul(P0,g0)|0,q=Math.imul(P0,x0),E=E+Math.imul(T0,h0)|0,$=$+Math.imul(T0,p0)|0,$=$+Math.imul(R0,h0)|0,q=q+Math.imul(R0,p0)|0,E=E+Math.imul(e,w0)|0,$=$+Math.imul(e,y)|0,$=$+Math.imul(F0,w0)|0,q=q+Math.imul(F0,y)|0,E=E+Math.imul(d,Y0)|0,$=$+Math.imul(d,O0)|0,$=$+Math.imul(t,Y0)|0,q=q+Math.imul(t,O0)|0,E=E+Math.imul(Z0,A0)|0,$=$+Math.imul(Z0,S0)|0,$=$+Math.imul($0,A0)|0,q=q+Math.imul($0,S0)|0,E=E+Math.imul(c,v0)|0,$=$+Math.imul(c,c0)|0,$=$+Math.imul(m,v0)|0,q=q+Math.imul(m,c0)|0,E=E+Math.imul(r,_0)|0,$=$+Math.imul(r,j0)|0,$=$+Math.imul(X0,_0)|0,q=q+Math.imul(X0,j0)|0;var dX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(dX>>>26)|0,dX&=67108863,E=Math.imul(C0,h0),$=Math.imul(C0,p0),$=$+Math.imul(P0,h0)|0,q=Math.imul(P0,p0),E=E+Math.imul(T0,w0)|0,$=$+Math.imul(T0,y)|0,$=$+Math.imul(R0,w0)|0,q=q+Math.imul(R0,y)|0,E=E+Math.imul(e,Y0)|0,$=$+Math.imul(e,O0)|0,$=$+Math.imul(F0,Y0)|0,q=q+Math.imul(F0,O0)|0,E=E+Math.imul(d,A0)|0,$=$+Math.imul(d,S0)|0,$=$+Math.imul(t,A0)|0,q=q+Math.imul(t,S0)|0,E=E+Math.imul(Z0,v0)|0,$=$+Math.imul(Z0,c0)|0,$=$+Math.imul($0,v0)|0,q=q+Math.imul($0,c0)|0,E=E+Math.imul(c,_0)|0,$=$+Math.imul(c,j0)|0,$=$+Math.imul(m,_0)|0,q=q+Math.imul(m,j0)|0;var lX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(lX>>>26)|0,lX&=67108863,E=Math.imul(C0,w0),$=Math.imul(C0,y),$=$+Math.imul(P0,w0)|0,q=Math.imul(P0,y),E=E+Math.imul(T0,Y0)|0,$=$+Math.imul(T0,O0)|0,$=$+Math.imul(R0,Y0)|0,q=q+Math.imul(R0,O0)|0,E=E+Math.imul(e,A0)|0,$=$+Math.imul(e,S0)|0,$=$+Math.imul(F0,A0)|0,q=q+Math.imul(F0,S0)|0,E=E+Math.imul(d,v0)|0,$=$+Math.imul(d,c0)|0,$=$+Math.imul(t,v0)|0,q=q+Math.imul(t,c0)|0,E=E+Math.imul(Z0,_0)|0,$=$+Math.imul(Z0,j0)|0,$=$+Math.imul($0,_0)|0,q=q+Math.imul($0,j0)|0;var mX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(mX>>>26)|0,mX&=67108863,E=Math.imul(C0,Y0),$=Math.imul(C0,O0),$=$+Math.imul(P0,Y0)|0,q=Math.imul(P0,O0),E=E+Math.imul(T0,A0)|0,$=$+Math.imul(T0,S0)|0,$=$+Math.imul(R0,A0)|0,q=q+Math.imul(R0,S0)|0,E=E+Math.imul(e,v0)|0,$=$+Math.imul(e,c0)|0,$=$+Math.imul(F0,v0)|0,q=q+Math.imul(F0,c0)|0,E=E+Math.imul(d,_0)|0,$=$+Math.imul(d,j0)|0,$=$+Math.imul(t,_0)|0,q=q+Math.imul(t,j0)|0;var oX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(oX>>>26)|0,oX&=67108863,E=Math.imul(C0,A0),$=Math.imul(C0,S0),$=$+Math.imul(P0,A0)|0,q=Math.imul(P0,S0),E=E+Math.imul(T0,v0)|0,$=$+Math.imul(T0,c0)|0,$=$+Math.imul(R0,v0)|0,q=q+Math.imul(R0,c0)|0,E=E+Math.imul(e,_0)|0,$=$+Math.imul(e,j0)|0,$=$+Math.imul(F0,_0)|0,q=q+Math.imul(F0,j0)|0;var nX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(nX>>>26)|0,nX&=67108863,E=Math.imul(C0,v0),$=Math.imul(C0,c0),$=$+Math.imul(P0,v0)|0,q=Math.imul(P0,c0),E=E+Math.imul(T0,_0)|0,$=$+Math.imul(T0,j0)|0,$=$+Math.imul(R0,_0)|0,q=q+Math.imul(R0,j0)|0;var sX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(sX>>>26)|0,sX&=67108863,E=Math.imul(C0,_0),$=Math.imul(C0,j0),$=$+Math.imul(P0,_0)|0,q=Math.imul(P0,j0);var rX=(T+E|0)+(($&8191)<<13)|0;if(T=(q+($>>>13)|0)+(rX>>>26)|0,rX&=67108863,M[0]=wX,M[1]=$X,M[2]=JX,M[3]=TX,M[4]=AX,M[5]=fX,M[6]=gX,M[7]=hX,M[8]=pX,M[9]=cX,M[10]=uX,M[11]=bX,M[12]=dX,M[13]=lX,M[14]=mX,M[15]=oX,M[16]=nX,M[17]=sX,M[18]=rX,T!==0)M[19]=T,F.length++;return F};if(!Math.imul)I=N;function B(J,W,F){F.negative=W.negative^J.negative,F.length=J.length+W.length;var V=0,H=0;for(var M=0;M<F.length-1;M++){var T=H;H=0;var E=V&67108863,$=Math.min(M,W.length-1);for(var q=Math.max(0,M-J.length+1);q<=$;q++){var j=M-q,L=J.words[j]|0,x=W.words[q]|0,f=L*x,b=f&67108863;T=T+(f/67108864|0)|0,b=b+E|0,E=b&67108863,T=T+(b>>>26)|0,H+=T>>>26,T&=67108863}F.words[M]=E,V=T,T=H}if(V!==0)F.words[M]=V;else F.length--;return F.strip()}function k(J,W,F){var V=new w;return V.mulp(J,W,F)}Y.prototype.mulTo=function(J,W){var F,V=this.length+J.length;if(this.length===10&&J.length===10)F=I(this,J,W);else if(V<63)F=N(this,J,W);else if(V<1024)F=B(this,J,W);else F=k(this,J,W);return F};function w(J,W){this.x=J,this.y=W}w.prototype.makeRBT=function(J){var W=Array(J),F=Y.prototype._countBits(J)-1;for(var V=0;V<J;V++)W[V]=this.revBin(V,F,J);return W},w.prototype.revBin=function(J,W,F){if(J===0||J===F-1)return J;var V=0;for(var H=0;H<W;H++)V|=(J&1)<<W-H-1,J>>=1;return V},w.prototype.permute=function(J,W,F,V,H,M){for(var T=0;T<M;T++)V[T]=W[J[T]],H[T]=F[J[T]]},w.prototype.transform=function(J,W,F,V,H,M){this.permute(M,J,W,F,V,H);for(var T=1;T<H;T<<=1){var E=T<<1,$=Math.cos(2*Math.PI/E),q=Math.sin(2*Math.PI/E);for(var j=0;j<H;j+=E){var L=$,x=q;for(var f=0;f<T;f++){var b=F[j+f],s=V[j+f],z0=F[j+f+T],i=V[j+f+T],o=L*z0-x*i;if(i=L*i+x*z0,z0=o,F[j+f]=b+z0,V[j+f]=s+i,F[j+f+T]=b-z0,V[j+f+T]=s-i,f!==E)o=$*L-q*x,x=$*x+q*L,L=o}}}},w.prototype.guessLen13b=function(J,W){var F=Math.max(W,J)|1,V=F&1,H=0;for(F=F/2|0;F;F=F>>>1)H++;return 1<<H+1+V},w.prototype.conjugate=function(J,W,F){if(F<=1)return;for(var V=0;V<F/2;V++){var H=J[V];J[V]=J[F-V-1],J[F-V-1]=H,H=W[V],W[V]=-W[F-V-1],W[F-V-1]=-H}},w.prototype.normalize13b=function(J,W){var F=0;for(var V=0;V<W/2;V++){var H=Math.round(J[2*V+1]/W)*8192+Math.round(J[2*V]/W)+F;if(J[V]=H&67108863,H<67108864)F=0;else F=H/67108864|0}return J},w.prototype.convert13b=function(J,W,F,V){var H=0;for(var M=0;M<W;M++)H=H+(J[M]|0),F[2*M]=H&8191,H=H>>>13,F[2*M+1]=H&8191,H=H>>>13;for(M=2*W;M<V;++M)F[M]=0;G(H===0),G((H&-8192)===0)},w.prototype.stub=function(J){var W=Array(J);for(var F=0;F<J;F++)W[F]=0;return W},w.prototype.mulp=function(J,W,F){var V=2*this.guessLen13b(J.length,W.length),H=this.makeRBT(V),M=this.stub(V),T=Array(V),E=Array(V),$=Array(V),q=Array(V),j=Array(V),L=Array(V),x=F.words;x.length=V,this.convert13b(J.words,J.length,T,V),this.convert13b(W.words,W.length,q,V),this.transform(T,M,E,$,V,H),this.transform(q,M,j,L,V,H);for(var f=0;f<V;f++){var b=E[f]*j[f]-$[f]*L[f];$[f]=E[f]*L[f]+$[f]*j[f],E[f]=b}return this.conjugate(E,$,V),this.transform(E,$,x,M,V,H),this.conjugate(x,M,V),this.normalize13b(x,V),F.negative=J.negative^W.negative,F.length=J.length+W.length,F.strip()},Y.prototype.mul=function(J){var W=new Y(null);return W.words=Array(this.length+J.length),this.mulTo(J,W)},Y.prototype.mulf=function(J){var W=new Y(null);return W.words=Array(this.length+J.length),k(this,J,W)},Y.prototype.imul=function(J){return this.clone().mulTo(J,this)},Y.prototype.imuln=function(J){G(typeof J==="number"),G(J<67108864);var W=0;for(var F=0;F<this.length;F++){var V=(this.words[F]|0)*J,H=(V&67108863)+(W&67108863);W>>=26,W+=V/67108864|0,W+=H>>>26,this.words[F]=H&67108863}if(W!==0)this.words[F]=W,this.length++;return this.length=J===0?1:this.length,this},Y.prototype.muln=function(J){return this.clone().imuln(J)},Y.prototype.sqr=function(){return this.mul(this)},Y.prototype.isqr=function(){return this.imul(this.clone())},Y.prototype.pow=function(J){var W=P(J);if(W.length===0)return new Y(1);var F=this;for(var V=0;V<W.length;V++,F=F.sqr())if(W[V]!==0)break;if(++V<W.length)for(var H=F.sqr();V<W.length;V++,H=H.sqr()){if(W[V]===0)continue;F=F.mul(H)}return F},Y.prototype.iushln=function(J){G(typeof J==="number"&&J>=0);var W=J%26,F=(J-W)/26,V=67108863>>>26-W<<26-W,H;if(W!==0){var M=0;for(H=0;H<this.length;H++){var T=this.words[H]&V,E=(this.words[H]|0)-T<<W;this.words[H]=E|M,M=T>>>26-W}if(M)this.words[H]=M,this.length++}if(F!==0){for(H=this.length-1;H>=0;H--)this.words[H+F]=this.words[H];for(H=0;H<F;H++)this.words[H]=0;this.length+=F}return this.strip()},Y.prototype.ishln=function(J){return G(this.negative===0),this.iushln(J)},Y.prototype.iushrn=function(J,W,F){G(typeof J==="number"&&J>=0);var V;if(W)V=(W-W%26)/26;else V=0;var H=J%26,M=Math.min((J-H)/26,this.length),T=67108863^67108863>>>H<<H,E=F;if(V-=M,V=Math.max(0,V),E){for(var $=0;$<M;$++)E.words[$]=this.words[$];E.length=M}if(M===0);else if(this.length>M){this.length-=M;for($=0;$<this.length;$++)this.words[$]=this.words[$+M]}else this.words[0]=0,this.length=1;var q=0;for($=this.length-1;$>=0&&(q!==0||$>=V);$--){var j=this.words[$]|0;this.words[$]=q<<26-H|j>>>H,q=j&T}if(E&&q!==0)E.words[E.length++]=q;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Y.prototype.ishrn=function(J,W,F){return G(this.negative===0),this.iushrn(J,W,F)},Y.prototype.shln=function(J){return this.clone().ishln(J)},Y.prototype.ushln=function(J){return this.clone().iushln(J)},Y.prototype.shrn=function(J){return this.clone().ishrn(J)},Y.prototype.ushrn=function(J){return this.clone().iushrn(J)},Y.prototype.testn=function(J){G(typeof J==="number"&&J>=0);var W=J%26,F=(J-W)/26,V=1<<W;if(this.length<=F)return!1;var H=this.words[F];return!!(H&V)},Y.prototype.imaskn=function(J){G(typeof J==="number"&&J>=0);var W=J%26,F=(J-W)/26;if(G(this.negative===0,"imaskn works only with positive numbers"),this.length<=F)return this;if(W!==0)F++;if(this.length=Math.min(F,this.length),W!==0){var V=67108863^67108863>>>W<<W;this.words[this.length-1]&=V}return this.strip()},Y.prototype.maskn=function(J){return this.clone().imaskn(J)},Y.prototype.iaddn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.isubn(-J);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<J)return this.words[0]=J-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(J),this.negative=1,this}return this._iaddn(J)},Y.prototype._iaddn=function(J){this.words[0]+=J;for(var W=0;W<this.length&&this.words[W]>=67108864;W++)if(this.words[W]-=67108864,W===this.length-1)this.words[W+1]=1;else this.words[W+1]++;return this.length=Math.max(this.length,W+1),this},Y.prototype.isubn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.iaddn(-J);if(this.negative!==0)return this.negative=0,this.iaddn(J),this.negative=1,this;if(this.words[0]-=J,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var W=0;W<this.length&&this.words[W]<0;W++)this.words[W]+=67108864,this.words[W+1]-=1;return this.strip()},Y.prototype.addn=function(J){return this.clone().iaddn(J)},Y.prototype.subn=function(J){return this.clone().isubn(J)},Y.prototype.iabs=function(){return this.negative=0,this},Y.prototype.abs=function(){return this.clone().iabs()},Y.prototype._ishlnsubmul=function(J,W,F){var V=J.length+F,H;this._expand(V);var M,T=0;for(H=0;H<J.length;H++){M=(this.words[H+F]|0)+T;var E=(J.words[H]|0)*W;M-=E&67108863,T=(M>>26)-(E/67108864|0),this.words[H+F]=M&67108863}for(;H<this.length-F;H++)M=(this.words[H+F]|0)+T,T=M>>26,this.words[H+F]=M&67108863;if(T===0)return this.strip();G(T===-1),T=0;for(H=0;H<this.length;H++)M=-(this.words[H]|0)+T,T=M>>26,this.words[H]=M&67108863;return this.negative=1,this.strip()},Y.prototype._wordDiv=function(J,W){var F=this.length-J.length,V=this.clone(),H=J,M=H.words[H.length-1]|0,T=this._countBits(M);if(F=26-T,F!==0)H=H.ushln(F),V.iushln(F),M=H.words[H.length-1]|0;var E=V.length-H.length,$;if(W!=="mod"){$=new Y(null),$.length=E+1,$.words=Array($.length);for(var q=0;q<$.length;q++)$.words[q]=0}var j=V.clone()._ishlnsubmul(H,1,E);if(j.negative===0){if(V=j,$)$.words[E]=1}for(var L=E-1;L>=0;L--){var x=(V.words[H.length+L]|0)*67108864+(V.words[H.length+L-1]|0);x=Math.min(x/M|0,67108863),V._ishlnsubmul(H,x,L);while(V.negative!==0)if(x--,V.negative=0,V._ishlnsubmul(H,1,L),!V.isZero())V.negative^=1;if($)$.words[L]=x}if($)$.strip();if(V.strip(),W!=="div"&&F!==0)V.iushrn(F);return{div:$||null,mod:V}},Y.prototype.divmod=function(J,W,F){if(G(!J.isZero()),this.isZero())return{div:new Y(0),mod:new Y(0)};var V,H,M;if(this.negative!==0&&J.negative===0){if(M=this.neg().divmod(J,W),W!=="mod")V=M.div.neg();if(W!=="div"){if(H=M.mod.neg(),F&&H.negative!==0)H.iadd(J)}return{div:V,mod:H}}if(this.negative===0&&J.negative!==0){if(M=this.divmod(J.neg(),W),W!=="mod")V=M.div.neg();return{div:V,mod:M.mod}}if((this.negative&J.negative)!==0){if(M=this.neg().divmod(J.neg(),W),W!=="div"){if(H=M.mod.neg(),F&&H.negative!==0)H.isub(J)}return{div:M.div,mod:H}}if(J.length>this.length||this.cmp(J)<0)return{div:new Y(0),mod:this};if(J.length===1){if(W==="div")return{div:this.divn(J.words[0]),mod:null};if(W==="mod")return{div:null,mod:new Y(this.modn(J.words[0]))};return{div:this.divn(J.words[0]),mod:new Y(this.modn(J.words[0]))}}return this._wordDiv(J,W)},Y.prototype.div=function(J){return this.divmod(J,"div",!1).div},Y.prototype.mod=function(J){return this.divmod(J,"mod",!1).mod},Y.prototype.umod=function(J){return this.divmod(J,"mod",!0).mod},Y.prototype.divRound=function(J){var W=this.divmod(J);if(W.mod.isZero())return W.div;var F=W.div.negative!==0?W.mod.isub(J):W.mod,V=J.ushrn(1),H=J.andln(1),M=F.cmp(V);if(M<0||H===1&&M===0)return W.div;return W.div.negative!==0?W.div.isubn(1):W.div.iaddn(1)},Y.prototype.modn=function(J){G(J<=67108863);var W=67108864%J,F=0;for(var V=this.length-1;V>=0;V--)F=(W*F+(this.words[V]|0))%J;return F},Y.prototype.idivn=function(J){G(J<=67108863);var W=0;for(var F=this.length-1;F>=0;F--){var V=(this.words[F]|0)+W*67108864;this.words[F]=V/J|0,W=V%J}return this.strip()},Y.prototype.divn=function(J){return this.clone().idivn(J)},Y.prototype.egcd=function(J){G(J.negative===0),G(!J.isZero());var W=this,F=J.clone();if(W.negative!==0)W=W.umod(J);else W=W.clone();var V=new Y(1),H=new Y(0),M=new Y(0),T=new Y(1),E=0;while(W.isEven()&&F.isEven())W.iushrn(1),F.iushrn(1),++E;var $=F.clone(),q=W.clone();while(!W.isZero()){for(var j=0,L=1;(W.words[0]&L)===0&&j<26;++j,L<<=1);if(j>0){W.iushrn(j);while(j-- >0){if(V.isOdd()||H.isOdd())V.iadd($),H.isub(q);V.iushrn(1),H.iushrn(1)}}for(var x=0,f=1;(F.words[0]&f)===0&&x<26;++x,f<<=1);if(x>0){F.iushrn(x);while(x-- >0){if(M.isOdd()||T.isOdd())M.iadd($),T.isub(q);M.iushrn(1),T.iushrn(1)}}if(W.cmp(F)>=0)W.isub(F),V.isub(M),H.isub(T);else F.isub(W),M.isub(V),T.isub(H)}return{a:M,b:T,gcd:F.iushln(E)}},Y.prototype._invmp=function(J){G(J.negative===0),G(!J.isZero());var W=this,F=J.clone();if(W.negative!==0)W=W.umod(J);else W=W.clone();var V=new Y(1),H=new Y(0),M=F.clone();while(W.cmpn(1)>0&&F.cmpn(1)>0){for(var T=0,E=1;(W.words[0]&E)===0&&T<26;++T,E<<=1);if(T>0){W.iushrn(T);while(T-- >0){if(V.isOdd())V.iadd(M);V.iushrn(1)}}for(var $=0,q=1;(F.words[0]&q)===0&&$<26;++$,q<<=1);if($>0){F.iushrn($);while($-- >0){if(H.isOdd())H.iadd(M);H.iushrn(1)}}if(W.cmp(F)>=0)W.isub(F),V.isub(H);else F.isub(W),H.isub(V)}var j;if(W.cmpn(1)===0)j=V;else j=H;if(j.cmpn(0)<0)j.iadd(J);return j},Y.prototype.gcd=function(J){if(this.isZero())return J.abs();if(J.isZero())return this.abs();var W=this.clone(),F=J.clone();W.negative=0,F.negative=0;for(var V=0;W.isEven()&&F.isEven();V++)W.iushrn(1),F.iushrn(1);do{while(W.isEven())W.iushrn(1);while(F.isEven())F.iushrn(1);var H=W.cmp(F);if(H<0){var M=W;W=F,F=M}else if(H===0||F.cmpn(1)===0)break;W.isub(F)}while(!0);return F.iushln(V)},Y.prototype.invm=function(J){return this.egcd(J).a.umod(J)},Y.prototype.isEven=function(){return(this.words[0]&1)===0},Y.prototype.isOdd=function(){return(this.words[0]&1)===1},Y.prototype.andln=function(J){return this.words[0]&J},Y.prototype.bincn=function(J){G(typeof J==="number");var W=J%26,F=(J-W)/26,V=1<<W;if(this.length<=F)return this._expand(F+1),this.words[F]|=V,this;var H=V;for(var M=F;H!==0&&M<this.length;M++){var T=this.words[M]|0;T+=H,H=T>>>26,T&=67108863,this.words[M]=T}if(H!==0)this.words[M]=H,this.length++;return this},Y.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Y.prototype.cmpn=function(J){var W=J<0;if(this.negative!==0&&!W)return-1;if(this.negative===0&&W)return 1;this.strip();var F;if(this.length>1)F=1;else{if(W)J=-J;G(J<=67108863,"Number is too big");var V=this.words[0]|0;F=V===J?0:V<J?-1:1}if(this.negative!==0)return-F|0;return F},Y.prototype.cmp=function(J){if(this.negative!==0&&J.negative===0)return-1;if(this.negative===0&&J.negative!==0)return 1;var W=this.ucmp(J);if(this.negative!==0)return-W|0;return W},Y.prototype.ucmp=function(J){if(this.length>J.length)return 1;if(this.length<J.length)return-1;var W=0;for(var F=this.length-1;F>=0;F--){var V=this.words[F]|0,H=J.words[F]|0;if(V===H)continue;if(V<H)W=-1;else if(V>H)W=1;break}return W},Y.prototype.gtn=function(J){return this.cmpn(J)===1},Y.prototype.gt=function(J){return this.cmp(J)===1},Y.prototype.gten=function(J){return this.cmpn(J)>=0},Y.prototype.gte=function(J){return this.cmp(J)>=0},Y.prototype.ltn=function(J){return this.cmpn(J)===-1},Y.prototype.lt=function(J){return this.cmp(J)===-1},Y.prototype.lten=function(J){return this.cmpn(J)<=0},Y.prototype.lte=function(J){return this.cmp(J)<=0},Y.prototype.eqn=function(J){return this.cmpn(J)===0},Y.prototype.eq=function(J){return this.cmp(J)===0},Y.red=function(J){return new l(J)},Y.prototype.toRed=function(J){return G(!this.red,"Already a number in reduction context"),G(this.negative===0,"red works only with positives"),J.convertTo(this)._forceRed(J)},Y.prototype.fromRed=function(){return G(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Y.prototype._forceRed=function(J){return this.red=J,this},Y.prototype.forceRed=function(J){return G(!this.red,"Already a number in reduction context"),this._forceRed(J)},Y.prototype.redAdd=function(J){return G(this.red,"redAdd works only with red numbers"),this.red.add(this,J)},Y.prototype.redIAdd=function(J){return G(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,J)},Y.prototype.redSub=function(J){return G(this.red,"redSub works only with red numbers"),this.red.sub(this,J)},Y.prototype.redISub=function(J){return G(this.red,"redISub works only with red numbers"),this.red.isub(this,J)},Y.prototype.redShl=function(J){return G(this.red,"redShl works only with red numbers"),this.red.shl(this,J)},Y.prototype.redMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.mul(this,J)},Y.prototype.redIMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.imul(this,J)},Y.prototype.redSqr=function(){return G(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Y.prototype.redISqr=function(){return G(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Y.prototype.redSqrt=function(){return G(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Y.prototype.redInvm=function(){return G(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Y.prototype.redNeg=function(){return G(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Y.prototype.redPow=function(J){return G(this.red&&!J.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,J)};var v={k256:null,p224:null,p192:null,p25519:null};function _(J,W){this.name=J,this.p=new Y(W,16),this.n=this.p.bitLength(),this.k=new Y(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}_.prototype._tmp=function(){var J=new Y(null);return J.words=Array(Math.ceil(this.n/13)),J},_.prototype.ireduce=function(J){var W=J,F;do this.split(W,this.tmp),W=this.imulK(W),W=W.iadd(this.tmp),F=W.bitLength();while(F>this.n);var V=F<this.n?-1:W.ucmp(this.p);if(V===0)W.words[0]=0,W.length=1;else if(V>0)W.isub(this.p);else if(W.strip!==void 0)W.strip();else W._strip();return W},_.prototype.split=function(J,W){J.iushrn(this.n,0,W)},_.prototype.imulK=function(J){return J.imul(this.k)};function u(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(u,_),u.prototype.split=function(J,W){var F=4194303,V=Math.min(J.length,9);for(var H=0;H<V;H++)W.words[H]=J.words[H];if(W.length=V,J.length<=9){J.words[0]=0,J.length=1;return}var M=J.words[9];W.words[W.length++]=M&F;for(H=10;H<J.length;H++){var T=J.words[H]|0;J.words[H-10]=(T&F)<<4|M>>>22,M=T}if(M>>>=22,J.words[H-10]=M,M===0&&J.length>10)J.length-=10;else J.length-=9},u.prototype.imulK=function(J){J.words[J.length]=0,J.words[J.length+1]=0,J.length+=2;var W=0;for(var F=0;F<J.length;F++){var V=J.words[F]|0;W+=V*977,J.words[F]=W&67108863,W=V*64+(W/67108864|0)}if(J.words[J.length-1]===0){if(J.length--,J.words[J.length-1]===0)J.length--}return J};function J0(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(J0,_);function H0(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(H0,_);function V0(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(V0,_),V0.prototype.imulK=function(J){var W=0;for(var F=0;F<J.length;F++){var V=(J.words[F]|0)*19+W,H=V&67108863;V>>>=26,J.words[F]=H,W=V}if(W!==0)J.words[J.length++]=W;return J},Y._prime=function(J){if(v[J])return v[J];var W;if(J==="k256")W=new u;else if(J==="p224")W=new J0;else if(J==="p192")W=new H0;else if(J==="p25519")W=new V0;else throw Error("Unknown prime "+J);return v[J]=W,W};function l(J){if(typeof J==="string"){var W=Y._prime(J);this.m=W.p,this.prime=W}else G(J.gtn(1),"modulus must be greater than 1"),this.m=J,this.prime=null}l.prototype._verify1=function(J){G(J.negative===0,"red works only with positives"),G(J.red,"red works only with red numbers")},l.prototype._verify2=function(J,W){G((J.negative|W.negative)===0,"red works only with positives"),G(J.red&&J.red===W.red,"red works only with red numbers")},l.prototype.imod=function(J){if(this.prime)return this.prime.ireduce(J)._forceRed(this);return J.umod(this.m)._forceRed(this)},l.prototype.neg=function(J){if(J.isZero())return J.clone();return this.m.sub(J)._forceRed(this)},l.prototype.add=function(J,W){this._verify2(J,W);var F=J.add(W);if(F.cmp(this.m)>=0)F.isub(this.m);return F._forceRed(this)},l.prototype.iadd=function(J,W){this._verify2(J,W);var F=J.iadd(W);if(F.cmp(this.m)>=0)F.isub(this.m);return F},l.prototype.sub=function(J,W){this._verify2(J,W);var F=J.sub(W);if(F.cmpn(0)<0)F.iadd(this.m);return F._forceRed(this)},l.prototype.isub=function(J,W){this._verify2(J,W);var F=J.isub(W);if(F.cmpn(0)<0)F.iadd(this.m);return F},l.prototype.shl=function(J,W){return this._verify1(J),this.imod(J.ushln(W))},l.prototype.imul=function(J,W){return this._verify2(J,W),this.imod(J.imul(W))},l.prototype.mul=function(J,W){return this._verify2(J,W),this.imod(J.mul(W))},l.prototype.isqr=function(J){return this.imul(J,J.clone())},l.prototype.sqr=function(J){return this.mul(J,J)},l.prototype.sqrt=function(J){if(J.isZero())return J.clone();var W=this.m.andln(3);if(G(W%2===1),W===3){var F=this.m.add(new Y(1)).iushrn(2);return this.pow(J,F)}var V=this.m.subn(1),H=0;while(!V.isZero()&&V.andln(1)===0)H++,V.iushrn(1);G(!V.isZero());var M=new Y(1).toRed(this),T=M.redNeg(),E=this.m.subn(1).iushrn(1),$=this.m.bitLength();$=new Y(2*$*$).toRed(this);while(this.pow($,E).cmp(T)!==0)$.redIAdd(T);var q=this.pow($,V),j=this.pow(J,V.addn(1).iushrn(1)),L=this.pow(J,V),x=H;while(L.cmp(M)!==0){var f=L;for(var b=0;f.cmp(M)!==0;b++)f=f.redSqr();G(b<x);var s=this.pow(q,new Y(1).iushln(x-b-1));j=j.redMul(s),q=s.redSqr(),L=L.redMul(q),x=b}return j},l.prototype.invm=function(J){var W=J._invmp(this.m);if(W.negative!==0)return W.negative=0,this.imod(W).redNeg();else return this.imod(W)},l.prototype.pow=function(J,W){if(W.isZero())return new Y(1).toRed(this);if(W.cmpn(1)===0)return J.clone();var F=4,V=Array(1<<F);V[0]=new Y(1).toRed(this),V[1]=J;for(var H=2;H<V.length;H++)V[H]=this.mul(V[H-1],J);var M=V[0],T=0,E=0,$=W.bitLength()%26;if($===0)$=26;for(H=W.length-1;H>=0;H--){var q=W.words[H];for(var j=$-1;j>=0;j--){var L=q>>j&1;if(M!==V[0])M=this.sqr(M);if(L===0&&T===0){E=0;continue}if(T<<=1,T|=L,E++,E!==F&&(H!==0||j!==0))continue;M=this.mul(M,V[T]),E=0,T=0}$=26}return M},l.prototype.convertTo=function(J){var W=J.umod(this.m);return W===J?W.clone():W},l.prototype.convertFrom=function(J){var W=J.clone();return W.red=null,W},Y.mont=function(J){return new U0(J)};function U0(J){if(l.call(this,J),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Y(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)}O(U0,l),U0.prototype.convertTo=function(J){return this.imod(J.ushln(this.shift))},U0.prototype.convertFrom=function(J){var W=this.imod(J.mul(this.rinv));return W.red=null,W},U0.prototype.imul=function(J,W){if(J.isZero()||W.isZero())return J.words[0]=0,J.length=1,J;var F=J.imul(W),V=F.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),H=F.isub(V).iushrn(this.shift),M=H;if(H.cmp(this.m)>=0)M=H.isub(this.m);else if(H.cmpn(0)<0)M=H.iadd(this.m);return M._forceRed(this)},U0.prototype.mul=function(J,W){if(J.isZero()||W.isZero())return new Y(0)._forceRed(this);var F=J.mul(W),V=F.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),H=F.isub(V).iushrn(this.shift),M=H;if(H.cmp(this.m)>=0)M=H.isub(this.m);else if(H.cmpn(0)<0)M=H.iadd(this.m);return M._forceRed(this)},U0.prototype.invm=function(J){var W=this.imod(J._invmp(this.m).mul(this.r2));return W._forceRed(this)}})(typeof Z>"u"||Z,X)}),KK=D0((X,Z)=>{var U=HK(),Q=FK();Z.exports=function(K){return new O(K)};var G={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}};G.p224=G.secp224r1,G.p256=G.secp256r1=G.prime256v1,G.p192=G.secp192r1=G.prime192v1,G.p384=G.secp384r1,G.p521=G.secp521r1;function O(K){if(this.curveType=G[K],!this.curveType)this.curveType={name:K};this.curve=new U.ec(this.curveType.name),this.keys=void 0}O.prototype.generateKeys=function(K,A){return this.keys=this.curve.genKeyPair(),this.getPublicKey(K,A)},O.prototype.computeSecret=function(K,A,D){if(A=A||"utf8",!Buffer.isBuffer(K))K=new Buffer(K,A);var C=this.curve.keyFromPublic(K).getPublic(),z=C.mul(this.keys.getPrivate()).getX();return Y(z,D,this.curveType.byteLength)},O.prototype.getPublicKey=function(K,A){var D=this.keys.getPublic(A==="compressed",!0);if(A==="hybrid")if(D[D.length-1]%2)D[0]=7;else D[0]=6;return Y(D,K)},O.prototype.getPrivateKey=function(K){return Y(this.keys.getPrivate(),K)},O.prototype.setPublicKey=function(K,A){if(A=A||"utf8",!Buffer.isBuffer(K))K=new Buffer(K,A);return this.keys._importPublic(K),this},O.prototype.setPrivateKey=function(K,A){if(A=A||"utf8",!Buffer.isBuffer(K))K=new Buffer(K,A);var D=new Q(K);return D=D.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(D),this};function Y(K,A,D){if(!Array.isArray(K))K=K.toArray();var C=new Buffer(K);if(D&&C.length<D){var z=new Buffer(D-C.length);z.fill(0),C=Buffer.concat([z,C])}if(!A)return C;else return C.toString(A)}}),EK=D0((X,Z)=>{var U=(EZ(),WX(KZ)).createECDH;Z.exports=U||KK()}),zK=D0((X,Z)=>{(function(U,Q){function G(J,W){if(!J)throw Error(W||"Assertion failed")}function O(J,W){J.super_=W;var F=function(){};F.prototype=W.prototype,J.prototype=new F,J.prototype.constructor=J}function Y(J,W,F){if(Y.isBN(J))return J;if(this.negative=0,this.words=null,this.length=0,this.red=null,J!==null){if(W==="le"||W==="be")F=W,W=10;this._init(J||0,W||10,F||"be")}}if(typeof U==="object")U.exports=Y;else Q.BN=Y;Y.BN=Y,Y.wordSize=26;var K;try{if(typeof window<"u"&&typeof window.Buffer<"u")K=window.Buffer;else K=(UZ(),WX(QZ)).Buffer}catch(J){}Y.isBN=function(J){if(J instanceof Y)return!0;return J!==null&&typeof J==="object"&&J.constructor.wordSize===Y.wordSize&&Array.isArray(J.words)},Y.max=function(J,W){if(J.cmp(W)>0)return J;return W},Y.min=function(J,W){if(J.cmp(W)<0)return J;return W},Y.prototype._init=function(J,W,F){if(typeof J==="number")return this._initNumber(J,W,F);if(typeof J==="object")return this._initArray(J,W,F);if(W==="hex")W=16;G(W===(W|0)&&W>=2&&W<=36),J=J.toString().replace(/\s+/g,"");var V=0;if(J[0]==="-")V++,this.negative=1;if(V<J.length){if(W===16)this._parseHex(J,V,F);else if(this._parseBase(J,W,V),F==="le")this._initArray(this.toArray(),W,F)}},Y.prototype._initNumber=function(J,W,F){if(J<0)this.negative=1,J=-J;if(J<67108864)this.words=[J&67108863],this.length=1;else if(J<4503599627370496)this.words=[J&67108863,J/67108864&67108863],this.length=2;else G(J<9007199254740992),this.words=[J&67108863,J/67108864&67108863,1],this.length=3;if(F!=="le")return;this._initArray(this.toArray(),W,F)},Y.prototype._initArray=function(J,W,F){if(G(typeof J.length==="number"),J.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(J.length/3),this.words=Array(this.length);for(var V=0;V<this.length;V++)this.words[V]=0;var H,M,T=0;if(F==="be"){for(V=J.length-1,H=0;V>=0;V-=3)if(M=J[V]|J[V-1]<<8|J[V-2]<<16,this.words[H]|=M<<T&67108863,this.words[H+1]=M>>>26-T&67108863,T+=24,T>=26)T-=26,H++}else if(F==="le"){for(V=0,H=0;V<J.length;V+=3)if(M=J[V]|J[V+1]<<8|J[V+2]<<16,this.words[H]|=M<<T&67108863,this.words[H+1]=M>>>26-T&67108863,T+=24,T>=26)T-=26,H++}return this.strip()};function A(J,W){var F=J.charCodeAt(W);if(F>=65&&F<=70)return F-55;else if(F>=97&&F<=102)return F-87;else return F-48&15}function D(J,W,F){var V=A(J,F);if(F-1>=W)V|=A(J,F-1)<<4;return V}Y.prototype._parseHex=function(J,W,F){this.length=Math.ceil((J.length-W)/6),this.words=Array(this.length);for(var V=0;V<this.length;V++)this.words[V]=0;var H=0,M=0,T;if(F==="be")for(V=J.length-1;V>=W;V-=2)if(T=D(J,W,V)<<H,this.words[M]|=T&67108863,H>=18)H-=18,M+=1,this.words[M]|=T>>>26;else H+=8;else{var E=J.length-W;for(V=E%2===0?W+1:W;V<J.length;V+=2)if(T=D(J,W,V)<<H,this.words[M]|=T&67108863,H>=18)H-=18,M+=1,this.words[M]|=T>>>26;else H+=8}this.strip()};function C(J,W,F,V){var H=0,M=Math.min(J.length,F);for(var T=W;T<M;T++){var E=J.charCodeAt(T)-48;if(H*=V,E>=49)H+=E-49+10;else if(E>=17)H+=E-17+10;else H+=E}return H}Y.prototype._parseBase=function(J,W,F){this.words=[0],this.length=1;for(var V=0,H=1;H<=67108863;H*=W)V++;V--,H=H/W|0;var M=J.length-F,T=M%V,E=Math.min(M,M-T)+F,$=0;for(var q=F;q<E;q+=V)if($=C(J,q,q+V,W),this.imuln(H),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($);if(T!==0){var j=1;$=C(J,q,J.length,W);for(q=0;q<T;q++)j*=W;if(this.imuln(j),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($)}this.strip()},Y.prototype.copy=function(J){J.words=Array(this.length);for(var W=0;W<this.length;W++)J.words[W]=this.words[W];J.length=this.length,J.negative=this.negative,J.red=this.red},Y.prototype.clone=function(){var J=new Y(null);return this.copy(J),J},Y.prototype._expand=function(J){while(this.length<J)this.words[this.length++]=0;return this},Y.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Y.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Y.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var z=["","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],S=[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(Y.prototype.toString=function(J,W){J=J||10,W=W|0||1;var F;if(J===16||J==="hex"){F="";var V=0,H=0;for(var M=0;M<this.length;M++){var T=this.words[M],E=((T<<V|H)&16777215).toString(16);if(H=T>>>24-V&16777215,V+=2,V>=26)V-=26,M--;if(H!==0||M!==this.length-1)F=z[6-E.length]+E+F;else F=E+F}if(H!==0)F=H.toString(16)+F;while(F.length%W!==0)F="0"+F;if(this.negative!==0)F="-"+F;return F}if(J===(J|0)&&J>=2&&J<=36){var $=R[J],q=S[J];F="";var j=this.clone();j.negative=0;while(!j.isZero()){var L=j.modn(q).toString(J);if(j=j.idivn(q),!j.isZero())F=z[$-L.length]+L+F;else F=L+F}if(this.isZero())F="0"+F;while(F.length%W!==0)F="0"+F;if(this.negative!==0)F="-"+F;return F}G(!1,"Base should be between 2 and 36")},Y.prototype.toNumber=function(){var J=this.words[0];if(this.length===2)J+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)J+=4503599627370496+this.words[1]*67108864;else if(this.length>2)G(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-J:J},Y.prototype.toJSON=function(){return this.toString(16)},Y.prototype.toBuffer=function(J,W){return G(typeof K<"u"),this.toArrayLike(K,J,W)},Y.prototype.toArray=function(J,W){return this.toArrayLike(Array,J,W)},Y.prototype.toArrayLike=function(J,W,F){var V=this.byteLength(),H=F||Math.max(1,V);G(V<=H,"byte array longer than desired length"),G(H>0,"Requested array length <= 0"),this.strip();var M=W==="le",T=new J(H),E,$,q=this.clone();if(!M){for($=0;$<H-V;$++)T[$]=0;for($=0;!q.isZero();$++)E=q.andln(255),q.iushrn(8),T[H-$-1]=E}else{for($=0;!q.isZero();$++)E=q.andln(255),q.iushrn(8),T[$]=E;for(;$<H;$++)T[$]=0}return T},Math.clz32)Y.prototype._countBits=function(J){return 32-Math.clz32(J)};else Y.prototype._countBits=function(J){var W=J,F=0;if(W>=4096)F+=13,W>>>=13;if(W>=64)F+=7,W>>>=7;if(W>=8)F+=4,W>>>=4;if(W>=2)F+=2,W>>>=2;return F+W};Y.prototype._zeroBits=function(J){if(J===0)return 26;var W=J,F=0;if((W&8191)===0)F+=13,W>>>=13;if((W&127)===0)F+=7,W>>>=7;if((W&15)===0)F+=4,W>>>=4;if((W&3)===0)F+=2,W>>>=2;if((W&1)===0)F++;return F},Y.prototype.bitLength=function(){var J=this.words[this.length-1],W=this._countBits(J);return(this.length-1)*26+W};function P(J){var W=Array(J.bitLength());for(var F=0;F<W.length;F++){var V=F/26|0,H=F%26;W[F]=(J.words[V]&1<<H)>>>H}return W}Y.prototype.zeroBits=function(){if(this.isZero())return 0;var J=0;for(var W=0;W<this.length;W++){var F=this._zeroBits(this.words[W]);if(J+=F,F!==26)break}return J},Y.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Y.prototype.toTwos=function(J){if(this.negative!==0)return this.abs().inotn(J).iaddn(1);return this.clone()},Y.prototype.fromTwos=function(J){if(this.testn(J-1))return this.notn(J).iaddn(1).ineg();return this.clone()},Y.prototype.isNeg=function(){return this.negative!==0},Y.prototype.neg=function(){return this.clone().ineg()},Y.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Y.prototype.iuor=function(J){while(this.length<J.length)this.words[this.length++]=0;for(var W=0;W<J.length;W++)this.words[W]=this.words[W]|J.words[W];return this.strip()},Y.prototype.ior=function(J){return G((this.negative|J.negative)===0),this.iuor(J)},Y.prototype.or=function(J){if(this.length>J.length)return this.clone().ior(J);return J.clone().ior(this)},Y.prototype.uor=function(J){if(this.length>J.length)return this.clone().iuor(J);return J.clone().iuor(this)},Y.prototype.iuand=function(J){var W;if(this.length>J.length)W=J;else W=this;for(var F=0;F<W.length;F++)this.words[F]=this.words[F]&J.words[F];return this.length=W.length,this.strip()},Y.prototype.iand=function(J){return G((this.negative|J.negative)===0),this.iuand(J)},Y.prototype.and=function(J){if(this.length>J.length)return this.clone().iand(J);return J.clone().iand(this)},Y.prototype.uand=function(J){if(this.length>J.length)return this.clone().iuand(J);return J.clone().iuand(this)},Y.prototype.iuxor=function(J){var W,F;if(this.length>J.length)W=this,F=J;else W=J,F=this;for(var V=0;V<F.length;V++)this.words[V]=W.words[V]^F.words[V];if(this!==W)for(;V<W.length;V++)this.words[V]=W.words[V];return this.length=W.length,this.strip()},Y.prototype.ixor=function(J){return G((this.negative|J.negative)===0),this.iuxor(J)},Y.prototype.xor=function(J){if(this.length>J.length)return this.clone().ixor(J);return J.clone().ixor(this)},Y.prototype.uxor=function(J){if(this.length>J.length)return this.clone().iuxor(J);return J.clone().iuxor(this)},Y.prototype.inotn=function(J){G(typeof J==="number"&&J>=0);var W=Math.ceil(J/26)|0,F=J%26;if(this._expand(W),F>0)W--;for(var V=0;V<W;V++)this.words[V]=~this.words[V]&67108863;if(F>0)this.words[V]=~this.words[V]&67108863>>26-F;return this.strip()},Y.prototype.notn=function(J){return this.clone().inotn(J)},Y.prototype.setn=function(J,W){G(typeof J==="number"&&J>=0);var F=J/26|0,V=J%26;if(this._expand(F+1),W)this.words[F]=this.words[F]|1<<V;else this.words[F]=this.words[F]&~(1<<V);return this.strip()},Y.prototype.iadd=function(J){var W;if(this.negative!==0&&J.negative===0)return this.negative=0,W=this.isub(J),this.negative^=1,this._normSign();else if(this.negative===0&&J.negative!==0)return J.negative=0,W=this.isub(J),J.negative=1,W._normSign();var F,V;if(this.length>J.length)F=this,V=J;else F=J,V=this;var H=0;for(var M=0;M<V.length;M++)W=(F.words[M]|0)+(V.words[M]|0)+H,this.words[M]=W&67108863,H=W>>>26;for(;H!==0&&M<F.length;M++)W=(F.words[M]|0)+H,this.words[M]=W&67108863,H=W>>>26;if(this.length=F.length,H!==0)this.words[this.length]=H,this.length++;else if(F!==this)for(;M<F.length;M++)this.words[M]=F.words[M];return this},Y.prototype.add=function(J){var W;if(J.negative!==0&&this.negative===0)return J.negative=0,W=this.sub(J),J.negative^=1,W;else if(J.negative===0&&this.negative!==0)return this.negative=0,W=J.sub(this),this.negative=1,W;if(this.length>J.length)return this.clone().iadd(J);return J.clone().iadd(this)},Y.prototype.isub=function(J){if(J.negative!==0){J.negative=0;var W=this.iadd(J);return J.negative=1,W._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(J),this.negative=1,this._normSign();var F=this.cmp(J);if(F===0)return this.negative=0,this.length=1,this.words[0]=0,this;var V,H;if(F>0)V=this,H=J;else V=J,H=this;var M=0;for(var T=0;T<H.length;T++)W=(V.words[T]|0)-(H.words[T]|0)+M,M=W>>26,this.words[T]=W&67108863;for(;M!==0&&T<V.length;T++)W=(V.words[T]|0)+M,M=W>>26,this.words[T]=W&67108863;if(M===0&&T<V.length&&V!==this)for(;T<V.length;T++)this.words[T]=V.words[T];if(this.length=Math.max(this.length,T),V!==this)this.negative=1;return this.strip()},Y.prototype.sub=function(J){return this.clone().isub(J)};function N(J,W,F){F.negative=W.negative^J.negative;var V=J.length+W.length|0;F.length=V,V=V-1|0;var H=J.words[0]|0,M=W.words[0]|0,T=H*M,E=T&67108863,$=T/67108864|0;F.words[0]=E;for(var q=1;q<V;q++){var j=$>>>26,L=$&67108863,x=Math.min(q,W.length-1);for(var f=Math.max(0,q-J.length+1);f<=x;f++){var b=q-f|0;H=J.words[b]|0,M=W.words[f]|0,T=H*M+L,j+=T/67108864|0,L=T&67108863}F.words[q]=L|0,$=j|0}if($!==0)F.words[q]=$|0;else F.length--;return F.strip()}var I=function(J,W,F){var V=J.words,H=W.words,M=F.words,T=0,E,$,q,j=V[0]|0,L=j&8191,x=j>>>13,f=V[1]|0,b=f&8191,s=f>>>13,z0=V[2]|0,i=z0&8191,o=z0>>>13,W0=V[3]|0,r=W0&8191,X0=W0>>>13,d0=V[4]|0,c=d0&8191,m=d0>>>13,E0=V[5]|0,Z0=E0&8191,$0=E0>>>13,N0=V[6]|0,d=N0&8191,t=N0>>>13,l0=V[7]|0,e=l0&8191,F0=l0>>>13,ZX=V[8]|0,T0=ZX&8191,R0=ZX>>>13,kX=V[9]|0,C0=kX&8191,P0=kX>>>13,_X=H[0]|0,I0=_X&8191,L0=_X>>>13,HZ=H[1]|0,B0=HZ&8191,y0=HZ>>>13,FZ=H[2]|0,f0=FZ&8191,k0=FZ>>>13,$Z=H[3]|0,g0=$Z&8191,x0=$Z>>>13,tX=H[4]|0,h0=tX&8191,p0=tX>>>13,iX=H[5]|0,w0=iX&8191,y=iX>>>13,n=H[6]|0,Y0=n&8191,O0=n>>>13,n0=H[7]|0,A0=n0&8191,S0=n0>>>13,xX=H[8]|0,v0=xX&8191,c0=xX>>>13,GZ=H[9]|0,_0=GZ&8191,j0=GZ>>>13;F.negative=J.negative^W.negative,F.length=19,E=Math.imul(L,I0),$=Math.imul(L,L0),$=$+Math.imul(x,I0)|0,q=Math.imul(x,L0);var wX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(wX>>>26)|0,wX&=67108863,E=Math.imul(b,I0),$=Math.imul(b,L0),$=$+Math.imul(s,I0)|0,q=Math.imul(s,L0),E=E+Math.imul(L,B0)|0,$=$+Math.imul(L,y0)|0,$=$+Math.imul(x,B0)|0,q=q+Math.imul(x,y0)|0;var $X=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+($X>>>26)|0,$X&=67108863,E=Math.imul(i,I0),$=Math.imul(i,L0),$=$+Math.imul(o,I0)|0,q=Math.imul(o,L0),E=E+Math.imul(b,B0)|0,$=$+Math.imul(b,y0)|0,$=$+Math.imul(s,B0)|0,q=q+Math.imul(s,y0)|0,E=E+Math.imul(L,f0)|0,$=$+Math.imul(L,k0)|0,$=$+Math.imul(x,f0)|0,q=q+Math.imul(x,k0)|0;var JX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(JX>>>26)|0,JX&=67108863,E=Math.imul(r,I0),$=Math.imul(r,L0),$=$+Math.imul(X0,I0)|0,q=Math.imul(X0,L0),E=E+Math.imul(i,B0)|0,$=$+Math.imul(i,y0)|0,$=$+Math.imul(o,B0)|0,q=q+Math.imul(o,y0)|0,E=E+Math.imul(b,f0)|0,$=$+Math.imul(b,k0)|0,$=$+Math.imul(s,f0)|0,q=q+Math.imul(s,k0)|0,E=E+Math.imul(L,g0)|0,$=$+Math.imul(L,x0)|0,$=$+Math.imul(x,g0)|0,q=q+Math.imul(x,x0)|0;var TX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(TX>>>26)|0,TX&=67108863,E=Math.imul(c,I0),$=Math.imul(c,L0),$=$+Math.imul(m,I0)|0,q=Math.imul(m,L0),E=E+Math.imul(r,B0)|0,$=$+Math.imul(r,y0)|0,$=$+Math.imul(X0,B0)|0,q=q+Math.imul(X0,y0)|0,E=E+Math.imul(i,f0)|0,$=$+Math.imul(i,k0)|0,$=$+Math.imul(o,f0)|0,q=q+Math.imul(o,k0)|0,E=E+Math.imul(b,g0)|0,$=$+Math.imul(b,x0)|0,$=$+Math.imul(s,g0)|0,q=q+Math.imul(s,x0)|0,E=E+Math.imul(L,h0)|0,$=$+Math.imul(L,p0)|0,$=$+Math.imul(x,h0)|0,q=q+Math.imul(x,p0)|0;var AX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(AX>>>26)|0,AX&=67108863,E=Math.imul(Z0,I0),$=Math.imul(Z0,L0),$=$+Math.imul($0,I0)|0,q=Math.imul($0,L0),E=E+Math.imul(c,B0)|0,$=$+Math.imul(c,y0)|0,$=$+Math.imul(m,B0)|0,q=q+Math.imul(m,y0)|0,E=E+Math.imul(r,f0)|0,$=$+Math.imul(r,k0)|0,$=$+Math.imul(X0,f0)|0,q=q+Math.imul(X0,k0)|0,E=E+Math.imul(i,g0)|0,$=$+Math.imul(i,x0)|0,$=$+Math.imul(o,g0)|0,q=q+Math.imul(o,x0)|0,E=E+Math.imul(b,h0)|0,$=$+Math.imul(b,p0)|0,$=$+Math.imul(s,h0)|0,q=q+Math.imul(s,p0)|0,E=E+Math.imul(L,w0)|0,$=$+Math.imul(L,y)|0,$=$+Math.imul(x,w0)|0,q=q+Math.imul(x,y)|0;var fX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(fX>>>26)|0,fX&=67108863,E=Math.imul(d,I0),$=Math.imul(d,L0),$=$+Math.imul(t,I0)|0,q=Math.imul(t,L0),E=E+Math.imul(Z0,B0)|0,$=$+Math.imul(Z0,y0)|0,$=$+Math.imul($0,B0)|0,q=q+Math.imul($0,y0)|0,E=E+Math.imul(c,f0)|0,$=$+Math.imul(c,k0)|0,$=$+Math.imul(m,f0)|0,q=q+Math.imul(m,k0)|0,E=E+Math.imul(r,g0)|0,$=$+Math.imul(r,x0)|0,$=$+Math.imul(X0,g0)|0,q=q+Math.imul(X0,x0)|0,E=E+Math.imul(i,h0)|0,$=$+Math.imul(i,p0)|0,$=$+Math.imul(o,h0)|0,q=q+Math.imul(o,p0)|0,E=E+Math.imul(b,w0)|0,$=$+Math.imul(b,y)|0,$=$+Math.imul(s,w0)|0,q=q+Math.imul(s,y)|0,E=E+Math.imul(L,Y0)|0,$=$+Math.imul(L,O0)|0,$=$+Math.imul(x,Y0)|0,q=q+Math.imul(x,O0)|0;var gX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(gX>>>26)|0,gX&=67108863,E=Math.imul(e,I0),$=Math.imul(e,L0),$=$+Math.imul(F0,I0)|0,q=Math.imul(F0,L0),E=E+Math.imul(d,B0)|0,$=$+Math.imul(d,y0)|0,$=$+Math.imul(t,B0)|0,q=q+Math.imul(t,y0)|0,E=E+Math.imul(Z0,f0)|0,$=$+Math.imul(Z0,k0)|0,$=$+Math.imul($0,f0)|0,q=q+Math.imul($0,k0)|0,E=E+Math.imul(c,g0)|0,$=$+Math.imul(c,x0)|0,$=$+Math.imul(m,g0)|0,q=q+Math.imul(m,x0)|0,E=E+Math.imul(r,h0)|0,$=$+Math.imul(r,p0)|0,$=$+Math.imul(X0,h0)|0,q=q+Math.imul(X0,p0)|0,E=E+Math.imul(i,w0)|0,$=$+Math.imul(i,y)|0,$=$+Math.imul(o,w0)|0,q=q+Math.imul(o,y)|0,E=E+Math.imul(b,Y0)|0,$=$+Math.imul(b,O0)|0,$=$+Math.imul(s,Y0)|0,q=q+Math.imul(s,O0)|0,E=E+Math.imul(L,A0)|0,$=$+Math.imul(L,S0)|0,$=$+Math.imul(x,A0)|0,q=q+Math.imul(x,S0)|0;var hX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(hX>>>26)|0,hX&=67108863,E=Math.imul(T0,I0),$=Math.imul(T0,L0),$=$+Math.imul(R0,I0)|0,q=Math.imul(R0,L0),E=E+Math.imul(e,B0)|0,$=$+Math.imul(e,y0)|0,$=$+Math.imul(F0,B0)|0,q=q+Math.imul(F0,y0)|0,E=E+Math.imul(d,f0)|0,$=$+Math.imul(d,k0)|0,$=$+Math.imul(t,f0)|0,q=q+Math.imul(t,k0)|0,E=E+Math.imul(Z0,g0)|0,$=$+Math.imul(Z0,x0)|0,$=$+Math.imul($0,g0)|0,q=q+Math.imul($0,x0)|0,E=E+Math.imul(c,h0)|0,$=$+Math.imul(c,p0)|0,$=$+Math.imul(m,h0)|0,q=q+Math.imul(m,p0)|0,E=E+Math.imul(r,w0)|0,$=$+Math.imul(r,y)|0,$=$+Math.imul(X0,w0)|0,q=q+Math.imul(X0,y)|0,E=E+Math.imul(i,Y0)|0,$=$+Math.imul(i,O0)|0,$=$+Math.imul(o,Y0)|0,q=q+Math.imul(o,O0)|0,E=E+Math.imul(b,A0)|0,$=$+Math.imul(b,S0)|0,$=$+Math.imul(s,A0)|0,q=q+Math.imul(s,S0)|0,E=E+Math.imul(L,v0)|0,$=$+Math.imul(L,c0)|0,$=$+Math.imul(x,v0)|0,q=q+Math.imul(x,c0)|0;var pX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(pX>>>26)|0,pX&=67108863,E=Math.imul(C0,I0),$=Math.imul(C0,L0),$=$+Math.imul(P0,I0)|0,q=Math.imul(P0,L0),E=E+Math.imul(T0,B0)|0,$=$+Math.imul(T0,y0)|0,$=$+Math.imul(R0,B0)|0,q=q+Math.imul(R0,y0)|0,E=E+Math.imul(e,f0)|0,$=$+Math.imul(e,k0)|0,$=$+Math.imul(F0,f0)|0,q=q+Math.imul(F0,k0)|0,E=E+Math.imul(d,g0)|0,$=$+Math.imul(d,x0)|0,$=$+Math.imul(t,g0)|0,q=q+Math.imul(t,x0)|0,E=E+Math.imul(Z0,h0)|0,$=$+Math.imul(Z0,p0)|0,$=$+Math.imul($0,h0)|0,q=q+Math.imul($0,p0)|0,E=E+Math.imul(c,w0)|0,$=$+Math.imul(c,y)|0,$=$+Math.imul(m,w0)|0,q=q+Math.imul(m,y)|0,E=E+Math.imul(r,Y0)|0,$=$+Math.imul(r,O0)|0,$=$+Math.imul(X0,Y0)|0,q=q+Math.imul(X0,O0)|0,E=E+Math.imul(i,A0)|0,$=$+Math.imul(i,S0)|0,$=$+Math.imul(o,A0)|0,q=q+Math.imul(o,S0)|0,E=E+Math.imul(b,v0)|0,$=$+Math.imul(b,c0)|0,$=$+Math.imul(s,v0)|0,q=q+Math.imul(s,c0)|0,E=E+Math.imul(L,_0)|0,$=$+Math.imul(L,j0)|0,$=$+Math.imul(x,_0)|0,q=q+Math.imul(x,j0)|0;var cX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(cX>>>26)|0,cX&=67108863,E=Math.imul(C0,B0),$=Math.imul(C0,y0),$=$+Math.imul(P0,B0)|0,q=Math.imul(P0,y0),E=E+Math.imul(T0,f0)|0,$=$+Math.imul(T0,k0)|0,$=$+Math.imul(R0,f0)|0,q=q+Math.imul(R0,k0)|0,E=E+Math.imul(e,g0)|0,$=$+Math.imul(e,x0)|0,$=$+Math.imul(F0,g0)|0,q=q+Math.imul(F0,x0)|0,E=E+Math.imul(d,h0)|0,$=$+Math.imul(d,p0)|0,$=$+Math.imul(t,h0)|0,q=q+Math.imul(t,p0)|0,E=E+Math.imul(Z0,w0)|0,$=$+Math.imul(Z0,y)|0,$=$+Math.imul($0,w0)|0,q=q+Math.imul($0,y)|0,E=E+Math.imul(c,Y0)|0,$=$+Math.imul(c,O0)|0,$=$+Math.imul(m,Y0)|0,q=q+Math.imul(m,O0)|0,E=E+Math.imul(r,A0)|0,$=$+Math.imul(r,S0)|0,$=$+Math.imul(X0,A0)|0,q=q+Math.imul(X0,S0)|0,E=E+Math.imul(i,v0)|0,$=$+Math.imul(i,c0)|0,$=$+Math.imul(o,v0)|0,q=q+Math.imul(o,c0)|0,E=E+Math.imul(b,_0)|0,$=$+Math.imul(b,j0)|0,$=$+Math.imul(s,_0)|0,q=q+Math.imul(s,j0)|0;var uX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(uX>>>26)|0,uX&=67108863,E=Math.imul(C0,f0),$=Math.imul(C0,k0),$=$+Math.imul(P0,f0)|0,q=Math.imul(P0,k0),E=E+Math.imul(T0,g0)|0,$=$+Math.imul(T0,x0)|0,$=$+Math.imul(R0,g0)|0,q=q+Math.imul(R0,x0)|0,E=E+Math.imul(e,h0)|0,$=$+Math.imul(e,p0)|0,$=$+Math.imul(F0,h0)|0,q=q+Math.imul(F0,p0)|0,E=E+Math.imul(d,w0)|0,$=$+Math.imul(d,y)|0,$=$+Math.imul(t,w0)|0,q=q+Math.imul(t,y)|0,E=E+Math.imul(Z0,Y0)|0,$=$+Math.imul(Z0,O0)|0,$=$+Math.imul($0,Y0)|0,q=q+Math.imul($0,O0)|0,E=E+Math.imul(c,A0)|0,$=$+Math.imul(c,S0)|0,$=$+Math.imul(m,A0)|0,q=q+Math.imul(m,S0)|0,E=E+Math.imul(r,v0)|0,$=$+Math.imul(r,c0)|0,$=$+Math.imul(X0,v0)|0,q=q+Math.imul(X0,c0)|0,E=E+Math.imul(i,_0)|0,$=$+Math.imul(i,j0)|0,$=$+Math.imul(o,_0)|0,q=q+Math.imul(o,j0)|0;var bX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(bX>>>26)|0,bX&=67108863,E=Math.imul(C0,g0),$=Math.imul(C0,x0),$=$+Math.imul(P0,g0)|0,q=Math.imul(P0,x0),E=E+Math.imul(T0,h0)|0,$=$+Math.imul(T0,p0)|0,$=$+Math.imul(R0,h0)|0,q=q+Math.imul(R0,p0)|0,E=E+Math.imul(e,w0)|0,$=$+Math.imul(e,y)|0,$=$+Math.imul(F0,w0)|0,q=q+Math.imul(F0,y)|0,E=E+Math.imul(d,Y0)|0,$=$+Math.imul(d,O0)|0,$=$+Math.imul(t,Y0)|0,q=q+Math.imul(t,O0)|0,E=E+Math.imul(Z0,A0)|0,$=$+Math.imul(Z0,S0)|0,$=$+Math.imul($0,A0)|0,q=q+Math.imul($0,S0)|0,E=E+Math.imul(c,v0)|0,$=$+Math.imul(c,c0)|0,$=$+Math.imul(m,v0)|0,q=q+Math.imul(m,c0)|0,E=E+Math.imul(r,_0)|0,$=$+Math.imul(r,j0)|0,$=$+Math.imul(X0,_0)|0,q=q+Math.imul(X0,j0)|0;var dX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(dX>>>26)|0,dX&=67108863,E=Math.imul(C0,h0),$=Math.imul(C0,p0),$=$+Math.imul(P0,h0)|0,q=Math.imul(P0,p0),E=E+Math.imul(T0,w0)|0,$=$+Math.imul(T0,y)|0,$=$+Math.imul(R0,w0)|0,q=q+Math.imul(R0,y)|0,E=E+Math.imul(e,Y0)|0,$=$+Math.imul(e,O0)|0,$=$+Math.imul(F0,Y0)|0,q=q+Math.imul(F0,O0)|0,E=E+Math.imul(d,A0)|0,$=$+Math.imul(d,S0)|0,$=$+Math.imul(t,A0)|0,q=q+Math.imul(t,S0)|0,E=E+Math.imul(Z0,v0)|0,$=$+Math.imul(Z0,c0)|0,$=$+Math.imul($0,v0)|0,q=q+Math.imul($0,c0)|0,E=E+Math.imul(c,_0)|0,$=$+Math.imul(c,j0)|0,$=$+Math.imul(m,_0)|0,q=q+Math.imul(m,j0)|0;var lX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(lX>>>26)|0,lX&=67108863,E=Math.imul(C0,w0),$=Math.imul(C0,y),$=$+Math.imul(P0,w0)|0,q=Math.imul(P0,y),E=E+Math.imul(T0,Y0)|0,$=$+Math.imul(T0,O0)|0,$=$+Math.imul(R0,Y0)|0,q=q+Math.imul(R0,O0)|0,E=E+Math.imul(e,A0)|0,$=$+Math.imul(e,S0)|0,$=$+Math.imul(F0,A0)|0,q=q+Math.imul(F0,S0)|0,E=E+Math.imul(d,v0)|0,$=$+Math.imul(d,c0)|0,$=$+Math.imul(t,v0)|0,q=q+Math.imul(t,c0)|0,E=E+Math.imul(Z0,_0)|0,$=$+Math.imul(Z0,j0)|0,$=$+Math.imul($0,_0)|0,q=q+Math.imul($0,j0)|0;var mX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(mX>>>26)|0,mX&=67108863,E=Math.imul(C0,Y0),$=Math.imul(C0,O0),$=$+Math.imul(P0,Y0)|0,q=Math.imul(P0,O0),E=E+Math.imul(T0,A0)|0,$=$+Math.imul(T0,S0)|0,$=$+Math.imul(R0,A0)|0,q=q+Math.imul(R0,S0)|0,E=E+Math.imul(e,v0)|0,$=$+Math.imul(e,c0)|0,$=$+Math.imul(F0,v0)|0,q=q+Math.imul(F0,c0)|0,E=E+Math.imul(d,_0)|0,$=$+Math.imul(d,j0)|0,$=$+Math.imul(t,_0)|0,q=q+Math.imul(t,j0)|0;var oX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(oX>>>26)|0,oX&=67108863,E=Math.imul(C0,A0),$=Math.imul(C0,S0),$=$+Math.imul(P0,A0)|0,q=Math.imul(P0,S0),E=E+Math.imul(T0,v0)|0,$=$+Math.imul(T0,c0)|0,$=$+Math.imul(R0,v0)|0,q=q+Math.imul(R0,c0)|0,E=E+Math.imul(e,_0)|0,$=$+Math.imul(e,j0)|0,$=$+Math.imul(F0,_0)|0,q=q+Math.imul(F0,j0)|0;var nX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(nX>>>26)|0,nX&=67108863,E=Math.imul(C0,v0),$=Math.imul(C0,c0),$=$+Math.imul(P0,v0)|0,q=Math.imul(P0,c0),E=E+Math.imul(T0,_0)|0,$=$+Math.imul(T0,j0)|0,$=$+Math.imul(R0,_0)|0,q=q+Math.imul(R0,j0)|0;var sX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(sX>>>26)|0,sX&=67108863,E=Math.imul(C0,_0),$=Math.imul(C0,j0),$=$+Math.imul(P0,_0)|0,q=Math.imul(P0,j0);var rX=(T+E|0)+(($&8191)<<13)|0;if(T=(q+($>>>13)|0)+(rX>>>26)|0,rX&=67108863,M[0]=wX,M[1]=$X,M[2]=JX,M[3]=TX,M[4]=AX,M[5]=fX,M[6]=gX,M[7]=hX,M[8]=pX,M[9]=cX,M[10]=uX,M[11]=bX,M[12]=dX,M[13]=lX,M[14]=mX,M[15]=oX,M[16]=nX,M[17]=sX,M[18]=rX,T!==0)M[19]=T,F.length++;return F};if(!Math.imul)I=N;function B(J,W,F){F.negative=W.negative^J.negative,F.length=J.length+W.length;var V=0,H=0;for(var M=0;M<F.length-1;M++){var T=H;H=0;var E=V&67108863,$=Math.min(M,W.length-1);for(var q=Math.max(0,M-J.length+1);q<=$;q++){var j=M-q,L=J.words[j]|0,x=W.words[q]|0,f=L*x,b=f&67108863;T=T+(f/67108864|0)|0,b=b+E|0,E=b&67108863,T=T+(b>>>26)|0,H+=T>>>26,T&=67108863}F.words[M]=E,V=T,T=H}if(V!==0)F.words[M]=V;else F.length--;return F.strip()}function k(J,W,F){var V=new w;return V.mulp(J,W,F)}Y.prototype.mulTo=function(J,W){var F,V=this.length+J.length;if(this.length===10&&J.length===10)F=I(this,J,W);else if(V<63)F=N(this,J,W);else if(V<1024)F=B(this,J,W);else F=k(this,J,W);return F};function w(J,W){this.x=J,this.y=W}w.prototype.makeRBT=function(J){var W=Array(J),F=Y.prototype._countBits(J)-1;for(var V=0;V<J;V++)W[V]=this.revBin(V,F,J);return W},w.prototype.revBin=function(J,W,F){if(J===0||J===F-1)return J;var V=0;for(var H=0;H<W;H++)V|=(J&1)<<W-H-1,J>>=1;return V},w.prototype.permute=function(J,W,F,V,H,M){for(var T=0;T<M;T++)V[T]=W[J[T]],H[T]=F[J[T]]},w.prototype.transform=function(J,W,F,V,H,M){this.permute(M,J,W,F,V,H);for(var T=1;T<H;T<<=1){var E=T<<1,$=Math.cos(2*Math.PI/E),q=Math.sin(2*Math.PI/E);for(var j=0;j<H;j+=E){var L=$,x=q;for(var f=0;f<T;f++){var b=F[j+f],s=V[j+f],z0=F[j+f+T],i=V[j+f+T],o=L*z0-x*i;if(i=L*i+x*z0,z0=o,F[j+f]=b+z0,V[j+f]=s+i,F[j+f+T]=b-z0,V[j+f+T]=s-i,f!==E)o=$*L-q*x,x=$*x+q*L,L=o}}}},w.prototype.guessLen13b=function(J,W){var F=Math.max(W,J)|1,V=F&1,H=0;for(F=F/2|0;F;F=F>>>1)H++;return 1<<H+1+V},w.prototype.conjugate=function(J,W,F){if(F<=1)return;for(var V=0;V<F/2;V++){var H=J[V];J[V]=J[F-V-1],J[F-V-1]=H,H=W[V],W[V]=-W[F-V-1],W[F-V-1]=-H}},w.prototype.normalize13b=function(J,W){var F=0;for(var V=0;V<W/2;V++){var H=Math.round(J[2*V+1]/W)*8192+Math.round(J[2*V]/W)+F;if(J[V]=H&67108863,H<67108864)F=0;else F=H/67108864|0}return J},w.prototype.convert13b=function(J,W,F,V){var H=0;for(var M=0;M<W;M++)H=H+(J[M]|0),F[2*M]=H&8191,H=H>>>13,F[2*M+1]=H&8191,H=H>>>13;for(M=2*W;M<V;++M)F[M]=0;G(H===0),G((H&-8192)===0)},w.prototype.stub=function(J){var W=Array(J);for(var F=0;F<J;F++)W[F]=0;return W},w.prototype.mulp=function(J,W,F){var V=2*this.guessLen13b(J.length,W.length),H=this.makeRBT(V),M=this.stub(V),T=Array(V),E=Array(V),$=Array(V),q=Array(V),j=Array(V),L=Array(V),x=F.words;x.length=V,this.convert13b(J.words,J.length,T,V),this.convert13b(W.words,W.length,q,V),this.transform(T,M,E,$,V,H),this.transform(q,M,j,L,V,H);for(var f=0;f<V;f++){var b=E[f]*j[f]-$[f]*L[f];$[f]=E[f]*L[f]+$[f]*j[f],E[f]=b}return this.conjugate(E,$,V),this.transform(E,$,x,M,V,H),this.conjugate(x,M,V),this.normalize13b(x,V),F.negative=J.negative^W.negative,F.length=J.length+W.length,F.strip()},Y.prototype.mul=function(J){var W=new Y(null);return W.words=Array(this.length+J.length),this.mulTo(J,W)},Y.prototype.mulf=function(J){var W=new Y(null);return W.words=Array(this.length+J.length),k(this,J,W)},Y.prototype.imul=function(J){return this.clone().mulTo(J,this)},Y.prototype.imuln=function(J){G(typeof J==="number"),G(J<67108864);var W=0;for(var F=0;F<this.length;F++){var V=(this.words[F]|0)*J,H=(V&67108863)+(W&67108863);W>>=26,W+=V/67108864|0,W+=H>>>26,this.words[F]=H&67108863}if(W!==0)this.words[F]=W,this.length++;return this.length=J===0?1:this.length,this},Y.prototype.muln=function(J){return this.clone().imuln(J)},Y.prototype.sqr=function(){return this.mul(this)},Y.prototype.isqr=function(){return this.imul(this.clone())},Y.prototype.pow=function(J){var W=P(J);if(W.length===0)return new Y(1);var F=this;for(var V=0;V<W.length;V++,F=F.sqr())if(W[V]!==0)break;if(++V<W.length)for(var H=F.sqr();V<W.length;V++,H=H.sqr()){if(W[V]===0)continue;F=F.mul(H)}return F},Y.prototype.iushln=function(J){G(typeof J==="number"&&J>=0);var W=J%26,F=(J-W)/26,V=67108863>>>26-W<<26-W,H;if(W!==0){var M=0;for(H=0;H<this.length;H++){var T=this.words[H]&V,E=(this.words[H]|0)-T<<W;this.words[H]=E|M,M=T>>>26-W}if(M)this.words[H]=M,this.length++}if(F!==0){for(H=this.length-1;H>=0;H--)this.words[H+F]=this.words[H];for(H=0;H<F;H++)this.words[H]=0;this.length+=F}return this.strip()},Y.prototype.ishln=function(J){return G(this.negative===0),this.iushln(J)},Y.prototype.iushrn=function(J,W,F){G(typeof J==="number"&&J>=0);var V;if(W)V=(W-W%26)/26;else V=0;var H=J%26,M=Math.min((J-H)/26,this.length),T=67108863^67108863>>>H<<H,E=F;if(V-=M,V=Math.max(0,V),E){for(var $=0;$<M;$++)E.words[$]=this.words[$];E.length=M}if(M===0);else if(this.length>M){this.length-=M;for($=0;$<this.length;$++)this.words[$]=this.words[$+M]}else this.words[0]=0,this.length=1;var q=0;for($=this.length-1;$>=0&&(q!==0||$>=V);$--){var j=this.words[$]|0;this.words[$]=q<<26-H|j>>>H,q=j&T}if(E&&q!==0)E.words[E.length++]=q;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Y.prototype.ishrn=function(J,W,F){return G(this.negative===0),this.iushrn(J,W,F)},Y.prototype.shln=function(J){return this.clone().ishln(J)},Y.prototype.ushln=function(J){return this.clone().iushln(J)},Y.prototype.shrn=function(J){return this.clone().ishrn(J)},Y.prototype.ushrn=function(J){return this.clone().iushrn(J)},Y.prototype.testn=function(J){G(typeof J==="number"&&J>=0);var W=J%26,F=(J-W)/26,V=1<<W;if(this.length<=F)return!1;var H=this.words[F];return!!(H&V)},Y.prototype.imaskn=function(J){G(typeof J==="number"&&J>=0);var W=J%26,F=(J-W)/26;if(G(this.negative===0,"imaskn works only with positive numbers"),this.length<=F)return this;if(W!==0)F++;if(this.length=Math.min(F,this.length),W!==0){var V=67108863^67108863>>>W<<W;this.words[this.length-1]&=V}return this.strip()},Y.prototype.maskn=function(J){return this.clone().imaskn(J)},Y.prototype.iaddn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.isubn(-J);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<J)return this.words[0]=J-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(J),this.negative=1,this}return this._iaddn(J)},Y.prototype._iaddn=function(J){this.words[0]+=J;for(var W=0;W<this.length&&this.words[W]>=67108864;W++)if(this.words[W]-=67108864,W===this.length-1)this.words[W+1]=1;else this.words[W+1]++;return this.length=Math.max(this.length,W+1),this},Y.prototype.isubn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.iaddn(-J);if(this.negative!==0)return this.negative=0,this.iaddn(J),this.negative=1,this;if(this.words[0]-=J,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var W=0;W<this.length&&this.words[W]<0;W++)this.words[W]+=67108864,this.words[W+1]-=1;return this.strip()},Y.prototype.addn=function(J){return this.clone().iaddn(J)},Y.prototype.subn=function(J){return this.clone().isubn(J)},Y.prototype.iabs=function(){return this.negative=0,this},Y.prototype.abs=function(){return this.clone().iabs()},Y.prototype._ishlnsubmul=function(J,W,F){var V=J.length+F,H;this._expand(V);var M,T=0;for(H=0;H<J.length;H++){M=(this.words[H+F]|0)+T;var E=(J.words[H]|0)*W;M-=E&67108863,T=(M>>26)-(E/67108864|0),this.words[H+F]=M&67108863}for(;H<this.length-F;H++)M=(this.words[H+F]|0)+T,T=M>>26,this.words[H+F]=M&67108863;if(T===0)return this.strip();G(T===-1),T=0;for(H=0;H<this.length;H++)M=-(this.words[H]|0)+T,T=M>>26,this.words[H]=M&67108863;return this.negative=1,this.strip()},Y.prototype._wordDiv=function(J,W){var F=this.length-J.length,V=this.clone(),H=J,M=H.words[H.length-1]|0,T=this._countBits(M);if(F=26-T,F!==0)H=H.ushln(F),V.iushln(F),M=H.words[H.length-1]|0;var E=V.length-H.length,$;if(W!=="mod"){$=new Y(null),$.length=E+1,$.words=Array($.length);for(var q=0;q<$.length;q++)$.words[q]=0}var j=V.clone()._ishlnsubmul(H,1,E);if(j.negative===0){if(V=j,$)$.words[E]=1}for(var L=E-1;L>=0;L--){var x=(V.words[H.length+L]|0)*67108864+(V.words[H.length+L-1]|0);x=Math.min(x/M|0,67108863),V._ishlnsubmul(H,x,L);while(V.negative!==0)if(x--,V.negative=0,V._ishlnsubmul(H,1,L),!V.isZero())V.negative^=1;if($)$.words[L]=x}if($)$.strip();if(V.strip(),W!=="div"&&F!==0)V.iushrn(F);return{div:$||null,mod:V}},Y.prototype.divmod=function(J,W,F){if(G(!J.isZero()),this.isZero())return{div:new Y(0),mod:new Y(0)};var V,H,M;if(this.negative!==0&&J.negative===0){if(M=this.neg().divmod(J,W),W!=="mod")V=M.div.neg();if(W!=="div"){if(H=M.mod.neg(),F&&H.negative!==0)H.iadd(J)}return{div:V,mod:H}}if(this.negative===0&&J.negative!==0){if(M=this.divmod(J.neg(),W),W!=="mod")V=M.div.neg();return{div:V,mod:M.mod}}if((this.negative&J.negative)!==0){if(M=this.neg().divmod(J.neg(),W),W!=="div"){if(H=M.mod.neg(),F&&H.negative!==0)H.isub(J)}return{div:M.div,mod:H}}if(J.length>this.length||this.cmp(J)<0)return{div:new Y(0),mod:this};if(J.length===1){if(W==="div")return{div:this.divn(J.words[0]),mod:null};if(W==="mod")return{div:null,mod:new Y(this.modn(J.words[0]))};return{div:this.divn(J.words[0]),mod:new Y(this.modn(J.words[0]))}}return this._wordDiv(J,W)},Y.prototype.div=function(J){return this.divmod(J,"div",!1).div},Y.prototype.mod=function(J){return this.divmod(J,"mod",!1).mod},Y.prototype.umod=function(J){return this.divmod(J,"mod",!0).mod},Y.prototype.divRound=function(J){var W=this.divmod(J);if(W.mod.isZero())return W.div;var F=W.div.negative!==0?W.mod.isub(J):W.mod,V=J.ushrn(1),H=J.andln(1),M=F.cmp(V);if(M<0||H===1&&M===0)return W.div;return W.div.negative!==0?W.div.isubn(1):W.div.iaddn(1)},Y.prototype.modn=function(J){G(J<=67108863);var W=67108864%J,F=0;for(var V=this.length-1;V>=0;V--)F=(W*F+(this.words[V]|0))%J;return F},Y.prototype.idivn=function(J){G(J<=67108863);var W=0;for(var F=this.length-1;F>=0;F--){var V=(this.words[F]|0)+W*67108864;this.words[F]=V/J|0,W=V%J}return this.strip()},Y.prototype.divn=function(J){return this.clone().idivn(J)},Y.prototype.egcd=function(J){G(J.negative===0),G(!J.isZero());var W=this,F=J.clone();if(W.negative!==0)W=W.umod(J);else W=W.clone();var V=new Y(1),H=new Y(0),M=new Y(0),T=new Y(1),E=0;while(W.isEven()&&F.isEven())W.iushrn(1),F.iushrn(1),++E;var $=F.clone(),q=W.clone();while(!W.isZero()){for(var j=0,L=1;(W.words[0]&L)===0&&j<26;++j,L<<=1);if(j>0){W.iushrn(j);while(j-- >0){if(V.isOdd()||H.isOdd())V.iadd($),H.isub(q);V.iushrn(1),H.iushrn(1)}}for(var x=0,f=1;(F.words[0]&f)===0&&x<26;++x,f<<=1);if(x>0){F.iushrn(x);while(x-- >0){if(M.isOdd()||T.isOdd())M.iadd($),T.isub(q);M.iushrn(1),T.iushrn(1)}}if(W.cmp(F)>=0)W.isub(F),V.isub(M),H.isub(T);else F.isub(W),M.isub(V),T.isub(H)}return{a:M,b:T,gcd:F.iushln(E)}},Y.prototype._invmp=function(J){G(J.negative===0),G(!J.isZero());var W=this,F=J.clone();if(W.negative!==0)W=W.umod(J);else W=W.clone();var V=new Y(1),H=new Y(0),M=F.clone();while(W.cmpn(1)>0&&F.cmpn(1)>0){for(var T=0,E=1;(W.words[0]&E)===0&&T<26;++T,E<<=1);if(T>0){W.iushrn(T);while(T-- >0){if(V.isOdd())V.iadd(M);V.iushrn(1)}}for(var $=0,q=1;(F.words[0]&q)===0&&$<26;++$,q<<=1);if($>0){F.iushrn($);while($-- >0){if(H.isOdd())H.iadd(M);H.iushrn(1)}}if(W.cmp(F)>=0)W.isub(F),V.isub(H);else F.isub(W),H.isub(V)}var j;if(W.cmpn(1)===0)j=V;else j=H;if(j.cmpn(0)<0)j.iadd(J);return j},Y.prototype.gcd=function(J){if(this.isZero())return J.abs();if(J.isZero())return this.abs();var W=this.clone(),F=J.clone();W.negative=0,F.negative=0;for(var V=0;W.isEven()&&F.isEven();V++)W.iushrn(1),F.iushrn(1);do{while(W.isEven())W.iushrn(1);while(F.isEven())F.iushrn(1);var H=W.cmp(F);if(H<0){var M=W;W=F,F=M}else if(H===0||F.cmpn(1)===0)break;W.isub(F)}while(!0);return F.iushln(V)},Y.prototype.invm=function(J){return this.egcd(J).a.umod(J)},Y.prototype.isEven=function(){return(this.words[0]&1)===0},Y.prototype.isOdd=function(){return(this.words[0]&1)===1},Y.prototype.andln=function(J){return this.words[0]&J},Y.prototype.bincn=function(J){G(typeof J==="number");var W=J%26,F=(J-W)/26,V=1<<W;if(this.length<=F)return this._expand(F+1),this.words[F]|=V,this;var H=V;for(var M=F;H!==0&&M<this.length;M++){var T=this.words[M]|0;T+=H,H=T>>>26,T&=67108863,this.words[M]=T}if(H!==0)this.words[M]=H,this.length++;return this},Y.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Y.prototype.cmpn=function(J){var W=J<0;if(this.negative!==0&&!W)return-1;if(this.negative===0&&W)return 1;this.strip();var F;if(this.length>1)F=1;else{if(W)J=-J;G(J<=67108863,"Number is too big");var V=this.words[0]|0;F=V===J?0:V<J?-1:1}if(this.negative!==0)return-F|0;return F},Y.prototype.cmp=function(J){if(this.negative!==0&&J.negative===0)return-1;if(this.negative===0&&J.negative!==0)return 1;var W=this.ucmp(J);if(this.negative!==0)return-W|0;return W},Y.prototype.ucmp=function(J){if(this.length>J.length)return 1;if(this.length<J.length)return-1;var W=0;for(var F=this.length-1;F>=0;F--){var V=this.words[F]|0,H=J.words[F]|0;if(V===H)continue;if(V<H)W=-1;else if(V>H)W=1;break}return W},Y.prototype.gtn=function(J){return this.cmpn(J)===1},Y.prototype.gt=function(J){return this.cmp(J)===1},Y.prototype.gten=function(J){return this.cmpn(J)>=0},Y.prototype.gte=function(J){return this.cmp(J)>=0},Y.prototype.ltn=function(J){return this.cmpn(J)===-1},Y.prototype.lt=function(J){return this.cmp(J)===-1},Y.prototype.lten=function(J){return this.cmpn(J)<=0},Y.prototype.lte=function(J){return this.cmp(J)<=0},Y.prototype.eqn=function(J){return this.cmpn(J)===0},Y.prototype.eq=function(J){return this.cmp(J)===0},Y.red=function(J){return new l(J)},Y.prototype.toRed=function(J){return G(!this.red,"Already a number in reduction context"),G(this.negative===0,"red works only with positives"),J.convertTo(this)._forceRed(J)},Y.prototype.fromRed=function(){return G(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Y.prototype._forceRed=function(J){return this.red=J,this},Y.prototype.forceRed=function(J){return G(!this.red,"Already a number in reduction context"),this._forceRed(J)},Y.prototype.redAdd=function(J){return G(this.red,"redAdd works only with red numbers"),this.red.add(this,J)},Y.prototype.redIAdd=function(J){return G(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,J)},Y.prototype.redSub=function(J){return G(this.red,"redSub works only with red numbers"),this.red.sub(this,J)},Y.prototype.redISub=function(J){return G(this.red,"redISub works only with red numbers"),this.red.isub(this,J)},Y.prototype.redShl=function(J){return G(this.red,"redShl works only with red numbers"),this.red.shl(this,J)},Y.prototype.redMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.mul(this,J)},Y.prototype.redIMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.imul(this,J)},Y.prototype.redSqr=function(){return G(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Y.prototype.redISqr=function(){return G(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Y.prototype.redSqrt=function(){return G(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Y.prototype.redInvm=function(){return G(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Y.prototype.redNeg=function(){return G(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Y.prototype.redPow=function(J){return G(this.red&&!J.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,J)};var v={k256:null,p224:null,p192:null,p25519:null};function _(J,W){this.name=J,this.p=new Y(W,16),this.n=this.p.bitLength(),this.k=new Y(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}_.prototype._tmp=function(){var J=new Y(null);return J.words=Array(Math.ceil(this.n/13)),J},_.prototype.ireduce=function(J){var W=J,F;do this.split(W,this.tmp),W=this.imulK(W),W=W.iadd(this.tmp),F=W.bitLength();while(F>this.n);var V=F<this.n?-1:W.ucmp(this.p);if(V===0)W.words[0]=0,W.length=1;else if(V>0)W.isub(this.p);else if(W.strip!==void 0)W.strip();else W._strip();return W},_.prototype.split=function(J,W){J.iushrn(this.n,0,W)},_.prototype.imulK=function(J){return J.imul(this.k)};function u(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(u,_),u.prototype.split=function(J,W){var F=4194303,V=Math.min(J.length,9);for(var H=0;H<V;H++)W.words[H]=J.words[H];if(W.length=V,J.length<=9){J.words[0]=0,J.length=1;return}var M=J.words[9];W.words[W.length++]=M&F;for(H=10;H<J.length;H++){var T=J.words[H]|0;J.words[H-10]=(T&F)<<4|M>>>22,M=T}if(M>>>=22,J.words[H-10]=M,M===0&&J.length>10)J.length-=10;else J.length-=9},u.prototype.imulK=function(J){J.words[J.length]=0,J.words[J.length+1]=0,J.length+=2;var W=0;for(var F=0;F<J.length;F++){var V=J.words[F]|0;W+=V*977,J.words[F]=W&67108863,W=V*64+(W/67108864|0)}if(J.words[J.length-1]===0){if(J.length--,J.words[J.length-1]===0)J.length--}return J};function J0(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(J0,_);function H0(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(H0,_);function V0(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(V0,_),V0.prototype.imulK=function(J){var W=0;for(var F=0;F<J.length;F++){var V=(J.words[F]|0)*19+W,H=V&67108863;V>>>=26,J.words[F]=H,W=V}if(W!==0)J.words[J.length++]=W;return J},Y._prime=function(J){if(v[J])return v[J];var W;if(J==="k256")W=new u;else if(J==="p224")W=new J0;else if(J==="p192")W=new H0;else if(J==="p25519")W=new V0;else throw Error("Unknown prime "+J);return v[J]=W,W};function l(J){if(typeof J==="string"){var W=Y._prime(J);this.m=W.p,this.prime=W}else G(J.gtn(1),"modulus must be greater than 1"),this.m=J,this.prime=null}l.prototype._verify1=function(J){G(J.negative===0,"red works only with positives"),G(J.red,"red works only with red numbers")},l.prototype._verify2=function(J,W){G((J.negative|W.negative)===0,"red works only with positives"),G(J.red&&J.red===W.red,"red works only with red numbers")},l.prototype.imod=function(J){if(this.prime)return this.prime.ireduce(J)._forceRed(this);return J.umod(this.m)._forceRed(this)},l.prototype.neg=function(J){if(J.isZero())return J.clone();return this.m.sub(J)._forceRed(this)},l.prototype.add=function(J,W){this._verify2(J,W);var F=J.add(W);if(F.cmp(this.m)>=0)F.isub(this.m);return F._forceRed(this)},l.prototype.iadd=function(J,W){this._verify2(J,W);var F=J.iadd(W);if(F.cmp(this.m)>=0)F.isub(this.m);return F},l.prototype.sub=function(J,W){this._verify2(J,W);var F=J.sub(W);if(F.cmpn(0)<0)F.iadd(this.m);return F._forceRed(this)},l.prototype.isub=function(J,W){this._verify2(J,W);var F=J.isub(W);if(F.cmpn(0)<0)F.iadd(this.m);return F},l.prototype.shl=function(J,W){return this._verify1(J),this.imod(J.ushln(W))},l.prototype.imul=function(J,W){return this._verify2(J,W),this.imod(J.imul(W))},l.prototype.mul=function(J,W){return this._verify2(J,W),this.imod(J.mul(W))},l.prototype.isqr=function(J){return this.imul(J,J.clone())},l.prototype.sqr=function(J){return this.mul(J,J)},l.prototype.sqrt=function(J){if(J.isZero())return J.clone();var W=this.m.andln(3);if(G(W%2===1),W===3){var F=this.m.add(new Y(1)).iushrn(2);return this.pow(J,F)}var V=this.m.subn(1),H=0;while(!V.isZero()&&V.andln(1)===0)H++,V.iushrn(1);G(!V.isZero());var M=new Y(1).toRed(this),T=M.redNeg(),E=this.m.subn(1).iushrn(1),$=this.m.bitLength();$=new Y(2*$*$).toRed(this);while(this.pow($,E).cmp(T)!==0)$.redIAdd(T);var q=this.pow($,V),j=this.pow(J,V.addn(1).iushrn(1)),L=this.pow(J,V),x=H;while(L.cmp(M)!==0){var f=L;for(var b=0;f.cmp(M)!==0;b++)f=f.redSqr();G(b<x);var s=this.pow(q,new Y(1).iushln(x-b-1));j=j.redMul(s),q=s.redSqr(),L=L.redMul(q),x=b}return j},l.prototype.invm=function(J){var W=J._invmp(this.m);if(W.negative!==0)return W.negative=0,this.imod(W).redNeg();else return this.imod(W)},l.prototype.pow=function(J,W){if(W.isZero())return new Y(1).toRed(this);if(W.cmpn(1)===0)return J.clone();var F=4,V=Array(1<<F);V[0]=new Y(1).toRed(this),V[1]=J;for(var H=2;H<V.length;H++)V[H]=this.mul(V[H-1],J);var M=V[0],T=0,E=0,$=W.bitLength()%26;if($===0)$=26;for(H=W.length-1;H>=0;H--){var q=W.words[H];for(var j=$-1;j>=0;j--){var L=q>>j&1;if(M!==V[0])M=this.sqr(M);if(L===0&&T===0){E=0;continue}if(T<<=1,T|=L,E++,E!==F&&(H!==0||j!==0))continue;M=this.mul(M,V[T]),E=0,T=0}$=26}return M},l.prototype.convertTo=function(J){var W=J.umod(this.m);return W===J?W.clone():W},l.prototype.convertFrom=function(J){var W=J.clone();return W.red=null,W},Y.mont=function(J){return new U0(J)};function U0(J){if(l.call(this,J),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Y(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)}O(U0,l),U0.prototype.convertTo=function(J){return this.imod(J.ushln(this.shift))},U0.prototype.convertFrom=function(J){var W=this.imod(J.mul(this.rinv));return W.red=null,W},U0.prototype.imul=function(J,W){if(J.isZero()||W.isZero())return J.words[0]=0,J.length=1,J;var F=J.imul(W),V=F.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),H=F.isub(V).iushrn(this.shift),M=H;if(H.cmp(this.m)>=0)M=H.isub(this.m);else if(H.cmpn(0)<0)M=H.iadd(this.m);return M._forceRed(this)},U0.prototype.mul=function(J,W){if(J.isZero()||W.isZero())return new Y(0)._forceRed(this);var F=J.mul(W),V=F.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),H=F.isub(V).iushrn(this.shift),M=H;if(H.cmp(this.m)>=0)M=H.isub(this.m);else if(H.cmpn(0)<0)M=H.iadd(this.m);return M._forceRed(this)},U0.prototype.invm=function(J){var W=this.imod(J._invmp(this.m).mul(this.r2));return W._forceRed(this)}})(typeof Z>"u"||Z,X)}),DK=D0((X)=>{var Z=LU(),U=LZ(),Q=X;Q.define=function(O,Y){return new G(O,Y)};function G(O,Y){this.name=O,this.body=Y,this.decoders={},this.encoders={}}G.prototype._createNamed=function(O){var Y;try{Y=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
|
|
25
|
+
this._initNamed(entity);
|
|
26
|
+
})`)}catch(K){Y=function(A){this._initNamed(A)}}return U(Y,O),Y.prototype._initNamed=function(K){O.call(this,K)},new Y(this)},G.prototype._getDecoder=function(O){if(O=O||"der",!this.decoders.hasOwnProperty(O))this.decoders[O]=this._createNamed(Z.decoders[O]);return this.decoders[O]},G.prototype.decode=function(O,Y,K){return this._getDecoder(Y).decode(O,K)},G.prototype._getEncoder=function(O){if(O=O||"der",!this.encoders.hasOwnProperty(O))this.encoders[O]=this._createNamed(Z.encoders[O]);return this.encoders[O]},G.prototype.encode=function(O,Y,K){return this._getEncoder(Y).encode(O,K)}}),qK=D0((X)=>{var Z=LZ();function U(G){this._reporterState={obj:null,path:[],options:G||{},errors:[]}}X.Reporter=U,U.prototype.isError=function(G){return G instanceof Q},U.prototype.save=function(){var G=this._reporterState;return{obj:G.obj,pathLen:G.path.length}},U.prototype.restore=function(G){var O=this._reporterState;O.obj=G.obj,O.path=O.path.slice(0,G.pathLen)},U.prototype.enterKey=function(G){return this._reporterState.path.push(G)},U.prototype.exitKey=function(G){var O=this._reporterState;O.path=O.path.slice(0,G-1)},U.prototype.leaveKey=function(G,O,Y){var K=this._reporterState;if(this.exitKey(G),K.obj!==null)K.obj[O]=Y},U.prototype.path=function(){return this._reporterState.path.join("/")},U.prototype.enterObject=function(){var G=this._reporterState,O=G.obj;return G.obj={},O},U.prototype.leaveObject=function(G){var O=this._reporterState,Y=O.obj;return O.obj=G,Y},U.prototype.error=function(G){var O,Y=this._reporterState,K=G instanceof Q;if(K)O=G;else O=new Q(Y.path.map(function(A){return"["+JSON.stringify(A)+"]"}).join(""),G.message||G,G.stack);if(!Y.options.partial)throw O;if(!K)Y.errors.push(O);return O},U.prototype.wrapResult=function(G){var O=this._reporterState;if(!O.options.partial)return G;return{result:this.isError(G)?null:G,errors:O.errors}};function Q(G,O){this.path=G,this.rethrow(O)}Z(Q,Error),Q.prototype.rethrow=function(G){if(this.message=G+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,Q);if(!this.stack)try{throw Error(this.message)}catch(O){this.stack=O.stack}return this}}),iG=D0((X)=>{var Z=LZ(),U=AU().Reporter,Q=(UZ(),WX(QZ)).Buffer;function G(Y,K){if(U.call(this,K),!Q.isBuffer(Y)){this.error("Input not Buffer");return}this.base=Y,this.offset=0,this.length=Y.length}Z(G,U),X.DecoderBuffer=G,G.prototype.save=function(){return{offset:this.offset,reporter:U.prototype.save.call(this)}},G.prototype.restore=function(Y){var K=new G(this.base);return K.offset=Y.offset,K.length=this.offset,this.offset=Y.offset,U.prototype.restore.call(this,Y.reporter),K},G.prototype.isEmpty=function(){return this.offset===this.length},G.prototype.readUInt8=function(Y){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(Y||"DecoderBuffer overrun")},G.prototype.skip=function(Y,K){if(!(this.offset+Y<=this.length))return this.error(K||"DecoderBuffer overrun");var A=new G(this.base);return A._reporterState=this._reporterState,A.offset=this.offset,A.length=this.offset+Y,this.offset+=Y,A},G.prototype.raw=function(Y){return this.base.slice(Y?Y.offset:this.offset,this.length)};function O(Y,K){if(Array.isArray(Y))this.length=0,this.value=Y.map(function(A){if(!(A instanceof O))A=new O(A,K);return this.length+=A.length,A},this);else if(typeof Y==="number"){if(!(0<=Y&&Y<=255))return K.error("non-byte EncoderBuffer value");this.value=Y,this.length=1}else if(typeof Y==="string")this.value=Y,this.length=Q.byteLength(Y);else if(Q.isBuffer(Y))this.value=Y,this.length=Y.length;else return K.error("Unsupported type: "+typeof Y)}X.EncoderBuffer=O,O.prototype.join=function(Y,K){if(!Y)Y=new Q(this.length);if(!K)K=0;if(this.length===0)return Y;if(Array.isArray(this.value))this.value.forEach(function(A){A.join(Y,K),K+=A.length});else{if(typeof this.value==="number")Y[K]=this.value;else if(typeof this.value==="string")Y.write(this.value,K);else if(Q.isBuffer(this.value))this.value.copy(Y,K);K+=this.length}return Y}}),MK=D0((X,Z)=>{var U=AU().Reporter,Q=AU().EncoderBuffer,G=AU().DecoderBuffer,O=KQ(),Y=["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"],K=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(Y),A=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function D(z,R){var S={};if(this._baseState=S,S.enc=z,S.parent=R||null,S.children=null,S.tag=null,S.args=null,S.reverseArgs=null,S.choice=null,S.optional=!1,S.any=!1,S.obj=!1,S.use=null,S.useDecoder=null,S.key=null,S.default=null,S.explicit=null,S.implicit=null,S.contains=null,!S.parent)S.children=[],this._wrap()}Z.exports=D;var C=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];D.prototype.clone=function(){var z=this._baseState,R={};C.forEach(function(P){R[P]=z[P]});var S=new this.constructor(R.parent);return S._baseState=R,S},D.prototype._wrap=function(){var z=this._baseState;K.forEach(function(R){this[R]=function(){var S=new this.constructor(this);return z.children.push(S),S[R].apply(S,arguments)}},this)},D.prototype._init=function(z){var R=this._baseState;O(R.parent===null),z.call(this),R.children=R.children.filter(function(S){return S._baseState.parent===this},this),O.equal(R.children.length,1,"Root node can have only one child")},D.prototype._useArgs=function(z){var R=this._baseState,S=z.filter(function(P){return P instanceof this.constructor},this);if(z=z.filter(function(P){return!(P instanceof this.constructor)},this),S.length!==0)O(R.children===null),R.children=S,S.forEach(function(P){P._baseState.parent=this},this);if(z.length!==0)O(R.args===null),R.args=z,R.reverseArgs=z.map(function(P){if(typeof P!=="object"||P.constructor!==Object)return P;var N={};return Object.keys(P).forEach(function(I){if(I==(I|0))I|=0;var B=P[I];N[B]=I}),N})},A.forEach(function(z){D.prototype[z]=function(){var R=this._baseState;throw Error(z+" not implemented for encoding: "+R.enc)}}),Y.forEach(function(z){D.prototype[z]=function(){var R=this._baseState,S=Array.prototype.slice.call(arguments);return O(R.tag===null),R.tag=z,this._useArgs(S),this}}),D.prototype.use=function(z){O(z);var R=this._baseState;return O(R.use===null),R.use=z,this},D.prototype.optional=function(){var z=this._baseState;return z.optional=!0,this},D.prototype.def=function(z){var R=this._baseState;return O(R.default===null),R.default=z,R.optional=!0,this},D.prototype.explicit=function(z){var R=this._baseState;return O(R.explicit===null&&R.implicit===null),R.explicit=z,this},D.prototype.implicit=function(z){var R=this._baseState;return O(R.explicit===null&&R.implicit===null),R.implicit=z,this},D.prototype.obj=function(){var z=this._baseState,R=Array.prototype.slice.call(arguments);if(z.obj=!0,R.length!==0)this._useArgs(R);return this},D.prototype.key=function(z){var R=this._baseState;return O(R.key===null),R.key=z,this},D.prototype.any=function(){var z=this._baseState;return z.any=!0,this},D.prototype.choice=function(z){var R=this._baseState;return O(R.choice===null),R.choice=z,this._useArgs(Object.keys(z).map(function(S){return z[S]})),this},D.prototype.contains=function(z){var R=this._baseState;return O(R.use===null),R.contains=z,this},D.prototype._decode=function(z,R){var S=this._baseState;if(S.parent===null)return z.wrapResult(S.children[0]._decode(z,R));var P=S.default,N=!0,I=null;if(S.key!==null)I=z.enterKey(S.key);if(S.optional){var B=null;if(S.explicit!==null)B=S.explicit;else if(S.implicit!==null)B=S.implicit;else if(S.tag!==null)B=S.tag;if(B===null&&!S.any){var k=z.save();try{if(S.choice===null)this._decodeGeneric(S.tag,z,R);else this._decodeChoice(z,R);N=!0}catch(H0){N=!1}z.restore(k)}else if(N=this._peekTag(z,B,S.any),z.isError(N))return N}var w;if(S.obj&&N)w=z.enterObject();if(N){if(S.explicit!==null){var v=this._decodeTag(z,S.explicit);if(z.isError(v))return v;z=v}var _=z.offset;if(S.use===null&&S.choice===null){if(S.any)var k=z.save();var u=this._decodeTag(z,S.implicit!==null?S.implicit:S.tag,S.any);if(z.isError(u))return u;if(S.any)P=z.raw(k);else z=u}if(R&&R.track&&S.tag!==null)R.track(z.path(),_,z.length,"tagged");if(R&&R.track&&S.tag!==null)R.track(z.path(),z.offset,z.length,"content");if(S.any)P=P;else if(S.choice===null)P=this._decodeGeneric(S.tag,z,R);else P=this._decodeChoice(z,R);if(z.isError(P))return P;if(!S.any&&S.choice===null&&S.children!==null)S.children.forEach(function(H0){H0._decode(z,R)});if(S.contains&&(S.tag==="octstr"||S.tag==="bitstr")){var J0=new G(P);P=this._getUse(S.contains,z._reporterState.obj)._decode(J0,R)}}if(S.obj&&N)P=z.leaveObject(w);if(S.key!==null&&(P!==null||N===!0))z.leaveKey(I,S.key,P);else if(I!==null)z.exitKey(I);return P},D.prototype._decodeGeneric=function(z,R,S){var P=this._baseState;if(z==="seq"||z==="set")return null;if(z==="seqof"||z==="setof")return this._decodeList(R,z,P.args[0],S);else if(/str$/.test(z))return this._decodeStr(R,z,S);else if(z==="objid"&&P.args)return this._decodeObjid(R,P.args[0],P.args[1],S);else if(z==="objid")return this._decodeObjid(R,null,null,S);else if(z==="gentime"||z==="utctime")return this._decodeTime(R,z,S);else if(z==="null_")return this._decodeNull(R,S);else if(z==="bool")return this._decodeBool(R,S);else if(z==="objDesc")return this._decodeStr(R,z,S);else if(z==="int"||z==="enum")return this._decodeInt(R,P.args&&P.args[0],S);if(P.use!==null)return this._getUse(P.use,R._reporterState.obj)._decode(R,S);else return R.error("unknown tag: "+z)},D.prototype._getUse=function(z,R){var S=this._baseState;if(S.useDecoder=this._use(z,R),O(S.useDecoder._baseState.parent===null),S.useDecoder=S.useDecoder._baseState.children[0],S.implicit!==S.useDecoder._baseState.implicit)S.useDecoder=S.useDecoder.clone(),S.useDecoder._baseState.implicit=S.implicit;return S.useDecoder},D.prototype._decodeChoice=function(z,R){var S=this._baseState,P=null,N=!1;if(Object.keys(S.choice).some(function(I){var B=z.save(),k=S.choice[I];try{var w=k._decode(z,R);if(z.isError(w))return!1;P={type:I,value:w},N=!0}catch(v){return z.restore(B),!1}return!0},this),!N)return z.error("Choice not matched");return P},D.prototype._createEncoderBuffer=function(z){return new Q(z,this.reporter)},D.prototype._encode=function(z,R,S){var P=this._baseState;if(P.default!==null&&P.default===z)return;var N=this._encodeValue(z,R,S);if(N===void 0)return;if(this._skipDefault(N,R,S))return;return N},D.prototype._encodeValue=function(z,R,S){var P=this._baseState;if(P.parent===null)return P.children[0]._encode(z,R||new U);var k=null;if(this.reporter=R,P.optional&&z===void 0)if(P.default!==null)z=P.default;else return;var N=null,I=!1;if(P.any)k=this._createEncoderBuffer(z);else if(P.choice)k=this._encodeChoice(z,R);else if(P.contains)N=this._getUse(P.contains,S)._encode(z,R),I=!0;else if(P.children)N=P.children.map(function(_){if(_._baseState.tag==="null_")return _._encode(null,R,z);if(_._baseState.key===null)return R.error("Child should have a key");var u=R.enterKey(_._baseState.key);if(typeof z!=="object")return R.error("Child expected, but input is not object");var J0=_._encode(z[_._baseState.key],R,z);return R.leaveKey(u),J0},this).filter(function(_){return _}),N=this._createEncoderBuffer(N);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(z))return R.error("seqof/setof, but data is not Array");var B=this.clone();B._baseState.implicit=null,N=this._createEncoderBuffer(z.map(function(_){var u=this._baseState;return this._getUse(u.args[0],z)._encode(_,R)},B))}else if(P.use!==null)k=this._getUse(P.use,S)._encode(z,R);else N=this._encodePrimitive(P.tag,z),I=!0;var k;if(!P.any&&P.choice===null){var w=P.implicit!==null?P.implicit:P.tag,v=P.implicit===null?"universal":"context";if(w===null){if(P.use===null)R.error("Tag could be omitted only for .use()")}else if(P.use===null)k=this._encodeComposite(w,I,v,N)}if(P.explicit!==null)k=this._encodeComposite(P.explicit,!1,"context",k);return k},D.prototype._encodeChoice=function(z,R){var S=this._baseState,P=S.choice[z.type];if(!P)O(!1,z.type+" not found in "+JSON.stringify(Object.keys(S.choice)));return P._encode(z.value,R)},D.prototype._encodePrimitive=function(z,R){var S=this._baseState;if(/str$/.test(z))return this._encodeStr(R,z);else if(z==="objid"&&S.args)return this._encodeObjid(R,S.reverseArgs[0],S.args[1]);else if(z==="objid")return this._encodeObjid(R,null,null);else if(z==="gentime"||z==="utctime")return this._encodeTime(R,z);else if(z==="null_")return this._encodeNull();else if(z==="int"||z==="enum")return this._encodeInt(R,S.args&&S.reverseArgs[0]);else if(z==="bool")return this._encodeBool(R);else if(z==="objDesc")return this._encodeStr(R,z);else throw Error("Unsupported tag: "+z)},D.prototype._isNumstr=function(z){return/^[0-9 ]*$/.test(z)},D.prototype._isPrintstr=function(z){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(z)}}),AU=D0((X)=>{var Z=X;Z.Reporter=qK().Reporter,Z.DecoderBuffer=iG().DecoderBuffer,Z.EncoderBuffer=iG().EncoderBuffer,Z.Node=MK()}),CK=D0((X)=>{var Z=qV();X.tagClass={0:"universal",1:"application",2:"context",3:"private"},X.tagClassByName=Z._reverse(X.tagClass),X.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"},X.tagByName=Z._reverse(X.tag)}),qV=D0((X)=>{var Z=X;Z._reverse=function(U){var Q={};return Object.keys(U).forEach(function(G){if((G|0)==G)G=G|0;var O=U[G];Q[O]=G}),Q},Z.der=CK()}),MV=D0((X,Z)=>{var U=LZ(),Q=LU(),G=Q.base,O=Q.bignum,Y=Q.constants.der;function K(z){this.enc="der",this.name=z.name,this.entity=z,this.tree=new A,this.tree._init(z.body)}Z.exports=K,K.prototype.decode=function(z,R){if(!(z instanceof G.DecoderBuffer))z=new G.DecoderBuffer(z,R);return this.tree._decode(z,R)};function A(z){G.Node.call(this,"der",z)}U(A,G.Node),A.prototype._peekTag=function(z,R,S){if(z.isEmpty())return!1;var P=z.save(),N=D(z,'Failed to peek tag: "'+R+'"');if(z.isError(N))return N;return z.restore(P),N.tag===R||N.tagStr===R||N.tagStr+"of"===R||S},A.prototype._decodeTag=function(z,R,S){var P=D(z,'Failed to decode tag of "'+R+'"');if(z.isError(P))return P;var N=C(z,P.primitive,'Failed to get length of "'+R+'"');if(z.isError(N))return N;if(!S&&P.tag!==R&&P.tagStr!==R&&P.tagStr+"of"!==R)return z.error('Failed to match tag: "'+R+'"');if(P.primitive||N!==null)return z.skip(N,'Failed to match body of: "'+R+'"');var I=z.save(),B=this._skipUntilEnd(z,'Failed to skip indefinite length body: "'+this.tag+'"');if(z.isError(B))return B;return N=z.offset-I.offset,z.restore(I),z.skip(N,'Failed to match body of: "'+R+'"')},A.prototype._skipUntilEnd=function(z,R){while(!0){var S=D(z,R);if(z.isError(S))return S;var P=C(z,S.primitive,R);if(z.isError(P))return P;var N;if(S.primitive||P!==null)N=z.skip(P);else N=this._skipUntilEnd(z,R);if(z.isError(N))return N;if(S.tagStr==="end")break}},A.prototype._decodeList=function(z,R,S,P){var N=[];while(!z.isEmpty()){var I=this._peekTag(z,"end");if(z.isError(I))return I;var B=S.decode(z,"der",P);if(z.isError(B)&&I)break;N.push(B)}return N},A.prototype._decodeStr=function(z,R){if(R==="bitstr"){var S=z.readUInt8();if(z.isError(S))return S;return{unused:S,data:z.raw()}}else if(R==="bmpstr"){var P=z.raw();if(P.length%2===1)return z.error("Decoding of string type: bmpstr length mismatch");var N="";for(var I=0;I<P.length/2;I++)N+=String.fromCharCode(P.readUInt16BE(I*2));return N}else if(R==="numstr"){var B=z.raw().toString("ascii");if(!this._isNumstr(B))return z.error("Decoding of string type: numstr unsupported characters");return B}else if(R==="octstr")return z.raw();else if(R==="objDesc")return z.raw();else if(R==="printstr"){var k=z.raw().toString("ascii");if(!this._isPrintstr(k))return z.error("Decoding of string type: printstr unsupported characters");return k}else if(/str$/.test(R))return z.raw().toString();else return z.error("Decoding of string type: "+R+" unsupported")},A.prototype._decodeObjid=function(z,R,S){var P,N=[],I=0;while(!z.isEmpty()){var B=z.readUInt8();if(I<<=7,I|=B&127,(B&128)===0)N.push(I),I=0}if(B&128)N.push(I);var k=N[0]/40|0,w=N[0]%40;if(S)P=N;else P=[k,w].concat(N.slice(1));if(R){var v=R[P.join(" ")];if(v===void 0)v=R[P.join(".")];if(v!==void 0)P=v}return P},A.prototype._decodeTime=function(z,R){var S=z.raw().toString();if(R==="gentime")var P=S.slice(0,4)|0,N=S.slice(4,6)|0,I=S.slice(6,8)|0,B=S.slice(8,10)|0,k=S.slice(10,12)|0,w=S.slice(12,14)|0;else if(R==="utctime"){var P=S.slice(0,2)|0,N=S.slice(2,4)|0,I=S.slice(4,6)|0,B=S.slice(6,8)|0,k=S.slice(8,10)|0,w=S.slice(10,12)|0;if(P<70)P=2000+P;else P=1900+P}else return z.error("Decoding "+R+" time is not supported yet");return Date.UTC(P,N-1,I,B,k,w,0)},A.prototype._decodeNull=function(z){return null},A.prototype._decodeBool=function(z){var R=z.readUInt8();if(z.isError(R))return R;else return R!==0},A.prototype._decodeInt=function(z,R){var S=z.raw(),P=new O(S);if(R)P=R[P.toString(10)]||P;return P},A.prototype._use=function(z,R){if(typeof z==="function")z=z(R);return z._getDecoder("der").tree};function D(z,R){var S=z.readUInt8(R);if(z.isError(S))return S;var P=Y.tagClass[S>>6],N=(S&32)===0;if((S&31)===31){var I=S;S=0;while((I&128)===128){if(I=z.readUInt8(R),z.isError(I))return I;S<<=7,S|=I&127}}else S&=31;var B=Y.tag[S];return{cls:P,primitive:N,tag:S,tagStr:B}}function C(z,R,S){var P=z.readUInt8(S);if(z.isError(P))return P;if(!R&&P===128)return null;if((P&128)===0)return P;var N=P&127;if(N>4)return z.error("length octect is too long");P=0;for(var I=0;I<N;I++){P<<=8;var B=z.readUInt8(S);if(z.isError(B))return B;P|=B}return P}}),AK=D0((X,Z)=>{var U=LZ(),Q=(UZ(),WX(QZ)).Buffer,G=MV();function O(Y){G.call(this,Y),this.enc="pem"}U(O,G),Z.exports=O,O.prototype.decode=function(Y,K){var A=Y.toString().split(/[\r\n]+/g),D=K.label.toUpperCase(),C=/^-----(BEGIN|END) ([^-]+)-----$/,z=-1,R=-1;for(var S=0;S<A.length;S++){var P=A[S].match(C);if(P===null)continue;if(P[2]!==D)continue;if(z===-1){if(P[1]!=="BEGIN")break;z=S}else{if(P[1]!=="END")break;R=S;break}}if(z===-1||R===-1)throw Error("PEM section not found for: "+D);var N=A.slice(z+1,R).join("");N.replace(/[^a-z0-9\+\/=]+/gi,"");var I=new Q(N,"base64");return G.prototype.decode.call(this,I,K)}}),TK=D0((X)=>{var Z=X;Z.der=MV(),Z.pem=AK()}),CV=D0((X,Z)=>{var U=LZ(),Q=(UZ(),WX(QZ)).Buffer,G=LU(),O=G.base,Y=G.constants.der;function K(z){this.enc="der",this.name=z.name,this.entity=z,this.tree=new A,this.tree._init(z.body)}Z.exports=K,K.prototype.encode=function(z,R){return this.tree._encode(z,R).join()};function A(z){O.Node.call(this,"der",z)}U(A,O.Node),A.prototype._encodeComposite=function(z,R,S,P){var N=C(z,R,S,this.reporter);if(P.length<128){var k=new Q(2);return k[0]=N,k[1]=P.length,this._createEncoderBuffer([k,P])}var I=1;for(var B=P.length;B>=256;B>>=8)I++;var k=new Q(2+I);k[0]=N,k[1]=128|I;for(var B=1+I,w=P.length;w>0;B--,w>>=8)k[B]=w&255;return this._createEncoderBuffer([k,P])},A.prototype._encodeStr=function(z,R){if(R==="bitstr")return this._createEncoderBuffer([z.unused|0,z.data]);else if(R==="bmpstr"){var S=new Q(z.length*2);for(var P=0;P<z.length;P++)S.writeUInt16BE(z.charCodeAt(P),P*2);return this._createEncoderBuffer(S)}else if(R==="numstr"){if(!this._isNumstr(z))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(z)}else if(R==="printstr"){if(!this._isPrintstr(z))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(z)}else if(/str$/.test(R))return this._createEncoderBuffer(z);else if(R==="objDesc")return this._createEncoderBuffer(z);else return this.reporter.error("Encoding of string type: "+R+" unsupported")},A.prototype._encodeObjid=function(z,R,S){if(typeof z==="string"){if(!R)return this.reporter.error("string objid given, but no values map found");if(!R.hasOwnProperty(z))return this.reporter.error("objid not found in values map");z=R[z].split(/[\s\.]+/g);for(var P=0;P<z.length;P++)z[P]|=0}else if(Array.isArray(z)){z=z.slice();for(var P=0;P<z.length;P++)z[P]|=0}if(!Array.isArray(z))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(z));if(!S){if(z[1]>=40)return this.reporter.error("Second objid identifier OOB");z.splice(0,2,z[0]*40+z[1])}var N=0;for(var P=0;P<z.length;P++){var I=z[P];for(N++;I>=128;I>>=7)N++}var B=new Q(N),k=B.length-1;for(var P=z.length-1;P>=0;P--){var I=z[P];B[k--]=I&127;while((I>>=7)>0)B[k--]=128|I&127}return this._createEncoderBuffer(B)};function D(z){if(z<10)return"0"+z;else return z}A.prototype._encodeTime=function(z,R){var S,P=new Date(z);if(R==="gentime")S=[D(P.getFullYear()),D(P.getUTCMonth()+1),D(P.getUTCDate()),D(P.getUTCHours()),D(P.getUTCMinutes()),D(P.getUTCSeconds()),"Z"].join("");else if(R==="utctime")S=[D(P.getFullYear()%100),D(P.getUTCMonth()+1),D(P.getUTCDate()),D(P.getUTCHours()),D(P.getUTCMinutes()),D(P.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+R+" time is not supported yet");return this._encodeStr(S,"octstr")},A.prototype._encodeNull=function(){return this._createEncoderBuffer("")},A.prototype._encodeInt=function(z,R){if(typeof z==="string"){if(!R)return this.reporter.error("String int or enum given, but no values map");if(!R.hasOwnProperty(z))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(z));z=R[z]}if(typeof z!=="number"&&!Q.isBuffer(z)){var S=z.toArray();if(!z.sign&&S[0]&128)S.unshift(0);z=new Q(S)}if(Q.isBuffer(z)){var P=z.length;if(z.length===0)P++;var I=new Q(P);if(z.copy(I),z.length===0)I[0]=0;return this._createEncoderBuffer(I)}if(z<128)return this._createEncoderBuffer(z);if(z<256)return this._createEncoderBuffer([0,z]);var P=1;for(var N=z;N>=256;N>>=8)P++;var I=Array(P);for(var N=I.length-1;N>=0;N--)I[N]=z&255,z>>=8;if(I[0]&128)I.unshift(0);return this._createEncoderBuffer(new Q(I))},A.prototype._encodeBool=function(z){return this._createEncoderBuffer(z?255:0)},A.prototype._use=function(z,R){if(typeof z==="function")z=z(R);return z._getEncoder("der").tree},A.prototype._skipDefault=function(z,R,S){var P=this._baseState,N;if(P.default===null)return!1;var I=z.join();if(P.defaultBuffer===void 0)P.defaultBuffer=this._encodeValue(P.default,R,S).join();if(I.length!==P.defaultBuffer.length)return!1;for(N=0;N<I.length;N++)if(I[N]!==P.defaultBuffer[N])return!1;return!0};function C(z,R,S,P){var N;if(z==="seqof")z="seq";else if(z==="setof")z="set";if(Y.tagByName.hasOwnProperty(z))N=Y.tagByName[z];else if(typeof z==="number"&&(z|0)===z)N=z;else return P.error("Unknown tag: "+z);if(N>=31)return P.error("Multi-octet tag encoding unsupported");if(!R)N|=32;return N|=Y.tagClassByName[S||"universal"]<<6,N}}),RK=D0((X,Z)=>{var U=LZ(),Q=CV();function G(O){Q.call(this,O),this.enc="pem"}U(G,Q),Z.exports=G,G.prototype.encode=function(O,Y){var K=Q.prototype.encode.call(this,O),A=K.toString("base64"),D=["-----BEGIN "+Y.label+"-----"];for(var C=0;C<A.length;C+=64)D.push(A.slice(C,C+64));return D.push("-----END "+Y.label+"-----"),D.join(`
|
|
27
|
+
`)}}),PK=D0((X)=>{var Z=X;Z.der=CV(),Z.pem=RK()}),LU=D0((X)=>{var Z=X;Z.bignum=zK(),Z.define=DK().define,Z.base=AU(),Z.constants=qV(),Z.decoders=TK(),Z.encoders=PK()}),SK=D0((X,Z)=>{var U=LU(),Q=U.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),G=U.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),O=U.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),Y=U.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(O),this.key("subjectPublicKey").bitstr())}),K=U.define("RelativeDistinguishedName",function(){this.setof(G)}),A=U.define("RDNSequence",function(){this.seqof(K)}),D=U.define("Name",function(){this.choice({rdnSequence:this.use(A)})}),C=U.define("Validity",function(){this.seq().obj(this.key("notBefore").use(Q),this.key("notAfter").use(Q))}),z=U.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),R=U.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(O),this.key("issuer").use(D),this.key("validity").use(C),this.key("subject").use(D),this.key("subjectPublicKeyInfo").use(Y),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(z).optional())}),S=U.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(R),this.key("signatureAlgorithm").use(O),this.key("signatureValue").bitstr())});Z.exports=S}),LK=D0((X)=>{var Z=LU();X.certificate=SK();var U=Z.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())});X.RSAPrivateKey=U;var Q=Z.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});X.RSAPublicKey=Q;var G=Z.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())}),O=Z.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(G),this.key("subjectPublicKey").bitstr())});X.PublicKey=O;var Y=Z.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(G),this.key("subjectPrivateKey").octstr())});X.PrivateKey=Y;var K=Z.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())});X.EncryptedPrivateKey=K;var A=Z.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())});X.DSAPrivateKey=A,X.DSAparam=Z.define("DSAparam",function(){this.int()});var D=Z.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),C=Z.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(D),this.key("publicKey").optional().explicit(1).bitstr())});X.ECPrivateKey=C,X.signature=Z.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),IK=D0((X,Z)=>{Z.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"}}),jK=D0((X,Z)=>{var U=qZ().Buffer,Q=qY().Transform,G=LZ();function O(D){Q.call(this),this._block=U.allocUnsafe(D),this._blockSize=D,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}G(O,Q),O.prototype._transform=function(D,C,z){var R=null;try{this.update(D,C)}catch(S){R=S}z(R)},O.prototype._flush=function(D){var C=null;try{this.push(this.digest())}catch(z){C=z}D(C)};var Y=typeof Uint8Array<"u",K=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(U.prototype instanceof Uint8Array||U.TYPED_ARRAY_SUPPORT);function A(D,C){if(D instanceof U)return D;if(typeof D==="string")return U.from(D,C);if(K&&ArrayBuffer.isView(D)){if(D.byteLength===0)return U.alloc(0);var z=U.from(D.buffer,D.byteOffset,D.byteLength);if(z.byteLength===D.byteLength)return z}if(Y&&D instanceof Uint8Array)return U.from(D);if(U.isBuffer(D)&&D.constructor&&typeof D.constructor.isBuffer==="function"&&D.constructor.isBuffer(D))return U.from(D);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}O.prototype.update=function(D,C){if(this._finalized)throw Error("Digest already called");D=A(D,C);var z=this._block,R=0;while(this._blockOffset+D.length-R>=this._blockSize){for(var S=this._blockOffset;S<this._blockSize;)z[S++]=D[R++];this._update(),this._blockOffset=0}while(R<D.length)z[this._blockOffset++]=D[R++];for(var P=0,N=D.length*8;N>0;++P)if(this._length[P]+=N,N=this._length[P]/4294967296|0,N>0)this._length[P]-=4294967296*N;return this},O.prototype._update=function(){throw Error("_update is not implemented")},O.prototype.digest=function(D){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var C=this._digest();if(D!==void 0)C=C.toString(D);this._block.fill(0),this._blockOffset=0;for(var z=0;z<4;++z)this._length[z]=0;return C},O.prototype._digest=function(){throw Error("_digest is not implemented")},Z.exports=O}),NK=D0((X,Z)=>{var U=LZ(),Q=jK(),G=qZ().Buffer,O=Array(16);function Y(){Q.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}U(Y,Q),Y.prototype._update=function(){var R=O;for(var S=0;S<16;++S)R[S]=this._block.readInt32LE(S*4);var P=this._a,N=this._b,I=this._c,B=this._d;P=A(P,N,I,B,R[0],3614090360,7),B=A(B,P,N,I,R[1],3905402710,12),I=A(I,B,P,N,R[2],606105819,17),N=A(N,I,B,P,R[3],3250441966,22),P=A(P,N,I,B,R[4],4118548399,7),B=A(B,P,N,I,R[5],1200080426,12),I=A(I,B,P,N,R[6],2821735955,17),N=A(N,I,B,P,R[7],4249261313,22),P=A(P,N,I,B,R[8],1770035416,7),B=A(B,P,N,I,R[9],2336552879,12),I=A(I,B,P,N,R[10],4294925233,17),N=A(N,I,B,P,R[11],2304563134,22),P=A(P,N,I,B,R[12],1804603682,7),B=A(B,P,N,I,R[13],4254626195,12),I=A(I,B,P,N,R[14],2792965006,17),N=A(N,I,B,P,R[15],1236535329,22),P=D(P,N,I,B,R[1],4129170786,5),B=D(B,P,N,I,R[6],3225465664,9),I=D(I,B,P,N,R[11],643717713,14),N=D(N,I,B,P,R[0],3921069994,20),P=D(P,N,I,B,R[5],3593408605,5),B=D(B,P,N,I,R[10],38016083,9),I=D(I,B,P,N,R[15],3634488961,14),N=D(N,I,B,P,R[4],3889429448,20),P=D(P,N,I,B,R[9],568446438,5),B=D(B,P,N,I,R[14],3275163606,9),I=D(I,B,P,N,R[3],4107603335,14),N=D(N,I,B,P,R[8],1163531501,20),P=D(P,N,I,B,R[13],2850285829,5),B=D(B,P,N,I,R[2],4243563512,9),I=D(I,B,P,N,R[7],1735328473,14),N=D(N,I,B,P,R[12],2368359562,20),P=C(P,N,I,B,R[5],4294588738,4),B=C(B,P,N,I,R[8],2272392833,11),I=C(I,B,P,N,R[11],1839030562,16),N=C(N,I,B,P,R[14],4259657740,23),P=C(P,N,I,B,R[1],2763975236,4),B=C(B,P,N,I,R[4],1272893353,11),I=C(I,B,P,N,R[7],4139469664,16),N=C(N,I,B,P,R[10],3200236656,23),P=C(P,N,I,B,R[13],681279174,4),B=C(B,P,N,I,R[0],3936430074,11),I=C(I,B,P,N,R[3],3572445317,16),N=C(N,I,B,P,R[6],76029189,23),P=C(P,N,I,B,R[9],3654602809,4),B=C(B,P,N,I,R[12],3873151461,11),I=C(I,B,P,N,R[15],530742520,16),N=C(N,I,B,P,R[2],3299628645,23),P=z(P,N,I,B,R[0],4096336452,6),B=z(B,P,N,I,R[7],1126891415,10),I=z(I,B,P,N,R[14],2878612391,15),N=z(N,I,B,P,R[5],4237533241,21),P=z(P,N,I,B,R[12],1700485571,6),B=z(B,P,N,I,R[3],2399980690,10),I=z(I,B,P,N,R[10],4293915773,15),N=z(N,I,B,P,R[1],2240044497,21),P=z(P,N,I,B,R[8],1873313359,6),B=z(B,P,N,I,R[15],4264355552,10),I=z(I,B,P,N,R[6],2734768916,15),N=z(N,I,B,P,R[13],1309151649,21),P=z(P,N,I,B,R[4],4149444226,6),B=z(B,P,N,I,R[11],3174756917,10),I=z(I,B,P,N,R[2],718787259,15),N=z(N,I,B,P,R[9],3951481745,21),this._a=this._a+P|0,this._b=this._b+N|0,this._c=this._c+I|0,this._d=this._d+B|0},Y.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=G.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 K(R,S){return R<<S|R>>>32-S}function A(R,S,P,N,I,B,k){return K(R+(S&P|~S&N)+I+B|0,k)+S|0}function D(R,S,P,N,I,B,k){return K(R+(S&N|P&~N)+I+B|0,k)+S|0}function C(R,S,P,N,I,B,k){return K(R+(S^P^N)+I+B|0,k)+S|0}function z(R,S,P,N,I,B,k){return K(R+(P^(S|~N))+I+B|0,k)+S|0}Z.exports=Y}),BK=D0((X,Z)=>{var U=qZ().Buffer,Q=NK();function G(O,Y,K,A){if(!U.isBuffer(O))O=U.from(O,"binary");if(Y){if(!U.isBuffer(Y))Y=U.from(Y,"binary");if(Y.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var D=K/8,C=U.alloc(D),z=U.alloc(A||0),R=U.alloc(0);while(D>0||A>0){var S=new Q;if(S.update(R),S.update(O),Y)S.update(Y);R=S.digest();var P=0;if(D>0){var N=C.length-D;P=Math.min(D,R.length),R.copy(C,N,0,P),D-=P}if(P<R.length&&A>0){var I=z.length-A,B=Math.min(A,R.length-P);R.copy(z,I,P,P+B),A-=B}}return R.fill(0),{key:C,iv:z}}Z.exports=G}),AV=D0((X)=>{var Z=(EZ(),WX(KZ));X.createCipher=X.Cipher=Z.createCipher,X.createCipheriv=X.Cipheriv=Z.createCipheriv,X.createDecipher=X.Decipher=Z.createDecipher,X.createDecipheriv=X.Decipheriv=Z.createDecipheriv,X.listCiphers=X.getCiphers=Z.getCiphers}),kK=D0((X,Z)=>{var U=/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,Q=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,G=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,O=BK(),Y=AV(),K=qZ().Buffer;Z.exports=function(A,D){var C=A.toString(),z=C.match(U),R;if(!z){var S=C.match(G);R=K.from(S[2].replace(/[\r\n]/g,""),"base64")}else{var P="aes"+z[1],N=K.from(z[2],"hex"),I=K.from(z[3].replace(/[\r\n]/g,""),"base64"),B=O(D,N.slice(0,8),parseInt(z[1],10)).key,k=[],w=Y.createDecipheriv(P,B,N);k.push(w.update(I)),k.push(w.final()),R=K.concat(k)}var v=C.match(Q)[1];return{tag:v,data:R}}}),TV=D0((X,Z)=>{var U=LK(),Q=IK(),G=kK(),O=AV(),Y=OV().pbkdf2Sync,K=qZ().Buffer;function A(C,z){var R=C.algorithm.decrypt.kde.kdeparams.salt,S=parseInt(C.algorithm.decrypt.kde.kdeparams.iters.toString(),10),P=Q[C.algorithm.decrypt.cipher.algo.join(".")],N=C.algorithm.decrypt.cipher.iv,I=C.subjectPrivateKey,B=parseInt(P.split("-")[1],10)/8,k=Y(z,R,S,B,"sha1"),w=O.createDecipheriv(P,k,N),v=[];return v.push(w.update(I)),v.push(w.final()),K.concat(v)}function D(C){var z;if(typeof C==="object"&&!K.isBuffer(C))z=C.passphrase,C=C.key;if(typeof C==="string")C=K.from(C);var R=G(C,z),S=R.tag,P=R.data,N,I;switch(S){case"CERTIFICATE":I=U.certificate.decode(P,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!I)I=U.PublicKey.decode(P,"der");switch(N=I.algorithm.algorithm.join("."),N){case"1.2.840.113549.1.1.1":return U.RSAPublicKey.decode(I.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return I.subjectPrivateKey=I.subjectPublicKey,{type:"ec",data:I};case"1.2.840.10040.4.1":return I.algorithm.params.pub_key=U.DSAparam.decode(I.subjectPublicKey.data,"der"),{type:"dsa",data:I.algorithm.params};default:throw Error("unknown key id "+N)}case"ENCRYPTED PRIVATE KEY":P=U.EncryptedPrivateKey.decode(P,"der"),P=A(P,z);case"PRIVATE KEY":switch(I=U.PrivateKey.decode(P,"der"),N=I.algorithm.algorithm.join("."),N){case"1.2.840.113549.1.1.1":return U.RSAPrivateKey.decode(I.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:I.algorithm.curve,privateKey:U.ECPrivateKey.decode(I.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return I.algorithm.params.priv_key=U.DSAparam.decode(I.subjectPrivateKey,"der"),{type:"dsa",params:I.algorithm.params};default:throw Error("unknown key id "+N)}case"RSA PUBLIC KEY":return U.RSAPublicKey.decode(P,"der");case"RSA PRIVATE KEY":return U.RSAPrivateKey.decode(P,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:U.DSAPrivateKey.decode(P,"der")};case"EC PRIVATE KEY":return P=U.ECPrivateKey.decode(P,"der"),{curve:P.parameters.value,privateKey:P.privateKey};default:throw Error("unknown key type "+S)}}D.signature=U.signature,Z.exports=D}),RV=D0((X,Z)=>{var U=VJ(),Q=qZ().Buffer;Z.exports=function(O,Y){var K=Q.alloc(0),A=0,D;while(K.length<Y)D=G(A++),K=Q.concat([K,U("sha1").update(O).update(D).digest()]);return K.slice(0,Y)};function G(O){var Y=Q.allocUnsafe(4);return Y.writeUInt32BE(O,0),Y}}),PV=D0((X,Z)=>{Z.exports=function(U,Q){var G=U.length,O=-1;while(++O<G)U[O]^=Q[O];return U}}),jY=D0((X,Z)=>{(function(U,Q){function G(J,W){if(!J)throw Error(W||"Assertion failed")}function O(J,W){J.super_=W;var F=function(){};F.prototype=W.prototype,J.prototype=new F,J.prototype.constructor=J}function Y(J,W,F){if(Y.isBN(J))return J;if(this.negative=0,this.words=null,this.length=0,this.red=null,J!==null){if(W==="le"||W==="be")F=W,W=10;this._init(J||0,W||10,F||"be")}}if(typeof U==="object")U.exports=Y;else Q.BN=Y;Y.BN=Y,Y.wordSize=26;var K;try{if(typeof window<"u"&&typeof window.Buffer<"u")K=window.Buffer;else K=(UZ(),WX(QZ)).Buffer}catch(J){}Y.isBN=function(J){if(J instanceof Y)return!0;return J!==null&&typeof J==="object"&&J.constructor.wordSize===Y.wordSize&&Array.isArray(J.words)},Y.max=function(J,W){if(J.cmp(W)>0)return J;return W},Y.min=function(J,W){if(J.cmp(W)<0)return J;return W},Y.prototype._init=function(J,W,F){if(typeof J==="number")return this._initNumber(J,W,F);if(typeof J==="object")return this._initArray(J,W,F);if(W==="hex")W=16;G(W===(W|0)&&W>=2&&W<=36),J=J.toString().replace(/\s+/g,"");var V=0;if(J[0]==="-")V++,this.negative=1;if(V<J.length){if(W===16)this._parseHex(J,V,F);else if(this._parseBase(J,W,V),F==="le")this._initArray(this.toArray(),W,F)}},Y.prototype._initNumber=function(J,W,F){if(J<0)this.negative=1,J=-J;if(J<67108864)this.words=[J&67108863],this.length=1;else if(J<4503599627370496)this.words=[J&67108863,J/67108864&67108863],this.length=2;else G(J<9007199254740992),this.words=[J&67108863,J/67108864&67108863,1],this.length=3;if(F!=="le")return;this._initArray(this.toArray(),W,F)},Y.prototype._initArray=function(J,W,F){if(G(typeof J.length==="number"),J.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(J.length/3),this.words=Array(this.length);for(var V=0;V<this.length;V++)this.words[V]=0;var H,M,T=0;if(F==="be"){for(V=J.length-1,H=0;V>=0;V-=3)if(M=J[V]|J[V-1]<<8|J[V-2]<<16,this.words[H]|=M<<T&67108863,this.words[H+1]=M>>>26-T&67108863,T+=24,T>=26)T-=26,H++}else if(F==="le"){for(V=0,H=0;V<J.length;V+=3)if(M=J[V]|J[V+1]<<8|J[V+2]<<16,this.words[H]|=M<<T&67108863,this.words[H+1]=M>>>26-T&67108863,T+=24,T>=26)T-=26,H++}return this.strip()};function A(J,W){var F=J.charCodeAt(W);if(F>=65&&F<=70)return F-55;else if(F>=97&&F<=102)return F-87;else return F-48&15}function D(J,W,F){var V=A(J,F);if(F-1>=W)V|=A(J,F-1)<<4;return V}Y.prototype._parseHex=function(J,W,F){this.length=Math.ceil((J.length-W)/6),this.words=Array(this.length);for(var V=0;V<this.length;V++)this.words[V]=0;var H=0,M=0,T;if(F==="be")for(V=J.length-1;V>=W;V-=2)if(T=D(J,W,V)<<H,this.words[M]|=T&67108863,H>=18)H-=18,M+=1,this.words[M]|=T>>>26;else H+=8;else{var E=J.length-W;for(V=E%2===0?W+1:W;V<J.length;V+=2)if(T=D(J,W,V)<<H,this.words[M]|=T&67108863,H>=18)H-=18,M+=1,this.words[M]|=T>>>26;else H+=8}this.strip()};function C(J,W,F,V){var H=0,M=Math.min(J.length,F);for(var T=W;T<M;T++){var E=J.charCodeAt(T)-48;if(H*=V,E>=49)H+=E-49+10;else if(E>=17)H+=E-17+10;else H+=E}return H}Y.prototype._parseBase=function(J,W,F){this.words=[0],this.length=1;for(var V=0,H=1;H<=67108863;H*=W)V++;V--,H=H/W|0;var M=J.length-F,T=M%V,E=Math.min(M,M-T)+F,$=0;for(var q=F;q<E;q+=V)if($=C(J,q,q+V,W),this.imuln(H),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($);if(T!==0){var j=1;$=C(J,q,J.length,W);for(q=0;q<T;q++)j*=W;if(this.imuln(j),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($)}this.strip()},Y.prototype.copy=function(J){J.words=Array(this.length);for(var W=0;W<this.length;W++)J.words[W]=this.words[W];J.length=this.length,J.negative=this.negative,J.red=this.red},Y.prototype.clone=function(){var J=new Y(null);return this.copy(J),J},Y.prototype._expand=function(J){while(this.length<J)this.words[this.length++]=0;return this},Y.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Y.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Y.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var z=["","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],S=[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(Y.prototype.toString=function(J,W){J=J||10,W=W|0||1;var F;if(J===16||J==="hex"){F="";var V=0,H=0;for(var M=0;M<this.length;M++){var T=this.words[M],E=((T<<V|H)&16777215).toString(16);if(H=T>>>24-V&16777215,V+=2,V>=26)V-=26,M--;if(H!==0||M!==this.length-1)F=z[6-E.length]+E+F;else F=E+F}if(H!==0)F=H.toString(16)+F;while(F.length%W!==0)F="0"+F;if(this.negative!==0)F="-"+F;return F}if(J===(J|0)&&J>=2&&J<=36){var $=R[J],q=S[J];F="";var j=this.clone();j.negative=0;while(!j.isZero()){var L=j.modn(q).toString(J);if(j=j.idivn(q),!j.isZero())F=z[$-L.length]+L+F;else F=L+F}if(this.isZero())F="0"+F;while(F.length%W!==0)F="0"+F;if(this.negative!==0)F="-"+F;return F}G(!1,"Base should be between 2 and 36")},Y.prototype.toNumber=function(){var J=this.words[0];if(this.length===2)J+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)J+=4503599627370496+this.words[1]*67108864;else if(this.length>2)G(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-J:J},Y.prototype.toJSON=function(){return this.toString(16)},Y.prototype.toBuffer=function(J,W){return G(typeof K<"u"),this.toArrayLike(K,J,W)},Y.prototype.toArray=function(J,W){return this.toArrayLike(Array,J,W)},Y.prototype.toArrayLike=function(J,W,F){var V=this.byteLength(),H=F||Math.max(1,V);G(V<=H,"byte array longer than desired length"),G(H>0,"Requested array length <= 0"),this.strip();var M=W==="le",T=new J(H),E,$,q=this.clone();if(!M){for($=0;$<H-V;$++)T[$]=0;for($=0;!q.isZero();$++)E=q.andln(255),q.iushrn(8),T[H-$-1]=E}else{for($=0;!q.isZero();$++)E=q.andln(255),q.iushrn(8),T[$]=E;for(;$<H;$++)T[$]=0}return T},Math.clz32)Y.prototype._countBits=function(J){return 32-Math.clz32(J)};else Y.prototype._countBits=function(J){var W=J,F=0;if(W>=4096)F+=13,W>>>=13;if(W>=64)F+=7,W>>>=7;if(W>=8)F+=4,W>>>=4;if(W>=2)F+=2,W>>>=2;return F+W};Y.prototype._zeroBits=function(J){if(J===0)return 26;var W=J,F=0;if((W&8191)===0)F+=13,W>>>=13;if((W&127)===0)F+=7,W>>>=7;if((W&15)===0)F+=4,W>>>=4;if((W&3)===0)F+=2,W>>>=2;if((W&1)===0)F++;return F},Y.prototype.bitLength=function(){var J=this.words[this.length-1],W=this._countBits(J);return(this.length-1)*26+W};function P(J){var W=Array(J.bitLength());for(var F=0;F<W.length;F++){var V=F/26|0,H=F%26;W[F]=(J.words[V]&1<<H)>>>H}return W}Y.prototype.zeroBits=function(){if(this.isZero())return 0;var J=0;for(var W=0;W<this.length;W++){var F=this._zeroBits(this.words[W]);if(J+=F,F!==26)break}return J},Y.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Y.prototype.toTwos=function(J){if(this.negative!==0)return this.abs().inotn(J).iaddn(1);return this.clone()},Y.prototype.fromTwos=function(J){if(this.testn(J-1))return this.notn(J).iaddn(1).ineg();return this.clone()},Y.prototype.isNeg=function(){return this.negative!==0},Y.prototype.neg=function(){return this.clone().ineg()},Y.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Y.prototype.iuor=function(J){while(this.length<J.length)this.words[this.length++]=0;for(var W=0;W<J.length;W++)this.words[W]=this.words[W]|J.words[W];return this.strip()},Y.prototype.ior=function(J){return G((this.negative|J.negative)===0),this.iuor(J)},Y.prototype.or=function(J){if(this.length>J.length)return this.clone().ior(J);return J.clone().ior(this)},Y.prototype.uor=function(J){if(this.length>J.length)return this.clone().iuor(J);return J.clone().iuor(this)},Y.prototype.iuand=function(J){var W;if(this.length>J.length)W=J;else W=this;for(var F=0;F<W.length;F++)this.words[F]=this.words[F]&J.words[F];return this.length=W.length,this.strip()},Y.prototype.iand=function(J){return G((this.negative|J.negative)===0),this.iuand(J)},Y.prototype.and=function(J){if(this.length>J.length)return this.clone().iand(J);return J.clone().iand(this)},Y.prototype.uand=function(J){if(this.length>J.length)return this.clone().iuand(J);return J.clone().iuand(this)},Y.prototype.iuxor=function(J){var W,F;if(this.length>J.length)W=this,F=J;else W=J,F=this;for(var V=0;V<F.length;V++)this.words[V]=W.words[V]^F.words[V];if(this!==W)for(;V<W.length;V++)this.words[V]=W.words[V];return this.length=W.length,this.strip()},Y.prototype.ixor=function(J){return G((this.negative|J.negative)===0),this.iuxor(J)},Y.prototype.xor=function(J){if(this.length>J.length)return this.clone().ixor(J);return J.clone().ixor(this)},Y.prototype.uxor=function(J){if(this.length>J.length)return this.clone().iuxor(J);return J.clone().iuxor(this)},Y.prototype.inotn=function(J){G(typeof J==="number"&&J>=0);var W=Math.ceil(J/26)|0,F=J%26;if(this._expand(W),F>0)W--;for(var V=0;V<W;V++)this.words[V]=~this.words[V]&67108863;if(F>0)this.words[V]=~this.words[V]&67108863>>26-F;return this.strip()},Y.prototype.notn=function(J){return this.clone().inotn(J)},Y.prototype.setn=function(J,W){G(typeof J==="number"&&J>=0);var F=J/26|0,V=J%26;if(this._expand(F+1),W)this.words[F]=this.words[F]|1<<V;else this.words[F]=this.words[F]&~(1<<V);return this.strip()},Y.prototype.iadd=function(J){var W;if(this.negative!==0&&J.negative===0)return this.negative=0,W=this.isub(J),this.negative^=1,this._normSign();else if(this.negative===0&&J.negative!==0)return J.negative=0,W=this.isub(J),J.negative=1,W._normSign();var F,V;if(this.length>J.length)F=this,V=J;else F=J,V=this;var H=0;for(var M=0;M<V.length;M++)W=(F.words[M]|0)+(V.words[M]|0)+H,this.words[M]=W&67108863,H=W>>>26;for(;H!==0&&M<F.length;M++)W=(F.words[M]|0)+H,this.words[M]=W&67108863,H=W>>>26;if(this.length=F.length,H!==0)this.words[this.length]=H,this.length++;else if(F!==this)for(;M<F.length;M++)this.words[M]=F.words[M];return this},Y.prototype.add=function(J){var W;if(J.negative!==0&&this.negative===0)return J.negative=0,W=this.sub(J),J.negative^=1,W;else if(J.negative===0&&this.negative!==0)return this.negative=0,W=J.sub(this),this.negative=1,W;if(this.length>J.length)return this.clone().iadd(J);return J.clone().iadd(this)},Y.prototype.isub=function(J){if(J.negative!==0){J.negative=0;var W=this.iadd(J);return J.negative=1,W._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(J),this.negative=1,this._normSign();var F=this.cmp(J);if(F===0)return this.negative=0,this.length=1,this.words[0]=0,this;var V,H;if(F>0)V=this,H=J;else V=J,H=this;var M=0;for(var T=0;T<H.length;T++)W=(V.words[T]|0)-(H.words[T]|0)+M,M=W>>26,this.words[T]=W&67108863;for(;M!==0&&T<V.length;T++)W=(V.words[T]|0)+M,M=W>>26,this.words[T]=W&67108863;if(M===0&&T<V.length&&V!==this)for(;T<V.length;T++)this.words[T]=V.words[T];if(this.length=Math.max(this.length,T),V!==this)this.negative=1;return this.strip()},Y.prototype.sub=function(J){return this.clone().isub(J)};function N(J,W,F){F.negative=W.negative^J.negative;var V=J.length+W.length|0;F.length=V,V=V-1|0;var H=J.words[0]|0,M=W.words[0]|0,T=H*M,E=T&67108863,$=T/67108864|0;F.words[0]=E;for(var q=1;q<V;q++){var j=$>>>26,L=$&67108863,x=Math.min(q,W.length-1);for(var f=Math.max(0,q-J.length+1);f<=x;f++){var b=q-f|0;H=J.words[b]|0,M=W.words[f]|0,T=H*M+L,j+=T/67108864|0,L=T&67108863}F.words[q]=L|0,$=j|0}if($!==0)F.words[q]=$|0;else F.length--;return F.strip()}var I=function(J,W,F){var V=J.words,H=W.words,M=F.words,T=0,E,$,q,j=V[0]|0,L=j&8191,x=j>>>13,f=V[1]|0,b=f&8191,s=f>>>13,z0=V[2]|0,i=z0&8191,o=z0>>>13,W0=V[3]|0,r=W0&8191,X0=W0>>>13,d0=V[4]|0,c=d0&8191,m=d0>>>13,E0=V[5]|0,Z0=E0&8191,$0=E0>>>13,N0=V[6]|0,d=N0&8191,t=N0>>>13,l0=V[7]|0,e=l0&8191,F0=l0>>>13,ZX=V[8]|0,T0=ZX&8191,R0=ZX>>>13,kX=V[9]|0,C0=kX&8191,P0=kX>>>13,_X=H[0]|0,I0=_X&8191,L0=_X>>>13,HZ=H[1]|0,B0=HZ&8191,y0=HZ>>>13,FZ=H[2]|0,f0=FZ&8191,k0=FZ>>>13,$Z=H[3]|0,g0=$Z&8191,x0=$Z>>>13,tX=H[4]|0,h0=tX&8191,p0=tX>>>13,iX=H[5]|0,w0=iX&8191,y=iX>>>13,n=H[6]|0,Y0=n&8191,O0=n>>>13,n0=H[7]|0,A0=n0&8191,S0=n0>>>13,xX=H[8]|0,v0=xX&8191,c0=xX>>>13,GZ=H[9]|0,_0=GZ&8191,j0=GZ>>>13;F.negative=J.negative^W.negative,F.length=19,E=Math.imul(L,I0),$=Math.imul(L,L0),$=$+Math.imul(x,I0)|0,q=Math.imul(x,L0);var wX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(wX>>>26)|0,wX&=67108863,E=Math.imul(b,I0),$=Math.imul(b,L0),$=$+Math.imul(s,I0)|0,q=Math.imul(s,L0),E=E+Math.imul(L,B0)|0,$=$+Math.imul(L,y0)|0,$=$+Math.imul(x,B0)|0,q=q+Math.imul(x,y0)|0;var $X=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+($X>>>26)|0,$X&=67108863,E=Math.imul(i,I0),$=Math.imul(i,L0),$=$+Math.imul(o,I0)|0,q=Math.imul(o,L0),E=E+Math.imul(b,B0)|0,$=$+Math.imul(b,y0)|0,$=$+Math.imul(s,B0)|0,q=q+Math.imul(s,y0)|0,E=E+Math.imul(L,f0)|0,$=$+Math.imul(L,k0)|0,$=$+Math.imul(x,f0)|0,q=q+Math.imul(x,k0)|0;var JX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(JX>>>26)|0,JX&=67108863,E=Math.imul(r,I0),$=Math.imul(r,L0),$=$+Math.imul(X0,I0)|0,q=Math.imul(X0,L0),E=E+Math.imul(i,B0)|0,$=$+Math.imul(i,y0)|0,$=$+Math.imul(o,B0)|0,q=q+Math.imul(o,y0)|0,E=E+Math.imul(b,f0)|0,$=$+Math.imul(b,k0)|0,$=$+Math.imul(s,f0)|0,q=q+Math.imul(s,k0)|0,E=E+Math.imul(L,g0)|0,$=$+Math.imul(L,x0)|0,$=$+Math.imul(x,g0)|0,q=q+Math.imul(x,x0)|0;var TX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(TX>>>26)|0,TX&=67108863,E=Math.imul(c,I0),$=Math.imul(c,L0),$=$+Math.imul(m,I0)|0,q=Math.imul(m,L0),E=E+Math.imul(r,B0)|0,$=$+Math.imul(r,y0)|0,$=$+Math.imul(X0,B0)|0,q=q+Math.imul(X0,y0)|0,E=E+Math.imul(i,f0)|0,$=$+Math.imul(i,k0)|0,$=$+Math.imul(o,f0)|0,q=q+Math.imul(o,k0)|0,E=E+Math.imul(b,g0)|0,$=$+Math.imul(b,x0)|0,$=$+Math.imul(s,g0)|0,q=q+Math.imul(s,x0)|0,E=E+Math.imul(L,h0)|0,$=$+Math.imul(L,p0)|0,$=$+Math.imul(x,h0)|0,q=q+Math.imul(x,p0)|0;var AX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(AX>>>26)|0,AX&=67108863,E=Math.imul(Z0,I0),$=Math.imul(Z0,L0),$=$+Math.imul($0,I0)|0,q=Math.imul($0,L0),E=E+Math.imul(c,B0)|0,$=$+Math.imul(c,y0)|0,$=$+Math.imul(m,B0)|0,q=q+Math.imul(m,y0)|0,E=E+Math.imul(r,f0)|0,$=$+Math.imul(r,k0)|0,$=$+Math.imul(X0,f0)|0,q=q+Math.imul(X0,k0)|0,E=E+Math.imul(i,g0)|0,$=$+Math.imul(i,x0)|0,$=$+Math.imul(o,g0)|0,q=q+Math.imul(o,x0)|0,E=E+Math.imul(b,h0)|0,$=$+Math.imul(b,p0)|0,$=$+Math.imul(s,h0)|0,q=q+Math.imul(s,p0)|0,E=E+Math.imul(L,w0)|0,$=$+Math.imul(L,y)|0,$=$+Math.imul(x,w0)|0,q=q+Math.imul(x,y)|0;var fX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(fX>>>26)|0,fX&=67108863,E=Math.imul(d,I0),$=Math.imul(d,L0),$=$+Math.imul(t,I0)|0,q=Math.imul(t,L0),E=E+Math.imul(Z0,B0)|0,$=$+Math.imul(Z0,y0)|0,$=$+Math.imul($0,B0)|0,q=q+Math.imul($0,y0)|0,E=E+Math.imul(c,f0)|0,$=$+Math.imul(c,k0)|0,$=$+Math.imul(m,f0)|0,q=q+Math.imul(m,k0)|0,E=E+Math.imul(r,g0)|0,$=$+Math.imul(r,x0)|0,$=$+Math.imul(X0,g0)|0,q=q+Math.imul(X0,x0)|0,E=E+Math.imul(i,h0)|0,$=$+Math.imul(i,p0)|0,$=$+Math.imul(o,h0)|0,q=q+Math.imul(o,p0)|0,E=E+Math.imul(b,w0)|0,$=$+Math.imul(b,y)|0,$=$+Math.imul(s,w0)|0,q=q+Math.imul(s,y)|0,E=E+Math.imul(L,Y0)|0,$=$+Math.imul(L,O0)|0,$=$+Math.imul(x,Y0)|0,q=q+Math.imul(x,O0)|0;var gX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(gX>>>26)|0,gX&=67108863,E=Math.imul(e,I0),$=Math.imul(e,L0),$=$+Math.imul(F0,I0)|0,q=Math.imul(F0,L0),E=E+Math.imul(d,B0)|0,$=$+Math.imul(d,y0)|0,$=$+Math.imul(t,B0)|0,q=q+Math.imul(t,y0)|0,E=E+Math.imul(Z0,f0)|0,$=$+Math.imul(Z0,k0)|0,$=$+Math.imul($0,f0)|0,q=q+Math.imul($0,k0)|0,E=E+Math.imul(c,g0)|0,$=$+Math.imul(c,x0)|0,$=$+Math.imul(m,g0)|0,q=q+Math.imul(m,x0)|0,E=E+Math.imul(r,h0)|0,$=$+Math.imul(r,p0)|0,$=$+Math.imul(X0,h0)|0,q=q+Math.imul(X0,p0)|0,E=E+Math.imul(i,w0)|0,$=$+Math.imul(i,y)|0,$=$+Math.imul(o,w0)|0,q=q+Math.imul(o,y)|0,E=E+Math.imul(b,Y0)|0,$=$+Math.imul(b,O0)|0,$=$+Math.imul(s,Y0)|0,q=q+Math.imul(s,O0)|0,E=E+Math.imul(L,A0)|0,$=$+Math.imul(L,S0)|0,$=$+Math.imul(x,A0)|0,q=q+Math.imul(x,S0)|0;var hX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(hX>>>26)|0,hX&=67108863,E=Math.imul(T0,I0),$=Math.imul(T0,L0),$=$+Math.imul(R0,I0)|0,q=Math.imul(R0,L0),E=E+Math.imul(e,B0)|0,$=$+Math.imul(e,y0)|0,$=$+Math.imul(F0,B0)|0,q=q+Math.imul(F0,y0)|0,E=E+Math.imul(d,f0)|0,$=$+Math.imul(d,k0)|0,$=$+Math.imul(t,f0)|0,q=q+Math.imul(t,k0)|0,E=E+Math.imul(Z0,g0)|0,$=$+Math.imul(Z0,x0)|0,$=$+Math.imul($0,g0)|0,q=q+Math.imul($0,x0)|0,E=E+Math.imul(c,h0)|0,$=$+Math.imul(c,p0)|0,$=$+Math.imul(m,h0)|0,q=q+Math.imul(m,p0)|0,E=E+Math.imul(r,w0)|0,$=$+Math.imul(r,y)|0,$=$+Math.imul(X0,w0)|0,q=q+Math.imul(X0,y)|0,E=E+Math.imul(i,Y0)|0,$=$+Math.imul(i,O0)|0,$=$+Math.imul(o,Y0)|0,q=q+Math.imul(o,O0)|0,E=E+Math.imul(b,A0)|0,$=$+Math.imul(b,S0)|0,$=$+Math.imul(s,A0)|0,q=q+Math.imul(s,S0)|0,E=E+Math.imul(L,v0)|0,$=$+Math.imul(L,c0)|0,$=$+Math.imul(x,v0)|0,q=q+Math.imul(x,c0)|0;var pX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(pX>>>26)|0,pX&=67108863,E=Math.imul(C0,I0),$=Math.imul(C0,L0),$=$+Math.imul(P0,I0)|0,q=Math.imul(P0,L0),E=E+Math.imul(T0,B0)|0,$=$+Math.imul(T0,y0)|0,$=$+Math.imul(R0,B0)|0,q=q+Math.imul(R0,y0)|0,E=E+Math.imul(e,f0)|0,$=$+Math.imul(e,k0)|0,$=$+Math.imul(F0,f0)|0,q=q+Math.imul(F0,k0)|0,E=E+Math.imul(d,g0)|0,$=$+Math.imul(d,x0)|0,$=$+Math.imul(t,g0)|0,q=q+Math.imul(t,x0)|0,E=E+Math.imul(Z0,h0)|0,$=$+Math.imul(Z0,p0)|0,$=$+Math.imul($0,h0)|0,q=q+Math.imul($0,p0)|0,E=E+Math.imul(c,w0)|0,$=$+Math.imul(c,y)|0,$=$+Math.imul(m,w0)|0,q=q+Math.imul(m,y)|0,E=E+Math.imul(r,Y0)|0,$=$+Math.imul(r,O0)|0,$=$+Math.imul(X0,Y0)|0,q=q+Math.imul(X0,O0)|0,E=E+Math.imul(i,A0)|0,$=$+Math.imul(i,S0)|0,$=$+Math.imul(o,A0)|0,q=q+Math.imul(o,S0)|0,E=E+Math.imul(b,v0)|0,$=$+Math.imul(b,c0)|0,$=$+Math.imul(s,v0)|0,q=q+Math.imul(s,c0)|0,E=E+Math.imul(L,_0)|0,$=$+Math.imul(L,j0)|0,$=$+Math.imul(x,_0)|0,q=q+Math.imul(x,j0)|0;var cX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(cX>>>26)|0,cX&=67108863,E=Math.imul(C0,B0),$=Math.imul(C0,y0),$=$+Math.imul(P0,B0)|0,q=Math.imul(P0,y0),E=E+Math.imul(T0,f0)|0,$=$+Math.imul(T0,k0)|0,$=$+Math.imul(R0,f0)|0,q=q+Math.imul(R0,k0)|0,E=E+Math.imul(e,g0)|0,$=$+Math.imul(e,x0)|0,$=$+Math.imul(F0,g0)|0,q=q+Math.imul(F0,x0)|0,E=E+Math.imul(d,h0)|0,$=$+Math.imul(d,p0)|0,$=$+Math.imul(t,h0)|0,q=q+Math.imul(t,p0)|0,E=E+Math.imul(Z0,w0)|0,$=$+Math.imul(Z0,y)|0,$=$+Math.imul($0,w0)|0,q=q+Math.imul($0,y)|0,E=E+Math.imul(c,Y0)|0,$=$+Math.imul(c,O0)|0,$=$+Math.imul(m,Y0)|0,q=q+Math.imul(m,O0)|0,E=E+Math.imul(r,A0)|0,$=$+Math.imul(r,S0)|0,$=$+Math.imul(X0,A0)|0,q=q+Math.imul(X0,S0)|0,E=E+Math.imul(i,v0)|0,$=$+Math.imul(i,c0)|0,$=$+Math.imul(o,v0)|0,q=q+Math.imul(o,c0)|0,E=E+Math.imul(b,_0)|0,$=$+Math.imul(b,j0)|0,$=$+Math.imul(s,_0)|0,q=q+Math.imul(s,j0)|0;var uX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(uX>>>26)|0,uX&=67108863,E=Math.imul(C0,f0),$=Math.imul(C0,k0),$=$+Math.imul(P0,f0)|0,q=Math.imul(P0,k0),E=E+Math.imul(T0,g0)|0,$=$+Math.imul(T0,x0)|0,$=$+Math.imul(R0,g0)|0,q=q+Math.imul(R0,x0)|0,E=E+Math.imul(e,h0)|0,$=$+Math.imul(e,p0)|0,$=$+Math.imul(F0,h0)|0,q=q+Math.imul(F0,p0)|0,E=E+Math.imul(d,w0)|0,$=$+Math.imul(d,y)|0,$=$+Math.imul(t,w0)|0,q=q+Math.imul(t,y)|0,E=E+Math.imul(Z0,Y0)|0,$=$+Math.imul(Z0,O0)|0,$=$+Math.imul($0,Y0)|0,q=q+Math.imul($0,O0)|0,E=E+Math.imul(c,A0)|0,$=$+Math.imul(c,S0)|0,$=$+Math.imul(m,A0)|0,q=q+Math.imul(m,S0)|0,E=E+Math.imul(r,v0)|0,$=$+Math.imul(r,c0)|0,$=$+Math.imul(X0,v0)|0,q=q+Math.imul(X0,c0)|0,E=E+Math.imul(i,_0)|0,$=$+Math.imul(i,j0)|0,$=$+Math.imul(o,_0)|0,q=q+Math.imul(o,j0)|0;var bX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(bX>>>26)|0,bX&=67108863,E=Math.imul(C0,g0),$=Math.imul(C0,x0),$=$+Math.imul(P0,g0)|0,q=Math.imul(P0,x0),E=E+Math.imul(T0,h0)|0,$=$+Math.imul(T0,p0)|0,$=$+Math.imul(R0,h0)|0,q=q+Math.imul(R0,p0)|0,E=E+Math.imul(e,w0)|0,$=$+Math.imul(e,y)|0,$=$+Math.imul(F0,w0)|0,q=q+Math.imul(F0,y)|0,E=E+Math.imul(d,Y0)|0,$=$+Math.imul(d,O0)|0,$=$+Math.imul(t,Y0)|0,q=q+Math.imul(t,O0)|0,E=E+Math.imul(Z0,A0)|0,$=$+Math.imul(Z0,S0)|0,$=$+Math.imul($0,A0)|0,q=q+Math.imul($0,S0)|0,E=E+Math.imul(c,v0)|0,$=$+Math.imul(c,c0)|0,$=$+Math.imul(m,v0)|0,q=q+Math.imul(m,c0)|0,E=E+Math.imul(r,_0)|0,$=$+Math.imul(r,j0)|0,$=$+Math.imul(X0,_0)|0,q=q+Math.imul(X0,j0)|0;var dX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(dX>>>26)|0,dX&=67108863,E=Math.imul(C0,h0),$=Math.imul(C0,p0),$=$+Math.imul(P0,h0)|0,q=Math.imul(P0,p0),E=E+Math.imul(T0,w0)|0,$=$+Math.imul(T0,y)|0,$=$+Math.imul(R0,w0)|0,q=q+Math.imul(R0,y)|0,E=E+Math.imul(e,Y0)|0,$=$+Math.imul(e,O0)|0,$=$+Math.imul(F0,Y0)|0,q=q+Math.imul(F0,O0)|0,E=E+Math.imul(d,A0)|0,$=$+Math.imul(d,S0)|0,$=$+Math.imul(t,A0)|0,q=q+Math.imul(t,S0)|0,E=E+Math.imul(Z0,v0)|0,$=$+Math.imul(Z0,c0)|0,$=$+Math.imul($0,v0)|0,q=q+Math.imul($0,c0)|0,E=E+Math.imul(c,_0)|0,$=$+Math.imul(c,j0)|0,$=$+Math.imul(m,_0)|0,q=q+Math.imul(m,j0)|0;var lX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(lX>>>26)|0,lX&=67108863,E=Math.imul(C0,w0),$=Math.imul(C0,y),$=$+Math.imul(P0,w0)|0,q=Math.imul(P0,y),E=E+Math.imul(T0,Y0)|0,$=$+Math.imul(T0,O0)|0,$=$+Math.imul(R0,Y0)|0,q=q+Math.imul(R0,O0)|0,E=E+Math.imul(e,A0)|0,$=$+Math.imul(e,S0)|0,$=$+Math.imul(F0,A0)|0,q=q+Math.imul(F0,S0)|0,E=E+Math.imul(d,v0)|0,$=$+Math.imul(d,c0)|0,$=$+Math.imul(t,v0)|0,q=q+Math.imul(t,c0)|0,E=E+Math.imul(Z0,_0)|0,$=$+Math.imul(Z0,j0)|0,$=$+Math.imul($0,_0)|0,q=q+Math.imul($0,j0)|0;var mX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(mX>>>26)|0,mX&=67108863,E=Math.imul(C0,Y0),$=Math.imul(C0,O0),$=$+Math.imul(P0,Y0)|0,q=Math.imul(P0,O0),E=E+Math.imul(T0,A0)|0,$=$+Math.imul(T0,S0)|0,$=$+Math.imul(R0,A0)|0,q=q+Math.imul(R0,S0)|0,E=E+Math.imul(e,v0)|0,$=$+Math.imul(e,c0)|0,$=$+Math.imul(F0,v0)|0,q=q+Math.imul(F0,c0)|0,E=E+Math.imul(d,_0)|0,$=$+Math.imul(d,j0)|0,$=$+Math.imul(t,_0)|0,q=q+Math.imul(t,j0)|0;var oX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(oX>>>26)|0,oX&=67108863,E=Math.imul(C0,A0),$=Math.imul(C0,S0),$=$+Math.imul(P0,A0)|0,q=Math.imul(P0,S0),E=E+Math.imul(T0,v0)|0,$=$+Math.imul(T0,c0)|0,$=$+Math.imul(R0,v0)|0,q=q+Math.imul(R0,c0)|0,E=E+Math.imul(e,_0)|0,$=$+Math.imul(e,j0)|0,$=$+Math.imul(F0,_0)|0,q=q+Math.imul(F0,j0)|0;var nX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(nX>>>26)|0,nX&=67108863,E=Math.imul(C0,v0),$=Math.imul(C0,c0),$=$+Math.imul(P0,v0)|0,q=Math.imul(P0,c0),E=E+Math.imul(T0,_0)|0,$=$+Math.imul(T0,j0)|0,$=$+Math.imul(R0,_0)|0,q=q+Math.imul(R0,j0)|0;var sX=(T+E|0)+(($&8191)<<13)|0;T=(q+($>>>13)|0)+(sX>>>26)|0,sX&=67108863,E=Math.imul(C0,_0),$=Math.imul(C0,j0),$=$+Math.imul(P0,_0)|0,q=Math.imul(P0,j0);var rX=(T+E|0)+(($&8191)<<13)|0;if(T=(q+($>>>13)|0)+(rX>>>26)|0,rX&=67108863,M[0]=wX,M[1]=$X,M[2]=JX,M[3]=TX,M[4]=AX,M[5]=fX,M[6]=gX,M[7]=hX,M[8]=pX,M[9]=cX,M[10]=uX,M[11]=bX,M[12]=dX,M[13]=lX,M[14]=mX,M[15]=oX,M[16]=nX,M[17]=sX,M[18]=rX,T!==0)M[19]=T,F.length++;return F};if(!Math.imul)I=N;function B(J,W,F){F.negative=W.negative^J.negative,F.length=J.length+W.length;var V=0,H=0;for(var M=0;M<F.length-1;M++){var T=H;H=0;var E=V&67108863,$=Math.min(M,W.length-1);for(var q=Math.max(0,M-J.length+1);q<=$;q++){var j=M-q,L=J.words[j]|0,x=W.words[q]|0,f=L*x,b=f&67108863;T=T+(f/67108864|0)|0,b=b+E|0,E=b&67108863,T=T+(b>>>26)|0,H+=T>>>26,T&=67108863}F.words[M]=E,V=T,T=H}if(V!==0)F.words[M]=V;else F.length--;return F.strip()}function k(J,W,F){var V=new w;return V.mulp(J,W,F)}Y.prototype.mulTo=function(J,W){var F,V=this.length+J.length;if(this.length===10&&J.length===10)F=I(this,J,W);else if(V<63)F=N(this,J,W);else if(V<1024)F=B(this,J,W);else F=k(this,J,W);return F};function w(J,W){this.x=J,this.y=W}w.prototype.makeRBT=function(J){var W=Array(J),F=Y.prototype._countBits(J)-1;for(var V=0;V<J;V++)W[V]=this.revBin(V,F,J);return W},w.prototype.revBin=function(J,W,F){if(J===0||J===F-1)return J;var V=0;for(var H=0;H<W;H++)V|=(J&1)<<W-H-1,J>>=1;return V},w.prototype.permute=function(J,W,F,V,H,M){for(var T=0;T<M;T++)V[T]=W[J[T]],H[T]=F[J[T]]},w.prototype.transform=function(J,W,F,V,H,M){this.permute(M,J,W,F,V,H);for(var T=1;T<H;T<<=1){var E=T<<1,$=Math.cos(2*Math.PI/E),q=Math.sin(2*Math.PI/E);for(var j=0;j<H;j+=E){var L=$,x=q;for(var f=0;f<T;f++){var b=F[j+f],s=V[j+f],z0=F[j+f+T],i=V[j+f+T],o=L*z0-x*i;if(i=L*i+x*z0,z0=o,F[j+f]=b+z0,V[j+f]=s+i,F[j+f+T]=b-z0,V[j+f+T]=s-i,f!==E)o=$*L-q*x,x=$*x+q*L,L=o}}}},w.prototype.guessLen13b=function(J,W){var F=Math.max(W,J)|1,V=F&1,H=0;for(F=F/2|0;F;F=F>>>1)H++;return 1<<H+1+V},w.prototype.conjugate=function(J,W,F){if(F<=1)return;for(var V=0;V<F/2;V++){var H=J[V];J[V]=J[F-V-1],J[F-V-1]=H,H=W[V],W[V]=-W[F-V-1],W[F-V-1]=-H}},w.prototype.normalize13b=function(J,W){var F=0;for(var V=0;V<W/2;V++){var H=Math.round(J[2*V+1]/W)*8192+Math.round(J[2*V]/W)+F;if(J[V]=H&67108863,H<67108864)F=0;else F=H/67108864|0}return J},w.prototype.convert13b=function(J,W,F,V){var H=0;for(var M=0;M<W;M++)H=H+(J[M]|0),F[2*M]=H&8191,H=H>>>13,F[2*M+1]=H&8191,H=H>>>13;for(M=2*W;M<V;++M)F[M]=0;G(H===0),G((H&-8192)===0)},w.prototype.stub=function(J){var W=Array(J);for(var F=0;F<J;F++)W[F]=0;return W},w.prototype.mulp=function(J,W,F){var V=2*this.guessLen13b(J.length,W.length),H=this.makeRBT(V),M=this.stub(V),T=Array(V),E=Array(V),$=Array(V),q=Array(V),j=Array(V),L=Array(V),x=F.words;x.length=V,this.convert13b(J.words,J.length,T,V),this.convert13b(W.words,W.length,q,V),this.transform(T,M,E,$,V,H),this.transform(q,M,j,L,V,H);for(var f=0;f<V;f++){var b=E[f]*j[f]-$[f]*L[f];$[f]=E[f]*L[f]+$[f]*j[f],E[f]=b}return this.conjugate(E,$,V),this.transform(E,$,x,M,V,H),this.conjugate(x,M,V),this.normalize13b(x,V),F.negative=J.negative^W.negative,F.length=J.length+W.length,F.strip()},Y.prototype.mul=function(J){var W=new Y(null);return W.words=Array(this.length+J.length),this.mulTo(J,W)},Y.prototype.mulf=function(J){var W=new Y(null);return W.words=Array(this.length+J.length),k(this,J,W)},Y.prototype.imul=function(J){return this.clone().mulTo(J,this)},Y.prototype.imuln=function(J){G(typeof J==="number"),G(J<67108864);var W=0;for(var F=0;F<this.length;F++){var V=(this.words[F]|0)*J,H=(V&67108863)+(W&67108863);W>>=26,W+=V/67108864|0,W+=H>>>26,this.words[F]=H&67108863}if(W!==0)this.words[F]=W,this.length++;return this.length=J===0?1:this.length,this},Y.prototype.muln=function(J){return this.clone().imuln(J)},Y.prototype.sqr=function(){return this.mul(this)},Y.prototype.isqr=function(){return this.imul(this.clone())},Y.prototype.pow=function(J){var W=P(J);if(W.length===0)return new Y(1);var F=this;for(var V=0;V<W.length;V++,F=F.sqr())if(W[V]!==0)break;if(++V<W.length)for(var H=F.sqr();V<W.length;V++,H=H.sqr()){if(W[V]===0)continue;F=F.mul(H)}return F},Y.prototype.iushln=function(J){G(typeof J==="number"&&J>=0);var W=J%26,F=(J-W)/26,V=67108863>>>26-W<<26-W,H;if(W!==0){var M=0;for(H=0;H<this.length;H++){var T=this.words[H]&V,E=(this.words[H]|0)-T<<W;this.words[H]=E|M,M=T>>>26-W}if(M)this.words[H]=M,this.length++}if(F!==0){for(H=this.length-1;H>=0;H--)this.words[H+F]=this.words[H];for(H=0;H<F;H++)this.words[H]=0;this.length+=F}return this.strip()},Y.prototype.ishln=function(J){return G(this.negative===0),this.iushln(J)},Y.prototype.iushrn=function(J,W,F){G(typeof J==="number"&&J>=0);var V;if(W)V=(W-W%26)/26;else V=0;var H=J%26,M=Math.min((J-H)/26,this.length),T=67108863^67108863>>>H<<H,E=F;if(V-=M,V=Math.max(0,V),E){for(var $=0;$<M;$++)E.words[$]=this.words[$];E.length=M}if(M===0);else if(this.length>M){this.length-=M;for($=0;$<this.length;$++)this.words[$]=this.words[$+M]}else this.words[0]=0,this.length=1;var q=0;for($=this.length-1;$>=0&&(q!==0||$>=V);$--){var j=this.words[$]|0;this.words[$]=q<<26-H|j>>>H,q=j&T}if(E&&q!==0)E.words[E.length++]=q;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Y.prototype.ishrn=function(J,W,F){return G(this.negative===0),this.iushrn(J,W,F)},Y.prototype.shln=function(J){return this.clone().ishln(J)},Y.prototype.ushln=function(J){return this.clone().iushln(J)},Y.prototype.shrn=function(J){return this.clone().ishrn(J)},Y.prototype.ushrn=function(J){return this.clone().iushrn(J)},Y.prototype.testn=function(J){G(typeof J==="number"&&J>=0);var W=J%26,F=(J-W)/26,V=1<<W;if(this.length<=F)return!1;var H=this.words[F];return!!(H&V)},Y.prototype.imaskn=function(J){G(typeof J==="number"&&J>=0);var W=J%26,F=(J-W)/26;if(G(this.negative===0,"imaskn works only with positive numbers"),this.length<=F)return this;if(W!==0)F++;if(this.length=Math.min(F,this.length),W!==0){var V=67108863^67108863>>>W<<W;this.words[this.length-1]&=V}return this.strip()},Y.prototype.maskn=function(J){return this.clone().imaskn(J)},Y.prototype.iaddn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.isubn(-J);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<J)return this.words[0]=J-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(J),this.negative=1,this}return this._iaddn(J)},Y.prototype._iaddn=function(J){this.words[0]+=J;for(var W=0;W<this.length&&this.words[W]>=67108864;W++)if(this.words[W]-=67108864,W===this.length-1)this.words[W+1]=1;else this.words[W+1]++;return this.length=Math.max(this.length,W+1),this},Y.prototype.isubn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.iaddn(-J);if(this.negative!==0)return this.negative=0,this.iaddn(J),this.negative=1,this;if(this.words[0]-=J,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var W=0;W<this.length&&this.words[W]<0;W++)this.words[W]+=67108864,this.words[W+1]-=1;return this.strip()},Y.prototype.addn=function(J){return this.clone().iaddn(J)},Y.prototype.subn=function(J){return this.clone().isubn(J)},Y.prototype.iabs=function(){return this.negative=0,this},Y.prototype.abs=function(){return this.clone().iabs()},Y.prototype._ishlnsubmul=function(J,W,F){var V=J.length+F,H;this._expand(V);var M,T=0;for(H=0;H<J.length;H++){M=(this.words[H+F]|0)+T;var E=(J.words[H]|0)*W;M-=E&67108863,T=(M>>26)-(E/67108864|0),this.words[H+F]=M&67108863}for(;H<this.length-F;H++)M=(this.words[H+F]|0)+T,T=M>>26,this.words[H+F]=M&67108863;if(T===0)return this.strip();G(T===-1),T=0;for(H=0;H<this.length;H++)M=-(this.words[H]|0)+T,T=M>>26,this.words[H]=M&67108863;return this.negative=1,this.strip()},Y.prototype._wordDiv=function(J,W){var F=this.length-J.length,V=this.clone(),H=J,M=H.words[H.length-1]|0,T=this._countBits(M);if(F=26-T,F!==0)H=H.ushln(F),V.iushln(F),M=H.words[H.length-1]|0;var E=V.length-H.length,$;if(W!=="mod"){$=new Y(null),$.length=E+1,$.words=Array($.length);for(var q=0;q<$.length;q++)$.words[q]=0}var j=V.clone()._ishlnsubmul(H,1,E);if(j.negative===0){if(V=j,$)$.words[E]=1}for(var L=E-1;L>=0;L--){var x=(V.words[H.length+L]|0)*67108864+(V.words[H.length+L-1]|0);x=Math.min(x/M|0,67108863),V._ishlnsubmul(H,x,L);while(V.negative!==0)if(x--,V.negative=0,V._ishlnsubmul(H,1,L),!V.isZero())V.negative^=1;if($)$.words[L]=x}if($)$.strip();if(V.strip(),W!=="div"&&F!==0)V.iushrn(F);return{div:$||null,mod:V}},Y.prototype.divmod=function(J,W,F){if(G(!J.isZero()),this.isZero())return{div:new Y(0),mod:new Y(0)};var V,H,M;if(this.negative!==0&&J.negative===0){if(M=this.neg().divmod(J,W),W!=="mod")V=M.div.neg();if(W!=="div"){if(H=M.mod.neg(),F&&H.negative!==0)H.iadd(J)}return{div:V,mod:H}}if(this.negative===0&&J.negative!==0){if(M=this.divmod(J.neg(),W),W!=="mod")V=M.div.neg();return{div:V,mod:M.mod}}if((this.negative&J.negative)!==0){if(M=this.neg().divmod(J.neg(),W),W!=="div"){if(H=M.mod.neg(),F&&H.negative!==0)H.isub(J)}return{div:M.div,mod:H}}if(J.length>this.length||this.cmp(J)<0)return{div:new Y(0),mod:this};if(J.length===1){if(W==="div")return{div:this.divn(J.words[0]),mod:null};if(W==="mod")return{div:null,mod:new Y(this.modn(J.words[0]))};return{div:this.divn(J.words[0]),mod:new Y(this.modn(J.words[0]))}}return this._wordDiv(J,W)},Y.prototype.div=function(J){return this.divmod(J,"div",!1).div},Y.prototype.mod=function(J){return this.divmod(J,"mod",!1).mod},Y.prototype.umod=function(J){return this.divmod(J,"mod",!0).mod},Y.prototype.divRound=function(J){var W=this.divmod(J);if(W.mod.isZero())return W.div;var F=W.div.negative!==0?W.mod.isub(J):W.mod,V=J.ushrn(1),H=J.andln(1),M=F.cmp(V);if(M<0||H===1&&M===0)return W.div;return W.div.negative!==0?W.div.isubn(1):W.div.iaddn(1)},Y.prototype.modn=function(J){G(J<=67108863);var W=67108864%J,F=0;for(var V=this.length-1;V>=0;V--)F=(W*F+(this.words[V]|0))%J;return F},Y.prototype.idivn=function(J){G(J<=67108863);var W=0;for(var F=this.length-1;F>=0;F--){var V=(this.words[F]|0)+W*67108864;this.words[F]=V/J|0,W=V%J}return this.strip()},Y.prototype.divn=function(J){return this.clone().idivn(J)},Y.prototype.egcd=function(J){G(J.negative===0),G(!J.isZero());var W=this,F=J.clone();if(W.negative!==0)W=W.umod(J);else W=W.clone();var V=new Y(1),H=new Y(0),M=new Y(0),T=new Y(1),E=0;while(W.isEven()&&F.isEven())W.iushrn(1),F.iushrn(1),++E;var $=F.clone(),q=W.clone();while(!W.isZero()){for(var j=0,L=1;(W.words[0]&L)===0&&j<26;++j,L<<=1);if(j>0){W.iushrn(j);while(j-- >0){if(V.isOdd()||H.isOdd())V.iadd($),H.isub(q);V.iushrn(1),H.iushrn(1)}}for(var x=0,f=1;(F.words[0]&f)===0&&x<26;++x,f<<=1);if(x>0){F.iushrn(x);while(x-- >0){if(M.isOdd()||T.isOdd())M.iadd($),T.isub(q);M.iushrn(1),T.iushrn(1)}}if(W.cmp(F)>=0)W.isub(F),V.isub(M),H.isub(T);else F.isub(W),M.isub(V),T.isub(H)}return{a:M,b:T,gcd:F.iushln(E)}},Y.prototype._invmp=function(J){G(J.negative===0),G(!J.isZero());var W=this,F=J.clone();if(W.negative!==0)W=W.umod(J);else W=W.clone();var V=new Y(1),H=new Y(0),M=F.clone();while(W.cmpn(1)>0&&F.cmpn(1)>0){for(var T=0,E=1;(W.words[0]&E)===0&&T<26;++T,E<<=1);if(T>0){W.iushrn(T);while(T-- >0){if(V.isOdd())V.iadd(M);V.iushrn(1)}}for(var $=0,q=1;(F.words[0]&q)===0&&$<26;++$,q<<=1);if($>0){F.iushrn($);while($-- >0){if(H.isOdd())H.iadd(M);H.iushrn(1)}}if(W.cmp(F)>=0)W.isub(F),V.isub(H);else F.isub(W),H.isub(V)}var j;if(W.cmpn(1)===0)j=V;else j=H;if(j.cmpn(0)<0)j.iadd(J);return j},Y.prototype.gcd=function(J){if(this.isZero())return J.abs();if(J.isZero())return this.abs();var W=this.clone(),F=J.clone();W.negative=0,F.negative=0;for(var V=0;W.isEven()&&F.isEven();V++)W.iushrn(1),F.iushrn(1);do{while(W.isEven())W.iushrn(1);while(F.isEven())F.iushrn(1);var H=W.cmp(F);if(H<0){var M=W;W=F,F=M}else if(H===0||F.cmpn(1)===0)break;W.isub(F)}while(!0);return F.iushln(V)},Y.prototype.invm=function(J){return this.egcd(J).a.umod(J)},Y.prototype.isEven=function(){return(this.words[0]&1)===0},Y.prototype.isOdd=function(){return(this.words[0]&1)===1},Y.prototype.andln=function(J){return this.words[0]&J},Y.prototype.bincn=function(J){G(typeof J==="number");var W=J%26,F=(J-W)/26,V=1<<W;if(this.length<=F)return this._expand(F+1),this.words[F]|=V,this;var H=V;for(var M=F;H!==0&&M<this.length;M++){var T=this.words[M]|0;T+=H,H=T>>>26,T&=67108863,this.words[M]=T}if(H!==0)this.words[M]=H,this.length++;return this},Y.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Y.prototype.cmpn=function(J){var W=J<0;if(this.negative!==0&&!W)return-1;if(this.negative===0&&W)return 1;this.strip();var F;if(this.length>1)F=1;else{if(W)J=-J;G(J<=67108863,"Number is too big");var V=this.words[0]|0;F=V===J?0:V<J?-1:1}if(this.negative!==0)return-F|0;return F},Y.prototype.cmp=function(J){if(this.negative!==0&&J.negative===0)return-1;if(this.negative===0&&J.negative!==0)return 1;var W=this.ucmp(J);if(this.negative!==0)return-W|0;return W},Y.prototype.ucmp=function(J){if(this.length>J.length)return 1;if(this.length<J.length)return-1;var W=0;for(var F=this.length-1;F>=0;F--){var V=this.words[F]|0,H=J.words[F]|0;if(V===H)continue;if(V<H)W=-1;else if(V>H)W=1;break}return W},Y.prototype.gtn=function(J){return this.cmpn(J)===1},Y.prototype.gt=function(J){return this.cmp(J)===1},Y.prototype.gten=function(J){return this.cmpn(J)>=0},Y.prototype.gte=function(J){return this.cmp(J)>=0},Y.prototype.ltn=function(J){return this.cmpn(J)===-1},Y.prototype.lt=function(J){return this.cmp(J)===-1},Y.prototype.lten=function(J){return this.cmpn(J)<=0},Y.prototype.lte=function(J){return this.cmp(J)<=0},Y.prototype.eqn=function(J){return this.cmpn(J)===0},Y.prototype.eq=function(J){return this.cmp(J)===0},Y.red=function(J){return new l(J)},Y.prototype.toRed=function(J){return G(!this.red,"Already a number in reduction context"),G(this.negative===0,"red works only with positives"),J.convertTo(this)._forceRed(J)},Y.prototype.fromRed=function(){return G(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Y.prototype._forceRed=function(J){return this.red=J,this},Y.prototype.forceRed=function(J){return G(!this.red,"Already a number in reduction context"),this._forceRed(J)},Y.prototype.redAdd=function(J){return G(this.red,"redAdd works only with red numbers"),this.red.add(this,J)},Y.prototype.redIAdd=function(J){return G(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,J)},Y.prototype.redSub=function(J){return G(this.red,"redSub works only with red numbers"),this.red.sub(this,J)},Y.prototype.redISub=function(J){return G(this.red,"redISub works only with red numbers"),this.red.isub(this,J)},Y.prototype.redShl=function(J){return G(this.red,"redShl works only with red numbers"),this.red.shl(this,J)},Y.prototype.redMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.mul(this,J)},Y.prototype.redIMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.imul(this,J)},Y.prototype.redSqr=function(){return G(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Y.prototype.redISqr=function(){return G(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Y.prototype.redSqrt=function(){return G(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Y.prototype.redInvm=function(){return G(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Y.prototype.redNeg=function(){return G(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Y.prototype.redPow=function(J){return G(this.red&&!J.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,J)};var v={k256:null,p224:null,p192:null,p25519:null};function _(J,W){this.name=J,this.p=new Y(W,16),this.n=this.p.bitLength(),this.k=new Y(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}_.prototype._tmp=function(){var J=new Y(null);return J.words=Array(Math.ceil(this.n/13)),J},_.prototype.ireduce=function(J){var W=J,F;do this.split(W,this.tmp),W=this.imulK(W),W=W.iadd(this.tmp),F=W.bitLength();while(F>this.n);var V=F<this.n?-1:W.ucmp(this.p);if(V===0)W.words[0]=0,W.length=1;else if(V>0)W.isub(this.p);else if(W.strip!==void 0)W.strip();else W._strip();return W},_.prototype.split=function(J,W){J.iushrn(this.n,0,W)},_.prototype.imulK=function(J){return J.imul(this.k)};function u(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(u,_),u.prototype.split=function(J,W){var F=4194303,V=Math.min(J.length,9);for(var H=0;H<V;H++)W.words[H]=J.words[H];if(W.length=V,J.length<=9){J.words[0]=0,J.length=1;return}var M=J.words[9];W.words[W.length++]=M&F;for(H=10;H<J.length;H++){var T=J.words[H]|0;J.words[H-10]=(T&F)<<4|M>>>22,M=T}if(M>>>=22,J.words[H-10]=M,M===0&&J.length>10)J.length-=10;else J.length-=9},u.prototype.imulK=function(J){J.words[J.length]=0,J.words[J.length+1]=0,J.length+=2;var W=0;for(var F=0;F<J.length;F++){var V=J.words[F]|0;W+=V*977,J.words[F]=W&67108863,W=V*64+(W/67108864|0)}if(J.words[J.length-1]===0){if(J.length--,J.words[J.length-1]===0)J.length--}return J};function J0(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(J0,_);function H0(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(H0,_);function V0(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(V0,_),V0.prototype.imulK=function(J){var W=0;for(var F=0;F<J.length;F++){var V=(J.words[F]|0)*19+W,H=V&67108863;V>>>=26,J.words[F]=H,W=V}if(W!==0)J.words[J.length++]=W;return J},Y._prime=function(J){if(v[J])return v[J];var W;if(J==="k256")W=new u;else if(J==="p224")W=new J0;else if(J==="p192")W=new H0;else if(J==="p25519")W=new V0;else throw Error("Unknown prime "+J);return v[J]=W,W};function l(J){if(typeof J==="string"){var W=Y._prime(J);this.m=W.p,this.prime=W}else G(J.gtn(1),"modulus must be greater than 1"),this.m=J,this.prime=null}l.prototype._verify1=function(J){G(J.negative===0,"red works only with positives"),G(J.red,"red works only with red numbers")},l.prototype._verify2=function(J,W){G((J.negative|W.negative)===0,"red works only with positives"),G(J.red&&J.red===W.red,"red works only with red numbers")},l.prototype.imod=function(J){if(this.prime)return this.prime.ireduce(J)._forceRed(this);return J.umod(this.m)._forceRed(this)},l.prototype.neg=function(J){if(J.isZero())return J.clone();return this.m.sub(J)._forceRed(this)},l.prototype.add=function(J,W){this._verify2(J,W);var F=J.add(W);if(F.cmp(this.m)>=0)F.isub(this.m);return F._forceRed(this)},l.prototype.iadd=function(J,W){this._verify2(J,W);var F=J.iadd(W);if(F.cmp(this.m)>=0)F.isub(this.m);return F},l.prototype.sub=function(J,W){this._verify2(J,W);var F=J.sub(W);if(F.cmpn(0)<0)F.iadd(this.m);return F._forceRed(this)},l.prototype.isub=function(J,W){this._verify2(J,W);var F=J.isub(W);if(F.cmpn(0)<0)F.iadd(this.m);return F},l.prototype.shl=function(J,W){return this._verify1(J),this.imod(J.ushln(W))},l.prototype.imul=function(J,W){return this._verify2(J,W),this.imod(J.imul(W))},l.prototype.mul=function(J,W){return this._verify2(J,W),this.imod(J.mul(W))},l.prototype.isqr=function(J){return this.imul(J,J.clone())},l.prototype.sqr=function(J){return this.mul(J,J)},l.prototype.sqrt=function(J){if(J.isZero())return J.clone();var W=this.m.andln(3);if(G(W%2===1),W===3){var F=this.m.add(new Y(1)).iushrn(2);return this.pow(J,F)}var V=this.m.subn(1),H=0;while(!V.isZero()&&V.andln(1)===0)H++,V.iushrn(1);G(!V.isZero());var M=new Y(1).toRed(this),T=M.redNeg(),E=this.m.subn(1).iushrn(1),$=this.m.bitLength();$=new Y(2*$*$).toRed(this);while(this.pow($,E).cmp(T)!==0)$.redIAdd(T);var q=this.pow($,V),j=this.pow(J,V.addn(1).iushrn(1)),L=this.pow(J,V),x=H;while(L.cmp(M)!==0){var f=L;for(var b=0;f.cmp(M)!==0;b++)f=f.redSqr();G(b<x);var s=this.pow(q,new Y(1).iushln(x-b-1));j=j.redMul(s),q=s.redSqr(),L=L.redMul(q),x=b}return j},l.prototype.invm=function(J){var W=J._invmp(this.m);if(W.negative!==0)return W.negative=0,this.imod(W).redNeg();else return this.imod(W)},l.prototype.pow=function(J,W){if(W.isZero())return new Y(1).toRed(this);if(W.cmpn(1)===0)return J.clone();var F=4,V=Array(1<<F);V[0]=new Y(1).toRed(this),V[1]=J;for(var H=2;H<V.length;H++)V[H]=this.mul(V[H-1],J);var M=V[0],T=0,E=0,$=W.bitLength()%26;if($===0)$=26;for(H=W.length-1;H>=0;H--){var q=W.words[H];for(var j=$-1;j>=0;j--){var L=q>>j&1;if(M!==V[0])M=this.sqr(M);if(L===0&&T===0){E=0;continue}if(T<<=1,T|=L,E++,E!==F&&(H!==0||j!==0))continue;M=this.mul(M,V[T]),E=0,T=0}$=26}return M},l.prototype.convertTo=function(J){var W=J.umod(this.m);return W===J?W.clone():W},l.prototype.convertFrom=function(J){var W=J.clone();return W.red=null,W},Y.mont=function(J){return new U0(J)};function U0(J){if(l.call(this,J),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Y(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)}O(U0,l),U0.prototype.convertTo=function(J){return this.imod(J.ushln(this.shift))},U0.prototype.convertFrom=function(J){var W=this.imod(J.mul(this.rinv));return W.red=null,W},U0.prototype.imul=function(J,W){if(J.isZero()||W.isZero())return J.words[0]=0,J.length=1,J;var F=J.imul(W),V=F.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),H=F.isub(V).iushrn(this.shift),M=H;if(H.cmp(this.m)>=0)M=H.isub(this.m);else if(H.cmpn(0)<0)M=H.iadd(this.m);return M._forceRed(this)},U0.prototype.mul=function(J,W){if(J.isZero()||W.isZero())return new Y(0)._forceRed(this);var F=J.mul(W),V=F.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),H=F.isub(V).iushrn(this.shift),M=H;if(H.cmp(this.m)>=0)M=H.isub(this.m);else if(H.cmpn(0)<0)M=H.iadd(this.m);return M._forceRed(this)},U0.prototype.invm=function(J){var W=this.imod(J._invmp(this.m).mul(this.r2));return W._forceRed(this)}})(typeof Z>"u"||Z,X)}),SV=D0((X,Z)=>{var U=jY(),Q=qZ().Buffer;function G(O,Y){return Q.from(O.toRed(U.mont(Y.modulus)).redPow(new U(Y.publicExponent)).fromRed().toArray())}Z.exports=G}),xK=D0((X,Z)=>{(function(U,Q){function G(V,H){if(!V)throw Error(H||"Assertion failed")}function O(V,H){V.super_=H;var M=function(){};M.prototype=H.prototype,V.prototype=new M,V.prototype.constructor=V}function Y(V,H,M){if(Y.isBN(V))return V;if(this.negative=0,this.words=null,this.length=0,this.red=null,V!==null){if(H==="le"||H==="be")M=H,H=10;this._init(V||0,H||10,M||"be")}}if(typeof U==="object")U.exports=Y;else Q.BN=Y;Y.BN=Y,Y.wordSize=26;var K;try{if(typeof window<"u"&&typeof window.Buffer<"u")K=window.Buffer;else K=(UZ(),WX(QZ)).Buffer}catch(V){}Y.isBN=function(V){if(V instanceof Y)return!0;return V!==null&&typeof V==="object"&&V.constructor.wordSize===Y.wordSize&&Array.isArray(V.words)},Y.max=function(V,H){if(V.cmp(H)>0)return V;return H},Y.min=function(V,H){if(V.cmp(H)<0)return V;return H},Y.prototype._init=function(V,H,M){if(typeof V==="number")return this._initNumber(V,H,M);if(typeof V==="object")return this._initArray(V,H,M);if(H==="hex")H=16;G(H===(H|0)&&H>=2&&H<=36),V=V.toString().replace(/\s+/g,"");var T=0;if(V[0]==="-")T++,this.negative=1;if(T<V.length){if(H===16)this._parseHex(V,T,M);else if(this._parseBase(V,H,T),M==="le")this._initArray(this.toArray(),H,M)}},Y.prototype._initNumber=function(V,H,M){if(V<0)this.negative=1,V=-V;if(V<67108864)this.words=[V&67108863],this.length=1;else if(V<4503599627370496)this.words=[V&67108863,V/67108864&67108863],this.length=2;else G(V<9007199254740992),this.words=[V&67108863,V/67108864&67108863,1],this.length=3;if(M!=="le")return;this._initArray(this.toArray(),H,M)},Y.prototype._initArray=function(V,H,M){if(G(typeof V.length==="number"),V.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(V.length/3),this.words=Array(this.length);for(var T=0;T<this.length;T++)this.words[T]=0;var E,$,q=0;if(M==="be"){for(T=V.length-1,E=0;T>=0;T-=3)if($=V[T]|V[T-1]<<8|V[T-2]<<16,this.words[E]|=$<<q&67108863,this.words[E+1]=$>>>26-q&67108863,q+=24,q>=26)q-=26,E++}else if(M==="le"){for(T=0,E=0;T<V.length;T+=3)if($=V[T]|V[T+1]<<8|V[T+2]<<16,this.words[E]|=$<<q&67108863,this.words[E+1]=$>>>26-q&67108863,q+=24,q>=26)q-=26,E++}return this._strip()};function A(V,H){var M=V.charCodeAt(H);if(M>=48&&M<=57)return M-48;else if(M>=65&&M<=70)return M-55;else if(M>=97&&M<=102)return M-87;else G(!1,"Invalid character in "+V)}function D(V,H,M){var T=A(V,M);if(M-1>=H)T|=A(V,M-1)<<4;return T}Y.prototype._parseHex=function(V,H,M){this.length=Math.ceil((V.length-H)/6),this.words=Array(this.length);for(var T=0;T<this.length;T++)this.words[T]=0;var E=0,$=0,q;if(M==="be")for(T=V.length-1;T>=H;T-=2)if(q=D(V,H,T)<<E,this.words[$]|=q&67108863,E>=18)E-=18,$+=1,this.words[$]|=q>>>26;else E+=8;else{var j=V.length-H;for(T=j%2===0?H+1:H;T<V.length;T+=2)if(q=D(V,H,T)<<E,this.words[$]|=q&67108863,E>=18)E-=18,$+=1,this.words[$]|=q>>>26;else E+=8}this._strip()};function C(V,H,M,T){var E=0,$=0,q=Math.min(V.length,M);for(var j=H;j<q;j++){var L=V.charCodeAt(j)-48;if(E*=T,L>=49)$=L-49+10;else if(L>=17)$=L-17+10;else $=L;G(L>=0&&$<T,"Invalid character"),E+=$}return E}Y.prototype._parseBase=function(V,H,M){this.words=[0],this.length=1;for(var T=0,E=1;E<=67108863;E*=H)T++;T--,E=E/H|0;var $=V.length-M,q=$%T,j=Math.min($,$-q)+M,L=0;for(var x=M;x<j;x+=T)if(L=C(V,x,x+T,H),this.imuln(E),this.words[0]+L<67108864)this.words[0]+=L;else this._iaddn(L);if(q!==0){var f=1;L=C(V,x,V.length,H);for(x=0;x<q;x++)f*=H;if(this.imuln(f),this.words[0]+L<67108864)this.words[0]+=L;else this._iaddn(L)}this._strip()},Y.prototype.copy=function(V){V.words=Array(this.length);for(var H=0;H<this.length;H++)V.words[H]=this.words[H];V.length=this.length,V.negative=this.negative,V.red=this.red};function z(V,H){V.words=H.words,V.length=H.length,V.negative=H.negative,V.red=H.red}if(Y.prototype._move=function(V){z(V,this)},Y.prototype.clone=function(){var V=new Y(null);return this.copy(V),V},Y.prototype._expand=function(V){while(this.length<V)this.words[this.length++]=0;return this},Y.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Y.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{Y.prototype[Symbol.for("nodejs.util.inspect.custom")]=R}catch(V){Y.prototype.inspect=R}else Y.prototype.inspect=R;function R(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var S=["","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],N=[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(Y.prototype.toString=function(V,H){V=V||10,H=H|0||1;var M;if(V===16||V==="hex"){M="";var T=0,E=0;for(var $=0;$<this.length;$++){var q=this.words[$],j=((q<<T|E)&16777215).toString(16);if(E=q>>>24-T&16777215,T+=2,T>=26)T-=26,$--;if(E!==0||$!==this.length-1)M=S[6-j.length]+j+M;else M=j+M}if(E!==0)M=E.toString(16)+M;while(M.length%H!==0)M="0"+M;if(this.negative!==0)M="-"+M;return M}if(V===(V|0)&&V>=2&&V<=36){var L=P[V],x=N[V];M="";var f=this.clone();f.negative=0;while(!f.isZero()){var b=f.modrn(x).toString(V);if(f=f.idivn(x),!f.isZero())M=S[L-b.length]+b+M;else M=b+M}if(this.isZero())M="0"+M;while(M.length%H!==0)M="0"+M;if(this.negative!==0)M="-"+M;return M}G(!1,"Base should be between 2 and 36")},Y.prototype.toNumber=function(){var V=this.words[0];if(this.length===2)V+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)V+=4503599627370496+this.words[1]*67108864;else if(this.length>2)G(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-V:V},Y.prototype.toJSON=function(){return this.toString(16,2)},K)Y.prototype.toBuffer=function(V,H){return this.toArrayLike(K,V,H)};Y.prototype.toArray=function(V,H){return this.toArrayLike(Array,V,H)};var I=function(V,H){if(V.allocUnsafe)return V.allocUnsafe(H);return new V(H)};if(Y.prototype.toArrayLike=function(V,H,M){this._strip();var T=this.byteLength(),E=M||Math.max(1,T);G(T<=E,"byte array longer than desired length"),G(E>0,"Requested array length <= 0");var $=I(V,E),q=H==="le"?"LE":"BE";return this["_toArrayLike"+q]($,T),$},Y.prototype._toArrayLikeLE=function(V,H){var M=0,T=0;for(var E=0,$=0;E<this.length;E++){var q=this.words[E]<<$|T;if(V[M++]=q&255,M<V.length)V[M++]=q>>8&255;if(M<V.length)V[M++]=q>>16&255;if($===6){if(M<V.length)V[M++]=q>>24&255;T=0,$=0}else T=q>>>24,$+=2}if(M<V.length){V[M++]=T;while(M<V.length)V[M++]=0}},Y.prototype._toArrayLikeBE=function(V,H){var M=V.length-1,T=0;for(var E=0,$=0;E<this.length;E++){var q=this.words[E]<<$|T;if(V[M--]=q&255,M>=0)V[M--]=q>>8&255;if(M>=0)V[M--]=q>>16&255;if($===6){if(M>=0)V[M--]=q>>24&255;T=0,$=0}else T=q>>>24,$+=2}if(M>=0){V[M--]=T;while(M>=0)V[M--]=0}},Math.clz32)Y.prototype._countBits=function(V){return 32-Math.clz32(V)};else Y.prototype._countBits=function(V){var H=V,M=0;if(H>=4096)M+=13,H>>>=13;if(H>=64)M+=7,H>>>=7;if(H>=8)M+=4,H>>>=4;if(H>=2)M+=2,H>>>=2;return M+H};Y.prototype._zeroBits=function(V){if(V===0)return 26;var H=V,M=0;if((H&8191)===0)M+=13,H>>>=13;if((H&127)===0)M+=7,H>>>=7;if((H&15)===0)M+=4,H>>>=4;if((H&3)===0)M+=2,H>>>=2;if((H&1)===0)M++;return M},Y.prototype.bitLength=function(){var V=this.words[this.length-1],H=this._countBits(V);return(this.length-1)*26+H};function B(V){var H=Array(V.bitLength());for(var M=0;M<H.length;M++){var T=M/26|0,E=M%26;H[M]=V.words[T]>>>E&1}return H}Y.prototype.zeroBits=function(){if(this.isZero())return 0;var V=0;for(var H=0;H<this.length;H++){var M=this._zeroBits(this.words[H]);if(V+=M,M!==26)break}return V},Y.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Y.prototype.toTwos=function(V){if(this.negative!==0)return this.abs().inotn(V).iaddn(1);return this.clone()},Y.prototype.fromTwos=function(V){if(this.testn(V-1))return this.notn(V).iaddn(1).ineg();return this.clone()},Y.prototype.isNeg=function(){return this.negative!==0},Y.prototype.neg=function(){return this.clone().ineg()},Y.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Y.prototype.iuor=function(V){while(this.length<V.length)this.words[this.length++]=0;for(var H=0;H<V.length;H++)this.words[H]=this.words[H]|V.words[H];return this._strip()},Y.prototype.ior=function(V){return G((this.negative|V.negative)===0),this.iuor(V)},Y.prototype.or=function(V){if(this.length>V.length)return this.clone().ior(V);return V.clone().ior(this)},Y.prototype.uor=function(V){if(this.length>V.length)return this.clone().iuor(V);return V.clone().iuor(this)},Y.prototype.iuand=function(V){var H;if(this.length>V.length)H=V;else H=this;for(var M=0;M<H.length;M++)this.words[M]=this.words[M]&V.words[M];return this.length=H.length,this._strip()},Y.prototype.iand=function(V){return G((this.negative|V.negative)===0),this.iuand(V)},Y.prototype.and=function(V){if(this.length>V.length)return this.clone().iand(V);return V.clone().iand(this)},Y.prototype.uand=function(V){if(this.length>V.length)return this.clone().iuand(V);return V.clone().iuand(this)},Y.prototype.iuxor=function(V){var H,M;if(this.length>V.length)H=this,M=V;else H=V,M=this;for(var T=0;T<M.length;T++)this.words[T]=H.words[T]^M.words[T];if(this!==H)for(;T<H.length;T++)this.words[T]=H.words[T];return this.length=H.length,this._strip()},Y.prototype.ixor=function(V){return G((this.negative|V.negative)===0),this.iuxor(V)},Y.prototype.xor=function(V){if(this.length>V.length)return this.clone().ixor(V);return V.clone().ixor(this)},Y.prototype.uxor=function(V){if(this.length>V.length)return this.clone().iuxor(V);return V.clone().iuxor(this)},Y.prototype.inotn=function(V){G(typeof V==="number"&&V>=0);var H=Math.ceil(V/26)|0,M=V%26;if(this._expand(H),M>0)H--;for(var T=0;T<H;T++)this.words[T]=~this.words[T]&67108863;if(M>0)this.words[T]=~this.words[T]&67108863>>26-M;return this._strip()},Y.prototype.notn=function(V){return this.clone().inotn(V)},Y.prototype.setn=function(V,H){G(typeof V==="number"&&V>=0);var M=V/26|0,T=V%26;if(this._expand(M+1),H)this.words[M]=this.words[M]|1<<T;else this.words[M]=this.words[M]&~(1<<T);return this._strip()},Y.prototype.iadd=function(V){var H;if(this.negative!==0&&V.negative===0)return this.negative=0,H=this.isub(V),this.negative^=1,this._normSign();else if(this.negative===0&&V.negative!==0)return V.negative=0,H=this.isub(V),V.negative=1,H._normSign();var M,T;if(this.length>V.length)M=this,T=V;else M=V,T=this;var E=0;for(var $=0;$<T.length;$++)H=(M.words[$]|0)+(T.words[$]|0)+E,this.words[$]=H&67108863,E=H>>>26;for(;E!==0&&$<M.length;$++)H=(M.words[$]|0)+E,this.words[$]=H&67108863,E=H>>>26;if(this.length=M.length,E!==0)this.words[this.length]=E,this.length++;else if(M!==this)for(;$<M.length;$++)this.words[$]=M.words[$];return this},Y.prototype.add=function(V){var H;if(V.negative!==0&&this.negative===0)return V.negative=0,H=this.sub(V),V.negative^=1,H;else if(V.negative===0&&this.negative!==0)return this.negative=0,H=V.sub(this),this.negative=1,H;if(this.length>V.length)return this.clone().iadd(V);return V.clone().iadd(this)},Y.prototype.isub=function(V){if(V.negative!==0){V.negative=0;var H=this.iadd(V);return V.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(V),this.negative=1,this._normSign();var M=this.cmp(V);if(M===0)return this.negative=0,this.length=1,this.words[0]=0,this;var T,E;if(M>0)T=this,E=V;else T=V,E=this;var $=0;for(var q=0;q<E.length;q++)H=(T.words[q]|0)-(E.words[q]|0)+$,$=H>>26,this.words[q]=H&67108863;for(;$!==0&&q<T.length;q++)H=(T.words[q]|0)+$,$=H>>26,this.words[q]=H&67108863;if($===0&&q<T.length&&T!==this)for(;q<T.length;q++)this.words[q]=T.words[q];if(this.length=Math.max(this.length,q),T!==this)this.negative=1;return this._strip()},Y.prototype.sub=function(V){return this.clone().isub(V)};function k(V,H,M){M.negative=H.negative^V.negative;var T=V.length+H.length|0;M.length=T,T=T-1|0;var E=V.words[0]|0,$=H.words[0]|0,q=E*$,j=q&67108863,L=q/67108864|0;M.words[0]=j;for(var x=1;x<T;x++){var f=L>>>26,b=L&67108863,s=Math.min(x,H.length-1);for(var z0=Math.max(0,x-V.length+1);z0<=s;z0++){var i=x-z0|0;E=V.words[i]|0,$=H.words[z0]|0,q=E*$+b,f+=q/67108864|0,b=q&67108863}M.words[x]=b|0,L=f|0}if(L!==0)M.words[x]=L|0;else M.length--;return M._strip()}var w=function(V,H,M){var T=V.words,E=H.words,$=M.words,q=0,j,L,x,f=T[0]|0,b=f&8191,s=f>>>13,z0=T[1]|0,i=z0&8191,o=z0>>>13,W0=T[2]|0,r=W0&8191,X0=W0>>>13,d0=T[3]|0,c=d0&8191,m=d0>>>13,E0=T[4]|0,Z0=E0&8191,$0=E0>>>13,N0=T[5]|0,d=N0&8191,t=N0>>>13,l0=T[6]|0,e=l0&8191,F0=l0>>>13,ZX=T[7]|0,T0=ZX&8191,R0=ZX>>>13,kX=T[8]|0,C0=kX&8191,P0=kX>>>13,_X=T[9]|0,I0=_X&8191,L0=_X>>>13,HZ=E[0]|0,B0=HZ&8191,y0=HZ>>>13,FZ=E[1]|0,f0=FZ&8191,k0=FZ>>>13,$Z=E[2]|0,g0=$Z&8191,x0=$Z>>>13,tX=E[3]|0,h0=tX&8191,p0=tX>>>13,iX=E[4]|0,w0=iX&8191,y=iX>>>13,n=E[5]|0,Y0=n&8191,O0=n>>>13,n0=E[6]|0,A0=n0&8191,S0=n0>>>13,xX=E[7]|0,v0=xX&8191,c0=xX>>>13,GZ=E[8]|0,_0=GZ&8191,j0=GZ>>>13,wX=E[9]|0,$X=wX&8191,JX=wX>>>13;M.negative=V.negative^H.negative,M.length=19,j=Math.imul(b,B0),L=Math.imul(b,y0),L=L+Math.imul(s,B0)|0,x=Math.imul(s,y0);var TX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(TX>>>26)|0,TX&=67108863,j=Math.imul(i,B0),L=Math.imul(i,y0),L=L+Math.imul(o,B0)|0,x=Math.imul(o,y0),j=j+Math.imul(b,f0)|0,L=L+Math.imul(b,k0)|0,L=L+Math.imul(s,f0)|0,x=x+Math.imul(s,k0)|0;var AX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(AX>>>26)|0,AX&=67108863,j=Math.imul(r,B0),L=Math.imul(r,y0),L=L+Math.imul(X0,B0)|0,x=Math.imul(X0,y0),j=j+Math.imul(i,f0)|0,L=L+Math.imul(i,k0)|0,L=L+Math.imul(o,f0)|0,x=x+Math.imul(o,k0)|0,j=j+Math.imul(b,g0)|0,L=L+Math.imul(b,x0)|0,L=L+Math.imul(s,g0)|0,x=x+Math.imul(s,x0)|0;var fX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(fX>>>26)|0,fX&=67108863,j=Math.imul(c,B0),L=Math.imul(c,y0),L=L+Math.imul(m,B0)|0,x=Math.imul(m,y0),j=j+Math.imul(r,f0)|0,L=L+Math.imul(r,k0)|0,L=L+Math.imul(X0,f0)|0,x=x+Math.imul(X0,k0)|0,j=j+Math.imul(i,g0)|0,L=L+Math.imul(i,x0)|0,L=L+Math.imul(o,g0)|0,x=x+Math.imul(o,x0)|0,j=j+Math.imul(b,h0)|0,L=L+Math.imul(b,p0)|0,L=L+Math.imul(s,h0)|0,x=x+Math.imul(s,p0)|0;var gX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(gX>>>26)|0,gX&=67108863,j=Math.imul(Z0,B0),L=Math.imul(Z0,y0),L=L+Math.imul($0,B0)|0,x=Math.imul($0,y0),j=j+Math.imul(c,f0)|0,L=L+Math.imul(c,k0)|0,L=L+Math.imul(m,f0)|0,x=x+Math.imul(m,k0)|0,j=j+Math.imul(r,g0)|0,L=L+Math.imul(r,x0)|0,L=L+Math.imul(X0,g0)|0,x=x+Math.imul(X0,x0)|0,j=j+Math.imul(i,h0)|0,L=L+Math.imul(i,p0)|0,L=L+Math.imul(o,h0)|0,x=x+Math.imul(o,p0)|0,j=j+Math.imul(b,w0)|0,L=L+Math.imul(b,y)|0,L=L+Math.imul(s,w0)|0,x=x+Math.imul(s,y)|0;var hX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(hX>>>26)|0,hX&=67108863,j=Math.imul(d,B0),L=Math.imul(d,y0),L=L+Math.imul(t,B0)|0,x=Math.imul(t,y0),j=j+Math.imul(Z0,f0)|0,L=L+Math.imul(Z0,k0)|0,L=L+Math.imul($0,f0)|0,x=x+Math.imul($0,k0)|0,j=j+Math.imul(c,g0)|0,L=L+Math.imul(c,x0)|0,L=L+Math.imul(m,g0)|0,x=x+Math.imul(m,x0)|0,j=j+Math.imul(r,h0)|0,L=L+Math.imul(r,p0)|0,L=L+Math.imul(X0,h0)|0,x=x+Math.imul(X0,p0)|0,j=j+Math.imul(i,w0)|0,L=L+Math.imul(i,y)|0,L=L+Math.imul(o,w0)|0,x=x+Math.imul(o,y)|0,j=j+Math.imul(b,Y0)|0,L=L+Math.imul(b,O0)|0,L=L+Math.imul(s,Y0)|0,x=x+Math.imul(s,O0)|0;var pX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(pX>>>26)|0,pX&=67108863,j=Math.imul(e,B0),L=Math.imul(e,y0),L=L+Math.imul(F0,B0)|0,x=Math.imul(F0,y0),j=j+Math.imul(d,f0)|0,L=L+Math.imul(d,k0)|0,L=L+Math.imul(t,f0)|0,x=x+Math.imul(t,k0)|0,j=j+Math.imul(Z0,g0)|0,L=L+Math.imul(Z0,x0)|0,L=L+Math.imul($0,g0)|0,x=x+Math.imul($0,x0)|0,j=j+Math.imul(c,h0)|0,L=L+Math.imul(c,p0)|0,L=L+Math.imul(m,h0)|0,x=x+Math.imul(m,p0)|0,j=j+Math.imul(r,w0)|0,L=L+Math.imul(r,y)|0,L=L+Math.imul(X0,w0)|0,x=x+Math.imul(X0,y)|0,j=j+Math.imul(i,Y0)|0,L=L+Math.imul(i,O0)|0,L=L+Math.imul(o,Y0)|0,x=x+Math.imul(o,O0)|0,j=j+Math.imul(b,A0)|0,L=L+Math.imul(b,S0)|0,L=L+Math.imul(s,A0)|0,x=x+Math.imul(s,S0)|0;var cX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(cX>>>26)|0,cX&=67108863,j=Math.imul(T0,B0),L=Math.imul(T0,y0),L=L+Math.imul(R0,B0)|0,x=Math.imul(R0,y0),j=j+Math.imul(e,f0)|0,L=L+Math.imul(e,k0)|0,L=L+Math.imul(F0,f0)|0,x=x+Math.imul(F0,k0)|0,j=j+Math.imul(d,g0)|0,L=L+Math.imul(d,x0)|0,L=L+Math.imul(t,g0)|0,x=x+Math.imul(t,x0)|0,j=j+Math.imul(Z0,h0)|0,L=L+Math.imul(Z0,p0)|0,L=L+Math.imul($0,h0)|0,x=x+Math.imul($0,p0)|0,j=j+Math.imul(c,w0)|0,L=L+Math.imul(c,y)|0,L=L+Math.imul(m,w0)|0,x=x+Math.imul(m,y)|0,j=j+Math.imul(r,Y0)|0,L=L+Math.imul(r,O0)|0,L=L+Math.imul(X0,Y0)|0,x=x+Math.imul(X0,O0)|0,j=j+Math.imul(i,A0)|0,L=L+Math.imul(i,S0)|0,L=L+Math.imul(o,A0)|0,x=x+Math.imul(o,S0)|0,j=j+Math.imul(b,v0)|0,L=L+Math.imul(b,c0)|0,L=L+Math.imul(s,v0)|0,x=x+Math.imul(s,c0)|0;var uX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(uX>>>26)|0,uX&=67108863,j=Math.imul(C0,B0),L=Math.imul(C0,y0),L=L+Math.imul(P0,B0)|0,x=Math.imul(P0,y0),j=j+Math.imul(T0,f0)|0,L=L+Math.imul(T0,k0)|0,L=L+Math.imul(R0,f0)|0,x=x+Math.imul(R0,k0)|0,j=j+Math.imul(e,g0)|0,L=L+Math.imul(e,x0)|0,L=L+Math.imul(F0,g0)|0,x=x+Math.imul(F0,x0)|0,j=j+Math.imul(d,h0)|0,L=L+Math.imul(d,p0)|0,L=L+Math.imul(t,h0)|0,x=x+Math.imul(t,p0)|0,j=j+Math.imul(Z0,w0)|0,L=L+Math.imul(Z0,y)|0,L=L+Math.imul($0,w0)|0,x=x+Math.imul($0,y)|0,j=j+Math.imul(c,Y0)|0,L=L+Math.imul(c,O0)|0,L=L+Math.imul(m,Y0)|0,x=x+Math.imul(m,O0)|0,j=j+Math.imul(r,A0)|0,L=L+Math.imul(r,S0)|0,L=L+Math.imul(X0,A0)|0,x=x+Math.imul(X0,S0)|0,j=j+Math.imul(i,v0)|0,L=L+Math.imul(i,c0)|0,L=L+Math.imul(o,v0)|0,x=x+Math.imul(o,c0)|0,j=j+Math.imul(b,_0)|0,L=L+Math.imul(b,j0)|0,L=L+Math.imul(s,_0)|0,x=x+Math.imul(s,j0)|0;var bX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(bX>>>26)|0,bX&=67108863,j=Math.imul(I0,B0),L=Math.imul(I0,y0),L=L+Math.imul(L0,B0)|0,x=Math.imul(L0,y0),j=j+Math.imul(C0,f0)|0,L=L+Math.imul(C0,k0)|0,L=L+Math.imul(P0,f0)|0,x=x+Math.imul(P0,k0)|0,j=j+Math.imul(T0,g0)|0,L=L+Math.imul(T0,x0)|0,L=L+Math.imul(R0,g0)|0,x=x+Math.imul(R0,x0)|0,j=j+Math.imul(e,h0)|0,L=L+Math.imul(e,p0)|0,L=L+Math.imul(F0,h0)|0,x=x+Math.imul(F0,p0)|0,j=j+Math.imul(d,w0)|0,L=L+Math.imul(d,y)|0,L=L+Math.imul(t,w0)|0,x=x+Math.imul(t,y)|0,j=j+Math.imul(Z0,Y0)|0,L=L+Math.imul(Z0,O0)|0,L=L+Math.imul($0,Y0)|0,x=x+Math.imul($0,O0)|0,j=j+Math.imul(c,A0)|0,L=L+Math.imul(c,S0)|0,L=L+Math.imul(m,A0)|0,x=x+Math.imul(m,S0)|0,j=j+Math.imul(r,v0)|0,L=L+Math.imul(r,c0)|0,L=L+Math.imul(X0,v0)|0,x=x+Math.imul(X0,c0)|0,j=j+Math.imul(i,_0)|0,L=L+Math.imul(i,j0)|0,L=L+Math.imul(o,_0)|0,x=x+Math.imul(o,j0)|0,j=j+Math.imul(b,$X)|0,L=L+Math.imul(b,JX)|0,L=L+Math.imul(s,$X)|0,x=x+Math.imul(s,JX)|0;var dX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(dX>>>26)|0,dX&=67108863,j=Math.imul(I0,f0),L=Math.imul(I0,k0),L=L+Math.imul(L0,f0)|0,x=Math.imul(L0,k0),j=j+Math.imul(C0,g0)|0,L=L+Math.imul(C0,x0)|0,L=L+Math.imul(P0,g0)|0,x=x+Math.imul(P0,x0)|0,j=j+Math.imul(T0,h0)|0,L=L+Math.imul(T0,p0)|0,L=L+Math.imul(R0,h0)|0,x=x+Math.imul(R0,p0)|0,j=j+Math.imul(e,w0)|0,L=L+Math.imul(e,y)|0,L=L+Math.imul(F0,w0)|0,x=x+Math.imul(F0,y)|0,j=j+Math.imul(d,Y0)|0,L=L+Math.imul(d,O0)|0,L=L+Math.imul(t,Y0)|0,x=x+Math.imul(t,O0)|0,j=j+Math.imul(Z0,A0)|0,L=L+Math.imul(Z0,S0)|0,L=L+Math.imul($0,A0)|0,x=x+Math.imul($0,S0)|0,j=j+Math.imul(c,v0)|0,L=L+Math.imul(c,c0)|0,L=L+Math.imul(m,v0)|0,x=x+Math.imul(m,c0)|0,j=j+Math.imul(r,_0)|0,L=L+Math.imul(r,j0)|0,L=L+Math.imul(X0,_0)|0,x=x+Math.imul(X0,j0)|0,j=j+Math.imul(i,$X)|0,L=L+Math.imul(i,JX)|0,L=L+Math.imul(o,$X)|0,x=x+Math.imul(o,JX)|0;var lX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(lX>>>26)|0,lX&=67108863,j=Math.imul(I0,g0),L=Math.imul(I0,x0),L=L+Math.imul(L0,g0)|0,x=Math.imul(L0,x0),j=j+Math.imul(C0,h0)|0,L=L+Math.imul(C0,p0)|0,L=L+Math.imul(P0,h0)|0,x=x+Math.imul(P0,p0)|0,j=j+Math.imul(T0,w0)|0,L=L+Math.imul(T0,y)|0,L=L+Math.imul(R0,w0)|0,x=x+Math.imul(R0,y)|0,j=j+Math.imul(e,Y0)|0,L=L+Math.imul(e,O0)|0,L=L+Math.imul(F0,Y0)|0,x=x+Math.imul(F0,O0)|0,j=j+Math.imul(d,A0)|0,L=L+Math.imul(d,S0)|0,L=L+Math.imul(t,A0)|0,x=x+Math.imul(t,S0)|0,j=j+Math.imul(Z0,v0)|0,L=L+Math.imul(Z0,c0)|0,L=L+Math.imul($0,v0)|0,x=x+Math.imul($0,c0)|0,j=j+Math.imul(c,_0)|0,L=L+Math.imul(c,j0)|0,L=L+Math.imul(m,_0)|0,x=x+Math.imul(m,j0)|0,j=j+Math.imul(r,$X)|0,L=L+Math.imul(r,JX)|0,L=L+Math.imul(X0,$X)|0,x=x+Math.imul(X0,JX)|0;var mX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(mX>>>26)|0,mX&=67108863,j=Math.imul(I0,h0),L=Math.imul(I0,p0),L=L+Math.imul(L0,h0)|0,x=Math.imul(L0,p0),j=j+Math.imul(C0,w0)|0,L=L+Math.imul(C0,y)|0,L=L+Math.imul(P0,w0)|0,x=x+Math.imul(P0,y)|0,j=j+Math.imul(T0,Y0)|0,L=L+Math.imul(T0,O0)|0,L=L+Math.imul(R0,Y0)|0,x=x+Math.imul(R0,O0)|0,j=j+Math.imul(e,A0)|0,L=L+Math.imul(e,S0)|0,L=L+Math.imul(F0,A0)|0,x=x+Math.imul(F0,S0)|0,j=j+Math.imul(d,v0)|0,L=L+Math.imul(d,c0)|0,L=L+Math.imul(t,v0)|0,x=x+Math.imul(t,c0)|0,j=j+Math.imul(Z0,_0)|0,L=L+Math.imul(Z0,j0)|0,L=L+Math.imul($0,_0)|0,x=x+Math.imul($0,j0)|0,j=j+Math.imul(c,$X)|0,L=L+Math.imul(c,JX)|0,L=L+Math.imul(m,$X)|0,x=x+Math.imul(m,JX)|0;var oX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(oX>>>26)|0,oX&=67108863,j=Math.imul(I0,w0),L=Math.imul(I0,y),L=L+Math.imul(L0,w0)|0,x=Math.imul(L0,y),j=j+Math.imul(C0,Y0)|0,L=L+Math.imul(C0,O0)|0,L=L+Math.imul(P0,Y0)|0,x=x+Math.imul(P0,O0)|0,j=j+Math.imul(T0,A0)|0,L=L+Math.imul(T0,S0)|0,L=L+Math.imul(R0,A0)|0,x=x+Math.imul(R0,S0)|0,j=j+Math.imul(e,v0)|0,L=L+Math.imul(e,c0)|0,L=L+Math.imul(F0,v0)|0,x=x+Math.imul(F0,c0)|0,j=j+Math.imul(d,_0)|0,L=L+Math.imul(d,j0)|0,L=L+Math.imul(t,_0)|0,x=x+Math.imul(t,j0)|0,j=j+Math.imul(Z0,$X)|0,L=L+Math.imul(Z0,JX)|0,L=L+Math.imul($0,$X)|0,x=x+Math.imul($0,JX)|0;var nX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(nX>>>26)|0,nX&=67108863,j=Math.imul(I0,Y0),L=Math.imul(I0,O0),L=L+Math.imul(L0,Y0)|0,x=Math.imul(L0,O0),j=j+Math.imul(C0,A0)|0,L=L+Math.imul(C0,S0)|0,L=L+Math.imul(P0,A0)|0,x=x+Math.imul(P0,S0)|0,j=j+Math.imul(T0,v0)|0,L=L+Math.imul(T0,c0)|0,L=L+Math.imul(R0,v0)|0,x=x+Math.imul(R0,c0)|0,j=j+Math.imul(e,_0)|0,L=L+Math.imul(e,j0)|0,L=L+Math.imul(F0,_0)|0,x=x+Math.imul(F0,j0)|0,j=j+Math.imul(d,$X)|0,L=L+Math.imul(d,JX)|0,L=L+Math.imul(t,$X)|0,x=x+Math.imul(t,JX)|0;var sX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(sX>>>26)|0,sX&=67108863,j=Math.imul(I0,A0),L=Math.imul(I0,S0),L=L+Math.imul(L0,A0)|0,x=Math.imul(L0,S0),j=j+Math.imul(C0,v0)|0,L=L+Math.imul(C0,c0)|0,L=L+Math.imul(P0,v0)|0,x=x+Math.imul(P0,c0)|0,j=j+Math.imul(T0,_0)|0,L=L+Math.imul(T0,j0)|0,L=L+Math.imul(R0,_0)|0,x=x+Math.imul(R0,j0)|0,j=j+Math.imul(e,$X)|0,L=L+Math.imul(e,JX)|0,L=L+Math.imul(F0,$X)|0,x=x+Math.imul(F0,JX)|0;var rX=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(rX>>>26)|0,rX&=67108863,j=Math.imul(I0,v0),L=Math.imul(I0,c0),L=L+Math.imul(L0,v0)|0,x=Math.imul(L0,c0),j=j+Math.imul(C0,_0)|0,L=L+Math.imul(C0,j0)|0,L=L+Math.imul(P0,_0)|0,x=x+Math.imul(P0,j0)|0,j=j+Math.imul(T0,$X)|0,L=L+Math.imul(T0,JX)|0,L=L+Math.imul(R0,$X)|0,x=x+Math.imul(R0,JX)|0;var wJ=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(wJ>>>26)|0,wJ&=67108863,j=Math.imul(I0,_0),L=Math.imul(I0,j0),L=L+Math.imul(L0,_0)|0,x=Math.imul(L0,j0),j=j+Math.imul(C0,$X)|0,L=L+Math.imul(C0,JX)|0,L=L+Math.imul(P0,$X)|0,x=x+Math.imul(P0,JX)|0;var vJ=(q+j|0)+((L&8191)<<13)|0;q=(x+(L>>>13)|0)+(vJ>>>26)|0,vJ&=67108863,j=Math.imul(I0,$X),L=Math.imul(I0,JX),L=L+Math.imul(L0,$X)|0,x=Math.imul(L0,JX);var _J=(q+j|0)+((L&8191)<<13)|0;if(q=(x+(L>>>13)|0)+(_J>>>26)|0,_J&=67108863,$[0]=TX,$[1]=AX,$[2]=fX,$[3]=gX,$[4]=hX,$[5]=pX,$[6]=cX,$[7]=uX,$[8]=bX,$[9]=dX,$[10]=lX,$[11]=mX,$[12]=oX,$[13]=nX,$[14]=sX,$[15]=rX,$[16]=wJ,$[17]=vJ,$[18]=_J,q!==0)$[19]=q,M.length++;return M};if(!Math.imul)w=k;function v(V,H,M){M.negative=H.negative^V.negative,M.length=V.length+H.length;var T=0,E=0;for(var $=0;$<M.length-1;$++){var q=E;E=0;var j=T&67108863,L=Math.min($,H.length-1);for(var x=Math.max(0,$-V.length+1);x<=L;x++){var f=$-x,b=V.words[f]|0,s=H.words[x]|0,z0=b*s,i=z0&67108863;q=q+(z0/67108864|0)|0,i=i+j|0,j=i&67108863,q=q+(i>>>26)|0,E+=q>>>26,q&=67108863}M.words[$]=j,T=q,q=E}if(T!==0)M.words[$]=T;else M.length--;return M._strip()}function _(V,H,M){return v(V,H,M)}Y.prototype.mulTo=function(V,H){var M,T=this.length+V.length;if(this.length===10&&V.length===10)M=w(this,V,H);else if(T<63)M=k(this,V,H);else if(T<1024)M=v(this,V,H);else M=_(this,V,H);return M};function u(V,H){this.x=V,this.y=H}u.prototype.makeRBT=function(V){var H=Array(V),M=Y.prototype._countBits(V)-1;for(var T=0;T<V;T++)H[T]=this.revBin(T,M,V);return H},u.prototype.revBin=function(V,H,M){if(V===0||V===M-1)return V;var T=0;for(var E=0;E<H;E++)T|=(V&1)<<H-E-1,V>>=1;return T},u.prototype.permute=function(V,H,M,T,E,$){for(var q=0;q<$;q++)T[q]=H[V[q]],E[q]=M[V[q]]},u.prototype.transform=function(V,H,M,T,E,$){this.permute($,V,H,M,T,E);for(var q=1;q<E;q<<=1){var j=q<<1,L=Math.cos(2*Math.PI/j),x=Math.sin(2*Math.PI/j);for(var f=0;f<E;f+=j){var b=L,s=x;for(var z0=0;z0<q;z0++){var i=M[f+z0],o=T[f+z0],W0=M[f+z0+q],r=T[f+z0+q],X0=b*W0-s*r;if(r=b*r+s*W0,W0=X0,M[f+z0]=i+W0,T[f+z0]=o+r,M[f+z0+q]=i-W0,T[f+z0+q]=o-r,z0!==j)X0=L*b-x*s,s=L*s+x*b,b=X0}}}},u.prototype.guessLen13b=function(V,H){var M=Math.max(H,V)|1,T=M&1,E=0;for(M=M/2|0;M;M=M>>>1)E++;return 1<<E+1+T},u.prototype.conjugate=function(V,H,M){if(M<=1)return;for(var T=0;T<M/2;T++){var E=V[T];V[T]=V[M-T-1],V[M-T-1]=E,E=H[T],H[T]=-H[M-T-1],H[M-T-1]=-E}},u.prototype.normalize13b=function(V,H){var M=0;for(var T=0;T<H/2;T++){var E=Math.round(V[2*T+1]/H)*8192+Math.round(V[2*T]/H)+M;if(V[T]=E&67108863,E<67108864)M=0;else M=E/67108864|0}return V},u.prototype.convert13b=function(V,H,M,T){var E=0;for(var $=0;$<H;$++)E=E+(V[$]|0),M[2*$]=E&8191,E=E>>>13,M[2*$+1]=E&8191,E=E>>>13;for($=2*H;$<T;++$)M[$]=0;G(E===0),G((E&-8192)===0)},u.prototype.stub=function(V){var H=Array(V);for(var M=0;M<V;M++)H[M]=0;return H},u.prototype.mulp=function(V,H,M){var T=2*this.guessLen13b(V.length,H.length),E=this.makeRBT(T),$=this.stub(T),q=Array(T),j=Array(T),L=Array(T),x=Array(T),f=Array(T),b=Array(T),s=M.words;s.length=T,this.convert13b(V.words,V.length,q,T),this.convert13b(H.words,H.length,x,T),this.transform(q,$,j,L,T,E),this.transform(x,$,f,b,T,E);for(var z0=0;z0<T;z0++){var i=j[z0]*f[z0]-L[z0]*b[z0];L[z0]=j[z0]*b[z0]+L[z0]*f[z0],j[z0]=i}return this.conjugate(j,L,T),this.transform(j,L,s,$,T,E),this.conjugate(s,$,T),this.normalize13b(s,T),M.negative=V.negative^H.negative,M.length=V.length+H.length,M._strip()},Y.prototype.mul=function(V){var H=new Y(null);return H.words=Array(this.length+V.length),this.mulTo(V,H)},Y.prototype.mulf=function(V){var H=new Y(null);return H.words=Array(this.length+V.length),_(this,V,H)},Y.prototype.imul=function(V){return this.clone().mulTo(V,this)},Y.prototype.imuln=function(V){var H=V<0;if(H)V=-V;G(typeof V==="number"),G(V<67108864);var M=0;for(var T=0;T<this.length;T++){var E=(this.words[T]|0)*V,$=(E&67108863)+(M&67108863);M>>=26,M+=E/67108864|0,M+=$>>>26,this.words[T]=$&67108863}if(M!==0)this.words[T]=M,this.length++;return this.length=V===0?1:this.length,H?this.ineg():this},Y.prototype.muln=function(V){return this.clone().imuln(V)},Y.prototype.sqr=function(){return this.mul(this)},Y.prototype.isqr=function(){return this.imul(this.clone())},Y.prototype.pow=function(V){var H=B(V);if(H.length===0)return new Y(1);var M=this;for(var T=0;T<H.length;T++,M=M.sqr())if(H[T]!==0)break;if(++T<H.length)for(var E=M.sqr();T<H.length;T++,E=E.sqr()){if(H[T]===0)continue;M=M.mul(E)}return M},Y.prototype.iushln=function(V){G(typeof V==="number"&&V>=0);var H=V%26,M=(V-H)/26,T=67108863>>>26-H<<26-H,E;if(H!==0){var $=0;for(E=0;E<this.length;E++){var q=this.words[E]&T,j=(this.words[E]|0)-q<<H;this.words[E]=j|$,$=q>>>26-H}if($)this.words[E]=$,this.length++}if(M!==0){for(E=this.length-1;E>=0;E--)this.words[E+M]=this.words[E];for(E=0;E<M;E++)this.words[E]=0;this.length+=M}return this._strip()},Y.prototype.ishln=function(V){return G(this.negative===0),this.iushln(V)},Y.prototype.iushrn=function(V,H,M){G(typeof V==="number"&&V>=0);var T;if(H)T=(H-H%26)/26;else T=0;var E=V%26,$=Math.min((V-E)/26,this.length),q=67108863^67108863>>>E<<E,j=M;if(T-=$,T=Math.max(0,T),j){for(var L=0;L<$;L++)j.words[L]=this.words[L];j.length=$}if($===0);else if(this.length>$){this.length-=$;for(L=0;L<this.length;L++)this.words[L]=this.words[L+$]}else this.words[0]=0,this.length=1;var x=0;for(L=this.length-1;L>=0&&(x!==0||L>=T);L--){var f=this.words[L]|0;this.words[L]=x<<26-E|f>>>E,x=f&q}if(j&&x!==0)j.words[j.length++]=x;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},Y.prototype.ishrn=function(V,H,M){return G(this.negative===0),this.iushrn(V,H,M)},Y.prototype.shln=function(V){return this.clone().ishln(V)},Y.prototype.ushln=function(V){return this.clone().iushln(V)},Y.prototype.shrn=function(V){return this.clone().ishrn(V)},Y.prototype.ushrn=function(V){return this.clone().iushrn(V)},Y.prototype.testn=function(V){G(typeof V==="number"&&V>=0);var H=V%26,M=(V-H)/26,T=1<<H;if(this.length<=M)return!1;var E=this.words[M];return!!(E&T)},Y.prototype.imaskn=function(V){G(typeof V==="number"&&V>=0);var H=V%26,M=(V-H)/26;if(G(this.negative===0,"imaskn works only with positive numbers"),this.length<=M)return this;if(H!==0)M++;if(this.length=Math.min(M,this.length),H!==0){var T=67108863^67108863>>>H<<H;this.words[this.length-1]&=T}return this._strip()},Y.prototype.maskn=function(V){return this.clone().imaskn(V)},Y.prototype.iaddn=function(V){if(G(typeof V==="number"),G(V<67108864),V<0)return this.isubn(-V);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=V)return this.words[0]=V-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(V),this.negative=1,this}return this._iaddn(V)},Y.prototype._iaddn=function(V){this.words[0]+=V;for(var H=0;H<this.length&&this.words[H]>=67108864;H++)if(this.words[H]-=67108864,H===this.length-1)this.words[H+1]=1;else this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},Y.prototype.isubn=function(V){if(G(typeof V==="number"),G(V<67108864),V<0)return this.iaddn(-V);if(this.negative!==0)return this.negative=0,this.iaddn(V),this.negative=1,this;if(this.words[0]-=V,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H<this.length&&this.words[H]<0;H++)this.words[H]+=67108864,this.words[H+1]-=1;return this._strip()},Y.prototype.addn=function(V){return this.clone().iaddn(V)},Y.prototype.subn=function(V){return this.clone().isubn(V)},Y.prototype.iabs=function(){return this.negative=0,this},Y.prototype.abs=function(){return this.clone().iabs()},Y.prototype._ishlnsubmul=function(V,H,M){var T=V.length+M,E;this._expand(T);var $,q=0;for(E=0;E<V.length;E++){$=(this.words[E+M]|0)+q;var j=(V.words[E]|0)*H;$-=j&67108863,q=($>>26)-(j/67108864|0),this.words[E+M]=$&67108863}for(;E<this.length-M;E++)$=(this.words[E+M]|0)+q,q=$>>26,this.words[E+M]=$&67108863;if(q===0)return this._strip();G(q===-1),q=0;for(E=0;E<this.length;E++)$=-(this.words[E]|0)+q,q=$>>26,this.words[E]=$&67108863;return this.negative=1,this._strip()},Y.prototype._wordDiv=function(V,H){var M=this.length-V.length,T=this.clone(),E=V,$=E.words[E.length-1]|0,q=this._countBits($);if(M=26-q,M!==0)E=E.ushln(M),T.iushln(M),$=E.words[E.length-1]|0;var j=T.length-E.length,L;if(H!=="mod"){L=new Y(null),L.length=j+1,L.words=Array(L.length);for(var x=0;x<L.length;x++)L.words[x]=0}var f=T.clone()._ishlnsubmul(E,1,j);if(f.negative===0){if(T=f,L)L.words[j]=1}for(var b=j-1;b>=0;b--){var s=(T.words[E.length+b]|0)*67108864+(T.words[E.length+b-1]|0);s=Math.min(s/$|0,67108863),T._ishlnsubmul(E,s,b);while(T.negative!==0)if(s--,T.negative=0,T._ishlnsubmul(E,1,b),!T.isZero())T.negative^=1;if(L)L.words[b]=s}if(L)L._strip();if(T._strip(),H!=="div"&&M!==0)T.iushrn(M);return{div:L||null,mod:T}},Y.prototype.divmod=function(V,H,M){if(G(!V.isZero()),this.isZero())return{div:new Y(0),mod:new Y(0)};var T,E,$;if(this.negative!==0&&V.negative===0){if($=this.neg().divmod(V,H),H!=="mod")T=$.div.neg();if(H!=="div"){if(E=$.mod.neg(),M&&E.negative!==0)E.iadd(V)}return{div:T,mod:E}}if(this.negative===0&&V.negative!==0){if($=this.divmod(V.neg(),H),H!=="mod")T=$.div.neg();return{div:T,mod:$.mod}}if((this.negative&V.negative)!==0){if($=this.neg().divmod(V.neg(),H),H!=="div"){if(E=$.mod.neg(),M&&E.negative!==0)E.isub(V)}return{div:$.div,mod:E}}if(V.length>this.length||this.cmp(V)<0)return{div:new Y(0),mod:this};if(V.length===1){if(H==="div")return{div:this.divn(V.words[0]),mod:null};if(H==="mod")return{div:null,mod:new Y(this.modrn(V.words[0]))};return{div:this.divn(V.words[0]),mod:new Y(this.modrn(V.words[0]))}}return this._wordDiv(V,H)},Y.prototype.div=function(V){return this.divmod(V,"div",!1).div},Y.prototype.mod=function(V){return this.divmod(V,"mod",!1).mod},Y.prototype.umod=function(V){return this.divmod(V,"mod",!0).mod},Y.prototype.divRound=function(V){var H=this.divmod(V);if(H.mod.isZero())return H.div;var M=H.div.negative!==0?H.mod.isub(V):H.mod,T=V.ushrn(1),E=V.andln(1),$=M.cmp(T);if($<0||E===1&&$===0)return H.div;return H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},Y.prototype.modrn=function(V){var H=V<0;if(H)V=-V;G(V<=67108863);var M=67108864%V,T=0;for(var E=this.length-1;E>=0;E--)T=(M*T+(this.words[E]|0))%V;return H?-T:T},Y.prototype.modn=function(V){return this.modrn(V)},Y.prototype.idivn=function(V){var H=V<0;if(H)V=-V;G(V<=67108863);var M=0;for(var T=this.length-1;T>=0;T--){var E=(this.words[T]|0)+M*67108864;this.words[T]=E/V|0,M=E%V}return this._strip(),H?this.ineg():this},Y.prototype.divn=function(V){return this.clone().idivn(V)},Y.prototype.egcd=function(V){G(V.negative===0),G(!V.isZero());var H=this,M=V.clone();if(H.negative!==0)H=H.umod(V);else H=H.clone();var T=new Y(1),E=new Y(0),$=new Y(0),q=new Y(1),j=0;while(H.isEven()&&M.isEven())H.iushrn(1),M.iushrn(1),++j;var L=M.clone(),x=H.clone();while(!H.isZero()){for(var f=0,b=1;(H.words[0]&b)===0&&f<26;++f,b<<=1);if(f>0){H.iushrn(f);while(f-- >0){if(T.isOdd()||E.isOdd())T.iadd(L),E.isub(x);T.iushrn(1),E.iushrn(1)}}for(var s=0,z0=1;(M.words[0]&z0)===0&&s<26;++s,z0<<=1);if(s>0){M.iushrn(s);while(s-- >0){if($.isOdd()||q.isOdd())$.iadd(L),q.isub(x);$.iushrn(1),q.iushrn(1)}}if(H.cmp(M)>=0)H.isub(M),T.isub($),E.isub(q);else M.isub(H),$.isub(T),q.isub(E)}return{a:$,b:q,gcd:M.iushln(j)}},Y.prototype._invmp=function(V){G(V.negative===0),G(!V.isZero());var H=this,M=V.clone();if(H.negative!==0)H=H.umod(V);else H=H.clone();var T=new Y(1),E=new Y(0),$=M.clone();while(H.cmpn(1)>0&&M.cmpn(1)>0){for(var q=0,j=1;(H.words[0]&j)===0&&q<26;++q,j<<=1);if(q>0){H.iushrn(q);while(q-- >0){if(T.isOdd())T.iadd($);T.iushrn(1)}}for(var L=0,x=1;(M.words[0]&x)===0&&L<26;++L,x<<=1);if(L>0){M.iushrn(L);while(L-- >0){if(E.isOdd())E.iadd($);E.iushrn(1)}}if(H.cmp(M)>=0)H.isub(M),T.isub(E);else M.isub(H),E.isub(T)}var f;if(H.cmpn(1)===0)f=T;else f=E;if(f.cmpn(0)<0)f.iadd(V);return f},Y.prototype.gcd=function(V){if(this.isZero())return V.abs();if(V.isZero())return this.abs();var H=this.clone(),M=V.clone();H.negative=0,M.negative=0;for(var T=0;H.isEven()&&M.isEven();T++)H.iushrn(1),M.iushrn(1);do{while(H.isEven())H.iushrn(1);while(M.isEven())M.iushrn(1);var E=H.cmp(M);if(E<0){var $=H;H=M,M=$}else if(E===0||M.cmpn(1)===0)break;H.isub(M)}while(!0);return M.iushln(T)},Y.prototype.invm=function(V){return this.egcd(V).a.umod(V)},Y.prototype.isEven=function(){return(this.words[0]&1)===0},Y.prototype.isOdd=function(){return(this.words[0]&1)===1},Y.prototype.andln=function(V){return this.words[0]&V},Y.prototype.bincn=function(V){G(typeof V==="number");var H=V%26,M=(V-H)/26,T=1<<H;if(this.length<=M)return this._expand(M+1),this.words[M]|=T,this;var E=T;for(var $=M;E!==0&&$<this.length;$++){var q=this.words[$]|0;q+=E,E=q>>>26,q&=67108863,this.words[$]=q}if(E!==0)this.words[$]=E,this.length++;return this},Y.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Y.prototype.cmpn=function(V){var H=V<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this._strip();var M;if(this.length>1)M=1;else{if(H)V=-V;G(V<=67108863,"Number is too big");var T=this.words[0]|0;M=T===V?0:T<V?-1:1}if(this.negative!==0)return-M|0;return M},Y.prototype.cmp=function(V){if(this.negative!==0&&V.negative===0)return-1;if(this.negative===0&&V.negative!==0)return 1;var H=this.ucmp(V);if(this.negative!==0)return-H|0;return H},Y.prototype.ucmp=function(V){if(this.length>V.length)return 1;if(this.length<V.length)return-1;var H=0;for(var M=this.length-1;M>=0;M--){var T=this.words[M]|0,E=V.words[M]|0;if(T===E)continue;if(T<E)H=-1;else if(T>E)H=1;break}return H},Y.prototype.gtn=function(V){return this.cmpn(V)===1},Y.prototype.gt=function(V){return this.cmp(V)===1},Y.prototype.gten=function(V){return this.cmpn(V)>=0},Y.prototype.gte=function(V){return this.cmp(V)>=0},Y.prototype.ltn=function(V){return this.cmpn(V)===-1},Y.prototype.lt=function(V){return this.cmp(V)===-1},Y.prototype.lten=function(V){return this.cmpn(V)<=0},Y.prototype.lte=function(V){return this.cmp(V)<=0},Y.prototype.eqn=function(V){return this.cmpn(V)===0},Y.prototype.eq=function(V){return this.cmp(V)===0},Y.red=function(V){return new W(V)},Y.prototype.toRed=function(V){return G(!this.red,"Already a number in reduction context"),G(this.negative===0,"red works only with positives"),V.convertTo(this)._forceRed(V)},Y.prototype.fromRed=function(){return G(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Y.prototype._forceRed=function(V){return this.red=V,this},Y.prototype.forceRed=function(V){return G(!this.red,"Already a number in reduction context"),this._forceRed(V)},Y.prototype.redAdd=function(V){return G(this.red,"redAdd works only with red numbers"),this.red.add(this,V)},Y.prototype.redIAdd=function(V){return G(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,V)},Y.prototype.redSub=function(V){return G(this.red,"redSub works only with red numbers"),this.red.sub(this,V)},Y.prototype.redISub=function(V){return G(this.red,"redISub works only with red numbers"),this.red.isub(this,V)},Y.prototype.redShl=function(V){return G(this.red,"redShl works only with red numbers"),this.red.shl(this,V)},Y.prototype.redMul=function(V){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,V),this.red.mul(this,V)},Y.prototype.redIMul=function(V){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,V),this.red.imul(this,V)},Y.prototype.redSqr=function(){return G(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Y.prototype.redISqr=function(){return G(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Y.prototype.redSqrt=function(){return G(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Y.prototype.redInvm=function(){return G(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Y.prototype.redNeg=function(){return G(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Y.prototype.redPow=function(V){return G(this.red&&!V.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,V)};var J0={k256:null,p224:null,p192:null,p25519:null};function H0(V,H){this.name=V,this.p=new Y(H,16),this.n=this.p.bitLength(),this.k=new Y(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H0.prototype._tmp=function(){var V=new Y(null);return V.words=Array(Math.ceil(this.n/13)),V},H0.prototype.ireduce=function(V){var H=V,M;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),M=H.bitLength();while(M>this.n);var T=M<this.n?-1:H.ucmp(this.p);if(T===0)H.words[0]=0,H.length=1;else if(T>0)H.isub(this.p);else if(H.strip!==void 0)H.strip();else H._strip();return H},H0.prototype.split=function(V,H){V.iushrn(this.n,0,H)},H0.prototype.imulK=function(V){return V.imul(this.k)};function V0(){H0.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(V0,H0),V0.prototype.split=function(V,H){var M=4194303,T=Math.min(V.length,9);for(var E=0;E<T;E++)H.words[E]=V.words[E];if(H.length=T,V.length<=9){V.words[0]=0,V.length=1;return}var $=V.words[9];H.words[H.length++]=$&M;for(E=10;E<V.length;E++){var q=V.words[E]|0;V.words[E-10]=(q&M)<<4|$>>>22,$=q}if($>>>=22,V.words[E-10]=$,$===0&&V.length>10)V.length-=10;else V.length-=9},V0.prototype.imulK=function(V){V.words[V.length]=0,V.words[V.length+1]=0,V.length+=2;var H=0;for(var M=0;M<V.length;M++){var T=V.words[M]|0;H+=T*977,V.words[M]=H&67108863,H=T*64+(H/67108864|0)}if(V.words[V.length-1]===0){if(V.length--,V.words[V.length-1]===0)V.length--}return V};function l(){H0.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(l,H0);function U0(){H0.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(U0,H0);function J(){H0.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(J,H0),J.prototype.imulK=function(V){var H=0;for(var M=0;M<V.length;M++){var T=(V.words[M]|0)*19+H,E=T&67108863;T>>>=26,V.words[M]=E,H=T}if(H!==0)V.words[V.length++]=H;return V},Y._prime=function(V){if(J0[V])return J0[V];var H;if(V==="k256")H=new V0;else if(V==="p224")H=new l;else if(V==="p192")H=new U0;else if(V==="p25519")H=new J;else throw Error("Unknown prime "+V);return J0[V]=H,H};function W(V){if(typeof V==="string"){var H=Y._prime(V);this.m=H.p,this.prime=H}else G(V.gtn(1),"modulus must be greater than 1"),this.m=V,this.prime=null}W.prototype._verify1=function(V){G(V.negative===0,"red works only with positives"),G(V.red,"red works only with red numbers")},W.prototype._verify2=function(V,H){G((V.negative|H.negative)===0,"red works only with positives"),G(V.red&&V.red===H.red,"red works only with red numbers")},W.prototype.imod=function(V){if(this.prime)return this.prime.ireduce(V)._forceRed(this);return z(V,V.umod(this.m)._forceRed(this)),V},W.prototype.neg=function(V){if(V.isZero())return V.clone();return this.m.sub(V)._forceRed(this)},W.prototype.add=function(V,H){this._verify2(V,H);var M=V.add(H);if(M.cmp(this.m)>=0)M.isub(this.m);return M._forceRed(this)},W.prototype.iadd=function(V,H){this._verify2(V,H);var M=V.iadd(H);if(M.cmp(this.m)>=0)M.isub(this.m);return M},W.prototype.sub=function(V,H){this._verify2(V,H);var M=V.sub(H);if(M.cmpn(0)<0)M.iadd(this.m);return M._forceRed(this)},W.prototype.isub=function(V,H){this._verify2(V,H);var M=V.isub(H);if(M.cmpn(0)<0)M.iadd(this.m);return M},W.prototype.shl=function(V,H){return this._verify1(V),this.imod(V.ushln(H))},W.prototype.imul=function(V,H){return this._verify2(V,H),this.imod(V.imul(H))},W.prototype.mul=function(V,H){return this._verify2(V,H),this.imod(V.mul(H))},W.prototype.isqr=function(V){return this.imul(V,V.clone())},W.prototype.sqr=function(V){return this.mul(V,V)},W.prototype.sqrt=function(V){if(V.isZero())return V.clone();var H=this.m.andln(3);if(G(H%2===1),H===3){var M=this.m.add(new Y(1)).iushrn(2);return this.pow(V,M)}var T=this.m.subn(1),E=0;while(!T.isZero()&&T.andln(1)===0)E++,T.iushrn(1);G(!T.isZero());var $=new Y(1).toRed(this),q=$.redNeg(),j=this.m.subn(1).iushrn(1),L=this.m.bitLength();L=new Y(2*L*L).toRed(this);while(this.pow(L,j).cmp(q)!==0)L.redIAdd(q);var x=this.pow(L,T),f=this.pow(V,T.addn(1).iushrn(1)),b=this.pow(V,T),s=E;while(b.cmp($)!==0){var z0=b;for(var i=0;z0.cmp($)!==0;i++)z0=z0.redSqr();G(i<s);var o=this.pow(x,new Y(1).iushln(s-i-1));f=f.redMul(o),x=o.redSqr(),b=b.redMul(x),s=i}return f},W.prototype.invm=function(V){var H=V._invmp(this.m);if(H.negative!==0)return H.negative=0,this.imod(H).redNeg();else return this.imod(H)},W.prototype.pow=function(V,H){if(H.isZero())return new Y(1).toRed(this);if(H.cmpn(1)===0)return V.clone();var M=4,T=Array(1<<M);T[0]=new Y(1).toRed(this),T[1]=V;for(var E=2;E<T.length;E++)T[E]=this.mul(T[E-1],V);var $=T[0],q=0,j=0,L=H.bitLength()%26;if(L===0)L=26;for(E=H.length-1;E>=0;E--){var x=H.words[E];for(var f=L-1;f>=0;f--){var b=x>>f&1;if($!==T[0])$=this.sqr($);if(b===0&&q===0){j=0;continue}if(q<<=1,q|=b,j++,j!==M&&(E!==0||f!==0))continue;$=this.mul($,T[q]),j=0,q=0}L=26}return $},W.prototype.convertTo=function(V){var H=V.umod(this.m);return H===V?H.clone():H},W.prototype.convertFrom=function(V){var H=V.clone();return H.red=null,H},Y.mont=function(V){return new F(V)};function F(V){if(W.call(this,V),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Y(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)}O(F,W),F.prototype.convertTo=function(V){return this.imod(V.ushln(this.shift))},F.prototype.convertFrom=function(V){var H=this.imod(V.mul(this.rinv));return H.red=null,H},F.prototype.imul=function(V,H){if(V.isZero()||H.isZero())return V.words[0]=0,V.length=1,V;var M=V.imul(H),T=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=M.isub(T).iushrn(this.shift),$=E;if(E.cmp(this.m)>=0)$=E.isub(this.m);else if(E.cmpn(0)<0)$=E.iadd(this.m);return $._forceRed(this)},F.prototype.mul=function(V,H){if(V.isZero()||H.isZero())return new Y(0)._forceRed(this);var M=V.mul(H),T=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=M.isub(T).iushrn(this.shift),$=E;if(E.cmp(this.m)>=0)$=E.isub(this.m);else if(E.cmpn(0)<0)$=E.iadd(this.m);return $._forceRed(this)},F.prototype.invm=function(V){var H=this.imod(V._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(typeof Z>"u"||Z,X)}),LV=D0((X,Z)=>{var U=xK(),Q=GJ(),G=qZ().Buffer;function O(A){var D=A.modulus.byteLength(),C;do C=new U(Q(D));while(C.cmp(A.modulus)>=0||!C.umod(A.prime1)||!C.umod(A.prime2));return C}function Y(A){var D=O(A),C=D.toRed(U.mont(A.modulus)).redPow(new U(A.publicExponent)).fromRed();return{blinder:C,unblinder:D.invm(A.modulus)}}function K(A,D){var C=Y(D),z=D.modulus.byteLength(),R=new U(A).mul(C.blinder).umod(D.modulus),S=R.toRed(U.mont(D.prime1)),P=R.toRed(U.mont(D.prime2)),N=D.coefficient,I=D.prime1,B=D.prime2,k=S.redPow(D.exponent1).fromRed(),w=P.redPow(D.exponent2).fromRed(),v=k.isub(w).imul(N).umod(I).imul(B);return w.iadd(v).imul(C.unblinder).umod(D.modulus).toArrayLike(G,"be",z)}K.getr=O,Z.exports=K}),wK=D0((X,Z)=>{var U=TV(),Q=GJ(),G=VJ(),O=RV(),Y=PV(),K=jY(),A=SV(),D=LV(),C=qZ().Buffer;Z.exports=function(P,N,I){var B;if(P.padding)B=P.padding;else if(I)B=1;else B=4;var k=U(P),w;if(B===4)w=z(k,N);else if(B===1)w=R(k,N,I);else if(B===3){if(w=new K(N),w.cmp(k.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(I)return D(w,k);else return A(w,k)};function z(P,N){var I=P.modulus.byteLength(),B=N.length,k=G("sha1").update(C.alloc(0)).digest(),w=k.length,v=2*w;if(B>I-v-2)throw Error("message too long");var _=C.alloc(I-B-v-2),u=I-w-1,J0=Q(w),H0=Y(C.concat([k,_,C.alloc(1,1),N],u),O(J0,u)),V0=Y(J0,O(H0,w));return new K(C.concat([C.alloc(1),V0,H0],I))}function R(P,N,I){var B=N.length,k=P.modulus.byteLength();if(B>k-11)throw Error("message too long");var w;if(I)w=C.alloc(k-B-3,255);else w=S(k-B-3);return new K(C.concat([C.from([0,I?1:2]),w,C.alloc(1),N],k))}function S(P){var N=C.allocUnsafe(P),I=0,B=Q(P*2),k=0,w;while(I<P){if(k===B.length)B=Q(P*2),k=0;if(w=B[k++],w)N[I++]=w}return N}}),vK=D0((X,Z)=>{var U=TV(),Q=RV(),G=PV(),O=jY(),Y=LV(),K=VJ(),A=SV(),D=qZ().Buffer;Z.exports=function(S,P,N){var I;if(S.padding)I=S.padding;else if(N)I=1;else I=4;var B=U(S),k=B.modulus.byteLength();if(P.length>k||new O(P).cmp(B.modulus)>=0)throw Error("decryption error");var w;if(N)w=A(new O(P),B);else w=Y(P,B);var v=D.alloc(k-w.length);if(w=D.concat([v,w],k),I===4)return C(B,w);else if(I===1)return z(B,w,N);else if(I===3)return w;else throw Error("unknown padding")};function C(S,P){var N=S.modulus.byteLength(),I=K("sha1").update(D.alloc(0)).digest(),B=I.length;if(P[0]!==0)throw Error("decryption error");var k=P.slice(1,B+1),w=P.slice(B+1),v=G(k,Q(w,B)),_=G(w,Q(v,N-B-1));if(R(I,_.slice(0,B)))throw Error("decryption error");var u=B;while(_[u]===0)u++;if(_[u++]!==1)throw Error("decryption error");return _.slice(u)}function z(S,P,N){var I=P.slice(0,2),B=2,k=0;while(P[B++]!==0)if(B>=P.length){k++;break}var w=P.slice(2,B-1);if(I.toString("hex")!=="0002"&&!N||I.toString("hex")!=="0001"&&N)k++;if(w.length<8)k++;if(k)throw Error("decryption error");return P.slice(B)}function R(S,P){S=D.from(S),P=D.from(P);var N=0,I=S.length;if(S.length!==P.length)N++,I=Math.min(S.length,P.length);var B=-1;while(++B<I)N+=S[B]^P[B];return N}}),MY=D0((X)=>{X.publicEncrypt=wK(),X.privateDecrypt=vK(),X.privateEncrypt=function(Z,U){return X.publicEncrypt(Z,U,!0)},X.publicDecrypt=function(Z,U){return X.privateDecrypt(Z,U,!0)}}),_K=D0((X)=>{var Z=(EZ(),WX(KZ));if(typeof Z.publicEncrypt!=="function")Z=MY();if(X.publicEncrypt=Z.publicEncrypt,X.privateDecrypt=Z.privateDecrypt,typeof Z.privateEncrypt!=="function")X.privateEncrypt=MY().privateEncrypt;else X.privateEncrypt=Z.privateEncrypt;if(typeof Z.publicDecrypt!=="function")X.publicDecrypt=MY().publicDecrypt;else X.publicDecrypt=Z.publicDecrypt}),yK=D0((X)=>{var Z=qZ(),U=GJ(),Q=Z.Buffer,G=Z.kMaxLength,O=globalThis.crypto||globalThis.msCrypto,Y=Math.pow(2,32)-1;function K(R,S){if(typeof R!=="number"||R!==R)throw TypeError("offset must be a number");if(R>Y||R<0)throw TypeError("offset must be a uint32");if(R>G||R>S)throw RangeError("offset out of range")}function A(R,S,P){if(typeof R!=="number"||R!==R)throw TypeError("size must be a number");if(R>Y||R<0)throw TypeError("size must be a uint32");if(R+S>P||R>G)throw RangeError("buffer too small")}O&&O.getRandomValues,X.randomFill=D,X.randomFillSync=z;function D(R,S,P,N){if(!Q.isBuffer(R)&&!(R instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof S==="function")N=S,S=0,P=R.length;else if(typeof P==="function")N=P,P=R.length-S;else if(typeof N!=="function")throw TypeError('"cb" argument must be a function');return K(S,R.length),A(P,S,R.length),C(R,S,P,N)}function C(R,S,P,N){if(!1)var I,B;if(N){U(P,function(w,v){if(w)return N(w);v.copy(R,S),N(null,R)});return}var k=U(P);return k.copy(R,S),R}function z(R,S,P){if(typeof S>"u")S=0;if(!Q.isBuffer(R)&&!(R instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(K(S,R.length),P===void 0)P=R.length-S;return A(P,S,R.length),C(R,S,P)}}),fK=D0((X,Z)=>{var U=(EZ(),WX(KZ));if(typeof U.randomFill==="function"&&typeof U.randomFillSync==="function")X.randomFill=U.randomFill,X.randomFillSync=U.randomFillSync;else Z.exports=yK()}),gK=D0((X)=>{X.randomBytes=X.rng=X.pseudoRandomBytes=X.prng=GJ(),X.createHash=X.Hash=VJ(),X.createHmac=X.Hmac=eG();var Z=GF(),U=Object.keys(Z),Q=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(U);X.getHashes=function(){return Q};var G=OV();X.pbkdf2=G.pbkdf2,X.pbkdf2Sync=G.pbkdf2Sync;var O=dF();X.Cipher=O.Cipher,X.createCipher=O.createCipher,X.Cipheriv=O.Cipheriv,X.createCipheriv=O.createCipheriv,X.Decipher=O.Decipher,X.createDecipher=O.createDecipher,X.Decipheriv=O.Decipheriv,X.createDecipheriv=O.createDecipheriv,X.getCiphers=O.getCiphers,X.listCiphers=O.listCiphers;var Y=lF();X.DiffieHellmanGroup=Y.DiffieHellmanGroup,X.createDiffieHellmanGroup=Y.createDiffieHellmanGroup,X.getDiffieHellman=Y.getDiffieHellman,X.createDiffieHellman=Y.createDiffieHellman,X.DiffieHellman=Y.DiffieHellman;var K=mF();X.createSign=K.createSign,X.Sign=K.Sign,X.createVerify=K.createVerify,X.Verify=K.Verify,X.createECDH=EK();var A=_K();X.publicEncrypt=A.publicEncrypt,X.privateEncrypt=A.privateEncrypt,X.publicDecrypt=A.publicDecrypt,X.privateDecrypt=A.privateDecrypt;var D=fK();X.randomFill=D.randomFill,X.randomFillSync=D.randomFillSync,X.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
|
|
28
|
+
we accept pull requests
|
|
29
|
+
https://github.com/browserify/crypto-browserify`)},X.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}}),VX=$F(gK(),1),hK=VX.prng,pK=VX.pseudoRandomBytes,cK=VX.rng,uK=VX.randomBytes,bK=VX.Hash,dK=VX.createHash,lK=VX.Hmac,mK=VX.createHmac,oK=VX.getHashes,nK=VX.pbkdf2,sK=VX.pbkdf2Sync,rK=VX.Cipher,aK=VX.createCipher,tK=VX.Cipheriv,iK=VX.createCipheriv,eK=VX.Decipher,X1=VX.createDecipher,Z1=VX.Decipheriv,Q1=VX.createDecipheriv,U1=VX.getCiphers,J1=VX.listCiphers,Y1=VX.DiffieHellmanGroup,$1=VX.createDiffieHellmanGroup,G1=VX.getDiffieHellman,V1=VX.createDiffieHellman,W1=VX.DiffieHellman,O1=VX.createSign,H1=VX.Sign,F1=VX.createVerify,K1=VX.Verify,E1=VX.createECDH,z1=VX.publicEncrypt,D1=VX.privateEncrypt,q1=VX.publicDecrypt,M1=VX.privateDecrypt,C1=VX.randomFill,A1=VX.randomFillSync,T1=VX.createCredentials,R1=VX.constants,I1=["p192","p224","p256","p384","p521","curve25519","ed25519","secp256k1","secp224r1","prime256v1","prime192v1","ed25519","secp384r1","secp521r1"];N1=crypto,B1=crypto});var HJ=QX((cD,IV)=>{var MZ=GX();bQ();cZ();DX();var k1=MZ.pkcs5=MZ.pkcs5||{},UQ;if(MZ.util.isNodejs&&!MZ.options.usePureJavaScript)UQ=(EZ(),WX(KZ));IV.exports=MZ.pbkdf2=k1.pbkdf2=function(X,Z,U,Q,G,O){if(typeof G==="function")O=G,G=null;if(MZ.util.isNodejs&&!MZ.options.usePureJavaScript&&UQ.pbkdf2&&(G===null||typeof G!=="object")&&(UQ.pbkdf2Sync.length>4||(!G||G==="sha1"))){if(typeof G!=="string")G="sha1";if(X=Buffer.from(X,"binary"),Z=Buffer.from(Z,"binary"),!O){if(UQ.pbkdf2Sync.length===4)return UQ.pbkdf2Sync(X,Z,U,Q).toString("binary");return UQ.pbkdf2Sync(X,Z,U,Q,G).toString("binary")}if(UQ.pbkdf2Sync.length===4)return UQ.pbkdf2(X,Z,U,Q,function(w,v){if(w)return O(w);O(null,v.toString("binary"))});return UQ.pbkdf2(X,Z,U,Q,G,function(w,v){if(w)return O(w);O(null,v.toString("binary"))})}if(typeof G>"u"||G===null)G="sha1";if(typeof G==="string"){if(!(G in MZ.md.algorithms))throw Error("Unknown hash algorithm: "+G);G=MZ.md[G].create()}var Y=G.digestLength;if(Q>4294967295*Y){var K=Error("Derived key is too long.");if(O)return O(K);throw K}var A=Math.ceil(Q/Y),D=Q-(A-1)*Y,C=MZ.hmac.create();C.start(G,X);var z="",R,S,P;if(!O){for(var N=1;N<=A;++N){C.start(null,null),C.update(Z),C.update(MZ.util.int32ToBytes(N)),R=P=C.digest().getBytes();for(var I=2;I<=U;++I)C.start(null,null),C.update(P),S=C.digest().getBytes(),R=MZ.util.xorBytes(R,S,Y),P=S;z+=N<A?R:R.substr(0,D)}return z}var N=1,I;function B(){if(N>A)return O(null,z);C.start(null,null),C.update(Z),C.update(MZ.util.int32ToBytes(N)),R=P=C.digest().getBytes(),I=2,k()}function k(){if(I<=U)return C.start(null,null),C.update(P),S=C.digest().getBytes(),R=MZ.util.xorBytes(R,S,Y),P=S,++I,MZ.util.setImmediate(k);z+=N<A?R:R.substr(0,D),++N,B()}B()}});var BY=QX((uD,xV)=>{var oZ=GX();cZ();DX();var NV=xV.exports=oZ.sha256=oZ.sha256||{};oZ.md.sha256=oZ.md.algorithms.sha256=NV;NV.create=function(){if(!BV)x1();var X=null,Z=oZ.util.createBuffer(),U=Array(64),Q={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return Q.start=function(){Q.messageLength=0,Q.fullMessageLength=Q.messageLength64=[];var G=Q.messageLengthSize/4;for(var O=0;O<G;++O)Q.fullMessageLength.push(0);return Z=oZ.util.createBuffer(),X={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},Q},Q.start(),Q.update=function(G,O){if(O==="utf8")G=oZ.util.encodeUtf8(G);var Y=G.length;Q.messageLength+=Y,Y=[Y/4294967296>>>0,Y>>>0];for(var K=Q.fullMessageLength.length-1;K>=0;--K)Q.fullMessageLength[K]+=Y[1],Y[1]=Y[0]+(Q.fullMessageLength[K]/4294967296>>>0),Q.fullMessageLength[K]=Q.fullMessageLength[K]>>>0,Y[0]=Y[1]/4294967296>>>0;if(Z.putBytes(G),jV(X,U,Z),Z.read>2048||Z.length()===0)Z.compact();return Q},Q.digest=function(){var G=oZ.util.createBuffer();G.putBytes(Z.bytes());var O=Q.fullMessageLength[Q.fullMessageLength.length-1]+Q.messageLengthSize,Y=O&Q.blockLength-1;G.putBytes(NY.substr(0,Q.blockLength-Y));var K,A,D=Q.fullMessageLength[0]*8;for(var C=0;C<Q.fullMessageLength.length-1;++C)K=Q.fullMessageLength[C+1]*8,A=K/4294967296>>>0,D+=A,G.putInt32(D>>>0),D=K>>>0;G.putInt32(D);var z={h0:X.h0,h1:X.h1,h2:X.h2,h3:X.h3,h4:X.h4,h5:X.h5,h6:X.h6,h7:X.h7};jV(z,U,G);var R=oZ.util.createBuffer();return R.putInt32(z.h0),R.putInt32(z.h1),R.putInt32(z.h2),R.putInt32(z.h3),R.putInt32(z.h4),R.putInt32(z.h5),R.putInt32(z.h6),R.putInt32(z.h7),R},Q};var NY=null,BV=!1,kV=null;function x1(){NY=String.fromCharCode(128),NY+=oZ.util.fillString(String.fromCharCode(0),64),kV=[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],BV=!0}function jV(X,Z,U){var Q,G,O,Y,K,A,D,C,z,R,S,P,N,I,B,k=U.length();while(k>=64){for(D=0;D<16;++D)Z[D]=U.getInt32();for(;D<64;++D)Q=Z[D-2],Q=(Q>>>17|Q<<15)^(Q>>>19|Q<<13)^Q>>>10,G=Z[D-15],G=(G>>>7|G<<25)^(G>>>18|G<<14)^G>>>3,Z[D]=Q+Z[D-7]+G+Z[D-16]|0;C=X.h0,z=X.h1,R=X.h2,S=X.h3,P=X.h4,N=X.h5,I=X.h6,B=X.h7;for(D=0;D<64;++D)Y=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),K=I^P&(N^I),O=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),A=C&z|R&(C^z),Q=B+Y+K+kV[D]+Z[D],G=O+A,B=I,I=N,N=P,P=S+Q>>>0,S=R,R=z,z=C,C=Q+G>>>0;X.h0=X.h0+C|0,X.h1=X.h1+z|0,X.h2=X.h2+R|0,X.h3=X.h3+S|0,X.h4=X.h4+P|0,X.h5=X.h5+N|0,X.h6=X.h6+I|0,X.h7=X.h7+B|0,k-=64}}});var kY=QX((bD,wV)=>{var nZ=GX();DX();var FJ=null;if(nZ.util.isNodejs&&!nZ.options.usePureJavaScript&&!process.versions["node-webkit"])FJ=(EZ(),WX(KZ));var w1=wV.exports=nZ.prng=nZ.prng||{};w1.create=function(X){var Z={plugin:X,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},U=X.md,Q=Array(32);for(var G=0;G<32;++G)Q[G]=U.create();Z.pools=Q,Z.pool=0,Z.generate=function(D,C){if(!C)return Z.generateSync(D);var z=Z.plugin.cipher,R=Z.plugin.increment,S=Z.plugin.formatKey,P=Z.plugin.formatSeed,N=nZ.util.createBuffer();Z.key=null,I();function I(B){if(B)return C(B);if(N.length()>=D)return C(null,N.getBytes(D));if(Z.generated>1048575)Z.key=null;if(Z.key===null)return nZ.util.nextTick(function(){O(I)});var k=z(Z.key,Z.seed);Z.generated+=k.length,N.putBytes(k),Z.key=S(z(Z.key,R(Z.seed))),Z.seed=P(z(Z.key,Z.seed)),nZ.util.setImmediate(I)}},Z.generateSync=function(D){var C=Z.plugin.cipher,z=Z.plugin.increment,R=Z.plugin.formatKey,S=Z.plugin.formatSeed;Z.key=null;var P=nZ.util.createBuffer();while(P.length()<D){if(Z.generated>1048575)Z.key=null;if(Z.key===null)Y();var N=C(Z.key,Z.seed);Z.generated+=N.length,P.putBytes(N),Z.key=R(C(Z.key,z(Z.seed))),Z.seed=S(C(Z.key,Z.seed))}return P.getBytes(D)};function O(D){if(Z.pools[0].messageLength>=32)return K(),D();var C=32-Z.pools[0].messageLength<<5;Z.seedFile(C,function(z,R){if(z)return D(z);Z.collect(R),K(),D()})}function Y(){if(Z.pools[0].messageLength>=32)return K();var D=32-Z.pools[0].messageLength<<5;Z.collect(Z.seedFileSync(D)),K()}function K(){Z.reseeds=Z.reseeds===4294967295?0:Z.reseeds+1;var D=Z.plugin.md.create();D.update(Z.keyBytes);var C=1;for(var z=0;z<32;++z){if(Z.reseeds%C===0)D.update(Z.pools[z].digest().getBytes()),Z.pools[z].start();C=C<<1}Z.keyBytes=D.digest().getBytes(),D.start(),D.update(Z.keyBytes);var R=D.digest().getBytes();Z.key=Z.plugin.formatKey(Z.keyBytes),Z.seed=Z.plugin.formatSeed(R),Z.generated=0}function A(D){var C=null,z=nZ.util.globalScope,R=z.crypto||z.msCrypto;if(R&&R.getRandomValues)C=function(_){return R.getRandomValues(_)};var S=nZ.util.createBuffer();if(C)while(S.length()<D){var P=Math.max(1,Math.min(D-S.length(),65536)/4),N=new Uint32Array(Math.floor(P));try{C(N);for(var I=0;I<N.length;++I)S.putInt32(N[I])}catch(_){if(!(typeof QuotaExceededError<"u"&&_ instanceof QuotaExceededError))throw _}}if(S.length()<D){var B,k,w,v=Math.floor(Math.random()*65536);while(S.length()<D){k=16807*(v&65535),B=16807*(v>>16),k+=(B&32767)<<16,k+=B>>15,k=(k&2147483647)+(k>>31),v=k&4294967295;for(var I=0;I<3;++I)w=v>>>(I<<3),w^=Math.floor(Math.random()*256),S.putByte(w&255)}}return S.getBytes(D)}if(FJ)Z.seedFile=function(D,C){FJ.randomBytes(D,function(z,R){if(z)return C(z);C(null,R.toString())})},Z.seedFileSync=function(D){return FJ.randomBytes(D).toString()};else Z.seedFile=function(D,C){try{C(null,A(D))}catch(z){C(z)}},Z.seedFileSync=A;return Z.collect=function(D){var C=D.length;for(var z=0;z<C;++z)Z.pools[Z.pool].update(D.substr(z,1)),Z.pool=Z.pool===31?0:Z.pool+1},Z.collectInt=function(D,C){var z="";for(var R=0;R<C;R+=8)z+=String.fromCharCode(D>>R&255);Z.collect(z)},Z.registerWorker=function(D){if(D===self)Z.seedFile=function(z,R){function S(P){var N=P.data;if(N.forge&&N.forge.prng)self.removeEventListener("message",S),R(N.forge.prng.err,N.forge.prng.bytes)}self.addEventListener("message",S),self.postMessage({forge:{prng:{needed:z}}})};else{var C=function(z){var R=z.data;if(R.forge&&R.forge.prng)Z.seedFile(R.forge.prng.needed,function(S,P){D.postMessage({forge:{prng:{err:S,bytes:P}}})})};D.addEventListener("message",C)}},Z}});var kZ=QX((dD,xY)=>{var JZ=GX();VQ();BY();kY();DX();(function(){if(JZ.random&&JZ.random.getBytes){xY.exports=JZ.random;return}(function(X){var Z={},U=[,,,,],Q=JZ.util.createBuffer();Z.formatKey=function(z){var R=JZ.util.createBuffer(z);return z=[,,,,],z[0]=R.getInt32(),z[1]=R.getInt32(),z[2]=R.getInt32(),z[3]=R.getInt32(),JZ.aes._expandKey(z,!1)},Z.formatSeed=function(z){var R=JZ.util.createBuffer(z);return z=[,,,,],z[0]=R.getInt32(),z[1]=R.getInt32(),z[2]=R.getInt32(),z[3]=R.getInt32(),z},Z.cipher=function(z,R){return JZ.aes._updateBlock(z,R,U,!1),Q.putInt32(U[0]),Q.putInt32(U[1]),Q.putInt32(U[2]),Q.putInt32(U[3]),Q.getBytes()},Z.increment=function(z){return++z[3],z},Z.md=JZ.md.sha256;function G(){var z=JZ.prng.create(Z);return z.getBytes=function(R,S){return z.generate(R,S)},z.getBytesSync=function(R){return z.generate(R)},z}var O=G(),Y=null,K=JZ.util.globalScope,A=K.crypto||K.msCrypto;if(A&&A.getRandomValues)Y=function(z){return A.getRandomValues(z)};if(JZ.options.usePureJavaScript||!JZ.util.isNodejs&&!Y){if(typeof window>"u"||window.document===void 0);if(O.collectInt(+new Date,32),typeof navigator<"u"){var D="";for(var C in navigator)try{if(typeof navigator[C]=="string")D+=navigator[C]}catch(z){}O.collect(D),D=null}if(X)X().mousemove(function(z){O.collectInt(z.clientX,16),O.collectInt(z.clientY,16)}),X().keypress(function(z){O.collectInt(z.charCode,8)})}if(!JZ.random)JZ.random=O;else for(var C in O)JZ.random[C]=O[C];JZ.random.createInstance=G,xY.exports=JZ.random})(typeof jQuery<"u"?jQuery:null)})()});var vY=QX((lD,yV)=>{var PZ=GX();DX();var wY=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],vV=[1,2,3,5],v1=function(X,Z){return X<<Z&65535|(X&65535)>>16-Z},_1=function(X,Z){return(X&65535)>>Z|X<<16-Z&65535};yV.exports=PZ.rc2=PZ.rc2||{};PZ.rc2.expandKey=function(X,Z){if(typeof X==="string")X=PZ.util.createBuffer(X);Z=Z||128;var U=X,Q=X.length(),G=Z,O=Math.ceil(G/8),Y=255>>(G&7),K;for(K=Q;K<128;K++)U.putByte(wY[U.at(K-1)+U.at(K-Q)&255]);U.setAt(128-O,wY[U.at(128-O)&Y]);for(K=127-O;K>=0;K--)U.setAt(K,wY[U.at(K+1)^U.at(K+O)]);return U};var _V=function(X,Z,U){var Q=!1,G=null,O=null,Y=null,K,A,D,C,z=[];X=PZ.rc2.expandKey(X,Z);for(D=0;D<64;D++)z.push(X.getInt16Le());if(U)K=function(P){for(D=0;D<4;D++)P[D]+=z[C]+(P[(D+3)%4]&P[(D+2)%4])+(~P[(D+3)%4]&P[(D+1)%4]),P[D]=v1(P[D],vV[D]),C++},A=function(P){for(D=0;D<4;D++)P[D]+=z[P[(D+3)%4]&63]};else K=function(P){for(D=3;D>=0;D--)P[D]=_1(P[D],vV[D]),P[D]-=z[C]+(P[(D+3)%4]&P[(D+2)%4])+(~P[(D+3)%4]&P[(D+1)%4]),C--},A=function(P){for(D=3;D>=0;D--)P[D]-=z[P[(D+3)%4]&63]};var R=function(P){var N=[];for(D=0;D<4;D++){var I=G.getInt16Le();if(Y!==null)if(U)I^=Y.getInt16Le();else Y.putInt16Le(I);N.push(I&65535)}C=U?0:63;for(var B=0;B<P.length;B++)for(var k=0;k<P[B][0];k++)P[B][1](N);for(D=0;D<4;D++){if(Y!==null)if(U)Y.putInt16Le(N[D]);else N[D]^=Y.getInt16Le();O.putInt16Le(N[D])}},S=null;return S={start:function(P,N){if(P){if(typeof P==="string")P=PZ.util.createBuffer(P)}Q=!1,G=PZ.util.createBuffer(),O=N||new PZ.util.createBuffer,Y=P,S.output=O},update:function(P){if(!Q)G.putBuffer(P);while(G.length()>=8)R([[5,K],[1,A],[6,K],[1,A],[5,K]])},finish:function(P){var N=!0;if(U)if(P)N=P(8,G,!U);else{var I=G.length()===8?8:8-G.length();G.fillWithByte(I,I)}if(N)Q=!0,S.update();if(!U){if(N=G.length()===0,N)if(P)N=P(8,O,!U);else{var B=O.length(),k=O.at(B-1);if(k>B)N=!1;else O.truncate(k)}}return N}},S};PZ.rc2.startEncrypting=function(X,Z,U){var Q=PZ.rc2.createEncryptionCipher(X,128);return Q.start(Z,U),Q};PZ.rc2.createEncryptionCipher=function(X,Z){return _V(X,Z,!0)};PZ.rc2.startDecrypting=function(X,Z,U){var Q=PZ.rc2.createDecryptionCipher(X,128);return Q.start(Z,U),Q};PZ.rc2.createDecryptionCipher=function(X,Z){return _V(X,Z,!1)}});var jU=QX((mD,dV)=>{var _Y=GX();dV.exports=_Y.jsbn=_Y.jsbn||{};var JQ,y1=244837814094590,fV=(y1&16777215)==15715070;function u0(X,Z,U){if(this.data=[],X!=null)if(typeof X=="number")this.fromNumber(X,Z,U);else if(Z==null&&typeof X!="string")this.fromString(X,256);else this.fromString(X,Z)}_Y.jsbn.BigInteger=u0;function qX(){return new u0(null)}function f1(X,Z,U,Q,G,O){while(--O>=0){var Y=Z*this.data[X++]+U.data[Q]+G;G=Math.floor(Y/67108864),U.data[Q++]=Y&67108863}return G}function g1(X,Z,U,Q,G,O){var Y=Z&32767,K=Z>>15;while(--O>=0){var A=this.data[X]&32767,D=this.data[X++]>>15,C=K*A+D*Y;A=Y*A+((C&32767)<<15)+U.data[Q]+(G&1073741823),G=(A>>>30)+(C>>>15)+K*D+(G>>>30),U.data[Q++]=A&1073741823}return G}function gV(X,Z,U,Q,G,O){var Y=Z&16383,K=Z>>14;while(--O>=0){var A=this.data[X]&16383,D=this.data[X++]>>14,C=K*A+D*Y;A=Y*A+((C&16383)<<14)+U.data[Q]+G,G=(A>>28)+(C>>14)+K*D,U.data[Q++]=A&268435455}return G}if(typeof navigator>"u")u0.prototype.am=gV,JQ=28;else if(fV&&navigator.appName=="Microsoft Internet Explorer")u0.prototype.am=g1,JQ=30;else if(fV&&navigator.appName!="Netscape")u0.prototype.am=f1,JQ=26;else u0.prototype.am=gV,JQ=28;u0.prototype.DB=JQ;u0.prototype.DM=(1<<JQ)-1;u0.prototype.DV=1<<JQ;var yY=52;u0.prototype.FV=Math.pow(2,yY);u0.prototype.F1=yY-JQ;u0.prototype.F2=2*JQ-yY;var h1="0123456789abcdefghijklmnopqrstuvwxyz",KJ=[],rQ,xZ;rQ=48;for(xZ=0;xZ<=9;++xZ)KJ[rQ++]=xZ;rQ=97;for(xZ=10;xZ<36;++xZ)KJ[rQ++]=xZ;rQ=65;for(xZ=10;xZ<36;++xZ)KJ[rQ++]=xZ;function hV(X){return h1.charAt(X)}function pV(X,Z){var U=KJ[X.charCodeAt(Z)];return U==null?-1:U}function p1(X){for(var Z=this.t-1;Z>=0;--Z)X.data[Z]=this.data[Z];X.t=this.t,X.s=this.s}function c1(X){if(this.t=1,this.s=X<0?-1:0,X>0)this.data[0]=X;else if(X<-1)this.data[0]=X+this.DV;else this.t=0}function EQ(X){var Z=qX();return Z.fromInt(X),Z}function u1(X,Z){var U;if(Z==16)U=4;else if(Z==8)U=3;else if(Z==256)U=8;else if(Z==2)U=1;else if(Z==32)U=5;else if(Z==4)U=2;else{this.fromRadix(X,Z);return}this.t=0,this.s=0;var Q=X.length,G=!1,O=0;while(--Q>=0){var Y=U==8?X[Q]&255:pV(X,Q);if(Y<0){if(X.charAt(Q)=="-")G=!0;continue}if(G=!1,O==0)this.data[this.t++]=Y;else if(O+U>this.DB)this.data[this.t-1]|=(Y&(1<<this.DB-O)-1)<<O,this.data[this.t++]=Y>>this.DB-O;else this.data[this.t-1]|=Y<<O;if(O+=U,O>=this.DB)O-=this.DB}if(U==8&&(X[0]&128)!=0){if(this.s=-1,O>0)this.data[this.t-1]|=(1<<this.DB-O)-1<<O}if(this.clamp(),G)u0.ZERO.subTo(this,this)}function b1(){var X=this.s&this.DM;while(this.t>0&&this.data[this.t-1]==X)--this.t}function d1(X){if(this.s<0)return"-"+this.negate().toString(X);var Z;if(X==16)Z=4;else if(X==8)Z=3;else if(X==2)Z=1;else if(X==32)Z=5;else if(X==4)Z=2;else return this.toRadix(X);var U=(1<<Z)-1,Q,G=!1,O="",Y=this.t,K=this.DB-Y*this.DB%Z;if(Y-- >0){if(K<this.DB&&(Q=this.data[Y]>>K)>0)G=!0,O=hV(Q);while(Y>=0){if(K<Z)Q=(this.data[Y]&(1<<K)-1)<<Z-K,Q|=this.data[--Y]>>(K+=this.DB-Z);else if(Q=this.data[Y]>>(K-=Z)&U,K<=0)K+=this.DB,--Y;if(Q>0)G=!0;if(G)O+=hV(Q)}}return G?O:"0"}function l1(){var X=qX();return u0.ZERO.subTo(this,X),X}function m1(){return this.s<0?this.negate():this}function o1(X){var Z=this.s-X.s;if(Z!=0)return Z;var U=this.t;if(Z=U-X.t,Z!=0)return this.s<0?-Z:Z;while(--U>=0)if((Z=this.data[U]-X.data[U])!=0)return Z;return 0}function EJ(X){var Z=1,U;if((U=X>>>16)!=0)X=U,Z+=16;if((U=X>>8)!=0)X=U,Z+=8;if((U=X>>4)!=0)X=U,Z+=4;if((U=X>>2)!=0)X=U,Z+=2;if((U=X>>1)!=0)X=U,Z+=1;return Z}function n1(){if(this.t<=0)return 0;return this.DB*(this.t-1)+EJ(this.data[this.t-1]^this.s&this.DM)}function s1(X,Z){var U;for(U=this.t-1;U>=0;--U)Z.data[U+X]=this.data[U];for(U=X-1;U>=0;--U)Z.data[U]=0;Z.t=this.t+X,Z.s=this.s}function r1(X,Z){for(var U=X;U<this.t;++U)Z.data[U-X]=this.data[U];Z.t=Math.max(this.t-X,0),Z.s=this.s}function a1(X,Z){var U=X%this.DB,Q=this.DB-U,G=(1<<Q)-1,O=Math.floor(X/this.DB),Y=this.s<<U&this.DM,K;for(K=this.t-1;K>=0;--K)Z.data[K+O+1]=this.data[K]>>Q|Y,Y=(this.data[K]&G)<<U;for(K=O-1;K>=0;--K)Z.data[K]=0;Z.data[O]=Y,Z.t=this.t+O+1,Z.s=this.s,Z.clamp()}function t1(X,Z){Z.s=this.s;var U=Math.floor(X/this.DB);if(U>=this.t){Z.t=0;return}var Q=X%this.DB,G=this.DB-Q,O=(1<<Q)-1;Z.data[0]=this.data[U]>>Q;for(var Y=U+1;Y<this.t;++Y)Z.data[Y-U-1]|=(this.data[Y]&O)<<G,Z.data[Y-U]=this.data[Y]>>Q;if(Q>0)Z.data[this.t-U-1]|=(this.s&O)<<G;Z.t=this.t-U,Z.clamp()}function i1(X,Z){var U=0,Q=0,G=Math.min(X.t,this.t);while(U<G)Q+=this.data[U]-X.data[U],Z.data[U++]=Q&this.DM,Q>>=this.DB;if(X.t<this.t){Q-=X.s;while(U<this.t)Q+=this.data[U],Z.data[U++]=Q&this.DM,Q>>=this.DB;Q+=this.s}else{Q+=this.s;while(U<X.t)Q-=X.data[U],Z.data[U++]=Q&this.DM,Q>>=this.DB;Q-=X.s}if(Z.s=Q<0?-1:0,Q<-1)Z.data[U++]=this.DV+Q;else if(Q>0)Z.data[U++]=Q;Z.t=U,Z.clamp()}function e1(X,Z){var U=this.abs(),Q=X.abs(),G=U.t;Z.t=G+Q.t;while(--G>=0)Z.data[G]=0;for(G=0;G<Q.t;++G)Z.data[G+U.t]=U.am(0,Q.data[G],Z,G,0,U.t);if(Z.s=0,Z.clamp(),this.s!=X.s)u0.ZERO.subTo(Z,Z)}function X8(X){var Z=this.abs(),U=X.t=2*Z.t;while(--U>=0)X.data[U]=0;for(U=0;U<Z.t-1;++U){var Q=Z.am(U,Z.data[U],X,2*U,0,1);if((X.data[U+Z.t]+=Z.am(U+1,2*Z.data[U],X,2*U+1,Q,Z.t-U-1))>=Z.DV)X.data[U+Z.t]-=Z.DV,X.data[U+Z.t+1]=1}if(X.t>0)X.data[X.t-1]+=Z.am(U,Z.data[U],X,2*U,0,1);X.s=0,X.clamp()}function Z8(X,Z,U){var Q=X.abs();if(Q.t<=0)return;var G=this.abs();if(G.t<Q.t){if(Z!=null)Z.fromInt(0);if(U!=null)this.copyTo(U);return}if(U==null)U=qX();var O=qX(),Y=this.s,K=X.s,A=this.DB-EJ(Q.data[Q.t-1]);if(A>0)Q.lShiftTo(A,O),G.lShiftTo(A,U);else Q.copyTo(O),G.copyTo(U);var D=O.t,C=O.data[D-1];if(C==0)return;var z=C*(1<<this.F1)+(D>1?O.data[D-2]>>this.F2:0),R=this.FV/z,S=(1<<this.F1)/z,P=1<<this.F2,N=U.t,I=N-D,B=Z==null?qX():Z;if(O.dlShiftTo(I,B),U.compareTo(B)>=0)U.data[U.t++]=1,U.subTo(B,U);u0.ONE.dlShiftTo(D,B),B.subTo(O,O);while(O.t<D)O.data[O.t++]=0;while(--I>=0){var k=U.data[--N]==C?this.DM:Math.floor(U.data[N]*R+(U.data[N-1]+P)*S);if((U.data[N]+=O.am(0,k,U,I,0,D))<k){O.dlShiftTo(I,B),U.subTo(B,U);while(U.data[N]<--k)U.subTo(B,U)}}if(Z!=null){if(U.drShiftTo(D,Z),Y!=K)u0.ZERO.subTo(Z,Z)}if(U.t=D,U.clamp(),A>0)U.rShiftTo(A,U);if(Y<0)u0.ZERO.subTo(U,U)}function Q8(X){var Z=qX();if(this.abs().divRemTo(X,null,Z),this.s<0&&Z.compareTo(u0.ZERO)>0)X.subTo(Z,Z);return Z}function kQ(X){this.m=X}function U8(X){if(X.s<0||X.compareTo(this.m)>=0)return X.mod(this.m);else return X}function J8(X){return X}function Y8(X){X.divRemTo(this.m,null,X)}function $8(X,Z,U){X.multiplyTo(Z,U),this.reduce(U)}function G8(X,Z){X.squareTo(Z),this.reduce(Z)}kQ.prototype.convert=U8;kQ.prototype.revert=J8;kQ.prototype.reduce=Y8;kQ.prototype.mulTo=$8;kQ.prototype.sqrTo=G8;function V8(){if(this.t<1)return 0;var X=this.data[0];if((X&1)==0)return 0;var Z=X&3;return Z=Z*(2-(X&15)*Z)&15,Z=Z*(2-(X&255)*Z)&255,Z=Z*(2-((X&65535)*Z&65535))&65535,Z=Z*(2-X*Z%this.DV)%this.DV,Z>0?this.DV-Z:-Z}function xQ(X){this.m=X,this.mp=X.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<X.DB-15)-1,this.mt2=2*X.t}function W8(X){var Z=qX();if(X.abs().dlShiftTo(this.m.t,Z),Z.divRemTo(this.m,null,Z),X.s<0&&Z.compareTo(u0.ZERO)>0)this.m.subTo(Z,Z);return Z}function O8(X){var Z=qX();return X.copyTo(Z),this.reduce(Z),Z}function H8(X){while(X.t<=this.mt2)X.data[X.t++]=0;for(var Z=0;Z<this.m.t;++Z){var U=X.data[Z]&32767,Q=U*this.mpl+((U*this.mph+(X.data[Z]>>15)*this.mpl&this.um)<<15)&X.DM;U=Z+this.m.t,X.data[U]+=this.m.am(0,Q,X,Z,0,this.m.t);while(X.data[U]>=X.DV)X.data[U]-=X.DV,X.data[++U]++}if(X.clamp(),X.drShiftTo(this.m.t,X),X.compareTo(this.m)>=0)X.subTo(this.m,X)}function F8(X,Z){X.squareTo(Z),this.reduce(Z)}function K8(X,Z,U){X.multiplyTo(Z,U),this.reduce(U)}xQ.prototype.convert=W8;xQ.prototype.revert=O8;xQ.prototype.reduce=H8;xQ.prototype.mulTo=K8;xQ.prototype.sqrTo=F8;function E8(){return(this.t>0?this.data[0]&1:this.s)==0}function z8(X,Z){if(X>4294967295||X<1)return u0.ONE;var U=qX(),Q=qX(),G=Z.convert(this),O=EJ(X)-1;G.copyTo(U);while(--O>=0)if(Z.sqrTo(U,Q),(X&1<<O)>0)Z.mulTo(Q,G,U);else{var Y=U;U=Q,Q=Y}return Z.revert(U)}function D8(X,Z){var U;if(X<256||Z.isEven())U=new kQ(Z);else U=new xQ(Z);return this.exp(X,U)}u0.prototype.copyTo=p1;u0.prototype.fromInt=c1;u0.prototype.fromString=u1;u0.prototype.clamp=b1;u0.prototype.dlShiftTo=s1;u0.prototype.drShiftTo=r1;u0.prototype.lShiftTo=a1;u0.prototype.rShiftTo=t1;u0.prototype.subTo=i1;u0.prototype.multiplyTo=e1;u0.prototype.squareTo=X8;u0.prototype.divRemTo=Z8;u0.prototype.invDigit=V8;u0.prototype.isEven=E8;u0.prototype.exp=z8;u0.prototype.toString=d1;u0.prototype.negate=l1;u0.prototype.abs=m1;u0.prototype.compareTo=o1;u0.prototype.bitLength=n1;u0.prototype.mod=Q8;u0.prototype.modPowInt=D8;u0.ZERO=EQ(0);u0.ONE=EQ(1);function q8(){var X=qX();return this.copyTo(X),X}function M8(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;else if(this.t==0)return-1}else if(this.t==1)return this.data[0];else if(this.t==0)return 0;return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function C8(){return this.t==0?this.s:this.data[0]<<24>>24}function A8(){return this.t==0?this.s:this.data[0]<<16>>16}function T8(X){return Math.floor(Math.LN2*this.DB/Math.log(X))}function R8(){if(this.s<0)return-1;else if(this.t<=0||this.t==1&&this.data[0]<=0)return 0;else return 1}function P8(X){if(X==null)X=10;if(this.signum()==0||X<2||X>36)return"0";var Z=this.chunkSize(X),U=Math.pow(X,Z),Q=EQ(U),G=qX(),O=qX(),Y="";this.divRemTo(Q,G,O);while(G.signum()>0)Y=(U+O.intValue()).toString(X).substr(1)+Y,G.divRemTo(Q,G,O);return O.intValue().toString(X)+Y}function S8(X,Z){if(this.fromInt(0),Z==null)Z=10;var U=this.chunkSize(Z),Q=Math.pow(Z,U),G=!1,O=0,Y=0;for(var K=0;K<X.length;++K){var A=pV(X,K);if(A<0){if(X.charAt(K)=="-"&&this.signum()==0)G=!0;continue}if(Y=Z*Y+A,++O>=U)this.dMultiply(Q),this.dAddOffset(Y,0),O=0,Y=0}if(O>0)this.dMultiply(Math.pow(Z,O)),this.dAddOffset(Y,0);if(G)u0.ZERO.subTo(this,this)}function L8(X,Z,U){if(typeof Z=="number")if(X<2)this.fromInt(1);else{if(this.fromNumber(X,U),!this.testBit(X-1))this.bitwiseTo(u0.ONE.shiftLeft(X-1),fY,this);if(this.isEven())this.dAddOffset(1,0);while(!this.isProbablePrime(Z))if(this.dAddOffset(2,0),this.bitLength()>X)this.subTo(u0.ONE.shiftLeft(X-1),this)}else{var Q=[],G=X&7;if(Q.length=(X>>3)+1,Z.nextBytes(Q),G>0)Q[0]&=(1<<G)-1;else Q[0]=0;this.fromString(Q,256)}}function I8(){var X=this.t,Z=[];Z[0]=this.s;var U=this.DB-X*this.DB%8,Q,G=0;if(X-- >0){if(U<this.DB&&(Q=this.data[X]>>U)!=(this.s&this.DM)>>U)Z[G++]=Q|this.s<<this.DB-U;while(X>=0){if(U<8)Q=(this.data[X]&(1<<U)-1)<<8-U,Q|=this.data[--X]>>(U+=this.DB-8);else if(Q=this.data[X]>>(U-=8)&255,U<=0)U+=this.DB,--X;if((Q&128)!=0)Q|=-256;if(G==0&&(this.s&128)!=(Q&128))++G;if(G>0||Q!=this.s)Z[G++]=Q}}return Z}function j8(X){return this.compareTo(X)==0}function N8(X){return this.compareTo(X)<0?this:X}function B8(X){return this.compareTo(X)>0?this:X}function k8(X,Z,U){var Q,G,O=Math.min(X.t,this.t);for(Q=0;Q<O;++Q)U.data[Q]=Z(this.data[Q],X.data[Q]);if(X.t<this.t){G=X.s&this.DM;for(Q=O;Q<this.t;++Q)U.data[Q]=Z(this.data[Q],G);U.t=this.t}else{G=this.s&this.DM;for(Q=O;Q<X.t;++Q)U.data[Q]=Z(G,X.data[Q]);U.t=X.t}U.s=Z(this.s,X.s),U.clamp()}function x8(X,Z){return X&Z}function w8(X){var Z=qX();return this.bitwiseTo(X,x8,Z),Z}function fY(X,Z){return X|Z}function v8(X){var Z=qX();return this.bitwiseTo(X,fY,Z),Z}function cV(X,Z){return X^Z}function _8(X){var Z=qX();return this.bitwiseTo(X,cV,Z),Z}function uV(X,Z){return X&~Z}function y8(X){var Z=qX();return this.bitwiseTo(X,uV,Z),Z}function f8(){var X=qX();for(var Z=0;Z<this.t;++Z)X.data[Z]=this.DM&~this.data[Z];return X.t=this.t,X.s=~this.s,X}function g8(X){var Z=qX();if(X<0)this.rShiftTo(-X,Z);else this.lShiftTo(X,Z);return Z}function h8(X){var Z=qX();if(X<0)this.lShiftTo(-X,Z);else this.rShiftTo(X,Z);return Z}function p8(X){if(X==0)return-1;var Z=0;if((X&65535)==0)X>>=16,Z+=16;if((X&255)==0)X>>=8,Z+=8;if((X&15)==0)X>>=4,Z+=4;if((X&3)==0)X>>=2,Z+=2;if((X&1)==0)++Z;return Z}function c8(){for(var X=0;X<this.t;++X)if(this.data[X]!=0)return X*this.DB+p8(this.data[X]);if(this.s<0)return this.t*this.DB;return-1}function u8(X){var Z=0;while(X!=0)X&=X-1,++Z;return Z}function b8(){var X=0,Z=this.s&this.DM;for(var U=0;U<this.t;++U)X+=u8(this.data[U]^Z);return X}function d8(X){var Z=Math.floor(X/this.DB);if(Z>=this.t)return this.s!=0;return(this.data[Z]&1<<X%this.DB)!=0}function l8(X,Z){var U=u0.ONE.shiftLeft(X);return this.bitwiseTo(U,Z,U),U}function m8(X){return this.changeBit(X,fY)}function o8(X){return this.changeBit(X,uV)}function n8(X){return this.changeBit(X,cV)}function s8(X,Z){var U=0,Q=0,G=Math.min(X.t,this.t);while(U<G)Q+=this.data[U]+X.data[U],Z.data[U++]=Q&this.DM,Q>>=this.DB;if(X.t<this.t){Q+=X.s;while(U<this.t)Q+=this.data[U],Z.data[U++]=Q&this.DM,Q>>=this.DB;Q+=this.s}else{Q+=this.s;while(U<X.t)Q+=X.data[U],Z.data[U++]=Q&this.DM,Q>>=this.DB;Q+=X.s}if(Z.s=Q<0?-1:0,Q>0)Z.data[U++]=Q;else if(Q<-1)Z.data[U++]=this.DV+Q;Z.t=U,Z.clamp()}function r8(X){var Z=qX();return this.addTo(X,Z),Z}function a8(X){var Z=qX();return this.subTo(X,Z),Z}function t8(X){var Z=qX();return this.multiplyTo(X,Z),Z}function i8(X){var Z=qX();return this.divRemTo(X,Z,null),Z}function e8(X){var Z=qX();return this.divRemTo(X,null,Z),Z}function XE(X){var Z=qX(),U=qX();return this.divRemTo(X,Z,U),[Z,U]}function ZE(X){this.data[this.t]=this.am(0,X-1,this,0,0,this.t),++this.t,this.clamp()}function QE(X,Z){if(X==0)return;while(this.t<=Z)this.data[this.t++]=0;this.data[Z]+=X;while(this.data[Z]>=this.DV){if(this.data[Z]-=this.DV,++Z>=this.t)this.data[this.t++]=0;++this.data[Z]}}function IU(){}function bV(X){return X}function UE(X,Z,U){X.multiplyTo(Z,U)}function JE(X,Z){X.squareTo(Z)}IU.prototype.convert=bV;IU.prototype.revert=bV;IU.prototype.mulTo=UE;IU.prototype.sqrTo=JE;function YE(X){return this.exp(X,new IU)}function $E(X,Z,U){var Q=Math.min(this.t+X.t,Z);U.s=0,U.t=Q;while(Q>0)U.data[--Q]=0;var G;for(G=U.t-this.t;Q<G;++Q)U.data[Q+this.t]=this.am(0,X.data[Q],U,Q,0,this.t);for(G=Math.min(X.t,Z);Q<G;++Q)this.am(0,X.data[Q],U,Q,0,Z-Q);U.clamp()}function GE(X,Z,U){--Z;var Q=U.t=this.t+X.t-Z;U.s=0;while(--Q>=0)U.data[Q]=0;for(Q=Math.max(Z-this.t,0);Q<X.t;++Q)U.data[this.t+Q-Z]=this.am(Z-Q,X.data[Q],U,0,0,this.t+Q-Z);U.clamp(),U.drShiftTo(1,U)}function aQ(X){this.r2=qX(),this.q3=qX(),u0.ONE.dlShiftTo(2*X.t,this.r2),this.mu=this.r2.divide(X),this.m=X}function VE(X){if(X.s<0||X.t>2*this.m.t)return X.mod(this.m);else if(X.compareTo(this.m)<0)return X;else{var Z=qX();return X.copyTo(Z),this.reduce(Z),Z}}function WE(X){return X}function OE(X){if(X.drShiftTo(this.m.t-1,this.r2),X.t>this.m.t+1)X.t=this.m.t+1,X.clamp();this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(X.compareTo(this.r2)<0)X.dAddOffset(1,this.m.t+1);X.subTo(this.r2,X);while(X.compareTo(this.m)>=0)X.subTo(this.m,X)}function HE(X,Z){X.squareTo(Z),this.reduce(Z)}function FE(X,Z,U){X.multiplyTo(Z,U),this.reduce(U)}aQ.prototype.convert=VE;aQ.prototype.revert=WE;aQ.prototype.reduce=OE;aQ.prototype.mulTo=FE;aQ.prototype.sqrTo=HE;function KE(X,Z){var U=X.bitLength(),Q,G=EQ(1),O;if(U<=0)return G;else if(U<18)Q=1;else if(U<48)Q=3;else if(U<144)Q=4;else if(U<768)Q=5;else Q=6;if(U<8)O=new kQ(Z);else if(Z.isEven())O=new aQ(Z);else O=new xQ(Z);var Y=[],K=3,A=Q-1,D=(1<<Q)-1;if(Y[1]=O.convert(this),Q>1){var C=qX();O.sqrTo(Y[1],C);while(K<=D)Y[K]=qX(),O.mulTo(C,Y[K-2],Y[K]),K+=2}var z=X.t-1,R,S=!0,P=qX(),N;U=EJ(X.data[z])-1;while(z>=0){if(U>=A)R=X.data[z]>>U-A&D;else if(R=(X.data[z]&(1<<U+1)-1)<<A-U,z>0)R|=X.data[z-1]>>this.DB+U-A;K=Q;while((R&1)==0)R>>=1,--K;if((U-=K)<0)U+=this.DB,--z;if(S)Y[R].copyTo(G),S=!1;else{while(K>1)O.sqrTo(G,P),O.sqrTo(P,G),K-=2;if(K>0)O.sqrTo(G,P);else N=G,G=P,P=N;O.mulTo(P,Y[R],G)}while(z>=0&&(X.data[z]&1<<U)==0)if(O.sqrTo(G,P),N=G,G=P,P=N,--U<0)U=this.DB-1,--z}return O.revert(G)}function EE(X){var Z=this.s<0?this.negate():this.clone(),U=X.s<0?X.negate():X.clone();if(Z.compareTo(U)<0){var Q=Z;Z=U,U=Q}var G=Z.getLowestSetBit(),O=U.getLowestSetBit();if(O<0)return Z;if(G<O)O=G;if(O>0)Z.rShiftTo(O,Z),U.rShiftTo(O,U);while(Z.signum()>0){if((G=Z.getLowestSetBit())>0)Z.rShiftTo(G,Z);if((G=U.getLowestSetBit())>0)U.rShiftTo(G,U);if(Z.compareTo(U)>=0)Z.subTo(U,Z),Z.rShiftTo(1,Z);else U.subTo(Z,U),U.rShiftTo(1,U)}if(O>0)U.lShiftTo(O,U);return U}function zE(X){if(X<=0)return 0;var Z=this.DV%X,U=this.s<0?X-1:0;if(this.t>0)if(Z==0)U=this.data[0]%X;else for(var Q=this.t-1;Q>=0;--Q)U=(Z*U+this.data[Q])%X;return U}function DE(X){var Z=X.isEven();if(this.isEven()&&Z||X.signum()==0)return u0.ZERO;var U=X.clone(),Q=this.clone(),G=EQ(1),O=EQ(0),Y=EQ(0),K=EQ(1);while(U.signum()!=0){while(U.isEven()){if(U.rShiftTo(1,U),Z){if(!G.isEven()||!O.isEven())G.addTo(this,G),O.subTo(X,O);G.rShiftTo(1,G)}else if(!O.isEven())O.subTo(X,O);O.rShiftTo(1,O)}while(Q.isEven()){if(Q.rShiftTo(1,Q),Z){if(!Y.isEven()||!K.isEven())Y.addTo(this,Y),K.subTo(X,K);Y.rShiftTo(1,Y)}else if(!K.isEven())K.subTo(X,K);K.rShiftTo(1,K)}if(U.compareTo(Q)>=0){if(U.subTo(Q,U),Z)G.subTo(Y,G);O.subTo(K,O)}else{if(Q.subTo(U,Q),Z)Y.subTo(G,Y);K.subTo(O,K)}}if(Q.compareTo(u0.ONE)!=0)return u0.ZERO;if(K.compareTo(X)>=0)return K.subtract(X);if(K.signum()<0)K.addTo(X,K);else return K;if(K.signum()<0)return K.add(X);else return K}var pZ=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],qE=67108864/pZ[pZ.length-1];function ME(X){var Z,U=this.abs();if(U.t==1&&U.data[0]<=pZ[pZ.length-1]){for(Z=0;Z<pZ.length;++Z)if(U.data[0]==pZ[Z])return!0;return!1}if(U.isEven())return!1;Z=1;while(Z<pZ.length){var Q=pZ[Z],G=Z+1;while(G<pZ.length&&Q<qE)Q*=pZ[G++];Q=U.modInt(Q);while(Z<G)if(Q%pZ[Z++]==0)return!1}return U.millerRabin(X)}function CE(X){var Z=this.subtract(u0.ONE),U=Z.getLowestSetBit();if(U<=0)return!1;var Q=Z.shiftRight(U),G=AE(),O;for(var Y=0;Y<X;++Y){do O=new u0(this.bitLength(),G);while(O.compareTo(u0.ONE)<=0||O.compareTo(Z)>=0);var K=O.modPow(Q,this);if(K.compareTo(u0.ONE)!=0&&K.compareTo(Z)!=0){var A=1;while(A++<U&&K.compareTo(Z)!=0)if(K=K.modPowInt(2,this),K.compareTo(u0.ONE)==0)return!1;if(K.compareTo(Z)!=0)return!1}}return!0}function AE(){return{nextBytes:function(X){for(var Z=0;Z<X.length;++Z)X[Z]=Math.floor(Math.random()*256)}}}u0.prototype.chunkSize=T8;u0.prototype.toRadix=P8;u0.prototype.fromRadix=S8;u0.prototype.fromNumber=L8;u0.prototype.bitwiseTo=k8;u0.prototype.changeBit=l8;u0.prototype.addTo=s8;u0.prototype.dMultiply=ZE;u0.prototype.dAddOffset=QE;u0.prototype.multiplyLowerTo=$E;u0.prototype.multiplyUpperTo=GE;u0.prototype.modInt=zE;u0.prototype.millerRabin=CE;u0.prototype.clone=q8;u0.prototype.intValue=M8;u0.prototype.byteValue=C8;u0.prototype.shortValue=A8;u0.prototype.signum=R8;u0.prototype.toByteArray=I8;u0.prototype.equals=j8;u0.prototype.min=N8;u0.prototype.max=B8;u0.prototype.and=w8;u0.prototype.or=v8;u0.prototype.xor=_8;u0.prototype.andNot=y8;u0.prototype.not=f8;u0.prototype.shiftLeft=g8;u0.prototype.shiftRight=h8;u0.prototype.getLowestSetBit=c8;u0.prototype.bitCount=b8;u0.prototype.testBit=d8;u0.prototype.setBit=m8;u0.prototype.clearBit=o8;u0.prototype.flipBit=n8;u0.prototype.add=r8;u0.prototype.subtract=a8;u0.prototype.multiply=t8;u0.prototype.divide=i8;u0.prototype.remainder=e8;u0.prototype.divideAndRemainder=XE;u0.prototype.modPow=KE;u0.prototype.modInverse=DE;u0.prototype.pow=YE;u0.prototype.gcd=EE;u0.prototype.isProbablePrime=ME});var tQ=QX((oD,nV)=>{var sZ=GX();cZ();DX();var mV=nV.exports=sZ.sha1=sZ.sha1||{};sZ.md.sha1=sZ.md.algorithms.sha1=mV;mV.create=function(){if(!oV)TE();var X=null,Z=sZ.util.createBuffer(),U=Array(80),Q={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return Q.start=function(){Q.messageLength=0,Q.fullMessageLength=Q.messageLength64=[];var G=Q.messageLengthSize/4;for(var O=0;O<G;++O)Q.fullMessageLength.push(0);return Z=sZ.util.createBuffer(),X={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},Q},Q.start(),Q.update=function(G,O){if(O==="utf8")G=sZ.util.encodeUtf8(G);var Y=G.length;Q.messageLength+=Y,Y=[Y/4294967296>>>0,Y>>>0];for(var K=Q.fullMessageLength.length-1;K>=0;--K)Q.fullMessageLength[K]+=Y[1],Y[1]=Y[0]+(Q.fullMessageLength[K]/4294967296>>>0),Q.fullMessageLength[K]=Q.fullMessageLength[K]>>>0,Y[0]=Y[1]/4294967296>>>0;if(Z.putBytes(G),lV(X,U,Z),Z.read>2048||Z.length()===0)Z.compact();return Q},Q.digest=function(){var G=sZ.util.createBuffer();G.putBytes(Z.bytes());var O=Q.fullMessageLength[Q.fullMessageLength.length-1]+Q.messageLengthSize,Y=O&Q.blockLength-1;G.putBytes(gY.substr(0,Q.blockLength-Y));var K,A,D=Q.fullMessageLength[0]*8;for(var C=0;C<Q.fullMessageLength.length-1;++C)K=Q.fullMessageLength[C+1]*8,A=K/4294967296>>>0,D+=A,G.putInt32(D>>>0),D=K>>>0;G.putInt32(D);var z={h0:X.h0,h1:X.h1,h2:X.h2,h3:X.h3,h4:X.h4};lV(z,U,G);var R=sZ.util.createBuffer();return R.putInt32(z.h0),R.putInt32(z.h1),R.putInt32(z.h2),R.putInt32(z.h3),R.putInt32(z.h4),R},Q};var gY=null,oV=!1;function TE(){gY=String.fromCharCode(128),gY+=sZ.util.fillString(String.fromCharCode(0),64),oV=!0}function lV(X,Z,U){var Q,G,O,Y,K,A,D,C,z=U.length();while(z>=64){G=X.h0,O=X.h1,Y=X.h2,K=X.h3,A=X.h4;for(C=0;C<16;++C)Q=U.getInt32(),Z[C]=Q,D=K^O&(Y^K),Q=(G<<5|G>>>27)+D+A+1518500249+Q,A=K,K=Y,Y=(O<<30|O>>>2)>>>0,O=G,G=Q;for(;C<20;++C)Q=Z[C-3]^Z[C-8]^Z[C-14]^Z[C-16],Q=Q<<1|Q>>>31,Z[C]=Q,D=K^O&(Y^K),Q=(G<<5|G>>>27)+D+A+1518500249+Q,A=K,K=Y,Y=(O<<30|O>>>2)>>>0,O=G,G=Q;for(;C<32;++C)Q=Z[C-3]^Z[C-8]^Z[C-14]^Z[C-16],Q=Q<<1|Q>>>31,Z[C]=Q,D=O^Y^K,Q=(G<<5|G>>>27)+D+A+1859775393+Q,A=K,K=Y,Y=(O<<30|O>>>2)>>>0,O=G,G=Q;for(;C<40;++C)Q=Z[C-6]^Z[C-16]^Z[C-28]^Z[C-32],Q=Q<<2|Q>>>30,Z[C]=Q,D=O^Y^K,Q=(G<<5|G>>>27)+D+A+1859775393+Q,A=K,K=Y,Y=(O<<30|O>>>2)>>>0,O=G,G=Q;for(;C<60;++C)Q=Z[C-6]^Z[C-16]^Z[C-28]^Z[C-32],Q=Q<<2|Q>>>30,Z[C]=Q,D=O&Y|K&(O^Y),Q=(G<<5|G>>>27)+D+A+2400959708+Q,A=K,K=Y,Y=(O<<30|O>>>2)>>>0,O=G,G=Q;for(;C<80;++C)Q=Z[C-6]^Z[C-16]^Z[C-28]^Z[C-32],Q=Q<<2|Q>>>30,Z[C]=Q,D=O^Y^K,Q=(G<<5|G>>>27)+D+A+3395469782+Q,A=K,K=Y,Y=(O<<30|O>>>2)>>>0,O=G,G=Q;X.h0=X.h0+G|0,X.h1=X.h1+O|0,X.h2=X.h2+Y|0,X.h3=X.h3+K|0,X.h4=X.h4+A|0,z-=64}}});var hY=QX((nD,rV)=>{var rZ=GX();DX();kZ();tQ();var sV=rV.exports=rZ.pkcs1=rZ.pkcs1||{};sV.encode_rsa_oaep=function(X,Z,U){var Q,G,O,Y;if(typeof U==="string")Q=U,G=arguments[3]||void 0,O=arguments[4]||void 0;else if(U){if(Q=U.label||void 0,G=U.seed||void 0,O=U.md||void 0,U.mgf1&&U.mgf1.md)Y=U.mgf1.md}if(!O)O=rZ.md.sha1.create();else O.start();if(!Y)Y=O;var K=Math.ceil(X.n.bitLength()/8),A=K-2*O.digestLength-2;if(Z.length>A){var D=Error("RSAES-OAEP input message length is too long.");throw D.length=Z.length,D.maxLength=A,D}if(!Q)Q="";O.update(Q,"raw");var C=O.digest(),z="",R=A-Z.length;for(var S=0;S<R;S++)z+="\x00";var P=C.getBytes()+z+"\x01"+Z;if(!G)G=rZ.random.getBytes(O.digestLength);else if(G.length!==O.digestLength){var D=Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw D.seedLength=G.length,D.digestLength=O.digestLength,D}var N=zJ(G,K-O.digestLength-1,Y),I=rZ.util.xorBytes(P,N,P.length),B=zJ(I,O.digestLength,Y),k=rZ.util.xorBytes(G,B,G.length);return"\x00"+k+I};sV.decode_rsa_oaep=function(X,Z,U){var Q,G,O;if(typeof U==="string")Q=U,G=arguments[3]||void 0;else if(U){if(Q=U.label||void 0,G=U.md||void 0,U.mgf1&&U.mgf1.md)O=U.mgf1.md}var Y=Math.ceil(X.n.bitLength()/8);if(Z.length!==Y){var I=Error("RSAES-OAEP encoded message length is invalid.");throw I.length=Z.length,I.expectedLength=Y,I}if(G===void 0)G=rZ.md.sha1.create();else G.start();if(!O)O=G;if(Y<2*G.digestLength+2)throw Error("RSAES-OAEP key is too short for the hash function.");if(!Q)Q="";G.update(Q,"raw");var K=G.digest().getBytes(),A=Z.charAt(0),D=Z.substring(1,G.digestLength+1),C=Z.substring(1+G.digestLength),z=zJ(C,G.digestLength,O),R=rZ.util.xorBytes(D,z,D.length),S=zJ(R,Y-G.digestLength-1,O),P=rZ.util.xorBytes(C,S,C.length),N=P.substring(0,G.digestLength),I=A!=="\x00";for(var B=0;B<G.digestLength;++B)I|=K.charAt(B)!==N.charAt(B);var k=1,w=G.digestLength;for(var v=G.digestLength;v<P.length;v++){var _=P.charCodeAt(v),u=_&1^1,J0=k?65534:0;I|=_&J0,k=k&u,w+=k}if(I||P.charCodeAt(w)!==1)throw Error("Invalid RSAES-OAEP padding.");return P.substring(w+1)};function zJ(X,Z,U){if(!U)U=rZ.md.sha1.create();var Q="",G=Math.ceil(Z/U.digestLength);for(var O=0;O<G;++O){var Y=String.fromCharCode(O>>24&255,O>>16&255,O>>8&255,O&255);U.start(),U.update(X+Y),Q+=U.digest().getBytes()}return Q.substring(0,Z)}});var cY=QX((sD,pY)=>{var zQ=GX();DX();jU();kZ();(function(){if(zQ.prime){pY.exports=zQ.prime;return}var X=pY.exports=zQ.prime=zQ.prime||{},Z=zQ.jsbn.BigInteger,U=[6,4,2,4,2,4,6,2],Q=new Z(null);Q.fromInt(30);var G=function(z,R){return z|R};X.generateProbablePrime=function(z,R,S){if(typeof R==="function")S=R,R={};R=R||{};var P=R.algorithm||"PRIMEINC";if(typeof P==="string")P={name:P};P.options=P.options||{};var N=R.prng||zQ.random,I={nextBytes:function(B){var k=N.getBytesSync(B.length);for(var w=0;w<B.length;++w)B[w]=k.charCodeAt(w)}};if(P.name==="PRIMEINC")return O(z,I,P.options,S);throw Error("Invalid prime generation algorithm: "+P.name)};function O(z,R,S,P){if("workers"in S)return A(z,R,S,P);return Y(z,R,S,P)}function Y(z,R,S,P){var N=D(z,R),I=0,B=C(N.bitLength());if("millerRabinTests"in S)B=S.millerRabinTests;var k=10;if("maxBlockTime"in S)k=S.maxBlockTime;K(N,z,R,I,B,k,P)}function K(z,R,S,P,N,I,B){var k=+new Date;do{if(z.bitLength()>R)z=D(R,S);if(z.isProbablePrime(N))return B(null,z);z.dAddOffset(U[P++%8],0)}while(I<0||+new Date-k<I);zQ.util.setImmediate(function(){K(z,R,S,P,N,I,B)})}function A(z,R,S,P){if(typeof Worker>"u")return Y(z,R,S,P);var N=D(z,R),I=S.workers,B=S.workLoad||100,k=B*30/8,w=S.workerScript||"forge/prime.worker.js";if(I===-1)return zQ.util.estimateCores(function(_,u){if(_)u=2;I=u-1,v()});v();function v(){I=Math.max(1,I);var _=[];for(var u=0;u<I;++u)_[u]=new Worker(w);var J0=I;for(var u=0;u<I;++u)_[u].addEventListener("message",V0);var H0=!1;function V0(l){if(H0)return;--J0;var U0=l.data;if(U0.found){for(var J=0;J<_.length;++J)_[J].terminate();return H0=!0,P(null,new Z(U0.prime,16))}if(N.bitLength()>z)N=D(z,R);var W=N.toString(16);l.target.postMessage({hex:W,workLoad:B}),N.dAddOffset(k,0)}}}function D(z,R){var S=new Z(z,R),P=z-1;if(!S.testBit(P))S.bitwiseTo(Z.ONE.shiftLeft(P),G,S);return S.dAddOffset(31-S.mod(Q).byteValue(),0),S}function C(z){if(z<=100)return 27;if(z<=150)return 18;if(z<=200)return 15;if(z<=250)return 12;if(z<=300)return 9;if(z<=350)return 8;if(z<=400)return 7;if(z<=500)return 6;if(z<=600)return 5;if(z<=800)return 4;if(z<=1250)return 3;return 2}})()});var NU=QX((rD,QW)=>{var i0=GX();hZ();jU();WQ();hY();cY();kZ();DX();if(typeof EX>"u")EX=i0.jsbn.BigInteger;var EX,uY=i0.util.isNodejs?(EZ(),WX(KZ)):null,K0=i0.asn1,wZ=i0.util;i0.pki=i0.pki||{};QW.exports=i0.pki.rsa=i0.rsa=i0.rsa||{};var UX=i0.pki,RE=[6,4,2,4,2,4,6,2],PE={name:"PrivateKeyInfo",tagClass:K0.Class.UNIVERSAL,type:K0.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:K0.Class.UNIVERSAL,type:K0.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:K0.Class.UNIVERSAL,type:K0.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:K0.Class.UNIVERSAL,type:K0.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:K0.Class.UNIVERSAL,type:K0.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},SE={name:"RSAPrivateKey",tagClass:K0.Class.UNIVERSAL,type:K0.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:K0.Class.UNIVERSAL,type:K0.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:K0.Class.UNIVERSAL,type:K0.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:K0.Class.UNIVERSAL,type:K0.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:K0.Class.UNIVERSAL,type:K0.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:K0.Class.UNIVERSAL,type:K0.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:K0.Class.UNIVERSAL,type:K0.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:K0.Class.UNIVERSAL,type:K0.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:K0.Class.UNIVERSAL,type:K0.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:K0.Class.UNIVERSAL,type:K0.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},LE={name:"RSAPublicKey",tagClass:K0.Class.UNIVERSAL,type:K0.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:K0.Class.UNIVERSAL,type:K0.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:K0.Class.UNIVERSAL,type:K0.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},IE=i0.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:K0.Class.UNIVERSAL,type:K0.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:K0.Class.UNIVERSAL,type:K0.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:K0.Class.UNIVERSAL,type:K0.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:K0.Class.UNIVERSAL,type:K0.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:K0.Class.UNIVERSAL,type:K0.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},jE={name:"DigestInfo",tagClass:K0.Class.UNIVERSAL,type:K0.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:K0.Class.UNIVERSAL,type:K0.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:K0.Class.UNIVERSAL,type:K0.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:K0.Class.UNIVERSAL,type:K0.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:K0.Class.UNIVERSAL,type:K0.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},NE=function(X){var Z;if(X.algorithm in UX.oids)Z=UX.oids[X.algorithm];else{var U=Error("Unknown message digest algorithm.");throw U.algorithm=X.algorithm,U}var Q=K0.oidToDer(Z).getBytes(),G=K0.create(K0.Class.UNIVERSAL,K0.Type.SEQUENCE,!0,[]),O=K0.create(K0.Class.UNIVERSAL,K0.Type.SEQUENCE,!0,[]);O.value.push(K0.create(K0.Class.UNIVERSAL,K0.Type.OID,!1,Q)),O.value.push(K0.create(K0.Class.UNIVERSAL,K0.Type.NULL,!1,""));var Y=K0.create(K0.Class.UNIVERSAL,K0.Type.OCTETSTRING,!1,X.digest().getBytes());return G.value.push(O),G.value.push(Y),K0.toDer(G).getBytes()},XW=function(X,Z,U){if(U)return X.modPow(Z.e,Z.n);if(!Z.p||!Z.q)return X.modPow(Z.d,Z.n);if(!Z.dP)Z.dP=Z.d.mod(Z.p.subtract(EX.ONE));if(!Z.dQ)Z.dQ=Z.d.mod(Z.q.subtract(EX.ONE));if(!Z.qInv)Z.qInv=Z.q.modInverse(Z.p);var Q;do Q=new EX(i0.util.bytesToHex(i0.random.getBytes(Z.n.bitLength()/8)),16);while(Q.compareTo(Z.n)>=0||!Q.gcd(Z.n).equals(EX.ONE));X=X.multiply(Q.modPow(Z.e,Z.n)).mod(Z.n);var G=X.mod(Z.p).modPow(Z.dP,Z.p),O=X.mod(Z.q).modPow(Z.dQ,Z.q);while(G.compareTo(O)<0)G=G.add(Z.p);var Y=G.subtract(O).multiply(Z.qInv).mod(Z.p).multiply(Z.q).add(O);return Y=Y.multiply(Q.modInverse(Z.n)).mod(Z.n),Y};UX.rsa.encrypt=function(X,Z,U){var Q=U,G,O=Math.ceil(Z.n.bitLength()/8);if(U!==!1&&U!==!0)Q=U===2,G=ZW(X,Z,U);else G=i0.util.createBuffer(),G.putBytes(X);var Y=new EX(G.toHex(),16),K=XW(Y,Z,Q),A=K.toString(16),D=i0.util.createBuffer(),C=O-Math.ceil(A.length/2);while(C>0)D.putByte(0),--C;return D.putBytes(i0.util.hexToBytes(A)),D.getBytes()};UX.rsa.decrypt=function(X,Z,U,Q){var G=Math.ceil(Z.n.bitLength()/8);if(X.length!==G){var O=Error("Encrypted message length is invalid.");throw O.length=X.length,O.expected=G,O}var Y=new EX(i0.util.createBuffer(X).toHex(),16);if(Y.compareTo(Z.n)>=0)throw Error("Encrypted message is invalid.");var K=XW(Y,Z,U),A=K.toString(16),D=i0.util.createBuffer(),C=G-Math.ceil(A.length/2);while(C>0)D.putByte(0),--C;if(D.putBytes(i0.util.hexToBytes(A)),Q!==!1)return DJ(D.getBytes(),Z,U);return D.getBytes()};UX.rsa.createKeyPairGenerationState=function(X,Z,U){if(typeof X==="string")X=parseInt(X,10);X=X||2048,U=U||{};var Q=U.prng||i0.random,G={nextBytes:function(K){var A=Q.getBytesSync(K.length);for(var D=0;D<K.length;++D)K[D]=A.charCodeAt(D)}},O=U.algorithm||"PRIMEINC",Y;if(O==="PRIMEINC")Y={algorithm:O,state:0,bits:X,rng:G,eInt:Z||65537,e:new EX(null),p:null,q:null,qBits:X>>1,pBits:X-(X>>1),pqState:0,num:null,keys:null},Y.e.fromInt(Y.eInt);else throw Error("Invalid key generation algorithm: "+O);return Y};UX.rsa.stepKeyPairGenerationState=function(X,Z){if(!("algorithm"in X))X.algorithm="PRIMEINC";var U=new EX(null);U.fromInt(30);var Q=0,G=function(z,R){return z|R},O=+new Date,Y,K=0;while(X.keys===null&&(Z<=0||K<Z)){if(X.state===0){var A=X.p===null?X.pBits:X.qBits,D=A-1;if(X.pqState===0){if(X.num=new EX(A,X.rng),!X.num.testBit(D))X.num.bitwiseTo(EX.ONE.shiftLeft(D),G,X.num);X.num.dAddOffset(31-X.num.mod(U).byteValue(),0),Q=0,++X.pqState}else if(X.pqState===1)if(X.num.bitLength()>A)X.pqState=0;else if(X.num.isProbablePrime(kE(X.num.bitLength())))++X.pqState;else X.num.dAddOffset(RE[Q++%8],0);else if(X.pqState===2)X.pqState=X.num.subtract(EX.ONE).gcd(X.e).compareTo(EX.ONE)===0?3:0;else if(X.pqState===3){if(X.pqState=0,X.p===null)X.p=X.num;else X.q=X.num;if(X.p!==null&&X.q!==null)++X.state;X.num=null}}else if(X.state===1){if(X.p.compareTo(X.q)<0)X.num=X.p,X.p=X.q,X.q=X.num;++X.state}else if(X.state===2)X.p1=X.p.subtract(EX.ONE),X.q1=X.q.subtract(EX.ONE),X.phi=X.p1.multiply(X.q1),++X.state;else if(X.state===3)if(X.phi.gcd(X.e).compareTo(EX.ONE)===0)++X.state;else X.p=null,X.q=null,X.state=0;else if(X.state===4)if(X.n=X.p.multiply(X.q),X.n.bitLength()===X.bits)++X.state;else X.q=null,X.state=0;else if(X.state===5){var C=X.e.modInverse(X.phi);X.keys={privateKey:UX.rsa.setPrivateKey(X.n,X.e,C,X.p,X.q,C.mod(X.p1),C.mod(X.q1),X.q.modInverse(X.p)),publicKey:UX.rsa.setPublicKey(X.n,X.e)}}Y=+new Date,K+=Y-O,O=Y}return X.keys!==null};UX.rsa.generateKeyPair=function(X,Z,U,Q){if(arguments.length===1){if(typeof X==="object")U=X,X=void 0;else if(typeof X==="function")Q=X,X=void 0}else if(arguments.length===2)if(typeof X==="number"){if(typeof Z==="function")Q=Z,Z=void 0;else if(typeof Z!=="number")U=Z,Z=void 0}else U=X,Q=Z,X=void 0,Z=void 0;else if(arguments.length===3)if(typeof Z==="number"){if(typeof U==="function")Q=U,U=void 0}else Q=U,U=Z,Z=void 0;if(U=U||{},X===void 0)X=U.bits||2048;if(Z===void 0)Z=U.e||65537;if(!i0.options.usePureJavaScript&&!U.prng&&X>=256&&X<=16384&&(Z===65537||Z===3)){if(Q){if(aV("generateKeyPair"))return uY.generateKeyPair("rsa",{modulusLength:X,publicExponent:Z,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(K,A,D){if(K)return Q(K);Q(null,{privateKey:UX.privateKeyFromPem(D),publicKey:UX.publicKeyFromPem(A)})});if(tV("generateKey")&&tV("exportKey"))return wZ.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:X,publicExponent:eV(Z),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(K){return wZ.globalScope.crypto.subtle.exportKey("pkcs8",K.privateKey)}).then(void 0,function(K){Q(K)}).then(function(K){if(K){var A=UX.privateKeyFromAsn1(K0.fromDer(i0.util.createBuffer(K)));Q(null,{privateKey:A,publicKey:UX.setRsaPublicKey(A.n,A.e)})}});if(iV("generateKey")&&iV("exportKey")){var G=wZ.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:X,publicExponent:eV(Z),hash:{name:"SHA-256"}},!0,["sign","verify"]);G.oncomplete=function(K){var A=K.target.result,D=wZ.globalScope.msCrypto.subtle.exportKey("pkcs8",A.privateKey);D.oncomplete=function(C){var z=C.target.result,R=UX.privateKeyFromAsn1(K0.fromDer(i0.util.createBuffer(z)));Q(null,{privateKey:R,publicKey:UX.setRsaPublicKey(R.n,R.e)})},D.onerror=function(C){Q(C)}},G.onerror=function(K){Q(K)};return}}else if(aV("generateKeyPairSync")){var O=uY.generateKeyPairSync("rsa",{modulusLength:X,publicExponent:Z,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:UX.privateKeyFromPem(O.privateKey),publicKey:UX.publicKeyFromPem(O.publicKey)}}}var Y=UX.rsa.createKeyPairGenerationState(X,Z,U);if(!Q)return UX.rsa.stepKeyPairGenerationState(Y,0),Y.keys;BE(Y,U,Q)};UX.setRsaPublicKey=UX.rsa.setPublicKey=function(X,Z){var U={n:X,e:Z};return U.encrypt=function(Q,G,O){if(typeof G==="string")G=G.toUpperCase();else if(G===void 0)G="RSAES-PKCS1-V1_5";if(G==="RSAES-PKCS1-V1_5")G={encode:function(K,A,D){return ZW(K,A,2).getBytes()}};else if(G==="RSA-OAEP"||G==="RSAES-OAEP")G={encode:function(K,A){return i0.pkcs1.encode_rsa_oaep(A,K,O)}};else if(["RAW","NONE","NULL",null].indexOf(G)!==-1)G={encode:function(K){return K}};else if(typeof G==="string")throw Error('Unsupported encryption scheme: "'+G+'".');var Y=G.encode(Q,U,!0);return UX.rsa.encrypt(Y,U,!0)},U.verify=function(Q,G,O,Y){if(typeof O==="string")O=O.toUpperCase();else if(O===void 0)O="RSASSA-PKCS1-V1_5";if(Y===void 0)Y={_parseAllDigestBytes:!0};if(!("_parseAllDigestBytes"in Y))Y._parseAllDigestBytes=!0;if(O==="RSASSA-PKCS1-V1_5")O={verify:function(A,D){D=DJ(D,U,!0);var C=K0.fromDer(D,{parseAllBytes:Y._parseAllDigestBytes}),z={},R=[];if(!K0.validate(C,jE,z,R)){var S=Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw S.errors=R,S}var P=K0.derToOid(z.algorithmIdentifier);if(!(P===i0.oids.md2||P===i0.oids.md5||P===i0.oids.sha1||P===i0.oids.sha224||P===i0.oids.sha256||P===i0.oids.sha384||P===i0.oids.sha512||P===i0.oids["sha512-224"]||P===i0.oids["sha512-256"])){var S=Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw S.oid=P,S}if(P===i0.oids.md2||P===i0.oids.md5){if(!("parameters"in z))throw Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.")}return A===z.digest}};else if(O==="NONE"||O==="NULL"||O===null)O={verify:function(A,D){return D=DJ(D,U,!0),A===D}};var K=UX.rsa.decrypt(G,U,!0,!1);return O.verify(Q,K,U.n.bitLength())},U};UX.setRsaPrivateKey=UX.rsa.setPrivateKey=function(X,Z,U,Q,G,O,Y,K){var A={n:X,e:Z,d:U,p:Q,q:G,dP:O,dQ:Y,qInv:K};return A.decrypt=function(D,C,z){if(typeof C==="string")C=C.toUpperCase();else if(C===void 0)C="RSAES-PKCS1-V1_5";var R=UX.rsa.decrypt(D,A,!1,!1);if(C==="RSAES-PKCS1-V1_5")C={decode:DJ};else if(C==="RSA-OAEP"||C==="RSAES-OAEP")C={decode:function(S,P){return i0.pkcs1.decode_rsa_oaep(P,S,z)}};else if(["RAW","NONE","NULL",null].indexOf(C)!==-1)C={decode:function(S){return S}};else throw Error('Unsupported encryption scheme: "'+C+'".');return C.decode(R,A,!1)},A.sign=function(D,C){var z=!1;if(typeof C==="string")C=C.toUpperCase();if(C===void 0||C==="RSASSA-PKCS1-V1_5")C={encode:NE},z=1;else if(C==="NONE"||C==="NULL"||C===null)C={encode:function(){return D}},z=1;var R=C.encode(D,A.n.bitLength());return UX.rsa.encrypt(R,A,z)},A};UX.wrapRsaPrivateKey=function(X){return K0.create(K0.Class.UNIVERSAL,K0.Type.SEQUENCE,!0,[K0.create(K0.Class.UNIVERSAL,K0.Type.INTEGER,!1,K0.integerToDer(0).getBytes()),K0.create(K0.Class.UNIVERSAL,K0.Type.SEQUENCE,!0,[K0.create(K0.Class.UNIVERSAL,K0.Type.OID,!1,K0.oidToDer(UX.oids.rsaEncryption).getBytes()),K0.create(K0.Class.UNIVERSAL,K0.Type.NULL,!1,"")]),K0.create(K0.Class.UNIVERSAL,K0.Type.OCTETSTRING,!1,K0.toDer(X).getBytes())])};UX.privateKeyFromAsn1=function(X){var Z={},U=[];if(K0.validate(X,PE,Z,U))X=K0.fromDer(i0.util.createBuffer(Z.privateKey));if(Z={},U=[],!K0.validate(X,SE,Z,U)){var Q=Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw Q.errors=U,Q}var G,O,Y,K,A,D,C,z;return G=i0.util.createBuffer(Z.privateKeyModulus).toHex(),O=i0.util.createBuffer(Z.privateKeyPublicExponent).toHex(),Y=i0.util.createBuffer(Z.privateKeyPrivateExponent).toHex(),K=i0.util.createBuffer(Z.privateKeyPrime1).toHex(),A=i0.util.createBuffer(Z.privateKeyPrime2).toHex(),D=i0.util.createBuffer(Z.privateKeyExponent1).toHex(),C=i0.util.createBuffer(Z.privateKeyExponent2).toHex(),z=i0.util.createBuffer(Z.privateKeyCoefficient).toHex(),UX.setRsaPrivateKey(new EX(G,16),new EX(O,16),new EX(Y,16),new EX(K,16),new EX(A,16),new EX(D,16),new EX(C,16),new EX(z,16))};UX.privateKeyToAsn1=UX.privateKeyToRSAPrivateKey=function(X){return K0.create(K0.Class.UNIVERSAL,K0.Type.SEQUENCE,!0,[K0.create(K0.Class.UNIVERSAL,K0.Type.INTEGER,!1,K0.integerToDer(0).getBytes()),K0.create(K0.Class.UNIVERSAL,K0.Type.INTEGER,!1,aZ(X.n)),K0.create(K0.Class.UNIVERSAL,K0.Type.INTEGER,!1,aZ(X.e)),K0.create(K0.Class.UNIVERSAL,K0.Type.INTEGER,!1,aZ(X.d)),K0.create(K0.Class.UNIVERSAL,K0.Type.INTEGER,!1,aZ(X.p)),K0.create(K0.Class.UNIVERSAL,K0.Type.INTEGER,!1,aZ(X.q)),K0.create(K0.Class.UNIVERSAL,K0.Type.INTEGER,!1,aZ(X.dP)),K0.create(K0.Class.UNIVERSAL,K0.Type.INTEGER,!1,aZ(X.dQ)),K0.create(K0.Class.UNIVERSAL,K0.Type.INTEGER,!1,aZ(X.qInv))])};UX.publicKeyFromAsn1=function(X){var Z={},U=[];if(K0.validate(X,IE,Z,U)){var Q=K0.derToOid(Z.publicKeyOid);if(Q!==UX.oids.rsaEncryption){var G=Error("Cannot read public key. Unknown OID.");throw G.oid=Q,G}X=Z.rsaPublicKey}if(U=[],!K0.validate(X,LE,Z,U)){var G=Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw G.errors=U,G}var O=i0.util.createBuffer(Z.publicKeyModulus).toHex(),Y=i0.util.createBuffer(Z.publicKeyExponent).toHex();return UX.setRsaPublicKey(new EX(O,16),new EX(Y,16))};UX.publicKeyToAsn1=UX.publicKeyToSubjectPublicKeyInfo=function(X){return K0.create(K0.Class.UNIVERSAL,K0.Type.SEQUENCE,!0,[K0.create(K0.Class.UNIVERSAL,K0.Type.SEQUENCE,!0,[K0.create(K0.Class.UNIVERSAL,K0.Type.OID,!1,K0.oidToDer(UX.oids.rsaEncryption).getBytes()),K0.create(K0.Class.UNIVERSAL,K0.Type.NULL,!1,"")]),K0.create(K0.Class.UNIVERSAL,K0.Type.BITSTRING,!1,[UX.publicKeyToRSAPublicKey(X)])])};UX.publicKeyToRSAPublicKey=function(X){return K0.create(K0.Class.UNIVERSAL,K0.Type.SEQUENCE,!0,[K0.create(K0.Class.UNIVERSAL,K0.Type.INTEGER,!1,aZ(X.n)),K0.create(K0.Class.UNIVERSAL,K0.Type.INTEGER,!1,aZ(X.e))])};function ZW(X,Z,U){var Q=i0.util.createBuffer(),G=Math.ceil(Z.n.bitLength()/8);if(X.length>G-11){var O=Error("Message is too long for PKCS#1 v1.5 padding.");throw O.length=X.length,O.max=G-11,O}Q.putByte(0),Q.putByte(U);var Y=G-3-X.length,K;if(U===0||U===1){K=U===0?0:255;for(var A=0;A<Y;++A)Q.putByte(K)}else while(Y>0){var D=0,C=i0.random.getBytes(Y);for(var A=0;A<Y;++A)if(K=C.charCodeAt(A),K===0)++D;else Q.putByte(K);Y=D}return Q.putByte(0),Q.putBytes(X),Q}function DJ(X,Z,U,Q){var G=Math.ceil(Z.n.bitLength()/8),O=i0.util.createBuffer(X),Y=O.getByte(),K=O.getByte();if(Y!==0||U&&K!==0&&K!==1||!U&&K!=2||U&&K===0&&typeof Q>"u")throw Error("Encryption block is invalid.");var A=0;if(K===0){A=G-3-Q;for(var D=0;D<A;++D)if(O.getByte()!==0)throw Error("Encryption block is invalid.")}else if(K===1){A=0;while(O.length()>1){if(O.getByte()!==255){--O.read;break}++A}}else if(K===2){A=0;while(O.length()>1){if(O.getByte()===0){--O.read;break}++A}}var C=O.getByte();if(C!==0||A!==G-3-O.length())throw Error("Encryption block is invalid.");return O.getBytes()}function BE(X,Z,U){if(typeof Z==="function")U=Z,Z={};Z=Z||{};var Q={algorithm:{name:Z.algorithm||"PRIMEINC",options:{workers:Z.workers||2,workLoad:Z.workLoad||100,workerScript:Z.workerScript}}};if("prng"in Z)Q.prng=Z.prng;G();function G(){O(X.pBits,function(K,A){if(K)return U(K);if(X.p=A,X.q!==null)return Y(K,X.q);O(X.qBits,Y)})}function O(K,A){i0.prime.generateProbablePrime(K,Q,A)}function Y(K,A){if(K)return U(K);if(X.q=A,X.p.compareTo(X.q)<0){var D=X.p;X.p=X.q,X.q=D}if(X.p.subtract(EX.ONE).gcd(X.e).compareTo(EX.ONE)!==0){X.p=null,G();return}if(X.q.subtract(EX.ONE).gcd(X.e).compareTo(EX.ONE)!==0){X.q=null,O(X.qBits,Y);return}if(X.p1=X.p.subtract(EX.ONE),X.q1=X.q.subtract(EX.ONE),X.phi=X.p1.multiply(X.q1),X.phi.gcd(X.e).compareTo(EX.ONE)!==0){X.p=X.q=null,G();return}if(X.n=X.p.multiply(X.q),X.n.bitLength()!==X.bits){X.q=null,O(X.qBits,Y);return}var C=X.e.modInverse(X.phi);X.keys={privateKey:UX.rsa.setPrivateKey(X.n,X.e,C,X.p,X.q,C.mod(X.p1),C.mod(X.q1),X.q.modInverse(X.p)),publicKey:UX.rsa.setPublicKey(X.n,X.e)},U(null,X.keys)}}function aZ(X){var Z=X.toString(16);if(Z[0]>="8")Z="00"+Z;var U=i0.util.hexToBytes(Z);if(U.length>1&&(U.charCodeAt(0)===0&&(U.charCodeAt(1)&128)===0||U.charCodeAt(0)===255&&(U.charCodeAt(1)&128)===128))return U.substr(1);return U}function kE(X){if(X<=100)return 27;if(X<=150)return 18;if(X<=200)return 15;if(X<=250)return 12;if(X<=300)return 9;if(X<=350)return 8;if(X<=400)return 7;if(X<=500)return 6;if(X<=600)return 5;if(X<=800)return 4;if(X<=1250)return 3;return 2}function aV(X){return i0.util.isNodejs&&typeof uY[X]==="function"}function tV(X){return typeof wZ.globalScope<"u"&&typeof wZ.globalScope.crypto==="object"&&typeof wZ.globalScope.crypto.subtle==="object"&&typeof wZ.globalScope.crypto.subtle[X]==="function"}function iV(X){return typeof wZ.globalScope<"u"&&typeof wZ.globalScope.msCrypto==="object"&&typeof wZ.globalScope.msCrypto.subtle==="object"&&typeof wZ.globalScope.msCrypto.subtle[X]==="function"}function eV(X){var Z=i0.util.hexToBytes(X.toString(16)),U=new Uint8Array(Z.length);for(var Q=0;Q<Z.length;++Q)U[Q]=Z.charCodeAt(Q);return U}});var dY=QX((aD,$W)=>{var t0=GX();VQ();hZ();FU();cZ();WQ();HJ();PQ();kZ();vY();NU();DX();if(typeof bY>"u")bY=t0.jsbn.BigInteger;var bY,q0=t0.asn1,YX=t0.pki=t0.pki||{};$W.exports=YX.pbe=t0.pbe=t0.pbe||{};var wQ=YX.oids,xE={name:"EncryptedPrivateKeyInfo",tagClass:q0.Class.UNIVERSAL,type:q0.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:q0.Class.UNIVERSAL,type:q0.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:q0.Class.UNIVERSAL,type:q0.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:q0.Class.UNIVERSAL,type:q0.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:q0.Class.UNIVERSAL,type:q0.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},wE={name:"PBES2Algorithms",tagClass:q0.Class.UNIVERSAL,type:q0.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:q0.Class.UNIVERSAL,type:q0.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:q0.Class.UNIVERSAL,type:q0.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:q0.Class.UNIVERSAL,type:q0.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:q0.Class.UNIVERSAL,type:q0.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:q0.Class.UNIVERSAL,type:q0.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:q0.Class.UNIVERSAL,type:q0.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:q0.Class.UNIVERSAL,type:q0.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:q0.Class.UNIVERSAL,type:q0.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:q0.Class.UNIVERSAL,type:q0.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:q0.Class.UNIVERSAL,type:q0.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:q0.Class.UNIVERSAL,type:q0.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},vE={name:"pkcs-12PbeParams",tagClass:q0.Class.UNIVERSAL,type:q0.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:q0.Class.UNIVERSAL,type:q0.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:q0.Class.UNIVERSAL,type:q0.Type.INTEGER,constructed:!1,capture:"iterations"}]};YX.encryptPrivateKeyInfo=function(X,Z,U){U=U||{},U.saltSize=U.saltSize||8,U.count=U.count||2048,U.algorithm=U.algorithm||"aes128",U.prfAlgorithm=U.prfAlgorithm||"sha1";var Q=t0.random.getBytesSync(U.saltSize),G=U.count,O=q0.integerToDer(G),Y,K,A;if(U.algorithm.indexOf("aes")===0||U.algorithm==="des"){var D,C,z;switch(U.algorithm){case"aes128":Y=16,D=16,C=wQ["aes128-CBC"],z=t0.aes.createEncryptionCipher;break;case"aes192":Y=24,D=16,C=wQ["aes192-CBC"],z=t0.aes.createEncryptionCipher;break;case"aes256":Y=32,D=16,C=wQ["aes256-CBC"],z=t0.aes.createEncryptionCipher;break;case"des":Y=8,D=8,C=wQ.desCBC,z=t0.des.createEncryptionCipher;break;default:var R=Error("Cannot encrypt private key. Unknown encryption algorithm.");throw R.algorithm=U.algorithm,R}var S="hmacWith"+U.prfAlgorithm.toUpperCase(),P=YW(S),N=t0.pkcs5.pbkdf2(Z,Q,G,Y,P),I=t0.random.getBytesSync(D),B=z(N);B.start(I),B.update(q0.toDer(X)),B.finish(),A=B.output.getBytes();var k=_E(Q,O,Y,S);K=q0.create(q0.Class.UNIVERSAL,q0.Type.SEQUENCE,!0,[q0.create(q0.Class.UNIVERSAL,q0.Type.OID,!1,q0.oidToDer(wQ.pkcs5PBES2).getBytes()),q0.create(q0.Class.UNIVERSAL,q0.Type.SEQUENCE,!0,[q0.create(q0.Class.UNIVERSAL,q0.Type.SEQUENCE,!0,[q0.create(q0.Class.UNIVERSAL,q0.Type.OID,!1,q0.oidToDer(wQ.pkcs5PBKDF2).getBytes()),k]),q0.create(q0.Class.UNIVERSAL,q0.Type.SEQUENCE,!0,[q0.create(q0.Class.UNIVERSAL,q0.Type.OID,!1,q0.oidToDer(C).getBytes()),q0.create(q0.Class.UNIVERSAL,q0.Type.OCTETSTRING,!1,I)])])])}else if(U.algorithm==="3des"){Y=24;var w=new t0.util.ByteBuffer(Q),N=YX.pbe.generatePkcs12Key(Z,w,1,G,Y),I=YX.pbe.generatePkcs12Key(Z,w,2,G,Y),B=t0.des.createEncryptionCipher(N);B.start(I),B.update(q0.toDer(X)),B.finish(),A=B.output.getBytes(),K=q0.create(q0.Class.UNIVERSAL,q0.Type.SEQUENCE,!0,[q0.create(q0.Class.UNIVERSAL,q0.Type.OID,!1,q0.oidToDer(wQ["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),q0.create(q0.Class.UNIVERSAL,q0.Type.SEQUENCE,!0,[q0.create(q0.Class.UNIVERSAL,q0.Type.OCTETSTRING,!1,Q),q0.create(q0.Class.UNIVERSAL,q0.Type.INTEGER,!1,O.getBytes())])])}else{var R=Error("Cannot encrypt private key. Unknown encryption algorithm.");throw R.algorithm=U.algorithm,R}var v=q0.create(q0.Class.UNIVERSAL,q0.Type.SEQUENCE,!0,[K,q0.create(q0.Class.UNIVERSAL,q0.Type.OCTETSTRING,!1,A)]);return v};YX.decryptPrivateKeyInfo=function(X,Z){var U=null,Q={},G=[];if(!q0.validate(X,xE,Q,G)){var O=Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw O.errors=G,O}var Y=q0.derToOid(Q.encryptionOid),K=YX.pbe.getCipher(Y,Q.encryptionParams,Z),A=t0.util.createBuffer(Q.encryptedData);if(K.update(A),K.finish())U=q0.fromDer(K.output);return U};YX.encryptedPrivateKeyToPem=function(X,Z){var U={type:"ENCRYPTED PRIVATE KEY",body:q0.toDer(X).getBytes()};return t0.pem.encode(U,{maxline:Z})};YX.encryptedPrivateKeyFromPem=function(X){var Z=t0.pem.decode(X)[0];if(Z.type!=="ENCRYPTED PRIVATE KEY"){var U=Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw U.headerType=Z.type,U}if(Z.procType&&Z.procType.type==="ENCRYPTED")throw Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return q0.fromDer(Z.body)};YX.encryptRsaPrivateKey=function(X,Z,U){if(U=U||{},!U.legacy){var Q=YX.wrapRsaPrivateKey(YX.privateKeyToAsn1(X));return Q=YX.encryptPrivateKeyInfo(Q,Z,U),YX.encryptedPrivateKeyToPem(Q)}var G,O,Y,K;switch(U.algorithm){case"aes128":G="AES-128-CBC",Y=16,O=t0.random.getBytesSync(16),K=t0.aes.createEncryptionCipher;break;case"aes192":G="AES-192-CBC",Y=24,O=t0.random.getBytesSync(16),K=t0.aes.createEncryptionCipher;break;case"aes256":G="AES-256-CBC",Y=32,O=t0.random.getBytesSync(16),K=t0.aes.createEncryptionCipher;break;case"3des":G="DES-EDE3-CBC",Y=24,O=t0.random.getBytesSync(8),K=t0.des.createEncryptionCipher;break;case"des":G="DES-CBC",Y=8,O=t0.random.getBytesSync(8),K=t0.des.createEncryptionCipher;break;default:var A=Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+U.algorithm+'".');throw A.algorithm=U.algorithm,A}var D=t0.pbe.opensslDeriveBytes(Z,O.substr(0,8),Y),C=K(D);C.start(O),C.update(q0.toDer(YX.privateKeyToAsn1(X))),C.finish();var z={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:G,parameters:t0.util.bytesToHex(O).toUpperCase()},body:C.output.getBytes()};return t0.pem.encode(z)};YX.decryptRsaPrivateKey=function(X,Z){var U=null,Q=t0.pem.decode(X)[0];if(Q.type!=="ENCRYPTED PRIVATE KEY"&&Q.type!=="PRIVATE KEY"&&Q.type!=="RSA PRIVATE KEY"){var G=Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw G.headerType=G,G}if(Q.procType&&Q.procType.type==="ENCRYPTED"){var O,Y;switch(Q.dekInfo.algorithm){case"DES-CBC":O=8,Y=t0.des.createDecryptionCipher;break;case"DES-EDE3-CBC":O=24,Y=t0.des.createDecryptionCipher;break;case"AES-128-CBC":O=16,Y=t0.aes.createDecryptionCipher;break;case"AES-192-CBC":O=24,Y=t0.aes.createDecryptionCipher;break;case"AES-256-CBC":O=32,Y=t0.aes.createDecryptionCipher;break;case"RC2-40-CBC":O=5,Y=function(z){return t0.rc2.createDecryptionCipher(z,40)};break;case"RC2-64-CBC":O=8,Y=function(z){return t0.rc2.createDecryptionCipher(z,64)};break;case"RC2-128-CBC":O=16,Y=function(z){return t0.rc2.createDecryptionCipher(z,128)};break;default:var G=Error('Could not decrypt private key; unsupported encryption algorithm "'+Q.dekInfo.algorithm+'".');throw G.algorithm=Q.dekInfo.algorithm,G}var K=t0.util.hexToBytes(Q.dekInfo.parameters),A=t0.pbe.opensslDeriveBytes(Z,K.substr(0,8),O),D=Y(A);if(D.start(K),D.update(t0.util.createBuffer(Q.body)),D.finish())U=D.output.getBytes();else return U}else U=Q.body;if(Q.type==="ENCRYPTED PRIVATE KEY")U=YX.decryptPrivateKeyInfo(q0.fromDer(U),Z);else U=q0.fromDer(U);if(U!==null)U=YX.privateKeyFromAsn1(U);return U};YX.pbe.generatePkcs12Key=function(X,Z,U,Q,G,O){var Y,K;if(typeof O>"u"||O===null){if(!("sha1"in t0.md))throw Error('"sha1" hash algorithm unavailable.');O=t0.md.sha1.create()}var{digestLength:A,blockLength:D}=O,C=new t0.util.ByteBuffer,z=new t0.util.ByteBuffer;if(X!==null&&X!==void 0){for(K=0;K<X.length;K++)z.putInt16(X.charCodeAt(K));z.putInt16(0)}var R=z.length(),S=Z.length(),P=new t0.util.ByteBuffer;P.fillWithByte(U,D);var N=D*Math.ceil(S/D),I=new t0.util.ByteBuffer;for(K=0;K<N;K++)I.putByte(Z.at(K%S));var B=D*Math.ceil(R/D),k=new t0.util.ByteBuffer;for(K=0;K<B;K++)k.putByte(z.at(K%R));var w=I;w.putBuffer(k);var v=Math.ceil(G/A);for(var _=1;_<=v;_++){var u=new t0.util.ByteBuffer;u.putBytes(P.bytes()),u.putBytes(w.bytes());for(var J0=0;J0<Q;J0++)O.start(),O.update(u.getBytes()),u=O.digest();var H0=new t0.util.ByteBuffer;for(K=0;K<D;K++)H0.putByte(u.at(K%A));var V0=Math.ceil(S/D)+Math.ceil(R/D),l=new t0.util.ByteBuffer;for(Y=0;Y<V0;Y++){var U0=new t0.util.ByteBuffer(w.getBytes(D)),J=511;for(K=H0.length()-1;K>=0;K--)J=J>>8,J+=H0.at(K)+U0.at(K),U0.setAt(K,J&255);l.putBuffer(U0)}w=l,C.putBuffer(u)}return C.truncate(C.length()-G),C};YX.pbe.getCipher=function(X,Z,U){switch(X){case YX.oids.pkcs5PBES2:return YX.pbe.getCipherForPBES2(X,Z,U);case YX.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case YX.oids["pbewithSHAAnd40BitRC2-CBC"]:return YX.pbe.getCipherForPKCS12PBE(X,Z,U);default:var Q=Error("Cannot read encrypted PBE data block. Unsupported OID.");throw Q.oid=X,Q.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],Q}};YX.pbe.getCipherForPBES2=function(X,Z,U){var Q={},G=[];if(!q0.validate(Z,wE,Q,G)){var O=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw O.errors=G,O}if(X=q0.derToOid(Q.kdfOid),X!==YX.oids.pkcs5PBKDF2){var O=Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw O.oid=X,O.supportedOids=["pkcs5PBKDF2"],O}if(X=q0.derToOid(Q.encOid),X!==YX.oids["aes128-CBC"]&&X!==YX.oids["aes192-CBC"]&&X!==YX.oids["aes256-CBC"]&&X!==YX.oids["des-EDE3-CBC"]&&X!==YX.oids.desCBC){var O=Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw O.oid=X,O.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],O}var Y=Q.kdfSalt,K=t0.util.createBuffer(Q.kdfIterationCount);K=K.getInt(K.length()<<3);var A,D;switch(YX.oids[X]){case"aes128-CBC":A=16,D=t0.aes.createDecryptionCipher;break;case"aes192-CBC":A=24,D=t0.aes.createDecryptionCipher;break;case"aes256-CBC":A=32,D=t0.aes.createDecryptionCipher;break;case"des-EDE3-CBC":A=24,D=t0.des.createDecryptionCipher;break;case"desCBC":A=8,D=t0.des.createDecryptionCipher;break}var C=JW(Q.prfOid),z=t0.pkcs5.pbkdf2(U,Y,K,A,C),R=Q.encIv,S=D(z);return S.start(R),S};YX.pbe.getCipherForPKCS12PBE=function(X,Z,U){var Q={},G=[];if(!q0.validate(Z,vE,Q,G)){var O=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw O.errors=G,O}var Y=t0.util.createBuffer(Q.salt),K=t0.util.createBuffer(Q.iterations);K=K.getInt(K.length()<<3);var A,D,C;switch(X){case YX.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:A=24,D=8,C=t0.des.startDecrypting;break;case YX.oids["pbewithSHAAnd40BitRC2-CBC"]:A=5,D=8,C=function(N,I){var B=t0.rc2.createDecryptionCipher(N,40);return B.start(I,null),B};break;default:var O=Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw O.oid=X,O}var z=JW(Q.prfOid),R=YX.pbe.generatePkcs12Key(U,Y,1,K,A,z);z.start();var S=YX.pbe.generatePkcs12Key(U,Y,2,K,D,z);return C(R,S)};YX.pbe.opensslDeriveBytes=function(X,Z,U,Q){if(typeof Q>"u"||Q===null){if(!("md5"in t0.md))throw Error('"md5" hash algorithm unavailable.');Q=t0.md.md5.create()}if(Z===null)Z="";var G=[UW(Q,X+Z)];for(var O=16,Y=1;O<U;++Y,O+=16)G.push(UW(Q,G[Y-1]+X+Z));return G.join("").substr(0,U)};function UW(X,Z){return X.start().update(Z).digest().getBytes()}function JW(X){var Z;if(!X)Z="hmacWithSHA1";else if(Z=YX.oids[q0.derToOid(X)],!Z){var U=Error("Unsupported PRF OID.");throw U.oid=X,U.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],U}return YW(Z)}function YW(X){var Z=t0.md;switch(X){case"hmacWithSHA224":Z=t0.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":X=X.substr(8).toLowerCase();break;default:var U=Error("Unsupported PRF algorithm.");throw U.algorithm=X,U.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],U}if(!Z||!(X in Z))throw Error("Unknown hash algorithm: "+X);return Z[X].create()}function _E(X,Z,U,Q){var G=q0.create(q0.Class.UNIVERSAL,q0.Type.SEQUENCE,!0,[q0.create(q0.Class.UNIVERSAL,q0.Type.OCTETSTRING,!1,X),q0.create(q0.Class.UNIVERSAL,q0.Type.INTEGER,!1,Z.getBytes())]);if(Q!=="hmacWithSHA1")G.value.push(q0.create(q0.Class.UNIVERSAL,q0.Type.INTEGER,!1,t0.util.hexToBytes(U.toString(16))),q0.create(q0.Class.UNIVERSAL,q0.Type.SEQUENCE,!0,[q0.create(q0.Class.UNIVERSAL,q0.Type.OID,!1,q0.oidToDer(YX.oids[Q]).getBytes()),q0.create(q0.Class.UNIVERSAL,q0.Type.NULL,!1,"")]));return G}});var lY=QX((tD,WW)=>{var iQ=GX();hZ();DX();var a0=iQ.asn1,eQ=WW.exports=iQ.pkcs7asn1=iQ.pkcs7asn1||{};iQ.pkcs7=iQ.pkcs7||{};iQ.pkcs7.asn1=eQ;var GW={name:"ContentInfo",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:a0.Class.UNIVERSAL,type:a0.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:a0.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};eQ.contentInfoValidator=GW;var VW={name:"EncryptedContentInfo",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:a0.Class.UNIVERSAL,type:a0.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:a0.Class.UNIVERSAL,type:a0.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:a0.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:a0.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};eQ.envelopedDataValidator={name:"EnvelopedData",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:a0.Class.UNIVERSAL,type:a0.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(VW)};eQ.encryptedDataValidator={name:"EncryptedData",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:a0.Class.UNIVERSAL,type:a0.Type.INTEGER,constructed:!1,capture:"version"}].concat(VW)};var yE={name:"SignerInfo",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:a0.Class.UNIVERSAL,type:a0.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:a0.Class.UNIVERSAL,type:a0.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:a0.Class.UNIVERSAL,type:a0.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:a0.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:a0.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:a0.Class.UNIVERSAL,type:a0.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:a0.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};eQ.signedDataValidator={name:"SignedData",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:a0.Class.UNIVERSAL,type:a0.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},GW,{name:"SignedData.Certificates",tagClass:a0.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:a0.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SET,capture:"signerInfos",optional:!0,value:[yE]}]};eQ.recipientInfoValidator={name:"RecipientInfo",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:a0.Class.UNIVERSAL,type:a0.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:a0.Class.UNIVERSAL,type:a0.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:a0.Class.UNIVERSAL,type:a0.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:a0.Class.UNIVERSAL,type:a0.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:a0.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:a0.Class.UNIVERSAL,type:a0.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var mY=QX((iD,OW)=>{var vQ=GX();DX();vQ.mgf=vQ.mgf||{};var fE=OW.exports=vQ.mgf.mgf1=vQ.mgf1=vQ.mgf1||{};fE.create=function(X){var Z={generate:function(U,Q){var G=new vQ.util.ByteBuffer,O=Math.ceil(Q/X.digestLength);for(var Y=0;Y<O;Y++){var K=new vQ.util.ByteBuffer;K.putInt32(Y),X.start(),X.update(U+K.getBytes()),G.putBuffer(X.digest())}return G.truncate(G.length()-Q),G.getBytes()}};return Z}});var FW=QX((eD,HW)=>{var qJ=GX();mY();HW.exports=qJ.mgf=qJ.mgf||{};qJ.mgf.mgf1=qJ.mgf1});var MJ=QX((Xq,KW)=>{var _Q=GX();kZ();DX();var gE=KW.exports=_Q.pss=_Q.pss||{};gE.create=function(X){if(arguments.length===3)X={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]};var{md:Z,mgf:U}=X,Q=Z.digestLength,G=X.salt||null;if(typeof G==="string")G=_Q.util.createBuffer(G);var O;if("saltLength"in X)O=X.saltLength;else if(G!==null)O=G.length();else throw Error("Salt length not specified or specific salt not given.");if(G!==null&&G.length()!==O)throw Error("Given salt length does not match length of given salt.");var Y=X.prng||_Q.random,K={};return K.encode=function(A,D){var C,z=D-1,R=Math.ceil(z/8),S=A.digest().getBytes();if(R<Q+O+2)throw Error("Message is too long to encrypt.");var P;if(G===null)P=Y.getBytesSync(O);else P=G.bytes();var N=new _Q.util.ByteBuffer;N.fillWithByte(0,8),N.putBytes(S),N.putBytes(P),Z.start(),Z.update(N.getBytes());var I=Z.digest().getBytes(),B=new _Q.util.ByteBuffer;B.fillWithByte(0,R-O-Q-2),B.putByte(1),B.putBytes(P);var k=B.getBytes(),w=R-Q-1,v=U.generate(I,w),_="";for(C=0;C<w;C++)_+=String.fromCharCode(k.charCodeAt(C)^v.charCodeAt(C));var u=65280>>8*R-z&255;return _=String.fromCharCode(_.charCodeAt(0)&~u)+_.substr(1),_+I+String.fromCharCode(188)},K.verify=function(A,D,C){var z,R=C-1,S=Math.ceil(R/8);if(D=D.substr(-S),S<Q+O+2)throw Error("Inconsistent parameters to PSS signature verification.");if(D.charCodeAt(S-1)!==188)throw Error("Encoded message does not end in 0xBC.");var P=S-Q-1,N=D.substr(0,P),I=D.substr(P,Q),B=65280>>8*S-R&255;if((N.charCodeAt(0)&B)!==0)throw Error("Bits beyond keysize not zero as expected.");var k=U.generate(I,P),w="";for(z=0;z<P;z++)w+=String.fromCharCode(N.charCodeAt(z)^k.charCodeAt(z));w=String.fromCharCode(w.charCodeAt(0)&~B)+w.substr(1);var v=S-Q-O-2;for(z=0;z<v;z++)if(w.charCodeAt(z)!==0)throw Error("Leftmost octets not zero as expected");if(w.charCodeAt(v)!==1)throw Error("Inconsistent PSS signature, 0x01 marker not found");var _=w.substr(-O),u=new _Q.util.ByteBuffer;u.fillWithByte(0,8),u.putBytes(A),u.putBytes(_),Z.start(),Z.update(u.getBytes());var J0=Z.digest().getBytes();return I===J0},K}});var TJ=QX((Zq,MW)=>{var e0=GX();VQ();hZ();FU();cZ();FW();WQ();PQ();MJ();NU();DX();var g=e0.asn1,o0=MW.exports=e0.pki=e0.pki||{},zX=o0.oids,vX={};vX.CN=zX.commonName;vX.commonName="CN";vX.C=zX.countryName;vX.countryName="C";vX.L=zX.localityName;vX.localityName="L";vX.ST=zX.stateOrProvinceName;vX.stateOrProvinceName="ST";vX.O=zX.organizationName;vX.organizationName="O";vX.OU=zX.organizationalUnitName;vX.organizationalUnitName="OU";vX.E=zX.emailAddress;vX.emailAddress="E";var zW=e0.pki.rsa.publicKeyValidator,hE={name:"Certificate",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:g.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:g.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:g.Class.UNIVERSAL,type:g.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:g.Class.UNIVERSAL,type:g.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:g.Class.UNIVERSAL,type:g.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:g.Class.UNIVERSAL,type:g.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},zW,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:g.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:g.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:g.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:g.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},pE={name:"rsapss",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:g.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:g.Class.UNIVERSAL,type:g.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:g.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:g.Class.UNIVERSAL,type:g.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:g.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:g.Class.UNIVERSAL,type:g.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:g.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:g.Class.UNIVERSAL,type:g.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},cE={name:"CertificationRequestInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},zW,{name:"CertificationRequestInfo.attributes",tagClass:g.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:g.Class.UNIVERSAL,type:g.Type.SET,constructed:!0}]}]}]},uE={name:"CertificationRequest",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[cE,{name:"CertificationRequest.signatureAlgorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:g.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};o0.RDNAttributesAsArray=function(X,Z){var U=[],Q,G,O;for(var Y=0;Y<X.value.length;++Y){Q=X.value[Y];for(var K=0;K<Q.value.length;++K){if(O={},G=Q.value[K],O.type=g.derToOid(G.value[0].value),O.value=G.value[1].value,O.valueTagClass=G.value[1].type,O.type in zX){if(O.name=zX[O.type],O.name in vX)O.shortName=vX[O.name]}if(Z)Z.update(O.type),Z.update(O.value);U.push(O)}}return U};o0.CRIAttributesAsArray=function(X){var Z=[];for(var U=0;U<X.length;++U){var Q=X[U],G=g.derToOid(Q.value[0].value),O=Q.value[1].value;for(var Y=0;Y<O.length;++Y){var K={};if(K.type=G,K.value=O[Y].value,K.valueTagClass=O[Y].type,K.type in zX){if(K.name=zX[K.type],K.name in vX)K.shortName=vX[K.name]}if(K.type===zX.extensionRequest){K.extensions=[];for(var A=0;A<K.value.length;++A)K.extensions.push(o0.certificateExtensionFromAsn1(K.value[A]))}Z.push(K)}}return Z};function DQ(X,Z){if(typeof Z==="string")Z={shortName:Z};var U=null,Q;for(var G=0;U===null&&G<X.attributes.length;++G)if(Q=X.attributes[G],Z.type&&Z.type===Q.type)U=Q;else if(Z.name&&Z.name===Q.name)U=Q;else if(Z.shortName&&Z.shortName===Q.shortName)U=Q;return U}var CJ=function(X,Z,U){var Q={};if(X!==zX["RSASSA-PSS"])return Q;if(U)Q={hash:{algorithmOid:zX.sha1},mgf:{algorithmOid:zX.mgf1,hash:{algorithmOid:zX.sha1}},saltLength:20};var G={},O=[];if(!g.validate(Z,pE,G,O)){var Y=Error("Cannot read RSASSA-PSS parameter block.");throw Y.errors=O,Y}if(G.hashOid!==void 0)Q.hash=Q.hash||{},Q.hash.algorithmOid=g.derToOid(G.hashOid);if(G.maskGenOid!==void 0)Q.mgf=Q.mgf||{},Q.mgf.algorithmOid=g.derToOid(G.maskGenOid),Q.mgf.hash=Q.mgf.hash||{},Q.mgf.hash.algorithmOid=g.derToOid(G.maskGenHashOid);if(G.saltLength!==void 0)Q.saltLength=G.saltLength.charCodeAt(0);return Q},AJ=function(X){switch(zX[X.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return e0.md.sha1.create();case"md5WithRSAEncryption":return e0.md.md5.create();case"sha256WithRSAEncryption":return e0.md.sha256.create();case"sha384WithRSAEncryption":return e0.md.sha384.create();case"sha512WithRSAEncryption":return e0.md.sha512.create();case"RSASSA-PSS":return e0.md.sha256.create();default:var Z=Error("Could not compute "+X.type+" digest. Unknown signature OID.");throw Z.signatureOid=X.signatureOid,Z}},DW=function(X){var Z=X.certificate,U;switch(Z.signatureOid){case zX.sha1WithRSAEncryption:case zX.sha1WithRSASignature:break;case zX["RSASSA-PSS"]:var Q,G;if(Q=zX[Z.signatureParameters.mgf.hash.algorithmOid],Q===void 0||e0.md[Q]===void 0){var O=Error("Unsupported MGF hash function.");throw O.oid=Z.signatureParameters.mgf.hash.algorithmOid,O.name=Q,O}if(G=zX[Z.signatureParameters.mgf.algorithmOid],G===void 0||e0.mgf[G]===void 0){var O=Error("Unsupported MGF function.");throw O.oid=Z.signatureParameters.mgf.algorithmOid,O.name=G,O}if(G=e0.mgf[G].create(e0.md[Q].create()),Q=zX[Z.signatureParameters.hash.algorithmOid],Q===void 0||e0.md[Q]===void 0){var O=Error("Unsupported RSASSA-PSS hash function.");throw O.oid=Z.signatureParameters.hash.algorithmOid,O.name=Q,O}U=e0.pss.create(e0.md[Q].create(),G,Z.signatureParameters.saltLength);break}return Z.publicKey.verify(X.md.digest().getBytes(),X.signature,U)};o0.certificateFromPem=function(X,Z,U){var Q=e0.pem.decode(X)[0];if(Q.type!=="CERTIFICATE"&&Q.type!=="X509 CERTIFICATE"&&Q.type!=="TRUSTED CERTIFICATE"){var G=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw G.headerType=Q.type,G}if(Q.procType&&Q.procType.type==="ENCRYPTED")throw Error("Could not convert certificate from PEM; PEM is encrypted.");var O=g.fromDer(Q.body,U);return o0.certificateFromAsn1(O,Z)};o0.certificateToPem=function(X,Z){var U={type:"CERTIFICATE",body:g.toDer(o0.certificateToAsn1(X)).getBytes()};return e0.pem.encode(U,{maxline:Z})};o0.publicKeyFromPem=function(X){var Z=e0.pem.decode(X)[0];if(Z.type!=="PUBLIC KEY"&&Z.type!=="RSA PUBLIC KEY"){var U=Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw U.headerType=Z.type,U}if(Z.procType&&Z.procType.type==="ENCRYPTED")throw Error("Could not convert public key from PEM; PEM is encrypted.");var Q=g.fromDer(Z.body);return o0.publicKeyFromAsn1(Q)};o0.publicKeyToPem=function(X,Z){var U={type:"PUBLIC KEY",body:g.toDer(o0.publicKeyToAsn1(X)).getBytes()};return e0.pem.encode(U,{maxline:Z})};o0.publicKeyToRSAPublicKeyPem=function(X,Z){var U={type:"RSA PUBLIC KEY",body:g.toDer(o0.publicKeyToRSAPublicKey(X)).getBytes()};return e0.pem.encode(U,{maxline:Z})};o0.getPublicKeyFingerprint=function(X,Z){Z=Z||{};var U=Z.md||e0.md.sha1.create(),Q=Z.type||"RSAPublicKey",G;switch(Q){case"RSAPublicKey":G=g.toDer(o0.publicKeyToRSAPublicKey(X)).getBytes();break;case"SubjectPublicKeyInfo":G=g.toDer(o0.publicKeyToAsn1(X)).getBytes();break;default:throw Error('Unknown fingerprint type "'+Z.type+'".')}U.start(),U.update(G);var O=U.digest();if(Z.encoding==="hex"){var Y=O.toHex();if(Z.delimiter)return Y.match(/.{2}/g).join(Z.delimiter);return Y}else if(Z.encoding==="binary")return O.getBytes();else if(Z.encoding)throw Error('Unknown encoding "'+Z.encoding+'".');return O};o0.certificationRequestFromPem=function(X,Z,U){var Q=e0.pem.decode(X)[0];if(Q.type!=="CERTIFICATE REQUEST"){var G=Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw G.headerType=Q.type,G}if(Q.procType&&Q.procType.type==="ENCRYPTED")throw Error("Could not convert certification request from PEM; PEM is encrypted.");var O=g.fromDer(Q.body,U);return o0.certificationRequestFromAsn1(O,Z)};o0.certificationRequestToPem=function(X,Z){var U={type:"CERTIFICATE REQUEST",body:g.toDer(o0.certificationRequestToAsn1(X)).getBytes()};return e0.pem.encode(U,{maxline:Z})};o0.createCertificate=function(){var X={};return X.version=2,X.serialNumber="00",X.signatureOid=null,X.signature=null,X.siginfo={},X.siginfo.algorithmOid=null,X.validity={},X.validity.notBefore=new Date,X.validity.notAfter=new Date,X.issuer={},X.issuer.getField=function(Z){return DQ(X.issuer,Z)},X.issuer.addField=function(Z){vZ([Z]),X.issuer.attributes.push(Z)},X.issuer.attributes=[],X.issuer.hash=null,X.subject={},X.subject.getField=function(Z){return DQ(X.subject,Z)},X.subject.addField=function(Z){vZ([Z]),X.subject.attributes.push(Z)},X.subject.attributes=[],X.subject.hash=null,X.extensions=[],X.publicKey=null,X.md=null,X.setSubject=function(Z,U){if(vZ(Z),X.subject.attributes=Z,delete X.subject.uniqueId,U)X.subject.uniqueId=U;X.subject.hash=null},X.setIssuer=function(Z,U){if(vZ(Z),X.issuer.attributes=Z,delete X.issuer.uniqueId,U)X.issuer.uniqueId=U;X.issuer.hash=null},X.setExtensions=function(Z){for(var U=0;U<Z.length;++U)qW(Z[U],{cert:X});X.extensions=Z},X.getExtension=function(Z){if(typeof Z==="string")Z={name:Z};var U=null,Q;for(var G=0;U===null&&G<X.extensions.length;++G)if(Q=X.extensions[G],Z.id&&Q.id===Z.id)U=Q;else if(Z.name&&Q.name===Z.name)U=Q;return U},X.sign=function(Z,U){X.md=U||e0.md.sha1.create();var Q=zX[X.md.algorithm+"WithRSAEncryption"];if(!Q){var G=Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw G.algorithm=X.md.algorithm,G}X.signatureOid=X.siginfo.algorithmOid=Q,X.tbsCertificate=o0.getTBSCertificate(X);var O=g.toDer(X.tbsCertificate);X.md.update(O.getBytes()),X.signature=Z.sign(X.md)},X.verify=function(Z){var U=!1;if(!X.issued(Z)){var Q=Z.issuer,G=X.subject,O=Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw O.expectedIssuer=G.attributes,O.actualIssuer=Q.attributes,O}var Y=Z.md;if(Y===null){Y=AJ({signatureOid:Z.signatureOid,type:"certificate"});var K=Z.tbsCertificate||o0.getTBSCertificate(Z),A=g.toDer(K);Y.update(A.getBytes())}if(Y!==null)U=DW({certificate:X,md:Y,signature:Z.signature});return U},X.isIssuer=function(Z){var U=!1,Q=X.issuer,G=Z.subject;if(Q.hash&&G.hash)U=Q.hash===G.hash;else if(Q.attributes.length===G.attributes.length){U=!0;var O,Y;for(var K=0;U&&K<Q.attributes.length;++K)if(O=Q.attributes[K],Y=G.attributes[K],O.type!==Y.type||O.value!==Y.value)U=!1}return U},X.issued=function(Z){return Z.isIssuer(X)},X.generateSubjectKeyIdentifier=function(){return o0.getPublicKeyFingerprint(X.publicKey,{type:"RSAPublicKey"})},X.verifySubjectKeyIdentifier=function(){var Z=zX.subjectKeyIdentifier;for(var U=0;U<X.extensions.length;++U){var Q=X.extensions[U];if(Q.id===Z){var G=X.generateSubjectKeyIdentifier().getBytes();return e0.util.hexToBytes(Q.subjectKeyIdentifier)===G}}return!1},X};o0.certificateFromAsn1=function(X,Z){var U={},Q=[];if(!g.validate(X,hE,U,Q)){var G=Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw G.errors=Q,G}var O=g.derToOid(U.publicKeyOid);if(O!==o0.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var Y=o0.createCertificate();Y.version=U.certVersion?U.certVersion.charCodeAt(0):0;var K=e0.util.createBuffer(U.certSerialNumber);Y.serialNumber=K.toHex(),Y.signatureOid=e0.asn1.derToOid(U.certSignatureOid),Y.signatureParameters=CJ(Y.signatureOid,U.certSignatureParams,!0),Y.siginfo.algorithmOid=e0.asn1.derToOid(U.certinfoSignatureOid),Y.siginfo.parameters=CJ(Y.siginfo.algorithmOid,U.certinfoSignatureParams,!1),Y.signature=U.certSignature;var A=[];if(U.certValidity1UTCTime!==void 0)A.push(g.utcTimeToDate(U.certValidity1UTCTime));if(U.certValidity2GeneralizedTime!==void 0)A.push(g.generalizedTimeToDate(U.certValidity2GeneralizedTime));if(U.certValidity3UTCTime!==void 0)A.push(g.utcTimeToDate(U.certValidity3UTCTime));if(U.certValidity4GeneralizedTime!==void 0)A.push(g.generalizedTimeToDate(U.certValidity4GeneralizedTime));if(A.length>2)throw Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(A.length<2)throw Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(Y.validity.notBefore=A[0],Y.validity.notAfter=A[1],Y.tbsCertificate=U.tbsCertificate,Z){Y.md=AJ({signatureOid:Y.signatureOid,type:"certificate"});var D=g.toDer(Y.tbsCertificate);Y.md.update(D.getBytes())}var C=e0.md.sha1.create(),z=g.toDer(U.certIssuer);if(C.update(z.getBytes()),Y.issuer.getField=function(P){return DQ(Y.issuer,P)},Y.issuer.addField=function(P){vZ([P]),Y.issuer.attributes.push(P)},Y.issuer.attributes=o0.RDNAttributesAsArray(U.certIssuer),U.certIssuerUniqueId)Y.issuer.uniqueId=U.certIssuerUniqueId;Y.issuer.hash=C.digest().toHex();var R=e0.md.sha1.create(),S=g.toDer(U.certSubject);if(R.update(S.getBytes()),Y.subject.getField=function(P){return DQ(Y.subject,P)},Y.subject.addField=function(P){vZ([P]),Y.subject.attributes.push(P)},Y.subject.attributes=o0.RDNAttributesAsArray(U.certSubject),U.certSubjectUniqueId)Y.subject.uniqueId=U.certSubjectUniqueId;if(Y.subject.hash=R.digest().toHex(),U.certExtensions)Y.extensions=o0.certificateExtensionsFromAsn1(U.certExtensions);else Y.extensions=[];return Y.publicKey=o0.publicKeyFromAsn1(U.subjectPublicKeyInfo),Y};o0.certificateExtensionsFromAsn1=function(X){var Z=[];for(var U=0;U<X.value.length;++U){var Q=X.value[U];for(var G=0;G<Q.value.length;++G)Z.push(o0.certificateExtensionFromAsn1(Q.value[G]))}return Z};o0.certificateExtensionFromAsn1=function(X){var Z={};if(Z.id=g.derToOid(X.value[0].value),Z.critical=!1,X.value[1].type===g.Type.BOOLEAN)Z.critical=X.value[1].value.charCodeAt(0)!==0,Z.value=X.value[2].value;else Z.value=X.value[1].value;if(Z.id in zX){if(Z.name=zX[Z.id],Z.name==="keyUsage"){var U=g.fromDer(Z.value),Q=0,G=0;if(U.value.length>1)Q=U.value.charCodeAt(1),G=U.value.length>2?U.value.charCodeAt(2):0;Z.digitalSignature=(Q&128)===128,Z.nonRepudiation=(Q&64)===64,Z.keyEncipherment=(Q&32)===32,Z.dataEncipherment=(Q&16)===16,Z.keyAgreement=(Q&8)===8,Z.keyCertSign=(Q&4)===4,Z.cRLSign=(Q&2)===2,Z.encipherOnly=(Q&1)===1,Z.decipherOnly=(G&128)===128}else if(Z.name==="basicConstraints"){var U=g.fromDer(Z.value);if(U.value.length>0&&U.value[0].type===g.Type.BOOLEAN)Z.cA=U.value[0].value.charCodeAt(0)!==0;else Z.cA=!1;var O=null;if(U.value.length>0&&U.value[0].type===g.Type.INTEGER)O=U.value[0].value;else if(U.value.length>1)O=U.value[1].value;if(O!==null)Z.pathLenConstraint=g.derToInteger(O)}else if(Z.name==="extKeyUsage"){var U=g.fromDer(Z.value);for(var Y=0;Y<U.value.length;++Y){var K=g.derToOid(U.value[Y].value);if(K in zX)Z[zX[K]]=!0;else Z[K]=!0}}else if(Z.name==="nsCertType"){var U=g.fromDer(Z.value),Q=0;if(U.value.length>1)Q=U.value.charCodeAt(1);Z.client=(Q&128)===128,Z.server=(Q&64)===64,Z.email=(Q&32)===32,Z.objsign=(Q&16)===16,Z.reserved=(Q&8)===8,Z.sslCA=(Q&4)===4,Z.emailCA=(Q&2)===2,Z.objCA=(Q&1)===1}else if(Z.name==="subjectAltName"||Z.name==="issuerAltName"){Z.altNames=[];var A,U=g.fromDer(Z.value);for(var D=0;D<U.value.length;++D){A=U.value[D];var C={type:A.type,value:A.value};switch(Z.altNames.push(C),A.type){case 1:case 2:case 6:break;case 7:C.ip=e0.util.bytesToIP(A.value);break;case 8:C.oid=g.derToOid(A.value);break;default:}}}else if(Z.name==="subjectKeyIdentifier"){var U=g.fromDer(Z.value);Z.subjectKeyIdentifier=e0.util.bytesToHex(U.value)}}return Z};o0.certificationRequestFromAsn1=function(X,Z){var U={},Q=[];if(!g.validate(X,uE,U,Q)){var G=Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw G.errors=Q,G}var O=g.derToOid(U.publicKeyOid);if(O!==o0.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var Y=o0.createCertificationRequest();if(Y.version=U.csrVersion?U.csrVersion.charCodeAt(0):0,Y.signatureOid=e0.asn1.derToOid(U.csrSignatureOid),Y.signatureParameters=CJ(Y.signatureOid,U.csrSignatureParams,!0),Y.siginfo.algorithmOid=e0.asn1.derToOid(U.csrSignatureOid),Y.siginfo.parameters=CJ(Y.siginfo.algorithmOid,U.csrSignatureParams,!1),Y.signature=U.csrSignature,Y.certificationRequestInfo=U.certificationRequestInfo,Z){Y.md=AJ({signatureOid:Y.signatureOid,type:"certification request"});var K=g.toDer(Y.certificationRequestInfo);Y.md.update(K.getBytes())}var A=e0.md.sha1.create();return Y.subject.getField=function(D){return DQ(Y.subject,D)},Y.subject.addField=function(D){vZ([D]),Y.subject.attributes.push(D)},Y.subject.attributes=o0.RDNAttributesAsArray(U.certificationRequestInfoSubject,A),Y.subject.hash=A.digest().toHex(),Y.publicKey=o0.publicKeyFromAsn1(U.subjectPublicKeyInfo),Y.getAttribute=function(D){return DQ(Y,D)},Y.addAttribute=function(D){vZ([D]),Y.attributes.push(D)},Y.attributes=o0.CRIAttributesAsArray(U.certificationRequestInfoAttributes||[]),Y};o0.createCertificationRequest=function(){var X={};return X.version=0,X.signatureOid=null,X.signature=null,X.siginfo={},X.siginfo.algorithmOid=null,X.subject={},X.subject.getField=function(Z){return DQ(X.subject,Z)},X.subject.addField=function(Z){vZ([Z]),X.subject.attributes.push(Z)},X.subject.attributes=[],X.subject.hash=null,X.publicKey=null,X.attributes=[],X.getAttribute=function(Z){return DQ(X,Z)},X.addAttribute=function(Z){vZ([Z]),X.attributes.push(Z)},X.md=null,X.setSubject=function(Z){vZ(Z),X.subject.attributes=Z,X.subject.hash=null},X.setAttributes=function(Z){vZ(Z),X.attributes=Z},X.sign=function(Z,U){X.md=U||e0.md.sha1.create();var Q=zX[X.md.algorithm+"WithRSAEncryption"];if(!Q){var G=Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw G.algorithm=X.md.algorithm,G}X.signatureOid=X.siginfo.algorithmOid=Q,X.certificationRequestInfo=o0.getCertificationRequestInfo(X);var O=g.toDer(X.certificationRequestInfo);X.md.update(O.getBytes()),X.signature=Z.sign(X.md)},X.verify=function(){var Z=!1,U=X.md;if(U===null){U=AJ({signatureOid:X.signatureOid,type:"certification request"});var Q=X.certificationRequestInfo||o0.getCertificationRequestInfo(X),G=g.toDer(Q);U.update(G.getBytes())}if(U!==null)Z=DW({certificate:X,md:U,signature:X.signature});return Z},X};function XU(X){var Z=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),U,Q,G=X.attributes;for(var O=0;O<G.length;++O){U=G[O];var Y=U.value,K=g.Type.PRINTABLESTRING;if("valueTagClass"in U){if(K=U.valueTagClass,K===g.Type.UTF8)Y=e0.util.encodeUtf8(Y)}Q=g.create(g.Class.UNIVERSAL,g.Type.SET,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(U.type).getBytes()),g.create(g.Class.UNIVERSAL,K,!1,Y)])]),Z.value.push(Q)}return Z}function vZ(X){var Z;for(var U=0;U<X.length;++U){if(Z=X[U],typeof Z.name>"u"){if(Z.type&&Z.type in o0.oids)Z.name=o0.oids[Z.type];else if(Z.shortName&&Z.shortName in vX)Z.name=o0.oids[vX[Z.shortName]]}if(typeof Z.type>"u")if(Z.name&&Z.name in o0.oids)Z.type=o0.oids[Z.name];else{var Q=Error("Attribute type not specified.");throw Q.attribute=Z,Q}if(typeof Z.shortName>"u"){if(Z.name&&Z.name in vX)Z.shortName=vX[Z.name]}if(Z.type===zX.extensionRequest){if(Z.valueConstructed=!0,Z.valueTagClass=g.Type.SEQUENCE,!Z.value&&Z.extensions){Z.value=[];for(var G=0;G<Z.extensions.length;++G)Z.value.push(o0.certificateExtensionToAsn1(qW(Z.extensions[G])))}}if(typeof Z.value>"u"){var Q=Error("Attribute value not specified.");throw Q.attribute=Z,Q}}}function qW(X,Z){if(Z=Z||{},typeof X.name>"u"){if(X.id&&X.id in o0.oids)X.name=o0.oids[X.id]}if(typeof X.id>"u")if(X.name&&X.name in o0.oids)X.id=o0.oids[X.name];else{var U=Error("Extension ID not specified.");throw U.extension=X,U}if(typeof X.value<"u")return X;if(X.name==="keyUsage"){var Q=0,G=0,O=0;if(X.digitalSignature)G|=128,Q=7;if(X.nonRepudiation)G|=64,Q=6;if(X.keyEncipherment)G|=32,Q=5;if(X.dataEncipherment)G|=16,Q=4;if(X.keyAgreement)G|=8,Q=3;if(X.keyCertSign)G|=4,Q=2;if(X.cRLSign)G|=2,Q=1;if(X.encipherOnly)G|=1,Q=0;if(X.decipherOnly)O|=128,Q=7;var Y=String.fromCharCode(Q);if(O!==0)Y+=String.fromCharCode(G)+String.fromCharCode(O);else if(G!==0)Y+=String.fromCharCode(G);X.value=g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,Y)}else if(X.name==="basicConstraints"){if(X.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),X.cA)X.value.value.push(g.create(g.Class.UNIVERSAL,g.Type.BOOLEAN,!1,String.fromCharCode(255)));if("pathLenConstraint"in X)X.value.value.push(g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(X.pathLenConstraint).getBytes()))}else if(X.name==="extKeyUsage"){X.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);var K=X.value.value;for(var A in X){if(X[A]!==!0)continue;if(A in zX)K.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(zX[A]).getBytes()));else if(A.indexOf(".")!==-1)K.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(A).getBytes()))}}else if(X.name==="nsCertType"){var Q=0,G=0;if(X.client)G|=128,Q=7;if(X.server)G|=64,Q=6;if(X.email)G|=32,Q=5;if(X.objsign)G|=16,Q=4;if(X.reserved)G|=8,Q=3;if(X.sslCA)G|=4,Q=2;if(X.emailCA)G|=2,Q=1;if(X.objCA)G|=1,Q=0;var Y=String.fromCharCode(Q);if(G!==0)Y+=String.fromCharCode(G);X.value=g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,Y)}else if(X.name==="subjectAltName"||X.name==="issuerAltName"){X.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);var D;for(var C=0;C<X.altNames.length;++C){D=X.altNames[C];var Y=D.value;if(D.type===7&&D.ip){if(Y=e0.util.bytesFromIP(D.ip),Y===null){var U=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw U.extension=X,U}}else if(D.type===8)if(D.oid)Y=g.oidToDer(g.oidToDer(D.oid));else Y=g.oidToDer(Y);X.value.value.push(g.create(g.Class.CONTEXT_SPECIFIC,D.type,!1,Y))}}else if(X.name==="nsComment"&&Z.cert){if(!/^[\x00-\x7F]*$/.test(X.comment)||X.comment.length<1||X.comment.length>128)throw Error('Invalid "nsComment" content.');X.value=g.create(g.Class.UNIVERSAL,g.Type.IA5STRING,!1,X.comment)}else if(X.name==="subjectKeyIdentifier"&&Z.cert){var z=Z.cert.generateSubjectKeyIdentifier();X.subjectKeyIdentifier=z.toHex(),X.value=g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,z.getBytes())}else if(X.name==="authorityKeyIdentifier"&&Z.cert){X.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);var K=X.value.value;if(X.keyIdentifier){var R=X.keyIdentifier===!0?Z.cert.generateSubjectKeyIdentifier().getBytes():X.keyIdentifier;K.push(g.create(g.Class.CONTEXT_SPECIFIC,0,!1,R))}if(X.authorityCertIssuer){var S=[g.create(g.Class.CONTEXT_SPECIFIC,4,!0,[XU(X.authorityCertIssuer===!0?Z.cert.issuer:X.authorityCertIssuer)])];K.push(g.create(g.Class.CONTEXT_SPECIFIC,1,!0,S))}if(X.serialNumber){var P=e0.util.hexToBytes(X.serialNumber===!0?Z.cert.serialNumber:X.serialNumber);K.push(g.create(g.Class.CONTEXT_SPECIFIC,2,!1,P))}}else if(X.name==="cRLDistributionPoints"){X.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);var K=X.value.value,N=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),I=g.create(g.Class.CONTEXT_SPECIFIC,0,!0,[]),D;for(var C=0;C<X.altNames.length;++C){D=X.altNames[C];var Y=D.value;if(D.type===7&&D.ip){if(Y=e0.util.bytesFromIP(D.ip),Y===null){var U=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw U.extension=X,U}}else if(D.type===8)if(D.oid)Y=g.oidToDer(g.oidToDer(D.oid));else Y=g.oidToDer(Y);I.value.push(g.create(g.Class.CONTEXT_SPECIFIC,D.type,!1,Y))}N.value.push(g.create(g.Class.CONTEXT_SPECIFIC,0,!0,[I])),K.push(N)}if(typeof X.value>"u"){var U=Error("Extension value not specified.");throw U.extension=X,U}return X}function oY(X,Z){switch(X){case zX["RSASSA-PSS"]:var U=[];if(Z.hash.algorithmOid!==void 0)U.push(g.create(g.Class.CONTEXT_SPECIFIC,0,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(Z.hash.algorithmOid).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")])]));if(Z.mgf.algorithmOid!==void 0)U.push(g.create(g.Class.CONTEXT_SPECIFIC,1,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(Z.mgf.algorithmOid).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(Z.mgf.hash.algorithmOid).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")])])]));if(Z.saltLength!==void 0)U.push(g.create(g.Class.CONTEXT_SPECIFIC,2,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(Z.saltLength).getBytes())]));return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,U);default:return g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")}}function bE(X){var Z=g.create(g.Class.CONTEXT_SPECIFIC,0,!0,[]);if(X.attributes.length===0)return Z;var U=X.attributes;for(var Q=0;Q<U.length;++Q){var G=U[Q],O=G.value,Y=g.Type.UTF8;if("valueTagClass"in G)Y=G.valueTagClass;if(Y===g.Type.UTF8)O=e0.util.encodeUtf8(O);var K=!1;if("valueConstructed"in G)K=G.valueConstructed;var A=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(G.type).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.SET,!0,[g.create(g.Class.UNIVERSAL,Y,K,O)])]);Z.value.push(A)}return Z}var dE=new Date("1950-01-01T00:00:00Z"),lE=new Date("2050-01-01T00:00:00Z");function EW(X){if(X>=dE&&X<lE)return g.create(g.Class.UNIVERSAL,g.Type.UTCTIME,!1,g.dateToUtcTime(X));else return g.create(g.Class.UNIVERSAL,g.Type.GENERALIZEDTIME,!1,g.dateToGeneralizedTime(X))}o0.getTBSCertificate=function(X){var Z=EW(X.validity.notBefore),U=EW(X.validity.notAfter),Q=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.CONTEXT_SPECIFIC,0,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(X.version).getBytes())]),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,e0.util.hexToBytes(X.serialNumber)),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(X.siginfo.algorithmOid).getBytes()),oY(X.siginfo.algorithmOid,X.siginfo.parameters)]),XU(X.issuer),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[Z,U]),XU(X.subject),o0.publicKeyToAsn1(X.publicKey)]);if(X.issuer.uniqueId)Q.value.push(g.create(g.Class.CONTEXT_SPECIFIC,1,!0,[g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,String.fromCharCode(0)+X.issuer.uniqueId)]));if(X.subject.uniqueId)Q.value.push(g.create(g.Class.CONTEXT_SPECIFIC,2,!0,[g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,String.fromCharCode(0)+X.subject.uniqueId)]));if(X.extensions.length>0)Q.value.push(o0.certificateExtensionsToAsn1(X.extensions));return Q};o0.getCertificationRequestInfo=function(X){var Z=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(X.version).getBytes()),XU(X.subject),o0.publicKeyToAsn1(X.publicKey),bE(X)]);return Z};o0.distinguishedNameToAsn1=function(X){return XU(X)};o0.certificateToAsn1=function(X){var Z=X.tbsCertificate||o0.getTBSCertificate(X);return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[Z,g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(X.signatureOid).getBytes()),oY(X.signatureOid,X.signatureParameters)]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,String.fromCharCode(0)+X.signature)])};o0.certificateExtensionsToAsn1=function(X){var Z=g.create(g.Class.CONTEXT_SPECIFIC,3,!0,[]),U=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);Z.value.push(U);for(var Q=0;Q<X.length;++Q)U.value.push(o0.certificateExtensionToAsn1(X[Q]));return Z};o0.certificateExtensionToAsn1=function(X){var Z=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);if(Z.value.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(X.id).getBytes())),X.critical)Z.value.push(g.create(g.Class.UNIVERSAL,g.Type.BOOLEAN,!1,String.fromCharCode(255)));var U=X.value;if(typeof X.value!=="string")U=g.toDer(U).getBytes();return Z.value.push(g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,U)),Z};o0.certificationRequestToAsn1=function(X){var Z=X.certificationRequestInfo||o0.getCertificationRequestInfo(X);return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[Z,g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(X.signatureOid).getBytes()),oY(X.signatureOid,X.signatureParameters)]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,String.fromCharCode(0)+X.signature)])};o0.createCaStore=function(X){var Z={certs:{}};Z.getIssuer=function(Y){var K=U(Y.issuer);return K},Z.addCertificate=function(Y){if(typeof Y==="string")Y=e0.pki.certificateFromPem(Y);if(Q(Y.subject),!Z.hasCertificate(Y))if(Y.subject.hash in Z.certs){var K=Z.certs[Y.subject.hash];if(!e0.util.isArray(K))K=[K];K.push(Y),Z.certs[Y.subject.hash]=K}else Z.certs[Y.subject.hash]=Y},Z.hasCertificate=function(Y){if(typeof Y==="string")Y=e0.pki.certificateFromPem(Y);var K=U(Y.subject);if(!K)return!1;if(!e0.util.isArray(K))K=[K];var A=g.toDer(o0.certificateToAsn1(Y)).getBytes();for(var D=0;D<K.length;++D){var C=g.toDer(o0.certificateToAsn1(K[D])).getBytes();if(A===C)return!0}return!1},Z.listAllCertificates=function(){var Y=[];for(var K in Z.certs)if(Z.certs.hasOwnProperty(K)){var A=Z.certs[K];if(!e0.util.isArray(A))Y.push(A);else for(var D=0;D<A.length;++D)Y.push(A[D])}return Y},Z.removeCertificate=function(Y){var K;if(typeof Y==="string")Y=e0.pki.certificateFromPem(Y);if(Q(Y.subject),!Z.hasCertificate(Y))return null;var A=U(Y.subject);if(!e0.util.isArray(A))return K=Z.certs[Y.subject.hash],delete Z.certs[Y.subject.hash],K;var D=g.toDer(o0.certificateToAsn1(Y)).getBytes();for(var C=0;C<A.length;++C){var z=g.toDer(o0.certificateToAsn1(A[C])).getBytes();if(D===z)K=A[C],A.splice(C,1)}if(A.length===0)delete Z.certs[Y.subject.hash];return K};function U(Y){return Q(Y),Z.certs[Y.hash]||null}function Q(Y){if(!Y.hash){var K=e0.md.sha1.create();Y.attributes=o0.RDNAttributesAsArray(XU(Y),K),Y.hash=K.digest().toHex()}}if(X)for(var G=0;G<X.length;++G){var O=X[G];Z.addCertificate(O)}return Z};o0.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"};o0.verifyCertificateChain=function(X,Z,U){if(typeof U==="function")U={verify:U};U=U||{},Z=Z.slice(0);var Q=Z.slice(0),G=U.validityCheckDate;if(typeof G>"u")G=new Date;var O=!0,Y=null,K=0;do{var A=Z.shift(),D=null,C=!1;if(G){if(G<A.validity.notBefore||G>A.validity.notAfter)Y={message:"Certificate is not valid yet or has expired.",error:o0.certificateError.certificate_expired,notBefore:A.validity.notBefore,notAfter:A.validity.notAfter,now:G}}if(Y===null){if(D=Z[0]||X.getIssuer(A),D===null){if(A.isIssuer(A))C=!0,D=A}if(D){var z=D;if(!e0.util.isArray(z))z=[z];var R=!1;while(!R&&z.length>0){D=z.shift();try{R=D.verify(A)}catch(_){}}if(!R)Y={message:"Certificate signature is invalid.",error:o0.certificateError.bad_certificate}}if(Y===null&&(!D||C)&&!X.hasCertificate(A))Y={message:"Certificate is not trusted.",error:o0.certificateError.unknown_ca}}if(Y===null&&D&&!A.isIssuer(D))Y={message:"Certificate issuer is invalid.",error:o0.certificateError.bad_certificate};if(Y===null){var S={keyUsage:!0,basicConstraints:!0};for(var P=0;Y===null&&P<A.extensions.length;++P){var N=A.extensions[P];if(N.critical&&!(N.name in S))Y={message:"Certificate has an unsupported critical extension.",error:o0.certificateError.unsupported_certificate}}}if(Y===null&&(!O||Z.length===0&&(!D||C))){var I=A.getExtension("basicConstraints"),B=A.getExtension("keyUsage");if(B!==null){if(!B.keyCertSign||I===null)Y={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:o0.certificateError.bad_certificate}}if(Y===null&&I!==null&&!I.cA)Y={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:o0.certificateError.bad_certificate};if(Y===null&&B!==null&&"pathLenConstraint"in I){var k=K-1;if(k>I.pathLenConstraint)Y={message:"Certificate basicConstraints pathLenConstraint violated.",error:o0.certificateError.bad_certificate}}}var w=Y===null?!0:Y.error,v=U.verify?U.verify(w,K,Q):w;if(v===!0)Y=null;else{if(w===!0)Y={message:"The application rejected the certificate.",error:o0.certificateError.bad_certificate};if(v||v===0){if(typeof v==="object"&&!e0.util.isArray(v)){if(v.message)Y.message=v.message;if(v.error)Y.error=v.error}else if(typeof v==="string")Y.error=v}throw Y}O=!1,++K}while(Z.length>0);return!0}});var sY=QX((Qq,AW)=>{var SX=GX();hZ();bQ();WQ();lY();dY();kZ();NU();tQ();DX();TJ();var{asn1:a,pki:HX}=SX,kU=AW.exports=SX.pkcs12=SX.pkcs12||{},CW={name:"ContentInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:a.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},mE={name:"PFX",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"version"},CW,{name:"PFX.macData",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:a.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},oE={name:"SafeBag",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:a.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:a.Class.UNIVERSAL,type:a.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},nE={name:"Attribute",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:a.Class.UNIVERSAL,type:a.Type.SET,constructed:!0,capture:"values"}]},sE={name:"CertBag",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:a.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:a.Class.UNIVERSAL,type:a.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function BU(X,Z,U,Q){var G=[];for(var O=0;O<X.length;O++)for(var Y=0;Y<X[O].safeBags.length;Y++){var K=X[O].safeBags[Y];if(Q!==void 0&&K.type!==Q)continue;if(Z===null){G.push(K);continue}if(K.attributes[Z]!==void 0&&K.attributes[Z].indexOf(U)>=0)G.push(K)}return G}kU.pkcs12FromAsn1=function(X,Z,U){if(typeof Z==="string")U=Z,Z=!0;else if(Z===void 0)Z=!0;var Q={},G=[];if(!a.validate(X,mE,Q,G)){var O=Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw O.errors=O,O}var Y={version:Q.version.charCodeAt(0),safeContents:[],getBags:function(I){var B={},k;if("localKeyId"in I)k=I.localKeyId;else if("localKeyIdHex"in I)k=SX.util.hexToBytes(I.localKeyIdHex);if(k===void 0&&!("friendlyName"in I)&&"bagType"in I)B[I.bagType]=BU(Y.safeContents,null,null,I.bagType);if(k!==void 0)B.localKeyId=BU(Y.safeContents,"localKeyId",k,I.bagType);if("friendlyName"in I)B.friendlyName=BU(Y.safeContents,"friendlyName",I.friendlyName,I.bagType);return B},getBagsByFriendlyName:function(I,B){return BU(Y.safeContents,"friendlyName",I,B)},getBagsByLocalKeyId:function(I,B){return BU(Y.safeContents,"localKeyId",I,B)}};if(Q.version.charCodeAt(0)!==3){var O=Error("PKCS#12 PFX of version other than 3 not supported.");throw O.version=Q.version.charCodeAt(0),O}if(a.derToOid(Q.contentType)!==HX.oids.data){var O=Error("Only PKCS#12 PFX in password integrity mode supported.");throw O.oid=a.derToOid(Q.contentType),O}var K=Q.content.value[0];if(K.tagClass!==a.Class.UNIVERSAL||K.type!==a.Type.OCTETSTRING)throw Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(K=nY(K),Q.mac){var A=null,D=0,C=a.derToOid(Q.macAlgorithm);switch(C){case HX.oids.sha1:A=SX.md.sha1.create(),D=20;break;case HX.oids.sha256:A=SX.md.sha256.create(),D=32;break;case HX.oids.sha384:A=SX.md.sha384.create(),D=48;break;case HX.oids.sha512:A=SX.md.sha512.create(),D=64;break;case HX.oids.md5:A=SX.md.md5.create(),D=16;break}if(A===null)throw Error("PKCS#12 uses unsupported MAC algorithm: "+C);var z=new SX.util.ByteBuffer(Q.macSalt),R="macIterations"in Q?parseInt(SX.util.bytesToHex(Q.macIterations),16):1,S=kU.generateKey(U,z,3,R,D,A),P=SX.hmac.create();P.start(A,S),P.update(K.value);var N=P.getMac();if(N.getBytes()!==Q.macDigest)throw Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(X.value)&&X.value.length>2)throw Error("Invalid PKCS#12. macData field present but MAC was not validated.");return rE(Y,K.value,Z,U),Y};function nY(X){if(X.composed||X.constructed){var Z=SX.util.createBuffer();for(var U=0;U<X.value.length;++U)Z.putBytes(X.value[U].value);X.composed=X.constructed=!1,X.value=Z.getBytes()}return X}function rE(X,Z,U,Q){if(Z=a.fromDer(Z,U),Z.tagClass!==a.Class.UNIVERSAL||Z.type!==a.Type.SEQUENCE||Z.constructed!==!0)throw Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var G=0;G<Z.value.length;G++){var O=Z.value[G],Y={},K=[];if(!a.validate(O,CW,Y,K)){var A=Error("Cannot read ContentInfo.");throw A.errors=K,A}var D={encrypted:!1},C=null,z=Y.content.value[0];switch(a.derToOid(Y.contentType)){case HX.oids.data:if(z.tagClass!==a.Class.UNIVERSAL||z.type!==a.Type.OCTETSTRING)throw Error("PKCS#12 SafeContents Data is not an OCTET STRING.");C=nY(z).value;break;case HX.oids.encryptedData:C=aE(z,Q),D.encrypted=!0;break;default:var A=Error("Unsupported PKCS#12 contentType.");throw A.contentType=a.derToOid(Y.contentType),A}D.safeBags=tE(C,U,Q),X.safeContents.push(D)}}function aE(X,Z){var U={},Q=[];if(!a.validate(X,SX.pkcs7.asn1.encryptedDataValidator,U,Q)){var G=Error("Cannot read EncryptedContentInfo.");throw G.errors=Q,G}var O=a.derToOid(U.contentType);if(O!==HX.oids.data){var G=Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw G.oid=O,G}O=a.derToOid(U.encAlgorithm);var Y=HX.pbe.getCipher(O,U.encParameter,Z),K=nY(U.encryptedContentAsn1),A=SX.util.createBuffer(K.value);if(Y.update(A),!Y.finish())throw Error("Failed to decrypt PKCS#12 SafeContents.");return Y.output.getBytes()}function tE(X,Z,U){if(!Z&&X.length===0)return[];if(X=a.fromDer(X,Z),X.tagClass!==a.Class.UNIVERSAL||X.type!==a.Type.SEQUENCE||X.constructed!==!0)throw Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");var Q=[];for(var G=0;G<X.value.length;G++){var O=X.value[G],Y={},K=[];if(!a.validate(O,oE,Y,K)){var A=Error("Cannot read SafeBag.");throw A.errors=K,A}var D={type:a.derToOid(Y.bagId),attributes:iE(Y.bagAttributes)};Q.push(D);var C,z,R=Y.bagValue.value[0];switch(D.type){case HX.oids.pkcs8ShroudedKeyBag:if(R=HX.decryptPrivateKeyInfo(R,U),R===null)throw Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case HX.oids.keyBag:try{D.key=HX.privateKeyFromAsn1(R)}catch(P){D.key=null,D.asn1=R}continue;case HX.oids.certBag:C=sE,z=function(){if(a.derToOid(Y.certId)!==HX.oids.x509Certificate){var P=Error("Unsupported certificate type, only X.509 supported.");throw P.oid=a.derToOid(Y.certId),P}var N=a.fromDer(Y.cert,Z);try{D.cert=HX.certificateFromAsn1(N,!0)}catch(I){D.cert=null,D.asn1=N}};break;default:var A=Error("Unsupported PKCS#12 SafeBag type.");throw A.oid=D.type,A}if(C!==void 0&&!a.validate(R,C,Y,K)){var A=Error("Cannot read PKCS#12 "+C.name);throw A.errors=K,A}z()}return Q}function iE(X){var Z={};if(X!==void 0)for(var U=0;U<X.length;++U){var Q={},G=[];if(!a.validate(X[U],nE,Q,G)){var O=Error("Cannot read PKCS#12 BagAttribute.");throw O.errors=G,O}var Y=a.derToOid(Q.oid);if(HX.oids[Y]===void 0)continue;Z[HX.oids[Y]]=[];for(var K=0;K<Q.values.length;++K)Z[HX.oids[Y]].push(Q.values[K].value)}return Z}kU.toPkcs12Asn1=function(X,Z,U,Q){if(Q=Q||{},Q.saltSize=Q.saltSize||8,Q.count=Q.count||2048,Q.algorithm=Q.algorithm||Q.encAlgorithm||"aes128",!("useMac"in Q))Q.useMac=!0;if(!("localKeyId"in Q))Q.localKeyId=null;if(!("generateLocalKeyId"in Q))Q.generateLocalKeyId=!0;var G=Q.localKeyId,O;if(G!==null)G=SX.util.hexToBytes(G);else if(Q.generateLocalKeyId)if(Z){var Y=SX.util.isArray(Z)?Z[0]:Z;if(typeof Y==="string")Y=HX.certificateFromPem(Y);var K=SX.md.sha1.create();K.update(a.toDer(HX.certificateToAsn1(Y)).getBytes()),G=K.digest().getBytes()}else G=SX.random.getBytes(20);var A=[];if(G!==null)A.push(a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(HX.oids.localKeyId).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SET,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,G)])]));if("friendlyName"in Q)A.push(a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(HX.oids.friendlyName).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SET,!0,[a.create(a.Class.UNIVERSAL,a.Type.BMPSTRING,!1,Q.friendlyName)])]));if(A.length>0)O=a.create(a.Class.UNIVERSAL,a.Type.SET,!0,A);var D=[],C=[];if(Z!==null)if(SX.util.isArray(Z))C=Z;else C=[Z];var z=[];for(var R=0;R<C.length;++R){if(Z=C[R],typeof Z==="string")Z=HX.certificateFromPem(Z);var S=R===0?O:void 0,P=HX.certificateToAsn1(Z),N=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(HX.oids.certBag).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(HX.oids.x509Certificate).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(P).getBytes())])])]),S]);z.push(N)}if(z.length>0){var I=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,z),B=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(HX.oids.data).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(I).getBytes())])]);D.push(B)}var k=null;if(X!==null){var w=HX.wrapRsaPrivateKey(HX.privateKeyToAsn1(X));if(U===null)k=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(HX.oids.keyBag).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[w]),O]);else k=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(HX.oids.pkcs8ShroudedKeyBag).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[HX.encryptPrivateKeyInfo(w,U,Q)]),O]);var v=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[k]),_=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(HX.oids.data).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(v).getBytes())])]);D.push(_)}var u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,D),J0;if(Q.useMac){var K=SX.md.sha1.create(),H0=new SX.util.ByteBuffer(SX.random.getBytes(Q.saltSize)),V0=Q.count,X=kU.generateKey(U,H0,3,V0,20),l=SX.hmac.create();l.start(K,X),l.update(a.toDer(u).getBytes());var U0=l.getMac();J0=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(HX.oids.sha1).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,U0.getBytes())]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,H0.getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(V0).getBytes())])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(3).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(HX.oids.data).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(u).getBytes())])]),J0])};kU.generateKey=SX.pbe.generatePkcs12Key});var aY=QX((Uq,TW)=>{var qQ=GX();hZ();WQ();dY();PQ();HJ();sY();MJ();NU();DX();TJ();var rY=qQ.asn1,ZU=TW.exports=qQ.pki=qQ.pki||{};ZU.pemToDer=function(X){var Z=qQ.pem.decode(X)[0];if(Z.procType&&Z.procType.type==="ENCRYPTED")throw Error("Could not convert PEM to DER; PEM is encrypted.");return qQ.util.createBuffer(Z.body)};ZU.privateKeyFromPem=function(X){var Z=qQ.pem.decode(X)[0];if(Z.type!=="PRIVATE KEY"&&Z.type!=="RSA PRIVATE KEY"){var U=Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw U.headerType=Z.type,U}if(Z.procType&&Z.procType.type==="ENCRYPTED")throw Error("Could not convert private key from PEM; PEM is encrypted.");var Q=rY.fromDer(Z.body);return ZU.privateKeyFromAsn1(Q)};ZU.privateKeyToPem=function(X,Z){var U={type:"RSA PRIVATE KEY",body:rY.toDer(ZU.privateKeyToAsn1(X)).getBytes()};return qQ.pem.encode(U,{maxline:Z})};ZU.privateKeyInfoToPem=function(X,Z){var U={type:"PRIVATE KEY",body:rY.toDer(X).getBytes()};return qQ.pem.encode(U,{maxline:Z})}});var Q$=QX((Jq,BW)=>{var b0=GX();hZ();bQ();mU();PQ();aY();kZ();tQ();DX();var SJ=function(X,Z,U,Q){var G=b0.util.createBuffer(),O=X.length>>1,Y=O+(X.length&1),K=X.substr(0,Y),A=X.substr(O,Y),D=b0.util.createBuffer(),C=b0.hmac.create();U=Z+U;var z=Math.ceil(Q/16),R=Math.ceil(Q/20);C.start("MD5",K);var S=b0.util.createBuffer();D.putBytes(U);for(var P=0;P<z;++P)C.start(null,null),C.update(D.getBytes()),D.putBuffer(C.digest()),C.start(null,null),C.update(D.bytes()+U),S.putBuffer(C.digest());C.start("SHA1",A);var N=b0.util.createBuffer();D.clear(),D.putBytes(U);for(var P=0;P<R;++P)C.start(null,null),C.update(D.getBytes()),D.putBuffer(C.digest()),C.start(null,null),C.update(D.bytes()+U),N.putBuffer(C.digest());return G.putBytes(b0.util.xorBytes(S.getBytes(),N.getBytes(),Q)),G},eE=function(X,Z,U){var Q=b0.hmac.create();Q.start("SHA1",X);var G=b0.util.createBuffer();return G.putInt32(Z[0]),G.putInt32(Z[1]),G.putByte(U.type),G.putByte(U.version.major),G.putByte(U.version.minor),G.putInt16(U.length),G.putBytes(U.fragment.bytes()),Q.update(G.getBytes()),Q.digest().getBytes()},Xz=function(X,Z,U){var Q=!1;try{var G=X.deflate(Z.fragment.getBytes());Z.fragment=b0.util.createBuffer(G),Z.length=G.length,Q=!0}catch(O){}return Q},Zz=function(X,Z,U){var Q=!1;try{var G=X.inflate(Z.fragment.getBytes());Z.fragment=b0.util.createBuffer(G),Z.length=G.length,Q=!0}catch(O){}return Q},IZ=function(X,Z){var U=0;switch(Z){case 1:U=X.getByte();break;case 2:U=X.getInt16();break;case 3:U=X.getInt24();break;case 4:U=X.getInt32();break}return b0.util.createBuffer(X.getBytes(U))},_Z=function(X,Z,U){X.putInt(U.length(),Z<<3),X.putBuffer(U)},p={};p.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};p.SupportedVersions=[p.Versions.TLS_1_1,p.Versions.TLS_1_0];p.Version=p.SupportedVersions[0];p.MaxFragment=15360;p.ConnectionEnd={server:0,client:1};p.PRFAlgorithm={tls_prf_sha256:0};p.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};p.CipherType={stream:0,block:1,aead:2};p.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};p.CompressionMethod={none:0,deflate:1};p.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};p.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};p.Alert={};p.Alert.Level={warning:1,fatal:2};p.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};p.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};p.CipherSuites={};p.getCipherSuite=function(X){var Z=null;for(var U in p.CipherSuites){var Q=p.CipherSuites[U];if(Q.id[0]===X.charCodeAt(0)&&Q.id[1]===X.charCodeAt(1)){Z=Q;break}}return Z};p.handleUnexpected=function(X,Z){var U=!X.open&&X.entity===p.ConnectionEnd.client;if(!U)X.error(X,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.unexpected_message}})};p.handleHelloRequest=function(X,Z,U){if(!X.handshaking&&X.handshakes>0)p.queue(X,p.createAlert(X,{level:p.Alert.Level.warning,description:p.Alert.Description.no_renegotiation})),p.flush(X);X.process()};p.parseHelloMessage=function(X,Z,U){var Q=null,G=X.entity===p.ConnectionEnd.client;if(U<38)X.error(X,{message:G?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.illegal_parameter}});else{var O=Z.fragment,Y=O.length();if(Q={version:{major:O.getByte(),minor:O.getByte()},random:b0.util.createBuffer(O.getBytes(32)),session_id:IZ(O,1),extensions:[]},G)Q.cipher_suite=O.getBytes(2),Q.compression_method=O.getByte();else Q.cipher_suites=IZ(O,2),Q.compression_methods=IZ(O,1);if(Y=U-(Y-O.length()),Y>0){var K=IZ(O,2);while(K.length()>0)Q.extensions.push({type:[K.getByte(),K.getByte()],data:IZ(K,2)});if(!G)for(var A=0;A<Q.extensions.length;++A){var D=Q.extensions[A];if(D.type[0]===0&&D.type[1]===0){var C=IZ(D.data,2);while(C.length()>0){var z=C.getByte();if(z!==0)break;X.session.extensions.server_name.serverNameList.push(IZ(C,2).getBytes())}}}}if(X.session.version){if(Q.version.major!==X.session.version.major||Q.version.minor!==X.session.version.minor)return X.error(X,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.protocol_version}})}if(G)X.session.cipherSuite=p.getCipherSuite(Q.cipher_suite);else{var R=b0.util.createBuffer(Q.cipher_suites.bytes());while(R.length()>0)if(X.session.cipherSuite=p.getCipherSuite(R.getBytes(2)),X.session.cipherSuite!==null)break}if(X.session.cipherSuite===null)return X.error(X,{message:"No cipher suites in common.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.handshake_failure},cipherSuite:b0.util.bytesToHex(Q.cipher_suite)});if(G)X.session.compressionMethod=Q.compression_method;else X.session.compressionMethod=p.CompressionMethod.none}return Q};p.createSecurityParameters=function(X,Z){var U=X.entity===p.ConnectionEnd.client,Q=Z.random.bytes(),G=U?X.session.sp.client_random:Q,O=U?Q:p.createRandom().getBytes();X.session.sp={entity:X.entity,prf_algorithm:p.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:X.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:G,server_random:O}};p.handleServerHello=function(X,Z,U){var Q=p.parseHelloMessage(X,Z,U);if(X.fail)return;if(Q.version.minor<=X.version.minor)X.version.minor=Q.version.minor;else return X.error(X,{message:"Incompatible TLS version.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.protocol_version}});X.session.version=X.version;var G=Q.session_id.bytes();if(G.length>0&&G===X.session.id)X.expect=SW,X.session.resuming=!0,X.session.sp.server_random=Q.random.bytes();else X.expect=Uz,X.session.resuming=!1,p.createSecurityParameters(X,Q);X.session.id=G,X.process()};p.handleClientHello=function(X,Z,U){var Q=p.parseHelloMessage(X,Z,U);if(X.fail)return;var G=Q.session_id.bytes(),O=null;if(X.sessionCache){if(O=X.sessionCache.getSession(G),O===null)G="";else if(O.version.major!==Q.version.major||O.version.minor>Q.version.minor)O=null,G=""}if(G.length===0)G=b0.random.getBytes(32);if(X.session.id=G,X.session.clientHelloVersion=Q.version,X.session.sp={},O)X.version=X.session.version=O.version,X.session.sp=O.sp;else{var Y;for(var K=1;K<p.SupportedVersions.length;++K)if(Y=p.SupportedVersions[K],Y.minor<=Q.version.minor)break;X.version={major:Y.major,minor:Y.minor},X.session.version=X.version}if(O!==null)X.expect=X$,X.session.resuming=!0,X.session.sp.client_random=Q.random.bytes();else X.expect=X.verifyClient!==!1?Oz:eY,X.session.resuming=!1,p.createSecurityParameters(X,Q);if(X.open=!0,p.queue(X,p.createRecord(X,{type:p.ContentType.handshake,data:p.createServerHello(X)})),X.session.resuming)p.queue(X,p.createRecord(X,{type:p.ContentType.change_cipher_spec,data:p.createChangeCipherSpec()})),X.state.pending=p.createConnectionState(X),X.state.current.write=X.state.pending.write,p.queue(X,p.createRecord(X,{type:p.ContentType.handshake,data:p.createFinished(X)}));else if(p.queue(X,p.createRecord(X,{type:p.ContentType.handshake,data:p.createCertificate(X)})),!X.fail){if(p.queue(X,p.createRecord(X,{type:p.ContentType.handshake,data:p.createServerKeyExchange(X)})),X.verifyClient!==!1)p.queue(X,p.createRecord(X,{type:p.ContentType.handshake,data:p.createCertificateRequest(X)}));p.queue(X,p.createRecord(X,{type:p.ContentType.handshake,data:p.createServerHelloDone(X)}))}p.flush(X),X.process()};p.handleCertificate=function(X,Z,U){if(U<3)return X.error(X,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.illegal_parameter}});var Q=Z.fragment,G={certificate_list:IZ(Q,3)},O,Y,K=[];try{while(G.certificate_list.length()>0)O=IZ(G.certificate_list,3),Y=b0.asn1.fromDer(O),O=b0.pki.certificateFromAsn1(Y,!0),K.push(O)}catch(D){return X.error(X,{message:"Could not parse certificate list.",cause:D,send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.bad_certificate}})}var A=X.entity===p.ConnectionEnd.client;if((A||X.verifyClient===!0)&&K.length===0)X.error(X,{message:A?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.illegal_parameter}});else if(K.length===0)X.expect=A?RW:eY;else{if(A)X.session.serverCertificate=K[0];else X.session.clientCertificate=K[0];if(p.verifyCertificateChain(X,K))X.expect=A?RW:eY}X.process()};p.handleServerKeyExchange=function(X,Z,U){if(U>0)return X.error(X,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.unsupported_certificate}});X.expect=Jz,X.process()};p.handleClientKeyExchange=function(X,Z,U){if(U<48)return X.error(X,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.unsupported_certificate}});var Q=Z.fragment,G={enc_pre_master_secret:IZ(Q,2).getBytes()},O=null;if(X.getPrivateKey)try{O=X.getPrivateKey(X,X.session.serverCertificate),O=b0.pki.privateKeyFromPem(O)}catch(A){X.error(X,{message:"Could not get private key.",cause:A,send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.internal_error}})}if(O===null)return X.error(X,{message:"No private key set.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.internal_error}});try{var Y=X.session.sp;Y.pre_master_secret=O.decrypt(G.enc_pre_master_secret);var K=X.session.clientHelloVersion;if(K.major!==Y.pre_master_secret.charCodeAt(0)||K.minor!==Y.pre_master_secret.charCodeAt(1))throw Error("TLS version rollback attack detected.")}catch(A){Y.pre_master_secret=b0.random.getBytes(48)}if(X.expect=X$,X.session.clientCertificate!==null)X.expect=Hz;X.process()};p.handleCertificateRequest=function(X,Z,U){if(U<3)return X.error(X,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.illegal_parameter}});var Q=Z.fragment,G={certificate_types:IZ(Q,1),certificate_authorities:IZ(Q,2)};X.session.certificateRequest=G,X.expect=Yz,X.process()};p.handleCertificateVerify=function(X,Z,U){if(U<2)return X.error(X,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.illegal_parameter}});var Q=Z.fragment;Q.read-=4;var G=Q.bytes();Q.read+=4;var O={signature:IZ(Q,2).getBytes()},Y=b0.util.createBuffer();Y.putBuffer(X.session.md5.digest()),Y.putBuffer(X.session.sha1.digest()),Y=Y.getBytes();try{var K=X.session.clientCertificate;if(!K.publicKey.verify(Y,O.signature,"NONE"))throw Error("CertificateVerify signature does not match.");X.session.md5.update(G),X.session.sha1.update(G)}catch(A){return X.error(X,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.handshake_failure}})}X.expect=X$,X.process()};p.handleServerHelloDone=function(X,Z,U){if(U>0)return X.error(X,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.record_overflow}});if(X.serverCertificate===null){var Q={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.insufficient_security}},G=0,O=X.verify(X,Q.alert.description,G,[]);if(O!==!0){if(O||O===0){if(typeof O==="object"&&!b0.util.isArray(O)){if(O.message)Q.message=O.message;if(O.alert)Q.alert.description=O.alert}else if(typeof O==="number")Q.alert.description=O}return X.error(X,Q)}}if(X.session.certificateRequest!==null)Z=p.createRecord(X,{type:p.ContentType.handshake,data:p.createCertificate(X)}),p.queue(X,Z);Z=p.createRecord(X,{type:p.ContentType.handshake,data:p.createClientKeyExchange(X)}),p.queue(X,Z),X.expect=Vz;var Y=function(K,A){if(K.session.certificateRequest!==null&&K.session.clientCertificate!==null)p.queue(K,p.createRecord(K,{type:p.ContentType.handshake,data:p.createCertificateVerify(K,A)}));p.queue(K,p.createRecord(K,{type:p.ContentType.change_cipher_spec,data:p.createChangeCipherSpec()})),K.state.pending=p.createConnectionState(K),K.state.current.write=K.state.pending.write,p.queue(K,p.createRecord(K,{type:p.ContentType.handshake,data:p.createFinished(K)})),K.expect=SW,p.flush(K),K.process()};if(X.session.certificateRequest===null||X.session.clientCertificate===null)return Y(X,null);p.getClientSignature(X,Y)};p.handleChangeCipherSpec=function(X,Z){if(Z.fragment.getByte()!==1)return X.error(X,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.illegal_parameter}});var U=X.entity===p.ConnectionEnd.client;if(X.session.resuming&&U||!X.session.resuming&&!U)X.state.pending=p.createConnectionState(X);if(X.state.current.read=X.state.pending.read,!X.session.resuming&&U||X.session.resuming&&!U)X.state.pending=null;X.expect=U?$z:Fz,X.process()};p.handleFinished=function(X,Z,U){var Q=Z.fragment;Q.read-=4;var G=Q.bytes();Q.read+=4;var O=Z.fragment.getBytes();Q=b0.util.createBuffer(),Q.putBuffer(X.session.md5.digest()),Q.putBuffer(X.session.sha1.digest());var Y=X.entity===p.ConnectionEnd.client,K=Y?"server finished":"client finished",A=X.session.sp,D=12,C=SJ;if(Q=C(A.master_secret,K,Q.getBytes(),D),Q.getBytes()!==O)return X.error(X,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.decrypt_error}});if(X.session.md5.update(G),X.session.sha1.update(G),X.session.resuming&&Y||!X.session.resuming&&!Y)p.queue(X,p.createRecord(X,{type:p.ContentType.change_cipher_spec,data:p.createChangeCipherSpec()})),X.state.current.write=X.state.pending.write,X.state.pending=null,p.queue(X,p.createRecord(X,{type:p.ContentType.handshake,data:p.createFinished(X)}));X.expect=Y?Gz:Kz,X.handshaking=!1,++X.handshakes,X.peerCertificate=Y?X.session.serverCertificate:X.session.clientCertificate,p.flush(X),X.isConnected=!0,X.connected(X),X.process()};p.handleAlert=function(X,Z){var U=Z.fragment,Q={level:U.getByte(),description:U.getByte()},G;switch(Q.description){case p.Alert.Description.close_notify:G="Connection closed.";break;case p.Alert.Description.unexpected_message:G="Unexpected message.";break;case p.Alert.Description.bad_record_mac:G="Bad record MAC.";break;case p.Alert.Description.decryption_failed:G="Decryption failed.";break;case p.Alert.Description.record_overflow:G="Record overflow.";break;case p.Alert.Description.decompression_failure:G="Decompression failed.";break;case p.Alert.Description.handshake_failure:G="Handshake failure.";break;case p.Alert.Description.bad_certificate:G="Bad certificate.";break;case p.Alert.Description.unsupported_certificate:G="Unsupported certificate.";break;case p.Alert.Description.certificate_revoked:G="Certificate revoked.";break;case p.Alert.Description.certificate_expired:G="Certificate expired.";break;case p.Alert.Description.certificate_unknown:G="Certificate unknown.";break;case p.Alert.Description.illegal_parameter:G="Illegal parameter.";break;case p.Alert.Description.unknown_ca:G="Unknown certificate authority.";break;case p.Alert.Description.access_denied:G="Access denied.";break;case p.Alert.Description.decode_error:G="Decode error.";break;case p.Alert.Description.decrypt_error:G="Decrypt error.";break;case p.Alert.Description.export_restriction:G="Export restriction.";break;case p.Alert.Description.protocol_version:G="Unsupported protocol version.";break;case p.Alert.Description.insufficient_security:G="Insufficient security.";break;case p.Alert.Description.internal_error:G="Internal error.";break;case p.Alert.Description.user_canceled:G="User canceled.";break;case p.Alert.Description.no_renegotiation:G="Renegotiation not supported.";break;default:G="Unknown error.";break}if(Q.description===p.Alert.Description.close_notify)return X.close();X.error(X,{message:G,send:!1,origin:X.entity===p.ConnectionEnd.client?"server":"client",alert:Q}),X.process()};p.handleHandshake=function(X,Z){var U=Z.fragment,Q=U.getByte(),G=U.getInt24();if(G>U.length())return X.fragmented=Z,Z.fragment=b0.util.createBuffer(),U.read-=4,X.process();X.fragmented=null,U.read-=4;var O=U.bytes(G+4);if(U.read+=4,Q in PJ[X.entity][X.expect]){if(X.entity===p.ConnectionEnd.server&&!X.open&&!X.fail)X.handshaking=!0,X.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:b0.md.md5.create(),sha1:b0.md.sha1.create()};if(Q!==p.HandshakeType.hello_request&&Q!==p.HandshakeType.certificate_verify&&Q!==p.HandshakeType.finished)X.session.md5.update(O),X.session.sha1.update(O);PJ[X.entity][X.expect][Q](X,Z,G)}else p.handleUnexpected(X,Z)};p.handleApplicationData=function(X,Z){X.data.putBuffer(Z.fragment),X.dataReady(X),X.process()};p.handleHeartbeat=function(X,Z){var U=Z.fragment,Q=U.getByte(),G=U.getInt16(),O=U.getBytes(G);if(Q===p.HeartbeatMessageType.heartbeat_request){if(X.handshaking||G>O.length)return X.process();p.queue(X,p.createRecord(X,{type:p.ContentType.heartbeat,data:p.createHeartbeat(p.HeartbeatMessageType.heartbeat_response,O)})),p.flush(X)}else if(Q===p.HeartbeatMessageType.heartbeat_response){if(O!==X.expectedHeartbeatPayload)return X.process();if(X.heartbeatReceived)X.heartbeatReceived(X,b0.util.createBuffer(O))}X.process()};var Qz=0,Uz=1,RW=2,Jz=3,Yz=4,SW=5,$z=6,Gz=7,Vz=8,Wz=0,Oz=1,eY=2,Hz=3,X$=4,Fz=5,Kz=6,h=p.handleUnexpected,LW=p.handleChangeCipherSpec,VZ=p.handleAlert,CZ=p.handleHandshake,IW=p.handleApplicationData,WZ=p.handleHeartbeat,Z$=[];Z$[p.ConnectionEnd.client]=[[h,VZ,CZ,h,WZ],[h,VZ,CZ,h,WZ],[h,VZ,CZ,h,WZ],[h,VZ,CZ,h,WZ],[h,VZ,CZ,h,WZ],[LW,VZ,h,h,WZ],[h,VZ,CZ,h,WZ],[h,VZ,CZ,IW,WZ],[h,VZ,CZ,h,WZ]];Z$[p.ConnectionEnd.server]=[[h,VZ,CZ,h,WZ],[h,VZ,CZ,h,WZ],[h,VZ,CZ,h,WZ],[h,VZ,CZ,h,WZ],[LW,VZ,h,h,WZ],[h,VZ,CZ,h,WZ],[h,VZ,CZ,IW,WZ],[h,VZ,CZ,h,WZ]];var{handleHelloRequest:MQ,handleServerHello:Ez,handleCertificate:jW,handleServerKeyExchange:PW,handleCertificateRequest:tY,handleServerHelloDone:RJ,handleFinished:NW}=p,PJ=[];PJ[p.ConnectionEnd.client]=[[h,h,Ez,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[MQ,h,h,h,h,h,h,h,h,h,h,jW,PW,tY,RJ,h,h,h,h,h,h],[MQ,h,h,h,h,h,h,h,h,h,h,h,PW,tY,RJ,h,h,h,h,h,h],[MQ,h,h,h,h,h,h,h,h,h,h,h,h,tY,RJ,h,h,h,h,h,h],[MQ,h,h,h,h,h,h,h,h,h,h,h,h,h,RJ,h,h,h,h,h,h],[MQ,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[MQ,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,NW],[MQ,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[MQ,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h]];var{handleClientHello:zz,handleClientKeyExchange:Dz,handleCertificateVerify:qz}=p;PJ[p.ConnectionEnd.server]=[[h,zz,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,jW,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,Dz,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,qz,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,NW],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h]];p.generateKeys=function(X,Z){var U=SJ,Q=Z.client_random+Z.server_random;if(!X.session.resuming)Z.master_secret=U(Z.pre_master_secret,"master secret",Q,48).bytes(),Z.pre_master_secret=null;Q=Z.server_random+Z.client_random;var G=2*Z.mac_key_length+2*Z.enc_key_length,O=X.version.major===p.Versions.TLS_1_0.major&&X.version.minor===p.Versions.TLS_1_0.minor;if(O)G+=2*Z.fixed_iv_length;var Y=U(Z.master_secret,"key expansion",Q,G),K={client_write_MAC_key:Y.getBytes(Z.mac_key_length),server_write_MAC_key:Y.getBytes(Z.mac_key_length),client_write_key:Y.getBytes(Z.enc_key_length),server_write_key:Y.getBytes(Z.enc_key_length)};if(O)K.client_write_IV=Y.getBytes(Z.fixed_iv_length),K.server_write_IV=Y.getBytes(Z.fixed_iv_length);return K};p.createConnectionState=function(X){var Z=X.entity===p.ConnectionEnd.client,U=function(){var O={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(Y){return!0},compressionState:null,compressFunction:function(Y){return!0},updateSequenceNumber:function(){if(O.sequenceNumber[1]===4294967295)O.sequenceNumber[1]=0,++O.sequenceNumber[0];else++O.sequenceNumber[1]}};return O},Q={read:U(),write:U()};if(Q.read.update=function(O,Y){if(!Q.read.cipherFunction(Y,Q.read))O.error(O,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.bad_record_mac}});else if(!Q.read.compressFunction(O,Y,Q.read))O.error(O,{message:"Could not decompress record.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.decompression_failure}});return!O.fail},Q.write.update=function(O,Y){if(!Q.write.compressFunction(O,Y,Q.write))O.error(O,{message:"Could not compress record.",send:!1,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.internal_error}});else if(!Q.write.cipherFunction(Y,Q.write))O.error(O,{message:"Could not encrypt record.",send:!1,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.internal_error}});return!O.fail},X.session){var G=X.session.sp;switch(X.session.cipherSuite.initSecurityParameters(G),G.keys=p.generateKeys(X,G),Q.read.macKey=Z?G.keys.server_write_MAC_key:G.keys.client_write_MAC_key,Q.write.macKey=Z?G.keys.client_write_MAC_key:G.keys.server_write_MAC_key,X.session.cipherSuite.initConnectionState(Q,X,G),G.compression_algorithm){case p.CompressionMethod.none:break;case p.CompressionMethod.deflate:Q.read.compressFunction=Zz,Q.write.compressFunction=Xz;break;default:throw Error("Unsupported compression algorithm.")}}return Q};p.createRandom=function(){var X=new Date,Z=+X+X.getTimezoneOffset()*60000,U=b0.util.createBuffer();return U.putInt32(Z),U.putBytes(b0.random.getBytes(28)),U};p.createRecord=function(X,Z){if(!Z.data)return null;var U={type:Z.type,version:{major:X.version.major,minor:X.version.minor},length:Z.data.length(),fragment:Z.data};return U};p.createAlert=function(X,Z){var U=b0.util.createBuffer();return U.putByte(Z.level),U.putByte(Z.description),p.createRecord(X,{type:p.ContentType.alert,data:U})};p.createClientHello=function(X){X.session.clientHelloVersion={major:X.version.major,minor:X.version.minor};var Z=b0.util.createBuffer();for(var U=0;U<X.cipherSuites.length;++U){var Q=X.cipherSuites[U];Z.putByte(Q.id[0]),Z.putByte(Q.id[1])}var G=Z.length(),O=b0.util.createBuffer();O.putByte(p.CompressionMethod.none);var Y=O.length(),K=b0.util.createBuffer();if(X.virtualHost){var A=b0.util.createBuffer();A.putByte(0),A.putByte(0);var D=b0.util.createBuffer();D.putByte(0),_Z(D,2,b0.util.createBuffer(X.virtualHost));var C=b0.util.createBuffer();_Z(C,2,D),_Z(A,2,C),K.putBuffer(A)}var z=K.length();if(z>0)z+=2;var R=X.session.id,S=R.length+1+2+4+28+2+G+1+Y+z,P=b0.util.createBuffer();if(P.putByte(p.HandshakeType.client_hello),P.putInt24(S),P.putByte(X.version.major),P.putByte(X.version.minor),P.putBytes(X.session.sp.client_random),_Z(P,1,b0.util.createBuffer(R)),_Z(P,2,Z),_Z(P,1,O),z>0)_Z(P,2,K);return P};p.createServerHello=function(X){var Z=X.session.id,U=Z.length+1+2+4+28+2+1,Q=b0.util.createBuffer();return Q.putByte(p.HandshakeType.server_hello),Q.putInt24(U),Q.putByte(X.version.major),Q.putByte(X.version.minor),Q.putBytes(X.session.sp.server_random),_Z(Q,1,b0.util.createBuffer(Z)),Q.putByte(X.session.cipherSuite.id[0]),Q.putByte(X.session.cipherSuite.id[1]),Q.putByte(X.session.compressionMethod),Q};p.createCertificate=function(X){var Z=X.entity===p.ConnectionEnd.client,U=null;if(X.getCertificate){var Q;if(Z)Q=X.session.certificateRequest;else Q=X.session.extensions.server_name.serverNameList;U=X.getCertificate(X,Q)}var G=b0.util.createBuffer();if(U!==null)try{if(!b0.util.isArray(U))U=[U];var O=null;for(var Y=0;Y<U.length;++Y){var K=b0.pem.decode(U[Y])[0];if(K.type!=="CERTIFICATE"&&K.type!=="X509 CERTIFICATE"&&K.type!=="TRUSTED CERTIFICATE"){var A=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw A.headerType=K.type,A}if(K.procType&&K.procType.type==="ENCRYPTED")throw Error("Could not convert certificate from PEM; PEM is encrypted.");var D=b0.util.createBuffer(K.body);if(O===null)O=b0.asn1.fromDer(D.bytes(),!1);var C=b0.util.createBuffer();_Z(C,3,D),G.putBuffer(C)}if(U=b0.pki.certificateFromAsn1(O),Z)X.session.clientCertificate=U;else X.session.serverCertificate=U}catch(S){return X.error(X,{message:"Could not send certificate list.",cause:S,send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.bad_certificate}})}var z=3+G.length(),R=b0.util.createBuffer();return R.putByte(p.HandshakeType.certificate),R.putInt24(z),_Z(R,3,G),R};p.createClientKeyExchange=function(X){var Z=b0.util.createBuffer();Z.putByte(X.session.clientHelloVersion.major),Z.putByte(X.session.clientHelloVersion.minor),Z.putBytes(b0.random.getBytes(46));var U=X.session.sp;U.pre_master_secret=Z.getBytes();var Q=X.session.serverCertificate.publicKey;Z=Q.encrypt(U.pre_master_secret);var G=Z.length+2,O=b0.util.createBuffer();return O.putByte(p.HandshakeType.client_key_exchange),O.putInt24(G),O.putInt16(Z.length),O.putBytes(Z),O};p.createServerKeyExchange=function(X){var Z=0,U=b0.util.createBuffer();if(Z>0)U.putByte(p.HandshakeType.server_key_exchange),U.putInt24(Z);return U};p.getClientSignature=function(X,Z){var U=b0.util.createBuffer();U.putBuffer(X.session.md5.digest()),U.putBuffer(X.session.sha1.digest()),U=U.getBytes(),X.getSignature=X.getSignature||function(Q,G,O){var Y=null;if(Q.getPrivateKey)try{Y=Q.getPrivateKey(Q,Q.session.clientCertificate),Y=b0.pki.privateKeyFromPem(Y)}catch(K){Q.error(Q,{message:"Could not get private key.",cause:K,send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.internal_error}})}if(Y===null)Q.error(Q,{message:"No private key set.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.internal_error}});else G=Y.sign(G,null);O(Q,G)},X.getSignature(X,U,Z)};p.createCertificateVerify=function(X,Z){var U=Z.length+2,Q=b0.util.createBuffer();return Q.putByte(p.HandshakeType.certificate_verify),Q.putInt24(U),Q.putInt16(Z.length),Q.putBytes(Z),Q};p.createCertificateRequest=function(X){var Z=b0.util.createBuffer();Z.putByte(1);var U=b0.util.createBuffer();for(var Q in X.caStore.certs){var G=X.caStore.certs[Q],O=b0.pki.distinguishedNameToAsn1(G.subject),Y=b0.asn1.toDer(O);U.putInt16(Y.length()),U.putBuffer(Y)}var K=1+Z.length()+2+U.length(),A=b0.util.createBuffer();return A.putByte(p.HandshakeType.certificate_request),A.putInt24(K),_Z(A,1,Z),_Z(A,2,U),A};p.createServerHelloDone=function(X){var Z=b0.util.createBuffer();return Z.putByte(p.HandshakeType.server_hello_done),Z.putInt24(0),Z};p.createChangeCipherSpec=function(){var X=b0.util.createBuffer();return X.putByte(1),X};p.createFinished=function(X){var Z=b0.util.createBuffer();Z.putBuffer(X.session.md5.digest()),Z.putBuffer(X.session.sha1.digest());var U=X.entity===p.ConnectionEnd.client,Q=X.session.sp,G=12,O=SJ,Y=U?"client finished":"server finished";Z=O(Q.master_secret,Y,Z.getBytes(),G);var K=b0.util.createBuffer();return K.putByte(p.HandshakeType.finished),K.putInt24(Z.length()),K.putBuffer(Z),K};p.createHeartbeat=function(X,Z,U){if(typeof U>"u")U=Z.length;var Q=b0.util.createBuffer();Q.putByte(X),Q.putInt16(U),Q.putBytes(Z);var G=Q.length(),O=Math.max(16,G-U-3);return Q.putBytes(b0.random.getBytes(O)),Q};p.queue=function(X,Z){if(!Z)return;if(Z.fragment.length()===0){if(Z.type===p.ContentType.handshake||Z.type===p.ContentType.alert||Z.type===p.ContentType.change_cipher_spec)return}if(Z.type===p.ContentType.handshake){var U=Z.fragment.bytes();X.session.md5.update(U),X.session.sha1.update(U),U=null}var Q;if(Z.fragment.length()<=p.MaxFragment)Q=[Z];else{Q=[];var G=Z.fragment.bytes();while(G.length>p.MaxFragment)Q.push(p.createRecord(X,{type:Z.type,data:b0.util.createBuffer(G.slice(0,p.MaxFragment))})),G=G.slice(p.MaxFragment);if(G.length>0)Q.push(p.createRecord(X,{type:Z.type,data:b0.util.createBuffer(G)}))}for(var O=0;O<Q.length&&!X.fail;++O){var Y=Q[O],K=X.state.current.write;if(K.update(X,Y))X.records.push(Y)}};p.flush=function(X){for(var Z=0;Z<X.records.length;++Z){var U=X.records[Z];X.tlsData.putByte(U.type),X.tlsData.putByte(U.version.major),X.tlsData.putByte(U.version.minor),X.tlsData.putInt16(U.fragment.length()),X.tlsData.putBuffer(X.records[Z].fragment)}return X.records=[],X.tlsDataReady(X)};var iY=function(X){switch(X){case!0:return!0;case b0.pki.certificateError.bad_certificate:return p.Alert.Description.bad_certificate;case b0.pki.certificateError.unsupported_certificate:return p.Alert.Description.unsupported_certificate;case b0.pki.certificateError.certificate_revoked:return p.Alert.Description.certificate_revoked;case b0.pki.certificateError.certificate_expired:return p.Alert.Description.certificate_expired;case b0.pki.certificateError.certificate_unknown:return p.Alert.Description.certificate_unknown;case b0.pki.certificateError.unknown_ca:return p.Alert.Description.unknown_ca;default:return p.Alert.Description.bad_certificate}},Mz=function(X){switch(X){case!0:return!0;case p.Alert.Description.bad_certificate:return b0.pki.certificateError.bad_certificate;case p.Alert.Description.unsupported_certificate:return b0.pki.certificateError.unsupported_certificate;case p.Alert.Description.certificate_revoked:return b0.pki.certificateError.certificate_revoked;case p.Alert.Description.certificate_expired:return b0.pki.certificateError.certificate_expired;case p.Alert.Description.certificate_unknown:return b0.pki.certificateError.certificate_unknown;case p.Alert.Description.unknown_ca:return b0.pki.certificateError.unknown_ca;default:return b0.pki.certificateError.bad_certificate}};p.verifyCertificateChain=function(X,Z){try{var U={};for(var Q in X.verifyOptions)U[Q]=X.verifyOptions[Q];U.verify=function(O,Y,K){var A=iY(O),D=X.verify(X,O,Y,K);if(D!==!0){if(typeof D==="object"&&!b0.util.isArray(D)){var C=Error("The application rejected the certificate.");if(C.send=!0,C.alert={level:p.Alert.Level.fatal,description:p.Alert.Description.bad_certificate},D.message)C.message=D.message;if(D.alert)C.alert.description=D.alert;throw C}if(D!==O)D=Mz(D)}return D},b0.pki.verifyCertificateChain(X.caStore,Z,U)}catch(O){var G=O;if(typeof G!=="object"||b0.util.isArray(G))G={send:!0,alert:{level:p.Alert.Level.fatal,description:iY(O)}};if(!("send"in G))G.send=!0;if(!("alert"in G))G.alert={level:p.Alert.Level.fatal,description:iY(G.error)};X.error(X,G)}return!X.fail};p.createSessionCache=function(X,Z){var U=null;if(X&&X.getSession&&X.setSession&&X.order)U=X;else{U={},U.cache=X||{},U.capacity=Math.max(Z||100,1),U.order=[];for(var Q in X)if(U.order.length<=Z)U.order.push(Q);else delete X[Q];U.getSession=function(G){var O=null,Y=null;if(G)Y=b0.util.bytesToHex(G);else if(U.order.length>0)Y=U.order[0];if(Y!==null&&Y in U.cache){O=U.cache[Y],delete U.cache[Y];for(var K in U.order)if(U.order[K]===Y){U.order.splice(K,1);break}}return O},U.setSession=function(G,O){if(U.order.length===U.capacity){var Y=U.order.shift();delete U.cache[Y]}var Y=b0.util.bytesToHex(G);U.order.push(Y),U.cache[Y]=O}}return U};p.createConnection=function(X){var Z=null;if(X.caStore)if(b0.util.isArray(X.caStore))Z=b0.pki.createCaStore(X.caStore);else Z=X.caStore;else Z=b0.pki.createCaStore();var U=X.cipherSuites||null;if(U===null){U=[];for(var Q in p.CipherSuites)U.push(p.CipherSuites[Q])}var G=X.server?p.ConnectionEnd.server:p.ConnectionEnd.client,O=X.sessionCache?p.createSessionCache(X.sessionCache):null,Y={version:{major:p.Version.major,minor:p.Version.minor},entity:G,sessionId:X.sessionId,caStore:Z,sessionCache:O,cipherSuites:U,connected:X.connected,virtualHost:X.virtualHost||null,verifyClient:X.verifyClient||!1,verify:X.verify||function(C,z,R,S){return z},verifyOptions:X.verifyOptions||{},getCertificate:X.getCertificate||null,getPrivateKey:X.getPrivateKey||null,getSignature:X.getSignature||null,input:b0.util.createBuffer(),tlsData:b0.util.createBuffer(),data:b0.util.createBuffer(),tlsDataReady:X.tlsDataReady,dataReady:X.dataReady,heartbeatReceived:X.heartbeatReceived,closed:X.closed,error:function(C,z){if(z.origin=z.origin||(C.entity===p.ConnectionEnd.client?"client":"server"),z.send)p.queue(C,p.createAlert(C,z.alert)),p.flush(C);var R=z.fatal!==!1;if(R)C.fail=!0;if(X.error(C,z),R)C.close(!1)},deflate:X.deflate||null,inflate:X.inflate||null};Y.reset=function(C){Y.version={major:p.Version.major,minor:p.Version.minor},Y.record=null,Y.session=null,Y.peerCertificate=null,Y.state={pending:null,current:null},Y.expect=Y.entity===p.ConnectionEnd.client?Qz:Wz,Y.fragmented=null,Y.records=[],Y.open=!1,Y.handshakes=0,Y.handshaking=!1,Y.isConnected=!1,Y.fail=!(C||typeof C>"u"),Y.input.clear(),Y.tlsData.clear(),Y.data.clear(),Y.state.current=p.createConnectionState(Y)},Y.reset();var K=function(C,z){var R=z.type-p.ContentType.change_cipher_spec,S=Z$[C.entity][C.expect];if(R in S)S[R](C,z);else p.handleUnexpected(C,z)},A=function(C){var z=0,R=C.input,S=R.length();if(S<5)z=5-S;else{C.record={type:R.getByte(),version:{major:R.getByte(),minor:R.getByte()},length:R.getInt16(),fragment:b0.util.createBuffer(),ready:!1};var P=C.record.version.major===C.version.major;if(P&&C.session&&C.session.version)P=C.record.version.minor===C.version.minor;if(!P)C.error(C,{message:"Incompatible TLS version.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.protocol_version}})}return z},D=function(C){var z=0,R=C.input,S=R.length();if(S<C.record.length)z=C.record.length-S;else{C.record.fragment.putBytes(R.getBytes(C.record.length)),R.compact();var P=C.state.current.read;if(P.update(C,C.record)){if(C.fragmented!==null)if(C.fragmented.type===C.record.type)C.fragmented.fragment.putBuffer(C.record.fragment),C.record=C.fragmented;else C.error(C,{message:"Invalid fragmented record.",send:!0,alert:{level:p.Alert.Level.fatal,description:p.Alert.Description.unexpected_message}});C.record.ready=!0}}return z};return Y.handshake=function(C){if(Y.entity!==p.ConnectionEnd.client)Y.error(Y,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(Y.handshaking)Y.error(Y,{message:"Handshake already in progress.",fatal:!1});else{if(Y.fail&&!Y.open&&Y.handshakes===0)Y.fail=!1;Y.handshaking=!0,C=C||"";var z=null;if(C.length>0){if(Y.sessionCache)z=Y.sessionCache.getSession(C);if(z===null)C=""}if(C.length===0&&Y.sessionCache){if(z=Y.sessionCache.getSession(),z!==null)C=z.id}if(Y.session={id:C,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:b0.md.md5.create(),sha1:b0.md.sha1.create()},z)Y.version=z.version,Y.session.sp=z.sp;Y.session.sp.client_random=p.createRandom().getBytes(),Y.open=!0,p.queue(Y,p.createRecord(Y,{type:p.ContentType.handshake,data:p.createClientHello(Y)})),p.flush(Y)}},Y.process=function(C){var z=0;if(C)Y.input.putBytes(C);if(!Y.fail){if(Y.record!==null&&Y.record.ready&&Y.record.fragment.isEmpty())Y.record=null;if(Y.record===null)z=A(Y);if(!Y.fail&&Y.record!==null&&!Y.record.ready)z=D(Y);if(!Y.fail&&Y.record!==null&&Y.record.ready)K(Y,Y.record)}return z},Y.prepare=function(C){return p.queue(Y,p.createRecord(Y,{type:p.ContentType.application_data,data:b0.util.createBuffer(C)})),p.flush(Y)},Y.prepareHeartbeatRequest=function(C,z){if(C instanceof b0.util.ByteBuffer)C=C.bytes();if(typeof z>"u")z=C.length;return Y.expectedHeartbeatPayload=C,p.queue(Y,p.createRecord(Y,{type:p.ContentType.heartbeat,data:p.createHeartbeat(p.HeartbeatMessageType.heartbeat_request,C,z)})),p.flush(Y)},Y.close=function(C){if(!Y.fail&&Y.sessionCache&&Y.session){var z={id:Y.session.id,version:Y.session.version,sp:Y.session.sp};z.sp.keys=null,Y.sessionCache.setSession(z.id,z)}if(Y.open){if(Y.open=!1,Y.input.clear(),Y.isConnected||Y.handshaking)Y.isConnected=Y.handshaking=!1,p.queue(Y,p.createAlert(Y,{level:p.Alert.Level.warning,description:p.Alert.Description.close_notify})),p.flush(Y);Y.closed(Y)}Y.reset(C)},Y};BW.exports=b0.tls=b0.tls||{};for(xU in p)if(typeof p[xU]!=="function")b0.tls[xU]=p[xU];var xU;b0.tls.prf_tls1=SJ;b0.tls.hmac_sha1=eE;b0.tls.createSessionCache=p.createSessionCache;b0.tls.createConnection=p.createConnection});var wW=QX((Yq,xW)=>{var CQ=GX();VQ();Q$();var yZ=xW.exports=CQ.tls;yZ.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(X){X.bulk_cipher_algorithm=yZ.BulkCipherAlgorithm.aes,X.cipher_type=yZ.CipherType.block,X.enc_key_length=16,X.block_length=16,X.fixed_iv_length=16,X.record_iv_length=16,X.mac_algorithm=yZ.MACAlgorithm.hmac_sha1,X.mac_length=20,X.mac_key_length=20},initConnectionState:kW};yZ.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(X){X.bulk_cipher_algorithm=yZ.BulkCipherAlgorithm.aes,X.cipher_type=yZ.CipherType.block,X.enc_key_length=32,X.block_length=16,X.fixed_iv_length=16,X.record_iv_length=16,X.mac_algorithm=yZ.MACAlgorithm.hmac_sha1,X.mac_length=20,X.mac_key_length=20},initConnectionState:kW};function kW(X,Z,U){var Q=Z.entity===CQ.tls.ConnectionEnd.client;X.read.cipherState={init:!1,cipher:CQ.cipher.createDecipher("AES-CBC",Q?U.keys.server_write_key:U.keys.client_write_key),iv:Q?U.keys.server_write_IV:U.keys.client_write_IV},X.write.cipherState={init:!1,cipher:CQ.cipher.createCipher("AES-CBC",Q?U.keys.client_write_key:U.keys.server_write_key),iv:Q?U.keys.client_write_IV:U.keys.server_write_IV},X.read.cipherFunction=Rz,X.write.cipherFunction=Cz,X.read.macLength=X.write.macLength=U.mac_length,X.read.macFunction=X.write.macFunction=yZ.hmac_sha1}function Cz(X,Z){var U=!1,Q=Z.macFunction(Z.macKey,Z.sequenceNumber,X);X.fragment.putBytes(Q),Z.updateSequenceNumber();var G;if(X.version.minor===yZ.Versions.TLS_1_0.minor)G=Z.cipherState.init?null:Z.cipherState.iv;else G=CQ.random.getBytesSync(16);Z.cipherState.init=!0;var O=Z.cipherState.cipher;if(O.start({iv:G}),X.version.minor>=yZ.Versions.TLS_1_1.minor)O.output.putBytes(G);if(O.update(X.fragment),O.finish(Az))X.fragment=O.output,X.length=X.fragment.length(),U=!0;return U}function Az(X,Z,U){if(!U){var Q=X-Z.length()%X;Z.fillWithByte(Q-1,Q)}return!0}function Tz(X,Z,U){var Q=!0;if(U){var G=Z.length(),O=Z.last();for(var Y=G-1-O;Y<G-1;++Y)Q=Q&&Z.at(Y)==O;if(Q)Z.truncate(O+1)}return Q}function Rz(X,Z){var U=!1,Q;if(X.version.minor===yZ.Versions.TLS_1_0.minor)Q=Z.cipherState.init?null:Z.cipherState.iv;else Q=X.fragment.getBytes(16);Z.cipherState.init=!0;var G=Z.cipherState.cipher;G.start({iv:Q}),G.update(X.fragment),U=G.finish(Tz);var O=Z.macLength,Y=CQ.random.getBytesSync(O),K=G.output.length();if(K>=O)X.fragment=G.output.getBytes(K-O),Y=G.output.getBytes(O);else X.fragment=G.output.getBytes();X.fragment=CQ.util.createBuffer(X.fragment),X.length=X.fragment.length();var A=Z.macFunction(Z.macKey,Z.sequenceNumber,X);return Z.updateSequenceNumber(),U=Pz(Z.macKey,Y,A)&&U,U}function Pz(X,Z,U){var Q=CQ.hmac.create();return Q.start("SHA1",X),Q.update(Z),Z=Q.digest().getBytes(),Q.start(null,null),Q.update(U),U=Q.digest().getBytes(),Z===U}});var Y$=QX(($q,fW)=>{var jX=GX();cZ();DX();var wU=fW.exports=jX.sha512=jX.sha512||{};jX.md.sha512=jX.md.algorithms.sha512=wU;var _W=jX.sha384=jX.sha512.sha384=jX.sha512.sha384||{};_W.create=function(){return wU.create("SHA-384")};jX.md.sha384=jX.md.algorithms.sha384=_W;jX.sha512.sha256=jX.sha512.sha256||{create:function(){return wU.create("SHA-512/256")}};jX.md["sha512/256"]=jX.md.algorithms["sha512/256"]=jX.sha512.sha256;jX.sha512.sha224=jX.sha512.sha224||{create:function(){return wU.create("SHA-512/224")}};jX.md["sha512/224"]=jX.md.algorithms["sha512/224"]=jX.sha512.sha224;wU.create=function(X){if(!yW)Sz();if(typeof X>"u")X="SHA-512";if(!(X in yQ))throw Error("Invalid SHA-512 algorithm: "+X);var Z=yQ[X],U=null,Q=jX.util.createBuffer(),G=Array(80);for(var O=0;O<80;++O)G[O]=[,,];var Y=64;switch(X){case"SHA-384":Y=48;break;case"SHA-512/256":Y=32;break;case"SHA-512/224":Y=28;break}var K={algorithm:X.replace("-","").toLowerCase(),blockLength:128,digestLength:Y,messageLength:0,fullMessageLength:null,messageLengthSize:16};return K.start=function(){K.messageLength=0,K.fullMessageLength=K.messageLength128=[];var A=K.messageLengthSize/4;for(var D=0;D<A;++D)K.fullMessageLength.push(0);Q=jX.util.createBuffer(),U=Array(Z.length);for(var D=0;D<Z.length;++D)U[D]=Z[D].slice(0);return K},K.start(),K.update=function(A,D){if(D==="utf8")A=jX.util.encodeUtf8(A);var C=A.length;K.messageLength+=C,C=[C/4294967296>>>0,C>>>0];for(var z=K.fullMessageLength.length-1;z>=0;--z)K.fullMessageLength[z]+=C[1],C[1]=C[0]+(K.fullMessageLength[z]/4294967296>>>0),K.fullMessageLength[z]=K.fullMessageLength[z]>>>0,C[0]=C[1]/4294967296>>>0;if(Q.putBytes(A),vW(U,G,Q),Q.read>2048||Q.length()===0)Q.compact();return K},K.digest=function(){var A=jX.util.createBuffer();A.putBytes(Q.bytes());var D=K.fullMessageLength[K.fullMessageLength.length-1]+K.messageLengthSize,C=D&K.blockLength-1;A.putBytes(U$.substr(0,K.blockLength-C));var z,R,S=K.fullMessageLength[0]*8;for(var P=0;P<K.fullMessageLength.length-1;++P)z=K.fullMessageLength[P+1]*8,R=z/4294967296>>>0,S+=R,A.putInt32(S>>>0),S=z>>>0;A.putInt32(S);var N=Array(U.length);for(var P=0;P<U.length;++P)N[P]=U[P].slice(0);vW(N,G,A);var I=jX.util.createBuffer(),B;if(X==="SHA-512")B=N.length;else if(X==="SHA-384")B=N.length-2;else B=N.length-4;for(var P=0;P<B;++P)if(I.putInt32(N[P][0]),P!==B-1||X!=="SHA-512/224")I.putInt32(N[P][1]);return I},K};var U$=null,yW=!1,J$=null,yQ=null;function Sz(){U$=String.fromCharCode(128),U$+=jX.util.fillString(String.fromCharCode(0),128),J$=[[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]],yQ={},yQ["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],yQ["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],yQ["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],yQ["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],yW=!0}function vW(X,Z,U){var Q,G,O,Y,K,A,D,C,z,R,S,P,N,I,B,k,w,v,_,u,J0,H0,V0,l,U0,J,W,F,V,H,M,T,E,$,q,j=U.length();while(j>=128){for(V=0;V<16;++V)Z[V][0]=U.getInt32()>>>0,Z[V][1]=U.getInt32()>>>0;for(;V<80;++V)T=Z[V-2],H=T[0],M=T[1],Q=((H>>>19|M<<13)^(M>>>29|H<<3)^H>>>6)>>>0,G=((H<<13|M>>>19)^(M<<3|H>>>29)^(H<<26|M>>>6))>>>0,$=Z[V-15],H=$[0],M=$[1],O=((H>>>1|M<<31)^(H>>>8|M<<24)^H>>>7)>>>0,Y=((H<<31|M>>>1)^(H<<24|M>>>8)^(H<<25|M>>>7))>>>0,E=Z[V-7],q=Z[V-16],M=G+E[1]+Y+q[1],Z[V][0]=Q+E[0]+O+q[0]+(M/4294967296>>>0)>>>0,Z[V][1]=M>>>0;N=X[0][0],I=X[0][1],B=X[1][0],k=X[1][1],w=X[2][0],v=X[2][1],_=X[3][0],u=X[3][1],J0=X[4][0],H0=X[4][1],V0=X[5][0],l=X[5][1],U0=X[6][0],J=X[6][1],W=X[7][0],F=X[7][1];for(V=0;V<80;++V)D=((J0>>>14|H0<<18)^(J0>>>18|H0<<14)^(H0>>>9|J0<<23))>>>0,C=((J0<<18|H0>>>14)^(J0<<14|H0>>>18)^(H0<<23|J0>>>9))>>>0,z=(U0^J0&(V0^U0))>>>0,R=(J^H0&(l^J))>>>0,K=((N>>>28|I<<4)^(I>>>2|N<<30)^(I>>>7|N<<25))>>>0,A=((N<<4|I>>>28)^(I<<30|N>>>2)^(I<<25|N>>>7))>>>0,S=(N&B|w&(N^B))>>>0,P=(I&k|v&(I^k))>>>0,M=F+C+R+J$[V][1]+Z[V][1],Q=W+D+z+J$[V][0]+Z[V][0]+(M/4294967296>>>0)>>>0,G=M>>>0,M=A+P,O=K+S+(M/4294967296>>>0)>>>0,Y=M>>>0,W=U0,F=J,U0=V0,J=l,V0=J0,l=H0,M=u+G,J0=_+Q+(M/4294967296>>>0)>>>0,H0=M>>>0,_=w,u=v,w=B,v=k,B=N,k=I,M=G+Y,N=Q+O+(M/4294967296>>>0)>>>0,I=M>>>0;M=X[0][1]+I,X[0][0]=X[0][0]+N+(M/4294967296>>>0)>>>0,X[0][1]=M>>>0,M=X[1][1]+k,X[1][0]=X[1][0]+B+(M/4294967296>>>0)>>>0,X[1][1]=M>>>0,M=X[2][1]+v,X[2][0]=X[2][0]+w+(M/4294967296>>>0)>>>0,X[2][1]=M>>>0,M=X[3][1]+u,X[3][0]=X[3][0]+_+(M/4294967296>>>0)>>>0,X[3][1]=M>>>0,M=X[4][1]+H0,X[4][0]=X[4][0]+J0+(M/4294967296>>>0)>>>0,X[4][1]=M>>>0,M=X[5][1]+l,X[5][0]=X[5][0]+V0+(M/4294967296>>>0)>>>0,X[5][1]=M>>>0,M=X[6][1]+J,X[6][0]=X[6][0]+U0+(M/4294967296>>>0)>>>0,X[6][1]=M>>>0,M=X[7][1]+F,X[7][0]=X[7][0]+W+(M/4294967296>>>0)>>>0,X[7][1]=M>>>0,j-=128}}});var gW=QX((Iz)=>{var Lz=GX();hZ();var YZ=Lz.asn1;Iz.privateKeyValidator={name:"PrivateKeyInfo",tagClass:YZ.Class.UNIVERSAL,type:YZ.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:YZ.Class.UNIVERSAL,type:YZ.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:YZ.Class.UNIVERSAL,type:YZ.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:YZ.Class.UNIVERSAL,type:YZ.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:YZ.Class.UNIVERSAL,type:YZ.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Iz.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:YZ.Class.UNIVERSAL,type:YZ.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:YZ.Class.UNIVERSAL,type:YZ.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:YZ.Class.UNIVERSAL,type:YZ.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:YZ.Class.UNIVERSAL,type:YZ.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var rW=QX((Vq,sW)=>{var OZ=GX();jU();kZ();Y$();DX();var bW=gW(),Bz=bW.publicKeyValidator,kz=bW.privateKeyValidator;if(typeof V$>"u")V$=OZ.jsbn.BigInteger;var V$,W$=OZ.util.ByteBuffer,SZ=typeof Buffer>"u"?Uint8Array:Buffer;OZ.pki=OZ.pki||{};sW.exports=OZ.pki.ed25519=OZ.ed25519=OZ.ed25519||{};var FX=OZ.ed25519;FX.constants={};FX.constants.PUBLIC_KEY_BYTE_LENGTH=32;FX.constants.PRIVATE_KEY_BYTE_LENGTH=64;FX.constants.SEED_BYTE_LENGTH=32;FX.constants.SIGN_BYTE_LENGTH=64;FX.constants.HASH_BYTE_LENGTH=64;FX.generateKeyPair=function(X){X=X||{};var Z=X.seed;if(Z===void 0)Z=OZ.random.getBytesSync(FX.constants.SEED_BYTE_LENGTH);else if(typeof Z==="string"){if(Z.length!==FX.constants.SEED_BYTE_LENGTH)throw TypeError('"seed" must be '+FX.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(Z instanceof Uint8Array))throw TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');Z=YQ({message:Z,encoding:"binary"});var U=new SZ(FX.constants.PUBLIC_KEY_BYTE_LENGTH),Q=new SZ(FX.constants.PRIVATE_KEY_BYTE_LENGTH);for(var G=0;G<32;++G)Q[G]=Z[G];return _z(U,Q),{publicKey:U,privateKey:Q}};FX.privateKeyFromAsn1=function(X){var Z={},U=[],Q=OZ.asn1.validate(X,kz,Z,U);if(!Q){var G=Error("Invalid Key.");throw G.errors=U,G}var O=OZ.asn1.derToOid(Z.privateKeyOid),Y=OZ.oids.EdDSA25519;if(O!==Y)throw Error('Invalid OID "'+O+'"; OID must be "'+Y+'".');var K=Z.privateKey,A=YQ({message:OZ.asn1.fromDer(K).value,encoding:"binary"});return{privateKeyBytes:A}};FX.publicKeyFromAsn1=function(X){var Z={},U=[],Q=OZ.asn1.validate(X,Bz,Z,U);if(!Q){var G=Error("Invalid Key.");throw G.errors=U,G}var O=OZ.asn1.derToOid(Z.publicKeyOid),Y=OZ.oids.EdDSA25519;if(O!==Y)throw Error('Invalid OID "'+O+'"; OID must be "'+Y+'".');var K=Z.ed25519PublicKey;if(K.length!==FX.constants.PUBLIC_KEY_BYTE_LENGTH)throw Error("Key length is invalid.");return YQ({message:K,encoding:"binary"})};FX.publicKeyFromPrivateKey=function(X){X=X||{};var Z=YQ({message:X.privateKey,encoding:"binary"});if(Z.length!==FX.constants.PRIVATE_KEY_BYTE_LENGTH)throw TypeError('"options.privateKey" must have a byte length of '+FX.constants.PRIVATE_KEY_BYTE_LENGTH);var U=new SZ(FX.constants.PUBLIC_KEY_BYTE_LENGTH);for(var Q=0;Q<U.length;++Q)U[Q]=Z[32+Q];return U};FX.sign=function(X){X=X||{};var Z=YQ(X),U=YQ({message:X.privateKey,encoding:"binary"});if(U.length===FX.constants.SEED_BYTE_LENGTH){var Q=FX.generateKeyPair({seed:U});U=Q.privateKey}else if(U.length!==FX.constants.PRIVATE_KEY_BYTE_LENGTH)throw TypeError('"options.privateKey" must have a byte length of '+FX.constants.SEED_BYTE_LENGTH+" or "+FX.constants.PRIVATE_KEY_BYTE_LENGTH);var G=new SZ(FX.constants.SIGN_BYTE_LENGTH+Z.length);yz(G,Z,Z.length,U);var O=new SZ(FX.constants.SIGN_BYTE_LENGTH);for(var Y=0;Y<O.length;++Y)O[Y]=G[Y];return O};FX.verify=function(X){X=X||{};var Z=YQ(X);if(X.signature===void 0)throw TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var U=YQ({message:X.signature,encoding:"binary"});if(U.length!==FX.constants.SIGN_BYTE_LENGTH)throw TypeError('"options.signature" must have a byte length of '+FX.constants.SIGN_BYTE_LENGTH);var Q=YQ({message:X.publicKey,encoding:"binary"});if(Q.length!==FX.constants.PUBLIC_KEY_BYTE_LENGTH)throw TypeError('"options.publicKey" must have a byte length of '+FX.constants.PUBLIC_KEY_BYTE_LENGTH);var G=new SZ(FX.constants.SIGN_BYTE_LENGTH+Z.length),O=new SZ(FX.constants.SIGN_BYTE_LENGTH+Z.length),Y;for(Y=0;Y<FX.constants.SIGN_BYTE_LENGTH;++Y)G[Y]=U[Y];for(Y=0;Y<Z.length;++Y)G[Y+FX.constants.SIGN_BYTE_LENGTH]=Z[Y];return fz(O,G,G.length,Q)>=0};function YQ(X){var Z=X.message;if(Z instanceof Uint8Array||Z instanceof SZ)return Z;var U=X.encoding;if(Z===void 0)if(X.md)Z=X.md.digest().getBytes(),U="binary";else throw TypeError('"options.message" or "options.md" not specified.');if(typeof Z==="string"&&!U)throw TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof Z==="string"){if(typeof Buffer<"u")return Buffer.from(Z,U);Z=new W$(Z,U)}else if(!(Z instanceof W$))throw TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');var Q=new SZ(Z.length());for(var G=0;G<Q.length;++G)Q[G]=Z.at(G);return Q}var O$=XX(),LJ=XX([1]),xz=XX([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),wz=XX([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),hW=XX([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),pW=XX([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),$$=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),vz=XX([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function vU(X,Z){var U=OZ.md.sha512.create(),Q=new W$(X);U.update(Q.getBytes(Z),"binary");var G=U.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(G,"binary");var O=new SZ(FX.constants.HASH_BYTE_LENGTH);for(var Y=0;Y<64;++Y)O[Y]=G.charCodeAt(Y);return O}function _z(X,Z){var U=[XX(),XX(),XX(),XX()],Q,G=vU(Z,32);G[0]&=248,G[31]&=127,G[31]|=64,E$(U,G),K$(X,U);for(Q=0;Q<32;++Q)Z[Q+32]=X[Q];return 0}function yz(X,Z,U,Q){var G,O,Y=new Float64Array(64),K=[XX(),XX(),XX(),XX()],A=vU(Q,32);A[0]&=248,A[31]&=127,A[31]|=64;var D=U+64;for(G=0;G<U;++G)X[64+G]=Z[G];for(G=0;G<32;++G)X[32+G]=A[32+G];var C=vU(X.subarray(32),U+32);H$(C),E$(K,C),K$(X,K);for(G=32;G<64;++G)X[G]=Q[G];var z=vU(X,U+64);H$(z);for(G=32;G<64;++G)Y[G]=0;for(G=0;G<32;++G)Y[G]=C[G];for(G=0;G<32;++G)for(O=0;O<32;O++)Y[G+O]+=z[G]*A[O];return dW(X.subarray(32),Y),D}function fz(X,Z,U,Q){var G,O,Y=new SZ(32),K=[XX(),XX(),XX(),XX()],A=[XX(),XX(),XX(),XX()];if(O=-1,U<64)return-1;if(gz(A,Q))return-1;for(G=0;G<U;++G)X[G]=Z[G];for(G=0;G<32;++G)X[G+32]=Q[G];var D=vU(X,U);if(H$(D),oW(K,A,D),E$(A,Z.subarray(32)),F$(K,A),K$(Y,K),U-=64,lW(Z,0,Y,0)){for(G=0;G<U;++G)X[G]=0;return-1}for(G=0;G<U;++G)X[G]=Z[G+64];return O=U,O}function dW(X,Z){var U,Q,G,O;for(Q=63;Q>=32;--Q){U=0;for(G=Q-32,O=Q-12;G<O;++G)Z[G]+=U-16*Z[Q]*$$[G-(Q-32)],U=Z[G]+128>>8,Z[G]-=U*256;Z[G]+=U,Z[Q]=0}U=0;for(G=0;G<32;++G)Z[G]+=U-(Z[31]>>4)*$$[G],U=Z[G]>>8,Z[G]&=255;for(G=0;G<32;++G)Z[G]-=U*$$[G];for(Q=0;Q<32;++Q)Z[Q+1]+=Z[Q]>>8,X[Q]=Z[Q]&255}function H$(X){var Z=new Float64Array(64);for(var U=0;U<64;++U)Z[U]=X[U],X[U]=0;dW(X,Z)}function F$(X,Z){var U=XX(),Q=XX(),G=XX(),O=XX(),Y=XX(),K=XX(),A=XX(),D=XX(),C=XX();UU(U,X[1],X[0]),UU(C,Z[1],Z[0]),RX(U,U,C),QU(Q,X[0],X[1]),QU(C,Z[0],Z[1]),RX(Q,Q,C),RX(G,X[3],Z[3]),RX(G,G,wz),RX(O,X[2],Z[2]),QU(O,O,O),UU(Y,Q,U),UU(K,O,G),QU(A,O,G),QU(D,Q,U),RX(X[0],Y,K),RX(X[1],D,A),RX(X[2],A,K),RX(X[3],Y,D)}function cW(X,Z,U){for(var Q=0;Q<4;++Q)nW(X[Q],Z[Q],U)}function K$(X,Z){var U=XX(),Q=XX(),G=XX();uz(G,Z[2]),RX(U,Z[0],G),RX(Q,Z[1],G),IJ(X,Q),X[31]^=mW(U)<<7}function IJ(X,Z){var U,Q,G,O=XX(),Y=XX();for(U=0;U<16;++U)Y[U]=Z[U];G$(Y),G$(Y),G$(Y);for(Q=0;Q<2;++Q){O[0]=Y[0]-65517;for(U=1;U<15;++U)O[U]=Y[U]-65535-(O[U-1]>>16&1),O[U-1]&=65535;O[15]=Y[15]-32767-(O[14]>>16&1),G=O[15]>>16&1,O[14]&=65535,nW(Y,O,1-G)}for(U=0;U<16;U++)X[2*U]=Y[U]&255,X[2*U+1]=Y[U]>>8}function gz(X,Z){var U=XX(),Q=XX(),G=XX(),O=XX(),Y=XX(),K=XX(),A=XX();if(AQ(X[2],LJ),hz(X[1],Z),fQ(G,X[1]),RX(O,G,xz),UU(G,G,X[2]),QU(O,X[2],O),fQ(Y,O),fQ(K,Y),RX(A,K,Y),RX(U,A,G),RX(U,U,O),pz(U,U),RX(U,U,G),RX(U,U,O),RX(U,U,O),RX(X[0],U,O),fQ(Q,X[0]),RX(Q,Q,O),uW(Q,G))RX(X[0],X[0],vz);if(fQ(Q,X[0]),RX(Q,Q,O),uW(Q,G))return-1;if(mW(X[0])===Z[31]>>7)UU(X[0],O$,X[0]);return RX(X[3],X[0],X[1]),0}function hz(X,Z){var U;for(U=0;U<16;++U)X[U]=Z[2*U]+(Z[2*U+1]<<8);X[15]&=32767}function pz(X,Z){var U=XX(),Q;for(Q=0;Q<16;++Q)U[Q]=Z[Q];for(Q=250;Q>=0;--Q)if(fQ(U,U),Q!==1)RX(U,U,Z);for(Q=0;Q<16;++Q)X[Q]=U[Q]}function uW(X,Z){var U=new SZ(32),Q=new SZ(32);return IJ(U,X),IJ(Q,Z),lW(U,0,Q,0)}function lW(X,Z,U,Q){return cz(X,Z,U,Q,32)}function cz(X,Z,U,Q,G){var O,Y=0;for(O=0;O<G;++O)Y|=X[Z+O]^U[Q+O];return(1&Y-1>>>8)-1}function mW(X){var Z=new SZ(32);return IJ(Z,X),Z[0]&1}function oW(X,Z,U){var Q,G;AQ(X[0],O$),AQ(X[1],LJ),AQ(X[2],LJ),AQ(X[3],O$);for(G=255;G>=0;--G)Q=U[G/8|0]>>(G&7)&1,cW(X,Z,Q),F$(Z,X),F$(X,X),cW(X,Z,Q)}function E$(X,Z){var U=[XX(),XX(),XX(),XX()];AQ(U[0],hW),AQ(U[1],pW),AQ(U[2],LJ),RX(U[3],hW,pW),oW(X,U,Z)}function AQ(X,Z){var U;for(U=0;U<16;U++)X[U]=Z[U]|0}function uz(X,Z){var U=XX(),Q;for(Q=0;Q<16;++Q)U[Q]=Z[Q];for(Q=253;Q>=0;--Q)if(fQ(U,U),Q!==2&&Q!==4)RX(U,U,Z);for(Q=0;Q<16;++Q)X[Q]=U[Q]}function G$(X){var Z,U,Q=1;for(Z=0;Z<16;++Z)U=X[Z]+Q+65535,Q=Math.floor(U/65536),X[Z]=U-Q*65536;X[0]+=Q-1+37*(Q-1)}function nW(X,Z,U){var Q,G=~(U-1);for(var O=0;O<16;++O)Q=G&(X[O]^Z[O]),X[O]^=Q,Z[O]^=Q}function XX(X){var Z,U=new Float64Array(16);if(X)for(Z=0;Z<X.length;++Z)U[Z]=X[Z];return U}function QU(X,Z,U){for(var Q=0;Q<16;++Q)X[Q]=Z[Q]+U[Q]}function UU(X,Z,U){for(var Q=0;Q<16;++Q)X[Q]=Z[Q]-U[Q]}function fQ(X,Z){RX(X,Z,Z)}function RX(X,Z,U){var Q,G,O=0,Y=0,K=0,A=0,D=0,C=0,z=0,R=0,S=0,P=0,N=0,I=0,B=0,k=0,w=0,v=0,_=0,u=0,J0=0,H0=0,V0=0,l=0,U0=0,J=0,W=0,F=0,V=0,H=0,M=0,T=0,E=0,$=U[0],q=U[1],j=U[2],L=U[3],x=U[4],f=U[5],b=U[6],s=U[7],z0=U[8],i=U[9],o=U[10],W0=U[11],r=U[12],X0=U[13],d0=U[14],c=U[15];Q=Z[0],O+=Q*$,Y+=Q*q,K+=Q*j,A+=Q*L,D+=Q*x,C+=Q*f,z+=Q*b,R+=Q*s,S+=Q*z0,P+=Q*i,N+=Q*o,I+=Q*W0,B+=Q*r,k+=Q*X0,w+=Q*d0,v+=Q*c,Q=Z[1],Y+=Q*$,K+=Q*q,A+=Q*j,D+=Q*L,C+=Q*x,z+=Q*f,R+=Q*b,S+=Q*s,P+=Q*z0,N+=Q*i,I+=Q*o,B+=Q*W0,k+=Q*r,w+=Q*X0,v+=Q*d0,_+=Q*c,Q=Z[2],K+=Q*$,A+=Q*q,D+=Q*j,C+=Q*L,z+=Q*x,R+=Q*f,S+=Q*b,P+=Q*s,N+=Q*z0,I+=Q*i,B+=Q*o,k+=Q*W0,w+=Q*r,v+=Q*X0,_+=Q*d0,u+=Q*c,Q=Z[3],A+=Q*$,D+=Q*q,C+=Q*j,z+=Q*L,R+=Q*x,S+=Q*f,P+=Q*b,N+=Q*s,I+=Q*z0,B+=Q*i,k+=Q*o,w+=Q*W0,v+=Q*r,_+=Q*X0,u+=Q*d0,J0+=Q*c,Q=Z[4],D+=Q*$,C+=Q*q,z+=Q*j,R+=Q*L,S+=Q*x,P+=Q*f,N+=Q*b,I+=Q*s,B+=Q*z0,k+=Q*i,w+=Q*o,v+=Q*W0,_+=Q*r,u+=Q*X0,J0+=Q*d0,H0+=Q*c,Q=Z[5],C+=Q*$,z+=Q*q,R+=Q*j,S+=Q*L,P+=Q*x,N+=Q*f,I+=Q*b,B+=Q*s,k+=Q*z0,w+=Q*i,v+=Q*o,_+=Q*W0,u+=Q*r,J0+=Q*X0,H0+=Q*d0,V0+=Q*c,Q=Z[6],z+=Q*$,R+=Q*q,S+=Q*j,P+=Q*L,N+=Q*x,I+=Q*f,B+=Q*b,k+=Q*s,w+=Q*z0,v+=Q*i,_+=Q*o,u+=Q*W0,J0+=Q*r,H0+=Q*X0,V0+=Q*d0,l+=Q*c,Q=Z[7],R+=Q*$,S+=Q*q,P+=Q*j,N+=Q*L,I+=Q*x,B+=Q*f,k+=Q*b,w+=Q*s,v+=Q*z0,_+=Q*i,u+=Q*o,J0+=Q*W0,H0+=Q*r,V0+=Q*X0,l+=Q*d0,U0+=Q*c,Q=Z[8],S+=Q*$,P+=Q*q,N+=Q*j,I+=Q*L,B+=Q*x,k+=Q*f,w+=Q*b,v+=Q*s,_+=Q*z0,u+=Q*i,J0+=Q*o,H0+=Q*W0,V0+=Q*r,l+=Q*X0,U0+=Q*d0,J+=Q*c,Q=Z[9],P+=Q*$,N+=Q*q,I+=Q*j,B+=Q*L,k+=Q*x,w+=Q*f,v+=Q*b,_+=Q*s,u+=Q*z0,J0+=Q*i,H0+=Q*o,V0+=Q*W0,l+=Q*r,U0+=Q*X0,J+=Q*d0,W+=Q*c,Q=Z[10],N+=Q*$,I+=Q*q,B+=Q*j,k+=Q*L,w+=Q*x,v+=Q*f,_+=Q*b,u+=Q*s,J0+=Q*z0,H0+=Q*i,V0+=Q*o,l+=Q*W0,U0+=Q*r,J+=Q*X0,W+=Q*d0,F+=Q*c,Q=Z[11],I+=Q*$,B+=Q*q,k+=Q*j,w+=Q*L,v+=Q*x,_+=Q*f,u+=Q*b,J0+=Q*s,H0+=Q*z0,V0+=Q*i,l+=Q*o,U0+=Q*W0,J+=Q*r,W+=Q*X0,F+=Q*d0,V+=Q*c,Q=Z[12],B+=Q*$,k+=Q*q,w+=Q*j,v+=Q*L,_+=Q*x,u+=Q*f,J0+=Q*b,H0+=Q*s,V0+=Q*z0,l+=Q*i,U0+=Q*o,J+=Q*W0,W+=Q*r,F+=Q*X0,V+=Q*d0,H+=Q*c,Q=Z[13],k+=Q*$,w+=Q*q,v+=Q*j,_+=Q*L,u+=Q*x,J0+=Q*f,H0+=Q*b,V0+=Q*s,l+=Q*z0,U0+=Q*i,J+=Q*o,W+=Q*W0,F+=Q*r,V+=Q*X0,H+=Q*d0,M+=Q*c,Q=Z[14],w+=Q*$,v+=Q*q,_+=Q*j,u+=Q*L,J0+=Q*x,H0+=Q*f,V0+=Q*b,l+=Q*s,U0+=Q*z0,J+=Q*i,W+=Q*o,F+=Q*W0,V+=Q*r,H+=Q*X0,M+=Q*d0,T+=Q*c,Q=Z[15],v+=Q*$,_+=Q*q,u+=Q*j,J0+=Q*L,H0+=Q*x,V0+=Q*f,l+=Q*b,U0+=Q*s,J+=Q*z0,W+=Q*i,F+=Q*o,V+=Q*W0,H+=Q*r,M+=Q*X0,T+=Q*d0,E+=Q*c,O+=38*_,Y+=38*u,K+=38*J0,A+=38*H0,D+=38*V0,C+=38*l,z+=38*U0,R+=38*J,S+=38*W,P+=38*F,N+=38*V,I+=38*H,B+=38*M,k+=38*T,w+=38*E,G=1,Q=O+G+65535,G=Math.floor(Q/65536),O=Q-G*65536,Q=Y+G+65535,G=Math.floor(Q/65536),Y=Q-G*65536,Q=K+G+65535,G=Math.floor(Q/65536),K=Q-G*65536,Q=A+G+65535,G=Math.floor(Q/65536),A=Q-G*65536,Q=D+G+65535,G=Math.floor(Q/65536),D=Q-G*65536,Q=C+G+65535,G=Math.floor(Q/65536),C=Q-G*65536,Q=z+G+65535,G=Math.floor(Q/65536),z=Q-G*65536,Q=R+G+65535,G=Math.floor(Q/65536),R=Q-G*65536,Q=S+G+65535,G=Math.floor(Q/65536),S=Q-G*65536,Q=P+G+65535,G=Math.floor(Q/65536),P=Q-G*65536,Q=N+G+65535,G=Math.floor(Q/65536),N=Q-G*65536,Q=I+G+65535,G=Math.floor(Q/65536),I=Q-G*65536,Q=B+G+65535,G=Math.floor(Q/65536),B=Q-G*65536,Q=k+G+65535,G=Math.floor(Q/65536),k=Q-G*65536,Q=w+G+65535,G=Math.floor(Q/65536),w=Q-G*65536,Q=v+G+65535,G=Math.floor(Q/65536),v=Q-G*65536,O+=G-1+37*(G-1),G=1,Q=O+G+65535,G=Math.floor(Q/65536),O=Q-G*65536,Q=Y+G+65535,G=Math.floor(Q/65536),Y=Q-G*65536,Q=K+G+65535,G=Math.floor(Q/65536),K=Q-G*65536,Q=A+G+65535,G=Math.floor(Q/65536),A=Q-G*65536,Q=D+G+65535,G=Math.floor(Q/65536),D=Q-G*65536,Q=C+G+65535,G=Math.floor(Q/65536),C=Q-G*65536,Q=z+G+65535,G=Math.floor(Q/65536),z=Q-G*65536,Q=R+G+65535,G=Math.floor(Q/65536),R=Q-G*65536,Q=S+G+65535,G=Math.floor(Q/65536),S=Q-G*65536,Q=P+G+65535,G=Math.floor(Q/65536),P=Q-G*65536,Q=N+G+65535,G=Math.floor(Q/65536),N=Q-G*65536,Q=I+G+65535,G=Math.floor(Q/65536),I=Q-G*65536,Q=B+G+65535,G=Math.floor(Q/65536),B=Q-G*65536,Q=k+G+65535,G=Math.floor(Q/65536),k=Q-G*65536,Q=w+G+65535,G=Math.floor(Q/65536),w=Q-G*65536,Q=v+G+65535,G=Math.floor(Q/65536),v=Q-G*65536,O+=G-1+37*(G-1),X[0]=O,X[1]=Y,X[2]=K,X[3]=A,X[4]=D,X[5]=C,X[6]=z,X[7]=R,X[8]=S,X[9]=P,X[10]=N,X[11]=I,X[12]=B,X[13]=k,X[14]=w,X[15]=v}});var eW=QX((Wq,iW)=>{var jZ=GX();DX();kZ();jU();iW.exports=jZ.kem=jZ.kem||{};var aW=jZ.jsbn.BigInteger;jZ.kem.rsa={};jZ.kem.rsa.create=function(X,Z){Z=Z||{};var U=Z.prng||jZ.random,Q={};return Q.encrypt=function(G,O){var Y=Math.ceil(G.n.bitLength()/8),K;do K=new aW(jZ.util.bytesToHex(U.getBytesSync(Y)),16).mod(G.n);while(K.compareTo(aW.ONE)<=0);K=jZ.util.hexToBytes(K.toString(16));var A=Y-K.length;if(A>0)K=jZ.util.fillString(String.fromCharCode(0),A)+K;var D=G.encrypt(K,"NONE"),C=X.generate(K,O);return{encapsulation:D,key:C}},Q.decrypt=function(G,O,Y){var K=G.decrypt(O,"NONE");return X.generate(K,Y)},Q};jZ.kem.kdf1=function(X,Z){tW(this,X,0,Z||X.digestLength)};jZ.kem.kdf2=function(X,Z){tW(this,X,1,Z||X.digestLength)};function tW(X,Z,U,Q){X.generate=function(G,O){var Y=new jZ.util.ByteBuffer,K=Math.ceil(O/Q)+U,A=new jZ.util.ByteBuffer;for(var D=U;D<K;++D){A.putInt32(D),Z.start(),Z.update(G+A.getBytes());var C=Z.digest();Y.putBytes(C.getBytes(Q))}return Y.truncate(Y.length()-O),Y.getBytes()}}});var ZO=QX((Oq,XO)=>{var KX=GX();DX();XO.exports=KX.log=KX.log||{};KX.log.levels=["none","error","warning","info","debug","verbose","max"];var BJ={},z$=[],_U=null;KX.log.LEVEL_LOCKED=2;KX.log.NO_LEVEL_CHECK=4;KX.log.INTERPOLATE=8;for(fZ=0;fZ<KX.log.levels.length;++fZ)jJ=KX.log.levels[fZ],BJ[jJ]={index:fZ,name:jJ.toUpperCase()};var jJ,fZ;KX.log.logMessage=function(X){var Z=BJ[X.level].index;for(var U=0;U<z$.length;++U){var Q=z$[U];if(Q.flags&KX.log.NO_LEVEL_CHECK)Q.f(X);else{var G=BJ[Q.level].index;if(Z<=G)Q.f(Q,X)}}};KX.log.prepareStandard=function(X){if(!("standard"in X))X.standard=BJ[X.level].name+" ["+X.category+"] "+X.message};KX.log.prepareFull=function(X){if(!("full"in X)){var Z=[X.message];Z=Z.concat([]),X.full=KX.util.format.apply(this,Z)}};KX.log.prepareStandardFull=function(X){if(!("standardFull"in X))KX.log.prepareStandard(X),X.standardFull=X.standard};NJ=["error","warning","info","debug","verbose"];for(fZ=0;fZ<NJ.length;++fZ)(function(Z){KX.log[Z]=function(U,Q){var G=Array.prototype.slice.call(arguments).slice(2),O={timestamp:new Date,level:Z,category:U,message:Q,arguments:G};KX.log.logMessage(O)}})(NJ[fZ]);var NJ,fZ;KX.log.makeLogger=function(X){var Z={flags:0,f:X};return KX.log.setLevel(Z,"none"),Z};KX.log.setLevel=function(X,Z){var U=!1;if(X&&!(X.flags&KX.log.LEVEL_LOCKED))for(var Q=0;Q<KX.log.levels.length;++Q){var G=KX.log.levels[Q];if(Z==G){X.level=Z,U=!0;break}}return U};KX.log.lock=function(X,Z){if(typeof Z>"u"||Z)X.flags|=KX.log.LEVEL_LOCKED;else X.flags&=~KX.log.LEVEL_LOCKED};KX.log.addLogger=function(X){z$.push(X)};if(typeof console<"u"&&"log"in console){if(console.error&&console.warn&&console.info&&console.debug)D$={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},YU=function(X,Z){KX.log.prepareStandard(Z);var U=D$[Z.level],Q=[Z.standard];Q=Q.concat(Z.arguments.slice()),U.apply(console,Q)},gQ=KX.log.makeLogger(YU);else YU=function(Z,U){KX.log.prepareStandardFull(U),console.log(U.standardFull)},gQ=KX.log.makeLogger(YU);KX.log.setLevel(gQ,"debug"),KX.log.addLogger(gQ),_U=gQ}else console={log:function(){}};var gQ,D$,YU;if(_U!==null&&typeof window<"u"&&window.location){if(JU=new URL(window.location.href).searchParams,JU.has("console.level"))KX.log.setLevel(_U,JU.get("console.level").slice(-1)[0]);if(JU.has("console.lock")){if(q$=JU.get("console.lock").slice(-1)[0],q$=="true")KX.log.lock(_U)}}var JU,q$;KX.log.consoleLogger=_U});var UO=QX((Hq,QO)=>{QO.exports=cZ();mU();tQ();BY();Y$()});var $O=QX((Fq,YO)=>{var s0=GX();VQ();hZ();FU();WQ();PQ();lY();kZ();DX();TJ();var Q0=s0.asn1,AZ=YO.exports=s0.pkcs7=s0.pkcs7||{};AZ.messageFromPem=function(X){var Z=s0.pem.decode(X)[0];if(Z.type!=="PKCS7"){var U=Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw U.headerType=Z.type,U}if(Z.procType&&Z.procType.type==="ENCRYPTED")throw Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var Q=Q0.fromDer(Z.body);return AZ.messageFromAsn1(Q)};AZ.messageToPem=function(X,Z){var U={type:"PKCS7",body:Q0.toDer(X.toAsn1()).getBytes()};return s0.pem.encode(U,{maxline:Z})};AZ.messageFromAsn1=function(X){var Z={},U=[];if(!Q0.validate(X,AZ.asn1.contentInfoValidator,Z,U)){var Q=Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw Q.errors=U,Q}var G=Q0.derToOid(Z.contentType),O;switch(G){case s0.pki.oids.envelopedData:O=AZ.createEnvelopedData();break;case s0.pki.oids.encryptedData:O=AZ.createEncryptedData();break;case s0.pki.oids.signedData:O=AZ.createSignedData();break;default:throw Error("Cannot read PKCS#7 message. ContentType with OID "+G+" is not (yet) supported.")}return O.fromAsn1(Z.content.value[0]),O};AZ.createSignedData=function(){var X=null;return X={type:s0.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(Q){if(C$(X,Q,AZ.asn1.signedDataValidator),X.certificates=[],X.crls=[],X.digestAlgorithmIdentifiers=[],X.contentInfo=null,X.signerInfos=[],X.rawCapture.certificates){var G=X.rawCapture.certificates.value;for(var O=0;O<G.length;++O)X.certificates.push(s0.pki.certificateFromAsn1(G[O]))}},toAsn1:function(){if(!X.contentInfo)X.sign();var Q=[];for(var G=0;G<X.certificates.length;++G)Q.push(s0.pki.certificateToAsn1(X.certificates[G]));var O=[],Y=Q0.create(Q0.Class.CONTEXT_SPECIFIC,0,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.INTEGER,!1,Q0.integerToDer(X.version).getBytes()),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SET,!0,X.digestAlgorithmIdentifiers),X.contentInfo])]);if(Q.length>0)Y.value[0].value.push(Q0.create(Q0.Class.CONTEXT_SPECIFIC,0,!0,Q));if(O.length>0)Y.value[0].value.push(Q0.create(Q0.Class.CONTEXT_SPECIFIC,1,!0,O));return Y.value[0].value.push(Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SET,!0,X.signerInfos)),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OID,!1,Q0.oidToDer(X.type).getBytes()),Y])},addSigner:function(Q){var{issuer:G,serialNumber:O}=Q;if(Q.certificate){var Y=Q.certificate;if(typeof Y==="string")Y=s0.pki.certificateFromPem(Y);G=Y.issuer.attributes,O=Y.serialNumber}var K=Q.key;if(!K)throw Error("Could not add PKCS#7 signer; no private key specified.");if(typeof K==="string")K=s0.pki.privateKeyFromPem(K);var A=Q.digestAlgorithm||s0.pki.oids.sha1;switch(A){case s0.pki.oids.sha1:case s0.pki.oids.sha256:case s0.pki.oids.sha384:case s0.pki.oids.sha512:case s0.pki.oids.md5:break;default:throw Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+A)}var D=Q.authenticatedAttributes||[];if(D.length>0){var C=!1,z=!1;for(var R=0;R<D.length;++R){var S=D[R];if(!C&&S.type===s0.pki.oids.contentType){if(C=!0,z)break;continue}if(!z&&S.type===s0.pki.oids.messageDigest){if(z=!0,C)break;continue}}if(!C||!z)throw Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}X.signers.push({key:K,version:1,issuer:G,serialNumber:O,digestAlgorithm:A,signatureAlgorithm:s0.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:D,unauthenticatedAttributes:[]})},sign:function(Q){if(Q=Q||{},typeof X.content!=="object"||X.contentInfo===null){if(X.contentInfo=Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OID,!1,Q0.oidToDer(s0.pki.oids.data).getBytes())]),"content"in X){var G;if(X.content instanceof s0.util.ByteBuffer)G=X.content.bytes();else if(typeof X.content==="string")G=s0.util.encodeUtf8(X.content);if(Q.detached)X.detachedContent=Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OCTETSTRING,!1,G);else X.contentInfo.value.push(Q0.create(Q0.Class.CONTEXT_SPECIFIC,0,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OCTETSTRING,!1,G)]))}}if(X.signers.length===0)return;var O=Z();U(O)},verify:function(){throw Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(Q){if(typeof Q==="string")Q=s0.pki.certificateFromPem(Q);X.certificates.push(Q)},addCertificateRevokationList:function(Q){throw Error("PKCS#7 CRL support not yet implemented.")}},X;function Z(){var Q={};for(var G=0;G<X.signers.length;++G){var O=X.signers[G],Y=O.digestAlgorithm;if(!(Y in Q))Q[Y]=s0.md[s0.pki.oids[Y]].create();if(O.authenticatedAttributes.length===0)O.md=Q[Y];else O.md=s0.md[s0.pki.oids[Y]].create()}X.digestAlgorithmIdentifiers=[];for(var Y in Q)X.digestAlgorithmIdentifiers.push(Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OID,!1,Q0.oidToDer(Y).getBytes()),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.NULL,!1,"")]));return Q}function U(Q){var G;if(X.detachedContent)G=X.detachedContent;else G=X.contentInfo.value[1],G=G.value[0];if(!G)throw Error("Could not sign PKCS#7 message; there is no content to sign.");var O=Q0.derToOid(X.contentInfo.value[0].value),Y=Q0.toDer(G);Y.getByte(),Q0.getBerValueLength(Y),Y=Y.getBytes();for(var K in Q)Q[K].start().update(Y);var A=new Date;for(var D=0;D<X.signers.length;++D){var C=X.signers[D];if(C.authenticatedAttributes.length===0){if(O!==s0.pki.oids.data)throw Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{C.authenticatedAttributesAsn1=Q0.create(Q0.Class.CONTEXT_SPECIFIC,0,!0,[]);var z=Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SET,!0,[]);for(var R=0;R<C.authenticatedAttributes.length;++R){var S=C.authenticatedAttributes[R];if(S.type===s0.pki.oids.messageDigest)S.value=Q[C.digestAlgorithm].digest();else if(S.type===s0.pki.oids.signingTime){if(!S.value)S.value=A}z.value.push(M$(S)),C.authenticatedAttributesAsn1.value.push(M$(S))}Y=Q0.toDer(z).getBytes(),C.md.start().update(Y)}C.signature=C.key.sign(C.md,"RSASSA-PKCS1-V1_5")}X.signerInfos=nz(X.signers)}};AZ.createEncryptedData=function(){var X=null;return X={type:s0.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:s0.pki.oids["aes256-CBC"]},fromAsn1:function(Z){C$(X,Z,AZ.asn1.encryptedDataValidator)},decrypt:function(Z){if(Z!==void 0)X.encryptedContent.key=Z;JO(X)}},X};AZ.createEnvelopedData=function(){var X=null;return X={type:s0.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:s0.pki.oids["aes256-CBC"]},fromAsn1:function(Z){var U=C$(X,Z,AZ.asn1.envelopedDataValidator);X.recipients=lz(U.recipientInfos.value)},toAsn1:function(){return Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OID,!1,Q0.oidToDer(X.type).getBytes()),Q0.create(Q0.Class.CONTEXT_SPECIFIC,0,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.INTEGER,!1,Q0.integerToDer(X.version).getBytes()),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SET,!0,mz(X.recipients)),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,sz(X.encryptedContent))])])])},findRecipient:function(Z){var U=Z.issuer.attributes;for(var Q=0;Q<X.recipients.length;++Q){var G=X.recipients[Q],O=G.issuer;if(G.serialNumber!==Z.serialNumber)continue;if(O.length!==U.length)continue;var Y=!0;for(var K=0;K<U.length;++K)if(O[K].type!==U[K].type||O[K].value!==U[K].value){Y=!1;break}if(Y)return G}return null},decrypt:function(Z,U){if(X.encryptedContent.key===void 0&&Z!==void 0&&U!==void 0)switch(Z.encryptedContent.algorithm){case s0.pki.oids.rsaEncryption:case s0.pki.oids.desCBC:var Q=U.decrypt(Z.encryptedContent.content);X.encryptedContent.key=s0.util.createBuffer(Q);break;default:throw Error("Unsupported asymmetric cipher, OID "+Z.encryptedContent.algorithm)}JO(X)},addRecipient:function(Z){X.recipients.push({version:0,issuer:Z.issuer.attributes,serialNumber:Z.serialNumber,encryptedContent:{algorithm:s0.pki.oids.rsaEncryption,key:Z.publicKey}})},encrypt:function(Z,U){if(X.encryptedContent.content===void 0){U=U||X.encryptedContent.algorithm,Z=Z||X.encryptedContent.key;var Q,G,O;switch(U){case s0.pki.oids["aes128-CBC"]:Q=16,G=16,O=s0.aes.createEncryptionCipher;break;case s0.pki.oids["aes192-CBC"]:Q=24,G=16,O=s0.aes.createEncryptionCipher;break;case s0.pki.oids["aes256-CBC"]:Q=32,G=16,O=s0.aes.createEncryptionCipher;break;case s0.pki.oids["des-EDE3-CBC"]:Q=24,G=8,O=s0.des.createEncryptionCipher;break;default:throw Error("Unsupported symmetric cipher, OID "+U)}if(Z===void 0)Z=s0.util.createBuffer(s0.random.getBytes(Q));else if(Z.length()!=Q)throw Error("Symmetric key has wrong length; got "+Z.length()+" bytes, expected "+Q+".");X.encryptedContent.algorithm=U,X.encryptedContent.key=Z,X.encryptedContent.parameter=s0.util.createBuffer(s0.random.getBytes(G));var Y=O(Z);if(Y.start(X.encryptedContent.parameter.copy()),Y.update(X.content),!Y.finish())throw Error("Symmetric encryption failed.");X.encryptedContent.content=Y.output}for(var K=0;K<X.recipients.length;++K){var A=X.recipients[K];if(A.encryptedContent.content!==void 0)continue;switch(A.encryptedContent.algorithm){case s0.pki.oids.rsaEncryption:A.encryptedContent.content=A.encryptedContent.key.encrypt(X.encryptedContent.key.data);break;default:throw Error("Unsupported asymmetric cipher, OID "+A.encryptedContent.algorithm)}}}},X};function bz(X){var Z={},U=[];if(!Q0.validate(X,AZ.asn1.recipientInfoValidator,Z,U)){var Q=Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw Q.errors=U,Q}return{version:Z.version.charCodeAt(0),issuer:s0.pki.RDNAttributesAsArray(Z.issuer),serialNumber:s0.util.createBuffer(Z.serial).toHex(),encryptedContent:{algorithm:Q0.derToOid(Z.encAlgorithm),parameter:Z.encParameter?Z.encParameter.value:void 0,content:Z.encKey}}}function dz(X){return Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.INTEGER,!1,Q0.integerToDer(X.version).getBytes()),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[s0.pki.distinguishedNameToAsn1({attributes:X.issuer}),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.INTEGER,!1,s0.util.hexToBytes(X.serialNumber))]),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OID,!1,Q0.oidToDer(X.encryptedContent.algorithm).getBytes()),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.NULL,!1,"")]),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OCTETSTRING,!1,X.encryptedContent.content)])}function lz(X){var Z=[];for(var U=0;U<X.length;++U)Z.push(bz(X[U]));return Z}function mz(X){var Z=[];for(var U=0;U<X.length;++U)Z.push(dz(X[U]));return Z}function oz(X){var Z=Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.INTEGER,!1,Q0.integerToDer(X.version).getBytes()),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[s0.pki.distinguishedNameToAsn1({attributes:X.issuer}),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.INTEGER,!1,s0.util.hexToBytes(X.serialNumber))]),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OID,!1,Q0.oidToDer(X.digestAlgorithm).getBytes()),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.NULL,!1,"")])]);if(X.authenticatedAttributesAsn1)Z.value.push(X.authenticatedAttributesAsn1);if(Z.value.push(Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OID,!1,Q0.oidToDer(X.signatureAlgorithm).getBytes()),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.NULL,!1,"")])),Z.value.push(Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OCTETSTRING,!1,X.signature)),X.unauthenticatedAttributes.length>0){var U=Q0.create(Q0.Class.CONTEXT_SPECIFIC,1,!0,[]);for(var Q=0;Q<X.unauthenticatedAttributes.length;++Q){var G=X.unauthenticatedAttributes[Q];U.values.push(M$(G))}Z.value.push(U)}return Z}function nz(X){var Z=[];for(var U=0;U<X.length;++U)Z.push(oz(X[U]));return Z}function M$(X){var Z;if(X.type===s0.pki.oids.contentType)Z=Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OID,!1,Q0.oidToDer(X.value).getBytes());else if(X.type===s0.pki.oids.messageDigest)Z=Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OCTETSTRING,!1,X.value.bytes());else if(X.type===s0.pki.oids.signingTime){var U=new Date("1950-01-01T00:00:00Z"),Q=new Date("2050-01-01T00:00:00Z"),G=X.value;if(typeof G==="string"){var O=Date.parse(G);if(!isNaN(O))G=new Date(O);else if(G.length===13)G=Q0.utcTimeToDate(G);else G=Q0.generalizedTimeToDate(G)}if(G>=U&&G<Q)Z=Q0.create(Q0.Class.UNIVERSAL,Q0.Type.UTCTIME,!1,Q0.dateToUtcTime(G));else Z=Q0.create(Q0.Class.UNIVERSAL,Q0.Type.GENERALIZEDTIME,!1,Q0.dateToGeneralizedTime(G))}return Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OID,!1,Q0.oidToDer(X.type).getBytes()),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SET,!0,[Z])])}function sz(X){return[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OID,!1,Q0.oidToDer(s0.pki.oids.data).getBytes()),Q0.create(Q0.Class.UNIVERSAL,Q0.Type.SEQUENCE,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OID,!1,Q0.oidToDer(X.algorithm).getBytes()),!X.parameter?void 0:Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OCTETSTRING,!1,X.parameter.getBytes())]),Q0.create(Q0.Class.CONTEXT_SPECIFIC,0,!0,[Q0.create(Q0.Class.UNIVERSAL,Q0.Type.OCTETSTRING,!1,X.content.getBytes())])]}function C$(X,Z,U){var Q={},G=[];if(!Q0.validate(Z,U,Q,G)){var O=Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw O.errors=O,O}var Y=Q0.derToOid(Q.contentType);if(Y!==s0.pki.oids.data)throw Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(Q.encryptedContent){var K="";if(s0.util.isArray(Q.encryptedContent))for(var A=0;A<Q.encryptedContent.length;++A){if(Q.encryptedContent[A].type!==Q0.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");K+=Q.encryptedContent[A].value}else K=Q.encryptedContent;X.encryptedContent={algorithm:Q0.derToOid(Q.encAlgorithm),parameter:s0.util.createBuffer(Q.encParameter.value),content:s0.util.createBuffer(K)}}if(Q.content){var K="";if(s0.util.isArray(Q.content))for(var A=0;A<Q.content.length;++A){if(Q.content[A].type!==Q0.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");K+=Q.content[A].value}else K=Q.content;X.content=s0.util.createBuffer(K)}return X.version=Q.version.charCodeAt(0),X.rawCapture=Q,Q}function JO(X){if(X.encryptedContent.key===void 0)throw Error("Symmetric key not available.");if(X.content===void 0){var Z;switch(X.encryptedContent.algorithm){case s0.pki.oids["aes128-CBC"]:case s0.pki.oids["aes192-CBC"]:case s0.pki.oids["aes256-CBC"]:Z=s0.aes.createDecryptionCipher(X.encryptedContent.key);break;case s0.pki.oids.desCBC:case s0.pki.oids["des-EDE3-CBC"]:Z=s0.des.createDecryptionCipher(X.encryptedContent.key);break;default:throw Error("Unsupported symmetric cipher, OID "+X.encryptedContent.algorithm)}if(Z.start(X.encryptedContent.parameter),Z.update(X.encryptedContent.content),!Z.finish())throw Error("Symmetric decryption failed.");X.content=Z.output}}});var VO=QX((Kq,GO)=>{var yX=GX();VQ();bQ();mU();tQ();DX();var xJ=GO.exports=yX.ssh=yX.ssh||{};xJ.privateKeyToPutty=function(X,Z,U){U=U||"",Z=Z||"";var Q="ssh-rsa",G=Z===""?"none":"aes256-cbc",O="PuTTY-User-Key-File-2: "+Q+`\r
|
|
30
|
+
`;O+="Encryption: "+G+`\r
|
|
31
|
+
`,O+="Comment: "+U+`\r
|
|
32
|
+
`;var Y=yX.util.createBuffer();$U(Y,Q),tZ(Y,X.e),tZ(Y,X.n);var K=yX.util.encode64(Y.bytes(),64),A=Math.floor(K.length/66)+1;O+="Public-Lines: "+A+`\r
|
|
33
|
+
`,O+=K;var D=yX.util.createBuffer();tZ(D,X.d),tZ(D,X.p),tZ(D,X.q),tZ(D,X.qInv);var C;if(!Z)C=yX.util.encode64(D.bytes(),64);else{var z=D.length()+16-1;z-=z%16;var R=kJ(D.bytes());R.truncate(R.length()-z+D.length()),D.putBuffer(R);var S=yX.util.createBuffer();S.putBuffer(kJ("\x00\x00\x00\x00",Z)),S.putBuffer(kJ("\x00\x00\x00\x01",Z));var P=yX.aes.createEncryptionCipher(S.truncate(8),"CBC");P.start(yX.util.createBuffer().fillWithByte(0,16)),P.update(D.copy()),P.finish();var N=P.output;N.truncate(16),C=yX.util.encode64(N.bytes(),64)}A=Math.floor(C.length/66)+1,O+=`\r
|
|
34
|
+
Private-Lines: `+A+`\r
|
|
35
|
+
`,O+=C;var I=kJ("putty-private-key-file-mac-key",Z),B=yX.util.createBuffer();$U(B,Q),$U(B,G),$U(B,U),B.putInt32(Y.length()),B.putBuffer(Y),B.putInt32(D.length()),B.putBuffer(D);var k=yX.hmac.create();return k.start("sha1",I),k.update(B.bytes()),O+=`\r
|
|
36
|
+
Private-MAC: `+k.digest().toHex()+`\r
|
|
37
|
+
`,O};xJ.publicKeyToOpenSSH=function(X,Z){var U="ssh-rsa";Z=Z||"";var Q=yX.util.createBuffer();return $U(Q,U),tZ(Q,X.e),tZ(Q,X.n),U+" "+yX.util.encode64(Q.bytes())+" "+Z};xJ.privateKeyToOpenSSH=function(X,Z){if(!Z)return yX.pki.privateKeyToPem(X);return yX.pki.encryptRsaPrivateKey(X,Z,{legacy:!0,algorithm:"aes128"})};xJ.getPublicKeyFingerprint=function(X,Z){Z=Z||{};var U=Z.md||yX.md.md5.create(),Q="ssh-rsa",G=yX.util.createBuffer();$U(G,Q),tZ(G,X.e),tZ(G,X.n),U.start(),U.update(G.getBytes());var O=U.digest();if(Z.encoding==="hex"){var Y=O.toHex();if(Z.delimiter)return Y.match(/.{2}/g).join(Z.delimiter);return Y}else if(Z.encoding==="binary")return O.getBytes();else if(Z.encoding)throw Error('Unknown encoding "'+Z.encoding+'".');return O};function tZ(X,Z){var U=Z.toString(16);if(U[0]>="8")U="00"+U;var Q=yX.util.hexToBytes(U);X.putInt32(Q.length),X.putBytes(Q)}function $U(X,Z){X.putInt32(Z.length),X.putString(Z)}function kJ(){var X=yX.md.sha1.create(),Z=arguments.length;for(var U=0;U<Z;++U)X.update(arguments[U]);return X.digest()}});var OO=QX((Eq,WO)=>{WO.exports=GX();VQ();wW();hZ();hU();FU();rW();bQ();eW();ZO();UO();mY();HJ();PQ();hY();sY();$O();aY();cY();kY();MJ();kZ();vY();VO();Q$();DX()});var pQ=zO(OO(),1),aX="https://dnabbs-api.yingxiong.com",rz=`${aX}/user/sdkLogin`,az=`${aX}/config/getRsaPublicKey`,tz=`${aX}/user/login/log`,iz=`${aX}/role/list`,ez=`${aX}/role/defaultRoleForTool`,XD=`${aX}/role/getCharDetail`,ZD=`${aX}/weapon/detail`,QD=`${aX}/role/getShortNoteInfo`,UD=`${aX}/encourage/signin/show`,JD=`${aX}/encourage/signin/signin`,YD=`${aX}/user/signIn`,$D=`${aX}/user/haveSignInNew`,GD=`${aX}/encourage/level/getTaskProcess`,VD=`${aX}/forum/list`,WD=`${aX}/forum/getPostDetail`,OD=`${aX}/forum/like`,HD=`${aX}/encourage/level/shareTask`,FD=`${aX}/forum/comment/createComment`,KD=`${aX}/user/mine`;var TQ=268;class ED{dev_code;uid;token;rsa_public_key;is_h5;constructor(X,Z="",U="",Q="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGpdbezK+eknQZQzPOjp8mr/dP+QHwk8CRkQh6C6qFnfLH3tiyl0pnt3dePuFDnM1PUXGhCkQ157ePJCQgkDU2+mimDmXh0oLFn9zuWSp+U8uLSLX3t3PpJ8TmNCROfUDWvzdbnShqg7JfDmnrOJz49qd234W84nrfTHbzdqeigQIDAQAB",G=!1){this.dev_code=X;this.uid=Z;this.token=U;this.rsa_public_key=Q;this.is_h5=G}async getRsaPublicKey(){if(this.rsa_public_key)return this.rsa_public_key;let X=await this._dna_request(az);if(X.is_success&&X.data){let Z=X.data.key;if(typeof Z==="string")this.rsa_public_key=Z}return this.rsa_public_key}async login(X,Z,U){let Q={mobile:X,code:Z,gameList:TQ},G=await this._dna_request(rz,Q,{sign:!0,refer:!0});if(G.is_success&&G.data){let O=G.data;if(typeof O.userId==="string")this.uid=O.userId;if(typeof O.token==="string")this.token=O.token}return G}async loginLog(){return await this._dna_request(tz)}async getRoleList(){return await this._dna_request(iz)}async getDefaultRoleForTool(){let X={type:1};return await this._dna_request(ez,X,{sign:!0})}async getRoleDetail(X,Z){let U={charId:X,charEid:Z,type:1};return await this._dna_request(XD,U)}async getWeaponDetail(X){let Z={weaponId:X,type:1};return await this._dna_request(ZD,Z)}async getShortNoteInfo(){return await this._dna_request(QD)}async haveSignIn(){let X={gameId:TQ};return await this._dna_request($D,X)}async signCalendar(){let X={gameId:TQ};return await this._dna_request(UD,X)}async gameSign(X,Z){let U={dayAwardId:X,periodId:Z,signinType:1};return await this._dna_request(JD,U)}async bbsSign(){let X={gameId:TQ};return await this._dna_request(YD,X)}async getTaskProcess(){let X={gameId:TQ};return await this._dna_request(GD,X)}async getPostList(){let X={forumId:46,gameId:TQ,pageIndex:1,pageSize:20,searchType:1,timeType:0};return await this._dna_request(VD,X)}async getPostDetail(X){let Z={postId:X};try{return await this._dna_request(WD,Z)}catch(U){return console.error("get_post_detail",U),hQ.err("请求皎皎角服务失败")}}async doLike(X){let Z={forumId:X.gameForumId,gameId:TQ,likeType:"1",operateType:"1",postCommentId:"",postCommentReplyId:"",postId:X.postId,postType:X.postType,toUserId:X.userId};try{return await this._dna_request(OD,Z)}catch(U){return console.error("do_like",U),hQ.err("请求皎皎角服务失败")}}async doShare(){let X={gameId:TQ};try{return await this._dna_request(HD,X)}catch(Z){return console.error("do_share",Z),hQ.err("请求皎皎角服务失败")}}async doReply(X,Z){let U=JSON.stringify([{content:Z,contentType:"1",imgHeight:0,imgWidth:0,url:""}]),Q={postId:X.postId,forumId:X.gameForumId||47,postType:"1",content:U};return await this._dna_request(FD,Q,{sign:!0,refer:!0,params:{toUserId:X.userId}})}async getAnnList(){let X={otherUserId:"709542994134436647",searchType:1,type:2};return await this._dna_request(KD,X)}async getHeaders(X){let{payload:Z,exparams:U,dev_code:Q=this.dev_code,refer:G,token:O=this.token}=X||{},Y="application/x-www-form-urlencoded; charset=utf-8",K={version:"1.1.3",source:"ios","Content-Type":"application/x-www-form-urlencoded; charset=utf-8","User-Agent":"DoubleHelix/4 CFNetwork/3860.100.1 Darwin/25.0.0"},A={version:"3.11.0",source:"h5","Content-Type":"application/x-www-form-urlencoded; charset=utf-8","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"},D={...this.is_h5?A:K};if(Q)D.devCode=Q;if(G)D.origin="https://dnabbs.yingxiong.com",D.refer="https://dnabbs.yingxiong.com/";if(O)D.token=O;if(typeof Z==="object"){let C=RD(Z);if(Object.assign(Z,{sign:C.s,timestamp:C.t}),U)Object.assign(Z,U);let z=new URLSearchParams;Object.entries(Z).forEach(([N,I])=>{z.append(N,String(I))}),Z=z.toString();let R=C.k,S=await this.getRsaPublicKey(),P=DD(R,S);if(this.is_h5)D.k=P;else D.rk=R,D.key=P}return{headers:D,payload:Z}}async _dna_request(X,Z,U){let{method:Q="POST",sign:G,refer:O,params:Y,max_retries:K=3,retry_delay:A=1,timeout:D=1e4}=U||{},C;if(G){let{payload:z,headers:R}=await this.getHeaders({payload:Z,refer:O,exparams:Y});Z=z,C=R}else{let{headers:z}=await this.getHeaders();C=z}for(let z=0;z<K;z++)try{let R={method:Q,headers:C,body:Z},S=new AbortController,P=setTimeout(()=>S.abort(),D),N=await fetch(X,{...R,signal:S.signal});clearTimeout(P);let I=N.headers.get("content-type")||"",B;if(I.includes("text/")){let k=await N.text();B={code:-999,data:k}}else B=await N.json();if(typeof B==="object"&&B!==null)try{if(typeof B.data==="string")B.data=JSON.parse(B.data)}catch(k){}return console.debug(`[DNA] url:[${X}] headers:[${JSON.stringify(C)}] data:[${JSON.stringify(Z)}] raw_res:${JSON.stringify(B)}`),new hQ(B)}catch(R){if(console.error(`请求失败: ${R.message}`),z<K-1)await new Promise((S)=>setTimeout(S,A*Math.pow(2,z)))}return hQ.err("请求服务器失败,已达最大重试次数")}}var HO;((Y)=>{Y.角色="role";Y.武器="weapon";Y.魔之楔="mzx";Y.role="角色";Y.weapon="武器";Y.mzx="魔之楔"})(HO||={});function zq(X){return HO[X]}var zD;((Q)=>{Q[Q.TEXT=1]="TEXT";Q[Q.IMAGE=2]="IMAGE";Q[Q.VIDEO=5]="VIDEO"})(zD||={});class hQ{code=0;msg="";success=!1;data;constructor(X){this.code=X.code||0,this.msg=X.msg||"",this.success=X.success||!1,this.data=X.data}get is_success(){return this.success&&[0,200].includes(this.code)}static err(X,Z=-999){return new hQ({code:Z,msg:X,data:void 0,success:!1})}}function DD(X,Z){try{let U=[];for(let K=0;K<Z.length;K+=64)U.push(Z.slice(K,K+64));let Q=`-----BEGIN PUBLIC KEY-----
|
|
38
|
+
${U.join(`
|
|
39
|
+
`)}
|
|
40
|
+
-----END PUBLIC KEY-----`,G=pQ.pki.publicKeyFromPem(Q),O=pQ.util.encodeUtf8(X),Y=G.encrypt(O);return pQ.util.encode64(Y)}catch(U){throw Error(`[DNA] RSA 加密失败: ${U.message}`)}}function qD(X=16){let U="";for(let Q=0;Q<X;Q++)U+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(Math.random()*62));return U}function MD(X){let Z=pQ.md.md5.create();return Z.update(X),Z.digest().toHex().toUpperCase()}function CD(X){function Z(U,Q){let G=U.split("");for(let O=1;O<Q.length;O+=2){let Y=Q[O-1],K=Q[O];if(Y>=0&&Y<G.length&&K>=0&&K<G.length)[G[Y],G[K]]=[G[K],G[Y]]}return G.join("")}return Z(MD(X),[1,13,5,17,7,23])}function AD(X,Z){let U=[],Q=Object.keys(X).sort();for(let O of Q){let Y=X[O];if(Y!==null&&Y!==void 0&&Y!=="")U.push(`${O}=${Y}`)}let G=U.join("&");return CD(`${G}&${Z}`)}function TD(X,Z){let U=new TextEncoder,Q=U.encode(X),G=U.encode(Z),O=[];for(let Y=0;Y<Q.length;Y++){let A=(Q[Y]&255)+(G[Y%G.length]&255);O.push(`@${A}`)}return O.join("")}function RD(X,Z){let U=Date.now(),Q={...X,timestamp:U,token:Z},G=qD(16),O=AD(Q,G);return{s:TD(O,G),t:U,k:G}}export{zq as getDNAInstanceMHType,zD as PostContentType,ED as DNAAPI};
|
|
41
|
+
|
|
42
|
+
//# debugId=E3A96FFD4A53516064756E2164756E21
|