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AO,SAAW,GAC1DA,EAAO,OAASR,EAAS,CAAC,EACnBA,EAAS,CAAC,IAAM,KACvBQ,EAAO,cAAgB,MAG3BA,EAAO,MAAQR,EAAS,CAAC,EACrB,OAAOQ,EAAO,OAAW,KAAeA,EAAO,SAAW,KAC1DA,EAAO,cAAgB,KAI3B,OAAOP,EAAU,OAAW,KAAeV,GAAa,KAAKU,EAAU,MAAM,EAC7EO,EAAO,OAASP,EAAU,WAE1B,OAAM,IAAI,UAAU,uCAAuC,EAG/D,GAAI,OAAOA,EAAU,UAAc,IAC/B,IAAKnO,EAAO2N,GAAyBD,IAAiB,KAAKS,EAAU,SAAS,EAC1EO,EAAO,UAAYP,EAAU,cAE7B,OAAM,IAAI,UAAU,+BAA+B,EAI3D,GAAI,OAAOA,EAAU,OAAW,IAC5B,GAAIN,GAAuB,KAAKM,EAAU,MAAM,EAC5CO,EAAO,OAAS,SAASP,EAAU,OAAQ,EAAE,MAE7C,OAAM,IAAI,UAAU,4BAA4B,EAIxD,OAAI,OAAOnO,EAAS,MAChB0O,EAAO,KAAO1O,GAEX,IAAIyO,EAAIC,CAAM,CACzB,CAKE,OAAO,UAAUC,EAAK,CACpB,GAAIA,aAAetC,GAAQsC,aAAevB,GACtC,OAAOuB,EAAI,SAAS,EAExB,MAAM,IAAI,UAAU,4BAA4B,CACpD,CACJ,EAKUC,GAAU","names":["uintDecode","num","buf","arr","acc","i","isBytes","a","anumber","n","title","prefix","abytes","value","length","bytes","len","ofLen","got","message","ahash","h","aexists","instance","checkFinished","aoutput","out","min","u32","clean","arrays","createView","rotr","word","shift","rotl","isLE","byteSwap","byteSwap32","swap32IfBE","u","createHasher","hashCons","info","hashC","msg","opts","tmp","oidNist","suffix","_HMAC","to","oHash","iHash","finished","destroyed","blockLen","outputLen","hash","key","pad","hmac","hmac_","Chi","b","c","Maj","HashMD","data","view","buffer","pos","take","dataView","oview","outLen","state","res","padOffset","SHA256_IV","SHA224_IV","SHA384_IV","SHA512_IV","SHA1_IV","SHA1_W","_SHA1","A","B","C","D","E","offset","F","K","T","sha1","U32_MASK64","_32n","fromBig","le","split","lst","Ah","Al","l","shrSH","_l","shrSL","rotrSH","rotrSL","rotrBH","rotrBL","rotlSH","rotlSL","rotlBH","rotlBL","add","Bh","Bl","add3L","Cl","add3H","low","Ch","add4L","Dl","add4H","Dh","add5L","El","add5H","Eh","SHA256_K","SHA256_W","SHA2_32B","G","H","W15","W2","s0","s1","sigma1","T1","T2","_SHA256","_SHA224","K512","SHA512_Kh","SHA512_Kl","SHA512_W_H","SHA512_W_L","SHA2_64B","Fh","Fl","Gh","Gl","Hh","Hl","W15h","W15l","s0h","s0l","W2h","W2l","s1h","s1l","SUMl","SUMh","sigma1h","sigma1l","CHIh","CHIl","T1ll","T1h","T1l","sigma0h","sigma0l","MAJh","MAJl","All","_SHA512","_SHA384","sha256","sha224","sha512","sha384","_0n","_1n","_2n","_7n","_256n","_0x71n","SHA3_PI","SHA3_ROTL","_SHA3_IOTA","round","R","x","y","t","j","IOTAS","SHA3_IOTA_H","SHA3_IOTA_L","rotlH","rotlL","keccakP","s","rounds","idx1","idx0","B0","B1","Th","Tl","curH","curL","PI","b0","b1","b2","b3","Keccak","_Keccak","bufferOut","enableXOF","genKeccak","sha3_224","sha3_256","sha3_384","sha3_512","globalScope","nobleHashes","canonicalizeAlgorithm","algorithm","hmacDigest","ALPHABET","base32Decode","str","end","bits","index","idx","base32Encode","hexDecode","hexEncode","hex","latin1Decode","latin1Encode","ENCODER","DECODER","utf8Decode","utf8Encode","randomBytes","size","Secret","_Secret","timingSafeEqual","HOTP","_HOTP","secret","digits","counter","digest","token","window","delta","check","generatedToken","e","issuer","label","issuerInLabel","TOTP","_TOTP","period","timestamp","OTPURI_REGEX","SECRET_REGEX","ALGORITHM_REGEX","ALGORITHM_CUSTOM_REGEX","INTEGER_REGEX","POSITIVE_INTEGER_REGEX","URI","uri","uriGroups","uriType","uriLabel","uriParams","cur","pairArr","pairKey","pairVal","pairAcc","OTP","config","otp","version"],"sources":["../esm/npm/otpauth@9.5.1/node_modules/otpauth/dist/otpauth.esm.js"],"sourcesContent":["//! otpauth 9.5.1 | (c) Héctor Molinero Fernández | MIT | https://github.com/hectorm/otpauth\n//! noble-hashes 2.2.0 | (c) Paul Miller | MIT | https://github.com/paulmillr/noble-hashes\n/// \u003creference types=\"./otpauth.d.ts\" /\u003e\n// @ts-nocheck\n/**\n * Converts an integer to an Uint8Array.\n * @param {number} num Integer.\n * @returns {Uint8Array} Uint8Array.\n */ const uintDecode = (num)=\u003e{\n    const buf = new ArrayBuffer(8);\n    const arr = new Uint8Array(buf);\n    let acc = num;\n    for(let i = 7; i \u003e= 0; i--){\n        if (acc === 0) break;\n        arr[i] = acc \u0026 255;\n        acc -= arr[i];\n        acc /= 256;\n    }\n    return arr;\n};\n\n/**\n * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.\n * @param a - value to test\n * @returns `true` when the value is a Uint8Array-compatible view.\n * @example\n * Check whether a value is a Uint8Array-compatible view.\n * ```ts\n * isBytes(new Uint8Array([1, 2, 3]));\n * ```\n */ function isBytes(a) {\n    // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases.\n    // The fallback still requires a real ArrayBuffer view, so plain\n    // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and\n    // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views.\n    return a instanceof Uint8Array || ArrayBuffer.isView(a) \u0026\u0026 a.constructor.name === 'Uint8Array' \u0026\u0026 'BYTES_PER_ELEMENT' in a \u0026\u0026 a.BYTES_PER_ELEMENT === 1;\n}\n/**\n * Asserts something is a non-negative integer.\n * @param n - number to validate\n * @param title - label included in thrown errors\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a non-negative integer option.\n * ```ts\n * anumber(32, 'length');\n * ```\n */ function anumber(n, title = '') {\n    if (typeof n !== 'number') {\n        const prefix = title \u0026\u0026 `\"${title}\" `;\n        throw new TypeError(`${prefix}expected number, got ${typeof n}`);\n    }\n    if (!Number.isSafeInteger(n) || n \u003c 0) {\n        const prefix = title \u0026\u0026 `\"${title}\" `;\n        throw new RangeError(`${prefix}expected integer \u003e= 0, got ${n}`);\n    }\n}\n/**\n * Asserts something is Uint8Array.\n * @param value - value to validate\n * @param length - optional exact length constraint\n * @param title - label included in thrown errors\n * @returns The validated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate that a value is a byte array.\n * ```ts\n * abytes(new Uint8Array([1, 2, 3]));\n * ```\n */ function abytes(value, length, title = '') {\n    const bytes = isBytes(value);\n    const len = value?.length;\n    const needsLen = length !== undefined;\n    if (!bytes || needsLen) {\n        const prefix = title \u0026\u0026 `\"${title}\" `;\n        const ofLen = '';\n        const got = bytes ? `length=${len}` : `type=${typeof value}`;\n        const message = prefix + 'expected Uint8Array' + ofLen + ', got ' + got;\n        if (!bytes) throw new TypeError(message);\n        throw new RangeError(message);\n    }\n    return value;\n}\n/**\n * Asserts something is a wrapped hash constructor.\n * @param h - hash constructor to validate\n * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError}\n * @throws On invalid hash metadata ranges or values. {@link RangeError}\n * @throws If the hash metadata allows empty outputs or block sizes. {@link Error}\n * @example\n * Validate a callable hash wrapper.\n * ```ts\n * import { ahash } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * ahash(sha256);\n * ```\n */ function ahash(h) {\n    if (typeof h !== 'function' || typeof h.create !== 'function') throw new TypeError('Hash must wrapped by utils.createHasher');\n    anumber(h.outputLen);\n    anumber(h.blockLen);\n    // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass\n    // validation and can produce empty outputs instead of failing fast.\n    if (h.outputLen \u003c 1) throw new Error('\"outputLen\" must be \u003e= 1');\n    if (h.blockLen \u003c 1) throw new Error('\"blockLen\" must be \u003e= 1');\n}\n/**\n * Asserts a hash instance has not been destroyed or finished.\n * @param instance - hash instance to validate\n * @param checkFinished - whether to reject finalized instances\n * @throws If the hash instance has already been destroyed or finalized. {@link Error}\n * @example\n * Validate that a hash instance is still usable.\n * ```ts\n * import { aexists } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aexists(hash);\n * ```\n */ function aexists(instance, checkFinished = true) {\n    if (instance.destroyed) throw new Error('Hash instance has been destroyed');\n    if (checkFinished \u0026\u0026 instance.finished) throw new Error('Hash#digest() has already been called');\n}\n/**\n * Asserts output is a sufficiently-sized byte array.\n * @param out - destination buffer\n * @param instance - hash instance providing output length\n * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a caller-provided digest buffer.\n * ```ts\n * import { aoutput } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aoutput(new Uint8Array(hash.outputLen), hash);\n * ```\n */ function aoutput(out, instance) {\n    abytes(out, undefined, 'digestInto() output');\n    const min = instance.outputLen;\n    if (out.length \u003c min) {\n        throw new RangeError('\"digestInto() output\" expected to be of length \u003e=' + min);\n    }\n}\n/**\n * Casts a typed array view to Uint32Array.\n * `arr.byteOffset` must already be 4-byte aligned or the platform\n * Uint32Array constructor will throw.\n * @param arr - source typed array\n * @returns Uint32Array view over the same buffer.\n * @example\n * Reinterpret a byte array as 32-bit words.\n * ```ts\n * u32(new Uint8Array(8));\n * ```\n */ function u32(arr) {\n    return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/**\n * Zeroizes typed arrays in place. Warning: JS provides no guarantees.\n * @param arrays - arrays to overwrite with zeros\n * @example\n * Zeroize sensitive buffers in place.\n * ```ts\n * clean(new Uint8Array([1, 2, 3]));\n * ```\n */ function clean(...arrays) {\n    for(let i = 0; i \u003c arrays.length; i++){\n        arrays[i].fill(0);\n    }\n}\n/**\n * Creates a DataView for byte-level manipulation.\n * @param arr - source typed array\n * @returns DataView over the same buffer region.\n * @example\n * Create a DataView over an existing buffer.\n * ```ts\n * createView(new Uint8Array(4));\n * ```\n */ function createView(arr) {\n    return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Rotate-right operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the right.\n * ```ts\n * rotr(0x12345678, 8);\n * ```\n */ function rotr(word, shift) {\n    return word \u003c\u003c 32 - shift | word \u003e\u003e\u003e shift;\n}\n/**\n * Rotate-left operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the left.\n * ```ts\n * rotl(0x12345678, 8);\n * ```\n */ function rotl(word, shift) {\n    return word \u003c\u003c shift | word \u003e\u003e\u003e 32 - shift \u003e\u003e\u003e 0;\n}\n/** Whether the current platform is little-endian. */ const isLE = /* @__PURE__ */ (()=\u003enew Uint8Array(new Uint32Array([\n        0x11223344\n    ]).buffer)[0] === 0x44)();\n/**\n * Byte-swap operation for uint32 values.\n * @param word - source word\n * @returns Word with reversed byte order.\n * @example\n * Reverse the byte order of a 32-bit word.\n * ```ts\n * byteSwap(0x11223344);\n * ```\n */ function byteSwap(word) {\n    return word \u003c\u003c 24 \u0026 0xff000000 | word \u003c\u003c 8 \u0026 0xff0000 | word \u003e\u003e\u003e 8 \u0026 0xff00 | word \u003e\u003e\u003e 24 \u0026 0xff;\n}\n/**\n * Byte-swaps every word of a Uint32Array in place.\n * @param arr - array to mutate\n * @returns The same array after mutation; callers pass live state arrays here.\n * @example\n * Reverse the byte order of every word in place.\n * ```ts\n * byteSwap32(new Uint32Array([0x11223344]));\n * ```\n */ function byteSwap32(arr) {\n    for(let i = 0; i \u003c arr.length; i++){\n        arr[i] = byteSwap(arr[i]);\n    }\n    return arr;\n}\n/**\n * Conditionally byte-swaps a Uint32Array on big-endian platforms.\n * @param u - array to normalize for host endianness\n * @returns Original or byte-swapped array depending on platform endianness.\n *   On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`.\n * @example\n * Normalize a word array for host endianness.\n * ```ts\n * swap32IfBE(new Uint32Array([0x11223344]));\n * ```\n */ const swap32IfBE = isLE ? (u)=\u003eu : byteSwap32;\n/**\n * Creates a callable hash function from a stateful class constructor.\n * @param hashCons - hash constructor or factory\n * @param info - optional metadata such as DER OID\n * @returns Frozen callable hash wrapper with `.create()`.\n *   Wrapper construction eagerly calls `hashCons(undefined)` once to read\n *   `outputLen` / `blockLen`, so constructor side effects happen at module\n *   init time.\n * @example\n * Wrap a stateful hash constructor into a callable helper.\n * ```ts\n * import { createHasher } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const wrapped = createHasher(sha256.create, { oid: sha256.oid });\n * wrapped(new Uint8Array([1]));\n * ```\n */ function createHasher(hashCons, info = {}) {\n    const hashC = (msg, opts)=\u003ehashCons(opts).update(msg).digest();\n    const tmp = hashCons(undefined);\n    hashC.outputLen = tmp.outputLen;\n    hashC.blockLen = tmp.blockLen;\n    hashC.canXOF = tmp.canXOF;\n    hashC.create = (opts)=\u003ehashCons(opts);\n    Object.assign(hashC, info);\n    return Object.freeze(hashC);\n}\n/**\n * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.\n * @param suffix - final OID byte for the selected hash.\n *   The helper accepts any byte even though only the documented NIST hash\n *   suffixes are meaningful downstream.\n * @returns Object containing the DER-encoded OID.\n * @example\n * Build OID metadata for a NIST hash.\n * ```ts\n * oidNist(0x01);\n * ```\n */ const oidNist = (suffix)=\u003e({\n        // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet.\n        // Larger suffix values would need base-128 OID encoding and a different length byte.\n        oid: Uint8Array.from([\n            0x06,\n            0x09,\n            0x60,\n            0x86,\n            0x48,\n            0x01,\n            0x65,\n            0x03,\n            0x04,\n            0x02,\n            suffix\n        ])\n    });\n\n/**\n * Internal class for HMAC.\n * Accepts any byte key, although RFC 2104 §3 recommends keys at least\n * `HashLen` bytes long.\n */ class _HMAC {\n    update(buf) {\n        aexists(this);\n        this.iHash.update(buf);\n        return this;\n    }\n    digestInto(out) {\n        aexists(this);\n        aoutput(out, this);\n        this.finished = true;\n        const buf = out.subarray(0, this.outputLen);\n        // Reuse the first outputLen bytes for the inner digest; the outer hash consumes them before\n        // overwriting that same prefix with the final tag, leaving any oversized tail untouched.\n        this.iHash.digestInto(buf);\n        this.oHash.update(buf);\n        this.oHash.digestInto(buf);\n        this.destroy();\n    }\n    digest() {\n        const out = new Uint8Array(this.oHash.outputLen);\n        this.digestInto(out);\n        return out;\n    }\n    _cloneInto(to) {\n        // Create new instance without calling constructor since the key\n        // is already in state and we don't know it.\n        to || (to = Object.create(Object.getPrototypeOf(this), {}));\n        const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;\n        to = to;\n        to.finished = finished;\n        to.destroyed = destroyed;\n        to.blockLen = blockLen;\n        to.outputLen = outputLen;\n        to.oHash = oHash._cloneInto(to.oHash);\n        to.iHash = iHash._cloneInto(to.iHash);\n        return to;\n    }\n    clone() {\n        return this._cloneInto();\n    }\n    destroy() {\n        this.destroyed = true;\n        this.oHash.destroy();\n        this.iHash.destroy();\n    }\n    constructor(hash, key){\n        this.canXOF = false;\n        this.finished = false;\n        this.destroyed = false;\n        ahash(hash);\n        abytes(key, undefined, 'key');\n        this.iHash = hash.create();\n        if (typeof this.iHash.update !== 'function') throw new Error('Expected instance of class which extends utils.Hash');\n        this.blockLen = this.iHash.blockLen;\n        this.outputLen = this.iHash.outputLen;\n        const blockLen = this.blockLen;\n        const pad = new Uint8Array(blockLen);\n        // blockLen can be bigger than outputLen\n        pad.set(key.length \u003e blockLen ? hash.create().update(key).digest() : key);\n        for(let i = 0; i \u003c pad.length; i++)pad[i] ^= 0x36;\n        this.iHash.update(pad);\n        // By doing update (processing of the first block) of the outer hash here,\n        // we can re-use it between multiple calls via clone.\n        this.oHash = hash.create();\n        // Undo internal XOR \u0026\u0026 apply outer XOR\n        for(let i = 0; i \u003c pad.length; i++)pad[i] ^= 0x36 ^ 0x5c;\n        this.oHash.update(pad);\n        clean(pad);\n    }\n}\nconst hmac = /* @__PURE__ */ (()=\u003e{\n    const hmac_ = (hash, key, message)=\u003enew _HMAC(hash, key).update(message).digest();\n    hmac_.create = (hash, key)=\u003enew _HMAC(hash, key);\n    return hmac_;\n})();\n\n/**\n * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`.\n * Returns bits from `b` when `a` is set, otherwise from `c`.\n * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never\n * set the same bit.\n * @param a - selector word\n * @param b - word chosen when selector bit is set\n * @param c - word chosen when selector bit is clear\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit choice primitive.\n * ```ts\n * Chi(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */ function Chi(a, b, c) {\n    return a \u0026 b ^ ~a \u0026 c;\n}\n/**\n * Shared 32-bit majority primitive reused by SHA-256 and SHA-1.\n * Returns bits shared by at least two inputs.\n * @param a - first input word\n * @param b - second input word\n * @param c - third input word\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit majority primitive.\n * ```ts\n * Maj(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */ function Maj(a, b, c) {\n    return a \u0026 b ^ a \u0026 c ^ b \u0026 c;\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit\n * strings with partial-byte tails.\n * @param blockLen - internal block size in bytes\n * @param outputLen - digest size in bytes\n * @param padOffset - trailing length field size in bytes\n * @param isLE - whether length and state words are encoded in little-endian\n * @example\n * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow.\n * ```ts\n * import { _SHA1 } from '@noble/hashes/legacy.js';\n * const hash = new _SHA1();\n * hash.update(new Uint8Array([97, 98, 99]));\n * hash.digest();\n * ```\n */ class HashMD {\n    update(data) {\n        aexists(this);\n        abytes(data);\n        const { view, buffer, blockLen } = this;\n        const len = data.length;\n        for(let pos = 0; pos \u003c len;){\n            const take = Math.min(blockLen - this.pos, len - pos);\n            // Fast path only when there is no buffered partial block: `take === blockLen` implies\n            // `this.pos === 0`, so we can process full blocks directly from the input view.\n            if (take === blockLen) {\n                const dataView = createView(data);\n                for(; blockLen \u003c= len - pos; pos += blockLen)this.process(dataView, pos);\n                continue;\n            }\n            buffer.set(data.subarray(pos, pos + take), this.pos);\n            this.pos += take;\n            pos += take;\n            if (this.pos === blockLen) {\n                this.process(view, 0);\n                this.pos = 0;\n            }\n        }\n        this.length += data.length;\n        this.roundClean();\n        return this;\n    }\n    digestInto(out) {\n        aexists(this);\n        aoutput(out, this);\n        this.finished = true;\n        // Padding\n        // We can avoid allocation of buffer for padding completely if it\n        // was previously not allocated here. But it won't change performance.\n        const { buffer, view, blockLen, isLE } = this;\n        let { pos } = this;\n        // append the bit '1' to the message\n        buffer[pos++] = 0b10000000;\n        clean(this.buffer.subarray(pos));\n        // we have less than padOffset left in buffer, so we cannot put length in\n        // current block, need process it and pad again\n        if (this.padOffset \u003e blockLen - pos) {\n            this.process(view, 0);\n            pos = 0;\n        }\n        // Pad until full block byte with zeros\n        for(let i = pos; i \u003c blockLen; i++)buffer[i] = 0;\n        // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from\n        // the padding fill above, and JS will overflow before user input can make that half non-zero.\n        // So we only need to write the low 64 bits here.\n        view.setBigUint64(blockLen - 8, BigInt(this.length * 8), isLE);\n        this.process(view, 0);\n        const oview = createView(out);\n        const len = this.outputLen;\n        // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT\n        if (len % 4) throw new Error('_sha2: outputLen must be aligned to 32bit');\n        const outLen = len / 4;\n        const state = this.get();\n        if (outLen \u003e state.length) throw new Error('_sha2: outputLen bigger than state');\n        for(let i = 0; i \u003c outLen; i++)oview.setUint32(4 * i, state[i], isLE);\n    }\n    digest() {\n        const { buffer, outputLen } = this;\n        this.digestInto(buffer);\n        // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return\n        // fresh bytes to the caller.\n        const res = buffer.slice(0, outputLen);\n        this.destroy();\n        return res;\n    }\n    _cloneInto(to) {\n        to || (to = new this.constructor());\n        to.set(...this.get());\n        const { blockLen, buffer, length, finished, destroyed, pos } = this;\n        to.destroyed = destroyed;\n        to.finished = finished;\n        to.length = length;\n        to.pos = pos;\n        // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and\n        // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it.\n        if (length % blockLen) to.buffer.set(buffer);\n        return to;\n    }\n    clone() {\n        return this._cloneInto();\n    }\n    constructor(blockLen, outputLen, padOffset, isLE){\n        this.canXOF = false;\n        this.finished = false;\n        this.length = 0;\n        this.pos = 0;\n        this.destroyed = false;\n        this.blockLen = blockLen;\n        this.outputLen = outputLen;\n        this.padOffset = padOffset;\n        this.isLE = isLE;\n        this.buffer = new Uint8Array(blockLen);\n        this.view = createView(this.buffer);\n    }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */ /** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the\n * square roots of the first eight prime numbers. Exported as a shared table; callers must treat\n * it as read-only because constructors copy words from it by index. */ const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n    0x6a09e667,\n    0xbb67ae85,\n    0x3c6ef372,\n    0xa54ff53a,\n    0x510e527f,\n    0x9b05688c,\n    0x1f83d9ab,\n    0x5be0cd19\n]);\n/** Initial SHA224 state `H(0)` from RFC 6234 §6.1. Exported as a shared table; callers must\n * treat it as read-only because constructors copy words from it by index. */ const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n    0xc1059ed8,\n    0x367cd507,\n    0x3070dd17,\n    0xf70e5939,\n    0xffc00b31,\n    0x68581511,\n    0x64f98fa7,\n    0xbefa4fa4\n]);\n/** Initial SHA384 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the ninth\n * through sixteenth prime numbers. Exported as a shared table; callers must treat it as read-only\n * because constructors copy halves from it by index. */ const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n    0xcbbb9d5d,\n    0xc1059ed8,\n    0x629a292a,\n    0x367cd507,\n    0x9159015a,\n    0x3070dd17,\n    0x152fecd8,\n    0xf70e5939,\n    0x67332667,\n    0xffc00b31,\n    0x8eb44a87,\n    0x68581511,\n    0xdb0c2e0d,\n    0x64f98fa7,\n    0x47b5481d,\n    0xbefa4fa4\n]);\n/** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first\n * eight prime numbers. Exported as a shared table; callers must treat it as read-only because\n * constructors copy halves from it by index. */ const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n    0x6a09e667,\n    0xf3bcc908,\n    0xbb67ae85,\n    0x84caa73b,\n    0x3c6ef372,\n    0xfe94f82b,\n    0xa54ff53a,\n    0x5f1d36f1,\n    0x510e527f,\n    0xade682d1,\n    0x9b05688c,\n    0x2b3e6c1f,\n    0x1f83d9ab,\n    0xfb41bd6b,\n    0x5be0cd19,\n    0x137e2179\n]);\n\n/** Initial SHA-1 state from RFC 3174 §6.1. */ const SHA1_IV = /* @__PURE__ */ Uint32Array.from([\n    0x67452301,\n    0xefcdab89,\n    0x98badcfe,\n    0x10325476,\n    0xc3d2e1f0\n]);\n// Reusable 80-word SHA-1 message schedule buffer.\nconst SHA1_W = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA1 legacy hash class. */ class _SHA1 extends HashMD {\n    get() {\n        const { A, B, C, D, E } = this;\n        return [\n            A,\n            B,\n            C,\n            D,\n            E\n        ];\n    }\n    set(A, B, C, D, E) {\n        this.A = A | 0;\n        this.B = B | 0;\n        this.C = C | 0;\n        this.D = D | 0;\n        this.E = E | 0;\n    }\n    process(view, offset) {\n        for(let i = 0; i \u003c 16; i++, offset += 4)SHA1_W[i] = view.getUint32(offset, false);\n        for(let i = 16; i \u003c 80; i++)SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1);\n        // Compression function main loop, 80 rounds\n        let { A, B, C, D, E } = this;\n        for(let i = 0; i \u003c 80; i++){\n            let F, K;\n            if (i \u003c 20) {\n                F = Chi(B, C, D);\n                K = 0x5a827999;\n            } else if (i \u003c 40) {\n                F = B ^ C ^ D;\n                K = 0x6ed9eba1;\n            } else if (i \u003c 60) {\n                F = Maj(B, C, D);\n                K = 0x8f1bbcdc;\n            } else {\n                F = B ^ C ^ D;\n                K = 0xca62c1d6;\n            }\n            const T = rotl(A, 5) + F + E + K + SHA1_W[i] | 0;\n            E = D;\n            D = C;\n            C = rotl(B, 30);\n            B = A;\n            A = T;\n        }\n        // Add the compressed chunk to the current hash value\n        A = A + this.A | 0;\n        B = B + this.B | 0;\n        C = C + this.C | 0;\n        D = D + this.D | 0;\n        E = E + this.E | 0;\n        this.set(A, B, C, D, E);\n    }\n    roundClean() {\n        clean(SHA1_W);\n    }\n    destroy() {\n        // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n        // update()/digest() callable on reused instances.\n        this.destroyed = true;\n        this.set(0, 0, 0, 0, 0);\n        clean(this.buffer);\n    }\n    constructor(){\n        super(64, 20, 8, false), this.A = SHA1_IV[0] | 0, this.B = SHA1_IV[1] | 0, this.C = SHA1_IV[2] | 0, this.D = SHA1_IV[3] | 0, this.E = SHA1_IV[4] | 0;\n    }\n}\n/**\n * SHA1 (RFC 3174) legacy hash function. It was cryptographically broken.\n * @param msg - message bytes to hash\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA1.\n * ```ts\n * sha1(new Uint8Array([97, 98, 99]));\n * ```\n */ const sha1 = /* @__PURE__ */ createHasher(()=\u003enew _SHA1());\n\nconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high\n// }` to match little-endian word order rather than the property names.\nfunction fromBig(n, le = false) {\n    if (le) return {\n        h: Number(n \u0026 U32_MASK64),\n        l: Number(n \u003e\u003e _32n \u0026 U32_MASK64)\n    };\n    return {\n        h: Number(n \u003e\u003e _32n \u0026 U32_MASK64) | 0,\n        l: Number(n \u0026 U32_MASK64) | 0\n    };\n}\n// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array\n// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`.\nfunction split(lst, le = false) {\n    const len = lst.length;\n    let Ah = new Uint32Array(len);\n    let Al = new Uint32Array(len);\n    for(let i = 0; i \u003c len; i++){\n        const { h, l } = fromBig(lst[i], le);\n        [Ah[i], Al[i]] = [\n            h,\n            l\n        ];\n    }\n    return [\n        Ah,\n        Al\n    ];\n}\n// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`.\nconst shrSH = (h, _l, s)=\u003eh \u003e\u003e\u003e s;\n// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`.\nconst shrSL = (h, l, s)=\u003eh \u003c\u003c 32 - s | l \u003e\u003e\u003e s;\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSH = (h, l, s)=\u003eh \u003e\u003e\u003e s | l \u003c\u003c 32 - s;\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSL = (h, l, s)=\u003eh \u003c\u003c 32 - s | l \u003e\u003e\u003e s;\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBH = (h, l, s)=\u003eh \u003c\u003c 64 - s | l \u003e\u003e\u003e s - 32;\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBL = (h, l, s)=\u003eh \u003e\u003e\u003e s - 32 | l \u003c\u003c 64 - s;\n// High 32-bit half of a 64-bit left rotate, valid for `s` in `1..31`.\nconst rotlSH = (h, l, s)=\u003eh \u003c\u003c s | l \u003e\u003e\u003e 32 - s;\n// Low 32-bit half of a 64-bit left rotate, valid for `s` in `1..31`.\nconst rotlSL = (h, l, s)=\u003el \u003c\u003c s | h \u003e\u003e\u003e 32 - s;\n// High 32-bit half of a 64-bit left rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotlBH = (h, l, s)=\u003el \u003c\u003c s - 32 | h \u003e\u003e\u003e 64 - s;\n// Low 32-bit half of a 64-bit left rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotlBL = (h, l, s)=\u003eh \u003c\u003c s - 32 | l \u003e\u003e\u003e 64 - s;\n// Add two split 64-bit words and return the split `{ h, l }` sum.\n// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out\n// of the low sum and instead use division.\nfunction add(Ah, Al, Bh, Bl) {\n    const l = (Al \u003e\u003e\u003e 0) + (Bl \u003e\u003e\u003e 0);\n    return {\n        h: Ah + Bh + (l / 2 ** 32 | 0) | 0,\n        l: l | 0\n    };\n}\n// Addition with more than 2 elements\n// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`.\nconst add3L = (Al, Bl, Cl)=\u003e(Al \u003e\u003e\u003e 0) + (Bl \u003e\u003e\u003e 0) + (Cl \u003e\u003e\u003e 0);\n// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`.\nconst add3H = (low, Ah, Bh, Ch)=\u003eAh + Bh + Ch + (low / 2 ** 32 | 0) | 0;\n// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`.\nconst add4L = (Al, Bl, Cl, Dl)=\u003e(Al \u003e\u003e\u003e 0) + (Bl \u003e\u003e\u003e 0) + (Cl \u003e\u003e\u003e 0) + (Dl \u003e\u003e\u003e 0);\n// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`.\nconst add4H = (low, Ah, Bh, Ch, Dh)=\u003eAh + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;\n// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`.\nconst add5L = (Al, Bl, Cl, Dl, El)=\u003e(Al \u003e\u003e\u003e 0) + (Bl \u003e\u003e\u003e 0) + (Cl \u003e\u003e\u003e 0) + (Dl \u003e\u003e\u003e 0) + (El \u003e\u003e\u003e 0);\n// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`.\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh)=\u003eAh + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;\n\n/**\n * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits\n * of the cube roots of the first 64 primes (2..311).\n */ // prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n    0x428a2f98,\n    0x71374491,\n    0xb5c0fbcf,\n    0xe9b5dba5,\n    0x3956c25b,\n    0x59f111f1,\n    0x923f82a4,\n    0xab1c5ed5,\n    0xd807aa98,\n    0x12835b01,\n    0x243185be,\n    0x550c7dc3,\n    0x72be5d74,\n    0x80deb1fe,\n    0x9bdc06a7,\n    0xc19bf174,\n    0xe49b69c1,\n    0xefbe4786,\n    0x0fc19dc6,\n    0x240ca1cc,\n    0x2de92c6f,\n    0x4a7484aa,\n    0x5cb0a9dc,\n    0x76f988da,\n    0x983e5152,\n    0xa831c66d,\n    0xb00327c8,\n    0xbf597fc7,\n    0xc6e00bf3,\n    0xd5a79147,\n    0x06ca6351,\n    0x14292967,\n    0x27b70a85,\n    0x2e1b2138,\n    0x4d2c6dfc,\n    0x53380d13,\n    0x650a7354,\n    0x766a0abb,\n    0x81c2c92e,\n    0x92722c85,\n    0xa2bfe8a1,\n    0xa81a664b,\n    0xc24b8b70,\n    0xc76c51a3,\n    0xd192e819,\n    0xd6990624,\n    0xf40e3585,\n    0x106aa070,\n    0x19a4c116,\n    0x1e376c08,\n    0x2748774c,\n    0x34b0bcb5,\n    0x391c0cb3,\n    0x4ed8aa4a,\n    0x5b9cca4f,\n    0x682e6ff3,\n    0x748f82ee,\n    0x78a5636f,\n    0x84c87814,\n    0x8cc70208,\n    0x90befffa,\n    0xa4506ceb,\n    0xbef9a3f7,\n    0xc67178f2\n]);\n/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */ const SHA256_W = /* @__PURE__ */ new Uint32Array(64);\n/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */ class SHA2_32B extends HashMD {\n    get() {\n        const { A, B, C, D, E, F, G, H } = this;\n        return [\n            A,\n            B,\n            C,\n            D,\n            E,\n            F,\n            G,\n            H\n        ];\n    }\n    // prettier-ignore\n    set(A, B, C, D, E, F, G, H) {\n        this.A = A | 0;\n        this.B = B | 0;\n        this.C = C | 0;\n        this.D = D | 0;\n        this.E = E | 0;\n        this.F = F | 0;\n        this.G = G | 0;\n        this.H = H | 0;\n    }\n    process(view, offset) {\n        // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n        for(let i = 0; i \u003c 16; i++, offset += 4)SHA256_W[i] = view.getUint32(offset, false);\n        for(let i = 16; i \u003c 64; i++){\n            const W15 = SHA256_W[i - 15];\n            const W2 = SHA256_W[i - 2];\n            const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 \u003e\u003e\u003e 3;\n            const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 \u003e\u003e\u003e 10;\n            SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;\n        }\n        // Compression function main loop, 64 rounds\n        let { A, B, C, D, E, F, G, H } = this;\n        for(let i = 0; i \u003c 64; i++){\n            const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n            const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;\n            const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n            const T2 = sigma0 + Maj(A, B, C) | 0;\n            H = G;\n            G = F;\n            F = E;\n            E = D + T1 | 0;\n            D = C;\n            C = B;\n            B = A;\n            A = T1 + T2 | 0;\n        }\n        // Add the compressed chunk to the current hash value\n        A = A + this.A | 0;\n        B = B + this.B | 0;\n        C = C + this.C | 0;\n        D = D + this.D | 0;\n        E = E + this.E | 0;\n        F = F + this.F | 0;\n        G = G + this.G | 0;\n        H = H + this.H | 0;\n        this.set(A, B, C, D, E, F, G, H);\n    }\n    roundClean() {\n        clean(SHA256_W);\n    }\n    destroy() {\n        // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n        // update()/digest() callable on reused instances.\n        this.destroyed = true;\n        this.set(0, 0, 0, 0, 0, 0, 0, 0);\n        clean(this.buffer);\n    }\n    constructor(outputLen){\n        super(64, outputLen, 8, false);\n    }\n}\n/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */ class _SHA256 extends SHA2_32B {\n    constructor(){\n        super(32), // We cannot use array here since array allows indexing by variable\n        // which means optimizer/compiler cannot use registers.\n        this.A = SHA256_IV[0] | 0, this.B = SHA256_IV[1] | 0, this.C = SHA256_IV[2] | 0, this.D = SHA256_IV[3] | 0, this.E = SHA256_IV[4] | 0, this.F = SHA256_IV[5] | 0, this.G = SHA256_IV[6] | 0, this.H = SHA256_IV[7] | 0;\n    }\n}\n/** Internal SHA-224 hash class grounded in RFC 6234 §6.2 and §8.5. */ class _SHA224 extends SHA2_32B {\n    constructor(){\n        super(28), this.A = SHA224_IV[0] | 0, this.B = SHA224_IV[1] | 0, this.C = SHA224_IV[2] | 0, this.D = SHA224_IV[3] | 0, this.E = SHA224_IV[4] | 0, this.F = SHA224_IV[5] | 0, this.G = SHA224_IV[6] | 0, this.H = SHA224_IV[7] | 0;\n    }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// SHA-384 / SHA-512 round constants from RFC 6234 §5.2:\n// 80 full 64-bit words split into high/low halves.\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (()=\u003esplit([\n        '0x428a2f98d728ae22',\n        '0x7137449123ef65cd',\n        '0xb5c0fbcfec4d3b2f',\n        '0xe9b5dba58189dbbc',\n        '0x3956c25bf348b538',\n        '0x59f111f1b605d019',\n        '0x923f82a4af194f9b',\n        '0xab1c5ed5da6d8118',\n        '0xd807aa98a3030242',\n        '0x12835b0145706fbe',\n        '0x243185be4ee4b28c',\n        '0x550c7dc3d5ffb4e2',\n        '0x72be5d74f27b896f',\n        '0x80deb1fe3b1696b1',\n        '0x9bdc06a725c71235',\n        '0xc19bf174cf692694',\n        '0xe49b69c19ef14ad2',\n        '0xefbe4786384f25e3',\n        '0x0fc19dc68b8cd5b5',\n        '0x240ca1cc77ac9c65',\n        '0x2de92c6f592b0275',\n        '0x4a7484aa6ea6e483',\n        '0x5cb0a9dcbd41fbd4',\n        '0x76f988da831153b5',\n        '0x983e5152ee66dfab',\n        '0xa831c66d2db43210',\n        '0xb00327c898fb213f',\n        '0xbf597fc7beef0ee4',\n        '0xc6e00bf33da88fc2',\n        '0xd5a79147930aa725',\n        '0x06ca6351e003826f',\n        '0x142929670a0e6e70',\n        '0x27b70a8546d22ffc',\n        '0x2e1b21385c26c926',\n        '0x4d2c6dfc5ac42aed',\n        '0x53380d139d95b3df',\n        '0x650a73548baf63de',\n        '0x766a0abb3c77b2a8',\n        '0x81c2c92e47edaee6',\n        '0x92722c851482353b',\n        '0xa2bfe8a14cf10364',\n        '0xa81a664bbc423001',\n        '0xc24b8b70d0f89791',\n        '0xc76c51a30654be30',\n        '0xd192e819d6ef5218',\n        '0xd69906245565a910',\n        '0xf40e35855771202a',\n        '0x106aa07032bbd1b8',\n        '0x19a4c116b8d2d0c8',\n        '0x1e376c085141ab53',\n        '0x2748774cdf8eeb99',\n        '0x34b0bcb5e19b48a8',\n        '0x391c0cb3c5c95a63',\n        '0x4ed8aa4ae3418acb',\n        '0x5b9cca4f7763e373',\n        '0x682e6ff3d6b2b8a3',\n        '0x748f82ee5defb2fc',\n        '0x78a5636f43172f60',\n        '0x84c87814a1f0ab72',\n        '0x8cc702081a6439ec',\n        '0x90befffa23631e28',\n        '0xa4506cebde82bde9',\n        '0xbef9a3f7b2c67915',\n        '0xc67178f2e372532b',\n        '0xca273eceea26619c',\n        '0xd186b8c721c0c207',\n        '0xeada7dd6cde0eb1e',\n        '0xf57d4f7fee6ed178',\n        '0x06f067aa72176fba',\n        '0x0a637dc5a2c898a6',\n        '0x113f9804bef90dae',\n        '0x1b710b35131c471b',\n        '0x28db77f523047d84',\n        '0x32caab7b40c72493',\n        '0x3c9ebe0a15c9bebc',\n        '0x431d67c49c100d4c',\n        '0x4cc5d4becb3e42b6',\n        '0x597f299cfc657e2a',\n        '0x5fcb6fab3ad6faec',\n        '0x6c44198c4a475817'\n    ].map((n)=\u003eBigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (()=\u003eK512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (()=\u003eK512[1])();\n// Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\n// Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */ class SHA2_64B extends HashMD {\n    // prettier-ignore\n    get() {\n        const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n        return [\n            Ah,\n            Al,\n            Bh,\n            Bl,\n            Ch,\n            Cl,\n            Dh,\n            Dl,\n            Eh,\n            El,\n            Fh,\n            Fl,\n            Gh,\n            Gl,\n            Hh,\n            Hl\n        ];\n    }\n    // prettier-ignore\n    set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n        this.Ah = Ah | 0;\n        this.Al = Al | 0;\n        this.Bh = Bh | 0;\n        this.Bl = Bl | 0;\n        this.Ch = Ch | 0;\n        this.Cl = Cl | 0;\n        this.Dh = Dh | 0;\n        this.Dl = Dl | 0;\n        this.Eh = Eh | 0;\n        this.El = El | 0;\n        this.Fh = Fh | 0;\n        this.Fl = Fl | 0;\n        this.Gh = Gh | 0;\n        this.Gl = Gl | 0;\n        this.Hh = Hh | 0;\n        this.Hl = Hl | 0;\n    }\n    process(view, offset) {\n        // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n        for(let i = 0; i \u003c 16; i++, offset += 4){\n            SHA512_W_H[i] = view.getUint32(offset);\n            SHA512_W_L[i] = view.getUint32(offset += 4);\n        }\n        for(let i = 16; i \u003c 80; i++){\n            // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n            const W15h = SHA512_W_H[i - 15] | 0;\n            const W15l = SHA512_W_L[i - 15] | 0;\n            const s0h = rotrSH(W15h, W15l, 1) ^ rotrSH(W15h, W15l, 8) ^ shrSH(W15h, W15l, 7);\n            const s0l = rotrSL(W15h, W15l, 1) ^ rotrSL(W15h, W15l, 8) ^ shrSL(W15h, W15l, 7);\n            // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n            const W2h = SHA512_W_H[i - 2] | 0;\n            const W2l = SHA512_W_L[i - 2] | 0;\n            const s1h = rotrSH(W2h, W2l, 19) ^ rotrBH(W2h, W2l, 61) ^ shrSH(W2h, W2l, 6);\n            const s1l = rotrSL(W2h, W2l, 19) ^ rotrBL(W2h, W2l, 61) ^ shrSL(W2h, W2l, 6);\n            // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16];\n            const SUMl = add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n            const SUMh = add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n            SHA512_W_H[i] = SUMh | 0;\n            SHA512_W_L[i] = SUMl | 0;\n        }\n        let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n        // Compression function main loop, 80 rounds\n        for(let i = 0; i \u003c 80; i++){\n            // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n            const sigma1h = rotrSH(Eh, El, 14) ^ rotrSH(Eh, El, 18) ^ rotrBH(Eh, El, 41);\n            const sigma1l = rotrSL(Eh, El, 14) ^ rotrSL(Eh, El, 18) ^ rotrBL(Eh, El, 41);\n            //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n            const CHIh = Eh \u0026 Fh ^ ~Eh \u0026 Gh;\n            const CHIl = El \u0026 Fl ^ ~El \u0026 Gl;\n            // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n            // prettier-ignore\n            const T1ll = add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n            const T1h = add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n            const T1l = T1ll | 0;\n            // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n            const sigma0h = rotrSH(Ah, Al, 28) ^ rotrBH(Ah, Al, 34) ^ rotrBH(Ah, Al, 39);\n            const sigma0l = rotrSL(Ah, Al, 28) ^ rotrBL(Ah, Al, 34) ^ rotrBL(Ah, Al, 39);\n            const MAJh = Ah \u0026 Bh ^ Ah \u0026 Ch ^ Bh \u0026 Ch;\n            const MAJl = Al \u0026 Bl ^ Al \u0026 Cl ^ Bl \u0026 Cl;\n            Hh = Gh | 0;\n            Hl = Gl | 0;\n            Gh = Fh | 0;\n            Gl = Fl | 0;\n            Fh = Eh | 0;\n            Fl = El | 0;\n            ({ h: Eh, l: El } = add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n            Dh = Ch | 0;\n            Dl = Cl | 0;\n            Ch = Bh | 0;\n            Cl = Bl | 0;\n            Bh = Ah | 0;\n            Bl = Al | 0;\n            const All = add3L(T1l, sigma0l, MAJl);\n            Ah = add3H(All, T1h, sigma0h, MAJh);\n            Al = All | 0;\n        }\n        // Add the compressed chunk to the current hash value\n        ({ h: Ah, l: Al } = add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n        ({ h: Bh, l: Bl } = add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n        ({ h: Ch, l: Cl } = add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n        ({ h: Dh, l: Dl } = add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n        ({ h: Eh, l: El } = add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n        ({ h: Fh, l: Fl } = add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n        ({ h: Gh, l: Gl } = add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n        ({ h: Hh, l: Hl } = add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n        this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n    }\n    roundClean() {\n        clean(SHA512_W_H, SHA512_W_L);\n    }\n    destroy() {\n        // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n        // update()/digest() callable on reused instances.\n        this.destroyed = true;\n        clean(this.buffer);\n        this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n    }\n    constructor(outputLen){\n        super(128, outputLen, 16, false);\n    }\n}\n/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */ class _SHA512 extends SHA2_64B {\n    constructor(){\n        super(64), this.Ah = SHA512_IV[0] | 0, this.Al = SHA512_IV[1] | 0, this.Bh = SHA512_IV[2] | 0, this.Bl = SHA512_IV[3] | 0, this.Ch = SHA512_IV[4] | 0, this.Cl = SHA512_IV[5] | 0, this.Dh = SHA512_IV[6] | 0, this.Dl = SHA512_IV[7] | 0, this.Eh = SHA512_IV[8] | 0, this.El = SHA512_IV[9] | 0, this.Fh = SHA512_IV[10] | 0, this.Fl = SHA512_IV[11] | 0, this.Gh = SHA512_IV[12] | 0, this.Gl = SHA512_IV[13] | 0, this.Hh = SHA512_IV[14] | 0, this.Hl = SHA512_IV[15] | 0;\n    }\n}\n/** Internal SHA-384 hash class grounded in RFC 6234 §6.3 and §6.4. */ class _SHA384 extends SHA2_64B {\n    constructor(){\n        super(48), this.Ah = SHA384_IV[0] | 0, this.Al = SHA384_IV[1] | 0, this.Bh = SHA384_IV[2] | 0, this.Bl = SHA384_IV[3] | 0, this.Ch = SHA384_IV[4] | 0, this.Cl = SHA384_IV[5] | 0, this.Dh = SHA384_IV[6] | 0, this.Dl = SHA384_IV[7] | 0, this.Eh = SHA384_IV[8] | 0, this.El = SHA384_IV[9] | 0, this.Fh = SHA384_IV[10] | 0, this.Fl = SHA384_IV[11] | 0, this.Gh = SHA384_IV[12] | 0, this.Gl = SHA384_IV[13] | 0, this.Hh = SHA384_IV[14] | 0, this.Hl = SHA384_IV[15] | 0;\n    }\n}\n/**\n * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:\n *\n * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.\n * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n * - Each sha256 hash is executing 2^18 bit operations.\n * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.\n * @param msg - message bytes to hash\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-256.\n * ```ts\n * sha256(new Uint8Array([97, 98, 99]));\n * ```\n */ const sha256 = /* @__PURE__ */ createHasher(()=\u003enew _SHA256(), /* @__PURE__ */ oidNist(0x01));\n/**\n * SHA2-224 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-224.\n * ```ts\n * sha224(new Uint8Array([97, 98, 99]));\n * ```\n */ const sha224 = /* @__PURE__ */ createHasher(()=\u003enew _SHA224(), /* @__PURE__ */ oidNist(0x04));\n/**\n * SHA2-512 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512.\n * ```ts\n * sha512(new Uint8Array([97, 98, 99]));\n * ```\n */ const sha512 = /* @__PURE__ */ createHasher(()=\u003enew _SHA512(), /* @__PURE__ */ oidNist(0x03));\n/**\n * SHA2-384 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-384.\n * ```ts\n * sha384(new Uint8Array([97, 98, 99]));\n * ```\n */ const sha384 = /* @__PURE__ */ createHasher(()=\u003enew _SHA384(), /* @__PURE__ */ oidNist(0x02));\n\n// No __PURE__ annotations in sha3 header:\n// EVERYTHING is in fact used on every export.\n// Various per round constants calculations\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\n// FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors\n// taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`.\nconst _0x71n = BigInt(0x71);\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = []; // no pure annotation: var is always used\nfor(let round = 0, R = _1n, x = 1, y = 0; round \u003c 24; round++){\n    // Pi\n    [x, y] = [\n        y,\n        (2 * x + 3 * y) % 5\n    ];\n    SHA3_PI.push(2 * (5 * y + x));\n    // Rotational\n    SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);\n    // Iota\n    let t = _0n;\n    for(let j = 0; j \u003c 7; j++){\n        R = (R \u003c\u003c _1n ^ (R \u003e\u003e _7n) * _0x71n) % _256n;\n        if (R \u0026 _2n) t ^= _1n \u003c\u003c (_1n \u003c\u003c BigInt(j)) - _1n;\n    }\n    _SHA3_IOTA.push(t);\n}\nconst IOTAS = split(_SHA3_IOTA, true);\n// `split(..., true)` keeps the local little-endian lane-word layout used by\n// `state32`, so these `H` / `L` tables follow the file's first-word /\n// second-word lane slots rather than `_u64.ts`'s usual high/low naming.\nconst SHA3_IOTA_H = IOTAS[0];\nconst SHA3_IOTA_L = IOTAS[1];\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s)=\u003es \u003e 32 ? rotlBH(h, l, s) : rotlSH(h, l, s);\nconst rotlL = (h, l, s)=\u003es \u003e 32 ? rotlBL(h, l, s) : rotlSL(h, l, s);\n/**\n * `keccakf1600` internal permutation, additionally allows adjusting the round count.\n * @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words\n *   in this file's local little-endian lane-word order\n * @param rounds - number of rounds to execute\n * @throws If `rounds` is outside the supported `1..24` range. {@link Error}\n * @example\n * Permute a Keccak state with the default 24 rounds.\n * ```ts\n * keccakP(new Uint32Array(50));\n * ```\n */ function keccakP(s, rounds = 24) {\n    anumber(rounds, 'rounds');\n    // This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table.\n    if (rounds \u003c 1 || rounds \u003e 24) throw new Error('\"rounds\" expected integer 1..24');\n    const B = new Uint32Array(5 * 2);\n    // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n    for(let round = 24 - rounds; round \u003c 24; round++){\n        // Theta θ\n        for(let x = 0; x \u003c 10; x++)B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n        for(let x = 0; x \u003c 10; x += 2){\n            const idx1 = (x + 8) % 10;\n            const idx0 = (x + 2) % 10;\n            const B0 = B[idx0];\n            const B1 = B[idx0 + 1];\n            const Th = rotlH(B0, B1, 1) ^ B[idx1];\n            const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n            for(let y = 0; y \u003c 50; y += 10){\n                s[x + y] ^= Th;\n                s[x + y + 1] ^= Tl;\n            }\n        }\n        // Rho (ρ) and Pi (π)\n        let curH = s[2];\n        let curL = s[3];\n        for(let t = 0; t \u003c 24; t++){\n            const shift = SHA3_ROTL[t];\n            const Th = rotlH(curH, curL, shift);\n            const Tl = rotlL(curH, curL, shift);\n            const PI = SHA3_PI[t];\n            curH = s[PI];\n            curL = s[PI + 1];\n            s[PI] = Th;\n            s[PI + 1] = Tl;\n        }\n        // Chi (χ)\n        // Same as:\n        // for (let x = 0; x \u003c 10; x++) B[x] = s[y + x];\n        // for (let x = 0; x \u003c 10; x++) s[y + x] ^= ~B[(x + 2) % 10] \u0026 B[(x + 4) % 10];\n        for(let y = 0; y \u003c 50; y += 10){\n            const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3];\n            s[y] ^= ~s[y + 2] \u0026 s[y + 4];\n            s[y + 1] ^= ~s[y + 3] \u0026 s[y + 5];\n            s[y + 2] ^= ~s[y + 4] \u0026 s[y + 6];\n            s[y + 3] ^= ~s[y + 5] \u0026 s[y + 7];\n            s[y + 4] ^= ~s[y + 6] \u0026 s[y + 8];\n            s[y + 5] ^= ~s[y + 7] \u0026 s[y + 9];\n            s[y + 6] ^= ~s[y + 8] \u0026 b0;\n            s[y + 7] ^= ~s[y + 9] \u0026 b1;\n            s[y + 8] ^= ~b0 \u0026 b2;\n            s[y + 9] ^= ~b1 \u0026 b3;\n        }\n        // Iota (ι)\n        s[0] ^= SHA3_IOTA_H[round];\n        s[1] ^= SHA3_IOTA_L[round];\n    }\n    clean(B);\n}\n/**\n * Keccak sponge function.\n * @param blockLen - absorb/squeeze rate in bytes\n * @param suffix - domain separation suffix byte\n * @param outputLen - default digest length in bytes. This base sponge only\n *   requires a non-negative integer; wrappers that need positive output\n *   lengths must enforce that themselves.\n * @param enableXOF - whether XOF output is allowed\n * @param rounds - number of Keccak-f rounds\n * @example\n * Build a sponge state, absorb bytes, then finalize a digest.\n * ```ts\n * const hash = new Keccak(136, 0x06, 32);\n * hash.update(new Uint8Array([1, 2, 3]));\n * hash.digest();\n * ```\n */ class Keccak {\n    clone() {\n        return this._cloneInto();\n    }\n    keccak() {\n        swap32IfBE(this.state32);\n        keccakP(this.state32, this.rounds);\n        swap32IfBE(this.state32);\n        this.posOut = 0;\n        this.pos = 0;\n    }\n    update(data) {\n        aexists(this);\n        abytes(data);\n        const { blockLen, state } = this;\n        const len = data.length;\n        for(let pos = 0; pos \u003c len;){\n            const take = Math.min(blockLen - this.pos, len - pos);\n            for(let i = 0; i \u003c take; i++)state[this.pos++] ^= data[pos++];\n            if (this.pos === blockLen) this.keccak();\n        }\n        return this;\n    }\n    finish() {\n        if (this.finished) return;\n        this.finished = true;\n        const { state, suffix, pos, blockLen } = this;\n        // FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1.\n        // These byte values already include the first padding bit, while the\n        // final `0x80` below supplies the closing `1` bit in the last rate byte.\n        state[pos] ^= suffix;\n        // If that combined suffix lands in the last rate byte and already sets\n        // bit 7, absorb it first so the final pad10*1 bit can be xored into a\n        // fresh block.\n        if ((suffix \u0026 0x80) !== 0 \u0026\u0026 pos === blockLen - 1) this.keccak();\n        state[blockLen - 1] ^= 0x80;\n        this.keccak();\n    }\n    writeInto(out) {\n        aexists(this, false);\n        abytes(out);\n        this.finish();\n        const bufferOut = this.state;\n        const { blockLen } = this;\n        for(let pos = 0, len = out.length; pos \u003c len;){\n            if (this.posOut \u003e= blockLen) this.keccak();\n            const take = Math.min(blockLen - this.posOut, len - pos);\n            out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n            this.posOut += take;\n            pos += take;\n        }\n        return out;\n    }\n    xofInto(out) {\n        // Plain SHA3/Keccak usage with XOF is probably a mistake, but this base\n        // class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/\n        // TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF.\n        if (!this.enableXOF) throw new Error('XOF is not possible for this instance');\n        return this.writeInto(out);\n    }\n    xof(bytes) {\n        anumber(bytes);\n        return this.xofInto(new Uint8Array(bytes));\n    }\n    digestInto(out) {\n        aoutput(out, this);\n        if (this.finished) throw new Error('digest() was already called');\n        // `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest.\n        this.writeInto(out.subarray(0, this.outputLen));\n        this.destroy();\n    }\n    digest() {\n        const out = new Uint8Array(this.outputLen);\n        this.digestInto(out);\n        return out;\n    }\n    destroy() {\n        this.destroyed = true;\n        clean(this.state);\n    }\n    _cloneInto(to) {\n        const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n        to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n        // Reused destinations can come from a different rate/capacity variant, so clone must rewrite\n        // the sponge geometry as well as the state words.\n        to.blockLen = blockLen;\n        to.state32.set(this.state32);\n        to.pos = this.pos;\n        to.posOut = this.posOut;\n        to.finished = this.finished;\n        to.rounds = rounds;\n        // Suffix can change in cSHAKE\n        to.suffix = suffix;\n        to.outputLen = outputLen;\n        to.enableXOF = enableXOF;\n        // Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone\n        // tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie.\n        to.canXOF = this.canXOF;\n        to.destroyed = this.destroyed;\n        return to;\n    }\n    // NOTE: we accept arguments in bytes instead of bits here.\n    constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24){\n        this.pos = 0;\n        this.posOut = 0;\n        this.finished = false;\n        this.destroyed = false;\n        this.enableXOF = false;\n        this.blockLen = blockLen;\n        this.suffix = suffix;\n        this.outputLen = outputLen;\n        this.enableXOF = enableXOF;\n        this.canXOF = enableXOF;\n        this.rounds = rounds;\n        // Can be passed from user as dkLen\n        anumber(outputLen, 'outputLen');\n        // 1600 = 5x5 matrix of 64bit.  1600 bits === 200 bytes\n        // 0 \u003c blockLen \u003c 200\n        if (!(0 \u003c blockLen \u0026\u0026 blockLen \u003c 200)) throw new Error('only keccak-f1600 function is supported');\n        this.state = new Uint8Array(200);\n        this.state32 = u32(this.state);\n    }\n}\nconst genKeccak = (suffix, blockLen, outputLen, info = {})=\u003ecreateHasher(()=\u003enew Keccak(blockLen, suffix, outputLen), info);\n/**\n * SHA3-224 hash function.\n * @param msg - message bytes to hash\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-224.\n * ```ts\n * sha3_224(new Uint8Array([97, 98, 99]));\n * ```\n */ const sha3_224 = /* @__PURE__ */ genKeccak(0x06, 144, 28, /* @__PURE__ */ oidNist(0x07));\n/**\n * SHA3-256 hash function. Different from keccak-256.\n * @param msg - message bytes to hash\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-256.\n * ```ts\n * sha3_256(new Uint8Array([97, 98, 99]));\n * ```\n */ const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, /* @__PURE__ */ oidNist(0x08));\n/**\n * SHA3-384 hash function.\n * @param msg - message bytes to hash\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-384.\n * ```ts\n * sha3_384(new Uint8Array([97, 98, 99]));\n * ```\n */ const sha3_384 = /* @__PURE__ */ genKeccak(0x06, 104, 48, /* @__PURE__ */ oidNist(0x09));\n/**\n * SHA3-512 hash function.\n * @param msg - message bytes to hash\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-512.\n * ```ts\n * sha3_512(new Uint8Array([97, 98, 99]));\n * ```\n */ const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, /* @__PURE__ */ oidNist(0x0a));\n\n/**\n * \"globalThis\" ponyfill.\n * @see [A horrifying globalThis polyfill in universal JavaScript](https://mathiasbynens.be/notes/globalthis)\n * @type {Object.\u003cstring, *\u003e}\n */ const globalScope = (()=\u003e{\n    if (typeof globalThis === \"object\") return globalThis;\n    else {\n        Object.defineProperty(Object.prototype, \"__GLOBALTHIS__\", {\n            get () {\n                return this;\n            },\n            configurable: true\n        });\n        try {\n            // @ts-expect-error\n            // eslint-disable-next-line no-undef\n            if (typeof __GLOBALTHIS__ !== \"undefined\") return __GLOBALTHIS__;\n        } finally{\n            // @ts-expect-error\n            delete Object.prototype.__GLOBALTHIS__;\n        }\n    }\n    // Still unable to determine \"globalThis\", fall back to a naive method.\n    if (typeof self !== \"undefined\") return self;\n    else if (typeof window !== \"undefined\") return window;\n    else if (typeof global !== \"undefined\") return global;\n    return undefined;\n})();\n\n/**\n * @noble/hashes hash functions.\n * @type {Object.\u003cstring, sha1|sha224|sha256|sha384|sha512|sha3_224|sha3_256|sha3_384|sha3_512\u003e}\n */ const nobleHashes = {\n    SHA1: sha1,\n    SHA224: sha224,\n    SHA256: sha256,\n    SHA384: sha384,\n    SHA512: sha512,\n    \"SHA3-224\": sha3_224,\n    \"SHA3-256\": sha3_256,\n    \"SHA3-384\": sha3_384,\n    \"SHA3-512\": sha3_512\n};\n/**\n * Canonicalizes a hash algorithm name.\n * @param {string} algorithm Hash algorithm name.\n * @returns {\"SHA1\"|\"SHA224\"|\"SHA256\"|\"SHA384\"|\"SHA512\"|\"SHA3-224\"|\"SHA3-256\"|\"SHA3-384\"|\"SHA3-512\"} Canonicalized hash algorithm name.\n */ const canonicalizeAlgorithm = (algorithm)=\u003e{\n    switch(true){\n        case /^(?:SHA-?1|SSL3-SHA1)$/i.test(algorithm):\n            return \"SHA1\";\n        case /^SHA(?:2?-)?224$/i.test(algorithm):\n            return \"SHA224\";\n        case /^SHA(?:2?-)?256$/i.test(algorithm):\n            return \"SHA256\";\n        case /^SHA(?:2?-)?384$/i.test(algorithm):\n            return \"SHA384\";\n        case /^SHA(?:2?-)?512$/i.test(algorithm):\n            return \"SHA512\";\n        case /^SHA3-224$/i.test(algorithm):\n            return \"SHA3-224\";\n        case /^SHA3-256$/i.test(algorithm):\n            return \"SHA3-256\";\n        case /^SHA3-384$/i.test(algorithm):\n            return \"SHA3-384\";\n        case /^SHA3-512$/i.test(algorithm):\n            return \"SHA3-512\";\n        default:\n            throw new TypeError(`Unknown hash algorithm: ${algorithm}`);\n    }\n};\n/**\n * Calculates an HMAC digest.\n * @param {string} algorithm Algorithm.\n * @param {Uint8Array} key Key.\n * @param {Uint8Array} message Message.\n * @returns {Uint8Array} Digest.\n */ const hmacDigest = (algorithm, key, message)=\u003e{\n    if (hmac) {\n        const hash = nobleHashes[algorithm] ?? nobleHashes[canonicalizeAlgorithm(algorithm)];\n        return hmac(hash, key, message);\n    } else {\n        throw new Error(\"Missing HMAC function\");\n    }\n};\n\n/**\n * RFC 4648 base32 alphabet without pad.\n * @type {string}\n */ const ALPHABET = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\";\n/**\n * Converts a base32 string to an Uint8Array (RFC 4648).\n * @see [LinusU/base32-decode](https://github.com/LinusU/base32-decode)\n * @param {string} str Base32 string.\n * @returns {Uint8Array} Uint8Array.\n */ const base32Decode = (str)=\u003e{\n    // Remove spaces (although they are not allowed by the spec, some issuers add them for readability).\n    str = str.replace(/ /g, \"\");\n    // Canonicalize to all upper case and remove padding if it exists.\n    let end = str.length;\n    while(str[end - 1] === \"=\")--end;\n    str = (end \u003c str.length ? str.substring(0, end) : str).toUpperCase();\n    const buf = new ArrayBuffer(str.length * 5 / 8 | 0);\n    const arr = new Uint8Array(buf);\n    let bits = 0;\n    let value = 0;\n    let index = 0;\n    for(let i = 0; i \u003c str.length; i++){\n        const idx = ALPHABET.indexOf(str[i]);\n        if (idx === -1) throw new TypeError(`Invalid character found: ${str[i]}`);\n        value = value \u003c\u003c 5 | idx;\n        bits += 5;\n        if (bits \u003e= 8) {\n            bits -= 8;\n            arr[index++] = value \u003e\u003e\u003e bits;\n        }\n    }\n    return arr;\n};\n/**\n * Converts an Uint8Array to a base32 string (RFC 4648).\n * @see [LinusU/base32-encode](https://github.com/LinusU/base32-encode)\n * @param {Uint8Array} arr Uint8Array.\n * @returns {string} Base32 string.\n */ const base32Encode = (arr)=\u003e{\n    let bits = 0;\n    let value = 0;\n    let str = \"\";\n    for(let i = 0; i \u003c arr.length; i++){\n        value = value \u003c\u003c 8 | arr[i];\n        bits += 8;\n        while(bits \u003e= 5){\n            str += ALPHABET[value \u003e\u003e\u003e bits - 5 \u0026 31];\n            bits -= 5;\n        }\n    }\n    if (bits \u003e 0) {\n        str += ALPHABET[value \u003c\u003c 5 - bits \u0026 31];\n    }\n    return str;\n};\n\n/**\n * Converts a hexadecimal string to an Uint8Array.\n * @param {string} str Hexadecimal string.\n * @returns {Uint8Array} Uint8Array.\n */ const hexDecode = (str)=\u003e{\n    // Remove spaces (although they are not allowed by the spec, some issuers add them for readability).\n    str = str.replace(/ /g, \"\");\n    const buf = new ArrayBuffer(str.length / 2);\n    const arr = new Uint8Array(buf);\n    for(let i = 0; i \u003c str.length; i += 2){\n        arr[i / 2] = parseInt(str.substring(i, i + 2), 16);\n    }\n    return arr;\n};\n/**\n * Converts an Uint8Array to a hexadecimal string.\n * @param {Uint8Array} arr Uint8Array.\n * @returns {string} Hexadecimal string.\n */ const hexEncode = (arr)=\u003e{\n    let str = \"\";\n    for(let i = 0; i \u003c arr.length; i++){\n        const hex = arr[i].toString(16);\n        if (hex.length === 1) str += \"0\";\n        str += hex;\n    }\n    return str.toUpperCase();\n};\n\n/**\n * Converts a Latin-1 string to an Uint8Array.\n * @param {string} str Latin-1 string.\n * @returns {Uint8Array} Uint8Array.\n */ const latin1Decode = (str)=\u003e{\n    const buf = new ArrayBuffer(str.length);\n    const arr = new Uint8Array(buf);\n    for(let i = 0; i \u003c str.length; i++){\n        arr[i] = str.charCodeAt(i) \u0026 0xff;\n    }\n    return arr;\n};\n/**\n * Converts an Uint8Array to a Latin-1 string.\n * @param {Uint8Array} arr Uint8Array.\n * @returns {string} Latin-1 string.\n */ const latin1Encode = (arr)=\u003e{\n    let str = \"\";\n    for(let i = 0; i \u003c arr.length; i++){\n        str += String.fromCharCode(arr[i]);\n    }\n    return str;\n};\n\n/**\n * TextEncoder instance.\n * @type {TextEncoder|null}\n */ const ENCODER = globalScope.TextEncoder ? new globalScope.TextEncoder() : null;\n/**\n * TextDecoder instance.\n * @type {TextDecoder|null}\n */ const DECODER = globalScope.TextDecoder ? new globalScope.TextDecoder() : null;\n/**\n * Converts an UTF-8 string to an Uint8Array.\n * @param {string} str String.\n * @returns {Uint8Array} Uint8Array.\n */ const utf8Decode = (str)=\u003e{\n    if (!ENCODER) {\n        throw new Error(\"Encoding API not available\");\n    }\n    return ENCODER.encode(str);\n};\n/**\n * Converts an Uint8Array to an UTF-8 string.\n * @param {Uint8Array} arr Uint8Array.\n * @returns {string} String.\n */ const utf8Encode = (arr)=\u003e{\n    if (!DECODER) {\n        throw new Error(\"Encoding API not available\");\n    }\n    return DECODER.decode(arr);\n};\n\n/**\n * Returns random bytes.\n * @param {number} size Size.\n * @returns {Uint8Array} Random bytes.\n */ const randomBytes = (size)=\u003e{\n    if (globalScope.crypto?.getRandomValues) {\n        return globalScope.crypto.getRandomValues(new Uint8Array(size));\n    } else {\n        throw new Error(\"Cryptography API not available\");\n    }\n};\n\n/**\n * OTP secret key.\n */ class Secret {\n    /**\n   * Converts a Latin-1 string to a Secret object.\n   * @param {string} str Latin-1 string.\n   * @returns {Secret} Secret object.\n   */ static fromLatin1(str) {\n        return new Secret({\n            buffer: latin1Decode(str).buffer\n        });\n    }\n    /**\n   * Converts an UTF-8 string to a Secret object.\n   * @param {string} str UTF-8 string.\n   * @returns {Secret} Secret object.\n   */ static fromUTF8(str) {\n        return new Secret({\n            buffer: utf8Decode(str).buffer\n        });\n    }\n    /**\n   * Converts a base32 string to a Secret object.\n   * @param {string} str Base32 string.\n   * @returns {Secret} Secret object.\n   */ static fromBase32(str) {\n        return new Secret({\n            buffer: base32Decode(str).buffer\n        });\n    }\n    /**\n   * Converts a hexadecimal string to a Secret object.\n   * @param {string} str Hexadecimal string.\n   * @returns {Secret} Secret object.\n   */ static fromHex(str) {\n        return new Secret({\n            buffer: hexDecode(str).buffer\n        });\n    }\n    /**\n   * Secret key buffer.\n   * @deprecated For backward compatibility, the \"bytes\" property should be used instead.\n   * @type {ArrayBufferLike}\n   */ get buffer() {\n        return this.bytes.buffer;\n    }\n    /**\n   * Latin-1 string representation of secret key.\n   * @type {string}\n   */ get latin1() {\n        Object.defineProperty(this, \"latin1\", {\n            enumerable: true,\n            writable: false,\n            configurable: false,\n            value: latin1Encode(this.bytes)\n        });\n        return this.latin1;\n    }\n    /**\n   * UTF-8 string representation of secret key.\n   * @type {string}\n   */ get utf8() {\n        Object.defineProperty(this, \"utf8\", {\n            enumerable: true,\n            writable: false,\n            configurable: false,\n            value: utf8Encode(this.bytes)\n        });\n        return this.utf8;\n    }\n    /**\n   * Base32 string representation of secret key.\n   * @type {string}\n   */ get base32() {\n        Object.defineProperty(this, \"base32\", {\n            enumerable: true,\n            writable: false,\n            configurable: false,\n            value: base32Encode(this.bytes)\n        });\n        return this.base32;\n    }\n    /**\n   * Hexadecimal string representation of secret key.\n   * @type {string}\n   */ get hex() {\n        Object.defineProperty(this, \"hex\", {\n            enumerable: true,\n            writable: false,\n            configurable: false,\n            value: hexEncode(this.bytes)\n        });\n        return this.hex;\n    }\n    /**\n   * Creates a secret key object.\n   * @param {Object} [config] Configuration options.\n   * @param {ArrayBufferLike} [config.buffer] Secret key buffer.\n   * @param {number} [config.size=20] Number of random bytes to generate, ignored if 'buffer' is provided.\n   */ constructor({ buffer, size = 20 } = {}){\n        /**\n     * Secret key.\n     * @type {Uint8Array}\n     * @readonly\n     */ this.bytes = typeof buffer === \"undefined\" ? randomBytes(size) : new Uint8Array(buffer);\n        // Prevent the \"bytes\" property from being modified.\n        Object.defineProperty(this, \"bytes\", {\n            enumerable: true,\n            writable: false,\n            configurable: false,\n            value: this.bytes\n        });\n    }\n}\n\n/**\n * Returns true if a is equal to b, without leaking timing information that would allow an attacker to guess one of the values.\n * @param {string} a String a.\n * @param {string} b String b.\n * @returns {boolean} Equality result.\n */ const timingSafeEqual = (a, b)=\u003e{\n    {\n        if (a.length !== b.length) {\n            throw new TypeError(\"Input strings must have the same length\");\n        }\n        let i = -1;\n        let out = 0;\n        while(++i \u003c a.length){\n            out |= a.charCodeAt(i) ^ b.charCodeAt(i);\n        }\n        return out === 0;\n    }\n};\n\n/**\n * HOTP: An HMAC-based One-time Password Algorithm.\n * @see [RFC 4226](https://datatracker.ietf.org/doc/html/rfc4226)\n */ class HOTP {\n    /**\n   * Default configuration.\n   * @type {{\n   *   issuer: string,\n   *   label: string,\n   *   issuerInLabel: boolean,\n   *   algorithm: string,\n   *   digits: number,\n   *   counter: number\n   *   window: number\n   * }}\n   */ static get defaults() {\n        return {\n            issuer: \"\",\n            label: \"OTPAuth\",\n            issuerInLabel: true,\n            algorithm: \"SHA1\",\n            digits: 6,\n            counter: 0,\n            window: 1\n        };\n    }\n    /**\n   * Generates an HOTP token.\n   * @param {Object} config Configuration options.\n   * @param {Secret} config.secret Secret key.\n   * @param {string} [config.algorithm='SHA1'] HMAC hashing algorithm.\n   * @param {number} [config.digits=6] Token length.\n   * @param {number} [config.counter=0] Counter value.\n   * @param {(algorithm: string, key: Uint8Array, message: Uint8Array) =\u003e Uint8Array} [config.hmac] Custom HMAC function.\n   * @returns {string} Token.\n   */ static generate({ secret, algorithm = HOTP.defaults.algorithm, digits = HOTP.defaults.digits, counter = HOTP.defaults.counter, hmac = hmacDigest }) {\n        const message = uintDecode(counter);\n        const digest = hmac(algorithm, secret.bytes, message);\n        if (!digest?.byteLength || digest.byteLength \u003c 19) {\n            throw new TypeError(\"Return value must be at least 19 bytes\");\n        }\n        const offset = digest[digest.byteLength - 1] \u0026 15;\n        const otp = ((digest[offset] \u0026 127) \u003c\u003c 24 | (digest[offset + 1] \u0026 255) \u003c\u003c 16 | (digest[offset + 2] \u0026 255) \u003c\u003c 8 | digest[offset + 3] \u0026 255) % 10 ** digits;\n        return otp.toString().padStart(digits, \"0\");\n    }\n    /**\n   * Generates an HOTP token.\n   * @param {Object} [config] Configuration options.\n   * @param {number} [config.counter=this.counter++] Counter value.\n   * @returns {string} Token.\n   */ generate({ counter = this.counter++ } = {}) {\n        return HOTP.generate({\n            secret: this.secret,\n            algorithm: this.algorithm,\n            digits: this.digits,\n            counter,\n            hmac: this.hmac\n        });\n    }\n    /**\n   * Validates an HOTP token.\n   * @param {Object} config Configuration options.\n   * @param {string} config.token Token value.\n   * @param {Secret} config.secret Secret key.\n   * @param {string} [config.algorithm='SHA1'] HMAC hashing algorithm.\n   * @param {number} [config.digits=6] Token length.\n   * @param {number} [config.counter=0] Counter value.\n   * @param {number} [config.window=1] Window of counter values to test.\n   * @param {(algorithm: string, key: Uint8Array, message: Uint8Array) =\u003e Uint8Array} [config.hmac] Custom HMAC function.\n   * @returns {number|null} Token delta or null if it is not found in the search window, in which case it should be considered invalid.\n   */ static validate({ token, secret, algorithm, digits = HOTP.defaults.digits, counter = HOTP.defaults.counter, window = HOTP.defaults.window, hmac = hmacDigest }) {\n        // Return early if the token length does not match the digit number.\n        if (token.length !== digits) return null;\n        let delta = null;\n        const check = (/** @type {number} */ i)=\u003e{\n            const generatedToken = HOTP.generate({\n                secret,\n                algorithm,\n                digits,\n                counter: i,\n                hmac\n            });\n            if (timingSafeEqual(token, generatedToken)) {\n                delta = i - counter;\n            }\n        };\n        check(counter);\n        for(let i = 1; i \u003c= window \u0026\u0026 delta === null; ++i){\n            check(counter - i);\n            if (delta !== null) break;\n            check(counter + i);\n            if (delta !== null) break;\n        }\n        return delta;\n    }\n    /**\n   * Validates an HOTP token.\n   * @param {Object} config Configuration options.\n   * @param {string} config.token Token value.\n   * @param {number} [config.counter=this.counter] Counter value.\n   * @param {number} [config.window=1] Window of counter values to test.\n   * @returns {number|null} Token delta or null if it is not found in the search window, in which case it should be considered invalid.\n   */ validate({ token, counter = this.counter, window }) {\n        return HOTP.validate({\n            token,\n            secret: this.secret,\n            algorithm: this.algorithm,\n            digits: this.digits,\n            counter,\n            window,\n            hmac: this.hmac\n        });\n    }\n    /**\n   * Returns a Google Authenticator key URI.\n   * @returns {string} URI.\n   */ toString() {\n        const e = encodeURIComponent;\n        return \"otpauth://hotp/\" + `${this.issuer.length \u003e 0 ? this.issuerInLabel ? `${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}\u0026` : `${e(this.label)}?issuer=${e(this.issuer)}\u0026` : `${e(this.label)}?`}` + `secret=${e(this.secret.base32)}\u0026` + `algorithm=${e(this.algorithm)}\u0026` + `digits=${e(this.digits)}\u0026` + `counter=${e(this.counter)}`;\n    }\n    /**\n   * Creates an HOTP object.\n   * @param {Object} [config] Configuration options.\n   * @param {string} [config.issuer=''] Account provider.\n   * @param {string} [config.label='OTPAuth'] Account label.\n   * @param {boolean} [config.issuerInLabel=true] Include issuer prefix in label.\n   * @param {Secret|string} [config.secret=Secret] Secret key.\n   * @param {string} [config.algorithm='SHA1'] HMAC hashing algorithm.\n   * @param {number} [config.digits=6] Token length.\n   * @param {number} [config.counter=0] Initial counter value.\n   * @param {(algorithm: string, key: Uint8Array, message: Uint8Array) =\u003e Uint8Array} [config.hmac] Custom HMAC function.\n   */ constructor({ issuer = HOTP.defaults.issuer, label = HOTP.defaults.label, issuerInLabel = HOTP.defaults.issuerInLabel, secret = new Secret(), algorithm = HOTP.defaults.algorithm, digits = HOTP.defaults.digits, counter = HOTP.defaults.counter, hmac } = {}){\n        /**\n     * Account provider.\n     * @type {string}\n     */ this.issuer = issuer;\n        /**\n     * Account label.\n     * @type {string}\n     */ this.label = label;\n        /**\n     * Include issuer prefix in label.\n     * @type {boolean}\n     */ this.issuerInLabel = issuerInLabel;\n        /**\n     * Secret key.\n     * @type {Secret}\n     */ this.secret = typeof secret === \"string\" ? Secret.fromBase32(secret) : secret;\n        /**\n     * HMAC hashing algorithm.\n     * @type {string}\n     */ this.algorithm = hmac ? algorithm : canonicalizeAlgorithm(algorithm);\n        /**\n     * Token length.\n     * @type {number}\n     */ this.digits = digits;\n        /**\n     * Initial counter value.\n     * @type {number}\n     */ this.counter = counter;\n        /**\n     * Custom HMAC function.\n     * @type {((algorithm: string, key: Uint8Array, message: Uint8Array) =\u003e Uint8Array)|undefined}\n     */ this.hmac = hmac;\n    }\n}\n\n/**\n * TOTP: Time-Based One-Time Password Algorithm.\n * @see [RFC 6238](https://datatracker.ietf.org/doc/html/rfc6238)\n */ class TOTP {\n    /**\n   * Default configuration.\n   * @type {{\n   *   issuer: string,\n   *   label: string,\n   *   issuerInLabel: boolean,\n   *   algorithm: string,\n   *   digits: number,\n   *   period: number\n   *   window: number\n   * }}\n   */ static get defaults() {\n        return {\n            issuer: \"\",\n            label: \"OTPAuth\",\n            issuerInLabel: true,\n            algorithm: \"SHA1\",\n            digits: 6,\n            period: 30,\n            window: 1\n        };\n    }\n    /**\n   * Calculates the counter. i.e. the number of periods since timestamp 0.\n   * @param {Object} [config] Configuration options.\n   * @param {number} [config.period=30] Token time-step duration.\n   * @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.\n   * @returns {number} Counter.\n   */ static counter({ period = TOTP.defaults.period, timestamp = Date.now() } = {}) {\n        return Math.floor(timestamp / 1000 / period);\n    }\n    /**\n   * Calculates the counter. i.e. the number of periods since timestamp 0.\n   * @param {Object} [config] Configuration options.\n   * @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.\n   * @returns {number} Counter.\n   */ counter({ timestamp = Date.now() } = {}) {\n        return TOTP.counter({\n            period: this.period,\n            timestamp\n        });\n    }\n    /**\n   * Calculates the remaining time in milliseconds until the next token is generated.\n   * @param {Object} [config] Configuration options.\n   * @param {number} [config.period=30] Token time-step duration.\n   * @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.\n   * @returns {number} counter.\n   */ static remaining({ period = TOTP.defaults.period, timestamp = Date.now() } = {}) {\n        return period * 1000 - timestamp % (period * 1000);\n    }\n    /**\n   * Calculates the remaining time in milliseconds until the next token is generated.\n   * @param {Object} [config] Configuration options.\n   * @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.\n   * @returns {number} counter.\n   */ remaining({ timestamp = Date.now() } = {}) {\n        return TOTP.remaining({\n            period: this.period,\n            timestamp\n        });\n    }\n    /**\n   * Generates a TOTP token.\n   * @param {Object} config Configuration options.\n   * @param {Secret} config.secret Secret key.\n   * @param {string} [config.algorithm='SHA1'] HMAC hashing algorithm.\n   * @param {number} [config.digits=6] Token length.\n   * @param {number} [config.period=30] Token time-step duration.\n   * @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.\n   * @param {(algorithm: string, key: Uint8Array, message: Uint8Array) =\u003e Uint8Array} [config.hmac] Custom HMAC function.\n   * @returns {string} Token.\n   */ static generate({ secret, algorithm, digits, period = TOTP.defaults.period, timestamp = Date.now(), hmac }) {\n        return HOTP.generate({\n            secret,\n            algorithm,\n            digits,\n            counter: TOTP.counter({\n                period,\n                timestamp\n            }),\n            hmac\n        });\n    }\n    /**\n   * Generates a TOTP token.\n   * @param {Object} [config] Configuration options.\n   * @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.\n   * @returns {string} Token.\n   */ generate({ timestamp = Date.now() } = {}) {\n        return TOTP.generate({\n            secret: this.secret,\n            algorithm: this.algorithm,\n            digits: this.digits,\n            period: this.period,\n            timestamp,\n            hmac: this.hmac\n        });\n    }\n    /**\n   * Validates a TOTP token.\n   * @param {Object} config Configuration options.\n   * @param {string} config.token Token value.\n   * @param {Secret} config.secret Secret key.\n   * @param {string} [config.algorithm='SHA1'] HMAC hashing algorithm.\n   * @param {number} [config.digits=6] Token length.\n   * @param {number} [config.period=30] Token time-step duration.\n   * @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.\n   * @param {number} [config.window=1] Window of counter values to test.\n   * @param {(algorithm: string, key: Uint8Array, message: Uint8Array) =\u003e Uint8Array} [config.hmac] Custom HMAC function.\n   * @returns {number|null} Token delta or null if it is not found in the search window, in which case it should be considered invalid.\n   */ static validate({ token, secret, algorithm, digits, period = TOTP.defaults.period, timestamp = Date.now(), window, hmac }) {\n        return HOTP.validate({\n            token,\n            secret,\n            algorithm,\n            digits,\n            counter: TOTP.counter({\n                period,\n                timestamp\n            }),\n            window,\n            hmac\n        });\n    }\n    /**\n   * Validates a TOTP token.\n   * @param {Object} config Configuration options.\n   * @param {string} config.token Token value.\n   * @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.\n   * @param {number} [config.window=1] Window of counter values to test.\n   * @returns {number|null} Token delta or null if it is not found in the search window, in which case it should be considered invalid.\n   */ validate({ token, timestamp, window }) {\n        return TOTP.validate({\n            token,\n            secret: this.secret,\n            algorithm: this.algorithm,\n            digits: this.digits,\n            period: this.period,\n            timestamp,\n            window,\n            hmac: this.hmac\n        });\n    }\n    /**\n   * Returns a Google Authenticator key URI.\n   * @returns {string} URI.\n   */ toString() {\n        const e = encodeURIComponent;\n        return \"otpauth://totp/\" + `${this.issuer.length \u003e 0 ? this.issuerInLabel ? `${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}\u0026` : `${e(this.label)}?issuer=${e(this.issuer)}\u0026` : `${e(this.label)}?`}` + `secret=${e(this.secret.base32)}\u0026` + `algorithm=${e(this.algorithm)}\u0026` + `digits=${e(this.digits)}\u0026` + `period=${e(this.period)}`;\n    }\n    /**\n   * Creates a TOTP object.\n   * @param {Object} [config] Configuration options.\n   * @param {string} [config.issuer=''] Account provider.\n   * @param {string} [config.label='OTPAuth'] Account label.\n   * @param {boolean} [config.issuerInLabel=true] Include issuer prefix in label.\n   * @param {Secret|string} [config.secret=Secret] Secret key.\n   * @param {string} [config.algorithm='SHA1'] HMAC hashing algorithm.\n   * @param {number} [config.digits=6] Token length.\n   * @param {number} [config.period=30] Token time-step duration.\n   * @param {(algorithm: string, key: Uint8Array, message: Uint8Array) =\u003e Uint8Array} [config.hmac] Custom HMAC function.\n   */ constructor({ issuer = TOTP.defaults.issuer, label = TOTP.defaults.label, issuerInLabel = TOTP.defaults.issuerInLabel, secret = new Secret(), algorithm = TOTP.defaults.algorithm, digits = TOTP.defaults.digits, period = TOTP.defaults.period, hmac } = {}){\n        /**\n     * Account provider.\n     * @type {string}\n     */ this.issuer = issuer;\n        /**\n     * Account label.\n     * @type {string}\n     */ this.label = label;\n        /**\n     * Include issuer prefix in label.\n     * @type {boolean}\n     */ this.issuerInLabel = issuerInLabel;\n        /**\n     * Secret key.\n     * @type {Secret}\n     */ this.secret = typeof secret === \"string\" ? Secret.fromBase32(secret) : secret;\n        /**\n     * HMAC hashing algorithm.\n     * @type {string}\n     */ this.algorithm = hmac ? algorithm : canonicalizeAlgorithm(algorithm);\n        /**\n     * Token length.\n     * @type {number}\n     */ this.digits = digits;\n        /**\n     * Token time-step duration.\n     * @type {number}\n     */ this.period = period;\n        /**\n     * Custom HMAC function.\n     * @type {((algorithm: string, key: Uint8Array, message: Uint8Array) =\u003e Uint8Array)|undefined}\n     */ this.hmac = hmac;\n    }\n}\n\n/**\n * Key URI regex (otpauth://TYPE/[ISSUER:]LABEL?PARAMETERS).\n * @type {RegExp}\n */ const OTPURI_REGEX = /^otpauth:\\/\\/([ht]otp)\\/(.+)\\?([A-Z0-9.~_-]+=[^?\u0026]*(?:\u0026[A-Z0-9.~_-]+=[^?\u0026]*)*)$/i;\n/**\n * RFC 4648 base32 alphabet with pad.\n * @type {RegExp}\n */ const SECRET_REGEX = /^[2-7A-Z]+=*$/i;\n/**\n * Regex for supported algorithms in built-in HMAC function.\n * @type {RegExp}\n */ const ALGORITHM_REGEX = /^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i;\n/**\n * Regex for custom algorithms in user-defined HMAC function.\n * @type {RegExp}\n */ const ALGORITHM_CUSTOM_REGEX = /^[A-Z0-9]+(?:[_-][A-Z0-9]+)*$/i;\n/**\n * Integer regex.\n * @type {RegExp}\n */ const INTEGER_REGEX = /^[+-]?\\d+$/;\n/**\n * Positive integer regex.\n * @type {RegExp}\n */ const POSITIVE_INTEGER_REGEX = /^\\+?[1-9]\\d*$/;\n/**\n * HOTP/TOTP object/string conversion.\n * @see [Key URI Format](https://github.com/google/google-authenticator/wiki/Key-Uri-Format)\n */ class URI {\n    /**\n   * Parses a Google Authenticator key URI and returns an HOTP/TOTP object.\n   * @param {string} uri Google Authenticator Key URI.\n   * @param {Object} [config] Configuration options.\n   * @param {(algorithm: string, key: Uint8Array, message: Uint8Array) =\u003e Uint8Array} [config.hmac] Custom HMAC function.\n   * @returns {HOTP|TOTP} HOTP/TOTP object.\n   */ static parse(uri, { hmac } = {}) {\n        let uriGroups;\n        try {\n            uriGroups = uri.match(OTPURI_REGEX);\n        // eslint-disable-next-line no-unused-vars\n        } catch (_) {\n        /* Handled below */ }\n        if (!Array.isArray(uriGroups)) {\n            throw new URIError(\"Invalid URI format\");\n        }\n        // Extract URI groups.\n        const uriType = uriGroups[1].toLowerCase();\n        const uriLabel = uriGroups[2].split(/(?::|%3A) *(.+)/i, 2).map(decodeURIComponent);\n        /** @type {Object.\u003cstring, string\u003e} */ const uriParams = uriGroups[3].split(\"\u0026\").reduce((acc, cur)=\u003e{\n            const pairArr = cur.split(/=(.*)/, 2).map(decodeURIComponent);\n            const pairKey = pairArr[0].toLowerCase();\n            const pairVal = pairArr[1];\n            /** @type {Object.\u003cstring, string\u003e} */ const pairAcc = acc;\n            pairAcc[pairKey] = pairVal;\n            return pairAcc;\n        }, {});\n        // 'OTP' will be instantiated with 'config' argument.\n        let OTP;\n        const config = {};\n        if (uriType === \"hotp\") {\n            OTP = HOTP;\n            // Counter: required\n            if (typeof uriParams.counter !== \"undefined\" \u0026\u0026 INTEGER_REGEX.test(uriParams.counter)) {\n                config.counter = parseInt(uriParams.counter, 10);\n            } else {\n                throw new TypeError(\"Missing or invalid 'counter' parameter\");\n            }\n        } else if (uriType === \"totp\") {\n            OTP = TOTP;\n            // Period: optional\n            if (typeof uriParams.period !== \"undefined\") {\n                if (POSITIVE_INTEGER_REGEX.test(uriParams.period)) {\n                    config.period = parseInt(uriParams.period, 10);\n                } else {\n                    throw new TypeError(\"Invalid 'period' parameter\");\n                }\n            }\n        } else {\n            throw new TypeError(\"Unknown OTP type\");\n        }\n        // Label: required\n        // Issuer: optional\n        if (typeof uriParams.issuer !== \"undefined\") {\n            config.issuer = uriParams.issuer;\n        }\n        if (uriLabel.length === 2) {\n            config.label = uriLabel[1];\n            if (typeof config.issuer === \"undefined\" || config.issuer === \"\") {\n                config.issuer = uriLabel[0];\n            } else if (uriLabel[0] === \"\") {\n                config.issuerInLabel = false;\n            }\n        } else {\n            config.label = uriLabel[0];\n            if (typeof config.issuer !== \"undefined\" \u0026\u0026 config.issuer !== \"\") {\n                config.issuerInLabel = false;\n            }\n        }\n        // Secret: required\n        if (typeof uriParams.secret !== \"undefined\" \u0026\u0026 SECRET_REGEX.test(uriParams.secret)) {\n            config.secret = uriParams.secret;\n        } else {\n            throw new TypeError(\"Missing or invalid 'secret' parameter\");\n        }\n        // Algorithm: optional\n        if (typeof uriParams.algorithm !== \"undefined\") {\n            if ((hmac ? ALGORITHM_CUSTOM_REGEX : ALGORITHM_REGEX).test(uriParams.algorithm)) {\n                config.algorithm = uriParams.algorithm;\n            } else {\n                throw new TypeError(\"Invalid 'algorithm' parameter\");\n            }\n        }\n        // Digits: optional\n        if (typeof uriParams.digits !== \"undefined\") {\n            if (POSITIVE_INTEGER_REGEX.test(uriParams.digits)) {\n                config.digits = parseInt(uriParams.digits, 10);\n            } else {\n                throw new TypeError(\"Invalid 'digits' parameter\");\n            }\n        }\n        // HMAC: optional\n        if (typeof hmac !== \"undefined\") {\n            config.hmac = hmac;\n        }\n        return new OTP(config);\n    }\n    /**\n   * Converts an HOTP/TOTP object to a Google Authenticator key URI.\n   * @param {HOTP|TOTP} otp HOTP/TOTP object.\n   * @returns {string} Google Authenticator Key URI.\n   */ static stringify(otp) {\n        if (otp instanceof HOTP || otp instanceof TOTP) {\n            return otp.toString();\n        }\n        throw new TypeError(\"Invalid 'HOTP/TOTP' object\");\n    }\n}\n\n/**\n * Library version.\n * @type {string}\n */ const version = \"9.5.1\";\n\nexport { HOTP, Secret, TOTP, URI, version };\n"],"version":3}
