@protontech/openpgp 5.11.0 → 5.11.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.
- package/README.md +3 -3
- package/dist/lightweight/argon2id.min.mjs +1 -1
- package/dist/lightweight/argon2id.mjs +1 -1
- package/dist/lightweight/bn.interface.min.mjs +1 -1
- package/dist/lightweight/bn.interface.mjs +1 -1
- package/dist/lightweight/bn.min.mjs +1 -1
- package/dist/lightweight/bn.mjs +1 -1
- package/dist/lightweight/elliptic.min.mjs +1 -1
- package/dist/lightweight/elliptic.mjs +1 -1
- package/dist/lightweight/openpgp.min.mjs +2 -2
- package/dist/lightweight/openpgp.min.mjs.map +1 -1
- package/dist/lightweight/openpgp.mjs +13 -9
- package/dist/lightweight/ponyfill.es6.min.mjs +1 -1
- package/dist/lightweight/ponyfill.es6.mjs +1 -1
- package/dist/lightweight/web-streams-adapter.min.mjs +1 -1
- package/dist/lightweight/web-streams-adapter.mjs +1 -1
- package/dist/node/openpgp.js +14 -8
- package/dist/node/openpgp.min.js +3 -3
- package/dist/node/openpgp.min.js.map +1 -1
- package/dist/node/openpgp.min.mjs +3 -3
- package/dist/node/openpgp.min.mjs.map +1 -1
- package/dist/node/openpgp.mjs +13 -9
- package/dist/openpgp.js +14 -8
- package/dist/openpgp.min.js +3 -3
- package/dist/openpgp.min.js.map +1 -1
- package/dist/openpgp.min.mjs +3 -3
- package/dist/openpgp.min.mjs.map +1 -1
- package/dist/openpgp.mjs +13 -9
- package/openpgp.d.ts +7 -0
- package/package.json +1 -1
package/dist/openpgp.min.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! OpenPGP.js v5.11.
|
|
2
|
-
const e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Symbol("doneWritingPromise"),r=Symbol("doneWritingResolve"),i=Symbol("doneWritingReject"),n=Symbol("readingIndex");class a extends Array{constructor(){super(),this[t]=new Promise(((e,t)=>{this[r]=e,this[i]=t})),this[t].catch((()=>{}))}}function s(e){return e&&e.getReader&&Array.isArray(e)}function o(e){if(!s(e)){const t=e.getWriter(),r=t.releaseLock;return t.releaseLock=()=>{t.closed.catch((function(){})),r.call(t)},t}this.stream=e}a.prototype.getReader=function(){return void 0===this[n]&&(this[n]=0),{read:async()=>(await this[t],this[n]===this.length?{value:void 0,done:!0}:{value:this[this[n]++],done:!1})}},a.prototype.readToEnd=async function(e){await this[t];const r=e(this.slice(this[n]));return this.length=0,r},a.prototype.clone=function(){const e=new a;return e[t]=this[t].then((()=>{e.push(...this)})),e},o.prototype.write=async function(e){this.stream.push(e)},o.prototype.close=async function(){this.stream[r]()},o.prototype.abort=async function(e){return this.stream[i](e),e},o.prototype.releaseLock=function(){};const c="object"==typeof e.process&&"object"==typeof e.process.versions,u=c&&void 0;function h(t){return s(t)?"array":e.ReadableStream&&e.ReadableStream.prototype.isPrototypeOf(t)?"web":_&&_.prototype.isPrototypeOf(t)?"ponyfill":u&&u.prototype.isPrototypeOf(t)?"node":!(!t||!t.getReader)&&"web-like"}function f(e){return Uint8Array.prototype.isPrototypeOf(e)}function d(e){if(1===e.length)return e[0];let t=0;for(let r=0;r<e.length;r++){if(!f(e[r]))throw Error("concatUint8Array: Data must be in the form of a Uint8Array");t+=e[r].length}const r=new Uint8Array(t);let i=0;return e.forEach((function(e){r.set(e,i),i+=e.length})),r}const l=c&&void 0,p=c&&void 0;let y,g;if(p){y=function(e){let t=!1;return new _({start(r){e.pause(),e.on("data",(i=>{t||(l.isBuffer(i)&&(i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),r.enqueue(i),e.pause())})),e.on("end",(()=>{t||r.close()})),e.on("error",(e=>r.error(e)))},pull(){e.resume()},cancel(r){t=!0,e.destroy(r)}})};class e extends p{constructor(e,t){super(t),this._reader=M(e)}async _read(e){try{for(;;){const{done:e,value:t}=await this._reader.read();if(e){this.push(null);break}if(!this.push(t))break}}catch(e){this.destroy(e)}}async _destroy(e,t){this._reader.cancel(e).then(t,t)}}g=function(t,r){return new e(t,r)}}const b=new WeakSet,m=Symbol("externalBuffer");function w(e){if(this.stream=e,e[m]&&(this[m]=e[m].slice()),s(e)){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{},void(this._cancel=async()=>{})}let t=h(e);if("node"===t&&(e=y(e)),t){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{t.closed.catch((function(){})),t.releaseLock()},void(this._cancel=t.cancel.bind(t))}let r=!1;this._read=async()=>r||b.has(e)?{value:void 0,done:!0}:(r=!0,{value:e,done:!1}),this._releaseLock=()=>{if(r)try{b.add(e)}catch(e){}}}w.prototype.read=async function(){if(this[m]&&this[m].length){return{done:!1,value:this[m].shift()}}return this._read()},w.prototype.releaseLock=function(){this[m]&&(this.stream[m]=this[m]),this._releaseLock()},w.prototype.cancel=function(e){return this._cancel(e)},w.prototype.readLine=async function(){let e,t=[];for(;!e;){let{done:r,value:i}=await this.read();if(i+="",r)return t.length?P(t):void 0;const n=i.indexOf("\n")+1;n&&(e=P(t.concat(i.substr(0,n))),t=[]),n!==i.length&&t.push(i.substr(n))}return this.unshift(...t),e},w.prototype.readByte=async function(){const{done:e,value:t}=await this.read();if(e)return;const r=t[0];return this.unshift(N(t,1)),r},w.prototype.readBytes=async function(e){const t=[];let r=0;for(;;){const{done:i,value:n}=await this.read();if(i)return t.length?P(t):void 0;if(t.push(n),r+=n.length,r>=e){const r=P(t);return this.unshift(N(r,e)),N(r,0,e)}}},w.prototype.peekBytes=async function(e){const t=await this.readBytes(e);return this.unshift(t),t},w.prototype.unshift=function(...e){this[m]||(this[m]=[]),1===e.length&&f(e[0])&&this[m].length&&e[0].length&&this[m][0].byteOffset>=e[0].length?this[m][0]=new Uint8Array(this[m][0].buffer,this[m][0].byteOffset-e[0].length,this[m][0].byteLength+e[0].length):this[m].unshift(...e.filter((e=>e&&e.length)))},w.prototype.readToEnd=async function(e=P){const t=[];for(;;){const{done:e,value:r}=await this.read();if(e)break;t.push(r)}return e(t)};let A,v,{ReadableStream:_,WritableStream:k,TransformStream:E}=e;async function S(){if(E)return;const[t,r]=await Promise.all([Promise.resolve().then((function(){return ey})),Promise.resolve().then((function(){return vy}))]);({ReadableStream:_,WritableStream:k,TransformStream:E}=t);const{createReadableStreamWrapper:i}=r;e.ReadableStream&&_!==e.ReadableStream&&(A=i(_),v=i(e.ReadableStream))}const C=c&&void 0;function I(e){let t=h(e);return"node"===t?y(e):"web"===t&&A?A(e):t?e:new _({start(t){t.enqueue(e),t.close()}})}function B(e){if(h(e))return e;const t=new a;return(async()=>{const r=D(t);await r.write(e),await r.close()})(),t}function P(e){return e.some((e=>h(e)&&!s(e)))?function(e){e=e.map(I);const t=U((async function(e){await Promise.all(i.map((t=>O(t,e))))}));let r=Promise.resolve();const i=e.map(((i,n)=>T(i,((i,a)=>(r=r.then((()=>x(i,t.writable,{preventClose:n!==e.length-1}))),r)))));return t.readable}(e):e.some((e=>s(e)))?function(e){const t=new a;let r=Promise.resolve();return e.forEach(((i,n)=>(r=r.then((()=>x(i,t,{preventClose:n!==e.length-1}))),r))),t}(e):"string"==typeof e[0]?e.join(""):C&&C.isBuffer(e[0])?C.concat(e):d(e)}function M(e){return new w(e)}function D(e){return new o(e)}async function x(e,t,{preventClose:r=!1,preventAbort:i=!1,preventCancel:n=!1}={}){if(h(e)&&!s(e)){e=I(e);try{if(e[m]){const r=D(t);for(let t=0;t<e[m].length;t++)await r.ready,await r.write(e[m][t]);r.releaseLock()}await e.pipeTo(t,{preventClose:r,preventAbort:i,preventCancel:n})}catch(e){}return}const a=M(e=B(e)),o=D(t);try{for(;;){await o.ready;const{done:e,value:t}=await a.read();if(e){r||await o.close();break}await o.write(t)}}catch(e){i||await o.abort(e)}finally{a.releaseLock(),o.releaseLock()}}function K(e,t){const r=new E(t);return x(e,r.writable),r.readable}function U(e){let t,r,i=!1;return{readable:new _({start(e){r=e},pull(){t?t():i=!0},cancel:e},{highWaterMark:0}),writable:new k({write:async function(e){r.enqueue(e),i?i=!1:(await new Promise((e=>{t=e})),t=null)},close:r.close.bind(r),abort:r.error.bind(r)})}}function R(e,t=(()=>{}),r=(()=>{})){if(s(e)){const i=new a;return(async()=>{const n=D(i);try{const i=await q(e),a=t(i),s=r();let o;o=void 0!==a&&void 0!==s?P([a,s]):void 0!==a?a:s,await n.write(o),await n.close()}catch(e){await n.abort(e)}})(),i}if(h(e))return K(e,{async transform(e,r){try{const i=await t(e);void 0!==i&&r.enqueue(i)}catch(e){r.error(e)}},async flush(e){try{const t=await r();void 0!==t&&e.enqueue(t)}catch(t){e.error(t)}}});const i=t(e),n=r();return void 0!==i&&void 0!==n?P([i,n]):void 0!==i?i:n}function T(e,t){if(h(e)&&!s(e)){let r;const i=new E({start(e){r=e}}),n=x(e,i.writable),a=U((async function(e){r.error(e),await n,await new Promise(setTimeout)}));return t(i.readable,a.writable),a.readable}e=B(e);const r=new a;return t(e,r),r}function Q(e,t){let r;const i=T(e,((e,n)=>{const a=M(e);a.remainder=()=>(a.releaseLock(),x(e,n),i),r=t(a)}));return r}function z(e){if(s(e))return e.clone();if(h(e)){const t=function(e){if(s(e))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(h(e)){const t=I(e).tee();return t[0][m]=t[1][m]=e[m],t}return[N(e),N(e)]}(e);return L(e,t[0]),t[1]}return N(e)}function F(e){return s(e)?z(e):h(e)?new _({start(t){const r=T(e,(async(e,r)=>{const i=M(e),n=D(r);try{for(;;){await n.ready;const{done:e,value:r}=await i.read();if(e){try{t.close()}catch(e){}return void await n.close()}try{t.enqueue(r)}catch(e){}await n.write(r)}}catch(e){t.error(e),await n.abort(e)}}));L(e,r)}}):N(e)}function L(e,t){Object.entries(Object.getOwnPropertyDescriptors(e.constructor.prototype)).forEach((([r,i])=>{"constructor"!==r&&(i.value?i.value=i.value.bind(t):i.get=i.get.bind(t),Object.defineProperty(e,r,i))}))}function N(e,t=0,r=1/0){if(s(e))throw Error("Not implemented");if(h(e)){if(t>=0&&r>=0){let i=0;return K(e,{transform(e,n){i<r?(i+e.length>=t&&n.enqueue(N(e,Math.max(t-i,0),r-i)),i+=e.length):n.terminate()}})}if(t<0&&(r<0||r===1/0)){let i=[];return R(e,(e=>{e.length>=-t?i=[e]:i.push(e)}),(()=>N(P(i),t,r)))}if(0===t&&r<0){let i;return R(e,(e=>{const n=i?P([i,e]):e;if(n.length>=-r)return i=N(n,r),N(n,t,r);i=n}))}return console.warn(`stream.slice(input, ${t}, ${r}) not implemented efficiently.`),H((async()=>N(await q(e),t,r)))}return e[m]&&(e=P(e[m].concat([e]))),!f(e)||C&&C.isBuffer(e)?e.slice(t,r):(r===1/0&&(r=e.length),e.subarray(t,r))}async function q(e,t=P){return s(e)?e.readToEnd(t):h(e)?M(e).readToEnd(t):e}async function O(e,t){if(h(e)){if(e.cancel)return e.cancel(t);if(e.destroy)return e.destroy(t),await new Promise(setTimeout),t}}function H(e){const t=new a;return(async()=>{const r=D(t);try{await r.write(await e()),await r.close()}catch(e){await r.abort(e)}})(),t}class j{constructor(e){if(void 0===e)throw Error("Invalid BigInteger input");if(e instanceof Uint8Array){const t=e,r=Array(t.length);for(let e=0;e<t.length;e++){const i=t[e].toString(16);r[e]=t[e]<=15?"0"+i:i}this.value=BigInt("0x0"+r.join(""))}else this.value=BigInt(e)}clone(){return new j(this.value)}iinc(){return this.value++,this}inc(){return this.clone().iinc()}idec(){return this.value--,this}dec(){return this.clone().idec()}iadd(e){return this.value+=e.value,this}add(e){return this.clone().iadd(e)}isub(e){return this.value-=e.value,this}sub(e){return this.clone().isub(e)}imul(e){return this.value*=e.value,this}mul(e){return this.clone().imul(e)}imod(e){return this.value%=e.value,this.isNegative()&&this.iadd(e),this}mod(e){return this.clone().imod(e)}modExp(e,t){if(t.isZero())throw Error("Modulo cannot be zero");if(t.isOne())return new j(0);if(e.isNegative())throw Error("Unsopported negative exponent");let r=e.value,i=this.value;i%=t.value;let n=BigInt(1);for(;r>BigInt(0);){const e=r&BigInt(1);r>>=BigInt(1);const a=n*i%t.value;n=e?a:n,i=i*i%t.value}return new j(n)}modInv(e){const{gcd:t,x:r}=this._egcd(e);if(!t.isOne())throw Error("Inverse does not exist");return r.add(e).mod(e)}_egcd(e){let t=BigInt(0),r=BigInt(1),i=BigInt(1),n=BigInt(0),a=this.value;for(e=e.value;e!==BigInt(0);){const s=a/e;let o=t;t=i-s*t,i=o,o=r,r=n-s*r,n=o,o=e,e=a%e,a=o}return{x:new j(i),y:new j(n),gcd:new j(a)}}gcd(e){let t=this.value;for(e=e.value;e!==BigInt(0);){const r=e;e=t%e,t=r}return new j(t)}ileftShift(e){return this.value<<=e.value,this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value>>=e.value,this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value===e.value}lt(e){return this.value<e.value}lte(e){return this.value<=e.value}gt(e){return this.value>e.value}gte(e){return this.value>=e.value}isZero(){return this.value===BigInt(0)}isOne(){return this.value===BigInt(1)}isNegative(){return this.value<BigInt(0)}isEven(){return!(this.value&BigInt(1))}abs(){const e=this.clone();return this.isNegative()&&(e.value=-e.value),e}toString(){return this.value.toString()}toNumber(){const e=Number(this.value);if(e>Number.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return e}getBit(e){return(this.value>>BigInt(e)&BigInt(1))===BigInt(0)?0:1}bitLength(){const e=new j(0),t=new j(1),r=new j(-1),i=this.isNegative()?r:e;let n=1;const a=this.clone();for(;!a.irightShift(t).equal(i);)n++;return n}byteLength(){const e=new j(0),t=new j(-1),r=this.isNegative()?t:e,i=new j(8);let n=1;const a=this.clone();for(;!a.irightShift(i).equal(r);)n++;return n}toUint8Array(e="be",t){let r=this.value.toString(16);r.length%2==1&&(r="0"+r);const i=r.length/2,n=new Uint8Array(t||i),a=t?t-i:0;let s=0;for(;s<i;)n[s+a]=parseInt(r.slice(2*s,2*s+2),16),s++;return"be"!==e&&n.reverse(),n}}const G=()=>"undefined"!=typeof BigInt;const W=Symbol("byValue");var V={curve:{p256:"p256","P-256":"p256",secp256r1:"p256",prime256v1:"p256","1.2.840.10045.3.1.7":"p256","2a8648ce3d030107":"p256","2A8648CE3D030107":"p256",p384:"p384","P-384":"p384",secp384r1:"p384","1.3.132.0.34":"p384","2b81040022":"p384","2B81040022":"p384",p521:"p521","P-521":"p521",secp521r1:"p521","1.3.132.0.35":"p521","2b81040023":"p521","2B81040023":"p521",secp256k1:"secp256k1","1.3.132.0.10":"secp256k1","2b8104000a":"secp256k1","2B8104000A":"secp256k1",ed25519Legacy:"ed25519",ED25519:"ed25519",ed25519:"ed25519",Ed25519:"ed25519","1.3.6.1.4.1.11591.15.1":"ed25519","2b06010401da470f01":"ed25519","2B06010401DA470F01":"ed25519",curve25519Legacy:"curve25519",X25519:"curve25519",cv25519:"curve25519",curve25519:"curve25519",Curve25519:"curve25519","1.3.6.1.4.1.3029.1.5.1":"curve25519","2b060104019755010501":"curve25519","2B060104019755010501":"curve25519",brainpoolP256r1:"brainpoolP256r1","1.3.36.3.3.2.8.1.1.7":"brainpoolP256r1","2b2403030208010107":"brainpoolP256r1","2B2403030208010107":"brainpoolP256r1",brainpoolP384r1:"brainpoolP384r1","1.3.36.3.3.2.8.1.1.11":"brainpoolP384r1","2b240303020801010b":"brainpoolP384r1","2B240303020801010B":"brainpoolP384r1",brainpoolP512r1:"brainpoolP512r1","1.3.36.3.3.2.8.1.1.13":"brainpoolP512r1","2b240303020801010d":"brainpoolP512r1","2B240303020801010D":"brainpoolP512r1"},kdfFlags:{replace_fingerprint:1,replace_kdf_params:2},s2k:{simple:0,salted:1,iterated:3,argon2:4,gnu:101},publicKey:{rsaEncryptSign:1,rsaEncrypt:2,rsaSign:3,elgamal:16,dsa:17,ecdh:18,ecdsa:19,eddsaLegacy:22,ed25519Legacy:22,eddsa:22,aedh:23,aedsa:24,x25519:25,x448:26,ed25519:27,ed448:28,aead:100,hmac:101},symmetric:{plaintext:0,idea:1,tripledes:2,cast5:3,blowfish:4,aes128:7,aes192:8,aes256:9,twofish:10},compression:{uncompressed:0,zip:1,zlib:2,bzip2:3},hash:{md5:1,sha1:2,ripemd:3,sha256:8,sha384:9,sha512:10,sha224:11},webHash:{"SHA-1":2,"SHA-256":8,"SHA-384":9,"SHA-512":10},aead:{eax:1,ocb:2,experimentalGCM:100},packet:{publicKeyEncryptedSessionKey:1,signature:2,symEncryptedSessionKey:3,onePassSignature:4,secretKey:5,publicKey:6,secretSubkey:7,compressedData:8,symmetricallyEncryptedData:9,marker:10,literalData:11,trust:12,userID:13,publicSubkey:14,userAttribute:17,symEncryptedIntegrityProtectedData:18,modificationDetectionCode:19,aeadEncryptedData:20},literal:{binary:98,text:116,utf8:117,mime:109},signature:{binary:0,text:1,standalone:2,certGeneric:16,certPersona:17,certCasual:18,certPositive:19,certRevocation:48,subkeyBinding:24,keyBinding:25,key:31,keyRevocation:32,subkeyRevocation:40,timestamp:64,thirdParty:80},signatureSubpacket:{signatureCreationTime:2,signatureExpirationTime:3,exportableCertification:4,trustSignature:5,regularExpression:6,revocable:7,keyExpirationTime:9,placeholderBackwardsCompatibility:10,preferredSymmetricAlgorithms:11,revocationKey:12,issuer:16,notationData:20,preferredHashAlgorithms:21,preferredCompressionAlgorithms:22,keyServerPreferences:23,preferredKeyServer:24,primaryUserID:25,policyURI:26,keyFlags:27,signersUserID:28,reasonForRevocation:29,features:30,signatureTarget:31,embeddedSignature:32,issuerFingerprint:33,preferredAEADAlgorithms:34},keyFlags:{certifyKeys:1,signData:2,encryptCommunication:4,encryptStorage:8,splitPrivateKey:16,authentication:32,forwardedCommunication:64,sharedPrivateKey:128},armor:{multipartSection:0,multipartLast:1,signed:2,message:3,publicKey:4,privateKey:5,signature:6},reasonForRevocation:{noReason:0,keySuperseded:1,keyCompromised:2,keyRetired:3,userIDInvalid:32},features:{modificationDetection:1,aead:2,v5Keys:4},write:function(e,t){if("number"==typeof t&&(t=this.read(e,t)),void 0!==e[t])return e[t];throw Error("Invalid enum value.")},read:function(e,t){if(e[W]||(e[W]=[],Object.entries(e).forEach((([t,r])=>{e[W][r]=t}))),void 0!==e[W][t])return e[W][t];throw Error("Invalid enum value.")}};const J=(()=>{try{return"development"===process.env.NODE_ENV}catch(e){}return!1})(),Y={isString:function(e){return"string"==typeof e||e instanceof String},isArray:function(e){return e instanceof Array},isUint8Array:f,isStream:h,readNumber:function(e){let t=0;for(let r=0;r<e.length;r++)t+=256**r*e[e.length-1-r];return t},writeNumber:function(e,t){const r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e>>8*(t-i-1)&255;return r},readDate:function(e){const t=Y.readNumber(e);return new Date(1e3*t)},writeDate:function(e){const t=Math.floor(e.getTime()/1e3);return Y.writeNumber(t,4)},normalizeDate:function(e=Date.now()){return null===e||e===1/0?e:new Date(1e3*Math.floor(+e/1e3))},readMPI:function(e){const t=(e[0]<<8|e[1])+7>>>3;return e.subarray(2,2+t)},leftPad(e,t){const r=new Uint8Array(t),i=t-e.length;return r.set(e,i),r},uint8ArrayToMPI:function(e){const t=Y.uint8ArrayBitLength(e);if(0===t)throw Error("Zero MPI");const r=e.subarray(e.length-Math.ceil(t/8)),i=new Uint8Array([(65280&t)>>8,255&t]);return Y.concatUint8Array([i,r])},uint8ArrayBitLength:function(e){let t;for(t=0;t<e.length&&0===e[t];t++);if(t===e.length)return 0;const r=e.subarray(t);return 8*(r.length-1)+Y.nbits(r[0])},hexToUint8Array:function(e){const t=new Uint8Array(e.length>>1);for(let r=0;r<e.length>>1;r++)t[r]=parseInt(e.substr(r<<1,2),16);return t},uint8ArrayToHex:function(e){const t=[],r=e.length;let i,n=0;for(;n<r;){for(i=e[n++].toString(16);i.length<2;)i="0"+i;t.push(""+i)}return t.join("")},stringToUint8Array:function(e){return R(e,(e=>{if(!Y.isString(e))throw Error("stringToUint8Array: Data must be in the form of a string");const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}))},uint8ArrayToString:function(e){const t=[],r=16384,i=(e=new Uint8Array(e)).length;for(let n=0;n<i;n+=r)t.push(String.fromCharCode.apply(String,e.subarray(n,n+r<i?n+r:i)));return t.join("")},encodeUTF8:function(e){const t=new TextEncoder("utf-8");function r(e,r=!1){return t.encode(e,{stream:!r})}return R(e,r,(()=>r("",!0)))},decodeUTF8:function(e){const t=new TextDecoder("utf-8");function r(e,r=!1){return t.decode(e,{stream:!r})}return R(e,r,(()=>r(new Uint8Array,!0)))},concat:P,concatUint8Array:d,equalsUint8Array:function(e,t){if(!Y.isUint8Array(e)||!Y.isUint8Array(t))throw Error("Data must be in the form of a Uint8Array");if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},writeChecksum:function(e){let t=0;for(let r=0;r<e.length;r++)t=t+e[r]&65535;return Y.writeNumber(t,2)},printDebug:function(e){J&&console.log("[OpenPGP.js debug]",e)},printDebugError:function(e){J&&console.error("[OpenPGP.js debug]",e)},nbits:function(e){let t=1,r=e>>>16;return 0!==r&&(e=r,t+=16),r=e>>8,0!==r&&(e=r,t+=8),r=e>>4,0!==r&&(e=r,t+=4),r=e>>2,0!==r&&(e=r,t+=2),r=e>>1,0!==r&&(e=r,t+=1),t},double:function(e){const t=new Uint8Array(e.length),r=e.length-1;for(let i=0;i<r;i++)t[i]=e[i]<<1^e[i+1]>>7;return t[r]=e[r]<<1^135*(e[0]>>7),t},shiftRight:function(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]>>=t,r>0&&(e[r]|=e[r-1]<<8-t);return e},getWebCrypto:function(){return void 0!==e&&e.crypto&&e.crypto.subtle},getBigInteger:async function(){if(G())return j;{const{default:e}=await Promise.resolve().then((function(){return Cy}));return e}},getNodeCrypto:function(){},getNodeZlib:function(){},getNodeBuffer:function(){return{}.Buffer},getHardwareConcurrency:function(){if("undefined"!=typeof navigator)return navigator.hardwareConcurrency||1;return(void 0).cpus().length},isEmailAddress:function(e){if(!Y.isString(e))return!1;return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+([a-zA-Z]{2,}[0-9]*|xn--[a-zA-Z\-0-9]+)))$/.test(e)},canonicalizeEOL:function(e){let t=!1;return R(e,(e=>{let r;t&&(e=Y.concatUint8Array([new Uint8Array([13]),e])),13===e[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;const i=[];for(let t=0;r=e.indexOf(10,t)+1,r;t=r)13!==e[r-2]&&i.push(r);if(!i.length)return e;const n=new Uint8Array(e.length+i.length);let a=0;for(let t=0;t<i.length;t++){const r=e.subarray(i[t-1]||0,i[t]);n.set(r,a),a+=r.length,n[a-1]=13,n[a]=10,a++}return n.set(e.subarray(i[i.length-1]||0),a),n}),(()=>t?new Uint8Array([13]):void 0))},nativeEOL:function(e){let t=!1;return R(e,(e=>{let r;13===(e=t&&10!==e[0]?Y.concatUint8Array([new Uint8Array([13]),e]):new Uint8Array(e))[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;let i=0;for(let t=0;t!==e.length;t=r){r=e.indexOf(13,t)+1,r||(r=e.length);const n=r-(10===e[r]?1:0);t&&e.copyWithin(i,t,n),i+=n-t}return e.subarray(0,i)}),(()=>t?new Uint8Array([13]):void 0))},removeTrailingSpaces:function(e){return e.split("\n").map((e=>{let t=e.length-1;for(;t>=0&&(" "===e[t]||"\t"===e[t]||"\r"===e[t]);t--);return e.substr(0,t+1)})).join("\n")},wrapError:function(e,t){if(!t)return Error(e);try{t.message=e+": "+t.message}catch(e){}return t},constructAllowedPackets:function(e){const t={};return e.forEach((e=>{if(!e.tag)throw Error("Invalid input: expected a packet class");t[e.tag]=e})),t},anyPromise:function(e){return new Promise((async(t,r)=>{let i;await Promise.all(e.map((async e=>{try{t(await e)}catch(e){i=e}}))),r(i)}))},selectUint8Array:function(e,t,r){const i=Math.max(t.length,r.length),n=new Uint8Array(i);let a=0;for(let i=0;i<n.length;i++)n[i]=t[i]&256-e|r[i]&255+e,a+=e&i<t.length|1-e&i<r.length;return n.subarray(0,a)},selectUint8:function(e,t,r){return t&256-e|r&255+e},isAES:function(e){return e===V.symmetric.aes128||e===V.symmetric.aes192||e===V.symmetric.aes256}},Z=Y.getNodeBuffer();let X,$;function ee(e){let t=new Uint8Array;return R(e,(e=>{t=Y.concatUint8Array([t,e]);const r=[],i=Math.floor(t.length/45),n=45*i,a=X(t.subarray(0,n));for(let e=0;e<i;e++)r.push(a.substr(60*e,60)),r.push("\n");return t=t.subarray(n),r.join("")}),(()=>t.length?X(t)+"\n":""))}function te(e){let t="";return R(e,(e=>{t+=e;let r=0;const i=[" ","\t","\r","\n"];for(let e=0;e<i.length;e++){const n=i[e];for(let e=t.indexOf(n);-1!==e;e=t.indexOf(n,e+1))r++}let n=t.length;for(;n>0&&(n-r)%4!=0;n--)i.includes(t[n])&&r--;const a=$(t.substr(0,n));return t=t.substr(n),a}),(()=>$(t)))}function re(e){return te(e.replace(/-/g,"+").replace(/_/g,"/"))}function ie(e,t){let r=ee(e).replace(/[\r\n]/g,"");return t&&(r=r.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")),r}Z?(X=e=>Z.from(e).toString("base64"),$=e=>{const t=Z.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}):(X=e=>btoa(Y.uint8ArrayToString(e)),$=e=>Y.stringToUint8Array(atob(e)));var ne={preferredHashAlgorithm:V.hash.sha256,preferredSymmetricAlgorithm:V.symmetric.aes256,preferredCompressionAlgorithm:V.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:V.aead.eax,aeadChunkSizeByte:12,v5Keys:!1,s2kType:V.s2k.iterated,s2kIterationCountByte:224,s2kArgon2Params:{passes:3,parallelism:4,memoryExponent:16},allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,allowForwardedMessages:!1,checksumRequired:!1,minRSABits:2047,passwordCollisionCheck:!1,revocationsExpire:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([V.symmetric.aes128,V.symmetric.aes192,V.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,additionalAllowedPackets:[],showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.11.0",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([V.hash.md5,V.hash.ripemd]),rejectMessageHashAlgorithms:new Set([V.hash.md5,V.hash.ripemd,V.hash.sha1]),rejectPublicKeyAlgorithms:new Set([V.publicKey.elgamal,V.publicKey.dsa]),rejectCurves:new Set([V.curve.secp256k1]),checkEdDSAFaultySignatures:!0};function ae(e){const t=e.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!t)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(t[1])?V.armor.multipartSection:/MESSAGE, PART \d+/.test(t[1])?V.armor.multipartLast:/SIGNED MESSAGE/.test(t[1])?V.armor.signed:/MESSAGE/.test(t[1])?V.armor.message:/PUBLIC KEY BLOCK/.test(t[1])?V.armor.publicKey:/PRIVATE KEY BLOCK/.test(t[1])?V.armor.privateKey:/SIGNATURE/.test(t[1])?V.armor.signature:void 0}function se(e,t){let r="";return t.showVersion&&(r+="Version: "+t.versionString+"\n"),t.showComment&&(r+="Comment: "+t.commentString+"\n"),e&&(r+="Comment: "+e+"\n"),r+="\n",r}function oe(e){return ee(function(e){let t=13501623;return R(e,(e=>{const r=ue?Math.floor(e.length/4):0,i=new Uint32Array(e.buffer,e.byteOffset,r);for(let e=0;e<r;e++)t^=i[e],t=ce[0][t>>24&255]^ce[1][t>>16&255]^ce[2][t>>8&255]^ce[3][t>>0&255];for(let i=4*r;i<e.length;i++)t=t>>8^ce[0][255&t^e[i]]}),(()=>new Uint8Array([t,t>>8,t>>16])))}(e))}const ce=[Array(255),Array(255),Array(255),Array(255)];for(let e=0;e<=255;e++){let t=e<<16;for(let e=0;e<8;e++)t=t<<1^(0!=(8388608&t)?8801531:0);ce[0][e]=(16711680&t)>>16|65280&t|(255&t)<<16}for(let e=0;e<=255;e++)ce[1][e]=ce[0][e]>>8^ce[0][255&ce[0][e]];for(let e=0;e<=255;e++)ce[2][e]=ce[1][e]>>8^ce[0][255&ce[1][e]];for(let e=0;e<=255;e++)ce[3][e]=ce[2][e]>>8^ce[0][255&ce[2][e]];const ue=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,255,!0),255===new Int16Array(e)[0]}();function he(e){for(let t=0;t<e.length;t++)/^([^\s:]|[^\s:][^:]*[^\s:]): .+$/.test(e[t])||Y.printDebugError(Error("Improperly formatted armor header: "+e[t])),/^(Version|Comment|MessageID|Hash|Charset): .+$/.test(e[t])||Y.printDebugError(Error("Unknown header: "+e[t]))}function fe(e){let t=e,r="";const i=e.lastIndexOf("=");return i>=0&&i!==e.length-1&&(t=e.slice(0,i),r=e.slice(i+1).substr(0,4)),{body:t,checksum:r}}function de(e,t=ne){return new Promise((async(r,i)=>{try{const n=/^-----[^-]+-----$/m,a=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let s;const o=[];let c,u,h,f=o,d=[],l=te(T(e,(async(e,t)=>{const p=M(e);try{for(;;){let e=await p.readLine();if(void 0===e)throw Error("Misformed armored text");if(e=Y.removeTrailingSpaces(e.replace(/[\r\n]/g,"")),s)if(c)u||2!==s||(n.test(e)?(d=d.join("\r\n"),u=!0,he(f),f=[],c=!1):d.push(e.replace(/^- /,"")));else if(n.test(e)&&i(Error("Mandatory blank line missing between armor headers and armor data")),a.test(e)){if(he(f),c=!0,u||2!==s){r({text:d,data:l,headers:o,type:s});break}}else f.push(e);else n.test(e)&&(s=ae(e))}}catch(e){return void i(e)}const y=D(t);try{for(;;){await y.ready;const{done:e,value:t}=await p.read();if(e)throw Error("Misformed armored text");const r=t+"";if(-1!==r.indexOf("=")||-1!==r.indexOf("-")){let e=await p.readToEnd();e.length||(e=""),e=r+e,e=Y.removeTrailingSpaces(e.replace(/\r/g,""));const t=e.split(n);if(1===t.length)throw Error("Misformed armored text");const i=fe(t[0].slice(0,-1));h=i.checksum,await y.write(i.body);break}await y.write(r)}await y.ready,await y.close()}catch(e){await y.abort(e)}})));l=T(l,(async(e,r)=>{const i=q(oe(F(e)));i.catch((()=>{})),await x(e,r,{preventClose:!0});const n=D(r);try{const e=(await i).replace("\n","");if(h!==e&&(h||t.checksumRequired))throw Error("Ascii armor integrity check failed");await n.ready,await n.close()}catch(e){await n.abort(e)}}))}catch(e){i(e)}})).then((async e=>(s(e.data)&&(e.data=await q(e.data)),e)))}function le(e,t,r,i,n,a=ne){let s,o;e===V.armor.signed&&(s=t.text,o=t.hash,t=t.data);const c=F(t),u=[];switch(e){case V.armor.multipartSection:u.push("-----BEGIN PGP MESSAGE, PART "+r+"/"+i+"-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP MESSAGE, PART "+r+"/"+i+"-----\n");break;case V.armor.multipartLast:u.push("-----BEGIN PGP MESSAGE, PART "+r+"-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP MESSAGE, PART "+r+"-----\n");break;case V.armor.signed:u.push("-----BEGIN PGP SIGNED MESSAGE-----\n"),u.push("Hash: "+o+"\n\n"),u.push(s.replace(/^-/gm,"- -")),u.push("\n-----BEGIN PGP SIGNATURE-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP SIGNATURE-----\n");break;case V.armor.message:u.push("-----BEGIN PGP MESSAGE-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP MESSAGE-----\n");break;case V.armor.publicKey:u.push("-----BEGIN PGP PUBLIC KEY BLOCK-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP PUBLIC KEY BLOCK-----\n");break;case V.armor.privateKey:u.push("-----BEGIN PGP PRIVATE KEY BLOCK-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP PRIVATE KEY BLOCK-----\n");break;case V.armor.signature:u.push("-----BEGIN PGP SIGNATURE-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP SIGNATURE-----\n")}return Y.concat(u)}class pe{constructor(){this.bytes=""}read(e){return this.bytes=Y.uint8ArrayToString(e.subarray(0,8)),this.bytes.length}write(){return Y.stringToUint8Array(this.bytes)}toHex(){return Y.uint8ArrayToHex(Y.stringToUint8Array(this.bytes))}equals(e,t=!1){return t&&(e.isWildcard()||this.isWildcard())||this.bytes===e.bytes}isNull(){return""===this.bytes}isWildcard(){return/^0+$/.test(this.toHex())}static mapToHex(e){return e.toHex()}static fromID(e){const t=new pe;return t.read(Y.hexToUint8Array(e)),t}static wildcard(){const e=new pe;return e.read(new Uint8Array(8)),e}}var ye=function(){var e,t,r=!1;function i(r,i){var n=e[(t[r]+t[i])%255];return 0!==r&&0!==i||(n=0),n}var n,a,s,o,c=!1;function u(){function u(r){var i,n,a;for(n=a=function(r){var i=e[255-t[r]];return 0===r&&(i=0),i}(r),i=0;i<4;i++)a^=n=255&(n<<1|n>>>7);return a^=99}r||function(){e=[],t=[];var i,n,a=1;for(i=0;i<255;i++)e[i]=a,n=128&a,a<<=1,a&=255,128===n&&(a^=27),a^=e[i],t[e[i]]=i;e[255]=e[0],t[0]=0,r=!0}(),n=[],a=[],s=[[],[],[],[]],o=[[],[],[],[]];for(var h=0;h<256;h++){var f=u(h);n[h]=f,a[f]=h,s[0][h]=i(2,f)<<24|f<<16|f<<8|i(3,f),o[0][f]=i(14,h)<<24|i(9,h)<<16|i(13,h)<<8|i(11,h);for(var d=1;d<4;d++)s[d][h]=s[d-1][h]>>>8|s[d-1][h]<<24,o[d][f]=o[d-1][f]>>>8|o[d-1][f]<<24}c=!0}var h=function(e,t){c||u();var r=new Uint32Array(t);r.set(n,512),r.set(a,768);for(var i=0;i<4;i++)r.set(s[i],4096+1024*i>>2),r.set(o[i],8192+1024*i>>2);var h=function(e,t,r){"use asm";var i=0,n=0,a=0,s=0,o=0,c=0,u=0,h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0,A=0,v=0,_=0,k=0;var E=new e.Uint32Array(r),S=new e.Uint8Array(r);function C(e,t,r,o,c,u,h,f){e=e|0;t=t|0;r=r|0;o=o|0;c=c|0;u=u|0;h=h|0;f=f|0;var d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0;d=r|0x400,l=r|0x800,p=r|0xc00;c=c^E[(e|0)>>2],u=u^E[(e|4)>>2],h=h^E[(e|8)>>2],f=f^E[(e|12)>>2];for(w=16;(w|0)<=o<<4;w=w+16|0){y=E[(r|c>>22&1020)>>2]^E[(d|u>>14&1020)>>2]^E[(l|h>>6&1020)>>2]^E[(p|f<<2&1020)>>2]^E[(e|w|0)>>2],g=E[(r|u>>22&1020)>>2]^E[(d|h>>14&1020)>>2]^E[(l|f>>6&1020)>>2]^E[(p|c<<2&1020)>>2]^E[(e|w|4)>>2],b=E[(r|h>>22&1020)>>2]^E[(d|f>>14&1020)>>2]^E[(l|c>>6&1020)>>2]^E[(p|u<<2&1020)>>2]^E[(e|w|8)>>2],m=E[(r|f>>22&1020)>>2]^E[(d|c>>14&1020)>>2]^E[(l|u>>6&1020)>>2]^E[(p|h<<2&1020)>>2]^E[(e|w|12)>>2];c=y,u=g,h=b,f=m}i=E[(t|c>>22&1020)>>2]<<24^E[(t|u>>14&1020)>>2]<<16^E[(t|h>>6&1020)>>2]<<8^E[(t|f<<2&1020)>>2]^E[(e|w|0)>>2],n=E[(t|u>>22&1020)>>2]<<24^E[(t|h>>14&1020)>>2]<<16^E[(t|f>>6&1020)>>2]<<8^E[(t|c<<2&1020)>>2]^E[(e|w|4)>>2],a=E[(t|h>>22&1020)>>2]<<24^E[(t|f>>14&1020)>>2]<<16^E[(t|c>>6&1020)>>2]<<8^E[(t|u<<2&1020)>>2]^E[(e|w|8)>>2],s=E[(t|f>>22&1020)>>2]<<24^E[(t|c>>14&1020)>>2]<<16^E[(t|u>>6&1020)>>2]<<8^E[(t|h<<2&1020)>>2]^E[(e|w|12)>>2]}function I(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;C(0x0000,0x0800,0x1000,k,e,t,r,i)}function B(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var a=0;C(0x0400,0x0c00,0x2000,k,e,i,r,t);a=n,n=s,s=a}function P(e,t,r,f){e=e|0;t=t|0;r=r|0;f=f|0;C(0x0000,0x0800,0x1000,k,o^e,c^t,u^r,h^f);o=i,c=n,u=a,h=s}function M(e,t,r,f){e=e|0;t=t|0;r=r|0;f=f|0;var d=0;C(0x0400,0x0c00,0x2000,k,e,f,r,t);d=n,n=s,s=d;i=i^o,n=n^c,a=a^u,s=s^h;o=e,c=t,u=r,h=f}function D(e,t,r,f){e=e|0;t=t|0;r=r|0;f=f|0;C(0x0000,0x0800,0x1000,k,o,c,u,h);o=i=i^e,c=n=n^t,u=a=a^r,h=s=s^f}function x(e,t,r,f){e=e|0;t=t|0;r=r|0;f=f|0;C(0x0000,0x0800,0x1000,k,o,c,u,h);i=i^e,n=n^t,a=a^r,s=s^f;o=e,c=t,u=r,h=f}function K(e,t,r,f){e=e|0;t=t|0;r=r|0;f=f|0;C(0x0000,0x0800,0x1000,k,o,c,u,h);o=i,c=n,u=a,h=s;i=i^e,n=n^t,a=a^r,s=s^f}function U(e,t,r,o){e=e|0;t=t|0;r=r|0;o=o|0;C(0x0000,0x0800,0x1000,k,f,d,l,p);p=~m&p|m&p+1;l=~b&l|b&l+((p|0)==0);d=~g&d|g&d+((l|0)==0);f=~y&f|y&f+((d|0)==0);i=i^e;n=n^t;a=a^r;s=s^o}function R(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,a=0,s=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0;e=e^o,t=t^c,r=r^u,i=i^h;n=w|0,a=A|0,s=v|0,f=_|0;for(;(g|0)<128;g=g+1|0){if(n>>>31){d=d^e,l=l^t,p=p^r,y=y^i}n=n<<1|a>>>31,a=a<<1|s>>>31,s=s<<1|f>>>31,f=f<<1;b=i&1;i=i>>>1|r<<31,r=r>>>1|t<<31,t=t>>>1|e<<31,e=e>>>1;if(b)e=e^0xe1000000}o=d,c=l,u=p,h=y}function T(e){e=e|0;k=e}function Q(e,t,r,o){e=e|0;t=t|0;r=r|0;o=o|0;i=e,n=t,a=r,s=o}function z(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;o=e,c=t,u=r,h=i}function F(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;f=e,d=t,l=r,p=i}function L(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;y=e,g=t,b=r,m=i}function N(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;p=~m&p|m&i,l=~b&l|b&r,d=~g&d|g&t,f=~y&f|y&e}function q(e){e=e|0;if(e&15)return-1;S[e|0]=i>>>24,S[e|1]=i>>>16&255,S[e|2]=i>>>8&255,S[e|3]=i&255,S[e|4]=n>>>24,S[e|5]=n>>>16&255,S[e|6]=n>>>8&255,S[e|7]=n&255,S[e|8]=a>>>24,S[e|9]=a>>>16&255,S[e|10]=a>>>8&255,S[e|11]=a&255,S[e|12]=s>>>24,S[e|13]=s>>>16&255,S[e|14]=s>>>8&255,S[e|15]=s&255;return 16}function O(e){e=e|0;if(e&15)return-1;S[e|0]=o>>>24,S[e|1]=o>>>16&255,S[e|2]=o>>>8&255,S[e|3]=o&255,S[e|4]=c>>>24,S[e|5]=c>>>16&255,S[e|6]=c>>>8&255,S[e|7]=c&255,S[e|8]=u>>>24,S[e|9]=u>>>16&255,S[e|10]=u>>>8&255,S[e|11]=u&255,S[e|12]=h>>>24,S[e|13]=h>>>16&255,S[e|14]=h>>>8&255,S[e|15]=h&255;return 16}function H(){I(0,0,0,0);w=i,A=n,v=a,_=s}function j(e,t,r){e=e|0;t=t|0;r=r|0;var o=0;if(t&15)return-1;while((r|0)>=16){W[e&7](S[t|0]<<24|S[t|1]<<16|S[t|2]<<8|S[t|3],S[t|4]<<24|S[t|5]<<16|S[t|6]<<8|S[t|7],S[t|8]<<24|S[t|9]<<16|S[t|10]<<8|S[t|11],S[t|12]<<24|S[t|13]<<16|S[t|14]<<8|S[t|15]);S[t|0]=i>>>24,S[t|1]=i>>>16&255,S[t|2]=i>>>8&255,S[t|3]=i&255,S[t|4]=n>>>24,S[t|5]=n>>>16&255,S[t|6]=n>>>8&255,S[t|7]=n&255,S[t|8]=a>>>24,S[t|9]=a>>>16&255,S[t|10]=a>>>8&255,S[t|11]=a&255,S[t|12]=s>>>24,S[t|13]=s>>>16&255,S[t|14]=s>>>8&255,S[t|15]=s&255;o=o+16|0,t=t+16|0,r=r-16|0}return o|0}function G(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t&15)return-1;while((r|0)>=16){V[e&1](S[t|0]<<24|S[t|1]<<16|S[t|2]<<8|S[t|3],S[t|4]<<24|S[t|5]<<16|S[t|6]<<8|S[t|7],S[t|8]<<24|S[t|9]<<16|S[t|10]<<8|S[t|11],S[t|12]<<24|S[t|13]<<16|S[t|14]<<8|S[t|15]);i=i+16|0,t=t+16|0,r=r-16|0}return i|0}var W=[I,B,P,M,D,x,K,U];var V=[P,R];return{set_rounds:T,set_state:Q,set_iv:z,set_nonce:F,set_mask:L,set_counter:N,get_state:q,get_iv:O,gcm_init:H,cipher:j,mac:G}}({Uint8Array,Uint32Array},e,t);return h.set_key=function(e,t,i,a,s,c,u,f,d){var l=r.subarray(0,60),p=r.subarray(256,316);l.set([t,i,a,s,c,u,f,d]);for(var y=e,g=1;y<4*e+28;y++){var b=l[y-1];(y%e==0||8===e&&y%e==4)&&(b=n[b>>>24]<<24^n[b>>>16&255]<<16^n[b>>>8&255]<<8^n[255&b]),y%e==0&&(b=b<<8^b>>>24^g<<24,g=g<<1^(128&g?27:0)),l[y]=l[y-e]^b}for(var m=0;m<y;m+=4)for(var w=0;w<4;w++){b=l[y-(4+m)+(4-w)%4];p[m+w]=m<4||m>=y-4?b:o[0][n[b>>>24]]^o[1][n[b>>>16&255]]^o[2][n[b>>>8&255]]^o[3][n[255&b]]}h.set_rounds(e+5)},h};return h.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},h.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},h.MAC={CBC:0,GCM:1},h.HEAP_DATA=16384,h}();function ge(e){return e instanceof Uint8Array}function be(e,t){const r=e?e.byteLength:t||65536;if(4095&r||r<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return e=e||new Uint8Array(new ArrayBuffer(r))}function me(e,t,r,i,n){const a=e.length-t,s=a<n?a:n;return e.set(r.subarray(i,i+s),t),s}function we(...e){const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let i=0;for(let t=0;t<e.length;t++)r.set(e[t],i),i+=e[t].length;return r}class Ae extends Error{constructor(...e){super(...e)}}class ve extends Error{constructor(...e){super(...e)}}class _e extends Error{constructor(...e){super(...e)}}const ke=[],Ee=[];class Se{constructor(e,t,r=!0,i,n,a){this.pos=0,this.len=0,this.mode=i,this.pos=0,this.len=0,this.key=e,this.iv=t,this.padding=r,this.acquire_asm(n,a)}acquire_asm(e,t){return void 0!==this.heap&&void 0!==this.asm||(this.heap=e||ke.pop()||be().subarray(ye.HEAP_DATA),this.asm=t||Ee.pop()||new ye(null,this.heap.buffer),this.reset(this.key,this.iv)),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(ke.push(this.heap),Ee.push(this.asm)),this.heap=void 0,this.asm=void 0}reset(e,t){const{asm:r}=this.acquire_asm(),i=e.length;if(16!==i&&24!==i&&32!==i)throw new ve("illegal key size");const n=new DataView(e.buffer,e.byteOffset,e.byteLength);if(r.set_key(i>>2,n.getUint32(0),n.getUint32(4),n.getUint32(8),n.getUint32(12),i>16?n.getUint32(16):0,i>16?n.getUint32(20):0,i>24?n.getUint32(24):0,i>24?n.getUint32(28):0),void 0!==t){if(16!==t.length)throw new ve("illegal iv size");let e=new DataView(t.buffer,t.byteOffset,t.byteLength);r.set_iv(e.getUint32(0),e.getUint32(4),e.getUint32(8),e.getUint32(12))}else r.set_iv(0,0,0,0)}AES_Encrypt_process(e){if(!ge(e))throw new TypeError("data isn't of expected type");let{heap:t,asm:r}=this.acquire_asm(),i=ye.ENC[this.mode],n=ye.HEAP_DATA,a=this.pos,s=this.len,o=0,c=e.length||0,u=0,h=0,f=new Uint8Array(s+c&-16);for(;c>0;)h=me(t,a+s,e,o,c),s+=h,o+=h,c-=h,h=r.cipher(i,n+a,s),h&&f.set(t.subarray(a,a+h),u),u+=h,h<s?(a+=h,s-=h):(a=0,s=0);return this.pos=a,this.len=s,f}AES_Encrypt_finish(){let{heap:e,asm:t}=this.acquire_asm(),r=ye.ENC[this.mode],i=ye.HEAP_DATA,n=this.pos,a=this.len,s=16-a%16,o=a;if(this.hasOwnProperty("padding")){if(this.padding){for(let t=0;t<s;++t)e[n+a+t]=s;a+=s,o=a}else if(a%16)throw new ve("data length must be a multiple of the block size")}else a+=s;const c=new Uint8Array(o);return a&&t.cipher(r,i+n,a),o&&c.set(e.subarray(n,n+o)),this.pos=0,this.len=0,this.release_asm(),c}AES_Decrypt_process(e){if(!ge(e))throw new TypeError("data isn't of expected type");let{heap:t,asm:r}=this.acquire_asm(),i=ye.DEC[this.mode],n=ye.HEAP_DATA,a=this.pos,s=this.len,o=0,c=e.length||0,u=0,h=s+c&-16,f=0,d=0;this.padding&&(f=s+c-h||16,h-=f);const l=new Uint8Array(h);for(;c>0;)d=me(t,a+s,e,o,c),s+=d,o+=d,c-=d,d=r.cipher(i,n+a,s-(c?0:f)),d&&l.set(t.subarray(a,a+d),u),u+=d,d<s?(a+=d,s-=d):(a=0,s=0);return this.pos=a,this.len=s,l}AES_Decrypt_finish(){let{heap:e,asm:t}=this.acquire_asm(),r=ye.DEC[this.mode],i=ye.HEAP_DATA,n=this.pos,a=this.len,s=a;if(a>0){if(a%16){if(this.hasOwnProperty("padding"))throw new ve("data length must be a multiple of the block size");a+=16-a%16}if(t.cipher(r,i+n,a),this.hasOwnProperty("padding")&&this.padding){let t=e[n+s-1];if(t<1||t>16||t>s)throw new _e("bad padding");let r=0;for(let i=t;i>1;i--)r|=t^e[n+s-i];if(r)throw new _e("bad padding");s-=t}}const o=new Uint8Array(s);return s>0&&o.set(e.subarray(n,n+s)),this.pos=0,this.len=0,this.release_asm(),o}}class Ce{static encrypt(e,t,r=!1){return new Ce(t,r).encrypt(e)}static decrypt(e,t,r=!1){return new Ce(t,r).decrypt(e)}constructor(e,t=!1,r){this.aes=r||new Se(e,void 0,t,"ECB")}encrypt(e){return we(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return we(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Ie(e){const t=function(e){const t=new Ce(e);this.encrypt=function(e){return t.encrypt(e)},this.decrypt=function(e){return t.decrypt(e)}};return t.blockSize=t.prototype.blockSize=16,t.keySize=t.prototype.keySize=e/8,t}function Be(e,t,r,i,n,a){const s=[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],o=[-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],c=[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],u=[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],h=[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],f=[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],d=[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],l=[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];let p,y,g,b,m,w,A,v,_,k,E,S,C,I,B=0,P=t.length;const M=32===e.length?3:9;v=3===M?r?[0,32,2]:[30,-2,-2]:r?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],r&&(t=function(e,t){const r=8-e.length%8;let i;if(2===t&&r<8)i=32;else if(1===t)i=r;else{if(t||!(r<8)){if(8===r)return e;throw Error("des: invalid padding")}i=0}const n=new Uint8Array(e.length+r);for(let t=0;t<e.length;t++)n[t]=e[t];for(let t=0;t<r;t++)n[e.length+t]=i;return n}(t,a),P=t.length);let D=new Uint8Array(P),x=0;for(1===i&&(_=n[B++]<<24|n[B++]<<16|n[B++]<<8|n[B++],E=n[B++]<<24|n[B++]<<16|n[B++]<<8|n[B++],B=0);B<P;){for(w=t[B++]<<24|t[B++]<<16|t[B++]<<8|t[B++],A=t[B++]<<24|t[B++]<<16|t[B++]<<8|t[B++],1===i&&(r?(w^=_,A^=E):(k=_,S=E,_=w,E=A)),g=252645135&(w>>>4^A),A^=g,w^=g<<4,g=65535&(w>>>16^A),A^=g,w^=g<<16,g=858993459&(A>>>2^w),w^=g,A^=g<<2,g=16711935&(A>>>8^w),w^=g,A^=g<<8,g=1431655765&(w>>>1^A),A^=g,w^=g<<1,w=w<<1|w>>>31,A=A<<1|A>>>31,y=0;y<M;y+=3){for(C=v[y+1],I=v[y+2],p=v[y];p!==C;p+=I)b=A^e[p],m=(A>>>4|A<<28)^e[p+1],g=w,w=A,A=g^(o[b>>>24&63]|u[b>>>16&63]|f[b>>>8&63]|l[63&b]|s[m>>>24&63]|c[m>>>16&63]|h[m>>>8&63]|d[63&m]);g=w,w=A,A=g}w=w>>>1|w<<31,A=A>>>1|A<<31,g=1431655765&(w>>>1^A),A^=g,w^=g<<1,g=16711935&(A>>>8^w),w^=g,A^=g<<8,g=858993459&(A>>>2^w),w^=g,A^=g<<2,g=65535&(w>>>16^A),A^=g,w^=g<<16,g=252645135&(w>>>4^A),A^=g,w^=g<<4,1===i&&(r?(_=w,E=A):(w^=k,A^=S)),D[x++]=w>>>24,D[x++]=w>>>16&255,D[x++]=w>>>8&255,D[x++]=255&w,D[x++]=A>>>24,D[x++]=A>>>16&255,D[x++]=A>>>8&255,D[x++]=255&A}return r||(D=function(e,t){let r,i=null;if(2===t)r=32;else if(1===t)i=e[e.length-1];else{if(t)throw Error("des: invalid padding");r=0}if(!i){for(i=1;e[e.length-i]===r;)i++;i--}return e.subarray(0,e.length-i)}(D,a)),D}function Pe(e){const t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],n=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],l=[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],y=e.length>8?3:1,g=Array(32*y),b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let m,w,A,v=0,_=0;for(let k=0;k<y;k++){let y=e[v++]<<24|e[v++]<<16|e[v++]<<8|e[v++],k=e[v++]<<24|e[v++]<<16|e[v++]<<8|e[v++];A=252645135&(y>>>4^k),k^=A,y^=A<<4,A=65535&(k>>>-16^y),y^=A,k^=A<<-16,A=858993459&(y>>>2^k),k^=A,y^=A<<2,A=65535&(k>>>-16^y),y^=A,k^=A<<-16,A=1431655765&(y>>>1^k),k^=A,y^=A<<1,A=16711935&(k>>>8^y),y^=A,k^=A<<8,A=1431655765&(y>>>1^k),k^=A,y^=A<<1,A=y<<8|k>>>20&240,y=k<<24|k<<8&16711680|k>>>8&65280|k>>>24&240,k=A;for(let e=0;e<16;e++)b[e]?(y=y<<2|y>>>26,k=k<<2|k>>>26):(y=y<<1|y>>>27,k=k<<1|k>>>27),y&=-15,k&=-15,m=t[y>>>28]|r[y>>>24&15]|i[y>>>20&15]|n[y>>>16&15]|a[y>>>12&15]|s[y>>>8&15]|o[y>>>4&15],w=c[k>>>28]|u[k>>>24&15]|h[k>>>20&15]|f[k>>>16&15]|d[k>>>12&15]|l[k>>>8&15]|p[k>>>4&15],A=65535&(w>>>16^m),g[_++]=m^A,g[_++]=w^A<<16}return g}function Me(e){this.key=[];for(let t=0;t<3;t++)this.key.push(new Uint8Array(e.subarray(8*t,8*t+8)));this.encrypt=function(e){return Be(Pe(this.key[2]),Be(Pe(this.key[1]),Be(Pe(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function De(){this.BlockSize=8,this.KeySize=16,this.setKey=function(e){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),e.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(e),!0},this.reset=function(){for(let e=0;e<16;e++)this.masking[e]=0,this.rotate[e]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(e){const t=Array(e.length);for(let a=0;a<e.length;a+=8){let s,o=e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3],c=e[a+4]<<24|e[a+5]<<16|e[a+6]<<8|e[a+7];s=c,c=o^r(c,this.masking[0],this.rotate[0]),o=s,s=c,c=o^i(c,this.masking[1],this.rotate[1]),o=s,s=c,c=o^n(c,this.masking[2],this.rotate[2]),o=s,s=c,c=o^r(c,this.masking[3],this.rotate[3]),o=s,s=c,c=o^i(c,this.masking[4],this.rotate[4]),o=s,s=c,c=o^n(c,this.masking[5],this.rotate[5]),o=s,s=c,c=o^r(c,this.masking[6],this.rotate[6]),o=s,s=c,c=o^i(c,this.masking[7],this.rotate[7]),o=s,s=c,c=o^n(c,this.masking[8],this.rotate[8]),o=s,s=c,c=o^r(c,this.masking[9],this.rotate[9]),o=s,s=c,c=o^i(c,this.masking[10],this.rotate[10]),o=s,s=c,c=o^n(c,this.masking[11],this.rotate[11]),o=s,s=c,c=o^r(c,this.masking[12],this.rotate[12]),o=s,s=c,c=o^i(c,this.masking[13],this.rotate[13]),o=s,s=c,c=o^n(c,this.masking[14],this.rotate[14]),o=s,s=c,c=o^r(c,this.masking[15],this.rotate[15]),o=s,t[a]=c>>>24&255,t[a+1]=c>>>16&255,t[a+2]=c>>>8&255,t[a+3]=255&c,t[a+4]=o>>>24&255,t[a+5]=o>>>16&255,t[a+6]=o>>>8&255,t[a+7]=255&o}return t},this.decrypt=function(e){const t=Array(e.length);for(let a=0;a<e.length;a+=8){let s,o=e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3],c=e[a+4]<<24|e[a+5]<<16|e[a+6]<<8|e[a+7];s=c,c=o^r(c,this.masking[15],this.rotate[15]),o=s,s=c,c=o^n(c,this.masking[14],this.rotate[14]),o=s,s=c,c=o^i(c,this.masking[13],this.rotate[13]),o=s,s=c,c=o^r(c,this.masking[12],this.rotate[12]),o=s,s=c,c=o^n(c,this.masking[11],this.rotate[11]),o=s,s=c,c=o^i(c,this.masking[10],this.rotate[10]),o=s,s=c,c=o^r(c,this.masking[9],this.rotate[9]),o=s,s=c,c=o^n(c,this.masking[8],this.rotate[8]),o=s,s=c,c=o^i(c,this.masking[7],this.rotate[7]),o=s,s=c,c=o^r(c,this.masking[6],this.rotate[6]),o=s,s=c,c=o^n(c,this.masking[5],this.rotate[5]),o=s,s=c,c=o^i(c,this.masking[4],this.rotate[4]),o=s,s=c,c=o^r(c,this.masking[3],this.rotate[3]),o=s,s=c,c=o^n(c,this.masking[2],this.rotate[2]),o=s,s=c,c=o^i(c,this.masking[1],this.rotate[1]),o=s,s=c,c=o^r(c,this.masking[0],this.rotate[0]),o=s,t[a]=c>>>24&255,t[a+1]=c>>>16&255,t[a+2]=c>>>8&255,t[a+3]=255&c,t[a+4]=o>>>24&255,t[a+5]=o>>16&255,t[a+6]=o>>8&255,t[a+7]=255&o}return t};const e=[,,,,];e[0]=[,,,,],e[0][0]=[4,0,13,15,12,14,8],e[0][1]=[5,2,16,18,17,19,10],e[0][2]=[6,3,23,22,21,20,9],e[0][3]=[7,1,26,25,27,24,11],e[1]=[,,,,],e[1][0]=[0,6,21,23,20,22,16],e[1][1]=[1,4,0,2,1,3,18],e[1][2]=[2,5,7,6,5,4,17],e[1][3]=[3,7,10,9,11,8,19],e[2]=[,,,,],e[2][0]=[4,0,13,15,12,14,8],e[2][1]=[5,2,16,18,17,19,10],e[2][2]=[6,3,23,22,21,20,9],e[2][3]=[7,1,26,25,27,24,11],e[3]=[,,,,],e[3][0]=[0,6,21,23,20,22,16],e[3][1]=[1,4,0,2,1,3,18],e[3][2]=[2,5,7,6,5,4,17],e[3][3]=[3,7,10,9,11,8,19];const t=[,,,,];function r(e,t,r){const i=t+e,n=i<<r|i>>>32-r;return(a[0][n>>>24]^a[1][n>>>16&255])-a[2][n>>>8&255]+a[3][255&n]}function i(e,t,r){const i=t^e,n=i<<r|i>>>32-r;return a[0][n>>>24]-a[1][n>>>16&255]+a[2][n>>>8&255]^a[3][255&n]}function n(e,t,r){const i=t-e,n=i<<r|i>>>32-r;return(a[0][n>>>24]+a[1][n>>>16&255]^a[2][n>>>8&255])-a[3][255&n]}t[0]=[,,,,],t[0][0]=[24,25,23,22,18],t[0][1]=[26,27,21,20,22],t[0][2]=[28,29,19,18,25],t[0][3]=[30,31,17,16,28],t[1]=[,,,,],t[1][0]=[3,2,12,13,8],t[1][1]=[1,0,14,15,13],t[1][2]=[7,6,8,9,3],t[1][3]=[5,4,10,11,7],t[2]=[,,,,],t[2][0]=[19,18,28,29,25],t[2][1]=[17,16,30,31,28],t[2][2]=[23,22,24,25,18],t[2][3]=[21,20,26,27,22],t[3]=[,,,,],t[3][0]=[8,9,7,6,3],t[3][1]=[10,11,5,4,7],t[3][2]=[12,13,3,2,8],t[3][3]=[14,15,1,0,13],this.keySchedule=function(r){const i=[,,,,,,,,],n=Array(32);let s;for(let e=0;e<4;e++)s=4*e,i[e]=r[s]<<24|r[s+1]<<16|r[s+2]<<8|r[s+3];const o=[6,7,4,5];let c,u=0;for(let r=0;r<2;r++)for(let r=0;r<4;r++){for(s=0;s<4;s++){const t=e[r][s];c=i[t[1]],c^=a[4][i[t[2]>>>2]>>>24-8*(3&t[2])&255],c^=a[5][i[t[3]>>>2]>>>24-8*(3&t[3])&255],c^=a[6][i[t[4]>>>2]>>>24-8*(3&t[4])&255],c^=a[7][i[t[5]>>>2]>>>24-8*(3&t[5])&255],c^=a[o[s]][i[t[6]>>>2]>>>24-8*(3&t[6])&255],i[t[0]]=c}for(s=0;s<4;s++){const e=t[r][s];c=a[4][i[e[0]>>>2]>>>24-8*(3&e[0])&255],c^=a[5][i[e[1]>>>2]>>>24-8*(3&e[1])&255],c^=a[6][i[e[2]>>>2]>>>24-8*(3&e[2])&255],c^=a[7][i[e[3]>>>2]>>>24-8*(3&e[3])&255],c^=a[4+s][i[e[4]>>>2]>>>24-8*(3&e[4])&255],n[u]=c,u++}}for(let e=0;e<16;e++)this.masking[e]=n[e],this.rotate[e]=31&n[16+e]};const a=[,,,,,,,,];a[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],a[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],a[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],a[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],a[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],a[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],a[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],a[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function xe(e){this.cast5=new De,this.cast5.setKey(e),this.encrypt=function(e){return this.cast5.encrypt(e)}}Me.keySize=Me.prototype.keySize=24,Me.blockSize=Me.prototype.blockSize=8,xe.blockSize=xe.prototype.blockSize=8,xe.keySize=xe.prototype.keySize=16;const Ke=4294967295;function Ue(e,t){return(e<<t|e>>>32-t)&Ke}function Re(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function Te(e,t,r){e.splice(t,4,255&r,r>>>8&255,r>>>16&255,r>>>24&255)}function Qe(e,t){return e>>>8*t&255}function ze(e){this.tf=function(){let e=null,t=null,r=-1,i=[],n=[[],[],[],[]];function a(e){return n[0][Qe(e,0)]^n[1][Qe(e,1)]^n[2][Qe(e,2)]^n[3][Qe(e,3)]}function s(e){return n[0][Qe(e,3)]^n[1][Qe(e,0)]^n[2][Qe(e,1)]^n[3][Qe(e,2)]}function o(e,t){let r=a(t[0]),n=s(t[1]);t[2]=Ue(t[2]^r+n+i[4*e+8]&Ke,31),t[3]=Ue(t[3],1)^r+2*n+i[4*e+9]&Ke,r=a(t[2]),n=s(t[3]),t[0]=Ue(t[0]^r+n+i[4*e+10]&Ke,31),t[1]=Ue(t[1],1)^r+2*n+i[4*e+11]&Ke}function c(e,t){let r=a(t[0]),n=s(t[1]);t[2]=Ue(t[2],1)^r+n+i[4*e+10]&Ke,t[3]=Ue(t[3]^r+2*n+i[4*e+11]&Ke,31),r=a(t[2]),n=s(t[3]),t[0]=Ue(t[0],1)^r+n+i[4*e+8]&Ke,t[1]=Ue(t[1]^r+2*n+i[4*e+9]&Ke,31)}return{name:"twofish",blocksize:16,open:function(t){let r,a,s,o,c;e=t;const u=[],h=[],f=[];let d;const l=[];let p,y,g;const b=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],m=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],w=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],A=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],v=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],_=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],k=[[],[]],E=[[],[],[],[]];function S(e){return e^e>>2^[0,90,180,238][3&e]}function C(e){return e^e>>1^e>>2^[0,238,180,90][3&e]}function I(e,t){let r,i,n;for(r=0;r<8;r++)i=t>>>24,t=t<<8&Ke|e>>>24,e=e<<8&Ke,n=i<<1,128&i&&(n^=333),t^=i^n<<16,n^=i>>>1,1&i&&(n^=166),t^=n<<24|n<<8;return t}function B(e,t){const r=t>>4,i=15&t,n=b[e][r^i],a=m[e][v[i]^_[r]];return A[e][v[a]^_[n]]<<4|w[e][n^a]}function P(e,t){let r=Qe(e,0),i=Qe(e,1),n=Qe(e,2),a=Qe(e,3);switch(d){case 4:r=k[1][r]^Qe(t[3],0),i=k[0][i]^Qe(t[3],1),n=k[0][n]^Qe(t[3],2),a=k[1][a]^Qe(t[3],3);case 3:r=k[1][r]^Qe(t[2],0),i=k[1][i]^Qe(t[2],1),n=k[0][n]^Qe(t[2],2),a=k[0][a]^Qe(t[2],3);case 2:r=k[0][k[0][r]^Qe(t[1],0)]^Qe(t[0],0),i=k[0][k[1][i]^Qe(t[1],1)]^Qe(t[0],1),n=k[1][k[0][n]^Qe(t[1],2)]^Qe(t[0],2),a=k[1][k[1][a]^Qe(t[1],3)]^Qe(t[0],3)}return E[0][r]^E[1][i]^E[2][n]^E[3][a]}for(e=e.slice(0,32),r=e.length;16!==r&&24!==r&&32!==r;)e[r++]=0;for(r=0;r<e.length;r+=4)f[r>>2]=Re(e,r);for(r=0;r<256;r++)k[0][r]=B(0,r),k[1][r]=B(1,r);for(r=0;r<256;r++)p=k[1][r],y=S(p),g=C(p),E[0][r]=p+(y<<8)+(g<<16)+(g<<24),E[2][r]=y+(g<<8)+(p<<16)+(g<<24),p=k[0][r],y=S(p),g=C(p),E[1][r]=g+(g<<8)+(y<<16)+(p<<24),E[3][r]=y+(p<<8)+(g<<16)+(y<<24);for(d=f.length/2,r=0;r<d;r++)a=f[r+r],u[r]=a,s=f[r+r+1],h[r]=s,l[d-r-1]=I(a,s);for(r=0;r<40;r+=2)a=16843009*r,s=a+16843009,a=P(a,u),s=Ue(P(s,h),8),i[r]=a+s&Ke,i[r+1]=Ue(a+2*s,9);for(r=0;r<256;r++)switch(a=s=o=c=r,d){case 4:a=k[1][a]^Qe(l[3],0),s=k[0][s]^Qe(l[3],1),o=k[0][o]^Qe(l[3],2),c=k[1][c]^Qe(l[3],3);case 3:a=k[1][a]^Qe(l[2],0),s=k[1][s]^Qe(l[2],1),o=k[0][o]^Qe(l[2],2),c=k[0][c]^Qe(l[2],3);case 2:n[0][r]=E[0][k[0][k[0][a]^Qe(l[1],0)]^Qe(l[0],0)],n[1][r]=E[1][k[0][k[1][s]^Qe(l[1],1)]^Qe(l[0],1)],n[2][r]=E[2][k[1][k[0][o]^Qe(l[1],2)]^Qe(l[0],2)],n[3][r]=E[3][k[1][k[1][c]^Qe(l[1],3)]^Qe(l[0],3)]}},close:function(){i=[],n=[[],[],[],[]]},encrypt:function(e,n){t=e,r=n;const a=[Re(t,r)^i[0],Re(t,r+4)^i[1],Re(t,r+8)^i[2],Re(t,r+12)^i[3]];for(let e=0;e<8;e++)o(e,a);return Te(t,r,a[2]^i[4]),Te(t,r+4,a[3]^i[5]),Te(t,r+8,a[0]^i[6]),Te(t,r+12,a[1]^i[7]),r+=16,t},decrypt:function(e,n){t=e,r=n;const a=[Re(t,r)^i[4],Re(t,r+4)^i[5],Re(t,r+8)^i[6],Re(t,r+12)^i[7]];for(let e=7;e>=0;e--)c(e,a);Te(t,r,a[2]^i[0]),Te(t,r+4,a[3]^i[1]),Te(t,r+8,a[0]^i[2]),Te(t,r+12,a[1]^i[3]),r+=16},finalize:function(){return t}}}(),this.tf.open(Array.from(e),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}function Fe(){}function Le(e){this.bf=new Fe,this.bf.init(e),this.encrypt=function(e){return this.bf.encryptBlock(e)}}ze.keySize=ze.prototype.keySize=32,ze.blockSize=ze.prototype.blockSize=16,Fe.prototype.BLOCKSIZE=8,Fe.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],Fe.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],Fe.prototype.NN=16,Fe.prototype._clean=function(e){if(e<0){e=(2147483647&e)+2147483648}return e},Fe.prototype._F=function(e){let t;const r=255&e,i=255&(e>>>=8),n=255&(e>>>=8),a=255&(e>>>=8);return t=this.sboxes[0][a]+this.sboxes[1][n],t^=this.sboxes[2][i],t+=this.sboxes[3][r],t},Fe.prototype._encryptBlock=function(e){let t,r=e[0],i=e[1];for(t=0;t<this.NN;++t){r^=this.parray[t],i=this._F(r)^i;const e=r;r=i,i=e}r^=this.parray[this.NN+0],i^=this.parray[this.NN+1],e[0]=this._clean(i),e[1]=this._clean(r)},Fe.prototype.encryptBlock=function(e){let t;const r=[0,0],i=this.BLOCKSIZE/2;for(t=0;t<this.BLOCKSIZE/2;++t)r[0]=r[0]<<8|255&e[t+0],r[1]=r[1]<<8|255&e[t+i];this._encryptBlock(r);const n=[];for(t=0;t<this.BLOCKSIZE/2;++t)n[t+0]=r[0]>>>24-8*t&255,n[t+i]=r[1]>>>24-8*t&255;return n},Fe.prototype._decryptBlock=function(e){let t,r=e[0],i=e[1];for(t=this.NN+1;t>1;--t){r^=this.parray[t],i=this._F(r)^i;const e=r;r=i,i=e}r^=this.parray[1],i^=this.parray[0],e[0]=this._clean(i),e[1]=this._clean(r)},Fe.prototype.init=function(e){let t,r=0;for(this.parray=[],t=0;t<this.NN+2;++t){let i=0;for(let t=0;t<4;++t)i=i<<8|255&e[r],++r>=e.length&&(r=0);this.parray[t]=this.PARRAY[t]^i}for(this.sboxes=[],t=0;t<4;++t)for(this.sboxes[t]=[],r=0;r<256;++r)this.sboxes[t][r]=this.SBOXES[t][r];const i=[0,0];for(t=0;t<this.NN+2;t+=2)this._encryptBlock(i),this.parray[t+0]=i[0],this.parray[t+1]=i[1];for(t=0;t<4;++t)for(r=0;r<256;r+=2)this._encryptBlock(i),this.sboxes[t][r+0]=i[0],this.sboxes[t][r+1]=i[1]},Le.keySize=Le.prototype.keySize=16,Le.blockSize=Le.prototype.blockSize=8;const Ne=Ie(128),qe=Ie(192),Oe=Ie(256),He=function(e){this.key=e,this.encrypt=function(e,t){return Be(Pe(this.key),e,!0,0,null,t)},this.decrypt=function(e,t){return Be(Pe(this.key),e,!1,0,null,t)}};var je=/*#__PURE__*/Object.freeze({__proto__:null,aes128:Ne,aes192:qe,aes256:Oe,des:He,tripledes:Me,cast5:xe,twofish:ze,blowfish:Le,idea:function(){throw Error("IDEA symmetric-key algorithm not implemented")}}),Ge=function(e,t,r){"use asm";var i=0,n=0,a=0,s=0,o=0,c=0,u=0;var h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0;var A=new e.Uint8Array(r);function v(e,t,r,c,u,h,f,d,l,p,y,g,b,m,w,A){e=e|0;t=t|0;r=r|0;c=c|0;u=u|0;h=h|0;f=f|0;d=d|0;l=l|0;p=p|0;y=y|0;g=g|0;b=b|0;m=m|0;w=w|0;A=A|0;var v=0,_=0,k=0,E=0,S=0,C=0,I=0,B=0,P=0,M=0,D=0,x=0,K=0,U=0,R=0,T=0,Q=0,z=0,F=0,L=0,N=0,q=0,O=0,H=0,j=0,G=0,W=0,V=0,J=0,Y=0,Z=0,X=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,ae=0,se=0,oe=0,ce=0,ue=0,he=0,fe=0,de=0,le=0,pe=0,ye=0,ge=0,be=0,me=0,we=0,Ae=0,ve=0,_e=0,ke=0,Ee=0,Se=0,Ce=0,Ie=0,Be=0,Pe=0,Me=0,De=0,xe=0,Ke=0,Ue=0,Re=0,Te=0,Qe=0;v=i;_=n;k=a;E=s;S=o;I=e+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=t+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=r+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=c+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=u+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=h+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=f+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=d+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=l+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=p+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=y+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=g+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=b+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=m+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=w+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=A+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=m^l^r^e;B=C<<1|C>>>31;I=B+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=w^p^c^t;P=C<<1|C>>>31;I=P+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=A^y^u^r;M=C<<1|C>>>31;I=M+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=B^g^h^c;D=C<<1|C>>>31;I=D+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=P^b^f^u;x=C<<1|C>>>31;I=x+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=M^m^d^h;K=C<<1|C>>>31;I=K+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=D^w^l^f;U=C<<1|C>>>31;I=U+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=x^A^p^d;R=C<<1|C>>>31;I=R+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=K^B^y^l;T=C<<1|C>>>31;I=T+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=U^P^g^p;Q=C<<1|C>>>31;I=Q+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=R^M^b^y;z=C<<1|C>>>31;I=z+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=T^D^m^g;F=C<<1|C>>>31;I=F+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Q^x^w^b;L=C<<1|C>>>31;I=L+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=z^K^A^m;N=C<<1|C>>>31;I=N+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=F^U^B^w;q=C<<1|C>>>31;I=q+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=L^R^P^A;O=C<<1|C>>>31;I=O+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=N^T^M^B;H=C<<1|C>>>31;I=H+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=q^Q^D^P;j=C<<1|C>>>31;I=j+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=O^z^x^M;G=C<<1|C>>>31;I=G+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=H^F^K^D;W=C<<1|C>>>31;I=W+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=j^L^U^x;V=C<<1|C>>>31;I=V+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=G^N^R^K;J=C<<1|C>>>31;I=J+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=W^q^T^U;Y=C<<1|C>>>31;I=Y+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=V^O^Q^R;Z=C<<1|C>>>31;I=Z+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=J^H^z^T;X=C<<1|C>>>31;I=X+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Y^j^F^Q;$=C<<1|C>>>31;I=$+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Z^G^L^z;ee=C<<1|C>>>31;I=ee+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=X^W^N^F;te=C<<1|C>>>31;I=te+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=$^V^q^L;re=C<<1|C>>>31;I=re+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ee^J^O^N;ie=C<<1|C>>>31;I=ie+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=te^Y^H^q;ne=C<<1|C>>>31;I=ne+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=re^Z^j^O;ae=C<<1|C>>>31;I=ae+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ie^X^G^H;se=C<<1|C>>>31;I=se+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ne^$^W^j;oe=C<<1|C>>>31;I=oe+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ae^ee^V^G;ce=C<<1|C>>>31;I=ce+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=se^te^J^W;ue=C<<1|C>>>31;I=ue+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=oe^re^Y^V;he=C<<1|C>>>31;I=he+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ce^ie^Z^J;fe=C<<1|C>>>31;I=fe+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ue^ne^X^Y;de=C<<1|C>>>31;I=de+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=he^ae^$^Z;le=C<<1|C>>>31;I=le+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=fe^se^ee^X;pe=C<<1|C>>>31;I=pe+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=de^oe^te^$;ye=C<<1|C>>>31;I=ye+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=le^ce^re^ee;ge=C<<1|C>>>31;I=ge+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=pe^ue^ie^te;be=C<<1|C>>>31;I=be+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ye^he^ne^re;me=C<<1|C>>>31;I=me+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ge^fe^ae^ie;we=C<<1|C>>>31;I=we+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=be^de^se^ne;Ae=C<<1|C>>>31;I=Ae+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=me^le^oe^ae;ve=C<<1|C>>>31;I=ve+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=we^pe^ce^se;_e=C<<1|C>>>31;I=_e+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Ae^ye^ue^oe;ke=C<<1|C>>>31;I=ke+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ve^ge^he^ce;Ee=C<<1|C>>>31;I=Ee+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=_e^be^fe^ue;Se=C<<1|C>>>31;I=Se+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ke^me^de^he;Ce=C<<1|C>>>31;I=Ce+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Ee^we^le^fe;Ie=C<<1|C>>>31;I=Ie+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Se^Ae^pe^de;Be=C<<1|C>>>31;I=Be+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Ce^ve^ye^le;Pe=C<<1|C>>>31;I=Pe+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Ie^_e^ge^pe;Me=C<<1|C>>>31;I=Me+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Be^ke^be^ye;De=C<<1|C>>>31;I=De+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Pe^Ee^me^ge;xe=C<<1|C>>>31;I=xe+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Me^Se^we^be;Ke=C<<1|C>>>31;I=Ke+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=De^Ce^Ae^me;Ue=C<<1|C>>>31;I=Ue+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=xe^Ie^ve^we;Re=C<<1|C>>>31;I=Re+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Ke^Be^_e^Ae;Te=C<<1|C>>>31;I=Te+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Ue^Pe^ke^ve;Qe=C<<1|C>>>31;I=Qe+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;i=i+v|0;n=n+_|0;a=a+k|0;s=s+E|0;o=o+S|0}function _(e){e=e|0;v(A[e|0]<<24|A[e|1]<<16|A[e|2]<<8|A[e|3],A[e|4]<<24|A[e|5]<<16|A[e|6]<<8|A[e|7],A[e|8]<<24|A[e|9]<<16|A[e|10]<<8|A[e|11],A[e|12]<<24|A[e|13]<<16|A[e|14]<<8|A[e|15],A[e|16]<<24|A[e|17]<<16|A[e|18]<<8|A[e|19],A[e|20]<<24|A[e|21]<<16|A[e|22]<<8|A[e|23],A[e|24]<<24|A[e|25]<<16|A[e|26]<<8|A[e|27],A[e|28]<<24|A[e|29]<<16|A[e|30]<<8|A[e|31],A[e|32]<<24|A[e|33]<<16|A[e|34]<<8|A[e|35],A[e|36]<<24|A[e|37]<<16|A[e|38]<<8|A[e|39],A[e|40]<<24|A[e|41]<<16|A[e|42]<<8|A[e|43],A[e|44]<<24|A[e|45]<<16|A[e|46]<<8|A[e|47],A[e|48]<<24|A[e|49]<<16|A[e|50]<<8|A[e|51],A[e|52]<<24|A[e|53]<<16|A[e|54]<<8|A[e|55],A[e|56]<<24|A[e|57]<<16|A[e|58]<<8|A[e|59],A[e|60]<<24|A[e|61]<<16|A[e|62]<<8|A[e|63])}function k(e){e=e|0;A[e|0]=i>>>24;A[e|1]=i>>>16&255;A[e|2]=i>>>8&255;A[e|3]=i&255;A[e|4]=n>>>24;A[e|5]=n>>>16&255;A[e|6]=n>>>8&255;A[e|7]=n&255;A[e|8]=a>>>24;A[e|9]=a>>>16&255;A[e|10]=a>>>8&255;A[e|11]=a&255;A[e|12]=s>>>24;A[e|13]=s>>>16&255;A[e|14]=s>>>8&255;A[e|15]=s&255;A[e|16]=o>>>24;A[e|17]=o>>>16&255;A[e|18]=o>>>8&255;A[e|19]=o&255}function E(){i=0x67452301;n=0xefcdab89;a=0x98badcfe;s=0x10325476;o=0xc3d2e1f0;c=u=0}function S(e,t,r,h,f,d,l){e=e|0;t=t|0;r=r|0;h=h|0;f=f|0;d=d|0;l=l|0;i=e;n=t;a=r;s=h;o=f;c=d;u=l}function C(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){_(e);e=e+64|0;t=t-64|0;r=r+64|0}c=c+r|0;if(c>>>0<r>>>0)u=u+1|0;return r|0}function I(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){i=C(e,t)|0;if((i|0)==-1)return-1;e=e+i|0;t=t-i|0}i=i+t|0;c=c+t|0;if(c>>>0<t>>>0)u=u+1|0;A[e|t]=0x80;if((t|0)>=56){for(n=t+1|0;(n|0)<64;n=n+1|0)A[e|n]=0x00;_(e);t=0;A[e|0]=0}for(n=t+1|0;(n|0)<59;n=n+1|0)A[e|n]=0;A[e|56]=u>>>21&255;A[e|57]=u>>>13&255;A[e|58]=u>>>5&255;A[e|59]=u<<3&255|c>>>29;A[e|60]=c>>>21&255;A[e|61]=c>>>13&255;A[e|62]=c>>>5&255;A[e|63]=c<<3&255;_(e);if(~r)k(r);return i|0}function B(){i=h;n=f;a=d;s=l;o=p;c=64;u=0}function P(){i=y;n=g;a=b;s=m;o=w;c=64;u=0}function M(e,t,r,A,_,k,S,C,I,B,P,M,D,x,K,U){e=e|0;t=t|0;r=r|0;A=A|0;_=_|0;k=k|0;S=S|0;C=C|0;I=I|0;B=B|0;P=P|0;M=M|0;D=D|0;x=x|0;K=K|0;U=U|0;E();v(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,A^0x5c5c5c5c,_^0x5c5c5c5c,k^0x5c5c5c5c,S^0x5c5c5c5c,C^0x5c5c5c5c,I^0x5c5c5c5c,B^0x5c5c5c5c,P^0x5c5c5c5c,M^0x5c5c5c5c,D^0x5c5c5c5c,x^0x5c5c5c5c,K^0x5c5c5c5c,U^0x5c5c5c5c);y=i;g=n;b=a;m=s;w=o;E();v(e^0x36363636,t^0x36363636,r^0x36363636,A^0x36363636,_^0x36363636,k^0x36363636,S^0x36363636,C^0x36363636,I^0x36363636,B^0x36363636,P^0x36363636,M^0x36363636,D^0x36363636,x^0x36363636,K^0x36363636,U^0x36363636);h=i;f=n;d=a;l=s;p=o;c=64;u=0}function D(e,t,r){e=e|0;t=t|0;r=r|0;var c=0,u=0,h=0,f=0,d=0,l=0;if(e&63)return-1;if(~r)if(r&31)return-1;l=I(e,t,-1)|0;c=i,u=n,h=a,f=s,d=o;P();v(c,u,h,f,d,0x80000000,0,0,0,0,0,0,0,0,0,672);if(~r)k(r);return l|0}function x(e,t,r,c,u){e=e|0;t=t|0;r=r|0;c=c|0;u=u|0;var h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0;if(e&63)return-1;if(~u)if(u&31)return-1;A[e+t|0]=r>>>24;A[e+t+1|0]=r>>>16&255;A[e+t+2|0]=r>>>8&255;A[e+t+3|0]=r&255;D(e,t+4|0,-1)|0;h=y=i,f=g=n,d=b=a,l=m=s,p=w=o;c=c-1|0;while((c|0)>0){B();v(y,g,b,m,w,0x80000000,0,0,0,0,0,0,0,0,0,672);y=i,g=n,b=a,m=s,w=o;P();v(y,g,b,m,w,0x80000000,0,0,0,0,0,0,0,0,0,672);y=i,g=n,b=a,m=s,w=o;h=h^i;f=f^n;d=d^a;l=l^s;p=p^o;c=c-1|0}i=h;n=f;a=d;s=l;o=p;if(~u)k(u);return 0}return{reset:E,init:S,process:C,finish:I,hmac_reset:B,hmac_init:M,hmac_finish:D,pbkdf2_generate_block:x}};class We{constructor(){this.pos=0,this.len=0}reset(){const{asm:e}=this.acquire_asm();return this.result=null,this.pos=0,this.len=0,e.reset(),this}process(e){if(null!==this.result)throw new Ae("state must be reset before processing new data");const{asm:t,heap:r}=this.acquire_asm();let i=this.pos,n=this.len,a=0,s=e.length,o=0;for(;s>0;)o=me(r,i+n,e,a,s),n+=o,a+=o,s-=o,o=t.process(i,n),i+=o,n-=o,n||(i=0);return this.pos=i,this.len=n,this}finish(){if(null!==this.result)throw new Ae("state must be reset before processing new data");const{asm:e,heap:t}=this.acquire_asm();return e.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(t.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const Ve=[],Je=[];class Ye extends We{constructor(){super(),this.NAME="sha1",this.BLOCK_SIZE=64,this.HASH_SIZE=20,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=Ve.pop()||be(),this.asm=Je.pop()||Ge({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(Ve.push(this.heap),Je.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return(new Ye).process(e).finish().result}}Ye.NAME="sha1",Ye.heap_pool=[],Ye.asm_pool=[],Ye.asm_function=Ge;const Ze=[],Xe=[];class $e extends We{constructor(){super(),this.NAME="sha256",this.BLOCK_SIZE=64,this.HASH_SIZE=32,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=Ze.pop()||be(),this.asm=Xe.pop()||function(e,t,r){"use asm";var i=0,n=0,a=0,s=0,o=0,c=0,u=0,h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0,A=0,v=0,_=0,k=0,E=0,S=0,C=0,I=0,B=0,P=new e.Uint8Array(r);function M(e,t,r,f,d,l,p,y,g,b,m,w,A,v,_,k){e=e|0;t=t|0;r=r|0;f=f|0;d=d|0;l=l|0;p=p|0;y=y|0;g=g|0;b=b|0;m=m|0;w=w|0;A=A|0;v=v|0;_=_|0;k=k|0;var E=0,S=0,C=0,I=0,B=0,P=0,M=0,D=0;E=i;S=n;C=a;I=s;B=o;P=c;M=u;D=h;D=e+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0x428a2f98|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;M=t+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0x71374491|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;P=r+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0xb5c0fbcf|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;B=f+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0xe9b5dba5|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;I=d+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0x3956c25b|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;C=l+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0x59f111f1|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;S=p+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0x923f82a4|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;E=y+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0xab1c5ed5|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;D=g+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0xd807aa98|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;M=b+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0x12835b01|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;P=m+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0x243185be|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;B=w+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0x550c7dc3|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;I=A+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0x72be5d74|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;C=v+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0x80deb1fe|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;S=_+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0x9bdc06a7|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;E=k+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0xc19bf174|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(_>>>17^_>>>19^_>>>10^_<<15^_<<13)+e+b|0;D=e+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0xe49b69c1|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(k>>>17^k>>>19^k>>>10^k<<15^k<<13)+t+m|0;M=t+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0xefbe4786|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;r=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+w|0;P=r+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0x0fc19dc6|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+f+A|0;B=f+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0x240ca1cc|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;d=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+d+v|0;I=d+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0x2de92c6f|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;l=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+l+_|0;C=l+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0x4a7484aa|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;p=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+p+k|0;S=p+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0x5cb0a9dc|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+y+e|0;E=y+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0x76f988da|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;g=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+g+t|0;D=g+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0x983e5152|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;b=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+r|0;M=b+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0xa831c66d|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;m=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0;P=m+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0xb00327c8|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;w=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+w+d|0;B=w+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0xbf597fc7|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;A=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+A+l|0;I=A+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0xc6e00bf3|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;v=(_>>>7^_>>>18^_>>>3^_<<25^_<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+v+p|0;C=v+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0xd5a79147|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;_=(k>>>7^k>>>18^k>>>3^k<<25^k<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+_+y|0;S=_+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0x06ca6351|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;k=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+k+g|0;E=k+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0x14292967|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(_>>>17^_>>>19^_>>>10^_<<15^_<<13)+e+b|0;D=e+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0x27b70a85|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(k>>>17^k>>>19^k>>>10^k<<15^k<<13)+t+m|0;M=t+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0x2e1b2138|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;r=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+w|0;P=r+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0x4d2c6dfc|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+f+A|0;B=f+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0x53380d13|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;d=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+d+v|0;I=d+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0x650a7354|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;l=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+l+_|0;C=l+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0x766a0abb|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;p=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+p+k|0;S=p+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0x81c2c92e|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+y+e|0;E=y+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0x92722c85|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;g=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+g+t|0;D=g+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0xa2bfe8a1|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;b=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+r|0;M=b+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0xa81a664b|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;m=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0;P=m+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0xc24b8b70|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;w=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+w+d|0;B=w+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0xc76c51a3|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;A=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+A+l|0;I=A+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0xd192e819|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;v=(_>>>7^_>>>18^_>>>3^_<<25^_<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+v+p|0;C=v+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0xd6990624|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;_=(k>>>7^k>>>18^k>>>3^k<<25^k<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+_+y|0;S=_+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0xf40e3585|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;k=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+k+g|0;E=k+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0x106aa070|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(_>>>17^_>>>19^_>>>10^_<<15^_<<13)+e+b|0;D=e+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0x19a4c116|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(k>>>17^k>>>19^k>>>10^k<<15^k<<13)+t+m|0;M=t+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0x1e376c08|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;r=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+w|0;P=r+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0x2748774c|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+f+A|0;B=f+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0x34b0bcb5|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;d=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+d+v|0;I=d+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0x391c0cb3|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;l=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+l+_|0;C=l+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0x4ed8aa4a|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;p=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+p+k|0;S=p+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0x5b9cca4f|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+y+e|0;E=y+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0x682e6ff3|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;g=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+g+t|0;D=g+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0x748f82ee|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;b=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+r|0;M=b+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0x78a5636f|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;m=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0;P=m+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0x84c87814|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;w=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+w+d|0;B=w+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0x8cc70208|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;A=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+A+l|0;I=A+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0x90befffa|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;v=(_>>>7^_>>>18^_>>>3^_<<25^_<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+v+p|0;C=v+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0xa4506ceb|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;_=(k>>>7^k>>>18^k>>>3^k<<25^k<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+_+y|0;S=_+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0xbef9a3f7|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;k=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+k+g|0;E=k+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0xc67178f2|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;i=i+E|0;n=n+S|0;a=a+C|0;s=s+I|0;o=o+B|0;c=c+P|0;u=u+M|0;h=h+D|0}function D(e){e=e|0;M(P[e|0]<<24|P[e|1]<<16|P[e|2]<<8|P[e|3],P[e|4]<<24|P[e|5]<<16|P[e|6]<<8|P[e|7],P[e|8]<<24|P[e|9]<<16|P[e|10]<<8|P[e|11],P[e|12]<<24|P[e|13]<<16|P[e|14]<<8|P[e|15],P[e|16]<<24|P[e|17]<<16|P[e|18]<<8|P[e|19],P[e|20]<<24|P[e|21]<<16|P[e|22]<<8|P[e|23],P[e|24]<<24|P[e|25]<<16|P[e|26]<<8|P[e|27],P[e|28]<<24|P[e|29]<<16|P[e|30]<<8|P[e|31],P[e|32]<<24|P[e|33]<<16|P[e|34]<<8|P[e|35],P[e|36]<<24|P[e|37]<<16|P[e|38]<<8|P[e|39],P[e|40]<<24|P[e|41]<<16|P[e|42]<<8|P[e|43],P[e|44]<<24|P[e|45]<<16|P[e|46]<<8|P[e|47],P[e|48]<<24|P[e|49]<<16|P[e|50]<<8|P[e|51],P[e|52]<<24|P[e|53]<<16|P[e|54]<<8|P[e|55],P[e|56]<<24|P[e|57]<<16|P[e|58]<<8|P[e|59],P[e|60]<<24|P[e|61]<<16|P[e|62]<<8|P[e|63])}function x(e){e=e|0;P[e|0]=i>>>24;P[e|1]=i>>>16&255;P[e|2]=i>>>8&255;P[e|3]=i&255;P[e|4]=n>>>24;P[e|5]=n>>>16&255;P[e|6]=n>>>8&255;P[e|7]=n&255;P[e|8]=a>>>24;P[e|9]=a>>>16&255;P[e|10]=a>>>8&255;P[e|11]=a&255;P[e|12]=s>>>24;P[e|13]=s>>>16&255;P[e|14]=s>>>8&255;P[e|15]=s&255;P[e|16]=o>>>24;P[e|17]=o>>>16&255;P[e|18]=o>>>8&255;P[e|19]=o&255;P[e|20]=c>>>24;P[e|21]=c>>>16&255;P[e|22]=c>>>8&255;P[e|23]=c&255;P[e|24]=u>>>24;P[e|25]=u>>>16&255;P[e|26]=u>>>8&255;P[e|27]=u&255;P[e|28]=h>>>24;P[e|29]=h>>>16&255;P[e|30]=h>>>8&255;P[e|31]=h&255}function K(){i=0x6a09e667;n=0xbb67ae85;a=0x3c6ef372;s=0xa54ff53a;o=0x510e527f;c=0x9b05688c;u=0x1f83d9ab;h=0x5be0cd19;f=d=0}function U(e,t,r,l,p,y,g,b,m,w){e=e|0;t=t|0;r=r|0;l=l|0;p=p|0;y=y|0;g=g|0;b=b|0;m=m|0;w=w|0;i=e;n=t;a=r;s=l;o=p;c=y;u=g;h=b;f=m;d=w}function R(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){D(e);e=e+64|0;t=t-64|0;r=r+64|0}f=f+r|0;if(f>>>0<r>>>0)d=d+1|0;return r|0}function T(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){i=R(e,t)|0;if((i|0)==-1)return-1;e=e+i|0;t=t-i|0}i=i+t|0;f=f+t|0;if(f>>>0<t>>>0)d=d+1|0;P[e|t]=0x80;if((t|0)>=56){for(n=t+1|0;(n|0)<64;n=n+1|0)P[e|n]=0x00;D(e);t=0;P[e|0]=0}for(n=t+1|0;(n|0)<59;n=n+1|0)P[e|n]=0;P[e|56]=d>>>21&255;P[e|57]=d>>>13&255;P[e|58]=d>>>5&255;P[e|59]=d<<3&255|f>>>29;P[e|60]=f>>>21&255;P[e|61]=f>>>13&255;P[e|62]=f>>>5&255;P[e|63]=f<<3&255;D(e);if(~r)x(r);return i|0}function Q(){i=l;n=p;a=y;s=g;o=b;c=m;u=w;h=A;f=64;d=0}function z(){i=v;n=_;a=k;s=E;o=S;c=C;u=I;h=B;f=64;d=0}function F(e,t,r,P,D,x,U,R,T,Q,z,F,L,N,q,O){e=e|0;t=t|0;r=r|0;P=P|0;D=D|0;x=x|0;U=U|0;R=R|0;T=T|0;Q=Q|0;z=z|0;F=F|0;L=L|0;N=N|0;q=q|0;O=O|0;K();M(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,P^0x5c5c5c5c,D^0x5c5c5c5c,x^0x5c5c5c5c,U^0x5c5c5c5c,R^0x5c5c5c5c,T^0x5c5c5c5c,Q^0x5c5c5c5c,z^0x5c5c5c5c,F^0x5c5c5c5c,L^0x5c5c5c5c,N^0x5c5c5c5c,q^0x5c5c5c5c,O^0x5c5c5c5c);v=i;_=n;k=a;E=s;S=o;C=c;I=u;B=h;K();M(e^0x36363636,t^0x36363636,r^0x36363636,P^0x36363636,D^0x36363636,x^0x36363636,U^0x36363636,R^0x36363636,T^0x36363636,Q^0x36363636,z^0x36363636,F^0x36363636,L^0x36363636,N^0x36363636,q^0x36363636,O^0x36363636);l=i;p=n;y=a;g=s;b=o;m=c;w=u;A=h;f=64;d=0}function L(e,t,r){e=e|0;t=t|0;r=r|0;var f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0;if(e&63)return-1;if(~r)if(r&31)return-1;w=T(e,t,-1)|0;f=i,d=n,l=a,p=s,y=o,g=c,b=u,m=h;z();M(f,d,l,p,y,g,b,m,0x80000000,0,0,0,0,0,0,768);if(~r)x(r);return w|0}function N(e,t,r,f,d){e=e|0;t=t|0;r=r|0;f=f|0;d=d|0;var l=0,p=0,y=0,g=0,b=0,m=0,w=0,A=0,v=0,_=0,k=0,E=0,S=0,C=0,I=0,B=0;if(e&63)return-1;if(~d)if(d&31)return-1;P[e+t|0]=r>>>24;P[e+t+1|0]=r>>>16&255;P[e+t+2|0]=r>>>8&255;P[e+t+3|0]=r&255;L(e,t+4|0,-1)|0;l=v=i,p=_=n,y=k=a,g=E=s,b=S=o,m=C=c,w=I=u,A=B=h;f=f-1|0;while((f|0)>0){Q();M(v,_,k,E,S,C,I,B,0x80000000,0,0,0,0,0,0,768);v=i,_=n,k=a,E=s,S=o,C=c,I=u,B=h;z();M(v,_,k,E,S,C,I,B,0x80000000,0,0,0,0,0,0,768);v=i,_=n,k=a,E=s,S=o,C=c,I=u,B=h;l=l^i;p=p^n;y=y^a;g=g^s;b=b^o;m=m^c;w=w^u;A=A^h;f=f-1|0}i=l;n=p;a=y;s=g;o=b;c=m;u=w;h=A;if(~d)x(d);return 0}return{reset:K,init:U,process:R,finish:T,hmac_reset:Q,hmac_init:F,hmac_finish:L,pbkdf2_generate_block:N}}({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(Ze.push(this.heap),Xe.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return(new $e).process(e).finish().result}}$e.NAME="sha256";var et=tt;function tt(e,t){if(!e)throw Error(t||"Assertion failed")}tt.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)};var rt=void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function it(e,t){return e(t={exports:{}},t.exports),t.exports}function nt(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var at=it((function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}));var st=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var i=0;i<e.length;i++){var n=e.charCodeAt(i),a=n>>8,s=255&n;a?r.push(a,s):r.push(s)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r};var ot=function(e){for(var t="",r=0;r<e.length;r++)t+=ht(e[r].toString(16));return t};function ct(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}var ut=function(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];"little"===t&&(n=ct(n)),r+=ft(n.toString(16))}return r};function ht(e){return 1===e.length?"0"+e:e}function ft(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var dt=function(e,t,r,i){var n=r-t;et(n%4==0);for(var a=Array(n/4),s=0,o=t;s<a.length;s++,o+=4){var c;c="big"===i?e[o]<<24|e[o+1]<<16|e[o+2]<<8|e[o+3]:e[o+3]<<24|e[o+2]<<16|e[o+1]<<8|e[o],a[s]=c>>>0}return a};var lt=function(e,t){for(var r=Array(4*e.length),i=0,n=0;i<e.length;i++,n+=4){var a=e[i];"big"===t?(r[n]=a>>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r};var pt={inherits:at,toArray:st,toHex:ot,htonl:ct,toHex32:ut,zero2:ht,zero8:ft,join32:dt,split32:lt,rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<<t|e>>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,i){return e+t+r+i>>>0},sum32_5:function(e,t,r,i,n){return e+t+r+i+n>>>0},sum64:function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,s=(a<i?1:0)+r+n;e[t]=s>>>0,e[t+1]=a},sum64_hi:function(e,t,r,i){return(t+i>>>0<t?1:0)+e+r>>>0},sum64_lo:function(e,t,r,i){return t+i>>>0},sum64_4_hi:function(e,t,r,i,n,a,s,o){var c=0,u=t;return c+=(u=u+i>>>0)<t?1:0,c+=(u=u+a>>>0)<a?1:0,e+r+n+s+(c+=(u=u+o>>>0)<o?1:0)>>>0},sum64_4_lo:function(e,t,r,i,n,a,s,o){return t+i+a+o>>>0},sum64_5_hi:function(e,t,r,i,n,a,s,o,c,u){var h=0,f=t;return h+=(f=f+i>>>0)<t?1:0,h+=(f=f+a>>>0)<a?1:0,h+=(f=f+o>>>0)<o?1:0,e+r+n+s+c+(h+=(f=f+u>>>0)<u?1:0)>>>0},sum64_5_lo:function(e,t,r,i,n,a,s,o,c,u){return t+i+a+o+u>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function yt(){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}var gt=yt;yt.prototype.update=function(e,t){if(e=pt.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=pt.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},yt.prototype.digest=function(e){return this.update(this._pad()),et(null===this.pending),this._digest(e)},yt.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,i=Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(e<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=e>>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,a=8;a<this.padLength;a++)i[n++]=0;return i};var bt={BlockHash:gt},mt=pt.rotr32;var wt=function(e,t,r,i){return 0===e?At(t,r,i):1===e||3===e?_t(t,r,i):2===e?vt(t,r,i):void 0};function At(e,t,r){return e&t^~e&r}function vt(e,t,r){return e&t^e&r^t&r}function _t(e,t,r){return e^t^r}var kt={ft_1:wt,ch32:At,maj32:vt,p32:_t,s0_256:function(e){return mt(e,2)^mt(e,13)^mt(e,22)},s1_256:function(e){return mt(e,6)^mt(e,11)^mt(e,25)},g0_256:function(e){return mt(e,7)^mt(e,18)^e>>>3},g1_256:function(e){return mt(e,17)^mt(e,19)^e>>>10}},Et=pt.sum32,St=pt.sum32_4,Ct=pt.sum32_5,It=kt.ch32,Bt=kt.maj32,Pt=kt.s0_256,Mt=kt.s1_256,Dt=kt.g0_256,xt=kt.g1_256,Kt=bt.BlockHash,Ut=[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 Rt(){if(!(this instanceof Rt))return new Rt;Kt.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Ut,this.W=Array(64)}pt.inherits(Rt,Kt);var Tt=Rt;function Qt(){if(!(this instanceof Qt))return new Qt;Tt.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Rt.blockSize=512,Rt.outSize=256,Rt.hmacStrength=192,Rt.padLength=64,Rt.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=St(xt(r[i-2]),r[i-7],Dt(r[i-15]),r[i-16]);var n=this.h[0],a=this.h[1],s=this.h[2],o=this.h[3],c=this.h[4],u=this.h[5],h=this.h[6],f=this.h[7];for(et(this.k.length===r.length),i=0;i<r.length;i++){var d=Ct(f,Mt(c),It(c,u,h),this.k[i],r[i]),l=Et(Pt(n),Bt(n,a,s));f=h,h=u,u=c,c=Et(o,d),o=s,s=a,a=n,n=Et(d,l)}this.h[0]=Et(this.h[0],n),this.h[1]=Et(this.h[1],a),this.h[2]=Et(this.h[2],s),this.h[3]=Et(this.h[3],o),this.h[4]=Et(this.h[4],c),this.h[5]=Et(this.h[5],u),this.h[6]=Et(this.h[6],h),this.h[7]=Et(this.h[7],f)},Rt.prototype._digest=function(e){return"hex"===e?pt.toHex32(this.h,"big"):pt.split32(this.h,"big")},pt.inherits(Qt,Tt);var zt=Qt;Qt.blockSize=512,Qt.outSize=224,Qt.hmacStrength=192,Qt.padLength=64,Qt.prototype._digest=function(e){return"hex"===e?pt.toHex32(this.h.slice(0,7),"big"):pt.split32(this.h.slice(0,7),"big")};var Ft=pt.rotr64_hi,Lt=pt.rotr64_lo,Nt=pt.shr64_hi,qt=pt.shr64_lo,Ot=pt.sum64,Ht=pt.sum64_hi,jt=pt.sum64_lo,Gt=pt.sum64_4_hi,Wt=pt.sum64_4_lo,Vt=pt.sum64_5_hi,Jt=pt.sum64_5_lo,Yt=bt.BlockHash,Zt=[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 Xt(){if(!(this instanceof Xt))return new Xt;Yt.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Zt,this.W=Array(160)}pt.inherits(Xt,Yt);var $t=Xt;function er(e,t,r,i,n){var a=e&r^~e&n;return a<0&&(a+=4294967296),a}function tr(e,t,r,i,n,a){var s=t&i^~t&a;return s<0&&(s+=4294967296),s}function rr(e,t,r,i,n){var a=e&r^e&n^r&n;return a<0&&(a+=4294967296),a}function ir(e,t,r,i,n,a){var s=t&i^t&a^i&a;return s<0&&(s+=4294967296),s}function nr(e,t){var r=Ft(e,t,28)^Ft(t,e,2)^Ft(t,e,7);return r<0&&(r+=4294967296),r}function ar(e,t){var r=Lt(e,t,28)^Lt(t,e,2)^Lt(t,e,7);return r<0&&(r+=4294967296),r}function sr(e,t){var r=Ft(e,t,14)^Ft(e,t,18)^Ft(t,e,9);return r<0&&(r+=4294967296),r}function or(e,t){var r=Lt(e,t,14)^Lt(e,t,18)^Lt(t,e,9);return r<0&&(r+=4294967296),r}function cr(e,t){var r=Ft(e,t,1)^Ft(e,t,8)^Nt(e,t,7);return r<0&&(r+=4294967296),r}function ur(e,t){var r=Lt(e,t,1)^Lt(e,t,8)^qt(e,t,7);return r<0&&(r+=4294967296),r}function hr(e,t){var r=Ft(e,t,19)^Ft(t,e,29)^Nt(e,t,6);return r<0&&(r+=4294967296),r}function fr(e,t){var r=Lt(e,t,19)^Lt(t,e,29)^qt(e,t,6);return r<0&&(r+=4294967296),r}function dr(){if(!(this instanceof dr))return new dr;$t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Xt.blockSize=1024,Xt.outSize=512,Xt.hmacStrength=192,Xt.padLength=128,Xt.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i<r.length;i+=2){var n=hr(r[i-4],r[i-3]),a=fr(r[i-4],r[i-3]),s=r[i-14],o=r[i-13],c=cr(r[i-30],r[i-29]),u=ur(r[i-30],r[i-29]),h=r[i-32],f=r[i-31];r[i]=Gt(n,a,s,o,c,u,h,f),r[i+1]=Wt(n,a,s,o,c,u,h,f)}},Xt.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,i=this.h[0],n=this.h[1],a=this.h[2],s=this.h[3],o=this.h[4],c=this.h[5],u=this.h[6],h=this.h[7],f=this.h[8],d=this.h[9],l=this.h[10],p=this.h[11],y=this.h[12],g=this.h[13],b=this.h[14],m=this.h[15];et(this.k.length===r.length);for(var w=0;w<r.length;w+=2){var A=b,v=m,_=sr(f,d),k=or(f,d),E=er(f,d,l,p,y),S=tr(f,d,l,p,y,g),C=this.k[w],I=this.k[w+1],B=r[w],P=r[w+1],M=Vt(A,v,_,k,E,S,C,I,B,P),D=Jt(A,v,_,k,E,S,C,I,B,P);A=nr(i,n),v=ar(i,n),_=rr(i,n,a,s,o),k=ir(i,n,a,s,o,c);var x=Ht(A,v,_,k),K=jt(A,v,_,k);b=y,m=g,y=l,g=p,l=f,p=d,f=Ht(u,h,M,D),d=jt(h,h,M,D),u=o,h=c,o=a,c=s,a=i,s=n,i=Ht(M,D,x,K),n=jt(M,D,x,K)}Ot(this.h,0,i,n),Ot(this.h,2,a,s),Ot(this.h,4,o,c),Ot(this.h,6,u,h),Ot(this.h,8,f,d),Ot(this.h,10,l,p),Ot(this.h,12,y,g),Ot(this.h,14,b,m)},Xt.prototype._digest=function(e){return"hex"===e?pt.toHex32(this.h,"big"):pt.split32(this.h,"big")},pt.inherits(dr,$t);var lr=dr;dr.blockSize=1024,dr.outSize=384,dr.hmacStrength=192,dr.padLength=128,dr.prototype._digest=function(e){return"hex"===e?pt.toHex32(this.h.slice(0,12),"big"):pt.split32(this.h.slice(0,12),"big")};var pr=pt.rotl32,yr=pt.sum32,gr=pt.sum32_3,br=pt.sum32_4,mr=bt.BlockHash;function wr(){if(!(this instanceof wr))return new wr;mr.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}pt.inherits(wr,mr);var Ar=wr;function vr(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function _r(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function kr(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}wr.blockSize=512,wr.outSize=160,wr.hmacStrength=192,wr.padLength=64,wr.prototype._update=function(e,t){for(var r=this.h[0],i=this.h[1],n=this.h[2],a=this.h[3],s=this.h[4],o=r,c=i,u=n,h=a,f=s,d=0;d<80;d++){var l=yr(pr(br(r,vr(d,i,n,a),e[Er[d]+t],_r(d)),Cr[d]),s);r=s,s=a,a=pr(n,10),n=i,i=l,l=yr(pr(br(o,vr(79-d,c,u,h),e[Sr[d]+t],kr(d)),Ir[d]),f),o=f,f=h,h=pr(u,10),u=c,c=l}l=gr(this.h[1],n,h),this.h[1]=gr(this.h[2],a,f),this.h[2]=gr(this.h[3],s,o),this.h[3]=gr(this.h[4],r,c),this.h[4]=gr(this.h[0],i,u),this.h[0]=l},wr.prototype._digest=function(e){return"hex"===e?pt.toHex32(this.h,"little"):pt.split32(this.h,"little")};var Er=[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],Sr=[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],Cr=[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],Ir=[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],Br={ripemd160:Ar};function Pr(e,t){let r=e[0],i=e[1],n=e[2],a=e[3];r=Dr(r,i,n,a,t[0],7,-680876936),a=Dr(a,r,i,n,t[1],12,-389564586),n=Dr(n,a,r,i,t[2],17,606105819),i=Dr(i,n,a,r,t[3],22,-1044525330),r=Dr(r,i,n,a,t[4],7,-176418897),a=Dr(a,r,i,n,t[5],12,1200080426),n=Dr(n,a,r,i,t[6],17,-1473231341),i=Dr(i,n,a,r,t[7],22,-45705983),r=Dr(r,i,n,a,t[8],7,1770035416),a=Dr(a,r,i,n,t[9],12,-1958414417),n=Dr(n,a,r,i,t[10],17,-42063),i=Dr(i,n,a,r,t[11],22,-1990404162),r=Dr(r,i,n,a,t[12],7,1804603682),a=Dr(a,r,i,n,t[13],12,-40341101),n=Dr(n,a,r,i,t[14],17,-1502002290),i=Dr(i,n,a,r,t[15],22,1236535329),r=xr(r,i,n,a,t[1],5,-165796510),a=xr(a,r,i,n,t[6],9,-1069501632),n=xr(n,a,r,i,t[11],14,643717713),i=xr(i,n,a,r,t[0],20,-373897302),r=xr(r,i,n,a,t[5],5,-701558691),a=xr(a,r,i,n,t[10],9,38016083),n=xr(n,a,r,i,t[15],14,-660478335),i=xr(i,n,a,r,t[4],20,-405537848),r=xr(r,i,n,a,t[9],5,568446438),a=xr(a,r,i,n,t[14],9,-1019803690),n=xr(n,a,r,i,t[3],14,-187363961),i=xr(i,n,a,r,t[8],20,1163531501),r=xr(r,i,n,a,t[13],5,-1444681467),a=xr(a,r,i,n,t[2],9,-51403784),n=xr(n,a,r,i,t[7],14,1735328473),i=xr(i,n,a,r,t[12],20,-1926607734),r=Kr(r,i,n,a,t[5],4,-378558),a=Kr(a,r,i,n,t[8],11,-2022574463),n=Kr(n,a,r,i,t[11],16,1839030562),i=Kr(i,n,a,r,t[14],23,-35309556),r=Kr(r,i,n,a,t[1],4,-1530992060),a=Kr(a,r,i,n,t[4],11,1272893353),n=Kr(n,a,r,i,t[7],16,-155497632),i=Kr(i,n,a,r,t[10],23,-1094730640),r=Kr(r,i,n,a,t[13],4,681279174),a=Kr(a,r,i,n,t[0],11,-358537222),n=Kr(n,a,r,i,t[3],16,-722521979),i=Kr(i,n,a,r,t[6],23,76029189),r=Kr(r,i,n,a,t[9],4,-640364487),a=Kr(a,r,i,n,t[12],11,-421815835),n=Kr(n,a,r,i,t[15],16,530742520),i=Kr(i,n,a,r,t[2],23,-995338651),r=Ur(r,i,n,a,t[0],6,-198630844),a=Ur(a,r,i,n,t[7],10,1126891415),n=Ur(n,a,r,i,t[14],15,-1416354905),i=Ur(i,n,a,r,t[5],21,-57434055),r=Ur(r,i,n,a,t[12],6,1700485571),a=Ur(a,r,i,n,t[3],10,-1894986606),n=Ur(n,a,r,i,t[10],15,-1051523),i=Ur(i,n,a,r,t[1],21,-2054922799),r=Ur(r,i,n,a,t[8],6,1873313359),a=Ur(a,r,i,n,t[15],10,-30611744),n=Ur(n,a,r,i,t[6],15,-1560198380),i=Ur(i,n,a,r,t[13],21,1309151649),r=Ur(r,i,n,a,t[4],6,-145523070),a=Ur(a,r,i,n,t[11],10,-1120210379),n=Ur(n,a,r,i,t[2],15,718787259),i=Ur(i,n,a,r,t[9],21,-343485551),e[0]=zr(r,e[0]),e[1]=zr(i,e[1]),e[2]=zr(n,e[2]),e[3]=zr(a,e[3])}function Mr(e,t,r,i,n,a){return t=zr(zr(t,e),zr(i,a)),zr(t<<n|t>>>32-n,r)}function Dr(e,t,r,i,n,a,s){return Mr(t&r|~t&i,e,t,n,a,s)}function xr(e,t,r,i,n,a,s){return Mr(t&i|r&~i,e,t,n,a,s)}function Kr(e,t,r,i,n,a,s){return Mr(t^r^i,e,t,n,a,s)}function Ur(e,t,r,i,n,a,s){return Mr(r^(t|~i),e,t,n,a,s)}function Rr(e){const t=[];let r;for(r=0;r<64;r+=4)t[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return t}const Tr="0123456789abcdef".split("");function Qr(e){let t="",r=0;for(;r<4;r++)t+=Tr[e>>8*r+4&15]+Tr[e>>8*r&15];return t}function zr(e,t){return e+t&4294967295}const Fr=Y.getWebCrypto(),Lr=Y.getNodeCrypto(),Nr=Lr&&Lr.getHashes();function qr(e){if(Lr&&Nr.includes(e))return async function(t){const r=Lr.createHash(e);return R(t,(e=>{r.update(e)}),(()=>new Uint8Array(r.digest())))}}function Or(e,t){return async function(r,i=ne){if(s(r)&&(r=await q(r)),!Y.isStream(r)&&Fr&&t&&r.length>=i.minBytesForWebCrypto)return new Uint8Array(await Fr.digest(t,r));const n=e();return R(r,(e=>{n.update(e)}),(()=>new Uint8Array(n.digest())))}}function Hr(e,t){return async function(r,i=ne){if(s(r)&&(r=await q(r)),Y.isStream(r)){const t=new e;return R(r,(e=>{t.process(e)}),(()=>t.finish().result))}return Fr&&t&&r.length>=i.minBytesForWebCrypto?new Uint8Array(await Fr.digest(t,r)):e.bytes(r)}}const jr={md5:qr("md5")||async function(e){const t=function(e){const t=e.length,r=[1732584193,-271733879,-1732584194,271733878];let i;for(i=64;i<=e.length;i+=64)Pr(r,Rr(e.substring(i-64,i)));e=e.substring(i-64);const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<e.length;i++)n[i>>2]|=e.charCodeAt(i)<<(i%4<<3);if(n[i>>2]|=128<<(i%4<<3),i>55)for(Pr(r,n),i=0;i<16;i++)n[i]=0;return n[14]=8*t,Pr(r,n),r}(Y.uint8ArrayToString(e));return Y.hexToUint8Array(function(e){for(let t=0;t<e.length;t++)e[t]=Qr(e[t]);return e.join("")}(t))},sha1:qr("sha1")||Hr(Ye,"SHA-1"),sha224:qr("sha224")||Or(zt),sha256:qr("sha256")||Hr($e,"SHA-256"),sha384:qr("sha384")||Or(lr,"SHA-384"),sha512:qr("sha512")||Or($t,"SHA-512"),ripemd:qr("ripemd160")||Or(Ar)};var Gr={md5:jr.md5,sha1:jr.sha1,sha224:jr.sha224,sha256:jr.sha256,sha384:jr.sha384,sha512:jr.sha512,ripemd:jr.ripemd,digest:function(e,t){switch(e){case V.hash.md5:return this.md5(t);case V.hash.sha1:return this.sha1(t);case V.hash.ripemd:return this.ripemd(t);case V.hash.sha256:return this.sha256(t);case V.hash.sha384:return this.sha384(t);case V.hash.sha512:return this.sha512(t);case V.hash.sha224:return this.sha224(t);default:throw Error("Invalid hash function.")}},getHashByteLength:function(e){switch(e){case V.hash.md5:return 16;case V.hash.sha1:case V.hash.ripemd:return 20;case V.hash.sha256:return 32;case V.hash.sha384:return 48;case V.hash.sha512:return 64;case V.hash.sha224:return 28;default:throw Error("Invalid hash algorithm.")}},getBlockSize:function(e){switch(e){case V.hash.md5:case V.hash.sha1:case V.hash.ripemd:case V.hash.sha224:case V.hash.sha256:return 64;case V.hash.sha384:case V.hash.sha512:return 128;default:throw Error("Invalid hash algorithm.")}}};class Wr{static encrypt(e,t,r){return new Wr(t,r).encrypt(e)}static decrypt(e,t,r){return new Wr(t,r).decrypt(e)}constructor(e,t,r){this.aes=r||new Se(e,t,!0,"CFB"),delete this.aes.padding}encrypt(e){return we(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return we(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Vr(e){const t=V.read(V.symmetric,e);return je[t]}const Jr=Y.getWebCrypto(),Yr=Y.getNodeCrypto(),Zr=Yr?Yr.getCiphers():[],Xr={idea:Zr.includes("idea-cfb")?"idea-cfb":void 0,tripledes:Zr.includes("des-ede3-cfb")?"des-ede3-cfb":void 0,cast5:Zr.includes("cast5-cfb")?"cast5-cfb":void 0,blowfish:Zr.includes("bf-cfb")?"bf-cfb":void 0,aes128:Zr.includes("aes-128-cfb")?"aes-128-cfb":void 0,aes192:Zr.includes("aes-192-cfb")?"aes-192-cfb":void 0,aes256:Zr.includes("aes-256-cfb")?"aes-256-cfb":void 0};var $r=/*#__PURE__*/Object.freeze({__proto__:null,encrypt:async function(e,t,r,i,n){const a=V.read(V.symmetric,e);if(Y.getNodeCrypto()&&Xr[a])return function(e,t,r,i){const n=V.read(V.symmetric,e),a=new Yr.createCipheriv(Xr[n],t,i);return R(r,(e=>new Uint8Array(a.update(e))))}(e,t,r,i);if(Y.isAES(e))return function(e,t,r,i,n){if(Y.getWebCrypto()&&24!==t.length&&!Y.isStream(r)&&r.length>=3e3*n.minBytesForWebCrypto)return async function(e,t,r,i){const n="AES-CBC",a=await Jr.importKey("raw",t,{name:n},!1,["encrypt"]),{blockSize:s}=Vr(e),o=Y.concatUint8Array([new Uint8Array(s),r]),c=new Uint8Array(await Jr.encrypt({name:n,iv:i},a,o)).subarray(0,r.length);return function(e,t){for(let r=0;r<e.length;r++)e[r]=e[r]^t[r]}(c,r),c}(e,t,r,i);const a=new Wr(t,i);return R(r,(e=>a.aes.AES_Encrypt_process(e)),(()=>a.aes.AES_Encrypt_finish()))}(e,t,r,i,n);const s=new(Vr(e))(t),o=s.blockSize,c=i.slice();let u=new Uint8Array;const h=e=>{e&&(u=Y.concatUint8Array([u,e]));const t=new Uint8Array(u.length);let r,i=0;for(;e?u.length>=o:u.length;){const e=s.encrypt(c);for(r=0;r<o;r++)c[r]=u[r]^e[r],t[i++]=c[r];u=u.subarray(o)}return t.subarray(0,i)};return R(r,h,h)},decrypt:async function(e,t,r,i){const n=V.read(V.symmetric,e);if(Y.getNodeCrypto()&&Xr[n])return function(e,t,r,i){const n=V.read(V.symmetric,e),a=new Yr.createDecipheriv(Xr[n],t,i);return R(r,(e=>new Uint8Array(a.update(e))))}(e,t,r,i);if(Y.isAES(e))return function(e,t,r,i){if(Y.isStream(r)){const e=new Wr(t,i);return R(r,(t=>e.aes.AES_Decrypt_process(t)),(()=>e.aes.AES_Decrypt_finish()))}return Wr.decrypt(r,t,i)}(0,t,r,i);const a=new(Vr(e))(t),s=a.blockSize;let o=i,c=new Uint8Array;const u=e=>{e&&(c=Y.concatUint8Array([c,e]));const t=new Uint8Array(c.length);let r,i=0;for(;e?c.length>=s:c.length;){const e=a.encrypt(o);for(o=c.subarray(0,s),r=0;r<s;r++)t[i++]=o[r]^e[r];c=c.subarray(s)}return t.subarray(0,i)};return R(r,u,u)}});class ei{static encrypt(e,t,r){return new ei(t,r).encrypt(e)}static decrypt(e,t,r){return new ei(t,r).encrypt(e)}constructor(e,t,r){this.aes=r||new Se(e,void 0,!1,"CTR"),delete this.aes.padding,this.AES_CTR_set_options(t)}encrypt(e){return we(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return we(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}AES_CTR_set_options(e,t,r){let{asm:i}=this.aes.acquire_asm();if(void 0!==r){if(r<8||r>48)throw new ve("illegal counter size");let e=Math.pow(2,r)-1;i.set_mask(0,0,e/4294967296|0,0|e)}else r=48,i.set_mask(0,0,65535,4294967295);if(void 0===e)throw Error("nonce is required");{let t=e.length;if(!t||t>16)throw new ve("illegal nonce size");let r=new DataView(new ArrayBuffer(16));new Uint8Array(r.buffer).set(e),i.set_nonce(r.getUint32(0),r.getUint32(4),r.getUint32(8),r.getUint32(12))}if(void 0!==t){if(t<0||t>=Math.pow(2,r))throw new ve("illegal counter value");i.set_counter(0,0,t/4294967296|0,0|t)}}}class ti{static encrypt(e,t,r=!0,i){return new ti(t,i,r).encrypt(e)}static decrypt(e,t,r=!0,i){return new ti(t,i,r).decrypt(e)}constructor(e,t,r=!0,i){this.aes=i||new Se(e,t,r,"CBC")}encrypt(e){return we(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return we(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}const ri=Y.getWebCrypto(),ii=Y.getNodeCrypto(),ni=16;function ai(e,t){const r=e.length-ni;for(let i=0;i<ni;i++)e[i+r]^=t[i];return e}const si=new Uint8Array(ni);async function oi(e){const t=await async function(e){if(Y.getWebCrypto()&&24!==e.length)return e=await ri.importKey("raw",e,{name:"AES-CBC",length:8*e.length},!1,["encrypt"]),async function(t){const r=await ri.encrypt({name:"AES-CBC",iv:si,length:8*ni},e,t);return new Uint8Array(r).subarray(0,r.byteLength-ni)};if(Y.getNodeCrypto())return async function(t){const r=new ii.createCipheriv("aes-"+8*e.length+"-cbc",e,si).update(t);return new Uint8Array(r)};return async function(t){return ti.encrypt(t,e,!1,si)}}(e),r=Y.double(await t(si)),i=Y.double(r);return async function(e){return(await t(function(e,t,r){if(e.length&&e.length%ni==0)return ai(e,t);const i=new Uint8Array(e.length+(ni-e.length%ni));return i.set(e),i[e.length]=128,ai(i,r)}(e,r,i))).subarray(-ni)}}const ci=Y.getWebCrypto(),ui=Y.getNodeCrypto(),hi=Y.getNodeBuffer(),fi=16,di=fi,li=fi,pi=new Uint8Array(fi),yi=new Uint8Array(fi);yi[fi-1]=1;const gi=new Uint8Array(fi);async function bi(e){const t=await oi(e);return function(e,r){return t(Y.concatUint8Array([e,r]))}}async function mi(e){return Y.getWebCrypto()&&24!==e.length?(e=await ci.importKey("raw",e,{name:"AES-CTR",length:8*e.length},!1,["encrypt"]),async function(t,r){const i=await ci.encrypt({name:"AES-CTR",counter:r,length:8*fi},e,t);return new Uint8Array(i)}):Y.getNodeCrypto()?async function(t,r){const i=new ui.createCipheriv("aes-"+8*e.length+"-ctr",e,r),n=hi.concat([i.update(t),i.final()]);return new Uint8Array(n)}:async function(t,r){return ei.encrypt(t,e,r)}}async function wi(e,t){if(e!==V.symmetric.aes128&&e!==V.symmetric.aes192&&e!==V.symmetric.aes256)throw Error("EAX mode supports only AES cipher");const[r,i]=await Promise.all([bi(t),mi(t)]);return{encrypt:async function(e,t,n){const[a,s]=await Promise.all([r(pi,t),r(yi,n)]),o=await i(e,a),c=await r(gi,o);for(let e=0;e<li;e++)c[e]^=s[e]^a[e];return Y.concatUint8Array([o,c])},decrypt:async function(e,t,n){if(e.length<li)throw Error("Invalid EAX ciphertext");const a=e.subarray(0,-li),s=e.subarray(-li),[o,c,u]=await Promise.all([r(pi,t),r(yi,n),r(gi,a)]),h=u;for(let e=0;e<li;e++)h[e]^=c[e]^o[e];if(!Y.equalsUint8Array(s,h))throw Error("Authentication tag mismatch");return await i(a,o)}}}gi[fi-1]=2,wi.getNonce=function(e,t){const r=e.slice();for(let e=0;e<t.length;e++)r[8+e]^=t[e];return r},wi.blockLength=fi,wi.ivLength=di,wi.tagLength=li;const Ai=16,vi=15,_i=16;function ki(e){let t=0;for(let r=1;0==(e&r);r<<=1)t++;return t}function Ei(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r];return e}function Si(e,t){return Ei(e.slice(),t)}const Ci=new Uint8Array(Ai),Ii=new Uint8Array([1]);async function Bi(e,t){let r,i,n,a=0;function s(e,t,i,s){const o=t.length/Ai|0;!function(e,t){const r=Y.nbits(Math.max(e.length,t.length)/Ai|0)-1;for(let e=a+1;e<=r;e++)n[e]=Y.double(n[e-1]);a=r}(t,s);const c=Y.concatUint8Array([Ci.subarray(0,vi-i.length),Ii,i]),u=63&c[Ai-1];c[Ai-1]&=192;const h=r(c),f=Y.concatUint8Array([h,Si(h.subarray(0,8),h.subarray(1,9))]),d=Y.shiftRight(f.subarray(0+(u>>3),17+(u>>3)),8-(7&u)).subarray(1),l=new Uint8Array(Ai),p=new Uint8Array(t.length+_i);let y,g=0;for(y=0;y<o;y++)Ei(d,n[ki(y+1)]),p.set(Ei(e(Si(d,t)),d),g),Ei(l,e===r?t:p.subarray(g)),t=t.subarray(Ai),g+=Ai;if(t.length){Ei(d,n.x);const i=r(d);p.set(Si(t,i),g);const a=new Uint8Array(Ai);a.set(e===r?t:p.subarray(g,-_i),0),a[t.length]=128,Ei(l,a),g+=t.length}const b=Ei(r(Ei(Ei(l,d),n.$)),function(e){if(!e.length)return Ci;const t=e.length/Ai|0,i=new Uint8Array(Ai),a=new Uint8Array(Ai);for(let s=0;s<t;s++)Ei(i,n[ki(s+1)]),Ei(a,r(Si(i,e))),e=e.subarray(Ai);if(e.length){Ei(i,n.x);const t=new Uint8Array(Ai);t.set(e,0),t[e.length]=128,Ei(t,i),Ei(a,r(t))}return a}(s));return p.set(b,g),p}return function(e,t){const a=V.read(V.symmetric,e),s=new je[a](t);r=s.encrypt.bind(s),i=s.decrypt.bind(s);const o=r(Ci),c=Y.double(o);n=[],n[0]=Y.double(c),n.x=o,n.$=c}(e,t),{encrypt:async function(e,t,i){return s(r,e,t,i)},decrypt:async function(e,t,r){if(e.length<_i)throw Error("Invalid OCB ciphertext");const n=e.subarray(-_i);e=e.subarray(0,-_i);const a=s(i,e,t,r);if(Y.equalsUint8Array(n,a.subarray(-_i)))return a.subarray(0,-_i);throw Error("Authentication tag mismatch")}}}Bi.getNonce=function(e,t){const r=e.slice();for(let e=0;e<t.length;e++)r[7+e]^=t[e];return r},Bi.blockLength=Ai,Bi.ivLength=vi,Bi.tagLength=_i;const Pi=68719476704;class Mi{constructor(e,t,r,i=16,n){this.tagSize=i,this.gamma0=0,this.counter=1,this.aes=n||new Se(e,void 0,!1,"CTR");let{asm:a,heap:s}=this.aes.acquire_asm();if(a.gcm_init(),this.tagSize<4||this.tagSize>16)throw new ve("illegal tagSize value");const o=t.length||0,c=new Uint8Array(16);12!==o?(this._gcm_mac_process(t),s[0]=0,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=0,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=0,s[11]=o>>>29,s[12]=o>>>21&255,s[13]=o>>>13&255,s[14]=o>>>5&255,s[15]=o<<3&255,a.mac(ye.MAC.GCM,ye.HEAP_DATA,16),a.get_iv(ye.HEAP_DATA),a.set_iv(0,0,0,0),c.set(s.subarray(0,16))):(c.set(t),c[15]=1);const u=new DataView(c.buffer);if(this.gamma0=u.getUint32(12),a.set_nonce(u.getUint32(0),u.getUint32(4),u.getUint32(8),0),a.set_mask(0,0,0,4294967295),void 0!==r){if(r.length>Pi)throw new ve("illegal adata length");r.length?(this.adata=r,this._gcm_mac_process(r)):this.adata=void 0}else this.adata=void 0;if(this.counter<1||this.counter>4294967295)throw new RangeError("counter must be a positive 32-bit integer");a.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(e,t,r,i,n){return new Mi(t,r,i,n).encrypt(e)}static decrypt(e,t,r,i,n){return new Mi(t,r,i,n).decrypt(e)}encrypt(e){return this.AES_GCM_encrypt(e)}decrypt(e){return this.AES_GCM_decrypt(e)}AES_GCM_Encrypt_process(e){let t=0,r=e.length||0,{asm:i,heap:n}=this.aes.acquire_asm(),a=this.counter,s=this.aes.pos,o=this.aes.len,c=0,u=o+r&-16,h=0;if((a-1<<4)+o+r>Pi)throw new RangeError("counter overflow");const f=new Uint8Array(u);for(;r>0;)h=me(n,s+o,e,t,r),o+=h,t+=h,r-=h,h=i.cipher(ye.ENC.CTR,ye.HEAP_DATA+s,o),h=i.mac(ye.MAC.GCM,ye.HEAP_DATA+s,h),h&&f.set(n.subarray(s,s+h),c),a+=h>>>4,c+=h,h<o?(s+=h,o-=h):(s=0,o=0);return this.counter=a,this.aes.pos=s,this.aes.len=o,f}AES_GCM_Encrypt_finish(){let{asm:e,heap:t}=this.aes.acquire_asm(),r=this.counter,i=this.tagSize,n=this.adata,a=this.aes.pos,s=this.aes.len;const o=new Uint8Array(s+i);e.cipher(ye.ENC.CTR,ye.HEAP_DATA+a,s+15&-16),s&&o.set(t.subarray(a,a+s));let c=s;for(;15&c;c++)t[a+c]=0;e.mac(ye.MAC.GCM,ye.HEAP_DATA+a,c);const u=void 0!==n?n.length:0,h=(r-1<<4)+s;return t[0]=0,t[1]=0,t[2]=0,t[3]=u>>>29,t[4]=u>>>21,t[5]=u>>>13&255,t[6]=u>>>5&255,t[7]=u<<3&255,t[8]=t[9]=t[10]=0,t[11]=h>>>29,t[12]=h>>>21&255,t[13]=h>>>13&255,t[14]=h>>>5&255,t[15]=h<<3&255,e.mac(ye.MAC.GCM,ye.HEAP_DATA,16),e.get_iv(ye.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(ye.ENC.CTR,ye.HEAP_DATA,16),o.set(t.subarray(0,i),s),this.counter=1,this.aes.pos=0,this.aes.len=0,o}AES_GCM_Decrypt_process(e){let t=0,r=e.length||0,{asm:i,heap:n}=this.aes.acquire_asm(),a=this.counter,s=this.tagSize,o=this.aes.pos,c=this.aes.len,u=0,h=c+r>s?c+r-s&-16:0,f=c+r-h,d=0;if((a-1<<4)+c+r>Pi)throw new RangeError("counter overflow");const l=new Uint8Array(h);for(;r>f;)d=me(n,o+c,e,t,r-f),c+=d,t+=d,r-=d,d=i.mac(ye.MAC.GCM,ye.HEAP_DATA+o,d),d=i.cipher(ye.DEC.CTR,ye.HEAP_DATA+o,d),d&&l.set(n.subarray(o,o+d),u),a+=d>>>4,u+=d,o=0,c=0;return r>0&&(c+=me(n,0,e,t,r)),this.counter=a,this.aes.pos=o,this.aes.len=c,l}AES_GCM_Decrypt_finish(){let{asm:e,heap:t}=this.aes.acquire_asm(),r=this.tagSize,i=this.adata,n=this.counter,a=this.aes.pos,s=this.aes.len,o=s-r;if(s<r)throw new Ae("authentication tag not found");const c=new Uint8Array(o),u=new Uint8Array(t.subarray(a+o,a+s));let h=o;for(;15&h;h++)t[a+h]=0;e.mac(ye.MAC.GCM,ye.HEAP_DATA+a,h),e.cipher(ye.DEC.CTR,ye.HEAP_DATA+a,h),o&&c.set(t.subarray(a,a+o));const f=void 0!==i?i.length:0,d=(n-1<<4)+s-r;t[0]=0,t[1]=0,t[2]=0,t[3]=f>>>29,t[4]=f>>>21,t[5]=f>>>13&255,t[6]=f>>>5&255,t[7]=f<<3&255,t[8]=t[9]=t[10]=0,t[11]=d>>>29,t[12]=d>>>21&255,t[13]=d>>>13&255,t[14]=d>>>5&255,t[15]=d<<3&255,e.mac(ye.MAC.GCM,ye.HEAP_DATA,16),e.get_iv(ye.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(ye.ENC.CTR,ye.HEAP_DATA,16);let l=0;for(let e=0;e<r;++e)l|=u[e]^t[e];if(l)throw new _e("data integrity check failed");return this.counter=1,this.aes.pos=0,this.aes.len=0,c}AES_GCM_decrypt(e){const t=this.AES_GCM_Decrypt_process(e),r=this.AES_GCM_Decrypt_finish(),i=new Uint8Array(t.length+r.length);return t.length&&i.set(t),r.length&&i.set(r,t.length),i}AES_GCM_encrypt(e){const t=this.AES_GCM_Encrypt_process(e),r=this.AES_GCM_Encrypt_finish(),i=new Uint8Array(t.length+r.length);return t.length&&i.set(t),r.length&&i.set(r,t.length),i}_gcm_mac_process(e){let{asm:t,heap:r}=this.aes.acquire_asm(),i=0,n=e.length||0,a=0;for(;n>0;){for(a=me(r,0,e,i,n),i+=a,n-=a;15&a;)r[a++]=0;t.mac(ye.MAC.GCM,ye.HEAP_DATA,a)}}}const Di=Y.getWebCrypto(),xi=Y.getNodeCrypto(),Ki=Y.getNodeBuffer(),Ui=16,Ri="AES-GCM";async function Ti(e,t){if(e!==V.symmetric.aes128&&e!==V.symmetric.aes192&&e!==V.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(Y.getNodeCrypto())return{encrypt:async function(e,r,i=new Uint8Array){const n=new xi.createCipheriv("aes-"+8*t.length+"-gcm",t,r);n.setAAD(i);const a=Ki.concat([n.update(e),n.final(),n.getAuthTag()]);return new Uint8Array(a)},decrypt:async function(e,r,i=new Uint8Array){const n=new xi.createDecipheriv("aes-"+8*t.length+"-gcm",t,r);n.setAAD(i),n.setAuthTag(e.slice(e.length-Ui,e.length));const a=Ki.concat([n.update(e.slice(0,e.length-Ui)),n.final()]);return new Uint8Array(a)}};if(Y.getWebCrypto()&&24!==t.length){const e=await Di.importKey("raw",t,{name:Ri},!1,["encrypt","decrypt"]);return{encrypt:async function(r,i,n=new Uint8Array){if(!r.length)return Mi.encrypt(r,t,i,n);const a=await Di.encrypt({name:Ri,iv:i,additionalData:n,tagLength:8*Ui},e,r);return new Uint8Array(a)},decrypt:async function(r,i,n=new Uint8Array){if(r.length===Ui)return Mi.decrypt(r,t,i,n);const a=await Di.decrypt({name:Ri,iv:i,additionalData:n,tagLength:8*Ui},e,r);return new Uint8Array(a)}}}return{encrypt:async function(e,r,i){return Mi.encrypt(e,t,r,i)},decrypt:async function(e,r,i){return Mi.decrypt(e,t,r,i)}}}Ti.getNonce=function(e,t){const r=e.slice();for(let e=0;e<t.length;e++)r[4+e]^=t[e];return r},Ti.blockLength=16,Ti.ivLength=12,Ti.tagLength=Ui;var Qi={cfb:$r,gcm:Ti,experimentalGCM:Ti,eax:wi,ocb:Bi},zi=it((function(e){!function(e){var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},r=function(){throw Error("no PRNG")},i=new Uint8Array(32);i[0]=9;var n=t(),a=t([1]),s=t([56129,1]),o=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),c=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),h=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),f=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function d(e,t,r,i){return function(e,t,r,i,n){var a,s=0;for(a=0;a<n;a++)s|=e[t+a]^r[i+a];return(1&s-1>>>8)-1}(e,t,r,i,32)}function l(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function p(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function y(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function g(e,r){var i,n,a,s=t(),o=t();for(i=0;i<16;i++)o[i]=r[i];for(p(o),p(o),p(o),n=0;n<2;n++){for(s[0]=o[0]-65517,i=1;i<15;i++)s[i]=o[i]-65535-(s[i-1]>>16&1),s[i-1]&=65535;s[15]=o[15]-32767-(s[14]>>16&1),a=s[15]>>16&1,s[14]&=65535,y(o,s,1-a)}for(i=0;i<16;i++)e[2*i]=255&o[i],e[2*i+1]=o[i]>>8}function b(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return g(r,e),g(i,t),d(r,0,i,0)}function m(e){var t=new Uint8Array(32);return g(t,e),1&t[0]}function w(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function A(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function v(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function _(e,t,r){var i,n,a=0,s=0,o=0,c=0,u=0,h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0,A=0,v=0,_=0,k=0,E=0,S=0,C=0,I=0,B=0,P=0,M=0,D=0,x=0,K=0,U=0,R=0,T=r[0],Q=r[1],z=r[2],F=r[3],L=r[4],N=r[5],q=r[6],O=r[7],H=r[8],j=r[9],G=r[10],W=r[11],V=r[12],J=r[13],Y=r[14],Z=r[15];a+=(i=t[0])*T,s+=i*Q,o+=i*z,c+=i*F,u+=i*L,h+=i*N,f+=i*q,d+=i*O,l+=i*H,p+=i*j,y+=i*G,g+=i*W,b+=i*V,m+=i*J,w+=i*Y,A+=i*Z,s+=(i=t[1])*T,o+=i*Q,c+=i*z,u+=i*F,h+=i*L,f+=i*N,d+=i*q,l+=i*O,p+=i*H,y+=i*j,g+=i*G,b+=i*W,m+=i*V,w+=i*J,A+=i*Y,v+=i*Z,o+=(i=t[2])*T,c+=i*Q,u+=i*z,h+=i*F,f+=i*L,d+=i*N,l+=i*q,p+=i*O,y+=i*H,g+=i*j,b+=i*G,m+=i*W,w+=i*V,A+=i*J,v+=i*Y,_+=i*Z,c+=(i=t[3])*T,u+=i*Q,h+=i*z,f+=i*F,d+=i*L,l+=i*N,p+=i*q,y+=i*O,g+=i*H,b+=i*j,m+=i*G,w+=i*W,A+=i*V,v+=i*J,_+=i*Y,k+=i*Z,u+=(i=t[4])*T,h+=i*Q,f+=i*z,d+=i*F,l+=i*L,p+=i*N,y+=i*q,g+=i*O,b+=i*H,m+=i*j,w+=i*G,A+=i*W,v+=i*V,_+=i*J,k+=i*Y,E+=i*Z,h+=(i=t[5])*T,f+=i*Q,d+=i*z,l+=i*F,p+=i*L,y+=i*N,g+=i*q,b+=i*O,m+=i*H,w+=i*j,A+=i*G,v+=i*W,_+=i*V,k+=i*J,E+=i*Y,S+=i*Z,f+=(i=t[6])*T,d+=i*Q,l+=i*z,p+=i*F,y+=i*L,g+=i*N,b+=i*q,m+=i*O,w+=i*H,A+=i*j,v+=i*G,_+=i*W,k+=i*V,E+=i*J,S+=i*Y,C+=i*Z,d+=(i=t[7])*T,l+=i*Q,p+=i*z,y+=i*F,g+=i*L,b+=i*N,m+=i*q,w+=i*O,A+=i*H,v+=i*j,_+=i*G,k+=i*W,E+=i*V,S+=i*J,C+=i*Y,I+=i*Z,l+=(i=t[8])*T,p+=i*Q,y+=i*z,g+=i*F,b+=i*L,m+=i*N,w+=i*q,A+=i*O,v+=i*H,_+=i*j,k+=i*G,E+=i*W,S+=i*V,C+=i*J,I+=i*Y,B+=i*Z,p+=(i=t[9])*T,y+=i*Q,g+=i*z,b+=i*F,m+=i*L,w+=i*N,A+=i*q,v+=i*O,_+=i*H,k+=i*j,E+=i*G,S+=i*W,C+=i*V,I+=i*J,B+=i*Y,P+=i*Z,y+=(i=t[10])*T,g+=i*Q,b+=i*z,m+=i*F,w+=i*L,A+=i*N,v+=i*q,_+=i*O,k+=i*H,E+=i*j,S+=i*G,C+=i*W,I+=i*V,B+=i*J,P+=i*Y,M+=i*Z,g+=(i=t[11])*T,b+=i*Q,m+=i*z,w+=i*F,A+=i*L,v+=i*N,_+=i*q,k+=i*O,E+=i*H,S+=i*j,C+=i*G,I+=i*W,B+=i*V,P+=i*J,M+=i*Y,D+=i*Z,b+=(i=t[12])*T,m+=i*Q,w+=i*z,A+=i*F,v+=i*L,_+=i*N,k+=i*q,E+=i*O,S+=i*H,C+=i*j,I+=i*G,B+=i*W,P+=i*V,M+=i*J,D+=i*Y,x+=i*Z,m+=(i=t[13])*T,w+=i*Q,A+=i*z,v+=i*F,_+=i*L,k+=i*N,E+=i*q,S+=i*O,C+=i*H,I+=i*j,B+=i*G,P+=i*W,M+=i*V,D+=i*J,x+=i*Y,K+=i*Z,w+=(i=t[14])*T,A+=i*Q,v+=i*z,_+=i*F,k+=i*L,E+=i*N,S+=i*q,C+=i*O,I+=i*H,B+=i*j,P+=i*G,M+=i*W,D+=i*V,x+=i*J,K+=i*Y,U+=i*Z,A+=(i=t[15])*T,s+=38*(_+=i*z),o+=38*(k+=i*F),c+=38*(E+=i*L),u+=38*(S+=i*N),h+=38*(C+=i*q),f+=38*(I+=i*O),d+=38*(B+=i*H),l+=38*(P+=i*j),p+=38*(M+=i*G),y+=38*(D+=i*W),g+=38*(x+=i*V),b+=38*(K+=i*J),m+=38*(U+=i*Y),w+=38*(R+=i*Z),a=(i=(a+=38*(v+=i*Q))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),w=(i=w+n+65535)-65536*(n=Math.floor(i/65536)),A=(i=A+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),w=(i=w+n+65535)-65536*(n=Math.floor(i/65536)),A=(i=A+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=s,e[2]=o,e[3]=c,e[4]=u,e[5]=h,e[6]=f,e[7]=d,e[8]=l,e[9]=p,e[10]=y,e[11]=g,e[12]=b,e[13]=m,e[14]=w,e[15]=A}function k(e,t){_(e,t,t)}function E(e,r){var i,n=t();for(i=0;i<16;i++)n[i]=r[i];for(i=253;i>=0;i--)k(n,n),2!==i&&4!==i&&_(n,n,r);for(i=0;i<16;i++)e[i]=n[i]}function S(e,r,i){var n,a,o=new Uint8Array(32),c=new Float64Array(80),u=t(),h=t(),f=t(),d=t(),l=t(),p=t();for(a=0;a<31;a++)o[a]=r[a];for(o[31]=127&r[31]|64,o[0]&=248,w(c,i),a=0;a<16;a++)h[a]=c[a],d[a]=u[a]=f[a]=0;for(u[0]=d[0]=1,a=254;a>=0;--a)y(u,h,n=o[a>>>3]>>>(7&a)&1),y(f,d,n),A(l,u,f),v(u,u,f),A(f,h,d),v(h,h,d),k(d,l),k(p,u),_(u,f,u),_(f,h,l),A(l,u,f),v(u,u,f),k(h,u),v(f,d,p),_(u,f,s),A(u,u,d),_(f,f,u),_(u,d,p),_(d,h,c),k(h,l),y(u,h,n),y(f,d,n);for(a=0;a<16;a++)c[a+16]=u[a],c[a+32]=f[a],c[a+48]=h[a],c[a+64]=d[a];var b=c.subarray(32),m=c.subarray(16);return E(b,b),_(m,m,b),g(e,m),0}function C(e,t){return S(e,t,i)}function I(e,r){var i=t(),n=t(),a=t(),s=t(),o=t(),u=t(),h=t(),f=t(),d=t();v(i,e[1],e[0]),v(d,r[1],r[0]),_(i,i,d),A(n,e[0],e[1]),A(d,r[0],r[1]),_(n,n,d),_(a,e[3],r[3]),_(a,a,c),_(s,e[2],r[2]),A(s,s,s),v(o,n,i),v(u,s,a),A(h,s,a),A(f,n,i),_(e[0],o,u),_(e[1],f,h),_(e[2],h,u),_(e[3],o,f)}function B(e,t,r){var i;for(i=0;i<4;i++)y(e[i],t[i],r)}function P(e,r){var i=t(),n=t(),a=t();E(a,r[2]),_(i,r[0],a),_(n,r[1],a),g(e,n),e[31]^=m(i)<<7}function M(e,t,r){var i,s;for(l(e[0],n),l(e[1],a),l(e[2],a),l(e[3],n),s=255;s>=0;--s)B(e,t,i=r[s/8|0]>>(7&s)&1),I(t,e),I(e,e),B(e,t,i)}function D(e,r){var i=[t(),t(),t(),t()];l(i[0],u),l(i[1],h),l(i[2],a),_(i[3],u,h),M(e,i,r)}function x(i,n,a){var s,o,c=[t(),t(),t(),t()];for(a||r(n,32),(s=e.hash(n.subarray(0,32)))[0]&=248,s[31]&=127,s[31]|=64,D(c,s),P(i,c),o=0;o<32;o++)n[o+32]=i[o];return 0}var K=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function U(e,t){var r,i,n,a;for(i=63;i>=32;--i){for(r=0,n=i-32,a=i-12;n<a;++n)t[n]+=r-16*t[i]*K[n-(i-32)],r=Math.floor((t[n]+128)/256),t[n]-=256*r;t[n]+=r,t[i]=0}for(r=0,n=0;n<32;n++)t[n]+=r-(t[31]>>4)*K[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*K[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function R(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;U(e,r)}function T(e,r){var i=t(),s=t(),c=t(),u=t(),h=t(),d=t(),p=t();return l(e[2],a),w(e[1],r),k(c,e[1]),_(u,c,o),v(c,c,e[2]),A(u,e[2],u),k(h,u),k(d,h),_(p,d,h),_(i,p,c),_(i,i,u),function(e,r){var i,n=t();for(i=0;i<16;i++)n[i]=r[i];for(i=250;i>=0;i--)k(n,n),1!==i&&_(n,n,r);for(i=0;i<16;i++)e[i]=n[i]}(i,i),_(i,i,c),_(i,i,u),_(i,i,u),_(e[0],i,u),k(s,e[0]),_(s,s,u),b(s,c)&&_(e[0],e[0],f),k(s,e[0]),_(s,s,u),b(s,c)?-1:(m(e[0])===r[31]>>7&&v(e[0],n,e[0]),_(e[3],e[0],e[1]),0)}var Q=64;function z(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function F(e){for(var t=0;t<e.length;t++)e[t]=0}e.scalarMult=function(e,t){if(z(e,t),32!==e.length)throw Error("bad n size");if(32!==t.length)throw Error("bad p size");var r=new Uint8Array(32);return S(r,e,t),r},e.box={},e.box.keyPair=function(){var e,t,i=new Uint8Array(32),n=new Uint8Array(32);return e=i,r(t=n,32),C(e,t),{publicKey:i,secretKey:n}},e.box.keyPair.fromSecretKey=function(e){if(z(e),32!==e.length)throw Error("bad secret key size");var t=new Uint8Array(32);return C(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.sign=function(r,i){if(z(r,i),64!==i.length)throw Error("bad secret key size");var n=new Uint8Array(Q+r.length);return function(r,i,n,a){var s,o,c,u,h,f=new Float64Array(64),d=[t(),t(),t(),t()];(s=e.hash(a.subarray(0,32)))[0]&=248,s[31]&=127,s[31]|=64;var l=n+64;for(u=0;u<n;u++)r[64+u]=i[u];for(u=0;u<32;u++)r[32+u]=s[32+u];for(R(c=e.hash(r.subarray(32,l))),D(d,c),P(r,d),u=32;u<64;u++)r[u]=a[u];for(R(o=e.hash(r.subarray(0,l))),u=0;u<64;u++)f[u]=0;for(u=0;u<32;u++)f[u]=c[u];for(u=0;u<32;u++)for(h=0;h<32;h++)f[u+h]+=o[u]*s[h];U(r.subarray(32),f)}(n,r,r.length,i),n},e.sign.detached=function(t,r){for(var i=e.sign(t,r),n=new Uint8Array(Q),a=0;a<n.length;a++)n[a]=i[a];return n},e.sign.detached.verify=function(r,i,n){if(z(r,i,n),i.length!==Q)throw Error("bad signature size");if(32!==n.length)throw Error("bad public key size");var a,s=new Uint8Array(Q+r.length),o=new Uint8Array(Q+r.length);for(a=0;a<Q;a++)s[a]=i[a];for(a=0;a<r.length;a++)s[a+Q]=r[a];return function(r,i,n,a){var s,o,c=new Uint8Array(32),u=[t(),t(),t(),t()],h=[t(),t(),t(),t()];if(n<64)return-1;if(T(h,a))return-1;for(s=0;s<n;s++)r[s]=i[s];for(s=0;s<32;s++)r[s+32]=a[s];if(R(o=e.hash(r.subarray(0,n))),M(u,h,o),D(h,i.subarray(32)),I(u,h),P(c,u),n-=64,d(i,0,c,0)){for(s=0;s<n;s++)r[s]=0;return-1}for(s=0;s<n;s++)r[s]=i[s+64];return n}(o,s,s.length,n)>=0},e.sign.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(64);return x(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(z(e),64!==e.length)throw Error("bad secret key size");for(var t=new Uint8Array(32),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(z(e),32!==e.length)throw Error("bad seed size");for(var t=new Uint8Array(32),r=new Uint8Array(64),i=0;i<32;i++)r[i]=e[i];return x(t,r,!0),{publicKey:t,secretKey:r}},e.setPRNG=function(e){r=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){e.setPRNG((function(e,r){var i,n=new Uint8Array(r);for(i=0;i<r;i+=65536)t.getRandomValues(n.subarray(i,i+Math.min(r-i,65536)));for(i=0;i<r;i++)e[i]=n[i];F(n)}))}else void 0!==nt&&(t=void 0)&&t.randomBytes&&e.setPRNG((function(e,r){var i,n=t.randomBytes(r);for(i=0;i<r;i++)e[i]=n[i];F(n)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})}));const Fi=Y.getNodeCrypto();function Li(e){const t=new Uint8Array(e);if(Fi){const e=Fi.randomBytes(t.length);t.set(e)}else{if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("No secure random number generator available.");crypto.getRandomValues(t)}return t}async function Ni(e,t){const r=await Y.getBigInteger();if(t.lt(e))throw Error("Illegal parameter value: max <= min");const i=t.sub(e),n=i.byteLength();return new r(await Li(n+8)).mod(i).add(e)}var qi=/*#__PURE__*/Object.freeze({__proto__:null,getRandomBytes:Li,getRandomBigInteger:Ni});async function Oi(e,t,r){const i=await Y.getBigInteger(),n=new i(1),a=n.leftShift(new i(e-1)),s=new i(30),o=[1,6,5,4,3,2,1,4,3,2,1,2,1,4,3,2,1,2,1,4,3,2,1,6,5,4,3,2,1,2],c=await Ni(a,a.leftShift(n));let u=c.mod(s).toNumber();do{c.iadd(new i(o[u])),u=(u+o[u])%o.length,c.bitLength()>e&&(c.imod(a.leftShift(n)).iadd(a),u=c.mod(s).toNumber())}while(!await Hi(c,t,r));return c}async function Hi(e,t,r){return!(t&&!e.dec().gcd(t).isOne())&&(!!await async function(e){const t=await Y.getBigInteger();return ji.every((r=>0!==e.mod(new t(r))))}(e)&&(!!await async function(e,t){const r=await Y.getBigInteger();return t=t||new r(2),t.modExp(e.dec(),e).isOne()}(e)&&!!await async function(e,t,r){const i=await Y.getBigInteger(),n=e.bitLength();t||(t=Math.max(1,n/48|0));const a=e.dec();let s=0;for(;!a.getBit(s);)s++;const o=e.rightShift(new i(s));for(;t>0;t--){let t,n=(r?r():await Ni(new i(2),a)).modExp(o,e);if(!n.isOne()&&!n.equal(a)){for(t=1;t<s;t++){if(n=n.mul(n).mod(e),n.isOne())return!1;if(n.equal(a))break}if(t===s)return!1}}return!0}(e,r)))}const ji=[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,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999,3001,3011,3019,3023,3037,3041,3049,3061,3067,3079,3083,3089,3109,3119,3121,3137,3163,3167,3169,3181,3187,3191,3203,3209,3217,3221,3229,3251,3253,3257,3259,3271,3299,3301,3307,3313,3319,3323,3329,3331,3343,3347,3359,3361,3371,3373,3389,3391,3407,3413,3433,3449,3457,3461,3463,3467,3469,3491,3499,3511,3517,3527,3529,3533,3539,3541,3547,3557,3559,3571,3581,3583,3593,3607,3613,3617,3623,3631,3637,3643,3659,3671,3673,3677,3691,3697,3701,3709,3719,3727,3733,3739,3761,3767,3769,3779,3793,3797,3803,3821,3823,3833,3847,3851,3853,3863,3877,3881,3889,3907,3911,3917,3919,3923,3929,3931,3943,3947,3967,3989,4001,4003,4007,4013,4019,4021,4027,4049,4051,4057,4073,4079,4091,4093,4099,4111,4127,4129,4133,4139,4153,4157,4159,4177,4201,4211,4217,4219,4229,4231,4241,4243,4253,4259,4261,4271,4273,4283,4289,4297,4327,4337,4339,4349,4357,4363,4373,4391,4397,4409,4421,4423,4441,4447,4451,4457,4463,4481,4483,4493,4507,4513,4517,4519,4523,4547,4549,4561,4567,4583,4591,4597,4603,4621,4637,4639,4643,4649,4651,4657,4663,4673,4679,4691,4703,4721,4723,4729,4733,4751,4759,4783,4787,4789,4793,4799,4801,4813,4817,4831,4861,4871,4877,4889,4903,4909,4919,4931,4933,4937,4943,4951,4957,4967,4969,4973,4987,4993,4999];const Gi=[];function Wi(e,t){const r=e.length;if(r>t-11)throw Error("Message too long");const i=function(e){const t=new Uint8Array(e);let r=0;for(;r<e;){const i=Li(e-r);for(let e=0;e<i.length;e++)0!==i[e]&&(t[r++]=i[e])}return t}(t-r-3),n=new Uint8Array(t);return n[1]=2,n.set(i,2),n.set(e,t-r),n}function Vi(e,t){let r=2,i=1;for(let t=r;t<e.length;t++)i&=0!==e[t],r+=i;const n=r-2,a=e.subarray(r+1),s=0===e[0]&2===e[1]&n>=8&!i;if(t)return Y.selectUint8Array(s,a,t);if(s)return a;throw Error("Decryption error")}async function Ji(e,t,r){let i;if(t.length!==Gr.getHashByteLength(e))throw Error("Invalid hash length");const n=new Uint8Array(Gi[e].length);for(i=0;i<Gi[e].length;i++)n[i]=Gi[e][i];const a=n.length+t.length;if(r<a+11)throw Error("Intended encoded message length too short");const s=new Uint8Array(r-a-3).fill(255),o=new Uint8Array(r);return o[1]=1,o.set(s,2),o.set(n,r-a),o.set(t,r-t.length),o}Gi[1]=[48,32,48,12,6,8,42,134,72,134,247,13,2,5,5,0,4,16],Gi[2]=[48,33,48,9,6,5,43,14,3,2,26,5,0,4,20],Gi[3]=[48,33,48,9,6,5,43,36,3,2,1,5,0,4,20],Gi[8]=[48,49,48,13,6,9,96,134,72,1,101,3,4,2,1,5,0,4,32],Gi[9]=[48,65,48,13,6,9,96,134,72,1,101,3,4,2,2,5,0,4,48],Gi[10]=[48,81,48,13,6,9,96,134,72,1,101,3,4,2,3,5,0,4,64],Gi[11]=[48,45,48,13,6,9,96,134,72,1,101,3,4,2,4,5,0,4,28];var Yi=/*#__PURE__*/Object.freeze({__proto__:null,emeEncode:Wi,emeDecode:Vi,emsaEncode:Ji});const Zi=Y.getWebCrypto(),Xi=Y.getNodeCrypto(),$i=void 0,en=Xi?$i.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())})):void 0,tn=Xi?$i.define("RSAPubliceKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())})):void 0;var rn=/*#__PURE__*/Object.freeze({__proto__:null,sign:async function(e,t,r,i,n,a,s,o,c){if(t&&!Y.isStream(t))if(Y.getWebCrypto())try{return await async function(e,t,r,i,n,a,s,o){const c=await async function(e,t,r,i,n,a){const s=await Y.getBigInteger(),o=new s(i),c=new s(n),u=new s(r);let h=u.mod(c.dec()),f=u.mod(o.dec());return f=f.toUint8Array(),h=h.toUint8Array(),{kty:"RSA",n:ie(e,!0),e:ie(t,!0),d:ie(r,!0),p:ie(n,!0),q:ie(i,!0),dp:ie(h,!0),dq:ie(f,!0),qi:ie(a,!0),ext:!0}}(r,i,n,a,s,o),u={name:"RSASSA-PKCS1-v1_5",hash:{name:e}},h=await Zi.importKey("jwk",c,u,!1,["sign"]);return new Uint8Array(await Zi.sign("RSASSA-PKCS1-v1_5",h,t))}(V.read(V.webHash,e),t,r,i,n,a,s,o)}catch(e){Y.printDebugError(e)}else if(Y.getNodeCrypto())return async function(e,t,r,i,n,a,s,o){const{default:c}=await Promise.resolve().then((function(){return ky})),u=new c(a),h=new c(s),f=new c(n),d=f.mod(h.subn(1)),l=f.mod(u.subn(1)),p=Xi.createSign(V.read(V.hash,e));p.write(t),p.end();const y={version:0,modulus:new c(r),publicExponent:new c(i),privateExponent:new c(n),prime1:new c(s),prime2:new c(a),exponent1:d,exponent2:l,coefficient:new c(o)};if(void 0!==Xi.createPrivateKey){const e=en.encode(y,"der");return new Uint8Array(p.sign({key:e,format:"der",type:"pkcs1"}))}const g=en.encode(y,"pem",{label:"RSA PRIVATE KEY"});return new Uint8Array(p.sign(g))}(e,t,r,i,n,a,s,o);return async function(e,t,r,i){const n=await Y.getBigInteger();t=new n(t);const a=new n(await Ji(e,i,t.byteLength()));if(r=new n(r),a.gte(t))throw Error("Message size cannot exceed modulus size");return a.modExp(r,t).toUint8Array("be",t.byteLength())}(e,r,n,c)},verify:async function(e,t,r,i,n,a){if(t&&!Y.isStream(t))if(Y.getWebCrypto())try{return await async function(e,t,r,i,n){const a=function(e,t){return{kty:"RSA",n:ie(e,!0),e:ie(t,!0),ext:!0}}(i,n),s=await Zi.importKey("jwk",a,{name:"RSASSA-PKCS1-v1_5",hash:{name:e}},!1,["verify"]);return Zi.verify("RSASSA-PKCS1-v1_5",s,r,t)}(V.read(V.webHash,e),t,r,i,n)}catch(e){Y.printDebugError(e)}else if(Y.getNodeCrypto())return async function(e,t,r,i,n){const{default:a}=await Promise.resolve().then((function(){return ky})),s=Xi.createVerify(V.read(V.hash,e));s.write(t),s.end();const o={modulus:new a(i),publicExponent:new a(n)};let c;if(void 0!==Xi.createPrivateKey){c={key:tn.encode(o,"der"),format:"der",type:"pkcs1"}}else c=tn.encode(o,"pem",{label:"RSA PUBLIC KEY"});try{return await s.verify(c,r)}catch(e){return!1}}(e,t,r,i,n);return async function(e,t,r,i,n){const a=await Y.getBigInteger();if(r=new a(r),t=new a(t),i=new a(i),t.gte(r))throw Error("Signature size cannot exceed modulus size");const s=t.modExp(i,r).toUint8Array("be",r.byteLength()),o=await Ji(e,n,r.byteLength());return Y.equalsUint8Array(s,o)}(e,r,i,n,a)},encrypt:async function(e,t,r){return Y.getNodeCrypto()?async function(e,t,r){const{default:i}=await Promise.resolve().then((function(){return ky})),n={modulus:new i(t),publicExponent:new i(r)};let a;if(void 0!==Xi.createPrivateKey){a={key:tn.encode(n,"der"),format:"der",type:"pkcs1",padding:Xi.constants.RSA_PKCS1_PADDING}}else{a={key:tn.encode(n,"pem",{label:"RSA PUBLIC KEY"}),padding:Xi.constants.RSA_PKCS1_PADDING}}return new Uint8Array(Xi.publicEncrypt(a,e))}(e,t,r):async function(e,t,r){const i=await Y.getBigInteger();if(t=new i(t),e=new i(Wi(e,t.byteLength())),r=new i(r),e.gte(t))throw Error("Message size cannot exceed modulus size");return e.modExp(r,t).toUint8Array("be",t.byteLength())}(e,t,r)},decrypt:async function(e,t,r,i,n,a,s,o){return Y.getNodeCrypto()?async function(e,t,r,i,n,a,s,o){const{default:c}=await Promise.resolve().then((function(){return ky})),u=new c(n),h=new c(a),f=new c(i),d=f.mod(h.subn(1)),l=f.mod(u.subn(1)),p={version:0,modulus:new c(t),publicExponent:new c(r),privateExponent:new c(i),prime1:new c(a),prime2:new c(n),exponent1:d,exponent2:l,coefficient:new c(s)};let y;if(void 0!==Xi.createPrivateKey){y={key:en.encode(p,"der"),format:"der",type:"pkcs1",padding:Xi.constants.RSA_PKCS1_PADDING}}else{y={key:en.encode(p,"pem",{label:"RSA PRIVATE KEY"}),padding:Xi.constants.RSA_PKCS1_PADDING}}try{return new Uint8Array(Xi.privateDecrypt(y,e))}catch(e){if(o)return o;throw Error("Decryption error")}}(e,t,r,i,n,a,s,o):async function(e,t,r,i,n,a,s,o){const c=await Y.getBigInteger();if(e=new c(e),t=new c(t),r=new c(r),i=new c(i),n=new c(n),a=new c(a),s=new c(s),e.gte(t))throw Error("Data too large.");const u=i.mod(a.dec()),h=i.mod(n.dec()),f=(await Ni(new c(2),t)).mod(t),d=f.modInv(t).modExp(r,t);e=e.mul(d).mod(t);const l=e.modExp(h,n),p=e.modExp(u,a),y=s.mul(p.sub(l)).mod(a);let g=y.mul(n).add(l);return g=g.mul(f).mod(t),Vi(g.toUint8Array("be",t.byteLength()),o)}(e,t,r,i,n,a,s,o)},generate:async function(e,t){if(t=new(await Y.getBigInteger())(t),Y.getWebCrypto()){const r={name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:t.toUint8Array(),hash:{name:"SHA-1"}},i=await Zi.generateKey(r,!0,["sign","verify"]),n=await Zi.exportKey("jwk",i.privateKey);return{n:re(n.n),e:t.toUint8Array(),d:re(n.d),p:re(n.q),q:re(n.p),u:re(n.qi)}}if(Y.getNodeCrypto()&&Xi.generateKeyPair&&en){const r={modulusLength:e,publicExponent:t.toNumber(),publicKeyEncoding:{type:"pkcs1",format:"der"},privateKeyEncoding:{type:"pkcs1",format:"der"}},i=await new Promise(((e,t)=>{Xi.generateKeyPair("rsa",r,((r,i,n)=>{r?t(r):e(en.decode(n,"der"))}))}));return{n:i.modulus.toArrayLike(Uint8Array),e:i.publicExponent.toArrayLike(Uint8Array),d:i.privateExponent.toArrayLike(Uint8Array),p:i.prime2.toArrayLike(Uint8Array),q:i.prime1.toArrayLike(Uint8Array),u:i.coefficient.toArrayLike(Uint8Array)}}let r,i,n;do{i=await Oi(e-(e>>1),t,40),r=await Oi(e>>1,t,40),n=r.mul(i)}while(n.bitLength()!==e);const a=r.dec().imul(i.dec());return i.lt(r)&&([r,i]=[i,r]),{n:n.toUint8Array(),e:t.toUint8Array(),d:t.modInv(a).toUint8Array(),p:r.toUint8Array(),q:i.toUint8Array(),u:r.modInv(i).toUint8Array()}},validateParams:async function(e,t,r,i,n,a){const s=await Y.getBigInteger();if(e=new s(e),i=new s(i),n=new s(n),!i.mul(n).equal(e))return!1;const o=new s(2);if(a=new s(a),!i.mul(a).mod(n).isOne())return!1;t=new s(t),r=new s(r);const c=new s(Math.floor(e.bitLength()/3)),u=await Ni(o,o.leftShift(c)),h=u.mul(r).mul(t);return!(!h.mod(i.dec()).equal(u)||!h.mod(n.dec()).equal(u))}});var nn=/*#__PURE__*/Object.freeze({__proto__:null,encrypt:async function(e,t,r,i){const n=await Y.getBigInteger();t=new n(t),r=new n(r),i=new n(i);const a=new n(Wi(e,t.byteLength())),s=await Ni(new n(1),t.dec());return{c1:r.modExp(s,t).toUint8Array(),c2:i.modExp(s,t).imul(a).imod(t).toUint8Array()}},decrypt:async function(e,t,r,i,n){const a=await Y.getBigInteger();return e=new a(e),t=new a(t),r=new a(r),i=new a(i),Vi(e.modExp(i,r).modInv(r).imul(t).imod(r).toUint8Array("be",r.byteLength()),n)},validateParams:async function(e,t,r,i){const n=await Y.getBigInteger();e=new n(e),t=new n(t),r=new n(r);const a=new n(1);if(t.lte(a)||t.gte(e))return!1;const s=new n(e.bitLength()),o=new n(1023);if(s.lt(o))return!1;if(!t.modExp(e.dec(),e).isOne())return!1;let c=t;const u=new n(1),h=new n(2).leftShift(new n(17));for(;u.lt(h);){if(c=c.mul(t).imod(e),c.isOne())return!1;u.iinc()}i=new n(i);const f=new n(2),d=await Ni(f.leftShift(s.dec()),f.leftShift(s)),l=e.dec().imul(d).iadd(i);return!!r.equal(t.modExp(l,e))}});class an{constructor(e){if(e instanceof an)this.oid=e.oid;else if(Y.isArray(e)||Y.isUint8Array(e)){if(6===(e=new Uint8Array(e))[0]){if(e[1]!==e.length-2)throw Error("Length mismatch in DER encoded oid");e=e.subarray(2)}this.oid=e}else this.oid=""}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.oid=e.subarray(1,1+t),1+this.oid.length}throw Error("Invalid oid")}write(){return Y.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return Y.uint8ArrayToHex(this.oid)}getName(){const e=this.toHex();if(V.curve[e])return V.write(V.curve,e);throw Error("Unknown curve object identifier.")}}function sn(e,t){return e.keyPair({priv:t})}function on(e,t){const r=e.keyPair({pub:t});if(!0!==r.validate().result)throw Error("Invalid elliptic public key");return r}async function cn(e){if(!ne.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:t}=await Promise.resolve().then((function(){return qg}));return new t.ec(e)}function un(e){let t,r=0;const i=e[0];return i<192?([r]=e,t=1):i<255?(r=(e[0]-192<<8)+e[1]+192,t=2):255===i&&(r=Y.readNumber(e.subarray(1,5)),t=5),{len:r,offset:t}}function hn(e){return e<192?new Uint8Array([e]):e>191&&e<8384?new Uint8Array([192+(e-192>>8),e-192&255]):Y.concatUint8Array([new Uint8Array([255]),Y.writeNumber(e,4)])}function fn(e){if(e<0||e>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+e])}function dn(e){return new Uint8Array([192|e])}function ln(e,t){return Y.concatUint8Array([dn(e),hn(t)])}function pn(e){return[V.packet.literalData,V.packet.compressedData,V.packet.symmetricallyEncryptedData,V.packet.symEncryptedIntegrityProtectedData,V.packet.aeadEncryptedData].includes(e)}async function yn(e,t){const r=M(e);let i,n;try{const s=await r.peekBytes(2);if(!s||s.length<2||0==(128&s[0]))throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const o=await r.readByte();let c,u,h=-1,f=-1;f=0,0!=(64&o)&&(f=1),f?h=63&o:(h=(63&o)>>2,u=3&o);const d=pn(h);let l,p=null;if(d){if("array"===Y.isStream(e)){const e=new a;i=D(e),p=e}else{const e=new E;i=D(e.writable),p=e.readable}n=t({tag:h,packet:p})}else p=[];do{if(f){const e=await r.readByte();if(l=!1,e<192)c=e;else if(e>=192&&e<224)c=(e-192<<8)+await r.readByte()+192;else if(e>223&&e<255){if(c=1<<(31&e),l=!0,!d)throw new TypeError("This packet type does not support partial lengths.")}else c=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte()}else switch(u){case 0:c=await r.readByte();break;case 1:c=await r.readByte()<<8|await r.readByte();break;case 2:c=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte();break;default:c=1/0}if(c>0){let e=0;for(;;){i&&await i.ready;const{done:t,value:n}=await r.read();if(t){if(c===1/0)break;throw Error("Unexpected end of packet")}const a=c===1/0?n:n.subarray(0,c-e);if(i?await i.write(a):p.push(a),e+=n.length,e>=c){r.unshift(n.subarray(c-e+n.length));break}}}}while(l);const y=await r.peekBytes(d?1/0:2);return i?(await i.ready,await i.close()):(p=Y.concatUint8Array(p),await t({tag:h,packet:p})),!y||!y.length}catch(e){if(i)return await i.abort(e),!0;throw e}finally{i&&await n,r.releaseLock()}}class gn extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,gn),this.name="UnsupportedError"}}class bn{constructor(e,t){this.tag=e,this.rawContent=t}write(){return this.rawContent}}const mn=Y.getWebCrypto(),wn=Y.getNodeCrypto(),An={p256:"P-256",p384:"P-384",p521:"P-521"},vn=wn?wn.getCurves():[],_n=wn?{secp256k1:vn.includes("secp256k1")?"secp256k1":void 0,p256:vn.includes("prime256v1")?"prime256v1":void 0,p384:vn.includes("secp384r1")?"secp384r1":void 0,p521:vn.includes("secp521r1")?"secp521r1":void 0,ed25519:vn.includes("ED25519")?"ED25519":void 0,curve25519:vn.includes("X25519")?"X25519":void 0,brainpoolP256r1:vn.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:vn.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:vn.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},kn={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:V.publicKey.ecdsa,hash:V.hash.sha256,cipher:V.symmetric.aes128,node:_n.p256,web:An.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:V.publicKey.ecdsa,hash:V.hash.sha384,cipher:V.symmetric.aes192,node:_n.p384,web:An.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:V.publicKey.ecdsa,hash:V.hash.sha512,cipher:V.symmetric.aes256,node:_n.p521,web:An.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:V.publicKey.ecdsa,hash:V.hash.sha256,cipher:V.symmetric.aes128,node:_n.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:V.publicKey.eddsaLegacy,hash:V.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:V.publicKey.ecdh,hash:V.hash.sha256,cipher:V.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:V.publicKey.ecdsa,hash:V.hash.sha256,cipher:V.symmetric.aes128,node:_n.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:V.publicKey.ecdsa,hash:V.hash.sha384,cipher:V.symmetric.aes192,node:_n.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:V.publicKey.ecdsa,hash:V.hash.sha512,cipher:V.symmetric.aes256,node:_n.brainpoolP512r1,payloadSize:64}};class En{constructor(e,t){try{(Y.isArray(e)||Y.isUint8Array(e))&&(e=new an(e)),e instanceof an&&(e=e.getName()),this.name=V.write(V.curve,e)}catch(e){throw new gn("Unknown curve")}t=t||kn[this.name],this.keyType=t.keyType,this.oid=t.oid,this.hash=t.hash,this.cipher=t.cipher,this.node=t.node&&kn[this.name],this.web=t.web&&kn[this.name],this.payloadSize=t.payloadSize,this.web&&Y.getWebCrypto()?this.type="web":this.node&&Y.getNodeCrypto()?this.type="node":"curve25519"===this.name?this.type="curve25519":"ed25519"===this.name&&(this.type="ed25519")}async genKeyPair(){let e;switch(this.type){case"web":try{return await async function(e){const t=await mn.generateKey({name:"ECDSA",namedCurve:An[e]},!0,["sign","verify"]),r=await mn.exportKey("jwk",t.privateKey),i=await mn.exportKey("jwk",t.publicKey);return{publicKey:Cn(i),privateKey:re(r.d)}}(this.name)}catch(e){Y.printDebugError("Browser did not support generating ec key "+e.message);break}case"node":return async function(e){const t=wn.createECDH(_n[e]);return await t.generateKeys(),{publicKey:new Uint8Array(t.getPublicKey()),privateKey:new Uint8Array(t.getPrivateKey())}}(this.name);case"curve25519":{const t=Li(32);t[0]=127&t[0]|64,t[31]&=248;const r=t.slice().reverse();e=zi.box.keyPair.fromSecretKey(r);return{publicKey:Y.concatUint8Array([new Uint8Array([64]),e.publicKey]),privateKey:t}}case"ed25519":{const e=Li(32),t=zi.sign.keyPair.fromSeed(e);return{publicKey:Y.concatUint8Array([new Uint8Array([64]),t.publicKey]),privateKey:e}}}const t=await cn(this.name);return e=await t.genKeyPair({entropy:Y.uint8ArrayToString(Li(32))}),{publicKey:new Uint8Array(e.getPublic("array",!1)),privateKey:e.getPrivate().toArrayLike(Uint8Array)}}}async function Sn(e,t,r,i){const n={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:e===V.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},a=t.getName();if(!n[a])return!1;if("curve25519"===a){i=i.slice().reverse();const{publicKey:e}=zi.box.keyPair.fromSecretKey(i);r=new Uint8Array(r);const t=new Uint8Array([64,...e]);return!!Y.equalsUint8Array(t,r)}const s=await cn(a);try{r=on(s,r).getPublic()}catch(e){return!1}return!!sn(s,i).getPublic().eq(r)}function Cn(e){const t=re(e.x),r=re(e.y),i=new Uint8Array(t.length+r.length+1);return i[0]=4,i.set(t,1),i.set(r,t.length+1),i}function In(e,t,r){const i=e,n=r.slice(1,i+1),a=r.slice(i+1,2*i+1);return{kty:"EC",crv:t,x:ie(n,!0),y:ie(a,!0),ext:!0}}function Bn(e,t,r,i){const n=In(e,t,r);return n.d=ie(i,!0),n}const Pn=Y.getWebCrypto(),Mn=Y.getNodeCrypto();async function Dn(e,t,r,i,n,a){const s=new En(e);if(r&&!Y.isStream(r)){const e={publicKey:i,privateKey:n};switch(s.type){case"web":try{return await async function(e,t,r,i){const n=e.payloadSize,a=Bn(e.payloadSize,An[e.name],i.publicKey,i.privateKey),s=await Pn.importKey("jwk",a,{name:"ECDSA",namedCurve:An[e.name],hash:{name:V.read(V.webHash,e.hash)}},!1,["sign"]),o=new Uint8Array(await Pn.sign({name:"ECDSA",namedCurve:An[e.name],hash:{name:V.read(V.webHash,t)}},s,r));return{r:o.slice(0,n),s:o.slice(n,n<<1)}}(s,t,r,e)}catch(e){if("p521"!==s.name&&("DataError"===e.name||"OperationError"===e.name))throw e;Y.printDebugError("Browser did not support signing: "+e.message)}break;case"node":{const i=await async function(e,t,r,i){const n=Mn.createSign(V.read(V.hash,t));n.write(r),n.end();const a=Rn.encode({version:1,parameters:e.oid,privateKey:Array.from(i.privateKey),publicKey:{unused:0,data:Array.from(i.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return Un.decode(n.sign(a),"der")}(s,t,r,e);return{r:i.r.toArrayLike(Uint8Array),s:i.s.toArrayLike(Uint8Array)}}}}return async function(e,t,r){const i=await cn(e.name),n=sn(i,r),a=n.sign(t);return{r:a.r.toArrayLike(Uint8Array),s:a.s.toArrayLike(Uint8Array)}}(s,a,n)}async function xn(e,t,r,i,n,a){const s=new En(e);if(i&&!Y.isStream(i))switch(s.type){case"web":try{return await async function(e,t,{r,s:i},n,a){const s=In(e.payloadSize,An[e.name],a),o=await Pn.importKey("jwk",s,{name:"ECDSA",namedCurve:An[e.name],hash:{name:V.read(V.webHash,e.hash)}},!1,["verify"]),c=Y.concatUint8Array([r,i]).buffer;return Pn.verify({name:"ECDSA",namedCurve:An[e.name],hash:{name:V.read(V.webHash,t)}},o,c,n)}(s,t,r,i,n)}catch(e){if("p521"!==s.name&&("DataError"===e.name||"OperationError"===e.name))throw e;Y.printDebugError("Browser did not support verifying: "+e.message)}break;case"node":return async function(e,t,{r,s:i},n,a){const{default:s}=await Promise.resolve().then((function(){return ky})),o=Mn.createVerify(V.read(V.hash,t));o.write(n),o.end();const c=Qn.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:e.oid},subjectPublicKey:{unused:0,data:Array.from(a)}},"pem",{label:"PUBLIC KEY"}),u=Un.encode({r:new s(r),s:new s(i)},"der");try{return o.verify(c,u)}catch(e){return!1}}(s,t,r,i,n)}return async function(e,t,r,i){const n=await cn(e.name),a=on(n,i);return a.verify(r,t)}(s,r,void 0===t?i:a,n)}const Kn=void 0,Un=Mn?Kn.define("ECDSASignature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())})):void 0,Rn=Mn?Kn.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().any(),this.key("publicKey").explicit(1).optional().bitstr())})):void 0,Tn=Mn?Kn.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())})):void 0,Qn=Mn?Kn.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(Tn),this.key("subjectPublicKey").bitstr())})):void 0;var zn=/*#__PURE__*/Object.freeze({__proto__:null,sign:Dn,verify:xn,validateParams:async function(e,t,r){const i=new En(e);if(i.keyType!==V.publicKey.ecdsa)return!1;switch(i.type){case"web":case"node":{const i=Li(8),n=V.hash.sha256,a=await Gr.digest(n,i);try{const s=await Dn(e,n,i,t,r,a);return await xn(e,n,s,i,t,a)}catch(e){return!1}}default:return Sn(V.publicKey.ecdsa,e,t,r)}}});zi.hash=e=>new Uint8Array($t().update(e).digest());var Fn=/*#__PURE__*/Object.freeze({__proto__:null,sign:async function(e,t,r,i,n,a){if(Gr.getHashByteLength(t)<Gr.getHashByteLength(V.hash.sha256))throw Error("Hash algorithm too weak for EdDSA.");const s=Y.concatUint8Array([n,i.subarray(1)]),o=zi.sign.detached(a,s);if(ne.checkEdDSAFaultySignatures&&!zi.sign.detached.verify(a,o,i.subarray(1)))throw Error("Transient signing failure");return{r:o.subarray(0,32),s:o.subarray(32)}},verify:async function(e,t,{r,s:i},n,a,s){if(Gr.getHashByteLength(t)<Gr.getHashByteLength(V.hash.sha256))throw Error("Hash algorithm too weak for EdDSA.");const o=Y.concatUint8Array([r,i]);return zi.sign.detached.verify(s,o,a.subarray(1))},validateParams:async function(e,t,r){if("ed25519"!==e.getName())return!1;const{publicKey:i}=zi.sign.keyPair.fromSeed(r),n=new Uint8Array([64,...i]);return Y.equalsUint8Array(t,n)}});function Ln(e){if(e===V.publicKey.ed25519)return V.hash.sha256;throw Error("Unknown EdDSA algo")}zi.hash=e=>new Uint8Array($t().update(e).digest());var Nn=/*#__PURE__*/Object.freeze({__proto__:null,generate:async function(e){if(e===V.publicKey.ed25519){const e=Li(32),{publicKey:t}=zi.sign.keyPair.fromSeed(e);return{A:t,seed:e}}throw Error("Unsupported EdDSA algorithm")},sign:async function(e,t,r,i,n,a){if(Gr.getHashByteLength(t)<Gr.getHashByteLength(Ln(e)))throw Error("Hash algorithm too weak for EdDSA.");switch(e){case V.publicKey.ed25519:{const e=Y.concatUint8Array([n,i]),t=zi.sign.detached(a,e);if(ne.checkEdDSAFaultySignatures&&!zi.sign.detached.verify(a,t,i))throw Error("Transient signing failure");return{RS:t}}case V.publicKey.ed448:default:throw Error("Unsupported EdDSA algorithm")}},verify:async function(e,t,{RS:r},i,n,a){if(Gr.getHashByteLength(t)<Gr.getHashByteLength(Ln(e)))throw Error("Hash algorithm too weak for EdDSA.");switch(e){case V.publicKey.ed25519:return zi.sign.detached.verify(a,r,n);case V.publicKey.ed448:default:throw Error("Unsupported EdDSA algorithm")}},validateParams:async function(e,t,r){switch(e){case V.publicKey.ed25519:{const{publicKey:e}=zi.sign.keyPair.fromSeed(r);return Y.equalsUint8Array(t,e)}case V.publicKey.ed448:default:return!1}},getPreferredHashAlgo:Ln});function qn(e,t){const r=new je["aes"+8*e.length](e),i=new Uint32Array([2795939494,2795939494]),n=Hn(t);let a=i;const s=n,o=n.length/2,c=new Uint32Array([0,0]);let u=new Uint32Array(4);for(let e=0;e<=5;++e)for(let t=0;t<o;++t)c[1]=o*e+(1+t),u[0]=a[0],u[1]=a[1],u[2]=s[2*t],u[3]=s[2*t+1],u=Hn(r.encrypt(jn(u))),a=u.subarray(0,2),a[0]^=c[0],a[1]^=c[1],s[2*t]=u[2],s[2*t+1]=u[3];return jn(a,s)}function On(e,t){const r=new je["aes"+8*e.length](e),i=new Uint32Array([2795939494,2795939494]),n=Hn(t);let a=n.subarray(0,2);const s=n.subarray(2),o=n.length/2-1,c=new Uint32Array([0,0]);let u=new Uint32Array(4);for(let e=5;e>=0;--e)for(let t=o-1;t>=0;--t)c[1]=o*e+(t+1),u[0]=a[0]^c[0],u[1]=a[1]^c[1],u[2]=s[2*t],u[3]=s[2*t+1],u=Hn(r.decrypt(jn(u))),a=u.subarray(0,2),s[2*t]=u[2],s[2*t+1]=u[3];if(a[0]===i[0]&&a[1]===i[1])return jn(s);throw Error("Key Data Integrity failed")}function Hn(e){const{length:t}=e,r=function(e){if(Y.isString(e)){const{length:t}=e,r=new ArrayBuffer(t),i=new Uint8Array(r);for(let r=0;r<t;++r)i[r]=e.charCodeAt(r);return r}return new Uint8Array(e).buffer}(e),i=new DataView(r),n=new Uint32Array(t/4);for(let e=0;e<t/4;++e)n[e]=i.getUint32(4*e);return n}function jn(){let e=0;for(let t=0;t<arguments.length;++t)e+=4*arguments[t].length;const t=new ArrayBuffer(e),r=new DataView(t);let i=0;for(let e=0;e<arguments.length;++e){for(let t=0;t<arguments[e].length;++t)r.setUint32(i+4*t,arguments[e][t]);i+=4*arguments[e].length}return new Uint8Array(t)}var Gn=/*#__PURE__*/Object.freeze({__proto__:null,wrap:qn,unwrap:On});function Wn(e){const t=8-e.length%8,r=new Uint8Array(e.length+t).fill(t);return r.set(e),r}function Vn(e){const t=e.length;if(t>0){const r=e[t-1];if(r>=1){const i=e.subarray(t-r),n=new Uint8Array(r).fill(r);if(Y.equalsUint8Array(i,n))return e.subarray(0,t-r)}}throw Error("Invalid padding")}var Jn=/*#__PURE__*/Object.freeze({__proto__:null,encode:Wn,decode:Vn});const Yn=Y.getWebCrypto(),Zn=Y.getNodeCrypto();function Xn(e,t,r,i){return Y.concatUint8Array([t.write(),new Uint8Array([e]),r.write(!0),Y.stringToUint8Array("Anonymous Sender "),r.replacementFingerprint||i.subarray(0,20)])}async function $n(e,t,r,i,n=!1,a=!1){let s;if(n){for(s=0;s<t.length&&0===t[s];s++);t=t.subarray(s)}if(a){for(s=t.length-1;s>=0&&0===t[s];s--);t=t.subarray(0,s+1)}return(await Gr.digest(e,Y.concatUint8Array([new Uint8Array([0,0,0,1]),t,i]))).subarray(0,r)}async function ea(e,t){switch(e.type){case"curve25519":{const r=Li(32),{secretKey:i,sharedKey:n}=await ta(e,t,null,r);let{publicKey:a}=zi.box.keyPair.fromSecretKey(i);return a=Y.concatUint8Array([new Uint8Array([64]),a]),{publicKey:a,sharedKey:n}}case"web":if(e.web&&Y.getWebCrypto())try{return await async function(e,t){const r=In(e.payloadSize,e.web.web,t);let i=Yn.generateKey({name:"ECDH",namedCurve:e.web.web},!0,["deriveKey","deriveBits"]),n=Yn.importKey("jwk",r,{name:"ECDH",namedCurve:e.web.web},!1,[]);[i,n]=await Promise.all([i,n]);let a=Yn.deriveBits({name:"ECDH",namedCurve:e.web.web,public:n},i.privateKey,e.web.sharedSize),s=Yn.exportKey("jwk",i.publicKey);[a,s]=await Promise.all([a,s]);const o=new Uint8Array(a),c=new Uint8Array(Cn(s));return{publicKey:c,sharedKey:o}}(e,t)}catch(e){Y.printDebugError(e)}break;case"node":return async function(e,t){const r=Zn.createECDH(e.node.node);r.generateKeys();const i=new Uint8Array(r.computeSecret(t)),n=new Uint8Array(r.getPublicKey());return{publicKey:n,sharedKey:i}}(e,t)}return async function(e,t){const r=await cn(e.name),i=await e.genKeyPair();t=on(r,t);const n=sn(r,i.privateKey),a=i.publicKey,s=n.derive(t.getPublic()),o=r.curve.p.byteLength(),c=s.toArrayLike(Uint8Array,"be",o);return{publicKey:a,sharedKey:c}}(e,t)}async function ta(e,t,r,i){if(i.length!==e.payloadSize){const t=new Uint8Array(e.payloadSize);t.set(i,e.payloadSize-i.length),i=t}switch(e.type){case"curve25519":{const e=i.slice().reverse();return{secretKey:e,sharedKey:zi.scalarMult(e,t.subarray(1))}}case"web":if(e.web&&Y.getWebCrypto())try{return await async function(e,t,r,i){const n=Bn(e.payloadSize,e.web.web,r,i);let a=Yn.importKey("jwk",n,{name:"ECDH",namedCurve:e.web.web},!0,["deriveKey","deriveBits"]);const s=In(e.payloadSize,e.web.web,t);let o=Yn.importKey("jwk",s,{name:"ECDH",namedCurve:e.web.web},!0,[]);[a,o]=await Promise.all([a,o]);let c=Yn.deriveBits({name:"ECDH",namedCurve:e.web.web,public:o},a,e.web.sharedSize),u=Yn.exportKey("jwk",a);[c,u]=await Promise.all([c,u]);const h=new Uint8Array(c);return{secretKey:re(u.d),sharedKey:h}}(e,t,r,i)}catch(e){Y.printDebugError(e)}break;case"node":return async function(e,t,r){const i=Zn.createECDH(e.node.node);i.setPrivateKey(r);const n=new Uint8Array(i.computeSecret(t));return{secretKey:new Uint8Array(i.getPrivateKey()),sharedKey:n}}(e,t,i)}return async function(e,t,r){const i=await cn(e.name);t=on(i,t),r=sn(i,r);const n=new Uint8Array(r.getPrivate()),a=r.derive(t.getPublic()),s=i.curve.p.byteLength(),o=a.toArrayLike(Uint8Array,"be",s);return{secretKey:n,sharedKey:o}}(e,t,i)}var ra=/*#__PURE__*/Object.freeze({__proto__:null,validateParams:async function(e,t,r){return Sn(V.publicKey.ecdh,e,t,r)},encrypt:async function(e,t,r,i,n){const a=Wn(r),s=new En(e),{publicKey:o,sharedKey:c}=await ea(s,i),u=Xn(V.publicKey.ecdh,e,t,n),{keySize:h}=Vr(t.cipher);return{publicKey:o,wrappedKey:qn(await $n(t.hash,c,h,u),a)}},decrypt:async function(e,t,r,i,n,a,s){const o=new En(e),{sharedKey:c}=await ta(o,r,n,a),u=Xn(V.publicKey.ecdh,e,t,s),{keySize:h}=Vr(t.cipher);let f;for(let e=0;e<3;e++)try{return Vn(On(await $n(t.hash,c,h,u,1===e,2===e),i))}catch(e){f=e}throw f}});const ia=Y.getWebCrypto(),na=Y.getNodeCrypto(),aa=na&&na.webcrypto&&na.webcrypto.subtle;async function sa(e,t,r,i,n){const a=V.read(V.webHash,e);if(!a)throw Error("Hash algo not supported with HKDF");if(ia||aa){const e=ia||aa,s=await e.importKey("raw",t,"HKDF",!1,["deriveBits"]),o=await e.deriveBits({name:"HKDF",hash:a,salt:r,info:i},s,8*n);return new Uint8Array(o)}if(na){const a=V.read(V.hash,e),s=(e,t)=>na.createHmac(a,e).update(t).digest(),o=s(r,t),c=o.length,u=Math.ceil(n/c),h=new Uint8Array(u*c),f=new Uint8Array(c+i.length+1);f.set(i,c);for(let e=0;e<u;e++){f[f.length-1]=e+1;const t=s(o,e>0?f:f.subarray(c));f.set(t,0),h.set(t,e*c)}return h.subarray(0,n)}throw Error("No HKDF implementation available")}const oa={x25519:Y.encodeUTF8("OpenPGP X25519")};var ca=/*#__PURE__*/Object.freeze({__proto__:null,generate:async function(e){if(e===V.publicKey.x25519){const e=Li(32),{publicKey:t}=zi.box.keyPair.fromSecretKey(e);return{A:t,k:e}}throw Error("Unsupported ECDH algorithm")},validateParams:async function(e,t,r){if(e===V.publicKey.x25519){const{publicKey:e}=zi.box.keyPair.fromSecretKey(r);return Y.equalsUint8Array(t,e)}return!1},encrypt:async function(e,t,r){if(e===V.publicKey.x25519){const e=Li(32),i=zi.scalarMult(e,r),{publicKey:n}=zi.box.keyPair.fromSecretKey(e),a=Y.concatUint8Array([n,r,i]),{keySize:s}=Vr(V.symmetric.aes128);return{ephemeralPublicKey:n,wrappedKey:qn(await sa(V.hash.sha256,a,new Uint8Array,oa.x25519,s),t)}}throw Error("Unsupported ECDH algorithm")},decrypt:async function(e,t,r,i,n){if(e===V.publicKey.x25519){const e=zi.scalarMult(n,t),a=Y.concatUint8Array([t,i,e]),{keySize:s}=Vr(V.symmetric.aes128);return On(await sa(V.hash.sha256,a,new Uint8Array,oa.x25519,s),r)}throw Error("Unsupported ECDH algorithm")}}),ua=/*#__PURE__*/Object.freeze({__proto__:null,CurveWithOID:En,ecdh:ra,ecdhX:ca,ecdsa:zn,eddsaLegacy:Fn,eddsa:Nn,generate:async function(e){const t=await Y.getBigInteger();e=new En(e);const r=await e.genKeyPair(),i=new t(r.publicKey).toUint8Array(),n=new t(r.privateKey).toUint8Array("be",e.payloadSize);return{oid:e.oid,Q:i,secret:n,hash:e.hash,cipher:e.cipher}},getPreferredHashAlgo:function(e){return kn[V.write(V.curve,e.toHex())].hash}});var ha=/*#__PURE__*/Object.freeze({__proto__:null,sign:async function(e,t,r,i,n,a){const s=await Y.getBigInteger(),o=new s(1);let c,u,h,f;i=new s(i),n=new s(n),r=new s(r),a=new s(a),r=r.mod(i),a=a.mod(n);const d=new s(t.subarray(0,n.byteLength())).mod(n);for(;;){if(c=await Ni(o,n),u=r.modExp(c,i).imod(n),u.isZero())continue;const e=a.mul(u).imod(n);if(f=d.add(e).imod(n),h=c.modInv(n).imul(f).imod(n),!h.isZero())break}return{r:u.toUint8Array("be",n.byteLength()),s:h.toUint8Array("be",n.byteLength())}},verify:async function(e,t,r,i,n,a,s,o){const c=await Y.getBigInteger(),u=new c(0);if(t=new c(t),r=new c(r),a=new c(a),s=new c(s),n=new c(n),o=new c(o),t.lte(u)||t.gte(s)||r.lte(u)||r.gte(s))return Y.printDebug("invalid DSA Signature"),!1;const h=new c(i.subarray(0,s.byteLength())).imod(s),f=r.modInv(s);if(f.isZero())return Y.printDebug("invalid DSA Signature"),!1;n=n.mod(a),o=o.mod(a);const d=h.mul(f).imod(s),l=t.mul(f).imod(s),p=n.modExp(d,a),y=o.modExp(l,a);return p.mul(y).imod(a).imod(s).equal(t)},validateParams:async function(e,t,r,i,n){const a=await Y.getBigInteger();e=new a(e),t=new a(t),r=new a(r),i=new a(i);const s=new a(1);if(r.lte(s)||r.gte(e))return!1;if(!e.dec().mod(t).isZero())return!1;if(!r.modExp(t,e).isOne())return!1;const o=new a(t.bitLength()),c=new a(150);if(o.lt(c)||!await Hi(t,null,32))return!1;n=new a(n);const u=new a(2),h=await Ni(u.leftShift(o.dec()),u.leftShift(o)),f=t.mul(h).add(n);return!!i.equal(r.modExp(f,e))}}),fa={rsa:rn,elgamal:nn,elliptic:ua,dsa:ha,nacl:zi};function da(e,t,r){switch(e){case V.hash.sha1:case V.hash.sha256:case V.hash.sha512:return async function(e,t,r){const i=Gr.getBlockSize(e),n=new Uint8Array(i);n.fill(92),la(n,t);const a=new Uint8Array(i);a.fill(54),la(a,t);const s=Y.concatUint8Array([a,r]),o=await Gr.digest(e,s),c=Y.concatUint8Array([n,o]);return Gr.digest(e,c)}(e,t,r);default:throw Error("Unsupported hash algorithm.")}}function la(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r]||0}class pa{constructor(e){if(void 0===e&&(e=new Uint8Array([])),!Y.isUint8Array(e))throw Error("data must be in the form of a Uint8Array");this.data=e,this.length=this.data.byteLength}write(){return Y.concatUint8Array([new Uint8Array([this.length]),this.data])}read(e){if(e.length>=1){const t=e[0];if(e.length>=t+1)return this.data=e.subarray(1,1+t),this.length=t,1+t}throw Error("Invalid octet string")}}var ya=/*#__PURE__*/Object.freeze({__proto__:null,parseSignatureParams:function(e,t){let r=0;switch(e){case V.publicKey.rsaEncryptSign:case V.publicKey.rsaEncrypt:case V.publicKey.rsaSign:return{s:Y.readMPI(t.subarray(r))};case V.publicKey.dsa:case V.publicKey.ecdsa:{const e=Y.readMPI(t.subarray(r));r+=e.length+2;return{r:e,s:Y.readMPI(t.subarray(r))}}case V.publicKey.eddsaLegacy:{let e=Y.readMPI(t.subarray(r));r+=e.length+2,e=Y.leftPad(e,32);let i=Y.readMPI(t.subarray(r));return i=Y.leftPad(i,32),{r:e,s:i}}case V.publicKey.ed25519:{const e=t.subarray(r,r+64);return r+=e.length,{RS:e}}case V.publicKey.hmac:{const e=new pa;return e.read(t.subarray(r)),{mac:e}}default:throw new gn("Unknown signature algorithm.")}},verify:async function(e,t,r,i,n,a,s){switch(e){case V.publicKey.rsaEncryptSign:case V.publicKey.rsaEncrypt:case V.publicKey.rsaSign:{const{n:e,e:n}=i,o=Y.leftPad(r.s,e.length);return fa.rsa.verify(t,a,o,e,n,s)}case V.publicKey.dsa:{const{g:e,p:n,q:a,y:o}=i,{r:c,s:u}=r;return fa.dsa.verify(t,c,u,s,e,n,a,o)}case V.publicKey.ecdsa:{const{oid:e,Q:n}=i,o=new fa.elliptic.CurveWithOID(e).payloadSize,c=Y.leftPad(r.r,o),u=Y.leftPad(r.s,o);return fa.elliptic.ecdsa.verify(e,t,{r:c,s:u},a,n,s)}case V.publicKey.eddsaLegacy:{const{oid:e,Q:n}=i;return fa.elliptic.eddsaLegacy.verify(e,t,r,a,n,s)}case V.publicKey.ed25519:{const{A:n}=i;return fa.elliptic.eddsa.verify(e,t,r,a,n,s)}case V.publicKey.hmac:{if(!n)throw Error("Cannot verify HMAC signature with symmetric key missing private parameters");const{cipher:e}=i,{keyMaterial:t}=n,a=await da(e.getValue(),t,s);return Y.equalsUint8Array(a,r.mac.data)}default:throw Error("Unknown signature algorithm.")}},sign:async function(e,t,r,i,n,a){if(!r||!i)throw Error("Missing key parameters");switch(e){case V.publicKey.rsaEncryptSign:case V.publicKey.rsaEncrypt:case V.publicKey.rsaSign:{const{n:e,e:s}=r,{d:o,p:c,q:u,u:h}=i;return{s:await fa.rsa.sign(t,n,e,s,o,c,u,h,a)}}case V.publicKey.dsa:{const{g:e,p:n,q:s}=r,{x:o}=i;return fa.dsa.sign(t,a,e,n,s,o)}case V.publicKey.elgamal:throw Error("Signing with Elgamal is not defined in the OpenPGP standard.");case V.publicKey.ecdsa:{const{oid:e,Q:s}=r,{d:o}=i;return fa.elliptic.ecdsa.sign(e,t,n,s,o,a)}case V.publicKey.eddsaLegacy:{const{oid:e,Q:s}=r,{seed:o}=i;return fa.elliptic.eddsaLegacy.sign(e,t,n,s,o,a)}case V.publicKey.ed25519:{const{A:s}=r,{seed:o}=i;return fa.elliptic.eddsa.sign(e,t,n,s,o,a)}case V.publicKey.hmac:{const{cipher:e}=r,{keyMaterial:t}=i,n=await da(e.getValue(),t,a);return{mac:new pa(n)}}default:throw Error("Unknown signature algorithm.")}}});class ga{constructor(e){e&&(this.data=e)}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.data=e.subarray(1,1+t),1+this.data.length}throw Error("Invalid symmetric key")}write(){return Y.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class ba{constructor(e){if(e){const{version:t,hash:r,cipher:i,replacementFingerprint:n}=e;this.version=t||1,this.hash=r,this.cipher=i,this.replacementFingerprint=n}else this.version=null,this.hash=null,this.cipher=null,this.replacementFingerprint=null}read(e){if(e.length<4||1!==e[1]&&255!==e[1])throw new gn("Cannot read KDFParams");const t=e[0];this.version=e[1],this.hash=e[2],this.cipher=e[3];let r=4;if(255===this.version){const i=t-r+1;this.replacementFingerprint=e.slice(r,r+i),r+=i}return r}write(e){if(!this.version||1===this.version||e)return new Uint8Array([3,1,this.hash,this.cipher]);return Y.concatUint8Array([new Uint8Array([3+this.replacementFingerprint.length,this.version,this.hash,this.cipher]),this.replacementFingerprint])}}const ma=e=>class{constructor(e){this.data=void 0===e?null:e}read(t){const r=t[0];return this.data=V.write(e,r),1}write(){return new Uint8Array([this.data])}getName(){return V.read(e,this.data)}getValue(){return this.data}},wa=ma(V.aead),Aa=ma(V.symmetric),va=ma(V.hash);class _a{static fromObject({wrappedKey:e,algorithm:t}){const r=new _a;return r.wrappedKey=e,r.algorithm=t,r}read(e){let t=0,r=e[t++];this.algorithm=r%2?e[t++]:null,r-=r%2,this.wrappedKey=e.subarray(t,t+r),t+=r}write(){return Y.concatUint8Array([this.algorithm?new Uint8Array([this.wrappedKey.length+1,this.algorithm]):new Uint8Array([this.wrappedKey.length]),this.wrappedKey])}}async function ka(e,t){const r=Li(32);return{privateParams:{hashSeed:r,keyMaterial:e},publicParams:{cipher:t,digest:await Gr.sha256(r)}}}function Ea(e){const{keySize:t}=Vr(e);return Li(t)}function Sa(e){const t=V.read(V.aead,e);return Qi[t]}function Ca(e){try{e.getName()}catch(e){throw new gn("Unknown curve OID")}}var Ia=/*#__PURE__*/Object.freeze({__proto__:null,publicKeyEncrypt:async function(e,t,r,i,n,a){switch(e){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:{const{n:e,e:t}=r;return{c:await fa.rsa.encrypt(n,e,t)}}case V.publicKey.elgamal:{const{p:e,g:t,y:i}=r;return fa.elgamal.encrypt(n,e,t,i)}case V.publicKey.ecdh:{const{oid:e,Q:t,kdfParams:i}=r,{publicKey:s,wrappedKey:o}=await fa.elliptic.ecdh.encrypt(e,i,n,t,a);return{V:s,C:new ga(o)}}case V.publicKey.x25519:{if(!Y.isAES(t))throw Error("X25519 keys can only encrypt AES session keys");const{A:i}=r,{ephemeralPublicKey:a,wrappedKey:s}=await fa.elliptic.ecdhX.encrypt(e,n,i);return{ephemeralPublicKey:a,C:_a.fromObject({algorithm:t,wrappedKey:s})}}case V.publicKey.aead:{if(!i)throw Error("Cannot encrypt with symmetric key missing private parameters");const{cipher:e}=r,t=e.getValue(),{keyMaterial:a}=i,s=ne.preferredAEADAlgorithm,o=Sa(ne.preferredAEADAlgorithm),{ivLength:c}=o,u=Li(c),h=await o(t,a),f=await h.encrypt(n,u,new Uint8Array);return{aeadMode:new wa(s),iv:u,c:new pa(f)}}default:return[]}},publicKeyDecrypt:async function(e,t,r,i,n,a){switch(e){case V.publicKey.rsaEncryptSign:case V.publicKey.rsaEncrypt:{const{c:e}=i,{n,e:s}=t,{d:o,p:c,q:u,u:h}=r;return fa.rsa.decrypt(e,n,s,o,c,u,h,a)}case V.publicKey.elgamal:{const{c1:e,c2:n}=i,s=t.p,o=r.x;return fa.elgamal.decrypt(e,n,s,o,a)}case V.publicKey.ecdh:{const{oid:e,Q:a,kdfParams:s}=t,{d:o}=r,{V:c,C:u}=i;return fa.elliptic.ecdh.decrypt(e,s,c,u.data,a,o,n)}case V.publicKey.x25519:{const{A:n}=t,{k:a}=r,{ephemeralPublicKey:s,C:o}=i;if(!Y.isAES(o.algorithm))throw Error("AES session key expected");return fa.elliptic.ecdhX.decrypt(e,s,o.wrappedKey,n,a)}case V.publicKey.aead:{const{cipher:e}=t,n=e.getValue(),{keyMaterial:a}=r,{aeadMode:s,iv:o,c}=i,u=Sa(s.getValue());return(await u(n,a)).decrypt(c.data,o,new Uint8Array)}default:throw Error("Unknown public key encryption algorithm.")}},parsePublicKeyParams:function(e,t){let r=0;switch(e){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:case V.publicKey.rsaSign:{const e=Y.readMPI(t.subarray(r));r+=e.length+2;const i=Y.readMPI(t.subarray(r));return r+=i.length+2,{read:r,publicParams:{n:e,e:i}}}case V.publicKey.dsa:{const e=Y.readMPI(t.subarray(r));r+=e.length+2;const i=Y.readMPI(t.subarray(r));r+=i.length+2;const n=Y.readMPI(t.subarray(r));r+=n.length+2;const a=Y.readMPI(t.subarray(r));return r+=a.length+2,{read:r,publicParams:{p:e,q:i,g:n,y:a}}}case V.publicKey.elgamal:{const e=Y.readMPI(t.subarray(r));r+=e.length+2;const i=Y.readMPI(t.subarray(r));r+=i.length+2;const n=Y.readMPI(t.subarray(r));return r+=n.length+2,{read:r,publicParams:{p:e,g:i,y:n}}}case V.publicKey.ecdsa:{const e=new an;r+=e.read(t),Ca(e);const i=Y.readMPI(t.subarray(r));return r+=i.length+2,{read:r,publicParams:{oid:e,Q:i}}}case V.publicKey.eddsaLegacy:{const e=new an;r+=e.read(t),Ca(e);let i=Y.readMPI(t.subarray(r));return r+=i.length+2,i=Y.leftPad(i,33),{read:r,publicParams:{oid:e,Q:i}}}case V.publicKey.ecdh:{const e=new an;r+=e.read(t),Ca(e);const i=Y.readMPI(t.subarray(r));r+=i.length+2;const n=new ba;return r+=n.read(t.subarray(r)),{read:r,publicParams:{oid:e,Q:i,kdfParams:n}}}case V.publicKey.ed25519:case V.publicKey.x25519:{const e=t.subarray(r,r+32);return r+=e.length,{read:r,publicParams:{A:e}}}case V.publicKey.hmac:case V.publicKey.aead:{const e=new Aa;r+=e.read(t);const i=Gr.getHashByteLength(V.hash.sha256),n=t.subarray(r,r+i);return r+=i,{read:r,publicParams:{cipher:e,digest:n}}}default:throw new gn("Unknown public key encryption algorithm.")}},parsePrivateKeyParams:function(e,t,r){let i=0;switch(e){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:case V.publicKey.rsaSign:{const e=Y.readMPI(t.subarray(i));i+=e.length+2;const r=Y.readMPI(t.subarray(i));i+=r.length+2;const n=Y.readMPI(t.subarray(i));i+=n.length+2;const a=Y.readMPI(t.subarray(i));return i+=a.length+2,{read:i,privateParams:{d:e,p:r,q:n,u:a}}}case V.publicKey.dsa:case V.publicKey.elgamal:{const e=Y.readMPI(t.subarray(i));return i+=e.length+2,{read:i,privateParams:{x:e}}}case V.publicKey.ecdsa:case V.publicKey.ecdh:{const e=new En(r.oid);let n=Y.readMPI(t.subarray(i));return i+=n.length+2,n=Y.leftPad(n,e.payloadSize),{read:i,privateParams:{d:n}}}case V.publicKey.eddsaLegacy:{const e=new En(r.oid);let n=Y.readMPI(t.subarray(i));return i+=n.length+2,n=Y.leftPad(n,e.payloadSize),{read:i,privateParams:{seed:n}}}case V.publicKey.ed25519:{const e=t.subarray(i,i+32);return i+=e.length,{read:i,privateParams:{seed:e}}}case V.publicKey.x25519:{const e=t.subarray(i,i+32);return i+=e.length,{read:i,privateParams:{k:e}}}case V.publicKey.hmac:{const{cipher:e}=r,n=Gr.getHashByteLength(e.getValue()),a=t.subarray(i,i+32);i+=32;const s=t.subarray(i,i+n);return i+=n,{read:i,privateParams:{hashSeed:a,keyMaterial:s}}}case V.publicKey.aead:{const{cipher:e}=r,n=t.subarray(i,i+32);i+=32;const{keySize:a}=Vr(e.getValue()),s=t.subarray(i,i+a);return i+=a,{read:i,privateParams:{hashSeed:n,keyMaterial:s}}}default:throw new gn("Unknown public key encryption algorithm.")}},parseEncSessionKeyParams:function(e,t){let r=0;switch(e){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:return{c:Y.readMPI(t.subarray(r))};case V.publicKey.elgamal:{const e=Y.readMPI(t.subarray(r));r+=e.length+2;return{c1:e,c2:Y.readMPI(t.subarray(r))}}case V.publicKey.ecdh:{const e=Y.readMPI(t.subarray(r));r+=e.length+2;const i=new ga;return i.read(t.subarray(r)),{V:e,C:i}}case V.publicKey.x25519:{const e=t.subarray(r,r+32);r+=e.length;const i=new _a;return i.read(t.subarray(r)),{ephemeralPublicKey:e,C:i}}case V.publicKey.aead:{const e=new wa;r+=e.read(t.subarray(r));const{ivLength:i}=Sa(e.getValue()),n=t.subarray(r,r+i);r+=i;const a=new pa;return r+=a.read(t.subarray(r)),{aeadMode:e,iv:n,c:a}}default:throw new gn("Unknown public key encryption algorithm.")}},serializeParams:function(e,t){const r=new Set([V.publicKey.ed25519,V.publicKey.x25519,V.publicKey.aead,V.publicKey.hmac]),i=Object.keys(t).map((i=>{const n=t[i];return Y.isUint8Array(n)?r.has(e)?n:Y.uint8ArrayToMPI(n):n.write()}));return Y.concatUint8Array(i)},generateParams:function(e,t,r,i){switch(e){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:case V.publicKey.rsaSign:return fa.rsa.generate(t,65537).then((({n:e,e:t,d:r,p:i,q:n,u:a})=>({privateParams:{d:r,p:i,q:n,u:a},publicParams:{n:e,e:t}})));case V.publicKey.ecdsa:return fa.elliptic.generate(r).then((({oid:e,Q:t,secret:r})=>({privateParams:{d:r},publicParams:{oid:new an(e),Q:t}})));case V.publicKey.eddsaLegacy:return fa.elliptic.generate(r).then((({oid:e,Q:t,secret:r})=>({privateParams:{seed:r},publicParams:{oid:new an(e),Q:t}})));case V.publicKey.ecdh:return fa.elliptic.generate(r).then((({oid:e,Q:t,secret:r,hash:i,cipher:n})=>({privateParams:{d:r},publicParams:{oid:new an(e),Q:t,kdfParams:new ba({hash:i,cipher:n})}})));case V.publicKey.ed25519:return fa.elliptic.eddsa.generate(e).then((({A:e,seed:t})=>({privateParams:{seed:t},publicParams:{A:e}})));case V.publicKey.x25519:return fa.elliptic.ecdhX.generate(e).then((({A:e,k:t})=>({privateParams:{k:t},publicParams:{A:e}})));case V.publicKey.hmac:{const e=V.write(V.hash,i);return ka(Li(Gr.getHashByteLength(e)),new va(e))}case V.publicKey.aead:{const e=V.write(V.symmetric,i);return ka(Ea(e),new Aa(e))}case V.publicKey.dsa:case V.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Unknown public key algorithm.")}},validateParams:async function(e,t,r){if(!t||!r)throw Error("Missing key parameters");switch(e){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:case V.publicKey.rsaSign:{const{n:e,e:i}=t,{d:n,p:a,q:s,u:o}=r;return fa.rsa.validateParams(e,i,n,a,s,o)}case V.publicKey.dsa:{const{p:e,q:i,g:n,y:a}=t,{x:s}=r;return fa.dsa.validateParams(e,i,n,a,s)}case V.publicKey.elgamal:{const{p:e,g:i,y:n}=t,{x:a}=r;return fa.elgamal.validateParams(e,i,n,a)}case V.publicKey.ecdsa:case V.publicKey.ecdh:{const i=fa.elliptic[V.read(V.publicKey,e)],{oid:n,Q:a}=t,{d:s}=r;return i.validateParams(n,a,s)}case V.publicKey.eddsaLegacy:{const{Q:e,oid:i}=t,{seed:n}=r;return fa.elliptic.eddsaLegacy.validateParams(i,e,n)}case V.publicKey.ed25519:{const{A:i}=t,{seed:n}=r;return fa.elliptic.eddsa.validateParams(e,i,n)}case V.publicKey.x25519:{const{A:i}=t,{k:n}=r;return fa.elliptic.ecdhX.validateParams(e,i,n)}case V.publicKey.hmac:{const{cipher:e,digest:i}=t,{hashSeed:n,keyMaterial:a}=r;return Gr.getHashByteLength(e.getValue())===a.length&&Y.equalsUint8Array(i,await Gr.sha256(n))}case V.publicKey.aead:{const{cipher:e,digest:i}=t,{hashSeed:n,keyMaterial:a}=r,{keySize:s}=Vr(e.getValue());return s===a.length&&Y.equalsUint8Array(i,await Gr.sha256(n))}default:throw Error("Unknown public key algorithm.")}},getPrefixRandom:async function(e){const{blockSize:t}=Vr(e),r=await Li(t),i=new Uint8Array([r[r.length-2],r[r.length-1]]);return Y.concat([r,i])},generateSessionKey:Ea,getAEADMode:Sa,getCipher:Vr,getPreferredCurveHashAlgo:function(e,t){switch(e){case V.publicKey.ecdsa:case V.publicKey.eddsaLegacy:return fa.elliptic.getPreferredHashAlgo(t);case V.publicKey.ed25519:return fa.elliptic.eddsa.getPreferredHashAlgo(e);default:throw Error("Unknown elliptic signing algo")}}});const Ba={cipher:je,hash:Gr,mode:Qi,publicKey:fa,signature:ya,random:qi,pkcs1:Yi,pkcs5:Jn,aesKW:Gn};Object.assign(Ba,Ia);class Pa extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,Pa),this.name="Argon2OutOfMemoryError"}}let Ma,Da;class xa{constructor(e=ne){const{passes:t,parallelism:r,memoryExponent:i}=e.s2kArgon2Params;this.type="argon2",this.salt=null,this.t=t,this.p=r,this.encodedM=i}generateSalt(){this.salt=Ba.random.getRandomBytes(16)}read(e){let t=0;return this.salt=e.subarray(t,t+16),t+=16,this.t=e[t++],this.p=e[t++],this.encodedM=e[t++],t}write(){const e=[new Uint8Array([V.write(V.s2k,this.type)]),this.salt,new Uint8Array([this.t,this.p,this.encodedM])];return Y.concatUint8Array(e)}async produceKey(e,t){const r=2<<this.encodedM-1;try{Ma=Ma||(await Promise.resolve().then((function(){return Pb}))).default,Da=Da||Ma();const i=await Da,n=i({version:19,type:2,password:Y.encodeUTF8(e),salt:this.salt,tagLength:t,memorySize:r,parallelism:this.p,passes:this.t});return r>1048576&&(Da=Ma(),Da.catch((()=>{}))),n}catch(e){throw e.message&&(e.message.includes("Unable to grow instance memory")||e.message.includes("failed to grow memory")||e.message.includes("WebAssembly.Memory.grow")||e.message.includes("Out of memory"))?new Pa("Could not allocate required memory for Argon2"):e}}}class Ka{constructor(e,t=ne){this.algorithm=V.hash.sha256,this.type=V.read(V.s2k,e),this.c=t.s2kIterationCountByte,this.salt=null}generateSalt(){switch(this.type){case"salted":case"iterated":this.salt=Ba.random.getRandomBytes(8)}}getCount(){return 16+(15&this.c)<<6+(this.c>>4)}read(e){let t=0;switch(this.algorithm=e[t++],this.type){case"simple":break;case"salted":this.salt=e.subarray(t,t+8),t+=8;break;case"iterated":this.salt=e.subarray(t,t+8),t+=8,this.c=e[t++];break;case"gnu":if("GNU"!==Y.uint8ArrayToString(e.subarray(t,t+3)))throw new gn("Unknown s2k type.");t+=3;if(1001!==1e3+e[t++])throw new gn("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw new gn("Unknown s2k type.")}return t}write(){if("gnu-dummy"===this.type)return new Uint8Array([101,0,...Y.stringToUint8Array("GNU"),1]);const e=[new Uint8Array([V.write(V.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":e.push(this.salt);break;case"iterated":e.push(this.salt),e.push(new Uint8Array([this.c]));break;case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}return Y.concatUint8Array(e)}async produceKey(e,t){e=Y.encodeUTF8(e);const r=[];let i=0,n=0;for(;i<t;){let t;switch(this.type){case"simple":t=Y.concatUint8Array([new Uint8Array(n),e]);break;case"salted":t=Y.concatUint8Array([new Uint8Array(n),this.salt,e]);break;case"iterated":{const r=Y.concatUint8Array([this.salt,e]);let i=r.length;const a=Math.max(this.getCount(),i);t=new Uint8Array(n+a),t.set(r,n);for(let e=n+i;e<a;e+=i,i*=2)t.copyWithin(e,n,e);break}case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}const a=await Ba.hash.digest(this.algorithm,t);r.push(a),i+=a.length,n++}return Y.concatUint8Array(r).subarray(0,t)}}const Ua=new Set([V.s2k.argon2,V.s2k.iterated]);function Ra(e,t=ne){switch(e){case V.s2k.argon2:return new xa(t);case V.s2k.iterated:case V.s2k.gnu:case V.s2k.salted:case V.s2k.simple:return new Ka(e,t);default:throw new gn("Unsupported S2K type "+e)}}function Ta(e){const{s2kType:t}=e;if(!Ua.has(t))throw Error("The provided `config.s2kType` value is not allowed");return Ra(t,e)}var Qa="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function za(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)}const Fa={arraySet:function(e,t,r,i,n){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+i),n);else for(let a=0;a<i;a++)e[n+a]=t[r+a]},flattenChunks:function(e){let t,r,i,n,a;for(i=0,t=0,r=e.length;t<r;t++)i+=e[t].length;const s=new Uint8Array(i);for(n=0,t=0,r=e.length;t<r;t++)a=e[t],s.set(a,n),n+=a.length;return s}},La={arraySet:function(e,t,r,i,n){for(let a=0;a<i;a++)e[n+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};let Na=Qa?Uint8Array:Array,qa=Qa?Uint16Array:Array,Oa=Qa?Int32Array:Array,Ha=Qa?Fa.flattenChunks:La.flattenChunks,ja=Qa?Fa.arraySet:La.arraySet;const Ga=0,Wa=1,Va=2,Ja=3,Ya=4,Za=5,Xa=6,$a=0,es=1,ts=2,rs=-2,is=-3,ns=-5,as=-1,ss=1,os=2,cs=3,us=4,hs=0,fs=1,ds=2,ls=8;function ps(e){let t=e.length;for(;--t>=0;)e[t]=0}const ys=0,gs=1,bs=2,ms=29,ws=256,As=ws+1+ms,vs=30,_s=19,ks=2*As+1,Es=15,Ss=16,Cs=7,Is=256,Bs=16,Ps=17,Ms=18,Ds=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],xs=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Us=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Rs=Array(2*(As+2));ps(Rs);const Ts=Array(2*vs);ps(Ts);const Qs=Array(512);ps(Qs);const zs=Array(256);ps(zs);const Fs=Array(ms);ps(Fs);const Ls=Array(vs);function Ns(e,t,r,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=e&&e.length}let qs,Os,Hs;function js(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Gs(e){return e<256?Qs[e]:Qs[256+(e>>>7)]}function Ws(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Vs(e,t,r){e.bi_valid>Ss-r?(e.bi_buf|=t<<e.bi_valid&65535,Ws(e,e.bi_buf),e.bi_buf=t>>Ss-e.bi_valid,e.bi_valid+=r-Ss):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function Js(e,t,r){Vs(e,r[2*t],r[2*t+1])}function Ys(e,t){let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function Zs(e,t,r){const i=Array(Es+1);let n,a,s=0;for(n=1;n<=Es;n++)i[n]=s=s+r[n-1]<<1;for(a=0;a<=t;a++){const t=e[2*a+1];0!==t&&(e[2*a]=Ys(i[t]++,t))}}function Xs(e){let t;for(t=0;t<As;t++)e.dyn_ltree[2*t]=0;for(t=0;t<vs;t++)e.dyn_dtree[2*t]=0;for(t=0;t<_s;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*Is]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function $s(e){e.bi_valid>8?Ws(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function eo(e,t,r,i){const n=2*t,a=2*r;return e[n]<e[a]||e[n]===e[a]&&i[t]<=i[r]}function to(e,t,r){const i=e.heap[r];let n=r<<1;for(;n<=e.heap_len&&(n<e.heap_len&&eo(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!eo(t,i,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=i}function ro(e,t,r){let i,n,a,s,o=0;if(0!==e.last_lit)do{i=e.pending_buf[e.d_buf+2*o]<<8|e.pending_buf[e.d_buf+2*o+1],n=e.pending_buf[e.l_buf+o],o++,0===i?Js(e,n,t):(a=zs[n],Js(e,a+ws+1,t),s=Ds[a],0!==s&&(n-=Fs[a],Vs(e,n,s)),i--,a=Gs(i),Js(e,a,r),s=xs[a],0!==s&&(i-=Ls[a],Vs(e,i,s)))}while(o<e.last_lit);Js(e,Is,t)}function io(e,t){const r=t.dyn_tree,i=t.stat_desc.static_tree,n=t.stat_desc.has_stree,a=t.stat_desc.elems;let s,o,c,u=-1;for(e.heap_len=0,e.heap_max=ks,s=0;s<a;s++)0!==r[2*s]?(e.heap[++e.heap_len]=u=s,e.depth[s]=0):r[2*s+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=u<2?++u:0,r[2*c]=1,e.depth[c]=0,e.opt_len--,n&&(e.static_len-=i[2*c+1]);for(t.max_code=u,s=e.heap_len>>1;s>=1;s--)to(e,r,s);c=a;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],to(e,r,1),o=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=o,r[2*c]=r[2*s]+r[2*o],e.depth[c]=(e.depth[s]>=e.depth[o]?e.depth[s]:e.depth[o])+1,r[2*s+1]=r[2*o+1]=c,e.heap[1]=c++,to(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){const r=t.dyn_tree,i=t.max_code,n=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,h,f,d,l,p,y=0;for(d=0;d<=Es;d++)e.bl_count[d]=0;for(r[2*e.heap[e.heap_max]+1]=0,u=e.heap_max+1;u<ks;u++)h=e.heap[u],d=r[2*r[2*h+1]+1]+1,d>c&&(d=c,y++),r[2*h+1]=d,h>i||(e.bl_count[d]++,l=0,h>=o&&(l=s[h-o]),p=r[2*h],e.opt_len+=p*(d+l),a&&(e.static_len+=p*(n[2*h+1]+l)));if(0!==y){do{for(d=c-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[c]--,y-=2}while(y>0);for(d=c;0!==d;d--)for(h=e.bl_count[d];0!==h;)f=e.heap[--u],f>i||(r[2*f+1]!==d&&(e.opt_len+=(d-r[2*f+1])*r[2*f],r[2*f+1]=d),h--)}}(e,t),Zs(r,u,e.bl_count)}function no(e,t,r){let i,n,a=-1,s=t[1],o=0,c=7,u=4;for(0===s&&(c=138,u=3),t[2*(r+1)+1]=65535,i=0;i<=r;i++)n=s,s=t[2*(i+1)+1],++o<c&&n===s||(o<u?e.bl_tree[2*n]+=o:0!==n?(n!==a&&e.bl_tree[2*n]++,e.bl_tree[2*Bs]++):o<=10?e.bl_tree[2*Ps]++:e.bl_tree[2*Ms]++,o=0,a=n,0===s?(c=138,u=3):n===s?(c=6,u=3):(c=7,u=4))}function ao(e,t,r){let i,n,a=-1,s=t[1],o=0,c=7,u=4;for(0===s&&(c=138,u=3),i=0;i<=r;i++)if(n=s,s=t[2*(i+1)+1],!(++o<c&&n===s)){if(o<u)do{Js(e,n,e.bl_tree)}while(0!=--o);else 0!==n?(n!==a&&(Js(e,n,e.bl_tree),o--),Js(e,Bs,e.bl_tree),Vs(e,o-3,2)):o<=10?(Js(e,Ps,e.bl_tree),Vs(e,o-3,3)):(Js(e,Ms,e.bl_tree),Vs(e,o-11,7));o=0,a=n,0===s?(c=138,u=3):n===s?(c=6,u=3):(c=7,u=4)}}ps(Ls);let so=!1;function oo(e){so||(!function(){let e,t,r,i,n;const a=Array(Es+1);for(r=0,i=0;i<ms-1;i++)for(Fs[i]=r,e=0;e<1<<Ds[i];e++)zs[r++]=i;for(zs[r-1]=i,n=0,i=0;i<16;i++)for(Ls[i]=n,e=0;e<1<<xs[i];e++)Qs[n++]=i;for(n>>=7;i<vs;i++)for(Ls[i]=n<<7,e=0;e<1<<xs[i]-7;e++)Qs[256+n++]=i;for(t=0;t<=Es;t++)a[t]=0;for(e=0;e<=143;)Rs[2*e+1]=8,e++,a[8]++;for(;e<=255;)Rs[2*e+1]=9,e++,a[9]++;for(;e<=279;)Rs[2*e+1]=7,e++,a[7]++;for(;e<=287;)Rs[2*e+1]=8,e++,a[8]++;for(Zs(Rs,As+1,a),e=0;e<vs;e++)Ts[2*e+1]=5,Ts[2*e]=Ys(e,5);qs=new Ns(Rs,Ds,ws+1,As,Es),Os=new Ns(Ts,xs,0,vs,Es),Hs=new Ns([],Ks,0,_s,Cs)}(),so=!0),e.l_desc=new js(e.dyn_ltree,qs),e.d_desc=new js(e.dyn_dtree,Os),e.bl_desc=new js(e.bl_tree,Hs),e.bi_buf=0,e.bi_valid=0,Xs(e)}function co(e,t,r,i){Vs(e,(ys<<1)+(i?1:0),3),function(e,t,r,i){$s(e),i&&(Ws(e,r),Ws(e,~r)),ja(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}function uo(e){Vs(e,gs<<1,3),Js(e,Is,Rs),function(e){16===e.bi_valid?(Ws(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}function ho(e,t,r,i){let n,a,s=0;e.level>0?(e.strm.data_type===ds&&(e.strm.data_type=function(e){let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return hs;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return fs;for(t=32;t<ws;t++)if(0!==e.dyn_ltree[2*t])return fs;return hs}(e)),io(e,e.l_desc),io(e,e.d_desc),s=function(e){let t;for(no(e,e.dyn_ltree,e.l_desc.max_code),no(e,e.dyn_dtree,e.d_desc.max_code),io(e,e.bl_desc),t=_s-1;t>=3&&0===e.bl_tree[2*Us[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),n=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?co(e,t,r,i):e.strategy===us||a===n?(Vs(e,(gs<<1)+(i?1:0),3),ro(e,Rs,Ts)):(Vs(e,(bs<<1)+(i?1:0),3),function(e,t,r,i){let n;for(Vs(e,t-257,5),Vs(e,r-1,5),Vs(e,i-4,4),n=0;n<i;n++)Vs(e,e.bl_tree[2*Us[n]+1],3);ao(e,e.dyn_ltree,t-1),ao(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),ro(e,e.dyn_ltree,e.dyn_dtree)),Xs(e),i&&$s(e)}function fo(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(zs[r]+ws+1)]++,e.dyn_dtree[2*Gs(t)]++),e.last_lit===e.lit_bufsize-1}function lo(e,t,r,i){let n=65535&e|0,a=e>>>16&65535|0,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{n=n+t[i++]|0,a=a+n|0}while(--s);n%=65521,a%=65521}return n|a<<16|0}const po=function(){let e;const t=[];for(let r=0;r<256;r++){e=r;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function yo(e,t,r,i){const n=po,a=i+r;e^=-1;for(let r=i;r<a;r++)e=e>>>8^n[255&(e^t[r])];return-1^e}var go={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};const bo=9,mo=3,wo=258,Ao=wo+mo+1,vo=32,_o=42,ko=69,Eo=73,So=91,Co=103,Io=113,Bo=666,Po=1,Mo=2,Do=3,xo=4,Ko=3;function Uo(e,t){return e.msg=go[t],t}function Ro(e){return(e<<1)-(e>4?9:0)}function To(e){let t=e.length;for(;--t>=0;)e[t]=0}function Qo(e){const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(ja(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function zo(e,t){ho(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Qo(e.strm)}function Fo(e,t){e.pending_buf[e.pending++]=t}function Lo(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function No(e,t,r,i){let n=e.avail_in;return n>i&&(n=i),0===n?0:(e.avail_in-=n,ja(t,e.input,e.next_in,n,r),1===e.state.wrap?e.adler=lo(e.adler,t,n,r):2===e.state.wrap&&(e.adler=yo(e.adler,t,n,r)),e.next_in+=n,e.total_in+=n,n)}function qo(e,t){let r,i,n=e.max_chain_length,a=e.strstart,s=e.prev_length,o=e.nice_match;const c=e.strstart>e.w_size-Ao?e.strstart-(e.w_size-Ao):0,u=e.window,h=e.w_mask,f=e.prev,d=e.strstart+wo;let l=u[a+s-1],p=u[a+s];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do{if(r=t,u[r+s]===p&&u[r+s-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&a<d);if(i=wo-(d-a),a=d-wo,i>s){if(e.match_start=t,s=i,i>=o)break;l=u[a+s-1],p=u[a+s]}}}while((t=f[t&h])>c&&0!=--n);return s<=e.lookahead?s:e.lookahead}function Oo(e){const t=e.w_size;let r,i,n,a,s;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Ao)){ja(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,i=e.hash_size,r=i;do{n=e.head[--r],e.head[r]=n>=t?n-t:0}while(--i);i=t,r=i;do{n=e.prev[--r],e.prev[r]=n>=t?n-t:0}while(--i);a+=t}if(0===e.strm.avail_in)break;if(i=No(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=i,e.lookahead+e.insert>=mo)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+mo-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<mo)););}while(e.lookahead<Ao&&0!==e.strm.avail_in)}function Ho(e,t){let r,i;for(;;){if(e.lookahead<Ao){if(Oo(e),e.lookahead<Ao&&t===Ga)return Po;if(0===e.lookahead)break}if(r=0,e.lookahead>=mo&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+mo-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-Ao&&(e.match_length=qo(e,r)),e.match_length>=mo)if(i=fo(e,e.strstart-e.match_start,e.match_length-mo),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=mo){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+mo-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=fo(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(zo(e,!1),0===e.strm.avail_out))return Po}return e.insert=e.strstart<mo-1?e.strstart:mo-1,t===Ya?(zo(e,!0),0===e.strm.avail_out?Do:xo):e.last_lit&&(zo(e,!1),0===e.strm.avail_out)?Po:Mo}function jo(e,t){let r,i,n;for(;;){if(e.lookahead<Ao){if(Oo(e),e.lookahead<Ao&&t===Ga)return Po;if(0===e.lookahead)break}if(r=0,e.lookahead>=mo&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+mo-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=mo-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-Ao&&(e.match_length=qo(e,r),e.match_length<=5&&(e.strategy===ss||e.match_length===mo&&e.strstart-e.match_start>4096)&&(e.match_length=mo-1)),e.prev_length>=mo&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-mo,i=fo(e,e.strstart-1-e.prev_match,e.prev_length-mo),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+mo-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=mo-1,e.strstart++,i&&(zo(e,!1),0===e.strm.avail_out))return Po}else if(e.match_available){if(i=fo(e,0,e.window[e.strstart-1]),i&&zo(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return Po}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=fo(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<mo-1?e.strstart:mo-1,t===Ya?(zo(e,!0),0===e.strm.avail_out?Do:xo):e.last_lit&&(zo(e,!1),0===e.strm.avail_out)?Po:Mo}class Go{constructor(e,t,r,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=i,this.func=n}}const Wo=[new Go(0,0,0,0,(function(e,t){let r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Oo(e),0===e.lookahead&&t===Ga)return Po;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,zo(e,!1),0===e.strm.avail_out))return Po;if(e.strstart-e.block_start>=e.w_size-Ao&&(zo(e,!1),0===e.strm.avail_out))return Po}return e.insert=0,t===Ya?(zo(e,!0),0===e.strm.avail_out?Do:xo):(e.strstart>e.block_start&&(zo(e,!1),e.strm.avail_out),Po)})),new Go(4,4,8,4,Ho),new Go(4,5,16,8,Ho),new Go(4,6,32,32,Ho),new Go(4,4,16,16,jo),new Go(8,16,32,32,jo),new Go(8,16,128,128,jo),new Go(8,32,128,256,jo),new Go(32,128,258,1024,jo),new Go(32,258,258,4096,jo)];class Vo{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ls,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new qa(1146),this.dyn_dtree=new qa(122),this.bl_tree=new qa(78),To(this.dyn_ltree),To(this.dyn_dtree),To(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new qa(16),this.heap=new qa(573),To(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new qa(573),To(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}}function Jo(e){const t=function(e){let t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=ds,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?_o:Io,e.adler=2===t.wrap?0:1,t.last_flush=Ga,oo(t),$a):Uo(e,rs)}(e);return t===$a&&function(e){e.window_size=2*e.w_size,To(e.head),e.max_lazy_match=Wo[e.level].max_lazy,e.good_match=Wo[e.level].good_length,e.nice_match=Wo[e.level].nice_length,e.max_chain_length=Wo[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=mo-1,e.match_available=0,e.ins_h=0}(e.state),t}function Yo(e,t){let r,i,n,a;if(!e||!e.state||t>Za||t<0)return e?Uo(e,rs):rs;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===Bo&&t!==Ya)return Uo(e,0===e.avail_out?ns:rs);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===_o)if(2===i.wrap)e.adler=0,Fo(i,31),Fo(i,139),Fo(i,8),i.gzhead?(Fo(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Fo(i,255&i.gzhead.time),Fo(i,i.gzhead.time>>8&255),Fo(i,i.gzhead.time>>16&255),Fo(i,i.gzhead.time>>24&255),Fo(i,9===i.level?2:i.strategy>=os||i.level<2?4:0),Fo(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(Fo(i,255&i.gzhead.extra.length),Fo(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=yo(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=ko):(Fo(i,0),Fo(i,0),Fo(i,0),Fo(i,0),Fo(i,0),Fo(i,9===i.level?2:i.strategy>=os||i.level<2?4:0),Fo(i,Ko),i.status=Io);else{let t=ls+(i.w_bits-8<<4)<<8,r=-1;r=i.strategy>=os||i.level<2?0:i.level<6?1:6===i.level?2:3,t|=r<<6,0!==i.strstart&&(t|=vo),t+=31-t%31,i.status=Io,Lo(i,t),0!==i.strstart&&(Lo(i,e.adler>>>16),Lo(i,65535&e.adler)),e.adler=1}if(i.status===ko)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=yo(e.adler,i.pending_buf,i.pending-n,n)),Qo(e),n=i.pending,i.pending!==i.pending_buf_size));)Fo(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=yo(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Eo)}else i.status=Eo;if(i.status===Eo)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=yo(e.adler,i.pending_buf,i.pending-n,n)),Qo(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}a=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,Fo(i,a)}while(0!==a);i.gzhead.hcrc&&i.pending>n&&(e.adler=yo(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=So)}else i.status=So;if(i.status===So)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=yo(e.adler,i.pending_buf,i.pending-n,n)),Qo(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}a=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,Fo(i,a)}while(0!==a);i.gzhead.hcrc&&i.pending>n&&(e.adler=yo(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=Co)}else i.status=Co;if(i.status===Co&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Qo(e),i.pending+2<=i.pending_buf_size&&(Fo(i,255&e.adler),Fo(i,e.adler>>8&255),e.adler=0,i.status=Io)):i.status=Io),0!==i.pending){if(Qo(e),0===e.avail_out)return i.last_flush=-1,$a}else if(0===e.avail_in&&Ro(t)<=Ro(r)&&t!==Ya)return Uo(e,ns);if(i.status===Bo&&0!==e.avail_in)return Uo(e,ns);if(0!==e.avail_in||0!==i.lookahead||t!==Ga&&i.status!==Bo){var s=i.strategy===os?function(e,t){let r;for(;;){if(0===e.lookahead&&(Oo(e),0===e.lookahead)){if(t===Ga)return Po;break}if(e.match_length=0,r=fo(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(zo(e,!1),0===e.strm.avail_out))return Po}return e.insert=0,t===Ya?(zo(e,!0),0===e.strm.avail_out?Do:xo):e.last_lit&&(zo(e,!1),0===e.strm.avail_out)?Po:Mo}(i,t):i.strategy===cs?function(e,t){let r,i,n,a;const s=e.window;for(;;){if(e.lookahead<=wo){if(Oo(e),e.lookahead<=wo&&t===Ga)return Po;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=mo&&e.strstart>0&&(n=e.strstart-1,i=s[n],i===s[++n]&&i===s[++n]&&i===s[++n])){a=e.strstart+wo;do{}while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<a);e.match_length=wo-(a-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=mo?(r=fo(e,1,e.match_length-mo),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=fo(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(zo(e,!1),0===e.strm.avail_out))return Po}return e.insert=0,t===Ya?(zo(e,!0),0===e.strm.avail_out?Do:xo):e.last_lit&&(zo(e,!1),0===e.strm.avail_out)?Po:Mo}(i,t):Wo[i.level].func(i,t);if(s!==Do&&s!==xo||(i.status=Bo),s===Po||s===Do)return 0===e.avail_out&&(i.last_flush=-1),$a;if(s===Mo&&(t===Wa?uo(i):t!==Za&&(co(i,0,0,!1),t===Ja&&(To(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),Qo(e),0===e.avail_out))return i.last_flush=-1,$a}return t!==Ya?$a:i.wrap<=0?es:(2===i.wrap?(Fo(i,255&e.adler),Fo(i,e.adler>>8&255),Fo(i,e.adler>>16&255),Fo(i,e.adler>>24&255),Fo(i,255&e.total_in),Fo(i,e.total_in>>8&255),Fo(i,e.total_in>>16&255),Fo(i,e.total_in>>24&255)):(Lo(i,e.adler>>>16),Lo(i,65535&e.adler)),Qo(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?$a:es)}try{String.fromCharCode.call(null,0)}catch(e){}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){}const Zo=new Na(256);for(let e=0;e<256;e++)Zo[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;function Xo(e){let t,r,i,n,a=0;const s=e.length;for(i=0;i<s;i++)t=e.charCodeAt(i),55296==(64512&t)&&i+1<s&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(t=65536+(t-55296<<10)+(r-56320),i++)),a+=t<128?1:t<2048?2:t<65536?3:4;const o=new Na(a);for(n=0,i=0;n<a;i++)t=e.charCodeAt(i),55296==(64512&t)&&i+1<s&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(t=65536+(t-55296<<10)+(r-56320),i++)),t<128?o[n++]=t:t<2048?(o[n++]=192|t>>>6,o[n++]=128|63&t):t<65536?(o[n++]=224|t>>>12,o[n++]=128|t>>>6&63,o[n++]=128|63&t):(o[n++]=240|t>>>18,o[n++]=128|t>>>12&63,o[n++]=128|t>>>6&63,o[n++]=128|63&t);return o}Zo[254]=Zo[254]=1;class $o{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}}class ec{constructor(e){this.options={level:as,method:ls,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,...e||{}};const t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $o,this.strm.avail_out=0;var r,i,n=function(e,t,r,i,n,a){if(!e)return rs;let s=1;if(t===as&&(t=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),n<1||n>bo||r!==ls||i<8||i>15||t<0||t>9||a<0||a>us)return Uo(e,rs);8===i&&(i=9);const o=new Vo;return e.state=o,o.strm=e,o.wrap=s,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+mo-1)/mo),o.window=new Na(2*o.w_size),o.head=new qa(o.hash_size),o.prev=new qa(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Na(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=a,o.method=r,Jo(e)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==$a)throw Error(go[n]);if(t.header&&(r=this.strm,i=t.header,r&&r.state&&(2!==r.state.wrap||(r.state.gzhead=i))),t.dictionary){let e;if(e="string"==typeof t.dictionary?Xo(t.dictionary):t.dictionary instanceof ArrayBuffer?new Uint8Array(t.dictionary):t.dictionary,n=function(e,t){let r,i,n,a,s,o,c,u,h=t.length;if(!e||!e.state)return rs;if(r=e.state,a=r.wrap,2===a||1===a&&r.status!==_o||r.lookahead)return rs;for(1===a&&(e.adler=lo(e.adler,t,h,0)),r.wrap=0,h>=r.w_size&&(0===a&&(To(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new Na(r.w_size),ja(u,t,h-r.w_size,r.w_size,0),t=u,h=r.w_size),s=e.avail_in,o=e.next_in,c=e.input,e.avail_in=h,e.next_in=0,e.input=t,Oo(r);r.lookahead>=mo;){i=r.strstart,n=r.lookahead-(mo-1);do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+mo-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++}while(--n);r.strstart=i,r.lookahead=mo-1,Oo(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=mo-1,r.match_available=0,e.next_in=o,e.input=c,e.avail_in=s,r.wrap=a,$a}(this.strm,e),n!==$a)throw Error(go[n]);this._dict_set=!0}}push(e,t){const{strm:r,options:{chunkSize:i}}=this;var n,a;if(this.ended)return!1;a=t===~~t?t:!0===t?Ya:Ga,"string"==typeof e?r.input=Xo(e):e instanceof ArrayBuffer?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new Na(i),r.next_out=0,r.avail_out=i),(n=Yo(r,a))!==es&&n!==$a)return this.onEnd(n),this.ended=!0,!1;0!==r.avail_out&&(0!==r.avail_in||a!==Ya&&a!==Va)||this.onData(za(r.output,r.next_out))}while((r.avail_in>0||0===r.avail_out)&&n!==es);return a===Ya?(n=function(e){let t;return e&&e.state?(t=e.state.status,t!==_o&&t!==ko&&t!==Eo&&t!==So&&t!==Co&&t!==Io&&t!==Bo?Uo(e,rs):(e.state=null,t===Io?Uo(e,is):$a)):rs}(this.strm),this.onEnd(n),this.ended=!0,n===$a):a!==Va||(this.onEnd($a),r.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===$a&&(this.result=Ha(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}const tc=30,rc=12;function ic(e,t){let r,i,n,a,s,o,c,u,h,f;const d=e.state;r=e.next_in;const l=e.input,p=r+(e.avail_in-5);i=e.next_out;const y=e.output,g=i-(t-e.avail_out),b=i+(e.avail_out-257),m=d.dmax,w=d.wsize,A=d.whave,v=d.wnext,_=d.window;n=d.hold,a=d.bits;const k=d.lencode,E=d.distcode,S=(1<<d.lenbits)-1,C=(1<<d.distbits)-1;e:do{a<15&&(n+=l[r++]<<a,a+=8,n+=l[r++]<<a,a+=8),s=k[n&S];t:for(;;){if(o=s>>>24,n>>>=o,a-=o,o=s>>>16&255,0===o)y[i++]=65535&s;else{if(!(16&o)){if(0==(64&o)){s=k[(65535&s)+(n&(1<<o)-1)];continue t}if(32&o){d.mode=rc;break e}e.msg="invalid literal/length code",d.mode=tc;break e}c=65535&s,o&=15,o&&(a<o&&(n+=l[r++]<<a,a+=8),c+=n&(1<<o)-1,n>>>=o,a-=o),a<15&&(n+=l[r++]<<a,a+=8,n+=l[r++]<<a,a+=8),s=E[n&C];r:for(;;){if(o=s>>>24,n>>>=o,a-=o,o=s>>>16&255,!(16&o)){if(0==(64&o)){s=E[(65535&s)+(n&(1<<o)-1)];continue r}e.msg="invalid distance code",d.mode=tc;break e}if(u=65535&s,o&=15,a<o&&(n+=l[r++]<<a,a+=8,a<o&&(n+=l[r++]<<a,a+=8)),u+=n&(1<<o)-1,u>m){e.msg="invalid distance too far back",d.mode=tc;break e}if(n>>>=o,a-=o,o=i-g,u>o){if(o=u-o,o>A&&d.sane){e.msg="invalid distance too far back",d.mode=tc;break e}if(h=0,f=_,0===v){if(h+=w-o,o<c){c-=o;do{y[i++]=_[h++]}while(--o);h=i-u,f=y}}else if(v<o){if(h+=w+v-o,o-=v,o<c){c-=o;do{y[i++]=_[h++]}while(--o);if(h=0,v<c){o=v,c-=o;do{y[i++]=_[h++]}while(--o);h=i-u,f=y}}}else if(h+=v-o,o<c){c-=o;do{y[i++]=_[h++]}while(--o);h=i-u,f=y}for(;c>2;)y[i++]=f[h++],y[i++]=f[h++],y[i++]=f[h++],c-=3;c&&(y[i++]=f[h++],c>1&&(y[i++]=f[h++]))}else{h=i-u;do{y[i++]=y[h++],y[i++]=y[h++],y[i++]=y[h++],c-=3}while(c>2);c&&(y[i++]=y[h++],c>1&&(y[i++]=y[h++]))}break}}break}}while(r<p&&i<b);c=a>>3,r-=c,a-=c<<3,n&=(1<<a)-1,e.next_in=r,e.next_out=i,e.avail_in=r<p?p-r+5:5-(r-p),e.avail_out=i<b?b-i+257:257-(i-b),d.hold=n,d.bits=a}const nc=15,ac=852,sc=592,oc=0,cc=1,uc=2,hc=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],fc=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],dc=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],lc=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function pc(e,t,r,i,n,a,s,o){const c=o.bits;let u,h,f,d,l,p=0,y=0,g=0,b=0,m=0,w=0,A=0,v=0,_=0,k=0,E=null,S=0;const C=new qa(nc+1),I=new qa(nc+1);let B,P,M,D=null,x=0;for(p=0;p<=nc;p++)C[p]=0;for(y=0;y<i;y++)C[t[r+y]]++;for(m=c,b=nc;b>=1&&0===C[b];b--);if(m>b&&(m=b),0===b)return n[a++]=20971520,n[a++]=20971520,o.bits=1,0;for(g=1;g<b&&0===C[g];g++);for(m<g&&(m=g),v=1,p=1;p<=nc;p++)if(v<<=1,v-=C[p],v<0)return-1;if(v>0&&(e===oc||1!==b))return-1;for(I[1]=0,p=1;p<nc;p++)I[p+1]=I[p]+C[p];for(y=0;y<i;y++)0!==t[r+y]&&(s[I[t[r+y]]++]=y);e===oc?(E=D=s,l=19):e===cc?(E=hc,S-=257,D=fc,x-=257,l=256):(E=dc,D=lc,l=-1),k=0,y=0,p=g,d=a,w=m,A=0,f=-1,_=1<<m;const K=_-1;if(e===cc&&_>ac||e===uc&&_>sc)return 1;for(;;){B=p-A,s[y]<l?(P=0,M=s[y]):s[y]>l?(P=D[x+s[y]],M=E[S+s[y]]):(P=96,M=0),u=1<<p-A,h=1<<w,g=h;do{h-=u,n[d+(k>>A)+h]=B<<24|P<<16|M|0}while(0!==h);for(u=1<<p-1;k&u;)u>>=1;if(0!==u?(k&=u-1,k+=u):k=0,y++,0==--C[p]){if(p===b)break;p=t[r+s[y]]}if(p>m&&(k&K)!==f){for(0===A&&(A=m),d+=g,w=p-A,v=1<<w;w+A<b&&(v-=C[w+A],!(v<=0));)w++,v<<=1;if(_+=1<<w,e===cc&&_>ac||e===uc&&_>sc)return 1;f=k&K,n[f]=m<<24|w<<16|d-a|0}}return 0!==k&&(n[d+k]=p-A<<24|64<<16|0),o.bits=m,0}const yc=0,gc=1,bc=2,mc=1,wc=2,Ac=3,vc=4,_c=5,kc=6,Ec=7,Sc=8,Cc=9,Ic=10,Bc=11,Pc=12,Mc=13,Dc=14,xc=15,Kc=16,Uc=17,Rc=18,Tc=19,Qc=20,zc=21,Fc=22,Lc=23,Nc=24,qc=25,Oc=26,Hc=27,jc=28,Gc=29,Wc=30,Vc=852,Jc=592;function Yc(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}class Zc{constructor(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new qa(320),this.work=new qa(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}}function Xc(e){let t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,function(e){let t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=mc,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Oa(Vc),t.distcode=t.distdyn=new Oa(Jc),t.sane=1,t.back=-1,$a):rs}(e)):rs}function $c(e,t){let r,i;return e?(i=new Zc,e.state=i,i.window=null,r=function(e,t){let r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?rs:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,Xc(e))):rs}(e,t),r!==$a&&(e.state=null),r):rs}let eu,tu,ru=!0;function iu(e){if(ru){let t;for(eu=new Oa(512),tu=new Oa(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(pc(gc,e.lens,0,288,eu,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;pc(bc,e.lens,0,32,tu,0,e.work,{bits:5}),ru=!1}e.lencode=eu,e.lenbits=9,e.distcode=tu,e.distbits=5}function nu(e,t,r,i){let n;const a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Na(a.wsize)),i>=a.wsize?(ja(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>i&&(n=i),ja(a.window,t,r-i,n,a.wnext),(i-=n)?(ja(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0}function au(e,t){let r,i,n,a,s,o,c,u,h,f,d,l,p,y,g,b,m,w,A,v,_,k,E,S,C=0,I=new Na(4);const B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return rs;r=e.state,r.mode===Pc&&(r.mode=Mc),s=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,o=e.avail_in,u=r.hold,h=r.bits,f=o,d=c,k=$a;e:for(;;)switch(r.mode){case mc:if(0===r.wrap){r.mode=Mc;break}for(;h<16;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(2&r.wrap&&35615===u){r.check=0,I[0]=255&u,I[1]=u>>>8&255,r.check=yo(r.check,I,2,0),u=0,h=0,r.mode=wc;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=Wc;break}if((15&u)!==ls){e.msg="unknown compression method",r.mode=Wc;break}if(u>>>=4,h-=4,_=8+(15&u),0===r.wbits)r.wbits=_;else if(_>r.wbits){e.msg="invalid window size",r.mode=Wc;break}r.dmax=1<<_,e.adler=r.check=1,r.mode=512&u?Ic:Pc,u=0,h=0;break;case wc:for(;h<16;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(r.flags=u,(255&r.flags)!==ls){e.msg="unknown compression method",r.mode=Wc;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=Wc;break}r.head&&(r.head.text=u>>8&1),512&r.flags&&(I[0]=255&u,I[1]=u>>>8&255,r.check=yo(r.check,I,2,0)),u=0,h=0,r.mode=Ac;case Ac:for(;h<32;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}r.head&&(r.head.time=u),512&r.flags&&(I[0]=255&u,I[1]=u>>>8&255,I[2]=u>>>16&255,I[3]=u>>>24&255,r.check=yo(r.check,I,4,0)),u=0,h=0,r.mode=vc;case vc:for(;h<16;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}r.head&&(r.head.xflags=255&u,r.head.os=u>>8),512&r.flags&&(I[0]=255&u,I[1]=u>>>8&255,r.check=yo(r.check,I,2,0)),u=0,h=0,r.mode=_c;case _c:if(1024&r.flags){for(;h<16;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}r.length=u,r.head&&(r.head.extra_len=u),512&r.flags&&(I[0]=255&u,I[1]=u>>>8&255,r.check=yo(r.check,I,2,0)),u=0,h=0}else r.head&&(r.head.extra=null);r.mode=kc;case kc:if(1024&r.flags&&(l=r.length,l>o&&(l=o),l&&(r.head&&(_=r.head.extra_len-r.length,r.head.extra||(r.head.extra=Array(r.head.extra_len)),ja(r.head.extra,i,a,l,_)),512&r.flags&&(r.check=yo(r.check,i,l,a)),o-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=Ec;case Ec:if(2048&r.flags){if(0===o)break e;l=0;do{_=i[a+l++],r.head&&_&&r.length<65536&&(r.head.name+=String.fromCharCode(_))}while(_&&l<o);if(512&r.flags&&(r.check=yo(r.check,i,l,a)),o-=l,a+=l,_)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Sc;case Sc:if(4096&r.flags){if(0===o)break e;l=0;do{_=i[a+l++],r.head&&_&&r.length<65536&&(r.head.comment+=String.fromCharCode(_))}while(_&&l<o);if(512&r.flags&&(r.check=yo(r.check,i,l,a)),o-=l,a+=l,_)break e}else r.head&&(r.head.comment=null);r.mode=Cc;case Cc:if(512&r.flags){for(;h<16;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(u!==(65535&r.check)){e.msg="header crc mismatch",r.mode=Wc;break}u=0,h=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Pc;break;case Ic:for(;h<32;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}e.adler=r.check=Yc(u),u=0,h=0,r.mode=Bc;case Bc:if(0===r.havedict)return e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=o,r.hold=u,r.bits=h,ts;e.adler=r.check=1,r.mode=Pc;case Pc:if(t===Za||t===Xa)break e;case Mc:if(r.last){u>>>=7&h,h-=7&h,r.mode=Hc;break}for(;h<3;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}switch(r.last=1&u,u>>>=1,h-=1,3&u){case 0:r.mode=Dc;break;case 1:if(iu(r),r.mode=Qc,t===Xa){u>>>=2,h-=2;break e}break;case 2:r.mode=Uc;break;case 3:e.msg="invalid block type",r.mode=Wc}u>>>=2,h-=2;break;case Dc:for(u>>>=7&h,h-=7&h;h<32;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Wc;break}if(r.length=65535&u,u=0,h=0,r.mode=xc,t===Xa)break e;case xc:r.mode=Kc;case Kc:if(l=r.length,l){if(l>o&&(l=o),l>c&&(l=c),0===l)break e;ja(n,i,a,l,s),o-=l,a+=l,c-=l,s+=l,r.length-=l;break}r.mode=Pc;break;case Uc:for(;h<14;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(r.nlen=257+(31&u),u>>>=5,h-=5,r.ndist=1+(31&u),u>>>=5,h-=5,r.ncode=4+(15&u),u>>>=4,h-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Wc;break}r.have=0,r.mode=Rc;case Rc:for(;r.have<r.ncode;){for(;h<3;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}r.lens[B[r.have++]]=7&u,u>>>=3,h-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,E={bits:r.lenbits},k=pc(yc,r.lens,0,19,r.lencode,0,r.work,E),r.lenbits=E.bits,k){e.msg="invalid code lengths set",r.mode=Wc;break}r.have=0,r.mode=Tc;case Tc:for(;r.have<r.nlen+r.ndist;){for(;C=r.lencode[u&(1<<r.lenbits)-1],g=C>>>24,b=C>>>16&255,m=65535&C,!(g<=h);){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(m<16)u>>>=g,h-=g,r.lens[r.have++]=m;else{if(16===m){for(S=g+2;h<S;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(u>>>=g,h-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=Wc;break}_=r.lens[r.have-1],l=3+(3&u),u>>>=2,h-=2}else if(17===m){for(S=g+3;h<S;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}u>>>=g,h-=g,_=0,l=3+(7&u),u>>>=3,h-=3}else{for(S=g+7;h<S;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}u>>>=g,h-=g,_=0,l=11+(127&u),u>>>=7,h-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Wc;break}for(;l--;)r.lens[r.have++]=_}}if(r.mode===Wc)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Wc;break}if(r.lenbits=9,E={bits:r.lenbits},k=pc(gc,r.lens,0,r.nlen,r.lencode,0,r.work,E),r.lenbits=E.bits,k){e.msg="invalid literal/lengths set",r.mode=Wc;break}if(r.distbits=6,r.distcode=r.distdyn,E={bits:r.distbits},k=pc(bc,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,E),r.distbits=E.bits,k){e.msg="invalid distances set",r.mode=Wc;break}if(r.mode=Qc,t===Xa)break e;case Qc:r.mode=zc;case zc:if(o>=6&&c>=258){e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=o,r.hold=u,r.bits=h,ic(e,d),s=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,o=e.avail_in,u=r.hold,h=r.bits,r.mode===Pc&&(r.back=-1);break}for(r.back=0;C=r.lencode[u&(1<<r.lenbits)-1],g=C>>>24,b=C>>>16&255,m=65535&C,!(g<=h);){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(b&&0==(240&b)){for(w=g,A=b,v=m;C=r.lencode[v+((u&(1<<w+A)-1)>>w)],g=C>>>24,b=C>>>16&255,m=65535&C,!(w+g<=h);){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}u>>>=w,h-=w,r.back+=w}if(u>>>=g,h-=g,r.back+=g,r.length=m,0===b){r.mode=Oc;break}if(32&b){r.back=-1,r.mode=Pc;break}if(64&b){e.msg="invalid literal/length code",r.mode=Wc;break}r.extra=15&b,r.mode=Fc;case Fc:if(r.extra){for(S=r.extra;h<S;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Lc;case Lc:for(;C=r.distcode[u&(1<<r.distbits)-1],g=C>>>24,b=C>>>16&255,m=65535&C,!(g<=h);){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(0==(240&b)){for(w=g,A=b,v=m;C=r.distcode[v+((u&(1<<w+A)-1)>>w)],g=C>>>24,b=C>>>16&255,m=65535&C,!(w+g<=h);){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}u>>>=w,h-=w,r.back+=w}if(u>>>=g,h-=g,r.back+=g,64&b){e.msg="invalid distance code",r.mode=Wc;break}r.offset=m,r.extra=15&b,r.mode=Nc;case Nc:if(r.extra){for(S=r.extra;h<S;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Wc;break}r.mode=qc;case qc:if(0===c)break e;if(l=d-c,r.offset>l){if(l=r.offset-l,l>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Wc;break}l>r.wnext?(l-=r.wnext,p=r.wsize-l):p=r.wnext-l,l>r.length&&(l=r.length),y=r.window}else y=n,p=s-r.offset,l=r.length;l>c&&(l=c),c-=l,r.length-=l;do{n[s++]=y[p++]}while(--l);0===r.length&&(r.mode=zc);break;case Oc:if(0===c)break e;n[s++]=r.length,c--,r.mode=zc;break;case Hc:if(r.wrap){for(;h<32;){if(0===o)break e;o--,u|=i[a++]<<h,h+=8}if(d-=c,e.total_out+=d,r.total+=d,d&&(e.adler=r.check=r.flags?yo(r.check,n,d,s-d):lo(r.check,n,d,s-d)),d=c,(r.flags?u:Yc(u))!==r.check){e.msg="incorrect data check",r.mode=Wc;break}u=0,h=0}r.mode=jc;case jc:if(r.wrap&&r.flags){for(;h<32;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(u!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=Wc;break}u=0,h=0}r.mode=Gc;case Gc:k=es;break e;case Wc:k=is;break e;default:return rs}return e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=o,r.hold=u,r.bits=h,(r.wsize||d!==e.avail_out&&r.mode<Wc&&(r.mode<Hc||t!==Ya))&&nu(e,e.output,e.next_out,d-e.avail_out),f-=e.avail_in,d-=e.avail_out,e.total_in+=f,e.total_out+=d,r.total+=d,r.wrap&&d&&(e.adler=r.check=r.flags?yo(r.check,n,d,e.next_out-d):lo(r.check,n,d,e.next_out-d)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Pc?128:0)+(r.mode===Qc||r.mode===xc?256:0),(0===f&&0===d||t===Ya)&&k===$a&&(k=ns),k}function su(e,t){const r=t.length;let i,n;return e&&e.state?(i=e.state,0!==i.wrap&&i.mode!==Bc?rs:i.mode===Bc&&(n=1,n=lo(n,t,r,0),n!==i.check)?is:(nu(e,t,r,r),i.havedict=1,$a)):rs}class ou{constructor(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}}class cu{constructor(e){this.options={chunkSize:16384,windowBits:0,...e||{}};const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $o,this.strm.avail_out=0;let r=$c(this.strm,t.windowBits);if(r!==$a)throw Error(go[r]);if(this.header=new ou,function(e,t){let r;e&&e.state&&(r=e.state,0==(2&r.wrap)||(r.head=t,t.done=!1))}(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Xo(t.dictionary):t.dictionary instanceof ArrayBuffer&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=su(this.strm,t.dictionary),r!==$a)))throw Error(go[r])}push(e,t){const{strm:r,options:{chunkSize:i,dictionary:n}}=this;let a,s,o=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?Ya:Ga,"string"==typeof e?r.input=function(e){const t=new Na(e.length);for(let r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t}(e):e instanceof ArrayBuffer?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new Na(i),r.next_out=0,r.avail_out=i),a=au(r,Ga),a===ts&&n&&(a=su(this.strm,n)),a===ns&&!0===o&&(a=$a,o=!1),a!==es&&a!==$a)return this.onEnd(a),this.ended=!0,!1;r.next_out&&(0!==r.avail_out&&a!==es&&(0!==r.avail_in||s!==Ya&&s!==Va)||this.onData(za(r.output,r.next_out))),0===r.avail_in&&0===r.avail_out&&(o=!0)}while((r.avail_in>0||0===r.avail_out)&&a!==es);return a===es&&(s=Ya),s===Ya?(a=function(e){if(!e||!e.state)return rs;const t=e.state;return t.window&&(t.window=null),e.state=null,$a}(this.strm),this.onEnd(a),this.ended=!0,a===$a):s!==Va||(this.onEnd($a),r.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===$a&&(this.result=Ha(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}var uu=[0,1,3,7,15,31,63,127,255],hu=function(e){this.stream=e,this.bitOffset=0,this.curByte=0,this.hasByte=!1};hu.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},hu.prototype.read=function(e){for(var t=0;e>0;){this._ensureByte();var r=8-this.bitOffset;if(e>=r)t<<=r,t|=uu[r]&this.curByte,this.hasByte=!1,this.bitOffset=0,e-=r;else{t<<=e;var i=r-e;t|=(this.curByte&uu[e]<<i)>>i,this.bitOffset+=e,e=0}}return t},hu.prototype.seek=function(e){var t=e%8,r=(e-t)/8;this.bitOffset=t,this.stream.seek(r),this.hasByte=!1},hu.prototype.pi=function(){var e,t=new Uint8Array(6);for(e=0;e<t.length;e++)t[e]=this.read(8);return function(e){return Array.prototype.map.call(e,(e=>("00"+e.toString(16)).slice(-2))).join("")}(t)};var fu=hu,du=function(){};du.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},du.prototype.read=function(e,t,r){for(var i=0;i<r;){var n=this.readByte();if(n<0)return 0===i?-1:i;e[t++]=n,i++}return i},du.prototype.seek=function(e){throw Error("abstract method seek() not implemented")},du.prototype.writeByte=function(e){throw Error("abstract method readByte() not implemented")},du.prototype.write=function(e,t,r){var i;for(i=0;i<r;i++)this.writeByte(e[t++]);return r},du.prototype.flush=function(){};var lu,pu=du,yu=(lu=new Uint32Array([0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188]),function(){var e=4294967295;this.getCRC=function(){return~e>>>0},this.updateCRC=function(t){e=e<<8^lu[255&(e>>>24^t)]},this.updateCRCRun=function(t,r){for(;r-- >0;)e=e<<8^lu[255&(e>>>24^t)]}}),gu=function(e,t){var r,i=e[t];for(r=t;r>0;r--)e[r]=e[r-1];return e[0]=i,i},bu={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},mu={};mu[bu.LAST_BLOCK]="Bad file checksum",mu[bu.NOT_BZIP_DATA]="Not bzip data",mu[bu.UNEXPECTED_INPUT_EOF]="Unexpected input EOF",mu[bu.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF",mu[bu.DATA_ERROR]="Data error",mu[bu.OUT_OF_MEMORY]="Out of memory",mu[bu.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var wu=function(e,t){var r=mu[e]||"unknown error";t&&(r+=": "+t);var i=new TypeError(r);throw i.errorCode=e,i},Au=function(e,t){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(e,t)};Au.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new yu,!0):(this.writeCount=-1,!1)},Au.prototype._start_bunzip=function(e,t){var r=new Uint8Array(4);4===e.read(r,0,4)&&"BZh"===String.fromCharCode(r[0],r[1],r[2])||wu(bu.NOT_BZIP_DATA,"bad magic");var i=r[3]-48;(i<1||i>9)&&wu(bu.NOT_BZIP_DATA,"level out of range"),this.reader=new fu(e),this.dbufSize=1e5*i,this.nextoutput=0,this.outputStream=t,this.streamCRC=0},Au.prototype._get_next_block=function(){var e,t,r,i=this.reader,n=i.pi();if("177245385090"===n)return!1;"314159265359"!==n&&wu(bu.NOT_BZIP_DATA),this.targetBlockCRC=i.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,i.read(1)&&wu(bu.OBSOLETE_INPUT);var a=i.read(24);a>this.dbufSize&&wu(bu.DATA_ERROR,"initial position out of bounds");var s=i.read(16),o=new Uint8Array(256),c=0;for(e=0;e<16;e++)if(s&1<<15-e){var u=16*e;for(r=i.read(16),t=0;t<16;t++)r&1<<15-t&&(o[c++]=u+t)}var h=i.read(3);(h<2||h>6)&&wu(bu.DATA_ERROR);var f=i.read(15);0===f&&wu(bu.DATA_ERROR);var d=new Uint8Array(256);for(e=0;e<h;e++)d[e]=e;var l=new Uint8Array(f);for(e=0;e<f;e++){for(t=0;i.read(1);t++)t>=h&&wu(bu.DATA_ERROR);l[e]=gu(d,t)}var p,y=c+2,g=[];for(t=0;t<h;t++){var b,m,w=new Uint8Array(y),A=new Uint16Array(21);for(s=i.read(5),e=0;e<y;e++){for(;(s<1||s>20)&&wu(bu.DATA_ERROR),i.read(1);)i.read(1)?s--:s++;w[e]=s}for(b=m=w[0],e=1;e<y;e++)w[e]>m?m=w[e]:w[e]<b&&(b=w[e]);p={},g.push(p),p.permute=new Uint16Array(258),p.limit=new Uint32Array(22),p.base=new Uint32Array(21),p.minLen=b,p.maxLen=m;var v=0;for(e=b;e<=m;e++)for(A[e]=p.limit[e]=0,s=0;s<y;s++)w[s]===e&&(p.permute[v++]=s);for(e=0;e<y;e++)A[w[e]]++;for(v=s=0,e=b;e<m;e++)v+=A[e],p.limit[e]=v-1,v<<=1,s+=A[e],p.base[e+1]=v-s;p.limit[m+1]=Number.MAX_VALUE,p.limit[m]=v+A[m]-1,p.base[b]=0}var _=new Uint32Array(256);for(e=0;e<256;e++)d[e]=e;var k,E=0,S=0,C=0,I=this.dbuf=new Uint32Array(this.dbufSize);for(y=0;;){for(y--||(y=49,C>=f&&wu(bu.DATA_ERROR),p=g[l[C++]]),e=p.minLen,t=i.read(e);e>p.maxLen&&wu(bu.DATA_ERROR),!(t<=p.limit[e]);e++)t=t<<1|i.read(1);((t-=p.base[e])<0||t>=258)&&wu(bu.DATA_ERROR);var B=p.permute[t];if(0!==B&&1!==B){if(E)for(E=0,S+s>this.dbufSize&&wu(bu.DATA_ERROR),_[k=o[d[0]]]+=s;s--;)I[S++]=k;if(B>c)break;S>=this.dbufSize&&wu(bu.DATA_ERROR),_[k=o[k=gu(d,e=B-1)]]++,I[S++]=k}else E||(E=1,s=0),s+=0===B?E:2*E,E<<=1}for((a<0||a>=S)&&wu(bu.DATA_ERROR),t=0,e=0;e<256;e++)r=t+_[e],_[e]=t,t=r;for(e=0;e<S;e++)I[_[k=255&I[e]]]|=e<<8,_[k]++;var P=0,M=0,D=0;return S&&(M=255&(P=I[a]),P>>=8,D=-1),this.writePos=P,this.writeCurrent=M,this.writeCount=S,this.writeRun=D,!0},Au.prototype._read_bunzip=function(e,t){var r,i,n;if(this.writeCount<0)return 0;var a=this.dbuf,s=this.writePos,o=this.writeCurrent,c=this.writeCount;this.outputsize;for(var u=this.writeRun;c;){for(c--,i=o,o=255&(s=a[s]),s>>=8,3==u++?(r=o,n=i,o=-1):(r=1,n=o),this.blockCRC.updateCRCRun(n,r);r--;)this.outputStream.writeByte(n),this.nextoutput++;o!=i&&(u=0)}return this.writeCount=c,this.blockCRC.getCRC()!==this.targetBlockCRC&&wu(bu.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var vu=function(e){if("readByte"in e)return e;var t=new pu;return t.pos=0,t.readByte=function(){return e[this.pos++]},t.seek=function(e){this.pos=e},t.eof=function(){return this.pos>=e.length},t},_u=function(e){var t=new pu,r=!0;if(e)if("number"==typeof e)t.buffer=new Uint8Array(e),r=!1;else{if("writeByte"in e)return e;t.buffer=e,r=!1}else t.buffer=new Uint8Array(16384);return t.pos=0,t.writeByte=function(e){if(r&&this.pos>=this.buffer.length){var t=new Uint8Array(2*this.buffer.length);t.set(this.buffer),this.buffer=t}this.buffer[this.pos++]=e},t.getBuffer=function(){if(this.pos!==this.buffer.length){if(!r)throw new TypeError("outputsize does not match decoded input");var e=new Uint8Array(this.pos);e.set(this.buffer.subarray(0,this.pos)),this.buffer=e}return this.buffer},t._coerced=!0,t};var ku=function(e,t,r){for(var i=vu(e),n=_u(t),a=new Au(i,n);!("eof"in i)||!i.eof();)if(a._init_block())a._read_bunzip();else{var s=a.reader.read(32)>>>0;if(s!==a.streamCRC&&wu(bu.DATA_ERROR,"Bad stream CRC (got "+a.streamCRC.toString(16)+" expected "+s.toString(16)+")"),!r||!("eof"in i)||i.eof())break;a._start_bunzip(i,n)}if("getBuffer"in n)return n.getBuffer()};class Eu{static get tag(){return V.packet.literalData}constructor(e=new Date){this.format=V.literal.utf8,this.date=Y.normalizeDate(e),this.text=null,this.data=null,this.filename=""}setText(e,t=V.literal.utf8){this.format=t,this.text=e,this.data=null}getText(e=!1){return(null===this.text||Y.isStream(this.text))&&(this.text=Y.decodeUTF8(Y.nativeEOL(this.getBytes(e)))),this.text}setBytes(e,t){this.format=t,this.data=e,this.text=null}getBytes(e=!1){return null===this.data&&(this.data=Y.canonicalizeEOL(Y.encodeUTF8(this.text))),e?F(this.data):this.data}setFilename(e){this.filename=e}getFilename(){return this.filename}async read(e){await Q(e,(async e=>{const t=await e.readByte(),r=await e.readByte();this.filename=Y.decodeUTF8(await e.readBytes(r)),this.date=Y.readDate(await e.readBytes(4));let i=e.remainder();s(i)&&(i=await q(i)),this.setBytes(i,t)}))}writeHeader(){const e=Y.encodeUTF8(this.filename),t=new Uint8Array([e.length]),r=new Uint8Array([this.format]),i=Y.writeDate(this.date);return Y.concatUint8Array([r,t,e,i])}write(){const e=this.writeHeader(),t=this.getBytes();return Y.concat([e,t])}}const Su=Symbol("verified"),Cu=new Set([V.signatureSubpacket.issuer,V.signatureSubpacket.issuerFingerprint,V.signatureSubpacket.embeddedSignature]);class Iu{static get tag(){return V.packet.signature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.unhashedSubpackets=[],this.signedHashValue=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=!0,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyID=new pe,this.rawNotations=[],this.notations={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserID=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.features=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.issuerKeyVersion=null,this.issuerFingerprint=null,this.preferredAEADAlgorithms=null,this.revoked=null,this[Su]=null}read(e){let t=0;if(this.version=e[t++],4!==this.version&&5!==this.version)throw new gn(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=e[t++],this.publicKeyAlgorithm=e[t++],this.hashAlgorithm=e[t++],t+=this.readSubPackets(e.subarray(t,e.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=e.subarray(0,t),t+=this.readSubPackets(e.subarray(t,e.length),!1),this.signedHashValue=e.subarray(t,t+2),t+=2,this.params=Ba.signature.parseSignatureParams(this.publicKeyAlgorithm,e.subarray(t,e.length))}writeParams(){return this.params instanceof Promise?H((async()=>Ba.serializeParams(this.publicKeyAlgorithm,await this.params))):Ba.serializeParams(this.publicKeyAlgorithm,this.params)}write(){const e=[];return e.push(this.signatureData),e.push(this.writeUnhashedSubPackets()),e.push(this.signedHashValue),e.push(this.writeParams()),Y.concat(e)}async sign(e,t,r=new Date,i=!1){5===e.version?this.version=5:this.version=4;const n=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=Y.normalizeDate(r),this.issuerKeyVersion=e.version,this.issuerFingerprint=e.getFingerprintBytes(),this.issuerKeyID=e.getKeyID(),n.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=Y.concat(n);const a=this.toHash(this.signatureType,t,i),s=await this.hash(this.signatureType,t,a,i);this.signedHashValue=N(z(s),0,2);const o=async()=>Ba.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,e.publicParams,e.privateParams,a,await q(s));Y.isStream(s)?this.params=o():(this.params=await o(),this[Su]=!0)}writeHashedSubPackets(){const e=V.signatureSubpacket,t=[];let r;if(null===this.created)throw Error("Missing signature creation time");t.push(Bu(e.signatureCreationTime,!0,Y.writeDate(this.created))),null!==this.signatureExpirationTime&&t.push(Bu(e.signatureExpirationTime,!0,Y.writeNumber(this.signatureExpirationTime,4))),null!==this.exportable&&t.push(Bu(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),null!==this.trustLevel&&(r=new Uint8Array([this.trustLevel,this.trustAmount]),t.push(Bu(e.trustSignature,!0,r))),null!==this.regularExpression&&t.push(Bu(e.regularExpression,!0,this.regularExpression)),null!==this.revocable&&t.push(Bu(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),null!==this.keyExpirationTime&&t.push(Bu(e.keyExpirationTime,!0,Y.writeNumber(this.keyExpirationTime,4))),null!==this.preferredSymmetricAlgorithms&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.preferredSymmetricAlgorithms)),t.push(Bu(e.preferredSymmetricAlgorithms,!1,r))),null!==this.revocationKeyClass&&(r=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),r=Y.concat([r,this.revocationKeyFingerprint]),t.push(Bu(e.revocationKey,!1,r))),this.issuerKeyID.isNull()||5===this.issuerKeyVersion||t.push(Bu(e.issuer,!0,this.issuerKeyID.write())),this.rawNotations.forEach((({name:i,value:n,humanReadable:a,critical:s})=>{r=[new Uint8Array([a?128:0,0,0,0])];const o=Y.encodeUTF8(i);r.push(Y.writeNumber(o.length,2)),r.push(Y.writeNumber(n.length,2)),r.push(o),r.push(n),r=Y.concat(r),t.push(Bu(e.notationData,s,r))})),null!==this.preferredHashAlgorithms&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.preferredHashAlgorithms)),t.push(Bu(e.preferredHashAlgorithms,!1,r))),null!==this.preferredCompressionAlgorithms&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.preferredCompressionAlgorithms)),t.push(Bu(e.preferredCompressionAlgorithms,!1,r))),null!==this.keyServerPreferences&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.keyServerPreferences)),t.push(Bu(e.keyServerPreferences,!1,r))),null!==this.preferredKeyServer&&t.push(Bu(e.preferredKeyServer,!1,Y.encodeUTF8(this.preferredKeyServer))),null!==this.isPrimaryUserID&&t.push(Bu(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),null!==this.policyURI&&t.push(Bu(e.policyURI,!1,Y.encodeUTF8(this.policyURI))),null!==this.keyFlags&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.keyFlags)),t.push(Bu(e.keyFlags,!0,r))),null!==this.signersUserID&&t.push(Bu(e.signersUserID,!1,Y.encodeUTF8(this.signersUserID))),null!==this.reasonForRevocationFlag&&(r=Y.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),t.push(Bu(e.reasonForRevocation,!0,r))),null!==this.features&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.features)),t.push(Bu(e.features,!1,r))),null!==this.signatureTargetPublicKeyAlgorithm&&(r=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],r.push(Y.stringToUint8Array(this.signatureTargetHash)),r=Y.concat(r),t.push(Bu(e.signatureTarget,!0,r))),null!==this.embeddedSignature&&t.push(Bu(e.embeddedSignature,!0,this.embeddedSignature.write())),null!==this.issuerFingerprint&&(r=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],r=Y.concat(r),t.push(Bu(e.issuerFingerprint,5===this.version,r))),null!==this.preferredAEADAlgorithms&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.preferredAEADAlgorithms)),t.push(Bu(e.preferredAEADAlgorithms,!1,r)));const i=Y.concat(t),n=Y.writeNumber(i.length,2);return Y.concat([n,i])}writeUnhashedSubPackets(){const e=[];this.unhashedSubpackets.forEach((t=>{e.push(hn(t.length)),e.push(t)}));const t=Y.concat(e),r=Y.writeNumber(t.length,2);return Y.concat([r,t])}readSubPacket(e,t=!0){let r=0;const i=!!(128&e[r]),n=127&e[r];if(t||(this.unhashedSubpackets.push(e.subarray(r,e.length)),Cu.has(n)))switch(r++,n){case V.signatureSubpacket.signatureCreationTime:this.created=Y.readDate(e.subarray(r,e.length));break;case V.signatureSubpacket.signatureExpirationTime:{const t=Y.readNumber(e.subarray(r,e.length));this.signatureNeverExpires=0===t,this.signatureExpirationTime=t;break}case V.signatureSubpacket.exportableCertification:this.exportable=1===e[r++];break;case V.signatureSubpacket.trustSignature:this.trustLevel=e[r++],this.trustAmount=e[r++];break;case V.signatureSubpacket.regularExpression:this.regularExpression=e[r];break;case V.signatureSubpacket.revocable:this.revocable=1===e[r++];break;case V.signatureSubpacket.keyExpirationTime:{const t=Y.readNumber(e.subarray(r,e.length));this.keyExpirationTime=t,this.keyNeverExpires=0===t;break}case V.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...e.subarray(r,e.length)];break;case V.signatureSubpacket.revocationKey:this.revocationKeyClass=e[r++],this.revocationKeyAlgorithm=e[r++],this.revocationKeyFingerprint=e.subarray(r,r+20);break;case V.signatureSubpacket.issuer:this.issuerKeyID.read(e.subarray(r,e.length));break;case V.signatureSubpacket.notationData:{const t=!!(128&e[r]);r+=4;const n=Y.readNumber(e.subarray(r,r+2));r+=2;const a=Y.readNumber(e.subarray(r,r+2));r+=2;const s=Y.decodeUTF8(e.subarray(r,r+n)),o=e.subarray(r+n,r+n+a);this.rawNotations.push({name:s,humanReadable:t,value:o,critical:i}),t&&(this.notations[s]=Y.decodeUTF8(o));break}case V.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...e.subarray(r,e.length)];break;case V.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...e.subarray(r,e.length)];break;case V.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...e.subarray(r,e.length)];break;case V.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=Y.decodeUTF8(e.subarray(r,e.length));break;case V.signatureSubpacket.primaryUserID:this.isPrimaryUserID=0!==e[r++];break;case V.signatureSubpacket.policyURI:this.policyURI=Y.decodeUTF8(e.subarray(r,e.length));break;case V.signatureSubpacket.keyFlags:this.keyFlags=[...e.subarray(r,e.length)];break;case V.signatureSubpacket.signersUserID:this.signersUserID=Y.decodeUTF8(e.subarray(r,e.length));break;case V.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=e[r++],this.reasonForRevocationString=Y.decodeUTF8(e.subarray(r,e.length));break;case V.signatureSubpacket.features:this.features=[...e.subarray(r,e.length)];break;case V.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=e[r++],this.signatureTargetHashAlgorithm=e[r++];const t=Ba.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=Y.uint8ArrayToString(e.subarray(r,r+t));break}case V.signatureSubpacket.embeddedSignature:this.embeddedSignature=new Iu,this.embeddedSignature.read(e.subarray(r,e.length));break;case V.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=e[r++],this.issuerFingerprint=e.subarray(r,e.length),5===this.issuerKeyVersion?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case V.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...e.subarray(r,e.length)];break;default:{const e=Error("Unknown signature subpacket type "+n);if(i)throw e;Y.printDebug(e)}}}readSubPackets(e,t=!0,r){const i=Y.readNumber(e.subarray(0,2));let n=2;for(;n<2+i;){const i=un(e.subarray(n,e.length));n+=i.offset,this.readSubPacket(e.subarray(n,n+i.len),t,r),n+=i.len}return n}toSign(e,t){const r=V.signature;switch(e){case r.binary:return null!==t.text?Y.encodeUTF8(t.getText(!0)):t.getBytes(!0);case r.text:{const e=t.getBytes(!0);return Y.canonicalizeEOL(e)}case r.standalone:return new Uint8Array(0);case r.certGeneric:case r.certPersona:case r.certCasual:case r.certPositive:case r.certRevocation:{let e,i;if(t.userID)i=180,e=t.userID;else{if(!t.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");i=209,e=t.userAttribute}const n=e.write();return Y.concat([this.toSign(r.key,t),new Uint8Array([i]),Y.writeNumber(n.length,4),n])}case r.subkeyBinding:case r.subkeyRevocation:case r.keyBinding:return Y.concat([this.toSign(r.key,t),this.toSign(r.key,{key:t.bind})]);case r.key:if(void 0===t.key)throw Error("Key packet is required for this signature.");return t.key.writeForHash(this.version);case r.keyRevocation:return this.toSign(r.key,t);case r.timestamp:return new Uint8Array(0);case r.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(e,t){let r=0;return R(z(this.signatureData),(e=>{r+=e.length}),(()=>{const i=[];return 5!==this.version||this.signatureType!==V.signature.binary&&this.signatureType!==V.signature.text||(t?i.push(new Uint8Array(6)):i.push(e.writeHeader())),i.push(new Uint8Array([this.version,255])),5===this.version&&i.push(new Uint8Array(4)),i.push(Y.writeNumber(r,4)),Y.concat(i)}))}toHash(e,t,r=!1){const i=this.toSign(e,t);return Y.concat([i,this.signatureData,this.calculateTrailer(t,r)])}async hash(e,t,r,i=!1){return r||(r=this.toHash(e,t,i)),Ba.hash.digest(this.hashAlgorithm,r)}async verify(e,t,r,i=new Date,n=!1,a=ne){if(!this.issuerKeyID.equals(e.getKeyID()))throw Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==e.algorithm)throw Error("Public key algorithm used to sign signature does not match issuer key algorithm.");const s=t===V.signature.binary||t===V.signature.text;if(!(this[Su]&&!s)){let i,a;if(this.hashed?a=await this.hashed:(i=this.toHash(t,r,n),a=await this.hash(t,r,i)),a=await q(a),this.signedHashValue[0]!==a[0]||this.signedHashValue[1]!==a[1])throw Error("Signed digest did not match");this.params=await this.params;const s=this.publicKeyAlgorithm===V.publicKey.hmac?e.privateParams:null;if(this[Su]=await Ba.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,e.publicParams,s,i,a),!this[Su])throw Error("Signature verification failed")}const o=Y.normalizeDate(i);if(o&&this.created>o)throw Error("Signature creation time is in the future");if(o&&o>=this.getExpirationTime())throw Error("Signature is expired");if(a.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+V.read(V.hash,this.hashAlgorithm).toUpperCase());if(a.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[V.signature.binary,V.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+V.read(V.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach((({name:e,critical:t})=>{if(t&&a.knownNotations.indexOf(e)<0)throw Error("Unknown critical notation: "+e)})),null!==this.revocationKeyClass)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(e=new Date){const t=Y.normalizeDate(e);return null!==t&&!(this.created<=t&&t<this.getExpirationTime())}getExpirationTime(){return this.signatureNeverExpires?1/0:new Date(this.created.getTime()+1e3*this.signatureExpirationTime)}}function Bu(e,t,r){const i=[];return i.push(hn(r.length+1)),i.push(new Uint8Array([(t?128:0)|e])),i.push(r),Y.concat(i)}class Pu{static get tag(){return V.packet.onePassSignature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.issuerKeyID=null,this.flags=null}read(e){let t=0;if(this.version=e[t++],3!==this.version)throw new gn(`Version ${this.version} of the one-pass signature packet is unsupported.`);return this.signatureType=e[t++],this.hashAlgorithm=e[t++],this.publicKeyAlgorithm=e[t++],this.issuerKeyID=new pe,this.issuerKeyID.read(e.subarray(t,t+8)),t+=8,this.flags=e[t++],this}write(){const e=new Uint8Array([3,this.signatureType,this.hashAlgorithm,this.publicKeyAlgorithm]),t=new Uint8Array([this.flags]);return Y.concatUint8Array([e,this.issuerKeyID.write(),t])}calculateTrailer(...e){return H((async()=>Iu.prototype.calculateTrailer.apply(await this.correspondingSig,e)))}async verify(){const e=await this.correspondingSig;if(!e||e.constructor.tag!==V.packet.signature)throw Error("Corresponding signature packet missing");if(e.signatureType!==this.signatureType||e.hashAlgorithm!==this.hashAlgorithm||e.publicKeyAlgorithm!==this.publicKeyAlgorithm||!e.issuerKeyID.equals(this.issuerKeyID))throw Error("Corresponding signature packet does not match one-pass signature packet");return e.hashed=this.hashed,e.verify.apply(e,arguments)}}function Mu(e,t){if(!t[e]){let t;try{t=V.read(V.packet,e)}catch(t){throw new gn("Unknown packet type with tag: "+e)}throw Error("Packet not allowed in this context: "+t)}return new t[e]}Pu.prototype.hash=Iu.prototype.hash,Pu.prototype.toHash=Iu.prototype.toHash,Pu.prototype.toSign=Iu.prototype.toSign;class Du extends Array{static async fromBinary(e,t,r=ne){const i=new Du;return await i.read(e,t,r),i}async read(e,t,r=ne){r.additionalAllowedPackets.length&&(t={...t,...Y.constructAllowedPackets(r.additionalAllowedPackets)}),this.stream=T(e,(async(e,i)=>{const n=D(i);try{for(;;){await n.ready;if(await yn(e,(async e=>{try{if(e.tag===V.packet.marker||e.tag===V.packet.trust)return;const i=Mu(e.tag,t);i.packets=new Du,i.fromStream=Y.isStream(e.packet),await i.read(e.packet,r),await n.write(i)}catch(t){const i=!r.ignoreUnsupportedPackets&&t instanceof gn,a=!(r.ignoreMalformedPackets||t instanceof gn);if(i||a||pn(e.tag))await n.abort(t);else{const t=new bn(e.tag,e.packet);await n.write(t)}Y.printDebugError(t)}})))return await n.ready,void await n.close()}}catch(e){await n.abort(e)}}));const i=M(this.stream);for(;;){const{done:e,value:t}=await i.read();if(e?this.stream=null:this.push(t),e||pn(t.constructor.tag))break}i.releaseLock()}write(){const e=[];for(let t=0;t<this.length;t++){const r=this[t]instanceof bn?this[t].tag:this[t].constructor.tag,i=this[t].write();if(Y.isStream(i)&&pn(this[t].constructor.tag)){let t=[],n=0;const a=512;e.push(dn(r)),e.push(R(i,(e=>{if(t.push(e),n+=e.length,n>=a){const e=Math.min(Math.log(n)/Math.LN2|0,30),r=2**e,i=Y.concat([fn(e)].concat(t));return t=[i.subarray(1+r)],n=t[0].length,i.subarray(0,1+r)}}),(()=>Y.concat([hn(n)].concat(t)))))}else{if(Y.isStream(i)){let t=0;e.push(R(z(i),(e=>{t+=e.length}),(()=>ln(r,t))))}else e.push(ln(r,i.length));e.push(i)}}return Y.concat(e)}filterByTag(...e){const t=new Du,r=e=>t=>e===t;for(let i=0;i<this.length;i++)e.some(r(this[i].constructor.tag))&&t.push(this[i]);return t}findPacket(e){return this.find((t=>t.constructor.tag===e))}indexOfTag(...e){const t=[],r=this,i=e=>t=>e===t;for(let n=0;n<this.length;n++)e.some(i(r[n].constructor.tag))&&t.push(n);return t}}const xu=/*#__PURE__*/Y.constructAllowedPackets([Eu,Pu,Iu]);class Ku{static get tag(){return V.packet.compressedData}constructor(e=ne){this.packets=null,this.algorithm=e.preferredCompressionAlgorithm,this.compressed=null,this.deflateLevel=e.deflateLevel}async read(e,t=ne){await Q(e,(async e=>{this.algorithm=await e.readByte(),this.compressed=e.remainder(),await this.decompress(t)}))}write(){return null===this.compressed&&this.compress(),Y.concat([new Uint8Array([this.algorithm]),this.compressed])}async decompress(e=ne){const t=V.read(V.compression,this.algorithm),r=Lu[t];if(!r)throw Error(t+" decompression not supported");this.packets=await Du.fromBinary(r(this.compressed),xu,e)}compress(){const e=V.read(V.compression,this.algorithm),t=Fu[e];if(!t)throw Error(e+" compression not supported");this.compressed=t(this.packets.write(),this.deflateLevel)}}const Uu=Y.getNodeZlib();function Ru(e){return e}function Tu(e,t,r={}){return function(i){return!Y.isStream(i)||s(i)?H((()=>q(i).then((t=>new Promise(((i,n)=>{e(t,r,((e,t)=>{if(e)return n(e);i(t)}))})))))):y(g(i).pipe(t(r)))}}function Qu(e,t={}){return function(r){const i=new e(t);return R(r,(e=>{if(e.length)return i.push(e,Va),i.result}),(()=>{if(e===ec)return i.push([],Ya),i.result}))}}function zu(e){return function(t){return H((async()=>e(await q(t))))}}const Fu=Uu?{zip:/*#__PURE__*/(e,t)=>Tu(Uu.deflateRaw,Uu.createDeflateRaw,{level:t})(e),zlib:/*#__PURE__*/(e,t)=>Tu(Uu.deflate,Uu.createDeflate,{level:t})(e)}:{zip:/*#__PURE__*/(e,t)=>Qu(ec,{raw:!0,level:t})(e),zlib:/*#__PURE__*/(e,t)=>Qu(ec,{level:t})(e)},Lu=Uu?{uncompressed:Ru,zip:/*#__PURE__*/Tu(Uu.inflateRaw,Uu.createInflateRaw),zlib:/*#__PURE__*/Tu(Uu.inflate,Uu.createInflate),bzip2:/*#__PURE__*/zu(ku)}:{uncompressed:Ru,zip:/*#__PURE__*/Qu(cu,{raw:!0}),zlib:/*#__PURE__*/Qu(cu),bzip2:/*#__PURE__*/zu(ku)},Nu=/*#__PURE__*/Y.constructAllowedPackets([Eu,Ku,Pu,Iu]);class qu{static get tag(){return V.packet.symEncryptedIntegrityProtectedData}constructor(){this.version=1,this.encrypted=null,this.packets=null}async read(e){await Q(e,(async e=>{const t=await e.readByte();if(1!==t)throw new gn(`Version ${t} of the SEIP packet is unsupported.`);this.encrypted=e.remainder()}))}write(){return Y.concat([new Uint8Array([1]),this.encrypted])}async encrypt(e,t,r=ne){const{blockSize:i}=Ba.getCipher(e);let n=this.packets.write();s(n)&&(n=await q(n));const a=await Ba.getPrefixRandom(e),o=new Uint8Array([211,20]),c=Y.concat([a,n,o]),u=await Ba.hash.sha1(F(c)),h=Y.concat([c,u]);return this.encrypted=await Ba.mode.cfb.encrypt(e,t,h,new Uint8Array(i),r),!0}async decrypt(e,t,r=ne){const{blockSize:i}=Ba.getCipher(e);let n=z(this.encrypted);s(n)&&(n=await q(n));const a=await Ba.mode.cfb.decrypt(e,t,n,new Uint8Array(i)),o=N(F(a),-20),c=N(a,0,-20),u=Promise.all([q(await Ba.hash.sha1(F(c))),q(o)]).then((([e,t])=>{if(!Y.equalsUint8Array(e,t))throw Error("Modification detected.");return new Uint8Array})),h=N(c,i+2);let f=N(h,0,-2);return f=P([f,H((()=>u))]),Y.isStream(n)&&r.allowUnauthenticatedStream||(f=await q(f)),this.packets=await Du.fromBinary(f,Nu,r),!0}}const Ou=/*#__PURE__*/Y.constructAllowedPackets([Eu,Ku,Pu,Iu]);class Hu{static get tag(){return V.packet.aeadEncryptedData}constructor(){this.version=1,this.cipherAlgorithm=null,this.aeadAlgorithm=V.aead.eax,this.chunkSizeByte=null,this.iv=null,this.encrypted=null,this.packets=null}async read(e){await Q(e,(async e=>{const t=await e.readByte();if(1!==t)throw new gn(`Version ${t} of the AEAD-encrypted data packet is not supported.`);this.cipherAlgorithm=await e.readByte(),this.aeadAlgorithm=await e.readByte(),this.chunkSizeByte=await e.readByte();const r=Ba.getAEADMode(this.aeadAlgorithm);this.iv=await e.readBytes(r.ivLength),this.encrypted=e.remainder()}))}write(){return Y.concat([new Uint8Array([this.version,this.cipherAlgorithm,this.aeadAlgorithm,this.chunkSizeByte]),this.iv,this.encrypted])}async decrypt(e,t,r=ne){this.packets=await Du.fromBinary(await this.crypt("decrypt",t,z(this.encrypted)),Ou,r)}async encrypt(e,t,r=ne){this.cipherAlgorithm=e;const{ivLength:i}=Ba.getAEADMode(this.aeadAlgorithm);this.iv=Ba.random.getRandomBytes(i),this.chunkSizeByte=r.aeadChunkSizeByte;const n=this.packets.write();this.encrypted=await this.crypt("encrypt",t,n)}async crypt(e,t,r){const i=Ba.getAEADMode(this.aeadAlgorithm),n=await i(this.cipherAlgorithm,t),a="decrypt"===e?i.tagLength:0,s="encrypt"===e?i.tagLength:0,o=2**(this.chunkSizeByte+6)+a,c=new ArrayBuffer(21),u=new Uint8Array(c,0,13),h=new Uint8Array(c),f=new DataView(c),d=new Uint8Array(c,5,8);u.set([192|Hu.tag,this.version,this.cipherAlgorithm,this.aeadAlgorithm,this.chunkSizeByte],0);let l=0,p=Promise.resolve(),y=0,g=0;const b=this.iv;return T(r,(async(t,r)=>{if("array"!==Y.isStream(t)){const e=new E({},{highWaterMark:Y.getHardwareConcurrency()*2**(this.chunkSizeByte+6),size:e=>e.length});x(e.readable,r),r=e.writable}const c=M(t),m=D(r);try{for(;;){let t=await c.readBytes(o+a)||new Uint8Array;const r=t.subarray(t.length-a);let w,A;if(t=t.subarray(0,t.length-a),!l||t.length?(c.unshift(r),w=n[e](t,i.getNonce(b,d),u),g+=t.length-a+s):(f.setInt32(17,y),w=n[e](r,i.getNonce(b,d),h),g+=s,A=!0),y+=t.length-a,p=p.then((()=>w)).then((async e=>{await m.ready,await m.write(e),g-=e.length})).catch((e=>m.abort(e))),(A||g>m.desiredSize)&&await p,A){await m.close();break}f.setInt32(9,++l)}}catch(e){await m.abort(e)}}))}}class ju{static get tag(){return V.packet.publicKeyEncryptedSessionKey}constructor(){this.version=3,this.publicKeyID=new pe,this.publicKeyAlgorithm=null,this.sessionKey=null,this.sessionKeyAlgorithm=null,this.encrypted={}}read(e){let t=0;if(this.version=e[t++],3!==this.version)throw new gn(`Version ${this.version} of the PKESK packet is unsupported.`);t+=this.publicKeyID.read(e.subarray(t)),this.publicKeyAlgorithm=e[t++],this.encrypted=Ba.parseEncSessionKeyParams(this.publicKeyAlgorithm,e.subarray(t),this.version),this.publicKeyAlgorithm===V.publicKey.x25519&&(this.sessionKeyAlgorithm=V.write(V.symmetric,this.encrypted.C.algorithm))}write(){const e=[new Uint8Array([this.version]),this.publicKeyID.write(),new Uint8Array([this.publicKeyAlgorithm]),Ba.serializeParams(this.publicKeyAlgorithm,this.encrypted)];return Y.concatUint8Array(e)}async encrypt(e){const t=V.write(V.publicKey,this.publicKeyAlgorithm),r=Gu(this.version,t,this.sessionKeyAlgorithm,this.sessionKey),i=t===V.publicKey.aead?e.privateParams:null;this.encrypted=await Ba.publicKeyEncrypt(t,this.sessionKeyAlgorithm,e.publicParams,i,r,e.getFingerprintBytes())}async decrypt(e,t){if(this.publicKeyAlgorithm!==e.algorithm)throw Error("Decryption error");const r=t?Gu(this.version,this.publicKeyAlgorithm,t.sessionKeyAlgorithm,t.sessionKey):null,i=await Ba.publicKeyDecrypt(this.publicKeyAlgorithm,e.publicParams,e.privateParams,this.encrypted,e.getFingerprintBytes(),r),{sessionKey:n,sessionKeyAlgorithm:a}=function(e,t,r,i){switch(t){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:case V.publicKey.elgamal:case V.publicKey.ecdh:case V.publicKey.aead:{const e=r.subarray(0,r.length-2),t=r.subarray(r.length-2),n=Y.writeChecksum(e.subarray(e.length%8)),a=n[0]===t[0]&n[1]===t[1],s={sessionKeyAlgorithm:e[0],sessionKey:e.subarray(1)};if(i){const e=a&s.sessionKeyAlgorithm===i.sessionKeyAlgorithm&s.sessionKey.length===i.sessionKey.length;return{sessionKey:Y.selectUint8Array(e,s.sessionKey,i.sessionKey),sessionKeyAlgorithm:Y.selectUint8(e,s.sessionKeyAlgorithm,i.sessionKeyAlgorithm)}}if(a&&V.read(V.symmetric,s.sessionKeyAlgorithm))return s;throw Error("Decryption error")}case V.publicKey.x25519:return{sessionKey:r};default:throw Error("Unsupported public key algorithm")}}(this.version,this.publicKeyAlgorithm,i,t);this.publicKeyAlgorithm!==V.publicKey.x25519&&(this.sessionKeyAlgorithm=a),this.sessionKey=n}}function Gu(e,t,r,i){switch(t){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:case V.publicKey.elgamal:case V.publicKey.ecdh:case V.publicKey.aead:return Y.concatUint8Array([new Uint8Array([r]),i,Y.writeChecksum(i.subarray(i.length%8))]);case V.publicKey.x25519:return i;default:throw Error("Unsupported public key algorithm")}}class Wu{static get tag(){return V.packet.symEncryptedSessionKey}constructor(e=ne){this.version=e.aeadProtect?5:4,this.sessionKey=null,this.sessionKeyEncryptionAlgorithm=null,this.sessionKeyAlgorithm=V.symmetric.aes256,this.aeadAlgorithm=V.write(V.aead,e.preferredAEADAlgorithm),this.encrypted=null,this.s2k=null,this.iv=null}read(e){let t=0;if(this.version=e[t++],4!==this.version&&5!==this.version)throw new gn(`Version ${this.version} of the SKESK packet is unsupported.`);const r=e[t++];5===this.version&&(this.aeadAlgorithm=e[t++]);const i=e[t++];if(this.s2k=Ra(i),t+=this.s2k.read(e.subarray(t,e.length)),5===this.version){const r=Ba.getAEADMode(this.aeadAlgorithm);this.iv=e.subarray(t,t+=r.ivLength)}5===this.version||t<e.length?(this.encrypted=e.subarray(t,e.length),this.sessionKeyEncryptionAlgorithm=r):this.sessionKeyAlgorithm=r}write(){const e=null===this.encrypted?this.sessionKeyAlgorithm:this.sessionKeyEncryptionAlgorithm;let t;return 5===this.version?t=Y.concatUint8Array([new Uint8Array([this.version,e,this.aeadAlgorithm]),this.s2k.write(),this.iv,this.encrypted]):(t=Y.concatUint8Array([new Uint8Array([this.version,e]),this.s2k.write()]),null!==this.encrypted&&(t=Y.concatUint8Array([t,this.encrypted]))),t}async decrypt(e){const t=null!==this.sessionKeyEncryptionAlgorithm?this.sessionKeyEncryptionAlgorithm:this.sessionKeyAlgorithm,{blockSize:r,keySize:i}=Ba.getCipher(t),n=await this.s2k.produceKey(e,i);if(5===this.version){const e=Ba.getAEADMode(this.aeadAlgorithm),r=new Uint8Array([192|Wu.tag,this.version,this.sessionKeyEncryptionAlgorithm,this.aeadAlgorithm]),i=await e(t,n);this.sessionKey=await i.decrypt(this.encrypted,this.iv,r)}else if(null!==this.encrypted){const e=await Ba.mode.cfb.decrypt(t,n,this.encrypted,new Uint8Array(r));this.sessionKeyAlgorithm=V.write(V.symmetric,e[0]),this.sessionKey=e.subarray(1,e.length)}else this.sessionKey=n}async encrypt(e,t=ne){const r=null!==this.sessionKeyEncryptionAlgorithm?this.sessionKeyEncryptionAlgorithm:this.sessionKeyAlgorithm;this.sessionKeyEncryptionAlgorithm=r,this.s2k=Ta(t),this.s2k.generateSalt();const{blockSize:i,keySize:n}=Ba.getCipher(r),a=await this.s2k.produceKey(e,n);if(null===this.sessionKey&&(this.sessionKey=Ba.generateSessionKey(this.sessionKeyAlgorithm)),5===this.version){const e=Ba.getAEADMode(this.aeadAlgorithm);this.iv=Ba.random.getRandomBytes(e.ivLength);const t=new Uint8Array([192|Wu.tag,this.version,this.sessionKeyEncryptionAlgorithm,this.aeadAlgorithm]),i=await e(r,a);this.encrypted=await i.encrypt(this.sessionKey,this.iv,t)}else{const e=Y.concatUint8Array([new Uint8Array([this.sessionKeyAlgorithm]),this.sessionKey]);this.encrypted=await Ba.mode.cfb.encrypt(r,a,e,new Uint8Array(i),t)}}}class Vu{static get tag(){return V.packet.publicKey}constructor(e=new Date,t=ne){this.version=t.v5Keys?5:4,this.created=Y.normalizeDate(e),this.algorithm=null,this.publicParams=null,this.expirationTimeV3=0,this.fingerprint=null,this.keyID=null}static fromSecretKeyPacket(e){const t=new Vu,{version:r,created:i,algorithm:n,publicParams:a,keyID:s,fingerprint:o}=e;return t.version=r,t.created=i,t.algorithm=n,t.publicParams=a,t.keyID=s,t.fingerprint=o,t}async read(e){let t=0;if(this.version=e[t++],4===this.version||5===this.version){this.created=Y.readDate(e.subarray(t,t+4)),t+=4,this.algorithm=e[t++],5===this.version&&(t+=4);const{read:r,publicParams:i}=Ba.parsePublicKeyParams(this.algorithm,e.subarray(t));return this.publicParams=i,t+=r,await this.computeFingerprintAndKeyID(),t}throw new gn(`Version ${this.version} of the key packet is unsupported.`)}write(){const e=[];e.push(new Uint8Array([this.version])),e.push(Y.writeDate(this.created)),e.push(new Uint8Array([this.algorithm]));const t=Ba.serializeParams(this.algorithm,this.publicParams);return 5===this.version&&e.push(Y.writeNumber(t.length,4)),e.push(t),Y.concatUint8Array(e)}writeForHash(e){const t=this.writePublicKey();return 5===e?Y.concatUint8Array([new Uint8Array([154]),Y.writeNumber(t.length,4),t]):Y.concatUint8Array([new Uint8Array([153]),Y.writeNumber(t.length,2),t])}isDecrypted(){return null}getCreationTime(){return this.created}getKeyID(){return this.keyID}async computeFingerprintAndKeyID(){if(await this.computeFingerprint(),this.keyID=new pe,5===this.version)this.keyID.read(this.fingerprint.subarray(0,8));else{if(4!==this.version)throw Error("Unsupported key version");this.keyID.read(this.fingerprint.subarray(12,20))}}async computeFingerprint(){const e=this.writeForHash(this.version);if(5===this.version)this.fingerprint=await Ba.hash.sha256(e);else{if(4!==this.version)throw Error("Unsupported key version");this.fingerprint=await Ba.hash.sha1(e)}}getFingerprintBytes(){return this.fingerprint}getFingerprint(){return Y.uint8ArrayToHex(this.getFingerprintBytes())}hasSameFingerprintAs(e){return this.version===e.version&&Y.equalsUint8Array(this.writePublicKey(),e.writePublicKey())}getAlgorithmInfo(){const e={};e.algorithm=V.read(V.publicKey,this.algorithm);const t=this.publicParams.n||this.publicParams.p;return t?e.bits=Y.uint8ArrayBitLength(t):this.publicParams.oid?e.curve=this.publicParams.oid.getName():this.publicParams.cipher&&(e.symmetric=this.publicParams.cipher.getName()),e}}Vu.prototype.readPublicKey=Vu.prototype.read,Vu.prototype.writePublicKey=Vu.prototype.write;const Ju=/*#__PURE__*/Y.constructAllowedPackets([Eu,Ku,Pu,Iu]);class Yu{static get tag(){return V.packet.symmetricallyEncryptedData}constructor(){this.encrypted=null,this.packets=null}read(e){this.encrypted=e}write(){return this.encrypted}async decrypt(e,t,r=ne){if(!r.allowUnauthenticatedMessages)throw Error("Message is not authenticated.");const{blockSize:i}=Ba.getCipher(e),n=await q(z(this.encrypted)),a=await Ba.mode.cfb.decrypt(e,t,n.subarray(i+2),n.subarray(2,i+2));this.packets=await Du.fromBinary(a,Ju,r)}async encrypt(e,t,r=ne){const i=this.packets.write(),{blockSize:n}=Ba.getCipher(e),a=await Ba.getPrefixRandom(e),s=await Ba.mode.cfb.encrypt(e,t,a,new Uint8Array(n),r),o=await Ba.mode.cfb.encrypt(e,t,i,s.subarray(2),r);this.encrypted=Y.concat([s,o])}}class Zu{static get tag(){return V.packet.marker}read(e){return 80===e[0]&&71===e[1]&&80===e[2]}write(){return new Uint8Array([80,71,80])}}class Xu extends Vu{static get tag(){return V.packet.publicSubkey}constructor(e,t){super(e,t)}static fromSecretSubkeyPacket(e){const t=new Xu,{version:r,created:i,algorithm:n,publicParams:a,keyID:s,fingerprint:o}=e;return t.version=r,t.created=i,t.algorithm=n,t.publicParams=a,t.keyID=s,t.fingerprint=o,t}}class $u{static get tag(){return V.packet.userAttribute}constructor(){this.attributes=[]}read(e){let t=0;for(;t<e.length;){const r=un(e.subarray(t,e.length));t+=r.offset,this.attributes.push(Y.uint8ArrayToString(e.subarray(t,t+r.len))),t+=r.len}}write(){const e=[];for(let t=0;t<this.attributes.length;t++)e.push(hn(this.attributes[t].length)),e.push(Y.stringToUint8Array(this.attributes[t]));return Y.concatUint8Array(e)}equals(e){return!!(e&&e instanceof $u)&&this.attributes.every((function(t,r){return t===e.attributes[r]}))}}class eh extends Vu{static get tag(){return V.packet.secretKey}constructor(e=new Date,t=ne){super(e,t),this.keyMaterial=null,this.isEncrypted=null,this.s2kUsage=0,this.s2k=null,this.symmetric=null,this.aead=null,this.privateParams=null}async read(e){let t=await this.readPublicKey(e);const r=t;this.s2kUsage=e[t++],5===this.version&&t++;try{if(255===this.s2kUsage||254===this.s2kUsage||253===this.s2kUsage){this.symmetric=e[t++],253===this.s2kUsage&&(this.aead=e[t++]);const r=e[t++];if(this.s2k=Ra(r),t+=this.s2k.read(e.subarray(t,e.length)),"gnu-dummy"===this.s2k.type)return}else this.s2kUsage&&(this.symmetric=this.s2kUsage);this.s2kUsage&&(this.iv=e.subarray(t,t+Ba.getCipher(this.symmetric).blockSize),t+=this.iv.length)}catch(t){if(!this.s2kUsage)throw t;this.unparseableKeyMaterial=e.subarray(r),this.isEncrypted=!0}if(5===this.version&&(t+=4),this.keyMaterial=e.subarray(t),this.isEncrypted=!!this.s2kUsage,!this.isEncrypted){const e=this.keyMaterial.subarray(0,-2);if(!Y.equalsUint8Array(Y.writeChecksum(e),this.keyMaterial.subarray(-2)))throw Error("Key checksum mismatch");try{const{privateParams:t}=Ba.parsePrivateKeyParams(this.algorithm,e,this.publicParams);this.privateParams=t}catch(e){if(e instanceof gn)throw e;throw Error("Error reading MPIs")}}}write(){const e=this.writePublicKey();if(this.unparseableKeyMaterial)return Y.concatUint8Array([e,this.unparseableKeyMaterial]);const t=[e];t.push(new Uint8Array([this.s2kUsage]));const r=[];return 255!==this.s2kUsage&&254!==this.s2kUsage&&253!==this.s2kUsage||(r.push(this.symmetric),253===this.s2kUsage&&r.push(this.aead),r.push(...this.s2k.write())),this.s2kUsage&&"gnu-dummy"!==this.s2k.type&&r.push(...this.iv),5===this.version&&t.push(new Uint8Array([r.length])),t.push(new Uint8Array(r)),this.isDummy()||(this.s2kUsage||(this.keyMaterial=Ba.serializeParams(this.algorithm,this.privateParams)),5===this.version&&t.push(Y.writeNumber(this.keyMaterial.length,4)),t.push(this.keyMaterial),this.s2kUsage||t.push(Y.writeChecksum(this.keyMaterial))),Y.concatUint8Array(t)}isDecrypted(){return!1===this.isEncrypted}isMissingSecretKeyMaterial(){return void 0!==this.unparseableKeyMaterial||this.isDummy()}isDummy(){return!(!this.s2k||"gnu-dummy"!==this.s2k.type)}makeDummy(e=ne){this.isDummy()||(this.isDecrypted()&&this.clearPrivateParams(),delete this.unparseableKeyMaterial,this.isEncrypted=null,this.keyMaterial=null,this.s2k=Ra(V.s2k.gnu,e),this.s2k.algorithm=0,this.s2k.c=0,this.s2k.type="gnu-dummy",this.s2kUsage=254,this.symmetric=V.symmetric.aes256)}async encrypt(e,t=ne){if(this.isDummy())return;if(!this.isDecrypted())throw Error("Key packet is already encrypted");if(!e)throw Error("A non-empty passphrase is required for key encryption.");this.s2k=Ta(t),this.s2k.generateSalt();const r=Ba.serializeParams(this.algorithm,this.privateParams);this.symmetric=V.symmetric.aes256;const i=await th(this.s2k,e,this.symmetric),{blockSize:n}=Ba.getCipher(this.symmetric);if(this.iv=Ba.random.getRandomBytes(n),t.aeadProtect){this.s2kUsage=253,this.aead=V.aead.eax;const e=Ba.getAEADMode(this.aead),t=await e(this.symmetric,i);this.keyMaterial=await t.encrypt(r,this.iv.subarray(0,e.ivLength),new Uint8Array)}else this.s2kUsage=254,this.keyMaterial=await Ba.mode.cfb.encrypt(this.symmetric,i,Y.concatUint8Array([r,await Ba.hash.sha1(r,t)]),this.iv,t)}async decrypt(e){if(this.isDummy())return!1;if(this.unparseableKeyMaterial)throw Error("Key packet cannot be decrypted: unsupported S2K or cipher algo");if(this.isDecrypted())throw Error("Key packet is already decrypted.");let t,r;if(254!==this.s2kUsage&&253!==this.s2kUsage)throw 255===this.s2kUsage?Error("Encrypted private key is authenticated using an insecure two-byte hash"):Error("Private key is encrypted using an insecure S2K function: unsalted MD5");if(t=await th(this.s2k,e,this.symmetric),253===this.s2kUsage){const e=Ba.getAEADMode(this.aead),i=await e(this.symmetric,t);try{r=await i.decrypt(this.keyMaterial,this.iv.subarray(0,e.ivLength),new Uint8Array)}catch(e){if("Authentication tag mismatch"===e.message)throw Error("Incorrect key passphrase: "+e.message);throw e}}else{const e=await Ba.mode.cfb.decrypt(this.symmetric,t,this.keyMaterial,this.iv);r=e.subarray(0,-20);const i=await Ba.hash.sha1(r);if(!Y.equalsUint8Array(i,e.subarray(-20)))throw Error("Incorrect key passphrase")}try{const{privateParams:e}=Ba.parsePrivateKeyParams(this.algorithm,r,this.publicParams);this.privateParams=e}catch(e){throw Error("Error reading MPIs")}this.isEncrypted=!1,this.keyMaterial=null,this.s2kUsage=0}async validate(){if(this.isDummy())return;if(!this.isDecrypted())throw Error("Key is not decrypted");let e;try{e=await Ba.validateParams(this.algorithm,this.publicParams,this.privateParams)}catch(t){e=!1}if(!e)throw Error("Key is invalid")}async generate(e,t,r){const{privateParams:i,publicParams:n}=await Ba.generateParams(this.algorithm,e,t,r);this.privateParams=i,this.publicParams=n,this.isEncrypted=!1}clearPrivateParams(){this.isMissingSecretKeyMaterial()||(Object.keys(this.privateParams).forEach((e=>{this.privateParams[e].fill(0),delete this.privateParams[e]})),this.privateParams=null,this.isEncrypted=!0)}}async function th(e,t,r){const{keySize:i}=Ba.getCipher(r);return e.produceKey(t,i)}var rh=it((function(e){!function(t){function r(e){function t(){return ke<Ee}function r(){return ke}function n(e){ke=e}function a(){ke=0,Ee=_e.length}function s(e,t){return{name:e,tokens:t||"",semantic:t||"",children:[]}}function o(e,t){var r;return null===t?null:((r=s(e)).tokens=t.tokens,r.semantic=t.semantic,r.children.push(t),r)}function c(e,t){return null!==t&&(e.tokens+=t.tokens,e.semantic+=t.semantic),e.children.push(t),e}function u(e){var r;return t()&&e(r=_e[ke])?(ke+=1,s("token",r)):null}function h(e){return function(){return o("literal",u((function(t){return t===e})))}}function f(){var e=arguments;return function(){var t,i,a,o;for(o=r(),i=s("and"),t=0;t<e.length;t+=1){if(null===(a=e[t]()))return n(o),null;c(i,a)}return i}}function d(){var e=arguments;return function(){var t,i,a;for(a=r(),t=0;t<e.length;t+=1){if(null!==(i=e[t]()))return i;n(a)}return null}}function l(e){return function(){var t,i;return i=r(),null!==(t=e())?t:(n(i),s("opt"))}}function p(e){return function(){var t=e();return null!==t&&(t.semantic=""),t}}function y(e){return function(){var t=e();return null!==t&&t.semantic.length>0&&(t.semantic=" "),t}}function g(e,t){return function(){var i,a,o,u,h;for(u=r(),i=s("star"),o=0,h=void 0===t?0:t;null!==(a=e());)o+=1,c(i,a);return o>=h?i:(n(u),null)}}function b(e){return e.charCodeAt(0)>=128}function m(){return o("cr",h("\r")())}function w(){return o("crlf",f(m,_)())}function A(){return o("dquote",h('"')())}function v(){return o("htab",h("\t")())}function _(){return o("lf",h("\n")())}function k(){return o("sp",h(" ")())}function E(){return o("vchar",u((function(t){var r=t.charCodeAt(0),i=33<=r&&r<=126;return e.rfc6532&&(i=i||b(t)),i})))}function S(){return o("wsp",d(k,v)())}function C(){var e=o("quoted-pair",d(f(h("\\"),d(E,S)),ie)());return null===e?null:(e.semantic=e.semantic[1],e)}function I(){return o("fws",d(ae,f(l(f(g(S),p(w))),g(S,1)))())}function B(){return o("ctext",d((function(){return u((function(t){var r=t.charCodeAt(0),i=33<=r&&r<=39||42<=r&&r<=91||93<=r&&r<=126;return e.rfc6532&&(i=i||b(t)),i}))}),te)())}function P(){return o("ccontent",d(B,C,M)())}function M(){return o("comment",f(h("("),g(f(l(I),P)),l(I),h(")"))())}function D(){return o("cfws",d(f(g(f(l(I),M),1),l(I)),I)())}function x(){return o("atext",u((function(t){var r="a"<=t&&t<="z"||"A"<=t&&t<="Z"||"0"<=t&&t<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(t)>=0;return e.rfc6532&&(r=r||b(t)),r})))}function K(){return o("atom",f(y(l(D)),g(x,1),y(l(D)))())}function U(){var e,t;return null===(e=o("dot-atom-text",g(x,1)()))||null!==(t=g(f(h("."),g(x,1)))())&&c(e,t),e}function R(){return o("dot-atom",f(p(l(D)),U,p(l(D)))())}function T(){return o("qtext",d((function(){return u((function(t){var r=t.charCodeAt(0),i=33===r||35<=r&&r<=91||93<=r&&r<=126;return e.rfc6532&&(i=i||b(t)),i}))}),re)())}function Q(){return o("qcontent",d(T,C)())}function z(){return o("quoted-string",f(p(l(D)),p(A),g(f(l(y(I)),Q)),l(p(I)),p(A),p(l(D)))())}function F(){return o("word",d(K,z)())}function L(){return o("address",d(N,H)())}function N(){return o("mailbox",d(q,$)())}function q(){return o("name-addr",f(l(j),O)())}function O(){return o("angle-addr",d(f(p(l(D)),h("<"),$,h(">"),p(l(D))),se)())}function H(){return o("group",f(j,h(":"),l(V),h(";"),p(l(D)))())}function j(){return o("display-name",(null!==(e=o("phrase",d(ne,g(F,1))()))&&(e.semantic=function(e){return e.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(e.semantic)),e));var e}function G(){return o("mailbox-list",d(f(N,g(f(h(","),N))),ue)())}function W(){return o("address-list",d(f(L,g(f(h(","),L))),he)())}function V(){return o("group-list",d(G,p(D),fe)())}function J(){return o("local-part",d(de,R,z)())}function Y(){return o("dtext",d((function(){return u((function(t){var r=t.charCodeAt(0),i=33<=r&&r<=90||94<=r&&r<=126;return e.rfc6532&&(i=i||b(t)),i}))}),pe)())}function Z(){return o("domain-literal",f(p(l(D)),h("["),g(f(l(I),Y)),l(I),h("]"),p(l(D)))())}function X(){return o("domain",(t=d(le,R,Z)(),e.rejectTLD&&t&&t.semantic&&t.semantic.indexOf(".")<0?null:(t&&(t.semantic=t.semantic.replace(/\s+/g,"")),t)));var t}function $(){return o("addr-spec",f(J,h("@"),X)())}function ee(){return e.strict?null:o("obs-NO-WS-CTL",u((function(e){var t=e.charCodeAt(0);return 1<=t&&t<=8||11===t||12===t||14<=t&&t<=31||127===t})))}function te(){return e.strict?null:o("obs-ctext",ee())}function re(){return e.strict?null:o("obs-qtext",ee())}function ie(){return e.strict?null:o("obs-qp",f(h("\\"),d(h("\0"),ee,_,m))())}function ne(){return e.strict?null:e.atInDisplayName?o("obs-phrase",f(F,g(d(F,h("."),h("@"),y(D))))()):o("obs-phrase",f(F,g(d(F,h("."),y(D))))())}function ae(){return e.strict?null:o("obs-FWS",g(f(p(l(w)),S),1)())}function se(){return e.strict?null:o("obs-angle-addr",f(p(l(D)),h("<"),oe,$,h(">"),p(l(D)))())}function oe(){return e.strict?null:o("obs-route",f(ce,h(":"))())}function ce(){return e.strict?null:o("obs-domain-list",f(g(d(p(D),h(","))),h("@"),X,g(f(h(","),p(l(D)),l(f(h("@"),X)))))())}function ue(){return e.strict?null:o("obs-mbox-list",f(g(f(p(l(D)),h(","))),N,g(f(h(","),l(f(N,p(D))))))())}function he(){return e.strict?null:o("obs-addr-list",f(g(f(p(l(D)),h(","))),L,g(f(h(","),l(f(L,p(D))))))())}function fe(){return e.strict?null:o("obs-group-list",f(g(f(p(l(D)),h(",")),1),p(l(D)))())}function de(){return e.strict?null:o("obs-local-part",f(F,g(f(h("."),F)))())}function le(){return e.strict?null:o("obs-domain",f(K,g(f(h("."),K)))())}function pe(){return e.strict?null:o("obs-dtext",d(ee,C)())}function ye(e,t){var r,i,n;if(null==t)return null;for(i=[t];i.length>0;){if((n=i.pop()).name===e)return n;for(r=n.children.length-1;r>=0;r-=1)i.push(n.children[r])}return null}function ge(e,t){var r,i,n,a,s;if(null==t)return null;for(i=[t],a=[],s={},r=0;r<e.length;r+=1)s[e[r]]=!0;for(;i.length>0;)if((n=i.pop()).name in s)a.push(n);else for(r=n.children.length-1;r>=0;r-=1)i.push(n.children[r]);return a}function be(t){var r,i,n,a,s;if(null===t)return null;for(r=[],i=ge(["group","mailbox"],t),n=0;n<i.length;n+=1)"group"===(a=i[n]).name?r.push(me(a)):"mailbox"===a.name&&r.push(we(a));return s={ast:t,addresses:r},e.simple&&(s=function(e){var t;if(e&&e.addresses)for(t=0;t<e.addresses.length;t+=1)delete e.addresses[t].node;return e}(s)),e.oneResult?function(t){if(!t)return null;if(!e.partial&&t.addresses.length>1)return null;return t.addresses&&t.addresses[0]}(s):e.simple?s&&s.addresses:s}function me(e){var t,r=ye("display-name",e),i=[],n=ge(["mailbox"],e);for(t=0;t<n.length;t+=1)i.push(we(n[t]));return{node:e,parts:{name:r},type:e.name,name:Ae(r),addresses:i}}function we(e){var t=ye("display-name",e),r=ye("addr-spec",e),i=function(e,t){var r,i,n,a;if(null==t)return null;for(i=[t],a=[];i.length>0;)for((n=i.pop()).name===e&&a.push(n),r=n.children.length-1;r>=0;r-=1)i.push(n.children[r]);return a}("cfws",e),n=ge(["comment"],e),a=ye("local-part",r),s=ye("domain",r);return{node:e,parts:{name:t,address:r,local:a,domain:s,comments:i},type:e.name,name:Ae(t),address:Ae(r),local:Ae(a),domain:Ae(s),comments:ve(n),groupName:Ae(e.groupName)}}function Ae(e){return null!=e?e.semantic:null}function ve(e){var t="";if(e)for(var r=0;r<e.length;r+=1)t+=Ae(e[r]);return t}var _e,ke,Ee,Se,Ce;if(null===(e=i(e,{})))return null;if(_e=e.input,Ce={address:L,"address-list":W,"angle-addr":O,from:function(){return o("from",d(G,W)())},group:H,mailbox:N,"mailbox-list":G,"reply-to":function(){return o("reply-to",W())},sender:function(){return o("sender",d(N,L)())}}[e.startAt]||W,!e.strict){if(a(),e.strict=!0,Se=Ce(_e),e.partial||!t())return be(Se);e.strict=!1}return a(),Se=Ce(_e),!e.partial&&t()?null:be(Se)}function i(e,t){function r(e){return"[object String]"===Object.prototype.toString.call(e)}function i(e){return null==e}var n,a;if(r(e))e={input:e};else if(!function(e){return e===Object(e)}(e))return null;if(!r(e.input))return null;if(!t)return null;for(a in n={oneResult:!1,partial:!1,rejectTLD:!1,rfc6532:!1,simple:!1,startAt:"address-list",strict:!1,atInDisplayName:!1})i(e[a])&&(e[a]=i(t[a])?n[a]:t[a]);return e}r.parseOneAddress=function(e){return r(i(e,{oneResult:!0,rfc6532:!0,simple:!0,startAt:"address-list"}))},r.parseAddressList=function(e){return r(i(e,{rfc6532:!0,simple:!0,startAt:"address-list"}))},r.parseFrom=function(e){return r(i(e,{rfc6532:!0,simple:!0,startAt:"from"}))},r.parseSender=function(e){return r(i(e,{oneResult:!0,rfc6532:!0,simple:!0,startAt:"sender"}))},r.parseReplyTo=function(e){return r(i(e,{rfc6532:!0,simple:!0,startAt:"reply-to"}))},e.exports=r}()}));class ih{static get tag(){return V.packet.userID}constructor(){this.userID="",this.name="",this.email="",this.comment=""}static fromObject(e){if(Y.isString(e)||e.name&&!Y.isString(e.name)||e.email&&!Y.isEmailAddress(e.email)||e.comment&&!Y.isString(e.comment))throw Error("Invalid user ID format");const t=new ih;Object.assign(t,e);const r=[];return t.name&&r.push(t.name),t.comment&&r.push(`(${t.comment})`),t.email&&r.push(`<${t.email}>`),t.userID=r.join(" "),t}read(e,t=ne){const r=Y.decodeUTF8(e);if(r.length>t.maxUserIDLength)throw Error("User ID string is too long");try{const{name:e,address:t,comments:i}=rh.parseOneAddress({input:r,atInDisplayName:!0});this.comment=i.replace(/^\(|\)$/g,""),this.name=e,this.email=t}catch(e){}this.userID=r}write(){return Y.encodeUTF8(this.userID)}equals(e){return e&&e.userID===this.userID}}class nh extends eh{static get tag(){return V.packet.secretSubkey}constructor(e=new Date,t=ne){super(e,t)}}class ah{static get tag(){return V.packet.trust}read(){throw new gn("Trust packets are not supported")}write(){throw new gn("Trust packets are not supported")}}const sh=/*#__PURE__*/Y.constructAllowedPackets([Iu]);class oh{constructor(e){this.packets=e||new Du}write(){return this.packets.write()}armor(e=ne){return le(V.armor.signature,this.write(),void 0,void 0,void 0,e)}getSigningKeyIDs(){return this.packets.map((e=>e.issuerKeyID))}}async function ch({armoredSignature:e,binarySignature:t,config:r,...i}){r={...ne,...r};let n=e||t;if(!n)throw Error("readSignature: must pass options object containing `armoredSignature` or `binarySignature`");if(e&&!Y.isString(e))throw Error("readSignature: options.armoredSignature must be a string");if(t&&!Y.isUint8Array(t))throw Error("readSignature: options.binarySignature must be a Uint8Array");const a=Object.keys(i);if(a.length>0)throw Error("Unknown option: "+a.join(", "));if(e){const{type:e,data:t}=await de(n,r);if(e!==V.armor.signature)throw Error("Armored text not of type signature");n=t}const s=await Du.fromBinary(n,sh,r);return new oh(s)}async function uh(e,t){const r=new nh(e.date,t);return r.packets=null,r.algorithm=V.write(V.publicKey,e.algorithm),await r.generate(e.rsaBits,e.curve,e.symmetric),await r.computeFingerprintAndKeyID(),r}async function hh(e,t){const r=new eh(e.date,t);return r.packets=null,r.algorithm=V.write(V.publicKey,e.algorithm),await r.generate(e.rsaBits,e.curve,e.symmetric),await r.computeFingerprintAndKeyID(),r}async function fh(e,t,r,i,n=new Date,a){let s,o;for(let c=e.length-1;c>=0;c--)try{(!s||e[c].created>=s.created)&&(await e[c].verify(t,r,i,n,void 0,a),s=e[c])}catch(e){o=e}if(!s)throw Y.wrapError(`Could not find valid ${V.read(V.signature,r)} signature in key ${t.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,((e,t,r)=>t+" "+r.toLowerCase())),o);return s}function dh(e,t,r=new Date){const i=Y.normalizeDate(r);if(null!==i){const r=wh(e,t);return!(e.created<=i&&i<r)}return!1}async function lh(e,t,r,i){const n={};n.key=t,n.bind=e;const a={signatureType:V.signature.subkeyBinding};r.sign?(a.keyFlags=[V.keyFlags.signData],a.embeddedSignature=await gh(n,null,e,{signatureType:V.signature.keyBinding},r.date,void 0,void 0,void 0,i)):a.keyFlags=r.forwarding?[V.keyFlags.forwardedCommunication]:[V.keyFlags.encryptCommunication|V.keyFlags.encryptStorage],r.keyExpirationTime>0&&(a.keyExpirationTime=r.keyExpirationTime,a.keyNeverExpires=!1);return await gh(n,null,t,a,r.date,void 0,void 0,void 0,i)}async function ph(e,t,r=new Date,i={},n){let a=n.preferredHashAlgorithm,s=a;if(e){const t=await e.getPrimaryUser(r,i,n);t.selfCertification.preferredHashAlgorithms&&([s]=t.selfCertification.preferredHashAlgorithms,a=Ba.hash.getHashByteLength(a)<=Ba.hash.getHashByteLength(s)?s:a)}switch(t.algorithm){case V.publicKey.ecdsa:case V.publicKey.eddsaLegacy:case V.publicKey.ed25519:s=Ba.getPreferredCurveHashAlgo(t.algorithm,t.publicParams.oid)}return Ba.hash.getHashByteLength(a)<=Ba.hash.getHashByteLength(s)?s:a}async function yh(e,t=[],r=new Date,i=[],n=ne){const a={symmetric:V.symmetric.aes128,aead:V.aead.eax,compression:V.compression.uncompressed}[e],s={symmetric:n.preferredSymmetricAlgorithm,aead:n.preferredAEADAlgorithm,compression:n.preferredCompressionAlgorithm}[e],o={symmetric:"preferredSymmetricAlgorithms",aead:"preferredAEADAlgorithms",compression:"preferredCompressionAlgorithms"}[e],c=await Promise.all(t.map((async function(e,t){const a=(await e.getPrimaryUser(r,i[t],n)).selfCertification[o];return!!a&&a.indexOf(s)>=0})));return c.every(Boolean)?s:a}async function gh(e,t,r,i,n,a,s=[],o=!1,c){if(r.isDummy())throw Error("Cannot sign with a gnu-dummy key.");if(!r.isDecrypted())throw Error("Signing key is not decrypted.");const u=new Iu;return Object.assign(u,i),u.publicKeyAlgorithm=r.algorithm,u.hashAlgorithm=await ph(t,r,n,a,c),u.rawNotations=s,await u.sign(r,e,n,o),u}async function bh(e,t,r,i=new Date,n){(e=e[r])&&(t[r].length?await Promise.all(e.map((async function(e){e.isExpired(i)||n&&!await n(e)||t[r].some((function(t){return Y.equalsUint8Array(t.writeParams(),e.writeParams())}))||t[r].push(e)}))):t[r]=e)}async function mh(e,t,r,i,n,a,s=new Date,o){a=a||e;const c=[];return await Promise.all(i.map((async function(e){try{n&&!e.issuerKeyID.equals(n.issuerKeyID)||(await e.verify(a,t,r,o.revocationsExpire?s:null,!1,o),c.push(e.issuerKeyID))}catch(e){}}))),n?(n.revoked=!!c.some((e=>e.equals(n.issuerKeyID)))||(n.revoked||!1),n.revoked):c.length>0}function wh(e,t){let r;return!1===t.keyNeverExpires&&(r=e.created.getTime()+1e3*t.keyExpirationTime),r?new Date(r):1/0}function Ah(e,t={}){if(e.type=e.type||t.type,e.curve=e.curve||t.curve,e.rsaBits=e.rsaBits||t.rsaBits,e.keyExpirationTime=void 0!==e.keyExpirationTime?e.keyExpirationTime:t.keyExpirationTime,e.passphrase=Y.isString(e.passphrase)?e.passphrase:t.passphrase,e.date=e.date||t.date,e.sign=e.sign||!1,e.forwarding=e.forwarding||!1,e.sign&&e.forwarding)throw Error('Incompatible options: "sign" and "forwarding" cannot be set together');switch(e.type){case"ecc":try{e.curve=V.write(V.curve,e.curve)}catch(e){throw Error("Unknown curve")}e.curve!==V.curve.ed25519Legacy&&e.curve!==V.curve.curve25519Legacy||(e.curve=e.sign?V.curve.ed25519Legacy:V.curve.curve25519Legacy),e.sign?e.algorithm=e.curve===V.curve.ed25519Legacy?V.publicKey.eddsaLegacy:V.publicKey.ecdsa:e.algorithm=V.publicKey.ecdh;break;case"rsa":e.algorithm=V.publicKey.rsaEncryptSign;break;case"symmetric":e.sign?(e.algorithm=V.publicKey.hmac,e.symmetric=e.symmetricHash||t.symmetricHash):(e.algorithm=V.publicKey.aead,e.symmetric=e.symmetricCipher||t.symmetricCipher);break;default:throw Error("Unsupported key type "+e.type)}return e}function vh(e,t){const r=e.algorithm;return r!==V.publicKey.rsaEncrypt&&r!==V.publicKey.elgamal&&r!==V.publicKey.ecdh&&r!==V.publicKey.x25519&&(!t.keyFlags||0!=(t.keyFlags[0]&V.keyFlags.signData))}function _h(e,t){const r=e.algorithm;return r!==V.publicKey.dsa&&r!==V.publicKey.rsaSign&&r!==V.publicKey.ecdsa&&r!==V.publicKey.eddsaLegacy&&r!==V.publicKey.ed25519&&(!t.keyFlags||0!=(t.keyFlags[0]&V.keyFlags.encryptCommunication)||0!=(t.keyFlags[0]&V.keyFlags.encryptStorage))}function kh(e,t){return!(e.keyFlags&&0==(e.keyFlags[0]&V.keyFlags.sign)&&0==(e.keyFlags[0]&V.keyFlags.certifyKeys)&&0==(e.keyFlags[0]&V.keyFlags.authentication)||!t.allowInsecureDecryptionWithSigningKeys)||(!e.keyFlags||0!=(e.keyFlags[0]&V.keyFlags.encryptCommunication)||0!=(e.keyFlags[0]&V.keyFlags.encryptStorage)||t.allowForwardedMessages&&0!=(e.keyFlags[0]&V.keyFlags.forwardedCommunication))}function Eh(e,t){const r=V.write(V.publicKey,e.algorithm),i=e.getAlgorithmInfo();if(t.rejectPublicKeyAlgorithms.has(r))throw Error(i.algorithm+" keys are considered too weak.");switch(r){case V.publicKey.rsaEncryptSign:case V.publicKey.rsaSign:case V.publicKey.rsaEncrypt:if(i.bits<t.minRSABits)throw Error(`RSA keys shorter than ${t.minRSABits} bits are considered too weak.`);break;case V.publicKey.ecdsa:case V.publicKey.eddsaLegacy:case V.publicKey.ecdh:if(t.rejectCurves.has(i.curve))throw Error(`Support for ${i.algorithm} keys using curve ${i.curve} is disabled.`)}}class Sh{constructor(e,t){this.userID=e.constructor.tag===V.packet.userID?e:null,this.userAttribute=e.constructor.tag===V.packet.userAttribute?e:null,this.selfCertifications=[],this.otherCertifications=[],this.revocationSignatures=[],this.mainKey=t}toPacketList(){const e=new Du;return e.push(this.userID||this.userAttribute),e.push(...this.revocationSignatures),e.push(...this.selfCertifications),e.push(...this.otherCertifications),e}clone(){const e=new Sh(this.userID||this.userAttribute,this.mainKey);return e.selfCertifications=[...this.selfCertifications],e.otherCertifications=[...this.otherCertifications],e.revocationSignatures=[...this.revocationSignatures],e}async certify(e,t,r){const i=this.mainKey.keyPacket,n={userID:this.userID,userAttribute:this.userAttribute,key:i},a=new Sh(n.userID||n.userAttribute,this.mainKey);return a.otherCertifications=await Promise.all(e.map((async function(e){if(!e.isPrivate())throw Error("Need private key for signing");if(e.hasSameFingerprintAs(i))throw Error("The user's own key can only be used for self-certifications");const a=await e.getSigningKey(void 0,t,void 0,r);return gh(n,e,a.keyPacket,{signatureType:V.signature.certGeneric,keyFlags:[V.keyFlags.certifyKeys|V.keyFlags.signData]},t,void 0,void 0,void 0,r)}))),await a.update(this,t,r),a}async isRevoked(e,t,r=new Date,i=ne){const n=this.mainKey.keyPacket;return mh(n,V.signature.certRevocation,{key:n,userID:this.userID,userAttribute:this.userAttribute},this.revocationSignatures,e,t,r,i)}async verifyCertificate(e,t,r=new Date,i){const n=this,a=this.mainKey.keyPacket,s={userID:this.userID,userAttribute:this.userAttribute,key:a},{issuerKeyID:o}=e,c=t.filter((e=>e.getKeys(o).length>0));return 0===c.length?null:(await Promise.all(c.map((async t=>{const a=await t.getSigningKey(o,e.created,void 0,i);if(e.revoked||await n.isRevoked(e,a.keyPacket,r,i))throw Error("User certificate is revoked");try{await e.verify(a.keyPacket,V.signature.certGeneric,s,r,void 0,i)}catch(e){throw Y.wrapError("User certificate is invalid",e)}}))),!0)}async verifyAllCertifications(e,t=new Date,r){const i=this,n=this.selfCertifications.concat(this.otherCertifications);return Promise.all(n.map((async n=>({keyID:n.issuerKeyID,valid:await i.verifyCertificate(n,e,t,r).catch((()=>!1))}))))}async verify(e=new Date,t){if(!this.selfCertifications.length)throw Error("No self-certifications found");const r=this,i=this.mainKey.keyPacket,n={userID:this.userID,userAttribute:this.userAttribute,key:i};let a;for(let s=this.selfCertifications.length-1;s>=0;s--)try{const a=this.selfCertifications[s];if(a.revoked||await r.isRevoked(a,void 0,e,t))throw Error("Self-certification is revoked");try{await a.verify(i,V.signature.certGeneric,n,e,void 0,t)}catch(e){throw Y.wrapError("Self-certification is invalid",e)}return!0}catch(e){a=e}throw a}async update(e,t,r){const i=this.mainKey.keyPacket,n={userID:this.userID,userAttribute:this.userAttribute,key:i};await bh(e,this,"selfCertifications",t,(async function(e){try{return await e.verify(i,V.signature.certGeneric,n,t,!1,r),!0}catch(e){return!1}})),await bh(e,this,"otherCertifications",t),await bh(e,this,"revocationSignatures",t,(function(e){return mh(i,V.signature.certRevocation,n,[e],void 0,void 0,t,r)}))}async revoke(e,{flag:t=V.reasonForRevocation.noReason,string:r=""}={},i=new Date,n=ne){const a={userID:this.userID,userAttribute:this.userAttribute,key:e},s=new Sh(a.userID||a.userAttribute,this.mainKey);return s.revocationSignatures.push(await gh(a,null,e,{signatureType:V.signature.certRevocation,reasonForRevocationFlag:V.write(V.reasonForRevocation,t),reasonForRevocationString:r},i,void 0,void 0,!1,n)),await s.update(this),s}}class Ch{constructor(e,t){this.keyPacket=e,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=t}toPacketList(){const e=new Du;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.bindingSignatures),e}clone(){const e=new Ch(this.keyPacket,this.mainKey);return e.bindingSignatures=[...this.bindingSignatures],e.revocationSignatures=[...this.revocationSignatures],e}async isRevoked(e,t,r=new Date,i=ne){const n=this.mainKey.keyPacket;return mh(n,V.signature.subkeyRevocation,{key:n,bind:this.keyPacket},this.revocationSignatures,e,t,r,i)}async verify(e=new Date,t=ne){const r=this.mainKey.keyPacket,i={key:r,bind:this.keyPacket},n=await fh(this.bindingSignatures,r,V.signature.subkeyBinding,i,e,t);if(n.revoked||await this.isRevoked(n,null,e,t))throw Error("Subkey is revoked");if(dh(this.keyPacket,n,e))throw Error("Subkey is expired");return n}async getExpirationTime(e=new Date,t=ne){const r=this.mainKey.keyPacket,i={key:r,bind:this.keyPacket};let n;try{n=await fh(this.bindingSignatures,r,V.signature.subkeyBinding,i,e,t)}catch(e){return null}const a=wh(this.keyPacket,n),s=n.getExpirationTime();return a<s?a:s}async update(e,t=new Date,r=ne){const i=this.mainKey.keyPacket;if(!this.hasSameFingerprintAs(e))throw Error("Subkey update method: fingerprints of subkeys not equal");this.keyPacket.constructor.tag===V.packet.publicSubkey&&e.keyPacket.constructor.tag===V.packet.secretSubkey&&(this.keyPacket=e.keyPacket);const n=this,a={key:i,bind:n.keyPacket};await bh(e,this,"bindingSignatures",t,(async function(e){for(let t=0;t<n.bindingSignatures.length;t++)if(n.bindingSignatures[t].issuerKeyID.equals(e.issuerKeyID))return e.created>n.bindingSignatures[t].created&&(n.bindingSignatures[t]=e),!1;try{return await e.verify(i,V.signature.subkeyBinding,a,t,void 0,r),!0}catch(e){return!1}})),await bh(e,this,"revocationSignatures",t,(function(e){return mh(i,V.signature.subkeyRevocation,a,[e],void 0,void 0,t,r)}))}async revoke(e,{flag:t=V.reasonForRevocation.noReason,string:r=""}={},i=new Date,n=ne){const a={key:e,bind:this.keyPacket},s=new Ch(this.keyPacket,this.mainKey);return s.revocationSignatures.push(await gh(a,null,e,{signatureType:V.signature.subkeyRevocation,reasonForRevocationFlag:V.write(V.reasonForRevocation,t),reasonForRevocationString:r},i,void 0,void 0,!1,n)),await s.update(this),s}hasSameFingerprintAs(e){return this.keyPacket.hasSameFingerprintAs(e.keyPacket||e)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach((e=>{Ch.prototype[e]=function(){return this.keyPacket[e]()}}));const Ih=/*#__PURE__*/Y.constructAllowedPackets([Iu]),Bh=new Set([V.packet.publicKey,V.packet.privateKey]),Ph=new Set([V.packet.publicKey,V.packet.privateKey,V.packet.publicSubkey,V.packet.privateSubkey]);class Mh{packetListToStructure(e,t=new Set){let r,i,n,a;for(const s of e){if(s instanceof bn){Ph.has(s.tag)&&!a&&(a=Bh.has(s.tag)?Bh:Ph);continue}const e=s.constructor.tag;if(a){if(!a.has(e))continue;a=null}if(t.has(e))throw Error("Unexpected packet type: "+e);switch(e){case V.packet.publicKey:case V.packet.secretKey:if(this.keyPacket)throw Error("Key block contains multiple keys");if(this.keyPacket=s,i=this.getKeyID(),!i)throw Error("Missing Key ID");break;case V.packet.userID:case V.packet.userAttribute:r=new Sh(s,this),this.users.push(r);break;case V.packet.publicSubkey:case V.packet.secretSubkey:r=null,n=new Ch(s,this),this.subkeys.push(n);break;case V.packet.signature:switch(s.signatureType){case V.signature.certGeneric:case V.signature.certPersona:case V.signature.certCasual:case V.signature.certPositive:if(!r){Y.printDebug("Dropping certification signatures without preceding user packet");continue}s.issuerKeyID.equals(i)?r.selfCertifications.push(s):r.otherCertifications.push(s);break;case V.signature.certRevocation:r?r.revocationSignatures.push(s):this.directSignatures.push(s);break;case V.signature.key:this.directSignatures.push(s);break;case V.signature.subkeyBinding:if(!n){Y.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}n.bindingSignatures.push(s);break;case V.signature.keyRevocation:this.revocationSignatures.push(s);break;case V.signature.subkeyRevocation:if(!n){Y.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}n.revocationSignatures.push(s)}}}}toPacketList(){const e=new Du;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.directSignatures),this.users.map((t=>e.push(...t.toPacketList()))),this.subkeys.map((t=>e.push(...t.toPacketList()))),e}clone(e=!1){const t=new this.constructor(this.toPacketList());return e&&t.getKeys().forEach((e=>{if(e.keyPacket=Object.create(Object.getPrototypeOf(e.keyPacket),Object.getOwnPropertyDescriptors(e.keyPacket)),!e.keyPacket.isDecrypted())return;const t={};Object.keys(e.keyPacket.privateParams).forEach((r=>{t[r]=new Uint8Array(e.keyPacket.privateParams[r])})),e.keyPacket.privateParams=t})),t}getSubkeys(e=null){return this.subkeys.filter((t=>!e||t.getKeyID().equals(e,!0)))}getKeys(e=null){const t=[];return e&&!this.getKeyID().equals(e,!0)||t.push(this),t.concat(this.getSubkeys(e))}getKeyIDs(){return this.getKeys().map((e=>e.getKeyID()))}getUserIDs(){return this.users.map((e=>e.userID?e.userID.userID:null)).filter((e=>null!==e))}write(){return this.toPacketList().write()}async getSigningKey(e=null,t=new Date,r={},i=ne){await this.verifyPrimaryKey(t,r,i);const n=this.keyPacket,a=this.subkeys.slice().sort(((e,t)=>t.keyPacket.created-e.keyPacket.created));let s;for(const r of a)if(!e||r.getKeyID().equals(e))try{await r.verify(t,i);const e={key:n,bind:r.keyPacket},a=await fh(r.bindingSignatures,n,V.signature.subkeyBinding,e,t,i);if(!vh(r.keyPacket,a))continue;if(!a.embeddedSignature)throw Error("Missing embedded signature");return await fh([a.embeddedSignature],r.keyPacket,V.signature.keyBinding,e,t,i),Eh(r.keyPacket,i),r}catch(e){s=e}try{const a=await this.getPrimaryUser(t,r,i);if((!e||n.getKeyID().equals(e))&&vh(n,a.selfCertification))return Eh(n,i),this}catch(e){s=e}throw Y.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),s)}async getEncryptionKey(e,t=new Date,r={},i=ne){await this.verifyPrimaryKey(t,r,i);const n=this.keyPacket,a=this.subkeys.slice().sort(((e,t)=>t.keyPacket.created-e.keyPacket.created));let s;for(const r of a)if(!e||r.getKeyID().equals(e))try{await r.verify(t,i);const e={key:n,bind:r.keyPacket},a=await fh(r.bindingSignatures,n,V.signature.subkeyBinding,e,t,i);if(_h(r.keyPacket,a))return Eh(r.keyPacket,i),r}catch(e){s=e}try{const a=await this.getPrimaryUser(t,r,i);if((!e||n.getKeyID().equals(e))&&_h(n,a.selfCertification))return Eh(n,i),this}catch(e){s=e}throw Y.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),s)}async isRevoked(e,t,r=new Date,i=ne){return mh(this.keyPacket,V.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,e,t,r,i)}async verifyPrimaryKey(e=new Date,t={},r=ne){const i=this.keyPacket;if(await this.isRevoked(null,null,e,r))throw Error("Primary key is revoked");const{selfCertification:n}=await this.getPrimaryUser(e,t,r);if(dh(i,n,e))throw Error("Primary key is expired");const a=await fh(this.directSignatures,i,V.signature.key,{key:i},e,r).catch((()=>{}));if(a&&dh(i,a,e))throw Error("Primary key is expired")}async getExpirationTime(e,t=ne){let r;try{const{selfCertification:i}=await this.getPrimaryUser(null,e,t),n=wh(this.keyPacket,i),a=i.getExpirationTime(),s=await fh(this.directSignatures,this.keyPacket,V.signature.key,{key:this.keyPacket},null,t).catch((()=>{}));if(s){const e=wh(this.keyPacket,s);r=Math.min(n,a,e)}else r=n<a?n:a}catch(e){r=null}return Y.normalizeDate(r)}async getPrimaryUser(e=new Date,t={},r=ne){const i=this.keyPacket,n=[];let a;for(let s=0;s<this.users.length;s++)try{const a=this.users[s];if(!a.userID)continue;if(void 0!==t.name&&a.userID.name!==t.name||void 0!==t.email&&a.userID.email!==t.email||void 0!==t.comment&&a.userID.comment!==t.comment)throw Error("Could not find user that matches that user ID");const o={userID:a.userID,key:i},c=await fh(a.selfCertifications,i,V.signature.certGeneric,o,e,r);n.push({index:s,user:a,selfCertification:c})}catch(e){a=e}if(!n.length)throw a||Error("Could not find primary user");await Promise.all(n.map((async function(t){return t.selfCertification.revoked||t.user.isRevoked(t.selfCertification,null,e,r)})));const s=n.sort((function(e,t){const r=e.selfCertification,i=t.selfCertification;return i.revoked-r.revoked||r.isPrimaryUserID-i.isPrimaryUserID||r.created-i.created})).pop(),{user:o,selfCertification:c}=s;if(c.revoked||await o.isRevoked(c,null,e,r))throw Error("Primary user is revoked");return s}async update(e,t=new Date,r=ne){if(!this.hasSameFingerprintAs(e))throw Error("Primary key fingerprints must be equal to update the key");if(!this.isPrivate()&&e.isPrivate()){if(!(this.subkeys.length===e.subkeys.length&&this.subkeys.every((t=>e.subkeys.some((e=>t.hasSameFingerprintAs(e)))))))throw Error("Cannot update public key with private key if subkeys mismatch");return e.update(this,r)}const i=this.clone();return await bh(e,i,"revocationSignatures",t,(n=>mh(i.keyPacket,V.signature.keyRevocation,i,[n],null,e.keyPacket,t,r))),await bh(e,i,"directSignatures",t),await Promise.all(e.users.map((async e=>{const n=i.users.filter((t=>e.userID&&e.userID.equals(t.userID)||e.userAttribute&&e.userAttribute.equals(t.userAttribute)));if(n.length>0)await Promise.all(n.map((i=>i.update(e,t,r))));else{const t=e.clone();t.mainKey=i,i.users.push(t)}}))),await Promise.all(e.subkeys.map((async e=>{const n=i.subkeys.filter((t=>t.hasSameFingerprintAs(e)));if(n.length>0)await Promise.all(n.map((i=>i.update(e,t,r))));else{const t=e.clone();t.mainKey=i,i.subkeys.push(t)}}))),i}async getRevocationCertificate(e=new Date,t=ne){const r={key:this.keyPacket},i=await fh(this.revocationSignatures,this.keyPacket,V.signature.keyRevocation,r,e,t),n=new Du;return n.push(i),le(V.armor.publicKey,n.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(e,t=new Date,r=ne){const i=await de(e,r),n=(await Du.fromBinary(i.data,Ih,r)).findPacket(V.packet.signature);if(!n||n.signatureType!==V.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!n.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await n.verify(this.keyPacket,V.signature.keyRevocation,{key:this.keyPacket},t,void 0,r)}catch(e){throw Y.wrapError("Could not verify revocation signature",e)}const a=this.clone();return a.revocationSignatures.push(n),a}async signPrimaryUser(e,t,r,i=ne){const{index:n,user:a}=await this.getPrimaryUser(t,r,i),s=await a.certify(e,t,i),o=this.clone();return o.users[n]=s,o}async signAllUsers(e,t=new Date,r=ne){const i=this.clone();return i.users=await Promise.all(this.users.map((function(i){return i.certify(e,t,r)}))),i}async verifyPrimaryUser(e,t=new Date,r,i=ne){const n=this.keyPacket,{user:a}=await this.getPrimaryUser(t,r,i);return e?await a.verifyAllCertifications(e,t,i):[{keyID:n.getKeyID(),valid:await a.verify(t,i).catch((()=>!1))}]}async verifyAllUsers(e,t=new Date,r=ne){const i=this.keyPacket,n=[];return await Promise.all(this.users.map((async a=>{const s=e?await a.verifyAllCertifications(e,t,r):[{keyID:i.getKeyID(),valid:await a.verify(t,r).catch((()=>!1))}];n.push(...s.map((e=>({userID:a.userID?a.userID.userID:null,userAttribute:a.userAttribute,keyID:e.keyID,valid:e.valid}))))}))),n}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach((e=>{Mh.prototype[e]=Ch.prototype[e]}));class Dh extends Mh{constructor(e){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],e&&(this.packetListToStructure(e,new Set([V.packet.secretKey,V.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(e=ne){return le(V.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,e)}}class xh extends Dh{constructor(e){if(super(),this.packetListToStructure(e,new Set([V.packet.publicKey,V.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const e=new Du,t=this.toPacketList();let r=!1;for(const i of t)if(!r||i.constructor.tag!==V.packet.Signature)switch(r&&(r=!1),i.constructor.tag){case V.packet.secretKey:{const t=V.write(V.publicKey,i.algorithm);if(t===V.publicKey.aead||t===V.publicKey.hmac)throw Error("Cannot create public key from symmetric private");const r=Vu.fromSecretKeyPacket(i);e.push(r);break}case V.packet.secretSubkey:{const t=V.write(V.publicKey,i.algorithm);if(t===V.publicKey.aead||t===V.publicKey.hmac){r=!0;break}const n=Xu.fromSecretSubkeyPacket(i);e.push(n);break}default:e.push(i)}return new Dh(e)}armor(e=ne){return le(V.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,e)}async getDecryptionKeys(e,t=new Date,r={},i=ne){const n=this.keyPacket,a=[];for(let r=0;r<this.subkeys.length;r++)if(!e||this.subkeys[r].getKeyID().equals(e,!0))try{const e={key:n,bind:this.subkeys[r].keyPacket};kh(await fh(this.subkeys[r].bindingSignatures,n,V.signature.subkeyBinding,e,t,i),i)&&a.push(this.subkeys[r])}catch(e){}const s=await this.getPrimaryUser(t,r,i);return e&&!n.getKeyID().equals(e,!0)||!kh(s.selfCertification,i)||a.push(this),a}isDecrypted(){return this.getKeys().some((({keyPacket:e})=>e.isDecrypted()))}async validate(e=ne){if(!this.isPrivate())throw Error("Cannot validate a public key");let t;if(this.keyPacket.isDummy()){const r=await this.getSigningKey(null,null,void 0,{...e,rejectPublicKeyAlgorithms:new Set,minRSABits:0});r&&!r.keyPacket.isDummy()&&(t=r.keyPacket)}else t=this.keyPacket;if(t)return t.validate();{const e=this.getKeys(),t=e.map((e=>e.keyPacket.isDummy())).every(Boolean);if(t)throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(e.map((async e=>e.keyPacket.validate())))}}clearPrivateParams(){this.getKeys().forEach((({keyPacket:e})=>{e.isDecrypted()&&e.clearPrivateParams()}))}async revoke({flag:e=V.reasonForRevocation.noReason,string:t=""}={},r=new Date,i=ne){if(!this.isPrivate())throw Error("Need private key for revoking");const n={key:this.keyPacket},a=this.clone();return a.revocationSignatures.push(await gh(n,null,this.keyPacket,{signatureType:V.signature.keyRevocation,reasonForRevocationFlag:V.write(V.reasonForRevocation,e),reasonForRevocationString:t},r,void 0,void 0,void 0,i)),a}async addSubkey(e={}){const t={...ne,...e.config};if(e.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(e.rsaBits<t.minRSABits)throw Error(`rsaBits should be at least ${t.minRSABits}, got: ${e.rsaBits}`);const r=this.keyPacket;if(r.isDummy())throw Error("Cannot add subkey to gnu-dummy primary key");if(!r.isDecrypted())throw Error("Key is not decrypted");const i=r.getAlgorithmInfo();i.type=i.curve?"ecc":"rsa",i.rsaBits=i.bits||4096,i.curve=i.curve||"curve25519",e=Ah(e,i);const n=await uh(e);Eh(n,t);const a=await lh(n,r,e,t),s=this.toPacketList();return s.push(n,a),new xh(s)}}const Kh=/*#__PURE__*/Y.constructAllowedPackets([Vu,Xu,eh,nh,ih,$u,Iu]);function Uh(e){for(const t of e)switch(t.constructor.tag){case V.packet.secretKey:return new xh(e);case V.packet.publicKey:return new Dh(e)}throw Error("No key packet found")}async function Rh(e,t,r,i){r.passphrase&&await e.encrypt(r.passphrase,i),await Promise.all(t.map((async function(e,t){const n=r.subkeys[t].passphrase;n&&await e.encrypt(n,i)})));const n=new Du;n.push(e),await Promise.all(r.userIDs.map((async function(t,n){function a(e,t){return[t,...e.filter((e=>e!==t))]}const s=ih.fromObject(t),o={};o.userID=s,o.key=e;const c={};c.signatureType=V.signature.certGeneric,c.keyFlags=[V.keyFlags.certifyKeys|V.keyFlags.signData],c.preferredSymmetricAlgorithms=a([V.symmetric.aes256,V.symmetric.aes128,V.symmetric.aes192],i.preferredSymmetricAlgorithm),i.aeadProtect&&(c.preferredAEADAlgorithms=a([V.aead.eax,V.aead.ocb],i.preferredAEADAlgorithm)),c.preferredHashAlgorithms=a([V.hash.sha256,V.hash.sha512],i.preferredHashAlgorithm),c.preferredCompressionAlgorithms=a([V.compression.zlib,V.compression.zip,V.compression.uncompressed],i.preferredCompressionAlgorithm),0===n&&(c.isPrimaryUserID=!0),c.features=[0],c.features[0]|=V.features.modificationDetection,i.aeadProtect&&(c.features[0]|=V.features.aead),i.v5Keys&&(c.features[0]|=V.features.v5Keys),r.keyExpirationTime>0&&(c.keyExpirationTime=r.keyExpirationTime,c.keyNeverExpires=!1);return{userIDPacket:s,signaturePacket:await gh(o,null,e,c,r.date,void 0,void 0,void 0,i)}}))).then((e=>{e.forEach((({userIDPacket:e,signaturePacket:t})=>{n.push(e),n.push(t)}))})),await Promise.all(t.map((async function(t,n){const a=r.subkeys[n];return{secretSubkeyPacket:t,subkeySignaturePacket:await lh(t,e,a,i)}}))).then((e=>{e.forEach((({secretSubkeyPacket:e,subkeySignaturePacket:t})=>{n.push(e),n.push(t)}))}));const a={key:e};return n.push(await gh(a,null,e,{signatureType:V.signature.keyRevocation,reasonForRevocationFlag:V.reasonForRevocation.noReason,reasonForRevocationString:""},r.date,void 0,void 0,void 0,i)),r.passphrase&&e.clearPrivateParams(),await Promise.all(t.map((async function(e,t){r.subkeys[t].passphrase&&e.clearPrivateParams()}))),new xh(n)}async function Th({armoredKey:e,binaryKey:t,config:r,...i}){if(r={...ne,...r},!e&&!t)throw Error("readKey: must pass options object containing `armoredKey` or `binaryKey`");if(e&&!Y.isString(e))throw Error("readKey: options.armoredKey must be a string");if(t&&!Y.isUint8Array(t))throw Error("readKey: options.binaryKey must be a Uint8Array");const n=Object.keys(i);if(n.length>0)throw Error("Unknown option: "+n.join(", "));let a;if(e){const{type:t,data:i}=await de(e,r);if(t!==V.armor.publicKey&&t!==V.armor.privateKey)throw Error("Armored text not of type key");a=i}else a=t;return Uh(await Du.fromBinary(a,Kh,r))}async function Qh({armoredKey:e,binaryKey:t,config:r,...i}){if(r={...ne,...r},!e&&!t)throw Error("readPrivateKey: must pass options object containing `armoredKey` or `binaryKey`");if(e&&!Y.isString(e))throw Error("readPrivateKey: options.armoredKey must be a string");if(t&&!Y.isUint8Array(t))throw Error("readPrivateKey: options.binaryKey must be a Uint8Array");const n=Object.keys(i);if(n.length>0)throw Error("Unknown option: "+n.join(", "));let a;if(e){const{type:t,data:i}=await de(e,r);if(t!==V.armor.privateKey)throw Error("Armored text not of type private key");a=i}else a=t;const s=await Du.fromBinary(a,Kh,r);return new xh(s)}async function zh({armoredKeys:e,binaryKeys:t,config:r,...i}){r={...ne,...r};let n=e||t;if(!n)throw Error("readKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(e&&!Y.isString(e))throw Error("readKeys: options.armoredKeys must be a string");if(t&&!Y.isUint8Array(t))throw Error("readKeys: options.binaryKeys must be a Uint8Array");const a=Object.keys(i);if(a.length>0)throw Error("Unknown option: "+a.join(", "));if(e){const{type:t,data:i}=await de(e,r);if(t!==V.armor.publicKey&&t!==V.armor.privateKey)throw Error("Armored text not of type key");n=i}const s=[],o=await Du.fromBinary(n,Kh,r),c=o.indexOfTag(V.packet.publicKey,V.packet.secretKey);if(0===c.length)throw Error("No key packet found");for(let e=0;e<c.length;e++){const t=Uh(o.slice(c[e],c[e+1]));s.push(t)}return s}async function Fh({armoredKeys:e,binaryKeys:t,config:r}){r={...ne,...r};let i=e||t;if(!i)throw Error("readPrivateKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(e&&!Y.isString(e))throw Error("readPrivateKeys: options.armoredKeys must be a string");if(t&&!Y.isUint8Array(t))throw Error("readPrivateKeys: options.binaryKeys must be a Uint8Array");if(e){const{type:t,data:n}=await de(e,r);if(t!==V.armor.privateKey)throw Error("Armored text not of type private key");i=n}const n=[],a=await Du.fromBinary(i,Kh,r),s=a.indexOfTag(V.packet.secretKey);if(0===s.length)throw Error("No secret key packet found");for(let e=0;e<s.length;e++){const t=a.slice(s[e],s[e+1]),r=new xh(t);n.push(r)}return n}const Lh=/*#__PURE__*/Y.constructAllowedPackets([Eu,Ku,Hu,qu,Yu,ju,Wu,Pu,Iu]),Nh=/*#__PURE__*/Y.constructAllowedPackets([Wu]),qh=/*#__PURE__*/Y.constructAllowedPackets([Iu]);class Oh{constructor(e){this.packets=e||new Du}getEncryptionKeyIDs(){const e=[];return this.packets.filterByTag(V.packet.publicKeyEncryptedSessionKey).forEach((function(t){e.push(t.publicKeyID)})),e}getSigningKeyIDs(){const e=this.unwrapCompressed(),t=e.packets.filterByTag(V.packet.onePassSignature);if(t.length>0)return t.map((e=>e.issuerKeyID));return e.packets.filterByTag(V.packet.signature).map((e=>e.issuerKeyID))}async decrypt(e,t,r,i=new Date,n=ne){const a=r||await this.decryptSessionKeys(e,t,i,n),s=this.packets.filterByTag(V.packet.symmetricallyEncryptedData,V.packet.symEncryptedIntegrityProtectedData,V.packet.aeadEncryptedData);if(0===s.length)throw Error("No encrypted data found");const o=s[0];let c=null;const u=Promise.all(a.map((async({algorithm:e,data:t})=>{if(!Y.isUint8Array(t)||!Y.isString(e))throw Error("Invalid session key for decryption.");try{const r=V.write(V.symmetric,e);await o.decrypt(r,t,n)}catch(e){Y.printDebugError(e),c=e}})));if(O(o.encrypted),o.encrypted=null,await u,!o.packets||!o.packets.length)throw c||Error("Decryption failed.");const h=new Oh(o.packets);return o.packets=new Du,h}async decryptSessionKeys(e,t,r=new Date,i=ne){let n,a=[];if(t){const e=this.packets.filterByTag(V.packet.symEncryptedSessionKey);if(0===e.length)throw Error("No symmetrically encrypted session key packet found.");await Promise.all(t.map((async function(t,r){let s;s=r?await Du.fromBinary(e.write(),Nh,i):e,await Promise.all(s.map((async function(e){try{await e.decrypt(t),a.push(e)}catch(e){Y.printDebugError(e),e instanceof Pa&&(n=e)}})))})))}else{if(!e)throw Error("No key or password specified.");{const t=this.packets.filterByTag(V.packet.publicKeyEncryptedSessionKey);if(0===t.length)throw Error("No public key encrypted session key packet found.");await Promise.all(t.map((async function(t){await Promise.all(e.map((async function(e){let s=[V.symmetric.aes256,V.symmetric.aes128,V.symmetric.tripledes,V.symmetric.cast5];try{const t=await e.getPrimaryUser(r,void 0,i);t.selfCertification.preferredSymmetricAlgorithms&&(s=s.concat(t.selfCertification.preferredSymmetricAlgorithms))}catch(e){}const o=(await e.getDecryptionKeys(t.publicKeyID,null,void 0,i)).map((e=>e.keyPacket));await Promise.all(o.map((async function(e){if(!e||e.isDummy())return;if(!e.isDecrypted())throw Error("Decryption key is not decrypted.");if(i.constantTimePKCS1Decryption&&(t.publicKeyAlgorithm===V.publicKey.rsaEncrypt||t.publicKeyAlgorithm===V.publicKey.rsaEncryptSign||t.publicKeyAlgorithm===V.publicKey.rsaSign||t.publicKeyAlgorithm===V.publicKey.elgamal)){const r=t.write();await Promise.all(Array.from(i.constantTimePKCS1DecryptionSupportedSymmetricAlgorithms).map((async t=>{const i=new ju;i.read(r);const s={sessionKeyAlgorithm:t,sessionKey:Ba.generateSessionKey(t)};try{await i.decrypt(e,s),a.push(i)}catch(e){Y.printDebugError(e),n=e}})))}else try{if(await t.decrypt(e),!s.includes(V.write(V.symmetric,t.sessionKeyAlgorithm)))throw Error("A non-preferred symmetric algorithm was used.");a.push(t)}catch(e){Y.printDebugError(e),n=e}})))}))),O(t.encrypted),t.encrypted=null})))}}if(a.length>0){if(a.length>1){const e=new Set;a=a.filter((t=>{const r=t.sessionKeyAlgorithm+Y.uint8ArrayToString(t.sessionKey);return!e.has(r)&&(e.add(r),!0)}))}return a.map((e=>({data:e.sessionKey,algorithm:V.read(V.symmetric,e.sessionKeyAlgorithm)})))}throw n||Error("Session key decryption failed.")}getLiteralData(){const e=this.unwrapCompressed().packets.findPacket(V.packet.literalData);return e&&e.getBytes()||null}getFilename(){const e=this.unwrapCompressed().packets.findPacket(V.packet.literalData);return e&&e.getFilename()||null}getText(){const e=this.unwrapCompressed().packets.findPacket(V.packet.literalData);return e?e.getText():null}static async generateSessionKey(e=[],t=new Date,r=[],i=ne){const n=await yh("symmetric",e,t,r,i),a=V.read(V.symmetric,n),s=i.aeadProtect&&await async function(e,t=new Date,r=[],i=ne){let n=!0;return await Promise.all(e.map((async function(e,a){const s=await e.getPrimaryUser(t,r[a],i);s.selfCertification.features&&s.selfCertification.features[0]&V.features.aead||(n=!1)}))),n}(e,t,r,i)?V.read(V.aead,await yh("aead",e,t,r,i)):void 0;await Promise.all(e.map((e=>e.getEncryptionKey().catch((()=>null)).then((e=>{if(e&&e.keyPacket.algorithm===V.publicKey.x25519&&!Y.isAES(n))throw Error("Could not generate a session key compatible with the given `encryptionKeys`: X22519 keys can only be used to encrypt AES session keys; change `config.preferredSymmetricAlgorithm` accordingly.")})))));return{data:Ba.generateSessionKey(n),algorithm:a,aeadAlgorithm:s}}async encrypt(e,t,r,i=!1,n=[],a=new Date,s=[],o=ne){if(r){if(!Y.isUint8Array(r.data)||!Y.isString(r.algorithm))throw Error("Invalid session key for encryption.")}else if(e&&e.length)r=await Oh.generateSessionKey(e,a,s,o);else{if(!t||!t.length)throw Error("No keys, passwords, or session key provided.");r=await Oh.generateSessionKey(void 0,void 0,void 0,o)}const{data:c,algorithm:u,aeadAlgorithm:h}=r,f=await Oh.encryptSessionKey(c,u,h,e,t,i,n,a,s,o);let d;h?(d=new Hu,d.aeadAlgorithm=V.write(V.aead,h)):d=new qu,d.packets=this.packets;const l=V.write(V.symmetric,u);return await d.encrypt(l,c,o),f.packets.push(d),d.packets=new Du,f}static async encryptSessionKey(e,t,r,i,n,a=!1,s=[],o=new Date,c=[],u=ne){const h=new Du,f=V.write(V.symmetric,t),d=r&&V.write(V.aead,r);if(i){const t=await Promise.all(i.map((async function(t,r){const i=await t.getEncryptionKey(s[r],o,c,u),n=new ju;return n.publicKeyID=a?pe.wildcard():i.getKeyID(),n.publicKeyAlgorithm=i.keyPacket.algorithm,n.sessionKey=e,n.sessionKeyAlgorithm=f,await n.encrypt(i.keyPacket),delete n.sessionKey,n})));h.push(...t)}if(n){const t=async function(e,t){try{return await e.decrypt(t),1}catch(e){return 0}},r=(e,t)=>e+t,i=async function(e,a,s,o){const c=new Wu(u);if(c.sessionKey=e,c.sessionKeyAlgorithm=a,s&&(c.aeadAlgorithm=s),await c.encrypt(o,u),u.passwordCollisionCheck){if(1!==(await Promise.all(n.map((e=>t(c,e))))).reduce(r))return i(e,a,o)}return delete c.sessionKey,c},a=await Promise.all(n.map((t=>i(e,f,d,t))));h.push(...a)}return new Oh(h)}async sign(e=[],t=null,r=[],i=new Date,n=[],a=[],s=ne){const o=new Du,c=this.packets.findPacket(V.packet.literalData);if(!c)throw Error("No literal data packet to sign.");let u,h;const f=null===c.text?V.signature.binary:V.signature.text;if(t)for(h=t.packets.filterByTag(V.packet.signature),u=h.length-1;u>=0;u--){const t=h[u],r=new Pu;r.signatureType=t.signatureType,r.hashAlgorithm=t.hashAlgorithm,r.publicKeyAlgorithm=t.publicKeyAlgorithm,r.issuerKeyID=t.issuerKeyID,e.length||0!==u||(r.flags=1),o.push(r)}return await Promise.all(Array.from(e).reverse().map((async function(t,a){if(!t.isPrivate())throw Error("Need private key for signing");const o=r[e.length-1-a],c=await t.getSigningKey(o,i,n,s),u=new Pu;return u.signatureType=f,u.hashAlgorithm=await ph(t,c.keyPacket,i,n,s),u.publicKeyAlgorithm=c.keyPacket.algorithm,u.issuerKeyID=c.getKeyID(),a===e.length-1&&(u.flags=1),u}))).then((e=>{e.forEach((e=>o.push(e)))})),o.push(c),o.push(...await Hh(c,e,t,r,i,n,a,!1,s)),new Oh(o)}compress(e,t=ne){if(e===V.compression.uncompressed)return this;const r=new Ku(t);r.algorithm=e,r.packets=this.packets;const i=new Du;return i.push(r),new Oh(i)}async signDetached(e=[],t=null,r=[],i=new Date,n=[],a=[],s=ne){const o=this.packets.findPacket(V.packet.literalData);if(!o)throw Error("No literal data packet to sign.");return new oh(await Hh(o,e,t,r,i,n,a,!0,s))}async verify(e,t=new Date,r=ne){const i=this.unwrapCompressed(),n=i.packets.filterByTag(V.packet.literalData);if(1!==n.length)throw Error("Can only verify message with one literal data packet.");s(i.packets.stream)&&i.packets.push(...await q(i.packets.stream,(e=>e||[])));const a=i.packets.filterByTag(V.packet.onePassSignature).reverse(),o=i.packets.filterByTag(V.packet.signature);return a.length&&!o.length&&Y.isStream(i.packets.stream)&&!s(i.packets.stream)?(await Promise.all(a.map((async e=>{e.correspondingSig=new Promise(((t,r)=>{e.correspondingSigResolve=t,e.correspondingSigReject=r})),e.signatureData=H((async()=>(await e.correspondingSig).signatureData)),e.hashed=q(await e.hash(e.signatureType,n[0],void 0,!1)),e.hashed.catch((()=>{}))}))),i.packets.stream=T(i.packets.stream,(async(e,t)=>{const r=M(e),i=D(t);try{for(let e=0;e<a.length;e++){const{value:t}=await r.read();a[e].correspondingSigResolve(t)}await r.readToEnd(),await i.ready,await i.close()}catch(e){a.forEach((t=>{t.correspondingSigReject(e)})),await i.abort(e)}})),jh(a,n,e,t,!1,r)):jh(o,n,e,t,!1,r)}verifyDetached(e,t,r=new Date,i=ne){const n=this.unwrapCompressed().packets.filterByTag(V.packet.literalData);if(1!==n.length)throw Error("Can only verify message with one literal data packet.");return jh(e.packets.filterByTag(V.packet.signature),n,t,r,!0,i)}unwrapCompressed(){const e=this.packets.filterByTag(V.packet.compressedData);return e.length?new Oh(e[0].packets):this}async appendSignature(e,t=ne){await this.packets.read(Y.isUint8Array(e)?e:(await de(e)).data,qh,t)}write(){return this.packets.write()}armor(e=ne){return le(V.armor.message,this.write(),null,null,null,e)}}async function Hh(e,t,r=null,i=[],n=new Date,a=[],s=[],o=!1,c=ne){const u=new Du,h=null===e.text?V.signature.binary:V.signature.text;if(await Promise.all(t.map((async(t,r)=>{const u=a[r];if(!t.isPrivate())throw Error("Need private key for signing");const f=await t.getSigningKey(i[r],n,u,c);return gh(e,t,f.keyPacket,{signatureType:h},n,u,s,o,c)}))).then((e=>{u.push(...e)})),r){const e=r.packets.filterByTag(V.packet.signature);u.push(...e)}return u}async function jh(e,t,r,i=new Date,n=!1,a=ne){return Promise.all(e.filter((function(e){return["text","binary"].includes(V.read(V.signature,e.signatureType))})).map((async function(e){return async function(e,t,r,i=new Date,n=!1,a=ne){let s,o;for(const t of r){const r=t.getKeys(e.issuerKeyID);if(r.length>0){s=t,o=r[0];break}}const c=e instanceof Pu?e.correspondingSig:e,u={keyID:e.issuerKeyID,verified:(async()=>{if(!o)throw Error("Could not find signing key with key ID "+e.issuerKeyID.toHex());await e.verify(o.keyPacket,e.signatureType,t[0],i,n,a);const r=await c;if(o.getCreationTime()>r.created)throw Error("Key is newer than the signature");try{await s.getSigningKey(o.getKeyID(),r.created,void 0,a)}catch(e){if(!a.allowInsecureVerificationWithReformattedKeys||!e.message.match(/Signature creation time is in the future/))throw e;await s.getSigningKey(o.getKeyID(),i,void 0,a)}return!0})(),signature:(async()=>{const e=await c,t=new Du;return e&&t.push(e),new oh(t)})()};return u.signature.catch((()=>{})),u.verified.catch((()=>{})),u}(e,t,r,i,n,a)})))}async function Gh({armoredMessage:e,binaryMessage:t,config:r,...i}){r={...ne,...r};let n=e||t;if(!n)throw Error("readMessage: must pass options object containing `armoredMessage` or `binaryMessage`");if(e&&!Y.isString(e)&&!Y.isStream(e))throw Error("readMessage: options.armoredMessage must be a string or stream");if(t&&!Y.isUint8Array(t)&&!Y.isStream(t))throw Error("readMessage: options.binaryMessage must be a Uint8Array or stream");const a=Object.keys(i);if(a.length>0)throw Error("Unknown option: "+a.join(", "));const s=Y.isStream(n);if(s&&(await S(),n=I(n)),e){const{type:e,data:t}=await de(n,r);if(e!==V.armor.message)throw Error("Armored text not of type message");n=t}const o=await Du.fromBinary(n,Lh,r),c=new Oh(o);return c.fromStream=s,c}async function Wh({text:e,binary:t,filename:r,date:i=new Date,format:n=(void 0!==e?"utf8":"binary"),...a}){let s=void 0!==e?e:t;if(void 0===s)throw Error("createMessage: must pass options object containing `text` or `binary`");if(e&&!Y.isString(e)&&!Y.isStream(e))throw Error("createMessage: options.text must be a string or stream");if(t&&!Y.isUint8Array(t)&&!Y.isStream(t))throw Error("createMessage: options.binary must be a Uint8Array or stream");const o=Object.keys(a);if(o.length>0)throw Error("Unknown option: "+o.join(", "));const c=Y.isStream(s);c&&(await S(),s=I(s));const u=new Eu(i);void 0!==e?u.setText(s,V.write(V.literal,n)):u.setBytes(s,V.write(V.literal,n)),void 0!==r&&u.setFilename(r);const h=new Du;h.push(u);const f=new Oh(h);return f.fromStream=c,f}const Vh=/*#__PURE__*/Y.constructAllowedPackets([Iu]);class Jh{constructor(e,t){if(this.text=Y.removeTrailingSpaces(e).replace(/\r?\n/g,"\r\n"),t&&!(t instanceof oh))throw Error("Invalid signature input");this.signature=t||new oh(new Du)}getSigningKeyIDs(){const e=[];return this.signature.packets.forEach((function(t){e.push(t.issuerKeyID)})),e}async sign(e,t=null,r=[],i=new Date,n=[],a=[],s=ne){const o=new Eu;o.setText(this.text);const c=new oh(await Hh(o,e,t,r,i,n,a,!0,s));return new Jh(this.text,c)}verify(e,t=new Date,r=ne){const i=this.signature.packets.filterByTag(V.packet.signature),n=new Eu;return n.setText(this.text),jh(i,[n],e,t,!0,r)}getText(){return this.text.replace(/\r\n/g,"\n")}armor(e=ne){let t=this.signature.packets.map((function(e){return V.read(V.hash,e.hashAlgorithm).toUpperCase()}));t=t.filter((function(e,t,r){return r.indexOf(e)===t}));const r={hash:t.join(),text:this.text,data:this.signature.packets.write()};return le(V.armor.signed,r,void 0,void 0,void 0,e)}}async function Yh({cleartextMessage:e,config:t,...r}){if(t={...ne,...t},!e)throw Error("readCleartextMessage: must pass options object containing `cleartextMessage`");if(!Y.isString(e))throw Error("readCleartextMessage: options.cleartextMessage must be a string");const i=Object.keys(r);if(i.length>0)throw Error("Unknown option: "+i.join(", "));const n=await de(e);if(n.type!==V.armor.signed)throw Error("No cleartext signed message.");const a=await Du.fromBinary(n.data,Vh,t);!function(e,t){const r=function(e){const r=e=>t=>e.hashAlgorithm===t;for(let i=0;i<t.length;i++)if(t[i].constructor.tag===V.packet.signature&&!e.some(r(t[i])))return!1;return!0};let i=null,n=[];if(e.forEach((function(e){if(i=e.match(/^Hash: (.+)$/),!i)throw Error('Only "Hash" header allowed in cleartext signed message');i=i[1].replace(/\s/g,""),i=i.split(","),i=i.map((function(e){e=e.toLowerCase();try{return V.write(V.hash,e)}catch(t){throw Error("Unknown hash algorithm in armor header: "+e)}})),n=n.concat(i)})),!n.length&&!r([V.hash.md5]))throw Error('If no "Hash" header in cleartext signed message, then only MD5 signatures allowed');if(n.length&&!r(n))throw Error("Hash algorithm mismatch in armor header and signature")}(n.headers,a);const s=new oh(a);return new Jh(n.text,s)}async function Zh({text:e,...t}){if(!e)throw Error("createCleartextMessage: must pass options object containing `text`");if(!Y.isString(e))throw Error("createCleartextMessage: options.text must be a string");const r=Object.keys(t);if(r.length>0)throw Error("Unknown option: "+r.join(", "));return new Jh(e)}async function Xh({userIDs:e=[],passphrase:t,type:r="ecc",rsaBits:i=4096,curve:n="curve25519",keyExpirationTime:a=0,date:s=new Date,subkeys:o=[{}],format:c="armored",config:u,symmetricHash:h="sha256",symmetricCipher:f="aes256",...d}){yf(u={...ne,...u}),e=gf(e);const l=Object.keys(d);if(l.length>0)throw Error("Unknown option: "+l.join(", "));if(0===e.length)throw Error("UserIDs are required for key generation");if("rsa"===r&&i<u.minRSABits)throw Error(`rsaBits should be at least ${u.minRSABits}, got: ${i}`);const p={userIDs:e,passphrase:t,type:r,rsaBits:i,curve:n,keyExpirationTime:a,date:s,subkeys:o,symmetricHash:h,symmetricCipher:f};try{const{key:e,revocationCertificate:t}=await async function(e,t){e.sign=!0,(e=Ah(e)).subkeys=e.subkeys.map(((t,r)=>Ah(e.subkeys[r],e)));let r=[hh(e,t)];r=r.concat(e.subkeys.map((e=>uh(e,t))));const i=await Promise.all(r),n=await Rh(i[0],i.slice(1),e,t),a=await n.getRevocationCertificate(e.date,t);return n.revocationSignatures=[],{key:n,revocationCertificate:a}}(p,u);return e.getKeys().forEach((({keyPacket:e})=>Eh(e,u))),{privateKey:wf(e,c,u),publicKey:"symmetric"!==r?wf(e.toPublic(),c,u):null,revocationCertificate:t}}catch(e){throw Y.wrapError("Error generating keypair",e)}}async function $h({privateKey:e,userIDs:t=[],passphrase:r,keyExpirationTime:i=0,date:n,format:a="armored",config:s,...o}){yf(s={...ne,...s}),t=gf(t);const c=Object.keys(o);if(c.length>0)throw Error("Unknown option: "+c.join(", "));if(0===t.length)throw Error("UserIDs are required for key reformat");const u={privateKey:e,userIDs:t,passphrase:r,keyExpirationTime:i,date:n};try{const{key:e,revocationCertificate:t}=await async function(e,t){e=o(e);const{privateKey:r}=e;if(!r.isPrivate())throw Error("Cannot reformat a public key");if(r.keyPacket.isDummy())throw Error("Cannot reformat a gnu-dummy primary key");if(!r.getKeys().every((({keyPacket:e})=>e.isDecrypted())))throw Error("Key is not decrypted");const i=r.keyPacket;e.subkeys||(e.subkeys=await Promise.all(r.subkeys.map((async e=>{const r=e.keyPacket,n={key:i,bind:r},a=await fh(e.bindingSignatures,i,V.signature.subkeyBinding,n,null,t).catch((()=>({})));return{sign:a.keyFlags&&a.keyFlags[0]&V.keyFlags.signData,forwarding:a.keyFlags&&a.keyFlags[0]&V.keyFlags.forwardedCommunication}}))));const n=r.subkeys.map((e=>e.keyPacket));if(e.subkeys.length!==n.length)throw Error("Number of subkey options does not match number of subkeys");e.subkeys=e.subkeys.map((t=>o(t,e)));const a=await Rh(i,n,e,t),s=await a.getRevocationCertificate(e.date,t);return a.revocationSignatures=[],{key:a,revocationCertificate:s};function o(e,t={}){return e.keyExpirationTime=e.keyExpirationTime||t.keyExpirationTime,e.passphrase=Y.isString(e.passphrase)?e.passphrase:t.passphrase,e.date=e.date||t.date,e}}(u,s);return{privateKey:wf(e,a,s),publicKey:wf(e.toPublic(),a,s),revocationCertificate:t}}catch(e){throw Y.wrapError("Error reformatting keypair",e)}}async function ef({key:e,revocationCertificate:t,reasonForRevocation:r,date:i=new Date,format:n="armored",config:a,...s}){yf(a={...ne,...a});const o=Object.keys(s);if(o.length>0)throw Error("Unknown option: "+o.join(", "));try{const s=t?await e.applyRevocationCertificate(t,i,a):await e.revoke(r,i,a);return s.isPrivate()?{privateKey:wf(s,n,a),publicKey:wf(s.toPublic(),n,a)}:{privateKey:null,publicKey:wf(s,n,a)}}catch(e){throw Y.wrapError("Error revoking key",e)}}async function tf({privateKey:e,passphrase:t,config:r,...i}){yf(r={...ne,...r});const n=Object.keys(i);if(n.length>0)throw Error("Unknown option: "+n.join(", "));if(!e.isPrivate())throw Error("Cannot decrypt a public key");const a=e.clone(!0),s=Y.isArray(t)?t:[t];try{return await Promise.all(a.getKeys().map((e=>Y.anyPromise(s.map((t=>e.keyPacket.decrypt(t))))))),await a.validate(r),a}catch(e){throw a.clearPrivateParams(),Y.wrapError("Error decrypting private key",e)}}async function rf({privateKey:e,passphrase:t,config:r,...i}){yf(r={...ne,...r});const n=Object.keys(i);if(n.length>0)throw Error("Unknown option: "+n.join(", "));if(!e.isPrivate())throw Error("Cannot encrypt a public key");const a=e.clone(!0),s=a.getKeys(),o=Y.isArray(t)?t:Array(s.length).fill(t);if(o.length!==s.length)throw Error("Invalid number of passphrases given for key encryption");try{return await Promise.all(s.map((async(e,t)=>{const{keyPacket:i}=e;await i.encrypt(o[t],r),i.clearPrivateParams()}))),a}catch(e){throw a.clearPrivateParams(),Y.wrapError("Error encrypting private key",e)}}async function nf({message:e,encryptionKeys:t,signingKeys:r,passwords:i,sessionKey:n,format:a="armored",signature:s=null,wildcard:o=!1,signingKeyIDs:c=[],encryptionKeyIDs:u=[],date:h=new Date,signingUserIDs:f=[],encryptionUserIDs:d=[],signatureNotations:l=[],config:p,...y}){if(yf(p={...ne,...p}),ff(e),lf(a),t=gf(t),r=gf(r),i=gf(i),c=gf(c),u=gf(u),f=gf(f),d=gf(d),l=gf(l),y.detached)throw Error("The `detached` option has been removed from openpgp.encrypt, separately call openpgp.sign instead. Don't forget to remove the `privateKeys` option as well.");if(y.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encrypt, pass `encryptionKeys` instead");if(y.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.encrypt, pass `signingKeys` instead");if(void 0!==y.armor)throw Error("The `armor` option has been removed from openpgp.encrypt, pass `format` instead.");const g=Object.keys(y);if(g.length>0)throw Error("Unknown option: "+g.join(", "));r||(r=[]);const b=e.fromStream;try{if((r.length||s)&&(e=await e.sign(r,s,c,h,f,l,p)),e=e.compress(await yh("compression",t,h,d,p),p),e=await e.encrypt(t,i,n,o,u,h,d,p),"object"===a)return e;const y="armored"===a;return bf(y?e.armor(p):e.write(),b,y?"utf8":"binary")}catch(e){throw Y.wrapError("Error encrypting message",e)}}async function af({message:e,decryptionKeys:t,passwords:r,sessionKeys:i,verificationKeys:n,expectSigned:a=!1,format:s="utf8",signature:o=null,date:c=new Date,config:u,...h}){if(yf(u={...ne,...u}),ff(e),n=gf(n),t=gf(t),r=gf(r),i=gf(i),h.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decrypt, pass `decryptionKeys` instead");if(h.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.decrypt, pass `verificationKeys` instead");const f=Object.keys(h);if(f.length>0)throw Error("Unknown option: "+f.join(", "));try{const h=await e.decrypt(t,r,i,c,u);n||(n=[]);const f={};if(f.signatures=o?await h.verifyDetached(o,n,c,u):await h.verify(n,c,u),f.data="binary"===s?h.getLiteralData():h.getText(),f.filename=h.getFilename(),mf(f,e),a){if(0===n.length)throw Error("Verification keys are required to verify message signatures");if(0===f.signatures.length)throw Error("Message is not signed");f.data=P([f.data,H((async()=>{await Y.anyPromise(f.signatures.map((e=>e.verified)))}))])}return f.data=await bf(f.data,e.fromStream,s),f}catch(e){throw Y.wrapError("Error decrypting message",e)}}async function sf({message:e,signingKeys:t,format:r="armored",detached:i=!1,signingKeyIDs:n=[],date:a=new Date,signingUserIDs:s=[],signatureNotations:o=[],config:c,...u}){if(yf(c={...ne,...c}),df(e),lf(r),t=gf(t),n=gf(n),s=gf(s),o=gf(o),u.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.sign, pass `signingKeys` instead");if(void 0!==u.armor)throw Error("The `armor` option has been removed from openpgp.sign, pass `format` instead.");const h=Object.keys(u);if(h.length>0)throw Error("Unknown option: "+h.join(", "));if(e instanceof Jh&&"binary"===r)throw Error("Cannot return signed cleartext message in binary format");if(e instanceof Jh&&i)throw Error("Cannot detach-sign a cleartext message");if(!t||0===t.length)throw Error("No signing keys provided");try{let u;if(u=i?await e.signDetached(t,void 0,n,a,s,o,c):await e.sign(t,void 0,n,a,s,o,c),"object"===r)return u;const h="armored"===r;return u=h?u.armor(c):u.write(),i&&(u=T(e.packets.write(),(async(e,t)=>{await Promise.all([x(u,t),q(e).catch((()=>{}))])}))),bf(u,e.fromStream,h?"utf8":"binary")}catch(e){throw Y.wrapError("Error signing message",e)}}async function of({message:e,verificationKeys:t,expectSigned:r=!1,format:i="utf8",signature:n=null,date:a=new Date,config:s,...o}){if(yf(s={...ne,...s}),df(e),t=gf(t),o.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.verify, pass `verificationKeys` instead");const c=Object.keys(o);if(c.length>0)throw Error("Unknown option: "+c.join(", "));if(e instanceof Jh&&"binary"===i)throw Error("Can't return cleartext message data as binary");if(e instanceof Jh&&n)throw Error("Can't verify detached cleartext signature");try{const o={};if(o.signatures=n?await e.verifyDetached(n,t,a,s):await e.verify(t,a,s),o.data="binary"===i?e.getLiteralData():e.getText(),e.fromStream&&mf(o,e),r){if(0===o.signatures.length)throw Error("Message is not signed");o.data=P([o.data,H((async()=>{await Y.anyPromise(o.signatures.map((e=>e.verified)))}))])}return o.data=await bf(o.data,e.fromStream,i),o}catch(e){throw Y.wrapError("Error verifying signed message",e)}}async function cf({encryptionKeys:e,date:t=new Date,encryptionUserIDs:r=[],config:i,...n}){if(yf(i={...ne,...i}),e=gf(e),r=gf(r),n.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.generateSessionKey, pass `encryptionKeys` instead");const a=Object.keys(n);if(a.length>0)throw Error("Unknown option: "+a.join(", "));try{return await Oh.generateSessionKey(e,t,r,i)}catch(e){throw Y.wrapError("Error generating session key",e)}}async function uf({data:e,algorithm:t,aeadAlgorithm:r,encryptionKeys:i,passwords:n,format:a="armored",wildcard:s=!1,encryptionKeyIDs:o=[],date:c=new Date,encryptionUserIDs:u=[],config:h,...f}){if(yf(h={...ne,...h}),function(e,t){if(!Y.isUint8Array(e))throw Error("Parameter ["+(t||"data")+"] must be of type Uint8Array")}(e),function(e,t){if(!Y.isString(e))throw Error("Parameter ["+(t||"data")+"] must be of type String")}(t,"algorithm"),lf(a),i=gf(i),n=gf(n),o=gf(o),u=gf(u),f.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encryptSessionKey, pass `encryptionKeys` instead");const d=Object.keys(f);if(d.length>0)throw Error("Unknown option: "+d.join(", "));if(!(i&&0!==i.length||n&&0!==n.length))throw Error("No encryption keys or passwords provided.");try{return wf(await Oh.encryptSessionKey(e,t,r,i,n,s,o,c,u,h),a,h)}catch(e){throw Y.wrapError("Error encrypting session key",e)}}async function hf({message:e,decryptionKeys:t,passwords:r,date:i=new Date,config:n,...a}){if(yf(n={...ne,...n}),ff(e),t=gf(t),r=gf(r),a.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decryptSessionKeys, pass `decryptionKeys` instead");const s=Object.keys(a);if(s.length>0)throw Error("Unknown option: "+s.join(", "));try{return await e.decryptSessionKeys(t,r,i,n)}catch(e){throw Y.wrapError("Error decrypting session keys",e)}}function ff(e){if(!(e instanceof Oh))throw Error("Parameter [message] needs to be of type Message")}function df(e){if(!(e instanceof Jh||e instanceof Oh))throw Error("Parameter [message] needs to be of type Message or CleartextMessage")}function lf(e){if("armored"!==e&&"binary"!==e&&"object"!==e)throw Error("Unsupported format "+e)}const pf=Object.keys(ne).length;function yf(e){const t=Object.keys(e);if(t.length!==pf)for(const e of t)if(void 0===ne[e])throw Error("Unknown config property: "+e)}function gf(e){return e&&!Y.isArray(e)&&(e=[e]),e}async function bf(e,t,r="utf8"){const i=Y.isStream(e);return"array"===i?q(e):"node"===t?(e=g(e),"binary"!==r&&e.setEncoding(r),e):"web"===t&&"ponyfill"===i?v(e):e}function mf(e,t){e.data=T(t.packets.stream,(async(t,r)=>{await x(e.data,r,{preventClose:!0});const i=D(r);try{await q(t,(e=>e)),await i.close()}catch(e){await i.abort(e)}}))}function wf(e,t,r){switch(t){case"object":return e;case"armored":return e.armor(r);case"binary":return e.write();default:throw Error("Unsupported format "+t)}}const Af="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:e=>`Symbol(${e})`;function vf(){}const _f="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;function kf(e){return"object"==typeof e&&null!==e||"function"==typeof e}const Ef=vf,Sf=Promise,Cf=Promise.prototype.then,If=Promise.resolve.bind(Sf),Bf=Promise.reject.bind(Sf);function Pf(e){return new Sf(e)}function Mf(e){return If(e)}function Df(e){return Bf(e)}function xf(e,t,r){return Cf.call(e,t,r)}function Kf(e,t,r){xf(xf(e,t,r),void 0,Ef)}function Uf(e,t){Kf(e,t)}function Rf(e,t){Kf(e,void 0,t)}function Tf(e,t,r){return xf(e,t,r)}function Qf(e){xf(e,void 0,Ef)}const zf=(()=>{const e=_f&&_f.queueMicrotask;if("function"==typeof e)return e;const t=Mf(void 0);return e=>xf(t,e)})();function Ff(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function Lf(e,t,r){try{return Mf(Ff(e,t,r))}catch(e){return Df(e)}}class Nf{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){const t=this._back;let r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size}shift(){const e=this._front;let t=e;const r=this._cursor;let i=r+1;const n=e._elements,a=n[r];return 16384===i&&(t=e._next,i=0),--this._size,this._cursor=i,e!==t&&(this._front=t),n[r]=void 0,a}forEach(e){let t=this._cursor,r=this._front,i=r._elements;for(;!(t===i.length&&void 0===r._next||t===i.length&&(r=r._next,i=r._elements,t=0,0===i.length));)e(i[t]),++t}peek(){const e=this._front,t=this._cursor;return e._elements[t]}}function qf(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?Gf(e):"closed"===t._state?function(e){Gf(e),Jf(e)}(e):Wf(e,t._storedError)}function Of(e,t){return Cp(e._ownerReadableStream,t)}function Hf(e){"readable"===e._ownerReadableStream._state?Vf(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,t){Wf(e,t)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function jf(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function Gf(e){e._closedPromise=Pf(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function Wf(e,t){Gf(e),Vf(e,t)}function Vf(e,t){void 0!==e._closedPromise_reject&&(Qf(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function Jf(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}const Yf=Af("[[AbortSteps]]"),Zf=Af("[[ErrorSteps]]"),Xf=Af("[[CancelSteps]]"),$f=Af("[[PullSteps]]"),ed=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},td=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function rd(e,t){if(void 0!==e&&("object"!=typeof(r=e)&&"function"!=typeof r))throw new TypeError(t+" is not an object.");var r}function id(e,t){if("function"!=typeof e)throw new TypeError(t+" is not a function.")}function nd(e,t){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError(t+" is not an object.")}function ad(e,t,r){if(void 0===e)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}function sd(e,t,r){if(void 0===e)throw new TypeError(`${t} is required in '${r}'.`)}function od(e){return Number(e)}function cd(e){return 0===e?0:e}function ud(e,t){const r=Number.MAX_SAFE_INTEGER;let i=Number(e);if(i=cd(i),!ed(i))throw new TypeError(t+" is not a finite number");if(i=function(e){return cd(td(e))}(i),i<0||i>r)throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return ed(i)&&0!==i?i:0}function hd(e,t){if(!Ep(e))throw new TypeError(t+" is not a ReadableStream.")}function fd(e){return new gd(e)}function dd(e,t){e._reader._readRequests.push(t)}function ld(e,t,r){const i=e._reader._readRequests.shift();r?i._closeSteps():i._chunkSteps(t)}function pd(e){return e._reader._readRequests.length}function yd(e){const t=e._reader;return void 0!==t&&!!bd(t)}class gd{constructor(e){if(ad(e,1,"ReadableStreamDefaultReader"),hd(e,"First parameter"),Sp(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");qf(this,e),this._readRequests=new Nf}get closed(){return bd(this)?this._closedPromise:Df(wd("closed"))}cancel(e=undefined){return bd(this)?void 0===this._ownerReadableStream?Df(jf("cancel")):Of(this,e):Df(wd("cancel"))}read(){if(!bd(this))return Df(wd("read"));if(void 0===this._ownerReadableStream)return Df(jf("read from"));let e,t;const r=Pf(((r,i)=>{e=r,t=i}));return md(this,{_chunkSteps:t=>e({value:t,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:e=>t(e)}),r}releaseLock(){if(!bd(this))throw wd("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Hf(this)}}}function bd(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function md(e,t){const r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[$f](t)}function wd(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}let Ad;Object.defineProperties(gd.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(gd.prototype,Af.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof Af.asyncIterator&&(Ad={[Af.asyncIterator](){return this}},Object.defineProperty(Ad,Af.asyncIterator,{enumerable:!1}));class vd{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){const e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?Tf(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){const t=()=>this._returnSteps(e);return this._ongoingPromise?Tf(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const e=this._reader;if(void 0===e._ownerReadableStream)return Df(jf("iterate"));let t,r;const i=Pf(((e,i)=>{t=e,r=i}));return md(e,{_chunkSteps:e=>{this._ongoingPromise=void 0,zf((()=>t({value:e,done:!1})))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Hf(e),t({value:void 0,done:!0})},_errorSteps:t=>{this._ongoingPromise=void 0,this._isFinished=!0,Hf(e),r(t)}}),i}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;const t=this._reader;if(void 0===t._ownerReadableStream)return Df(jf("finish iterating"));if(!this._preventCancel){const r=Of(t,e);return Hf(t),Tf(r,(()=>({value:e,done:!0})))}return Hf(t),Mf({value:e,done:!0})}}const _d={next(){return kd(this)?this._asyncIteratorImpl.next():Df(Ed("next"))},return(e){return kd(this)?this._asyncIteratorImpl.return(e):Df(Ed("return"))}};function kd(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl")}function Ed(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}void 0!==Ad&&Object.setPrototypeOf(_d,Ad);const Sd=Number.isNaN||function(e){return e!=e};function Cd(e){return!!function(e){if("number"!=typeof e)return!1;if(Sd(e))return!1;if(e<0)return!1;return!0}(e)&&e!==1/0}function Id(e){const t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function Bd(e,t,r){if(!Cd(r=Number(r)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function Pd(e){e._queue=new Nf,e._queueTotalSize=0}function Md(e){return e.slice()}class Dd{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Ud(this))throw Yd("view");return this._view}respond(e){if(!Ud(this))throw Yd("respond");if(ad(e,1,"respond"),e=ud(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(e,t){if(t=Number(t),!Cd(t))throw new RangeError("bytesWritten must be a finite");Hd(e,t)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!Ud(this))throw Yd("respondWithNewView");if(ad(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");!function(e,t){const r=e._pendingPullIntos.peek();if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==t.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=t.buffer,Hd(e,t.byteLength)}(this._associatedReadableByteStreamController,e)}}Object.defineProperties(Dd.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(Dd.prototype,Af.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class xd{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Kd(this))throw Zd("byobRequest");if(null===this._byobRequest&&this._pendingPullIntos.length>0){const e=this._pendingPullIntos.peek(),t=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),r=Object.create(Dd.prototype);!function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}(r,this,t),this._byobRequest=r}return this._byobRequest}get desiredSize(){if(!Kd(this))throw Zd("desiredSize");return Vd(this)}close(){if(!Kd(this))throw Zd("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);!function(e){const t=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==t._state)return;if(e._queueTotalSize>0)return void(e._closeRequested=!0);if(e._pendingPullIntos.length>0){if(e._pendingPullIntos.peek().bytesFilled>0){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Wd(e,t),t}}Gd(e),Ip(t)}(this)}enqueue(e){if(!Kd(this))throw Zd("enqueue");if(ad(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");const t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);!function(e,t){const r=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==r._state)return;const i=t.buffer,n=t.byteOffset,a=t.byteLength,s=i;if(yd(r))if(0===pd(r))zd(e,s,n,a);else{ld(r,new Uint8Array(s,n,a),!1)}else el(r)?(zd(e,s,n,a),Od(e)):zd(e,s,n,a);Rd(e)}(this,e)}error(e=undefined){if(!Kd(this))throw Zd("error");Wd(this,e)}[Xf](e){if(this._pendingPullIntos.length>0){this._pendingPullIntos.peek().bytesFilled=0}Pd(this);const t=this._cancelAlgorithm(e);return Gd(this),t}[$f](e){const t=this._controlledReadableByteStream;if(this._queueTotalSize>0){const t=this._queue.shift();this._queueTotalSize-=t.byteLength,Nd(this);const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);return void e._chunkSteps(r)}const r=this._autoAllocateChunkSize;if(void 0!==r){let t;try{t=new ArrayBuffer(r)}catch(t){return void e._errorSteps(t)}const i={buffer:t,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}dd(t,e),Rd(this)}}function Kd(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function Ud(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function Rd(e){const t=function(e){const t=e._controlledReadableByteStream;if("readable"!==t._state)return!1;if(e._closeRequested)return!1;if(!e._started)return!1;if(yd(t)&&pd(t)>0)return!0;if(el(t)&&$d(t)>0)return!0;const r=Vd(e);if(r>0)return!0;return!1}(e);if(!t)return;if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0;Kf(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Rd(e))}),(t=>{Wd(e,t)}))}function Td(e,t){let r=!1;"closed"===e._state&&(r=!0);const i=Qd(t);"default"===t.readerType?ld(e,i,r):function(e,t,r){const i=e._reader,n=i._readIntoRequests.shift();r?n._closeSteps(t):n._chunkSteps(t)}(e,i,r)}function Qd(e){const t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function zd(e,t,r,i){e._queue.push({buffer:t,byteOffset:r,byteLength:i}),e._queueTotalSize+=i}function Fd(e,t){const r=t.elementSize,i=t.bytesFilled-t.bytesFilled%r,n=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),a=t.bytesFilled+n,s=a-a%r;let o=n,c=!1;s>i&&(o=s-t.bytesFilled,c=!0);const u=e._queue;for(;o>0;){const r=u.peek(),i=Math.min(o,r.byteLength),n=t.byteOffset+t.bytesFilled;h=t.buffer,f=n,d=r.buffer,l=r.byteOffset,p=i,new Uint8Array(h).set(new Uint8Array(d,l,p),f),r.byteLength===i?u.shift():(r.byteOffset+=i,r.byteLength-=i),e._queueTotalSize-=i,Ld(e,i,t),o-=i}var h,f,d,l,p;return c}function Ld(e,t,r){qd(e),r.bytesFilled+=t}function Nd(e){0===e._queueTotalSize&&e._closeRequested?(Gd(e),Ip(e._controlledReadableByteStream)):Rd(e)}function qd(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Od(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;const t=e._pendingPullIntos.peek();Fd(e,t)&&(jd(e),Td(e._controlledReadableByteStream,t))}}function Hd(e,t){const r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(e,t){t.buffer=t.buffer;const r=e._controlledReadableByteStream;if(el(r))for(;$d(r)>0;)Td(r,jd(e))}(e,r)}else!function(e,t,r){if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range");if(Ld(e,t,r),r.bytesFilled<r.elementSize)return;jd(e);const i=r.bytesFilled%r.elementSize;if(i>0){const t=r.byteOffset+r.bytesFilled,n=r.buffer.slice(t-i,t);zd(e,n,0,n.byteLength)}r.buffer=r.buffer,r.bytesFilled-=i,Td(e._controlledReadableByteStream,r),Od(e)}(e,t,r);Rd(e)}function jd(e){const t=e._pendingPullIntos.shift();return qd(e),t}function Gd(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Wd(e,t){const r=e._controlledReadableByteStream;"readable"===r._state&&(!function(e){qd(e),e._pendingPullIntos=new Nf}(e),Pd(e),Gd(e),Bp(r,t))}function Vd(e){const t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function Jd(e,t,r){const i=Object.create(xd.prototype);let n=()=>{},a=()=>Mf(void 0),s=()=>Mf(void 0);void 0!==t.start&&(n=()=>t.start(i)),void 0!==t.pull&&(a=()=>t.pull(i)),void 0!==t.cancel&&(s=e=>t.cancel(e));const o=t.autoAllocateChunkSize;if(0===o)throw new TypeError("autoAllocateChunkSize must be greater than 0");!function(e,t,r,i,n,a,s){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,Pd(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=a,t._pullAlgorithm=i,t._cancelAlgorithm=n,t._autoAllocateChunkSize=s,t._pendingPullIntos=new Nf,e._readableStreamController=t,Kf(Mf(r()),(()=>{t._started=!0,Rd(t)}),(e=>{Wd(t,e)}))}(e,i,n,a,s,r,o)}function Yd(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function Zd(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function Xd(e,t){e._reader._readIntoRequests.push(t)}function $d(e){return e._reader._readIntoRequests.length}function el(e){const t=e._reader;return void 0!==t&&!!rl(t)}Object.defineProperties(xd.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(xd.prototype,Af.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class tl{constructor(e){if(ad(e,1,"ReadableStreamBYOBReader"),hd(e,"First parameter"),Sp(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Kd(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");qf(this,e),this._readIntoRequests=new Nf}get closed(){return rl(this)?this._closedPromise:Df(il("closed"))}cancel(e=undefined){return rl(this)?void 0===this._ownerReadableStream?Df(jf("cancel")):Of(this,e):Df(il("cancel"))}read(e){if(!rl(this))return Df(il("read"));if(!ArrayBuffer.isView(e))return Df(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return Df(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return Df(new TypeError("view's buffer must have non-zero byteLength"));if(void 0===this._ownerReadableStream)return Df(jf("read from"));let t,r;const i=Pf(((e,i)=>{t=e,r=i}));return function(e,t,r){const i=e._ownerReadableStream;i._disturbed=!0,"errored"===i._state?r._errorSteps(i._storedError):function(e,t,r){const i=e._controlledReadableByteStream;let n=1;t.constructor!==DataView&&(n=t.constructor.BYTES_PER_ELEMENT);const a=t.constructor,s={buffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:n,viewConstructor:a,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(s),void Xd(i,r);if("closed"!==i._state){if(e._queueTotalSize>0){if(Fd(e,s)){const t=Qd(s);return Nd(e),void r._chunkSteps(t)}if(e._closeRequested){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");return Wd(e,t),void r._errorSteps(t)}}e._pendingPullIntos.push(s),Xd(i,r),Rd(e)}else{const e=new a(s.buffer,s.byteOffset,0);r._closeSteps(e)}}(i._readableStreamController,t,r)}(this,e,{_chunkSteps:e=>t({value:e,done:!1}),_closeSteps:e=>t({value:e,done:!0}),_errorSteps:e=>r(e)}),i}releaseLock(){if(!rl(this))throw il("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Hf(this)}}}function rl(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function il(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function nl(e,t){const{highWaterMark:r}=e;if(void 0===r)return t;if(Sd(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function al(e){const{size:t}=e;return t||(()=>1)}function sl(e,t){rd(e,t);const r=null==e?void 0:e.highWaterMark,i=null==e?void 0:e.size;return{highWaterMark:void 0===r?void 0:od(r),size:void 0===i?void 0:ol(i,t+" has member 'size' that")}}function ol(e,t){return id(e,t),t=>od(e(t))}function cl(e,t,r){return id(e,r),r=>Lf(e,t,[r])}function ul(e,t,r){return id(e,r),()=>Lf(e,t,[])}function hl(e,t,r){return id(e,r),r=>Ff(e,t,[r])}function fl(e,t,r){return id(e,r),(r,i)=>Lf(e,t,[r,i])}function dl(e,t){if(!gl(e))throw new TypeError(t+" is not a WritableStream.")}Object.defineProperties(tl.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(tl.prototype,Af.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});class ll{constructor(e={},t={}){void 0===e?e=null:nd(e,"First parameter");const r=sl(t,"Second parameter"),i=function(e,t){rd(e,t);const r=null==e?void 0:e.abort,i=null==e?void 0:e.close,n=null==e?void 0:e.start,a=null==e?void 0:e.type,s=null==e?void 0:e.write;return{abort:void 0===r?void 0:cl(r,e,t+" has member 'abort' that"),close:void 0===i?void 0:ul(i,e,t+" has member 'close' that"),start:void 0===n?void 0:hl(n,e,t+" has member 'start' that"),write:void 0===s?void 0:fl(s,e,t+" has member 'write' that"),type:a}}(e,"First parameter");yl(this);if(void 0!==i.type)throw new RangeError("Invalid type is specified");const n=al(r);!function(e,t,r,i){const n=Object.create(Ul.prototype);let a=()=>{},s=()=>Mf(void 0),o=()=>Mf(void 0),c=()=>Mf(void 0);void 0!==t.start&&(a=()=>t.start(n));void 0!==t.write&&(s=e=>t.write(e,n));void 0!==t.close&&(o=()=>t.close());void 0!==t.abort&&(c=e=>t.abort(e));Rl(e,n,a,s,o,c,r,i)}(this,i,nl(r,1),n)}get locked(){if(!gl(this))throw ql("locked");return bl(this)}abort(e=undefined){return gl(this)?bl(this)?Df(new TypeError("Cannot abort a stream that already has a writer")):ml(this,e):Df(ql("abort"))}close(){return gl(this)?bl(this)?Df(new TypeError("Cannot close a stream that already has a writer")):kl(this)?Df(new TypeError("Cannot close an already-closing stream")):wl(this):Df(ql("close"))}getWriter(){if(!gl(this))throw ql("getWriter");return pl(this)}}function pl(e){return new Cl(e)}function yl(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new Nf,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function gl(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function bl(e){return void 0!==e._writer}function ml(e,t){const r=e._state;if("closed"===r||"errored"===r)return Mf(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;let i=!1;"erroring"===r&&(i=!0,t=void 0);const n=Pf(((r,n)=>{e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:n,_reason:t,_wasAlreadyErroring:i}}));return e._pendingAbortRequest._promise=n,i||vl(e,t),n}function wl(e){const t=e._state;if("closed"===t||"errored"===t)return Df(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));const r=Pf(((t,r)=>{const i={_resolve:t,_reject:r};e._closeRequest=i})),i=e._writer;var n;return void 0!==i&&e._backpressure&&"writable"===t&&$l(i),Bd(n=e._writableStreamController,Kl,0),zl(n),r}function Al(e,t){"writable"!==e._state?_l(e):vl(e,t)}function vl(e,t){const r=e._writableStreamController;e._state="erroring",e._storedError=t;const i=e._writer;void 0!==i&&Ml(i,t),!function(e){if(void 0===e._inFlightWriteRequest&&void 0===e._inFlightCloseRequest)return!1;return!0}(e)&&r._started&&_l(e)}function _l(e){e._state="errored",e._writableStreamController[Zf]();const t=e._storedError;if(e._writeRequests.forEach((e=>{e._reject(t)})),e._writeRequests=new Nf,void 0===e._pendingAbortRequest)return void El(e);const r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void El(e);Kf(e._writableStreamController[Yf](r._reason),(()=>{r._resolve(),El(e)}),(t=>{r._reject(t),El(e)}))}function kl(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function El(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);const t=e._writer;void 0!==t&&Wl(t,e._storedError)}function Sl(e,t){const r=e._writer;void 0!==r&&t!==e._backpressure&&(t?function(e){Jl(e)}(r):$l(r)),e._backpressure=t}Object.defineProperties(ll.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(ll.prototype,Af.toStringTag,{value:"WritableStream",configurable:!0});class Cl{constructor(e){if(ad(e,1,"WritableStreamDefaultWriter"),dl(e,"First parameter"),bl(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;const t=e._state;if("writable"===t)!kl(e)&&e._backpressure?Jl(this):Zl(this),jl(this);else if("erroring"===t)Yl(this,e._storedError),jl(this);else if("closed"===t)Zl(this),jl(r=this),Vl(r);else{const t=e._storedError;Yl(this,t),Gl(this,t)}var r}get closed(){return Il(this)?this._closedPromise:Df(Ol("closed"))}get desiredSize(){if(!Il(this))throw Ol("desiredSize");if(void 0===this._ownerWritableStream)throw Hl("desiredSize");return function(e){const t=e._ownerWritableStream,r=t._state;if("errored"===r||"erroring"===r)return null;if("closed"===r)return 0;return Ql(t._writableStreamController)}(this)}get ready(){return Il(this)?this._readyPromise:Df(Ol("ready"))}abort(e=undefined){return Il(this)?void 0===this._ownerWritableStream?Df(Hl("abort")):function(e,t){const r=e._ownerWritableStream;return ml(r,t)}(this,e):Df(Ol("abort"))}close(){if(!Il(this))return Df(Ol("close"));const e=this._ownerWritableStream;return void 0===e?Df(Hl("close")):kl(e)?Df(new TypeError("Cannot close an already-closing stream")):Bl(this)}releaseLock(){if(!Il(this))throw Ol("releaseLock");void 0!==this._ownerWritableStream&&Dl(this)}write(e=undefined){return Il(this)?void 0===this._ownerWritableStream?Df(Hl("write to")):xl(this,e):Df(Ol("write"))}}function Il(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function Bl(e){return wl(e._ownerWritableStream)}function Pl(e,t){"pending"===e._closedPromiseState?Wl(e,t):function(e,t){Gl(e,t)}(e,t)}function Ml(e,t){"pending"===e._readyPromiseState?Xl(e,t):function(e,t){Yl(e,t)}(e,t)}function Dl(e){const t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Ml(e,r),Pl(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function xl(e,t){const r=e._ownerWritableStream,i=r._writableStreamController,n=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return Fl(e,t),1}}(i,t);if(r!==e._ownerWritableStream)return Df(Hl("write to"));const a=r._state;if("errored"===a)return Df(r._storedError);if(kl(r)||"closed"===a)return Df(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===a)return Df(r._storedError);const s=function(e){return Pf(((t,r)=>{const i={_resolve:t,_reject:r};e._writeRequests.push(i)}))}(r);return function(e,t,r){try{Bd(e,t,r)}catch(t){return void Fl(e,t)}const i=e._controlledWritableStream;if(!kl(i)&&"writable"===i._state){Sl(i,Ll(e))}zl(e)}(i,t,n),s}Object.defineProperties(Cl.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(Cl.prototype,Af.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const Kl={};class Ul{constructor(){throw new TypeError("Illegal constructor")}error(e=undefined){if(!function(e){if(!kf(e))return!1;if(!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream"))return!1;return!0}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&Nl(this,e)}[Yf](e){const t=this._abortAlgorithm(e);return Tl(this),t}[Zf](){Pd(this)}}function Rl(e,t,r,i,n,a,s,o){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,Pd(t),t._started=!1,t._strategySizeAlgorithm=o,t._strategyHWM=s,t._writeAlgorithm=i,t._closeAlgorithm=n,t._abortAlgorithm=a;const c=Ll(t);Sl(e,c);Kf(Mf(r()),(()=>{t._started=!0,zl(t)}),(r=>{t._started=!0,Al(e,r)}))}function Tl(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Ql(e){return e._strategyHWM-e._queueTotalSize}function zl(e){const t=e._controlledWritableStream;if(!e._started)return;if(void 0!==t._inFlightWriteRequest)return;if("erroring"===t._state)return void _l(t);if(0===e._queue.length)return;const r=e._queue.peek().value;r===Kl?function(e){const t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),Id(e);const r=e._closeAlgorithm();Tl(e),Kf(r,(()=>{!function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";const t=e._writer;void 0!==t&&Vl(t)}(t)}),(e=>{!function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),Al(e,t)}(t,e)}))}(e):function(e,t){const r=e._controlledWritableStream;!function(e){e._inFlightWriteRequest=e._writeRequests.shift()}(r);const i=e._writeAlgorithm(t);Kf(i,(()=>{!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);const t=r._state;if(Id(e),!kl(r)&&"writable"===t){const t=Ll(e);Sl(r,t)}zl(e)}),(t=>{"writable"===r._state&&Tl(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,Al(e,t)}(r,t)}))}(e,r)}function Fl(e,t){"writable"===e._controlledWritableStream._state&&Nl(e,t)}function Ll(e){return Ql(e)<=0}function Nl(e,t){const r=e._controlledWritableStream;Tl(e),vl(r,t)}function ql(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function Ol(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function Hl(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function jl(e){e._closedPromise=Pf(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function Gl(e,t){jl(e),Wl(e,t)}function Wl(e,t){void 0!==e._closedPromise_reject&&(Qf(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function Vl(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function Jl(e){e._readyPromise=Pf(((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function Yl(e,t){Jl(e),Xl(e,t)}function Zl(e){Jl(e),$l(e)}function Xl(e,t){void 0!==e._readyPromise_reject&&(Qf(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function $l(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(Ul.prototype,{error:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(Ul.prototype,Af.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const ep="undefined"!=typeof DOMException?DOMException:void 0;const tp=function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}(ep)?ep:function(){const e=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return Object.defineProperty(e.prototype=Object.create(Error.prototype),"constructor",{value:e,writable:!0,configurable:!0}),e}();function rp(e,t,r,i,n,a){const s=fd(e),o=pl(t);e._disturbed=!0;let c=!1,u=Mf(void 0);return Pf(((h,f)=>{let d;if(void 0!==a){if(d=()=>{const r=new tp("Aborted","AbortError"),a=[];i||a.push((()=>"writable"===t._state?ml(t,r):Mf(void 0))),n||a.push((()=>"readable"===e._state?Cp(e,r):Mf(void 0))),y((()=>Promise.all(a.map((e=>e())))),!0,r)},a.aborted)return void d();a.addEventListener("abort",d)}if(p(e,s._closedPromise,(e=>{i?g(!0,e):y((()=>ml(t,e)),!0,e)})),p(t,o._closedPromise,(t=>{n?g(!0,t):y((()=>Cp(e,t)),!0,t)})),function(e,t,r){"closed"===e._state?r():Uf(t,r)}(e,s._closedPromise,(()=>{r?g():y((()=>function(e){const t=e._ownerWritableStream,r=t._state;return kl(t)||"closed"===r?Mf(void 0):"errored"===r?Df(t._storedError):Bl(e)}(o)))})),kl(t)||"closed"===t._state){const t=new TypeError("the destination writable stream closed before all data could be piped to it");n?g(!0,t):y((()=>Cp(e,t)),!0,t)}function l(){const e=u;return xf(u,(()=>e!==u?l():void 0))}function p(e,t,r){"errored"===e._state?r(e._storedError):Rf(t,r)}function y(e,r,i){function n(){Kf(e(),(()=>b(r,i)),(e=>b(!0,e)))}c||(c=!0,"writable"!==t._state||kl(t)?n():Uf(l(),n))}function g(e,r){c||(c=!0,"writable"!==t._state||kl(t)?b(e,r):Uf(l(),(()=>b(e,r))))}function b(e,t){Dl(o),Hf(s),void 0!==a&&a.removeEventListener("abort",d),e?f(t):h(void 0)}Qf(Pf(((e,t)=>{!function r(i){i?e():xf(c?Mf(!0):xf(o._readyPromise,(()=>Pf(((e,t)=>{md(s,{_chunkSteps:t=>{u=xf(xl(o,t),void 0,vf),e(!1)},_closeSteps:()=>e(!0),_errorSteps:t})})))),r,t)}(!1)})))}))}class ip{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!np(this))throw pp("desiredSize");return fp(this)}close(){if(!np(this))throw pp("close");if(!dp(this))throw new TypeError("The stream is not in a state that permits close");cp(this)}enqueue(e=undefined){if(!np(this))throw pp("enqueue");if(!dp(this))throw new TypeError("The stream is not in a state that permits enqueue");return up(this,e)}error(e=undefined){if(!np(this))throw pp("error");hp(this,e)}[Xf](e){Pd(this);const t=this._cancelAlgorithm(e);return op(this),t}[$f](e){const t=this._controlledReadableStream;if(this._queue.length>0){const r=Id(this);this._closeRequested&&0===this._queue.length?(op(this),Ip(t)):ap(this),e._chunkSteps(r)}else dd(t,e),ap(this)}}function np(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function ap(e){if(!sp(e))return;if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0;Kf(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,ap(e))}),(t=>{hp(e,t)}))}function sp(e){const t=e._controlledReadableStream;if(!dp(e))return!1;if(!e._started)return!1;if(Sp(t)&&pd(t)>0)return!0;return fp(e)>0}function op(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function cp(e){if(!dp(e))return;const t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(op(e),Ip(t))}function up(e,t){if(!dp(e))return;const r=e._controlledReadableStream;if(Sp(r)&&pd(r)>0)ld(r,t,!1);else{let r;try{r=e._strategySizeAlgorithm(t)}catch(t){throw hp(e,t),t}try{Bd(e,t,r)}catch(t){throw hp(e,t),t}}ap(e)}function hp(e,t){const r=e._controlledReadableStream;"readable"===r._state&&(Pd(e),op(e),Bp(r,t))}function fp(e){const t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function dp(e){const t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function lp(e,t,r,i,n,a,s){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,Pd(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=s,t._strategyHWM=a,t._pullAlgorithm=i,t._cancelAlgorithm=n,e._readableStreamController=t;Kf(Mf(r()),(()=>{t._started=!0,ap(t)}),(e=>{hp(t,e)}))}function pp(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function yp(e,t,r){return id(e,r),r=>Lf(e,t,[r])}function gp(e,t,r){return id(e,r),r=>Lf(e,t,[r])}function bp(e,t,r){return id(e,r),r=>Ff(e,t,[r])}function mp(e,t){if("bytes"!==(e=""+e))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function wp(e,t){if("byob"!==(e=""+e))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Ap(e,t){rd(e,t);const r=null==e?void 0:e.preventAbort,i=null==e?void 0:e.preventCancel,n=null==e?void 0:e.preventClose,a=null==e?void 0:e.signal;return void 0!==a&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw new TypeError(t+" is not an AbortSignal.")}(a,t+" has member 'signal' that"),{preventAbort:!!r,preventCancel:!!i,preventClose:!!n,signal:a}}Object.defineProperties(ip.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(ip.prototype,Af.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class vp{constructor(e={},t={}){void 0===e?e=null:nd(e,"First parameter");const r=sl(t,"Second parameter"),i=function(e,t){rd(e,t);const r=e,i=null==r?void 0:r.autoAllocateChunkSize,n=null==r?void 0:r.cancel,a=null==r?void 0:r.pull,s=null==r?void 0:r.start,o=null==r?void 0:r.type;return{autoAllocateChunkSize:void 0===i?void 0:ud(i,t+" has member 'autoAllocateChunkSize' that"),cancel:void 0===n?void 0:yp(n,r,t+" has member 'cancel' that"),pull:void 0===a?void 0:gp(a,r,t+" has member 'pull' that"),start:void 0===s?void 0:bp(s,r,t+" has member 'start' that"),type:void 0===o?void 0:mp(o,t+" has member 'type' that")}}(e,"First parameter");if(kp(this),"bytes"===i.type){if(void 0!==r.size)throw new RangeError("The strategy for a byte stream cannot have a size function");Jd(this,i,nl(r,0))}else{const e=al(r);!function(e,t,r,i){const n=Object.create(ip.prototype);let a=()=>{},s=()=>Mf(void 0),o=()=>Mf(void 0);void 0!==t.start&&(a=()=>t.start(n)),void 0!==t.pull&&(s=()=>t.pull(n)),void 0!==t.cancel&&(o=e=>t.cancel(e)),lp(e,n,a,s,o,r,i)}(this,i,nl(r,1),e)}}get locked(){if(!Ep(this))throw Pp("locked");return Sp(this)}cancel(e=undefined){return Ep(this)?Sp(this)?Df(new TypeError("Cannot cancel a stream that already has a reader")):Cp(this,e):Df(Pp("cancel"))}getReader(e=undefined){if(!Ep(this))throw Pp("getReader");const t=function(e,t){rd(e,t);const r=null==e?void 0:e.mode;return{mode:void 0===r?void 0:wp(r,t+" has member 'mode' that")}}(e,"First parameter");return void 0===t.mode?fd(this):function(e){return new tl(e)}(this)}pipeThrough(e,t={}){if(!Ep(this))throw Pp("pipeThrough");ad(e,1,"pipeThrough");const r=function(e,t){rd(e,t);const r=null==e?void 0:e.readable;sd(r,"readable","ReadableWritablePair"),hd(r,t+" has member 'readable' that");const i=null==e?void 0:e.writable;return sd(i,"writable","ReadableWritablePair"),dl(i,t+" has member 'writable' that"),{readable:r,writable:i}}(e,"First parameter"),i=Ap(t,"Second parameter");if(Sp(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(bl(r.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Qf(rp(this,r.writable,i.preventClose,i.preventAbort,i.preventCancel,i.signal)),r.readable}pipeTo(e,t={}){if(!Ep(this))return Df(Pp("pipeTo"));if(void 0===e)return Df("Parameter 1 is required in 'pipeTo'.");if(!gl(e))return Df(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let r;try{r=Ap(t,"Second parameter")}catch(e){return Df(e)}return Sp(this)?Df(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):bl(e)?Df(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):rp(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!Ep(this))throw Pp("tee");const e=function(e,t){const r=fd(e);let i,n,a,s,o,c=!1,u=!1,h=!1;const f=Pf((e=>{o=e}));function d(){return c||(c=!0,md(r,{_chunkSteps:e=>{zf((()=>{c=!1;const t=e,r=e;u||up(a._readableStreamController,t),h||up(s._readableStreamController,r)}))},_closeSteps:()=>{c=!1,u||cp(a._readableStreamController),h||cp(s._readableStreamController),u&&h||o(void 0)},_errorSteps:()=>{c=!1}})),Mf(void 0)}function l(){}return a=_p(l,d,(function(t){if(u=!0,i=t,h){const t=Md([i,n]),r=Cp(e,t);o(r)}return f})),s=_p(l,d,(function(t){if(h=!0,n=t,u){const t=Md([i,n]),r=Cp(e,t);o(r)}return f})),Rf(r._closedPromise,(e=>{hp(a._readableStreamController,e),hp(s._readableStreamController,e),u&&h||o(void 0)})),[a,s]}(this);return Md(e)}values(e=undefined){if(!Ep(this))throw Pp("values");return function(e,t){const r=fd(e),i=new vd(r,t),n=Object.create(_d);return n._asyncIteratorImpl=i,n}(this,function(e,t){return rd(e,t),{preventCancel:!!(null==e?void 0:e.preventCancel)}}(e,"First parameter").preventCancel)}}function _p(e,t,r,i=1,n=(()=>1)){const a=Object.create(vp.prototype);kp(a);return lp(a,Object.create(ip.prototype),e,t,r,i,n),a}function kp(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function Ep(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function Sp(e){return void 0!==e._reader}function Cp(e,t){if(e._disturbed=!0,"closed"===e._state)return Mf(void 0);if("errored"===e._state)return Df(e._storedError);Ip(e);return Tf(e._readableStreamController[Xf](t),vf)}function Ip(e){e._state="closed";const t=e._reader;void 0!==t&&(Jf(t),bd(t)&&(t._readRequests.forEach((e=>{e._closeSteps()})),t._readRequests=new Nf))}function Bp(e,t){e._state="errored",e._storedError=t;const r=e._reader;void 0!==r&&(Vf(r,t),bd(r)?(r._readRequests.forEach((e=>{e._errorSteps(t)})),r._readRequests=new Nf):(r._readIntoRequests.forEach((e=>{e._errorSteps(t)})),r._readIntoRequests=new Nf))}function Pp(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function Mp(e,t){rd(e,t);const r=null==e?void 0:e.highWaterMark;return sd(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:od(r)}}Object.defineProperties(vp.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(vp.prototype,Af.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof Af.asyncIterator&&Object.defineProperty(vp.prototype,Af.asyncIterator,{value:vp.prototype.values,writable:!0,configurable:!0});const Dp=function(e){return e.byteLength};class xp{constructor(e){ad(e,1,"ByteLengthQueuingStrategy"),e=Mp(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Up(this))throw Kp("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Up(this))throw Kp("size");return Dp}}function Kp(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Up(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")}Object.defineProperties(xp.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(xp.prototype,Af.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});const Rp=function(){return 1};class Tp{constructor(e){ad(e,1,"CountQueuingStrategy"),e=Mp(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!zp(this))throw Qp("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!zp(this))throw Qp("size");return Rp}}function Qp(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function zp(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")}function Fp(e,t,r){return id(e,r),r=>Lf(e,t,[r])}function Lp(e,t,r){return id(e,r),r=>Ff(e,t,[r])}function Np(e,t,r){return id(e,r),(r,i)=>Lf(e,t,[r,i])}Object.defineProperties(Tp.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(Tp.prototype,Af.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class qp{constructor(e={},t={},r={}){void 0===e&&(e=null);const i=sl(t,"Second parameter"),n=sl(r,"Third parameter"),a=function(e,t){rd(e,t);const r=null==e?void 0:e.flush,i=null==e?void 0:e.readableType,n=null==e?void 0:e.start,a=null==e?void 0:e.transform,s=null==e?void 0:e.writableType;return{flush:void 0===r?void 0:Fp(r,e,t+" has member 'flush' that"),readableType:i,start:void 0===n?void 0:Lp(n,e,t+" has member 'start' that"),transform:void 0===a?void 0:Np(a,e,t+" has member 'transform' that"),writableType:s}}(e,"First parameter");if(void 0!==a.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==a.writableType)throw new RangeError("Invalid writableType specified");const s=nl(n,0),o=al(n),c=nl(i,1),u=al(i);let h;!function(e,t,r,i,n,a){function s(){return t}function o(t){return function(e,t){const r=e._transformStreamController;if(e._backpressure){return Tf(e._backpressureChangePromise,(()=>{const i=e._writable;if("erroring"===i._state)throw i._storedError;return Zp(r,t)}))}return Zp(r,t)}(e,t)}function c(t){return function(e,t){return Hp(e,t),Mf(void 0)}(e,t)}function u(){return function(e){const t=e._readable,r=e._transformStreamController,i=r._flushAlgorithm();return Jp(r),Tf(i,(()=>{if("errored"===t._state)throw t._storedError;cp(t._readableStreamController)}),(r=>{throw Hp(e,r),t._storedError}))}(e)}function h(){return function(e){return Gp(e,!1),e._backpressureChangePromise}(e)}function f(t){return jp(e,t),Mf(void 0)}e._writable=function(e,t,r,i,n=1,a=(()=>1)){const s=Object.create(ll.prototype);return yl(s),Rl(s,Object.create(Ul.prototype),e,t,r,i,n,a),s}(s,o,u,c,r,i),e._readable=_p(s,h,f,n,a),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,Gp(e,!0),e._transformStreamController=void 0}(this,Pf((e=>{h=e})),c,u,s,o),function(e,t){const r=Object.create(Wp.prototype);let i=e=>{try{return Yp(r,e),Mf(void 0)}catch(e){return Df(e)}},n=()=>Mf(void 0);void 0!==t.transform&&(i=e=>t.transform(e,r));void 0!==t.flush&&(n=()=>t.flush(r));!function(e,t,r,i){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=i}(e,r,i,n)}(this,a),void 0!==a.start?h(a.start(this._transformStreamController)):h(void 0)}get readable(){if(!Op(this))throw $p("readable");return this._readable}get writable(){if(!Op(this))throw $p("writable");return this._writable}}function Op(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function Hp(e,t){hp(e._readable._readableStreamController,t),jp(e,t)}function jp(e,t){Jp(e._transformStreamController),Fl(e._writable._writableStreamController,t),e._backpressure&&Gp(e,!1)}function Gp(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=Pf((t=>{e._backpressureChangePromise_resolve=t})),e._backpressure=t}Object.defineProperties(qp.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(qp.prototype,Af.toStringTag,{value:"TransformStream",configurable:!0});class Wp{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Vp(this))throw Xp("desiredSize");return fp(this._controlledTransformStream._readable._readableStreamController)}enqueue(e=undefined){if(!Vp(this))throw Xp("enqueue");Yp(this,e)}error(e=undefined){if(!Vp(this))throw Xp("error");var t;t=e,Hp(this._controlledTransformStream,t)}terminate(){if(!Vp(this))throw Xp("terminate");!function(e){const t=e._controlledTransformStream,r=t._readable._readableStreamController;cp(r);jp(t,new TypeError("TransformStream terminated"))}(this)}}function Vp(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function Jp(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Yp(e,t){const r=e._controlledTransformStream,i=r._readable._readableStreamController;if(!dp(i))throw new TypeError("Readable side is not in a state that permits enqueue");try{up(i,t)}catch(e){throw jp(r,e),r._readable._storedError}const n=function(e){return!sp(e)}(i);n!==r._backpressure&&Gp(r,!0)}function Zp(e,t){return Tf(e._transformAlgorithm(t),void 0,(t=>{throw Hp(e._controlledTransformStream,t),t}))}function Xp(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function $p(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(Wp.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(Wp.prototype,Af.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var ey=/*#__PURE__*/Object.freeze({__proto__:null,ByteLengthQueuingStrategy:xp,CountQueuingStrategy:Tp,ReadableByteStreamController:xd,ReadableStream:vp,ReadableStreamBYOBReader:tl,ReadableStreamBYOBRequest:Dd,ReadableStreamDefaultController:ip,ReadableStreamDefaultReader:gd,TransformStream:qp,TransformStreamDefaultController:Wp,WritableStream:ll,WritableStreamDefaultController:Ul,WritableStreamDefaultWriter:Cl}),ty=function(e,t){return ty=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},ty(e,t)};
|
|
1
|
+
/*! OpenPGP.js v5.11.1 - 2024-04-10 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
|
|
2
|
+
const e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Symbol("doneWritingPromise"),r=Symbol("doneWritingResolve"),i=Symbol("doneWritingReject"),n=Symbol("readingIndex");class a extends Array{constructor(){super(),this[t]=new Promise(((e,t)=>{this[r]=e,this[i]=t})),this[t].catch((()=>{}))}}function s(e){return e&&e.getReader&&Array.isArray(e)}function o(e){if(!s(e)){const t=e.getWriter(),r=t.releaseLock;return t.releaseLock=()=>{t.closed.catch((function(){})),r.call(t)},t}this.stream=e}a.prototype.getReader=function(){return void 0===this[n]&&(this[n]=0),{read:async()=>(await this[t],this[n]===this.length?{value:void 0,done:!0}:{value:this[this[n]++],done:!1})}},a.prototype.readToEnd=async function(e){await this[t];const r=e(this.slice(this[n]));return this.length=0,r},a.prototype.clone=function(){const e=new a;return e[t]=this[t].then((()=>{e.push(...this)})),e},o.prototype.write=async function(e){this.stream.push(e)},o.prototype.close=async function(){this.stream[r]()},o.prototype.abort=async function(e){return this.stream[i](e),e},o.prototype.releaseLock=function(){};const c="object"==typeof e.process&&"object"==typeof e.process.versions,u=c&&void 0;function h(t){return s(t)?"array":e.ReadableStream&&e.ReadableStream.prototype.isPrototypeOf(t)?"web":_&&_.prototype.isPrototypeOf(t)?"ponyfill":u&&u.prototype.isPrototypeOf(t)?"node":!(!t||!t.getReader)&&"web-like"}function f(e){return Uint8Array.prototype.isPrototypeOf(e)}function d(e){if(1===e.length)return e[0];let t=0;for(let r=0;r<e.length;r++){if(!f(e[r]))throw Error("concatUint8Array: Data must be in the form of a Uint8Array");t+=e[r].length}const r=new Uint8Array(t);let i=0;return e.forEach((function(e){r.set(e,i),i+=e.length})),r}const l=c&&void 0,p=c&&void 0;let y,g;if(p){y=function(e){let t=!1;return new _({start(r){e.pause(),e.on("data",(i=>{t||(l.isBuffer(i)&&(i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),r.enqueue(i),e.pause())})),e.on("end",(()=>{t||r.close()})),e.on("error",(e=>r.error(e)))},pull(){e.resume()},cancel(r){t=!0,e.destroy(r)}})};class e extends p{constructor(e,t){super(t),this._reader=M(e)}async _read(e){try{for(;;){const{done:e,value:t}=await this._reader.read();if(e){this.push(null);break}if(!this.push(t))break}}catch(e){this.destroy(e)}}async _destroy(e,t){this._reader.cancel(e).then(t,t)}}g=function(t,r){return new e(t,r)}}const b=new WeakSet,m=Symbol("externalBuffer");function w(e){if(this.stream=e,e[m]&&(this[m]=e[m].slice()),s(e)){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{},void(this._cancel=async()=>{})}let t=h(e);if("node"===t&&(e=y(e)),t){const t=e.getReader();return this._read=t.read.bind(t),this._releaseLock=()=>{t.closed.catch((function(){})),t.releaseLock()},void(this._cancel=t.cancel.bind(t))}let r=!1;this._read=async()=>r||b.has(e)?{value:void 0,done:!0}:(r=!0,{value:e,done:!1}),this._releaseLock=()=>{if(r)try{b.add(e)}catch(e){}}}w.prototype.read=async function(){if(this[m]&&this[m].length){return{done:!1,value:this[m].shift()}}return this._read()},w.prototype.releaseLock=function(){this[m]&&(this.stream[m]=this[m]),this._releaseLock()},w.prototype.cancel=function(e){return this._cancel(e)},w.prototype.readLine=async function(){let e,t=[];for(;!e;){let{done:r,value:i}=await this.read();if(i+="",r)return t.length?P(t):void 0;const n=i.indexOf("\n")+1;n&&(e=P(t.concat(i.substr(0,n))),t=[]),n!==i.length&&t.push(i.substr(n))}return this.unshift(...t),e},w.prototype.readByte=async function(){const{done:e,value:t}=await this.read();if(e)return;const r=t[0];return this.unshift(N(t,1)),r},w.prototype.readBytes=async function(e){const t=[];let r=0;for(;;){const{done:i,value:n}=await this.read();if(i)return t.length?P(t):void 0;if(t.push(n),r+=n.length,r>=e){const r=P(t);return this.unshift(N(r,e)),N(r,0,e)}}},w.prototype.peekBytes=async function(e){const t=await this.readBytes(e);return this.unshift(t),t},w.prototype.unshift=function(...e){this[m]||(this[m]=[]),1===e.length&&f(e[0])&&this[m].length&&e[0].length&&this[m][0].byteOffset>=e[0].length?this[m][0]=new Uint8Array(this[m][0].buffer,this[m][0].byteOffset-e[0].length,this[m][0].byteLength+e[0].length):this[m].unshift(...e.filter((e=>e&&e.length)))},w.prototype.readToEnd=async function(e=P){const t=[];for(;;){const{done:e,value:r}=await this.read();if(e)break;t.push(r)}return e(t)};let A,v,{ReadableStream:_,WritableStream:k,TransformStream:E}=e;async function S(){if(E)return;const[t,r]=await Promise.all([Promise.resolve().then((function(){return ey})),Promise.resolve().then((function(){return vy}))]);({ReadableStream:_,WritableStream:k,TransformStream:E}=t);const{createReadableStreamWrapper:i}=r;e.ReadableStream&&_!==e.ReadableStream&&(A=i(_),v=i(e.ReadableStream))}const C=c&&void 0;function I(e){let t=h(e);return"node"===t?y(e):"web"===t&&A?A(e):t?e:new _({start(t){t.enqueue(e),t.close()}})}function B(e){if(h(e))return e;const t=new a;return(async()=>{const r=D(t);await r.write(e),await r.close()})(),t}function P(e){return e.some((e=>h(e)&&!s(e)))?function(e){e=e.map(I);const t=U((async function(e){await Promise.all(i.map((t=>O(t,e))))}));let r=Promise.resolve();const i=e.map(((i,n)=>T(i,((i,a)=>(r=r.then((()=>x(i,t.writable,{preventClose:n!==e.length-1}))),r)))));return t.readable}(e):e.some((e=>s(e)))?function(e){const t=new a;let r=Promise.resolve();return e.forEach(((i,n)=>(r=r.then((()=>x(i,t,{preventClose:n!==e.length-1}))),r))),t}(e):"string"==typeof e[0]?e.join(""):C&&C.isBuffer(e[0])?C.concat(e):d(e)}function M(e){return new w(e)}function D(e){return new o(e)}async function x(e,t,{preventClose:r=!1,preventAbort:i=!1,preventCancel:n=!1}={}){if(h(e)&&!s(e)){e=I(e);try{if(e[m]){const r=D(t);for(let t=0;t<e[m].length;t++)await r.ready,await r.write(e[m][t]);r.releaseLock()}await e.pipeTo(t,{preventClose:r,preventAbort:i,preventCancel:n})}catch(e){}return}const a=M(e=B(e)),o=D(t);try{for(;;){await o.ready;const{done:e,value:t}=await a.read();if(e){r||await o.close();break}await o.write(t)}}catch(e){i||await o.abort(e)}finally{a.releaseLock(),o.releaseLock()}}function K(e,t){const r=new E(t);return x(e,r.writable),r.readable}function U(e){let t,r,i=!1;return{readable:new _({start(e){r=e},pull(){t?t():i=!0},cancel:e},{highWaterMark:0}),writable:new k({write:async function(e){r.enqueue(e),i?i=!1:(await new Promise((e=>{t=e})),t=null)},close:r.close.bind(r),abort:r.error.bind(r)})}}function R(e,t=(()=>{}),r=(()=>{})){if(s(e)){const i=new a;return(async()=>{const n=D(i);try{const i=await q(e),a=t(i),s=r();let o;o=void 0!==a&&void 0!==s?P([a,s]):void 0!==a?a:s,await n.write(o),await n.close()}catch(e){await n.abort(e)}})(),i}if(h(e))return K(e,{async transform(e,r){try{const i=await t(e);void 0!==i&&r.enqueue(i)}catch(e){r.error(e)}},async flush(e){try{const t=await r();void 0!==t&&e.enqueue(t)}catch(t){e.error(t)}}});const i=t(e),n=r();return void 0!==i&&void 0!==n?P([i,n]):void 0!==i?i:n}function T(e,t){if(h(e)&&!s(e)){let r;const i=new E({start(e){r=e}}),n=x(e,i.writable),a=U((async function(e){r.error(e),await n,await new Promise(setTimeout)}));return t(i.readable,a.writable),a.readable}e=B(e);const r=new a;return t(e,r),r}function Q(e,t){let r;const i=T(e,((e,n)=>{const a=M(e);a.remainder=()=>(a.releaseLock(),x(e,n),i),r=t(a)}));return r}function z(e){if(s(e))return e.clone();if(h(e)){const t=function(e){if(s(e))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(h(e)){const t=I(e).tee();return t[0][m]=t[1][m]=e[m],t}return[N(e),N(e)]}(e);return L(e,t[0]),t[1]}return N(e)}function F(e){return s(e)?z(e):h(e)?new _({start(t){const r=T(e,(async(e,r)=>{const i=M(e),n=D(r);try{for(;;){await n.ready;const{done:e,value:r}=await i.read();if(e){try{t.close()}catch(e){}return void await n.close()}try{t.enqueue(r)}catch(e){}await n.write(r)}}catch(e){t.error(e),await n.abort(e)}}));L(e,r)}}):N(e)}function L(e,t){Object.entries(Object.getOwnPropertyDescriptors(e.constructor.prototype)).forEach((([r,i])=>{"constructor"!==r&&(i.value?i.value=i.value.bind(t):i.get=i.get.bind(t),Object.defineProperty(e,r,i))}))}function N(e,t=0,r=1/0){if(s(e))throw Error("Not implemented");if(h(e)){if(t>=0&&r>=0){let i=0;return K(e,{transform(e,n){i<r?(i+e.length>=t&&n.enqueue(N(e,Math.max(t-i,0),r-i)),i+=e.length):n.terminate()}})}if(t<0&&(r<0||r===1/0)){let i=[];return R(e,(e=>{e.length>=-t?i=[e]:i.push(e)}),(()=>N(P(i),t,r)))}if(0===t&&r<0){let i;return R(e,(e=>{const n=i?P([i,e]):e;if(n.length>=-r)return i=N(n,r),N(n,t,r);i=n}))}return console.warn(`stream.slice(input, ${t}, ${r}) not implemented efficiently.`),H((async()=>N(await q(e),t,r)))}return e[m]&&(e=P(e[m].concat([e]))),!f(e)||C&&C.isBuffer(e)?e.slice(t,r):(r===1/0&&(r=e.length),e.subarray(t,r))}async function q(e,t=P){return s(e)?e.readToEnd(t):h(e)?M(e).readToEnd(t):e}async function O(e,t){if(h(e)){if(e.cancel)return e.cancel(t);if(e.destroy)return e.destroy(t),await new Promise(setTimeout),t}}function H(e){const t=new a;return(async()=>{const r=D(t);try{await r.write(await e()),await r.close()}catch(e){await r.abort(e)}})(),t}class j{constructor(e){if(void 0===e)throw Error("Invalid BigInteger input");if(e instanceof Uint8Array){const t=e,r=Array(t.length);for(let e=0;e<t.length;e++){const i=t[e].toString(16);r[e]=t[e]<=15?"0"+i:i}this.value=BigInt("0x0"+r.join(""))}else this.value=BigInt(e)}clone(){return new j(this.value)}iinc(){return this.value++,this}inc(){return this.clone().iinc()}idec(){return this.value--,this}dec(){return this.clone().idec()}iadd(e){return this.value+=e.value,this}add(e){return this.clone().iadd(e)}isub(e){return this.value-=e.value,this}sub(e){return this.clone().isub(e)}imul(e){return this.value*=e.value,this}mul(e){return this.clone().imul(e)}imod(e){return this.value%=e.value,this.isNegative()&&this.iadd(e),this}mod(e){return this.clone().imod(e)}modExp(e,t){if(t.isZero())throw Error("Modulo cannot be zero");if(t.isOne())return new j(0);if(e.isNegative())throw Error("Unsopported negative exponent");let r=e.value,i=this.value;i%=t.value;let n=BigInt(1);for(;r>BigInt(0);){const e=r&BigInt(1);r>>=BigInt(1);const a=n*i%t.value;n=e?a:n,i=i*i%t.value}return new j(n)}modInv(e){const{gcd:t,x:r}=this._egcd(e);if(!t.isOne())throw Error("Inverse does not exist");return r.add(e).mod(e)}_egcd(e){let t=BigInt(0),r=BigInt(1),i=BigInt(1),n=BigInt(0),a=this.value;for(e=e.value;e!==BigInt(0);){const s=a/e;let o=t;t=i-s*t,i=o,o=r,r=n-s*r,n=o,o=e,e=a%e,a=o}return{x:new j(i),y:new j(n),gcd:new j(a)}}gcd(e){let t=this.value;for(e=e.value;e!==BigInt(0);){const r=e;e=t%e,t=r}return new j(t)}ileftShift(e){return this.value<<=e.value,this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value>>=e.value,this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value===e.value}lt(e){return this.value<e.value}lte(e){return this.value<=e.value}gt(e){return this.value>e.value}gte(e){return this.value>=e.value}isZero(){return this.value===BigInt(0)}isOne(){return this.value===BigInt(1)}isNegative(){return this.value<BigInt(0)}isEven(){return!(this.value&BigInt(1))}abs(){const e=this.clone();return this.isNegative()&&(e.value=-e.value),e}toString(){return this.value.toString()}toNumber(){const e=Number(this.value);if(e>Number.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return e}getBit(e){return(this.value>>BigInt(e)&BigInt(1))===BigInt(0)?0:1}bitLength(){const e=new j(0),t=new j(1),r=new j(-1),i=this.isNegative()?r:e;let n=1;const a=this.clone();for(;!a.irightShift(t).equal(i);)n++;return n}byteLength(){const e=new j(0),t=new j(-1),r=this.isNegative()?t:e,i=new j(8);let n=1;const a=this.clone();for(;!a.irightShift(i).equal(r);)n++;return n}toUint8Array(e="be",t){let r=this.value.toString(16);r.length%2==1&&(r="0"+r);const i=r.length/2,n=new Uint8Array(t||i),a=t?t-i:0;let s=0;for(;s<i;)n[s+a]=parseInt(r.slice(2*s,2*s+2),16),s++;return"be"!==e&&n.reverse(),n}}const G=()=>"undefined"!=typeof BigInt;const W=Symbol("byValue");var V={curve:{p256:"p256","P-256":"p256",secp256r1:"p256",prime256v1:"p256","1.2.840.10045.3.1.7":"p256","2a8648ce3d030107":"p256","2A8648CE3D030107":"p256",p384:"p384","P-384":"p384",secp384r1:"p384","1.3.132.0.34":"p384","2b81040022":"p384","2B81040022":"p384",p521:"p521","P-521":"p521",secp521r1:"p521","1.3.132.0.35":"p521","2b81040023":"p521","2B81040023":"p521",secp256k1:"secp256k1","1.3.132.0.10":"secp256k1","2b8104000a":"secp256k1","2B8104000A":"secp256k1",ed25519Legacy:"ed25519",ED25519:"ed25519",ed25519:"ed25519",Ed25519:"ed25519","1.3.6.1.4.1.11591.15.1":"ed25519","2b06010401da470f01":"ed25519","2B06010401DA470F01":"ed25519",curve25519Legacy:"curve25519",X25519:"curve25519",cv25519:"curve25519",curve25519:"curve25519",Curve25519:"curve25519","1.3.6.1.4.1.3029.1.5.1":"curve25519","2b060104019755010501":"curve25519","2B060104019755010501":"curve25519",brainpoolP256r1:"brainpoolP256r1","1.3.36.3.3.2.8.1.1.7":"brainpoolP256r1","2b2403030208010107":"brainpoolP256r1","2B2403030208010107":"brainpoolP256r1",brainpoolP384r1:"brainpoolP384r1","1.3.36.3.3.2.8.1.1.11":"brainpoolP384r1","2b240303020801010b":"brainpoolP384r1","2B240303020801010B":"brainpoolP384r1",brainpoolP512r1:"brainpoolP512r1","1.3.36.3.3.2.8.1.1.13":"brainpoolP512r1","2b240303020801010d":"brainpoolP512r1","2B240303020801010D":"brainpoolP512r1"},kdfFlags:{replace_fingerprint:1,replace_kdf_params:2},s2k:{simple:0,salted:1,iterated:3,argon2:4,gnu:101},publicKey:{rsaEncryptSign:1,rsaEncrypt:2,rsaSign:3,elgamal:16,dsa:17,ecdh:18,ecdsa:19,eddsaLegacy:22,ed25519Legacy:22,eddsa:22,aedh:23,aedsa:24,x25519:25,x448:26,ed25519:27,ed448:28,aead:100,hmac:101},symmetric:{plaintext:0,idea:1,tripledes:2,cast5:3,blowfish:4,aes128:7,aes192:8,aes256:9,twofish:10},compression:{uncompressed:0,zip:1,zlib:2,bzip2:3},hash:{md5:1,sha1:2,ripemd:3,sha256:8,sha384:9,sha512:10,sha224:11},webHash:{"SHA-1":2,"SHA-256":8,"SHA-384":9,"SHA-512":10},aead:{eax:1,ocb:2,experimentalGCM:100},packet:{publicKeyEncryptedSessionKey:1,signature:2,symEncryptedSessionKey:3,onePassSignature:4,secretKey:5,publicKey:6,secretSubkey:7,compressedData:8,symmetricallyEncryptedData:9,marker:10,literalData:11,trust:12,userID:13,publicSubkey:14,userAttribute:17,symEncryptedIntegrityProtectedData:18,modificationDetectionCode:19,aeadEncryptedData:20},literal:{binary:98,text:116,utf8:117,mime:109},signature:{binary:0,text:1,standalone:2,certGeneric:16,certPersona:17,certCasual:18,certPositive:19,certRevocation:48,subkeyBinding:24,keyBinding:25,key:31,keyRevocation:32,subkeyRevocation:40,timestamp:64,thirdParty:80},signatureSubpacket:{signatureCreationTime:2,signatureExpirationTime:3,exportableCertification:4,trustSignature:5,regularExpression:6,revocable:7,keyExpirationTime:9,placeholderBackwardsCompatibility:10,preferredSymmetricAlgorithms:11,revocationKey:12,issuer:16,notationData:20,preferredHashAlgorithms:21,preferredCompressionAlgorithms:22,keyServerPreferences:23,preferredKeyServer:24,primaryUserID:25,policyURI:26,keyFlags:27,signersUserID:28,reasonForRevocation:29,features:30,signatureTarget:31,embeddedSignature:32,issuerFingerprint:33,preferredAEADAlgorithms:34},keyFlags:{certifyKeys:1,signData:2,encryptCommunication:4,encryptStorage:8,splitPrivateKey:16,authentication:32,forwardedCommunication:64,sharedPrivateKey:128},armor:{multipartSection:0,multipartLast:1,signed:2,message:3,publicKey:4,privateKey:5,signature:6},reasonForRevocation:{noReason:0,keySuperseded:1,keyCompromised:2,keyRetired:3,userIDInvalid:32},features:{modificationDetection:1,aead:2,v5Keys:4},write:function(e,t){if("number"==typeof t&&(t=this.read(e,t)),void 0!==e[t])return e[t];throw Error("Invalid enum value.")},read:function(e,t){if(e[W]||(e[W]=[],Object.entries(e).forEach((([t,r])=>{e[W][r]=t}))),void 0!==e[W][t])return e[W][t];throw Error("Invalid enum value.")}};const J=(()=>{try{return"development"===process.env.NODE_ENV}catch(e){}return!1})(),Y={isString:function(e){return"string"==typeof e||e instanceof String},isArray:function(e){return e instanceof Array},isUint8Array:f,isStream:h,readNumber:function(e){let t=0;for(let r=0;r<e.length;r++)t+=256**r*e[e.length-1-r];return t},writeNumber:function(e,t){const r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e>>8*(t-i-1)&255;return r},readDate:function(e){const t=Y.readNumber(e);return new Date(1e3*t)},writeDate:function(e){const t=Math.floor(e.getTime()/1e3);return Y.writeNumber(t,4)},normalizeDate:function(e=Date.now()){return null===e||e===1/0?e:new Date(1e3*Math.floor(+e/1e3))},readMPI:function(e){const t=(e[0]<<8|e[1])+7>>>3;return e.subarray(2,2+t)},leftPad(e,t){const r=new Uint8Array(t),i=t-e.length;return r.set(e,i),r},uint8ArrayToMPI:function(e){const t=Y.uint8ArrayBitLength(e);if(0===t)throw Error("Zero MPI");const r=e.subarray(e.length-Math.ceil(t/8)),i=new Uint8Array([(65280&t)>>8,255&t]);return Y.concatUint8Array([i,r])},uint8ArrayBitLength:function(e){let t;for(t=0;t<e.length&&0===e[t];t++);if(t===e.length)return 0;const r=e.subarray(t);return 8*(r.length-1)+Y.nbits(r[0])},hexToUint8Array:function(e){const t=new Uint8Array(e.length>>1);for(let r=0;r<e.length>>1;r++)t[r]=parseInt(e.substr(r<<1,2),16);return t},uint8ArrayToHex:function(e){const t=[],r=e.length;let i,n=0;for(;n<r;){for(i=e[n++].toString(16);i.length<2;)i="0"+i;t.push(""+i)}return t.join("")},stringToUint8Array:function(e){return R(e,(e=>{if(!Y.isString(e))throw Error("stringToUint8Array: Data must be in the form of a string");const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}))},uint8ArrayToString:function(e){const t=[],r=16384,i=(e=new Uint8Array(e)).length;for(let n=0;n<i;n+=r)t.push(String.fromCharCode.apply(String,e.subarray(n,n+r<i?n+r:i)));return t.join("")},encodeUTF8:function(e){const t=new TextEncoder("utf-8");function r(e,r=!1){return t.encode(e,{stream:!r})}return R(e,r,(()=>r("",!0)))},decodeUTF8:function(e){const t=new TextDecoder("utf-8");function r(e,r=!1){return t.decode(e,{stream:!r})}return R(e,r,(()=>r(new Uint8Array,!0)))},concat:P,concatUint8Array:d,equalsUint8Array:function(e,t){if(!Y.isUint8Array(e)||!Y.isUint8Array(t))throw Error("Data must be in the form of a Uint8Array");if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},writeChecksum:function(e){let t=0;for(let r=0;r<e.length;r++)t=t+e[r]&65535;return Y.writeNumber(t,2)},printDebug:function(e){J&&console.log("[OpenPGP.js debug]",e)},printDebugError:function(e){J&&console.error("[OpenPGP.js debug]",e)},nbits:function(e){let t=1,r=e>>>16;return 0!==r&&(e=r,t+=16),r=e>>8,0!==r&&(e=r,t+=8),r=e>>4,0!==r&&(e=r,t+=4),r=e>>2,0!==r&&(e=r,t+=2),r=e>>1,0!==r&&(e=r,t+=1),t},double:function(e){const t=new Uint8Array(e.length),r=e.length-1;for(let i=0;i<r;i++)t[i]=e[i]<<1^e[i+1]>>7;return t[r]=e[r]<<1^135*(e[0]>>7),t},shiftRight:function(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]>>=t,r>0&&(e[r]|=e[r-1]<<8-t);return e},getWebCrypto:function(){return void 0!==e&&e.crypto&&e.crypto.subtle},getBigInteger:async function(){if(G())return j;{const{default:e}=await Promise.resolve().then((function(){return Cy}));return e}},getNodeCrypto:function(){},getNodeZlib:function(){},getNodeBuffer:function(){return{}.Buffer},getHardwareConcurrency:function(){if("undefined"!=typeof navigator)return navigator.hardwareConcurrency||1;return(void 0).cpus().length},isEmailAddress:function(e){if(!Y.isString(e))return!1;return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+([a-zA-Z]{2,}[0-9]*|xn--[a-zA-Z\-0-9]+)))$/.test(e)},canonicalizeEOL:function(e){let t=!1;return R(e,(e=>{let r;t&&(e=Y.concatUint8Array([new Uint8Array([13]),e])),13===e[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;const i=[];for(let t=0;r=e.indexOf(10,t)+1,r;t=r)13!==e[r-2]&&i.push(r);if(!i.length)return e;const n=new Uint8Array(e.length+i.length);let a=0;for(let t=0;t<i.length;t++){const r=e.subarray(i[t-1]||0,i[t]);n.set(r,a),a+=r.length,n[a-1]=13,n[a]=10,a++}return n.set(e.subarray(i[i.length-1]||0),a),n}),(()=>t?new Uint8Array([13]):void 0))},nativeEOL:function(e){let t=!1;return R(e,(e=>{let r;13===(e=t&&10!==e[0]?Y.concatUint8Array([new Uint8Array([13]),e]):new Uint8Array(e))[e.length-1]?(t=!0,e=e.subarray(0,-1)):t=!1;let i=0;for(let t=0;t!==e.length;t=r){r=e.indexOf(13,t)+1,r||(r=e.length);const n=r-(10===e[r]?1:0);t&&e.copyWithin(i,t,n),i+=n-t}return e.subarray(0,i)}),(()=>t?new Uint8Array([13]):void 0))},removeTrailingSpaces:function(e){return e.split("\n").map((e=>{let t=e.length-1;for(;t>=0&&(" "===e[t]||"\t"===e[t]||"\r"===e[t]);t--);return e.substr(0,t+1)})).join("\n")},wrapError:function(e,t){if(!t)return Error(e);try{t.message=e+": "+t.message}catch(e){}return t},constructAllowedPackets:function(e){const t={};return e.forEach((e=>{if(!e.tag)throw Error("Invalid input: expected a packet class");t[e.tag]=e})),t},anyPromise:function(e){return new Promise((async(t,r)=>{let i;await Promise.all(e.map((async e=>{try{t(await e)}catch(e){i=e}}))),r(i)}))},selectUint8Array:function(e,t,r){const i=Math.max(t.length,r.length),n=new Uint8Array(i);let a=0;for(let i=0;i<n.length;i++)n[i]=t[i]&256-e|r[i]&255+e,a+=e&i<t.length|1-e&i<r.length;return n.subarray(0,a)},selectUint8:function(e,t,r){return t&256-e|r&255+e},isAES:function(e){return e===V.symmetric.aes128||e===V.symmetric.aes192||e===V.symmetric.aes256}},Z=Y.getNodeBuffer();let X,$;function ee(e){let t=new Uint8Array;return R(e,(e=>{t=Y.concatUint8Array([t,e]);const r=[],i=Math.floor(t.length/45),n=45*i,a=X(t.subarray(0,n));for(let e=0;e<i;e++)r.push(a.substr(60*e,60)),r.push("\n");return t=t.subarray(n),r.join("")}),(()=>t.length?X(t)+"\n":""))}function te(e){let t="";return R(e,(e=>{t+=e;let r=0;const i=[" ","\t","\r","\n"];for(let e=0;e<i.length;e++){const n=i[e];for(let e=t.indexOf(n);-1!==e;e=t.indexOf(n,e+1))r++}let n=t.length;for(;n>0&&(n-r)%4!=0;n--)i.includes(t[n])&&r--;const a=$(t.substr(0,n));return t=t.substr(n),a}),(()=>$(t)))}function re(e){return te(e.replace(/-/g,"+").replace(/_/g,"/"))}function ie(e,t){let r=ee(e).replace(/[\r\n]/g,"");return t&&(r=r.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")),r}Z?(X=e=>Z.from(e).toString("base64"),$=e=>{const t=Z.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}):(X=e=>btoa(Y.uint8ArrayToString(e)),$=e=>Y.stringToUint8Array(atob(e)));var ne={preferredHashAlgorithm:V.hash.sha256,preferredSymmetricAlgorithm:V.symmetric.aes256,preferredCompressionAlgorithm:V.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:V.aead.eax,aeadChunkSizeByte:12,v5Keys:!1,s2kType:V.s2k.iterated,s2kIterationCountByte:224,s2kArgon2Params:{passes:3,parallelism:4,memoryExponent:16},allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,allowForwardedMessages:!1,checksumRequired:!1,minRSABits:2047,passwordCollisionCheck:!1,revocationsExpire:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([V.symmetric.aes128,V.symmetric.aes192,V.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,additionalAllowedPackets:[],showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.11.1",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([V.hash.md5,V.hash.ripemd]),rejectMessageHashAlgorithms:new Set([V.hash.md5,V.hash.ripemd,V.hash.sha1]),rejectPublicKeyAlgorithms:new Set([V.publicKey.elgamal,V.publicKey.dsa]),rejectCurves:new Set([V.curve.secp256k1]),checkEdDSAFaultySignatures:!0};function ae(e){const t=e.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!t)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(t[1])?V.armor.multipartSection:/MESSAGE, PART \d+/.test(t[1])?V.armor.multipartLast:/SIGNED MESSAGE/.test(t[1])?V.armor.signed:/MESSAGE/.test(t[1])?V.armor.message:/PUBLIC KEY BLOCK/.test(t[1])?V.armor.publicKey:/PRIVATE KEY BLOCK/.test(t[1])?V.armor.privateKey:/SIGNATURE/.test(t[1])?V.armor.signature:void 0}function se(e,t){let r="";return t.showVersion&&(r+="Version: "+t.versionString+"\n"),t.showComment&&(r+="Comment: "+t.commentString+"\n"),e&&(r+="Comment: "+e+"\n"),r+="\n",r}function oe(e){return ee(function(e){let t=13501623;return R(e,(e=>{const r=ue?Math.floor(e.length/4):0,i=new Uint32Array(e.buffer,e.byteOffset,r);for(let e=0;e<r;e++)t^=i[e],t=ce[0][t>>24&255]^ce[1][t>>16&255]^ce[2][t>>8&255]^ce[3][t>>0&255];for(let i=4*r;i<e.length;i++)t=t>>8^ce[0][255&t^e[i]]}),(()=>new Uint8Array([t,t>>8,t>>16])))}(e))}const ce=[Array(255),Array(255),Array(255),Array(255)];for(let e=0;e<=255;e++){let t=e<<16;for(let e=0;e<8;e++)t=t<<1^(0!=(8388608&t)?8801531:0);ce[0][e]=(16711680&t)>>16|65280&t|(255&t)<<16}for(let e=0;e<=255;e++)ce[1][e]=ce[0][e]>>8^ce[0][255&ce[0][e]];for(let e=0;e<=255;e++)ce[2][e]=ce[1][e]>>8^ce[0][255&ce[1][e]];for(let e=0;e<=255;e++)ce[3][e]=ce[2][e]>>8^ce[0][255&ce[2][e]];const ue=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,255,!0),255===new Int16Array(e)[0]}();function he(e){for(let t=0;t<e.length;t++)/^([^\s:]|[^\s:][^:]*[^\s:]): .+$/.test(e[t])||Y.printDebugError(Error("Improperly formatted armor header: "+e[t])),/^(Version|Comment|MessageID|Hash|Charset): .+$/.test(e[t])||Y.printDebugError(Error("Unknown header: "+e[t]))}function fe(e){let t=e,r="";const i=e.lastIndexOf("=");return i>=0&&i!==e.length-1&&(t=e.slice(0,i),r=e.slice(i+1).substr(0,4)),{body:t,checksum:r}}function de(e,t=ne){return new Promise((async(r,i)=>{try{const n=/^-----[^-]+-----$/m,a=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let s;const o=[];let c,u,h,f=o,d=[],l=te(T(e,(async(e,t)=>{const p=M(e);try{for(;;){let e=await p.readLine();if(void 0===e)throw Error("Misformed armored text");if(e=Y.removeTrailingSpaces(e.replace(/[\r\n]/g,"")),s)if(c)u||2!==s||(n.test(e)?(d=d.join("\r\n"),u=!0,he(f),f=[],c=!1):d.push(e.replace(/^- /,"")));else if(n.test(e)&&i(Error("Mandatory blank line missing between armor headers and armor data")),a.test(e)){if(he(f),c=!0,u||2!==s){r({text:d,data:l,headers:o,type:s});break}}else f.push(e);else n.test(e)&&(s=ae(e))}}catch(e){return void i(e)}const y=D(t);try{for(;;){await y.ready;const{done:e,value:t}=await p.read();if(e)throw Error("Misformed armored text");const r=t+"";if(-1!==r.indexOf("=")||-1!==r.indexOf("-")){let e=await p.readToEnd();e.length||(e=""),e=r+e,e=Y.removeTrailingSpaces(e.replace(/\r/g,""));const t=e.split(n);if(1===t.length)throw Error("Misformed armored text");const i=fe(t[0].slice(0,-1));h=i.checksum,await y.write(i.body);break}await y.write(r)}await y.ready,await y.close()}catch(e){await y.abort(e)}})));l=T(l,(async(e,r)=>{const i=q(oe(F(e)));i.catch((()=>{})),await x(e,r,{preventClose:!0});const n=D(r);try{const e=(await i).replace("\n","");if(h!==e&&(h||t.checksumRequired))throw Error("Ascii armor integrity check failed");await n.ready,await n.close()}catch(e){await n.abort(e)}}))}catch(e){i(e)}})).then((async e=>(s(e.data)&&(e.data=await q(e.data)),e)))}function le(e,t,r,i,n,a=ne){let s,o;e===V.armor.signed&&(s=t.text,o=t.hash,t=t.data);const c=F(t),u=[];switch(e){case V.armor.multipartSection:u.push("-----BEGIN PGP MESSAGE, PART "+r+"/"+i+"-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP MESSAGE, PART "+r+"/"+i+"-----\n");break;case V.armor.multipartLast:u.push("-----BEGIN PGP MESSAGE, PART "+r+"-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP MESSAGE, PART "+r+"-----\n");break;case V.armor.signed:u.push("-----BEGIN PGP SIGNED MESSAGE-----\n"),u.push("Hash: "+o+"\n\n"),u.push(s.replace(/^-/gm,"- -")),u.push("\n-----BEGIN PGP SIGNATURE-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP SIGNATURE-----\n");break;case V.armor.message:u.push("-----BEGIN PGP MESSAGE-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP MESSAGE-----\n");break;case V.armor.publicKey:u.push("-----BEGIN PGP PUBLIC KEY BLOCK-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP PUBLIC KEY BLOCK-----\n");break;case V.armor.privateKey:u.push("-----BEGIN PGP PRIVATE KEY BLOCK-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP PRIVATE KEY BLOCK-----\n");break;case V.armor.signature:u.push("-----BEGIN PGP SIGNATURE-----\n"),u.push(se(n,a)),u.push(ee(t)),u.push("=",oe(c)),u.push("-----END PGP SIGNATURE-----\n")}return Y.concat(u)}class pe{constructor(){this.bytes=""}read(e){return this.bytes=Y.uint8ArrayToString(e.subarray(0,8)),this.bytes.length}write(){return Y.stringToUint8Array(this.bytes)}toHex(){return Y.uint8ArrayToHex(Y.stringToUint8Array(this.bytes))}equals(e,t=!1){return t&&(e.isWildcard()||this.isWildcard())||this.bytes===e.bytes}isNull(){return""===this.bytes}isWildcard(){return/^0+$/.test(this.toHex())}static mapToHex(e){return e.toHex()}static fromID(e){const t=new pe;return t.read(Y.hexToUint8Array(e)),t}static wildcard(){const e=new pe;return e.read(new Uint8Array(8)),e}}var ye=function(){var e,t,r=!1;function i(r,i){var n=e[(t[r]+t[i])%255];return 0!==r&&0!==i||(n=0),n}var n,a,s,o,c=!1;function u(){function u(r){var i,n,a;for(n=a=function(r){var i=e[255-t[r]];return 0===r&&(i=0),i}(r),i=0;i<4;i++)a^=n=255&(n<<1|n>>>7);return a^=99}r||function(){e=[],t=[];var i,n,a=1;for(i=0;i<255;i++)e[i]=a,n=128&a,a<<=1,a&=255,128===n&&(a^=27),a^=e[i],t[e[i]]=i;e[255]=e[0],t[0]=0,r=!0}(),n=[],a=[],s=[[],[],[],[]],o=[[],[],[],[]];for(var h=0;h<256;h++){var f=u(h);n[h]=f,a[f]=h,s[0][h]=i(2,f)<<24|f<<16|f<<8|i(3,f),o[0][f]=i(14,h)<<24|i(9,h)<<16|i(13,h)<<8|i(11,h);for(var d=1;d<4;d++)s[d][h]=s[d-1][h]>>>8|s[d-1][h]<<24,o[d][f]=o[d-1][f]>>>8|o[d-1][f]<<24}c=!0}var h=function(e,t){c||u();var r=new Uint32Array(t);r.set(n,512),r.set(a,768);for(var i=0;i<4;i++)r.set(s[i],4096+1024*i>>2),r.set(o[i],8192+1024*i>>2);var h=function(e,t,r){"use asm";var i=0,n=0,a=0,s=0,o=0,c=0,u=0,h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0,A=0,v=0,_=0,k=0;var E=new e.Uint32Array(r),S=new e.Uint8Array(r);function C(e,t,r,o,c,u,h,f){e=e|0;t=t|0;r=r|0;o=o|0;c=c|0;u=u|0;h=h|0;f=f|0;var d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0;d=r|0x400,l=r|0x800,p=r|0xc00;c=c^E[(e|0)>>2],u=u^E[(e|4)>>2],h=h^E[(e|8)>>2],f=f^E[(e|12)>>2];for(w=16;(w|0)<=o<<4;w=w+16|0){y=E[(r|c>>22&1020)>>2]^E[(d|u>>14&1020)>>2]^E[(l|h>>6&1020)>>2]^E[(p|f<<2&1020)>>2]^E[(e|w|0)>>2],g=E[(r|u>>22&1020)>>2]^E[(d|h>>14&1020)>>2]^E[(l|f>>6&1020)>>2]^E[(p|c<<2&1020)>>2]^E[(e|w|4)>>2],b=E[(r|h>>22&1020)>>2]^E[(d|f>>14&1020)>>2]^E[(l|c>>6&1020)>>2]^E[(p|u<<2&1020)>>2]^E[(e|w|8)>>2],m=E[(r|f>>22&1020)>>2]^E[(d|c>>14&1020)>>2]^E[(l|u>>6&1020)>>2]^E[(p|h<<2&1020)>>2]^E[(e|w|12)>>2];c=y,u=g,h=b,f=m}i=E[(t|c>>22&1020)>>2]<<24^E[(t|u>>14&1020)>>2]<<16^E[(t|h>>6&1020)>>2]<<8^E[(t|f<<2&1020)>>2]^E[(e|w|0)>>2],n=E[(t|u>>22&1020)>>2]<<24^E[(t|h>>14&1020)>>2]<<16^E[(t|f>>6&1020)>>2]<<8^E[(t|c<<2&1020)>>2]^E[(e|w|4)>>2],a=E[(t|h>>22&1020)>>2]<<24^E[(t|f>>14&1020)>>2]<<16^E[(t|c>>6&1020)>>2]<<8^E[(t|u<<2&1020)>>2]^E[(e|w|8)>>2],s=E[(t|f>>22&1020)>>2]<<24^E[(t|c>>14&1020)>>2]<<16^E[(t|u>>6&1020)>>2]<<8^E[(t|h<<2&1020)>>2]^E[(e|w|12)>>2]}function I(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;C(0x0000,0x0800,0x1000,k,e,t,r,i)}function B(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var a=0;C(0x0400,0x0c00,0x2000,k,e,i,r,t);a=n,n=s,s=a}function P(e,t,r,f){e=e|0;t=t|0;r=r|0;f=f|0;C(0x0000,0x0800,0x1000,k,o^e,c^t,u^r,h^f);o=i,c=n,u=a,h=s}function M(e,t,r,f){e=e|0;t=t|0;r=r|0;f=f|0;var d=0;C(0x0400,0x0c00,0x2000,k,e,f,r,t);d=n,n=s,s=d;i=i^o,n=n^c,a=a^u,s=s^h;o=e,c=t,u=r,h=f}function D(e,t,r,f){e=e|0;t=t|0;r=r|0;f=f|0;C(0x0000,0x0800,0x1000,k,o,c,u,h);o=i=i^e,c=n=n^t,u=a=a^r,h=s=s^f}function x(e,t,r,f){e=e|0;t=t|0;r=r|0;f=f|0;C(0x0000,0x0800,0x1000,k,o,c,u,h);i=i^e,n=n^t,a=a^r,s=s^f;o=e,c=t,u=r,h=f}function K(e,t,r,f){e=e|0;t=t|0;r=r|0;f=f|0;C(0x0000,0x0800,0x1000,k,o,c,u,h);o=i,c=n,u=a,h=s;i=i^e,n=n^t,a=a^r,s=s^f}function U(e,t,r,o){e=e|0;t=t|0;r=r|0;o=o|0;C(0x0000,0x0800,0x1000,k,f,d,l,p);p=~m&p|m&p+1;l=~b&l|b&l+((p|0)==0);d=~g&d|g&d+((l|0)==0);f=~y&f|y&f+((d|0)==0);i=i^e;n=n^t;a=a^r;s=s^o}function R(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,a=0,s=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0;e=e^o,t=t^c,r=r^u,i=i^h;n=w|0,a=A|0,s=v|0,f=_|0;for(;(g|0)<128;g=g+1|0){if(n>>>31){d=d^e,l=l^t,p=p^r,y=y^i}n=n<<1|a>>>31,a=a<<1|s>>>31,s=s<<1|f>>>31,f=f<<1;b=i&1;i=i>>>1|r<<31,r=r>>>1|t<<31,t=t>>>1|e<<31,e=e>>>1;if(b)e=e^0xe1000000}o=d,c=l,u=p,h=y}function T(e){e=e|0;k=e}function Q(e,t,r,o){e=e|0;t=t|0;r=r|0;o=o|0;i=e,n=t,a=r,s=o}function z(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;o=e,c=t,u=r,h=i}function F(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;f=e,d=t,l=r,p=i}function L(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;y=e,g=t,b=r,m=i}function N(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;p=~m&p|m&i,l=~b&l|b&r,d=~g&d|g&t,f=~y&f|y&e}function q(e){e=e|0;if(e&15)return-1;S[e|0]=i>>>24,S[e|1]=i>>>16&255,S[e|2]=i>>>8&255,S[e|3]=i&255,S[e|4]=n>>>24,S[e|5]=n>>>16&255,S[e|6]=n>>>8&255,S[e|7]=n&255,S[e|8]=a>>>24,S[e|9]=a>>>16&255,S[e|10]=a>>>8&255,S[e|11]=a&255,S[e|12]=s>>>24,S[e|13]=s>>>16&255,S[e|14]=s>>>8&255,S[e|15]=s&255;return 16}function O(e){e=e|0;if(e&15)return-1;S[e|0]=o>>>24,S[e|1]=o>>>16&255,S[e|2]=o>>>8&255,S[e|3]=o&255,S[e|4]=c>>>24,S[e|5]=c>>>16&255,S[e|6]=c>>>8&255,S[e|7]=c&255,S[e|8]=u>>>24,S[e|9]=u>>>16&255,S[e|10]=u>>>8&255,S[e|11]=u&255,S[e|12]=h>>>24,S[e|13]=h>>>16&255,S[e|14]=h>>>8&255,S[e|15]=h&255;return 16}function H(){I(0,0,0,0);w=i,A=n,v=a,_=s}function j(e,t,r){e=e|0;t=t|0;r=r|0;var o=0;if(t&15)return-1;while((r|0)>=16){W[e&7](S[t|0]<<24|S[t|1]<<16|S[t|2]<<8|S[t|3],S[t|4]<<24|S[t|5]<<16|S[t|6]<<8|S[t|7],S[t|8]<<24|S[t|9]<<16|S[t|10]<<8|S[t|11],S[t|12]<<24|S[t|13]<<16|S[t|14]<<8|S[t|15]);S[t|0]=i>>>24,S[t|1]=i>>>16&255,S[t|2]=i>>>8&255,S[t|3]=i&255,S[t|4]=n>>>24,S[t|5]=n>>>16&255,S[t|6]=n>>>8&255,S[t|7]=n&255,S[t|8]=a>>>24,S[t|9]=a>>>16&255,S[t|10]=a>>>8&255,S[t|11]=a&255,S[t|12]=s>>>24,S[t|13]=s>>>16&255,S[t|14]=s>>>8&255,S[t|15]=s&255;o=o+16|0,t=t+16|0,r=r-16|0}return o|0}function G(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t&15)return-1;while((r|0)>=16){V[e&1](S[t|0]<<24|S[t|1]<<16|S[t|2]<<8|S[t|3],S[t|4]<<24|S[t|5]<<16|S[t|6]<<8|S[t|7],S[t|8]<<24|S[t|9]<<16|S[t|10]<<8|S[t|11],S[t|12]<<24|S[t|13]<<16|S[t|14]<<8|S[t|15]);i=i+16|0,t=t+16|0,r=r-16|0}return i|0}var W=[I,B,P,M,D,x,K,U];var V=[P,R];return{set_rounds:T,set_state:Q,set_iv:z,set_nonce:F,set_mask:L,set_counter:N,get_state:q,get_iv:O,gcm_init:H,cipher:j,mac:G}}({Uint8Array,Uint32Array},e,t);return h.set_key=function(e,t,i,a,s,c,u,f,d){var l=r.subarray(0,60),p=r.subarray(256,316);l.set([t,i,a,s,c,u,f,d]);for(var y=e,g=1;y<4*e+28;y++){var b=l[y-1];(y%e==0||8===e&&y%e==4)&&(b=n[b>>>24]<<24^n[b>>>16&255]<<16^n[b>>>8&255]<<8^n[255&b]),y%e==0&&(b=b<<8^b>>>24^g<<24,g=g<<1^(128&g?27:0)),l[y]=l[y-e]^b}for(var m=0;m<y;m+=4)for(var w=0;w<4;w++){b=l[y-(4+m)+(4-w)%4];p[m+w]=m<4||m>=y-4?b:o[0][n[b>>>24]]^o[1][n[b>>>16&255]]^o[2][n[b>>>8&255]]^o[3][n[255&b]]}h.set_rounds(e+5)},h};return h.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},h.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},h.MAC={CBC:0,GCM:1},h.HEAP_DATA=16384,h}();function ge(e){return e instanceof Uint8Array}function be(e,t){const r=e?e.byteLength:t||65536;if(4095&r||r<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return e=e||new Uint8Array(new ArrayBuffer(r))}function me(e,t,r,i,n){const a=e.length-t,s=a<n?a:n;return e.set(r.subarray(i,i+s),t),s}function we(...e){const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let i=0;for(let t=0;t<e.length;t++)r.set(e[t],i),i+=e[t].length;return r}class Ae extends Error{constructor(...e){super(...e)}}class ve extends Error{constructor(...e){super(...e)}}class _e extends Error{constructor(...e){super(...e)}}const ke=[],Ee=[];class Se{constructor(e,t,r=!0,i,n,a){this.pos=0,this.len=0,this.mode=i,this.pos=0,this.len=0,this.key=e,this.iv=t,this.padding=r,this.acquire_asm(n,a)}acquire_asm(e,t){return void 0!==this.heap&&void 0!==this.asm||(this.heap=e||ke.pop()||be().subarray(ye.HEAP_DATA),this.asm=t||Ee.pop()||new ye(null,this.heap.buffer),this.reset(this.key,this.iv)),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(ke.push(this.heap),Ee.push(this.asm)),this.heap=void 0,this.asm=void 0}reset(e,t){const{asm:r}=this.acquire_asm(),i=e.length;if(16!==i&&24!==i&&32!==i)throw new ve("illegal key size");const n=new DataView(e.buffer,e.byteOffset,e.byteLength);if(r.set_key(i>>2,n.getUint32(0),n.getUint32(4),n.getUint32(8),n.getUint32(12),i>16?n.getUint32(16):0,i>16?n.getUint32(20):0,i>24?n.getUint32(24):0,i>24?n.getUint32(28):0),void 0!==t){if(16!==t.length)throw new ve("illegal iv size");let e=new DataView(t.buffer,t.byteOffset,t.byteLength);r.set_iv(e.getUint32(0),e.getUint32(4),e.getUint32(8),e.getUint32(12))}else r.set_iv(0,0,0,0)}AES_Encrypt_process(e){if(!ge(e))throw new TypeError("data isn't of expected type");let{heap:t,asm:r}=this.acquire_asm(),i=ye.ENC[this.mode],n=ye.HEAP_DATA,a=this.pos,s=this.len,o=0,c=e.length||0,u=0,h=0,f=new Uint8Array(s+c&-16);for(;c>0;)h=me(t,a+s,e,o,c),s+=h,o+=h,c-=h,h=r.cipher(i,n+a,s),h&&f.set(t.subarray(a,a+h),u),u+=h,h<s?(a+=h,s-=h):(a=0,s=0);return this.pos=a,this.len=s,f}AES_Encrypt_finish(){let{heap:e,asm:t}=this.acquire_asm(),r=ye.ENC[this.mode],i=ye.HEAP_DATA,n=this.pos,a=this.len,s=16-a%16,o=a;if(this.hasOwnProperty("padding")){if(this.padding){for(let t=0;t<s;++t)e[n+a+t]=s;a+=s,o=a}else if(a%16)throw new ve("data length must be a multiple of the block size")}else a+=s;const c=new Uint8Array(o);return a&&t.cipher(r,i+n,a),o&&c.set(e.subarray(n,n+o)),this.pos=0,this.len=0,this.release_asm(),c}AES_Decrypt_process(e){if(!ge(e))throw new TypeError("data isn't of expected type");let{heap:t,asm:r}=this.acquire_asm(),i=ye.DEC[this.mode],n=ye.HEAP_DATA,a=this.pos,s=this.len,o=0,c=e.length||0,u=0,h=s+c&-16,f=0,d=0;this.padding&&(f=s+c-h||16,h-=f);const l=new Uint8Array(h);for(;c>0;)d=me(t,a+s,e,o,c),s+=d,o+=d,c-=d,d=r.cipher(i,n+a,s-(c?0:f)),d&&l.set(t.subarray(a,a+d),u),u+=d,d<s?(a+=d,s-=d):(a=0,s=0);return this.pos=a,this.len=s,l}AES_Decrypt_finish(){let{heap:e,asm:t}=this.acquire_asm(),r=ye.DEC[this.mode],i=ye.HEAP_DATA,n=this.pos,a=this.len,s=a;if(a>0){if(a%16){if(this.hasOwnProperty("padding"))throw new ve("data length must be a multiple of the block size");a+=16-a%16}if(t.cipher(r,i+n,a),this.hasOwnProperty("padding")&&this.padding){let t=e[n+s-1];if(t<1||t>16||t>s)throw new _e("bad padding");let r=0;for(let i=t;i>1;i--)r|=t^e[n+s-i];if(r)throw new _e("bad padding");s-=t}}const o=new Uint8Array(s);return s>0&&o.set(e.subarray(n,n+s)),this.pos=0,this.len=0,this.release_asm(),o}}class Ce{static encrypt(e,t,r=!1){return new Ce(t,r).encrypt(e)}static decrypt(e,t,r=!1){return new Ce(t,r).decrypt(e)}constructor(e,t=!1,r){this.aes=r||new Se(e,void 0,t,"ECB")}encrypt(e){return we(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return we(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Ie(e){const t=function(e){const t=new Ce(e);this.encrypt=function(e){return t.encrypt(e)},this.decrypt=function(e){return t.decrypt(e)}};return t.blockSize=t.prototype.blockSize=16,t.keySize=t.prototype.keySize=e/8,t}function Be(e,t,r,i,n,a){const s=[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],o=[-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],c=[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],u=[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],h=[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],f=[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],d=[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],l=[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];let p,y,g,b,m,w,A,v,_,k,E,S,C,I,B=0,P=t.length;const M=32===e.length?3:9;v=3===M?r?[0,32,2]:[30,-2,-2]:r?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],r&&(t=function(e,t){const r=8-e.length%8;let i;if(2===t&&r<8)i=32;else if(1===t)i=r;else{if(t||!(r<8)){if(8===r)return e;throw Error("des: invalid padding")}i=0}const n=new Uint8Array(e.length+r);for(let t=0;t<e.length;t++)n[t]=e[t];for(let t=0;t<r;t++)n[e.length+t]=i;return n}(t,a),P=t.length);let D=new Uint8Array(P),x=0;for(1===i&&(_=n[B++]<<24|n[B++]<<16|n[B++]<<8|n[B++],E=n[B++]<<24|n[B++]<<16|n[B++]<<8|n[B++],B=0);B<P;){for(w=t[B++]<<24|t[B++]<<16|t[B++]<<8|t[B++],A=t[B++]<<24|t[B++]<<16|t[B++]<<8|t[B++],1===i&&(r?(w^=_,A^=E):(k=_,S=E,_=w,E=A)),g=252645135&(w>>>4^A),A^=g,w^=g<<4,g=65535&(w>>>16^A),A^=g,w^=g<<16,g=858993459&(A>>>2^w),w^=g,A^=g<<2,g=16711935&(A>>>8^w),w^=g,A^=g<<8,g=1431655765&(w>>>1^A),A^=g,w^=g<<1,w=w<<1|w>>>31,A=A<<1|A>>>31,y=0;y<M;y+=3){for(C=v[y+1],I=v[y+2],p=v[y];p!==C;p+=I)b=A^e[p],m=(A>>>4|A<<28)^e[p+1],g=w,w=A,A=g^(o[b>>>24&63]|u[b>>>16&63]|f[b>>>8&63]|l[63&b]|s[m>>>24&63]|c[m>>>16&63]|h[m>>>8&63]|d[63&m]);g=w,w=A,A=g}w=w>>>1|w<<31,A=A>>>1|A<<31,g=1431655765&(w>>>1^A),A^=g,w^=g<<1,g=16711935&(A>>>8^w),w^=g,A^=g<<8,g=858993459&(A>>>2^w),w^=g,A^=g<<2,g=65535&(w>>>16^A),A^=g,w^=g<<16,g=252645135&(w>>>4^A),A^=g,w^=g<<4,1===i&&(r?(_=w,E=A):(w^=k,A^=S)),D[x++]=w>>>24,D[x++]=w>>>16&255,D[x++]=w>>>8&255,D[x++]=255&w,D[x++]=A>>>24,D[x++]=A>>>16&255,D[x++]=A>>>8&255,D[x++]=255&A}return r||(D=function(e,t){let r,i=null;if(2===t)r=32;else if(1===t)i=e[e.length-1];else{if(t)throw Error("des: invalid padding");r=0}if(!i){for(i=1;e[e.length-i]===r;)i++;i--}return e.subarray(0,e.length-i)}(D,a)),D}function Pe(e){const t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],n=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],l=[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],y=e.length>8?3:1,g=Array(32*y),b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let m,w,A,v=0,_=0;for(let k=0;k<y;k++){let y=e[v++]<<24|e[v++]<<16|e[v++]<<8|e[v++],k=e[v++]<<24|e[v++]<<16|e[v++]<<8|e[v++];A=252645135&(y>>>4^k),k^=A,y^=A<<4,A=65535&(k>>>-16^y),y^=A,k^=A<<-16,A=858993459&(y>>>2^k),k^=A,y^=A<<2,A=65535&(k>>>-16^y),y^=A,k^=A<<-16,A=1431655765&(y>>>1^k),k^=A,y^=A<<1,A=16711935&(k>>>8^y),y^=A,k^=A<<8,A=1431655765&(y>>>1^k),k^=A,y^=A<<1,A=y<<8|k>>>20&240,y=k<<24|k<<8&16711680|k>>>8&65280|k>>>24&240,k=A;for(let e=0;e<16;e++)b[e]?(y=y<<2|y>>>26,k=k<<2|k>>>26):(y=y<<1|y>>>27,k=k<<1|k>>>27),y&=-15,k&=-15,m=t[y>>>28]|r[y>>>24&15]|i[y>>>20&15]|n[y>>>16&15]|a[y>>>12&15]|s[y>>>8&15]|o[y>>>4&15],w=c[k>>>28]|u[k>>>24&15]|h[k>>>20&15]|f[k>>>16&15]|d[k>>>12&15]|l[k>>>8&15]|p[k>>>4&15],A=65535&(w>>>16^m),g[_++]=m^A,g[_++]=w^A<<16}return g}function Me(e){this.key=[];for(let t=0;t<3;t++)this.key.push(new Uint8Array(e.subarray(8*t,8*t+8)));this.encrypt=function(e){return Be(Pe(this.key[2]),Be(Pe(this.key[1]),Be(Pe(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function De(){this.BlockSize=8,this.KeySize=16,this.setKey=function(e){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),e.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(e),!0},this.reset=function(){for(let e=0;e<16;e++)this.masking[e]=0,this.rotate[e]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(e){const t=Array(e.length);for(let a=0;a<e.length;a+=8){let s,o=e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3],c=e[a+4]<<24|e[a+5]<<16|e[a+6]<<8|e[a+7];s=c,c=o^r(c,this.masking[0],this.rotate[0]),o=s,s=c,c=o^i(c,this.masking[1],this.rotate[1]),o=s,s=c,c=o^n(c,this.masking[2],this.rotate[2]),o=s,s=c,c=o^r(c,this.masking[3],this.rotate[3]),o=s,s=c,c=o^i(c,this.masking[4],this.rotate[4]),o=s,s=c,c=o^n(c,this.masking[5],this.rotate[5]),o=s,s=c,c=o^r(c,this.masking[6],this.rotate[6]),o=s,s=c,c=o^i(c,this.masking[7],this.rotate[7]),o=s,s=c,c=o^n(c,this.masking[8],this.rotate[8]),o=s,s=c,c=o^r(c,this.masking[9],this.rotate[9]),o=s,s=c,c=o^i(c,this.masking[10],this.rotate[10]),o=s,s=c,c=o^n(c,this.masking[11],this.rotate[11]),o=s,s=c,c=o^r(c,this.masking[12],this.rotate[12]),o=s,s=c,c=o^i(c,this.masking[13],this.rotate[13]),o=s,s=c,c=o^n(c,this.masking[14],this.rotate[14]),o=s,s=c,c=o^r(c,this.masking[15],this.rotate[15]),o=s,t[a]=c>>>24&255,t[a+1]=c>>>16&255,t[a+2]=c>>>8&255,t[a+3]=255&c,t[a+4]=o>>>24&255,t[a+5]=o>>>16&255,t[a+6]=o>>>8&255,t[a+7]=255&o}return t},this.decrypt=function(e){const t=Array(e.length);for(let a=0;a<e.length;a+=8){let s,o=e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3],c=e[a+4]<<24|e[a+5]<<16|e[a+6]<<8|e[a+7];s=c,c=o^r(c,this.masking[15],this.rotate[15]),o=s,s=c,c=o^n(c,this.masking[14],this.rotate[14]),o=s,s=c,c=o^i(c,this.masking[13],this.rotate[13]),o=s,s=c,c=o^r(c,this.masking[12],this.rotate[12]),o=s,s=c,c=o^n(c,this.masking[11],this.rotate[11]),o=s,s=c,c=o^i(c,this.masking[10],this.rotate[10]),o=s,s=c,c=o^r(c,this.masking[9],this.rotate[9]),o=s,s=c,c=o^n(c,this.masking[8],this.rotate[8]),o=s,s=c,c=o^i(c,this.masking[7],this.rotate[7]),o=s,s=c,c=o^r(c,this.masking[6],this.rotate[6]),o=s,s=c,c=o^n(c,this.masking[5],this.rotate[5]),o=s,s=c,c=o^i(c,this.masking[4],this.rotate[4]),o=s,s=c,c=o^r(c,this.masking[3],this.rotate[3]),o=s,s=c,c=o^n(c,this.masking[2],this.rotate[2]),o=s,s=c,c=o^i(c,this.masking[1],this.rotate[1]),o=s,s=c,c=o^r(c,this.masking[0],this.rotate[0]),o=s,t[a]=c>>>24&255,t[a+1]=c>>>16&255,t[a+2]=c>>>8&255,t[a+3]=255&c,t[a+4]=o>>>24&255,t[a+5]=o>>16&255,t[a+6]=o>>8&255,t[a+7]=255&o}return t};const e=[,,,,];e[0]=[,,,,],e[0][0]=[4,0,13,15,12,14,8],e[0][1]=[5,2,16,18,17,19,10],e[0][2]=[6,3,23,22,21,20,9],e[0][3]=[7,1,26,25,27,24,11],e[1]=[,,,,],e[1][0]=[0,6,21,23,20,22,16],e[1][1]=[1,4,0,2,1,3,18],e[1][2]=[2,5,7,6,5,4,17],e[1][3]=[3,7,10,9,11,8,19],e[2]=[,,,,],e[2][0]=[4,0,13,15,12,14,8],e[2][1]=[5,2,16,18,17,19,10],e[2][2]=[6,3,23,22,21,20,9],e[2][3]=[7,1,26,25,27,24,11],e[3]=[,,,,],e[3][0]=[0,6,21,23,20,22,16],e[3][1]=[1,4,0,2,1,3,18],e[3][2]=[2,5,7,6,5,4,17],e[3][3]=[3,7,10,9,11,8,19];const t=[,,,,];function r(e,t,r){const i=t+e,n=i<<r|i>>>32-r;return(a[0][n>>>24]^a[1][n>>>16&255])-a[2][n>>>8&255]+a[3][255&n]}function i(e,t,r){const i=t^e,n=i<<r|i>>>32-r;return a[0][n>>>24]-a[1][n>>>16&255]+a[2][n>>>8&255]^a[3][255&n]}function n(e,t,r){const i=t-e,n=i<<r|i>>>32-r;return(a[0][n>>>24]+a[1][n>>>16&255]^a[2][n>>>8&255])-a[3][255&n]}t[0]=[,,,,],t[0][0]=[24,25,23,22,18],t[0][1]=[26,27,21,20,22],t[0][2]=[28,29,19,18,25],t[0][3]=[30,31,17,16,28],t[1]=[,,,,],t[1][0]=[3,2,12,13,8],t[1][1]=[1,0,14,15,13],t[1][2]=[7,6,8,9,3],t[1][3]=[5,4,10,11,7],t[2]=[,,,,],t[2][0]=[19,18,28,29,25],t[2][1]=[17,16,30,31,28],t[2][2]=[23,22,24,25,18],t[2][3]=[21,20,26,27,22],t[3]=[,,,,],t[3][0]=[8,9,7,6,3],t[3][1]=[10,11,5,4,7],t[3][2]=[12,13,3,2,8],t[3][3]=[14,15,1,0,13],this.keySchedule=function(r){const i=[,,,,,,,,],n=Array(32);let s;for(let e=0;e<4;e++)s=4*e,i[e]=r[s]<<24|r[s+1]<<16|r[s+2]<<8|r[s+3];const o=[6,7,4,5];let c,u=0;for(let r=0;r<2;r++)for(let r=0;r<4;r++){for(s=0;s<4;s++){const t=e[r][s];c=i[t[1]],c^=a[4][i[t[2]>>>2]>>>24-8*(3&t[2])&255],c^=a[5][i[t[3]>>>2]>>>24-8*(3&t[3])&255],c^=a[6][i[t[4]>>>2]>>>24-8*(3&t[4])&255],c^=a[7][i[t[5]>>>2]>>>24-8*(3&t[5])&255],c^=a[o[s]][i[t[6]>>>2]>>>24-8*(3&t[6])&255],i[t[0]]=c}for(s=0;s<4;s++){const e=t[r][s];c=a[4][i[e[0]>>>2]>>>24-8*(3&e[0])&255],c^=a[5][i[e[1]>>>2]>>>24-8*(3&e[1])&255],c^=a[6][i[e[2]>>>2]>>>24-8*(3&e[2])&255],c^=a[7][i[e[3]>>>2]>>>24-8*(3&e[3])&255],c^=a[4+s][i[e[4]>>>2]>>>24-8*(3&e[4])&255],n[u]=c,u++}}for(let e=0;e<16;e++)this.masking[e]=n[e],this.rotate[e]=31&n[16+e]};const a=[,,,,,,,,];a[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],a[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],a[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],a[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],a[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],a[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],a[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],a[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function xe(e){this.cast5=new De,this.cast5.setKey(e),this.encrypt=function(e){return this.cast5.encrypt(e)}}Me.keySize=Me.prototype.keySize=24,Me.blockSize=Me.prototype.blockSize=8,xe.blockSize=xe.prototype.blockSize=8,xe.keySize=xe.prototype.keySize=16;const Ke=4294967295;function Ue(e,t){return(e<<t|e>>>32-t)&Ke}function Re(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function Te(e,t,r){e.splice(t,4,255&r,r>>>8&255,r>>>16&255,r>>>24&255)}function Qe(e,t){return e>>>8*t&255}function ze(e){this.tf=function(){let e=null,t=null,r=-1,i=[],n=[[],[],[],[]];function a(e){return n[0][Qe(e,0)]^n[1][Qe(e,1)]^n[2][Qe(e,2)]^n[3][Qe(e,3)]}function s(e){return n[0][Qe(e,3)]^n[1][Qe(e,0)]^n[2][Qe(e,1)]^n[3][Qe(e,2)]}function o(e,t){let r=a(t[0]),n=s(t[1]);t[2]=Ue(t[2]^r+n+i[4*e+8]&Ke,31),t[3]=Ue(t[3],1)^r+2*n+i[4*e+9]&Ke,r=a(t[2]),n=s(t[3]),t[0]=Ue(t[0]^r+n+i[4*e+10]&Ke,31),t[1]=Ue(t[1],1)^r+2*n+i[4*e+11]&Ke}function c(e,t){let r=a(t[0]),n=s(t[1]);t[2]=Ue(t[2],1)^r+n+i[4*e+10]&Ke,t[3]=Ue(t[3]^r+2*n+i[4*e+11]&Ke,31),r=a(t[2]),n=s(t[3]),t[0]=Ue(t[0],1)^r+n+i[4*e+8]&Ke,t[1]=Ue(t[1]^r+2*n+i[4*e+9]&Ke,31)}return{name:"twofish",blocksize:16,open:function(t){let r,a,s,o,c;e=t;const u=[],h=[],f=[];let d;const l=[];let p,y,g;const b=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],m=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],w=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],A=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],v=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],_=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],k=[[],[]],E=[[],[],[],[]];function S(e){return e^e>>2^[0,90,180,238][3&e]}function C(e){return e^e>>1^e>>2^[0,238,180,90][3&e]}function I(e,t){let r,i,n;for(r=0;r<8;r++)i=t>>>24,t=t<<8&Ke|e>>>24,e=e<<8&Ke,n=i<<1,128&i&&(n^=333),t^=i^n<<16,n^=i>>>1,1&i&&(n^=166),t^=n<<24|n<<8;return t}function B(e,t){const r=t>>4,i=15&t,n=b[e][r^i],a=m[e][v[i]^_[r]];return A[e][v[a]^_[n]]<<4|w[e][n^a]}function P(e,t){let r=Qe(e,0),i=Qe(e,1),n=Qe(e,2),a=Qe(e,3);switch(d){case 4:r=k[1][r]^Qe(t[3],0),i=k[0][i]^Qe(t[3],1),n=k[0][n]^Qe(t[3],2),a=k[1][a]^Qe(t[3],3);case 3:r=k[1][r]^Qe(t[2],0),i=k[1][i]^Qe(t[2],1),n=k[0][n]^Qe(t[2],2),a=k[0][a]^Qe(t[2],3);case 2:r=k[0][k[0][r]^Qe(t[1],0)]^Qe(t[0],0),i=k[0][k[1][i]^Qe(t[1],1)]^Qe(t[0],1),n=k[1][k[0][n]^Qe(t[1],2)]^Qe(t[0],2),a=k[1][k[1][a]^Qe(t[1],3)]^Qe(t[0],3)}return E[0][r]^E[1][i]^E[2][n]^E[3][a]}for(e=e.slice(0,32),r=e.length;16!==r&&24!==r&&32!==r;)e[r++]=0;for(r=0;r<e.length;r+=4)f[r>>2]=Re(e,r);for(r=0;r<256;r++)k[0][r]=B(0,r),k[1][r]=B(1,r);for(r=0;r<256;r++)p=k[1][r],y=S(p),g=C(p),E[0][r]=p+(y<<8)+(g<<16)+(g<<24),E[2][r]=y+(g<<8)+(p<<16)+(g<<24),p=k[0][r],y=S(p),g=C(p),E[1][r]=g+(g<<8)+(y<<16)+(p<<24),E[3][r]=y+(p<<8)+(g<<16)+(y<<24);for(d=f.length/2,r=0;r<d;r++)a=f[r+r],u[r]=a,s=f[r+r+1],h[r]=s,l[d-r-1]=I(a,s);for(r=0;r<40;r+=2)a=16843009*r,s=a+16843009,a=P(a,u),s=Ue(P(s,h),8),i[r]=a+s&Ke,i[r+1]=Ue(a+2*s,9);for(r=0;r<256;r++)switch(a=s=o=c=r,d){case 4:a=k[1][a]^Qe(l[3],0),s=k[0][s]^Qe(l[3],1),o=k[0][o]^Qe(l[3],2),c=k[1][c]^Qe(l[3],3);case 3:a=k[1][a]^Qe(l[2],0),s=k[1][s]^Qe(l[2],1),o=k[0][o]^Qe(l[2],2),c=k[0][c]^Qe(l[2],3);case 2:n[0][r]=E[0][k[0][k[0][a]^Qe(l[1],0)]^Qe(l[0],0)],n[1][r]=E[1][k[0][k[1][s]^Qe(l[1],1)]^Qe(l[0],1)],n[2][r]=E[2][k[1][k[0][o]^Qe(l[1],2)]^Qe(l[0],2)],n[3][r]=E[3][k[1][k[1][c]^Qe(l[1],3)]^Qe(l[0],3)]}},close:function(){i=[],n=[[],[],[],[]]},encrypt:function(e,n){t=e,r=n;const a=[Re(t,r)^i[0],Re(t,r+4)^i[1],Re(t,r+8)^i[2],Re(t,r+12)^i[3]];for(let e=0;e<8;e++)o(e,a);return Te(t,r,a[2]^i[4]),Te(t,r+4,a[3]^i[5]),Te(t,r+8,a[0]^i[6]),Te(t,r+12,a[1]^i[7]),r+=16,t},decrypt:function(e,n){t=e,r=n;const a=[Re(t,r)^i[4],Re(t,r+4)^i[5],Re(t,r+8)^i[6],Re(t,r+12)^i[7]];for(let e=7;e>=0;e--)c(e,a);Te(t,r,a[2]^i[0]),Te(t,r+4,a[3]^i[1]),Te(t,r+8,a[0]^i[2]),Te(t,r+12,a[1]^i[3]),r+=16},finalize:function(){return t}}}(),this.tf.open(Array.from(e),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}function Fe(){}function Le(e){this.bf=new Fe,this.bf.init(e),this.encrypt=function(e){return this.bf.encryptBlock(e)}}ze.keySize=ze.prototype.keySize=32,ze.blockSize=ze.prototype.blockSize=16,Fe.prototype.BLOCKSIZE=8,Fe.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],Fe.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],Fe.prototype.NN=16,Fe.prototype._clean=function(e){if(e<0){e=(2147483647&e)+2147483648}return e},Fe.prototype._F=function(e){let t;const r=255&e,i=255&(e>>>=8),n=255&(e>>>=8),a=255&(e>>>=8);return t=this.sboxes[0][a]+this.sboxes[1][n],t^=this.sboxes[2][i],t+=this.sboxes[3][r],t},Fe.prototype._encryptBlock=function(e){let t,r=e[0],i=e[1];for(t=0;t<this.NN;++t){r^=this.parray[t],i=this._F(r)^i;const e=r;r=i,i=e}r^=this.parray[this.NN+0],i^=this.parray[this.NN+1],e[0]=this._clean(i),e[1]=this._clean(r)},Fe.prototype.encryptBlock=function(e){let t;const r=[0,0],i=this.BLOCKSIZE/2;for(t=0;t<this.BLOCKSIZE/2;++t)r[0]=r[0]<<8|255&e[t+0],r[1]=r[1]<<8|255&e[t+i];this._encryptBlock(r);const n=[];for(t=0;t<this.BLOCKSIZE/2;++t)n[t+0]=r[0]>>>24-8*t&255,n[t+i]=r[1]>>>24-8*t&255;return n},Fe.prototype._decryptBlock=function(e){let t,r=e[0],i=e[1];for(t=this.NN+1;t>1;--t){r^=this.parray[t],i=this._F(r)^i;const e=r;r=i,i=e}r^=this.parray[1],i^=this.parray[0],e[0]=this._clean(i),e[1]=this._clean(r)},Fe.prototype.init=function(e){let t,r=0;for(this.parray=[],t=0;t<this.NN+2;++t){let i=0;for(let t=0;t<4;++t)i=i<<8|255&e[r],++r>=e.length&&(r=0);this.parray[t]=this.PARRAY[t]^i}for(this.sboxes=[],t=0;t<4;++t)for(this.sboxes[t]=[],r=0;r<256;++r)this.sboxes[t][r]=this.SBOXES[t][r];const i=[0,0];for(t=0;t<this.NN+2;t+=2)this._encryptBlock(i),this.parray[t+0]=i[0],this.parray[t+1]=i[1];for(t=0;t<4;++t)for(r=0;r<256;r+=2)this._encryptBlock(i),this.sboxes[t][r+0]=i[0],this.sboxes[t][r+1]=i[1]},Le.keySize=Le.prototype.keySize=16,Le.blockSize=Le.prototype.blockSize=8;const Ne=Ie(128),qe=Ie(192),Oe=Ie(256),He=function(e){this.key=e,this.encrypt=function(e,t){return Be(Pe(this.key),e,!0,0,null,t)},this.decrypt=function(e,t){return Be(Pe(this.key),e,!1,0,null,t)}};var je=/*#__PURE__*/Object.freeze({__proto__:null,aes128:Ne,aes192:qe,aes256:Oe,des:He,tripledes:Me,cast5:xe,twofish:ze,blowfish:Le,idea:function(){throw Error("IDEA symmetric-key algorithm not implemented")}}),Ge=function(e,t,r){"use asm";var i=0,n=0,a=0,s=0,o=0,c=0,u=0;var h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0;var A=new e.Uint8Array(r);function v(e,t,r,c,u,h,f,d,l,p,y,g,b,m,w,A){e=e|0;t=t|0;r=r|0;c=c|0;u=u|0;h=h|0;f=f|0;d=d|0;l=l|0;p=p|0;y=y|0;g=g|0;b=b|0;m=m|0;w=w|0;A=A|0;var v=0,_=0,k=0,E=0,S=0,C=0,I=0,B=0,P=0,M=0,D=0,x=0,K=0,U=0,R=0,T=0,Q=0,z=0,F=0,L=0,N=0,q=0,O=0,H=0,j=0,G=0,W=0,V=0,J=0,Y=0,Z=0,X=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,ae=0,se=0,oe=0,ce=0,ue=0,he=0,fe=0,de=0,le=0,pe=0,ye=0,ge=0,be=0,me=0,we=0,Ae=0,ve=0,_e=0,ke=0,Ee=0,Se=0,Ce=0,Ie=0,Be=0,Pe=0,Me=0,De=0,xe=0,Ke=0,Ue=0,Re=0,Te=0,Qe=0;v=i;_=n;k=a;E=s;S=o;I=e+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=t+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=r+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=c+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=u+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=h+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=f+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=d+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=l+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=p+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=y+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=g+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=b+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=m+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=w+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;I=A+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=m^l^r^e;B=C<<1|C>>>31;I=B+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=w^p^c^t;P=C<<1|C>>>31;I=P+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=A^y^u^r;M=C<<1|C>>>31;I=M+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=B^g^h^c;D=C<<1|C>>>31;I=D+(v<<5|v>>>27)+S+(_&k|~_&E)+0x5a827999|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=P^b^f^u;x=C<<1|C>>>31;I=x+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=M^m^d^h;K=C<<1|C>>>31;I=K+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=D^w^l^f;U=C<<1|C>>>31;I=U+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=x^A^p^d;R=C<<1|C>>>31;I=R+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=K^B^y^l;T=C<<1|C>>>31;I=T+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=U^P^g^p;Q=C<<1|C>>>31;I=Q+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=R^M^b^y;z=C<<1|C>>>31;I=z+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=T^D^m^g;F=C<<1|C>>>31;I=F+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Q^x^w^b;L=C<<1|C>>>31;I=L+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=z^K^A^m;N=C<<1|C>>>31;I=N+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=F^U^B^w;q=C<<1|C>>>31;I=q+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=L^R^P^A;O=C<<1|C>>>31;I=O+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=N^T^M^B;H=C<<1|C>>>31;I=H+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=q^Q^D^P;j=C<<1|C>>>31;I=j+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=O^z^x^M;G=C<<1|C>>>31;I=G+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=H^F^K^D;W=C<<1|C>>>31;I=W+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=j^L^U^x;V=C<<1|C>>>31;I=V+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=G^N^R^K;J=C<<1|C>>>31;I=J+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=W^q^T^U;Y=C<<1|C>>>31;I=Y+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=V^O^Q^R;Z=C<<1|C>>>31;I=Z+(v<<5|v>>>27)+S+(_^k^E)+0x6ed9eba1|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=J^H^z^T;X=C<<1|C>>>31;I=X+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Y^j^F^Q;$=C<<1|C>>>31;I=$+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Z^G^L^z;ee=C<<1|C>>>31;I=ee+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=X^W^N^F;te=C<<1|C>>>31;I=te+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=$^V^q^L;re=C<<1|C>>>31;I=re+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ee^J^O^N;ie=C<<1|C>>>31;I=ie+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=te^Y^H^q;ne=C<<1|C>>>31;I=ne+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=re^Z^j^O;ae=C<<1|C>>>31;I=ae+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ie^X^G^H;se=C<<1|C>>>31;I=se+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ne^$^W^j;oe=C<<1|C>>>31;I=oe+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ae^ee^V^G;ce=C<<1|C>>>31;I=ce+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=se^te^J^W;ue=C<<1|C>>>31;I=ue+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=oe^re^Y^V;he=C<<1|C>>>31;I=he+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ce^ie^Z^J;fe=C<<1|C>>>31;I=fe+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ue^ne^X^Y;de=C<<1|C>>>31;I=de+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=he^ae^$^Z;le=C<<1|C>>>31;I=le+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=fe^se^ee^X;pe=C<<1|C>>>31;I=pe+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=de^oe^te^$;ye=C<<1|C>>>31;I=ye+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=le^ce^re^ee;ge=C<<1|C>>>31;I=ge+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=pe^ue^ie^te;be=C<<1|C>>>31;I=be+(v<<5|v>>>27)+S+(_&k|_&E|k&E)-0x70e44324|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ye^he^ne^re;me=C<<1|C>>>31;I=me+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ge^fe^ae^ie;we=C<<1|C>>>31;I=we+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=be^de^se^ne;Ae=C<<1|C>>>31;I=Ae+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=me^le^oe^ae;ve=C<<1|C>>>31;I=ve+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=we^pe^ce^se;_e=C<<1|C>>>31;I=_e+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Ae^ye^ue^oe;ke=C<<1|C>>>31;I=ke+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ve^ge^he^ce;Ee=C<<1|C>>>31;I=Ee+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=_e^be^fe^ue;Se=C<<1|C>>>31;I=Se+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=ke^me^de^he;Ce=C<<1|C>>>31;I=Ce+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Ee^we^le^fe;Ie=C<<1|C>>>31;I=Ie+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Se^Ae^pe^de;Be=C<<1|C>>>31;I=Be+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Ce^ve^ye^le;Pe=C<<1|C>>>31;I=Pe+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Ie^_e^ge^pe;Me=C<<1|C>>>31;I=Me+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Be^ke^be^ye;De=C<<1|C>>>31;I=De+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Pe^Ee^me^ge;xe=C<<1|C>>>31;I=xe+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Me^Se^we^be;Ke=C<<1|C>>>31;I=Ke+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=De^Ce^Ae^me;Ue=C<<1|C>>>31;I=Ue+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=xe^Ie^ve^we;Re=C<<1|C>>>31;I=Re+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Ke^Be^_e^Ae;Te=C<<1|C>>>31;I=Te+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;C=Ue^Pe^ke^ve;Qe=C<<1|C>>>31;I=Qe+(v<<5|v>>>27)+S+(_^k^E)-0x359d3e2a|0;S=E;E=k;k=_<<30|_>>>2;_=v;v=I;i=i+v|0;n=n+_|0;a=a+k|0;s=s+E|0;o=o+S|0}function _(e){e=e|0;v(A[e|0]<<24|A[e|1]<<16|A[e|2]<<8|A[e|3],A[e|4]<<24|A[e|5]<<16|A[e|6]<<8|A[e|7],A[e|8]<<24|A[e|9]<<16|A[e|10]<<8|A[e|11],A[e|12]<<24|A[e|13]<<16|A[e|14]<<8|A[e|15],A[e|16]<<24|A[e|17]<<16|A[e|18]<<8|A[e|19],A[e|20]<<24|A[e|21]<<16|A[e|22]<<8|A[e|23],A[e|24]<<24|A[e|25]<<16|A[e|26]<<8|A[e|27],A[e|28]<<24|A[e|29]<<16|A[e|30]<<8|A[e|31],A[e|32]<<24|A[e|33]<<16|A[e|34]<<8|A[e|35],A[e|36]<<24|A[e|37]<<16|A[e|38]<<8|A[e|39],A[e|40]<<24|A[e|41]<<16|A[e|42]<<8|A[e|43],A[e|44]<<24|A[e|45]<<16|A[e|46]<<8|A[e|47],A[e|48]<<24|A[e|49]<<16|A[e|50]<<8|A[e|51],A[e|52]<<24|A[e|53]<<16|A[e|54]<<8|A[e|55],A[e|56]<<24|A[e|57]<<16|A[e|58]<<8|A[e|59],A[e|60]<<24|A[e|61]<<16|A[e|62]<<8|A[e|63])}function k(e){e=e|0;A[e|0]=i>>>24;A[e|1]=i>>>16&255;A[e|2]=i>>>8&255;A[e|3]=i&255;A[e|4]=n>>>24;A[e|5]=n>>>16&255;A[e|6]=n>>>8&255;A[e|7]=n&255;A[e|8]=a>>>24;A[e|9]=a>>>16&255;A[e|10]=a>>>8&255;A[e|11]=a&255;A[e|12]=s>>>24;A[e|13]=s>>>16&255;A[e|14]=s>>>8&255;A[e|15]=s&255;A[e|16]=o>>>24;A[e|17]=o>>>16&255;A[e|18]=o>>>8&255;A[e|19]=o&255}function E(){i=0x67452301;n=0xefcdab89;a=0x98badcfe;s=0x10325476;o=0xc3d2e1f0;c=u=0}function S(e,t,r,h,f,d,l){e=e|0;t=t|0;r=r|0;h=h|0;f=f|0;d=d|0;l=l|0;i=e;n=t;a=r;s=h;o=f;c=d;u=l}function C(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){_(e);e=e+64|0;t=t-64|0;r=r+64|0}c=c+r|0;if(c>>>0<r>>>0)u=u+1|0;return r|0}function I(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){i=C(e,t)|0;if((i|0)==-1)return-1;e=e+i|0;t=t-i|0}i=i+t|0;c=c+t|0;if(c>>>0<t>>>0)u=u+1|0;A[e|t]=0x80;if((t|0)>=56){for(n=t+1|0;(n|0)<64;n=n+1|0)A[e|n]=0x00;_(e);t=0;A[e|0]=0}for(n=t+1|0;(n|0)<59;n=n+1|0)A[e|n]=0;A[e|56]=u>>>21&255;A[e|57]=u>>>13&255;A[e|58]=u>>>5&255;A[e|59]=u<<3&255|c>>>29;A[e|60]=c>>>21&255;A[e|61]=c>>>13&255;A[e|62]=c>>>5&255;A[e|63]=c<<3&255;_(e);if(~r)k(r);return i|0}function B(){i=h;n=f;a=d;s=l;o=p;c=64;u=0}function P(){i=y;n=g;a=b;s=m;o=w;c=64;u=0}function M(e,t,r,A,_,k,S,C,I,B,P,M,D,x,K,U){e=e|0;t=t|0;r=r|0;A=A|0;_=_|0;k=k|0;S=S|0;C=C|0;I=I|0;B=B|0;P=P|0;M=M|0;D=D|0;x=x|0;K=K|0;U=U|0;E();v(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,A^0x5c5c5c5c,_^0x5c5c5c5c,k^0x5c5c5c5c,S^0x5c5c5c5c,C^0x5c5c5c5c,I^0x5c5c5c5c,B^0x5c5c5c5c,P^0x5c5c5c5c,M^0x5c5c5c5c,D^0x5c5c5c5c,x^0x5c5c5c5c,K^0x5c5c5c5c,U^0x5c5c5c5c);y=i;g=n;b=a;m=s;w=o;E();v(e^0x36363636,t^0x36363636,r^0x36363636,A^0x36363636,_^0x36363636,k^0x36363636,S^0x36363636,C^0x36363636,I^0x36363636,B^0x36363636,P^0x36363636,M^0x36363636,D^0x36363636,x^0x36363636,K^0x36363636,U^0x36363636);h=i;f=n;d=a;l=s;p=o;c=64;u=0}function D(e,t,r){e=e|0;t=t|0;r=r|0;var c=0,u=0,h=0,f=0,d=0,l=0;if(e&63)return-1;if(~r)if(r&31)return-1;l=I(e,t,-1)|0;c=i,u=n,h=a,f=s,d=o;P();v(c,u,h,f,d,0x80000000,0,0,0,0,0,0,0,0,0,672);if(~r)k(r);return l|0}function x(e,t,r,c,u){e=e|0;t=t|0;r=r|0;c=c|0;u=u|0;var h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0;if(e&63)return-1;if(~u)if(u&31)return-1;A[e+t|0]=r>>>24;A[e+t+1|0]=r>>>16&255;A[e+t+2|0]=r>>>8&255;A[e+t+3|0]=r&255;D(e,t+4|0,-1)|0;h=y=i,f=g=n,d=b=a,l=m=s,p=w=o;c=c-1|0;while((c|0)>0){B();v(y,g,b,m,w,0x80000000,0,0,0,0,0,0,0,0,0,672);y=i,g=n,b=a,m=s,w=o;P();v(y,g,b,m,w,0x80000000,0,0,0,0,0,0,0,0,0,672);y=i,g=n,b=a,m=s,w=o;h=h^i;f=f^n;d=d^a;l=l^s;p=p^o;c=c-1|0}i=h;n=f;a=d;s=l;o=p;if(~u)k(u);return 0}return{reset:E,init:S,process:C,finish:I,hmac_reset:B,hmac_init:M,hmac_finish:D,pbkdf2_generate_block:x}};class We{constructor(){this.pos=0,this.len=0}reset(){const{asm:e}=this.acquire_asm();return this.result=null,this.pos=0,this.len=0,e.reset(),this}process(e){if(null!==this.result)throw new Ae("state must be reset before processing new data");const{asm:t,heap:r}=this.acquire_asm();let i=this.pos,n=this.len,a=0,s=e.length,o=0;for(;s>0;)o=me(r,i+n,e,a,s),n+=o,a+=o,s-=o,o=t.process(i,n),i+=o,n-=o,n||(i=0);return this.pos=i,this.len=n,this}finish(){if(null!==this.result)throw new Ae("state must be reset before processing new data");const{asm:e,heap:t}=this.acquire_asm();return e.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(t.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const Ve=[],Je=[];class Ye extends We{constructor(){super(),this.NAME="sha1",this.BLOCK_SIZE=64,this.HASH_SIZE=20,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=Ve.pop()||be(),this.asm=Je.pop()||Ge({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(Ve.push(this.heap),Je.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return(new Ye).process(e).finish().result}}Ye.NAME="sha1",Ye.heap_pool=[],Ye.asm_pool=[],Ye.asm_function=Ge;const Ze=[],Xe=[];class $e extends We{constructor(){super(),this.NAME="sha256",this.BLOCK_SIZE=64,this.HASH_SIZE=32,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=Ze.pop()||be(),this.asm=Xe.pop()||function(e,t,r){"use asm";var i=0,n=0,a=0,s=0,o=0,c=0,u=0,h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0,A=0,v=0,_=0,k=0,E=0,S=0,C=0,I=0,B=0,P=new e.Uint8Array(r);function M(e,t,r,f,d,l,p,y,g,b,m,w,A,v,_,k){e=e|0;t=t|0;r=r|0;f=f|0;d=d|0;l=l|0;p=p|0;y=y|0;g=g|0;b=b|0;m=m|0;w=w|0;A=A|0;v=v|0;_=_|0;k=k|0;var E=0,S=0,C=0,I=0,B=0,P=0,M=0,D=0;E=i;S=n;C=a;I=s;B=o;P=c;M=u;D=h;D=e+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0x428a2f98|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;M=t+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0x71374491|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;P=r+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0xb5c0fbcf|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;B=f+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0xe9b5dba5|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;I=d+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0x3956c25b|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;C=l+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0x59f111f1|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;S=p+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0x923f82a4|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;E=y+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0xab1c5ed5|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;D=g+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0xd807aa98|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;M=b+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0x12835b01|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;P=m+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0x243185be|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;B=w+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0x550c7dc3|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;I=A+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0x72be5d74|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;C=v+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0x80deb1fe|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;S=_+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0x9bdc06a7|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;E=k+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0xc19bf174|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(_>>>17^_>>>19^_>>>10^_<<15^_<<13)+e+b|0;D=e+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0xe49b69c1|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(k>>>17^k>>>19^k>>>10^k<<15^k<<13)+t+m|0;M=t+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0xefbe4786|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;r=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+w|0;P=r+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0x0fc19dc6|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+f+A|0;B=f+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0x240ca1cc|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;d=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+d+v|0;I=d+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0x2de92c6f|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;l=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+l+_|0;C=l+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0x4a7484aa|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;p=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+p+k|0;S=p+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0x5cb0a9dc|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+y+e|0;E=y+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0x76f988da|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;g=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+g+t|0;D=g+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0x983e5152|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;b=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+r|0;M=b+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0xa831c66d|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;m=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0;P=m+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0xb00327c8|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;w=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+w+d|0;B=w+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0xbf597fc7|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;A=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+A+l|0;I=A+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0xc6e00bf3|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;v=(_>>>7^_>>>18^_>>>3^_<<25^_<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+v+p|0;C=v+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0xd5a79147|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;_=(k>>>7^k>>>18^k>>>3^k<<25^k<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+_+y|0;S=_+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0x06ca6351|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;k=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+k+g|0;E=k+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0x14292967|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(_>>>17^_>>>19^_>>>10^_<<15^_<<13)+e+b|0;D=e+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0x27b70a85|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(k>>>17^k>>>19^k>>>10^k<<15^k<<13)+t+m|0;M=t+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0x2e1b2138|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;r=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+w|0;P=r+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0x4d2c6dfc|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+f+A|0;B=f+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0x53380d13|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;d=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+d+v|0;I=d+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0x650a7354|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;l=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+l+_|0;C=l+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0x766a0abb|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;p=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+p+k|0;S=p+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0x81c2c92e|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+y+e|0;E=y+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0x92722c85|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;g=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+g+t|0;D=g+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0xa2bfe8a1|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;b=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+r|0;M=b+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0xa81a664b|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;m=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0;P=m+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0xc24b8b70|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;w=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+w+d|0;B=w+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0xc76c51a3|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;A=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+A+l|0;I=A+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0xd192e819|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;v=(_>>>7^_>>>18^_>>>3^_<<25^_<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+v+p|0;C=v+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0xd6990624|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;_=(k>>>7^k>>>18^k>>>3^k<<25^k<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+_+y|0;S=_+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0xf40e3585|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;k=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+k+g|0;E=k+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0x106aa070|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(_>>>17^_>>>19^_>>>10^_<<15^_<<13)+e+b|0;D=e+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0x19a4c116|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(k>>>17^k>>>19^k>>>10^k<<15^k<<13)+t+m|0;M=t+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0x1e376c08|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;r=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+w|0;P=r+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0x2748774c|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+f+A|0;B=f+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0x34b0bcb5|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;d=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+d+v|0;I=d+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0x391c0cb3|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;l=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+l+_|0;C=l+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0x4ed8aa4a|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;p=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+p+k|0;S=p+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0x5b9cca4f|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+y+e|0;E=y+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0x682e6ff3|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;g=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+g+t|0;D=g+D+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(M^B&(P^M))+0x748f82ee|0;I=I+D|0;D=D+(E&S^C&(E^S))+(E>>>2^E>>>13^E>>>22^E<<30^E<<19^E<<10)|0;b=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+b+r|0;M=b+M+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(P^I&(B^P))+0x78a5636f|0;C=C+M|0;M=M+(D&E^S&(D^E))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0;m=(w>>>7^w>>>18^w>>>3^w<<25^w<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0;P=m+P+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(I^B))+0x84c87814|0;S=S+P|0;P=P+(M&D^E&(M^D))+(M>>>2^M>>>13^M>>>22^M<<30^M<<19^M<<10)|0;w=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+w+d|0;B=w+B+(S>>>6^S>>>11^S>>>25^S<<26^S<<21^S<<7)+(I^S&(C^I))+0x8cc70208|0;E=E+B|0;B=B+(P&M^D&(P^M))+(P>>>2^P>>>13^P>>>22^P<<30^P<<19^P<<10)|0;A=(v>>>7^v>>>18^v>>>3^v<<25^v<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+A+l|0;I=A+I+(E>>>6^E>>>11^E>>>25^E<<26^E<<21^E<<7)+(C^E&(S^C))+0x90befffa|0;D=D+I|0;I=I+(B&P^M&(B^P))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0;v=(_>>>7^_>>>18^_>>>3^_<<25^_<<14)+(w>>>17^w>>>19^w>>>10^w<<15^w<<13)+v+p|0;C=v+C+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(S^D&(E^S))+0xa4506ceb|0;M=M+C|0;C=C+(I&B^P&(I^B))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0;_=(k>>>7^k>>>18^k>>>3^k<<25^k<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+_+y|0;S=_+S+(M>>>6^M>>>11^M>>>25^M<<26^M<<21^M<<7)+(E^M&(D^E))+0xbef9a3f7|0;P=P+S|0;S=S+(C&I^B&(C^I))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0;k=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(v>>>17^v>>>19^v>>>10^v<<15^v<<13)+k+g|0;E=k+E+(P>>>6^P>>>11^P>>>25^P<<26^P<<21^P<<7)+(D^P&(M^D))+0xc67178f2|0;B=B+E|0;E=E+(S&C^I&(S^C))+(S>>>2^S>>>13^S>>>22^S<<30^S<<19^S<<10)|0;i=i+E|0;n=n+S|0;a=a+C|0;s=s+I|0;o=o+B|0;c=c+P|0;u=u+M|0;h=h+D|0}function D(e){e=e|0;M(P[e|0]<<24|P[e|1]<<16|P[e|2]<<8|P[e|3],P[e|4]<<24|P[e|5]<<16|P[e|6]<<8|P[e|7],P[e|8]<<24|P[e|9]<<16|P[e|10]<<8|P[e|11],P[e|12]<<24|P[e|13]<<16|P[e|14]<<8|P[e|15],P[e|16]<<24|P[e|17]<<16|P[e|18]<<8|P[e|19],P[e|20]<<24|P[e|21]<<16|P[e|22]<<8|P[e|23],P[e|24]<<24|P[e|25]<<16|P[e|26]<<8|P[e|27],P[e|28]<<24|P[e|29]<<16|P[e|30]<<8|P[e|31],P[e|32]<<24|P[e|33]<<16|P[e|34]<<8|P[e|35],P[e|36]<<24|P[e|37]<<16|P[e|38]<<8|P[e|39],P[e|40]<<24|P[e|41]<<16|P[e|42]<<8|P[e|43],P[e|44]<<24|P[e|45]<<16|P[e|46]<<8|P[e|47],P[e|48]<<24|P[e|49]<<16|P[e|50]<<8|P[e|51],P[e|52]<<24|P[e|53]<<16|P[e|54]<<8|P[e|55],P[e|56]<<24|P[e|57]<<16|P[e|58]<<8|P[e|59],P[e|60]<<24|P[e|61]<<16|P[e|62]<<8|P[e|63])}function x(e){e=e|0;P[e|0]=i>>>24;P[e|1]=i>>>16&255;P[e|2]=i>>>8&255;P[e|3]=i&255;P[e|4]=n>>>24;P[e|5]=n>>>16&255;P[e|6]=n>>>8&255;P[e|7]=n&255;P[e|8]=a>>>24;P[e|9]=a>>>16&255;P[e|10]=a>>>8&255;P[e|11]=a&255;P[e|12]=s>>>24;P[e|13]=s>>>16&255;P[e|14]=s>>>8&255;P[e|15]=s&255;P[e|16]=o>>>24;P[e|17]=o>>>16&255;P[e|18]=o>>>8&255;P[e|19]=o&255;P[e|20]=c>>>24;P[e|21]=c>>>16&255;P[e|22]=c>>>8&255;P[e|23]=c&255;P[e|24]=u>>>24;P[e|25]=u>>>16&255;P[e|26]=u>>>8&255;P[e|27]=u&255;P[e|28]=h>>>24;P[e|29]=h>>>16&255;P[e|30]=h>>>8&255;P[e|31]=h&255}function K(){i=0x6a09e667;n=0xbb67ae85;a=0x3c6ef372;s=0xa54ff53a;o=0x510e527f;c=0x9b05688c;u=0x1f83d9ab;h=0x5be0cd19;f=d=0}function U(e,t,r,l,p,y,g,b,m,w){e=e|0;t=t|0;r=r|0;l=l|0;p=p|0;y=y|0;g=g|0;b=b|0;m=m|0;w=w|0;i=e;n=t;a=r;s=l;o=p;c=y;u=g;h=b;f=m;d=w}function R(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){D(e);e=e+64|0;t=t-64|0;r=r+64|0}f=f+r|0;if(f>>>0<r>>>0)d=d+1|0;return r|0}function T(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){i=R(e,t)|0;if((i|0)==-1)return-1;e=e+i|0;t=t-i|0}i=i+t|0;f=f+t|0;if(f>>>0<t>>>0)d=d+1|0;P[e|t]=0x80;if((t|0)>=56){for(n=t+1|0;(n|0)<64;n=n+1|0)P[e|n]=0x00;D(e);t=0;P[e|0]=0}for(n=t+1|0;(n|0)<59;n=n+1|0)P[e|n]=0;P[e|56]=d>>>21&255;P[e|57]=d>>>13&255;P[e|58]=d>>>5&255;P[e|59]=d<<3&255|f>>>29;P[e|60]=f>>>21&255;P[e|61]=f>>>13&255;P[e|62]=f>>>5&255;P[e|63]=f<<3&255;D(e);if(~r)x(r);return i|0}function Q(){i=l;n=p;a=y;s=g;o=b;c=m;u=w;h=A;f=64;d=0}function z(){i=v;n=_;a=k;s=E;o=S;c=C;u=I;h=B;f=64;d=0}function F(e,t,r,P,D,x,U,R,T,Q,z,F,L,N,q,O){e=e|0;t=t|0;r=r|0;P=P|0;D=D|0;x=x|0;U=U|0;R=R|0;T=T|0;Q=Q|0;z=z|0;F=F|0;L=L|0;N=N|0;q=q|0;O=O|0;K();M(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,P^0x5c5c5c5c,D^0x5c5c5c5c,x^0x5c5c5c5c,U^0x5c5c5c5c,R^0x5c5c5c5c,T^0x5c5c5c5c,Q^0x5c5c5c5c,z^0x5c5c5c5c,F^0x5c5c5c5c,L^0x5c5c5c5c,N^0x5c5c5c5c,q^0x5c5c5c5c,O^0x5c5c5c5c);v=i;_=n;k=a;E=s;S=o;C=c;I=u;B=h;K();M(e^0x36363636,t^0x36363636,r^0x36363636,P^0x36363636,D^0x36363636,x^0x36363636,U^0x36363636,R^0x36363636,T^0x36363636,Q^0x36363636,z^0x36363636,F^0x36363636,L^0x36363636,N^0x36363636,q^0x36363636,O^0x36363636);l=i;p=n;y=a;g=s;b=o;m=c;w=u;A=h;f=64;d=0}function L(e,t,r){e=e|0;t=t|0;r=r|0;var f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0;if(e&63)return-1;if(~r)if(r&31)return-1;w=T(e,t,-1)|0;f=i,d=n,l=a,p=s,y=o,g=c,b=u,m=h;z();M(f,d,l,p,y,g,b,m,0x80000000,0,0,0,0,0,0,768);if(~r)x(r);return w|0}function N(e,t,r,f,d){e=e|0;t=t|0;r=r|0;f=f|0;d=d|0;var l=0,p=0,y=0,g=0,b=0,m=0,w=0,A=0,v=0,_=0,k=0,E=0,S=0,C=0,I=0,B=0;if(e&63)return-1;if(~d)if(d&31)return-1;P[e+t|0]=r>>>24;P[e+t+1|0]=r>>>16&255;P[e+t+2|0]=r>>>8&255;P[e+t+3|0]=r&255;L(e,t+4|0,-1)|0;l=v=i,p=_=n,y=k=a,g=E=s,b=S=o,m=C=c,w=I=u,A=B=h;f=f-1|0;while((f|0)>0){Q();M(v,_,k,E,S,C,I,B,0x80000000,0,0,0,0,0,0,768);v=i,_=n,k=a,E=s,S=o,C=c,I=u,B=h;z();M(v,_,k,E,S,C,I,B,0x80000000,0,0,0,0,0,0,768);v=i,_=n,k=a,E=s,S=o,C=c,I=u,B=h;l=l^i;p=p^n;y=y^a;g=g^s;b=b^o;m=m^c;w=w^u;A=A^h;f=f-1|0}i=l;n=p;a=y;s=g;o=b;c=m;u=w;h=A;if(~d)x(d);return 0}return{reset:K,init:U,process:R,finish:T,hmac_reset:Q,hmac_init:F,hmac_finish:L,pbkdf2_generate_block:N}}({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(Ze.push(this.heap),Xe.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return(new $e).process(e).finish().result}}$e.NAME="sha256";var et=tt;function tt(e,t){if(!e)throw Error(t||"Assertion failed")}tt.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)};var rt=void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function it(e,t){return e(t={exports:{}},t.exports),t.exports}function nt(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var at=it((function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}));var st=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var i=0;i<e.length;i++){var n=e.charCodeAt(i),a=n>>8,s=255&n;a?r.push(a,s):r.push(s)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r};var ot=function(e){for(var t="",r=0;r<e.length;r++)t+=ht(e[r].toString(16));return t};function ct(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}var ut=function(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];"little"===t&&(n=ct(n)),r+=ft(n.toString(16))}return r};function ht(e){return 1===e.length?"0"+e:e}function ft(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var dt=function(e,t,r,i){var n=r-t;et(n%4==0);for(var a=Array(n/4),s=0,o=t;s<a.length;s++,o+=4){var c;c="big"===i?e[o]<<24|e[o+1]<<16|e[o+2]<<8|e[o+3]:e[o+3]<<24|e[o+2]<<16|e[o+1]<<8|e[o],a[s]=c>>>0}return a};var lt=function(e,t){for(var r=Array(4*e.length),i=0,n=0;i<e.length;i++,n+=4){var a=e[i];"big"===t?(r[n]=a>>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r};var pt={inherits:at,toArray:st,toHex:ot,htonl:ct,toHex32:ut,zero2:ht,zero8:ft,join32:dt,split32:lt,rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<<t|e>>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,i){return e+t+r+i>>>0},sum32_5:function(e,t,r,i,n){return e+t+r+i+n>>>0},sum64:function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,s=(a<i?1:0)+r+n;e[t]=s>>>0,e[t+1]=a},sum64_hi:function(e,t,r,i){return(t+i>>>0<t?1:0)+e+r>>>0},sum64_lo:function(e,t,r,i){return t+i>>>0},sum64_4_hi:function(e,t,r,i,n,a,s,o){var c=0,u=t;return c+=(u=u+i>>>0)<t?1:0,c+=(u=u+a>>>0)<a?1:0,e+r+n+s+(c+=(u=u+o>>>0)<o?1:0)>>>0},sum64_4_lo:function(e,t,r,i,n,a,s,o){return t+i+a+o>>>0},sum64_5_hi:function(e,t,r,i,n,a,s,o,c,u){var h=0,f=t;return h+=(f=f+i>>>0)<t?1:0,h+=(f=f+a>>>0)<a?1:0,h+=(f=f+o>>>0)<o?1:0,e+r+n+s+c+(h+=(f=f+u>>>0)<u?1:0)>>>0},sum64_5_lo:function(e,t,r,i,n,a,s,o,c,u){return t+i+a+o+u>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function yt(){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}var gt=yt;yt.prototype.update=function(e,t){if(e=pt.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=pt.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},yt.prototype.digest=function(e){return this.update(this._pad()),et(null===this.pending),this._digest(e)},yt.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,i=Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(e<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=e>>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,a=8;a<this.padLength;a++)i[n++]=0;return i};var bt={BlockHash:gt},mt=pt.rotr32;var wt=function(e,t,r,i){return 0===e?At(t,r,i):1===e||3===e?_t(t,r,i):2===e?vt(t,r,i):void 0};function At(e,t,r){return e&t^~e&r}function vt(e,t,r){return e&t^e&r^t&r}function _t(e,t,r){return e^t^r}var kt={ft_1:wt,ch32:At,maj32:vt,p32:_t,s0_256:function(e){return mt(e,2)^mt(e,13)^mt(e,22)},s1_256:function(e){return mt(e,6)^mt(e,11)^mt(e,25)},g0_256:function(e){return mt(e,7)^mt(e,18)^e>>>3},g1_256:function(e){return mt(e,17)^mt(e,19)^e>>>10}},Et=pt.sum32,St=pt.sum32_4,Ct=pt.sum32_5,It=kt.ch32,Bt=kt.maj32,Pt=kt.s0_256,Mt=kt.s1_256,Dt=kt.g0_256,xt=kt.g1_256,Kt=bt.BlockHash,Ut=[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 Rt(){if(!(this instanceof Rt))return new Rt;Kt.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Ut,this.W=Array(64)}pt.inherits(Rt,Kt);var Tt=Rt;function Qt(){if(!(this instanceof Qt))return new Qt;Tt.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Rt.blockSize=512,Rt.outSize=256,Rt.hmacStrength=192,Rt.padLength=64,Rt.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=St(xt(r[i-2]),r[i-7],Dt(r[i-15]),r[i-16]);var n=this.h[0],a=this.h[1],s=this.h[2],o=this.h[3],c=this.h[4],u=this.h[5],h=this.h[6],f=this.h[7];for(et(this.k.length===r.length),i=0;i<r.length;i++){var d=Ct(f,Mt(c),It(c,u,h),this.k[i],r[i]),l=Et(Pt(n),Bt(n,a,s));f=h,h=u,u=c,c=Et(o,d),o=s,s=a,a=n,n=Et(d,l)}this.h[0]=Et(this.h[0],n),this.h[1]=Et(this.h[1],a),this.h[2]=Et(this.h[2],s),this.h[3]=Et(this.h[3],o),this.h[4]=Et(this.h[4],c),this.h[5]=Et(this.h[5],u),this.h[6]=Et(this.h[6],h),this.h[7]=Et(this.h[7],f)},Rt.prototype._digest=function(e){return"hex"===e?pt.toHex32(this.h,"big"):pt.split32(this.h,"big")},pt.inherits(Qt,Tt);var zt=Qt;Qt.blockSize=512,Qt.outSize=224,Qt.hmacStrength=192,Qt.padLength=64,Qt.prototype._digest=function(e){return"hex"===e?pt.toHex32(this.h.slice(0,7),"big"):pt.split32(this.h.slice(0,7),"big")};var Ft=pt.rotr64_hi,Lt=pt.rotr64_lo,Nt=pt.shr64_hi,qt=pt.shr64_lo,Ot=pt.sum64,Ht=pt.sum64_hi,jt=pt.sum64_lo,Gt=pt.sum64_4_hi,Wt=pt.sum64_4_lo,Vt=pt.sum64_5_hi,Jt=pt.sum64_5_lo,Yt=bt.BlockHash,Zt=[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 Xt(){if(!(this instanceof Xt))return new Xt;Yt.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Zt,this.W=Array(160)}pt.inherits(Xt,Yt);var $t=Xt;function er(e,t,r,i,n){var a=e&r^~e&n;return a<0&&(a+=4294967296),a}function tr(e,t,r,i,n,a){var s=t&i^~t&a;return s<0&&(s+=4294967296),s}function rr(e,t,r,i,n){var a=e&r^e&n^r&n;return a<0&&(a+=4294967296),a}function ir(e,t,r,i,n,a){var s=t&i^t&a^i&a;return s<0&&(s+=4294967296),s}function nr(e,t){var r=Ft(e,t,28)^Ft(t,e,2)^Ft(t,e,7);return r<0&&(r+=4294967296),r}function ar(e,t){var r=Lt(e,t,28)^Lt(t,e,2)^Lt(t,e,7);return r<0&&(r+=4294967296),r}function sr(e,t){var r=Ft(e,t,14)^Ft(e,t,18)^Ft(t,e,9);return r<0&&(r+=4294967296),r}function or(e,t){var r=Lt(e,t,14)^Lt(e,t,18)^Lt(t,e,9);return r<0&&(r+=4294967296),r}function cr(e,t){var r=Ft(e,t,1)^Ft(e,t,8)^Nt(e,t,7);return r<0&&(r+=4294967296),r}function ur(e,t){var r=Lt(e,t,1)^Lt(e,t,8)^qt(e,t,7);return r<0&&(r+=4294967296),r}function hr(e,t){var r=Ft(e,t,19)^Ft(t,e,29)^Nt(e,t,6);return r<0&&(r+=4294967296),r}function fr(e,t){var r=Lt(e,t,19)^Lt(t,e,29)^qt(e,t,6);return r<0&&(r+=4294967296),r}function dr(){if(!(this instanceof dr))return new dr;$t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Xt.blockSize=1024,Xt.outSize=512,Xt.hmacStrength=192,Xt.padLength=128,Xt.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i<r.length;i+=2){var n=hr(r[i-4],r[i-3]),a=fr(r[i-4],r[i-3]),s=r[i-14],o=r[i-13],c=cr(r[i-30],r[i-29]),u=ur(r[i-30],r[i-29]),h=r[i-32],f=r[i-31];r[i]=Gt(n,a,s,o,c,u,h,f),r[i+1]=Wt(n,a,s,o,c,u,h,f)}},Xt.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,i=this.h[0],n=this.h[1],a=this.h[2],s=this.h[3],o=this.h[4],c=this.h[5],u=this.h[6],h=this.h[7],f=this.h[8],d=this.h[9],l=this.h[10],p=this.h[11],y=this.h[12],g=this.h[13],b=this.h[14],m=this.h[15];et(this.k.length===r.length);for(var w=0;w<r.length;w+=2){var A=b,v=m,_=sr(f,d),k=or(f,d),E=er(f,d,l,p,y),S=tr(f,d,l,p,y,g),C=this.k[w],I=this.k[w+1],B=r[w],P=r[w+1],M=Vt(A,v,_,k,E,S,C,I,B,P),D=Jt(A,v,_,k,E,S,C,I,B,P);A=nr(i,n),v=ar(i,n),_=rr(i,n,a,s,o),k=ir(i,n,a,s,o,c);var x=Ht(A,v,_,k),K=jt(A,v,_,k);b=y,m=g,y=l,g=p,l=f,p=d,f=Ht(u,h,M,D),d=jt(h,h,M,D),u=o,h=c,o=a,c=s,a=i,s=n,i=Ht(M,D,x,K),n=jt(M,D,x,K)}Ot(this.h,0,i,n),Ot(this.h,2,a,s),Ot(this.h,4,o,c),Ot(this.h,6,u,h),Ot(this.h,8,f,d),Ot(this.h,10,l,p),Ot(this.h,12,y,g),Ot(this.h,14,b,m)},Xt.prototype._digest=function(e){return"hex"===e?pt.toHex32(this.h,"big"):pt.split32(this.h,"big")},pt.inherits(dr,$t);var lr=dr;dr.blockSize=1024,dr.outSize=384,dr.hmacStrength=192,dr.padLength=128,dr.prototype._digest=function(e){return"hex"===e?pt.toHex32(this.h.slice(0,12),"big"):pt.split32(this.h.slice(0,12),"big")};var pr=pt.rotl32,yr=pt.sum32,gr=pt.sum32_3,br=pt.sum32_4,mr=bt.BlockHash;function wr(){if(!(this instanceof wr))return new wr;mr.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}pt.inherits(wr,mr);var Ar=wr;function vr(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function _r(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function kr(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}wr.blockSize=512,wr.outSize=160,wr.hmacStrength=192,wr.padLength=64,wr.prototype._update=function(e,t){for(var r=this.h[0],i=this.h[1],n=this.h[2],a=this.h[3],s=this.h[4],o=r,c=i,u=n,h=a,f=s,d=0;d<80;d++){var l=yr(pr(br(r,vr(d,i,n,a),e[Er[d]+t],_r(d)),Cr[d]),s);r=s,s=a,a=pr(n,10),n=i,i=l,l=yr(pr(br(o,vr(79-d,c,u,h),e[Sr[d]+t],kr(d)),Ir[d]),f),o=f,f=h,h=pr(u,10),u=c,c=l}l=gr(this.h[1],n,h),this.h[1]=gr(this.h[2],a,f),this.h[2]=gr(this.h[3],s,o),this.h[3]=gr(this.h[4],r,c),this.h[4]=gr(this.h[0],i,u),this.h[0]=l},wr.prototype._digest=function(e){return"hex"===e?pt.toHex32(this.h,"little"):pt.split32(this.h,"little")};var Er=[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],Sr=[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],Cr=[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],Ir=[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],Br={ripemd160:Ar};function Pr(e,t){let r=e[0],i=e[1],n=e[2],a=e[3];r=Dr(r,i,n,a,t[0],7,-680876936),a=Dr(a,r,i,n,t[1],12,-389564586),n=Dr(n,a,r,i,t[2],17,606105819),i=Dr(i,n,a,r,t[3],22,-1044525330),r=Dr(r,i,n,a,t[4],7,-176418897),a=Dr(a,r,i,n,t[5],12,1200080426),n=Dr(n,a,r,i,t[6],17,-1473231341),i=Dr(i,n,a,r,t[7],22,-45705983),r=Dr(r,i,n,a,t[8],7,1770035416),a=Dr(a,r,i,n,t[9],12,-1958414417),n=Dr(n,a,r,i,t[10],17,-42063),i=Dr(i,n,a,r,t[11],22,-1990404162),r=Dr(r,i,n,a,t[12],7,1804603682),a=Dr(a,r,i,n,t[13],12,-40341101),n=Dr(n,a,r,i,t[14],17,-1502002290),i=Dr(i,n,a,r,t[15],22,1236535329),r=xr(r,i,n,a,t[1],5,-165796510),a=xr(a,r,i,n,t[6],9,-1069501632),n=xr(n,a,r,i,t[11],14,643717713),i=xr(i,n,a,r,t[0],20,-373897302),r=xr(r,i,n,a,t[5],5,-701558691),a=xr(a,r,i,n,t[10],9,38016083),n=xr(n,a,r,i,t[15],14,-660478335),i=xr(i,n,a,r,t[4],20,-405537848),r=xr(r,i,n,a,t[9],5,568446438),a=xr(a,r,i,n,t[14],9,-1019803690),n=xr(n,a,r,i,t[3],14,-187363961),i=xr(i,n,a,r,t[8],20,1163531501),r=xr(r,i,n,a,t[13],5,-1444681467),a=xr(a,r,i,n,t[2],9,-51403784),n=xr(n,a,r,i,t[7],14,1735328473),i=xr(i,n,a,r,t[12],20,-1926607734),r=Kr(r,i,n,a,t[5],4,-378558),a=Kr(a,r,i,n,t[8],11,-2022574463),n=Kr(n,a,r,i,t[11],16,1839030562),i=Kr(i,n,a,r,t[14],23,-35309556),r=Kr(r,i,n,a,t[1],4,-1530992060),a=Kr(a,r,i,n,t[4],11,1272893353),n=Kr(n,a,r,i,t[7],16,-155497632),i=Kr(i,n,a,r,t[10],23,-1094730640),r=Kr(r,i,n,a,t[13],4,681279174),a=Kr(a,r,i,n,t[0],11,-358537222),n=Kr(n,a,r,i,t[3],16,-722521979),i=Kr(i,n,a,r,t[6],23,76029189),r=Kr(r,i,n,a,t[9],4,-640364487),a=Kr(a,r,i,n,t[12],11,-421815835),n=Kr(n,a,r,i,t[15],16,530742520),i=Kr(i,n,a,r,t[2],23,-995338651),r=Ur(r,i,n,a,t[0],6,-198630844),a=Ur(a,r,i,n,t[7],10,1126891415),n=Ur(n,a,r,i,t[14],15,-1416354905),i=Ur(i,n,a,r,t[5],21,-57434055),r=Ur(r,i,n,a,t[12],6,1700485571),a=Ur(a,r,i,n,t[3],10,-1894986606),n=Ur(n,a,r,i,t[10],15,-1051523),i=Ur(i,n,a,r,t[1],21,-2054922799),r=Ur(r,i,n,a,t[8],6,1873313359),a=Ur(a,r,i,n,t[15],10,-30611744),n=Ur(n,a,r,i,t[6],15,-1560198380),i=Ur(i,n,a,r,t[13],21,1309151649),r=Ur(r,i,n,a,t[4],6,-145523070),a=Ur(a,r,i,n,t[11],10,-1120210379),n=Ur(n,a,r,i,t[2],15,718787259),i=Ur(i,n,a,r,t[9],21,-343485551),e[0]=zr(r,e[0]),e[1]=zr(i,e[1]),e[2]=zr(n,e[2]),e[3]=zr(a,e[3])}function Mr(e,t,r,i,n,a){return t=zr(zr(t,e),zr(i,a)),zr(t<<n|t>>>32-n,r)}function Dr(e,t,r,i,n,a,s){return Mr(t&r|~t&i,e,t,n,a,s)}function xr(e,t,r,i,n,a,s){return Mr(t&i|r&~i,e,t,n,a,s)}function Kr(e,t,r,i,n,a,s){return Mr(t^r^i,e,t,n,a,s)}function Ur(e,t,r,i,n,a,s){return Mr(r^(t|~i),e,t,n,a,s)}function Rr(e){const t=[];let r;for(r=0;r<64;r+=4)t[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return t}const Tr="0123456789abcdef".split("");function Qr(e){let t="",r=0;for(;r<4;r++)t+=Tr[e>>8*r+4&15]+Tr[e>>8*r&15];return t}function zr(e,t){return e+t&4294967295}const Fr=Y.getWebCrypto(),Lr=Y.getNodeCrypto(),Nr=Lr&&Lr.getHashes();function qr(e){if(Lr&&Nr.includes(e))return async function(t){const r=Lr.createHash(e);return R(t,(e=>{r.update(e)}),(()=>new Uint8Array(r.digest())))}}function Or(e,t){return async function(r,i=ne){if(s(r)&&(r=await q(r)),!Y.isStream(r)&&Fr&&t&&r.length>=i.minBytesForWebCrypto)return new Uint8Array(await Fr.digest(t,r));const n=e();return R(r,(e=>{n.update(e)}),(()=>new Uint8Array(n.digest())))}}function Hr(e,t){return async function(r,i=ne){if(s(r)&&(r=await q(r)),Y.isStream(r)){const t=new e;return R(r,(e=>{t.process(e)}),(()=>t.finish().result))}return Fr&&t&&r.length>=i.minBytesForWebCrypto?new Uint8Array(await Fr.digest(t,r)):e.bytes(r)}}const jr={md5:qr("md5")||async function(e){const t=function(e){const t=e.length,r=[1732584193,-271733879,-1732584194,271733878];let i;for(i=64;i<=e.length;i+=64)Pr(r,Rr(e.substring(i-64,i)));e=e.substring(i-64);const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<e.length;i++)n[i>>2]|=e.charCodeAt(i)<<(i%4<<3);if(n[i>>2]|=128<<(i%4<<3),i>55)for(Pr(r,n),i=0;i<16;i++)n[i]=0;return n[14]=8*t,Pr(r,n),r}(Y.uint8ArrayToString(e));return Y.hexToUint8Array(function(e){for(let t=0;t<e.length;t++)e[t]=Qr(e[t]);return e.join("")}(t))},sha1:qr("sha1")||Hr(Ye,"SHA-1"),sha224:qr("sha224")||Or(zt),sha256:qr("sha256")||Hr($e,"SHA-256"),sha384:qr("sha384")||Or(lr,"SHA-384"),sha512:qr("sha512")||Or($t,"SHA-512"),ripemd:qr("ripemd160")||Or(Ar)};var Gr={md5:jr.md5,sha1:jr.sha1,sha224:jr.sha224,sha256:jr.sha256,sha384:jr.sha384,sha512:jr.sha512,ripemd:jr.ripemd,digest:function(e,t){switch(e){case V.hash.md5:return this.md5(t);case V.hash.sha1:return this.sha1(t);case V.hash.ripemd:return this.ripemd(t);case V.hash.sha256:return this.sha256(t);case V.hash.sha384:return this.sha384(t);case V.hash.sha512:return this.sha512(t);case V.hash.sha224:return this.sha224(t);default:throw Error("Invalid hash function.")}},getHashByteLength:function(e){switch(e){case V.hash.md5:return 16;case V.hash.sha1:case V.hash.ripemd:return 20;case V.hash.sha256:return 32;case V.hash.sha384:return 48;case V.hash.sha512:return 64;case V.hash.sha224:return 28;default:throw Error("Invalid hash algorithm.")}},getBlockSize:function(e){switch(e){case V.hash.md5:case V.hash.sha1:case V.hash.ripemd:case V.hash.sha224:case V.hash.sha256:return 64;case V.hash.sha384:case V.hash.sha512:return 128;default:throw Error("Invalid hash algorithm.")}}};class Wr{static encrypt(e,t,r){return new Wr(t,r).encrypt(e)}static decrypt(e,t,r){return new Wr(t,r).decrypt(e)}constructor(e,t,r){this.aes=r||new Se(e,t,!0,"CFB"),delete this.aes.padding}encrypt(e){return we(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return we(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Vr(e){const t=V.read(V.symmetric,e);return je[t]}const Jr=Y.getWebCrypto(),Yr=Y.getNodeCrypto(),Zr=Yr?Yr.getCiphers():[],Xr={idea:Zr.includes("idea-cfb")?"idea-cfb":void 0,tripledes:Zr.includes("des-ede3-cfb")?"des-ede3-cfb":void 0,cast5:Zr.includes("cast5-cfb")?"cast5-cfb":void 0,blowfish:Zr.includes("bf-cfb")?"bf-cfb":void 0,aes128:Zr.includes("aes-128-cfb")?"aes-128-cfb":void 0,aes192:Zr.includes("aes-192-cfb")?"aes-192-cfb":void 0,aes256:Zr.includes("aes-256-cfb")?"aes-256-cfb":void 0};var $r=/*#__PURE__*/Object.freeze({__proto__:null,encrypt:async function(e,t,r,i,n){const a=V.read(V.symmetric,e);if(Y.getNodeCrypto()&&Xr[a])return function(e,t,r,i){const n=V.read(V.symmetric,e),a=new Yr.createCipheriv(Xr[n],t,i);return R(r,(e=>new Uint8Array(a.update(e))))}(e,t,r,i);if(Y.isAES(e))return function(e,t,r,i,n){if(Y.getWebCrypto()&&24!==t.length&&!Y.isStream(r)&&r.length>=3e3*n.minBytesForWebCrypto)return async function(e,t,r,i){const n="AES-CBC",a=await Jr.importKey("raw",t,{name:n},!1,["encrypt"]),{blockSize:s}=Vr(e),o=Y.concatUint8Array([new Uint8Array(s),r]),c=new Uint8Array(await Jr.encrypt({name:n,iv:i},a,o)).subarray(0,r.length);return function(e,t){for(let r=0;r<e.length;r++)e[r]=e[r]^t[r]}(c,r),c}(e,t,r,i);const a=new Wr(t,i);return R(r,(e=>a.aes.AES_Encrypt_process(e)),(()=>a.aes.AES_Encrypt_finish()))}(e,t,r,i,n);const s=new(Vr(e))(t),o=s.blockSize,c=i.slice();let u=new Uint8Array;const h=e=>{e&&(u=Y.concatUint8Array([u,e]));const t=new Uint8Array(u.length);let r,i=0;for(;e?u.length>=o:u.length;){const e=s.encrypt(c);for(r=0;r<o;r++)c[r]=u[r]^e[r],t[i++]=c[r];u=u.subarray(o)}return t.subarray(0,i)};return R(r,h,h)},decrypt:async function(e,t,r,i){const n=V.read(V.symmetric,e);if(Y.getNodeCrypto()&&Xr[n])return function(e,t,r,i){const n=V.read(V.symmetric,e),a=new Yr.createDecipheriv(Xr[n],t,i);return R(r,(e=>new Uint8Array(a.update(e))))}(e,t,r,i);if(Y.isAES(e))return function(e,t,r,i){if(Y.isStream(r)){const e=new Wr(t,i);return R(r,(t=>e.aes.AES_Decrypt_process(t)),(()=>e.aes.AES_Decrypt_finish()))}return Wr.decrypt(r,t,i)}(0,t,r,i);const a=new(Vr(e))(t),s=a.blockSize;let o=i,c=new Uint8Array;const u=e=>{e&&(c=Y.concatUint8Array([c,e]));const t=new Uint8Array(c.length);let r,i=0;for(;e?c.length>=s:c.length;){const e=a.encrypt(o);for(o=c.subarray(0,s),r=0;r<s;r++)t[i++]=o[r]^e[r];c=c.subarray(s)}return t.subarray(0,i)};return R(r,u,u)}});class ei{static encrypt(e,t,r){return new ei(t,r).encrypt(e)}static decrypt(e,t,r){return new ei(t,r).encrypt(e)}constructor(e,t,r){this.aes=r||new Se(e,void 0,!1,"CTR"),delete this.aes.padding,this.AES_CTR_set_options(t)}encrypt(e){return we(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return we(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}AES_CTR_set_options(e,t,r){let{asm:i}=this.aes.acquire_asm();if(void 0!==r){if(r<8||r>48)throw new ve("illegal counter size");let e=Math.pow(2,r)-1;i.set_mask(0,0,e/4294967296|0,0|e)}else r=48,i.set_mask(0,0,65535,4294967295);if(void 0===e)throw Error("nonce is required");{let t=e.length;if(!t||t>16)throw new ve("illegal nonce size");let r=new DataView(new ArrayBuffer(16));new Uint8Array(r.buffer).set(e),i.set_nonce(r.getUint32(0),r.getUint32(4),r.getUint32(8),r.getUint32(12))}if(void 0!==t){if(t<0||t>=Math.pow(2,r))throw new ve("illegal counter value");i.set_counter(0,0,t/4294967296|0,0|t)}}}class ti{static encrypt(e,t,r=!0,i){return new ti(t,i,r).encrypt(e)}static decrypt(e,t,r=!0,i){return new ti(t,i,r).decrypt(e)}constructor(e,t,r=!0,i){this.aes=i||new Se(e,t,r,"CBC")}encrypt(e){return we(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return we(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}const ri=Y.getWebCrypto(),ii=Y.getNodeCrypto(),ni=16;function ai(e,t){const r=e.length-ni;for(let i=0;i<ni;i++)e[i+r]^=t[i];return e}const si=new Uint8Array(ni);async function oi(e){const t=await async function(e){if(Y.getWebCrypto()&&24!==e.length)return e=await ri.importKey("raw",e,{name:"AES-CBC",length:8*e.length},!1,["encrypt"]),async function(t){const r=await ri.encrypt({name:"AES-CBC",iv:si,length:8*ni},e,t);return new Uint8Array(r).subarray(0,r.byteLength-ni)};if(Y.getNodeCrypto())return async function(t){const r=new ii.createCipheriv("aes-"+8*e.length+"-cbc",e,si).update(t);return new Uint8Array(r)};return async function(t){return ti.encrypt(t,e,!1,si)}}(e),r=Y.double(await t(si)),i=Y.double(r);return async function(e){return(await t(function(e,t,r){if(e.length&&e.length%ni==0)return ai(e,t);const i=new Uint8Array(e.length+(ni-e.length%ni));return i.set(e),i[e.length]=128,ai(i,r)}(e,r,i))).subarray(-ni)}}const ci=Y.getWebCrypto(),ui=Y.getNodeCrypto(),hi=Y.getNodeBuffer(),fi=16,di=fi,li=fi,pi=new Uint8Array(fi),yi=new Uint8Array(fi);yi[fi-1]=1;const gi=new Uint8Array(fi);async function bi(e){const t=await oi(e);return function(e,r){return t(Y.concatUint8Array([e,r]))}}async function mi(e){return Y.getWebCrypto()&&24!==e.length?(e=await ci.importKey("raw",e,{name:"AES-CTR",length:8*e.length},!1,["encrypt"]),async function(t,r){const i=await ci.encrypt({name:"AES-CTR",counter:r,length:8*fi},e,t);return new Uint8Array(i)}):Y.getNodeCrypto()?async function(t,r){const i=new ui.createCipheriv("aes-"+8*e.length+"-ctr",e,r),n=hi.concat([i.update(t),i.final()]);return new Uint8Array(n)}:async function(t,r){return ei.encrypt(t,e,r)}}async function wi(e,t){if(e!==V.symmetric.aes128&&e!==V.symmetric.aes192&&e!==V.symmetric.aes256)throw Error("EAX mode supports only AES cipher");const[r,i]=await Promise.all([bi(t),mi(t)]);return{encrypt:async function(e,t,n){const[a,s]=await Promise.all([r(pi,t),r(yi,n)]),o=await i(e,a),c=await r(gi,o);for(let e=0;e<li;e++)c[e]^=s[e]^a[e];return Y.concatUint8Array([o,c])},decrypt:async function(e,t,n){if(e.length<li)throw Error("Invalid EAX ciphertext");const a=e.subarray(0,-li),s=e.subarray(-li),[o,c,u]=await Promise.all([r(pi,t),r(yi,n),r(gi,a)]),h=u;for(let e=0;e<li;e++)h[e]^=c[e]^o[e];if(!Y.equalsUint8Array(s,h))throw Error("Authentication tag mismatch");return await i(a,o)}}}gi[fi-1]=2,wi.getNonce=function(e,t){const r=e.slice();for(let e=0;e<t.length;e++)r[8+e]^=t[e];return r},wi.blockLength=fi,wi.ivLength=di,wi.tagLength=li;const Ai=16,vi=15,_i=16;function ki(e){let t=0;for(let r=1;0==(e&r);r<<=1)t++;return t}function Ei(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r];return e}function Si(e,t){return Ei(e.slice(),t)}const Ci=new Uint8Array(Ai),Ii=new Uint8Array([1]);async function Bi(e,t){let r,i,n,a=0;function s(e,t,i,s){const o=t.length/Ai|0;!function(e,t){const r=Y.nbits(Math.max(e.length,t.length)/Ai|0)-1;for(let e=a+1;e<=r;e++)n[e]=Y.double(n[e-1]);a=r}(t,s);const c=Y.concatUint8Array([Ci.subarray(0,vi-i.length),Ii,i]),u=63&c[Ai-1];c[Ai-1]&=192;const h=r(c),f=Y.concatUint8Array([h,Si(h.subarray(0,8),h.subarray(1,9))]),d=Y.shiftRight(f.subarray(0+(u>>3),17+(u>>3)),8-(7&u)).subarray(1),l=new Uint8Array(Ai),p=new Uint8Array(t.length+_i);let y,g=0;for(y=0;y<o;y++)Ei(d,n[ki(y+1)]),p.set(Ei(e(Si(d,t)),d),g),Ei(l,e===r?t:p.subarray(g)),t=t.subarray(Ai),g+=Ai;if(t.length){Ei(d,n.x);const i=r(d);p.set(Si(t,i),g);const a=new Uint8Array(Ai);a.set(e===r?t:p.subarray(g,-_i),0),a[t.length]=128,Ei(l,a),g+=t.length}const b=Ei(r(Ei(Ei(l,d),n.$)),function(e){if(!e.length)return Ci;const t=e.length/Ai|0,i=new Uint8Array(Ai),a=new Uint8Array(Ai);for(let s=0;s<t;s++)Ei(i,n[ki(s+1)]),Ei(a,r(Si(i,e))),e=e.subarray(Ai);if(e.length){Ei(i,n.x);const t=new Uint8Array(Ai);t.set(e,0),t[e.length]=128,Ei(t,i),Ei(a,r(t))}return a}(s));return p.set(b,g),p}return function(e,t){const a=V.read(V.symmetric,e),s=new je[a](t);r=s.encrypt.bind(s),i=s.decrypt.bind(s);const o=r(Ci),c=Y.double(o);n=[],n[0]=Y.double(c),n.x=o,n.$=c}(e,t),{encrypt:async function(e,t,i){return s(r,e,t,i)},decrypt:async function(e,t,r){if(e.length<_i)throw Error("Invalid OCB ciphertext");const n=e.subarray(-_i);e=e.subarray(0,-_i);const a=s(i,e,t,r);if(Y.equalsUint8Array(n,a.subarray(-_i)))return a.subarray(0,-_i);throw Error("Authentication tag mismatch")}}}Bi.getNonce=function(e,t){const r=e.slice();for(let e=0;e<t.length;e++)r[7+e]^=t[e];return r},Bi.blockLength=Ai,Bi.ivLength=vi,Bi.tagLength=_i;const Pi=68719476704;class Mi{constructor(e,t,r,i=16,n){this.tagSize=i,this.gamma0=0,this.counter=1,this.aes=n||new Se(e,void 0,!1,"CTR");let{asm:a,heap:s}=this.aes.acquire_asm();if(a.gcm_init(),this.tagSize<4||this.tagSize>16)throw new ve("illegal tagSize value");const o=t.length||0,c=new Uint8Array(16);12!==o?(this._gcm_mac_process(t),s[0]=0,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=0,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=0,s[11]=o>>>29,s[12]=o>>>21&255,s[13]=o>>>13&255,s[14]=o>>>5&255,s[15]=o<<3&255,a.mac(ye.MAC.GCM,ye.HEAP_DATA,16),a.get_iv(ye.HEAP_DATA),a.set_iv(0,0,0,0),c.set(s.subarray(0,16))):(c.set(t),c[15]=1);const u=new DataView(c.buffer);if(this.gamma0=u.getUint32(12),a.set_nonce(u.getUint32(0),u.getUint32(4),u.getUint32(8),0),a.set_mask(0,0,0,4294967295),void 0!==r){if(r.length>Pi)throw new ve("illegal adata length");r.length?(this.adata=r,this._gcm_mac_process(r)):this.adata=void 0}else this.adata=void 0;if(this.counter<1||this.counter>4294967295)throw new RangeError("counter must be a positive 32-bit integer");a.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(e,t,r,i,n){return new Mi(t,r,i,n).encrypt(e)}static decrypt(e,t,r,i,n){return new Mi(t,r,i,n).decrypt(e)}encrypt(e){return this.AES_GCM_encrypt(e)}decrypt(e){return this.AES_GCM_decrypt(e)}AES_GCM_Encrypt_process(e){let t=0,r=e.length||0,{asm:i,heap:n}=this.aes.acquire_asm(),a=this.counter,s=this.aes.pos,o=this.aes.len,c=0,u=o+r&-16,h=0;if((a-1<<4)+o+r>Pi)throw new RangeError("counter overflow");const f=new Uint8Array(u);for(;r>0;)h=me(n,s+o,e,t,r),o+=h,t+=h,r-=h,h=i.cipher(ye.ENC.CTR,ye.HEAP_DATA+s,o),h=i.mac(ye.MAC.GCM,ye.HEAP_DATA+s,h),h&&f.set(n.subarray(s,s+h),c),a+=h>>>4,c+=h,h<o?(s+=h,o-=h):(s=0,o=0);return this.counter=a,this.aes.pos=s,this.aes.len=o,f}AES_GCM_Encrypt_finish(){let{asm:e,heap:t}=this.aes.acquire_asm(),r=this.counter,i=this.tagSize,n=this.adata,a=this.aes.pos,s=this.aes.len;const o=new Uint8Array(s+i);e.cipher(ye.ENC.CTR,ye.HEAP_DATA+a,s+15&-16),s&&o.set(t.subarray(a,a+s));let c=s;for(;15&c;c++)t[a+c]=0;e.mac(ye.MAC.GCM,ye.HEAP_DATA+a,c);const u=void 0!==n?n.length:0,h=(r-1<<4)+s;return t[0]=0,t[1]=0,t[2]=0,t[3]=u>>>29,t[4]=u>>>21,t[5]=u>>>13&255,t[6]=u>>>5&255,t[7]=u<<3&255,t[8]=t[9]=t[10]=0,t[11]=h>>>29,t[12]=h>>>21&255,t[13]=h>>>13&255,t[14]=h>>>5&255,t[15]=h<<3&255,e.mac(ye.MAC.GCM,ye.HEAP_DATA,16),e.get_iv(ye.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(ye.ENC.CTR,ye.HEAP_DATA,16),o.set(t.subarray(0,i),s),this.counter=1,this.aes.pos=0,this.aes.len=0,o}AES_GCM_Decrypt_process(e){let t=0,r=e.length||0,{asm:i,heap:n}=this.aes.acquire_asm(),a=this.counter,s=this.tagSize,o=this.aes.pos,c=this.aes.len,u=0,h=c+r>s?c+r-s&-16:0,f=c+r-h,d=0;if((a-1<<4)+c+r>Pi)throw new RangeError("counter overflow");const l=new Uint8Array(h);for(;r>f;)d=me(n,o+c,e,t,r-f),c+=d,t+=d,r-=d,d=i.mac(ye.MAC.GCM,ye.HEAP_DATA+o,d),d=i.cipher(ye.DEC.CTR,ye.HEAP_DATA+o,d),d&&l.set(n.subarray(o,o+d),u),a+=d>>>4,u+=d,o=0,c=0;return r>0&&(c+=me(n,0,e,t,r)),this.counter=a,this.aes.pos=o,this.aes.len=c,l}AES_GCM_Decrypt_finish(){let{asm:e,heap:t}=this.aes.acquire_asm(),r=this.tagSize,i=this.adata,n=this.counter,a=this.aes.pos,s=this.aes.len,o=s-r;if(s<r)throw new Ae("authentication tag not found");const c=new Uint8Array(o),u=new Uint8Array(t.subarray(a+o,a+s));let h=o;for(;15&h;h++)t[a+h]=0;e.mac(ye.MAC.GCM,ye.HEAP_DATA+a,h),e.cipher(ye.DEC.CTR,ye.HEAP_DATA+a,h),o&&c.set(t.subarray(a,a+o));const f=void 0!==i?i.length:0,d=(n-1<<4)+s-r;t[0]=0,t[1]=0,t[2]=0,t[3]=f>>>29,t[4]=f>>>21,t[5]=f>>>13&255,t[6]=f>>>5&255,t[7]=f<<3&255,t[8]=t[9]=t[10]=0,t[11]=d>>>29,t[12]=d>>>21&255,t[13]=d>>>13&255,t[14]=d>>>5&255,t[15]=d<<3&255,e.mac(ye.MAC.GCM,ye.HEAP_DATA,16),e.get_iv(ye.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(ye.ENC.CTR,ye.HEAP_DATA,16);let l=0;for(let e=0;e<r;++e)l|=u[e]^t[e];if(l)throw new _e("data integrity check failed");return this.counter=1,this.aes.pos=0,this.aes.len=0,c}AES_GCM_decrypt(e){const t=this.AES_GCM_Decrypt_process(e),r=this.AES_GCM_Decrypt_finish(),i=new Uint8Array(t.length+r.length);return t.length&&i.set(t),r.length&&i.set(r,t.length),i}AES_GCM_encrypt(e){const t=this.AES_GCM_Encrypt_process(e),r=this.AES_GCM_Encrypt_finish(),i=new Uint8Array(t.length+r.length);return t.length&&i.set(t),r.length&&i.set(r,t.length),i}_gcm_mac_process(e){let{asm:t,heap:r}=this.aes.acquire_asm(),i=0,n=e.length||0,a=0;for(;n>0;){for(a=me(r,0,e,i,n),i+=a,n-=a;15&a;)r[a++]=0;t.mac(ye.MAC.GCM,ye.HEAP_DATA,a)}}}const Di=Y.getWebCrypto(),xi=Y.getNodeCrypto(),Ki=Y.getNodeBuffer(),Ui=16,Ri="AES-GCM";async function Ti(e,t){if(e!==V.symmetric.aes128&&e!==V.symmetric.aes192&&e!==V.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(Y.getNodeCrypto())return{encrypt:async function(e,r,i=new Uint8Array){const n=new xi.createCipheriv("aes-"+8*t.length+"-gcm",t,r);n.setAAD(i);const a=Ki.concat([n.update(e),n.final(),n.getAuthTag()]);return new Uint8Array(a)},decrypt:async function(e,r,i=new Uint8Array){const n=new xi.createDecipheriv("aes-"+8*t.length+"-gcm",t,r);n.setAAD(i),n.setAuthTag(e.slice(e.length-Ui,e.length));const a=Ki.concat([n.update(e.slice(0,e.length-Ui)),n.final()]);return new Uint8Array(a)}};if(Y.getWebCrypto()&&24!==t.length){const e=await Di.importKey("raw",t,{name:Ri},!1,["encrypt","decrypt"]);return{encrypt:async function(r,i,n=new Uint8Array){if(!r.length)return Mi.encrypt(r,t,i,n);const a=await Di.encrypt({name:Ri,iv:i,additionalData:n,tagLength:8*Ui},e,r);return new Uint8Array(a)},decrypt:async function(r,i,n=new Uint8Array){if(r.length===Ui)return Mi.decrypt(r,t,i,n);const a=await Di.decrypt({name:Ri,iv:i,additionalData:n,tagLength:8*Ui},e,r);return new Uint8Array(a)}}}return{encrypt:async function(e,r,i){return Mi.encrypt(e,t,r,i)},decrypt:async function(e,r,i){return Mi.decrypt(e,t,r,i)}}}Ti.getNonce=function(e,t){const r=e.slice();for(let e=0;e<t.length;e++)r[4+e]^=t[e];return r},Ti.blockLength=16,Ti.ivLength=12,Ti.tagLength=Ui;var Qi={cfb:$r,gcm:Ti,experimentalGCM:Ti,eax:wi,ocb:Bi},zi=it((function(e){!function(e){var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},r=function(){throw Error("no PRNG")},i=new Uint8Array(32);i[0]=9;var n=t(),a=t([1]),s=t([56129,1]),o=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),c=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),h=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),f=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function d(e,t,r,i){return function(e,t,r,i,n){var a,s=0;for(a=0;a<n;a++)s|=e[t+a]^r[i+a];return(1&s-1>>>8)-1}(e,t,r,i,32)}function l(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function p(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function y(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function g(e,r){var i,n,a,s=t(),o=t();for(i=0;i<16;i++)o[i]=r[i];for(p(o),p(o),p(o),n=0;n<2;n++){for(s[0]=o[0]-65517,i=1;i<15;i++)s[i]=o[i]-65535-(s[i-1]>>16&1),s[i-1]&=65535;s[15]=o[15]-32767-(s[14]>>16&1),a=s[15]>>16&1,s[14]&=65535,y(o,s,1-a)}for(i=0;i<16;i++)e[2*i]=255&o[i],e[2*i+1]=o[i]>>8}function b(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return g(r,e),g(i,t),d(r,0,i,0)}function m(e){var t=new Uint8Array(32);return g(t,e),1&t[0]}function w(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function A(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function v(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function _(e,t,r){var i,n,a=0,s=0,o=0,c=0,u=0,h=0,f=0,d=0,l=0,p=0,y=0,g=0,b=0,m=0,w=0,A=0,v=0,_=0,k=0,E=0,S=0,C=0,I=0,B=0,P=0,M=0,D=0,x=0,K=0,U=0,R=0,T=r[0],Q=r[1],z=r[2],F=r[3],L=r[4],N=r[5],q=r[6],O=r[7],H=r[8],j=r[9],G=r[10],W=r[11],V=r[12],J=r[13],Y=r[14],Z=r[15];a+=(i=t[0])*T,s+=i*Q,o+=i*z,c+=i*F,u+=i*L,h+=i*N,f+=i*q,d+=i*O,l+=i*H,p+=i*j,y+=i*G,g+=i*W,b+=i*V,m+=i*J,w+=i*Y,A+=i*Z,s+=(i=t[1])*T,o+=i*Q,c+=i*z,u+=i*F,h+=i*L,f+=i*N,d+=i*q,l+=i*O,p+=i*H,y+=i*j,g+=i*G,b+=i*W,m+=i*V,w+=i*J,A+=i*Y,v+=i*Z,o+=(i=t[2])*T,c+=i*Q,u+=i*z,h+=i*F,f+=i*L,d+=i*N,l+=i*q,p+=i*O,y+=i*H,g+=i*j,b+=i*G,m+=i*W,w+=i*V,A+=i*J,v+=i*Y,_+=i*Z,c+=(i=t[3])*T,u+=i*Q,h+=i*z,f+=i*F,d+=i*L,l+=i*N,p+=i*q,y+=i*O,g+=i*H,b+=i*j,m+=i*G,w+=i*W,A+=i*V,v+=i*J,_+=i*Y,k+=i*Z,u+=(i=t[4])*T,h+=i*Q,f+=i*z,d+=i*F,l+=i*L,p+=i*N,y+=i*q,g+=i*O,b+=i*H,m+=i*j,w+=i*G,A+=i*W,v+=i*V,_+=i*J,k+=i*Y,E+=i*Z,h+=(i=t[5])*T,f+=i*Q,d+=i*z,l+=i*F,p+=i*L,y+=i*N,g+=i*q,b+=i*O,m+=i*H,w+=i*j,A+=i*G,v+=i*W,_+=i*V,k+=i*J,E+=i*Y,S+=i*Z,f+=(i=t[6])*T,d+=i*Q,l+=i*z,p+=i*F,y+=i*L,g+=i*N,b+=i*q,m+=i*O,w+=i*H,A+=i*j,v+=i*G,_+=i*W,k+=i*V,E+=i*J,S+=i*Y,C+=i*Z,d+=(i=t[7])*T,l+=i*Q,p+=i*z,y+=i*F,g+=i*L,b+=i*N,m+=i*q,w+=i*O,A+=i*H,v+=i*j,_+=i*G,k+=i*W,E+=i*V,S+=i*J,C+=i*Y,I+=i*Z,l+=(i=t[8])*T,p+=i*Q,y+=i*z,g+=i*F,b+=i*L,m+=i*N,w+=i*q,A+=i*O,v+=i*H,_+=i*j,k+=i*G,E+=i*W,S+=i*V,C+=i*J,I+=i*Y,B+=i*Z,p+=(i=t[9])*T,y+=i*Q,g+=i*z,b+=i*F,m+=i*L,w+=i*N,A+=i*q,v+=i*O,_+=i*H,k+=i*j,E+=i*G,S+=i*W,C+=i*V,I+=i*J,B+=i*Y,P+=i*Z,y+=(i=t[10])*T,g+=i*Q,b+=i*z,m+=i*F,w+=i*L,A+=i*N,v+=i*q,_+=i*O,k+=i*H,E+=i*j,S+=i*G,C+=i*W,I+=i*V,B+=i*J,P+=i*Y,M+=i*Z,g+=(i=t[11])*T,b+=i*Q,m+=i*z,w+=i*F,A+=i*L,v+=i*N,_+=i*q,k+=i*O,E+=i*H,S+=i*j,C+=i*G,I+=i*W,B+=i*V,P+=i*J,M+=i*Y,D+=i*Z,b+=(i=t[12])*T,m+=i*Q,w+=i*z,A+=i*F,v+=i*L,_+=i*N,k+=i*q,E+=i*O,S+=i*H,C+=i*j,I+=i*G,B+=i*W,P+=i*V,M+=i*J,D+=i*Y,x+=i*Z,m+=(i=t[13])*T,w+=i*Q,A+=i*z,v+=i*F,_+=i*L,k+=i*N,E+=i*q,S+=i*O,C+=i*H,I+=i*j,B+=i*G,P+=i*W,M+=i*V,D+=i*J,x+=i*Y,K+=i*Z,w+=(i=t[14])*T,A+=i*Q,v+=i*z,_+=i*F,k+=i*L,E+=i*N,S+=i*q,C+=i*O,I+=i*H,B+=i*j,P+=i*G,M+=i*W,D+=i*V,x+=i*J,K+=i*Y,U+=i*Z,A+=(i=t[15])*T,s+=38*(_+=i*z),o+=38*(k+=i*F),c+=38*(E+=i*L),u+=38*(S+=i*N),h+=38*(C+=i*q),f+=38*(I+=i*O),d+=38*(B+=i*H),l+=38*(P+=i*j),p+=38*(M+=i*G),y+=38*(D+=i*W),g+=38*(x+=i*V),b+=38*(K+=i*J),m+=38*(U+=i*Y),w+=38*(R+=i*Z),a=(i=(a+=38*(v+=i*Q))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),w=(i=w+n+65535)-65536*(n=Math.floor(i/65536)),A=(i=A+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),w=(i=w+n+65535)-65536*(n=Math.floor(i/65536)),A=(i=A+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=s,e[2]=o,e[3]=c,e[4]=u,e[5]=h,e[6]=f,e[7]=d,e[8]=l,e[9]=p,e[10]=y,e[11]=g,e[12]=b,e[13]=m,e[14]=w,e[15]=A}function k(e,t){_(e,t,t)}function E(e,r){var i,n=t();for(i=0;i<16;i++)n[i]=r[i];for(i=253;i>=0;i--)k(n,n),2!==i&&4!==i&&_(n,n,r);for(i=0;i<16;i++)e[i]=n[i]}function S(e,r,i){var n,a,o=new Uint8Array(32),c=new Float64Array(80),u=t(),h=t(),f=t(),d=t(),l=t(),p=t();for(a=0;a<31;a++)o[a]=r[a];for(o[31]=127&r[31]|64,o[0]&=248,w(c,i),a=0;a<16;a++)h[a]=c[a],d[a]=u[a]=f[a]=0;for(u[0]=d[0]=1,a=254;a>=0;--a)y(u,h,n=o[a>>>3]>>>(7&a)&1),y(f,d,n),A(l,u,f),v(u,u,f),A(f,h,d),v(h,h,d),k(d,l),k(p,u),_(u,f,u),_(f,h,l),A(l,u,f),v(u,u,f),k(h,u),v(f,d,p),_(u,f,s),A(u,u,d),_(f,f,u),_(u,d,p),_(d,h,c),k(h,l),y(u,h,n),y(f,d,n);for(a=0;a<16;a++)c[a+16]=u[a],c[a+32]=f[a],c[a+48]=h[a],c[a+64]=d[a];var b=c.subarray(32),m=c.subarray(16);return E(b,b),_(m,m,b),g(e,m),0}function C(e,t){return S(e,t,i)}function I(e,r){var i=t(),n=t(),a=t(),s=t(),o=t(),u=t(),h=t(),f=t(),d=t();v(i,e[1],e[0]),v(d,r[1],r[0]),_(i,i,d),A(n,e[0],e[1]),A(d,r[0],r[1]),_(n,n,d),_(a,e[3],r[3]),_(a,a,c),_(s,e[2],r[2]),A(s,s,s),v(o,n,i),v(u,s,a),A(h,s,a),A(f,n,i),_(e[0],o,u),_(e[1],f,h),_(e[2],h,u),_(e[3],o,f)}function B(e,t,r){var i;for(i=0;i<4;i++)y(e[i],t[i],r)}function P(e,r){var i=t(),n=t(),a=t();E(a,r[2]),_(i,r[0],a),_(n,r[1],a),g(e,n),e[31]^=m(i)<<7}function M(e,t,r){var i,s;for(l(e[0],n),l(e[1],a),l(e[2],a),l(e[3],n),s=255;s>=0;--s)B(e,t,i=r[s/8|0]>>(7&s)&1),I(t,e),I(e,e),B(e,t,i)}function D(e,r){var i=[t(),t(),t(),t()];l(i[0],u),l(i[1],h),l(i[2],a),_(i[3],u,h),M(e,i,r)}function x(i,n,a){var s,o,c=[t(),t(),t(),t()];for(a||r(n,32),(s=e.hash(n.subarray(0,32)))[0]&=248,s[31]&=127,s[31]|=64,D(c,s),P(i,c),o=0;o<32;o++)n[o+32]=i[o];return 0}var K=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function U(e,t){var r,i,n,a;for(i=63;i>=32;--i){for(r=0,n=i-32,a=i-12;n<a;++n)t[n]+=r-16*t[i]*K[n-(i-32)],r=Math.floor((t[n]+128)/256),t[n]-=256*r;t[n]+=r,t[i]=0}for(r=0,n=0;n<32;n++)t[n]+=r-(t[31]>>4)*K[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*K[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function R(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;U(e,r)}function T(e,r){var i=t(),s=t(),c=t(),u=t(),h=t(),d=t(),p=t();return l(e[2],a),w(e[1],r),k(c,e[1]),_(u,c,o),v(c,c,e[2]),A(u,e[2],u),k(h,u),k(d,h),_(p,d,h),_(i,p,c),_(i,i,u),function(e,r){var i,n=t();for(i=0;i<16;i++)n[i]=r[i];for(i=250;i>=0;i--)k(n,n),1!==i&&_(n,n,r);for(i=0;i<16;i++)e[i]=n[i]}(i,i),_(i,i,c),_(i,i,u),_(i,i,u),_(e[0],i,u),k(s,e[0]),_(s,s,u),b(s,c)&&_(e[0],e[0],f),k(s,e[0]),_(s,s,u),b(s,c)?-1:(m(e[0])===r[31]>>7&&v(e[0],n,e[0]),_(e[3],e[0],e[1]),0)}var Q=64;function z(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function F(e){for(var t=0;t<e.length;t++)e[t]=0}e.scalarMult=function(e,t){if(z(e,t),32!==e.length)throw Error("bad n size");if(32!==t.length)throw Error("bad p size");var r=new Uint8Array(32);return S(r,e,t),r},e.box={},e.box.keyPair=function(){var e,t,i=new Uint8Array(32),n=new Uint8Array(32);return e=i,r(t=n,32),C(e,t),{publicKey:i,secretKey:n}},e.box.keyPair.fromSecretKey=function(e){if(z(e),32!==e.length)throw Error("bad secret key size");var t=new Uint8Array(32);return C(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.sign=function(r,i){if(z(r,i),64!==i.length)throw Error("bad secret key size");var n=new Uint8Array(Q+r.length);return function(r,i,n,a){var s,o,c,u,h,f=new Float64Array(64),d=[t(),t(),t(),t()];(s=e.hash(a.subarray(0,32)))[0]&=248,s[31]&=127,s[31]|=64;var l=n+64;for(u=0;u<n;u++)r[64+u]=i[u];for(u=0;u<32;u++)r[32+u]=s[32+u];for(R(c=e.hash(r.subarray(32,l))),D(d,c),P(r,d),u=32;u<64;u++)r[u]=a[u];for(R(o=e.hash(r.subarray(0,l))),u=0;u<64;u++)f[u]=0;for(u=0;u<32;u++)f[u]=c[u];for(u=0;u<32;u++)for(h=0;h<32;h++)f[u+h]+=o[u]*s[h];U(r.subarray(32),f)}(n,r,r.length,i),n},e.sign.detached=function(t,r){for(var i=e.sign(t,r),n=new Uint8Array(Q),a=0;a<n.length;a++)n[a]=i[a];return n},e.sign.detached.verify=function(r,i,n){if(z(r,i,n),i.length!==Q)throw Error("bad signature size");if(32!==n.length)throw Error("bad public key size");var a,s=new Uint8Array(Q+r.length),o=new Uint8Array(Q+r.length);for(a=0;a<Q;a++)s[a]=i[a];for(a=0;a<r.length;a++)s[a+Q]=r[a];return function(r,i,n,a){var s,o,c=new Uint8Array(32),u=[t(),t(),t(),t()],h=[t(),t(),t(),t()];if(n<64)return-1;if(T(h,a))return-1;for(s=0;s<n;s++)r[s]=i[s];for(s=0;s<32;s++)r[s+32]=a[s];if(R(o=e.hash(r.subarray(0,n))),M(u,h,o),D(h,i.subarray(32)),I(u,h),P(c,u),n-=64,d(i,0,c,0)){for(s=0;s<n;s++)r[s]=0;return-1}for(s=0;s<n;s++)r[s]=i[s+64];return n}(o,s,s.length,n)>=0},e.sign.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(64);return x(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(z(e),64!==e.length)throw Error("bad secret key size");for(var t=new Uint8Array(32),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(z(e),32!==e.length)throw Error("bad seed size");for(var t=new Uint8Array(32),r=new Uint8Array(64),i=0;i<32;i++)r[i]=e[i];return x(t,r,!0),{publicKey:t,secretKey:r}},e.setPRNG=function(e){r=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){e.setPRNG((function(e,r){var i,n=new Uint8Array(r);for(i=0;i<r;i+=65536)t.getRandomValues(n.subarray(i,i+Math.min(r-i,65536)));for(i=0;i<r;i++)e[i]=n[i];F(n)}))}else void 0!==nt&&(t=void 0)&&t.randomBytes&&e.setPRNG((function(e,r){var i,n=t.randomBytes(r);for(i=0;i<r;i++)e[i]=n[i];F(n)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})}));const Fi=Y.getNodeCrypto();function Li(e){const t=new Uint8Array(e);if(Fi){const e=Fi.randomBytes(t.length);t.set(e)}else{if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("No secure random number generator available.");crypto.getRandomValues(t)}return t}async function Ni(e,t){const r=await Y.getBigInteger();if(t.lt(e))throw Error("Illegal parameter value: max <= min");const i=t.sub(e),n=i.byteLength();return new r(await Li(n+8)).mod(i).add(e)}var qi=/*#__PURE__*/Object.freeze({__proto__:null,getRandomBytes:Li,getRandomBigInteger:Ni});async function Oi(e,t,r){const i=await Y.getBigInteger(),n=new i(1),a=n.leftShift(new i(e-1)),s=new i(30),o=[1,6,5,4,3,2,1,4,3,2,1,2,1,4,3,2,1,2,1,4,3,2,1,6,5,4,3,2,1,2],c=await Ni(a,a.leftShift(n));let u=c.mod(s).toNumber();do{c.iadd(new i(o[u])),u=(u+o[u])%o.length,c.bitLength()>e&&(c.imod(a.leftShift(n)).iadd(a),u=c.mod(s).toNumber())}while(!await Hi(c,t,r));return c}async function Hi(e,t,r){return!(t&&!e.dec().gcd(t).isOne())&&(!!await async function(e){const t=await Y.getBigInteger();return ji.every((r=>0!==e.mod(new t(r))))}(e)&&(!!await async function(e,t){const r=await Y.getBigInteger();return t=t||new r(2),t.modExp(e.dec(),e).isOne()}(e)&&!!await async function(e,t,r){const i=await Y.getBigInteger(),n=e.bitLength();t||(t=Math.max(1,n/48|0));const a=e.dec();let s=0;for(;!a.getBit(s);)s++;const o=e.rightShift(new i(s));for(;t>0;t--){let t,n=(r?r():await Ni(new i(2),a)).modExp(o,e);if(!n.isOne()&&!n.equal(a)){for(t=1;t<s;t++){if(n=n.mul(n).mod(e),n.isOne())return!1;if(n.equal(a))break}if(t===s)return!1}}return!0}(e,r)))}const ji=[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,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999,3001,3011,3019,3023,3037,3041,3049,3061,3067,3079,3083,3089,3109,3119,3121,3137,3163,3167,3169,3181,3187,3191,3203,3209,3217,3221,3229,3251,3253,3257,3259,3271,3299,3301,3307,3313,3319,3323,3329,3331,3343,3347,3359,3361,3371,3373,3389,3391,3407,3413,3433,3449,3457,3461,3463,3467,3469,3491,3499,3511,3517,3527,3529,3533,3539,3541,3547,3557,3559,3571,3581,3583,3593,3607,3613,3617,3623,3631,3637,3643,3659,3671,3673,3677,3691,3697,3701,3709,3719,3727,3733,3739,3761,3767,3769,3779,3793,3797,3803,3821,3823,3833,3847,3851,3853,3863,3877,3881,3889,3907,3911,3917,3919,3923,3929,3931,3943,3947,3967,3989,4001,4003,4007,4013,4019,4021,4027,4049,4051,4057,4073,4079,4091,4093,4099,4111,4127,4129,4133,4139,4153,4157,4159,4177,4201,4211,4217,4219,4229,4231,4241,4243,4253,4259,4261,4271,4273,4283,4289,4297,4327,4337,4339,4349,4357,4363,4373,4391,4397,4409,4421,4423,4441,4447,4451,4457,4463,4481,4483,4493,4507,4513,4517,4519,4523,4547,4549,4561,4567,4583,4591,4597,4603,4621,4637,4639,4643,4649,4651,4657,4663,4673,4679,4691,4703,4721,4723,4729,4733,4751,4759,4783,4787,4789,4793,4799,4801,4813,4817,4831,4861,4871,4877,4889,4903,4909,4919,4931,4933,4937,4943,4951,4957,4967,4969,4973,4987,4993,4999];const Gi=[];function Wi(e,t){const r=e.length;if(r>t-11)throw Error("Message too long");const i=function(e){const t=new Uint8Array(e);let r=0;for(;r<e;){const i=Li(e-r);for(let e=0;e<i.length;e++)0!==i[e]&&(t[r++]=i[e])}return t}(t-r-3),n=new Uint8Array(t);return n[1]=2,n.set(i,2),n.set(e,t-r),n}function Vi(e,t){let r=2,i=1;for(let t=r;t<e.length;t++)i&=0!==e[t],r+=i;const n=r-2,a=e.subarray(r+1),s=0===e[0]&2===e[1]&n>=8&!i;if(t)return Y.selectUint8Array(s,a,t);if(s)return a;throw Error("Decryption error")}async function Ji(e,t,r){let i;if(t.length!==Gr.getHashByteLength(e))throw Error("Invalid hash length");const n=new Uint8Array(Gi[e].length);for(i=0;i<Gi[e].length;i++)n[i]=Gi[e][i];const a=n.length+t.length;if(r<a+11)throw Error("Intended encoded message length too short");const s=new Uint8Array(r-a-3).fill(255),o=new Uint8Array(r);return o[1]=1,o.set(s,2),o.set(n,r-a),o.set(t,r-t.length),o}Gi[1]=[48,32,48,12,6,8,42,134,72,134,247,13,2,5,5,0,4,16],Gi[2]=[48,33,48,9,6,5,43,14,3,2,26,5,0,4,20],Gi[3]=[48,33,48,9,6,5,43,36,3,2,1,5,0,4,20],Gi[8]=[48,49,48,13,6,9,96,134,72,1,101,3,4,2,1,5,0,4,32],Gi[9]=[48,65,48,13,6,9,96,134,72,1,101,3,4,2,2,5,0,4,48],Gi[10]=[48,81,48,13,6,9,96,134,72,1,101,3,4,2,3,5,0,4,64],Gi[11]=[48,45,48,13,6,9,96,134,72,1,101,3,4,2,4,5,0,4,28];var Yi=/*#__PURE__*/Object.freeze({__proto__:null,emeEncode:Wi,emeDecode:Vi,emsaEncode:Ji});const Zi=Y.getWebCrypto(),Xi=Y.getNodeCrypto(),$i=void 0,en=Xi?$i.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())})):void 0,tn=Xi?$i.define("RSAPubliceKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())})):void 0;var rn=/*#__PURE__*/Object.freeze({__proto__:null,sign:async function(e,t,r,i,n,a,s,o,c){if(t&&!Y.isStream(t))if(Y.getWebCrypto())try{return await async function(e,t,r,i,n,a,s,o){const c=await async function(e,t,r,i,n,a){const s=await Y.getBigInteger(),o=new s(i),c=new s(n),u=new s(r);let h=u.mod(c.dec()),f=u.mod(o.dec());return f=f.toUint8Array(),h=h.toUint8Array(),{kty:"RSA",n:ie(e,!0),e:ie(t,!0),d:ie(r,!0),p:ie(n,!0),q:ie(i,!0),dp:ie(h,!0),dq:ie(f,!0),qi:ie(a,!0),ext:!0}}(r,i,n,a,s,o),u={name:"RSASSA-PKCS1-v1_5",hash:{name:e}},h=await Zi.importKey("jwk",c,u,!1,["sign"]);return new Uint8Array(await Zi.sign("RSASSA-PKCS1-v1_5",h,t))}(V.read(V.webHash,e),t,r,i,n,a,s,o)}catch(e){Y.printDebugError(e)}else if(Y.getNodeCrypto())return async function(e,t,r,i,n,a,s,o){const{default:c}=await Promise.resolve().then((function(){return ky})),u=new c(a),h=new c(s),f=new c(n),d=f.mod(h.subn(1)),l=f.mod(u.subn(1)),p=Xi.createSign(V.read(V.hash,e));p.write(t),p.end();const y={version:0,modulus:new c(r),publicExponent:new c(i),privateExponent:new c(n),prime1:new c(s),prime2:new c(a),exponent1:d,exponent2:l,coefficient:new c(o)};if(void 0!==Xi.createPrivateKey){const e=en.encode(y,"der");return new Uint8Array(p.sign({key:e,format:"der",type:"pkcs1"}))}const g=en.encode(y,"pem",{label:"RSA PRIVATE KEY"});return new Uint8Array(p.sign(g))}(e,t,r,i,n,a,s,o);return async function(e,t,r,i){const n=await Y.getBigInteger();t=new n(t);const a=new n(await Ji(e,i,t.byteLength()));if(r=new n(r),a.gte(t))throw Error("Message size cannot exceed modulus size");return a.modExp(r,t).toUint8Array("be",t.byteLength())}(e,r,n,c)},verify:async function(e,t,r,i,n,a){if(t&&!Y.isStream(t))if(Y.getWebCrypto())try{return await async function(e,t,r,i,n){const a=function(e,t){return{kty:"RSA",n:ie(e,!0),e:ie(t,!0),ext:!0}}(i,n),s=await Zi.importKey("jwk",a,{name:"RSASSA-PKCS1-v1_5",hash:{name:e}},!1,["verify"]);return Zi.verify("RSASSA-PKCS1-v1_5",s,r,t)}(V.read(V.webHash,e),t,r,i,n)}catch(e){Y.printDebugError(e)}else if(Y.getNodeCrypto())return async function(e,t,r,i,n){const{default:a}=await Promise.resolve().then((function(){return ky})),s=Xi.createVerify(V.read(V.hash,e));s.write(t),s.end();const o={modulus:new a(i),publicExponent:new a(n)};let c;if(void 0!==Xi.createPrivateKey){c={key:tn.encode(o,"der"),format:"der",type:"pkcs1"}}else c=tn.encode(o,"pem",{label:"RSA PUBLIC KEY"});try{return await s.verify(c,r)}catch(e){return!1}}(e,t,r,i,n);return async function(e,t,r,i,n){const a=await Y.getBigInteger();if(r=new a(r),t=new a(t),i=new a(i),t.gte(r))throw Error("Signature size cannot exceed modulus size");const s=t.modExp(i,r).toUint8Array("be",r.byteLength()),o=await Ji(e,n,r.byteLength());return Y.equalsUint8Array(s,o)}(e,r,i,n,a)},encrypt:async function(e,t,r){return Y.getNodeCrypto()?async function(e,t,r){const{default:i}=await Promise.resolve().then((function(){return ky})),n={modulus:new i(t),publicExponent:new i(r)};let a;if(void 0!==Xi.createPrivateKey){a={key:tn.encode(n,"der"),format:"der",type:"pkcs1",padding:Xi.constants.RSA_PKCS1_PADDING}}else{a={key:tn.encode(n,"pem",{label:"RSA PUBLIC KEY"}),padding:Xi.constants.RSA_PKCS1_PADDING}}return new Uint8Array(Xi.publicEncrypt(a,e))}(e,t,r):async function(e,t,r){const i=await Y.getBigInteger();if(t=new i(t),e=new i(Wi(e,t.byteLength())),r=new i(r),e.gte(t))throw Error("Message size cannot exceed modulus size");return e.modExp(r,t).toUint8Array("be",t.byteLength())}(e,t,r)},decrypt:async function(e,t,r,i,n,a,s,o){if(Y.getNodeCrypto()&&!o)try{return await async function(e,t,r,i,n,a,s){const{default:o}=await Promise.resolve().then((function(){return ky})),c=new o(n),u=new o(a),h=new o(i),f=h.mod(u.subn(1)),d=h.mod(c.subn(1)),l={version:0,modulus:new o(t),publicExponent:new o(r),privateExponent:new o(i),prime1:new o(a),prime2:new o(n),exponent1:f,exponent2:d,coefficient:new o(s)};let p;if(void 0!==Xi.createPrivateKey){p={key:en.encode(l,"der"),format:"der",type:"pkcs1",padding:Xi.constants.RSA_PKCS1_PADDING}}else{p={key:en.encode(l,"pem",{label:"RSA PRIVATE KEY"}),padding:Xi.constants.RSA_PKCS1_PADDING}}try{return new Uint8Array(Xi.privateDecrypt(p,e))}catch(e){throw Error("Decryption error")}}(e,t,r,i,n,a,s)}catch(e){Y.printDebugError(e)}return async function(e,t,r,i,n,a,s,o){const c=await Y.getBigInteger();if(e=new c(e),t=new c(t),r=new c(r),i=new c(i),n=new c(n),a=new c(a),s=new c(s),e.gte(t))throw Error("Data too large.");const u=i.mod(a.dec()),h=i.mod(n.dec()),f=(await Ni(new c(2),t)).mod(t),d=f.modInv(t).modExp(r,t);e=e.mul(d).mod(t);const l=e.modExp(h,n),p=e.modExp(u,a),y=s.mul(p.sub(l)).mod(a);let g=y.mul(n).add(l);return g=g.mul(f).mod(t),Vi(g.toUint8Array("be",t.byteLength()),o)}(e,t,r,i,n,a,s,o)},generate:async function(e,t){if(t=new(await Y.getBigInteger())(t),Y.getWebCrypto()){const r={name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:t.toUint8Array(),hash:{name:"SHA-1"}},i=await Zi.generateKey(r,!0,["sign","verify"]),n=await Zi.exportKey("jwk",i.privateKey);return{n:re(n.n),e:t.toUint8Array(),d:re(n.d),p:re(n.q),q:re(n.p),u:re(n.qi)}}if(Y.getNodeCrypto()&&Xi.generateKeyPair&&en){const r={modulusLength:e,publicExponent:t.toNumber(),publicKeyEncoding:{type:"pkcs1",format:"der"},privateKeyEncoding:{type:"pkcs1",format:"der"}},i=await new Promise(((e,t)=>{Xi.generateKeyPair("rsa",r,((r,i,n)=>{r?t(r):e(en.decode(n,"der"))}))}));return{n:i.modulus.toArrayLike(Uint8Array),e:i.publicExponent.toArrayLike(Uint8Array),d:i.privateExponent.toArrayLike(Uint8Array),p:i.prime2.toArrayLike(Uint8Array),q:i.prime1.toArrayLike(Uint8Array),u:i.coefficient.toArrayLike(Uint8Array)}}let r,i,n;do{i=await Oi(e-(e>>1),t,40),r=await Oi(e>>1,t,40),n=r.mul(i)}while(n.bitLength()!==e);const a=r.dec().imul(i.dec());return i.lt(r)&&([r,i]=[i,r]),{n:n.toUint8Array(),e:t.toUint8Array(),d:t.modInv(a).toUint8Array(),p:r.toUint8Array(),q:i.toUint8Array(),u:r.modInv(i).toUint8Array()}},validateParams:async function(e,t,r,i,n,a){const s=await Y.getBigInteger();if(e=new s(e),i=new s(i),n=new s(n),!i.mul(n).equal(e))return!1;const o=new s(2);if(a=new s(a),!i.mul(a).mod(n).isOne())return!1;t=new s(t),r=new s(r);const c=new s(Math.floor(e.bitLength()/3)),u=await Ni(o,o.leftShift(c)),h=u.mul(r).mul(t);return!(!h.mod(i.dec()).equal(u)||!h.mod(n.dec()).equal(u))}});var nn=/*#__PURE__*/Object.freeze({__proto__:null,encrypt:async function(e,t,r,i){const n=await Y.getBigInteger();t=new n(t),r=new n(r),i=new n(i);const a=new n(Wi(e,t.byteLength())),s=await Ni(new n(1),t.dec());return{c1:r.modExp(s,t).toUint8Array(),c2:i.modExp(s,t).imul(a).imod(t).toUint8Array()}},decrypt:async function(e,t,r,i,n){const a=await Y.getBigInteger();return e=new a(e),t=new a(t),r=new a(r),i=new a(i),Vi(e.modExp(i,r).modInv(r).imul(t).imod(r).toUint8Array("be",r.byteLength()),n)},validateParams:async function(e,t,r,i){const n=await Y.getBigInteger();e=new n(e),t=new n(t),r=new n(r);const a=new n(1);if(t.lte(a)||t.gte(e))return!1;const s=new n(e.bitLength()),o=new n(1023);if(s.lt(o))return!1;if(!t.modExp(e.dec(),e).isOne())return!1;let c=t;const u=new n(1),h=new n(2).leftShift(new n(17));for(;u.lt(h);){if(c=c.mul(t).imod(e),c.isOne())return!1;u.iinc()}i=new n(i);const f=new n(2),d=await Ni(f.leftShift(s.dec()),f.leftShift(s)),l=e.dec().imul(d).iadd(i);return!!r.equal(t.modExp(l,e))}});class an{constructor(e){if(e instanceof an)this.oid=e.oid;else if(Y.isArray(e)||Y.isUint8Array(e)){if(6===(e=new Uint8Array(e))[0]){if(e[1]!==e.length-2)throw Error("Length mismatch in DER encoded oid");e=e.subarray(2)}this.oid=e}else this.oid=""}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.oid=e.subarray(1,1+t),1+this.oid.length}throw Error("Invalid oid")}write(){return Y.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return Y.uint8ArrayToHex(this.oid)}getName(){const e=this.toHex();if(V.curve[e])return V.write(V.curve,e);throw Error("Unknown curve object identifier.")}}function sn(e,t){return e.keyPair({priv:t})}function on(e,t){const r=e.keyPair({pub:t});if(!0!==r.validate().result)throw Error("Invalid elliptic public key");return r}async function cn(e){if(!ne.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:t}=await Promise.resolve().then((function(){return qg}));return new t.ec(e)}function un(e){let t,r=0;const i=e[0];return i<192?([r]=e,t=1):i<255?(r=(e[0]-192<<8)+e[1]+192,t=2):255===i&&(r=Y.readNumber(e.subarray(1,5)),t=5),{len:r,offset:t}}function hn(e){return e<192?new Uint8Array([e]):e>191&&e<8384?new Uint8Array([192+(e-192>>8),e-192&255]):Y.concatUint8Array([new Uint8Array([255]),Y.writeNumber(e,4)])}function fn(e){if(e<0||e>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+e])}function dn(e){return new Uint8Array([192|e])}function ln(e,t){return Y.concatUint8Array([dn(e),hn(t)])}function pn(e){return[V.packet.literalData,V.packet.compressedData,V.packet.symmetricallyEncryptedData,V.packet.symEncryptedIntegrityProtectedData,V.packet.aeadEncryptedData].includes(e)}async function yn(e,t){const r=M(e);let i,n;try{const s=await r.peekBytes(2);if(!s||s.length<2||0==(128&s[0]))throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const o=await r.readByte();let c,u,h=-1,f=-1;f=0,0!=(64&o)&&(f=1),f?h=63&o:(h=(63&o)>>2,u=3&o);const d=pn(h);let l,p=null;if(d){if("array"===Y.isStream(e)){const e=new a;i=D(e),p=e}else{const e=new E;i=D(e.writable),p=e.readable}n=t({tag:h,packet:p})}else p=[];do{if(f){const e=await r.readByte();if(l=!1,e<192)c=e;else if(e>=192&&e<224)c=(e-192<<8)+await r.readByte()+192;else if(e>223&&e<255){if(c=1<<(31&e),l=!0,!d)throw new TypeError("This packet type does not support partial lengths.")}else c=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte()}else switch(u){case 0:c=await r.readByte();break;case 1:c=await r.readByte()<<8|await r.readByte();break;case 2:c=await r.readByte()<<24|await r.readByte()<<16|await r.readByte()<<8|await r.readByte();break;default:c=1/0}if(c>0){let e=0;for(;;){i&&await i.ready;const{done:t,value:n}=await r.read();if(t){if(c===1/0)break;throw Error("Unexpected end of packet")}const a=c===1/0?n:n.subarray(0,c-e);if(i?await i.write(a):p.push(a),e+=n.length,e>=c){r.unshift(n.subarray(c-e+n.length));break}}}}while(l);const y=await r.peekBytes(d?1/0:2);return i?(await i.ready,await i.close()):(p=Y.concatUint8Array(p),await t({tag:h,packet:p})),!y||!y.length}catch(e){if(i)return await i.abort(e),!0;throw e}finally{i&&await n,r.releaseLock()}}class gn extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,gn),this.name="UnsupportedError"}}class bn{constructor(e,t){this.tag=e,this.rawContent=t}write(){return this.rawContent}}const mn=Y.getWebCrypto(),wn=Y.getNodeCrypto(),An={p256:"P-256",p384:"P-384",p521:"P-521"},vn=wn?wn.getCurves():[],_n=wn?{secp256k1:vn.includes("secp256k1")?"secp256k1":void 0,p256:vn.includes("prime256v1")?"prime256v1":void 0,p384:vn.includes("secp384r1")?"secp384r1":void 0,p521:vn.includes("secp521r1")?"secp521r1":void 0,ed25519:vn.includes("ED25519")?"ED25519":void 0,curve25519:vn.includes("X25519")?"X25519":void 0,brainpoolP256r1:vn.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:vn.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:vn.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},kn={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:V.publicKey.ecdsa,hash:V.hash.sha256,cipher:V.symmetric.aes128,node:_n.p256,web:An.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:V.publicKey.ecdsa,hash:V.hash.sha384,cipher:V.symmetric.aes192,node:_n.p384,web:An.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:V.publicKey.ecdsa,hash:V.hash.sha512,cipher:V.symmetric.aes256,node:_n.p521,web:An.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:V.publicKey.ecdsa,hash:V.hash.sha256,cipher:V.symmetric.aes128,node:_n.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:V.publicKey.eddsaLegacy,hash:V.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:V.publicKey.ecdh,hash:V.hash.sha256,cipher:V.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:V.publicKey.ecdsa,hash:V.hash.sha256,cipher:V.symmetric.aes128,node:_n.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:V.publicKey.ecdsa,hash:V.hash.sha384,cipher:V.symmetric.aes192,node:_n.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:V.publicKey.ecdsa,hash:V.hash.sha512,cipher:V.symmetric.aes256,node:_n.brainpoolP512r1,payloadSize:64}};class En{constructor(e,t){try{(Y.isArray(e)||Y.isUint8Array(e))&&(e=new an(e)),e instanceof an&&(e=e.getName()),this.name=V.write(V.curve,e)}catch(e){throw new gn("Unknown curve")}t=t||kn[this.name],this.keyType=t.keyType,this.oid=t.oid,this.hash=t.hash,this.cipher=t.cipher,this.node=t.node&&kn[this.name],this.web=t.web&&kn[this.name],this.payloadSize=t.payloadSize,this.web&&Y.getWebCrypto()?this.type="web":this.node&&Y.getNodeCrypto()?this.type="node":"curve25519"===this.name?this.type="curve25519":"ed25519"===this.name&&(this.type="ed25519")}async genKeyPair(){let e;switch(this.type){case"web":try{return await async function(e){const t=await mn.generateKey({name:"ECDSA",namedCurve:An[e]},!0,["sign","verify"]),r=await mn.exportKey("jwk",t.privateKey),i=await mn.exportKey("jwk",t.publicKey);return{publicKey:Cn(i),privateKey:re(r.d)}}(this.name)}catch(e){Y.printDebugError("Browser did not support generating ec key "+e.message);break}case"node":return async function(e){const t=wn.createECDH(_n[e]);return await t.generateKeys(),{publicKey:new Uint8Array(t.getPublicKey()),privateKey:new Uint8Array(t.getPrivateKey())}}(this.name);case"curve25519":{const t=Li(32);t[0]=127&t[0]|64,t[31]&=248;const r=t.slice().reverse();e=zi.box.keyPair.fromSecretKey(r);return{publicKey:Y.concatUint8Array([new Uint8Array([64]),e.publicKey]),privateKey:t}}case"ed25519":{const e=Li(32),t=zi.sign.keyPair.fromSeed(e);return{publicKey:Y.concatUint8Array([new Uint8Array([64]),t.publicKey]),privateKey:e}}}const t=await cn(this.name);return e=await t.genKeyPair({entropy:Y.uint8ArrayToString(Li(32))}),{publicKey:new Uint8Array(e.getPublic("array",!1)),privateKey:e.getPrivate().toArrayLike(Uint8Array)}}}async function Sn(e,t,r,i){const n={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:e===V.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},a=t.getName();if(!n[a])return!1;if("curve25519"===a){i=i.slice().reverse();const{publicKey:e}=zi.box.keyPair.fromSecretKey(i);r=new Uint8Array(r);const t=new Uint8Array([64,...e]);return!!Y.equalsUint8Array(t,r)}const s=await cn(a);try{r=on(s,r).getPublic()}catch(e){return!1}return!!sn(s,i).getPublic().eq(r)}function Cn(e){const t=re(e.x),r=re(e.y),i=new Uint8Array(t.length+r.length+1);return i[0]=4,i.set(t,1),i.set(r,t.length+1),i}function In(e,t,r){const i=e,n=r.slice(1,i+1),a=r.slice(i+1,2*i+1);return{kty:"EC",crv:t,x:ie(n,!0),y:ie(a,!0),ext:!0}}function Bn(e,t,r,i){const n=In(e,t,r);return n.d=ie(i,!0),n}const Pn=Y.getWebCrypto(),Mn=Y.getNodeCrypto();async function Dn(e,t,r,i,n,a){const s=new En(e);if(r&&!Y.isStream(r)){const e={publicKey:i,privateKey:n};switch(s.type){case"web":try{return await async function(e,t,r,i){const n=e.payloadSize,a=Bn(e.payloadSize,An[e.name],i.publicKey,i.privateKey),s=await Pn.importKey("jwk",a,{name:"ECDSA",namedCurve:An[e.name],hash:{name:V.read(V.webHash,e.hash)}},!1,["sign"]),o=new Uint8Array(await Pn.sign({name:"ECDSA",namedCurve:An[e.name],hash:{name:V.read(V.webHash,t)}},s,r));return{r:o.slice(0,n),s:o.slice(n,n<<1)}}(s,t,r,e)}catch(e){if("p521"!==s.name&&("DataError"===e.name||"OperationError"===e.name))throw e;Y.printDebugError("Browser did not support signing: "+e.message)}break;case"node":{const i=await async function(e,t,r,i){const n=Mn.createSign(V.read(V.hash,t));n.write(r),n.end();const a=Rn.encode({version:1,parameters:e.oid,privateKey:Array.from(i.privateKey),publicKey:{unused:0,data:Array.from(i.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return Un.decode(n.sign(a),"der")}(s,t,r,e);return{r:i.r.toArrayLike(Uint8Array),s:i.s.toArrayLike(Uint8Array)}}}}return async function(e,t,r){const i=await cn(e.name),n=sn(i,r),a=n.sign(t);return{r:a.r.toArrayLike(Uint8Array),s:a.s.toArrayLike(Uint8Array)}}(s,a,n)}async function xn(e,t,r,i,n,a){const s=new En(e);if(i&&!Y.isStream(i))switch(s.type){case"web":try{return await async function(e,t,{r,s:i},n,a){const s=In(e.payloadSize,An[e.name],a),o=await Pn.importKey("jwk",s,{name:"ECDSA",namedCurve:An[e.name],hash:{name:V.read(V.webHash,e.hash)}},!1,["verify"]),c=Y.concatUint8Array([r,i]).buffer;return Pn.verify({name:"ECDSA",namedCurve:An[e.name],hash:{name:V.read(V.webHash,t)}},o,c,n)}(s,t,r,i,n)}catch(e){if("p521"!==s.name&&("DataError"===e.name||"OperationError"===e.name))throw e;Y.printDebugError("Browser did not support verifying: "+e.message)}break;case"node":return async function(e,t,{r,s:i},n,a){const{default:s}=await Promise.resolve().then((function(){return ky})),o=Mn.createVerify(V.read(V.hash,t));o.write(n),o.end();const c=Qn.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:e.oid},subjectPublicKey:{unused:0,data:Array.from(a)}},"pem",{label:"PUBLIC KEY"}),u=Un.encode({r:new s(r),s:new s(i)},"der");try{return o.verify(c,u)}catch(e){return!1}}(s,t,r,i,n)}return async function(e,t,r,i){const n=await cn(e.name),a=on(n,i);return a.verify(r,t)}(s,r,void 0===t?i:a,n)}const Kn=void 0,Un=Mn?Kn.define("ECDSASignature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())})):void 0,Rn=Mn?Kn.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().any(),this.key("publicKey").explicit(1).optional().bitstr())})):void 0,Tn=Mn?Kn.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())})):void 0,Qn=Mn?Kn.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(Tn),this.key("subjectPublicKey").bitstr())})):void 0;var zn=/*#__PURE__*/Object.freeze({__proto__:null,sign:Dn,verify:xn,validateParams:async function(e,t,r){const i=new En(e);if(i.keyType!==V.publicKey.ecdsa)return!1;switch(i.type){case"web":case"node":{const i=Li(8),n=V.hash.sha256,a=await Gr.digest(n,i);try{const s=await Dn(e,n,i,t,r,a);return await xn(e,n,s,i,t,a)}catch(e){return!1}}default:return Sn(V.publicKey.ecdsa,e,t,r)}}});zi.hash=e=>new Uint8Array($t().update(e).digest());var Fn=/*#__PURE__*/Object.freeze({__proto__:null,sign:async function(e,t,r,i,n,a){if(Gr.getHashByteLength(t)<Gr.getHashByteLength(V.hash.sha256))throw Error("Hash algorithm too weak for EdDSA.");const s=Y.concatUint8Array([n,i.subarray(1)]),o=zi.sign.detached(a,s);if(ne.checkEdDSAFaultySignatures&&!zi.sign.detached.verify(a,o,i.subarray(1)))throw Error("Transient signing failure");return{r:o.subarray(0,32),s:o.subarray(32)}},verify:async function(e,t,{r,s:i},n,a,s){if(Gr.getHashByteLength(t)<Gr.getHashByteLength(V.hash.sha256))throw Error("Hash algorithm too weak for EdDSA.");const o=Y.concatUint8Array([r,i]);return zi.sign.detached.verify(s,o,a.subarray(1))},validateParams:async function(e,t,r){if("ed25519"!==e.getName())return!1;const{publicKey:i}=zi.sign.keyPair.fromSeed(r),n=new Uint8Array([64,...i]);return Y.equalsUint8Array(t,n)}});function Ln(e){if(e===V.publicKey.ed25519)return V.hash.sha256;throw Error("Unknown EdDSA algo")}zi.hash=e=>new Uint8Array($t().update(e).digest());var Nn=/*#__PURE__*/Object.freeze({__proto__:null,generate:async function(e){if(e===V.publicKey.ed25519){const e=Li(32),{publicKey:t}=zi.sign.keyPair.fromSeed(e);return{A:t,seed:e}}throw Error("Unsupported EdDSA algorithm")},sign:async function(e,t,r,i,n,a){if(Gr.getHashByteLength(t)<Gr.getHashByteLength(Ln(e)))throw Error("Hash algorithm too weak for EdDSA.");switch(e){case V.publicKey.ed25519:{const e=Y.concatUint8Array([n,i]),t=zi.sign.detached(a,e);if(ne.checkEdDSAFaultySignatures&&!zi.sign.detached.verify(a,t,i))throw Error("Transient signing failure");return{RS:t}}case V.publicKey.ed448:default:throw Error("Unsupported EdDSA algorithm")}},verify:async function(e,t,{RS:r},i,n,a){if(Gr.getHashByteLength(t)<Gr.getHashByteLength(Ln(e)))throw Error("Hash algorithm too weak for EdDSA.");switch(e){case V.publicKey.ed25519:return zi.sign.detached.verify(a,r,n);case V.publicKey.ed448:default:throw Error("Unsupported EdDSA algorithm")}},validateParams:async function(e,t,r){switch(e){case V.publicKey.ed25519:{const{publicKey:e}=zi.sign.keyPair.fromSeed(r);return Y.equalsUint8Array(t,e)}case V.publicKey.ed448:default:return!1}},getPreferredHashAlgo:Ln});function qn(e,t){const r=new je["aes"+8*e.length](e),i=new Uint32Array([2795939494,2795939494]),n=Hn(t);let a=i;const s=n,o=n.length/2,c=new Uint32Array([0,0]);let u=new Uint32Array(4);for(let e=0;e<=5;++e)for(let t=0;t<o;++t)c[1]=o*e+(1+t),u[0]=a[0],u[1]=a[1],u[2]=s[2*t],u[3]=s[2*t+1],u=Hn(r.encrypt(jn(u))),a=u.subarray(0,2),a[0]^=c[0],a[1]^=c[1],s[2*t]=u[2],s[2*t+1]=u[3];return jn(a,s)}function On(e,t){const r=new je["aes"+8*e.length](e),i=new Uint32Array([2795939494,2795939494]),n=Hn(t);let a=n.subarray(0,2);const s=n.subarray(2),o=n.length/2-1,c=new Uint32Array([0,0]);let u=new Uint32Array(4);for(let e=5;e>=0;--e)for(let t=o-1;t>=0;--t)c[1]=o*e+(t+1),u[0]=a[0]^c[0],u[1]=a[1]^c[1],u[2]=s[2*t],u[3]=s[2*t+1],u=Hn(r.decrypt(jn(u))),a=u.subarray(0,2),s[2*t]=u[2],s[2*t+1]=u[3];if(a[0]===i[0]&&a[1]===i[1])return jn(s);throw Error("Key Data Integrity failed")}function Hn(e){const{length:t}=e,r=function(e){if(Y.isString(e)){const{length:t}=e,r=new ArrayBuffer(t),i=new Uint8Array(r);for(let r=0;r<t;++r)i[r]=e.charCodeAt(r);return r}return new Uint8Array(e).buffer}(e),i=new DataView(r),n=new Uint32Array(t/4);for(let e=0;e<t/4;++e)n[e]=i.getUint32(4*e);return n}function jn(){let e=0;for(let t=0;t<arguments.length;++t)e+=4*arguments[t].length;const t=new ArrayBuffer(e),r=new DataView(t);let i=0;for(let e=0;e<arguments.length;++e){for(let t=0;t<arguments[e].length;++t)r.setUint32(i+4*t,arguments[e][t]);i+=4*arguments[e].length}return new Uint8Array(t)}var Gn=/*#__PURE__*/Object.freeze({__proto__:null,wrap:qn,unwrap:On});function Wn(e){const t=8-e.length%8,r=new Uint8Array(e.length+t).fill(t);return r.set(e),r}function Vn(e){const t=e.length;if(t>0){const r=e[t-1];if(r>=1){const i=e.subarray(t-r),n=new Uint8Array(r).fill(r);if(Y.equalsUint8Array(i,n))return e.subarray(0,t-r)}}throw Error("Invalid padding")}var Jn=/*#__PURE__*/Object.freeze({__proto__:null,encode:Wn,decode:Vn});const Yn=Y.getWebCrypto(),Zn=Y.getNodeCrypto();function Xn(e,t,r,i){return Y.concatUint8Array([t.write(),new Uint8Array([e]),r.write(!0),Y.stringToUint8Array("Anonymous Sender "),r.replacementFingerprint||i.subarray(0,20)])}async function $n(e,t,r,i,n=!1,a=!1){let s;if(n){for(s=0;s<t.length&&0===t[s];s++);t=t.subarray(s)}if(a){for(s=t.length-1;s>=0&&0===t[s];s--);t=t.subarray(0,s+1)}return(await Gr.digest(e,Y.concatUint8Array([new Uint8Array([0,0,0,1]),t,i]))).subarray(0,r)}async function ea(e,t){switch(e.type){case"curve25519":{const r=Li(32),{secretKey:i,sharedKey:n}=await ta(e,t,null,r);let{publicKey:a}=zi.box.keyPair.fromSecretKey(i);return a=Y.concatUint8Array([new Uint8Array([64]),a]),{publicKey:a,sharedKey:n}}case"web":if(e.web&&Y.getWebCrypto())try{return await async function(e,t){const r=In(e.payloadSize,e.web.web,t);let i=Yn.generateKey({name:"ECDH",namedCurve:e.web.web},!0,["deriveKey","deriveBits"]),n=Yn.importKey("jwk",r,{name:"ECDH",namedCurve:e.web.web},!1,[]);[i,n]=await Promise.all([i,n]);let a=Yn.deriveBits({name:"ECDH",namedCurve:e.web.web,public:n},i.privateKey,e.web.sharedSize),s=Yn.exportKey("jwk",i.publicKey);[a,s]=await Promise.all([a,s]);const o=new Uint8Array(a),c=new Uint8Array(Cn(s));return{publicKey:c,sharedKey:o}}(e,t)}catch(e){Y.printDebugError(e)}break;case"node":return async function(e,t){const r=Zn.createECDH(e.node.node);r.generateKeys();const i=new Uint8Array(r.computeSecret(t)),n=new Uint8Array(r.getPublicKey());return{publicKey:n,sharedKey:i}}(e,t)}return async function(e,t){const r=await cn(e.name),i=await e.genKeyPair();t=on(r,t);const n=sn(r,i.privateKey),a=i.publicKey,s=n.derive(t.getPublic()),o=r.curve.p.byteLength(),c=s.toArrayLike(Uint8Array,"be",o);return{publicKey:a,sharedKey:c}}(e,t)}async function ta(e,t,r,i){if(i.length!==e.payloadSize){const t=new Uint8Array(e.payloadSize);t.set(i,e.payloadSize-i.length),i=t}switch(e.type){case"curve25519":{const e=i.slice().reverse();return{secretKey:e,sharedKey:zi.scalarMult(e,t.subarray(1))}}case"web":if(e.web&&Y.getWebCrypto())try{return await async function(e,t,r,i){const n=Bn(e.payloadSize,e.web.web,r,i);let a=Yn.importKey("jwk",n,{name:"ECDH",namedCurve:e.web.web},!0,["deriveKey","deriveBits"]);const s=In(e.payloadSize,e.web.web,t);let o=Yn.importKey("jwk",s,{name:"ECDH",namedCurve:e.web.web},!0,[]);[a,o]=await Promise.all([a,o]);let c=Yn.deriveBits({name:"ECDH",namedCurve:e.web.web,public:o},a,e.web.sharedSize),u=Yn.exportKey("jwk",a);[c,u]=await Promise.all([c,u]);const h=new Uint8Array(c);return{secretKey:re(u.d),sharedKey:h}}(e,t,r,i)}catch(e){Y.printDebugError(e)}break;case"node":return async function(e,t,r){const i=Zn.createECDH(e.node.node);i.setPrivateKey(r);const n=new Uint8Array(i.computeSecret(t));return{secretKey:new Uint8Array(i.getPrivateKey()),sharedKey:n}}(e,t,i)}return async function(e,t,r){const i=await cn(e.name);t=on(i,t),r=sn(i,r);const n=new Uint8Array(r.getPrivate()),a=r.derive(t.getPublic()),s=i.curve.p.byteLength(),o=a.toArrayLike(Uint8Array,"be",s);return{secretKey:n,sharedKey:o}}(e,t,i)}var ra=/*#__PURE__*/Object.freeze({__proto__:null,validateParams:async function(e,t,r){return Sn(V.publicKey.ecdh,e,t,r)},encrypt:async function(e,t,r,i,n){const a=Wn(r),s=new En(e),{publicKey:o,sharedKey:c}=await ea(s,i),u=Xn(V.publicKey.ecdh,e,t,n),{keySize:h}=Vr(t.cipher);return{publicKey:o,wrappedKey:qn(await $n(t.hash,c,h,u),a)}},decrypt:async function(e,t,r,i,n,a,s){const o=new En(e),{sharedKey:c}=await ta(o,r,n,a),u=Xn(V.publicKey.ecdh,e,t,s),{keySize:h}=Vr(t.cipher);let f;for(let e=0;e<3;e++)try{return Vn(On(await $n(t.hash,c,h,u,1===e,2===e),i))}catch(e){f=e}throw f}});const ia=Y.getWebCrypto(),na=Y.getNodeCrypto(),aa=na&&na.webcrypto&&na.webcrypto.subtle;async function sa(e,t,r,i,n){const a=V.read(V.webHash,e);if(!a)throw Error("Hash algo not supported with HKDF");if(ia||aa){const e=ia||aa,s=await e.importKey("raw",t,"HKDF",!1,["deriveBits"]),o=await e.deriveBits({name:"HKDF",hash:a,salt:r,info:i},s,8*n);return new Uint8Array(o)}if(na){const a=V.read(V.hash,e),s=(e,t)=>na.createHmac(a,e).update(t).digest(),o=s(r,t),c=o.length,u=Math.ceil(n/c),h=new Uint8Array(u*c),f=new Uint8Array(c+i.length+1);f.set(i,c);for(let e=0;e<u;e++){f[f.length-1]=e+1;const t=s(o,e>0?f:f.subarray(c));f.set(t,0),h.set(t,e*c)}return h.subarray(0,n)}throw Error("No HKDF implementation available")}const oa={x25519:Y.encodeUTF8("OpenPGP X25519")};var ca=/*#__PURE__*/Object.freeze({__proto__:null,generate:async function(e){if(e===V.publicKey.x25519){const e=Li(32),{publicKey:t}=zi.box.keyPair.fromSecretKey(e);return{A:t,k:e}}throw Error("Unsupported ECDH algorithm")},validateParams:async function(e,t,r){if(e===V.publicKey.x25519){const{publicKey:e}=zi.box.keyPair.fromSecretKey(r);return Y.equalsUint8Array(t,e)}return!1},encrypt:async function(e,t,r){if(e===V.publicKey.x25519){const e=Li(32),i=zi.scalarMult(e,r),{publicKey:n}=zi.box.keyPair.fromSecretKey(e),a=Y.concatUint8Array([n,r,i]),{keySize:s}=Vr(V.symmetric.aes128);return{ephemeralPublicKey:n,wrappedKey:qn(await sa(V.hash.sha256,a,new Uint8Array,oa.x25519,s),t)}}throw Error("Unsupported ECDH algorithm")},decrypt:async function(e,t,r,i,n){if(e===V.publicKey.x25519){const e=zi.scalarMult(n,t),a=Y.concatUint8Array([t,i,e]),{keySize:s}=Vr(V.symmetric.aes128);return On(await sa(V.hash.sha256,a,new Uint8Array,oa.x25519,s),r)}throw Error("Unsupported ECDH algorithm")}}),ua=/*#__PURE__*/Object.freeze({__proto__:null,CurveWithOID:En,ecdh:ra,ecdhX:ca,ecdsa:zn,eddsaLegacy:Fn,eddsa:Nn,generate:async function(e){const t=await Y.getBigInteger();e=new En(e);const r=await e.genKeyPair(),i=new t(r.publicKey).toUint8Array(),n=new t(r.privateKey).toUint8Array("be",e.payloadSize);return{oid:e.oid,Q:i,secret:n,hash:e.hash,cipher:e.cipher}},getPreferredHashAlgo:function(e){return kn[V.write(V.curve,e.toHex())].hash}});var ha=/*#__PURE__*/Object.freeze({__proto__:null,sign:async function(e,t,r,i,n,a){const s=await Y.getBigInteger(),o=new s(1);let c,u,h,f;i=new s(i),n=new s(n),r=new s(r),a=new s(a),r=r.mod(i),a=a.mod(n);const d=new s(t.subarray(0,n.byteLength())).mod(n);for(;;){if(c=await Ni(o,n),u=r.modExp(c,i).imod(n),u.isZero())continue;const e=a.mul(u).imod(n);if(f=d.add(e).imod(n),h=c.modInv(n).imul(f).imod(n),!h.isZero())break}return{r:u.toUint8Array("be",n.byteLength()),s:h.toUint8Array("be",n.byteLength())}},verify:async function(e,t,r,i,n,a,s,o){const c=await Y.getBigInteger(),u=new c(0);if(t=new c(t),r=new c(r),a=new c(a),s=new c(s),n=new c(n),o=new c(o),t.lte(u)||t.gte(s)||r.lte(u)||r.gte(s))return Y.printDebug("invalid DSA Signature"),!1;const h=new c(i.subarray(0,s.byteLength())).imod(s),f=r.modInv(s);if(f.isZero())return Y.printDebug("invalid DSA Signature"),!1;n=n.mod(a),o=o.mod(a);const d=h.mul(f).imod(s),l=t.mul(f).imod(s),p=n.modExp(d,a),y=o.modExp(l,a);return p.mul(y).imod(a).imod(s).equal(t)},validateParams:async function(e,t,r,i,n){const a=await Y.getBigInteger();e=new a(e),t=new a(t),r=new a(r),i=new a(i);const s=new a(1);if(r.lte(s)||r.gte(e))return!1;if(!e.dec().mod(t).isZero())return!1;if(!r.modExp(t,e).isOne())return!1;const o=new a(t.bitLength()),c=new a(150);if(o.lt(c)||!await Hi(t,null,32))return!1;n=new a(n);const u=new a(2),h=await Ni(u.leftShift(o.dec()),u.leftShift(o)),f=t.mul(h).add(n);return!!i.equal(r.modExp(f,e))}}),fa={rsa:rn,elgamal:nn,elliptic:ua,dsa:ha,nacl:zi};function da(e,t,r){switch(e){case V.hash.sha1:case V.hash.sha256:case V.hash.sha512:return async function(e,t,r){const i=Gr.getBlockSize(e),n=new Uint8Array(i);n.fill(92),la(n,t);const a=new Uint8Array(i);a.fill(54),la(a,t);const s=Y.concatUint8Array([a,r]),o=await Gr.digest(e,s),c=Y.concatUint8Array([n,o]);return Gr.digest(e,c)}(e,t,r);default:throw Error("Unsupported hash algorithm.")}}function la(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r]||0}class pa{constructor(e){if(void 0===e&&(e=new Uint8Array([])),!Y.isUint8Array(e))throw Error("data must be in the form of a Uint8Array");this.data=e,this.length=this.data.byteLength}write(){return Y.concatUint8Array([new Uint8Array([this.length]),this.data])}read(e){if(e.length>=1){const t=e[0];if(e.length>=t+1)return this.data=e.subarray(1,1+t),this.length=t,1+t}throw Error("Invalid octet string")}}var ya=/*#__PURE__*/Object.freeze({__proto__:null,parseSignatureParams:function(e,t){let r=0;switch(e){case V.publicKey.rsaEncryptSign:case V.publicKey.rsaEncrypt:case V.publicKey.rsaSign:return{s:Y.readMPI(t.subarray(r))};case V.publicKey.dsa:case V.publicKey.ecdsa:{const e=Y.readMPI(t.subarray(r));r+=e.length+2;return{r:e,s:Y.readMPI(t.subarray(r))}}case V.publicKey.eddsaLegacy:{let e=Y.readMPI(t.subarray(r));r+=e.length+2,e=Y.leftPad(e,32);let i=Y.readMPI(t.subarray(r));return i=Y.leftPad(i,32),{r:e,s:i}}case V.publicKey.ed25519:{const e=t.subarray(r,r+64);return r+=e.length,{RS:e}}case V.publicKey.hmac:{const e=new pa;return e.read(t.subarray(r)),{mac:e}}default:throw new gn("Unknown signature algorithm.")}},verify:async function(e,t,r,i,n,a,s){switch(e){case V.publicKey.rsaEncryptSign:case V.publicKey.rsaEncrypt:case V.publicKey.rsaSign:{const{n:e,e:n}=i,o=Y.leftPad(r.s,e.length);return fa.rsa.verify(t,a,o,e,n,s)}case V.publicKey.dsa:{const{g:e,p:n,q:a,y:o}=i,{r:c,s:u}=r;return fa.dsa.verify(t,c,u,s,e,n,a,o)}case V.publicKey.ecdsa:{const{oid:e,Q:n}=i,o=new fa.elliptic.CurveWithOID(e).payloadSize,c=Y.leftPad(r.r,o),u=Y.leftPad(r.s,o);return fa.elliptic.ecdsa.verify(e,t,{r:c,s:u},a,n,s)}case V.publicKey.eddsaLegacy:{const{oid:e,Q:n}=i;return fa.elliptic.eddsaLegacy.verify(e,t,r,a,n,s)}case V.publicKey.ed25519:{const{A:n}=i;return fa.elliptic.eddsa.verify(e,t,r,a,n,s)}case V.publicKey.hmac:{if(!n)throw Error("Cannot verify HMAC signature with symmetric key missing private parameters");const{cipher:e}=i,{keyMaterial:t}=n,a=await da(e.getValue(),t,s);return Y.equalsUint8Array(a,r.mac.data)}default:throw Error("Unknown signature algorithm.")}},sign:async function(e,t,r,i,n,a){if(!r||!i)throw Error("Missing key parameters");switch(e){case V.publicKey.rsaEncryptSign:case V.publicKey.rsaEncrypt:case V.publicKey.rsaSign:{const{n:e,e:s}=r,{d:o,p:c,q:u,u:h}=i;return{s:await fa.rsa.sign(t,n,e,s,o,c,u,h,a)}}case V.publicKey.dsa:{const{g:e,p:n,q:s}=r,{x:o}=i;return fa.dsa.sign(t,a,e,n,s,o)}case V.publicKey.elgamal:throw Error("Signing with Elgamal is not defined in the OpenPGP standard.");case V.publicKey.ecdsa:{const{oid:e,Q:s}=r,{d:o}=i;return fa.elliptic.ecdsa.sign(e,t,n,s,o,a)}case V.publicKey.eddsaLegacy:{const{oid:e,Q:s}=r,{seed:o}=i;return fa.elliptic.eddsaLegacy.sign(e,t,n,s,o,a)}case V.publicKey.ed25519:{const{A:s}=r,{seed:o}=i;return fa.elliptic.eddsa.sign(e,t,n,s,o,a)}case V.publicKey.hmac:{const{cipher:e}=r,{keyMaterial:t}=i,n=await da(e.getValue(),t,a);return{mac:new pa(n)}}default:throw Error("Unknown signature algorithm.")}}});class ga{constructor(e){e&&(this.data=e)}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.data=e.subarray(1,1+t),1+this.data.length}throw Error("Invalid symmetric key")}write(){return Y.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class ba{constructor(e){if(e){const{version:t,hash:r,cipher:i,replacementFingerprint:n}=e;this.version=t||1,this.hash=r,this.cipher=i,this.replacementFingerprint=n}else this.version=null,this.hash=null,this.cipher=null,this.replacementFingerprint=null}read(e){if(e.length<4||1!==e[1]&&255!==e[1])throw new gn("Cannot read KDFParams");const t=e[0];this.version=e[1],this.hash=e[2],this.cipher=e[3];let r=4;if(255===this.version){const i=t-r+1;this.replacementFingerprint=e.slice(r,r+i),r+=i}return r}write(e){if(!this.version||1===this.version||e)return new Uint8Array([3,1,this.hash,this.cipher]);return Y.concatUint8Array([new Uint8Array([3+this.replacementFingerprint.length,this.version,this.hash,this.cipher]),this.replacementFingerprint])}}const ma=e=>class{constructor(e){this.data=void 0===e?null:e}read(t){const r=t[0];return this.data=V.write(e,r),1}write(){return new Uint8Array([this.data])}getName(){return V.read(e,this.data)}getValue(){return this.data}},wa=ma(V.aead),Aa=ma(V.symmetric),va=ma(V.hash);class _a{static fromObject({wrappedKey:e,algorithm:t}){const r=new _a;return r.wrappedKey=e,r.algorithm=t,r}read(e){let t=0,r=e[t++];this.algorithm=r%2?e[t++]:null,r-=r%2,this.wrappedKey=e.subarray(t,t+r),t+=r}write(){return Y.concatUint8Array([this.algorithm?new Uint8Array([this.wrappedKey.length+1,this.algorithm]):new Uint8Array([this.wrappedKey.length]),this.wrappedKey])}}async function ka(e,t){const r=Li(32);return{privateParams:{hashSeed:r,keyMaterial:e},publicParams:{cipher:t,digest:await Gr.sha256(r)}}}function Ea(e){const{keySize:t}=Vr(e);return Li(t)}function Sa(e){const t=V.read(V.aead,e);return Qi[t]}function Ca(e){try{e.getName()}catch(e){throw new gn("Unknown curve OID")}}var Ia=/*#__PURE__*/Object.freeze({__proto__:null,publicKeyEncrypt:async function(e,t,r,i,n,a){switch(e){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:{const{n:e,e:t}=r;return{c:await fa.rsa.encrypt(n,e,t)}}case V.publicKey.elgamal:{const{p:e,g:t,y:i}=r;return fa.elgamal.encrypt(n,e,t,i)}case V.publicKey.ecdh:{const{oid:e,Q:t,kdfParams:i}=r,{publicKey:s,wrappedKey:o}=await fa.elliptic.ecdh.encrypt(e,i,n,t,a);return{V:s,C:new ga(o)}}case V.publicKey.x25519:{if(!Y.isAES(t))throw Error("X25519 keys can only encrypt AES session keys");const{A:i}=r,{ephemeralPublicKey:a,wrappedKey:s}=await fa.elliptic.ecdhX.encrypt(e,n,i);return{ephemeralPublicKey:a,C:_a.fromObject({algorithm:t,wrappedKey:s})}}case V.publicKey.aead:{if(!i)throw Error("Cannot encrypt with symmetric key missing private parameters");const{cipher:e}=r,t=e.getValue(),{keyMaterial:a}=i,s=ne.preferredAEADAlgorithm,o=Sa(ne.preferredAEADAlgorithm),{ivLength:c}=o,u=Li(c),h=await o(t,a),f=await h.encrypt(n,u,new Uint8Array);return{aeadMode:new wa(s),iv:u,c:new pa(f)}}default:return[]}},publicKeyDecrypt:async function(e,t,r,i,n,a){switch(e){case V.publicKey.rsaEncryptSign:case V.publicKey.rsaEncrypt:{const{c:e}=i,{n,e:s}=t,{d:o,p:c,q:u,u:h}=r;return fa.rsa.decrypt(e,n,s,o,c,u,h,a)}case V.publicKey.elgamal:{const{c1:e,c2:n}=i,s=t.p,o=r.x;return fa.elgamal.decrypt(e,n,s,o,a)}case V.publicKey.ecdh:{const{oid:e,Q:a,kdfParams:s}=t,{d:o}=r,{V:c,C:u}=i;return fa.elliptic.ecdh.decrypt(e,s,c,u.data,a,o,n)}case V.publicKey.x25519:{const{A:n}=t,{k:a}=r,{ephemeralPublicKey:s,C:o}=i;if(!Y.isAES(o.algorithm))throw Error("AES session key expected");return fa.elliptic.ecdhX.decrypt(e,s,o.wrappedKey,n,a)}case V.publicKey.aead:{const{cipher:e}=t,n=e.getValue(),{keyMaterial:a}=r,{aeadMode:s,iv:o,c}=i,u=Sa(s.getValue());return(await u(n,a)).decrypt(c.data,o,new Uint8Array)}default:throw Error("Unknown public key encryption algorithm.")}},parsePublicKeyParams:function(e,t){let r=0;switch(e){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:case V.publicKey.rsaSign:{const e=Y.readMPI(t.subarray(r));r+=e.length+2;const i=Y.readMPI(t.subarray(r));return r+=i.length+2,{read:r,publicParams:{n:e,e:i}}}case V.publicKey.dsa:{const e=Y.readMPI(t.subarray(r));r+=e.length+2;const i=Y.readMPI(t.subarray(r));r+=i.length+2;const n=Y.readMPI(t.subarray(r));r+=n.length+2;const a=Y.readMPI(t.subarray(r));return r+=a.length+2,{read:r,publicParams:{p:e,q:i,g:n,y:a}}}case V.publicKey.elgamal:{const e=Y.readMPI(t.subarray(r));r+=e.length+2;const i=Y.readMPI(t.subarray(r));r+=i.length+2;const n=Y.readMPI(t.subarray(r));return r+=n.length+2,{read:r,publicParams:{p:e,g:i,y:n}}}case V.publicKey.ecdsa:{const e=new an;r+=e.read(t),Ca(e);const i=Y.readMPI(t.subarray(r));return r+=i.length+2,{read:r,publicParams:{oid:e,Q:i}}}case V.publicKey.eddsaLegacy:{const e=new an;r+=e.read(t),Ca(e);let i=Y.readMPI(t.subarray(r));return r+=i.length+2,i=Y.leftPad(i,33),{read:r,publicParams:{oid:e,Q:i}}}case V.publicKey.ecdh:{const e=new an;r+=e.read(t),Ca(e);const i=Y.readMPI(t.subarray(r));r+=i.length+2;const n=new ba;return r+=n.read(t.subarray(r)),{read:r,publicParams:{oid:e,Q:i,kdfParams:n}}}case V.publicKey.ed25519:case V.publicKey.x25519:{const e=t.subarray(r,r+32);return r+=e.length,{read:r,publicParams:{A:e}}}case V.publicKey.hmac:case V.publicKey.aead:{const e=new Aa;r+=e.read(t);const i=Gr.getHashByteLength(V.hash.sha256),n=t.subarray(r,r+i);return r+=i,{read:r,publicParams:{cipher:e,digest:n}}}default:throw new gn("Unknown public key encryption algorithm.")}},parsePrivateKeyParams:function(e,t,r){let i=0;switch(e){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:case V.publicKey.rsaSign:{const e=Y.readMPI(t.subarray(i));i+=e.length+2;const r=Y.readMPI(t.subarray(i));i+=r.length+2;const n=Y.readMPI(t.subarray(i));i+=n.length+2;const a=Y.readMPI(t.subarray(i));return i+=a.length+2,{read:i,privateParams:{d:e,p:r,q:n,u:a}}}case V.publicKey.dsa:case V.publicKey.elgamal:{const e=Y.readMPI(t.subarray(i));return i+=e.length+2,{read:i,privateParams:{x:e}}}case V.publicKey.ecdsa:case V.publicKey.ecdh:{const e=new En(r.oid);let n=Y.readMPI(t.subarray(i));return i+=n.length+2,n=Y.leftPad(n,e.payloadSize),{read:i,privateParams:{d:n}}}case V.publicKey.eddsaLegacy:{const e=new En(r.oid);let n=Y.readMPI(t.subarray(i));return i+=n.length+2,n=Y.leftPad(n,e.payloadSize),{read:i,privateParams:{seed:n}}}case V.publicKey.ed25519:{const e=t.subarray(i,i+32);return i+=e.length,{read:i,privateParams:{seed:e}}}case V.publicKey.x25519:{const e=t.subarray(i,i+32);return i+=e.length,{read:i,privateParams:{k:e}}}case V.publicKey.hmac:{const{cipher:e}=r,n=Gr.getHashByteLength(e.getValue()),a=t.subarray(i,i+32);i+=32;const s=t.subarray(i,i+n);return i+=n,{read:i,privateParams:{hashSeed:a,keyMaterial:s}}}case V.publicKey.aead:{const{cipher:e}=r,n=t.subarray(i,i+32);i+=32;const{keySize:a}=Vr(e.getValue()),s=t.subarray(i,i+a);return i+=a,{read:i,privateParams:{hashSeed:n,keyMaterial:s}}}default:throw new gn("Unknown public key encryption algorithm.")}},parseEncSessionKeyParams:function(e,t){let r=0;switch(e){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:return{c:Y.readMPI(t.subarray(r))};case V.publicKey.elgamal:{const e=Y.readMPI(t.subarray(r));r+=e.length+2;return{c1:e,c2:Y.readMPI(t.subarray(r))}}case V.publicKey.ecdh:{const e=Y.readMPI(t.subarray(r));r+=e.length+2;const i=new ga;return i.read(t.subarray(r)),{V:e,C:i}}case V.publicKey.x25519:{const e=t.subarray(r,r+32);r+=e.length;const i=new _a;return i.read(t.subarray(r)),{ephemeralPublicKey:e,C:i}}case V.publicKey.aead:{const e=new wa;r+=e.read(t.subarray(r));const{ivLength:i}=Sa(e.getValue()),n=t.subarray(r,r+i);r+=i;const a=new pa;return r+=a.read(t.subarray(r)),{aeadMode:e,iv:n,c:a}}default:throw new gn("Unknown public key encryption algorithm.")}},serializeParams:function(e,t){const r=new Set([V.publicKey.ed25519,V.publicKey.x25519,V.publicKey.aead,V.publicKey.hmac]),i=Object.keys(t).map((i=>{const n=t[i];return Y.isUint8Array(n)?r.has(e)?n:Y.uint8ArrayToMPI(n):n.write()}));return Y.concatUint8Array(i)},generateParams:function(e,t,r,i){switch(e){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:case V.publicKey.rsaSign:return fa.rsa.generate(t,65537).then((({n:e,e:t,d:r,p:i,q:n,u:a})=>({privateParams:{d:r,p:i,q:n,u:a},publicParams:{n:e,e:t}})));case V.publicKey.ecdsa:return fa.elliptic.generate(r).then((({oid:e,Q:t,secret:r})=>({privateParams:{d:r},publicParams:{oid:new an(e),Q:t}})));case V.publicKey.eddsaLegacy:return fa.elliptic.generate(r).then((({oid:e,Q:t,secret:r})=>({privateParams:{seed:r},publicParams:{oid:new an(e),Q:t}})));case V.publicKey.ecdh:return fa.elliptic.generate(r).then((({oid:e,Q:t,secret:r,hash:i,cipher:n})=>({privateParams:{d:r},publicParams:{oid:new an(e),Q:t,kdfParams:new ba({hash:i,cipher:n})}})));case V.publicKey.ed25519:return fa.elliptic.eddsa.generate(e).then((({A:e,seed:t})=>({privateParams:{seed:t},publicParams:{A:e}})));case V.publicKey.x25519:return fa.elliptic.ecdhX.generate(e).then((({A:e,k:t})=>({privateParams:{k:t},publicParams:{A:e}})));case V.publicKey.hmac:{const e=V.write(V.hash,i);return ka(Li(Gr.getHashByteLength(e)),new va(e))}case V.publicKey.aead:{const e=V.write(V.symmetric,i);return ka(Ea(e),new Aa(e))}case V.publicKey.dsa:case V.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Unknown public key algorithm.")}},validateParams:async function(e,t,r){if(!t||!r)throw Error("Missing key parameters");switch(e){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:case V.publicKey.rsaSign:{const{n:e,e:i}=t,{d:n,p:a,q:s,u:o}=r;return fa.rsa.validateParams(e,i,n,a,s,o)}case V.publicKey.dsa:{const{p:e,q:i,g:n,y:a}=t,{x:s}=r;return fa.dsa.validateParams(e,i,n,a,s)}case V.publicKey.elgamal:{const{p:e,g:i,y:n}=t,{x:a}=r;return fa.elgamal.validateParams(e,i,n,a)}case V.publicKey.ecdsa:case V.publicKey.ecdh:{const i=fa.elliptic[V.read(V.publicKey,e)],{oid:n,Q:a}=t,{d:s}=r;return i.validateParams(n,a,s)}case V.publicKey.eddsaLegacy:{const{Q:e,oid:i}=t,{seed:n}=r;return fa.elliptic.eddsaLegacy.validateParams(i,e,n)}case V.publicKey.ed25519:{const{A:i}=t,{seed:n}=r;return fa.elliptic.eddsa.validateParams(e,i,n)}case V.publicKey.x25519:{const{A:i}=t,{k:n}=r;return fa.elliptic.ecdhX.validateParams(e,i,n)}case V.publicKey.hmac:{const{cipher:e,digest:i}=t,{hashSeed:n,keyMaterial:a}=r;return Gr.getHashByteLength(e.getValue())===a.length&&Y.equalsUint8Array(i,await Gr.sha256(n))}case V.publicKey.aead:{const{cipher:e,digest:i}=t,{hashSeed:n,keyMaterial:a}=r,{keySize:s}=Vr(e.getValue());return s===a.length&&Y.equalsUint8Array(i,await Gr.sha256(n))}default:throw Error("Unknown public key algorithm.")}},getPrefixRandom:async function(e){const{blockSize:t}=Vr(e),r=await Li(t),i=new Uint8Array([r[r.length-2],r[r.length-1]]);return Y.concat([r,i])},generateSessionKey:Ea,getAEADMode:Sa,getCipher:Vr,getPreferredCurveHashAlgo:function(e,t){switch(e){case V.publicKey.ecdsa:case V.publicKey.eddsaLegacy:return fa.elliptic.getPreferredHashAlgo(t);case V.publicKey.ed25519:return fa.elliptic.eddsa.getPreferredHashAlgo(e);default:throw Error("Unknown elliptic signing algo")}}});const Ba={cipher:je,hash:Gr,mode:Qi,publicKey:fa,signature:ya,random:qi,pkcs1:Yi,pkcs5:Jn,aesKW:Gn};Object.assign(Ba,Ia);class Pa extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,Pa),this.name="Argon2OutOfMemoryError"}}let Ma,Da;class xa{constructor(e=ne){const{passes:t,parallelism:r,memoryExponent:i}=e.s2kArgon2Params;this.type="argon2",this.salt=null,this.t=t,this.p=r,this.encodedM=i}generateSalt(){this.salt=Ba.random.getRandomBytes(16)}read(e){let t=0;return this.salt=e.subarray(t,t+16),t+=16,this.t=e[t++],this.p=e[t++],this.encodedM=e[t++],t}write(){const e=[new Uint8Array([V.write(V.s2k,this.type)]),this.salt,new Uint8Array([this.t,this.p,this.encodedM])];return Y.concatUint8Array(e)}async produceKey(e,t){const r=2<<this.encodedM-1;try{Ma=Ma||(await Promise.resolve().then((function(){return Pb}))).default,Da=Da||Ma();const i=await Da,n=i({version:19,type:2,password:Y.encodeUTF8(e),salt:this.salt,tagLength:t,memorySize:r,parallelism:this.p,passes:this.t});return r>1048576&&(Da=Ma(),Da.catch((()=>{}))),n}catch(e){throw e.message&&(e.message.includes("Unable to grow instance memory")||e.message.includes("failed to grow memory")||e.message.includes("WebAssembly.Memory.grow")||e.message.includes("Out of memory"))?new Pa("Could not allocate required memory for Argon2"):e}}}class Ka{constructor(e,t=ne){this.algorithm=V.hash.sha256,this.type=V.read(V.s2k,e),this.c=t.s2kIterationCountByte,this.salt=null}generateSalt(){switch(this.type){case"salted":case"iterated":this.salt=Ba.random.getRandomBytes(8)}}getCount(){return 16+(15&this.c)<<6+(this.c>>4)}read(e){let t=0;switch(this.algorithm=e[t++],this.type){case"simple":break;case"salted":this.salt=e.subarray(t,t+8),t+=8;break;case"iterated":this.salt=e.subarray(t,t+8),t+=8,this.c=e[t++];break;case"gnu":if("GNU"!==Y.uint8ArrayToString(e.subarray(t,t+3)))throw new gn("Unknown s2k type.");t+=3;if(1001!==1e3+e[t++])throw new gn("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw new gn("Unknown s2k type.")}return t}write(){if("gnu-dummy"===this.type)return new Uint8Array([101,0,...Y.stringToUint8Array("GNU"),1]);const e=[new Uint8Array([V.write(V.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":e.push(this.salt);break;case"iterated":e.push(this.salt),e.push(new Uint8Array([this.c]));break;case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}return Y.concatUint8Array(e)}async produceKey(e,t){e=Y.encodeUTF8(e);const r=[];let i=0,n=0;for(;i<t;){let t;switch(this.type){case"simple":t=Y.concatUint8Array([new Uint8Array(n),e]);break;case"salted":t=Y.concatUint8Array([new Uint8Array(n),this.salt,e]);break;case"iterated":{const r=Y.concatUint8Array([this.salt,e]);let i=r.length;const a=Math.max(this.getCount(),i);t=new Uint8Array(n+a),t.set(r,n);for(let e=n+i;e<a;e+=i,i*=2)t.copyWithin(e,n,e);break}case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}const a=await Ba.hash.digest(this.algorithm,t);r.push(a),i+=a.length,n++}return Y.concatUint8Array(r).subarray(0,t)}}const Ua=new Set([V.s2k.argon2,V.s2k.iterated]);function Ra(e,t=ne){switch(e){case V.s2k.argon2:return new xa(t);case V.s2k.iterated:case V.s2k.gnu:case V.s2k.salted:case V.s2k.simple:return new Ka(e,t);default:throw new gn("Unsupported S2K type "+e)}}function Ta(e){const{s2kType:t}=e;if(!Ua.has(t))throw Error("The provided `config.s2kType` value is not allowed");return Ra(t,e)}var Qa="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function za(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)}const Fa={arraySet:function(e,t,r,i,n){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+i),n);else for(let a=0;a<i;a++)e[n+a]=t[r+a]},flattenChunks:function(e){let t,r,i,n,a;for(i=0,t=0,r=e.length;t<r;t++)i+=e[t].length;const s=new Uint8Array(i);for(n=0,t=0,r=e.length;t<r;t++)a=e[t],s.set(a,n),n+=a.length;return s}},La={arraySet:function(e,t,r,i,n){for(let a=0;a<i;a++)e[n+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};let Na=Qa?Uint8Array:Array,qa=Qa?Uint16Array:Array,Oa=Qa?Int32Array:Array,Ha=Qa?Fa.flattenChunks:La.flattenChunks,ja=Qa?Fa.arraySet:La.arraySet;const Ga=0,Wa=1,Va=2,Ja=3,Ya=4,Za=5,Xa=6,$a=0,es=1,ts=2,rs=-2,is=-3,ns=-5,as=-1,ss=1,os=2,cs=3,us=4,hs=0,fs=1,ds=2,ls=8;function ps(e){let t=e.length;for(;--t>=0;)e[t]=0}const ys=0,gs=1,bs=2,ms=29,ws=256,As=ws+1+ms,vs=30,_s=19,ks=2*As+1,Es=15,Ss=16,Cs=7,Is=256,Bs=16,Ps=17,Ms=18,Ds=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],xs=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Us=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Rs=Array(2*(As+2));ps(Rs);const Ts=Array(2*vs);ps(Ts);const Qs=Array(512);ps(Qs);const zs=Array(256);ps(zs);const Fs=Array(ms);ps(Fs);const Ls=Array(vs);function Ns(e,t,r,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=e&&e.length}let qs,Os,Hs;function js(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Gs(e){return e<256?Qs[e]:Qs[256+(e>>>7)]}function Ws(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Vs(e,t,r){e.bi_valid>Ss-r?(e.bi_buf|=t<<e.bi_valid&65535,Ws(e,e.bi_buf),e.bi_buf=t>>Ss-e.bi_valid,e.bi_valid+=r-Ss):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function Js(e,t,r){Vs(e,r[2*t],r[2*t+1])}function Ys(e,t){let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function Zs(e,t,r){const i=Array(Es+1);let n,a,s=0;for(n=1;n<=Es;n++)i[n]=s=s+r[n-1]<<1;for(a=0;a<=t;a++){const t=e[2*a+1];0!==t&&(e[2*a]=Ys(i[t]++,t))}}function Xs(e){let t;for(t=0;t<As;t++)e.dyn_ltree[2*t]=0;for(t=0;t<vs;t++)e.dyn_dtree[2*t]=0;for(t=0;t<_s;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*Is]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function $s(e){e.bi_valid>8?Ws(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function eo(e,t,r,i){const n=2*t,a=2*r;return e[n]<e[a]||e[n]===e[a]&&i[t]<=i[r]}function to(e,t,r){const i=e.heap[r];let n=r<<1;for(;n<=e.heap_len&&(n<e.heap_len&&eo(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!eo(t,i,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=i}function ro(e,t,r){let i,n,a,s,o=0;if(0!==e.last_lit)do{i=e.pending_buf[e.d_buf+2*o]<<8|e.pending_buf[e.d_buf+2*o+1],n=e.pending_buf[e.l_buf+o],o++,0===i?Js(e,n,t):(a=zs[n],Js(e,a+ws+1,t),s=Ds[a],0!==s&&(n-=Fs[a],Vs(e,n,s)),i--,a=Gs(i),Js(e,a,r),s=xs[a],0!==s&&(i-=Ls[a],Vs(e,i,s)))}while(o<e.last_lit);Js(e,Is,t)}function io(e,t){const r=t.dyn_tree,i=t.stat_desc.static_tree,n=t.stat_desc.has_stree,a=t.stat_desc.elems;let s,o,c,u=-1;for(e.heap_len=0,e.heap_max=ks,s=0;s<a;s++)0!==r[2*s]?(e.heap[++e.heap_len]=u=s,e.depth[s]=0):r[2*s+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=u<2?++u:0,r[2*c]=1,e.depth[c]=0,e.opt_len--,n&&(e.static_len-=i[2*c+1]);for(t.max_code=u,s=e.heap_len>>1;s>=1;s--)to(e,r,s);c=a;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],to(e,r,1),o=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=o,r[2*c]=r[2*s]+r[2*o],e.depth[c]=(e.depth[s]>=e.depth[o]?e.depth[s]:e.depth[o])+1,r[2*s+1]=r[2*o+1]=c,e.heap[1]=c++,to(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){const r=t.dyn_tree,i=t.max_code,n=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,h,f,d,l,p,y=0;for(d=0;d<=Es;d++)e.bl_count[d]=0;for(r[2*e.heap[e.heap_max]+1]=0,u=e.heap_max+1;u<ks;u++)h=e.heap[u],d=r[2*r[2*h+1]+1]+1,d>c&&(d=c,y++),r[2*h+1]=d,h>i||(e.bl_count[d]++,l=0,h>=o&&(l=s[h-o]),p=r[2*h],e.opt_len+=p*(d+l),a&&(e.static_len+=p*(n[2*h+1]+l)));if(0!==y){do{for(d=c-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[c]--,y-=2}while(y>0);for(d=c;0!==d;d--)for(h=e.bl_count[d];0!==h;)f=e.heap[--u],f>i||(r[2*f+1]!==d&&(e.opt_len+=(d-r[2*f+1])*r[2*f],r[2*f+1]=d),h--)}}(e,t),Zs(r,u,e.bl_count)}function no(e,t,r){let i,n,a=-1,s=t[1],o=0,c=7,u=4;for(0===s&&(c=138,u=3),t[2*(r+1)+1]=65535,i=0;i<=r;i++)n=s,s=t[2*(i+1)+1],++o<c&&n===s||(o<u?e.bl_tree[2*n]+=o:0!==n?(n!==a&&e.bl_tree[2*n]++,e.bl_tree[2*Bs]++):o<=10?e.bl_tree[2*Ps]++:e.bl_tree[2*Ms]++,o=0,a=n,0===s?(c=138,u=3):n===s?(c=6,u=3):(c=7,u=4))}function ao(e,t,r){let i,n,a=-1,s=t[1],o=0,c=7,u=4;for(0===s&&(c=138,u=3),i=0;i<=r;i++)if(n=s,s=t[2*(i+1)+1],!(++o<c&&n===s)){if(o<u)do{Js(e,n,e.bl_tree)}while(0!=--o);else 0!==n?(n!==a&&(Js(e,n,e.bl_tree),o--),Js(e,Bs,e.bl_tree),Vs(e,o-3,2)):o<=10?(Js(e,Ps,e.bl_tree),Vs(e,o-3,3)):(Js(e,Ms,e.bl_tree),Vs(e,o-11,7));o=0,a=n,0===s?(c=138,u=3):n===s?(c=6,u=3):(c=7,u=4)}}ps(Ls);let so=!1;function oo(e){so||(!function(){let e,t,r,i,n;const a=Array(Es+1);for(r=0,i=0;i<ms-1;i++)for(Fs[i]=r,e=0;e<1<<Ds[i];e++)zs[r++]=i;for(zs[r-1]=i,n=0,i=0;i<16;i++)for(Ls[i]=n,e=0;e<1<<xs[i];e++)Qs[n++]=i;for(n>>=7;i<vs;i++)for(Ls[i]=n<<7,e=0;e<1<<xs[i]-7;e++)Qs[256+n++]=i;for(t=0;t<=Es;t++)a[t]=0;for(e=0;e<=143;)Rs[2*e+1]=8,e++,a[8]++;for(;e<=255;)Rs[2*e+1]=9,e++,a[9]++;for(;e<=279;)Rs[2*e+1]=7,e++,a[7]++;for(;e<=287;)Rs[2*e+1]=8,e++,a[8]++;for(Zs(Rs,As+1,a),e=0;e<vs;e++)Ts[2*e+1]=5,Ts[2*e]=Ys(e,5);qs=new Ns(Rs,Ds,ws+1,As,Es),Os=new Ns(Ts,xs,0,vs,Es),Hs=new Ns([],Ks,0,_s,Cs)}(),so=!0),e.l_desc=new js(e.dyn_ltree,qs),e.d_desc=new js(e.dyn_dtree,Os),e.bl_desc=new js(e.bl_tree,Hs),e.bi_buf=0,e.bi_valid=0,Xs(e)}function co(e,t,r,i){Vs(e,(ys<<1)+(i?1:0),3),function(e,t,r,i){$s(e),i&&(Ws(e,r),Ws(e,~r)),ja(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}function uo(e){Vs(e,gs<<1,3),Js(e,Is,Rs),function(e){16===e.bi_valid?(Ws(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}function ho(e,t,r,i){let n,a,s=0;e.level>0?(e.strm.data_type===ds&&(e.strm.data_type=function(e){let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return hs;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return fs;for(t=32;t<ws;t++)if(0!==e.dyn_ltree[2*t])return fs;return hs}(e)),io(e,e.l_desc),io(e,e.d_desc),s=function(e){let t;for(no(e,e.dyn_ltree,e.l_desc.max_code),no(e,e.dyn_dtree,e.d_desc.max_code),io(e,e.bl_desc),t=_s-1;t>=3&&0===e.bl_tree[2*Us[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),n=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?co(e,t,r,i):e.strategy===us||a===n?(Vs(e,(gs<<1)+(i?1:0),3),ro(e,Rs,Ts)):(Vs(e,(bs<<1)+(i?1:0),3),function(e,t,r,i){let n;for(Vs(e,t-257,5),Vs(e,r-1,5),Vs(e,i-4,4),n=0;n<i;n++)Vs(e,e.bl_tree[2*Us[n]+1],3);ao(e,e.dyn_ltree,t-1),ao(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),ro(e,e.dyn_ltree,e.dyn_dtree)),Xs(e),i&&$s(e)}function fo(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(zs[r]+ws+1)]++,e.dyn_dtree[2*Gs(t)]++),e.last_lit===e.lit_bufsize-1}function lo(e,t,r,i){let n=65535&e|0,a=e>>>16&65535|0,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{n=n+t[i++]|0,a=a+n|0}while(--s);n%=65521,a%=65521}return n|a<<16|0}const po=function(){let e;const t=[];for(let r=0;r<256;r++){e=r;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function yo(e,t,r,i){const n=po,a=i+r;e^=-1;for(let r=i;r<a;r++)e=e>>>8^n[255&(e^t[r])];return-1^e}var go={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};const bo=9,mo=3,wo=258,Ao=wo+mo+1,vo=32,_o=42,ko=69,Eo=73,So=91,Co=103,Io=113,Bo=666,Po=1,Mo=2,Do=3,xo=4,Ko=3;function Uo(e,t){return e.msg=go[t],t}function Ro(e){return(e<<1)-(e>4?9:0)}function To(e){let t=e.length;for(;--t>=0;)e[t]=0}function Qo(e){const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(ja(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function zo(e,t){ho(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Qo(e.strm)}function Fo(e,t){e.pending_buf[e.pending++]=t}function Lo(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function No(e,t,r,i){let n=e.avail_in;return n>i&&(n=i),0===n?0:(e.avail_in-=n,ja(t,e.input,e.next_in,n,r),1===e.state.wrap?e.adler=lo(e.adler,t,n,r):2===e.state.wrap&&(e.adler=yo(e.adler,t,n,r)),e.next_in+=n,e.total_in+=n,n)}function qo(e,t){let r,i,n=e.max_chain_length,a=e.strstart,s=e.prev_length,o=e.nice_match;const c=e.strstart>e.w_size-Ao?e.strstart-(e.w_size-Ao):0,u=e.window,h=e.w_mask,f=e.prev,d=e.strstart+wo;let l=u[a+s-1],p=u[a+s];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do{if(r=t,u[r+s]===p&&u[r+s-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&a<d);if(i=wo-(d-a),a=d-wo,i>s){if(e.match_start=t,s=i,i>=o)break;l=u[a+s-1],p=u[a+s]}}}while((t=f[t&h])>c&&0!=--n);return s<=e.lookahead?s:e.lookahead}function Oo(e){const t=e.w_size;let r,i,n,a,s;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Ao)){ja(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,i=e.hash_size,r=i;do{n=e.head[--r],e.head[r]=n>=t?n-t:0}while(--i);i=t,r=i;do{n=e.prev[--r],e.prev[r]=n>=t?n-t:0}while(--i);a+=t}if(0===e.strm.avail_in)break;if(i=No(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=i,e.lookahead+e.insert>=mo)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+mo-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<mo)););}while(e.lookahead<Ao&&0!==e.strm.avail_in)}function Ho(e,t){let r,i;for(;;){if(e.lookahead<Ao){if(Oo(e),e.lookahead<Ao&&t===Ga)return Po;if(0===e.lookahead)break}if(r=0,e.lookahead>=mo&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+mo-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-Ao&&(e.match_length=qo(e,r)),e.match_length>=mo)if(i=fo(e,e.strstart-e.match_start,e.match_length-mo),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=mo){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+mo-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=fo(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(zo(e,!1),0===e.strm.avail_out))return Po}return e.insert=e.strstart<mo-1?e.strstart:mo-1,t===Ya?(zo(e,!0),0===e.strm.avail_out?Do:xo):e.last_lit&&(zo(e,!1),0===e.strm.avail_out)?Po:Mo}function jo(e,t){let r,i,n;for(;;){if(e.lookahead<Ao){if(Oo(e),e.lookahead<Ao&&t===Ga)return Po;if(0===e.lookahead)break}if(r=0,e.lookahead>=mo&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+mo-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=mo-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-Ao&&(e.match_length=qo(e,r),e.match_length<=5&&(e.strategy===ss||e.match_length===mo&&e.strstart-e.match_start>4096)&&(e.match_length=mo-1)),e.prev_length>=mo&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-mo,i=fo(e,e.strstart-1-e.prev_match,e.prev_length-mo),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+mo-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=mo-1,e.strstart++,i&&(zo(e,!1),0===e.strm.avail_out))return Po}else if(e.match_available){if(i=fo(e,0,e.window[e.strstart-1]),i&&zo(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return Po}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=fo(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<mo-1?e.strstart:mo-1,t===Ya?(zo(e,!0),0===e.strm.avail_out?Do:xo):e.last_lit&&(zo(e,!1),0===e.strm.avail_out)?Po:Mo}class Go{constructor(e,t,r,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=i,this.func=n}}const Wo=[new Go(0,0,0,0,(function(e,t){let r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Oo(e),0===e.lookahead&&t===Ga)return Po;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,zo(e,!1),0===e.strm.avail_out))return Po;if(e.strstart-e.block_start>=e.w_size-Ao&&(zo(e,!1),0===e.strm.avail_out))return Po}return e.insert=0,t===Ya?(zo(e,!0),0===e.strm.avail_out?Do:xo):(e.strstart>e.block_start&&(zo(e,!1),e.strm.avail_out),Po)})),new Go(4,4,8,4,Ho),new Go(4,5,16,8,Ho),new Go(4,6,32,32,Ho),new Go(4,4,16,16,jo),new Go(8,16,32,32,jo),new Go(8,16,128,128,jo),new Go(8,32,128,256,jo),new Go(32,128,258,1024,jo),new Go(32,258,258,4096,jo)];class Vo{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ls,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new qa(1146),this.dyn_dtree=new qa(122),this.bl_tree=new qa(78),To(this.dyn_ltree),To(this.dyn_dtree),To(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new qa(16),this.heap=new qa(573),To(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new qa(573),To(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}}function Jo(e){const t=function(e){let t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=ds,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?_o:Io,e.adler=2===t.wrap?0:1,t.last_flush=Ga,oo(t),$a):Uo(e,rs)}(e);return t===$a&&function(e){e.window_size=2*e.w_size,To(e.head),e.max_lazy_match=Wo[e.level].max_lazy,e.good_match=Wo[e.level].good_length,e.nice_match=Wo[e.level].nice_length,e.max_chain_length=Wo[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=mo-1,e.match_available=0,e.ins_h=0}(e.state),t}function Yo(e,t){let r,i,n,a;if(!e||!e.state||t>Za||t<0)return e?Uo(e,rs):rs;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===Bo&&t!==Ya)return Uo(e,0===e.avail_out?ns:rs);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===_o)if(2===i.wrap)e.adler=0,Fo(i,31),Fo(i,139),Fo(i,8),i.gzhead?(Fo(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Fo(i,255&i.gzhead.time),Fo(i,i.gzhead.time>>8&255),Fo(i,i.gzhead.time>>16&255),Fo(i,i.gzhead.time>>24&255),Fo(i,9===i.level?2:i.strategy>=os||i.level<2?4:0),Fo(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(Fo(i,255&i.gzhead.extra.length),Fo(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=yo(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=ko):(Fo(i,0),Fo(i,0),Fo(i,0),Fo(i,0),Fo(i,0),Fo(i,9===i.level?2:i.strategy>=os||i.level<2?4:0),Fo(i,Ko),i.status=Io);else{let t=ls+(i.w_bits-8<<4)<<8,r=-1;r=i.strategy>=os||i.level<2?0:i.level<6?1:6===i.level?2:3,t|=r<<6,0!==i.strstart&&(t|=vo),t+=31-t%31,i.status=Io,Lo(i,t),0!==i.strstart&&(Lo(i,e.adler>>>16),Lo(i,65535&e.adler)),e.adler=1}if(i.status===ko)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=yo(e.adler,i.pending_buf,i.pending-n,n)),Qo(e),n=i.pending,i.pending!==i.pending_buf_size));)Fo(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=yo(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Eo)}else i.status=Eo;if(i.status===Eo)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=yo(e.adler,i.pending_buf,i.pending-n,n)),Qo(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}a=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,Fo(i,a)}while(0!==a);i.gzhead.hcrc&&i.pending>n&&(e.adler=yo(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=So)}else i.status=So;if(i.status===So)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=yo(e.adler,i.pending_buf,i.pending-n,n)),Qo(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}a=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,Fo(i,a)}while(0!==a);i.gzhead.hcrc&&i.pending>n&&(e.adler=yo(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=Co)}else i.status=Co;if(i.status===Co&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Qo(e),i.pending+2<=i.pending_buf_size&&(Fo(i,255&e.adler),Fo(i,e.adler>>8&255),e.adler=0,i.status=Io)):i.status=Io),0!==i.pending){if(Qo(e),0===e.avail_out)return i.last_flush=-1,$a}else if(0===e.avail_in&&Ro(t)<=Ro(r)&&t!==Ya)return Uo(e,ns);if(i.status===Bo&&0!==e.avail_in)return Uo(e,ns);if(0!==e.avail_in||0!==i.lookahead||t!==Ga&&i.status!==Bo){var s=i.strategy===os?function(e,t){let r;for(;;){if(0===e.lookahead&&(Oo(e),0===e.lookahead)){if(t===Ga)return Po;break}if(e.match_length=0,r=fo(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(zo(e,!1),0===e.strm.avail_out))return Po}return e.insert=0,t===Ya?(zo(e,!0),0===e.strm.avail_out?Do:xo):e.last_lit&&(zo(e,!1),0===e.strm.avail_out)?Po:Mo}(i,t):i.strategy===cs?function(e,t){let r,i,n,a;const s=e.window;for(;;){if(e.lookahead<=wo){if(Oo(e),e.lookahead<=wo&&t===Ga)return Po;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=mo&&e.strstart>0&&(n=e.strstart-1,i=s[n],i===s[++n]&&i===s[++n]&&i===s[++n])){a=e.strstart+wo;do{}while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<a);e.match_length=wo-(a-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=mo?(r=fo(e,1,e.match_length-mo),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=fo(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(zo(e,!1),0===e.strm.avail_out))return Po}return e.insert=0,t===Ya?(zo(e,!0),0===e.strm.avail_out?Do:xo):e.last_lit&&(zo(e,!1),0===e.strm.avail_out)?Po:Mo}(i,t):Wo[i.level].func(i,t);if(s!==Do&&s!==xo||(i.status=Bo),s===Po||s===Do)return 0===e.avail_out&&(i.last_flush=-1),$a;if(s===Mo&&(t===Wa?uo(i):t!==Za&&(co(i,0,0,!1),t===Ja&&(To(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),Qo(e),0===e.avail_out))return i.last_flush=-1,$a}return t!==Ya?$a:i.wrap<=0?es:(2===i.wrap?(Fo(i,255&e.adler),Fo(i,e.adler>>8&255),Fo(i,e.adler>>16&255),Fo(i,e.adler>>24&255),Fo(i,255&e.total_in),Fo(i,e.total_in>>8&255),Fo(i,e.total_in>>16&255),Fo(i,e.total_in>>24&255)):(Lo(i,e.adler>>>16),Lo(i,65535&e.adler)),Qo(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?$a:es)}try{String.fromCharCode.call(null,0)}catch(e){}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){}const Zo=new Na(256);for(let e=0;e<256;e++)Zo[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;function Xo(e){let t,r,i,n,a=0;const s=e.length;for(i=0;i<s;i++)t=e.charCodeAt(i),55296==(64512&t)&&i+1<s&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(t=65536+(t-55296<<10)+(r-56320),i++)),a+=t<128?1:t<2048?2:t<65536?3:4;const o=new Na(a);for(n=0,i=0;n<a;i++)t=e.charCodeAt(i),55296==(64512&t)&&i+1<s&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(t=65536+(t-55296<<10)+(r-56320),i++)),t<128?o[n++]=t:t<2048?(o[n++]=192|t>>>6,o[n++]=128|63&t):t<65536?(o[n++]=224|t>>>12,o[n++]=128|t>>>6&63,o[n++]=128|63&t):(o[n++]=240|t>>>18,o[n++]=128|t>>>12&63,o[n++]=128|t>>>6&63,o[n++]=128|63&t);return o}Zo[254]=Zo[254]=1;class $o{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}}class ec{constructor(e){this.options={level:as,method:ls,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,...e||{}};const t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $o,this.strm.avail_out=0;var r,i,n=function(e,t,r,i,n,a){if(!e)return rs;let s=1;if(t===as&&(t=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),n<1||n>bo||r!==ls||i<8||i>15||t<0||t>9||a<0||a>us)return Uo(e,rs);8===i&&(i=9);const o=new Vo;return e.state=o,o.strm=e,o.wrap=s,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+mo-1)/mo),o.window=new Na(2*o.w_size),o.head=new qa(o.hash_size),o.prev=new qa(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Na(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=a,o.method=r,Jo(e)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==$a)throw Error(go[n]);if(t.header&&(r=this.strm,i=t.header,r&&r.state&&(2!==r.state.wrap||(r.state.gzhead=i))),t.dictionary){let e;if(e="string"==typeof t.dictionary?Xo(t.dictionary):t.dictionary instanceof ArrayBuffer?new Uint8Array(t.dictionary):t.dictionary,n=function(e,t){let r,i,n,a,s,o,c,u,h=t.length;if(!e||!e.state)return rs;if(r=e.state,a=r.wrap,2===a||1===a&&r.status!==_o||r.lookahead)return rs;for(1===a&&(e.adler=lo(e.adler,t,h,0)),r.wrap=0,h>=r.w_size&&(0===a&&(To(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new Na(r.w_size),ja(u,t,h-r.w_size,r.w_size,0),t=u,h=r.w_size),s=e.avail_in,o=e.next_in,c=e.input,e.avail_in=h,e.next_in=0,e.input=t,Oo(r);r.lookahead>=mo;){i=r.strstart,n=r.lookahead-(mo-1);do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+mo-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++}while(--n);r.strstart=i,r.lookahead=mo-1,Oo(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=mo-1,r.match_available=0,e.next_in=o,e.input=c,e.avail_in=s,r.wrap=a,$a}(this.strm,e),n!==$a)throw Error(go[n]);this._dict_set=!0}}push(e,t){const{strm:r,options:{chunkSize:i}}=this;var n,a;if(this.ended)return!1;a=t===~~t?t:!0===t?Ya:Ga,"string"==typeof e?r.input=Xo(e):e instanceof ArrayBuffer?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new Na(i),r.next_out=0,r.avail_out=i),(n=Yo(r,a))!==es&&n!==$a)return this.onEnd(n),this.ended=!0,!1;0!==r.avail_out&&(0!==r.avail_in||a!==Ya&&a!==Va)||this.onData(za(r.output,r.next_out))}while((r.avail_in>0||0===r.avail_out)&&n!==es);return a===Ya?(n=function(e){let t;return e&&e.state?(t=e.state.status,t!==_o&&t!==ko&&t!==Eo&&t!==So&&t!==Co&&t!==Io&&t!==Bo?Uo(e,rs):(e.state=null,t===Io?Uo(e,is):$a)):rs}(this.strm),this.onEnd(n),this.ended=!0,n===$a):a!==Va||(this.onEnd($a),r.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===$a&&(this.result=Ha(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}const tc=30,rc=12;function ic(e,t){let r,i,n,a,s,o,c,u,h,f;const d=e.state;r=e.next_in;const l=e.input,p=r+(e.avail_in-5);i=e.next_out;const y=e.output,g=i-(t-e.avail_out),b=i+(e.avail_out-257),m=d.dmax,w=d.wsize,A=d.whave,v=d.wnext,_=d.window;n=d.hold,a=d.bits;const k=d.lencode,E=d.distcode,S=(1<<d.lenbits)-1,C=(1<<d.distbits)-1;e:do{a<15&&(n+=l[r++]<<a,a+=8,n+=l[r++]<<a,a+=8),s=k[n&S];t:for(;;){if(o=s>>>24,n>>>=o,a-=o,o=s>>>16&255,0===o)y[i++]=65535&s;else{if(!(16&o)){if(0==(64&o)){s=k[(65535&s)+(n&(1<<o)-1)];continue t}if(32&o){d.mode=rc;break e}e.msg="invalid literal/length code",d.mode=tc;break e}c=65535&s,o&=15,o&&(a<o&&(n+=l[r++]<<a,a+=8),c+=n&(1<<o)-1,n>>>=o,a-=o),a<15&&(n+=l[r++]<<a,a+=8,n+=l[r++]<<a,a+=8),s=E[n&C];r:for(;;){if(o=s>>>24,n>>>=o,a-=o,o=s>>>16&255,!(16&o)){if(0==(64&o)){s=E[(65535&s)+(n&(1<<o)-1)];continue r}e.msg="invalid distance code",d.mode=tc;break e}if(u=65535&s,o&=15,a<o&&(n+=l[r++]<<a,a+=8,a<o&&(n+=l[r++]<<a,a+=8)),u+=n&(1<<o)-1,u>m){e.msg="invalid distance too far back",d.mode=tc;break e}if(n>>>=o,a-=o,o=i-g,u>o){if(o=u-o,o>A&&d.sane){e.msg="invalid distance too far back",d.mode=tc;break e}if(h=0,f=_,0===v){if(h+=w-o,o<c){c-=o;do{y[i++]=_[h++]}while(--o);h=i-u,f=y}}else if(v<o){if(h+=w+v-o,o-=v,o<c){c-=o;do{y[i++]=_[h++]}while(--o);if(h=0,v<c){o=v,c-=o;do{y[i++]=_[h++]}while(--o);h=i-u,f=y}}}else if(h+=v-o,o<c){c-=o;do{y[i++]=_[h++]}while(--o);h=i-u,f=y}for(;c>2;)y[i++]=f[h++],y[i++]=f[h++],y[i++]=f[h++],c-=3;c&&(y[i++]=f[h++],c>1&&(y[i++]=f[h++]))}else{h=i-u;do{y[i++]=y[h++],y[i++]=y[h++],y[i++]=y[h++],c-=3}while(c>2);c&&(y[i++]=y[h++],c>1&&(y[i++]=y[h++]))}break}}break}}while(r<p&&i<b);c=a>>3,r-=c,a-=c<<3,n&=(1<<a)-1,e.next_in=r,e.next_out=i,e.avail_in=r<p?p-r+5:5-(r-p),e.avail_out=i<b?b-i+257:257-(i-b),d.hold=n,d.bits=a}const nc=15,ac=852,sc=592,oc=0,cc=1,uc=2,hc=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],fc=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],dc=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],lc=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function pc(e,t,r,i,n,a,s,o){const c=o.bits;let u,h,f,d,l,p=0,y=0,g=0,b=0,m=0,w=0,A=0,v=0,_=0,k=0,E=null,S=0;const C=new qa(nc+1),I=new qa(nc+1);let B,P,M,D=null,x=0;for(p=0;p<=nc;p++)C[p]=0;for(y=0;y<i;y++)C[t[r+y]]++;for(m=c,b=nc;b>=1&&0===C[b];b--);if(m>b&&(m=b),0===b)return n[a++]=20971520,n[a++]=20971520,o.bits=1,0;for(g=1;g<b&&0===C[g];g++);for(m<g&&(m=g),v=1,p=1;p<=nc;p++)if(v<<=1,v-=C[p],v<0)return-1;if(v>0&&(e===oc||1!==b))return-1;for(I[1]=0,p=1;p<nc;p++)I[p+1]=I[p]+C[p];for(y=0;y<i;y++)0!==t[r+y]&&(s[I[t[r+y]]++]=y);e===oc?(E=D=s,l=19):e===cc?(E=hc,S-=257,D=fc,x-=257,l=256):(E=dc,D=lc,l=-1),k=0,y=0,p=g,d=a,w=m,A=0,f=-1,_=1<<m;const K=_-1;if(e===cc&&_>ac||e===uc&&_>sc)return 1;for(;;){B=p-A,s[y]<l?(P=0,M=s[y]):s[y]>l?(P=D[x+s[y]],M=E[S+s[y]]):(P=96,M=0),u=1<<p-A,h=1<<w,g=h;do{h-=u,n[d+(k>>A)+h]=B<<24|P<<16|M|0}while(0!==h);for(u=1<<p-1;k&u;)u>>=1;if(0!==u?(k&=u-1,k+=u):k=0,y++,0==--C[p]){if(p===b)break;p=t[r+s[y]]}if(p>m&&(k&K)!==f){for(0===A&&(A=m),d+=g,w=p-A,v=1<<w;w+A<b&&(v-=C[w+A],!(v<=0));)w++,v<<=1;if(_+=1<<w,e===cc&&_>ac||e===uc&&_>sc)return 1;f=k&K,n[f]=m<<24|w<<16|d-a|0}}return 0!==k&&(n[d+k]=p-A<<24|64<<16|0),o.bits=m,0}const yc=0,gc=1,bc=2,mc=1,wc=2,Ac=3,vc=4,_c=5,kc=6,Ec=7,Sc=8,Cc=9,Ic=10,Bc=11,Pc=12,Mc=13,Dc=14,xc=15,Kc=16,Uc=17,Rc=18,Tc=19,Qc=20,zc=21,Fc=22,Lc=23,Nc=24,qc=25,Oc=26,Hc=27,jc=28,Gc=29,Wc=30,Vc=852,Jc=592;function Yc(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}class Zc{constructor(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new qa(320),this.work=new qa(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}}function Xc(e){let t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,function(e){let t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=mc,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Oa(Vc),t.distcode=t.distdyn=new Oa(Jc),t.sane=1,t.back=-1,$a):rs}(e)):rs}function $c(e,t){let r,i;return e?(i=new Zc,e.state=i,i.window=null,r=function(e,t){let r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?rs:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,Xc(e))):rs}(e,t),r!==$a&&(e.state=null),r):rs}let eu,tu,ru=!0;function iu(e){if(ru){let t;for(eu=new Oa(512),tu=new Oa(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(pc(gc,e.lens,0,288,eu,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;pc(bc,e.lens,0,32,tu,0,e.work,{bits:5}),ru=!1}e.lencode=eu,e.lenbits=9,e.distcode=tu,e.distbits=5}function nu(e,t,r,i){let n;const a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Na(a.wsize)),i>=a.wsize?(ja(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>i&&(n=i),ja(a.window,t,r-i,n,a.wnext),(i-=n)?(ja(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0}function au(e,t){let r,i,n,a,s,o,c,u,h,f,d,l,p,y,g,b,m,w,A,v,_,k,E,S,C=0,I=new Na(4);const B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return rs;r=e.state,r.mode===Pc&&(r.mode=Mc),s=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,o=e.avail_in,u=r.hold,h=r.bits,f=o,d=c,k=$a;e:for(;;)switch(r.mode){case mc:if(0===r.wrap){r.mode=Mc;break}for(;h<16;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(2&r.wrap&&35615===u){r.check=0,I[0]=255&u,I[1]=u>>>8&255,r.check=yo(r.check,I,2,0),u=0,h=0,r.mode=wc;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=Wc;break}if((15&u)!==ls){e.msg="unknown compression method",r.mode=Wc;break}if(u>>>=4,h-=4,_=8+(15&u),0===r.wbits)r.wbits=_;else if(_>r.wbits){e.msg="invalid window size",r.mode=Wc;break}r.dmax=1<<_,e.adler=r.check=1,r.mode=512&u?Ic:Pc,u=0,h=0;break;case wc:for(;h<16;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(r.flags=u,(255&r.flags)!==ls){e.msg="unknown compression method",r.mode=Wc;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=Wc;break}r.head&&(r.head.text=u>>8&1),512&r.flags&&(I[0]=255&u,I[1]=u>>>8&255,r.check=yo(r.check,I,2,0)),u=0,h=0,r.mode=Ac;case Ac:for(;h<32;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}r.head&&(r.head.time=u),512&r.flags&&(I[0]=255&u,I[1]=u>>>8&255,I[2]=u>>>16&255,I[3]=u>>>24&255,r.check=yo(r.check,I,4,0)),u=0,h=0,r.mode=vc;case vc:for(;h<16;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}r.head&&(r.head.xflags=255&u,r.head.os=u>>8),512&r.flags&&(I[0]=255&u,I[1]=u>>>8&255,r.check=yo(r.check,I,2,0)),u=0,h=0,r.mode=_c;case _c:if(1024&r.flags){for(;h<16;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}r.length=u,r.head&&(r.head.extra_len=u),512&r.flags&&(I[0]=255&u,I[1]=u>>>8&255,r.check=yo(r.check,I,2,0)),u=0,h=0}else r.head&&(r.head.extra=null);r.mode=kc;case kc:if(1024&r.flags&&(l=r.length,l>o&&(l=o),l&&(r.head&&(_=r.head.extra_len-r.length,r.head.extra||(r.head.extra=Array(r.head.extra_len)),ja(r.head.extra,i,a,l,_)),512&r.flags&&(r.check=yo(r.check,i,l,a)),o-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=Ec;case Ec:if(2048&r.flags){if(0===o)break e;l=0;do{_=i[a+l++],r.head&&_&&r.length<65536&&(r.head.name+=String.fromCharCode(_))}while(_&&l<o);if(512&r.flags&&(r.check=yo(r.check,i,l,a)),o-=l,a+=l,_)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Sc;case Sc:if(4096&r.flags){if(0===o)break e;l=0;do{_=i[a+l++],r.head&&_&&r.length<65536&&(r.head.comment+=String.fromCharCode(_))}while(_&&l<o);if(512&r.flags&&(r.check=yo(r.check,i,l,a)),o-=l,a+=l,_)break e}else r.head&&(r.head.comment=null);r.mode=Cc;case Cc:if(512&r.flags){for(;h<16;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(u!==(65535&r.check)){e.msg="header crc mismatch",r.mode=Wc;break}u=0,h=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Pc;break;case Ic:for(;h<32;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}e.adler=r.check=Yc(u),u=0,h=0,r.mode=Bc;case Bc:if(0===r.havedict)return e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=o,r.hold=u,r.bits=h,ts;e.adler=r.check=1,r.mode=Pc;case Pc:if(t===Za||t===Xa)break e;case Mc:if(r.last){u>>>=7&h,h-=7&h,r.mode=Hc;break}for(;h<3;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}switch(r.last=1&u,u>>>=1,h-=1,3&u){case 0:r.mode=Dc;break;case 1:if(iu(r),r.mode=Qc,t===Xa){u>>>=2,h-=2;break e}break;case 2:r.mode=Uc;break;case 3:e.msg="invalid block type",r.mode=Wc}u>>>=2,h-=2;break;case Dc:for(u>>>=7&h,h-=7&h;h<32;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Wc;break}if(r.length=65535&u,u=0,h=0,r.mode=xc,t===Xa)break e;case xc:r.mode=Kc;case Kc:if(l=r.length,l){if(l>o&&(l=o),l>c&&(l=c),0===l)break e;ja(n,i,a,l,s),o-=l,a+=l,c-=l,s+=l,r.length-=l;break}r.mode=Pc;break;case Uc:for(;h<14;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(r.nlen=257+(31&u),u>>>=5,h-=5,r.ndist=1+(31&u),u>>>=5,h-=5,r.ncode=4+(15&u),u>>>=4,h-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Wc;break}r.have=0,r.mode=Rc;case Rc:for(;r.have<r.ncode;){for(;h<3;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}r.lens[B[r.have++]]=7&u,u>>>=3,h-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,E={bits:r.lenbits},k=pc(yc,r.lens,0,19,r.lencode,0,r.work,E),r.lenbits=E.bits,k){e.msg="invalid code lengths set",r.mode=Wc;break}r.have=0,r.mode=Tc;case Tc:for(;r.have<r.nlen+r.ndist;){for(;C=r.lencode[u&(1<<r.lenbits)-1],g=C>>>24,b=C>>>16&255,m=65535&C,!(g<=h);){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(m<16)u>>>=g,h-=g,r.lens[r.have++]=m;else{if(16===m){for(S=g+2;h<S;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(u>>>=g,h-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=Wc;break}_=r.lens[r.have-1],l=3+(3&u),u>>>=2,h-=2}else if(17===m){for(S=g+3;h<S;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}u>>>=g,h-=g,_=0,l=3+(7&u),u>>>=3,h-=3}else{for(S=g+7;h<S;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}u>>>=g,h-=g,_=0,l=11+(127&u),u>>>=7,h-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Wc;break}for(;l--;)r.lens[r.have++]=_}}if(r.mode===Wc)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Wc;break}if(r.lenbits=9,E={bits:r.lenbits},k=pc(gc,r.lens,0,r.nlen,r.lencode,0,r.work,E),r.lenbits=E.bits,k){e.msg="invalid literal/lengths set",r.mode=Wc;break}if(r.distbits=6,r.distcode=r.distdyn,E={bits:r.distbits},k=pc(bc,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,E),r.distbits=E.bits,k){e.msg="invalid distances set",r.mode=Wc;break}if(r.mode=Qc,t===Xa)break e;case Qc:r.mode=zc;case zc:if(o>=6&&c>=258){e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=o,r.hold=u,r.bits=h,ic(e,d),s=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,o=e.avail_in,u=r.hold,h=r.bits,r.mode===Pc&&(r.back=-1);break}for(r.back=0;C=r.lencode[u&(1<<r.lenbits)-1],g=C>>>24,b=C>>>16&255,m=65535&C,!(g<=h);){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(b&&0==(240&b)){for(w=g,A=b,v=m;C=r.lencode[v+((u&(1<<w+A)-1)>>w)],g=C>>>24,b=C>>>16&255,m=65535&C,!(w+g<=h);){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}u>>>=w,h-=w,r.back+=w}if(u>>>=g,h-=g,r.back+=g,r.length=m,0===b){r.mode=Oc;break}if(32&b){r.back=-1,r.mode=Pc;break}if(64&b){e.msg="invalid literal/length code",r.mode=Wc;break}r.extra=15&b,r.mode=Fc;case Fc:if(r.extra){for(S=r.extra;h<S;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Lc;case Lc:for(;C=r.distcode[u&(1<<r.distbits)-1],g=C>>>24,b=C>>>16&255,m=65535&C,!(g<=h);){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(0==(240&b)){for(w=g,A=b,v=m;C=r.distcode[v+((u&(1<<w+A)-1)>>w)],g=C>>>24,b=C>>>16&255,m=65535&C,!(w+g<=h);){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}u>>>=w,h-=w,r.back+=w}if(u>>>=g,h-=g,r.back+=g,64&b){e.msg="invalid distance code",r.mode=Wc;break}r.offset=m,r.extra=15&b,r.mode=Nc;case Nc:if(r.extra){for(S=r.extra;h<S;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Wc;break}r.mode=qc;case qc:if(0===c)break e;if(l=d-c,r.offset>l){if(l=r.offset-l,l>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Wc;break}l>r.wnext?(l-=r.wnext,p=r.wsize-l):p=r.wnext-l,l>r.length&&(l=r.length),y=r.window}else y=n,p=s-r.offset,l=r.length;l>c&&(l=c),c-=l,r.length-=l;do{n[s++]=y[p++]}while(--l);0===r.length&&(r.mode=zc);break;case Oc:if(0===c)break e;n[s++]=r.length,c--,r.mode=zc;break;case Hc:if(r.wrap){for(;h<32;){if(0===o)break e;o--,u|=i[a++]<<h,h+=8}if(d-=c,e.total_out+=d,r.total+=d,d&&(e.adler=r.check=r.flags?yo(r.check,n,d,s-d):lo(r.check,n,d,s-d)),d=c,(r.flags?u:Yc(u))!==r.check){e.msg="incorrect data check",r.mode=Wc;break}u=0,h=0}r.mode=jc;case jc:if(r.wrap&&r.flags){for(;h<32;){if(0===o)break e;o--,u+=i[a++]<<h,h+=8}if(u!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=Wc;break}u=0,h=0}r.mode=Gc;case Gc:k=es;break e;case Wc:k=is;break e;default:return rs}return e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=o,r.hold=u,r.bits=h,(r.wsize||d!==e.avail_out&&r.mode<Wc&&(r.mode<Hc||t!==Ya))&&nu(e,e.output,e.next_out,d-e.avail_out),f-=e.avail_in,d-=e.avail_out,e.total_in+=f,e.total_out+=d,r.total+=d,r.wrap&&d&&(e.adler=r.check=r.flags?yo(r.check,n,d,e.next_out-d):lo(r.check,n,d,e.next_out-d)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Pc?128:0)+(r.mode===Qc||r.mode===xc?256:0),(0===f&&0===d||t===Ya)&&k===$a&&(k=ns),k}function su(e,t){const r=t.length;let i,n;return e&&e.state?(i=e.state,0!==i.wrap&&i.mode!==Bc?rs:i.mode===Bc&&(n=1,n=lo(n,t,r,0),n!==i.check)?is:(nu(e,t,r,r),i.havedict=1,$a)):rs}class ou{constructor(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}}class cu{constructor(e){this.options={chunkSize:16384,windowBits:0,...e||{}};const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $o,this.strm.avail_out=0;let r=$c(this.strm,t.windowBits);if(r!==$a)throw Error(go[r]);if(this.header=new ou,function(e,t){let r;e&&e.state&&(r=e.state,0==(2&r.wrap)||(r.head=t,t.done=!1))}(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Xo(t.dictionary):t.dictionary instanceof ArrayBuffer&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=su(this.strm,t.dictionary),r!==$a)))throw Error(go[r])}push(e,t){const{strm:r,options:{chunkSize:i,dictionary:n}}=this;let a,s,o=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?Ya:Ga,"string"==typeof e?r.input=function(e){const t=new Na(e.length);for(let r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t}(e):e instanceof ArrayBuffer?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new Na(i),r.next_out=0,r.avail_out=i),a=au(r,Ga),a===ts&&n&&(a=su(this.strm,n)),a===ns&&!0===o&&(a=$a,o=!1),a!==es&&a!==$a)return this.onEnd(a),this.ended=!0,!1;r.next_out&&(0!==r.avail_out&&a!==es&&(0!==r.avail_in||s!==Ya&&s!==Va)||this.onData(za(r.output,r.next_out))),0===r.avail_in&&0===r.avail_out&&(o=!0)}while((r.avail_in>0||0===r.avail_out)&&a!==es);return a===es&&(s=Ya),s===Ya?(a=function(e){if(!e||!e.state)return rs;const t=e.state;return t.window&&(t.window=null),e.state=null,$a}(this.strm),this.onEnd(a),this.ended=!0,a===$a):s!==Va||(this.onEnd($a),r.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===$a&&(this.result=Ha(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}var uu=[0,1,3,7,15,31,63,127,255],hu=function(e){this.stream=e,this.bitOffset=0,this.curByte=0,this.hasByte=!1};hu.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},hu.prototype.read=function(e){for(var t=0;e>0;){this._ensureByte();var r=8-this.bitOffset;if(e>=r)t<<=r,t|=uu[r]&this.curByte,this.hasByte=!1,this.bitOffset=0,e-=r;else{t<<=e;var i=r-e;t|=(this.curByte&uu[e]<<i)>>i,this.bitOffset+=e,e=0}}return t},hu.prototype.seek=function(e){var t=e%8,r=(e-t)/8;this.bitOffset=t,this.stream.seek(r),this.hasByte=!1},hu.prototype.pi=function(){var e,t=new Uint8Array(6);for(e=0;e<t.length;e++)t[e]=this.read(8);return function(e){return Array.prototype.map.call(e,(e=>("00"+e.toString(16)).slice(-2))).join("")}(t)};var fu=hu,du=function(){};du.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},du.prototype.read=function(e,t,r){for(var i=0;i<r;){var n=this.readByte();if(n<0)return 0===i?-1:i;e[t++]=n,i++}return i},du.prototype.seek=function(e){throw Error("abstract method seek() not implemented")},du.prototype.writeByte=function(e){throw Error("abstract method readByte() not implemented")},du.prototype.write=function(e,t,r){var i;for(i=0;i<r;i++)this.writeByte(e[t++]);return r},du.prototype.flush=function(){};var lu,pu=du,yu=(lu=new Uint32Array([0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188]),function(){var e=4294967295;this.getCRC=function(){return~e>>>0},this.updateCRC=function(t){e=e<<8^lu[255&(e>>>24^t)]},this.updateCRCRun=function(t,r){for(;r-- >0;)e=e<<8^lu[255&(e>>>24^t)]}}),gu=function(e,t){var r,i=e[t];for(r=t;r>0;r--)e[r]=e[r-1];return e[0]=i,i},bu={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},mu={};mu[bu.LAST_BLOCK]="Bad file checksum",mu[bu.NOT_BZIP_DATA]="Not bzip data",mu[bu.UNEXPECTED_INPUT_EOF]="Unexpected input EOF",mu[bu.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF",mu[bu.DATA_ERROR]="Data error",mu[bu.OUT_OF_MEMORY]="Out of memory",mu[bu.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var wu=function(e,t){var r=mu[e]||"unknown error";t&&(r+=": "+t);var i=new TypeError(r);throw i.errorCode=e,i},Au=function(e,t){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(e,t)};Au.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new yu,!0):(this.writeCount=-1,!1)},Au.prototype._start_bunzip=function(e,t){var r=new Uint8Array(4);4===e.read(r,0,4)&&"BZh"===String.fromCharCode(r[0],r[1],r[2])||wu(bu.NOT_BZIP_DATA,"bad magic");var i=r[3]-48;(i<1||i>9)&&wu(bu.NOT_BZIP_DATA,"level out of range"),this.reader=new fu(e),this.dbufSize=1e5*i,this.nextoutput=0,this.outputStream=t,this.streamCRC=0},Au.prototype._get_next_block=function(){var e,t,r,i=this.reader,n=i.pi();if("177245385090"===n)return!1;"314159265359"!==n&&wu(bu.NOT_BZIP_DATA),this.targetBlockCRC=i.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,i.read(1)&&wu(bu.OBSOLETE_INPUT);var a=i.read(24);a>this.dbufSize&&wu(bu.DATA_ERROR,"initial position out of bounds");var s=i.read(16),o=new Uint8Array(256),c=0;for(e=0;e<16;e++)if(s&1<<15-e){var u=16*e;for(r=i.read(16),t=0;t<16;t++)r&1<<15-t&&(o[c++]=u+t)}var h=i.read(3);(h<2||h>6)&&wu(bu.DATA_ERROR);var f=i.read(15);0===f&&wu(bu.DATA_ERROR);var d=new Uint8Array(256);for(e=0;e<h;e++)d[e]=e;var l=new Uint8Array(f);for(e=0;e<f;e++){for(t=0;i.read(1);t++)t>=h&&wu(bu.DATA_ERROR);l[e]=gu(d,t)}var p,y=c+2,g=[];for(t=0;t<h;t++){var b,m,w=new Uint8Array(y),A=new Uint16Array(21);for(s=i.read(5),e=0;e<y;e++){for(;(s<1||s>20)&&wu(bu.DATA_ERROR),i.read(1);)i.read(1)?s--:s++;w[e]=s}for(b=m=w[0],e=1;e<y;e++)w[e]>m?m=w[e]:w[e]<b&&(b=w[e]);p={},g.push(p),p.permute=new Uint16Array(258),p.limit=new Uint32Array(22),p.base=new Uint32Array(21),p.minLen=b,p.maxLen=m;var v=0;for(e=b;e<=m;e++)for(A[e]=p.limit[e]=0,s=0;s<y;s++)w[s]===e&&(p.permute[v++]=s);for(e=0;e<y;e++)A[w[e]]++;for(v=s=0,e=b;e<m;e++)v+=A[e],p.limit[e]=v-1,v<<=1,s+=A[e],p.base[e+1]=v-s;p.limit[m+1]=Number.MAX_VALUE,p.limit[m]=v+A[m]-1,p.base[b]=0}var _=new Uint32Array(256);for(e=0;e<256;e++)d[e]=e;var k,E=0,S=0,C=0,I=this.dbuf=new Uint32Array(this.dbufSize);for(y=0;;){for(y--||(y=49,C>=f&&wu(bu.DATA_ERROR),p=g[l[C++]]),e=p.minLen,t=i.read(e);e>p.maxLen&&wu(bu.DATA_ERROR),!(t<=p.limit[e]);e++)t=t<<1|i.read(1);((t-=p.base[e])<0||t>=258)&&wu(bu.DATA_ERROR);var B=p.permute[t];if(0!==B&&1!==B){if(E)for(E=0,S+s>this.dbufSize&&wu(bu.DATA_ERROR),_[k=o[d[0]]]+=s;s--;)I[S++]=k;if(B>c)break;S>=this.dbufSize&&wu(bu.DATA_ERROR),_[k=o[k=gu(d,e=B-1)]]++,I[S++]=k}else E||(E=1,s=0),s+=0===B?E:2*E,E<<=1}for((a<0||a>=S)&&wu(bu.DATA_ERROR),t=0,e=0;e<256;e++)r=t+_[e],_[e]=t,t=r;for(e=0;e<S;e++)I[_[k=255&I[e]]]|=e<<8,_[k]++;var P=0,M=0,D=0;return S&&(M=255&(P=I[a]),P>>=8,D=-1),this.writePos=P,this.writeCurrent=M,this.writeCount=S,this.writeRun=D,!0},Au.prototype._read_bunzip=function(e,t){var r,i,n;if(this.writeCount<0)return 0;var a=this.dbuf,s=this.writePos,o=this.writeCurrent,c=this.writeCount;this.outputsize;for(var u=this.writeRun;c;){for(c--,i=o,o=255&(s=a[s]),s>>=8,3==u++?(r=o,n=i,o=-1):(r=1,n=o),this.blockCRC.updateCRCRun(n,r);r--;)this.outputStream.writeByte(n),this.nextoutput++;o!=i&&(u=0)}return this.writeCount=c,this.blockCRC.getCRC()!==this.targetBlockCRC&&wu(bu.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var vu=function(e){if("readByte"in e)return e;var t=new pu;return t.pos=0,t.readByte=function(){return e[this.pos++]},t.seek=function(e){this.pos=e},t.eof=function(){return this.pos>=e.length},t},_u=function(e){var t=new pu,r=!0;if(e)if("number"==typeof e)t.buffer=new Uint8Array(e),r=!1;else{if("writeByte"in e)return e;t.buffer=e,r=!1}else t.buffer=new Uint8Array(16384);return t.pos=0,t.writeByte=function(e){if(r&&this.pos>=this.buffer.length){var t=new Uint8Array(2*this.buffer.length);t.set(this.buffer),this.buffer=t}this.buffer[this.pos++]=e},t.getBuffer=function(){if(this.pos!==this.buffer.length){if(!r)throw new TypeError("outputsize does not match decoded input");var e=new Uint8Array(this.pos);e.set(this.buffer.subarray(0,this.pos)),this.buffer=e}return this.buffer},t._coerced=!0,t};var ku=function(e,t,r){for(var i=vu(e),n=_u(t),a=new Au(i,n);!("eof"in i)||!i.eof();)if(a._init_block())a._read_bunzip();else{var s=a.reader.read(32)>>>0;if(s!==a.streamCRC&&wu(bu.DATA_ERROR,"Bad stream CRC (got "+a.streamCRC.toString(16)+" expected "+s.toString(16)+")"),!r||!("eof"in i)||i.eof())break;a._start_bunzip(i,n)}if("getBuffer"in n)return n.getBuffer()};class Eu{static get tag(){return V.packet.literalData}constructor(e=new Date){this.format=V.literal.utf8,this.date=Y.normalizeDate(e),this.text=null,this.data=null,this.filename=""}setText(e,t=V.literal.utf8){this.format=t,this.text=e,this.data=null}getText(e=!1){return(null===this.text||Y.isStream(this.text))&&(this.text=Y.decodeUTF8(Y.nativeEOL(this.getBytes(e)))),this.text}setBytes(e,t){this.format=t,this.data=e,this.text=null}getBytes(e=!1){return null===this.data&&(this.data=Y.canonicalizeEOL(Y.encodeUTF8(this.text))),e?F(this.data):this.data}setFilename(e){this.filename=e}getFilename(){return this.filename}async read(e){await Q(e,(async e=>{const t=await e.readByte(),r=await e.readByte();this.filename=Y.decodeUTF8(await e.readBytes(r)),this.date=Y.readDate(await e.readBytes(4));let i=e.remainder();s(i)&&(i=await q(i)),this.setBytes(i,t)}))}writeHeader(){const e=Y.encodeUTF8(this.filename),t=new Uint8Array([e.length]),r=new Uint8Array([this.format]),i=Y.writeDate(this.date);return Y.concatUint8Array([r,t,e,i])}write(){const e=this.writeHeader(),t=this.getBytes();return Y.concat([e,t])}}const Su=Symbol("verified"),Cu=new Set([V.signatureSubpacket.issuer,V.signatureSubpacket.issuerFingerprint,V.signatureSubpacket.embeddedSignature]);class Iu{static get tag(){return V.packet.signature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.unhashedSubpackets=[],this.signedHashValue=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=!0,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyID=new pe,this.rawNotations=[],this.notations={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserID=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.features=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.issuerKeyVersion=null,this.issuerFingerprint=null,this.preferredAEADAlgorithms=null,this.revoked=null,this[Su]=null}read(e){let t=0;if(this.version=e[t++],4!==this.version&&5!==this.version)throw new gn(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=e[t++],this.publicKeyAlgorithm=e[t++],this.hashAlgorithm=e[t++],t+=this.readSubPackets(e.subarray(t,e.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=e.subarray(0,t),t+=this.readSubPackets(e.subarray(t,e.length),!1),this.signedHashValue=e.subarray(t,t+2),t+=2,this.params=Ba.signature.parseSignatureParams(this.publicKeyAlgorithm,e.subarray(t,e.length))}writeParams(){return this.params instanceof Promise?H((async()=>Ba.serializeParams(this.publicKeyAlgorithm,await this.params))):Ba.serializeParams(this.publicKeyAlgorithm,this.params)}write(){const e=[];return e.push(this.signatureData),e.push(this.writeUnhashedSubPackets()),e.push(this.signedHashValue),e.push(this.writeParams()),Y.concat(e)}async sign(e,t,r=new Date,i=!1){5===e.version?this.version=5:this.version=4;const n=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=Y.normalizeDate(r),this.issuerKeyVersion=e.version,this.issuerFingerprint=e.getFingerprintBytes(),this.issuerKeyID=e.getKeyID(),n.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=Y.concat(n);const a=this.toHash(this.signatureType,t,i),s=await this.hash(this.signatureType,t,a,i);this.signedHashValue=N(z(s),0,2);const o=async()=>Ba.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,e.publicParams,e.privateParams,a,await q(s));Y.isStream(s)?this.params=o():(this.params=await o(),this[Su]=!0)}writeHashedSubPackets(){const e=V.signatureSubpacket,t=[];let r;if(null===this.created)throw Error("Missing signature creation time");t.push(Bu(e.signatureCreationTime,!0,Y.writeDate(this.created))),null!==this.signatureExpirationTime&&t.push(Bu(e.signatureExpirationTime,!0,Y.writeNumber(this.signatureExpirationTime,4))),null!==this.exportable&&t.push(Bu(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),null!==this.trustLevel&&(r=new Uint8Array([this.trustLevel,this.trustAmount]),t.push(Bu(e.trustSignature,!0,r))),null!==this.regularExpression&&t.push(Bu(e.regularExpression,!0,this.regularExpression)),null!==this.revocable&&t.push(Bu(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),null!==this.keyExpirationTime&&t.push(Bu(e.keyExpirationTime,!0,Y.writeNumber(this.keyExpirationTime,4))),null!==this.preferredSymmetricAlgorithms&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.preferredSymmetricAlgorithms)),t.push(Bu(e.preferredSymmetricAlgorithms,!1,r))),null!==this.revocationKeyClass&&(r=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),r=Y.concat([r,this.revocationKeyFingerprint]),t.push(Bu(e.revocationKey,!1,r))),this.issuerKeyID.isNull()||5===this.issuerKeyVersion||t.push(Bu(e.issuer,!0,this.issuerKeyID.write())),this.rawNotations.forEach((({name:i,value:n,humanReadable:a,critical:s})=>{r=[new Uint8Array([a?128:0,0,0,0])];const o=Y.encodeUTF8(i);r.push(Y.writeNumber(o.length,2)),r.push(Y.writeNumber(n.length,2)),r.push(o),r.push(n),r=Y.concat(r),t.push(Bu(e.notationData,s,r))})),null!==this.preferredHashAlgorithms&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.preferredHashAlgorithms)),t.push(Bu(e.preferredHashAlgorithms,!1,r))),null!==this.preferredCompressionAlgorithms&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.preferredCompressionAlgorithms)),t.push(Bu(e.preferredCompressionAlgorithms,!1,r))),null!==this.keyServerPreferences&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.keyServerPreferences)),t.push(Bu(e.keyServerPreferences,!1,r))),null!==this.preferredKeyServer&&t.push(Bu(e.preferredKeyServer,!1,Y.encodeUTF8(this.preferredKeyServer))),null!==this.isPrimaryUserID&&t.push(Bu(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),null!==this.policyURI&&t.push(Bu(e.policyURI,!1,Y.encodeUTF8(this.policyURI))),null!==this.keyFlags&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.keyFlags)),t.push(Bu(e.keyFlags,!0,r))),null!==this.signersUserID&&t.push(Bu(e.signersUserID,!1,Y.encodeUTF8(this.signersUserID))),null!==this.reasonForRevocationFlag&&(r=Y.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),t.push(Bu(e.reasonForRevocation,!0,r))),null!==this.features&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.features)),t.push(Bu(e.features,!1,r))),null!==this.signatureTargetPublicKeyAlgorithm&&(r=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],r.push(Y.stringToUint8Array(this.signatureTargetHash)),r=Y.concat(r),t.push(Bu(e.signatureTarget,!0,r))),null!==this.embeddedSignature&&t.push(Bu(e.embeddedSignature,!0,this.embeddedSignature.write())),null!==this.issuerFingerprint&&(r=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],r=Y.concat(r),t.push(Bu(e.issuerFingerprint,5===this.version,r))),null!==this.preferredAEADAlgorithms&&(r=Y.stringToUint8Array(Y.uint8ArrayToString(this.preferredAEADAlgorithms)),t.push(Bu(e.preferredAEADAlgorithms,!1,r)));const i=Y.concat(t),n=Y.writeNumber(i.length,2);return Y.concat([n,i])}writeUnhashedSubPackets(){const e=[];this.unhashedSubpackets.forEach((t=>{e.push(hn(t.length)),e.push(t)}));const t=Y.concat(e),r=Y.writeNumber(t.length,2);return Y.concat([r,t])}readSubPacket(e,t=!0){let r=0;const i=!!(128&e[r]),n=127&e[r];if(t||(this.unhashedSubpackets.push(e.subarray(r,e.length)),Cu.has(n)))switch(r++,n){case V.signatureSubpacket.signatureCreationTime:this.created=Y.readDate(e.subarray(r,e.length));break;case V.signatureSubpacket.signatureExpirationTime:{const t=Y.readNumber(e.subarray(r,e.length));this.signatureNeverExpires=0===t,this.signatureExpirationTime=t;break}case V.signatureSubpacket.exportableCertification:this.exportable=1===e[r++];break;case V.signatureSubpacket.trustSignature:this.trustLevel=e[r++],this.trustAmount=e[r++];break;case V.signatureSubpacket.regularExpression:this.regularExpression=e[r];break;case V.signatureSubpacket.revocable:this.revocable=1===e[r++];break;case V.signatureSubpacket.keyExpirationTime:{const t=Y.readNumber(e.subarray(r,e.length));this.keyExpirationTime=t,this.keyNeverExpires=0===t;break}case V.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...e.subarray(r,e.length)];break;case V.signatureSubpacket.revocationKey:this.revocationKeyClass=e[r++],this.revocationKeyAlgorithm=e[r++],this.revocationKeyFingerprint=e.subarray(r,r+20);break;case V.signatureSubpacket.issuer:this.issuerKeyID.read(e.subarray(r,e.length));break;case V.signatureSubpacket.notationData:{const t=!!(128&e[r]);r+=4;const n=Y.readNumber(e.subarray(r,r+2));r+=2;const a=Y.readNumber(e.subarray(r,r+2));r+=2;const s=Y.decodeUTF8(e.subarray(r,r+n)),o=e.subarray(r+n,r+n+a);this.rawNotations.push({name:s,humanReadable:t,value:o,critical:i}),t&&(this.notations[s]=Y.decodeUTF8(o));break}case V.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...e.subarray(r,e.length)];break;case V.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...e.subarray(r,e.length)];break;case V.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...e.subarray(r,e.length)];break;case V.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=Y.decodeUTF8(e.subarray(r,e.length));break;case V.signatureSubpacket.primaryUserID:this.isPrimaryUserID=0!==e[r++];break;case V.signatureSubpacket.policyURI:this.policyURI=Y.decodeUTF8(e.subarray(r,e.length));break;case V.signatureSubpacket.keyFlags:this.keyFlags=[...e.subarray(r,e.length)];break;case V.signatureSubpacket.signersUserID:this.signersUserID=Y.decodeUTF8(e.subarray(r,e.length));break;case V.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=e[r++],this.reasonForRevocationString=Y.decodeUTF8(e.subarray(r,e.length));break;case V.signatureSubpacket.features:this.features=[...e.subarray(r,e.length)];break;case V.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=e[r++],this.signatureTargetHashAlgorithm=e[r++];const t=Ba.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=Y.uint8ArrayToString(e.subarray(r,r+t));break}case V.signatureSubpacket.embeddedSignature:this.embeddedSignature=new Iu,this.embeddedSignature.read(e.subarray(r,e.length));break;case V.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=e[r++],this.issuerFingerprint=e.subarray(r,e.length),5===this.issuerKeyVersion?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case V.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...e.subarray(r,e.length)];break;default:{const e=Error("Unknown signature subpacket type "+n);if(i)throw e;Y.printDebug(e)}}}readSubPackets(e,t=!0,r){const i=Y.readNumber(e.subarray(0,2));let n=2;for(;n<2+i;){const i=un(e.subarray(n,e.length));n+=i.offset,this.readSubPacket(e.subarray(n,n+i.len),t,r),n+=i.len}return n}toSign(e,t){const r=V.signature;switch(e){case r.binary:return null!==t.text?Y.encodeUTF8(t.getText(!0)):t.getBytes(!0);case r.text:{const e=t.getBytes(!0);return Y.canonicalizeEOL(e)}case r.standalone:return new Uint8Array(0);case r.certGeneric:case r.certPersona:case r.certCasual:case r.certPositive:case r.certRevocation:{let e,i;if(t.userID)i=180,e=t.userID;else{if(!t.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");i=209,e=t.userAttribute}const n=e.write();return Y.concat([this.toSign(r.key,t),new Uint8Array([i]),Y.writeNumber(n.length,4),n])}case r.subkeyBinding:case r.subkeyRevocation:case r.keyBinding:return Y.concat([this.toSign(r.key,t),this.toSign(r.key,{key:t.bind})]);case r.key:if(void 0===t.key)throw Error("Key packet is required for this signature.");return t.key.writeForHash(this.version);case r.keyRevocation:return this.toSign(r.key,t);case r.timestamp:return new Uint8Array(0);case r.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(e,t){let r=0;return R(z(this.signatureData),(e=>{r+=e.length}),(()=>{const i=[];return 5!==this.version||this.signatureType!==V.signature.binary&&this.signatureType!==V.signature.text||(t?i.push(new Uint8Array(6)):i.push(e.writeHeader())),i.push(new Uint8Array([this.version,255])),5===this.version&&i.push(new Uint8Array(4)),i.push(Y.writeNumber(r,4)),Y.concat(i)}))}toHash(e,t,r=!1){const i=this.toSign(e,t);return Y.concat([i,this.signatureData,this.calculateTrailer(t,r)])}async hash(e,t,r,i=!1){return r||(r=this.toHash(e,t,i)),Ba.hash.digest(this.hashAlgorithm,r)}async verify(e,t,r,i=new Date,n=!1,a=ne){if(!this.issuerKeyID.equals(e.getKeyID()))throw Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==e.algorithm)throw Error("Public key algorithm used to sign signature does not match issuer key algorithm.");const s=t===V.signature.binary||t===V.signature.text;if(!(this[Su]&&!s)){let i,a;if(this.hashed?a=await this.hashed:(i=this.toHash(t,r,n),a=await this.hash(t,r,i)),a=await q(a),this.signedHashValue[0]!==a[0]||this.signedHashValue[1]!==a[1])throw Error("Signed digest did not match");this.params=await this.params;const s=this.publicKeyAlgorithm===V.publicKey.hmac?e.privateParams:null;if(this[Su]=await Ba.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,e.publicParams,s,i,a),!this[Su])throw Error("Signature verification failed")}const o=Y.normalizeDate(i);if(o&&this.created>o)throw Error("Signature creation time is in the future");if(o&&o>=this.getExpirationTime())throw Error("Signature is expired");if(a.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+V.read(V.hash,this.hashAlgorithm).toUpperCase());if(a.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[V.signature.binary,V.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+V.read(V.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach((({name:e,critical:t})=>{if(t&&a.knownNotations.indexOf(e)<0)throw Error("Unknown critical notation: "+e)})),null!==this.revocationKeyClass)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(e=new Date){const t=Y.normalizeDate(e);return null!==t&&!(this.created<=t&&t<this.getExpirationTime())}getExpirationTime(){return this.signatureNeverExpires?1/0:new Date(this.created.getTime()+1e3*this.signatureExpirationTime)}}function Bu(e,t,r){const i=[];return i.push(hn(r.length+1)),i.push(new Uint8Array([(t?128:0)|e])),i.push(r),Y.concat(i)}class Pu{static get tag(){return V.packet.onePassSignature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.issuerKeyID=null,this.flags=null}read(e){let t=0;if(this.version=e[t++],3!==this.version)throw new gn(`Version ${this.version} of the one-pass signature packet is unsupported.`);return this.signatureType=e[t++],this.hashAlgorithm=e[t++],this.publicKeyAlgorithm=e[t++],this.issuerKeyID=new pe,this.issuerKeyID.read(e.subarray(t,t+8)),t+=8,this.flags=e[t++],this}write(){const e=new Uint8Array([3,this.signatureType,this.hashAlgorithm,this.publicKeyAlgorithm]),t=new Uint8Array([this.flags]);return Y.concatUint8Array([e,this.issuerKeyID.write(),t])}calculateTrailer(...e){return H((async()=>Iu.prototype.calculateTrailer.apply(await this.correspondingSig,e)))}async verify(){const e=await this.correspondingSig;if(!e||e.constructor.tag!==V.packet.signature)throw Error("Corresponding signature packet missing");if(e.signatureType!==this.signatureType||e.hashAlgorithm!==this.hashAlgorithm||e.publicKeyAlgorithm!==this.publicKeyAlgorithm||!e.issuerKeyID.equals(this.issuerKeyID))throw Error("Corresponding signature packet does not match one-pass signature packet");return e.hashed=this.hashed,e.verify.apply(e,arguments)}}function Mu(e,t){if(!t[e]){let t;try{t=V.read(V.packet,e)}catch(t){throw new gn("Unknown packet type with tag: "+e)}throw Error("Packet not allowed in this context: "+t)}return new t[e]}Pu.prototype.hash=Iu.prototype.hash,Pu.prototype.toHash=Iu.prototype.toHash,Pu.prototype.toSign=Iu.prototype.toSign;class Du extends Array{static async fromBinary(e,t,r=ne){const i=new Du;return await i.read(e,t,r),i}async read(e,t,r=ne){r.additionalAllowedPackets.length&&(t={...t,...Y.constructAllowedPackets(r.additionalAllowedPackets)}),this.stream=T(e,(async(e,i)=>{const n=D(i);try{for(;;){await n.ready;if(await yn(e,(async e=>{try{if(e.tag===V.packet.marker||e.tag===V.packet.trust)return;const i=Mu(e.tag,t);i.packets=new Du,i.fromStream=Y.isStream(e.packet),await i.read(e.packet,r),await n.write(i)}catch(t){const i=!r.ignoreUnsupportedPackets&&t instanceof gn,a=!(r.ignoreMalformedPackets||t instanceof gn);if(i||a||pn(e.tag))await n.abort(t);else{const t=new bn(e.tag,e.packet);await n.write(t)}Y.printDebugError(t)}})))return await n.ready,void await n.close()}}catch(e){await n.abort(e)}}));const i=M(this.stream);for(;;){const{done:e,value:t}=await i.read();if(e?this.stream=null:this.push(t),e||pn(t.constructor.tag))break}i.releaseLock()}write(){const e=[];for(let t=0;t<this.length;t++){const r=this[t]instanceof bn?this[t].tag:this[t].constructor.tag,i=this[t].write();if(Y.isStream(i)&&pn(this[t].constructor.tag)){let t=[],n=0;const a=512;e.push(dn(r)),e.push(R(i,(e=>{if(t.push(e),n+=e.length,n>=a){const e=Math.min(Math.log(n)/Math.LN2|0,30),r=2**e,i=Y.concat([fn(e)].concat(t));return t=[i.subarray(1+r)],n=t[0].length,i.subarray(0,1+r)}}),(()=>Y.concat([hn(n)].concat(t)))))}else{if(Y.isStream(i)){let t=0;e.push(R(z(i),(e=>{t+=e.length}),(()=>ln(r,t))))}else e.push(ln(r,i.length));e.push(i)}}return Y.concat(e)}filterByTag(...e){const t=new Du,r=e=>t=>e===t;for(let i=0;i<this.length;i++)e.some(r(this[i].constructor.tag))&&t.push(this[i]);return t}findPacket(e){return this.find((t=>t.constructor.tag===e))}indexOfTag(...e){const t=[],r=this,i=e=>t=>e===t;for(let n=0;n<this.length;n++)e.some(i(r[n].constructor.tag))&&t.push(n);return t}}const xu=/*#__PURE__*/Y.constructAllowedPackets([Eu,Pu,Iu]);class Ku{static get tag(){return V.packet.compressedData}constructor(e=ne){this.packets=null,this.algorithm=e.preferredCompressionAlgorithm,this.compressed=null,this.deflateLevel=e.deflateLevel}async read(e,t=ne){await Q(e,(async e=>{this.algorithm=await e.readByte(),this.compressed=e.remainder(),await this.decompress(t)}))}write(){return null===this.compressed&&this.compress(),Y.concat([new Uint8Array([this.algorithm]),this.compressed])}async decompress(e=ne){const t=V.read(V.compression,this.algorithm),r=Lu[t];if(!r)throw Error(t+" decompression not supported");this.packets=await Du.fromBinary(r(this.compressed),xu,e)}compress(){const e=V.read(V.compression,this.algorithm),t=Fu[e];if(!t)throw Error(e+" compression not supported");this.compressed=t(this.packets.write(),this.deflateLevel)}}const Uu=Y.getNodeZlib();function Ru(e){return e}function Tu(e,t,r={}){return function(i){return!Y.isStream(i)||s(i)?H((()=>q(i).then((t=>new Promise(((i,n)=>{e(t,r,((e,t)=>{if(e)return n(e);i(t)}))})))))):y(g(i).pipe(t(r)))}}function Qu(e,t={}){return function(r){const i=new e(t);return R(r,(e=>{if(e.length)return i.push(e,Va),i.result}),(()=>{if(e===ec)return i.push([],Ya),i.result}))}}function zu(e){return function(t){return H((async()=>e(await q(t))))}}const Fu=Uu?{zip:/*#__PURE__*/(e,t)=>Tu(Uu.deflateRaw,Uu.createDeflateRaw,{level:t})(e),zlib:/*#__PURE__*/(e,t)=>Tu(Uu.deflate,Uu.createDeflate,{level:t})(e)}:{zip:/*#__PURE__*/(e,t)=>Qu(ec,{raw:!0,level:t})(e),zlib:/*#__PURE__*/(e,t)=>Qu(ec,{level:t})(e)},Lu=Uu?{uncompressed:Ru,zip:/*#__PURE__*/Tu(Uu.inflateRaw,Uu.createInflateRaw),zlib:/*#__PURE__*/Tu(Uu.inflate,Uu.createInflate),bzip2:/*#__PURE__*/zu(ku)}:{uncompressed:Ru,zip:/*#__PURE__*/Qu(cu,{raw:!0}),zlib:/*#__PURE__*/Qu(cu),bzip2:/*#__PURE__*/zu(ku)},Nu=/*#__PURE__*/Y.constructAllowedPackets([Eu,Ku,Pu,Iu]);class qu{static get tag(){return V.packet.symEncryptedIntegrityProtectedData}constructor(){this.version=1,this.encrypted=null,this.packets=null}async read(e){await Q(e,(async e=>{const t=await e.readByte();if(1!==t)throw new gn(`Version ${t} of the SEIP packet is unsupported.`);this.encrypted=e.remainder()}))}write(){return Y.concat([new Uint8Array([1]),this.encrypted])}async encrypt(e,t,r=ne){const{blockSize:i}=Ba.getCipher(e);let n=this.packets.write();s(n)&&(n=await q(n));const a=await Ba.getPrefixRandom(e),o=new Uint8Array([211,20]),c=Y.concat([a,n,o]),u=await Ba.hash.sha1(F(c)),h=Y.concat([c,u]);return this.encrypted=await Ba.mode.cfb.encrypt(e,t,h,new Uint8Array(i),r),!0}async decrypt(e,t,r=ne){const{blockSize:i}=Ba.getCipher(e);let n=z(this.encrypted);s(n)&&(n=await q(n));const a=await Ba.mode.cfb.decrypt(e,t,n,new Uint8Array(i)),o=N(F(a),-20),c=N(a,0,-20),u=Promise.all([q(await Ba.hash.sha1(F(c))),q(o)]).then((([e,t])=>{if(!Y.equalsUint8Array(e,t))throw Error("Modification detected.");return new Uint8Array})),h=N(c,i+2);let f=N(h,0,-2);return f=P([f,H((()=>u))]),Y.isStream(n)&&r.allowUnauthenticatedStream||(f=await q(f)),this.packets=await Du.fromBinary(f,Nu,r),!0}}const Ou=/*#__PURE__*/Y.constructAllowedPackets([Eu,Ku,Pu,Iu]);class Hu{static get tag(){return V.packet.aeadEncryptedData}constructor(){this.version=1,this.cipherAlgorithm=null,this.aeadAlgorithm=V.aead.eax,this.chunkSizeByte=null,this.iv=null,this.encrypted=null,this.packets=null}async read(e){await Q(e,(async e=>{const t=await e.readByte();if(1!==t)throw new gn(`Version ${t} of the AEAD-encrypted data packet is not supported.`);this.cipherAlgorithm=await e.readByte(),this.aeadAlgorithm=await e.readByte(),this.chunkSizeByte=await e.readByte();const r=Ba.getAEADMode(this.aeadAlgorithm);this.iv=await e.readBytes(r.ivLength),this.encrypted=e.remainder()}))}write(){return Y.concat([new Uint8Array([this.version,this.cipherAlgorithm,this.aeadAlgorithm,this.chunkSizeByte]),this.iv,this.encrypted])}async decrypt(e,t,r=ne){this.packets=await Du.fromBinary(await this.crypt("decrypt",t,z(this.encrypted)),Ou,r)}async encrypt(e,t,r=ne){this.cipherAlgorithm=e;const{ivLength:i}=Ba.getAEADMode(this.aeadAlgorithm);this.iv=Ba.random.getRandomBytes(i),this.chunkSizeByte=r.aeadChunkSizeByte;const n=this.packets.write();this.encrypted=await this.crypt("encrypt",t,n)}async crypt(e,t,r){const i=Ba.getAEADMode(this.aeadAlgorithm),n=await i(this.cipherAlgorithm,t),a="decrypt"===e?i.tagLength:0,s="encrypt"===e?i.tagLength:0,o=2**(this.chunkSizeByte+6)+a,c=new ArrayBuffer(21),u=new Uint8Array(c,0,13),h=new Uint8Array(c),f=new DataView(c),d=new Uint8Array(c,5,8);u.set([192|Hu.tag,this.version,this.cipherAlgorithm,this.aeadAlgorithm,this.chunkSizeByte],0);let l=0,p=Promise.resolve(),y=0,g=0;const b=this.iv;return T(r,(async(t,r)=>{if("array"!==Y.isStream(t)){const e=new E({},{highWaterMark:Y.getHardwareConcurrency()*2**(this.chunkSizeByte+6),size:e=>e.length});x(e.readable,r),r=e.writable}const c=M(t),m=D(r);try{for(;;){let t=await c.readBytes(o+a)||new Uint8Array;const r=t.subarray(t.length-a);let w,A;if(t=t.subarray(0,t.length-a),!l||t.length?(c.unshift(r),w=n[e](t,i.getNonce(b,d),u),g+=t.length-a+s):(f.setInt32(17,y),w=n[e](r,i.getNonce(b,d),h),g+=s,A=!0),y+=t.length-a,p=p.then((()=>w)).then((async e=>{await m.ready,await m.write(e),g-=e.length})).catch((e=>m.abort(e))),(A||g>m.desiredSize)&&await p,A){await m.close();break}f.setInt32(9,++l)}}catch(e){await m.abort(e)}}))}}class ju{static get tag(){return V.packet.publicKeyEncryptedSessionKey}constructor(){this.version=3,this.publicKeyID=new pe,this.publicKeyAlgorithm=null,this.sessionKey=null,this.sessionKeyAlgorithm=null,this.encrypted={}}read(e){let t=0;if(this.version=e[t++],3!==this.version)throw new gn(`Version ${this.version} of the PKESK packet is unsupported.`);t+=this.publicKeyID.read(e.subarray(t)),this.publicKeyAlgorithm=e[t++],this.encrypted=Ba.parseEncSessionKeyParams(this.publicKeyAlgorithm,e.subarray(t),this.version),this.publicKeyAlgorithm===V.publicKey.x25519&&(this.sessionKeyAlgorithm=V.write(V.symmetric,this.encrypted.C.algorithm))}write(){const e=[new Uint8Array([this.version]),this.publicKeyID.write(),new Uint8Array([this.publicKeyAlgorithm]),Ba.serializeParams(this.publicKeyAlgorithm,this.encrypted)];return Y.concatUint8Array(e)}async encrypt(e){const t=V.write(V.publicKey,this.publicKeyAlgorithm),r=Gu(this.version,t,this.sessionKeyAlgorithm,this.sessionKey),i=t===V.publicKey.aead?e.privateParams:null;this.encrypted=await Ba.publicKeyEncrypt(t,this.sessionKeyAlgorithm,e.publicParams,i,r,e.getFingerprintBytes())}async decrypt(e,t){if(this.publicKeyAlgorithm!==e.algorithm)throw Error("Decryption error");const r=t?Gu(this.version,this.publicKeyAlgorithm,t.sessionKeyAlgorithm,t.sessionKey):null,i=await Ba.publicKeyDecrypt(this.publicKeyAlgorithm,e.publicParams,e.privateParams,this.encrypted,e.getFingerprintBytes(),r),{sessionKey:n,sessionKeyAlgorithm:a}=function(e,t,r,i){switch(t){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:case V.publicKey.elgamal:case V.publicKey.ecdh:case V.publicKey.aead:{const e=r.subarray(0,r.length-2),t=r.subarray(r.length-2),n=Y.writeChecksum(e.subarray(e.length%8)),a=n[0]===t[0]&n[1]===t[1],s={sessionKeyAlgorithm:e[0],sessionKey:e.subarray(1)};if(i){const e=a&s.sessionKeyAlgorithm===i.sessionKeyAlgorithm&s.sessionKey.length===i.sessionKey.length;return{sessionKey:Y.selectUint8Array(e,s.sessionKey,i.sessionKey),sessionKeyAlgorithm:Y.selectUint8(e,s.sessionKeyAlgorithm,i.sessionKeyAlgorithm)}}if(a&&V.read(V.symmetric,s.sessionKeyAlgorithm))return s;throw Error("Decryption error")}case V.publicKey.x25519:return{sessionKey:r};default:throw Error("Unsupported public key algorithm")}}(this.version,this.publicKeyAlgorithm,i,t);this.publicKeyAlgorithm!==V.publicKey.x25519&&(this.sessionKeyAlgorithm=a),this.sessionKey=n}}function Gu(e,t,r,i){switch(t){case V.publicKey.rsaEncrypt:case V.publicKey.rsaEncryptSign:case V.publicKey.elgamal:case V.publicKey.ecdh:case V.publicKey.aead:return Y.concatUint8Array([new Uint8Array([r]),i,Y.writeChecksum(i.subarray(i.length%8))]);case V.publicKey.x25519:return i;default:throw Error("Unsupported public key algorithm")}}class Wu{static get tag(){return V.packet.symEncryptedSessionKey}constructor(e=ne){this.version=e.aeadProtect?5:4,this.sessionKey=null,this.sessionKeyEncryptionAlgorithm=null,this.sessionKeyAlgorithm=V.symmetric.aes256,this.aeadAlgorithm=V.write(V.aead,e.preferredAEADAlgorithm),this.encrypted=null,this.s2k=null,this.iv=null}read(e){let t=0;if(this.version=e[t++],4!==this.version&&5!==this.version)throw new gn(`Version ${this.version} of the SKESK packet is unsupported.`);const r=e[t++];5===this.version&&(this.aeadAlgorithm=e[t++]);const i=e[t++];if(this.s2k=Ra(i),t+=this.s2k.read(e.subarray(t,e.length)),5===this.version){const r=Ba.getAEADMode(this.aeadAlgorithm);this.iv=e.subarray(t,t+=r.ivLength)}5===this.version||t<e.length?(this.encrypted=e.subarray(t,e.length),this.sessionKeyEncryptionAlgorithm=r):this.sessionKeyAlgorithm=r}write(){const e=null===this.encrypted?this.sessionKeyAlgorithm:this.sessionKeyEncryptionAlgorithm;let t;return 5===this.version?t=Y.concatUint8Array([new Uint8Array([this.version,e,this.aeadAlgorithm]),this.s2k.write(),this.iv,this.encrypted]):(t=Y.concatUint8Array([new Uint8Array([this.version,e]),this.s2k.write()]),null!==this.encrypted&&(t=Y.concatUint8Array([t,this.encrypted]))),t}async decrypt(e){const t=null!==this.sessionKeyEncryptionAlgorithm?this.sessionKeyEncryptionAlgorithm:this.sessionKeyAlgorithm,{blockSize:r,keySize:i}=Ba.getCipher(t),n=await this.s2k.produceKey(e,i);if(5===this.version){const e=Ba.getAEADMode(this.aeadAlgorithm),r=new Uint8Array([192|Wu.tag,this.version,this.sessionKeyEncryptionAlgorithm,this.aeadAlgorithm]),i=await e(t,n);this.sessionKey=await i.decrypt(this.encrypted,this.iv,r)}else if(null!==this.encrypted){const e=await Ba.mode.cfb.decrypt(t,n,this.encrypted,new Uint8Array(r));this.sessionKeyAlgorithm=V.write(V.symmetric,e[0]),this.sessionKey=e.subarray(1,e.length)}else this.sessionKey=n}async encrypt(e,t=ne){const r=null!==this.sessionKeyEncryptionAlgorithm?this.sessionKeyEncryptionAlgorithm:this.sessionKeyAlgorithm;this.sessionKeyEncryptionAlgorithm=r,this.s2k=Ta(t),this.s2k.generateSalt();const{blockSize:i,keySize:n}=Ba.getCipher(r),a=await this.s2k.produceKey(e,n);if(null===this.sessionKey&&(this.sessionKey=Ba.generateSessionKey(this.sessionKeyAlgorithm)),5===this.version){const e=Ba.getAEADMode(this.aeadAlgorithm);this.iv=Ba.random.getRandomBytes(e.ivLength);const t=new Uint8Array([192|Wu.tag,this.version,this.sessionKeyEncryptionAlgorithm,this.aeadAlgorithm]),i=await e(r,a);this.encrypted=await i.encrypt(this.sessionKey,this.iv,t)}else{const e=Y.concatUint8Array([new Uint8Array([this.sessionKeyAlgorithm]),this.sessionKey]);this.encrypted=await Ba.mode.cfb.encrypt(r,a,e,new Uint8Array(i),t)}}}class Vu{static get tag(){return V.packet.publicKey}constructor(e=new Date,t=ne){this.version=t.v5Keys?5:4,this.created=Y.normalizeDate(e),this.algorithm=null,this.publicParams=null,this.expirationTimeV3=0,this.fingerprint=null,this.keyID=null}static fromSecretKeyPacket(e){const t=new Vu,{version:r,created:i,algorithm:n,publicParams:a,keyID:s,fingerprint:o}=e;return t.version=r,t.created=i,t.algorithm=n,t.publicParams=a,t.keyID=s,t.fingerprint=o,t}async read(e){let t=0;if(this.version=e[t++],4===this.version||5===this.version){this.created=Y.readDate(e.subarray(t,t+4)),t+=4,this.algorithm=e[t++],5===this.version&&(t+=4);const{read:r,publicParams:i}=Ba.parsePublicKeyParams(this.algorithm,e.subarray(t));return this.publicParams=i,t+=r,await this.computeFingerprintAndKeyID(),t}throw new gn(`Version ${this.version} of the key packet is unsupported.`)}write(){const e=[];e.push(new Uint8Array([this.version])),e.push(Y.writeDate(this.created)),e.push(new Uint8Array([this.algorithm]));const t=Ba.serializeParams(this.algorithm,this.publicParams);return 5===this.version&&e.push(Y.writeNumber(t.length,4)),e.push(t),Y.concatUint8Array(e)}writeForHash(e){const t=this.writePublicKey();return 5===e?Y.concatUint8Array([new Uint8Array([154]),Y.writeNumber(t.length,4),t]):Y.concatUint8Array([new Uint8Array([153]),Y.writeNumber(t.length,2),t])}isDecrypted(){return null}getCreationTime(){return this.created}getKeyID(){return this.keyID}async computeFingerprintAndKeyID(){if(await this.computeFingerprint(),this.keyID=new pe,5===this.version)this.keyID.read(this.fingerprint.subarray(0,8));else{if(4!==this.version)throw Error("Unsupported key version");this.keyID.read(this.fingerprint.subarray(12,20))}}async computeFingerprint(){const e=this.writeForHash(this.version);if(5===this.version)this.fingerprint=await Ba.hash.sha256(e);else{if(4!==this.version)throw Error("Unsupported key version");this.fingerprint=await Ba.hash.sha1(e)}}getFingerprintBytes(){return this.fingerprint}getFingerprint(){return Y.uint8ArrayToHex(this.getFingerprintBytes())}hasSameFingerprintAs(e){return this.version===e.version&&Y.equalsUint8Array(this.writePublicKey(),e.writePublicKey())}getAlgorithmInfo(){const e={};e.algorithm=V.read(V.publicKey,this.algorithm);const t=this.publicParams.n||this.publicParams.p;return t?e.bits=Y.uint8ArrayBitLength(t):this.publicParams.oid?e.curve=this.publicParams.oid.getName():this.publicParams.cipher&&(e.symmetric=this.publicParams.cipher.getName()),e}}Vu.prototype.readPublicKey=Vu.prototype.read,Vu.prototype.writePublicKey=Vu.prototype.write;const Ju=/*#__PURE__*/Y.constructAllowedPackets([Eu,Ku,Pu,Iu]);class Yu{static get tag(){return V.packet.symmetricallyEncryptedData}constructor(){this.encrypted=null,this.packets=null}read(e){this.encrypted=e}write(){return this.encrypted}async decrypt(e,t,r=ne){if(!r.allowUnauthenticatedMessages)throw Error("Message is not authenticated.");const{blockSize:i}=Ba.getCipher(e),n=await q(z(this.encrypted)),a=await Ba.mode.cfb.decrypt(e,t,n.subarray(i+2),n.subarray(2,i+2));this.packets=await Du.fromBinary(a,Ju,r)}async encrypt(e,t,r=ne){const i=this.packets.write(),{blockSize:n}=Ba.getCipher(e),a=await Ba.getPrefixRandom(e),s=await Ba.mode.cfb.encrypt(e,t,a,new Uint8Array(n),r),o=await Ba.mode.cfb.encrypt(e,t,i,s.subarray(2),r);this.encrypted=Y.concat([s,o])}}class Zu{static get tag(){return V.packet.marker}read(e){return 80===e[0]&&71===e[1]&&80===e[2]}write(){return new Uint8Array([80,71,80])}}class Xu extends Vu{static get tag(){return V.packet.publicSubkey}constructor(e,t){super(e,t)}static fromSecretSubkeyPacket(e){const t=new Xu,{version:r,created:i,algorithm:n,publicParams:a,keyID:s,fingerprint:o}=e;return t.version=r,t.created=i,t.algorithm=n,t.publicParams=a,t.keyID=s,t.fingerprint=o,t}}class $u{static get tag(){return V.packet.userAttribute}constructor(){this.attributes=[]}read(e){let t=0;for(;t<e.length;){const r=un(e.subarray(t,e.length));t+=r.offset,this.attributes.push(Y.uint8ArrayToString(e.subarray(t,t+r.len))),t+=r.len}}write(){const e=[];for(let t=0;t<this.attributes.length;t++)e.push(hn(this.attributes[t].length)),e.push(Y.stringToUint8Array(this.attributes[t]));return Y.concatUint8Array(e)}equals(e){return!!(e&&e instanceof $u)&&this.attributes.every((function(t,r){return t===e.attributes[r]}))}}class eh extends Vu{static get tag(){return V.packet.secretKey}constructor(e=new Date,t=ne){super(e,t),this.keyMaterial=null,this.isEncrypted=null,this.s2kUsage=0,this.s2k=null,this.symmetric=null,this.aead=null,this.privateParams=null}async read(e){let t=await this.readPublicKey(e);const r=t;this.s2kUsage=e[t++],5===this.version&&t++;try{if(255===this.s2kUsage||254===this.s2kUsage||253===this.s2kUsage){this.symmetric=e[t++],253===this.s2kUsage&&(this.aead=e[t++]);const r=e[t++];if(this.s2k=Ra(r),t+=this.s2k.read(e.subarray(t,e.length)),"gnu-dummy"===this.s2k.type)return}else this.s2kUsage&&(this.symmetric=this.s2kUsage);this.s2kUsage&&(this.iv=e.subarray(t,t+Ba.getCipher(this.symmetric).blockSize),t+=this.iv.length)}catch(t){if(!this.s2kUsage)throw t;this.unparseableKeyMaterial=e.subarray(r),this.isEncrypted=!0}if(5===this.version&&(t+=4),this.keyMaterial=e.subarray(t),this.isEncrypted=!!this.s2kUsage,!this.isEncrypted){const e=this.keyMaterial.subarray(0,-2);if(!Y.equalsUint8Array(Y.writeChecksum(e),this.keyMaterial.subarray(-2)))throw Error("Key checksum mismatch");try{const{privateParams:t}=Ba.parsePrivateKeyParams(this.algorithm,e,this.publicParams);this.privateParams=t}catch(e){if(e instanceof gn)throw e;throw Error("Error reading MPIs")}}}write(){const e=this.writePublicKey();if(this.unparseableKeyMaterial)return Y.concatUint8Array([e,this.unparseableKeyMaterial]);const t=[e];t.push(new Uint8Array([this.s2kUsage]));const r=[];return 255!==this.s2kUsage&&254!==this.s2kUsage&&253!==this.s2kUsage||(r.push(this.symmetric),253===this.s2kUsage&&r.push(this.aead),r.push(...this.s2k.write())),this.s2kUsage&&"gnu-dummy"!==this.s2k.type&&r.push(...this.iv),5===this.version&&t.push(new Uint8Array([r.length])),t.push(new Uint8Array(r)),this.isDummy()||(this.s2kUsage||(this.keyMaterial=Ba.serializeParams(this.algorithm,this.privateParams)),5===this.version&&t.push(Y.writeNumber(this.keyMaterial.length,4)),t.push(this.keyMaterial),this.s2kUsage||t.push(Y.writeChecksum(this.keyMaterial))),Y.concatUint8Array(t)}isDecrypted(){return!1===this.isEncrypted}isMissingSecretKeyMaterial(){return void 0!==this.unparseableKeyMaterial||this.isDummy()}isDummy(){return!(!this.s2k||"gnu-dummy"!==this.s2k.type)}makeDummy(e=ne){this.isDummy()||(this.isDecrypted()&&this.clearPrivateParams(),delete this.unparseableKeyMaterial,this.isEncrypted=null,this.keyMaterial=null,this.s2k=Ra(V.s2k.gnu,e),this.s2k.algorithm=0,this.s2k.c=0,this.s2k.type="gnu-dummy",this.s2kUsage=254,this.symmetric=V.symmetric.aes256)}async encrypt(e,t=ne){if(this.isDummy())return;if(!this.isDecrypted())throw Error("Key packet is already encrypted");if(!e)throw Error("A non-empty passphrase is required for key encryption.");this.s2k=Ta(t),this.s2k.generateSalt();const r=Ba.serializeParams(this.algorithm,this.privateParams);this.symmetric=V.symmetric.aes256;const i=await th(this.s2k,e,this.symmetric),{blockSize:n}=Ba.getCipher(this.symmetric);if(this.iv=Ba.random.getRandomBytes(n),t.aeadProtect){this.s2kUsage=253,this.aead=V.aead.eax;const e=Ba.getAEADMode(this.aead),t=await e(this.symmetric,i);this.keyMaterial=await t.encrypt(r,this.iv.subarray(0,e.ivLength),new Uint8Array)}else this.s2kUsage=254,this.keyMaterial=await Ba.mode.cfb.encrypt(this.symmetric,i,Y.concatUint8Array([r,await Ba.hash.sha1(r,t)]),this.iv,t)}async decrypt(e){if(this.isDummy())return!1;if(this.unparseableKeyMaterial)throw Error("Key packet cannot be decrypted: unsupported S2K or cipher algo");if(this.isDecrypted())throw Error("Key packet is already decrypted.");let t,r;if(254!==this.s2kUsage&&253!==this.s2kUsage)throw 255===this.s2kUsage?Error("Encrypted private key is authenticated using an insecure two-byte hash"):Error("Private key is encrypted using an insecure S2K function: unsalted MD5");if(t=await th(this.s2k,e,this.symmetric),253===this.s2kUsage){const e=Ba.getAEADMode(this.aead),i=await e(this.symmetric,t);try{r=await i.decrypt(this.keyMaterial,this.iv.subarray(0,e.ivLength),new Uint8Array)}catch(e){if("Authentication tag mismatch"===e.message)throw Error("Incorrect key passphrase: "+e.message);throw e}}else{const e=await Ba.mode.cfb.decrypt(this.symmetric,t,this.keyMaterial,this.iv);r=e.subarray(0,-20);const i=await Ba.hash.sha1(r);if(!Y.equalsUint8Array(i,e.subarray(-20)))throw Error("Incorrect key passphrase")}try{const{privateParams:e}=Ba.parsePrivateKeyParams(this.algorithm,r,this.publicParams);this.privateParams=e}catch(e){throw Error("Error reading MPIs")}this.isEncrypted=!1,this.keyMaterial=null,this.s2kUsage=0}async validate(){if(this.isDummy())return;if(!this.isDecrypted())throw Error("Key is not decrypted");let e;try{e=await Ba.validateParams(this.algorithm,this.publicParams,this.privateParams)}catch(t){e=!1}if(!e)throw Error("Key is invalid")}async generate(e,t,r){const{privateParams:i,publicParams:n}=await Ba.generateParams(this.algorithm,e,t,r);this.privateParams=i,this.publicParams=n,this.isEncrypted=!1}clearPrivateParams(){this.isMissingSecretKeyMaterial()||(Object.keys(this.privateParams).forEach((e=>{this.privateParams[e].fill(0),delete this.privateParams[e]})),this.privateParams=null,this.isEncrypted=!0)}}async function th(e,t,r){const{keySize:i}=Ba.getCipher(r);return e.produceKey(t,i)}var rh=it((function(e){!function(t){function r(e){function t(){return ke<Ee}function r(){return ke}function n(e){ke=e}function a(){ke=0,Ee=_e.length}function s(e,t){return{name:e,tokens:t||"",semantic:t||"",children:[]}}function o(e,t){var r;return null===t?null:((r=s(e)).tokens=t.tokens,r.semantic=t.semantic,r.children.push(t),r)}function c(e,t){return null!==t&&(e.tokens+=t.tokens,e.semantic+=t.semantic),e.children.push(t),e}function u(e){var r;return t()&&e(r=_e[ke])?(ke+=1,s("token",r)):null}function h(e){return function(){return o("literal",u((function(t){return t===e})))}}function f(){var e=arguments;return function(){var t,i,a,o;for(o=r(),i=s("and"),t=0;t<e.length;t+=1){if(null===(a=e[t]()))return n(o),null;c(i,a)}return i}}function d(){var e=arguments;return function(){var t,i,a;for(a=r(),t=0;t<e.length;t+=1){if(null!==(i=e[t]()))return i;n(a)}return null}}function l(e){return function(){var t,i;return i=r(),null!==(t=e())?t:(n(i),s("opt"))}}function p(e){return function(){var t=e();return null!==t&&(t.semantic=""),t}}function y(e){return function(){var t=e();return null!==t&&t.semantic.length>0&&(t.semantic=" "),t}}function g(e,t){return function(){var i,a,o,u,h;for(u=r(),i=s("star"),o=0,h=void 0===t?0:t;null!==(a=e());)o+=1,c(i,a);return o>=h?i:(n(u),null)}}function b(e){return e.charCodeAt(0)>=128}function m(){return o("cr",h("\r")())}function w(){return o("crlf",f(m,_)())}function A(){return o("dquote",h('"')())}function v(){return o("htab",h("\t")())}function _(){return o("lf",h("\n")())}function k(){return o("sp",h(" ")())}function E(){return o("vchar",u((function(t){var r=t.charCodeAt(0),i=33<=r&&r<=126;return e.rfc6532&&(i=i||b(t)),i})))}function S(){return o("wsp",d(k,v)())}function C(){var e=o("quoted-pair",d(f(h("\\"),d(E,S)),ie)());return null===e?null:(e.semantic=e.semantic[1],e)}function I(){return o("fws",d(ae,f(l(f(g(S),p(w))),g(S,1)))())}function B(){return o("ctext",d((function(){return u((function(t){var r=t.charCodeAt(0),i=33<=r&&r<=39||42<=r&&r<=91||93<=r&&r<=126;return e.rfc6532&&(i=i||b(t)),i}))}),te)())}function P(){return o("ccontent",d(B,C,M)())}function M(){return o("comment",f(h("("),g(f(l(I),P)),l(I),h(")"))())}function D(){return o("cfws",d(f(g(f(l(I),M),1),l(I)),I)())}function x(){return o("atext",u((function(t){var r="a"<=t&&t<="z"||"A"<=t&&t<="Z"||"0"<=t&&t<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(t)>=0;return e.rfc6532&&(r=r||b(t)),r})))}function K(){return o("atom",f(y(l(D)),g(x,1),y(l(D)))())}function U(){var e,t;return null===(e=o("dot-atom-text",g(x,1)()))||null!==(t=g(f(h("."),g(x,1)))())&&c(e,t),e}function R(){return o("dot-atom",f(p(l(D)),U,p(l(D)))())}function T(){return o("qtext",d((function(){return u((function(t){var r=t.charCodeAt(0),i=33===r||35<=r&&r<=91||93<=r&&r<=126;return e.rfc6532&&(i=i||b(t)),i}))}),re)())}function Q(){return o("qcontent",d(T,C)())}function z(){return o("quoted-string",f(p(l(D)),p(A),g(f(l(y(I)),Q)),l(p(I)),p(A),p(l(D)))())}function F(){return o("word",d(K,z)())}function L(){return o("address",d(N,H)())}function N(){return o("mailbox",d(q,$)())}function q(){return o("name-addr",f(l(j),O)())}function O(){return o("angle-addr",d(f(p(l(D)),h("<"),$,h(">"),p(l(D))),se)())}function H(){return o("group",f(j,h(":"),l(V),h(";"),p(l(D)))())}function j(){return o("display-name",(null!==(e=o("phrase",d(ne,g(F,1))()))&&(e.semantic=function(e){return e.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(e.semantic)),e));var e}function G(){return o("mailbox-list",d(f(N,g(f(h(","),N))),ue)())}function W(){return o("address-list",d(f(L,g(f(h(","),L))),he)())}function V(){return o("group-list",d(G,p(D),fe)())}function J(){return o("local-part",d(de,R,z)())}function Y(){return o("dtext",d((function(){return u((function(t){var r=t.charCodeAt(0),i=33<=r&&r<=90||94<=r&&r<=126;return e.rfc6532&&(i=i||b(t)),i}))}),pe)())}function Z(){return o("domain-literal",f(p(l(D)),h("["),g(f(l(I),Y)),l(I),h("]"),p(l(D)))())}function X(){return o("domain",(t=d(le,R,Z)(),e.rejectTLD&&t&&t.semantic&&t.semantic.indexOf(".")<0?null:(t&&(t.semantic=t.semantic.replace(/\s+/g,"")),t)));var t}function $(){return o("addr-spec",f(J,h("@"),X)())}function ee(){return e.strict?null:o("obs-NO-WS-CTL",u((function(e){var t=e.charCodeAt(0);return 1<=t&&t<=8||11===t||12===t||14<=t&&t<=31||127===t})))}function te(){return e.strict?null:o("obs-ctext",ee())}function re(){return e.strict?null:o("obs-qtext",ee())}function ie(){return e.strict?null:o("obs-qp",f(h("\\"),d(h("\0"),ee,_,m))())}function ne(){return e.strict?null:e.atInDisplayName?o("obs-phrase",f(F,g(d(F,h("."),h("@"),y(D))))()):o("obs-phrase",f(F,g(d(F,h("."),y(D))))())}function ae(){return e.strict?null:o("obs-FWS",g(f(p(l(w)),S),1)())}function se(){return e.strict?null:o("obs-angle-addr",f(p(l(D)),h("<"),oe,$,h(">"),p(l(D)))())}function oe(){return e.strict?null:o("obs-route",f(ce,h(":"))())}function ce(){return e.strict?null:o("obs-domain-list",f(g(d(p(D),h(","))),h("@"),X,g(f(h(","),p(l(D)),l(f(h("@"),X)))))())}function ue(){return e.strict?null:o("obs-mbox-list",f(g(f(p(l(D)),h(","))),N,g(f(h(","),l(f(N,p(D))))))())}function he(){return e.strict?null:o("obs-addr-list",f(g(f(p(l(D)),h(","))),L,g(f(h(","),l(f(L,p(D))))))())}function fe(){return e.strict?null:o("obs-group-list",f(g(f(p(l(D)),h(",")),1),p(l(D)))())}function de(){return e.strict?null:o("obs-local-part",f(F,g(f(h("."),F)))())}function le(){return e.strict?null:o("obs-domain",f(K,g(f(h("."),K)))())}function pe(){return e.strict?null:o("obs-dtext",d(ee,C)())}function ye(e,t){var r,i,n;if(null==t)return null;for(i=[t];i.length>0;){if((n=i.pop()).name===e)return n;for(r=n.children.length-1;r>=0;r-=1)i.push(n.children[r])}return null}function ge(e,t){var r,i,n,a,s;if(null==t)return null;for(i=[t],a=[],s={},r=0;r<e.length;r+=1)s[e[r]]=!0;for(;i.length>0;)if((n=i.pop()).name in s)a.push(n);else for(r=n.children.length-1;r>=0;r-=1)i.push(n.children[r]);return a}function be(t){var r,i,n,a,s;if(null===t)return null;for(r=[],i=ge(["group","mailbox"],t),n=0;n<i.length;n+=1)"group"===(a=i[n]).name?r.push(me(a)):"mailbox"===a.name&&r.push(we(a));return s={ast:t,addresses:r},e.simple&&(s=function(e){var t;if(e&&e.addresses)for(t=0;t<e.addresses.length;t+=1)delete e.addresses[t].node;return e}(s)),e.oneResult?function(t){if(!t)return null;if(!e.partial&&t.addresses.length>1)return null;return t.addresses&&t.addresses[0]}(s):e.simple?s&&s.addresses:s}function me(e){var t,r=ye("display-name",e),i=[],n=ge(["mailbox"],e);for(t=0;t<n.length;t+=1)i.push(we(n[t]));return{node:e,parts:{name:r},type:e.name,name:Ae(r),addresses:i}}function we(e){var t=ye("display-name",e),r=ye("addr-spec",e),i=function(e,t){var r,i,n,a;if(null==t)return null;for(i=[t],a=[];i.length>0;)for((n=i.pop()).name===e&&a.push(n),r=n.children.length-1;r>=0;r-=1)i.push(n.children[r]);return a}("cfws",e),n=ge(["comment"],e),a=ye("local-part",r),s=ye("domain",r);return{node:e,parts:{name:t,address:r,local:a,domain:s,comments:i},type:e.name,name:Ae(t),address:Ae(r),local:Ae(a),domain:Ae(s),comments:ve(n),groupName:Ae(e.groupName)}}function Ae(e){return null!=e?e.semantic:null}function ve(e){var t="";if(e)for(var r=0;r<e.length;r+=1)t+=Ae(e[r]);return t}var _e,ke,Ee,Se,Ce;if(null===(e=i(e,{})))return null;if(_e=e.input,Ce={address:L,"address-list":W,"angle-addr":O,from:function(){return o("from",d(G,W)())},group:H,mailbox:N,"mailbox-list":G,"reply-to":function(){return o("reply-to",W())},sender:function(){return o("sender",d(N,L)())}}[e.startAt]||W,!e.strict){if(a(),e.strict=!0,Se=Ce(_e),e.partial||!t())return be(Se);e.strict=!1}return a(),Se=Ce(_e),!e.partial&&t()?null:be(Se)}function i(e,t){function r(e){return"[object String]"===Object.prototype.toString.call(e)}function i(e){return null==e}var n,a;if(r(e))e={input:e};else if(!function(e){return e===Object(e)}(e))return null;if(!r(e.input))return null;if(!t)return null;for(a in n={oneResult:!1,partial:!1,rejectTLD:!1,rfc6532:!1,simple:!1,startAt:"address-list",strict:!1,atInDisplayName:!1})i(e[a])&&(e[a]=i(t[a])?n[a]:t[a]);return e}r.parseOneAddress=function(e){return r(i(e,{oneResult:!0,rfc6532:!0,simple:!0,startAt:"address-list"}))},r.parseAddressList=function(e){return r(i(e,{rfc6532:!0,simple:!0,startAt:"address-list"}))},r.parseFrom=function(e){return r(i(e,{rfc6532:!0,simple:!0,startAt:"from"}))},r.parseSender=function(e){return r(i(e,{oneResult:!0,rfc6532:!0,simple:!0,startAt:"sender"}))},r.parseReplyTo=function(e){return r(i(e,{rfc6532:!0,simple:!0,startAt:"reply-to"}))},e.exports=r}()}));class ih{static get tag(){return V.packet.userID}constructor(){this.userID="",this.name="",this.email="",this.comment=""}static fromObject(e){if(Y.isString(e)||e.name&&!Y.isString(e.name)||e.email&&!Y.isEmailAddress(e.email)||e.comment&&!Y.isString(e.comment))throw Error("Invalid user ID format");const t=new ih;Object.assign(t,e);const r=[];return t.name&&r.push(t.name),t.comment&&r.push(`(${t.comment})`),t.email&&r.push(`<${t.email}>`),t.userID=r.join(" "),t}read(e,t=ne){const r=Y.decodeUTF8(e);if(r.length>t.maxUserIDLength)throw Error("User ID string is too long");try{const{name:e,address:t,comments:i}=rh.parseOneAddress({input:r,atInDisplayName:!0});this.comment=i.replace(/^\(|\)$/g,""),this.name=e,this.email=t}catch(e){}this.userID=r}write(){return Y.encodeUTF8(this.userID)}equals(e){return e&&e.userID===this.userID}}class nh extends eh{static get tag(){return V.packet.secretSubkey}constructor(e=new Date,t=ne){super(e,t)}}class ah{static get tag(){return V.packet.trust}read(){throw new gn("Trust packets are not supported")}write(){throw new gn("Trust packets are not supported")}}const sh=/*#__PURE__*/Y.constructAllowedPackets([Iu]);class oh{constructor(e){this.packets=e||new Du}write(){return this.packets.write()}armor(e=ne){return le(V.armor.signature,this.write(),void 0,void 0,void 0,e)}getSigningKeyIDs(){return this.packets.map((e=>e.issuerKeyID))}}async function ch({armoredSignature:e,binarySignature:t,config:r,...i}){r={...ne,...r};let n=e||t;if(!n)throw Error("readSignature: must pass options object containing `armoredSignature` or `binarySignature`");if(e&&!Y.isString(e))throw Error("readSignature: options.armoredSignature must be a string");if(t&&!Y.isUint8Array(t))throw Error("readSignature: options.binarySignature must be a Uint8Array");const a=Object.keys(i);if(a.length>0)throw Error("Unknown option: "+a.join(", "));if(e){const{type:e,data:t}=await de(n,r);if(e!==V.armor.signature)throw Error("Armored text not of type signature");n=t}const s=await Du.fromBinary(n,sh,r);return new oh(s)}async function uh(e,t){const r=new nh(e.date,t);return r.packets=null,r.algorithm=V.write(V.publicKey,e.algorithm),await r.generate(e.rsaBits,e.curve,e.symmetric),await r.computeFingerprintAndKeyID(),r}async function hh(e,t){const r=new eh(e.date,t);return r.packets=null,r.algorithm=V.write(V.publicKey,e.algorithm),await r.generate(e.rsaBits,e.curve,e.symmetric),await r.computeFingerprintAndKeyID(),r}async function fh(e,t,r,i,n=new Date,a){let s,o;for(let c=e.length-1;c>=0;c--)try{(!s||e[c].created>=s.created)&&(await e[c].verify(t,r,i,n,void 0,a),s=e[c])}catch(e){o=e}if(!s)throw Y.wrapError(`Could not find valid ${V.read(V.signature,r)} signature in key ${t.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,((e,t,r)=>t+" "+r.toLowerCase())),o);return s}function dh(e,t,r=new Date){const i=Y.normalizeDate(r);if(null!==i){const r=wh(e,t);return!(e.created<=i&&i<r)}return!1}async function lh(e,t,r,i){const n={};n.key=t,n.bind=e;const a={signatureType:V.signature.subkeyBinding};r.sign?(a.keyFlags=[V.keyFlags.signData],a.embeddedSignature=await gh(n,null,e,{signatureType:V.signature.keyBinding},r.date,void 0,void 0,void 0,i)):a.keyFlags=r.forwarding?[V.keyFlags.forwardedCommunication]:[V.keyFlags.encryptCommunication|V.keyFlags.encryptStorage],r.keyExpirationTime>0&&(a.keyExpirationTime=r.keyExpirationTime,a.keyNeverExpires=!1);return await gh(n,null,t,a,r.date,void 0,void 0,void 0,i)}async function ph(e,t,r=new Date,i={},n){let a=n.preferredHashAlgorithm,s=a;if(e){const t=await e.getPrimaryUser(r,i,n);t.selfCertification.preferredHashAlgorithms&&([s]=t.selfCertification.preferredHashAlgorithms,a=Ba.hash.getHashByteLength(a)<=Ba.hash.getHashByteLength(s)?s:a)}switch(t.algorithm){case V.publicKey.ecdsa:case V.publicKey.eddsaLegacy:case V.publicKey.ed25519:s=Ba.getPreferredCurveHashAlgo(t.algorithm,t.publicParams.oid)}return Ba.hash.getHashByteLength(a)<=Ba.hash.getHashByteLength(s)?s:a}async function yh(e,t=[],r=new Date,i=[],n=ne){const a={symmetric:V.symmetric.aes128,aead:V.aead.eax,compression:V.compression.uncompressed}[e],s={symmetric:n.preferredSymmetricAlgorithm,aead:n.preferredAEADAlgorithm,compression:n.preferredCompressionAlgorithm}[e],o={symmetric:"preferredSymmetricAlgorithms",aead:"preferredAEADAlgorithms",compression:"preferredCompressionAlgorithms"}[e],c=await Promise.all(t.map((async function(e,t){const a=(await e.getPrimaryUser(r,i[t],n)).selfCertification[o];return!!a&&a.indexOf(s)>=0})));return c.every(Boolean)?s:a}async function gh(e,t,r,i,n,a,s=[],o=!1,c){if(r.isDummy())throw Error("Cannot sign with a gnu-dummy key.");if(!r.isDecrypted())throw Error("Signing key is not decrypted.");const u=new Iu;return Object.assign(u,i),u.publicKeyAlgorithm=r.algorithm,u.hashAlgorithm=await ph(t,r,n,a,c),u.rawNotations=s,await u.sign(r,e,n,o),u}async function bh(e,t,r,i=new Date,n){(e=e[r])&&(t[r].length?await Promise.all(e.map((async function(e){e.isExpired(i)||n&&!await n(e)||t[r].some((function(t){return Y.equalsUint8Array(t.writeParams(),e.writeParams())}))||t[r].push(e)}))):t[r]=e)}async function mh(e,t,r,i,n,a,s=new Date,o){a=a||e;const c=[];return await Promise.all(i.map((async function(e){try{n&&!e.issuerKeyID.equals(n.issuerKeyID)||(await e.verify(a,t,r,o.revocationsExpire?s:null,!1,o),c.push(e.issuerKeyID))}catch(e){}}))),n?(n.revoked=!!c.some((e=>e.equals(n.issuerKeyID)))||(n.revoked||!1),n.revoked):c.length>0}function wh(e,t){let r;return!1===t.keyNeverExpires&&(r=e.created.getTime()+1e3*t.keyExpirationTime),r?new Date(r):1/0}function Ah(e,t={}){if(e.type=e.type||t.type,e.curve=e.curve||t.curve,e.rsaBits=e.rsaBits||t.rsaBits,e.keyExpirationTime=void 0!==e.keyExpirationTime?e.keyExpirationTime:t.keyExpirationTime,e.passphrase=Y.isString(e.passphrase)?e.passphrase:t.passphrase,e.date=e.date||t.date,e.sign=e.sign||!1,e.forwarding=e.forwarding||!1,e.sign&&e.forwarding)throw Error('Incompatible options: "sign" and "forwarding" cannot be set together');switch(e.type){case"ecc":try{e.curve=V.write(V.curve,e.curve)}catch(e){throw Error("Unknown curve")}e.curve!==V.curve.ed25519Legacy&&e.curve!==V.curve.curve25519Legacy||(e.curve=e.sign?V.curve.ed25519Legacy:V.curve.curve25519Legacy),e.sign?e.algorithm=e.curve===V.curve.ed25519Legacy?V.publicKey.eddsaLegacy:V.publicKey.ecdsa:e.algorithm=V.publicKey.ecdh;break;case"rsa":e.algorithm=V.publicKey.rsaEncryptSign;break;case"symmetric":e.sign?(e.algorithm=V.publicKey.hmac,e.symmetric=e.symmetricHash||t.symmetricHash):(e.algorithm=V.publicKey.aead,e.symmetric=e.symmetricCipher||t.symmetricCipher);break;default:throw Error("Unsupported key type "+e.type)}return e}function vh(e,t){const r=e.algorithm;return r!==V.publicKey.rsaEncrypt&&r!==V.publicKey.elgamal&&r!==V.publicKey.ecdh&&r!==V.publicKey.x25519&&(!t.keyFlags||0!=(t.keyFlags[0]&V.keyFlags.signData))}function _h(e,t){const r=e.algorithm;return r!==V.publicKey.dsa&&r!==V.publicKey.rsaSign&&r!==V.publicKey.ecdsa&&r!==V.publicKey.eddsaLegacy&&r!==V.publicKey.ed25519&&(!t.keyFlags||0!=(t.keyFlags[0]&V.keyFlags.encryptCommunication)||0!=(t.keyFlags[0]&V.keyFlags.encryptStorage))}function kh(e,t){return!(e.keyFlags&&0==(e.keyFlags[0]&V.keyFlags.sign)&&0==(e.keyFlags[0]&V.keyFlags.certifyKeys)&&0==(e.keyFlags[0]&V.keyFlags.authentication)||!t.allowInsecureDecryptionWithSigningKeys)||(!e.keyFlags||0!=(e.keyFlags[0]&V.keyFlags.encryptCommunication)||0!=(e.keyFlags[0]&V.keyFlags.encryptStorage)||t.allowForwardedMessages&&0!=(e.keyFlags[0]&V.keyFlags.forwardedCommunication))}function Eh(e,t){const r=V.write(V.publicKey,e.algorithm),i=e.getAlgorithmInfo();if(t.rejectPublicKeyAlgorithms.has(r))throw Error(i.algorithm+" keys are considered too weak.");switch(r){case V.publicKey.rsaEncryptSign:case V.publicKey.rsaSign:case V.publicKey.rsaEncrypt:if(i.bits<t.minRSABits)throw Error(`RSA keys shorter than ${t.minRSABits} bits are considered too weak.`);break;case V.publicKey.ecdsa:case V.publicKey.eddsaLegacy:case V.publicKey.ecdh:if(t.rejectCurves.has(i.curve))throw Error(`Support for ${i.algorithm} keys using curve ${i.curve} is disabled.`)}}class Sh{constructor(e,t){this.userID=e.constructor.tag===V.packet.userID?e:null,this.userAttribute=e.constructor.tag===V.packet.userAttribute?e:null,this.selfCertifications=[],this.otherCertifications=[],this.revocationSignatures=[],this.mainKey=t}toPacketList(){const e=new Du;return e.push(this.userID||this.userAttribute),e.push(...this.revocationSignatures),e.push(...this.selfCertifications),e.push(...this.otherCertifications),e}clone(){const e=new Sh(this.userID||this.userAttribute,this.mainKey);return e.selfCertifications=[...this.selfCertifications],e.otherCertifications=[...this.otherCertifications],e.revocationSignatures=[...this.revocationSignatures],e}async certify(e,t,r){const i=this.mainKey.keyPacket,n={userID:this.userID,userAttribute:this.userAttribute,key:i},a=new Sh(n.userID||n.userAttribute,this.mainKey);return a.otherCertifications=await Promise.all(e.map((async function(e){if(!e.isPrivate())throw Error("Need private key for signing");if(e.hasSameFingerprintAs(i))throw Error("The user's own key can only be used for self-certifications");const a=await e.getSigningKey(void 0,t,void 0,r);return gh(n,e,a.keyPacket,{signatureType:V.signature.certGeneric,keyFlags:[V.keyFlags.certifyKeys|V.keyFlags.signData]},t,void 0,void 0,void 0,r)}))),await a.update(this,t,r),a}async isRevoked(e,t,r=new Date,i=ne){const n=this.mainKey.keyPacket;return mh(n,V.signature.certRevocation,{key:n,userID:this.userID,userAttribute:this.userAttribute},this.revocationSignatures,e,t,r,i)}async verifyCertificate(e,t,r=new Date,i){const n=this,a=this.mainKey.keyPacket,s={userID:this.userID,userAttribute:this.userAttribute,key:a},{issuerKeyID:o}=e,c=t.filter((e=>e.getKeys(o).length>0));return 0===c.length?null:(await Promise.all(c.map((async t=>{const a=await t.getSigningKey(o,e.created,void 0,i);if(e.revoked||await n.isRevoked(e,a.keyPacket,r,i))throw Error("User certificate is revoked");try{await e.verify(a.keyPacket,V.signature.certGeneric,s,r,void 0,i)}catch(e){throw Y.wrapError("User certificate is invalid",e)}}))),!0)}async verifyAllCertifications(e,t=new Date,r){const i=this,n=this.selfCertifications.concat(this.otherCertifications);return Promise.all(n.map((async n=>({keyID:n.issuerKeyID,valid:await i.verifyCertificate(n,e,t,r).catch((()=>!1))}))))}async verify(e=new Date,t){if(!this.selfCertifications.length)throw Error("No self-certifications found");const r=this,i=this.mainKey.keyPacket,n={userID:this.userID,userAttribute:this.userAttribute,key:i};let a;for(let s=this.selfCertifications.length-1;s>=0;s--)try{const a=this.selfCertifications[s];if(a.revoked||await r.isRevoked(a,void 0,e,t))throw Error("Self-certification is revoked");try{await a.verify(i,V.signature.certGeneric,n,e,void 0,t)}catch(e){throw Y.wrapError("Self-certification is invalid",e)}return!0}catch(e){a=e}throw a}async update(e,t,r){const i=this.mainKey.keyPacket,n={userID:this.userID,userAttribute:this.userAttribute,key:i};await bh(e,this,"selfCertifications",t,(async function(e){try{return await e.verify(i,V.signature.certGeneric,n,t,!1,r),!0}catch(e){return!1}})),await bh(e,this,"otherCertifications",t),await bh(e,this,"revocationSignatures",t,(function(e){return mh(i,V.signature.certRevocation,n,[e],void 0,void 0,t,r)}))}async revoke(e,{flag:t=V.reasonForRevocation.noReason,string:r=""}={},i=new Date,n=ne){const a={userID:this.userID,userAttribute:this.userAttribute,key:e},s=new Sh(a.userID||a.userAttribute,this.mainKey);return s.revocationSignatures.push(await gh(a,null,e,{signatureType:V.signature.certRevocation,reasonForRevocationFlag:V.write(V.reasonForRevocation,t),reasonForRevocationString:r},i,void 0,void 0,!1,n)),await s.update(this),s}}class Ch{constructor(e,t){this.keyPacket=e,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=t}toPacketList(){const e=new Du;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.bindingSignatures),e}clone(){const e=new Ch(this.keyPacket,this.mainKey);return e.bindingSignatures=[...this.bindingSignatures],e.revocationSignatures=[...this.revocationSignatures],e}async isRevoked(e,t,r=new Date,i=ne){const n=this.mainKey.keyPacket;return mh(n,V.signature.subkeyRevocation,{key:n,bind:this.keyPacket},this.revocationSignatures,e,t,r,i)}async verify(e=new Date,t=ne){const r=this.mainKey.keyPacket,i={key:r,bind:this.keyPacket},n=await fh(this.bindingSignatures,r,V.signature.subkeyBinding,i,e,t);if(n.revoked||await this.isRevoked(n,null,e,t))throw Error("Subkey is revoked");if(dh(this.keyPacket,n,e))throw Error("Subkey is expired");return n}async getExpirationTime(e=new Date,t=ne){const r=this.mainKey.keyPacket,i={key:r,bind:this.keyPacket};let n;try{n=await fh(this.bindingSignatures,r,V.signature.subkeyBinding,i,e,t)}catch(e){return null}const a=wh(this.keyPacket,n),s=n.getExpirationTime();return a<s?a:s}async update(e,t=new Date,r=ne){const i=this.mainKey.keyPacket;if(!this.hasSameFingerprintAs(e))throw Error("Subkey update method: fingerprints of subkeys not equal");this.keyPacket.constructor.tag===V.packet.publicSubkey&&e.keyPacket.constructor.tag===V.packet.secretSubkey&&(this.keyPacket=e.keyPacket);const n=this,a={key:i,bind:n.keyPacket};await bh(e,this,"bindingSignatures",t,(async function(e){for(let t=0;t<n.bindingSignatures.length;t++)if(n.bindingSignatures[t].issuerKeyID.equals(e.issuerKeyID))return e.created>n.bindingSignatures[t].created&&(n.bindingSignatures[t]=e),!1;try{return await e.verify(i,V.signature.subkeyBinding,a,t,void 0,r),!0}catch(e){return!1}})),await bh(e,this,"revocationSignatures",t,(function(e){return mh(i,V.signature.subkeyRevocation,a,[e],void 0,void 0,t,r)}))}async revoke(e,{flag:t=V.reasonForRevocation.noReason,string:r=""}={},i=new Date,n=ne){const a={key:e,bind:this.keyPacket},s=new Ch(this.keyPacket,this.mainKey);return s.revocationSignatures.push(await gh(a,null,e,{signatureType:V.signature.subkeyRevocation,reasonForRevocationFlag:V.write(V.reasonForRevocation,t),reasonForRevocationString:r},i,void 0,void 0,!1,n)),await s.update(this),s}hasSameFingerprintAs(e){return this.keyPacket.hasSameFingerprintAs(e.keyPacket||e)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach((e=>{Ch.prototype[e]=function(){return this.keyPacket[e]()}}));const Ih=/*#__PURE__*/Y.constructAllowedPackets([Iu]),Bh=new Set([V.packet.publicKey,V.packet.privateKey]),Ph=new Set([V.packet.publicKey,V.packet.privateKey,V.packet.publicSubkey,V.packet.privateSubkey]);class Mh{packetListToStructure(e,t=new Set){let r,i,n,a;for(const s of e){if(s instanceof bn){Ph.has(s.tag)&&!a&&(a=Bh.has(s.tag)?Bh:Ph);continue}const e=s.constructor.tag;if(a){if(!a.has(e))continue;a=null}if(t.has(e))throw Error("Unexpected packet type: "+e);switch(e){case V.packet.publicKey:case V.packet.secretKey:if(this.keyPacket)throw Error("Key block contains multiple keys");if(this.keyPacket=s,i=this.getKeyID(),!i)throw Error("Missing Key ID");break;case V.packet.userID:case V.packet.userAttribute:r=new Sh(s,this),this.users.push(r);break;case V.packet.publicSubkey:case V.packet.secretSubkey:r=null,n=new Ch(s,this),this.subkeys.push(n);break;case V.packet.signature:switch(s.signatureType){case V.signature.certGeneric:case V.signature.certPersona:case V.signature.certCasual:case V.signature.certPositive:if(!r){Y.printDebug("Dropping certification signatures without preceding user packet");continue}s.issuerKeyID.equals(i)?r.selfCertifications.push(s):r.otherCertifications.push(s);break;case V.signature.certRevocation:r?r.revocationSignatures.push(s):this.directSignatures.push(s);break;case V.signature.key:this.directSignatures.push(s);break;case V.signature.subkeyBinding:if(!n){Y.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}n.bindingSignatures.push(s);break;case V.signature.keyRevocation:this.revocationSignatures.push(s);break;case V.signature.subkeyRevocation:if(!n){Y.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}n.revocationSignatures.push(s)}}}}toPacketList(){const e=new Du;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.directSignatures),this.users.map((t=>e.push(...t.toPacketList()))),this.subkeys.map((t=>e.push(...t.toPacketList()))),e}clone(e=!1){const t=new this.constructor(this.toPacketList());return e&&t.getKeys().forEach((e=>{if(e.keyPacket=Object.create(Object.getPrototypeOf(e.keyPacket),Object.getOwnPropertyDescriptors(e.keyPacket)),!e.keyPacket.isDecrypted())return;const t={};Object.keys(e.keyPacket.privateParams).forEach((r=>{t[r]=new Uint8Array(e.keyPacket.privateParams[r])})),e.keyPacket.privateParams=t})),t}getSubkeys(e=null){return this.subkeys.filter((t=>!e||t.getKeyID().equals(e,!0)))}getKeys(e=null){const t=[];return e&&!this.getKeyID().equals(e,!0)||t.push(this),t.concat(this.getSubkeys(e))}getKeyIDs(){return this.getKeys().map((e=>e.getKeyID()))}getUserIDs(){return this.users.map((e=>e.userID?e.userID.userID:null)).filter((e=>null!==e))}write(){return this.toPacketList().write()}async getSigningKey(e=null,t=new Date,r={},i=ne){await this.verifyPrimaryKey(t,r,i);const n=this.keyPacket,a=this.subkeys.slice().sort(((e,t)=>t.keyPacket.created-e.keyPacket.created));let s;for(const r of a)if(!e||r.getKeyID().equals(e))try{await r.verify(t,i);const e={key:n,bind:r.keyPacket},a=await fh(r.bindingSignatures,n,V.signature.subkeyBinding,e,t,i);if(!vh(r.keyPacket,a))continue;if(!a.embeddedSignature)throw Error("Missing embedded signature");return await fh([a.embeddedSignature],r.keyPacket,V.signature.keyBinding,e,t,i),Eh(r.keyPacket,i),r}catch(e){s=e}try{const a=await this.getPrimaryUser(t,r,i);if((!e||n.getKeyID().equals(e))&&vh(n,a.selfCertification))return Eh(n,i),this}catch(e){s=e}throw Y.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),s)}async getEncryptionKey(e,t=new Date,r={},i=ne){await this.verifyPrimaryKey(t,r,i);const n=this.keyPacket,a=this.subkeys.slice().sort(((e,t)=>t.keyPacket.created-e.keyPacket.created));let s;for(const r of a)if(!e||r.getKeyID().equals(e))try{await r.verify(t,i);const e={key:n,bind:r.keyPacket},a=await fh(r.bindingSignatures,n,V.signature.subkeyBinding,e,t,i);if(_h(r.keyPacket,a))return Eh(r.keyPacket,i),r}catch(e){s=e}try{const a=await this.getPrimaryUser(t,r,i);if((!e||n.getKeyID().equals(e))&&_h(n,a.selfCertification))return Eh(n,i),this}catch(e){s=e}throw Y.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),s)}async isRevoked(e,t,r=new Date,i=ne){return mh(this.keyPacket,V.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,e,t,r,i)}async verifyPrimaryKey(e=new Date,t={},r=ne){const i=this.keyPacket;if(await this.isRevoked(null,null,e,r))throw Error("Primary key is revoked");const{selfCertification:n}=await this.getPrimaryUser(e,t,r);if(dh(i,n,e))throw Error("Primary key is expired");const a=await fh(this.directSignatures,i,V.signature.key,{key:i},e,r).catch((()=>{}));if(a&&dh(i,a,e))throw Error("Primary key is expired")}async getExpirationTime(e,t=ne){let r;try{const{selfCertification:i}=await this.getPrimaryUser(null,e,t),n=wh(this.keyPacket,i),a=i.getExpirationTime(),s=await fh(this.directSignatures,this.keyPacket,V.signature.key,{key:this.keyPacket},null,t).catch((()=>{}));if(s){const e=wh(this.keyPacket,s);r=Math.min(n,a,e)}else r=n<a?n:a}catch(e){r=null}return Y.normalizeDate(r)}async getPrimaryUser(e=new Date,t={},r=ne){const i=this.keyPacket,n=[];let a;for(let s=0;s<this.users.length;s++)try{const a=this.users[s];if(!a.userID)continue;if(void 0!==t.name&&a.userID.name!==t.name||void 0!==t.email&&a.userID.email!==t.email||void 0!==t.comment&&a.userID.comment!==t.comment)throw Error("Could not find user that matches that user ID");const o={userID:a.userID,key:i},c=await fh(a.selfCertifications,i,V.signature.certGeneric,o,e,r);n.push({index:s,user:a,selfCertification:c})}catch(e){a=e}if(!n.length)throw a||Error("Could not find primary user");await Promise.all(n.map((async function(t){return t.selfCertification.revoked||t.user.isRevoked(t.selfCertification,null,e,r)})));const s=n.sort((function(e,t){const r=e.selfCertification,i=t.selfCertification;return i.revoked-r.revoked||r.isPrimaryUserID-i.isPrimaryUserID||r.created-i.created})).pop(),{user:o,selfCertification:c}=s;if(c.revoked||await o.isRevoked(c,null,e,r))throw Error("Primary user is revoked");return s}async update(e,t=new Date,r=ne){if(!this.hasSameFingerprintAs(e))throw Error("Primary key fingerprints must be equal to update the key");if(!this.isPrivate()&&e.isPrivate()){if(!(this.subkeys.length===e.subkeys.length&&this.subkeys.every((t=>e.subkeys.some((e=>t.hasSameFingerprintAs(e)))))))throw Error("Cannot update public key with private key if subkeys mismatch");return e.update(this,r)}const i=this.clone();return await bh(e,i,"revocationSignatures",t,(n=>mh(i.keyPacket,V.signature.keyRevocation,i,[n],null,e.keyPacket,t,r))),await bh(e,i,"directSignatures",t),await Promise.all(e.users.map((async e=>{const n=i.users.filter((t=>e.userID&&e.userID.equals(t.userID)||e.userAttribute&&e.userAttribute.equals(t.userAttribute)));if(n.length>0)await Promise.all(n.map((i=>i.update(e,t,r))));else{const t=e.clone();t.mainKey=i,i.users.push(t)}}))),await Promise.all(e.subkeys.map((async e=>{const n=i.subkeys.filter((t=>t.hasSameFingerprintAs(e)));if(n.length>0)await Promise.all(n.map((i=>i.update(e,t,r))));else{const t=e.clone();t.mainKey=i,i.subkeys.push(t)}}))),i}async getRevocationCertificate(e=new Date,t=ne){const r={key:this.keyPacket},i=await fh(this.revocationSignatures,this.keyPacket,V.signature.keyRevocation,r,e,t),n=new Du;return n.push(i),le(V.armor.publicKey,n.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(e,t=new Date,r=ne){const i=await de(e,r),n=(await Du.fromBinary(i.data,Ih,r)).findPacket(V.packet.signature);if(!n||n.signatureType!==V.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!n.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await n.verify(this.keyPacket,V.signature.keyRevocation,{key:this.keyPacket},t,void 0,r)}catch(e){throw Y.wrapError("Could not verify revocation signature",e)}const a=this.clone();return a.revocationSignatures.push(n),a}async signPrimaryUser(e,t,r,i=ne){const{index:n,user:a}=await this.getPrimaryUser(t,r,i),s=await a.certify(e,t,i),o=this.clone();return o.users[n]=s,o}async signAllUsers(e,t=new Date,r=ne){const i=this.clone();return i.users=await Promise.all(this.users.map((function(i){return i.certify(e,t,r)}))),i}async verifyPrimaryUser(e,t=new Date,r,i=ne){const n=this.keyPacket,{user:a}=await this.getPrimaryUser(t,r,i);return e?await a.verifyAllCertifications(e,t,i):[{keyID:n.getKeyID(),valid:await a.verify(t,i).catch((()=>!1))}]}async verifyAllUsers(e,t=new Date,r=ne){const i=this.keyPacket,n=[];return await Promise.all(this.users.map((async a=>{const s=e?await a.verifyAllCertifications(e,t,r):[{keyID:i.getKeyID(),valid:await a.verify(t,r).catch((()=>!1))}];n.push(...s.map((e=>({userID:a.userID?a.userID.userID:null,userAttribute:a.userAttribute,keyID:e.keyID,valid:e.valid}))))}))),n}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach((e=>{Mh.prototype[e]=Ch.prototype[e]}));class Dh extends Mh{constructor(e){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],e&&(this.packetListToStructure(e,new Set([V.packet.secretKey,V.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(e=ne){return le(V.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,e)}}class xh extends Dh{constructor(e){if(super(),this.packetListToStructure(e,new Set([V.packet.publicKey,V.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const e=new Du,t=this.toPacketList();let r=!1;for(const i of t)if(!r||i.constructor.tag!==V.packet.Signature)switch(r&&(r=!1),i.constructor.tag){case V.packet.secretKey:{const t=V.write(V.publicKey,i.algorithm);if(t===V.publicKey.aead||t===V.publicKey.hmac)throw Error("Cannot create public key from symmetric private");const r=Vu.fromSecretKeyPacket(i);e.push(r);break}case V.packet.secretSubkey:{const t=V.write(V.publicKey,i.algorithm);if(t===V.publicKey.aead||t===V.publicKey.hmac){r=!0;break}const n=Xu.fromSecretSubkeyPacket(i);e.push(n);break}default:e.push(i)}return new Dh(e)}armor(e=ne){return le(V.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,e)}async getDecryptionKeys(e,t=new Date,r={},i=ne){const n=this.keyPacket,a=[];for(let r=0;r<this.subkeys.length;r++)if(!e||this.subkeys[r].getKeyID().equals(e,!0))try{const e={key:n,bind:this.subkeys[r].keyPacket};kh(await fh(this.subkeys[r].bindingSignatures,n,V.signature.subkeyBinding,e,t,i),i)&&a.push(this.subkeys[r])}catch(e){}const s=await this.getPrimaryUser(t,r,i);return e&&!n.getKeyID().equals(e,!0)||!kh(s.selfCertification,i)||a.push(this),a}isDecrypted(){return this.getKeys().some((({keyPacket:e})=>e.isDecrypted()))}async validate(e=ne){if(!this.isPrivate())throw Error("Cannot validate a public key");let t;if(this.keyPacket.isDummy()){const r=await this.getSigningKey(null,null,void 0,{...e,rejectPublicKeyAlgorithms:new Set,minRSABits:0});r&&!r.keyPacket.isDummy()&&(t=r.keyPacket)}else t=this.keyPacket;if(t)return t.validate();{const e=this.getKeys(),t=e.map((e=>e.keyPacket.isDummy())).every(Boolean);if(t)throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(e.map((async e=>e.keyPacket.validate())))}}clearPrivateParams(){this.getKeys().forEach((({keyPacket:e})=>{e.isDecrypted()&&e.clearPrivateParams()}))}async revoke({flag:e=V.reasonForRevocation.noReason,string:t=""}={},r=new Date,i=ne){if(!this.isPrivate())throw Error("Need private key for revoking");const n={key:this.keyPacket},a=this.clone();return a.revocationSignatures.push(await gh(n,null,this.keyPacket,{signatureType:V.signature.keyRevocation,reasonForRevocationFlag:V.write(V.reasonForRevocation,e),reasonForRevocationString:t},r,void 0,void 0,void 0,i)),a}async addSubkey(e={}){const t={...ne,...e.config};if(e.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(e.rsaBits<t.minRSABits)throw Error(`rsaBits should be at least ${t.minRSABits}, got: ${e.rsaBits}`);const r=this.keyPacket;if(r.isDummy())throw Error("Cannot add subkey to gnu-dummy primary key");if(!r.isDecrypted())throw Error("Key is not decrypted");const i=r.getAlgorithmInfo();i.type=i.curve?"ecc":"rsa",i.rsaBits=i.bits||4096,i.curve=i.curve||"curve25519",e=Ah(e,i);const n=await uh(e);Eh(n,t);const a=await lh(n,r,e,t),s=this.toPacketList();return s.push(n,a),new xh(s)}}const Kh=/*#__PURE__*/Y.constructAllowedPackets([Vu,Xu,eh,nh,ih,$u,Iu]);function Uh(e){for(const t of e)switch(t.constructor.tag){case V.packet.secretKey:return new xh(e);case V.packet.publicKey:return new Dh(e)}throw Error("No key packet found")}async function Rh(e,t,r,i){r.passphrase&&await e.encrypt(r.passphrase,i),await Promise.all(t.map((async function(e,t){const n=r.subkeys[t].passphrase;n&&await e.encrypt(n,i)})));const n=new Du;n.push(e),await Promise.all(r.userIDs.map((async function(t,n){function a(e,t){return[t,...e.filter((e=>e!==t))]}const s=ih.fromObject(t),o={};o.userID=s,o.key=e;const c={};c.signatureType=V.signature.certGeneric,c.keyFlags=[V.keyFlags.certifyKeys|V.keyFlags.signData],c.preferredSymmetricAlgorithms=a([V.symmetric.aes256,V.symmetric.aes128,V.symmetric.aes192],i.preferredSymmetricAlgorithm),i.aeadProtect&&(c.preferredAEADAlgorithms=a([V.aead.eax,V.aead.ocb],i.preferredAEADAlgorithm)),c.preferredHashAlgorithms=a([V.hash.sha256,V.hash.sha512],i.preferredHashAlgorithm),c.preferredCompressionAlgorithms=a([V.compression.zlib,V.compression.zip,V.compression.uncompressed],i.preferredCompressionAlgorithm),0===n&&(c.isPrimaryUserID=!0),c.features=[0],c.features[0]|=V.features.modificationDetection,i.aeadProtect&&(c.features[0]|=V.features.aead),i.v5Keys&&(c.features[0]|=V.features.v5Keys),r.keyExpirationTime>0&&(c.keyExpirationTime=r.keyExpirationTime,c.keyNeverExpires=!1);return{userIDPacket:s,signaturePacket:await gh(o,null,e,c,r.date,void 0,void 0,void 0,i)}}))).then((e=>{e.forEach((({userIDPacket:e,signaturePacket:t})=>{n.push(e),n.push(t)}))})),await Promise.all(t.map((async function(t,n){const a=r.subkeys[n];return{secretSubkeyPacket:t,subkeySignaturePacket:await lh(t,e,a,i)}}))).then((e=>{e.forEach((({secretSubkeyPacket:e,subkeySignaturePacket:t})=>{n.push(e),n.push(t)}))}));const a={key:e};return n.push(await gh(a,null,e,{signatureType:V.signature.keyRevocation,reasonForRevocationFlag:V.reasonForRevocation.noReason,reasonForRevocationString:""},r.date,void 0,void 0,void 0,i)),r.passphrase&&e.clearPrivateParams(),await Promise.all(t.map((async function(e,t){r.subkeys[t].passphrase&&e.clearPrivateParams()}))),new xh(n)}async function Th({armoredKey:e,binaryKey:t,config:r,...i}){if(r={...ne,...r},!e&&!t)throw Error("readKey: must pass options object containing `armoredKey` or `binaryKey`");if(e&&!Y.isString(e))throw Error("readKey: options.armoredKey must be a string");if(t&&!Y.isUint8Array(t))throw Error("readKey: options.binaryKey must be a Uint8Array");const n=Object.keys(i);if(n.length>0)throw Error("Unknown option: "+n.join(", "));let a;if(e){const{type:t,data:i}=await de(e,r);if(t!==V.armor.publicKey&&t!==V.armor.privateKey)throw Error("Armored text not of type key");a=i}else a=t;return Uh(await Du.fromBinary(a,Kh,r))}async function Qh({armoredKey:e,binaryKey:t,config:r,...i}){if(r={...ne,...r},!e&&!t)throw Error("readPrivateKey: must pass options object containing `armoredKey` or `binaryKey`");if(e&&!Y.isString(e))throw Error("readPrivateKey: options.armoredKey must be a string");if(t&&!Y.isUint8Array(t))throw Error("readPrivateKey: options.binaryKey must be a Uint8Array");const n=Object.keys(i);if(n.length>0)throw Error("Unknown option: "+n.join(", "));let a;if(e){const{type:t,data:i}=await de(e,r);if(t!==V.armor.privateKey)throw Error("Armored text not of type private key");a=i}else a=t;const s=await Du.fromBinary(a,Kh,r);return new xh(s)}async function zh({armoredKeys:e,binaryKeys:t,config:r,...i}){r={...ne,...r};let n=e||t;if(!n)throw Error("readKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(e&&!Y.isString(e))throw Error("readKeys: options.armoredKeys must be a string");if(t&&!Y.isUint8Array(t))throw Error("readKeys: options.binaryKeys must be a Uint8Array");const a=Object.keys(i);if(a.length>0)throw Error("Unknown option: "+a.join(", "));if(e){const{type:t,data:i}=await de(e,r);if(t!==V.armor.publicKey&&t!==V.armor.privateKey)throw Error("Armored text not of type key");n=i}const s=[],o=await Du.fromBinary(n,Kh,r),c=o.indexOfTag(V.packet.publicKey,V.packet.secretKey);if(0===c.length)throw Error("No key packet found");for(let e=0;e<c.length;e++){const t=Uh(o.slice(c[e],c[e+1]));s.push(t)}return s}async function Fh({armoredKeys:e,binaryKeys:t,config:r}){r={...ne,...r};let i=e||t;if(!i)throw Error("readPrivateKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(e&&!Y.isString(e))throw Error("readPrivateKeys: options.armoredKeys must be a string");if(t&&!Y.isUint8Array(t))throw Error("readPrivateKeys: options.binaryKeys must be a Uint8Array");if(e){const{type:t,data:n}=await de(e,r);if(t!==V.armor.privateKey)throw Error("Armored text not of type private key");i=n}const n=[],a=await Du.fromBinary(i,Kh,r),s=a.indexOfTag(V.packet.secretKey);if(0===s.length)throw Error("No secret key packet found");for(let e=0;e<s.length;e++){const t=a.slice(s[e],s[e+1]),r=new xh(t);n.push(r)}return n}const Lh=/*#__PURE__*/Y.constructAllowedPackets([Eu,Ku,Hu,qu,Yu,ju,Wu,Pu,Iu]),Nh=/*#__PURE__*/Y.constructAllowedPackets([Wu]),qh=/*#__PURE__*/Y.constructAllowedPackets([Iu]);class Oh{constructor(e){this.packets=e||new Du}getEncryptionKeyIDs(){const e=[];return this.packets.filterByTag(V.packet.publicKeyEncryptedSessionKey).forEach((function(t){e.push(t.publicKeyID)})),e}getSigningKeyIDs(){const e=this.unwrapCompressed(),t=e.packets.filterByTag(V.packet.onePassSignature);if(t.length>0)return t.map((e=>e.issuerKeyID));return e.packets.filterByTag(V.packet.signature).map((e=>e.issuerKeyID))}async decrypt(e,t,r,i=new Date,n=ne){const a=r||await this.decryptSessionKeys(e,t,i,n),s=this.packets.filterByTag(V.packet.symmetricallyEncryptedData,V.packet.symEncryptedIntegrityProtectedData,V.packet.aeadEncryptedData);if(0===s.length)throw Error("No encrypted data found");const o=s[0];let c=null;const u=Promise.all(a.map((async({algorithm:e,data:t})=>{if(!Y.isUint8Array(t)||!Y.isString(e))throw Error("Invalid session key for decryption.");try{const r=V.write(V.symmetric,e);await o.decrypt(r,t,n)}catch(e){Y.printDebugError(e),c=e}})));if(O(o.encrypted),o.encrypted=null,await u,!o.packets||!o.packets.length)throw c||Error("Decryption failed.");const h=new Oh(o.packets);return o.packets=new Du,h}async decryptSessionKeys(e,t,r=new Date,i=ne){let n,a=[];if(t){const e=this.packets.filterByTag(V.packet.symEncryptedSessionKey);if(0===e.length)throw Error("No symmetrically encrypted session key packet found.");await Promise.all(t.map((async function(t,r){let s;s=r?await Du.fromBinary(e.write(),Nh,i):e,await Promise.all(s.map((async function(e){try{await e.decrypt(t),a.push(e)}catch(e){Y.printDebugError(e),e instanceof Pa&&(n=e)}})))})))}else{if(!e)throw Error("No key or password specified.");{const t=this.packets.filterByTag(V.packet.publicKeyEncryptedSessionKey);if(0===t.length)throw Error("No public key encrypted session key packet found.");await Promise.all(t.map((async function(t){await Promise.all(e.map((async function(e){let s=[V.symmetric.aes256,V.symmetric.aes128,V.symmetric.tripledes,V.symmetric.cast5];try{const t=await e.getPrimaryUser(r,void 0,i);t.selfCertification.preferredSymmetricAlgorithms&&(s=s.concat(t.selfCertification.preferredSymmetricAlgorithms))}catch(e){}const o=(await e.getDecryptionKeys(t.publicKeyID,null,void 0,i)).map((e=>e.keyPacket));await Promise.all(o.map((async function(e){if(!e||e.isDummy())return;if(!e.isDecrypted())throw Error("Decryption key is not decrypted.");if(i.constantTimePKCS1Decryption&&(t.publicKeyAlgorithm===V.publicKey.rsaEncrypt||t.publicKeyAlgorithm===V.publicKey.rsaEncryptSign||t.publicKeyAlgorithm===V.publicKey.rsaSign||t.publicKeyAlgorithm===V.publicKey.elgamal)){const r=t.write();await Promise.all(Array.from(i.constantTimePKCS1DecryptionSupportedSymmetricAlgorithms).map((async t=>{const i=new ju;i.read(r);const s={sessionKeyAlgorithm:t,sessionKey:Ba.generateSessionKey(t)};try{await i.decrypt(e,s),a.push(i)}catch(e){Y.printDebugError(e),n=e}})))}else try{if(await t.decrypt(e),!s.includes(V.write(V.symmetric,t.sessionKeyAlgorithm)))throw Error("A non-preferred symmetric algorithm was used.");a.push(t)}catch(e){Y.printDebugError(e),n=e}})))}))),O(t.encrypted),t.encrypted=null})))}}if(a.length>0){if(a.length>1){const e=new Set;a=a.filter((t=>{const r=t.sessionKeyAlgorithm+Y.uint8ArrayToString(t.sessionKey);return!e.has(r)&&(e.add(r),!0)}))}return a.map((e=>({data:e.sessionKey,algorithm:V.read(V.symmetric,e.sessionKeyAlgorithm)})))}throw n||Error("Session key decryption failed.")}getLiteralData(){const e=this.unwrapCompressed().packets.findPacket(V.packet.literalData);return e&&e.getBytes()||null}getFilename(){const e=this.unwrapCompressed().packets.findPacket(V.packet.literalData);return e&&e.getFilename()||null}getText(){const e=this.unwrapCompressed().packets.findPacket(V.packet.literalData);return e?e.getText():null}static async generateSessionKey(e=[],t=new Date,r=[],i=ne){const n=await yh("symmetric",e,t,r,i),a=V.read(V.symmetric,n),s=i.aeadProtect&&await async function(e,t=new Date,r=[],i=ne){let n=!0;return await Promise.all(e.map((async function(e,a){const s=await e.getPrimaryUser(t,r[a],i);s.selfCertification.features&&s.selfCertification.features[0]&V.features.aead||(n=!1)}))),n}(e,t,r,i)?V.read(V.aead,await yh("aead",e,t,r,i)):void 0;await Promise.all(e.map((e=>e.getEncryptionKey().catch((()=>null)).then((e=>{if(e&&e.keyPacket.algorithm===V.publicKey.x25519&&!Y.isAES(n))throw Error("Could not generate a session key compatible with the given `encryptionKeys`: X22519 keys can only be used to encrypt AES session keys; change `config.preferredSymmetricAlgorithm` accordingly.")})))));return{data:Ba.generateSessionKey(n),algorithm:a,aeadAlgorithm:s}}async encrypt(e,t,r,i=!1,n=[],a=new Date,s=[],o=ne){if(r){if(!Y.isUint8Array(r.data)||!Y.isString(r.algorithm))throw Error("Invalid session key for encryption.")}else if(e&&e.length)r=await Oh.generateSessionKey(e,a,s,o);else{if(!t||!t.length)throw Error("No keys, passwords, or session key provided.");r=await Oh.generateSessionKey(void 0,void 0,void 0,o)}const{data:c,algorithm:u,aeadAlgorithm:h}=r,f=await Oh.encryptSessionKey(c,u,h,e,t,i,n,a,s,o);let d;h?(d=new Hu,d.aeadAlgorithm=V.write(V.aead,h)):d=new qu,d.packets=this.packets;const l=V.write(V.symmetric,u);return await d.encrypt(l,c,o),f.packets.push(d),d.packets=new Du,f}static async encryptSessionKey(e,t,r,i,n,a=!1,s=[],o=new Date,c=[],u=ne){const h=new Du,f=V.write(V.symmetric,t),d=r&&V.write(V.aead,r);if(i){const t=await Promise.all(i.map((async function(t,r){const i=await t.getEncryptionKey(s[r],o,c,u),n=new ju;return n.publicKeyID=a?pe.wildcard():i.getKeyID(),n.publicKeyAlgorithm=i.keyPacket.algorithm,n.sessionKey=e,n.sessionKeyAlgorithm=f,await n.encrypt(i.keyPacket),delete n.sessionKey,n})));h.push(...t)}if(n){const t=async function(e,t){try{return await e.decrypt(t),1}catch(e){return 0}},r=(e,t)=>e+t,i=async function(e,a,s,o){const c=new Wu(u);if(c.sessionKey=e,c.sessionKeyAlgorithm=a,s&&(c.aeadAlgorithm=s),await c.encrypt(o,u),u.passwordCollisionCheck){if(1!==(await Promise.all(n.map((e=>t(c,e))))).reduce(r))return i(e,a,o)}return delete c.sessionKey,c},a=await Promise.all(n.map((t=>i(e,f,d,t))));h.push(...a)}return new Oh(h)}async sign(e=[],t=null,r=[],i=new Date,n=[],a=[],s=ne){const o=new Du,c=this.packets.findPacket(V.packet.literalData);if(!c)throw Error("No literal data packet to sign.");let u,h;const f=null===c.text?V.signature.binary:V.signature.text;if(t)for(h=t.packets.filterByTag(V.packet.signature),u=h.length-1;u>=0;u--){const t=h[u],r=new Pu;r.signatureType=t.signatureType,r.hashAlgorithm=t.hashAlgorithm,r.publicKeyAlgorithm=t.publicKeyAlgorithm,r.issuerKeyID=t.issuerKeyID,e.length||0!==u||(r.flags=1),o.push(r)}return await Promise.all(Array.from(e).reverse().map((async function(t,a){if(!t.isPrivate())throw Error("Need private key for signing");const o=r[e.length-1-a],c=await t.getSigningKey(o,i,n,s),u=new Pu;return u.signatureType=f,u.hashAlgorithm=await ph(t,c.keyPacket,i,n,s),u.publicKeyAlgorithm=c.keyPacket.algorithm,u.issuerKeyID=c.getKeyID(),a===e.length-1&&(u.flags=1),u}))).then((e=>{e.forEach((e=>o.push(e)))})),o.push(c),o.push(...await Hh(c,e,t,r,i,n,a,!1,s)),new Oh(o)}compress(e,t=ne){if(e===V.compression.uncompressed)return this;const r=new Ku(t);r.algorithm=e,r.packets=this.packets;const i=new Du;return i.push(r),new Oh(i)}async signDetached(e=[],t=null,r=[],i=new Date,n=[],a=[],s=ne){const o=this.packets.findPacket(V.packet.literalData);if(!o)throw Error("No literal data packet to sign.");return new oh(await Hh(o,e,t,r,i,n,a,!0,s))}async verify(e,t=new Date,r=ne){const i=this.unwrapCompressed(),n=i.packets.filterByTag(V.packet.literalData);if(1!==n.length)throw Error("Can only verify message with one literal data packet.");s(i.packets.stream)&&i.packets.push(...await q(i.packets.stream,(e=>e||[])));const a=i.packets.filterByTag(V.packet.onePassSignature).reverse(),o=i.packets.filterByTag(V.packet.signature);return a.length&&!o.length&&Y.isStream(i.packets.stream)&&!s(i.packets.stream)?(await Promise.all(a.map((async e=>{e.correspondingSig=new Promise(((t,r)=>{e.correspondingSigResolve=t,e.correspondingSigReject=r})),e.signatureData=H((async()=>(await e.correspondingSig).signatureData)),e.hashed=q(await e.hash(e.signatureType,n[0],void 0,!1)),e.hashed.catch((()=>{}))}))),i.packets.stream=T(i.packets.stream,(async(e,t)=>{const r=M(e),i=D(t);try{for(let e=0;e<a.length;e++){const{value:t}=await r.read();a[e].correspondingSigResolve(t)}await r.readToEnd(),await i.ready,await i.close()}catch(e){a.forEach((t=>{t.correspondingSigReject(e)})),await i.abort(e)}})),jh(a,n,e,t,!1,r)):jh(o,n,e,t,!1,r)}verifyDetached(e,t,r=new Date,i=ne){const n=this.unwrapCompressed().packets.filterByTag(V.packet.literalData);if(1!==n.length)throw Error("Can only verify message with one literal data packet.");return jh(e.packets.filterByTag(V.packet.signature),n,t,r,!0,i)}unwrapCompressed(){const e=this.packets.filterByTag(V.packet.compressedData);return e.length?new Oh(e[0].packets):this}async appendSignature(e,t=ne){await this.packets.read(Y.isUint8Array(e)?e:(await de(e)).data,qh,t)}write(){return this.packets.write()}armor(e=ne){return le(V.armor.message,this.write(),null,null,null,e)}}async function Hh(e,t,r=null,i=[],n=new Date,a=[],s=[],o=!1,c=ne){const u=new Du,h=null===e.text?V.signature.binary:V.signature.text;if(await Promise.all(t.map((async(t,r)=>{const u=a[r];if(!t.isPrivate())throw Error("Need private key for signing");const f=await t.getSigningKey(i[r],n,u,c);return gh(e,t,f.keyPacket,{signatureType:h},n,u,s,o,c)}))).then((e=>{u.push(...e)})),r){const e=r.packets.filterByTag(V.packet.signature);u.push(...e)}return u}async function jh(e,t,r,i=new Date,n=!1,a=ne){return Promise.all(e.filter((function(e){return["text","binary"].includes(V.read(V.signature,e.signatureType))})).map((async function(e){return async function(e,t,r,i=new Date,n=!1,a=ne){let s,o;for(const t of r){const r=t.getKeys(e.issuerKeyID);if(r.length>0){s=t,o=r[0];break}}const c=e instanceof Pu?e.correspondingSig:e,u={keyID:e.issuerKeyID,verified:(async()=>{if(!o)throw Error("Could not find signing key with key ID "+e.issuerKeyID.toHex());await e.verify(o.keyPacket,e.signatureType,t[0],i,n,a);const r=await c;if(o.getCreationTime()>r.created)throw Error("Key is newer than the signature");try{await s.getSigningKey(o.getKeyID(),r.created,void 0,a)}catch(e){if(!a.allowInsecureVerificationWithReformattedKeys||!e.message.match(/Signature creation time is in the future/))throw e;await s.getSigningKey(o.getKeyID(),i,void 0,a)}return!0})(),signature:(async()=>{const e=await c,t=new Du;return e&&t.push(e),new oh(t)})()};return u.signature.catch((()=>{})),u.verified.catch((()=>{})),u}(e,t,r,i,n,a)})))}async function Gh({armoredMessage:e,binaryMessage:t,config:r,...i}){r={...ne,...r};let n=e||t;if(!n)throw Error("readMessage: must pass options object containing `armoredMessage` or `binaryMessage`");if(e&&!Y.isString(e)&&!Y.isStream(e))throw Error("readMessage: options.armoredMessage must be a string or stream");if(t&&!Y.isUint8Array(t)&&!Y.isStream(t))throw Error("readMessage: options.binaryMessage must be a Uint8Array or stream");const a=Object.keys(i);if(a.length>0)throw Error("Unknown option: "+a.join(", "));const s=Y.isStream(n);if(s&&(await S(),n=I(n)),e){const{type:e,data:t}=await de(n,r);if(e!==V.armor.message)throw Error("Armored text not of type message");n=t}const o=await Du.fromBinary(n,Lh,r),c=new Oh(o);return c.fromStream=s,c}async function Wh({text:e,binary:t,filename:r,date:i=new Date,format:n=(void 0!==e?"utf8":"binary"),...a}){let s=void 0!==e?e:t;if(void 0===s)throw Error("createMessage: must pass options object containing `text` or `binary`");if(e&&!Y.isString(e)&&!Y.isStream(e))throw Error("createMessage: options.text must be a string or stream");if(t&&!Y.isUint8Array(t)&&!Y.isStream(t))throw Error("createMessage: options.binary must be a Uint8Array or stream");const o=Object.keys(a);if(o.length>0)throw Error("Unknown option: "+o.join(", "));const c=Y.isStream(s);c&&(await S(),s=I(s));const u=new Eu(i);void 0!==e?u.setText(s,V.write(V.literal,n)):u.setBytes(s,V.write(V.literal,n)),void 0!==r&&u.setFilename(r);const h=new Du;h.push(u);const f=new Oh(h);return f.fromStream=c,f}const Vh=/*#__PURE__*/Y.constructAllowedPackets([Iu]);class Jh{constructor(e,t){if(this.text=Y.removeTrailingSpaces(e).replace(/\r?\n/g,"\r\n"),t&&!(t instanceof oh))throw Error("Invalid signature input");this.signature=t||new oh(new Du)}getSigningKeyIDs(){const e=[];return this.signature.packets.forEach((function(t){e.push(t.issuerKeyID)})),e}async sign(e,t=null,r=[],i=new Date,n=[],a=[],s=ne){const o=new Eu;o.setText(this.text);const c=new oh(await Hh(o,e,t,r,i,n,a,!0,s));return new Jh(this.text,c)}verify(e,t=new Date,r=ne){const i=this.signature.packets.filterByTag(V.packet.signature),n=new Eu;return n.setText(this.text),jh(i,[n],e,t,!0,r)}getText(){return this.text.replace(/\r\n/g,"\n")}armor(e=ne){let t=this.signature.packets.map((function(e){return V.read(V.hash,e.hashAlgorithm).toUpperCase()}));t=t.filter((function(e,t,r){return r.indexOf(e)===t}));const r={hash:t.join(),text:this.text,data:this.signature.packets.write()};return le(V.armor.signed,r,void 0,void 0,void 0,e)}}async function Yh({cleartextMessage:e,config:t,...r}){if(t={...ne,...t},!e)throw Error("readCleartextMessage: must pass options object containing `cleartextMessage`");if(!Y.isString(e))throw Error("readCleartextMessage: options.cleartextMessage must be a string");const i=Object.keys(r);if(i.length>0)throw Error("Unknown option: "+i.join(", "));const n=await de(e);if(n.type!==V.armor.signed)throw Error("No cleartext signed message.");const a=await Du.fromBinary(n.data,Vh,t);!function(e,t){const r=function(e){const r=e=>t=>e.hashAlgorithm===t;for(let i=0;i<t.length;i++)if(t[i].constructor.tag===V.packet.signature&&!e.some(r(t[i])))return!1;return!0};let i=null,n=[];if(e.forEach((function(e){if(i=e.match(/^Hash: (.+)$/),!i)throw Error('Only "Hash" header allowed in cleartext signed message');i=i[1].replace(/\s/g,""),i=i.split(","),i=i.map((function(e){e=e.toLowerCase();try{return V.write(V.hash,e)}catch(t){throw Error("Unknown hash algorithm in armor header: "+e)}})),n=n.concat(i)})),!n.length&&!r([V.hash.md5]))throw Error('If no "Hash" header in cleartext signed message, then only MD5 signatures allowed');if(n.length&&!r(n))throw Error("Hash algorithm mismatch in armor header and signature")}(n.headers,a);const s=new oh(a);return new Jh(n.text,s)}async function Zh({text:e,...t}){if(!e)throw Error("createCleartextMessage: must pass options object containing `text`");if(!Y.isString(e))throw Error("createCleartextMessage: options.text must be a string");const r=Object.keys(t);if(r.length>0)throw Error("Unknown option: "+r.join(", "));return new Jh(e)}async function Xh({userIDs:e=[],passphrase:t,type:r="ecc",rsaBits:i=4096,curve:n="curve25519",keyExpirationTime:a=0,date:s=new Date,subkeys:o=[{}],format:c="armored",config:u,symmetricHash:h="sha256",symmetricCipher:f="aes256",...d}){yf(u={...ne,...u}),e=gf(e);const l=Object.keys(d);if(l.length>0)throw Error("Unknown option: "+l.join(", "));if(0===e.length)throw Error("UserIDs are required for key generation");if("rsa"===r&&i<u.minRSABits)throw Error(`rsaBits should be at least ${u.minRSABits}, got: ${i}`);const p={userIDs:e,passphrase:t,type:r,rsaBits:i,curve:n,keyExpirationTime:a,date:s,subkeys:o,symmetricHash:h,symmetricCipher:f};try{const{key:e,revocationCertificate:t}=await async function(e,t){e.sign=!0,(e=Ah(e)).subkeys=e.subkeys.map(((t,r)=>Ah(e.subkeys[r],e)));let r=[hh(e,t)];r=r.concat(e.subkeys.map((e=>uh(e,t))));const i=await Promise.all(r),n=await Rh(i[0],i.slice(1),e,t),a=await n.getRevocationCertificate(e.date,t);return n.revocationSignatures=[],{key:n,revocationCertificate:a}}(p,u);return e.getKeys().forEach((({keyPacket:e})=>Eh(e,u))),{privateKey:wf(e,c,u),publicKey:"symmetric"!==r?wf(e.toPublic(),c,u):null,revocationCertificate:t}}catch(e){throw Y.wrapError("Error generating keypair",e)}}async function $h({privateKey:e,userIDs:t=[],passphrase:r,keyExpirationTime:i=0,date:n,format:a="armored",config:s,...o}){yf(s={...ne,...s}),t=gf(t);const c=Object.keys(o);if(c.length>0)throw Error("Unknown option: "+c.join(", "));if(0===t.length)throw Error("UserIDs are required for key reformat");const u={privateKey:e,userIDs:t,passphrase:r,keyExpirationTime:i,date:n};try{const{key:e,revocationCertificate:t}=await async function(e,t){e=o(e);const{privateKey:r}=e;if(!r.isPrivate())throw Error("Cannot reformat a public key");if(r.keyPacket.isDummy())throw Error("Cannot reformat a gnu-dummy primary key");if(!r.getKeys().every((({keyPacket:e})=>e.isDecrypted())))throw Error("Key is not decrypted");const i=r.keyPacket;e.subkeys||(e.subkeys=await Promise.all(r.subkeys.map((async e=>{const r=e.keyPacket,n={key:i,bind:r},a=await fh(e.bindingSignatures,i,V.signature.subkeyBinding,n,null,t).catch((()=>({})));return{sign:a.keyFlags&&a.keyFlags[0]&V.keyFlags.signData,forwarding:a.keyFlags&&a.keyFlags[0]&V.keyFlags.forwardedCommunication}}))));const n=r.subkeys.map((e=>e.keyPacket));if(e.subkeys.length!==n.length)throw Error("Number of subkey options does not match number of subkeys");e.subkeys=e.subkeys.map((t=>o(t,e)));const a=await Rh(i,n,e,t),s=await a.getRevocationCertificate(e.date,t);return a.revocationSignatures=[],{key:a,revocationCertificate:s};function o(e,t={}){return e.keyExpirationTime=e.keyExpirationTime||t.keyExpirationTime,e.passphrase=Y.isString(e.passphrase)?e.passphrase:t.passphrase,e.date=e.date||t.date,e}}(u,s);return{privateKey:wf(e,a,s),publicKey:wf(e.toPublic(),a,s),revocationCertificate:t}}catch(e){throw Y.wrapError("Error reformatting keypair",e)}}async function ef({key:e,revocationCertificate:t,reasonForRevocation:r,date:i=new Date,format:n="armored",config:a,...s}){yf(a={...ne,...a});const o=Object.keys(s);if(o.length>0)throw Error("Unknown option: "+o.join(", "));try{const s=t?await e.applyRevocationCertificate(t,i,a):await e.revoke(r,i,a);return s.isPrivate()?{privateKey:wf(s,n,a),publicKey:wf(s.toPublic(),n,a)}:{privateKey:null,publicKey:wf(s,n,a)}}catch(e){throw Y.wrapError("Error revoking key",e)}}async function tf({privateKey:e,passphrase:t,config:r,...i}){yf(r={...ne,...r});const n=Object.keys(i);if(n.length>0)throw Error("Unknown option: "+n.join(", "));if(!e.isPrivate())throw Error("Cannot decrypt a public key");const a=e.clone(!0),s=Y.isArray(t)?t:[t];try{return await Promise.all(a.getKeys().map((e=>Y.anyPromise(s.map((t=>e.keyPacket.decrypt(t))))))),await a.validate(r),a}catch(e){throw a.clearPrivateParams(),Y.wrapError("Error decrypting private key",e)}}async function rf({privateKey:e,passphrase:t,config:r,...i}){yf(r={...ne,...r});const n=Object.keys(i);if(n.length>0)throw Error("Unknown option: "+n.join(", "));if(!e.isPrivate())throw Error("Cannot encrypt a public key");const a=e.clone(!0),s=a.getKeys(),o=Y.isArray(t)?t:Array(s.length).fill(t);if(o.length!==s.length)throw Error("Invalid number of passphrases given for key encryption");try{return await Promise.all(s.map((async(e,t)=>{const{keyPacket:i}=e;await i.encrypt(o[t],r),i.clearPrivateParams()}))),a}catch(e){throw a.clearPrivateParams(),Y.wrapError("Error encrypting private key",e)}}async function nf({message:e,encryptionKeys:t,signingKeys:r,passwords:i,sessionKey:n,format:a="armored",signature:s=null,wildcard:o=!1,signingKeyIDs:c=[],encryptionKeyIDs:u=[],date:h=new Date,signingUserIDs:f=[],encryptionUserIDs:d=[],signatureNotations:l=[],config:p,...y}){if(yf(p={...ne,...p}),ff(e),lf(a),t=gf(t),r=gf(r),i=gf(i),c=gf(c),u=gf(u),f=gf(f),d=gf(d),l=gf(l),y.detached)throw Error("The `detached` option has been removed from openpgp.encrypt, separately call openpgp.sign instead. Don't forget to remove the `privateKeys` option as well.");if(y.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encrypt, pass `encryptionKeys` instead");if(y.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.encrypt, pass `signingKeys` instead");if(void 0!==y.armor)throw Error("The `armor` option has been removed from openpgp.encrypt, pass `format` instead.");const g=Object.keys(y);if(g.length>0)throw Error("Unknown option: "+g.join(", "));r||(r=[]);const b=e.fromStream;try{if((r.length||s)&&(e=await e.sign(r,s,c,h,f,l,p)),e=e.compress(await yh("compression",t,h,d,p),p),e=await e.encrypt(t,i,n,o,u,h,d,p),"object"===a)return e;const y="armored"===a;return bf(y?e.armor(p):e.write(),b,y?"utf8":"binary")}catch(e){throw Y.wrapError("Error encrypting message",e)}}async function af({message:e,decryptionKeys:t,passwords:r,sessionKeys:i,verificationKeys:n,expectSigned:a=!1,format:s="utf8",signature:o=null,date:c=new Date,config:u,...h}){if(yf(u={...ne,...u}),ff(e),n=gf(n),t=gf(t),r=gf(r),i=gf(i),h.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decrypt, pass `decryptionKeys` instead");if(h.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.decrypt, pass `verificationKeys` instead");const f=Object.keys(h);if(f.length>0)throw Error("Unknown option: "+f.join(", "));try{const h=await e.decrypt(t,r,i,c,u);n||(n=[]);const f={};if(f.signatures=o?await h.verifyDetached(o,n,c,u):await h.verify(n,c,u),f.data="binary"===s?h.getLiteralData():h.getText(),f.filename=h.getFilename(),mf(f,e),a){if(0===n.length)throw Error("Verification keys are required to verify message signatures");if(0===f.signatures.length)throw Error("Message is not signed");f.data=P([f.data,H((async()=>{await Y.anyPromise(f.signatures.map((e=>e.verified)))}))])}return f.data=await bf(f.data,e.fromStream,s),f}catch(e){throw Y.wrapError("Error decrypting message",e)}}async function sf({message:e,signingKeys:t,format:r="armored",detached:i=!1,signingKeyIDs:n=[],date:a=new Date,signingUserIDs:s=[],signatureNotations:o=[],config:c,...u}){if(yf(c={...ne,...c}),df(e),lf(r),t=gf(t),n=gf(n),s=gf(s),o=gf(o),u.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.sign, pass `signingKeys` instead");if(void 0!==u.armor)throw Error("The `armor` option has been removed from openpgp.sign, pass `format` instead.");const h=Object.keys(u);if(h.length>0)throw Error("Unknown option: "+h.join(", "));if(e instanceof Jh&&"binary"===r)throw Error("Cannot return signed cleartext message in binary format");if(e instanceof Jh&&i)throw Error("Cannot detach-sign a cleartext message");if(!t||0===t.length)throw Error("No signing keys provided");try{let u;if(u=i?await e.signDetached(t,void 0,n,a,s,o,c):await e.sign(t,void 0,n,a,s,o,c),"object"===r)return u;const h="armored"===r;return u=h?u.armor(c):u.write(),i&&(u=T(e.packets.write(),(async(e,t)=>{await Promise.all([x(u,t),q(e).catch((()=>{}))])}))),bf(u,e.fromStream,h?"utf8":"binary")}catch(e){throw Y.wrapError("Error signing message",e)}}async function of({message:e,verificationKeys:t,expectSigned:r=!1,format:i="utf8",signature:n=null,date:a=new Date,config:s,...o}){if(yf(s={...ne,...s}),df(e),t=gf(t),o.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.verify, pass `verificationKeys` instead");const c=Object.keys(o);if(c.length>0)throw Error("Unknown option: "+c.join(", "));if(e instanceof Jh&&"binary"===i)throw Error("Can't return cleartext message data as binary");if(e instanceof Jh&&n)throw Error("Can't verify detached cleartext signature");try{const o={};if(o.signatures=n?await e.verifyDetached(n,t,a,s):await e.verify(t,a,s),o.data="binary"===i?e.getLiteralData():e.getText(),e.fromStream&&mf(o,e),r){if(0===o.signatures.length)throw Error("Message is not signed");o.data=P([o.data,H((async()=>{await Y.anyPromise(o.signatures.map((e=>e.verified)))}))])}return o.data=await bf(o.data,e.fromStream,i),o}catch(e){throw Y.wrapError("Error verifying signed message",e)}}async function cf({encryptionKeys:e,date:t=new Date,encryptionUserIDs:r=[],config:i,...n}){if(yf(i={...ne,...i}),e=gf(e),r=gf(r),n.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.generateSessionKey, pass `encryptionKeys` instead");const a=Object.keys(n);if(a.length>0)throw Error("Unknown option: "+a.join(", "));try{return await Oh.generateSessionKey(e,t,r,i)}catch(e){throw Y.wrapError("Error generating session key",e)}}async function uf({data:e,algorithm:t,aeadAlgorithm:r,encryptionKeys:i,passwords:n,format:a="armored",wildcard:s=!1,encryptionKeyIDs:o=[],date:c=new Date,encryptionUserIDs:u=[],config:h,...f}){if(yf(h={...ne,...h}),function(e,t){if(!Y.isUint8Array(e))throw Error("Parameter ["+(t||"data")+"] must be of type Uint8Array")}(e),function(e,t){if(!Y.isString(e))throw Error("Parameter ["+(t||"data")+"] must be of type String")}(t,"algorithm"),lf(a),i=gf(i),n=gf(n),o=gf(o),u=gf(u),f.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encryptSessionKey, pass `encryptionKeys` instead");const d=Object.keys(f);if(d.length>0)throw Error("Unknown option: "+d.join(", "));if(!(i&&0!==i.length||n&&0!==n.length))throw Error("No encryption keys or passwords provided.");try{return wf(await Oh.encryptSessionKey(e,t,r,i,n,s,o,c,u,h),a,h)}catch(e){throw Y.wrapError("Error encrypting session key",e)}}async function hf({message:e,decryptionKeys:t,passwords:r,date:i=new Date,config:n,...a}){if(yf(n={...ne,...n}),ff(e),t=gf(t),r=gf(r),a.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decryptSessionKeys, pass `decryptionKeys` instead");const s=Object.keys(a);if(s.length>0)throw Error("Unknown option: "+s.join(", "));try{return await e.decryptSessionKeys(t,r,i,n)}catch(e){throw Y.wrapError("Error decrypting session keys",e)}}function ff(e){if(!(e instanceof Oh))throw Error("Parameter [message] needs to be of type Message")}function df(e){if(!(e instanceof Jh||e instanceof Oh))throw Error("Parameter [message] needs to be of type Message or CleartextMessage")}function lf(e){if("armored"!==e&&"binary"!==e&&"object"!==e)throw Error("Unsupported format "+e)}const pf=Object.keys(ne).length;function yf(e){const t=Object.keys(e);if(t.length!==pf)for(const e of t)if(void 0===ne[e])throw Error("Unknown config property: "+e)}function gf(e){return e&&!Y.isArray(e)&&(e=[e]),e}async function bf(e,t,r="utf8"){const i=Y.isStream(e);return"array"===i?q(e):"node"===t?(e=g(e),"binary"!==r&&e.setEncoding(r),e):"web"===t&&"ponyfill"===i?v(e):e}function mf(e,t){e.data=T(t.packets.stream,(async(t,r)=>{await x(e.data,r,{preventClose:!0});const i=D(r);try{await q(t,(e=>e)),await i.close()}catch(e){await i.abort(e)}}))}function wf(e,t,r){switch(t){case"object":return e;case"armored":return e.armor(r);case"binary":return e.write();default:throw Error("Unsupported format "+t)}}const Af="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:e=>`Symbol(${e})`;function vf(){}const _f="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;function kf(e){return"object"==typeof e&&null!==e||"function"==typeof e}const Ef=vf,Sf=Promise,Cf=Promise.prototype.then,If=Promise.resolve.bind(Sf),Bf=Promise.reject.bind(Sf);function Pf(e){return new Sf(e)}function Mf(e){return If(e)}function Df(e){return Bf(e)}function xf(e,t,r){return Cf.call(e,t,r)}function Kf(e,t,r){xf(xf(e,t,r),void 0,Ef)}function Uf(e,t){Kf(e,t)}function Rf(e,t){Kf(e,void 0,t)}function Tf(e,t,r){return xf(e,t,r)}function Qf(e){xf(e,void 0,Ef)}const zf=(()=>{const e=_f&&_f.queueMicrotask;if("function"==typeof e)return e;const t=Mf(void 0);return e=>xf(t,e)})();function Ff(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function Lf(e,t,r){try{return Mf(Ff(e,t,r))}catch(e){return Df(e)}}class Nf{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){const t=this._back;let r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size}shift(){const e=this._front;let t=e;const r=this._cursor;let i=r+1;const n=e._elements,a=n[r];return 16384===i&&(t=e._next,i=0),--this._size,this._cursor=i,e!==t&&(this._front=t),n[r]=void 0,a}forEach(e){let t=this._cursor,r=this._front,i=r._elements;for(;!(t===i.length&&void 0===r._next||t===i.length&&(r=r._next,i=r._elements,t=0,0===i.length));)e(i[t]),++t}peek(){const e=this._front,t=this._cursor;return e._elements[t]}}function qf(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?Gf(e):"closed"===t._state?function(e){Gf(e),Jf(e)}(e):Wf(e,t._storedError)}function Of(e,t){return Cp(e._ownerReadableStream,t)}function Hf(e){"readable"===e._ownerReadableStream._state?Vf(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,t){Wf(e,t)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function jf(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function Gf(e){e._closedPromise=Pf(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function Wf(e,t){Gf(e),Vf(e,t)}function Vf(e,t){void 0!==e._closedPromise_reject&&(Qf(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function Jf(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}const Yf=Af("[[AbortSteps]]"),Zf=Af("[[ErrorSteps]]"),Xf=Af("[[CancelSteps]]"),$f=Af("[[PullSteps]]"),ed=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},td=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function rd(e,t){if(void 0!==e&&("object"!=typeof(r=e)&&"function"!=typeof r))throw new TypeError(t+" is not an object.");var r}function id(e,t){if("function"!=typeof e)throw new TypeError(t+" is not a function.")}function nd(e,t){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError(t+" is not an object.")}function ad(e,t,r){if(void 0===e)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}function sd(e,t,r){if(void 0===e)throw new TypeError(`${t} is required in '${r}'.`)}function od(e){return Number(e)}function cd(e){return 0===e?0:e}function ud(e,t){const r=Number.MAX_SAFE_INTEGER;let i=Number(e);if(i=cd(i),!ed(i))throw new TypeError(t+" is not a finite number");if(i=function(e){return cd(td(e))}(i),i<0||i>r)throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return ed(i)&&0!==i?i:0}function hd(e,t){if(!Ep(e))throw new TypeError(t+" is not a ReadableStream.")}function fd(e){return new gd(e)}function dd(e,t){e._reader._readRequests.push(t)}function ld(e,t,r){const i=e._reader._readRequests.shift();r?i._closeSteps():i._chunkSteps(t)}function pd(e){return e._reader._readRequests.length}function yd(e){const t=e._reader;return void 0!==t&&!!bd(t)}class gd{constructor(e){if(ad(e,1,"ReadableStreamDefaultReader"),hd(e,"First parameter"),Sp(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");qf(this,e),this._readRequests=new Nf}get closed(){return bd(this)?this._closedPromise:Df(wd("closed"))}cancel(e=undefined){return bd(this)?void 0===this._ownerReadableStream?Df(jf("cancel")):Of(this,e):Df(wd("cancel"))}read(){if(!bd(this))return Df(wd("read"));if(void 0===this._ownerReadableStream)return Df(jf("read from"));let e,t;const r=Pf(((r,i)=>{e=r,t=i}));return md(this,{_chunkSteps:t=>e({value:t,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:e=>t(e)}),r}releaseLock(){if(!bd(this))throw wd("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Hf(this)}}}function bd(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function md(e,t){const r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[$f](t)}function wd(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}let Ad;Object.defineProperties(gd.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(gd.prototype,Af.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof Af.asyncIterator&&(Ad={[Af.asyncIterator](){return this}},Object.defineProperty(Ad,Af.asyncIterator,{enumerable:!1}));class vd{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){const e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?Tf(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){const t=()=>this._returnSteps(e);return this._ongoingPromise?Tf(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const e=this._reader;if(void 0===e._ownerReadableStream)return Df(jf("iterate"));let t,r;const i=Pf(((e,i)=>{t=e,r=i}));return md(e,{_chunkSteps:e=>{this._ongoingPromise=void 0,zf((()=>t({value:e,done:!1})))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Hf(e),t({value:void 0,done:!0})},_errorSteps:t=>{this._ongoingPromise=void 0,this._isFinished=!0,Hf(e),r(t)}}),i}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;const t=this._reader;if(void 0===t._ownerReadableStream)return Df(jf("finish iterating"));if(!this._preventCancel){const r=Of(t,e);return Hf(t),Tf(r,(()=>({value:e,done:!0})))}return Hf(t),Mf({value:e,done:!0})}}const _d={next(){return kd(this)?this._asyncIteratorImpl.next():Df(Ed("next"))},return(e){return kd(this)?this._asyncIteratorImpl.return(e):Df(Ed("return"))}};function kd(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl")}function Ed(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}void 0!==Ad&&Object.setPrototypeOf(_d,Ad);const Sd=Number.isNaN||function(e){return e!=e};function Cd(e){return!!function(e){if("number"!=typeof e)return!1;if(Sd(e))return!1;if(e<0)return!1;return!0}(e)&&e!==1/0}function Id(e){const t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function Bd(e,t,r){if(!Cd(r=Number(r)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function Pd(e){e._queue=new Nf,e._queueTotalSize=0}function Md(e){return e.slice()}class Dd{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Ud(this))throw Yd("view");return this._view}respond(e){if(!Ud(this))throw Yd("respond");if(ad(e,1,"respond"),e=ud(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(e,t){if(t=Number(t),!Cd(t))throw new RangeError("bytesWritten must be a finite");Hd(e,t)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!Ud(this))throw Yd("respondWithNewView");if(ad(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");!function(e,t){const r=e._pendingPullIntos.peek();if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==t.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=t.buffer,Hd(e,t.byteLength)}(this._associatedReadableByteStreamController,e)}}Object.defineProperties(Dd.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(Dd.prototype,Af.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class xd{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Kd(this))throw Zd("byobRequest");if(null===this._byobRequest&&this._pendingPullIntos.length>0){const e=this._pendingPullIntos.peek(),t=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),r=Object.create(Dd.prototype);!function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}(r,this,t),this._byobRequest=r}return this._byobRequest}get desiredSize(){if(!Kd(this))throw Zd("desiredSize");return Vd(this)}close(){if(!Kd(this))throw Zd("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);!function(e){const t=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==t._state)return;if(e._queueTotalSize>0)return void(e._closeRequested=!0);if(e._pendingPullIntos.length>0){if(e._pendingPullIntos.peek().bytesFilled>0){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Wd(e,t),t}}Gd(e),Ip(t)}(this)}enqueue(e){if(!Kd(this))throw Zd("enqueue");if(ad(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");const t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);!function(e,t){const r=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==r._state)return;const i=t.buffer,n=t.byteOffset,a=t.byteLength,s=i;if(yd(r))if(0===pd(r))zd(e,s,n,a);else{ld(r,new Uint8Array(s,n,a),!1)}else el(r)?(zd(e,s,n,a),Od(e)):zd(e,s,n,a);Rd(e)}(this,e)}error(e=undefined){if(!Kd(this))throw Zd("error");Wd(this,e)}[Xf](e){if(this._pendingPullIntos.length>0){this._pendingPullIntos.peek().bytesFilled=0}Pd(this);const t=this._cancelAlgorithm(e);return Gd(this),t}[$f](e){const t=this._controlledReadableByteStream;if(this._queueTotalSize>0){const t=this._queue.shift();this._queueTotalSize-=t.byteLength,Nd(this);const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);return void e._chunkSteps(r)}const r=this._autoAllocateChunkSize;if(void 0!==r){let t;try{t=new ArrayBuffer(r)}catch(t){return void e._errorSteps(t)}const i={buffer:t,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}dd(t,e),Rd(this)}}function Kd(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function Ud(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function Rd(e){const t=function(e){const t=e._controlledReadableByteStream;if("readable"!==t._state)return!1;if(e._closeRequested)return!1;if(!e._started)return!1;if(yd(t)&&pd(t)>0)return!0;if(el(t)&&$d(t)>0)return!0;const r=Vd(e);if(r>0)return!0;return!1}(e);if(!t)return;if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0;Kf(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Rd(e))}),(t=>{Wd(e,t)}))}function Td(e,t){let r=!1;"closed"===e._state&&(r=!0);const i=Qd(t);"default"===t.readerType?ld(e,i,r):function(e,t,r){const i=e._reader,n=i._readIntoRequests.shift();r?n._closeSteps(t):n._chunkSteps(t)}(e,i,r)}function Qd(e){const t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function zd(e,t,r,i){e._queue.push({buffer:t,byteOffset:r,byteLength:i}),e._queueTotalSize+=i}function Fd(e,t){const r=t.elementSize,i=t.bytesFilled-t.bytesFilled%r,n=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),a=t.bytesFilled+n,s=a-a%r;let o=n,c=!1;s>i&&(o=s-t.bytesFilled,c=!0);const u=e._queue;for(;o>0;){const r=u.peek(),i=Math.min(o,r.byteLength),n=t.byteOffset+t.bytesFilled;h=t.buffer,f=n,d=r.buffer,l=r.byteOffset,p=i,new Uint8Array(h).set(new Uint8Array(d,l,p),f),r.byteLength===i?u.shift():(r.byteOffset+=i,r.byteLength-=i),e._queueTotalSize-=i,Ld(e,i,t),o-=i}var h,f,d,l,p;return c}function Ld(e,t,r){qd(e),r.bytesFilled+=t}function Nd(e){0===e._queueTotalSize&&e._closeRequested?(Gd(e),Ip(e._controlledReadableByteStream)):Rd(e)}function qd(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Od(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;const t=e._pendingPullIntos.peek();Fd(e,t)&&(jd(e),Td(e._controlledReadableByteStream,t))}}function Hd(e,t){const r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(e,t){t.buffer=t.buffer;const r=e._controlledReadableByteStream;if(el(r))for(;$d(r)>0;)Td(r,jd(e))}(e,r)}else!function(e,t,r){if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range");if(Ld(e,t,r),r.bytesFilled<r.elementSize)return;jd(e);const i=r.bytesFilled%r.elementSize;if(i>0){const t=r.byteOffset+r.bytesFilled,n=r.buffer.slice(t-i,t);zd(e,n,0,n.byteLength)}r.buffer=r.buffer,r.bytesFilled-=i,Td(e._controlledReadableByteStream,r),Od(e)}(e,t,r);Rd(e)}function jd(e){const t=e._pendingPullIntos.shift();return qd(e),t}function Gd(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Wd(e,t){const r=e._controlledReadableByteStream;"readable"===r._state&&(!function(e){qd(e),e._pendingPullIntos=new Nf}(e),Pd(e),Gd(e),Bp(r,t))}function Vd(e){const t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function Jd(e,t,r){const i=Object.create(xd.prototype);let n=()=>{},a=()=>Mf(void 0),s=()=>Mf(void 0);void 0!==t.start&&(n=()=>t.start(i)),void 0!==t.pull&&(a=()=>t.pull(i)),void 0!==t.cancel&&(s=e=>t.cancel(e));const o=t.autoAllocateChunkSize;if(0===o)throw new TypeError("autoAllocateChunkSize must be greater than 0");!function(e,t,r,i,n,a,s){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,Pd(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=a,t._pullAlgorithm=i,t._cancelAlgorithm=n,t._autoAllocateChunkSize=s,t._pendingPullIntos=new Nf,e._readableStreamController=t,Kf(Mf(r()),(()=>{t._started=!0,Rd(t)}),(e=>{Wd(t,e)}))}(e,i,n,a,s,r,o)}function Yd(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function Zd(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function Xd(e,t){e._reader._readIntoRequests.push(t)}function $d(e){return e._reader._readIntoRequests.length}function el(e){const t=e._reader;return void 0!==t&&!!rl(t)}Object.defineProperties(xd.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(xd.prototype,Af.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class tl{constructor(e){if(ad(e,1,"ReadableStreamBYOBReader"),hd(e,"First parameter"),Sp(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Kd(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");qf(this,e),this._readIntoRequests=new Nf}get closed(){return rl(this)?this._closedPromise:Df(il("closed"))}cancel(e=undefined){return rl(this)?void 0===this._ownerReadableStream?Df(jf("cancel")):Of(this,e):Df(il("cancel"))}read(e){if(!rl(this))return Df(il("read"));if(!ArrayBuffer.isView(e))return Df(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return Df(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return Df(new TypeError("view's buffer must have non-zero byteLength"));if(void 0===this._ownerReadableStream)return Df(jf("read from"));let t,r;const i=Pf(((e,i)=>{t=e,r=i}));return function(e,t,r){const i=e._ownerReadableStream;i._disturbed=!0,"errored"===i._state?r._errorSteps(i._storedError):function(e,t,r){const i=e._controlledReadableByteStream;let n=1;t.constructor!==DataView&&(n=t.constructor.BYTES_PER_ELEMENT);const a=t.constructor,s={buffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:n,viewConstructor:a,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(s),void Xd(i,r);if("closed"!==i._state){if(e._queueTotalSize>0){if(Fd(e,s)){const t=Qd(s);return Nd(e),void r._chunkSteps(t)}if(e._closeRequested){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");return Wd(e,t),void r._errorSteps(t)}}e._pendingPullIntos.push(s),Xd(i,r),Rd(e)}else{const e=new a(s.buffer,s.byteOffset,0);r._closeSteps(e)}}(i._readableStreamController,t,r)}(this,e,{_chunkSteps:e=>t({value:e,done:!1}),_closeSteps:e=>t({value:e,done:!0}),_errorSteps:e=>r(e)}),i}releaseLock(){if(!rl(this))throw il("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Hf(this)}}}function rl(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function il(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function nl(e,t){const{highWaterMark:r}=e;if(void 0===r)return t;if(Sd(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function al(e){const{size:t}=e;return t||(()=>1)}function sl(e,t){rd(e,t);const r=null==e?void 0:e.highWaterMark,i=null==e?void 0:e.size;return{highWaterMark:void 0===r?void 0:od(r),size:void 0===i?void 0:ol(i,t+" has member 'size' that")}}function ol(e,t){return id(e,t),t=>od(e(t))}function cl(e,t,r){return id(e,r),r=>Lf(e,t,[r])}function ul(e,t,r){return id(e,r),()=>Lf(e,t,[])}function hl(e,t,r){return id(e,r),r=>Ff(e,t,[r])}function fl(e,t,r){return id(e,r),(r,i)=>Lf(e,t,[r,i])}function dl(e,t){if(!gl(e))throw new TypeError(t+" is not a WritableStream.")}Object.defineProperties(tl.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(tl.prototype,Af.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});class ll{constructor(e={},t={}){void 0===e?e=null:nd(e,"First parameter");const r=sl(t,"Second parameter"),i=function(e,t){rd(e,t);const r=null==e?void 0:e.abort,i=null==e?void 0:e.close,n=null==e?void 0:e.start,a=null==e?void 0:e.type,s=null==e?void 0:e.write;return{abort:void 0===r?void 0:cl(r,e,t+" has member 'abort' that"),close:void 0===i?void 0:ul(i,e,t+" has member 'close' that"),start:void 0===n?void 0:hl(n,e,t+" has member 'start' that"),write:void 0===s?void 0:fl(s,e,t+" has member 'write' that"),type:a}}(e,"First parameter");yl(this);if(void 0!==i.type)throw new RangeError("Invalid type is specified");const n=al(r);!function(e,t,r,i){const n=Object.create(Ul.prototype);let a=()=>{},s=()=>Mf(void 0),o=()=>Mf(void 0),c=()=>Mf(void 0);void 0!==t.start&&(a=()=>t.start(n));void 0!==t.write&&(s=e=>t.write(e,n));void 0!==t.close&&(o=()=>t.close());void 0!==t.abort&&(c=e=>t.abort(e));Rl(e,n,a,s,o,c,r,i)}(this,i,nl(r,1),n)}get locked(){if(!gl(this))throw ql("locked");return bl(this)}abort(e=undefined){return gl(this)?bl(this)?Df(new TypeError("Cannot abort a stream that already has a writer")):ml(this,e):Df(ql("abort"))}close(){return gl(this)?bl(this)?Df(new TypeError("Cannot close a stream that already has a writer")):kl(this)?Df(new TypeError("Cannot close an already-closing stream")):wl(this):Df(ql("close"))}getWriter(){if(!gl(this))throw ql("getWriter");return pl(this)}}function pl(e){return new Cl(e)}function yl(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new Nf,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function gl(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function bl(e){return void 0!==e._writer}function ml(e,t){const r=e._state;if("closed"===r||"errored"===r)return Mf(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;let i=!1;"erroring"===r&&(i=!0,t=void 0);const n=Pf(((r,n)=>{e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:n,_reason:t,_wasAlreadyErroring:i}}));return e._pendingAbortRequest._promise=n,i||vl(e,t),n}function wl(e){const t=e._state;if("closed"===t||"errored"===t)return Df(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));const r=Pf(((t,r)=>{const i={_resolve:t,_reject:r};e._closeRequest=i})),i=e._writer;var n;return void 0!==i&&e._backpressure&&"writable"===t&&$l(i),Bd(n=e._writableStreamController,Kl,0),zl(n),r}function Al(e,t){"writable"!==e._state?_l(e):vl(e,t)}function vl(e,t){const r=e._writableStreamController;e._state="erroring",e._storedError=t;const i=e._writer;void 0!==i&&Ml(i,t),!function(e){if(void 0===e._inFlightWriteRequest&&void 0===e._inFlightCloseRequest)return!1;return!0}(e)&&r._started&&_l(e)}function _l(e){e._state="errored",e._writableStreamController[Zf]();const t=e._storedError;if(e._writeRequests.forEach((e=>{e._reject(t)})),e._writeRequests=new Nf,void 0===e._pendingAbortRequest)return void El(e);const r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void El(e);Kf(e._writableStreamController[Yf](r._reason),(()=>{r._resolve(),El(e)}),(t=>{r._reject(t),El(e)}))}function kl(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function El(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);const t=e._writer;void 0!==t&&Wl(t,e._storedError)}function Sl(e,t){const r=e._writer;void 0!==r&&t!==e._backpressure&&(t?function(e){Jl(e)}(r):$l(r)),e._backpressure=t}Object.defineProperties(ll.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(ll.prototype,Af.toStringTag,{value:"WritableStream",configurable:!0});class Cl{constructor(e){if(ad(e,1,"WritableStreamDefaultWriter"),dl(e,"First parameter"),bl(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;const t=e._state;if("writable"===t)!kl(e)&&e._backpressure?Jl(this):Zl(this),jl(this);else if("erroring"===t)Yl(this,e._storedError),jl(this);else if("closed"===t)Zl(this),jl(r=this),Vl(r);else{const t=e._storedError;Yl(this,t),Gl(this,t)}var r}get closed(){return Il(this)?this._closedPromise:Df(Ol("closed"))}get desiredSize(){if(!Il(this))throw Ol("desiredSize");if(void 0===this._ownerWritableStream)throw Hl("desiredSize");return function(e){const t=e._ownerWritableStream,r=t._state;if("errored"===r||"erroring"===r)return null;if("closed"===r)return 0;return Ql(t._writableStreamController)}(this)}get ready(){return Il(this)?this._readyPromise:Df(Ol("ready"))}abort(e=undefined){return Il(this)?void 0===this._ownerWritableStream?Df(Hl("abort")):function(e,t){const r=e._ownerWritableStream;return ml(r,t)}(this,e):Df(Ol("abort"))}close(){if(!Il(this))return Df(Ol("close"));const e=this._ownerWritableStream;return void 0===e?Df(Hl("close")):kl(e)?Df(new TypeError("Cannot close an already-closing stream")):Bl(this)}releaseLock(){if(!Il(this))throw Ol("releaseLock");void 0!==this._ownerWritableStream&&Dl(this)}write(e=undefined){return Il(this)?void 0===this._ownerWritableStream?Df(Hl("write to")):xl(this,e):Df(Ol("write"))}}function Il(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function Bl(e){return wl(e._ownerWritableStream)}function Pl(e,t){"pending"===e._closedPromiseState?Wl(e,t):function(e,t){Gl(e,t)}(e,t)}function Ml(e,t){"pending"===e._readyPromiseState?Xl(e,t):function(e,t){Yl(e,t)}(e,t)}function Dl(e){const t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Ml(e,r),Pl(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function xl(e,t){const r=e._ownerWritableStream,i=r._writableStreamController,n=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return Fl(e,t),1}}(i,t);if(r!==e._ownerWritableStream)return Df(Hl("write to"));const a=r._state;if("errored"===a)return Df(r._storedError);if(kl(r)||"closed"===a)return Df(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===a)return Df(r._storedError);const s=function(e){return Pf(((t,r)=>{const i={_resolve:t,_reject:r};e._writeRequests.push(i)}))}(r);return function(e,t,r){try{Bd(e,t,r)}catch(t){return void Fl(e,t)}const i=e._controlledWritableStream;if(!kl(i)&&"writable"===i._state){Sl(i,Ll(e))}zl(e)}(i,t,n),s}Object.defineProperties(Cl.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(Cl.prototype,Af.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const Kl={};class Ul{constructor(){throw new TypeError("Illegal constructor")}error(e=undefined){if(!function(e){if(!kf(e))return!1;if(!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream"))return!1;return!0}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&Nl(this,e)}[Yf](e){const t=this._abortAlgorithm(e);return Tl(this),t}[Zf](){Pd(this)}}function Rl(e,t,r,i,n,a,s,o){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,Pd(t),t._started=!1,t._strategySizeAlgorithm=o,t._strategyHWM=s,t._writeAlgorithm=i,t._closeAlgorithm=n,t._abortAlgorithm=a;const c=Ll(t);Sl(e,c);Kf(Mf(r()),(()=>{t._started=!0,zl(t)}),(r=>{t._started=!0,Al(e,r)}))}function Tl(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Ql(e){return e._strategyHWM-e._queueTotalSize}function zl(e){const t=e._controlledWritableStream;if(!e._started)return;if(void 0!==t._inFlightWriteRequest)return;if("erroring"===t._state)return void _l(t);if(0===e._queue.length)return;const r=e._queue.peek().value;r===Kl?function(e){const t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),Id(e);const r=e._closeAlgorithm();Tl(e),Kf(r,(()=>{!function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";const t=e._writer;void 0!==t&&Vl(t)}(t)}),(e=>{!function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),Al(e,t)}(t,e)}))}(e):function(e,t){const r=e._controlledWritableStream;!function(e){e._inFlightWriteRequest=e._writeRequests.shift()}(r);const i=e._writeAlgorithm(t);Kf(i,(()=>{!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);const t=r._state;if(Id(e),!kl(r)&&"writable"===t){const t=Ll(e);Sl(r,t)}zl(e)}),(t=>{"writable"===r._state&&Tl(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,Al(e,t)}(r,t)}))}(e,r)}function Fl(e,t){"writable"===e._controlledWritableStream._state&&Nl(e,t)}function Ll(e){return Ql(e)<=0}function Nl(e,t){const r=e._controlledWritableStream;Tl(e),vl(r,t)}function ql(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function Ol(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function Hl(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function jl(e){e._closedPromise=Pf(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function Gl(e,t){jl(e),Wl(e,t)}function Wl(e,t){void 0!==e._closedPromise_reject&&(Qf(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function Vl(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function Jl(e){e._readyPromise=Pf(((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function Yl(e,t){Jl(e),Xl(e,t)}function Zl(e){Jl(e),$l(e)}function Xl(e,t){void 0!==e._readyPromise_reject&&(Qf(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function $l(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(Ul.prototype,{error:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(Ul.prototype,Af.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const ep="undefined"!=typeof DOMException?DOMException:void 0;const tp=function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}(ep)?ep:function(){const e=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return Object.defineProperty(e.prototype=Object.create(Error.prototype),"constructor",{value:e,writable:!0,configurable:!0}),e}();function rp(e,t,r,i,n,a){const s=fd(e),o=pl(t);e._disturbed=!0;let c=!1,u=Mf(void 0);return Pf(((h,f)=>{let d;if(void 0!==a){if(d=()=>{const r=new tp("Aborted","AbortError"),a=[];i||a.push((()=>"writable"===t._state?ml(t,r):Mf(void 0))),n||a.push((()=>"readable"===e._state?Cp(e,r):Mf(void 0))),y((()=>Promise.all(a.map((e=>e())))),!0,r)},a.aborted)return void d();a.addEventListener("abort",d)}if(p(e,s._closedPromise,(e=>{i?g(!0,e):y((()=>ml(t,e)),!0,e)})),p(t,o._closedPromise,(t=>{n?g(!0,t):y((()=>Cp(e,t)),!0,t)})),function(e,t,r){"closed"===e._state?r():Uf(t,r)}(e,s._closedPromise,(()=>{r?g():y((()=>function(e){const t=e._ownerWritableStream,r=t._state;return kl(t)||"closed"===r?Mf(void 0):"errored"===r?Df(t._storedError):Bl(e)}(o)))})),kl(t)||"closed"===t._state){const t=new TypeError("the destination writable stream closed before all data could be piped to it");n?g(!0,t):y((()=>Cp(e,t)),!0,t)}function l(){const e=u;return xf(u,(()=>e!==u?l():void 0))}function p(e,t,r){"errored"===e._state?r(e._storedError):Rf(t,r)}function y(e,r,i){function n(){Kf(e(),(()=>b(r,i)),(e=>b(!0,e)))}c||(c=!0,"writable"!==t._state||kl(t)?n():Uf(l(),n))}function g(e,r){c||(c=!0,"writable"!==t._state||kl(t)?b(e,r):Uf(l(),(()=>b(e,r))))}function b(e,t){Dl(o),Hf(s),void 0!==a&&a.removeEventListener("abort",d),e?f(t):h(void 0)}Qf(Pf(((e,t)=>{!function r(i){i?e():xf(c?Mf(!0):xf(o._readyPromise,(()=>Pf(((e,t)=>{md(s,{_chunkSteps:t=>{u=xf(xl(o,t),void 0,vf),e(!1)},_closeSteps:()=>e(!0),_errorSteps:t})})))),r,t)}(!1)})))}))}class ip{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!np(this))throw pp("desiredSize");return fp(this)}close(){if(!np(this))throw pp("close");if(!dp(this))throw new TypeError("The stream is not in a state that permits close");cp(this)}enqueue(e=undefined){if(!np(this))throw pp("enqueue");if(!dp(this))throw new TypeError("The stream is not in a state that permits enqueue");return up(this,e)}error(e=undefined){if(!np(this))throw pp("error");hp(this,e)}[Xf](e){Pd(this);const t=this._cancelAlgorithm(e);return op(this),t}[$f](e){const t=this._controlledReadableStream;if(this._queue.length>0){const r=Id(this);this._closeRequested&&0===this._queue.length?(op(this),Ip(t)):ap(this),e._chunkSteps(r)}else dd(t,e),ap(this)}}function np(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function ap(e){if(!sp(e))return;if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0;Kf(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,ap(e))}),(t=>{hp(e,t)}))}function sp(e){const t=e._controlledReadableStream;if(!dp(e))return!1;if(!e._started)return!1;if(Sp(t)&&pd(t)>0)return!0;return fp(e)>0}function op(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function cp(e){if(!dp(e))return;const t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(op(e),Ip(t))}function up(e,t){if(!dp(e))return;const r=e._controlledReadableStream;if(Sp(r)&&pd(r)>0)ld(r,t,!1);else{let r;try{r=e._strategySizeAlgorithm(t)}catch(t){throw hp(e,t),t}try{Bd(e,t,r)}catch(t){throw hp(e,t),t}}ap(e)}function hp(e,t){const r=e._controlledReadableStream;"readable"===r._state&&(Pd(e),op(e),Bp(r,t))}function fp(e){const t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function dp(e){const t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function lp(e,t,r,i,n,a,s){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,Pd(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=s,t._strategyHWM=a,t._pullAlgorithm=i,t._cancelAlgorithm=n,e._readableStreamController=t;Kf(Mf(r()),(()=>{t._started=!0,ap(t)}),(e=>{hp(t,e)}))}function pp(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function yp(e,t,r){return id(e,r),r=>Lf(e,t,[r])}function gp(e,t,r){return id(e,r),r=>Lf(e,t,[r])}function bp(e,t,r){return id(e,r),r=>Ff(e,t,[r])}function mp(e,t){if("bytes"!==(e=""+e))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function wp(e,t){if("byob"!==(e=""+e))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Ap(e,t){rd(e,t);const r=null==e?void 0:e.preventAbort,i=null==e?void 0:e.preventCancel,n=null==e?void 0:e.preventClose,a=null==e?void 0:e.signal;return void 0!==a&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw new TypeError(t+" is not an AbortSignal.")}(a,t+" has member 'signal' that"),{preventAbort:!!r,preventCancel:!!i,preventClose:!!n,signal:a}}Object.defineProperties(ip.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(ip.prototype,Af.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class vp{constructor(e={},t={}){void 0===e?e=null:nd(e,"First parameter");const r=sl(t,"Second parameter"),i=function(e,t){rd(e,t);const r=e,i=null==r?void 0:r.autoAllocateChunkSize,n=null==r?void 0:r.cancel,a=null==r?void 0:r.pull,s=null==r?void 0:r.start,o=null==r?void 0:r.type;return{autoAllocateChunkSize:void 0===i?void 0:ud(i,t+" has member 'autoAllocateChunkSize' that"),cancel:void 0===n?void 0:yp(n,r,t+" has member 'cancel' that"),pull:void 0===a?void 0:gp(a,r,t+" has member 'pull' that"),start:void 0===s?void 0:bp(s,r,t+" has member 'start' that"),type:void 0===o?void 0:mp(o,t+" has member 'type' that")}}(e,"First parameter");if(kp(this),"bytes"===i.type){if(void 0!==r.size)throw new RangeError("The strategy for a byte stream cannot have a size function");Jd(this,i,nl(r,0))}else{const e=al(r);!function(e,t,r,i){const n=Object.create(ip.prototype);let a=()=>{},s=()=>Mf(void 0),o=()=>Mf(void 0);void 0!==t.start&&(a=()=>t.start(n)),void 0!==t.pull&&(s=()=>t.pull(n)),void 0!==t.cancel&&(o=e=>t.cancel(e)),lp(e,n,a,s,o,r,i)}(this,i,nl(r,1),e)}}get locked(){if(!Ep(this))throw Pp("locked");return Sp(this)}cancel(e=undefined){return Ep(this)?Sp(this)?Df(new TypeError("Cannot cancel a stream that already has a reader")):Cp(this,e):Df(Pp("cancel"))}getReader(e=undefined){if(!Ep(this))throw Pp("getReader");const t=function(e,t){rd(e,t);const r=null==e?void 0:e.mode;return{mode:void 0===r?void 0:wp(r,t+" has member 'mode' that")}}(e,"First parameter");return void 0===t.mode?fd(this):function(e){return new tl(e)}(this)}pipeThrough(e,t={}){if(!Ep(this))throw Pp("pipeThrough");ad(e,1,"pipeThrough");const r=function(e,t){rd(e,t);const r=null==e?void 0:e.readable;sd(r,"readable","ReadableWritablePair"),hd(r,t+" has member 'readable' that");const i=null==e?void 0:e.writable;return sd(i,"writable","ReadableWritablePair"),dl(i,t+" has member 'writable' that"),{readable:r,writable:i}}(e,"First parameter"),i=Ap(t,"Second parameter");if(Sp(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(bl(r.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Qf(rp(this,r.writable,i.preventClose,i.preventAbort,i.preventCancel,i.signal)),r.readable}pipeTo(e,t={}){if(!Ep(this))return Df(Pp("pipeTo"));if(void 0===e)return Df("Parameter 1 is required in 'pipeTo'.");if(!gl(e))return Df(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let r;try{r=Ap(t,"Second parameter")}catch(e){return Df(e)}return Sp(this)?Df(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):bl(e)?Df(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):rp(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!Ep(this))throw Pp("tee");const e=function(e,t){const r=fd(e);let i,n,a,s,o,c=!1,u=!1,h=!1;const f=Pf((e=>{o=e}));function d(){return c||(c=!0,md(r,{_chunkSteps:e=>{zf((()=>{c=!1;const t=e,r=e;u||up(a._readableStreamController,t),h||up(s._readableStreamController,r)}))},_closeSteps:()=>{c=!1,u||cp(a._readableStreamController),h||cp(s._readableStreamController),u&&h||o(void 0)},_errorSteps:()=>{c=!1}})),Mf(void 0)}function l(){}return a=_p(l,d,(function(t){if(u=!0,i=t,h){const t=Md([i,n]),r=Cp(e,t);o(r)}return f})),s=_p(l,d,(function(t){if(h=!0,n=t,u){const t=Md([i,n]),r=Cp(e,t);o(r)}return f})),Rf(r._closedPromise,(e=>{hp(a._readableStreamController,e),hp(s._readableStreamController,e),u&&h||o(void 0)})),[a,s]}(this);return Md(e)}values(e=undefined){if(!Ep(this))throw Pp("values");return function(e,t){const r=fd(e),i=new vd(r,t),n=Object.create(_d);return n._asyncIteratorImpl=i,n}(this,function(e,t){return rd(e,t),{preventCancel:!!(null==e?void 0:e.preventCancel)}}(e,"First parameter").preventCancel)}}function _p(e,t,r,i=1,n=(()=>1)){const a=Object.create(vp.prototype);kp(a);return lp(a,Object.create(ip.prototype),e,t,r,i,n),a}function kp(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function Ep(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function Sp(e){return void 0!==e._reader}function Cp(e,t){if(e._disturbed=!0,"closed"===e._state)return Mf(void 0);if("errored"===e._state)return Df(e._storedError);Ip(e);return Tf(e._readableStreamController[Xf](t),vf)}function Ip(e){e._state="closed";const t=e._reader;void 0!==t&&(Jf(t),bd(t)&&(t._readRequests.forEach((e=>{e._closeSteps()})),t._readRequests=new Nf))}function Bp(e,t){e._state="errored",e._storedError=t;const r=e._reader;void 0!==r&&(Vf(r,t),bd(r)?(r._readRequests.forEach((e=>{e._errorSteps(t)})),r._readRequests=new Nf):(r._readIntoRequests.forEach((e=>{e._errorSteps(t)})),r._readIntoRequests=new Nf))}function Pp(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function Mp(e,t){rd(e,t);const r=null==e?void 0:e.highWaterMark;return sd(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:od(r)}}Object.defineProperties(vp.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(vp.prototype,Af.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof Af.asyncIterator&&Object.defineProperty(vp.prototype,Af.asyncIterator,{value:vp.prototype.values,writable:!0,configurable:!0});const Dp=function(e){return e.byteLength};class xp{constructor(e){ad(e,1,"ByteLengthQueuingStrategy"),e=Mp(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Up(this))throw Kp("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Up(this))throw Kp("size");return Dp}}function Kp(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Up(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")}Object.defineProperties(xp.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(xp.prototype,Af.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});const Rp=function(){return 1};class Tp{constructor(e){ad(e,1,"CountQueuingStrategy"),e=Mp(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!zp(this))throw Qp("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!zp(this))throw Qp("size");return Rp}}function Qp(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function zp(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")}function Fp(e,t,r){return id(e,r),r=>Lf(e,t,[r])}function Lp(e,t,r){return id(e,r),r=>Ff(e,t,[r])}function Np(e,t,r){return id(e,r),(r,i)=>Lf(e,t,[r,i])}Object.defineProperties(Tp.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(Tp.prototype,Af.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class qp{constructor(e={},t={},r={}){void 0===e&&(e=null);const i=sl(t,"Second parameter"),n=sl(r,"Third parameter"),a=function(e,t){rd(e,t);const r=null==e?void 0:e.flush,i=null==e?void 0:e.readableType,n=null==e?void 0:e.start,a=null==e?void 0:e.transform,s=null==e?void 0:e.writableType;return{flush:void 0===r?void 0:Fp(r,e,t+" has member 'flush' that"),readableType:i,start:void 0===n?void 0:Lp(n,e,t+" has member 'start' that"),transform:void 0===a?void 0:Np(a,e,t+" has member 'transform' that"),writableType:s}}(e,"First parameter");if(void 0!==a.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==a.writableType)throw new RangeError("Invalid writableType specified");const s=nl(n,0),o=al(n),c=nl(i,1),u=al(i);let h;!function(e,t,r,i,n,a){function s(){return t}function o(t){return function(e,t){const r=e._transformStreamController;if(e._backpressure){return Tf(e._backpressureChangePromise,(()=>{const i=e._writable;if("erroring"===i._state)throw i._storedError;return Zp(r,t)}))}return Zp(r,t)}(e,t)}function c(t){return function(e,t){return Hp(e,t),Mf(void 0)}(e,t)}function u(){return function(e){const t=e._readable,r=e._transformStreamController,i=r._flushAlgorithm();return Jp(r),Tf(i,(()=>{if("errored"===t._state)throw t._storedError;cp(t._readableStreamController)}),(r=>{throw Hp(e,r),t._storedError}))}(e)}function h(){return function(e){return Gp(e,!1),e._backpressureChangePromise}(e)}function f(t){return jp(e,t),Mf(void 0)}e._writable=function(e,t,r,i,n=1,a=(()=>1)){const s=Object.create(ll.prototype);return yl(s),Rl(s,Object.create(Ul.prototype),e,t,r,i,n,a),s}(s,o,u,c,r,i),e._readable=_p(s,h,f,n,a),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,Gp(e,!0),e._transformStreamController=void 0}(this,Pf((e=>{h=e})),c,u,s,o),function(e,t){const r=Object.create(Wp.prototype);let i=e=>{try{return Yp(r,e),Mf(void 0)}catch(e){return Df(e)}},n=()=>Mf(void 0);void 0!==t.transform&&(i=e=>t.transform(e,r));void 0!==t.flush&&(n=()=>t.flush(r));!function(e,t,r,i){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=i}(e,r,i,n)}(this,a),void 0!==a.start?h(a.start(this._transformStreamController)):h(void 0)}get readable(){if(!Op(this))throw $p("readable");return this._readable}get writable(){if(!Op(this))throw $p("writable");return this._writable}}function Op(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function Hp(e,t){hp(e._readable._readableStreamController,t),jp(e,t)}function jp(e,t){Jp(e._transformStreamController),Fl(e._writable._writableStreamController,t),e._backpressure&&Gp(e,!1)}function Gp(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=Pf((t=>{e._backpressureChangePromise_resolve=t})),e._backpressure=t}Object.defineProperties(qp.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(qp.prototype,Af.toStringTag,{value:"TransformStream",configurable:!0});class Wp{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Vp(this))throw Xp("desiredSize");return fp(this._controlledTransformStream._readable._readableStreamController)}enqueue(e=undefined){if(!Vp(this))throw Xp("enqueue");Yp(this,e)}error(e=undefined){if(!Vp(this))throw Xp("error");var t;t=e,Hp(this._controlledTransformStream,t)}terminate(){if(!Vp(this))throw Xp("terminate");!function(e){const t=e._controlledTransformStream,r=t._readable._readableStreamController;cp(r);jp(t,new TypeError("TransformStream terminated"))}(this)}}function Vp(e){return!!kf(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function Jp(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Yp(e,t){const r=e._controlledTransformStream,i=r._readable._readableStreamController;if(!dp(i))throw new TypeError("Readable side is not in a state that permits enqueue");try{up(i,t)}catch(e){throw jp(r,e),r._readable._storedError}const n=function(e){return!sp(e)}(i);n!==r._backpressure&&Gp(r,!0)}function Zp(e,t){return Tf(e._transformAlgorithm(t),void 0,(t=>{throw Hp(e._controlledTransformStream,t),t}))}function Xp(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function $p(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(Wp.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Af.toStringTag&&Object.defineProperty(Wp.prototype,Af.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var ey=/*#__PURE__*/Object.freeze({__proto__:null,ByteLengthQueuingStrategy:xp,CountQueuingStrategy:Tp,ReadableByteStreamController:xd,ReadableStream:vp,ReadableStreamBYOBReader:tl,ReadableStreamBYOBRequest:Dd,ReadableStreamDefaultController:ip,ReadableStreamDefaultReader:gd,TransformStream:qp,TransformStreamDefaultController:Wp,WritableStream:ll,WritableStreamDefaultController:Ul,WritableStreamDefaultWriter:Cl}),ty=function(e,t){return ty=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},ty(e,t)};
|
|
3
3
|
/*! *****************************************************************************
|
|
4
4
|
Copyright (c) Microsoft Corporation.
|
|
5
5
|
|
|
@@ -13,5 +13,5 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
13
13
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
14
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
15
|
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
***************************************************************************** */function ry(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+t+" is not a constructor or null");function r(){this.constructor=e}ty(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function iy(e){if(!e)throw new TypeError("Assertion failed")}function ny(){}function ay(e){return"object"==typeof e&&null!==e||"function"==typeof e}function sy(e){if("function"!=typeof e)return!1;var t=!1;try{new e({start:function(){t=!0}})}catch(e){}return t}function oy(e){return!!ay(e)&&"function"==typeof e.getReader}function cy(e){return!!ay(e)&&"function"==typeof e.getWriter}function uy(e){return!!ay(e)&&(!!oy(e.readable)&&!!cy(e.writable))}function hy(e){try{return e.getReader({mode:"byob"}).releaseLock(),!0}catch(e){return!1}}function fy(e,t){var r=(void 0===t?{}:t).type;return iy(oy(e)),iy(!1===e.locked),"bytes"===(r=dy(r))?new gy(e):new py(e)}function dy(e){var t=e+"";if("bytes"===t)return t;if(void 0===e)return e;throw new RangeError("Invalid type is specified")}var ly=function(){function e(e){this._underlyingReader=void 0,this._readerMode=void 0,this._readableStreamController=void 0,this._pendingRead=void 0,this._underlyingStream=e,this._attachDefaultReader()}return e.prototype.start=function(e){this._readableStreamController=e},e.prototype.cancel=function(e){return iy(void 0!==this._underlyingReader),this._underlyingReader.cancel(e)},e.prototype._attachDefaultReader=function(){if("default"!==this._readerMode){this._detachReader();var e=this._underlyingStream.getReader();this._readerMode="default",this._attachReader(e)}},e.prototype._attachReader=function(e){var t=this;iy(void 0===this._underlyingReader),this._underlyingReader=e;var r=this._underlyingReader.closed;r&&r.then((function(){return t._finishPendingRead()})).then((function(){e===t._underlyingReader&&t._readableStreamController.close()}),(function(r){e===t._underlyingReader&&t._readableStreamController.error(r)})).catch(ny)},e.prototype._detachReader=function(){void 0!==this._underlyingReader&&(this._underlyingReader.releaseLock(),this._underlyingReader=void 0,this._readerMode=void 0)},e.prototype._pullWithDefaultReader=function(){var e=this;this._attachDefaultReader();var t=this._underlyingReader.read().then((function(t){var r=e._readableStreamController;t.done?e._tryClose():r.enqueue(t.value)}));return this._setPendingRead(t),t},e.prototype._tryClose=function(){try{this._readableStreamController.close()}catch(e){}},e.prototype._setPendingRead=function(e){var t,r=this,i=function(){r._pendingRead===t&&(r._pendingRead=void 0)};this._pendingRead=t=e.then(i,i)},e.prototype._finishPendingRead=function(){var e=this;if(this._pendingRead){var t=function(){return e._finishPendingRead()};return this._pendingRead.then(t,t)}},e}(),py=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ry(t,e),t.prototype.pull=function(){return this._pullWithDefaultReader()},t}(ly);function yy(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var gy=function(e){function t(t){var r=this,i=hy(t);return(r=e.call(this,t)||this)._supportsByob=i,r}return ry(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return"bytes"},enumerable:!1,configurable:!0}),t.prototype._attachByobReader=function(){if("byob"!==this._readerMode){iy(this._supportsByob),this._detachReader();var e=this._underlyingStream.getReader({mode:"byob"});this._readerMode="byob",this._attachReader(e)}},t.prototype.pull=function(){if(this._supportsByob){var e=this._readableStreamController.byobRequest;if(e)return this._pullWithByobRequest(e)}return this._pullWithDefaultReader()},t.prototype._pullWithByobRequest=function(e){var t=this;this._attachByobReader();var r=new Uint8Array(e.view.byteLength),i=this._underlyingReader.read(r).then((function(r){var i,n,a;t._readableStreamController,r.done?(t._tryClose(),e.respond(0)):(i=r.value,n=e.view,a=yy(i),yy(n).set(a,0),e.respond(r.value.byteLength))}));return this._setPendingRead(i),i},t}(ly);function by(e){iy(cy(e)),iy(!1===e.locked);var t=e.getWriter();return new my(t)}var my=function(){function e(e){var t=this;this._writableStreamController=void 0,this._pendingWrite=void 0,this._state="writable",this._storedError=void 0,this._underlyingWriter=e,this._errorPromise=new Promise((function(e,r){t._errorPromiseReject=r})),this._errorPromise.catch(ny)}return e.prototype.start=function(e){var t=this;this._writableStreamController=e,this._underlyingWriter.closed.then((function(){t._state="closed"})).catch((function(e){return t._finishErroring(e)}))},e.prototype.write=function(e){var t=this,r=this._underlyingWriter;if(null===r.desiredSize)return r.ready;var i=r.write(e);i.catch((function(e){return t._finishErroring(e)})),r.ready.catch((function(e){return t._startErroring(e)}));var n=Promise.race([i,this._errorPromise]);return this._setPendingWrite(n),n},e.prototype.close=function(){var e=this;return void 0===this._pendingWrite?this._underlyingWriter.close():this._finishPendingWrite().then((function(){return e.close()}))},e.prototype.abort=function(e){if("errored"!==this._state)return this._underlyingWriter.abort(e)},e.prototype._setPendingWrite=function(e){var t,r=this,i=function(){r._pendingWrite===t&&(r._pendingWrite=void 0)};this._pendingWrite=t=e.then(i,i)},e.prototype._finishPendingWrite=function(){var e=this;if(void 0===this._pendingWrite)return Promise.resolve();var t=function(){return e._finishPendingWrite()};return this._pendingWrite.then(t,t)},e.prototype._startErroring=function(e){var t=this;if("writable"===this._state){this._state="erroring",this._storedError=e;var r=function(){return t._finishErroring(e)};void 0===this._pendingWrite?r():this._finishPendingWrite().then(r,r),this._writableStreamController.error(e)}},e.prototype._finishErroring=function(e){"writable"===this._state&&this._startErroring(e),"erroring"===this._state&&(this._state="errored",this._errorPromiseReject(this._storedError))},e}();function wy(e){iy(uy(e));var t=e.readable,r=e.writable;iy(!1===t.locked),iy(!1===r.locked);var i,n=t.getReader();try{i=r.getWriter()}catch(e){throw n.releaseLock(),e}return new Ay(n,i)}var Ay=function(){function e(e,t){var r=this;this._transformStreamController=void 0,this._onRead=function(e){if(!e.done)return r._transformStreamController.enqueue(e.value),r._reader.read().then(r._onRead)},this._onError=function(e){r._flushReject(e),r._transformStreamController.error(e),r._reader.cancel(e).catch(ny),r._writer.abort(e).catch(ny)},this._onTerminate=function(){r._flushResolve(),r._transformStreamController.terminate();var e=new TypeError("TransformStream terminated");r._writer.abort(e).catch(ny)},this._reader=e,this._writer=t,this._flushPromise=new Promise((function(e,t){r._flushResolve=e,r._flushReject=t}))}return e.prototype.start=function(e){this._transformStreamController=e,this._reader.read().then(this._onRead).then(this._onTerminate,this._onError);var t=this._reader.closed;t&&t.then(this._onTerminate,this._onError)},e.prototype.transform=function(e){return this._writer.write(e)},e.prototype.flush=function(){var e=this;return this._writer.close().then((function(){return e._flushPromise}))},e}(),vy=/*#__PURE__*/Object.freeze({__proto__:null,createReadableStreamWrapper:function(e){iy(function(e){return!!sy(e)&&!!oy(new e)}(e));var t=function(e){try{return new e({type:"bytes"}),!0}catch(e){return!1}}(e);return function(r,i){var n=(void 0===i?{}:i).type;if("bytes"!==(n=dy(n))||t||(n=void 0),r.constructor===e&&("bytes"!==n||hy(r)))return r;if("bytes"===n){var a=fy(r,{type:n});return new e(a)}a=fy(r);return new e(a)}},createTransformStreamWrapper:function(e){return iy(function(e){return!!sy(e)&&!!uy(new e)}(e)),function(t){if(t.constructor===e)return t;var r=wy(t);return new e(r)}},createWrappingReadableSource:fy,createWrappingTransformer:wy,createWrappingWritableSink:by,createWritableStreamWrapper:function(e){return iy(function(e){return!!sy(e)&&!!cy(new e)}(e)),function(t){if(t.constructor===e)return t;var r=by(t);return new e(r)}}}),_y=it((function(e){!function(e,t){function r(e,t){if(!e)throw Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{a=void 0}catch(e){}function s(e,t,r){for(var i=0,n=Math.min(e.length,r),a=t;a<n;a++){var s=e.charCodeAt(a)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function o(e,t,r,i){for(var n=0,a=Math.min(e.length,r),s=t;s<a;s++){var o=e.charCodeAt(s)-48;n*=i,n+=o>=49?o-49+10:o>=17?o-17+10:o}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&n++,16===t?this._parseHex(e,n):this._parseBase(e,t,n),"-"===e[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,s,o=0;if("be"===i)for(n=e.length-1,a=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===i)for(n=0,a=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},n.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,a=0;for(r=e.length-6,i=0;r>=t;r-=6)n=s(e,r,r+6),this.words[i]|=n<<a&67108863,this.words[i+1]|=n>>>26-a&4194303,(a+=24)>=26&&(a-=26,i++);r+6!==t&&(n=s(e,t,r+6),this.words[i]|=n<<a&67108863,this.words[i+1]|=n>>>26-a&4194303),this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,s=a%i,c=Math.min(a,a-s)+r,u=0,h=r;h<c;h+=i)u=o(e,h,h+i,t),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=o(e,h,e.length,t),h=0;h<s;h++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},n.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],a=0|t.words[0],s=n*a,o=67108863&s,c=s/67108864|0;r.words[0]=o;for(var u=1;u<i;u++){for(var h=c>>>26,f=67108863&c,d=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=d;l++){var p=u-l|0;h+=(s=(n=0|e.words[p])*(a=0|t.words[l])+f)/67108864|0,f=67108863&s}r.words[u]=0|f,c=0|h}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,a=0,s=0;s<this.length;s++){var o=this.words[s],f=(16777215&(o<<n|a)).toString(16);i=0!==(a=o>>>24-n&16777215)||s!==this.length-1?c[6-f.length]+f+i:f+i,(n+=2)>=26&&(n-=26,s--)}for(0!==a&&(i=a.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],l=h[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(l).toString(e);i=(p=p.idivn(l)).isZero()?y+i:c[d-y.length]+y+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),a=i||Math.max(1,n);r(n<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var s,o,c="le"===t,u=new e(a),h=this.clone();if(c){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),u[o]=s;for(;o<a;o++)u[o]=0}else{for(o=0;o<a-n;o++)u[o]=0;for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),u[a-o-1]=s}return u},n.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,a=0;a<i.length;a++)t=(0|r.words[a])+(0|i.words[a])+n,this.words[a]=67108863&t,n=t>>>26;for(;0!==n&&a<r.length;a++)t=(0|r.words[a])+n,this.words[a]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var a=0,s=0;s<i.length;s++)a=(t=(0|r.words[s])-(0|i.words[s])+a)>>26,this.words[s]=67108863&t;for(;0!==a&&s<r.length;s++)a=(t=(0|r.words[s])+a)>>26,this.words[s]=67108863&t;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,a,s=e.words,o=t.words,c=r.words,u=0,h=0|s[0],f=8191&h,d=h>>>13,l=0|s[1],p=8191&l,y=l>>>13,g=0|s[2],b=8191&g,m=g>>>13,w=0|s[3],A=8191&w,v=w>>>13,_=0|s[4],k=8191&_,E=_>>>13,S=0|s[5],C=8191&S,I=S>>>13,B=0|s[6],P=8191&B,M=B>>>13,D=0|s[7],x=8191&D,K=D>>>13,U=0|s[8],R=8191&U,T=U>>>13,Q=0|s[9],z=8191&Q,F=Q>>>13,L=0|o[0],N=8191&L,q=L>>>13,O=0|o[1],H=8191&O,j=O>>>13,G=0|o[2],W=8191&G,V=G>>>13,J=0|o[3],Y=8191&J,Z=J>>>13,X=0|o[4],$=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ie=te>>>13,ne=0|o[6],ae=8191&ne,se=ne>>>13,oe=0|o[7],ce=8191&oe,ue=oe>>>13,he=0|o[8],fe=8191&he,de=he>>>13,le=0|o[9],pe=8191&le,ye=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(f,N))|0)+((8191&(n=(n=Math.imul(f,q))+Math.imul(d,N)|0))<<13)|0;u=((a=Math.imul(d,q))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,N),n=(n=Math.imul(p,q))+Math.imul(y,N)|0,a=Math.imul(y,q);var be=(u+(i=i+Math.imul(f,H)|0)|0)+((8191&(n=(n=n+Math.imul(f,j)|0)+Math.imul(d,H)|0))<<13)|0;u=((a=a+Math.imul(d,j)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,N),n=(n=Math.imul(b,q))+Math.imul(m,N)|0,a=Math.imul(m,q),i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,j)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,j)|0;var me=(u+(i=i+Math.imul(f,W)|0)|0)+((8191&(n=(n=n+Math.imul(f,V)|0)+Math.imul(d,W)|0))<<13)|0;u=((a=a+Math.imul(d,V)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(A,N),n=(n=Math.imul(A,q))+Math.imul(v,N)|0,a=Math.imul(v,q),i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,j)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,j)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,V)|0;var we=(u+(i=i+Math.imul(f,Y)|0)|0)+((8191&(n=(n=n+Math.imul(f,Z)|0)+Math.imul(d,Y)|0))<<13)|0;u=((a=a+Math.imul(d,Z)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(k,N),n=(n=Math.imul(k,q))+Math.imul(E,N)|0,a=Math.imul(E,q),i=i+Math.imul(A,H)|0,n=(n=n+Math.imul(A,j)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,j)|0,i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,V)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(y,Y)|0,a=a+Math.imul(y,Z)|0;var Ae=(u+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;u=((a=a+Math.imul(d,ee)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(C,N),n=(n=Math.imul(C,q))+Math.imul(I,N)|0,a=Math.imul(I,q),i=i+Math.imul(k,H)|0,n=(n=n+Math.imul(k,j)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,j)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(v,W)|0,a=a+Math.imul(v,V)|0,i=i+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,Z)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,ee)|0;var ve=(u+(i=i+Math.imul(f,re)|0)|0)+((8191&(n=(n=n+Math.imul(f,ie)|0)+Math.imul(d,re)|0))<<13)|0;u=((a=a+Math.imul(d,ie)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(P,N),n=(n=Math.imul(P,q))+Math.imul(M,N)|0,a=Math.imul(M,q),i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,j)|0)+Math.imul(I,H)|0,a=a+Math.imul(I,j)|0,i=i+Math.imul(k,W)|0,n=(n=n+Math.imul(k,V)|0)+Math.imul(E,W)|0,a=a+Math.imul(E,V)|0,i=i+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(v,Y)|0,a=a+Math.imul(v,Z)|0,i=i+Math.imul(b,$)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ie)|0;var _e=(u+(i=i+Math.imul(f,ae)|0)|0)+((8191&(n=(n=n+Math.imul(f,se)|0)+Math.imul(d,ae)|0))<<13)|0;u=((a=a+Math.imul(d,se)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(x,N),n=(n=Math.imul(x,q))+Math.imul(K,N)|0,a=Math.imul(K,q),i=i+Math.imul(P,H)|0,n=(n=n+Math.imul(P,j)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,j)|0,i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(I,W)|0,a=a+Math.imul(I,V)|0,i=i+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(E,Y)|0,a=a+Math.imul(E,Z)|0,i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,ee)|0,i=i+Math.imul(b,re)|0,n=(n=n+Math.imul(b,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0,i=i+Math.imul(p,ae)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,se)|0;var ke=(u+(i=i+Math.imul(f,ce)|0)|0)+((8191&(n=(n=n+Math.imul(f,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((a=a+Math.imul(d,ue)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(R,N),n=(n=Math.imul(R,q))+Math.imul(T,N)|0,a=Math.imul(T,q),i=i+Math.imul(x,H)|0,n=(n=n+Math.imul(x,j)|0)+Math.imul(K,H)|0,a=a+Math.imul(K,j)|0,i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(M,W)|0,a=a+Math.imul(M,V)|0,i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(I,Y)|0,a=a+Math.imul(I,Z)|0,i=i+Math.imul(k,$)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(v,re)|0,a=a+Math.imul(v,ie)|0,i=i+Math.imul(b,ae)|0,n=(n=n+Math.imul(b,se)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,se)|0,i=i+Math.imul(p,ce)|0,n=(n=n+Math.imul(p,ue)|0)+Math.imul(y,ce)|0,a=a+Math.imul(y,ue)|0;var Ee=(u+(i=i+Math.imul(f,fe)|0)|0)+((8191&(n=(n=n+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;u=((a=a+Math.imul(d,de)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(z,N),n=(n=Math.imul(z,q))+Math.imul(F,N)|0,a=Math.imul(F,q),i=i+Math.imul(R,H)|0,n=(n=n+Math.imul(R,j)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,j)|0,i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(K,W)|0,a=a+Math.imul(K,V)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(M,Y)|0,a=a+Math.imul(M,Z)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,ee)|0,i=i+Math.imul(k,re)|0,n=(n=n+Math.imul(k,ie)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ie)|0,i=i+Math.imul(A,ae)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(v,ae)|0,a=a+Math.imul(v,se)|0,i=i+Math.imul(b,ce)|0,n=(n=n+Math.imul(b,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0,i=i+Math.imul(p,fe)|0,n=(n=n+Math.imul(p,de)|0)+Math.imul(y,fe)|0,a=a+Math.imul(y,de)|0;var Se=(u+(i=i+Math.imul(f,pe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ye)|0)+Math.imul(d,pe)|0))<<13)|0;u=((a=a+Math.imul(d,ye)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(z,H),n=(n=Math.imul(z,j))+Math.imul(F,H)|0,a=Math.imul(F,j),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(T,W)|0,a=a+Math.imul(T,V)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(K,Y)|0,a=a+Math.imul(K,Z)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,ee)|0,i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(I,re)|0,a=a+Math.imul(I,ie)|0,i=i+Math.imul(k,ae)|0,n=(n=n+Math.imul(k,se)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,se)|0,i=i+Math.imul(A,ce)|0,n=(n=n+Math.imul(A,ue)|0)+Math.imul(v,ce)|0,a=a+Math.imul(v,ue)|0,i=i+Math.imul(b,fe)|0,n=(n=n+Math.imul(b,de)|0)+Math.imul(m,fe)|0,a=a+Math.imul(m,de)|0;var Ce=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;u=((a=a+Math.imul(y,ye)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(z,W),n=(n=Math.imul(z,V))+Math.imul(F,W)|0,a=Math.imul(F,V),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(T,Y)|0,a=a+Math.imul(T,Z)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(K,$)|0,a=a+Math.imul(K,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(M,re)|0,a=a+Math.imul(M,ie)|0,i=i+Math.imul(C,ae)|0,n=(n=n+Math.imul(C,se)|0)+Math.imul(I,ae)|0,a=a+Math.imul(I,se)|0,i=i+Math.imul(k,ce)|0,n=(n=n+Math.imul(k,ue)|0)+Math.imul(E,ce)|0,a=a+Math.imul(E,ue)|0,i=i+Math.imul(A,fe)|0,n=(n=n+Math.imul(A,de)|0)+Math.imul(v,fe)|0,a=a+Math.imul(v,de)|0;var Ie=(u+(i=i+Math.imul(b,pe)|0)|0)+((8191&(n=(n=n+Math.imul(b,ye)|0)+Math.imul(m,pe)|0))<<13)|0;u=((a=a+Math.imul(m,ye)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(z,Y),n=(n=Math.imul(z,Z))+Math.imul(F,Y)|0,a=Math.imul(F,Z),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(K,re)|0,a=a+Math.imul(K,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,se)|0,i=i+Math.imul(C,ce)|0,n=(n=n+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,a=a+Math.imul(I,ue)|0,i=i+Math.imul(k,fe)|0,n=(n=n+Math.imul(k,de)|0)+Math.imul(E,fe)|0,a=a+Math.imul(E,de)|0;var Be=(u+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,ye)|0)+Math.imul(v,pe)|0))<<13)|0;u=((a=a+Math.imul(v,ye)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(z,$),n=(n=Math.imul(z,ee))+Math.imul(F,$)|0,a=Math.imul(F,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,se)|0)+Math.imul(K,ae)|0,a=a+Math.imul(K,se)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(M,ce)|0,a=a+Math.imul(M,ue)|0,i=i+Math.imul(C,fe)|0,n=(n=n+Math.imul(C,de)|0)+Math.imul(I,fe)|0,a=a+Math.imul(I,de)|0;var Pe=(u+(i=i+Math.imul(k,pe)|0)|0)+((8191&(n=(n=n+Math.imul(k,ye)|0)+Math.imul(E,pe)|0))<<13)|0;u=((a=a+Math.imul(E,ye)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(z,re),n=(n=Math.imul(z,ie))+Math.imul(F,re)|0,a=Math.imul(F,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,se)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,se)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(K,ce)|0,a=a+Math.imul(K,ue)|0,i=i+Math.imul(P,fe)|0,n=(n=n+Math.imul(P,de)|0)+Math.imul(M,fe)|0,a=a+Math.imul(M,de)|0;var Me=(u+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,ye)|0)+Math.imul(I,pe)|0))<<13)|0;u=((a=a+Math.imul(I,ye)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(z,ae),n=(n=Math.imul(z,se))+Math.imul(F,ae)|0,a=Math.imul(F,se),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(T,ce)|0,a=a+Math.imul(T,ue)|0,i=i+Math.imul(x,fe)|0,n=(n=n+Math.imul(x,de)|0)+Math.imul(K,fe)|0,a=a+Math.imul(K,de)|0;var De=(u+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,ye)|0)+Math.imul(M,pe)|0))<<13)|0;u=((a=a+Math.imul(M,ye)|0)+(n>>>13)|0)+(De>>>26)|0,De&=67108863,i=Math.imul(z,ce),n=(n=Math.imul(z,ue))+Math.imul(F,ce)|0,a=Math.imul(F,ue),i=i+Math.imul(R,fe)|0,n=(n=n+Math.imul(R,de)|0)+Math.imul(T,fe)|0,a=a+Math.imul(T,de)|0;var xe=(u+(i=i+Math.imul(x,pe)|0)|0)+((8191&(n=(n=n+Math.imul(x,ye)|0)+Math.imul(K,pe)|0))<<13)|0;u=((a=a+Math.imul(K,ye)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(z,fe),n=(n=Math.imul(z,de))+Math.imul(F,fe)|0,a=Math.imul(F,de);var Ke=(u+(i=i+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,ye)|0)+Math.imul(T,pe)|0))<<13)|0;u=((a=a+Math.imul(T,ye)|0)+(n>>>13)|0)+(Ke>>>26)|0,Ke&=67108863;var Ue=(u+(i=Math.imul(z,pe))|0)+((8191&(n=(n=Math.imul(z,ye))+Math.imul(F,pe)|0))<<13)|0;return u=((a=Math.imul(F,ye))+(n>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,c[0]=ge,c[1]=be,c[2]=me,c[3]=we,c[4]=Ae,c[5]=ve,c[6]=_e,c[7]=ke,c[8]=Ee,c[9]=Se,c[10]=Ce,c[11]=Ie,c[12]=Be,c[13]=Pe,c[14]=Me,c[15]=De,c[16]=xe,c[17]=Ke,c[18]=Ue,0!==u&&(c[19]=u,r.length++),r};function l(e,t,r){return(new p).mulp(e,t,r)}function p(e,t){this.x=e,this.y=t}Math.imul||(d=f),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?f(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,a=0;a<r.length-1;a++){var s=n;n=0;for(var o=67108863&i,c=Math.min(a,t.length-1),u=Math.max(0,a-e.length+1);u<=c;u++){var h=a-u,f=(0|e.words[h])*(0|t.words[u]),d=67108863&f;o=67108863&(d=d+o|0),n+=(s=(s=s+(f/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[a]=o,i=s,s=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):l(this,e,t),r},p.prototype.makeRBT=function(e){for(var t=Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},p.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},p.prototype.permute=function(e,t,r,i,n,a){for(var s=0;s<a;s++)i[s]=t[e[s]],n[s]=r[e[s]]},p.prototype.transform=function(e,t,r,i,n,a){this.permute(a,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var o=s<<1,c=Math.cos(2*Math.PI/o),u=Math.sin(2*Math.PI/o),h=0;h<n;h+=o)for(var f=c,d=u,l=0;l<s;l++){var p=r[h+l],y=i[h+l],g=r[h+l+s],b=i[h+l+s],m=f*g-d*b;b=f*b+d*g,g=m,r[h+l]=p+g,i[h+l]=y+b,r[h+l+s]=p-g,i[h+l+s]=y-b,l!==o&&(m=c*f-u*d,d=c*d+u*f,f=m)}},p.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},p.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},p.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},p.prototype.convert13b=function(e,t,i,n){for(var a=0,s=0;s<t;s++)a+=0|e[s],i[2*s]=8191&a,a>>>=13,i[2*s+1]=8191&a,a>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===a),r(0==(-8192&a))},p.prototype.stub=function(e){for(var t=Array(e),r=0;r<e;r++)t[r]=0;return t},p.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),a=this.stub(i),s=Array(i),o=Array(i),c=Array(i),u=Array(i),h=Array(i),f=Array(i),d=r.words;d.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,u,i),this.transform(s,a,o,c,i,n),this.transform(u,a,h,f,i,n);for(var l=0;l<i;l++){var p=o[l]*h[l]-c[l]*f[l];c[l]=o[l]*f[l]+c[l]*h[l],o[l]=p}return this.conjugate(o,c,i),this.transform(o,c,d,a,i,n),this.conjugate(d,a,i),this.normalize13b(d,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=Array(this.length+e.length),l(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,a=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=a>>>26,this.words[i]=67108863&a}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var a=r.sqr();i<t.length;i++,a=a.sqr())0!==t[i]&&(r=r.mul(a));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,a=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&a,c=(0|this.words[t])-o<<i;this.words[t]=c|s,s=o>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var a=e%26,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<<a,c=i;if(n=Math.max(0,n-=s),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var h=0;for(u=this.length-1;u>=0&&(0!==h||u>=n);u--){var f=0|this.words[u];this.words[u]=h<<26-a|f>>>a,h=f&o}return c&&0!==h&&(c.words[c.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i)&&!!(this.words[i]&n)},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,a,s=e.length+i;this._expand(s);var o=0;for(n=0;n<e.length;n++){a=(0|this.words[n+i])+o;var c=(0|e.words[n])*t;o=((a-=67108863&c)>>26)-(c/67108864|0),this.words[n+i]=67108863&a}for(;n<this.length-i;n++)o=(a=(0|this.words[n+i])+o)>>26,this.words[n+i]=67108863&a;if(0===o)return this.strip();for(r(-1===o),o=0,n=0;n<this.length;n++)o=(a=-(0|this.words[n])+o)>>26,this.words[n]=67108863&a;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),a=e,s=0|a.words[a.length-1];0!==(r=26-this._countBits(s))&&(a=a.ushln(r),i.iushln(r),s=0|a.words[a.length-1]);var o,c=i.length-a.length;if("mod"!==t){(o=new n(null)).length=c+1,o.words=Array(o.length);for(var u=0;u<o.length;u++)o.words[u]=0}var h=i.clone()._ishlnsubmul(a,1,c);0===h.negative&&(i=h,o&&(o.words[c]=1));for(var f=c-1;f>=0;f--){var d=67108864*(0|i.words[a.length+f])+(0|i.words[a.length+f-1]);for(d=Math.min(d/s|0,67108863),i._ishlnsubmul(a,d,f);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(a,1,f),i.isZero()||(i.negative^=1);o&&(o.words[f]=d)}return o&&o.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:o||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(a=o.div.neg()),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:a,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(a=o.div.neg()),{div:a,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,s,o},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new n(1),s=new n(0),o=new n(0),c=new n(1),u=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++u;for(var h=i.clone(),f=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(h),s.isub(f)),a.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(i.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(h),c.isub(f)),o.iushrn(1),c.iushrn(1);t.cmp(i)>=0?(t.isub(i),a.isub(o),s.isub(c)):(i.isub(t),o.isub(a),c.isub(s))}return{a:o,b:c,gcd:i.iushln(u)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,s=new n(1),o=new n(0),c=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,h=1;0==(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var f=0,d=1;0==(i.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(i.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(o)):(i.isub(t),o.isub(s))}return(a=0===t.cmpn(1)?s:o).cmpn(0)<0&&a.iadd(e),a},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var a=t;t=r,r=a}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var a=n,s=i;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new v(e)},n.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function v(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function _(e){v.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}g.prototype._tmp=function(){var e=new n(null);return e.words=Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(b,g),b.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|a>>>22,a=s}a>>>=22,e.words[n-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(m,g),i(w,g),i(A,g),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new m;else if("p192"===e)t=new w;else{if("p25519"!==e)throw Error("Unknown prime "+e);t=new A}return y[e]=t,t},v.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},v.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},v.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},v.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},v.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},v.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},v.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},v.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},v.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},v.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},v.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},v.prototype.isqr=function(e){return this.imul(e,e.clone())},v.prototype.sqr=function(e){return this.mul(e,e)},v.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());var o=new n(1).toRed(this),c=o.redNeg(),u=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new n(2*h*h).toRed(this);0!==this.pow(h,u).cmp(c);)h.redIAdd(c);for(var f=this.pow(h,a),d=this.pow(e,a.addn(1).iushrn(1)),l=this.pow(e,a),p=s;0!==l.cmp(o);){for(var y=l,g=0;0!==y.cmp(o);g++)y=y.redSqr();r(g<p);var b=this.pow(f,new n(1).iushln(p-g-1));d=d.redMul(b),f=b.redSqr(),l=l.redMul(f),p=g}return d},v.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},v.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var a=r[0],s=0,o=0,c=t.bitLength()%26;for(0===c&&(c=26),i=t.length-1;i>=0;i--){for(var u=t.words[i],h=c-1;h>=0;h--){var f=u>>h&1;a!==r[0]&&(a=this.sqr(a)),0!==f||0!==s?(s<<=1,s|=f,(4===++o||0===i&&0===h)&&(a=this.mul(a,r[s]),o=0,s=0)):o=0}c=26}return a},v.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},v.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new _(e)},i(_,v),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},_.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(i).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,rt)})),ky=/*#__PURE__*/Object.freeze({__proto__:null,default:_y,__moduleExports:_y});class Ey{constructor(e){if(void 0===e)throw Error("Invalid BigInteger input");this.value=new _y(e)}clone(){const e=new Ey(null);return this.value.copy(e.value),e}iinc(){return this.value.iadd(new _y(1)),this}inc(){return this.clone().iinc()}idec(){return this.value.isub(new _y(1)),this}dec(){return this.clone().idec()}iadd(e){return this.value.iadd(e.value),this}add(e){return this.clone().iadd(e)}isub(e){return this.value.isub(e.value),this}sub(e){return this.clone().isub(e)}imul(e){return this.value.imul(e.value),this}mul(e){return this.clone().imul(e)}imod(e){return this.value=this.value.umod(e.value),this}mod(e){return this.clone().imod(e)}modExp(e,t){const r=t.isEven()?_y.red(t.value):_y.mont(t.value),i=this.clone();return i.value=i.value.toRed(r).redPow(e.value).fromRed(),i}modInv(e){if(!this.gcd(e).isOne())throw Error("Inverse does not exist");return new Ey(this.value.invm(e.value))}gcd(e){return new Ey(this.value.gcd(e.value))}ileftShift(e){return this.value.ishln(e.value.toNumber()),this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value.ishrn(e.value.toNumber()),this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value.eq(e.value)}lt(e){return this.value.lt(e.value)}lte(e){return this.value.lte(e.value)}gt(e){return this.value.gt(e.value)}gte(e){return this.value.gte(e.value)}isZero(){return this.value.isZero()}isOne(){return this.value.eq(new _y(1))}isNegative(){return this.value.isNeg()}isEven(){return this.value.isEven()}abs(){const e=this.clone();return e.value=e.value.abs(),e}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}getBit(e){return this.value.testn(e)?1:0}bitLength(){return this.value.bitLength()}byteLength(){return this.value.byteLength()}toUint8Array(e="be",t){return this.value.toArrayLike(Uint8Array,e,t)}}var Sy,Cy=/*#__PURE__*/Object.freeze({__proto__:null,default:Ey}),Iy=it((function(e,t){var r=t;function i(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(i=0;i<e.length;i++){var n=e.charCodeAt(i),a=n>>8,s=255&n;a?r.push(a,s):r.push(s)}return r},r.zero2=i,r.toHex=n,r.encode=function(e,t){return"hex"===t?n(e):e}})),By=it((function(e,t){var r=t;r.assert=et,r.toArray=Iy.toArray,r.zero2=Iy.zero2,r.toHex=Iy.toHex,r.encode=Iy.encode,r.getNAF=function(e,t){for(var r=[],i=1<<t+1,n=e.clone();n.cmpn(1)>=0;){var a;if(n.isOdd()){var s=n.andln(i-1);a=s>(i>>1)-1?(i>>1)-s:s,n.isubn(a)}else a=0;r.push(a);for(var o=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c<o;c++)r.push(0);n.iushrn(o)}return r},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i=0,n=0;e.cmpn(-i)>0||t.cmpn(-n)>0;){var a,s,o,c=e.andln(3)+i&3,u=t.andln(3)+n&3;if(3===c&&(c=-1),3===u&&(u=-1),0==(1&c))a=0;else a=3!==(o=e.andln(7)+i&7)&&5!==o||2!==u?c:-c;if(r[0].push(a),0==(1&u))s=0;else s=3!==(o=t.andln(7)+n&7)&&5!==o||2!==c?u:-u;r[1].push(s),2*i===a+1&&(i=1-i),2*n===s+1&&(n=1-n),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new _y(e,"hex","le")}})),Py=function(e){return Sy||(Sy=new My(null)),Sy.generate(e)};function My(e){this.rand=e}var Dy=My;if(My.prototype.generate=function(e){return this._rand(e)},My.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?My.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?My.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(My.prototype._rand=function(){throw Error("Not implemented yet")});else try{var xy=void 0;if("function"!=typeof xy.randomBytes)throw Error("Not supported");My.prototype._rand=function(e){return xy.randomBytes(e)}}catch(e){}Py.Rand=Dy;var Ky=By.getNAF,Uy=By.getJSF,Ry=By.assert;function Ty(e,t){this.type=e,this.p=new _y(t.p,16),this.red=t.prime?_y.red(t.prime):_y.mont(this.p),this.zero=new _y(0).toRed(this.red),this.one=new _y(1).toRed(this.red),this.two=new _y(2).toRed(this.red),this.n=t.n&&new _y(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,];var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Qy=Ty;function zy(e,t){this.curve=e,this.type=t,this.precomputed=null}Ty.prototype.point=function(){throw Error("Not implemented")},Ty.prototype.validate=function(){throw Error("Not implemented")},Ty.prototype._fixedNafMul=function(e,t){Ry(e.precomputed);var r=e._getDoubles(),i=Ky(t,1),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;for(var a=[],s=0;s<i.length;s+=r.step){var o=0;for(t=s+r.step-1;t>=s;t--)o=(o<<1)+i[t];a.push(o)}for(var c=this.jpoint(null,null,null),u=this.jpoint(null,null,null),h=n;h>0;h--){for(s=0;s<a.length;s++){(o=a[s])===h?u=u.mixedAdd(r.points[s]):o===-h&&(u=u.mixedAdd(r.points[s].neg()))}c=c.add(u)}return c.toP()},Ty.prototype._wnafMul=function(e,t){var r=4,i=e._getNAFPoints(r);r=i.wnd;for(var n=i.points,a=Ky(t,r),s=this.jpoint(null,null,null),o=a.length-1;o>=0;o--){for(t=0;o>=0&&0===a[o];o--)t++;if(o>=0&&t++,s=s.dblp(t),o<0)break;var c=a[o];Ry(0!==c),s="affine"===e.type?c>0?s.mixedAdd(n[c-1>>1]):s.mixedAdd(n[-c-1>>1].neg()):c>0?s.add(n[c-1>>1]):s.add(n[-c-1>>1].neg())}return"affine"===e.type?s.toP():s},Ty.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,s=this._wnafT2,o=this._wnafT3,c=0,u=0;u<i;u++){var h=(k=t[u])._getNAFPoints(e);a[u]=h.wnd,s[u]=h.points}for(u=i-1;u>=1;u-=2){var f=u-1,d=u;if(1===a[f]&&1===a[d]){var l=[t[f],null,null,t[d]];0===t[f].y.cmp(t[d].y)?(l[1]=t[f].add(t[d]),l[2]=t[f].toJ().mixedAdd(t[d].neg())):0===t[f].y.cmp(t[d].y.redNeg())?(l[1]=t[f].toJ().mixedAdd(t[d]),l[2]=t[f].add(t[d].neg())):(l[1]=t[f].toJ().mixedAdd(t[d]),l[2]=t[f].toJ().mixedAdd(t[d].neg()));var p=[-3,-1,-5,-7,0,7,5,1,3],y=Uy(r[f],r[d]);c=Math.max(y[0].length,c),o[f]=Array(c),o[d]=Array(c);for(var g=0;g<c;g++){var b=0|y[0][g],m=0|y[1][g];o[f][g]=p[3*(b+1)+(m+1)],o[d][g]=0,s[f]=l}}else o[f]=Ky(r[f],a[f]),o[d]=Ky(r[d],a[d]),c=Math.max(o[f].length,c),c=Math.max(o[d].length,c)}var w=this.jpoint(null,null,null),A=this._wnafT4;for(u=c;u>=0;u--){for(var v=0;u>=0;){var _=!0;for(g=0;g<i;g++)A[g]=0|o[g][u],0!==A[g]&&(_=!1);if(!_)break;v++,u--}if(u>=0&&v++,w=w.dblp(v),u<0)break;for(g=0;g<i;g++){var k,E=A[g];0!==E&&(E>0?k=s[g][E-1>>1]:E<0&&(k=s[g][-E-1>>1].neg()),w="affine"===k.type?w.mixedAdd(k):w.add(k))}}for(u=0;u<i;u++)s[u]=null;return n?w:w.toP()},Ty.BasePoint=zy,zy.prototype.eq=function(){throw Error("Not implemented")},zy.prototype.validate=function(){return this.curve.validate(this)},Ty.prototype.decodePoint=function(e,t){e=By.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?Ry(e[e.length-1]%2==0):7===e[0]&&Ry(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw Error("Unknown point format")},zy.prototype.encodeCompressed=function(e){return this.encode(e,!0)},zy.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},zy.prototype.encode=function(e,t){return By.encode(this._encode(t),e)},zy.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},zy.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},zy.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var a=0;a<e;a++)i=i.dbl();r.push(i)}return{step:e,points:r}},zy.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},zy.prototype._getBeta=function(){return null},zy.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var Fy=By.assert;function Ly(e){Qy.call(this,"short",e),this.a=new _y(e.a,16).toRed(this.red),this.b=new _y(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}at(Ly,Qy);var Ny=Ly;function qy(e,t,r,i){Qy.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new _y(t,16),this.y=new _y(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function Oy(e,t,r,i){Qy.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new _y(0)):(this.x=new _y(t,16),this.y=new _y(r,16),this.z=new _y(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function Hy(e){Qy.call(this,"mont",e),this.a=new _y(e.a,16).toRed(this.red),this.b=new _y(e.b,16).toRed(this.red),this.i4=new _y(4).toRed(this.red).redInvm(),this.two=new _y(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Ly.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new _y(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new _y(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],Fy(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new _y(e.a,16),b:new _y(e.b,16)}})):this._getEndoBasis(r)}}},Ly.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:_y.mont(e),r=new _y(2).toRed(t).redInvm(),i=r.redNeg(),n=new _y(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},Ly.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,s,o,c,u,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,d=this.n.clone(),l=new _y(1),p=new _y(0),y=new _y(0),g=new _y(1),b=0;0!==f.cmpn(0);){var m=d.div(f);c=d.sub(m.mul(f)),u=y.sub(m.mul(l));var w=g.sub(m.mul(p));if(!i&&c.cmp(h)<0)t=o.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++b)break;o=c,d=f,f=c,y=l,l=u,g=p,p=w}a=c.neg(),s=u;var A=i.sqr().add(n.sqr());return a.sqr().add(s.sqr()).cmp(A)>=0&&(a=t,s=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:i,b:n},{a,b:s}]},Ly.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),s=n.mul(r.a),o=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(s).sub(o),k2:c.add(u).neg()}},Ly.prototype.pointFromX=function(e,t){(e=new _y(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},Ly.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},Ly.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a<e.length;a++){var s=this._endoSplit(t[a]),o=e[a],c=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),i[2*a]=o,i[2*a+1]=c,n[2*a]=s.k1,n[2*a+1]=s.k2}for(var u=this._wnafMulAdd(1,i,n,2*a,r),h=0;h<2*a;h++)i[h]=null,n[h]=null;return u},at(qy,Qy.BasePoint),Ly.prototype.point=function(e,t,r){return new qy(this,e,t,r)},Ly.prototype.pointFromJSON=function(e,t){return qy.fromJSON(this,e,t)},qy.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},qy.prototype.toJSON=function(){return this.precomputed?[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)}}]:[this.x,this.y]},qy.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;function n(t){return e.point(t[0],t[1],r)}var a=t[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(n))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(n))}},i},qy.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},qy.prototype.isInfinity=function(){return this.inf},qy.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},qy.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),a=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)},qy.prototype.getX=function(){return this.x.fromRed()},qy.prototype.getY=function(){return this.y.fromRed()},qy.prototype.mul=function(e){return e=new _y(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},qy.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},qy.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},qy.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},qy.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},qy.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},at(Oy,Qy.BasePoint),Ly.prototype.jpoint=function(e,t,r){return new Oy(this,e,t,r)},Oy.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},Oy.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Oy.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),o=i.redSub(n),c=a.redSub(s);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),h=u.redMul(o),f=i.redMul(u),d=c.redSqr().redIAdd(h).redISub(f).redISub(f),l=c.redMul(f.redISub(d)).redISub(a.redMul(h)),p=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(d,l,p)},Oy.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,a=e.y.redMul(t).redMul(this.z),s=r.redSub(i),o=n.redSub(a);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),h=r.redMul(c),f=o.redSqr().redIAdd(u).redISub(h).redISub(h),d=o.redMul(h.redISub(f)).redISub(n.redMul(u)),l=this.z.redMul(s);return this.curve.jpoint(f,d,l)},Oy.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}var i=this.curve.a,n=this.curve.tinv,a=this.x,s=this.y,o=this.z,c=o.redSqr().redSqr(),u=s.redAdd(s);for(r=0;r<e;r++){var h=a.redSqr(),f=u.redSqr(),d=f.redSqr(),l=h.redAdd(h).redIAdd(h).redIAdd(i.redMul(c)),p=a.redMul(f),y=l.redSqr().redISub(p.redAdd(p)),g=p.redISub(y),b=l.redMul(g);b=b.redIAdd(b).redISub(d);var m=u.redMul(o);r+1<e&&(c=c.redMul(d)),a=y,o=m,u=b}return this.curve.jpoint(a,u.redMul(n),o)},Oy.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Oy.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(a);s=s.redIAdd(s);var o=i.redAdd(i).redIAdd(i),c=o.redSqr().redISub(s).redISub(s),u=a.redIAdd(a);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=o.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),f=this.y.redSqr(),d=f.redSqr(),l=this.x.redAdd(f).redSqr().redISub(h).redISub(d);l=l.redIAdd(l);var p=h.redAdd(h).redIAdd(h),y=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),e=y.redISub(l).redISub(l),t=p.redMul(l.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},Oy.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(a);s=s.redIAdd(s);var o=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),c=o.redSqr().redISub(s).redISub(s);e=c;var u=a.redIAdd(a);u=(u=u.redIAdd(u)).redIAdd(u),t=o.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),f=this.y.redSqr(),d=this.x.redMul(f),l=this.x.redSub(h).redMul(this.x.redAdd(h));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),y=(p=p.redIAdd(p)).redAdd(p);e=l.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(h);var g=f.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=l.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},Oy.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),a=t.redSqr(),s=r.redSqr(),o=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(n)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),h=o.redSqr().redISub(u.redAdd(u)),f=u.redISub(h),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=o.redMul(f).redISub(d),p=r.redAdd(r).redMul(i);return this.curve.jpoint(h,l,p)},Oy.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),a=n.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(i),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(a)).redSqr(),c=i.redIAdd(i);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=n.redIAdd(s).redSqr().redISub(a).redISub(o).redISub(c),h=t.redMul(u);h=(h=h.redIAdd(h)).redIAdd(h);var f=this.x.redMul(o).redISub(h);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(o)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=this.z.redAdd(s).redSqr().redISub(r).redISub(o);return this.curve.jpoint(f,d,l)},Oy.prototype.mul=function(e,t){return e=new _y(e,t),this.curve._wnafMul(this,e)},Oy.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var i=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(i)).cmpn(0)},Oy.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},Oy.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Oy.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},at(Hy,Qy);var jy=Hy;function Gy(e,t,r){Qy.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new _y(t,16),this.z=new _y(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Hy.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},at(Gy,Qy.BasePoint),Hy.prototype.decodePoint=function(e,t){if(33===(e=By.toArray(e,t)).length&&64===e[0]&&(e=e.slice(1,33).reverse()),32!==e.length)throw Error("Unknown point compression format");return this.point(e,1)},Hy.prototype.point=function(e,t){return new Gy(this,e,t)},Hy.prototype.pointFromJSON=function(e){return Gy.fromJSON(this,e)},Gy.prototype.precompute=function(){},Gy.prototype._encode=function(e){var t=this.curve.p.byteLength();return e?[64].concat(this.getX().toArray("le",t)):this.getX().toArray("be",t)},Gy.fromJSON=function(e,t){return new Gy(e,t[0],t[1]||e.one)},Gy.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Gy.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Gy.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},Gy.prototype.add=function(){throw Error("Not supported on Montgomery curve")},Gy.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),s=n.redMul(i),o=t.z.redMul(a.redAdd(s).redSqr()),c=t.x.redMul(a.redISub(s).redSqr());return this.curve.point(o,c)},Gy.prototype.mul=function(e){for(var t=(e=new _y(e,16)).clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var a=n.length-1;a>=0;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},Gy.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},Gy.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},Gy.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},Gy.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Gy.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Wy=By.assert;function Vy(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,Qy.call(this,"edwards",e),this.a=new _y(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new _y(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new _y(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Wy(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}at(Vy,Qy);var Jy=Vy;function Yy(e,t,r,i,n){Qy.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new _y(t,16),this.y=new _y(r,16),this.z=i?new _y(i,16):this.curve.one,this.t=n&&new _y(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}Vy.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},Vy.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},Vy.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},Vy.prototype.pointFromX=function(e,t){(e=new _y(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),n=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=i.redMul(n.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw Error("invalid point");var o=s.fromRed().isOdd();return(t&&!o||!t&&o)&&(s=s.redNeg()),this.point(e,s)},Vy.prototype.pointFromY=function(e,t){(e=new _y(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=r.redSub(this.c2),n=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(n.redInvm());if(0===a.cmp(this.zero)){if(t)throw Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},Vy.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),i=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===i.cmp(n)},at(Yy,Qy.BasePoint),Vy.prototype.pointFromJSON=function(e){return Yy.fromJSON(this,e)},Vy.prototype.point=function(e,t,r,i){return new Yy(this,e,t,r,i)},Yy.fromJSON=function(e,t){return new Yy(e,t[0],t[1],t[2])},Yy.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Yy.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},Yy.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=i.redAdd(t),s=a.redSub(r),o=i.redSub(t),c=n.redMul(s),u=a.redMul(o),h=n.redMul(o),f=s.redMul(a);return this.curve.point(c,u,f,h)},Yy.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var s=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(s.redSub(this.curve.two)),t=s.redMul(u.redSub(a)),r=s.redSqr().redSub(s).redSub(s);else{var o=this.z.redSqr(),c=s.redSub(o).redISub(o);e=i.redSub(n).redISub(a).redMul(c),t=s.redMul(u.redSub(a)),r=s.redMul(c)}}else{var u=n.redAdd(a);o=this.curve._mulC(this.z).redSqr(),c=u.redSub(o).redSub(o);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},Yy.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Yy.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),s=n.redSub(i),o=n.redAdd(i),c=r.redAdd(t),u=a.redMul(s),h=o.redMul(c),f=a.redMul(c),d=s.redMul(o);return this.curve.point(u,h,d,f)},Yy.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(a).redMul(s),c=n.redSub(o),u=n.redAdd(o),h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(s),f=i.redMul(c).redMul(h);return this.curve.twisted?(t=i.redMul(u).redMul(s.redSub(this.curve._mulA(a))),r=c.redMul(u)):(t=i.redMul(u).redMul(s.redSub(a)),r=this.curve._mulC(c).redMul(u)),this.curve.point(f,t,r)},Yy.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},Yy.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},Yy.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},Yy.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},Yy.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},Yy.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Yy.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Yy.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Yy.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},Yy.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},Yy.prototype.toP=Yy.prototype.normalize,Yy.prototype.mixedAdd=Yy.prototype.add;var Zy=it((function(e,t){var r=t;r.base=Qy,r.short=Ny,r.mont=jy,r.edwards=Jy})),Xy=pt.rotl32,$y=pt.sum32,eg=pt.sum32_5,tg=kt.ft_1,rg=bt.BlockHash,ig=[1518500249,1859775393,2400959708,3395469782];function ng(){if(!(this instanceof ng))return new ng;rg.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}pt.inherits(ng,rg);var ag=ng;ng.blockSize=512,ng.outSize=160,ng.hmacStrength=80,ng.padLength=64,ng.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=Xy(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],a=this.h[1],s=this.h[2],o=this.h[3],c=this.h[4];for(i=0;i<r.length;i++){var u=~~(i/20),h=eg(Xy(n,5),tg(u,a,s,o),c,r[i],ig[u]);c=o,o=s,s=Xy(a,30),a=n,n=h}this.h[0]=$y(this.h[0],n),this.h[1]=$y(this.h[1],a),this.h[2]=$y(this.h[2],s),this.h[3]=$y(this.h[3],o),this.h[4]=$y(this.h[4],c)},ng.prototype._digest=function(e){return"hex"===e?pt.toHex32(this.h,"big"):pt.split32(this.h,"big")};var sg={sha1:ag,sha224:zt,sha256:Tt,sha384:lr,sha512:$t};function og(e,t,r){if(!(this instanceof og))return new og(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(pt.toArray(t,r))}var cg=og;og.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),et(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},og.prototype.update=function(e,t){return this.inner.update(e,t),this},og.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var ug=it((function(e,t){var r=t;r.utils=pt,r.common=bt,r.sha=sg,r.ripemd=Br,r.hmac=cg,r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160})),hg={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"]]}},fg=it((function(e,t){var r,i=t,n=By.assert;function a(e){if("short"===e.type)this.curve=new Zy.short(e);else if("edwards"===e.type)this.curve=new Zy.edwards(e);else{if("mont"!==e.type)throw Error("Unknown curve type.");this.curve=new Zy.mont(e)}this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, n*G != O")}function s(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new a(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=a,s("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:ug.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:ug.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:ug.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:ug.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"]}),s("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:ug.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",cofactor:"8",hash:ug.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",cofactor:"8",hash:ug.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]}),s("brainpoolP256r1",{type:"short",prime:null,p:"A9FB57DB A1EEA9BC 3E660A90 9D838D72 6E3BF623 D5262028 2013481D 1F6E5377",a:"7D5A0975 FC2C3057 EEF67530 417AFFE7 FB8055C1 26DC5C6C E94A4B44 F330B5D9",b:"26DC5C6C E94A4B44 F330B5D9 BBD77CBF 95841629 5CF7E1CE 6BCCDC18 FF8C07B6",n:"A9FB57DB A1EEA9BC 3E660A90 9D838D71 8C397AA3 B561A6F7 901E0E82 974856A7",hash:ug.sha256,gRed:!1,g:["8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262","547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997"]}),s("brainpoolP384r1",{type:"short",prime:null,p:"8CB91E82 A3386D28 0F5D6F7E 50E641DF 152F7109 ED5456B4 12B1DA19 7FB71123ACD3A729 901D1A71 87470013 3107EC53",a:"7BC382C6 3D8C150C 3C72080A CE05AFA0 C2BEA28E 4FB22787 139165EF BA91F90F8AA5814A 503AD4EB 04A8C7DD 22CE2826",b:"04A8C7DD 22CE2826 8B39B554 16F0447C 2FB77DE1 07DCD2A6 2E880EA5 3EEB62D57CB43902 95DBC994 3AB78696 FA504C11",n:"8CB91E82 A3386D28 0F5D6F7E 50E641DF 152F7109 ED5456B3 1F166E6C AC0425A7CF3AB6AF 6B7FC310 3B883202 E9046565",hash:ug.sha384,gRed:!1,g:["1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E","8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315"]}),s("brainpoolP512r1",{type:"short",prime:null,p:"AADD9DB8 DBE9C48B 3FD4E6AE 33C9FC07 CB308DB3 B3C9D20E D6639CCA 703308717D4D9B00 9BC66842 AECDA12A E6A380E6 2881FF2F 2D82C685 28AA6056 583A48F3",a:"7830A331 8B603B89 E2327145 AC234CC5 94CBDD8D 3DF91610 A83441CA EA9863BC2DED5D5A A8253AA1 0A2EF1C9 8B9AC8B5 7F1117A7 2BF2C7B9 E7C1AC4D 77FC94CA",b:"3DF91610 A83441CA EA9863BC 2DED5D5A A8253AA1 0A2EF1C9 8B9AC8B5 7F1117A72BF2C7B9 E7C1AC4D 77FC94CA DC083E67 984050B7 5EBAE5DD 2809BD63 8016F723",n:"AADD9DB8 DBE9C48B 3FD4E6AE 33C9FC07 CB308DB3 B3C9D20E D6639CCA 70330870553E5C41 4CA92619 41866119 7FAC1047 1DB1D381 085DDADD B5879682 9CA90069",hash:ug.sha512,gRed:!1,g:["81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822","7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892"]});try{r=hg}catch(e){r=void 0}s("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:ug.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function dg(e){if(!(this instanceof dg))return new dg(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Iy.toArray(e.entropy,e.entropyEnc||"hex"),r=Iy.toArray(e.nonce,e.nonceEnc||"hex"),i=Iy.toArray(e.pers,e.persEnc||"hex");et(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}var lg=dg;dg.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},dg.prototype._hmac=function(){return new ug.hmac(this.hash,this.K)},dg.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},dg.prototype.reseed=function(e,t,r,i){"string"!=typeof t&&(i=r,r=t,t=null),e=Iy.toArray(e,t),r=Iy.toArray(r,i),et(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},dg.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=Iy.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<e;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var a=n.slice(0,e);return this._update(r),this._reseed++,Iy.encode(a,t)};var pg=By.assert;function yg(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var gg=yg;yg.fromPublic=function(e,t,r){return t instanceof yg?t:new yg(e,{pub:t,pubEnc:r})},yg.fromPrivate=function(e,t,r){return t instanceof yg?t:new yg(e,{priv:t,privEnc:r})},yg.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},yg.prototype.getPublic=function(e,t){return this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},yg.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},yg.prototype._importPrivate=function(e,t){if(this.priv=new _y(e,t||16),"mont"===this.ec.curve.type){var r=this.ec.curve.one,i=r.ushln(252).sub(r).ushln(3);this.priv=this.priv.or(r.ushln(254)),this.priv=this.priv.and(i)}else this.priv=this.priv.umod(this.ec.curve.n)},yg.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?pg(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||pg(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},yg.prototype.derive=function(e){return e.mul(this.priv).getX()},yg.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},yg.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},yg.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var bg=By.assert;function mg(e,t){if(e instanceof mg)return e;this._importDER(e,t)||(bg(e.r&&e.s,"Signature without r or s"),this.r=new _y(e.r,16),this.s=new _y(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var wg=mg;function Ag(){this.place=0}function vg(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,s=t.place;a<i;a++,s++)n<<=8,n|=e[s];return t.place=s,n}function _g(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function kg(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}mg.prototype._importDER=function(e,t){e=By.toArray(e,t);var r=new Ag;if(48!==e[r.place++])return!1;if(vg(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=vg(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=vg(e,r);if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===s[0]&&128&s[1]&&(s=s.slice(1)),this.r=new _y(n),this.s=new _y(s),this.recoveryParam=null,!0},mg.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=_g(t),r=_g(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];kg(i,t.length),(i=i.concat(t)).push(2),kg(i,r.length);var n=i.concat(r),a=[48];return kg(a,n.length),a=a.concat(n),By.encode(a,e)};var Eg=By.assert;function Sg(e){if(!(this instanceof Sg))return new Sg(e);"string"==typeof e&&(Eg(fg.hasOwnProperty(e),"Unknown curve "+e),e=fg[e]),e instanceof fg.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Cg=Sg;Sg.prototype.keyPair=function(e){return new gg(this,e)},Sg.prototype.keyFromPrivate=function(e,t){return gg.fromPrivate(this,e,t)},Sg.prototype.keyFromPublic=function(e,t){return gg.fromPublic(this,e,t)},Sg.prototype.genKeyPair=function(e){e||(e={});var t=new lg({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Py(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()});if("mont"===this.curve.type){var r=new _y(t.generate(32));return this.keyFromPrivate(r)}for(var i=this.n.byteLength(),n=this.n.sub(new _y(2));;){if(!((r=new _y(t.generate(i))).cmp(n)>0))return r.iaddn(1),this.keyFromPrivate(r)}},Sg.prototype._truncateToN=function(e,t,r){var i=(r=r||8*e.byteLength())-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Sg.prototype.truncateMsg=function(e){var t;return e instanceof Uint8Array?(t=8*e.byteLength,e=this._truncateToN(new _y(e,16),!1,t)):"string"==typeof e?(t=4*e.length,e=this._truncateToN(new _y(e,16),!1,t)):e=this._truncateToN(new _y(e,16)),e},Sg.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this.truncateMsg(e);for(var n=this.n.byteLength(),a=t.getPrivate().toArray("be",n),s=e.toArray("be",n),o=new lg({hash:this.hash,entropy:a,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),c=this.n.sub(new _y(1)),u=0;;u++){var h=i.k?i.k(u):new _y(o.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(c)>=0)){var f=this.g.mul(h);if(!f.isInfinity()){var d=f.getX(),l=d.umod(this.n);if(0!==l.cmpn(0)){var p=h.invm(this.n).mul(l.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var y=(f.getY().isOdd()?1:0)|(0!==d.cmp(l)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),y^=1),new wg({r:l,s:p,recoveryParam:y})}}}}}},Sg.prototype.verify=function(e,t,r,i){return r=this.keyFromPublic(r,i),t=new wg(t,"hex"),this._verify(this.truncateMsg(e),t,r)||this._verify(this._truncateToN(new _y(e,16)),t,r)},Sg.prototype._verify=function(e,t,r){var i=t.r,n=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;var a,s=n.invm(this.n),o=s.mul(e).umod(this.n),c=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(o,r.getPublic(),c)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(o,r.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Sg.prototype.recoverPubKey=function(e,t,r,i){Eg((3&r)===r,"The recovery param is more than two bits"),t=new wg(t,i);var n=this.n,a=new _y(e),s=t.r,o=t.s,c=1&r,u=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw Error("Unable to find sencond key candinate");s=u?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c);var h=t.r.invm(n),f=n.sub(a).mul(h).umod(n),d=o.mul(h).umod(n);return this.g.mulAdd(f,s,d)},Sg.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new wg(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw Error("Unable to find valid recovery factor")};var Ig=By.assert,Bg=By.parseBytes,Pg=By.cachedProperty;function Mg(e,t){if(this.eddsa=e,t.hasOwnProperty("secret")&&(this._secret=Bg(t.secret)),e.isPoint(t.pub))this._pub=t.pub;else if(this._pubBytes=Bg(t.pub),this._pubBytes&&33===this._pubBytes.length&&64===this._pubBytes[0]&&(this._pubBytes=this._pubBytes.slice(1,33)),this._pubBytes&&32!==this._pubBytes.length)throw Error("Unknown point compression format")}Mg.fromPublic=function(e,t){return t instanceof Mg?t:new Mg(e,{pub:t})},Mg.fromSecret=function(e,t){return t instanceof Mg?t:new Mg(e,{secret:t})},Mg.prototype.secret=function(){return this._secret},Pg(Mg,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Pg(Mg,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Pg(Mg,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),Pg(Mg,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Pg(Mg,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Pg(Mg,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Mg.prototype.sign=function(e){return Ig(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},Mg.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},Mg.prototype.getSecret=function(e){return Ig(this._secret,"KeyPair is public only"),By.encode(this.secret(),e)},Mg.prototype.getPublic=function(e,t){return By.encode((t?[64]:[]).concat(this.pubBytes()),e)};var Dg=Mg,xg=By.assert,Kg=By.cachedProperty,Ug=By.parseBytes;function Rg(e,t){this.eddsa=e,"object"!=typeof t&&(t=Ug(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),xg(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof _y&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}Kg(Rg,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Kg(Rg,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Kg(Rg,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Kg(Rg,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Rg.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Rg.prototype.toHex=function(){return By.encode(this.toBytes(),"hex").toUpperCase()};var Tg=Rg,Qg=By.assert,zg=By.parseBytes;function Fg(e){if(Qg("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof Fg))return new Fg(e);e=fg[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=ug.sha512}var Lg=Fg;Fg.prototype.sign=function(e,t){e=zg(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),s=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),o=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:o,Rencoded:a})},Fg.prototype.verify=function(e,t,r){e=zg(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},Fg.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return By.intFromLE(e.digest()).umod(this.curve.n)},Fg.prototype.keyPair=function(e){return new Dg(this,e)},Fg.prototype.keyFromPublic=function(e){return Dg.fromPublic(this,e)},Fg.prototype.keyFromSecret=function(e){return Dg.fromSecret(this,e)},Fg.prototype.genKeyPair=function(e){e||(e={});var t=new lg({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Py(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.curve.n.toArray()});return this.keyFromSecret(t.generate(32))},Fg.prototype.makeSignature=function(e){return e instanceof Tg?e:new Tg(this,e)},Fg.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},Fg.prototype.decodePoint=function(e){var t=(e=By.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),i=0!=(128&e[t]),n=By.intFromLE(r);return this.curve.pointFromY(n,i)},Fg.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},Fg.prototype.decodeInt=function(e){return By.intFromLE(e)},Fg.prototype.isPoint=function(e){return e instanceof this.pointClass};var Ng=it((function(e,t){var r=t;r.utils=By,r.rand=Py,r.curve=Zy,r.curves=fg,r.ec=Cg,r.eddsa=Lg})),qg=/*#__PURE__*/Object.freeze({__proto__:null,default:Ng,__moduleExports:Ng});function Og(e,t,r,i){e[t]+=r[i],e[t+1]+=r[i+1]+(e[t]<r[i])}function Hg(e,t){e[0]+=t,e[1]+=e[0]<t}function jg(e,t,r,i,n,a,s,o){Og(e,r,e,i),Og(e,r,t,s);let c=e[a]^e[r],u=e[a+1]^e[r+1];e[a]=u,e[a+1]=c,Og(e,n,e,a),c=e[i]^e[n],u=e[i+1]^e[n+1],e[i]=c>>>24^u<<8,e[i+1]=u>>>24^c<<8,Og(e,r,e,i),Og(e,r,t,o),c=e[a]^e[r],u=e[a+1]^e[r+1],e[a]=c>>>16^u<<16,e[a+1]=u>>>16^c<<16,Og(e,n,e,a),c=e[i]^e[n],u=e[i+1]^e[n+1],e[i]=u>>>31^c<<1,e[i+1]=c>>>31^u<<1}const Gg=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Wg=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((e=>2*e)));function Vg(e,t){const r=new Uint32Array(32),i=new Uint32Array(e.b.buffer,e.b.byteOffset,32);for(let t=0;t<16;t++)r[t]=e.h[t],r[t+16]=Gg[t];r[24]^=e.t0[0],r[25]^=e.t0[1];const n=t?4294967295:0;r[28]^=n,r[29]^=n;for(let e=0;e<12;e++){const t=e<<4;jg(r,i,0,8,16,24,Wg[t+0],Wg[t+1]),jg(r,i,2,10,18,26,Wg[t+2],Wg[t+3]),jg(r,i,4,12,20,28,Wg[t+4],Wg[t+5]),jg(r,i,6,14,22,30,Wg[t+6],Wg[t+7]),jg(r,i,0,10,20,30,Wg[t+8],Wg[t+9]),jg(r,i,2,12,22,24,Wg[t+10],Wg[t+11]),jg(r,i,4,14,16,26,Wg[t+12],Wg[t+13]),jg(r,i,6,8,18,28,Wg[t+14],Wg[t+15])}for(let t=0;t<16;t++)e.h[t]^=r[t]^r[t+16]}class Jg{constructor(e,t,r,i){const n=new Uint8Array(64);this.S={b:new Uint8Array(tb),h:new Uint32Array(Zg/4),t0:new Uint32Array(2),c:0,outlen:e},n[0]=e,t&&(n[1]=t.length),n[2]=1,n[3]=1,r&&n.set(r,32),i&&n.set(i,48);const a=new Uint32Array(n.buffer,n.byteOffset,n.length/Uint32Array.BYTES_PER_ELEMENT);for(let e=0;e<16;e++)this.S.h[e]=Gg[e]^a[e];if(t){const e=new Uint8Array(tb);e.set(t),this.update(e)}}update(e){if(!(e instanceof Uint8Array))throw Error("Input must be Uint8Array or Buffer");let t=0;for(;t<e.length;){this.S.c===tb&&(Hg(this.S.t0,this.S.c),Vg(this.S,!1),this.S.c=0);let r=tb-this.S.c;this.S.b.set(e.subarray(t,t+r),this.S.c);const i=Math.min(r,e.length-t);this.S.c+=i,t+=i}return this}digest(e){Hg(this.S.t0,this.S.c),this.S.b.fill(0,this.S.c),this.S.c=tb,Vg(this.S,!0);const t=e||new Uint8Array(this.S.outlen);for(let e=0;e<this.S.outlen;e++)t[e]=this.S.h[e>>2]>>8*(3&e);return this.S.h=null,t.buffer}}function Yg(e,t,r,i){if(e>Zg)throw Error(`outlen must be at most ${Zg} (given: ${e})`);if(t){if(!(t instanceof Uint8Array))throw Error("key must be Uint8Array or Buffer");if(t.length>Xg)throw Error(`key size must be at most ${Xg} (given: ${t.length})`)}if(r){if(!(r instanceof Uint8Array))throw Error("salt must be Uint8Array or Buffer");if(r.length!==$g)throw Error(`salt must be exactly ${$g} (given: ${r.length}`)}if(i){if(!(i instanceof Uint8Array))throw Error("personal must be Uint8Array or Buffer");if(i.length!==eb)throw Error(`salt must be exactly ${eb} (given: ${i.length}`)}return new Jg(e,t,r,i)}const Zg=64,Xg=64,$g=16,eb=16,tb=128,rb=2,ib=19,nb=4294967295,ab=4,sb=4294967295,ob=8,cb=4294967295,ub=8,hb=4294967295,fb=4294967295,db=32,lb=1024,pb=64,yb=205===new Uint8Array(new Uint16Array([43981]).buffer)[0];function gb(e,t,r){return e[r+0]=t,e[r+1]=t>>8,e[r+2]=t>>16,e[r+3]=t>>24,e}function bb(e,t,r){if(t>Number.MAX_SAFE_INTEGER)throw Error("LE64: large numbers unsupported");let i=t;for(let t=r;t<r+7;t++)e[t]=i,i=(i-e[t])/256;return e}function mb(e,t,r){const i=new Uint8Array(64),n=new Uint8Array(4+t.length);if(gb(n,e,0),n.set(t,4),e<=64)return Yg(e).update(n).digest(r),r;const a=Math.ceil(e/32)-2;for(let e=0;e<a;e++)Yg(64).update(0===e?n:i).digest(i),r.set(i.subarray(0,32),32*e);const s=new Uint8Array(Yg(e-32*a).update(i).digest());return r.set(s,32*a),r}function wb(e,t,r,i){return e.fn.XOR(t.byteOffset,r.byteOffset,i.byteOffset),t}function Ab(e,t,r,i){return e.fn.G(t.byteOffset,r.byteOffset,i.byteOffset,e.refs.gZ.byteOffset),i}function vb(e,t,r,i){return e.fn.G2(t.byteOffset,r.byteOffset,i.byteOffset,e.refs.gZ.byteOffset),i}function*_b(e,t,r,i,n,a,s,o){e.refs.prngTmp.fill(0);const c=e.refs.prngTmp.subarray(0,48);bb(c,t,0),bb(c,r,8),bb(c,i,16),bb(c,n,24),bb(c,a,32),bb(c,rb,40);for(let t=1;t<=s;t++){bb(e.refs.prngTmp,t,c.length);const r=vb(e,e.refs.ZERO1024,e.refs.prngTmp,e.refs.prngR);for(let e=1===t?8*o:0;e<r.length;e+=8)yield r.subarray(e,e+8)}return[]}const kb=1024,Eb=64*kb;function Sb(e,{memory:t,instance:r}){if(!yb)throw Error("BigEndian system not supported");const i=function({type:e,version:t,tagLength:r,password:i,salt:n,ad:a,secret:s,parallelism:o,memorySize:c,passes:u}){const h=(e,t,r,i)=>{if(t<r||t>i)throw Error(`${e} size should be between ${r} and ${i} bytes`)};if(e!==rb||t!==ib)throw Error("Unsupported type or version");return h("password",i,ub,cb),h("salt",n,ob,sb),h("tag",r,ab,nb),h("memory",c,8*o,hb),a&&h("associated data",a,0,fb),s&&h("secret",s,0,db),{type:e,version:t,tagLength:r,password:i,salt:n,ad:a,secret:s,lanes:o,memorySize:c,passes:u}}({type:rb,version:ib,...e}),{G:n,G2:a,xor:s,getLZ:o}=r.exports,c={},u={};u.G=n,u.G2=a,u.XOR=s;const h=4*i.lanes*Math.floor(i.memorySize/(4*i.lanes)),f=h*lb+10*kb;if(t.buffer.byteLength<f){const e=Math.ceil((f-t.buffer.byteLength)/Eb);t.grow(e)}let d=0;c.gZ=new Uint8Array(t.buffer,d,lb),d+=c.gZ.length,c.prngR=new Uint8Array(t.buffer,d,lb),d+=c.prngR.length,c.prngTmp=new Uint8Array(t.buffer,d,lb),d+=c.prngTmp.length,c.ZERO1024=new Uint8Array(t.buffer,d,1024),d+=c.ZERO1024.length;const l=new Uint32Array(t.buffer,d,2);d+=l.length*Uint32Array.BYTES_PER_ELEMENT;const p={fn:u,refs:c},y=new Uint8Array(t.buffer,d,lb);d+=y.length;const g=new Uint8Array(t.buffer,d,i.memorySize*lb),b=new Uint8Array(t.buffer,0,d),m=function(e){const t=Yg(pb),r=new Uint8Array(4),i=new Uint8Array(24);gb(i,e.lanes,0),gb(i,e.tagLength,4),gb(i,e.memorySize,8),gb(i,e.passes,12),gb(i,e.version,16),gb(i,e.type,20);const n=[i];e.password?(n.push(gb(new Uint8Array(4),e.password.length,0)),n.push(e.password)):n.push(r);e.salt?(n.push(gb(new Uint8Array(4),e.salt.length,0)),n.push(e.salt)):n.push(r);e.secret?(n.push(gb(new Uint8Array(4),e.secret.length,0)),n.push(e.secret)):n.push(r);e.ad?(n.push(gb(new Uint8Array(4),e.ad.length,0)),n.push(e.ad)):n.push(r);t.update(function(e){if(1===e.length)return e[0];let t=0;for(let r=0;r<e.length;r++){if(!(e[r]instanceof Uint8Array))throw Error("concatArrays: Data must be in the form of a Uint8Array");t+=e[r].length}const r=new Uint8Array(t);let i=0;return e.forEach((e=>{r.set(e,i),i+=e.length})),r}(n));const a=t.digest();return new Uint8Array(a)}(i),w=h/i.lanes,A=Array(i.lanes).fill(null).map((()=>Array(w))),v=(e,t)=>(A[e][t]=g.subarray(e*w*1024+1024*t,e*w*1024+1024*t+lb),A[e][t]);for(let e=0;e<i.lanes;e++){const t=new Uint8Array(m.length+8);t.set(m),gb(t,0,m.length),gb(t,e,m.length+4),mb(lb,t,v(e,0)),gb(t,1,m.length),mb(lb,t,v(e,1))}const _=w/4;for(let e=0;e<i.passes;e++)for(let t=0;t<4;t++){const r=0===e&&t<=1;for(let n=0;n<i.lanes;n++){let a=0===t&&0===e?2:0;const s=r?_b(p,e,n,t,h,i.passes,_,a):null;for(;a<_;a++){const c=t*_+a,u=c>0?A[n][c-1]:A[n][w-1],h=r?s.next().value:u;o(l.byteOffset,h.byteOffset,n,i.lanes,e,t,a,4,_);const f=l[0],d=l[1];0===e&&v(n,c),Ab(p,u,A[f][d],e>0?y:A[n][c]),e>0&&wb(p,A[n][c],y,A[n][c])}}}const k=A[0][w-1];for(let e=1;e<i.lanes;e++)wb(p,k,k,A[e][w-1]);const E=mb(i.tagLength,k,new Uint8Array(i.tagLength));return b.fill(0),t.grow(0),E}let Cb;async function Ib(e,t){const r=new WebAssembly.Memory({initial:1040,maximum:65536}),i=await async function(e,t,r){const i={env:{memory:e}};if(void 0===Cb)try{const e=await t(i);return Cb=!0,e}catch(e){Cb=!1}return(Cb?t:r)(i)}(r,e,t);return e=>Sb(e,{instance:i.instance,memory:r})}function Bb(t,r,i,n){function a(e,t,r){var i=r?WebAssembly.instantiateStreaming:WebAssembly.instantiate,n=r?WebAssembly.compileStreaming:WebAssembly.compile;return t?i(e,t):n(e)}var s=null;if(r)return a(fetch(r),n,!0);var o=e.atob(i),c=o.length;s=new Uint8Array(new ArrayBuffer(c));for(var u=0;u<c;u++)s[u]=o.charCodeAt(u);if(t){var h=new WebAssembly.Module(s);return n?new WebAssembly.Instance(h,n):h}return a(s,n,!1)}var Pb=/*#__PURE__*/Object.freeze({__proto__:null,default:async()=>Ib((e=>Bb(0,null,"AGFzbQEAAAABKwdgBH9/f38AYAABf2AAAGADf39/AGAJf39/f39/f39/AX9gAX8AYAF/AX8CEwEDZW52Bm1lbW9yeQIBkAiAgAQDCgkCAwAABAEFBgEEBQFwAQICBgkBfwFBkIjAAgsHfQoDeG9yAAEBRwACAkcyAAMFZ2V0TFoABBlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALX2luaXRpYWxpemUAABBfX2Vycm5vX2xvY2F0aW9uAAgJc3RhY2tTYXZlAAUMc3RhY2tSZXN0b3JlAAYKc3RhY2tBbGxvYwAHCQcBAEEBCwEACs0gCQMAAQtYAQJ/A0AgACAEQQR0IgNqIAIgA2r9AAQAIAEgA2r9AAQA/VH9CwQAIAAgA0EQciIDaiACIANq/QAEACABIANq/QAEAP1R/QsEACAEQQJqIgRBwABHDQALC7ceAgt7A38DQCADIBFBBHQiD2ogASAPav0ABAAgACAPav0ABAD9USIF/QsEACACIA9qIAX9CwQAIAMgD0EQciIPaiABIA9q/QAEACAAIA9q/QAEAP1RIgX9CwQAIAIgD2ogBf0LBAAgEUECaiIRQcAARw0ACwNAIAMgEEEHdGoiAEEQaiAA/QAEcCAA/QAEMCIFIAD9AAQQIgT9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAQgBP0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgT9USIJQSD9ywEgCUEg/c0B/VAiCSAA/QAEUCIG/c4BIAkgCf0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIGIAX9USIFQSj9ywEgBUEY/c0B/VAiCCAE/c4BIAggCP0NAAECAwgJCgsAAQIDCAkKCyAEIAT9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIKIAogCf1RIgVBMP3LASAFQRD9zQH9UCIFIAb9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAYgBv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgkgCP1RIgRBAf3LASAEQT/9zQH9UCIMIAD9AARgIAD9AAQgIgQgAP0ABAAiBv3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBv1RIghBIP3LASAIQSD9zQH9UCIIIABBQGsiAf0ABAAiB/3OASAIIAj9DQABAgMICQoLAAECAwgJCgsgByAH/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiByAE/VEiBEEo/csBIARBGP3NAf1QIgsgBv3OASALIAv9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBiAI/VEiBEEw/csBIARBEP3NAf1QIgQgB/3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgByAH/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCCAL/VEiB0EB/csBIAdBP/3NAf1QIg0gDf0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eHyIH/c4BIAcgB/0NAAECAwgJCgsAAQIDCAkKCyAKIAr9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIKIAQgBSAF/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/VEiC0Eg/csBIAtBIP3NAf1QIgsgCP3OASALIAv9DQABAgMICQoLAAECAwgJCgsgCCAI/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCCAH/VEiB0Eo/csBIAdBGP3NAf1QIgcgCv3OASAHIAf9DQABAgMICQoLAAECAwgJCgsgCiAK/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiDv0LBAAgACAGIA0gDCAM/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4fIgr9zgEgCiAK/Q0AAQIDCAkKCwABAgMICQoLIAYgBv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgYgBSAEIAT9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9USIFQSD9ywEgBUEg/c0B/VAiBSAJ/c4BIAUgBf0NAAECAwgJCgsAAQIDCAkKCyAJIAn9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIJIAr9USIEQSj9ywEgBEEY/c0B/VAiCiAG/c4BIAogCv0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIE/QsEACAAIAQgBf1RIgVBMP3LASAFQRD9zQH9UCIFIA4gC/1RIgRBMP3LASAEQRD9zQH9UCIEIAT9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9CwRgIAAgBCAFIAX9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9CwRwIAEgBCAI/c4BIAQgBP0NAAECAwgJCgsAAQIDCAkKCyAIIAj9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIE/QsEACAAIAUgCf3OASAFIAX9DQABAgMICQoLAAECAwgJCgsgCSAJ/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCf0LBFAgACAEIAf9USIFQQH9ywEgBUE//c0B/VAiBSAJIAr9USIEQQH9ywEgBEE//c0B/VAiBCAE/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/QsEICAAIAQgBSAF/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/QsEMCAQQQFqIhBBCEcNAAtBACEQA0AgAyAQQQR0aiIAQYABaiAA/QAEgAcgAP0ABIADIgUgAP0ABIABIgT9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAQgBP0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgT9USIJQSD9ywEgCUEg/c0B/VAiCSAA/QAEgAUiBv3OASAJIAn9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBiAF/VEiBUEo/csBIAVBGP3NAf1QIgggBP3OASAIIAj9DQABAgMICQoLAAECAwgJCgsgBCAE/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCiAKIAn9USIFQTD9ywEgBUEQ/c0B/VAiBSAG/c4BIAUgBf0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIJIAj9USIEQQH9ywEgBEE//c0B/VAiDCAA/QAEgAYgAP0ABIACIgQgAP0ABAAiBv3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBv1RIghBIP3LASAIQSD9zQH9UCIIIAD9AASABCIH/c4BIAggCP0NAAECAwgJCgsAAQIDCAkKCyAHIAf9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIHIAT9USIEQSj9ywEgBEEY/c0B/VAiCyAG/c4BIAsgC/0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIGIAj9USIEQTD9ywEgBEEQ/c0B/VAiBCAH/c4BIAQgBP0NAAECAwgJCgsAAQIDCAkKCyAHIAf9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIIIAv9USIHQQH9ywEgB0E//c0B/VAiDSAN/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4fIgf9zgEgByAH/Q0AAQIDCAkKCwABAgMICQoLIAogCv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgogBCAFIAX9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9USILQSD9ywEgC0Eg/c0B/VAiCyAI/c4BIAsgC/0NAAECAwgJCgsAAQIDCAkKCyAIIAj9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIIIAf9USIHQSj9ywEgB0EY/c0B/VAiByAK/c4BIAcgB/0NAAECAwgJCgsAAQIDCAkKCyAKIAr9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIO/QsEACAAIAYgDSAMIAz9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh8iCv3OASAKIAr9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBiAFIAQgBP0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eH/1RIgVBIP3LASAFQSD9zQH9UCIFIAn9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAkgCf0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgkgCv1RIgRBKP3LASAEQRj9zQH9UCIKIAb9zgEgCiAK/Q0AAQIDCAkKCwABAgMICQoLIAYgBv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgT9CwQAIAAgBCAF/VEiBUEw/csBIAVBEP3NAf1QIgUgDiAL/VEiBEEw/csBIARBEP3NAf1QIgQgBP0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eH/0LBIAGIAAgBCAFIAX9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9CwSAByAAIAQgCP3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgCCAI/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBP0LBIAEIAAgBSAJ/c4BIAUgBf0NAAECAwgJCgsAAQIDCAkKCyAJIAn9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIJ/QsEgAUgACAEIAf9USIFQQH9ywEgBUE//c0B/VAiBSAJIAr9USIEQQH9ywEgBEE//c0B/VAiBCAE/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/QsEgAIgACAEIAUgBf0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eH/0LBIADIBBBAWoiEEEIRw0AC0EAIRADQCACIBBBBHQiAGoiASAAIANq/QAEACAB/QAEAP1R/QsEACACIABBEHIiAWoiDyABIANq/QAEACAP/QAEAP1R/QsEACACIABBIHIiAWoiDyABIANq/QAEACAP/QAEAP1R/QsEACACIABBMHIiAGoiASAAIANq/QAEACAB/QAEAP1R/QsEACAQQQRqIhBBwABHDQALCxYAIAAgASACIAMQAiAAIAIgAiADEAILewIBfwF+IAIhCSABNQIAIQogBCAFcgRAIAEoAgQgA3AhCQsgACAJNgIAIAAgB0EBayAFIAQbIAhsIAZBAWtBAEF/IAYbIAIgCUYbaiIBIAVBAWogCGxBACAEG2ogAa0gCiAKfkIgiH5CIIinQX9zaiAHIAhscDYCBCAACwQAIwALBgAgACQACxAAIwAgAGtBcHEiACQAIAALBQBBgAgL",e)),(e=>Bb(0,null,"AGFzbQEAAAABPwhgBH9/f38AYAABf2AAAGADf39/AGARf39/f39/f39/f39/f39/f38AYAl/f39/f39/f38Bf2ABfwBgAX8BfwITAQNlbnYGbWVtb3J5AgGQCICABAMLCgIDBAAABQEGBwEEBQFwAQICBgkBfwFBkIjAAgsHfQoDeG9yAAEBRwADAkcyAAQFZ2V0TFoABRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALX2luaXRpYWxpemUAABBfX2Vycm5vX2xvY2F0aW9uAAkJc3RhY2tTYXZlAAYMc3RhY2tSZXN0b3JlAAcKc3RhY2tBbGxvYwAICQcBAEEBCwEACssaCgMAAQtQAQJ/A0AgACAEQQN0IgNqIAIgA2opAwAgASADaikDAIU3AwAgACADQQhyIgNqIAIgA2opAwAgASADaikDAIU3AwAgBEECaiIEQYABRw0ACwveDwICfgF/IAAgAUEDdGoiEyATKQMAIhEgACAFQQN0aiIBKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA1BA3RqIgUgESAFKQMAhUIgiSIRNwMAIAAgCUEDdGoiCSARIAkpAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAEgESABKQMAhUIoiSIRNwMAIBMgESATKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAFIBEgBSkDAIVCMIkiETcDACAJIBEgCSkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgASARIAEpAwCFQgGJNwMAIAAgAkEDdGoiDSANKQMAIhEgACAGQQN0aiICKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA5BA3RqIgYgESAGKQMAhUIgiSIRNwMAIAAgCkEDdGoiCiARIAopAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAIgESACKQMAhUIoiSIRNwMAIA0gESANKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAGIBEgBikDAIVCMIkiETcDACAKIBEgCikDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAiARIAIpAwCFQgGJNwMAIAAgA0EDdGoiDiAOKQMAIhEgACAHQQN0aiIDKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA9BA3RqIgcgESAHKQMAhUIgiSIRNwMAIAAgC0EDdGoiCyARIAspAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAMgESADKQMAhUIoiSIRNwMAIA4gESAOKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAHIBEgBykDAIVCMIkiETcDACALIBEgCykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAyARIAMpAwCFQgGJNwMAIAAgBEEDdGoiDyAPKQMAIhEgACAIQQN0aiIEKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIBBBA3RqIgggESAIKQMAhUIgiSIRNwMAIAAgDEEDdGoiACARIAApAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAQgESAEKQMAhUIoiSIRNwMAIA8gESAPKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAIIBEgCCkDAIVCMIkiETcDACAAIBEgACkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgBCARIAQpAwCFQgGJNwMAIBMgEykDACIRIAIpAwAiEnwgEUIBhkL+////H4MgEkL/////D4N+fCIRNwMAIAggESAIKQMAhUIgiSIRNwMAIAsgESALKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACACIBEgAikDAIVCKIkiETcDACATIBEgEykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgCCARIAgpAwCFQjCJIhE3AwAgCyARIAspAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAIgESACKQMAhUIBiTcDACANIA0pAwAiESADKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAFIBEgBSkDAIVCIIkiETcDACAAIBEgACkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAyARIAMpAwCFQiiJIhE3AwAgDSARIA0pAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAUgESAFKQMAhUIwiSIRNwMAIAAgESAAKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACADIBEgAykDAIVCAYk3AwAgDiAOKQMAIhEgBCkDACISfCARQgGGQv7///8fgyASQv////8Pg358IhE3AwAgBiARIAYpAwCFQiCJIhE3AwAgCSARIAkpAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAQgESAEKQMAhUIoiSIRNwMAIA4gESAOKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAGIBEgBikDAIVCMIkiETcDACAJIBEgCSkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgBCARIAQpAwCFQgGJNwMAIA8gDykDACIRIAEpAwAiEnwgEUIBhkL+////H4MgEkL/////D4N+fCIRNwMAIAcgESAHKQMAhUIgiSIRNwMAIAogESAKKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACABIBEgASkDAIVCKIkiETcDACAPIBEgDykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgByARIAcpAwCFQjCJIhE3AwAgCiARIAopAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAEgESABKQMAhUIBiTcDAAvdCAEPfwNAIAIgBUEDdCIGaiABIAZqKQMAIAAgBmopAwCFNwMAIAIgBkEIciIGaiABIAZqKQMAIAAgBmopAwCFNwMAIAVBAmoiBUGAAUcNAAsDQCADIARBA3QiAGogACACaikDADcDACADIARBAXIiAEEDdCIBaiABIAJqKQMANwMAIAMgBEECciIBQQN0IgVqIAIgBWopAwA3AwAgAyAEQQNyIgVBA3QiBmogAiAGaikDADcDACADIARBBHIiBkEDdCIHaiACIAdqKQMANwMAIAMgBEEFciIHQQN0IghqIAIgCGopAwA3AwAgAyAEQQZyIghBA3QiCWogAiAJaikDADcDACADIARBB3IiCUEDdCIKaiACIApqKQMANwMAIAMgBEEIciIKQQN0IgtqIAIgC2opAwA3AwAgAyAEQQlyIgtBA3QiDGogAiAMaikDADcDACADIARBCnIiDEEDdCINaiACIA1qKQMANwMAIAMgBEELciINQQN0Ig5qIAIgDmopAwA3AwAgAyAEQQxyIg5BA3QiD2ogAiAPaikDADcDACADIARBDXIiD0EDdCIQaiACIBBqKQMANwMAIAMgBEEOciIQQQN0IhFqIAIgEWopAwA3AwAgAyAEQQ9yIhFBA3QiEmogAiASaikDADcDACADIARB//8DcSAAQf//A3EgAUH//wNxIAVB//8DcSAGQf//A3EgB0H//wNxIAhB//8DcSAJQf//A3EgCkH//wNxIAtB//8DcSAMQf//A3EgDUH//wNxIA5B//8DcSAPQf//A3EgEEH//wNxIBFB//8DcRACIARB8ABJIQAgBEEQaiEEIAANAAtBACEBIANBAEEBQRBBEUEgQSFBMEExQcAAQcEAQdAAQdEAQeAAQeEAQfAAQfEAEAIgA0ECQQNBEkETQSJBI0EyQTNBwgBBwwBB0gBB0wBB4gBB4wBB8gBB8wAQAiADQQRBBUEUQRVBJEElQTRBNUHEAEHFAEHUAEHVAEHkAEHlAEH0AEH1ABACIANBBkEHQRZBF0EmQSdBNkE3QcYAQccAQdYAQdcAQeYAQecAQfYAQfcAEAIgA0EIQQlBGEEZQShBKUE4QTlByABByQBB2ABB2QBB6ABB6QBB+ABB+QAQAiADQQpBC0EaQRtBKkErQTpBO0HKAEHLAEHaAEHbAEHqAEHrAEH6AEH7ABACIANBDEENQRxBHUEsQS1BPEE9QcwAQc0AQdwAQd0AQewAQe0AQfwAQf0AEAIgA0EOQQ9BHkEfQS5BL0E+QT9BzgBBzwBB3gBB3wBB7gBB7wBB/gBB/wAQAgNAIAIgAUEDdCIAaiIEIAAgA2opAwAgBCkDAIU3AwAgAiAAQQhyIgRqIgUgAyAEaikDACAFKQMAhTcDACACIABBEHIiBGoiBSADIARqKQMAIAUpAwCFNwMAIAIgAEEYciIAaiIEIAAgA2opAwAgBCkDAIU3AwAgAUEEaiIBQYABRw0ACwsWACAAIAEgAiADEAMgACACIAIgAxADC3sCAX8BfiACIQkgATUCACEKIAQgBXIEQCABKAIEIANwIQkLIAAgCTYCACAAIAdBAWsgBSAEGyAIbCAGQQFrQQBBfyAGGyACIAlGG2oiASAFQQFqIAhsQQAgBBtqIAGtIAogCn5CIIh+QiCIp0F/c2ogByAIbHA2AgQgAAsEACMACwYAIAAkAAsQACMAIABrQXBxIgAkACAACwUAQYAICw==",e)))});export{Hu as AEADEncryptedDataPacket,Jh as CleartextMessage,Ku as CompressedDataPacket,ba as KDFParams,Eu as LiteralDataPacket,Zu as MarkerPacket,Oh as Message,Pu as OnePassSignaturePacket,Du as PacketList,xh as PrivateKey,Dh as PublicKey,ju as PublicKeyEncryptedSessionKeyPacket,Vu as PublicKeyPacket,Xu as PublicSubkeyPacket,eh as SecretKeyPacket,nh as SecretSubkeyPacket,oh as Signature,Iu as SignaturePacket,Ch as Subkey,qu as SymEncryptedIntegrityProtectedDataPacket,Wu as SymEncryptedSessionKeyPacket,Yu as SymmetricallyEncryptedDataPacket,ah as TrustPacket,bn as UnparseablePacket,$u as UserAttributePacket,ih as UserIDPacket,le as armor,ne as config,Zh as createCleartextMessage,Wh as createMessage,af as decrypt,tf as decryptKey,hf as decryptSessionKeys,nf as encrypt,rf as encryptKey,uf as encryptSessionKey,V as enums,Xh as generateKey,cf as generateSessionKey,Yh as readCleartextMessage,Th as readKey,zh as readKeys,Gh as readMessage,Qh as readPrivateKey,Fh as readPrivateKeys,ch as readSignature,$h as reformatKey,ef as revokeKey,sf as sign,de as unarmor,of as verify};
|
|
16
|
+
***************************************************************************** */function ry(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+t+" is not a constructor or null");function r(){this.constructor=e}ty(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function iy(e){if(!e)throw new TypeError("Assertion failed")}function ny(){}function ay(e){return"object"==typeof e&&null!==e||"function"==typeof e}function sy(e){if("function"!=typeof e)return!1;var t=!1;try{new e({start:function(){t=!0}})}catch(e){}return t}function oy(e){return!!ay(e)&&"function"==typeof e.getReader}function cy(e){return!!ay(e)&&"function"==typeof e.getWriter}function uy(e){return!!ay(e)&&(!!oy(e.readable)&&!!cy(e.writable))}function hy(e){try{return e.getReader({mode:"byob"}).releaseLock(),!0}catch(e){return!1}}function fy(e,t){var r=(void 0===t?{}:t).type;return iy(oy(e)),iy(!1===e.locked),"bytes"===(r=dy(r))?new gy(e):new py(e)}function dy(e){var t=e+"";if("bytes"===t)return t;if(void 0===e)return e;throw new RangeError("Invalid type is specified")}var ly=function(){function e(e){this._underlyingReader=void 0,this._readerMode=void 0,this._readableStreamController=void 0,this._pendingRead=void 0,this._underlyingStream=e,this._attachDefaultReader()}return e.prototype.start=function(e){this._readableStreamController=e},e.prototype.cancel=function(e){return iy(void 0!==this._underlyingReader),this._underlyingReader.cancel(e)},e.prototype._attachDefaultReader=function(){if("default"!==this._readerMode){this._detachReader();var e=this._underlyingStream.getReader();this._readerMode="default",this._attachReader(e)}},e.prototype._attachReader=function(e){var t=this;iy(void 0===this._underlyingReader),this._underlyingReader=e;var r=this._underlyingReader.closed;r&&r.then((function(){return t._finishPendingRead()})).then((function(){e===t._underlyingReader&&t._readableStreamController.close()}),(function(r){e===t._underlyingReader&&t._readableStreamController.error(r)})).catch(ny)},e.prototype._detachReader=function(){void 0!==this._underlyingReader&&(this._underlyingReader.releaseLock(),this._underlyingReader=void 0,this._readerMode=void 0)},e.prototype._pullWithDefaultReader=function(){var e=this;this._attachDefaultReader();var t=this._underlyingReader.read().then((function(t){var r=e._readableStreamController;t.done?e._tryClose():r.enqueue(t.value)}));return this._setPendingRead(t),t},e.prototype._tryClose=function(){try{this._readableStreamController.close()}catch(e){}},e.prototype._setPendingRead=function(e){var t,r=this,i=function(){r._pendingRead===t&&(r._pendingRead=void 0)};this._pendingRead=t=e.then(i,i)},e.prototype._finishPendingRead=function(){var e=this;if(this._pendingRead){var t=function(){return e._finishPendingRead()};return this._pendingRead.then(t,t)}},e}(),py=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ry(t,e),t.prototype.pull=function(){return this._pullWithDefaultReader()},t}(ly);function yy(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var gy=function(e){function t(t){var r=this,i=hy(t);return(r=e.call(this,t)||this)._supportsByob=i,r}return ry(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return"bytes"},enumerable:!1,configurable:!0}),t.prototype._attachByobReader=function(){if("byob"!==this._readerMode){iy(this._supportsByob),this._detachReader();var e=this._underlyingStream.getReader({mode:"byob"});this._readerMode="byob",this._attachReader(e)}},t.prototype.pull=function(){if(this._supportsByob){var e=this._readableStreamController.byobRequest;if(e)return this._pullWithByobRequest(e)}return this._pullWithDefaultReader()},t.prototype._pullWithByobRequest=function(e){var t=this;this._attachByobReader();var r=new Uint8Array(e.view.byteLength),i=this._underlyingReader.read(r).then((function(r){var i,n,a;t._readableStreamController,r.done?(t._tryClose(),e.respond(0)):(i=r.value,n=e.view,a=yy(i),yy(n).set(a,0),e.respond(r.value.byteLength))}));return this._setPendingRead(i),i},t}(ly);function by(e){iy(cy(e)),iy(!1===e.locked);var t=e.getWriter();return new my(t)}var my=function(){function e(e){var t=this;this._writableStreamController=void 0,this._pendingWrite=void 0,this._state="writable",this._storedError=void 0,this._underlyingWriter=e,this._errorPromise=new Promise((function(e,r){t._errorPromiseReject=r})),this._errorPromise.catch(ny)}return e.prototype.start=function(e){var t=this;this._writableStreamController=e,this._underlyingWriter.closed.then((function(){t._state="closed"})).catch((function(e){return t._finishErroring(e)}))},e.prototype.write=function(e){var t=this,r=this._underlyingWriter;if(null===r.desiredSize)return r.ready;var i=r.write(e);i.catch((function(e){return t._finishErroring(e)})),r.ready.catch((function(e){return t._startErroring(e)}));var n=Promise.race([i,this._errorPromise]);return this._setPendingWrite(n),n},e.prototype.close=function(){var e=this;return void 0===this._pendingWrite?this._underlyingWriter.close():this._finishPendingWrite().then((function(){return e.close()}))},e.prototype.abort=function(e){if("errored"!==this._state)return this._underlyingWriter.abort(e)},e.prototype._setPendingWrite=function(e){var t,r=this,i=function(){r._pendingWrite===t&&(r._pendingWrite=void 0)};this._pendingWrite=t=e.then(i,i)},e.prototype._finishPendingWrite=function(){var e=this;if(void 0===this._pendingWrite)return Promise.resolve();var t=function(){return e._finishPendingWrite()};return this._pendingWrite.then(t,t)},e.prototype._startErroring=function(e){var t=this;if("writable"===this._state){this._state="erroring",this._storedError=e;var r=function(){return t._finishErroring(e)};void 0===this._pendingWrite?r():this._finishPendingWrite().then(r,r),this._writableStreamController.error(e)}},e.prototype._finishErroring=function(e){"writable"===this._state&&this._startErroring(e),"erroring"===this._state&&(this._state="errored",this._errorPromiseReject(this._storedError))},e}();function wy(e){iy(uy(e));var t=e.readable,r=e.writable;iy(!1===t.locked),iy(!1===r.locked);var i,n=t.getReader();try{i=r.getWriter()}catch(e){throw n.releaseLock(),e}return new Ay(n,i)}var Ay=function(){function e(e,t){var r=this;this._transformStreamController=void 0,this._onRead=function(e){if(!e.done)return r._transformStreamController.enqueue(e.value),r._reader.read().then(r._onRead)},this._onError=function(e){r._flushReject(e),r._transformStreamController.error(e),r._reader.cancel(e).catch(ny),r._writer.abort(e).catch(ny)},this._onTerminate=function(){r._flushResolve(),r._transformStreamController.terminate();var e=new TypeError("TransformStream terminated");r._writer.abort(e).catch(ny)},this._reader=e,this._writer=t,this._flushPromise=new Promise((function(e,t){r._flushResolve=e,r._flushReject=t}))}return e.prototype.start=function(e){this._transformStreamController=e,this._reader.read().then(this._onRead).then(this._onTerminate,this._onError);var t=this._reader.closed;t&&t.then(this._onTerminate,this._onError)},e.prototype.transform=function(e){return this._writer.write(e)},e.prototype.flush=function(){var e=this;return this._writer.close().then((function(){return e._flushPromise}))},e}(),vy=/*#__PURE__*/Object.freeze({__proto__:null,createReadableStreamWrapper:function(e){iy(function(e){return!!sy(e)&&!!oy(new e)}(e));var t=function(e){try{return new e({type:"bytes"}),!0}catch(e){return!1}}(e);return function(r,i){var n=(void 0===i?{}:i).type;if("bytes"!==(n=dy(n))||t||(n=void 0),r.constructor===e&&("bytes"!==n||hy(r)))return r;if("bytes"===n){var a=fy(r,{type:n});return new e(a)}a=fy(r);return new e(a)}},createTransformStreamWrapper:function(e){return iy(function(e){return!!sy(e)&&!!uy(new e)}(e)),function(t){if(t.constructor===e)return t;var r=wy(t);return new e(r)}},createWrappingReadableSource:fy,createWrappingTransformer:wy,createWrappingWritableSink:by,createWritableStreamWrapper:function(e){return iy(function(e){return!!sy(e)&&!!cy(new e)}(e)),function(t){if(t.constructor===e)return t;var r=by(t);return new e(r)}}}),_y=it((function(e){!function(e,t){function r(e,t){if(!e)throw Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{a=void 0}catch(e){}function s(e,t,r){for(var i=0,n=Math.min(e.length,r),a=t;a<n;a++){var s=e.charCodeAt(a)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function o(e,t,r,i){for(var n=0,a=Math.min(e.length,r),s=t;s<a;s++){var o=e.charCodeAt(s)-48;n*=i,n+=o>=49?o-49+10:o>=17?o-17+10:o}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&n++,16===t?this._parseHex(e,n):this._parseBase(e,t,n),"-"===e[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,s,o=0;if("be"===i)for(n=e.length-1,a=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===i)for(n=0,a=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},n.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,a=0;for(r=e.length-6,i=0;r>=t;r-=6)n=s(e,r,r+6),this.words[i]|=n<<a&67108863,this.words[i+1]|=n>>>26-a&4194303,(a+=24)>=26&&(a-=26,i++);r+6!==t&&(n=s(e,t,r+6),this.words[i]|=n<<a&67108863,this.words[i+1]|=n>>>26-a&4194303),this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,s=a%i,c=Math.min(a,a-s)+r,u=0,h=r;h<c;h+=i)u=o(e,h,h+i,t),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=o(e,h,e.length,t),h=0;h<s;h++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},n.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],a=0|t.words[0],s=n*a,o=67108863&s,c=s/67108864|0;r.words[0]=o;for(var u=1;u<i;u++){for(var h=c>>>26,f=67108863&c,d=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=d;l++){var p=u-l|0;h+=(s=(n=0|e.words[p])*(a=0|t.words[l])+f)/67108864|0,f=67108863&s}r.words[u]=0|f,c=0|h}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,a=0,s=0;s<this.length;s++){var o=this.words[s],f=(16777215&(o<<n|a)).toString(16);i=0!==(a=o>>>24-n&16777215)||s!==this.length-1?c[6-f.length]+f+i:f+i,(n+=2)>=26&&(n-=26,s--)}for(0!==a&&(i=a.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],l=h[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(l).toString(e);i=(p=p.idivn(l)).isZero()?y+i:c[d-y.length]+y+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),a=i||Math.max(1,n);r(n<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var s,o,c="le"===t,u=new e(a),h=this.clone();if(c){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),u[o]=s;for(;o<a;o++)u[o]=0}else{for(o=0;o<a-n;o++)u[o]=0;for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),u[a-o-1]=s}return u},n.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,a=0;a<i.length;a++)t=(0|r.words[a])+(0|i.words[a])+n,this.words[a]=67108863&t,n=t>>>26;for(;0!==n&&a<r.length;a++)t=(0|r.words[a])+n,this.words[a]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var a=0,s=0;s<i.length;s++)a=(t=(0|r.words[s])-(0|i.words[s])+a)>>26,this.words[s]=67108863&t;for(;0!==a&&s<r.length;s++)a=(t=(0|r.words[s])+a)>>26,this.words[s]=67108863&t;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,a,s=e.words,o=t.words,c=r.words,u=0,h=0|s[0],f=8191&h,d=h>>>13,l=0|s[1],p=8191&l,y=l>>>13,g=0|s[2],b=8191&g,m=g>>>13,w=0|s[3],A=8191&w,v=w>>>13,_=0|s[4],k=8191&_,E=_>>>13,S=0|s[5],C=8191&S,I=S>>>13,B=0|s[6],P=8191&B,M=B>>>13,D=0|s[7],x=8191&D,K=D>>>13,U=0|s[8],R=8191&U,T=U>>>13,Q=0|s[9],z=8191&Q,F=Q>>>13,L=0|o[0],N=8191&L,q=L>>>13,O=0|o[1],H=8191&O,j=O>>>13,G=0|o[2],W=8191&G,V=G>>>13,J=0|o[3],Y=8191&J,Z=J>>>13,X=0|o[4],$=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ie=te>>>13,ne=0|o[6],ae=8191&ne,se=ne>>>13,oe=0|o[7],ce=8191&oe,ue=oe>>>13,he=0|o[8],fe=8191&he,de=he>>>13,le=0|o[9],pe=8191&le,ye=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(f,N))|0)+((8191&(n=(n=Math.imul(f,q))+Math.imul(d,N)|0))<<13)|0;u=((a=Math.imul(d,q))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,N),n=(n=Math.imul(p,q))+Math.imul(y,N)|0,a=Math.imul(y,q);var be=(u+(i=i+Math.imul(f,H)|0)|0)+((8191&(n=(n=n+Math.imul(f,j)|0)+Math.imul(d,H)|0))<<13)|0;u=((a=a+Math.imul(d,j)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,N),n=(n=Math.imul(b,q))+Math.imul(m,N)|0,a=Math.imul(m,q),i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,j)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,j)|0;var me=(u+(i=i+Math.imul(f,W)|0)|0)+((8191&(n=(n=n+Math.imul(f,V)|0)+Math.imul(d,W)|0))<<13)|0;u=((a=a+Math.imul(d,V)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(A,N),n=(n=Math.imul(A,q))+Math.imul(v,N)|0,a=Math.imul(v,q),i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,j)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,j)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,V)|0;var we=(u+(i=i+Math.imul(f,Y)|0)|0)+((8191&(n=(n=n+Math.imul(f,Z)|0)+Math.imul(d,Y)|0))<<13)|0;u=((a=a+Math.imul(d,Z)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(k,N),n=(n=Math.imul(k,q))+Math.imul(E,N)|0,a=Math.imul(E,q),i=i+Math.imul(A,H)|0,n=(n=n+Math.imul(A,j)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,j)|0,i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,V)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(y,Y)|0,a=a+Math.imul(y,Z)|0;var Ae=(u+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;u=((a=a+Math.imul(d,ee)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(C,N),n=(n=Math.imul(C,q))+Math.imul(I,N)|0,a=Math.imul(I,q),i=i+Math.imul(k,H)|0,n=(n=n+Math.imul(k,j)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,j)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(v,W)|0,a=a+Math.imul(v,V)|0,i=i+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,Z)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,ee)|0;var ve=(u+(i=i+Math.imul(f,re)|0)|0)+((8191&(n=(n=n+Math.imul(f,ie)|0)+Math.imul(d,re)|0))<<13)|0;u=((a=a+Math.imul(d,ie)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(P,N),n=(n=Math.imul(P,q))+Math.imul(M,N)|0,a=Math.imul(M,q),i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,j)|0)+Math.imul(I,H)|0,a=a+Math.imul(I,j)|0,i=i+Math.imul(k,W)|0,n=(n=n+Math.imul(k,V)|0)+Math.imul(E,W)|0,a=a+Math.imul(E,V)|0,i=i+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(v,Y)|0,a=a+Math.imul(v,Z)|0,i=i+Math.imul(b,$)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ie)|0;var _e=(u+(i=i+Math.imul(f,ae)|0)|0)+((8191&(n=(n=n+Math.imul(f,se)|0)+Math.imul(d,ae)|0))<<13)|0;u=((a=a+Math.imul(d,se)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(x,N),n=(n=Math.imul(x,q))+Math.imul(K,N)|0,a=Math.imul(K,q),i=i+Math.imul(P,H)|0,n=(n=n+Math.imul(P,j)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,j)|0,i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(I,W)|0,a=a+Math.imul(I,V)|0,i=i+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(E,Y)|0,a=a+Math.imul(E,Z)|0,i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,ee)|0,i=i+Math.imul(b,re)|0,n=(n=n+Math.imul(b,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0,i=i+Math.imul(p,ae)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,se)|0;var ke=(u+(i=i+Math.imul(f,ce)|0)|0)+((8191&(n=(n=n+Math.imul(f,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((a=a+Math.imul(d,ue)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(R,N),n=(n=Math.imul(R,q))+Math.imul(T,N)|0,a=Math.imul(T,q),i=i+Math.imul(x,H)|0,n=(n=n+Math.imul(x,j)|0)+Math.imul(K,H)|0,a=a+Math.imul(K,j)|0,i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(M,W)|0,a=a+Math.imul(M,V)|0,i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(I,Y)|0,a=a+Math.imul(I,Z)|0,i=i+Math.imul(k,$)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(v,re)|0,a=a+Math.imul(v,ie)|0,i=i+Math.imul(b,ae)|0,n=(n=n+Math.imul(b,se)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,se)|0,i=i+Math.imul(p,ce)|0,n=(n=n+Math.imul(p,ue)|0)+Math.imul(y,ce)|0,a=a+Math.imul(y,ue)|0;var Ee=(u+(i=i+Math.imul(f,fe)|0)|0)+((8191&(n=(n=n+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;u=((a=a+Math.imul(d,de)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(z,N),n=(n=Math.imul(z,q))+Math.imul(F,N)|0,a=Math.imul(F,q),i=i+Math.imul(R,H)|0,n=(n=n+Math.imul(R,j)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,j)|0,i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(K,W)|0,a=a+Math.imul(K,V)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(M,Y)|0,a=a+Math.imul(M,Z)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,ee)|0,i=i+Math.imul(k,re)|0,n=(n=n+Math.imul(k,ie)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ie)|0,i=i+Math.imul(A,ae)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(v,ae)|0,a=a+Math.imul(v,se)|0,i=i+Math.imul(b,ce)|0,n=(n=n+Math.imul(b,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0,i=i+Math.imul(p,fe)|0,n=(n=n+Math.imul(p,de)|0)+Math.imul(y,fe)|0,a=a+Math.imul(y,de)|0;var Se=(u+(i=i+Math.imul(f,pe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ye)|0)+Math.imul(d,pe)|0))<<13)|0;u=((a=a+Math.imul(d,ye)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(z,H),n=(n=Math.imul(z,j))+Math.imul(F,H)|0,a=Math.imul(F,j),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(T,W)|0,a=a+Math.imul(T,V)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(K,Y)|0,a=a+Math.imul(K,Z)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,ee)|0,i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(I,re)|0,a=a+Math.imul(I,ie)|0,i=i+Math.imul(k,ae)|0,n=(n=n+Math.imul(k,se)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,se)|0,i=i+Math.imul(A,ce)|0,n=(n=n+Math.imul(A,ue)|0)+Math.imul(v,ce)|0,a=a+Math.imul(v,ue)|0,i=i+Math.imul(b,fe)|0,n=(n=n+Math.imul(b,de)|0)+Math.imul(m,fe)|0,a=a+Math.imul(m,de)|0;var Ce=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;u=((a=a+Math.imul(y,ye)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(z,W),n=(n=Math.imul(z,V))+Math.imul(F,W)|0,a=Math.imul(F,V),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(T,Y)|0,a=a+Math.imul(T,Z)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(K,$)|0,a=a+Math.imul(K,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(M,re)|0,a=a+Math.imul(M,ie)|0,i=i+Math.imul(C,ae)|0,n=(n=n+Math.imul(C,se)|0)+Math.imul(I,ae)|0,a=a+Math.imul(I,se)|0,i=i+Math.imul(k,ce)|0,n=(n=n+Math.imul(k,ue)|0)+Math.imul(E,ce)|0,a=a+Math.imul(E,ue)|0,i=i+Math.imul(A,fe)|0,n=(n=n+Math.imul(A,de)|0)+Math.imul(v,fe)|0,a=a+Math.imul(v,de)|0;var Ie=(u+(i=i+Math.imul(b,pe)|0)|0)+((8191&(n=(n=n+Math.imul(b,ye)|0)+Math.imul(m,pe)|0))<<13)|0;u=((a=a+Math.imul(m,ye)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(z,Y),n=(n=Math.imul(z,Z))+Math.imul(F,Y)|0,a=Math.imul(F,Z),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(K,re)|0,a=a+Math.imul(K,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,se)|0,i=i+Math.imul(C,ce)|0,n=(n=n+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,a=a+Math.imul(I,ue)|0,i=i+Math.imul(k,fe)|0,n=(n=n+Math.imul(k,de)|0)+Math.imul(E,fe)|0,a=a+Math.imul(E,de)|0;var Be=(u+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,ye)|0)+Math.imul(v,pe)|0))<<13)|0;u=((a=a+Math.imul(v,ye)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(z,$),n=(n=Math.imul(z,ee))+Math.imul(F,$)|0,a=Math.imul(F,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,se)|0)+Math.imul(K,ae)|0,a=a+Math.imul(K,se)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(M,ce)|0,a=a+Math.imul(M,ue)|0,i=i+Math.imul(C,fe)|0,n=(n=n+Math.imul(C,de)|0)+Math.imul(I,fe)|0,a=a+Math.imul(I,de)|0;var Pe=(u+(i=i+Math.imul(k,pe)|0)|0)+((8191&(n=(n=n+Math.imul(k,ye)|0)+Math.imul(E,pe)|0))<<13)|0;u=((a=a+Math.imul(E,ye)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(z,re),n=(n=Math.imul(z,ie))+Math.imul(F,re)|0,a=Math.imul(F,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,se)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,se)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(K,ce)|0,a=a+Math.imul(K,ue)|0,i=i+Math.imul(P,fe)|0,n=(n=n+Math.imul(P,de)|0)+Math.imul(M,fe)|0,a=a+Math.imul(M,de)|0;var Me=(u+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,ye)|0)+Math.imul(I,pe)|0))<<13)|0;u=((a=a+Math.imul(I,ye)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(z,ae),n=(n=Math.imul(z,se))+Math.imul(F,ae)|0,a=Math.imul(F,se),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(T,ce)|0,a=a+Math.imul(T,ue)|0,i=i+Math.imul(x,fe)|0,n=(n=n+Math.imul(x,de)|0)+Math.imul(K,fe)|0,a=a+Math.imul(K,de)|0;var De=(u+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,ye)|0)+Math.imul(M,pe)|0))<<13)|0;u=((a=a+Math.imul(M,ye)|0)+(n>>>13)|0)+(De>>>26)|0,De&=67108863,i=Math.imul(z,ce),n=(n=Math.imul(z,ue))+Math.imul(F,ce)|0,a=Math.imul(F,ue),i=i+Math.imul(R,fe)|0,n=(n=n+Math.imul(R,de)|0)+Math.imul(T,fe)|0,a=a+Math.imul(T,de)|0;var xe=(u+(i=i+Math.imul(x,pe)|0)|0)+((8191&(n=(n=n+Math.imul(x,ye)|0)+Math.imul(K,pe)|0))<<13)|0;u=((a=a+Math.imul(K,ye)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(z,fe),n=(n=Math.imul(z,de))+Math.imul(F,fe)|0,a=Math.imul(F,de);var Ke=(u+(i=i+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,ye)|0)+Math.imul(T,pe)|0))<<13)|0;u=((a=a+Math.imul(T,ye)|0)+(n>>>13)|0)+(Ke>>>26)|0,Ke&=67108863;var Ue=(u+(i=Math.imul(z,pe))|0)+((8191&(n=(n=Math.imul(z,ye))+Math.imul(F,pe)|0))<<13)|0;return u=((a=Math.imul(F,ye))+(n>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,c[0]=ge,c[1]=be,c[2]=me,c[3]=we,c[4]=Ae,c[5]=ve,c[6]=_e,c[7]=ke,c[8]=Ee,c[9]=Se,c[10]=Ce,c[11]=Ie,c[12]=Be,c[13]=Pe,c[14]=Me,c[15]=De,c[16]=xe,c[17]=Ke,c[18]=Ue,0!==u&&(c[19]=u,r.length++),r};function l(e,t,r){return(new p).mulp(e,t,r)}function p(e,t){this.x=e,this.y=t}Math.imul||(d=f),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?f(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,a=0;a<r.length-1;a++){var s=n;n=0;for(var o=67108863&i,c=Math.min(a,t.length-1),u=Math.max(0,a-e.length+1);u<=c;u++){var h=a-u,f=(0|e.words[h])*(0|t.words[u]),d=67108863&f;o=67108863&(d=d+o|0),n+=(s=(s=s+(f/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[a]=o,i=s,s=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):l(this,e,t),r},p.prototype.makeRBT=function(e){for(var t=Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},p.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},p.prototype.permute=function(e,t,r,i,n,a){for(var s=0;s<a;s++)i[s]=t[e[s]],n[s]=r[e[s]]},p.prototype.transform=function(e,t,r,i,n,a){this.permute(a,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var o=s<<1,c=Math.cos(2*Math.PI/o),u=Math.sin(2*Math.PI/o),h=0;h<n;h+=o)for(var f=c,d=u,l=0;l<s;l++){var p=r[h+l],y=i[h+l],g=r[h+l+s],b=i[h+l+s],m=f*g-d*b;b=f*b+d*g,g=m,r[h+l]=p+g,i[h+l]=y+b,r[h+l+s]=p-g,i[h+l+s]=y-b,l!==o&&(m=c*f-u*d,d=c*d+u*f,f=m)}},p.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},p.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},p.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},p.prototype.convert13b=function(e,t,i,n){for(var a=0,s=0;s<t;s++)a+=0|e[s],i[2*s]=8191&a,a>>>=13,i[2*s+1]=8191&a,a>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===a),r(0==(-8192&a))},p.prototype.stub=function(e){for(var t=Array(e),r=0;r<e;r++)t[r]=0;return t},p.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),a=this.stub(i),s=Array(i),o=Array(i),c=Array(i),u=Array(i),h=Array(i),f=Array(i),d=r.words;d.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,u,i),this.transform(s,a,o,c,i,n),this.transform(u,a,h,f,i,n);for(var l=0;l<i;l++){var p=o[l]*h[l]-c[l]*f[l];c[l]=o[l]*f[l]+c[l]*h[l],o[l]=p}return this.conjugate(o,c,i),this.transform(o,c,d,a,i,n),this.conjugate(d,a,i),this.normalize13b(d,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=Array(this.length+e.length),l(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,a=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=a>>>26,this.words[i]=67108863&a}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var a=r.sqr();i<t.length;i++,a=a.sqr())0!==t[i]&&(r=r.mul(a));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,a=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&a,c=(0|this.words[t])-o<<i;this.words[t]=c|s,s=o>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var a=e%26,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<<a,c=i;if(n=Math.max(0,n-=s),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var h=0;for(u=this.length-1;u>=0&&(0!==h||u>=n);u--){var f=0|this.words[u];this.words[u]=h<<26-a|f>>>a,h=f&o}return c&&0!==h&&(c.words[c.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i)&&!!(this.words[i]&n)},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,a,s=e.length+i;this._expand(s);var o=0;for(n=0;n<e.length;n++){a=(0|this.words[n+i])+o;var c=(0|e.words[n])*t;o=((a-=67108863&c)>>26)-(c/67108864|0),this.words[n+i]=67108863&a}for(;n<this.length-i;n++)o=(a=(0|this.words[n+i])+o)>>26,this.words[n+i]=67108863&a;if(0===o)return this.strip();for(r(-1===o),o=0,n=0;n<this.length;n++)o=(a=-(0|this.words[n])+o)>>26,this.words[n]=67108863&a;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),a=e,s=0|a.words[a.length-1];0!==(r=26-this._countBits(s))&&(a=a.ushln(r),i.iushln(r),s=0|a.words[a.length-1]);var o,c=i.length-a.length;if("mod"!==t){(o=new n(null)).length=c+1,o.words=Array(o.length);for(var u=0;u<o.length;u++)o.words[u]=0}var h=i.clone()._ishlnsubmul(a,1,c);0===h.negative&&(i=h,o&&(o.words[c]=1));for(var f=c-1;f>=0;f--){var d=67108864*(0|i.words[a.length+f])+(0|i.words[a.length+f-1]);for(d=Math.min(d/s|0,67108863),i._ishlnsubmul(a,d,f);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(a,1,f),i.isZero()||(i.negative^=1);o&&(o.words[f]=d)}return o&&o.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:o||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(a=o.div.neg()),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:a,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(a=o.div.neg()),{div:a,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,s,o},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new n(1),s=new n(0),o=new n(0),c=new n(1),u=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++u;for(var h=i.clone(),f=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(h),s.isub(f)),a.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(i.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(h),c.isub(f)),o.iushrn(1),c.iushrn(1);t.cmp(i)>=0?(t.isub(i),a.isub(o),s.isub(c)):(i.isub(t),o.isub(a),c.isub(s))}return{a:o,b:c,gcd:i.iushln(u)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,s=new n(1),o=new n(0),c=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,h=1;0==(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var f=0,d=1;0==(i.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(i.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(o)):(i.isub(t),o.isub(s))}return(a=0===t.cmpn(1)?s:o).cmpn(0)<0&&a.iadd(e),a},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var a=t;t=r,r=a}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var a=n,s=i;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new v(e)},n.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function v(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function _(e){v.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}g.prototype._tmp=function(){var e=new n(null);return e.words=Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(b,g),b.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|a>>>22,a=s}a>>>=22,e.words[n-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(m,g),i(w,g),i(A,g),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new m;else if("p192"===e)t=new w;else{if("p25519"!==e)throw Error("Unknown prime "+e);t=new A}return y[e]=t,t},v.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},v.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},v.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},v.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},v.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},v.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},v.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},v.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},v.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},v.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},v.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},v.prototype.isqr=function(e){return this.imul(e,e.clone())},v.prototype.sqr=function(e){return this.mul(e,e)},v.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());var o=new n(1).toRed(this),c=o.redNeg(),u=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new n(2*h*h).toRed(this);0!==this.pow(h,u).cmp(c);)h.redIAdd(c);for(var f=this.pow(h,a),d=this.pow(e,a.addn(1).iushrn(1)),l=this.pow(e,a),p=s;0!==l.cmp(o);){for(var y=l,g=0;0!==y.cmp(o);g++)y=y.redSqr();r(g<p);var b=this.pow(f,new n(1).iushln(p-g-1));d=d.redMul(b),f=b.redSqr(),l=l.redMul(f),p=g}return d},v.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},v.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var a=r[0],s=0,o=0,c=t.bitLength()%26;for(0===c&&(c=26),i=t.length-1;i>=0;i--){for(var u=t.words[i],h=c-1;h>=0;h--){var f=u>>h&1;a!==r[0]&&(a=this.sqr(a)),0!==f||0!==s?(s<<=1,s|=f,(4===++o||0===i&&0===h)&&(a=this.mul(a,r[s]),o=0,s=0)):o=0}c=26}return a},v.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},v.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new _(e)},i(_,v),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},_.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(i).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,rt)})),ky=/*#__PURE__*/Object.freeze({__proto__:null,default:_y,__moduleExports:_y});class Ey{constructor(e){if(void 0===e)throw Error("Invalid BigInteger input");this.value=new _y(e)}clone(){const e=new Ey(null);return this.value.copy(e.value),e}iinc(){return this.value.iadd(new _y(1)),this}inc(){return this.clone().iinc()}idec(){return this.value.isub(new _y(1)),this}dec(){return this.clone().idec()}iadd(e){return this.value.iadd(e.value),this}add(e){return this.clone().iadd(e)}isub(e){return this.value.isub(e.value),this}sub(e){return this.clone().isub(e)}imul(e){return this.value.imul(e.value),this}mul(e){return this.clone().imul(e)}imod(e){return this.value=this.value.umod(e.value),this}mod(e){return this.clone().imod(e)}modExp(e,t){const r=t.isEven()?_y.red(t.value):_y.mont(t.value),i=this.clone();return i.value=i.value.toRed(r).redPow(e.value).fromRed(),i}modInv(e){if(!this.gcd(e).isOne())throw Error("Inverse does not exist");return new Ey(this.value.invm(e.value))}gcd(e){return new Ey(this.value.gcd(e.value))}ileftShift(e){return this.value.ishln(e.value.toNumber()),this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value.ishrn(e.value.toNumber()),this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value.eq(e.value)}lt(e){return this.value.lt(e.value)}lte(e){return this.value.lte(e.value)}gt(e){return this.value.gt(e.value)}gte(e){return this.value.gte(e.value)}isZero(){return this.value.isZero()}isOne(){return this.value.eq(new _y(1))}isNegative(){return this.value.isNeg()}isEven(){return this.value.isEven()}abs(){const e=this.clone();return e.value=e.value.abs(),e}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}getBit(e){return this.value.testn(e)?1:0}bitLength(){return this.value.bitLength()}byteLength(){return this.value.byteLength()}toUint8Array(e="be",t){return this.value.toArrayLike(Uint8Array,e,t)}}var Sy,Cy=/*#__PURE__*/Object.freeze({__proto__:null,default:Ey}),Iy=it((function(e,t){var r=t;function i(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(i=0;i<e.length;i++){var n=e.charCodeAt(i),a=n>>8,s=255&n;a?r.push(a,s):r.push(s)}return r},r.zero2=i,r.toHex=n,r.encode=function(e,t){return"hex"===t?n(e):e}})),By=it((function(e,t){var r=t;r.assert=et,r.toArray=Iy.toArray,r.zero2=Iy.zero2,r.toHex=Iy.toHex,r.encode=Iy.encode,r.getNAF=function(e,t){for(var r=[],i=1<<t+1,n=e.clone();n.cmpn(1)>=0;){var a;if(n.isOdd()){var s=n.andln(i-1);a=s>(i>>1)-1?(i>>1)-s:s,n.isubn(a)}else a=0;r.push(a);for(var o=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c<o;c++)r.push(0);n.iushrn(o)}return r},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i=0,n=0;e.cmpn(-i)>0||t.cmpn(-n)>0;){var a,s,o,c=e.andln(3)+i&3,u=t.andln(3)+n&3;if(3===c&&(c=-1),3===u&&(u=-1),0==(1&c))a=0;else a=3!==(o=e.andln(7)+i&7)&&5!==o||2!==u?c:-c;if(r[0].push(a),0==(1&u))s=0;else s=3!==(o=t.andln(7)+n&7)&&5!==o||2!==c?u:-u;r[1].push(s),2*i===a+1&&(i=1-i),2*n===s+1&&(n=1-n),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new _y(e,"hex","le")}})),Py=function(e){return Sy||(Sy=new My(null)),Sy.generate(e)};function My(e){this.rand=e}var Dy=My;if(My.prototype.generate=function(e){return this._rand(e)},My.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?My.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?My.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(My.prototype._rand=function(){throw Error("Not implemented yet")});else try{var xy=void 0;if("function"!=typeof xy.randomBytes)throw Error("Not supported");My.prototype._rand=function(e){return xy.randomBytes(e)}}catch(e){}Py.Rand=Dy;var Ky=By.getNAF,Uy=By.getJSF,Ry=By.assert;function Ty(e,t){this.type=e,this.p=new _y(t.p,16),this.red=t.prime?_y.red(t.prime):_y.mont(this.p),this.zero=new _y(0).toRed(this.red),this.one=new _y(1).toRed(this.red),this.two=new _y(2).toRed(this.red),this.n=t.n&&new _y(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,];var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Qy=Ty;function zy(e,t){this.curve=e,this.type=t,this.precomputed=null}Ty.prototype.point=function(){throw Error("Not implemented")},Ty.prototype.validate=function(){throw Error("Not implemented")},Ty.prototype._fixedNafMul=function(e,t){Ry(e.precomputed);var r=e._getDoubles(),i=Ky(t,1),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;for(var a=[],s=0;s<i.length;s+=r.step){var o=0;for(t=s+r.step-1;t>=s;t--)o=(o<<1)+i[t];a.push(o)}for(var c=this.jpoint(null,null,null),u=this.jpoint(null,null,null),h=n;h>0;h--){for(s=0;s<a.length;s++){(o=a[s])===h?u=u.mixedAdd(r.points[s]):o===-h&&(u=u.mixedAdd(r.points[s].neg()))}c=c.add(u)}return c.toP()},Ty.prototype._wnafMul=function(e,t){var r=4,i=e._getNAFPoints(r);r=i.wnd;for(var n=i.points,a=Ky(t,r),s=this.jpoint(null,null,null),o=a.length-1;o>=0;o--){for(t=0;o>=0&&0===a[o];o--)t++;if(o>=0&&t++,s=s.dblp(t),o<0)break;var c=a[o];Ry(0!==c),s="affine"===e.type?c>0?s.mixedAdd(n[c-1>>1]):s.mixedAdd(n[-c-1>>1].neg()):c>0?s.add(n[c-1>>1]):s.add(n[-c-1>>1].neg())}return"affine"===e.type?s.toP():s},Ty.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,s=this._wnafT2,o=this._wnafT3,c=0,u=0;u<i;u++){var h=(k=t[u])._getNAFPoints(e);a[u]=h.wnd,s[u]=h.points}for(u=i-1;u>=1;u-=2){var f=u-1,d=u;if(1===a[f]&&1===a[d]){var l=[t[f],null,null,t[d]];0===t[f].y.cmp(t[d].y)?(l[1]=t[f].add(t[d]),l[2]=t[f].toJ().mixedAdd(t[d].neg())):0===t[f].y.cmp(t[d].y.redNeg())?(l[1]=t[f].toJ().mixedAdd(t[d]),l[2]=t[f].add(t[d].neg())):(l[1]=t[f].toJ().mixedAdd(t[d]),l[2]=t[f].toJ().mixedAdd(t[d].neg()));var p=[-3,-1,-5,-7,0,7,5,1,3],y=Uy(r[f],r[d]);c=Math.max(y[0].length,c),o[f]=Array(c),o[d]=Array(c);for(var g=0;g<c;g++){var b=0|y[0][g],m=0|y[1][g];o[f][g]=p[3*(b+1)+(m+1)],o[d][g]=0,s[f]=l}}else o[f]=Ky(r[f],a[f]),o[d]=Ky(r[d],a[d]),c=Math.max(o[f].length,c),c=Math.max(o[d].length,c)}var w=this.jpoint(null,null,null),A=this._wnafT4;for(u=c;u>=0;u--){for(var v=0;u>=0;){var _=!0;for(g=0;g<i;g++)A[g]=0|o[g][u],0!==A[g]&&(_=!1);if(!_)break;v++,u--}if(u>=0&&v++,w=w.dblp(v),u<0)break;for(g=0;g<i;g++){var k,E=A[g];0!==E&&(E>0?k=s[g][E-1>>1]:E<0&&(k=s[g][-E-1>>1].neg()),w="affine"===k.type?w.mixedAdd(k):w.add(k))}}for(u=0;u<i;u++)s[u]=null;return n?w:w.toP()},Ty.BasePoint=zy,zy.prototype.eq=function(){throw Error("Not implemented")},zy.prototype.validate=function(){return this.curve.validate(this)},Ty.prototype.decodePoint=function(e,t){e=By.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?Ry(e[e.length-1]%2==0):7===e[0]&&Ry(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw Error("Unknown point format")},zy.prototype.encodeCompressed=function(e){return this.encode(e,!0)},zy.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},zy.prototype.encode=function(e,t){return By.encode(this._encode(t),e)},zy.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},zy.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},zy.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var a=0;a<e;a++)i=i.dbl();r.push(i)}return{step:e,points:r}},zy.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},zy.prototype._getBeta=function(){return null},zy.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var Fy=By.assert;function Ly(e){Qy.call(this,"short",e),this.a=new _y(e.a,16).toRed(this.red),this.b=new _y(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}at(Ly,Qy);var Ny=Ly;function qy(e,t,r,i){Qy.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new _y(t,16),this.y=new _y(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function Oy(e,t,r,i){Qy.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new _y(0)):(this.x=new _y(t,16),this.y=new _y(r,16),this.z=new _y(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function Hy(e){Qy.call(this,"mont",e),this.a=new _y(e.a,16).toRed(this.red),this.b=new _y(e.b,16).toRed(this.red),this.i4=new _y(4).toRed(this.red).redInvm(),this.two=new _y(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Ly.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new _y(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new _y(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],Fy(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new _y(e.a,16),b:new _y(e.b,16)}})):this._getEndoBasis(r)}}},Ly.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:_y.mont(e),r=new _y(2).toRed(t).redInvm(),i=r.redNeg(),n=new _y(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},Ly.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,s,o,c,u,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,d=this.n.clone(),l=new _y(1),p=new _y(0),y=new _y(0),g=new _y(1),b=0;0!==f.cmpn(0);){var m=d.div(f);c=d.sub(m.mul(f)),u=y.sub(m.mul(l));var w=g.sub(m.mul(p));if(!i&&c.cmp(h)<0)t=o.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++b)break;o=c,d=f,f=c,y=l,l=u,g=p,p=w}a=c.neg(),s=u;var A=i.sqr().add(n.sqr());return a.sqr().add(s.sqr()).cmp(A)>=0&&(a=t,s=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:i,b:n},{a,b:s}]},Ly.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),s=n.mul(r.a),o=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(s).sub(o),k2:c.add(u).neg()}},Ly.prototype.pointFromX=function(e,t){(e=new _y(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},Ly.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},Ly.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a<e.length;a++){var s=this._endoSplit(t[a]),o=e[a],c=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),i[2*a]=o,i[2*a+1]=c,n[2*a]=s.k1,n[2*a+1]=s.k2}for(var u=this._wnafMulAdd(1,i,n,2*a,r),h=0;h<2*a;h++)i[h]=null,n[h]=null;return u},at(qy,Qy.BasePoint),Ly.prototype.point=function(e,t,r){return new qy(this,e,t,r)},Ly.prototype.pointFromJSON=function(e,t){return qy.fromJSON(this,e,t)},qy.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},qy.prototype.toJSON=function(){return this.precomputed?[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)}}]:[this.x,this.y]},qy.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;function n(t){return e.point(t[0],t[1],r)}var a=t[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(n))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(n))}},i},qy.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},qy.prototype.isInfinity=function(){return this.inf},qy.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},qy.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),a=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)},qy.prototype.getX=function(){return this.x.fromRed()},qy.prototype.getY=function(){return this.y.fromRed()},qy.prototype.mul=function(e){return e=new _y(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},qy.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},qy.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},qy.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},qy.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},qy.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},at(Oy,Qy.BasePoint),Ly.prototype.jpoint=function(e,t,r){return new Oy(this,e,t,r)},Oy.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},Oy.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Oy.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),o=i.redSub(n),c=a.redSub(s);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),h=u.redMul(o),f=i.redMul(u),d=c.redSqr().redIAdd(h).redISub(f).redISub(f),l=c.redMul(f.redISub(d)).redISub(a.redMul(h)),p=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(d,l,p)},Oy.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,a=e.y.redMul(t).redMul(this.z),s=r.redSub(i),o=n.redSub(a);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),h=r.redMul(c),f=o.redSqr().redIAdd(u).redISub(h).redISub(h),d=o.redMul(h.redISub(f)).redISub(n.redMul(u)),l=this.z.redMul(s);return this.curve.jpoint(f,d,l)},Oy.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}var i=this.curve.a,n=this.curve.tinv,a=this.x,s=this.y,o=this.z,c=o.redSqr().redSqr(),u=s.redAdd(s);for(r=0;r<e;r++){var h=a.redSqr(),f=u.redSqr(),d=f.redSqr(),l=h.redAdd(h).redIAdd(h).redIAdd(i.redMul(c)),p=a.redMul(f),y=l.redSqr().redISub(p.redAdd(p)),g=p.redISub(y),b=l.redMul(g);b=b.redIAdd(b).redISub(d);var m=u.redMul(o);r+1<e&&(c=c.redMul(d)),a=y,o=m,u=b}return this.curve.jpoint(a,u.redMul(n),o)},Oy.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Oy.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(a);s=s.redIAdd(s);var o=i.redAdd(i).redIAdd(i),c=o.redSqr().redISub(s).redISub(s),u=a.redIAdd(a);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=o.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),f=this.y.redSqr(),d=f.redSqr(),l=this.x.redAdd(f).redSqr().redISub(h).redISub(d);l=l.redIAdd(l);var p=h.redAdd(h).redIAdd(h),y=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),e=y.redISub(l).redISub(l),t=p.redMul(l.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},Oy.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(a);s=s.redIAdd(s);var o=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),c=o.redSqr().redISub(s).redISub(s);e=c;var u=a.redIAdd(a);u=(u=u.redIAdd(u)).redIAdd(u),t=o.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),f=this.y.redSqr(),d=this.x.redMul(f),l=this.x.redSub(h).redMul(this.x.redAdd(h));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),y=(p=p.redIAdd(p)).redAdd(p);e=l.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(h);var g=f.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=l.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},Oy.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),a=t.redSqr(),s=r.redSqr(),o=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(n)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),h=o.redSqr().redISub(u.redAdd(u)),f=u.redISub(h),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=o.redMul(f).redISub(d),p=r.redAdd(r).redMul(i);return this.curve.jpoint(h,l,p)},Oy.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),a=n.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(i),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(a)).redSqr(),c=i.redIAdd(i);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=n.redIAdd(s).redSqr().redISub(a).redISub(o).redISub(c),h=t.redMul(u);h=(h=h.redIAdd(h)).redIAdd(h);var f=this.x.redMul(o).redISub(h);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(o)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=this.z.redAdd(s).redSqr().redISub(r).redISub(o);return this.curve.jpoint(f,d,l)},Oy.prototype.mul=function(e,t){return e=new _y(e,t),this.curve._wnafMul(this,e)},Oy.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var i=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(i)).cmpn(0)},Oy.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},Oy.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Oy.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},at(Hy,Qy);var jy=Hy;function Gy(e,t,r){Qy.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new _y(t,16),this.z=new _y(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Hy.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},at(Gy,Qy.BasePoint),Hy.prototype.decodePoint=function(e,t){if(33===(e=By.toArray(e,t)).length&&64===e[0]&&(e=e.slice(1,33).reverse()),32!==e.length)throw Error("Unknown point compression format");return this.point(e,1)},Hy.prototype.point=function(e,t){return new Gy(this,e,t)},Hy.prototype.pointFromJSON=function(e){return Gy.fromJSON(this,e)},Gy.prototype.precompute=function(){},Gy.prototype._encode=function(e){var t=this.curve.p.byteLength();return e?[64].concat(this.getX().toArray("le",t)):this.getX().toArray("be",t)},Gy.fromJSON=function(e,t){return new Gy(e,t[0],t[1]||e.one)},Gy.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Gy.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Gy.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},Gy.prototype.add=function(){throw Error("Not supported on Montgomery curve")},Gy.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),s=n.redMul(i),o=t.z.redMul(a.redAdd(s).redSqr()),c=t.x.redMul(a.redISub(s).redSqr());return this.curve.point(o,c)},Gy.prototype.mul=function(e){for(var t=(e=new _y(e,16)).clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var a=n.length-1;a>=0;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},Gy.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},Gy.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},Gy.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},Gy.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Gy.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Wy=By.assert;function Vy(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,Qy.call(this,"edwards",e),this.a=new _y(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new _y(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new _y(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Wy(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}at(Vy,Qy);var Jy=Vy;function Yy(e,t,r,i,n){Qy.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new _y(t,16),this.y=new _y(r,16),this.z=i?new _y(i,16):this.curve.one,this.t=n&&new _y(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}Vy.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},Vy.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},Vy.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},Vy.prototype.pointFromX=function(e,t){(e=new _y(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),n=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=i.redMul(n.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw Error("invalid point");var o=s.fromRed().isOdd();return(t&&!o||!t&&o)&&(s=s.redNeg()),this.point(e,s)},Vy.prototype.pointFromY=function(e,t){(e=new _y(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=r.redSub(this.c2),n=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(n.redInvm());if(0===a.cmp(this.zero)){if(t)throw Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},Vy.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),i=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===i.cmp(n)},at(Yy,Qy.BasePoint),Vy.prototype.pointFromJSON=function(e){return Yy.fromJSON(this,e)},Vy.prototype.point=function(e,t,r,i){return new Yy(this,e,t,r,i)},Yy.fromJSON=function(e,t){return new Yy(e,t[0],t[1],t[2])},Yy.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Yy.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},Yy.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=i.redAdd(t),s=a.redSub(r),o=i.redSub(t),c=n.redMul(s),u=a.redMul(o),h=n.redMul(o),f=s.redMul(a);return this.curve.point(c,u,f,h)},Yy.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var s=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(s.redSub(this.curve.two)),t=s.redMul(u.redSub(a)),r=s.redSqr().redSub(s).redSub(s);else{var o=this.z.redSqr(),c=s.redSub(o).redISub(o);e=i.redSub(n).redISub(a).redMul(c),t=s.redMul(u.redSub(a)),r=s.redMul(c)}}else{var u=n.redAdd(a);o=this.curve._mulC(this.z).redSqr(),c=u.redSub(o).redSub(o);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},Yy.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Yy.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),s=n.redSub(i),o=n.redAdd(i),c=r.redAdd(t),u=a.redMul(s),h=o.redMul(c),f=a.redMul(c),d=s.redMul(o);return this.curve.point(u,h,d,f)},Yy.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(a).redMul(s),c=n.redSub(o),u=n.redAdd(o),h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(s),f=i.redMul(c).redMul(h);return this.curve.twisted?(t=i.redMul(u).redMul(s.redSub(this.curve._mulA(a))),r=c.redMul(u)):(t=i.redMul(u).redMul(s.redSub(a)),r=this.curve._mulC(c).redMul(u)),this.curve.point(f,t,r)},Yy.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},Yy.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},Yy.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},Yy.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},Yy.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},Yy.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Yy.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Yy.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Yy.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},Yy.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},Yy.prototype.toP=Yy.prototype.normalize,Yy.prototype.mixedAdd=Yy.prototype.add;var Zy=it((function(e,t){var r=t;r.base=Qy,r.short=Ny,r.mont=jy,r.edwards=Jy})),Xy=pt.rotl32,$y=pt.sum32,eg=pt.sum32_5,tg=kt.ft_1,rg=bt.BlockHash,ig=[1518500249,1859775393,2400959708,3395469782];function ng(){if(!(this instanceof ng))return new ng;rg.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}pt.inherits(ng,rg);var ag=ng;ng.blockSize=512,ng.outSize=160,ng.hmacStrength=80,ng.padLength=64,ng.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=Xy(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],a=this.h[1],s=this.h[2],o=this.h[3],c=this.h[4];for(i=0;i<r.length;i++){var u=~~(i/20),h=eg(Xy(n,5),tg(u,a,s,o),c,r[i],ig[u]);c=o,o=s,s=Xy(a,30),a=n,n=h}this.h[0]=$y(this.h[0],n),this.h[1]=$y(this.h[1],a),this.h[2]=$y(this.h[2],s),this.h[3]=$y(this.h[3],o),this.h[4]=$y(this.h[4],c)},ng.prototype._digest=function(e){return"hex"===e?pt.toHex32(this.h,"big"):pt.split32(this.h,"big")};var sg={sha1:ag,sha224:zt,sha256:Tt,sha384:lr,sha512:$t};function og(e,t,r){if(!(this instanceof og))return new og(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(pt.toArray(t,r))}var cg=og;og.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),et(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},og.prototype.update=function(e,t){return this.inner.update(e,t),this},og.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var ug=it((function(e,t){var r=t;r.utils=pt,r.common=bt,r.sha=sg,r.ripemd=Br,r.hmac=cg,r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160})),hg={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"]]}},fg=it((function(e,t){var r,i=t,n=By.assert;function a(e){if("short"===e.type)this.curve=new Zy.short(e);else if("edwards"===e.type)this.curve=new Zy.edwards(e);else{if("mont"!==e.type)throw Error("Unknown curve type.");this.curve=new Zy.mont(e)}this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, n*G != O")}function s(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new a(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=a,s("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:ug.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:ug.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:ug.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:ug.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"]}),s("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:ug.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",cofactor:"8",hash:ug.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",cofactor:"8",hash:ug.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]}),s("brainpoolP256r1",{type:"short",prime:null,p:"A9FB57DB A1EEA9BC 3E660A90 9D838D72 6E3BF623 D5262028 2013481D 1F6E5377",a:"7D5A0975 FC2C3057 EEF67530 417AFFE7 FB8055C1 26DC5C6C E94A4B44 F330B5D9",b:"26DC5C6C E94A4B44 F330B5D9 BBD77CBF 95841629 5CF7E1CE 6BCCDC18 FF8C07B6",n:"A9FB57DB A1EEA9BC 3E660A90 9D838D71 8C397AA3 B561A6F7 901E0E82 974856A7",hash:ug.sha256,gRed:!1,g:["8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262","547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997"]}),s("brainpoolP384r1",{type:"short",prime:null,p:"8CB91E82 A3386D28 0F5D6F7E 50E641DF 152F7109 ED5456B4 12B1DA19 7FB71123ACD3A729 901D1A71 87470013 3107EC53",a:"7BC382C6 3D8C150C 3C72080A CE05AFA0 C2BEA28E 4FB22787 139165EF BA91F90F8AA5814A 503AD4EB 04A8C7DD 22CE2826",b:"04A8C7DD 22CE2826 8B39B554 16F0447C 2FB77DE1 07DCD2A6 2E880EA5 3EEB62D57CB43902 95DBC994 3AB78696 FA504C11",n:"8CB91E82 A3386D28 0F5D6F7E 50E641DF 152F7109 ED5456B3 1F166E6C AC0425A7CF3AB6AF 6B7FC310 3B883202 E9046565",hash:ug.sha384,gRed:!1,g:["1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E","8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315"]}),s("brainpoolP512r1",{type:"short",prime:null,p:"AADD9DB8 DBE9C48B 3FD4E6AE 33C9FC07 CB308DB3 B3C9D20E D6639CCA 703308717D4D9B00 9BC66842 AECDA12A E6A380E6 2881FF2F 2D82C685 28AA6056 583A48F3",a:"7830A331 8B603B89 E2327145 AC234CC5 94CBDD8D 3DF91610 A83441CA EA9863BC2DED5D5A A8253AA1 0A2EF1C9 8B9AC8B5 7F1117A7 2BF2C7B9 E7C1AC4D 77FC94CA",b:"3DF91610 A83441CA EA9863BC 2DED5D5A A8253AA1 0A2EF1C9 8B9AC8B5 7F1117A72BF2C7B9 E7C1AC4D 77FC94CA DC083E67 984050B7 5EBAE5DD 2809BD63 8016F723",n:"AADD9DB8 DBE9C48B 3FD4E6AE 33C9FC07 CB308DB3 B3C9D20E D6639CCA 70330870553E5C41 4CA92619 41866119 7FAC1047 1DB1D381 085DDADD B5879682 9CA90069",hash:ug.sha512,gRed:!1,g:["81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822","7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892"]});try{r=hg}catch(e){r=void 0}s("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:ug.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function dg(e){if(!(this instanceof dg))return new dg(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Iy.toArray(e.entropy,e.entropyEnc||"hex"),r=Iy.toArray(e.nonce,e.nonceEnc||"hex"),i=Iy.toArray(e.pers,e.persEnc||"hex");et(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}var lg=dg;dg.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},dg.prototype._hmac=function(){return new ug.hmac(this.hash,this.K)},dg.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},dg.prototype.reseed=function(e,t,r,i){"string"!=typeof t&&(i=r,r=t,t=null),e=Iy.toArray(e,t),r=Iy.toArray(r,i),et(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},dg.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=Iy.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<e;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var a=n.slice(0,e);return this._update(r),this._reseed++,Iy.encode(a,t)};var pg=By.assert;function yg(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var gg=yg;yg.fromPublic=function(e,t,r){return t instanceof yg?t:new yg(e,{pub:t,pubEnc:r})},yg.fromPrivate=function(e,t,r){return t instanceof yg?t:new yg(e,{priv:t,privEnc:r})},yg.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},yg.prototype.getPublic=function(e,t){return this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},yg.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},yg.prototype._importPrivate=function(e,t){if(this.priv=new _y(e,t||16),"mont"===this.ec.curve.type){var r=this.ec.curve.one,i=r.ushln(252).sub(r).ushln(3);this.priv=this.priv.or(r.ushln(254)),this.priv=this.priv.and(i)}else this.priv=this.priv.umod(this.ec.curve.n)},yg.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?pg(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||pg(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},yg.prototype.derive=function(e){return e.mul(this.priv).getX()},yg.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},yg.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},yg.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var bg=By.assert;function mg(e,t){if(e instanceof mg)return e;this._importDER(e,t)||(bg(e.r&&e.s,"Signature without r or s"),this.r=new _y(e.r,16),this.s=new _y(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var wg=mg;function Ag(){this.place=0}function vg(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,s=t.place;a<i;a++,s++)n<<=8,n|=e[s];return t.place=s,n}function _g(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function kg(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}mg.prototype._importDER=function(e,t){e=By.toArray(e,t);var r=new Ag;if(48!==e[r.place++])return!1;if(vg(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=vg(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=vg(e,r);if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===s[0]&&128&s[1]&&(s=s.slice(1)),this.r=new _y(n),this.s=new _y(s),this.recoveryParam=null,!0},mg.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=_g(t),r=_g(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];kg(i,t.length),(i=i.concat(t)).push(2),kg(i,r.length);var n=i.concat(r),a=[48];return kg(a,n.length),a=a.concat(n),By.encode(a,e)};var Eg=By.assert;function Sg(e){if(!(this instanceof Sg))return new Sg(e);"string"==typeof e&&(Eg(fg.hasOwnProperty(e),"Unknown curve "+e),e=fg[e]),e instanceof fg.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Cg=Sg;Sg.prototype.keyPair=function(e){return new gg(this,e)},Sg.prototype.keyFromPrivate=function(e,t){return gg.fromPrivate(this,e,t)},Sg.prototype.keyFromPublic=function(e,t){return gg.fromPublic(this,e,t)},Sg.prototype.genKeyPair=function(e){e||(e={});var t=new lg({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Py(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()});if("mont"===this.curve.type){var r=new _y(t.generate(32));return this.keyFromPrivate(r)}for(var i=this.n.byteLength(),n=this.n.sub(new _y(2));;){if(!((r=new _y(t.generate(i))).cmp(n)>0))return r.iaddn(1),this.keyFromPrivate(r)}},Sg.prototype._truncateToN=function(e,t,r){var i=(r=r||8*e.byteLength())-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Sg.prototype.truncateMsg=function(e){var t;return e instanceof Uint8Array?(t=8*e.byteLength,e=this._truncateToN(new _y(e,16),!1,t)):"string"==typeof e?(t=4*e.length,e=this._truncateToN(new _y(e,16),!1,t)):e=this._truncateToN(new _y(e,16)),e},Sg.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this.truncateMsg(e);for(var n=this.n.byteLength(),a=t.getPrivate().toArray("be",n),s=e.toArray("be",n),o=new lg({hash:this.hash,entropy:a,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),c=this.n.sub(new _y(1)),u=0;;u++){var h=i.k?i.k(u):new _y(o.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(c)>=0)){var f=this.g.mul(h);if(!f.isInfinity()){var d=f.getX(),l=d.umod(this.n);if(0!==l.cmpn(0)){var p=h.invm(this.n).mul(l.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var y=(f.getY().isOdd()?1:0)|(0!==d.cmp(l)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),y^=1),new wg({r:l,s:p,recoveryParam:y})}}}}}},Sg.prototype.verify=function(e,t,r,i){return r=this.keyFromPublic(r,i),t=new wg(t,"hex"),this._verify(this.truncateMsg(e),t,r)||this._verify(this._truncateToN(new _y(e,16)),t,r)},Sg.prototype._verify=function(e,t,r){var i=t.r,n=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;var a,s=n.invm(this.n),o=s.mul(e).umod(this.n),c=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(o,r.getPublic(),c)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(o,r.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Sg.prototype.recoverPubKey=function(e,t,r,i){Eg((3&r)===r,"The recovery param is more than two bits"),t=new wg(t,i);var n=this.n,a=new _y(e),s=t.r,o=t.s,c=1&r,u=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw Error("Unable to find sencond key candinate");s=u?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c);var h=t.r.invm(n),f=n.sub(a).mul(h).umod(n),d=o.mul(h).umod(n);return this.g.mulAdd(f,s,d)},Sg.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new wg(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw Error("Unable to find valid recovery factor")};var Ig=By.assert,Bg=By.parseBytes,Pg=By.cachedProperty;function Mg(e,t){if(this.eddsa=e,t.hasOwnProperty("secret")&&(this._secret=Bg(t.secret)),e.isPoint(t.pub))this._pub=t.pub;else if(this._pubBytes=Bg(t.pub),this._pubBytes&&33===this._pubBytes.length&&64===this._pubBytes[0]&&(this._pubBytes=this._pubBytes.slice(1,33)),this._pubBytes&&32!==this._pubBytes.length)throw Error("Unknown point compression format")}Mg.fromPublic=function(e,t){return t instanceof Mg?t:new Mg(e,{pub:t})},Mg.fromSecret=function(e,t){return t instanceof Mg?t:new Mg(e,{secret:t})},Mg.prototype.secret=function(){return this._secret},Pg(Mg,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Pg(Mg,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Pg(Mg,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),Pg(Mg,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Pg(Mg,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Pg(Mg,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Mg.prototype.sign=function(e){return Ig(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},Mg.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},Mg.prototype.getSecret=function(e){return Ig(this._secret,"KeyPair is public only"),By.encode(this.secret(),e)},Mg.prototype.getPublic=function(e,t){return By.encode((t?[64]:[]).concat(this.pubBytes()),e)};var Dg=Mg,xg=By.assert,Kg=By.cachedProperty,Ug=By.parseBytes;function Rg(e,t){this.eddsa=e,"object"!=typeof t&&(t=Ug(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),xg(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof _y&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}Kg(Rg,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Kg(Rg,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Kg(Rg,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Kg(Rg,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Rg.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Rg.prototype.toHex=function(){return By.encode(this.toBytes(),"hex").toUpperCase()};var Tg=Rg,Qg=By.assert,zg=By.parseBytes;function Fg(e){if(Qg("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof Fg))return new Fg(e);e=fg[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=ug.sha512}var Lg=Fg;Fg.prototype.sign=function(e,t){e=zg(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),s=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),o=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:o,Rencoded:a})},Fg.prototype.verify=function(e,t,r){e=zg(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},Fg.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return By.intFromLE(e.digest()).umod(this.curve.n)},Fg.prototype.keyPair=function(e){return new Dg(this,e)},Fg.prototype.keyFromPublic=function(e){return Dg.fromPublic(this,e)},Fg.prototype.keyFromSecret=function(e){return Dg.fromSecret(this,e)},Fg.prototype.genKeyPair=function(e){e||(e={});var t=new lg({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Py(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.curve.n.toArray()});return this.keyFromSecret(t.generate(32))},Fg.prototype.makeSignature=function(e){return e instanceof Tg?e:new Tg(this,e)},Fg.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},Fg.prototype.decodePoint=function(e){var t=(e=By.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),i=0!=(128&e[t]),n=By.intFromLE(r);return this.curve.pointFromY(n,i)},Fg.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},Fg.prototype.decodeInt=function(e){return By.intFromLE(e)},Fg.prototype.isPoint=function(e){return e instanceof this.pointClass};var Ng=it((function(e,t){var r=t;r.utils=By,r.rand=Py,r.curve=Zy,r.curves=fg,r.ec=Cg,r.eddsa=Lg})),qg=/*#__PURE__*/Object.freeze({__proto__:null,default:Ng,__moduleExports:Ng});function Og(e,t,r,i){e[t]+=r[i],e[t+1]+=r[i+1]+(e[t]<r[i])}function Hg(e,t){e[0]+=t,e[1]+=e[0]<t}function jg(e,t,r,i,n,a,s,o){Og(e,r,e,i),Og(e,r,t,s);let c=e[a]^e[r],u=e[a+1]^e[r+1];e[a]=u,e[a+1]=c,Og(e,n,e,a),c=e[i]^e[n],u=e[i+1]^e[n+1],e[i]=c>>>24^u<<8,e[i+1]=u>>>24^c<<8,Og(e,r,e,i),Og(e,r,t,o),c=e[a]^e[r],u=e[a+1]^e[r+1],e[a]=c>>>16^u<<16,e[a+1]=u>>>16^c<<16,Og(e,n,e,a),c=e[i]^e[n],u=e[i+1]^e[n+1],e[i]=u>>>31^c<<1,e[i+1]=c>>>31^u<<1}const Gg=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Wg=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((e=>2*e)));function Vg(e,t){const r=new Uint32Array(32),i=new Uint32Array(e.b.buffer,e.b.byteOffset,32);for(let t=0;t<16;t++)r[t]=e.h[t],r[t+16]=Gg[t];r[24]^=e.t0[0],r[25]^=e.t0[1];const n=t?4294967295:0;r[28]^=n,r[29]^=n;for(let e=0;e<12;e++){const t=e<<4;jg(r,i,0,8,16,24,Wg[t+0],Wg[t+1]),jg(r,i,2,10,18,26,Wg[t+2],Wg[t+3]),jg(r,i,4,12,20,28,Wg[t+4],Wg[t+5]),jg(r,i,6,14,22,30,Wg[t+6],Wg[t+7]),jg(r,i,0,10,20,30,Wg[t+8],Wg[t+9]),jg(r,i,2,12,22,24,Wg[t+10],Wg[t+11]),jg(r,i,4,14,16,26,Wg[t+12],Wg[t+13]),jg(r,i,6,8,18,28,Wg[t+14],Wg[t+15])}for(let t=0;t<16;t++)e.h[t]^=r[t]^r[t+16]}class Jg{constructor(e,t,r,i){const n=new Uint8Array(64);this.S={b:new Uint8Array(tb),h:new Uint32Array(Zg/4),t0:new Uint32Array(2),c:0,outlen:e},n[0]=e,t&&(n[1]=t.length),n[2]=1,n[3]=1,r&&n.set(r,32),i&&n.set(i,48);const a=new Uint32Array(n.buffer,n.byteOffset,n.length/Uint32Array.BYTES_PER_ELEMENT);for(let e=0;e<16;e++)this.S.h[e]=Gg[e]^a[e];if(t){const e=new Uint8Array(tb);e.set(t),this.update(e)}}update(e){if(!(e instanceof Uint8Array))throw Error("Input must be Uint8Array or Buffer");let t=0;for(;t<e.length;){this.S.c===tb&&(Hg(this.S.t0,this.S.c),Vg(this.S,!1),this.S.c=0);let r=tb-this.S.c;this.S.b.set(e.subarray(t,t+r),this.S.c);const i=Math.min(r,e.length-t);this.S.c+=i,t+=i}return this}digest(e){Hg(this.S.t0,this.S.c),this.S.b.fill(0,this.S.c),this.S.c=tb,Vg(this.S,!0);const t=e||new Uint8Array(this.S.outlen);for(let e=0;e<this.S.outlen;e++)t[e]=this.S.h[e>>2]>>8*(3&e);return this.S.h=null,t.buffer}}function Yg(e,t,r,i){if(e>Zg)throw Error(`outlen must be at most ${Zg} (given: ${e})`);if(t){if(!(t instanceof Uint8Array))throw Error("key must be Uint8Array or Buffer");if(t.length>Xg)throw Error(`key size must be at most ${Xg} (given: ${t.length})`)}if(r){if(!(r instanceof Uint8Array))throw Error("salt must be Uint8Array or Buffer");if(r.length!==$g)throw Error(`salt must be exactly ${$g} (given: ${r.length}`)}if(i){if(!(i instanceof Uint8Array))throw Error("personal must be Uint8Array or Buffer");if(i.length!==eb)throw Error(`salt must be exactly ${eb} (given: ${i.length}`)}return new Jg(e,t,r,i)}const Zg=64,Xg=64,$g=16,eb=16,tb=128,rb=2,ib=19,nb=4294967295,ab=4,sb=4294967295,ob=8,cb=4294967295,ub=8,hb=4294967295,fb=4294967295,db=32,lb=1024,pb=64,yb=205===new Uint8Array(new Uint16Array([43981]).buffer)[0];function gb(e,t,r){return e[r+0]=t,e[r+1]=t>>8,e[r+2]=t>>16,e[r+3]=t>>24,e}function bb(e,t,r){if(t>Number.MAX_SAFE_INTEGER)throw Error("LE64: large numbers unsupported");let i=t;for(let t=r;t<r+7;t++)e[t]=i,i=(i-e[t])/256;return e}function mb(e,t,r){const i=new Uint8Array(64),n=new Uint8Array(4+t.length);if(gb(n,e,0),n.set(t,4),e<=64)return Yg(e).update(n).digest(r),r;const a=Math.ceil(e/32)-2;for(let e=0;e<a;e++)Yg(64).update(0===e?n:i).digest(i),r.set(i.subarray(0,32),32*e);const s=new Uint8Array(Yg(e-32*a).update(i).digest());return r.set(s,32*a),r}function wb(e,t,r,i){return e.fn.XOR(t.byteOffset,r.byteOffset,i.byteOffset),t}function Ab(e,t,r,i){return e.fn.G(t.byteOffset,r.byteOffset,i.byteOffset,e.refs.gZ.byteOffset),i}function vb(e,t,r,i){return e.fn.G2(t.byteOffset,r.byteOffset,i.byteOffset,e.refs.gZ.byteOffset),i}function*_b(e,t,r,i,n,a,s,o){e.refs.prngTmp.fill(0);const c=e.refs.prngTmp.subarray(0,48);bb(c,t,0),bb(c,r,8),bb(c,i,16),bb(c,n,24),bb(c,a,32),bb(c,rb,40);for(let t=1;t<=s;t++){bb(e.refs.prngTmp,t,c.length);const r=vb(e,e.refs.ZERO1024,e.refs.prngTmp,e.refs.prngR);for(let e=1===t?8*o:0;e<r.length;e+=8)yield r.subarray(e,e+8)}return[]}const kb=1024,Eb=64*kb;function Sb(e,{memory:t,instance:r}){if(!yb)throw Error("BigEndian system not supported");const i=function({type:e,version:t,tagLength:r,password:i,salt:n,ad:a,secret:s,parallelism:o,memorySize:c,passes:u}){const h=(e,t,r,i)=>{if(t<r||t>i)throw Error(`${e} size should be between ${r} and ${i} bytes`)};if(e!==rb||t!==ib)throw Error("Unsupported type or version");return h("password",i,ub,cb),h("salt",n,ob,sb),h("tag",r,ab,nb),h("memory",c,8*o,hb),a&&h("associated data",a,0,fb),s&&h("secret",s,0,db),{type:e,version:t,tagLength:r,password:i,salt:n,ad:a,secret:s,lanes:o,memorySize:c,passes:u}}({type:rb,version:ib,...e}),{G:n,G2:a,xor:s,getLZ:o}=r.exports,c={},u={};u.G=n,u.G2=a,u.XOR=s;const h=4*i.lanes*Math.floor(i.memorySize/(4*i.lanes)),f=h*lb+10*kb;if(t.buffer.byteLength<f){const e=Math.ceil((f-t.buffer.byteLength)/Eb);t.grow(e)}let d=0;c.gZ=new Uint8Array(t.buffer,d,lb),d+=c.gZ.length,c.prngR=new Uint8Array(t.buffer,d,lb),d+=c.prngR.length,c.prngTmp=new Uint8Array(t.buffer,d,lb),d+=c.prngTmp.length,c.ZERO1024=new Uint8Array(t.buffer,d,1024),d+=c.ZERO1024.length;const l=new Uint32Array(t.buffer,d,2);d+=l.length*Uint32Array.BYTES_PER_ELEMENT;const p={fn:u,refs:c},y=new Uint8Array(t.buffer,d,lb);d+=y.length;const g=new Uint8Array(t.buffer,d,i.memorySize*lb),b=new Uint8Array(t.buffer,0,d),m=function(e){const t=Yg(pb),r=new Uint8Array(4),i=new Uint8Array(24);gb(i,e.lanes,0),gb(i,e.tagLength,4),gb(i,e.memorySize,8),gb(i,e.passes,12),gb(i,e.version,16),gb(i,e.type,20);const n=[i];e.password?(n.push(gb(new Uint8Array(4),e.password.length,0)),n.push(e.password)):n.push(r);e.salt?(n.push(gb(new Uint8Array(4),e.salt.length,0)),n.push(e.salt)):n.push(r);e.secret?(n.push(gb(new Uint8Array(4),e.secret.length,0)),n.push(e.secret)):n.push(r);e.ad?(n.push(gb(new Uint8Array(4),e.ad.length,0)),n.push(e.ad)):n.push(r);t.update(function(e){if(1===e.length)return e[0];let t=0;for(let r=0;r<e.length;r++){if(!(e[r]instanceof Uint8Array))throw Error("concatArrays: Data must be in the form of a Uint8Array");t+=e[r].length}const r=new Uint8Array(t);let i=0;return e.forEach((e=>{r.set(e,i),i+=e.length})),r}(n));const a=t.digest();return new Uint8Array(a)}(i),w=h/i.lanes,A=Array(i.lanes).fill(null).map((()=>Array(w))),v=(e,t)=>(A[e][t]=g.subarray(e*w*1024+1024*t,e*w*1024+1024*t+lb),A[e][t]);for(let e=0;e<i.lanes;e++){const t=new Uint8Array(m.length+8);t.set(m),gb(t,0,m.length),gb(t,e,m.length+4),mb(lb,t,v(e,0)),gb(t,1,m.length),mb(lb,t,v(e,1))}const _=w/4;for(let e=0;e<i.passes;e++)for(let t=0;t<4;t++){const r=0===e&&t<=1;for(let n=0;n<i.lanes;n++){let a=0===t&&0===e?2:0;const s=r?_b(p,e,n,t,h,i.passes,_,a):null;for(;a<_;a++){const c=t*_+a,u=c>0?A[n][c-1]:A[n][w-1],h=r?s.next().value:u;o(l.byteOffset,h.byteOffset,n,i.lanes,e,t,a,4,_);const f=l[0],d=l[1];0===e&&v(n,c),Ab(p,u,A[f][d],e>0?y:A[n][c]),e>0&&wb(p,A[n][c],y,A[n][c])}}}const k=A[0][w-1];for(let e=1;e<i.lanes;e++)wb(p,k,k,A[e][w-1]);const E=mb(i.tagLength,k,new Uint8Array(i.tagLength));return b.fill(0),t.grow(0),E}let Cb;async function Ib(e,t){const r=new WebAssembly.Memory({initial:1040,maximum:65536}),i=await async function(e,t,r){const i={env:{memory:e}};if(void 0===Cb)try{const e=await t(i);return Cb=!0,e}catch(e){Cb=!1}return(Cb?t:r)(i)}(r,e,t);return e=>Sb(e,{instance:i.instance,memory:r})}function Bb(t,r,i,n){function a(e,t,r){var i=r?WebAssembly.instantiateStreaming:WebAssembly.instantiate,n=r?WebAssembly.compileStreaming:WebAssembly.compile;return t?i(e,t):n(e)}var s=null;if(r)return a(fetch(r),n,!0);var o=e.atob(i),c=o.length;s=new Uint8Array(new ArrayBuffer(c));for(var u=0;u<c;u++)s[u]=o.charCodeAt(u);if(t){var h=new WebAssembly.Module(s);return n?new WebAssembly.Instance(h,n):h}return a(s,n,!1)}var Pb=/*#__PURE__*/Object.freeze({__proto__:null,default:async()=>Ib((e=>Bb(0,null,"AGFzbQEAAAABKwdgBH9/f38AYAABf2AAAGADf39/AGAJf39/f39/f39/AX9gAX8AYAF/AX8CEwEDZW52Bm1lbW9yeQIBkAiAgAQDCgkCAwAABAEFBgEEBQFwAQICBgkBfwFBkIjAAgsHfQoDeG9yAAEBRwACAkcyAAMFZ2V0TFoABBlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALX2luaXRpYWxpemUAABBfX2Vycm5vX2xvY2F0aW9uAAgJc3RhY2tTYXZlAAUMc3RhY2tSZXN0b3JlAAYKc3RhY2tBbGxvYwAHCQcBAEEBCwEACs0gCQMAAQtYAQJ/A0AgACAEQQR0IgNqIAIgA2r9AAQAIAEgA2r9AAQA/VH9CwQAIAAgA0EQciIDaiACIANq/QAEACABIANq/QAEAP1R/QsEACAEQQJqIgRBwABHDQALC7ceAgt7A38DQCADIBFBBHQiD2ogASAPav0ABAAgACAPav0ABAD9USIF/QsEACACIA9qIAX9CwQAIAMgD0EQciIPaiABIA9q/QAEACAAIA9q/QAEAP1RIgX9CwQAIAIgD2ogBf0LBAAgEUECaiIRQcAARw0ACwNAIAMgEEEHdGoiAEEQaiAA/QAEcCAA/QAEMCIFIAD9AAQQIgT9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAQgBP0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgT9USIJQSD9ywEgCUEg/c0B/VAiCSAA/QAEUCIG/c4BIAkgCf0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIGIAX9USIFQSj9ywEgBUEY/c0B/VAiCCAE/c4BIAggCP0NAAECAwgJCgsAAQIDCAkKCyAEIAT9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIKIAogCf1RIgVBMP3LASAFQRD9zQH9UCIFIAb9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAYgBv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgkgCP1RIgRBAf3LASAEQT/9zQH9UCIMIAD9AARgIAD9AAQgIgQgAP0ABAAiBv3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBv1RIghBIP3LASAIQSD9zQH9UCIIIABBQGsiAf0ABAAiB/3OASAIIAj9DQABAgMICQoLAAECAwgJCgsgByAH/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiByAE/VEiBEEo/csBIARBGP3NAf1QIgsgBv3OASALIAv9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBiAI/VEiBEEw/csBIARBEP3NAf1QIgQgB/3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgByAH/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCCAL/VEiB0EB/csBIAdBP/3NAf1QIg0gDf0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eHyIH/c4BIAcgB/0NAAECAwgJCgsAAQIDCAkKCyAKIAr9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIKIAQgBSAF/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/VEiC0Eg/csBIAtBIP3NAf1QIgsgCP3OASALIAv9DQABAgMICQoLAAECAwgJCgsgCCAI/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCCAH/VEiB0Eo/csBIAdBGP3NAf1QIgcgCv3OASAHIAf9DQABAgMICQoLAAECAwgJCgsgCiAK/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiDv0LBAAgACAGIA0gDCAM/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4fIgr9zgEgCiAK/Q0AAQIDCAkKCwABAgMICQoLIAYgBv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgYgBSAEIAT9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9USIFQSD9ywEgBUEg/c0B/VAiBSAJ/c4BIAUgBf0NAAECAwgJCgsAAQIDCAkKCyAJIAn9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIJIAr9USIEQSj9ywEgBEEY/c0B/VAiCiAG/c4BIAogCv0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIE/QsEACAAIAQgBf1RIgVBMP3LASAFQRD9zQH9UCIFIA4gC/1RIgRBMP3LASAEQRD9zQH9UCIEIAT9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9CwRgIAAgBCAFIAX9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9CwRwIAEgBCAI/c4BIAQgBP0NAAECAwgJCgsAAQIDCAkKCyAIIAj9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIE/QsEACAAIAUgCf3OASAFIAX9DQABAgMICQoLAAECAwgJCgsgCSAJ/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCf0LBFAgACAEIAf9USIFQQH9ywEgBUE//c0B/VAiBSAJIAr9USIEQQH9ywEgBEE//c0B/VAiBCAE/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/QsEICAAIAQgBSAF/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/QsEMCAQQQFqIhBBCEcNAAtBACEQA0AgAyAQQQR0aiIAQYABaiAA/QAEgAcgAP0ABIADIgUgAP0ABIABIgT9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAQgBP0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgT9USIJQSD9ywEgCUEg/c0B/VAiCSAA/QAEgAUiBv3OASAJIAn9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBiAF/VEiBUEo/csBIAVBGP3NAf1QIgggBP3OASAIIAj9DQABAgMICQoLAAECAwgJCgsgBCAE/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiCiAKIAn9USIFQTD9ywEgBUEQ/c0B/VAiBSAG/c4BIAUgBf0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIJIAj9USIEQQH9ywEgBEE//c0B/VAiDCAA/QAEgAYgAP0ABIACIgQgAP0ABAAiBv3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBv1RIghBIP3LASAIQSD9zQH9UCIIIAD9AASABCIH/c4BIAggCP0NAAECAwgJCgsAAQIDCAkKCyAHIAf9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIHIAT9USIEQSj9ywEgBEEY/c0B/VAiCyAG/c4BIAsgC/0NAAECAwgJCgsAAQIDCAkKCyAGIAb9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIGIAj9USIEQTD9ywEgBEEQ/c0B/VAiBCAH/c4BIAQgBP0NAAECAwgJCgsAAQIDCAkKCyAHIAf9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIIIAv9USIHQQH9ywEgB0E//c0B/VAiDSAN/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4fIgf9zgEgByAH/Q0AAQIDCAkKCwABAgMICQoLIAogCv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgogBCAFIAX9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9USILQSD9ywEgC0Eg/c0B/VAiCyAI/c4BIAsgC/0NAAECAwgJCgsAAQIDCAkKCyAIIAj9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIIIAf9USIHQSj9ywEgB0EY/c0B/VAiByAK/c4BIAcgB/0NAAECAwgJCgsAAQIDCAkKCyAKIAr9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIO/QsEACAAIAYgDSAMIAz9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh8iCv3OASAKIAr9DQABAgMICQoLAAECAwgJCgsgBiAG/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBiAFIAQgBP0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eH/1RIgVBIP3LASAFQSD9zQH9UCIFIAn9zgEgBSAF/Q0AAQIDCAkKCwABAgMICQoLIAkgCf0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgkgCv1RIgRBKP3LASAEQRj9zQH9UCIKIAb9zgEgCiAK/Q0AAQIDCAkKCwABAgMICQoLIAYgBv0NAAECAwgJCgsAAQIDCAkKC/3eAUEB/csB/c4BIgT9CwQAIAAgBCAF/VEiBUEw/csBIAVBEP3NAf1QIgUgDiAL/VEiBEEw/csBIARBEP3NAf1QIgQgBP0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eH/0LBIAGIAAgBCAFIAX9DQABAgMEBQYHEBESExQVFhf9DQgJCgsMDQ4PGBkaGxwdHh/9CwSAByAAIAQgCP3OASAEIAT9DQABAgMICQoLAAECAwgJCgsgCCAI/Q0AAQIDCAkKCwABAgMICQoL/d4BQQH9ywH9zgEiBP0LBIAEIAAgBSAJ/c4BIAUgBf0NAAECAwgJCgsAAQIDCAkKCyAJIAn9DQABAgMICQoLAAECAwgJCgv93gFBAf3LAf3OASIJ/QsEgAUgACAEIAf9USIFQQH9ywEgBUE//c0B/VAiBSAJIAr9USIEQQH9ywEgBEE//c0B/VAiBCAE/Q0AAQIDBAUGBxAREhMUFRYX/Q0ICQoLDA0ODxgZGhscHR4f/QsEgAIgACAEIAUgBf0NAAECAwQFBgcQERITFBUWF/0NCAkKCwwNDg8YGRobHB0eH/0LBIADIBBBAWoiEEEIRw0AC0EAIRADQCACIBBBBHQiAGoiASAAIANq/QAEACAB/QAEAP1R/QsEACACIABBEHIiAWoiDyABIANq/QAEACAP/QAEAP1R/QsEACACIABBIHIiAWoiDyABIANq/QAEACAP/QAEAP1R/QsEACACIABBMHIiAGoiASAAIANq/QAEACAB/QAEAP1R/QsEACAQQQRqIhBBwABHDQALCxYAIAAgASACIAMQAiAAIAIgAiADEAILewIBfwF+IAIhCSABNQIAIQogBCAFcgRAIAEoAgQgA3AhCQsgACAJNgIAIAAgB0EBayAFIAQbIAhsIAZBAWtBAEF/IAYbIAIgCUYbaiIBIAVBAWogCGxBACAEG2ogAa0gCiAKfkIgiH5CIIinQX9zaiAHIAhscDYCBCAACwQAIwALBgAgACQACxAAIwAgAGtBcHEiACQAIAALBQBBgAgL",e)),(e=>Bb(0,null,"AGFzbQEAAAABPwhgBH9/f38AYAABf2AAAGADf39/AGARf39/f39/f39/f39/f39/f38AYAl/f39/f39/f38Bf2ABfwBgAX8BfwITAQNlbnYGbWVtb3J5AgGQCICABAMLCgIDBAAABQEGBwEEBQFwAQICBgkBfwFBkIjAAgsHfQoDeG9yAAEBRwADAkcyAAQFZ2V0TFoABRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALX2luaXRpYWxpemUAABBfX2Vycm5vX2xvY2F0aW9uAAkJc3RhY2tTYXZlAAYMc3RhY2tSZXN0b3JlAAcKc3RhY2tBbGxvYwAICQcBAEEBCwEACssaCgMAAQtQAQJ/A0AgACAEQQN0IgNqIAIgA2opAwAgASADaikDAIU3AwAgACADQQhyIgNqIAIgA2opAwAgASADaikDAIU3AwAgBEECaiIEQYABRw0ACwveDwICfgF/IAAgAUEDdGoiEyATKQMAIhEgACAFQQN0aiIBKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA1BA3RqIgUgESAFKQMAhUIgiSIRNwMAIAAgCUEDdGoiCSARIAkpAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAEgESABKQMAhUIoiSIRNwMAIBMgESATKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAFIBEgBSkDAIVCMIkiETcDACAJIBEgCSkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgASARIAEpAwCFQgGJNwMAIAAgAkEDdGoiDSANKQMAIhEgACAGQQN0aiICKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA5BA3RqIgYgESAGKQMAhUIgiSIRNwMAIAAgCkEDdGoiCiARIAopAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAIgESACKQMAhUIoiSIRNwMAIA0gESANKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAGIBEgBikDAIVCMIkiETcDACAKIBEgCikDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAiARIAIpAwCFQgGJNwMAIAAgA0EDdGoiDiAOKQMAIhEgACAHQQN0aiIDKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA9BA3RqIgcgESAHKQMAhUIgiSIRNwMAIAAgC0EDdGoiCyARIAspAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAMgESADKQMAhUIoiSIRNwMAIA4gESAOKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAHIBEgBykDAIVCMIkiETcDACALIBEgCykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAyARIAMpAwCFQgGJNwMAIAAgBEEDdGoiDyAPKQMAIhEgACAIQQN0aiIEKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIBBBA3RqIgggESAIKQMAhUIgiSIRNwMAIAAgDEEDdGoiACARIAApAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAQgESAEKQMAhUIoiSIRNwMAIA8gESAPKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAIIBEgCCkDAIVCMIkiETcDACAAIBEgACkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgBCARIAQpAwCFQgGJNwMAIBMgEykDACIRIAIpAwAiEnwgEUIBhkL+////H4MgEkL/////D4N+fCIRNwMAIAggESAIKQMAhUIgiSIRNwMAIAsgESALKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACACIBEgAikDAIVCKIkiETcDACATIBEgEykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgCCARIAgpAwCFQjCJIhE3AwAgCyARIAspAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAIgESACKQMAhUIBiTcDACANIA0pAwAiESADKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAFIBEgBSkDAIVCIIkiETcDACAAIBEgACkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAyARIAMpAwCFQiiJIhE3AwAgDSARIA0pAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAUgESAFKQMAhUIwiSIRNwMAIAAgESAAKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACADIBEgAykDAIVCAYk3AwAgDiAOKQMAIhEgBCkDACISfCARQgGGQv7///8fgyASQv////8Pg358IhE3AwAgBiARIAYpAwCFQiCJIhE3AwAgCSARIAkpAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAQgESAEKQMAhUIoiSIRNwMAIA4gESAOKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAGIBEgBikDAIVCMIkiETcDACAJIBEgCSkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgBCARIAQpAwCFQgGJNwMAIA8gDykDACIRIAEpAwAiEnwgEUIBhkL+////H4MgEkL/////D4N+fCIRNwMAIAcgESAHKQMAhUIgiSIRNwMAIAogESAKKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACABIBEgASkDAIVCKIkiETcDACAPIBEgDykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgByARIAcpAwCFQjCJIhE3AwAgCiARIAopAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAEgESABKQMAhUIBiTcDAAvdCAEPfwNAIAIgBUEDdCIGaiABIAZqKQMAIAAgBmopAwCFNwMAIAIgBkEIciIGaiABIAZqKQMAIAAgBmopAwCFNwMAIAVBAmoiBUGAAUcNAAsDQCADIARBA3QiAGogACACaikDADcDACADIARBAXIiAEEDdCIBaiABIAJqKQMANwMAIAMgBEECciIBQQN0IgVqIAIgBWopAwA3AwAgAyAEQQNyIgVBA3QiBmogAiAGaikDADcDACADIARBBHIiBkEDdCIHaiACIAdqKQMANwMAIAMgBEEFciIHQQN0IghqIAIgCGopAwA3AwAgAyAEQQZyIghBA3QiCWogAiAJaikDADcDACADIARBB3IiCUEDdCIKaiACIApqKQMANwMAIAMgBEEIciIKQQN0IgtqIAIgC2opAwA3AwAgAyAEQQlyIgtBA3QiDGogAiAMaikDADcDACADIARBCnIiDEEDdCINaiACIA1qKQMANwMAIAMgBEELciINQQN0Ig5qIAIgDmopAwA3AwAgAyAEQQxyIg5BA3QiD2ogAiAPaikDADcDACADIARBDXIiD0EDdCIQaiACIBBqKQMANwMAIAMgBEEOciIQQQN0IhFqIAIgEWopAwA3AwAgAyAEQQ9yIhFBA3QiEmogAiASaikDADcDACADIARB//8DcSAAQf//A3EgAUH//wNxIAVB//8DcSAGQf//A3EgB0H//wNxIAhB//8DcSAJQf//A3EgCkH//wNxIAtB//8DcSAMQf//A3EgDUH//wNxIA5B//8DcSAPQf//A3EgEEH//wNxIBFB//8DcRACIARB8ABJIQAgBEEQaiEEIAANAAtBACEBIANBAEEBQRBBEUEgQSFBMEExQcAAQcEAQdAAQdEAQeAAQeEAQfAAQfEAEAIgA0ECQQNBEkETQSJBI0EyQTNBwgBBwwBB0gBB0wBB4gBB4wBB8gBB8wAQAiADQQRBBUEUQRVBJEElQTRBNUHEAEHFAEHUAEHVAEHkAEHlAEH0AEH1ABACIANBBkEHQRZBF0EmQSdBNkE3QcYAQccAQdYAQdcAQeYAQecAQfYAQfcAEAIgA0EIQQlBGEEZQShBKUE4QTlByABByQBB2ABB2QBB6ABB6QBB+ABB+QAQAiADQQpBC0EaQRtBKkErQTpBO0HKAEHLAEHaAEHbAEHqAEHrAEH6AEH7ABACIANBDEENQRxBHUEsQS1BPEE9QcwAQc0AQdwAQd0AQewAQe0AQfwAQf0AEAIgA0EOQQ9BHkEfQS5BL0E+QT9BzgBBzwBB3gBB3wBB7gBB7wBB/gBB/wAQAgNAIAIgAUEDdCIAaiIEIAAgA2opAwAgBCkDAIU3AwAgAiAAQQhyIgRqIgUgAyAEaikDACAFKQMAhTcDACACIABBEHIiBGoiBSADIARqKQMAIAUpAwCFNwMAIAIgAEEYciIAaiIEIAAgA2opAwAgBCkDAIU3AwAgAUEEaiIBQYABRw0ACwsWACAAIAEgAiADEAMgACACIAIgAxADC3sCAX8BfiACIQkgATUCACEKIAQgBXIEQCABKAIEIANwIQkLIAAgCTYCACAAIAdBAWsgBSAEGyAIbCAGQQFrQQBBfyAGGyACIAlGG2oiASAFQQFqIAhsQQAgBBtqIAGtIAogCn5CIIh+QiCIp0F/c2ogByAIbHA2AgQgAAsEACMACwYAIAAkAAsQACMAIABrQXBxIgAkACAACwUAQYAICw==",e)))});export{Hu as AEADEncryptedDataPacket,Pa as Argon2OutOfMemoryError,xa as Argon2S2K,Jh as CleartextMessage,Ku as CompressedDataPacket,ba as KDFParams,Eu as LiteralDataPacket,Zu as MarkerPacket,Oh as Message,Pu as OnePassSignaturePacket,Du as PacketList,xh as PrivateKey,Dh as PublicKey,ju as PublicKeyEncryptedSessionKeyPacket,Vu as PublicKeyPacket,Xu as PublicSubkeyPacket,eh as SecretKeyPacket,nh as SecretSubkeyPacket,oh as Signature,Iu as SignaturePacket,Ch as Subkey,qu as SymEncryptedIntegrityProtectedDataPacket,Wu as SymEncryptedSessionKeyPacket,Yu as SymmetricallyEncryptedDataPacket,ah as TrustPacket,bn as UnparseablePacket,$u as UserAttributePacket,ih as UserIDPacket,le as armor,ne as config,Zh as createCleartextMessage,Wh as createMessage,af as decrypt,tf as decryptKey,hf as decryptSessionKeys,nf as encrypt,rf as encryptKey,uf as encryptSessionKey,V as enums,Xh as generateKey,cf as generateSessionKey,Yh as readCleartextMessage,Th as readKey,zh as readKeys,Gh as readMessage,Qh as readPrivateKey,Fh as readPrivateKeys,ch as readSignature,$h as reformatKey,ef as revokeKey,sf as sign,de as unarmor,of as verify};
|
|
17
17
|
//# sourceMappingURL=openpgp.min.mjs.map
|