@stacksjs/tlsx
Version:
A TLS/HTTPS library with automation.
4 lines • 299 kB
JavaScript
import{B as LX,v as xY,w as c,x as A0}from"./chunk-s5xt8spa.js";var o=c((tE,MZ)=>{MZ.exports={options:{usePureJavaScript:!1}}});var PZ=c((eE,DZ)=>{var E0={};DZ.exports=E0;var zZ={};E0.encode=function(J,$,Z){if(typeof $!=="string")throw new TypeError('"alphabet" must be a string.');if(Z!==void 0&&typeof Z!=="number")throw new TypeError('"maxline" must be a number.');var X="";if(!(J instanceof Uint8Array))X=gY(J,$);else{var Q=0,Y=$.length,U=$.charAt(0),G=[0];for(Q=0;Q<J.length;++Q){for(var E=0,W=J[Q];E<G.length;++E)W+=G[E]<<8,G[E]=W%Y,W=W/Y|0;while(W>0)G.push(W%Y),W=W/Y|0}for(Q=0;J[Q]===0&&Q<J.length-1;++Q)X+=U;for(Q=G.length-1;Q>=0;--Q)X+=$[G[Q]]}if(Z){var H=new RegExp(".{1,"+Z+"}","g");X=X.match(H).join(`\r
`)}return X};E0.decode=function(J,$){if(typeof J!=="string")throw new TypeError('"input" must be a string.');if(typeof $!=="string")throw new TypeError('"alphabet" must be a string.');var Z=zZ[$];if(!Z){Z=zZ[$]=[];for(var X=0;X<$.length;++X)Z[$.charCodeAt(X)]=X}J=J.replace(/\s/g,"");var Q=$.length,Y=$.charAt(0),U=[0];for(var X=0;X<J.length;X++){var G=Z[J.charCodeAt(X)];if(G===void 0)return;for(var E=0,W=G;E<U.length;++E)W+=U[E]*Q,U[E]=W&255,W>>=8;while(W>0)U.push(W&255),W>>=8}for(var H=0;J[H]===Y&&H<J.length-1;++H)U.push(0);if(typeof Buffer!=="undefined")return Buffer.from(U.reverse());return new Uint8Array(U.reverse())};function gY(J,$){var Z=0,X=$.length,Q=$.charAt(0),Y=[0];for(Z=0;Z<J.length();++Z){for(var U=0,G=J.at(Z);U<Y.length;++U)G+=Y[U]<<8,Y[U]=G%X,G=G/X|0;while(G>0)Y.push(G%X),G=G/X|0}var E="";for(Z=0;J.at(Z)===0&&Z<J.length()-1;++Z)E+=Q;for(Z=Y.length-1;Z>=0;--Z)E+=$[Y[Z]];return E}});var XJ=c((JH,TZ)=>{var KZ=o(),RZ=PZ(),R=TZ.exports=KZ.util=KZ.util||{};(function(){if(typeof process!=="undefined"&&process.nextTick){if(R.nextTick=process.nextTick,typeof setImmediate==="function")R.setImmediate=setImmediate;else R.setImmediate=R.nextTick;return}if(typeof setImmediate==="function"){R.setImmediate=function(){return setImmediate.apply(void 0,arguments)},R.nextTick=function(G){return setImmediate(G)};return}if(R.setImmediate=function(G){setTimeout(G,0)},typeof window!=="undefined"&&typeof window.postMessage==="function"){let G=function(E){if(E.source===window&&E.data===J){E.stopPropagation();var W=$.slice();$.length=0,W.forEach(function(H){H()})}};var U=G,J="forge.setImmediate",$=[];R.setImmediate=function(E){if($.push(E),$.length===1)window.postMessage(J,"*")},window.addEventListener("message",G,!0)}if(typeof MutationObserver!=="undefined"){var Z=Date.now(),X=!0,Q=document.createElement("div"),$=[];new MutationObserver(function(){var E=$.slice();$.length=0,E.forEach(function(W){W()})}).observe(Q,{attributes:!0});var Y=R.setImmediate;R.setImmediate=function(E){if(Date.now()-Z>15)Z=Date.now(),Y(E);else if($.push(E),$.length===1)Q.setAttribute("a",X=!X)}}R.nextTick=R.setImmediate})();R.isNodejs=typeof process!=="undefined"&&process.versions&&process.versions.node;R.globalScope=function(){if(R.isNodejs)return global;return typeof self==="undefined"?window:self}();R.isArray=Array.isArray||function(J){return Object.prototype.toString.call(J)==="[object Array]"};R.isArrayBuffer=function(J){return typeof ArrayBuffer!=="undefined"&&J instanceof ArrayBuffer};R.isArrayBufferView=function(J){return J&&R.isArrayBuffer(J.buffer)&&J.byteLength!==void 0};function EX(J){if(!(J===8||J===16||J===24||J===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+J)}R.ByteBuffer=H0;function H0(J){if(this.data="",this.read=0,typeof J==="string")this.data=J;else if(R.isArrayBuffer(J)||R.isArrayBufferView(J))if(typeof Buffer!=="undefined"&&J instanceof Buffer)this.data=J.toString("binary");else{var $=new Uint8Array(J);try{this.data=String.fromCharCode.apply(null,$)}catch(X){for(var Z=0;Z<$.length;++Z)this.putByte($[Z])}}else if(J instanceof H0||typeof J==="object"&&typeof J.data==="string"&&typeof J.read==="number")this.data=J.data,this.read=J.read;this._constructedStringLength=0}R.ByteStringBuffer=H0;var lY=4096;R.ByteStringBuffer.prototype._optimizeConstructedString=function(J){if(this._constructedStringLength+=J,this._constructedStringLength>lY)this.data.substr(0,1),this._constructedStringLength=0};R.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};R.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};R.ByteStringBuffer.prototype.putByte=function(J){return this.putBytes(String.fromCharCode(J))};R.ByteStringBuffer.prototype.fillWithByte=function(J,$){J=String.fromCharCode(J);var Z=this.data;while($>0){if($&1)Z+=J;if($>>>=1,$>0)J+=J}return this.data=Z,this._optimizeConstructedString($),this};R.ByteStringBuffer.prototype.putBytes=function(J){return this.data+=J,this._optimizeConstructedString(J.length),this};R.ByteStringBuffer.prototype.putString=function(J){return this.putBytes(R.encodeUtf8(J))};R.ByteStringBuffer.prototype.putInt16=function(J){return this.putBytes(String.fromCharCode(J>>8&255)+String.fromCharCode(J&255))};R.ByteStringBuffer.prototype.putInt24=function(J){return this.putBytes(String.fromCharCode(J>>16&255)+String.fromCharCode(J>>8&255)+String.fromCharCode(J&255))};R.ByteStringBuffer.prototype.putInt32=function(J){return this.putBytes(String.fromCharCode(J>>24&255)+String.fromCharCode(J>>16&255)+String.fromCharCode(J>>8&255)+String.fromCharCode(J&255))};R.ByteStringBuffer.prototype.putInt16Le=function(J){return this.putBytes(String.fromCharCode(J&255)+String.fromCharCode(J>>8&255))};R.ByteStringBuffer.prototype.putInt24Le=function(J){return this.putBytes(String.fromCharCode(J&255)+String.fromCharCode(J>>8&255)+String.fromCharCode(J>>16&255))};R.ByteStringBuffer.prototype.putInt32Le=function(J){return this.putBytes(String.fromCharCode(J&255)+String.fromCharCode(J>>8&255)+String.fromCharCode(J>>16&255)+String.fromCharCode(J>>24&255))};R.ByteStringBuffer.prototype.putInt=function(J,$){EX($);var Z="";do $-=8,Z+=String.fromCharCode(J>>$&255);while($>0);return this.putBytes(Z)};R.ByteStringBuffer.prototype.putSignedInt=function(J,$){if(J<0)J+=2<<$-1;return this.putInt(J,$)};R.ByteStringBuffer.prototype.putBuffer=function(J){return this.putBytes(J.getBytes())};R.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};R.ByteStringBuffer.prototype.getInt16=function(){var J=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,J};R.ByteStringBuffer.prototype.getInt24=function(){var J=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,J};R.ByteStringBuffer.prototype.getInt32=function(){var J=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,J};R.ByteStringBuffer.prototype.getInt16Le=function(){var J=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,J};R.ByteStringBuffer.prototype.getInt24Le=function(){var J=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,J};R.ByteStringBuffer.prototype.getInt32Le=function(){var J=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,J};R.ByteStringBuffer.prototype.getInt=function(J){EX(J);var $=0;do $=($<<8)+this.data.charCodeAt(this.read++),J-=8;while(J>0);return $};R.ByteStringBuffer.prototype.getSignedInt=function(J){var $=this.getInt(J),Z=2<<J-2;if($>=Z)$-=Z<<1;return $};R.ByteStringBuffer.prototype.getBytes=function(J){var $;if(J)J=Math.min(this.length(),J),$=this.data.slice(this.read,this.read+J),this.read+=J;else if(J===0)$="";else $=this.read===0?this.data:this.data.slice(this.read),this.clear();return $};R.ByteStringBuffer.prototype.bytes=function(J){return typeof J==="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+J)};R.ByteStringBuffer.prototype.at=function(J){return this.data.charCodeAt(this.read+J)};R.ByteStringBuffer.prototype.setAt=function(J,$){return this.data=this.data.substr(0,this.read+J)+String.fromCharCode($)+this.data.substr(this.read+J+1),this};R.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};R.ByteStringBuffer.prototype.copy=function(){var J=R.createBuffer(this.data);return J.read=this.read,J};R.ByteStringBuffer.prototype.compact=function(){if(this.read>0)this.data=this.data.slice(this.read),this.read=0;return this};R.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};R.ByteStringBuffer.prototype.truncate=function(J){var $=Math.max(0,this.length()-J);return this.data=this.data.substr(this.read,$),this.read=0,this};R.ByteStringBuffer.prototype.toHex=function(){var J="";for(var $=this.read;$<this.data.length;++$){var Z=this.data.charCodeAt($);if(Z<16)J+="0";J+=Z.toString(16)}return J};R.ByteStringBuffer.prototype.toString=function(){return R.decodeUtf8(this.bytes())};function pY(J,$){$=$||{},this.read=$.readOffset||0,this.growSize=$.growSize||1024;var Z=R.isArrayBuffer(J),X=R.isArrayBufferView(J);if(Z||X){if(Z)this.data=new DataView(J);else this.data=new DataView(J.buffer,J.byteOffset,J.byteLength);this.write="writeOffset"in $?$.writeOffset:this.data.byteLength;return}if(this.data=new DataView(new ArrayBuffer(0)),this.write=0,J!==null&&J!==void 0)this.putBytes(J);if("writeOffset"in $)this.write=$.writeOffset}R.DataBuffer=pY;R.DataBuffer.prototype.length=function(){return this.write-this.read};R.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};R.DataBuffer.prototype.accommodate=function(J,$){if(this.length()>=J)return this;$=Math.max($||this.growSize,J);var Z=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),X=new Uint8Array(this.length()+$);return X.set(Z),this.data=new DataView(X.buffer),this};R.DataBuffer.prototype.putByte=function(J){return this.accommodate(1),this.data.setUint8(this.write++,J),this};R.DataBuffer.prototype.fillWithByte=function(J,$){this.accommodate($);for(var Z=0;Z<$;++Z)this.data.setUint8(J);return this};R.DataBuffer.prototype.putBytes=function(J,$){if(R.isArrayBufferView(J)){var Z=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),X=Z.byteLength-Z.byteOffset;this.accommodate(X);var Q=new Uint8Array(this.data.buffer,this.write);return Q.set(Z),this.write+=X,this}if(R.isArrayBuffer(J)){var Z=new Uint8Array(J);this.accommodate(Z.byteLength);var Q=new Uint8Array(this.data.buffer);return Q.set(Z,this.write),this.write+=Z.byteLength,this}if(J instanceof R.DataBuffer||typeof J==="object"&&typeof J.read==="number"&&typeof J.write==="number"&&R.isArrayBufferView(J.data)){var Z=new Uint8Array(J.data.byteLength,J.read,J.length());this.accommodate(Z.byteLength);var Q=new Uint8Array(J.data.byteLength,this.write);return Q.set(Z),this.write+=Z.byteLength,this}if(J instanceof R.ByteStringBuffer)J=J.data,$="binary";if($=$||"binary",typeof J==="string"){var Y;if($==="hex")return this.accommodate(Math.ceil(J.length/2)),Y=new Uint8Array(this.data.buffer,this.write),this.write+=R.binary.hex.decode(J,Y,this.write),this;if($==="base64")return this.accommodate(Math.ceil(J.length/4)*3),Y=new Uint8Array(this.data.buffer,this.write),this.write+=R.binary.base64.decode(J,Y,this.write),this;if($==="utf8")J=R.encodeUtf8(J),$="binary";if($==="binary"||$==="raw")return this.accommodate(J.length),Y=new Uint8Array(this.data.buffer,this.write),this.write+=R.binary.raw.decode(Y),this;if($==="utf16")return this.accommodate(J.length*2),Y=new Uint16Array(this.data.buffer,this.write),this.write+=R.text.utf16.encode(Y),this;throw new Error("Invalid encoding: "+$)}throw Error("Invalid parameter: "+J)};R.DataBuffer.prototype.putBuffer=function(J){return this.putBytes(J),J.clear(),this};R.DataBuffer.prototype.putString=function(J){return this.putBytes(J,"utf16")};R.DataBuffer.prototype.putInt16=function(J){return this.accommodate(2),this.data.setInt16(this.write,J),this.write+=2,this};R.DataBuffer.prototype.putInt24=function(J){return this.accommodate(3),this.data.setInt16(this.write,J>>8&65535),this.data.setInt8(this.write,J>>16&255),this.write+=3,this};R.DataBuffer.prototype.putInt32=function(J){return this.accommodate(4),this.data.setInt32(this.write,J),this.write+=4,this};R.DataBuffer.prototype.putInt16Le=function(J){return this.accommodate(2),this.data.setInt16(this.write,J,!0),this.write+=2,this};R.DataBuffer.prototype.putInt24Le=function(J){return this.accommodate(3),this.data.setInt8(this.write,J>>16&255),this.data.setInt16(this.write,J>>8&65535,!0),this.write+=3,this};R.DataBuffer.prototype.putInt32Le=function(J){return this.accommodate(4),this.data.setInt32(this.write,J,!0),this.write+=4,this};R.DataBuffer.prototype.putInt=function(J,$){EX($),this.accommodate($/8);do $-=8,this.data.setInt8(this.write++,J>>$&255);while($>0);return this};R.DataBuffer.prototype.putSignedInt=function(J,$){if(EX($),this.accommodate($/8),J<0)J+=2<<$-1;return this.putInt(J,$)};R.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};R.DataBuffer.prototype.getInt16=function(){var J=this.data.getInt16(this.read);return this.read+=2,J};R.DataBuffer.prototype.getInt24=function(){var J=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,J};R.DataBuffer.prototype.getInt32=function(){var J=this.data.getInt32(this.read);return this.read+=4,J};R.DataBuffer.prototype.getInt16Le=function(){var J=this.data.getInt16(this.read,!0);return this.read+=2,J};R.DataBuffer.prototype.getInt24Le=function(){var J=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,J};R.DataBuffer.prototype.getInt32Le=function(){var J=this.data.getInt32(this.read,!0);return this.read+=4,J};R.DataBuffer.prototype.getInt=function(J){EX(J);var $=0;do $=($<<8)+this.data.getInt8(this.read++),J-=8;while(J>0);return $};R.DataBuffer.prototype.getSignedInt=function(J){var $=this.getInt(J),Z=2<<J-2;if($>=Z)$-=Z<<1;return $};R.DataBuffer.prototype.getBytes=function(J){var $;if(J)J=Math.min(this.length(),J),$=this.data.slice(this.read,this.read+J),this.read+=J;else if(J===0)$="";else $=this.read===0?this.data:this.data.slice(this.read),this.clear();return $};R.DataBuffer.prototype.bytes=function(J){return typeof J==="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+J)};R.DataBuffer.prototype.at=function(J){return this.data.getUint8(this.read+J)};R.DataBuffer.prototype.setAt=function(J,$){return this.data.setUint8(J,$),this};R.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};R.DataBuffer.prototype.copy=function(){return new R.DataBuffer(this)};R.DataBuffer.prototype.compact=function(){if(this.read>0){var J=new Uint8Array(this.data.buffer,this.read),$=new Uint8Array(J.byteLength);$.set(J),this.data=new DataView($),this.write-=this.read,this.read=0}return this};R.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};R.DataBuffer.prototype.truncate=function(J){return this.write=Math.max(0,this.length()-J),this.read=Math.min(this.read,this.write),this};R.DataBuffer.prototype.toHex=function(){var J="";for(var $=this.read;$<this.data.byteLength;++$){var Z=this.data.getUint8($);if(Z<16)J+="0";J+=Z.toString(16)}return J};R.DataBuffer.prototype.toString=function(J){var $=new Uint8Array(this.data,this.read,this.length());if(J=J||"utf8",J==="binary"||J==="raw")return R.binary.raw.encode($);if(J==="hex")return R.binary.hex.encode($);if(J==="base64")return R.binary.base64.encode($);if(J==="utf8")return R.text.utf8.decode($);if(J==="utf16")return R.text.utf16.decode($);throw new Error("Invalid encoding: "+J)};R.createBuffer=function(J,$){if($=$||"raw",J!==void 0&&$==="utf8")J=R.encodeUtf8(J);return new R.ByteBuffer(J)};R.fillString=function(J,$){var Z="";while($>0){if($&1)Z+=J;if($>>>=1,$>0)J+=J}return Z};R.xorBytes=function(J,$,Z){var X="",Q="",Y="",U=0,G=0;for(;Z>0;--Z,++U){if(Q=J.charCodeAt(U)^$.charCodeAt(U),G>=10)X+=Y,Y="",G=0;Y+=String.fromCharCode(Q),++G}return X+=Y,X};R.hexToBytes=function(J){var $="",Z=0;if(J.length&!0)Z=1,$+=String.fromCharCode(parseInt(J[0],16));for(;Z<J.length;Z+=2)$+=String.fromCharCode(parseInt(J.substr(Z,2),16));return $};R.bytesToHex=function(J){return R.createBuffer(J).toHex()};R.int32ToBytes=function(J){return String.fromCharCode(J>>24&255)+String.fromCharCode(J>>16&255)+String.fromCharCode(J>>8&255)+String.fromCharCode(J&255)};var C$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",S$=[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],AZ="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";R.encode64=function(J,$){var Z="",X="",Q,Y,U,G=0;while(G<J.length){if(Q=J.charCodeAt(G++),Y=J.charCodeAt(G++),U=J.charCodeAt(G++),Z+=C$.charAt(Q>>2),Z+=C$.charAt((Q&3)<<4|Y>>4),isNaN(Y))Z+="==";else Z+=C$.charAt((Y&15)<<2|U>>6),Z+=isNaN(U)?"=":C$.charAt(U&63);if($&&Z.length>$)X+=Z.substr(0,$)+`\r
`,Z=Z.substr($)}return X+=Z,X};R.decode64=function(J){J=J.replace(/[^A-Za-z0-9\+\/\=]/g,"");var $="",Z,X,Q,Y,U=0;while(U<J.length)if(Z=S$[J.charCodeAt(U++)-43],X=S$[J.charCodeAt(U++)-43],Q=S$[J.charCodeAt(U++)-43],Y=S$[J.charCodeAt(U++)-43],$+=String.fromCharCode(Z<<2|X>>4),Q!==64){if($+=String.fromCharCode((X&15)<<4|Q>>2),Y!==64)$+=String.fromCharCode((Q&3)<<6|Y)}return $};R.encodeUtf8=function(J){return unescape(encodeURIComponent(J))};R.decodeUtf8=function(J){return decodeURIComponent(escape(J))};R.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:RZ.encode,decode:RZ.decode}};R.binary.raw.encode=function(J){return String.fromCharCode.apply(null,J)};R.binary.raw.decode=function(J,$,Z){var X=$;if(!X)X=new Uint8Array(J.length);Z=Z||0;var Q=Z;for(var Y=0;Y<J.length;++Y)X[Q++]=J.charCodeAt(Y);return $?Q-Z:X};R.binary.hex.encode=R.bytesToHex;R.binary.hex.decode=function(J,$,Z){var X=$;if(!X)X=new Uint8Array(Math.ceil(J.length/2));Z=Z||0;var Q=0,Y=Z;if(J.length&1)Q=1,X[Y++]=parseInt(J[0],16);for(;Q<J.length;Q+=2)X[Y++]=parseInt(J.substr(Q,2),16);return $?Y-Z:X};R.binary.base64.encode=function(J,$){var Z="",X="",Q,Y,U,G=0;while(G<J.byteLength){if(Q=J[G++],Y=J[G++],U=J[G++],Z+=C$.charAt(Q>>2),Z+=C$.charAt((Q&3)<<4|Y>>4),isNaN(Y))Z+="==";else Z+=C$.charAt((Y&15)<<2|U>>6),Z+=isNaN(U)?"=":C$.charAt(U&63);if($&&Z.length>$)X+=Z.substr(0,$)+`\r
`,Z=Z.substr($)}return X+=Z,X};R.binary.base64.decode=function(J,$,Z){var X=$;if(!X)X=new Uint8Array(Math.ceil(J.length/4)*3);J=J.replace(/[^A-Za-z0-9\+\/\=]/g,""),Z=Z||0;var Q,Y,U,G,E=0,W=Z;while(E<J.length)if(Q=S$[J.charCodeAt(E++)-43],Y=S$[J.charCodeAt(E++)-43],U=S$[J.charCodeAt(E++)-43],G=S$[J.charCodeAt(E++)-43],X[W++]=Q<<2|Y>>4,U!==64){if(X[W++]=(Y&15)<<4|U>>2,G!==64)X[W++]=(U&3)<<6|G}return $?W-Z:X.subarray(0,W)};R.binary.base58.encode=function(J,$){return R.binary.baseN.encode(J,AZ,$)};R.binary.base58.decode=function(J,$){return R.binary.baseN.decode(J,AZ,$)};R.text={utf8:{},utf16:{}};R.text.utf8.encode=function(J,$,Z){J=R.encodeUtf8(J);var X=$;if(!X)X=new Uint8Array(J.length);Z=Z||0;var Q=Z;for(var Y=0;Y<J.length;++Y)X[Q++]=J.charCodeAt(Y);return $?Q-Z:X};R.text.utf8.decode=function(J){return R.decodeUtf8(String.fromCharCode.apply(null,J))};R.text.utf16.encode=function(J,$,Z){var X=$;if(!X)X=new Uint8Array(J.length*2);var Q=new Uint16Array(X.buffer);Z=Z||0;var Y=Z,U=Z;for(var G=0;G<J.length;++G)Q[U++]=J.charCodeAt(G),Y+=2;return $?Y-Z:X};R.text.utf16.decode=function(J){return String.fromCharCode.apply(null,new Uint16Array(J.buffer))};R.deflate=function(J,$,Z){if($=R.decode64(J.deflate(R.encode64($)).rval),Z){var X=2,Q=$.charCodeAt(1);if(Q&32)X=6;$=$.substring(X,$.length-4)}return $};R.inflate=function(J,$,Z){var X=J.inflate(R.encode64($)).rval;return X===null?null:R.decode64(X)};var O0=function(J,$,Z){if(!J)throw new Error("WebStorage not available.");var X;if(Z===null)X=J.removeItem($);else Z=R.encode64(JSON.stringify(Z)),X=J.setItem($,Z);if(typeof X!=="undefined"&&X.rval!==!0){var Q=new Error(X.error.message);throw Q.id=X.error.id,Q.name=X.error.name,Q}},V0=function(J,$){if(!J)throw new Error("WebStorage not available.");var Z=J.getItem($);if(J.init)if(Z.rval===null){if(Z.error){var X=new Error(Z.error.message);throw X.id=Z.error.id,X.name=Z.error.name,X}Z=null}else Z=Z.rval;if(Z!==null)Z=JSON.parse(R.decode64(Z));return Z},cY=function(J,$,Z,X){var Q=V0(J,$);if(Q===null)Q={};Q[Z]=X,O0(J,$,Q)},nY=function(J,$,Z){var X=V0(J,$);if(X!==null)X=Z in X?X[Z]:null;return X},oY=function(J,$,Z){var X=V0(J,$);if(X!==null&&Z in X){delete X[Z];var Q=!0;for(var Y in X){Q=!1;break}if(Q)X=null;O0(J,$,X)}},aY=function(J,$){O0(J,$,null)},wX=function(J,$,Z){var X=null;if(typeof Z==="undefined")Z=["web","flash"];var Q,Y=!1,U=null;for(var G in Z){Q=Z[G];try{if(Q==="flash"||Q==="both"){if($[0]===null)throw new Error("Flash local storage not available.");X=J.apply(this,$),Y=Q==="flash"}if(Q==="web"||Q==="both")$[0]=localStorage,X=J.apply(this,$),Y=!0}catch(E){U=E}if(Y)break}if(!Y)throw U;return X};R.setItem=function(J,$,Z,X,Q){wX(cY,arguments,Q)};R.getItem=function(J,$,Z,X){return wX(nY,arguments,X)};R.removeItem=function(J,$,Z,X){wX(oY,arguments,X)};R.clearItems=function(J,$,Z){wX(aY,arguments,Z)};R.isEmpty=function(J){for(var $ in J)if(J.hasOwnProperty($))return!1;return!0};R.format=function(J){var $=/%./g,Z,X,Q=0,Y=[],U=0;while(Z=$.exec(J)){if(X=J.substring(U,$.lastIndex-2),X.length>0)Y.push(X);U=$.lastIndex;var G=Z[0][1];switch(G){case"s":case"o":if(Q<arguments.length)Y.push(arguments[Q+++1]);else Y.push("<?>");break;case"%":Y.push("%");break;default:Y.push("<%"+G+"?>")}}return Y.push(J.substring(U)),Y.join("")};R.formatNumber=function(J,$,Z,X){var Q=J,Y=isNaN($=Math.abs($))?2:$,U=Z===void 0?",":Z,G=X===void 0?".":X,E=Q<0?"-":"",W=parseInt(Q=Math.abs(+Q||0).toFixed(Y),10)+"",H=W.length>3?W.length%3:0;return E+(H?W.substr(0,H)+G:"")+W.substr(H).replace(/(\d{3})(?=\d)/g,"$1"+G)+(Y?U+Math.abs(Q-W).toFixed(Y).slice(2):"")};R.formatSize=function(J){if(J>=1073741824)J=R.formatNumber(J/1073741824,2,".","")+" GiB";else if(J>=1048576)J=R.formatNumber(J/1048576,2,".","")+" MiB";else if(J>=1024)J=R.formatNumber(J/1024,0)+" KiB";else J=R.formatNumber(J,0)+" bytes";return J};R.bytesFromIP=function(J){if(J.indexOf(".")!==-1)return R.bytesFromIPv4(J);if(J.indexOf(":")!==-1)return R.bytesFromIPv6(J);return null};R.bytesFromIPv4=function(J){if(J=J.split("."),J.length!==4)return null;var $=R.createBuffer();for(var Z=0;Z<J.length;++Z){var X=parseInt(J[Z],10);if(isNaN(X))return null;$.putByte(X)}return $.getBytes()};R.bytesFromIPv6=function(J){var $=0;J=J.split(":").filter(function(U){if(U.length===0)++$;return!0});var Z=(8-J.length+$)*2,X=R.createBuffer();for(var Q=0;Q<8;++Q){if(!J[Q]||J[Q].length===0){X.fillWithByte(0,Z),Z=0;continue}var Y=R.hexToBytes(J[Q]);if(Y.length<2)X.putByte(0);X.putBytes(Y)}return X.getBytes()};R.bytesToIP=function(J){if(J.length===4)return R.bytesToIPv4(J);if(J.length===16)return R.bytesToIPv6(J);return null};R.bytesToIPv4=function(J){if(J.length!==4)return null;var $=[];for(var Z=0;Z<J.length;++Z)$.push(J.charCodeAt(Z));return $.join(".")};R.bytesToIPv6=function(J){if(J.length!==16)return null;var $=[],Z=[],X=0;for(var Q=0;Q<J.length;Q+=2){var Y=R.bytesToHex(J[Q]+J[Q+1]);while(Y[0]==="0"&&Y!=="0")Y=Y.substr(1);if(Y==="0"){var U=Z[Z.length-1],G=$.length;if(!U||G!==U.end+1)Z.push({start:G,end:G});else if(U.end=G,U.end-U.start>Z[X].end-Z[X].start)X=Z.length-1}$.push(Y)}if(Z.length>0){var E=Z[X];if(E.end-E.start>0){if($.splice(E.start,E.end-E.start+1,""),E.start===0)$.unshift("");if(E.end===7)$.push("")}}return $.join(":")};R.estimateCores=function(J,$){if(typeof J==="function")$=J,J={};if(J=J||{},"cores"in R&&!J.update)return $(null,R.cores);if(typeof navigator!=="undefined"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return R.cores=navigator.hardwareConcurrency,$(null,R.cores);if(typeof Worker==="undefined")return R.cores=1,$(null,R.cores);if(typeof Blob==="undefined")return R.cores=2,$(null,R.cores);var Z=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(U){var G=Date.now(),E=G+4;while(Date.now()<E);self.postMessage({st:G,et:E})})}.toString(),")()"],{type:"application/javascript"}));X([],5,16);function X(U,G,E){if(G===0){var W=Math.floor(U.reduce(function(H,O){return H+O},0)/U.length);return R.cores=Math.max(1,W),URL.revokeObjectURL(Z),$(null,R.cores)}Q(E,function(H,O){U.push(Y(E,O)),X(U,G-1,E)})}function Q(U,G){var E=[],W=[];for(var H=0;H<U;++H){var O=new Worker(Z);O.addEventListener("message",function(M){if(W.push(M.data),W.length===U){for(var P=0;P<U;++P)E[P].terminate();G(null,W)}}),E.push(O)}for(var H=0;H<U;++H)E[H].postMessage(H)}function Y(U,G){var E=[];for(var W=0;W<U;++W){var H=G[W],O=E[W]=[];for(var M=0;M<U;++M){if(W===M)continue;var P=G[M];if(H.st>P.st&&H.st<P.et||P.st>H.st&&P.st<H.et)O.push(M)}}return E.reduce(function(z,A){return Math.max(z,A.length)},0)}}});var IX=c(($H,NZ)=>{var NJ=o();XJ();NZ.exports=NJ.cipher=NJ.cipher||{};NJ.cipher.algorithms=NJ.cipher.algorithms||{};NJ.cipher.createCipher=function(J,$){var Z=J;if(typeof Z==="string"){if(Z=NJ.cipher.getAlgorithm(Z),Z)Z=Z()}if(!Z)throw new Error("Unsupported algorithm: "+J);return new NJ.cipher.BlockCipher({algorithm:Z,key:$,decrypt:!1})};NJ.cipher.createDecipher=function(J,$){var Z=J;if(typeof Z==="string"){if(Z=NJ.cipher.getAlgorithm(Z),Z)Z=Z()}if(!Z)throw new Error("Unsupported algorithm: "+J);return new NJ.cipher.BlockCipher({algorithm:Z,key:$,decrypt:!0})};NJ.cipher.registerAlgorithm=function(J,$){J=J.toUpperCase(),NJ.cipher.algorithms[J]=$};NJ.cipher.getAlgorithm=function(J){if(J=J.toUpperCase(),J in NJ.cipher.algorithms)return NJ.cipher.algorithms[J];return null};var q0=NJ.cipher.BlockCipher=function(J){this.algorithm=J.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=J.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=J.decrypt,this.algorithm.initialize(J)};q0.prototype.start=function(J){J=J||{};var $={};for(var Z in J)$[Z]=J[Z];$.decrypt=this._decrypt,this._finish=!1,this._input=NJ.util.createBuffer(),this.output=J.output||NJ.util.createBuffer(),this.mode.start($)};q0.prototype.update=function(J){if(J)this._input.putBuffer(J);while(!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish);this._input.compact()};q0.prototype.finish=function(J){if(J&&(this.mode.name==="ECB"||this.mode.name==="CBC"))this.mode.pad=function(Z){return J(this.blockSize,Z,!1)},this.mode.unpad=function(Z){return J(this.blockSize,Z,!0)};var $={};if($.decrypt=this._decrypt,$.overflow=this._input.length()%this.blockSize,!this._decrypt&&this.mode.pad){if(!this.mode.pad(this._input,$))return!1}if(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad){if(!this.mode.unpad(this.output,$))return!1}if(this.mode.afterFinish){if(!this.mode.afterFinish(this.output,$))return!1}return!0}});var M0=c((XH,CZ)=>{var CJ=o();XJ();CJ.cipher=CJ.cipher||{};var s=CZ.exports=CJ.cipher.modes=CJ.cipher.modes||{};s.ecb=function(J){J=J||{},this.name="ECB",this.cipher=J.cipher,this.blockSize=J.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};s.ecb.prototype.start=function(J){};s.ecb.prototype.encrypt=function(J,$,Z){if(J.length()<this.blockSize&&!(Z&&J.length()>0))return!0;for(var X=0;X<this._ints;++X)this._inBlock[X]=J.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var X=0;X<this._ints;++X)$.putInt32(this._outBlock[X])};s.ecb.prototype.decrypt=function(J,$,Z){if(J.length()<this.blockSize&&!(Z&&J.length()>0))return!0;for(var X=0;X<this._ints;++X)this._inBlock[X]=J.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var X=0;X<this._ints;++X)$.putInt32(this._outBlock[X])};s.ecb.prototype.pad=function(J,$){var Z=J.length()===this.blockSize?this.blockSize:this.blockSize-J.length();return J.fillWithByte(Z,Z),!0};s.ecb.prototype.unpad=function(J,$){if($.overflow>0)return!1;var Z=J.length(),X=J.at(Z-1);if(X>this.blockSize<<2)return!1;return J.truncate(X),!0};s.cbc=function(J){J=J||{},this.name="CBC",this.cipher=J.cipher,this.blockSize=J.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};s.cbc.prototype.start=function(J){if(J.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if(!("iv"in J))throw new Error("Invalid IV parameter.");else this._iv=BX(J.iv,this.blockSize),this._prev=this._iv.slice(0)};s.cbc.prototype.encrypt=function(J,$,Z){if(J.length()<this.blockSize&&!(Z&&J.length()>0))return!0;for(var X=0;X<this._ints;++X)this._inBlock[X]=this._prev[X]^J.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var X=0;X<this._ints;++X)$.putInt32(this._outBlock[X]);this._prev=this._outBlock};s.cbc.prototype.decrypt=function(J,$,Z){if(J.length()<this.blockSize&&!(Z&&J.length()>0))return!0;for(var X=0;X<this._ints;++X)this._inBlock[X]=J.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var X=0;X<this._ints;++X)$.putInt32(this._prev[X]^this._outBlock[X]);this._prev=this._inBlock.slice(0)};s.cbc.prototype.pad=function(J,$){var Z=J.length()===this.blockSize?this.blockSize:this.blockSize-J.length();return J.fillWithByte(Z,Z),!0};s.cbc.prototype.unpad=function(J,$){if($.overflow>0)return!1;var Z=J.length(),X=J.at(Z-1);if(X>this.blockSize<<2)return!1;return J.truncate(X),!0};s.cfb=function(J){J=J||{},this.name="CFB",this.cipher=J.cipher,this.blockSize=J.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=CJ.util.createBuffer(),this._partialBytes=0};s.cfb.prototype.start=function(J){if(!("iv"in J))throw new Error("Invalid IV parameter.");this._iv=BX(J.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};s.cfb.prototype.encrypt=function(J,$,Z){var X=J.length();if(X===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&X>=this.blockSize){for(var Q=0;Q<this._ints;++Q)this._inBlock[Q]=J.getInt32()^this._outBlock[Q],$.putInt32(this._inBlock[Q]);return}var Y=(this.blockSize-X)%this.blockSize;if(Y>0)Y=this.blockSize-Y;this._partialOutput.clear();for(var Q=0;Q<this._ints;++Q)this._partialBlock[Q]=J.getInt32()^this._outBlock[Q],this._partialOutput.putInt32(this._partialBlock[Q]);if(Y>0)J.read-=this.blockSize;else for(var Q=0;Q<this._ints;++Q)this._inBlock[Q]=this._partialBlock[Q];if(this._partialBytes>0)this._partialOutput.getBytes(this._partialBytes);if(Y>0&&!Z)return $.putBytes(this._partialOutput.getBytes(Y-this._partialBytes)),this._partialBytes=Y,!0;$.putBytes(this._partialOutput.getBytes(X-this._partialBytes)),this._partialBytes=0};s.cfb.prototype.decrypt=function(J,$,Z){var X=J.length();if(X===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&X>=this.blockSize){for(var Q=0;Q<this._ints;++Q)this._inBlock[Q]=J.getInt32(),$.putInt32(this._inBlock[Q]^this._outBlock[Q]);return}var Y=(this.blockSize-X)%this.blockSize;if(Y>0)Y=this.blockSize-Y;this._partialOutput.clear();for(var Q=0;Q<this._ints;++Q)this._partialBlock[Q]=J.getInt32(),this._partialOutput.putInt32(this._partialBlock[Q]^this._outBlock[Q]);if(Y>0)J.read-=this.blockSize;else for(var Q=0;Q<this._ints;++Q)this._inBlock[Q]=this._partialBlock[Q];if(this._partialBytes>0)this._partialOutput.getBytes(this._partialBytes);if(Y>0&&!Z)return $.putBytes(this._partialOutput.getBytes(Y-this._partialBytes)),this._partialBytes=Y,!0;$.putBytes(this._partialOutput.getBytes(X-this._partialBytes)),this._partialBytes=0};s.ofb=function(J){J=J||{},this.name="OFB",this.cipher=J.cipher,this.blockSize=J.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=CJ.util.createBuffer(),this._partialBytes=0};s.ofb.prototype.start=function(J){if(!("iv"in J))throw new Error("Invalid IV parameter.");this._iv=BX(J.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};s.ofb.prototype.encrypt=function(J,$,Z){var X=J.length();if(J.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&X>=this.blockSize){for(var Q=0;Q<this._ints;++Q)$.putInt32(J.getInt32()^this._outBlock[Q]),this._inBlock[Q]=this._outBlock[Q];return}var Y=(this.blockSize-X)%this.blockSize;if(Y>0)Y=this.blockSize-Y;this._partialOutput.clear();for(var Q=0;Q<this._ints;++Q)this._partialOutput.putInt32(J.getInt32()^this._outBlock[Q]);if(Y>0)J.read-=this.blockSize;else for(var Q=0;Q<this._ints;++Q)this._inBlock[Q]=this._outBlock[Q];if(this._partialBytes>0)this._partialOutput.getBytes(this._partialBytes);if(Y>0&&!Z)return $.putBytes(this._partialOutput.getBytes(Y-this._partialBytes)),this._partialBytes=Y,!0;$.putBytes(this._partialOutput.getBytes(X-this._partialBytes)),this._partialBytes=0};s.ofb.prototype.decrypt=s.ofb.prototype.encrypt;s.ctr=function(J){J=J||{},this.name="CTR",this.cipher=J.cipher,this.blockSize=J.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=CJ.util.createBuffer(),this._partialBytes=0};s.ctr.prototype.start=function(J){if(!("iv"in J))throw new Error("Invalid IV parameter.");this._iv=BX(J.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};s.ctr.prototype.encrypt=function(J,$,Z){var X=J.length();if(X===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&X>=this.blockSize)for(var Q=0;Q<this._ints;++Q)$.putInt32(J.getInt32()^this._outBlock[Q]);else{var Y=(this.blockSize-X)%this.blockSize;if(Y>0)Y=this.blockSize-Y;this._partialOutput.clear();for(var Q=0;Q<this._ints;++Q)this._partialOutput.putInt32(J.getInt32()^this._outBlock[Q]);if(Y>0)J.read-=this.blockSize;if(this._partialBytes>0)this._partialOutput.getBytes(this._partialBytes);if(Y>0&&!Z)return $.putBytes(this._partialOutput.getBytes(Y-this._partialBytes)),this._partialBytes=Y,!0;$.putBytes(this._partialOutput.getBytes(X-this._partialBytes)),this._partialBytes=0}jX(this._inBlock)};s.ctr.prototype.decrypt=s.ctr.prototype.encrypt;s.gcm=function(J){J=J||{},this.name="GCM",this.cipher=J.cipher,this.blockSize=J.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=CJ.util.createBuffer(),this._partialBytes=0,this._R=3774873600};s.gcm.prototype.start=function(J){if(!("iv"in J))throw new Error("Invalid IV parameter.");var $=CJ.util.createBuffer(J.iv);this._cipherLength=0;var Z;if("additionalData"in J)Z=CJ.util.createBuffer(J.additionalData);else Z=CJ.util.createBuffer();if("tagLength"in J)this._tagLength=J.tagLength;else this._tagLength=128;if(this._tag=null,J.decrypt){if(this._tag=CJ.util.createBuffer(J.tag).getBytes(),this._tag.length!==this._tagLength/8)throw new Error("Authentication tag does not match tag length.")}this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var X=$.length();if(X===12)this._j0=[$.getInt32(),$.getInt32(),$.getInt32(),1];else{this._j0=[0,0,0,0];while($.length()>0)this._j0=this.ghash(this._hashSubkey,this._j0,[$.getInt32(),$.getInt32(),$.getInt32(),$.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(F0(X*8)))}this._inBlock=this._j0.slice(0),jX(this._inBlock),this._partialBytes=0,Z=CJ.util.createBuffer(Z),this._aDataLength=F0(Z.length()*8);var Q=Z.length()%this.blockSize;if(Q)Z.fillWithByte(0,this.blockSize-Q);this._s=[0,0,0,0];while(Z.length()>0)this._s=this.ghash(this._hashSubkey,this._s,[Z.getInt32(),Z.getInt32(),Z.getInt32(),Z.getInt32()])};s.gcm.prototype.encrypt=function(J,$,Z){var X=J.length();if(X===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&X>=this.blockSize){for(var Q=0;Q<this._ints;++Q)$.putInt32(this._outBlock[Q]^=J.getInt32());this._cipherLength+=this.blockSize}else{var Y=(this.blockSize-X)%this.blockSize;if(Y>0)Y=this.blockSize-Y;this._partialOutput.clear();for(var Q=0;Q<this._ints;++Q)this._partialOutput.putInt32(J.getInt32()^this._outBlock[Q]);if(Y<=0||Z){if(Z){var U=X%this.blockSize;this._cipherLength+=U,this._partialOutput.truncate(this.blockSize-U)}else this._cipherLength+=this.blockSize;for(var Q=0;Q<this._ints;++Q)this._outBlock[Q]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0)this._partialOutput.getBytes(this._partialBytes);if(Y>0&&!Z)return J.read-=this.blockSize,$.putBytes(this._partialOutput.getBytes(Y-this._partialBytes)),this._partialBytes=Y,!0;$.putBytes(this._partialOutput.getBytes(X-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),jX(this._inBlock)};s.gcm.prototype.decrypt=function(J,$,Z){var X=J.length();if(X<this.blockSize&&!(Z&&X>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),jX(this._inBlock),this._hashBlock[0]=J.getInt32(),this._hashBlock[1]=J.getInt32(),this._hashBlock[2]=J.getInt32(),this._hashBlock[3]=J.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var Q=0;Q<this._ints;++Q)$.putInt32(this._outBlock[Q]^this._hashBlock[Q]);if(X<this.blockSize)this._cipherLength+=X%this.blockSize;else this._cipherLength+=this.blockSize};s.gcm.prototype.afterFinish=function(J,$){var Z=!0;if($.decrypt&&$.overflow)J.truncate(this.blockSize-$.overflow);this.tag=CJ.util.createBuffer();var X=this._aDataLength.concat(F0(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,X);var Q=[];this.cipher.encrypt(this._j0,Q);for(var Y=0;Y<this._ints;++Y)this.tag.putInt32(this._s[Y]^Q[Y]);if(this.tag.truncate(this.tag.length()%(this._tagLength/8)),$.decrypt&&this.tag.bytes()!==this._tag)Z=!1;return Z};s.gcm.prototype.multiply=function(J,$){var Z=[0,0,0,0],X=$.slice(0);for(var Q=0;Q<128;++Q){var Y=J[Q/32|0]&1<<31-Q%32;if(Y)Z[0]^=X[0],Z[1]^=X[1],Z[2]^=X[2],Z[3]^=X[3];this.pow(X,X)}return Z};s.gcm.prototype.pow=function(J,$){var Z=J[3]&1;for(var X=3;X>0;--X)$[X]=J[X]>>>1|(J[X-1]&1)<<31;if($[0]=J[0]>>>1,Z)$[0]^=this._R};s.gcm.prototype.tableMultiply=function(J){var $=[0,0,0,0];for(var Z=0;Z<32;++Z){var X=Z/8|0,Q=J[X]>>>(7-Z%8)*4&15,Y=this._m[Z][Q];$[0]^=Y[0],$[1]^=Y[1],$[2]^=Y[2],$[3]^=Y[3]}return $};s.gcm.prototype.ghash=function(J,$,Z){return $[0]^=Z[0],$[1]^=Z[1],$[2]^=Z[2],$[3]^=Z[3],this.tableMultiply($)};s.gcm.prototype.generateHashTable=function(J,$){var Z=8/$,X=4*Z,Q=16*Z,Y=new Array(Q);for(var U=0;U<Q;++U){var G=[0,0,0,0],E=U/X|0,W=(X-1-U%X)*$;G[E]=1<<$-1<<W,Y[U]=this.generateSubHashTable(this.multiply(G,J),$)}return Y};s.gcm.prototype.generateSubHashTable=function(J,$){var Z=1<<$,X=Z>>>1,Q=new Array(Z);Q[X]=J.slice(0);var Y=X>>>1;while(Y>0)this.pow(Q[2*Y],Q[Y]=[]),Y>>=1;Y=2;while(Y<X){for(var U=1;U<Y;++U){var G=Q[Y],E=Q[U];Q[Y+U]=[G[0]^E[0],G[1]^E[1],G[2]^E[2],G[3]^E[3]]}Y*=2}Q[0]=[0,0,0,0];for(Y=X+1;Y<Z;++Y){var W=Q[Y^X];Q[Y]=[J[0]^W[0],J[1]^W[1],J[2]^W[2],J[3]^W[3]]}return Q};function BX(J,$){if(typeof J==="string")J=CJ.util.createBuffer(J);if(CJ.util.isArray(J)&&J.length>4){var Z=J;J=CJ.util.createBuffer();for(var X=0;X<Z.length;++X)J.putByte(Z[X])}if(J.length()<$)throw new Error("Invalid IV length; got "+J.length()+" bytes and expected "+$+" bytes.");if(!CJ.util.isArray(J)){var Q=[],Y=$/4;for(var X=0;X<Y;++X)Q.push(J.getInt32());J=Q}return J}function jX(J){J[J.length-1]=J[J.length-1]+1&4294967295}function F0(J){return[J/4294967296|0,J&4294967295]}});var L$=c((ZH,IZ)=>{var HJ=o();IX();M0();XJ();IZ.exports=HJ.aes=HJ.aes||{};HJ.aes.startEncrypting=function(J,$,Z,X){var Q=xX({key:J,output:Z,decrypt:!1,mode:X});return Q.start($),Q};HJ.aes.createEncryptionCipher=function(J,$){return xX({key:J,output:null,decrypt:!1,mode:$})};HJ.aes.startDecrypting=function(J,$,Z,X){var Q=xX({key:J,output:Z,decrypt:!0,mode:X});return Q.start($),Q};HJ.aes.createDecryptionCipher=function(J,$){return xX({key:J,output:null,decrypt:!0,mode:$})};HJ.aes.Algorithm=function(J,$){if(!P0)LZ();var Z=this;Z.name=J,Z.mode=new $({blockSize:16,cipher:{encrypt:function(X,Q){return D0(Z._w,X,Q,!1)},decrypt:function(X,Q){return D0(Z._w,X,Q,!0)}}}),Z._init=!1};HJ.aes.Algorithm.prototype.initialize=function(J){if(this._init)return;var $=J.key,Z;if(typeof $==="string"&&($.length===16||$.length===24||$.length===32))$=HJ.util.createBuffer($);else if(HJ.util.isArray($)&&($.length===16||$.length===24||$.length===32)){Z=$,$=HJ.util.createBuffer();for(var X=0;X<Z.length;++X)$.putByte(Z[X])}if(!HJ.util.isArray($)){Z=$,$=[];var Q=Z.length();if(Q===16||Q===24||Q===32){Q=Q>>>2;for(var X=0;X<Q;++X)$.push(Z.getInt32())}}if(!HJ.util.isArray($)||!($.length===4||$.length===6||$.length===8))throw new Error("Invalid key parameter.");var Y=this.mode.name,U=["CFB","OFB","CTR","GCM"].indexOf(Y)!==-1;this._w=wZ($,J.decrypt&&!U),this._init=!0};HJ.aes._expandKey=function(J,$){if(!P0)LZ();return wZ(J,$)};HJ.aes._updateBlock=D0;a$("AES-ECB",HJ.cipher.modes.ecb);a$("AES-CBC",HJ.cipher.modes.cbc);a$("AES-CFB",HJ.cipher.modes.cfb);a$("AES-OFB",HJ.cipher.modes.ofb);a$("AES-CTR",HJ.cipher.modes.ctr);a$("AES-GCM",HJ.cipher.modes.gcm);function a$(J,$){var Z=function(){return new HJ.aes.Algorithm(J,$)};HJ.cipher.registerAlgorithm(J,Z)}var P0=!1,o$=4,cJ,z0,SZ,h$,U$;function LZ(){P0=!0,SZ=[0,1,2,4,8,16,32,64,128,27,54];var J=new Array(256);for(var $=0;$<128;++$)J[$]=$<<1,J[$+128]=$+128<<1^283;cJ=new Array(256),z0=new Array(256),h$=new Array(4),U$=new Array(4);for(var $=0;$<4;++$)h$[$]=new Array(256),U$[$]=new Array(256);var Z=0,X=0,Q,Y,U,G,E,W,H;for(var $=0;$<256;++$){G=X^X<<1^X<<2^X<<3^X<<4,G=G>>8^G&255^99,cJ[Z]=G,z0[G]=Z,E=J[G],Q=J[Z],Y=J[Q],U=J[Y],W=E<<24^G<<16^G<<8^(G^E),H=(Q^Y^U)<<24^(Z^U)<<16^(Z^Y^U)<<8^(Z^Q^U);for(var O=0;O<4;++O)h$[O][Z]=W,U$[O][G]=H,W=W<<24|W>>>8,H=H<<24|H>>>8;if(Z===0)Z=X=1;else Z=Q^J[J[J[Q^U]]],X^=J[J[X]]}}function wZ(J,$){var Z=J.slice(0),X,Q=1,Y=Z.length,U=Y+6+1,G=o$*U;for(var E=Y;E<G;++E){if(X=Z[E-1],E%Y===0)X=cJ[X>>>16&255]<<24^cJ[X>>>8&255]<<16^cJ[X&255]<<8^cJ[X>>>24]^SZ[Q]<<24,Q++;else if(Y>6&&E%Y===4)X=cJ[X>>>24]<<24^cJ[X>>>16&255]<<16^cJ[X>>>8&255]<<8^cJ[X&255];Z[E]=Z[E-Y]^X}if($){var W,H=U$[0],O=U$[1],M=U$[2],P=U$[3],z=Z.slice(0);G=Z.length;for(var E=0,A=G-o$;E<G;E+=o$,A-=o$)if(E===0||E===G-o$)z[E]=Z[A],z[E+1]=Z[A+3],z[E+2]=Z[A+2],z[E+3]=Z[A+1];else for(var T=0;T<o$;++T)W=Z[A+T],z[E+(3&-T)]=H[cJ[W>>>24]]^O[cJ[W>>>16&255]]^M[cJ[W>>>8&255]]^P[cJ[W&255]];Z=z}return Z}function D0(J,$,Z,X){var Q=J.length/4-1,Y,U,G,E,W;if(X)Y=U$[0],U=U$[1],G=U$[2],E=U$[3],W=z0;else Y=h$[0],U=h$[1],G=h$[2],E=h$[3],W=cJ;var H,O,M,P,z,A,T;H=$[0]^J[0],O=$[X?3:1]^J[1],M=$[2]^J[2],P=$[X?1:3]^J[3];var C=3;for(var L=1;L<Q;++L)z=Y[H>>>24]^U[O>>>16&255]^G[M>>>8&255]^E[P&255]^J[++C],A=Y[O>>>24]^U[M>>>16&255]^G[P>>>8&255]^E[H&255]^J[++C],T=Y[M>>>24]^U[P>>>16&255]^G[H>>>8&255]^E[O&255]^J[++C],P=Y[P>>>24]^U[H>>>16&255]^G[O>>>8&255]^E[M&255]^J[++C],H=z,O=A,M=T;Z[0]=W[H>>>24]<<24^W[O>>>16&255]<<16^W[M>>>8&255]<<8^W[P&255]^J[++C],Z[X?3:1]=W[O>>>24]<<24^W[M>>>16&255]<<16^W[P>>>8&255]<<8^W[H&255]^J[++C],Z[2]=W[M>>>24]<<24^W[P>>>16&255]<<16^W[H>>>8&255]<<8^W[O&255]^J[++C],Z[X?1:3]=W[P>>>24]<<24^W[H>>>16&255]<<16^W[O>>>8&255]<<8^W[M&255]^J[++C]}function xX(J){J=J||{};var $=(J.mode||"CBC").toUpperCase(),Z="AES-"+$,X;if(J.decrypt)X=HJ.cipher.createDecipher(Z,J.key);else X=HJ.cipher.createCipher(Z,J.key);var Q=X.start;return X.start=function(Y,U){var G=null;if(U instanceof HJ.util.ByteBuffer)G=U,U={};U=U||{},U.output=G,U.iv=Y,Q.call(X,U)},X}});var w$=c((QH,BZ)=>{var HX=o();HX.pki=HX.pki||{};var K0=BZ.exports=HX.pki.oids=HX.oids=HX.oids||{};function j(J,$){K0[J]=$,K0[$]=J}function QJ(J,$){K0[J]=$}j("1.2.840.113549.1.1.1","rsaEncryption");j("1.2.840.113549.1.1.4","md5WithRSAEncryption");j("1.2.840.113549.1.1.5","sha1WithRSAEncryption");j("1.2.840.113549.1.1.7","RSAES-OAEP");j("1.2.840.113549.1.1.8","mgf1");j("1.2.840.113549.1.1.9","pSpecified");j("1.2.840.113549.1.1.10","RSASSA-PSS");j("1.2.840.113549.1.1.11","sha256WithRSAEncryption");j("1.2.840.113549.1.1.12","sha384WithRSAEncryption");j("1.2.840.113549.1.1.13","sha512WithRSAEncryption");j("1.3.101.112","EdDSA25519");j("1.2.840.10040.4.3","dsa-with-sha1");j("1.3.14.3.2.7","desCBC");j("1.3.14.3.2.26","sha1");j("1.3.14.3.2.29","sha1WithRSASignature");j("2.16.840.1.101.3.4.2.1","sha256");j("2.16.840.1.101.3.4.2.2","sha384");j("2.16.840.1.101.3.4.2.3","sha512");j("2.16.840.1.101.3.4.2.4","sha224");j("2.16.840.1.101.3.4.2.5","sha512-224");j("2.16.840.1.101.3.4.2.6","sha512-256");j("1.2.840.113549.2.2","md2");j("1.2.840.113549.2.5","md5");j("1.2.840.113549.1.7.1","data");j("1.2.840.113549.1.7.2","signedData");j("1.2.840.113549.1.7.3","envelopedData");j("1.2.840.113549.1.7.4","signedAndEnvelopedData");j("1.2.840.113549.1.7.5","digestedData");j("1.2.840.113549.1.7.6","encryptedData");j("1.2.840.113549.1.9.1","emailAddress");j("1.2.840.113549.1.9.2","unstructuredName");j("1.2.840.113549.1.9.3","contentType");j("1.2.840.113549.1.9.4","messageDigest");j("1.2.840.113549.1.9.5","signingTime");j("1.2.840.113549.1.9.6","counterSignature");j("1.2.840.113549.1.9.7","challengePassword");j("1.2.840.113549.1.9.8","unstructuredAddress");j("1.2.840.113549.1.9.14","extensionRequest");j("1.2.840.113549.1.9.20","friendlyName");j("1.2.840.113549.1.9.21","localKeyId");j("1.2.840.113549.1.9.22.1","x509Certificate");j("1.2.840.113549.1.12.10.1.1","keyBag");j("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");j("1.2.840.113549.1.12.10.1.3","certBag");j("1.2.840.113549.1.12.10.1.4","crlBag");j("1.2.840.113549.1.12.10.1.5","secretBag");j("1.2.840.113549.1.12.10.1.6","safeContentsBag");j("1.2.840.113549.1.5.13","pkcs5PBES2");j("1.2.840.113549.1.5.12","pkcs5PBKDF2");j("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");j("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");j("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");j("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");j("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");j("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");j("1.2.840.113549.2.7","hmacWithSHA1");j("1.2.840.113549.2.8","hmacWithSHA224");j("1.2.840.113549.2.9","hmacWithSHA256");j("1.2.840.113549.2.10","hmacWithSHA384");j("1.2.840.113549.2.11","hmacWithSHA512");j("1.2.840.113549.3.7","des-EDE3-CBC");j("2.16.840.1.101.3.4.1.2","aes128-CBC");j("2.16.840.1.101.3.4.1.22","aes192-CBC");j("2.16.840.1.101.3.4.1.42","aes256-CBC");j("2.5.4.3","commonName");j("2.5.4.4","surname");j("2.5.4.5","serialNumber");j("2.5.4.6","countryName");j("2.5.4.7","localityName");j("2.5.4.8","stateOrProvinceName");j("2.5.4.9","streetAddress");j("2.5.4.10","organizationName");j("2.5.4.11","organizationalUnitName");j("2.5.4.12","title");j("2.5.4.13","description");j("2.5.4.15","businessCategory");j("2.5.4.17","postalCode");j("2.5.4.42","givenName");j("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");j("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");j("2.16.840.1.113730.1.1","nsCertType");j("2.16.840.1.113730.1.13","nsComment");QJ("2.5.29.1","authorityKeyIdentifier");QJ("2.5.29.2","keyAttributes");QJ("2.5.29.3","certificatePolicies");QJ("2.5.29.4","keyUsageRestriction");QJ("2.5.29.5","policyMapping");QJ("2.5.29.6","subtreesConstraint");QJ("2.5.29.7","subjectAltName");QJ("2.5.29.8","issuerAltName");QJ("2.5.29.9","subjectDirectoryAttributes");QJ("2.5.29.10","basicConstraints");QJ("2.5.29.11","nameConstraints");QJ("2.5.29.12","policyConstraints");QJ("2.5.29.13","basicConstraints");j("2.5.29.14","subjectKeyIdentifier");j("2.5.29.15","keyUsage");QJ("2.5.29.16","privateKeyUsagePeriod");j("2.5.29.17","subjectAltName");j("2.5.29.18","issuerAltName");j("2.5.29.19","basicConstraints");QJ("2.5.29.20","cRLNumber");QJ("2.5.29.21","cRLReason");QJ("2.5.29.22","expirationDate");QJ("2.5.29.23","instructionCode");QJ("2.5.29.24","invalidityDate");QJ("2.5.29.25","cRLDistributionPoints");QJ("2.5.29.26","issuingDistributionPoint");QJ("2.5.29.27","deltaCRLIndicator");QJ("2.5.29.28","issuingDistributionPoint");QJ("2.5.29.29","certificateIssuer");QJ("2.5.29.30","nameConstraints");j("2.5.29.31","cRLDistributionPoints");j("2.5.29.32","certificatePolicies");QJ("2.5.29.33","policyMappings");QJ("2.5.29.34","policyConstraints");j("2.5.29.35","authorityKeyIdentifier");QJ("2.5.29.36","policyConstraints");j("2.5.29.37","extKeyUsage");QJ("2.5.29.46","freshestCRL");QJ("2.5.29.54","inhibitAnyPolicy");j("1.3.6.1.4.1.11129.2.4.2","timestampList");j("1.3.6.1.5.5.7.1.1","authorityInfoAccess");j("1.3.6.1.5.5.7.3.1","serverAuth");j("1.3.6.1.5.5.7.3.2","clientAuth");j("1.3.6.1.5.5.7.3.3","codeSigning");j("1.3.6.1.5.5.7.3.4","emailProtection");j("1.3.6.1.5.5.7.3.8","timeStamping")});var G$=c((YH,xZ)=>{var qJ=o();XJ();w$();var _=xZ.exports=qJ.asn1=qJ.asn1||{};_.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};_.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};_.create=function(J,$,Z,X,Q){if(qJ.util.isArray(X)){var Y=[];for(var U=0;U<X.length;++U)if(X[U]!==void 0)Y.push(X[U]);X=Y}var G={tagClass:J,type:$,constructed:Z,composed:Z||qJ.util.isArray(X),value:X};if(Q&&"bitStringContents"in Q)G.bitStringContents=Q.bitStringContents,G.original=_.copy(G);return G};_.copy=function(J,$){var Z;if(qJ.util.isArray(J)){Z=[];for(var X=0;X<J.length;++X)Z.push(_.copy(J[X],$));return Z}if(typeof J==="string")return J;if(Z={tagClass:J.tagClass,type:J.type,constructed:J.constructed,composed:J.composed,value:_.copy(J.value,$)},$&&!$.excludeBitStringContents)Z.bitStringContents=J.bitStringContents;return Z};_.equals=function(J