@generaltranslation/react-core 1.8.18 → 1.8.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"internal.cjs.min.cjs","names":["u64.split","TYPE","TYPE$1","React","handleSingleChildElement","handleSingleChild","Children","React","getPluralForm","React","React","React","formatMessage$1"],"sources":["../src/dictionaries/indexDict.ts","../src/internal/flattenDictionary.ts","../../core/dist/base64-CWITCfhU.mjs","../../core/dist/isVariable-fAKEB7gF.mjs","../../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/utils.js","../../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/_md.js","../../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/_u64.js","../../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/sha2.js","../../format/dist/IntlCache-CTlCV-1u.mjs","../../format/dist/internal.mjs","../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/error.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/types.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/regex.generated.js","../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.16/node_modules/@formatjs/icu-skeleton-parser/date-time.js","../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.16/node_modules/@formatjs/icu-skeleton-parser/regex.generated.js","../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.16/node_modules/@formatjs/icu-skeleton-parser/number.js","../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.16/node_modules/@formatjs/icu-skeleton-parser/index.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/time-data.generated.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/date-time-pattern-generator.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/parser.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/manipulator.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/index.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/printer.js","../../core/dist/internal.mjs","../src/internal/addGTIdentifier.ts","../src/errors-dir/constants.ts","../src/errors-dir/createErrors.ts","../src/internal/removeInjectedT.ts","../src/variables/getVariableName.ts","../src/utils/utils.tsx","../../format/dist/types-DY1ZTHWr.mjs","../src/internal/writeChildrenAsObjects.ts","../src/branches/plurals/getPluralBranch.ts","../src/dictionaries/getDictionaryEntry.ts","../src/dictionaries/getEntryAndMetadata.ts","../src/variables/_getVariableProps.ts","../src/rendering/isVariableObject.ts","../src/rendering/getGTTag.ts","../src/rendering/renderDefaultChildren.tsx","../src/rendering/renderTranslatedChildren.tsx","../src/rendering/getDefaultRenderSettings.ts","../src/rendering/renderSkeleton.tsx","../src/utils/cookies.ts","../src/dictionaries/isDictionaryEntry.ts","../src/dictionaries/mergeDictionaries.ts","../src/promises/reactHasUse.ts","../src/dictionaries/getSubtree.ts","../src/dictionaries/injectEntry.ts","../src/dictionaries/stripMetadataFromEntries.ts","../../core/dist/id-DEaFhGqX.mjs","../src/dictionaries/injectHashes.ts","../src/dictionaries/injectTranslations.ts","../src/dictionaries/injectFallbacks.ts","../src/dictionaries/injectAndMerge.ts","../src/dictionaries/collectUntranslatedEntries.ts","../../i18n/dist/isEncodedTranslationOptions-BOwWa_-J.mjs","../../i18n/dist/versionId-B2xfz6jP.mjs","../../i18n/dist/mFallback-pqVm9wDk.mjs","../../i18n/dist/index.mjs","../src/variables/Derive.tsx"],"sourcesContent":["import { Dictionary, DictionaryEntry } from '../types-dir/types';\n/**\n * @description A function that gets a value from a dictionary, only one level\n * @param dictionary - dictionary to get the value from\n * @param id - id of the value to get\n */\nexport function get(dictionary: Dictionary, id: string | number) {\n if (dictionary == null) {\n throw new Error('Cannot index into an undefined dictionary');\n }\n if (Array.isArray(dictionary)) {\n return dictionary[id as number];\n }\n return dictionary[id as string];\n}\n\n/**\n * @description A function that sets a value in a dictionary\n * @param dictionary - dictionary to set the value in\n * @param id - id of the value to set\n * @param value - value to set\n */\nexport function set(\n dictionary: Dictionary,\n id: string | number,\n value: Dictionary | DictionaryEntry\n) {\n if (Array.isArray(dictionary)) {\n dictionary[id as number] = value;\n } else {\n (dictionary as Record<string, Dictionary | DictionaryEntry>)[id as string] =\n value;\n }\n}\n","import { get } from '../dictionaries/indexDict';\nimport {\n Dictionary,\n DictionaryEntry,\n FlattenedDictionary,\n} from '../types-dir/types';\n\nconst createDuplicateKeyError = (key: string) =>\n `Duplicate key found in dictionary: \"${key}\"`;\n\n/**\n * Flattens a nested dictionary by concatenating nested keys.\n * Throws an error if two keys result in the same flattened key.\n * @param {Record<string, any>} dictionary - The dictionary to flatten.\n * @param {string} [prefix=''] - The prefix for nested keys.\n * @returns {Record<string, React.ReactNode>} The flattened dictionary object.\n * @throws {Error} If two keys result in the same flattened key.\n */\nexport default function flattenDictionary(\n dictionary: Dictionary,\n prefix: string = ''\n): FlattenedDictionary {\n const flattened: FlattenedDictionary = {};\n for (const key in dictionary) {\n if (dictionary.hasOwnProperty(key)) {\n const newKey = prefix ? `${prefix}.${key}` : key;\n if (\n typeof get(dictionary, key) === 'object' &&\n get(dictionary, key) !== null &&\n !Array.isArray(get(dictionary, key))\n ) {\n const nestedFlattened = flattenDictionary(\n get(dictionary, key) as Dictionary,\n newKey\n );\n for (const flatKey in nestedFlattened) {\n if (flattened.hasOwnProperty(flatKey)) {\n throw new Error(createDuplicateKeyError(flatKey));\n }\n flattened[flatKey] = nestedFlattened[flatKey];\n }\n } else {\n if (flattened.hasOwnProperty(newKey)) {\n throw new Error(createDuplicateKeyError(newKey));\n }\n flattened[newKey] = get(dictionary, key) as DictionaryEntry;\n }\n }\n }\n return flattened;\n}\n","//#region src/settings/settings.ts\nconst libraryDefaultLocale = \"en\";\nconst defaultTimeout = 6e4;\n//#endregion\n//#region src/settings/settingsUrls.ts\nconst defaultCacheUrl = \"https://cdn.gtx.dev\";\nconst defaultBaseUrl = \"https://api2.gtx.dev\";\nconst defaultRuntimeApiUrl = \"https://runtime2.gtx.dev\";\n//#endregion\n//#region src/utils/isSupportedFileFormatTransform.ts\nconst SUPPORTED_TRANSFORMATIONS = {\n\tGTJSON: [\"GTJSON\"],\n\tJSON: [\"JSON\"],\n\tPO: [\"PO\"],\n\tPOT: [\"POT\", \"PO\"],\n\tYAML: [\"YAML\"],\n\tMDX: [\"MDX\"],\n\tMD: [\"MD\"],\n\tTS: [\"TS\"],\n\tJS: [\"JS\"],\n\tHTML: [\"HTML\"],\n\tTXT: [\"TXT\"],\n\tTWILIO_CONTENT_JSON: [\"TWILIO_CONTENT_JSON\"]\n};\n/**\n* This function checks if a file format transformation is supported during translation\n* @param from - The source file format.\n* @param to - The target file format.\n* @returns True if the transformation is supported, false otherwise\n*/\nfunction isSupportedFileFormatTransform(from, to) {\n\treturn SUPPORTED_TRANSFORMATIONS[from]?.includes(to) ?? false;\n}\n//#endregion\n//#region src/translate/utils/validateFileFormatTransform.ts\n/**\n* Returns a user-facing validation error when a requested file format transform\n* is missing source format context or is not currently supported.\n*/\nfunction getFileFormatTransformError(file) {\n\tif (!file.transformFormat) return void 0;\n\tconst fileLabel = file.fileName ?? file.fileId ?? \"unknown file\";\n\tif (!file.fileFormat) return `fileFormat is required when transformFormat is provided for ${fileLabel}`;\n\tif (!isSupportedFileFormatTransform(file.fileFormat, file.transformFormat)) return `Unsupported file format transform: ${file.fileFormat} -> ${file.transformFormat}`;\n}\n/**\n* Validates file format transforms before sending upload/enqueue requests.\n*/\nfunction validateFileFormatTransforms(files) {\n\tfor (const file of files) {\n\t\tconst error = getFileFormatTransformError(file);\n\t\tif (error) throw new Error(error);\n\t}\n}\n//#endregion\n//#region src/utils/base64.ts\nfunction encode(data) {\n\tif (typeof Buffer !== \"undefined\") return Buffer.from(data, \"utf8\").toString(\"base64\");\n\tconst bytes = new TextEncoder().encode(data);\n\tlet binary = \"\";\n\tfor (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);\n\treturn btoa(binary);\n}\nfunction decode(base64) {\n\tif (typeof Buffer !== \"undefined\") return Buffer.from(base64, \"base64\").toString(\"utf8\");\n\tconst binary = atob(base64);\n\tconst bytes = new Uint8Array(binary.length);\n\tfor (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);\n\treturn new TextDecoder().decode(bytes);\n}\n//#endregion\nexport { defaultBaseUrl as a, defaultTimeout as c, isSupportedFileFormatTransform as i, libraryDefaultLocale as l, encode as n, defaultCacheUrl as o, validateFileFormatTransforms as r, defaultRuntimeApiUrl as s, decode as t };\n\n//# sourceMappingURL=base64-CWITCfhU.mjs.map","//#region src/utils/stableStringify.ts\n/**\n* Deterministic JSON stringification with sorted object keys.\n* Drop-in replacement for `fast-json-stable-stringify` for plain\n* JSON-compatible data (no toJSON, no circular references).\n*/\nfunction _stringify(node) {\n\tif (node === void 0) return void 0;\n\tif (node === null) return \"null\";\n\tif (typeof node === \"number\") return isFinite(node) ? \"\" + node : \"null\";\n\tif (typeof node !== \"object\") return JSON.stringify(node);\n\tif (Array.isArray(node)) {\n\t\tlet out = \"[\";\n\t\tfor (let i = 0; i < node.length; i++) {\n\t\t\tif (i) out += \",\";\n\t\t\tout += _stringify(node[i]) || \"null\";\n\t\t}\n\t\treturn out + \"]\";\n\t}\n\tconst keys = Object.keys(node).sort();\n\tlet out = \"\";\n\tfor (const key of keys) {\n\t\tconst value = _stringify(node[key]);\n\t\tif (!value) continue;\n\t\tif (out) out += \",\";\n\t\tout += JSON.stringify(key) + \":\" + value;\n\t}\n\treturn \"{\" + out + \"}\";\n}\nfunction stableStringify(data) {\n\treturn _stringify(data) ?? \"\";\n}\n//#endregion\n//#region src/utils/isVariable.ts\nfunction isVariable(obj) {\n\tconst variableObj = obj;\n\tif (variableObj && typeof variableObj === \"object\" && typeof variableObj.k === \"string\") {\n\t\tconst k = Object.keys(variableObj);\n\t\tif (k.length === 1) return true;\n\t\tif (k.length === 2) {\n\t\t\tif (typeof variableObj.i === \"number\") return true;\n\t\t\tif (typeof variableObj.v === \"string\") return true;\n\t\t}\n\t\tif (k.length === 3) {\n\t\t\tif (typeof variableObj.v === \"string\" && typeof variableObj.i === \"number\") return true;\n\t\t}\n\t}\n\treturn false;\n}\n//#endregion\nexport { stableStringify as n, isVariable as t };\n\n//# sourceMappingURL=isVariable-fAKEB7gF.mjs.map","/**\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 */\nexport 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 ||\n (ArrayBuffer.isView(a) &&\n a.constructor.name === 'Uint8Array' &&\n 'BYTES_PER_ELEMENT' in a &&\n 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 */\nexport function anumber(n, title = '') {\n if (typeof n !== 'number') {\n const prefix = title && `\"${title}\" `;\n throw new TypeError(`${prefix}expected number, got ${typeof n}`);\n }\n if (!Number.isSafeInteger(n) || n < 0) {\n const prefix = title && `\"${title}\" `;\n throw new RangeError(`${prefix}expected integer >= 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 */\nexport function abytes(value, length, title = '') {\n const bytes = isBytes(value);\n const len = value?.length;\n const needsLen = length !== undefined;\n if (!bytes || (needsLen && len !== length)) {\n const prefix = title && `\"${title}\" `;\n const ofLen = needsLen ? ` of length ${length}` : '';\n const got = bytes ? `length=${len}` : `type=${typeof value}`;\n const message = prefix + 'expected Uint8Array' + ofLen + ', got ' + got;\n if (!bytes)\n throw new TypeError(message);\n throw new RangeError(message);\n }\n return value;\n}\n/**\n * Copies bytes into a fresh Uint8Array.\n * Buffer-style slices can alias the same backing store, so callers that need ownership should copy.\n * @param bytes - source bytes to clone\n * @returns Freshly allocated copy of `bytes`.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Clone a byte array before mutating it.\n * ```ts\n * const copy = copyBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function copyBytes(bytes) {\n // `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict\n // because callers use it at byte-validation boundaries before mutating the detached copy.\n return Uint8Array.from(abytes(bytes));\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 */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n 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 < 1)\n throw new Error('\"outputLen\" must be >= 1');\n if (h.blockLen < 1)\n throw new Error('\"blockLen\" must be >= 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 */\nexport function aexists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n 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 */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'digestInto() output');\n const min = instance.outputLen;\n if (out.length < min) {\n throw new RangeError('\"digestInto() output\" expected to be of length >=' + min);\n }\n}\n/**\n * Casts a typed array view to Uint8Array.\n * @param arr - source typed array\n * @returns Uint8Array view over the same buffer.\n * @example\n * Reinterpret a typed array as bytes.\n * ```ts\n * u8(new Uint32Array([1, 2]));\n * ```\n */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\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 */\nexport 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 */\nexport function clean(...arrays) {\n for (let i = 0; i < 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 */\nexport 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 */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> 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 */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Whether the current platform is little-endian. */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).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 */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/**\n * Conditionally byte-swaps one 32-bit word on big-endian platforms.\n * @param n - source word\n * @returns Original or byte-swapped word depending on platform endianness.\n * @example\n * Normalize a 32-bit word for host endianness.\n * ```ts\n * swap8IfBE(0x11223344);\n * ```\n */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n) >>> 0;\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 */\nexport function byteSwap32(arr) {\n for (let i = 0; i < 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 */\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string.\n * Uses the built-in function when available and assumes it matches the tested\n * fallback semantics.\n * @param bytes - bytes to encode\n * @returns Lowercase hexadecimal string.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Convert bytes to lowercase hexadecimal.\n * ```ts\n * bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'\n * ```\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };\nfunction asciiToBase16(ch) {\n if (ch >= asciis._0 && ch <= asciis._9)\n return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F)\n return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f)\n return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @param hex - hexadecimal string to decode\n * @returns Decoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Decode lowercase hexadecimal into bytes.\n * ```ts\n * hexToBytes('cafe0123'); // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n * ```\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new TypeError('hex string expected, got ' + typeof hex);\n if (hasHexBuiltin) {\n try {\n return Uint8Array.fromHex(hex);\n }\n catch (error) {\n if (error instanceof SyntaxError)\n throw new RangeError(error.message);\n throw error;\n }\n }\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new RangeError('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new RangeError('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * This yields to the Promise/microtask scheduler queue, not to timers or the\n * full macrotask event loop.\n * @example\n * Yield to the next scheduler tick.\n * ```ts\n * await nextTick();\n * ```\n */\nexport const nextTick = async () => { };\n/**\n * Returns control to the Promise/microtask scheduler every `tick`\n * milliseconds to avoid blocking long loops.\n * @param iters - number of loop iterations to run\n * @param tick - maximum time slice in milliseconds\n * @param cb - callback executed on each iteration\n * @example\n * Run a loop that periodically yields back to the event loop.\n * ```ts\n * await asyncLoop(2, 0, () => {});\n * ```\n */\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * Non-ASCII details are delegated to the platform `TextEncoder`.\n * @param str - string to encode\n * @returns UTF-8 encoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Encode a string as UTF-8 bytes.\n * ```ts\n * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99])\n * ```\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new TypeError('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Helper for KDFs: consumes Uint8Array or string.\n * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.\n * @param data - user-provided KDF input\n * @param errorTitle - label included in thrown errors\n * @returns Byte representation of the input.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Normalize KDF input to bytes.\n * ```ts\n * kdfInputToBytes('password');\n * ```\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/**\n * Copies several Uint8Arrays into one.\n * @param arrays - arrays to concatenate\n * @returns Concatenated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Concatenate multiple byte arrays.\n * ```ts\n * concatBytes(new Uint8Array([1]), new Uint8Array([2]));\n * ```\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/**\n * Merges default options and passed options.\n * @param defaults - base option object\n * @param opts - user overrides\n * @returns Merged option object. The merge mutates `defaults` in place.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Merge user overrides onto default options.\n * ```ts\n * checkOpts({ dkLen: 32 }, { asyncTick: 10 });\n * ```\n */\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new TypeError('options must be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\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 */\nexport function createHasher(hashCons, info = {}) {\n const hashC = (msg, opts) => hashCons(opts)\n .update(msg)\n .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) => hashCons(opts);\n Object.assign(hashC, info);\n return Object.freeze(hashC);\n}\n/**\n * Cryptographically secure PRNG backed by `crypto.getRandomValues`.\n * @param bytesLength - number of random bytes to generate\n * @returns Random bytes.\n * The platform `getRandomValues()` implementation still defines any\n * single-call length cap, and this helper rejects oversize requests\n * with a stable library `RangeError` instead of host-specific errors.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If the current runtime does not provide `crypto.getRandomValues`. {@link Error}\n * @example\n * Generate a fresh random key or nonce.\n * ```ts\n * const key = randomBytes(16);\n * ```\n */\nexport function randomBytes(bytesLength = 32) {\n // Match the repo's other length-taking helpers instead of relying on Uint8Array coercion.\n anumber(bytesLength, 'bytesLength');\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n // Web Cryptography API Level 2 §10.1.1:\n // if `byteLength > 65536`, throw `QuotaExceededError`.\n // Keep the guard explicit so callers can see the quota in code\n // instead of discovering it by reading the spec or host errors.\n // This wrapper surfaces the same quota as a stable library RangeError.\n if (bytesLength > 65536)\n throw new RangeError(`\"bytesLength\" expected <= 65536, got ${bytesLength}`);\n return cr.getRandomValues(new Uint8Array(bytesLength));\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 */\nexport const oidNist = (suffix) => ({\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([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]),\n});\n//# sourceMappingURL=utils.js.map","/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { abytes, aexists, aoutput, clean, createView, } from \"./utils.js\";\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 */\nexport function Chi(a, b, c) {\n return (a & b) ^ (~a & 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 */\nexport function Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & 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 */\nexport class HashMD {\n blockLen;\n outputLen;\n canXOF = false;\n padOffset;\n isLE;\n // For partial updates less than block size\n buffer;\n view;\n finished = false;\n length = 0;\n pos = 0;\n destroyed = false;\n constructor(blockLen, outputLen, padOffset, isLE) {\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 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 < 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 <= len - pos; pos += blockLen)\n 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 > 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 < blockLen; i++)\n 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)\n throw new Error('_sha2: outputLen must be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length)\n throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++)\n 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 ||= 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)\n to.buffer.set(buffer);\n return to;\n }\n clone() {\n return this._cloneInto();\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 */\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. */\nexport const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 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. */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 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. */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 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. */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n//# sourceMappingURL=_md.js.map","const 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)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\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 < len; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\n// Combine explicit `(high, low)` 32-bit halves into a bigint; `>>> 0` normalizes signed JS\n// bitwise results back to uint32 first, and little-endian callers must swap.\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`.\nconst shrSH = (h, _l, s) => h >>> s;\n// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`.\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> 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) => (h << (64 - s)) | (l >>> (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) => (h >>> (s - 32)) | (l << (64 - s));\n// High 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped low half.\nconst rotr32H = (_h, l) => l;\n// Low 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped high half.\nconst rotr32L = (h, _l) => h;\n// High 32-bit half of a 64-bit left rotate, valid for `s` in `1..31`.\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\n// Low 32-bit half of a 64-bit left rotate, valid for `s` in `1..31`.\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (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) => (l << (s - 32)) | (h >>> (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) => (h << (s - 32)) | (l >>> (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 >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\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) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\n// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`.\nconst add3H = (low, Ah, Bh, Ch) => (Ah + 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) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 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) => (Ah + 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) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 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) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig };\n// Canonical grouped namespace for callers that prefer one object.\n// Named exports stay for direct imports.\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\n// Default export mirrors named `u64` for compatibility with object-style imports.\nexport default u64;\n//# sourceMappingURL=_u64.js.map","/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}.\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, oidNist, rotr } from \"./utils.js\";\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 */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\n/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */\nclass SHA2_32B extends HashMD {\n constructor(outputLen) {\n super(64, outputLen, 8, false);\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\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 < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 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 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 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 < 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}\n/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */\nexport class _SHA256 extends SHA2_32B {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n A = SHA256_IV[0] | 0;\n B = SHA256_IV[1] | 0;\n C = SHA256_IV[2] | 0;\n D = SHA256_IV[3] | 0;\n E = SHA256_IV[4] | 0;\n F = SHA256_IV[5] | 0;\n G = SHA256_IV[6] | 0;\n H = SHA256_IV[7] | 0;\n constructor() {\n super(32);\n }\n}\n/** Internal SHA-224 hash class grounded in RFC 6234 §6.2 and §8.5. */\nexport class _SHA224 extends SHA2_32B {\n A = SHA224_IV[0] | 0;\n B = SHA224_IV[1] | 0;\n C = SHA224_IV[2] | 0;\n D = SHA224_IV[3] | 0;\n E = SHA224_IV[4] | 0;\n F = SHA224_IV[5] | 0;\n G = SHA224_IV[6] | 0;\n H = SHA224_IV[7] | 0;\n constructor() {\n super(28);\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__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[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. */\nclass SHA2_64B extends HashMD {\n constructor(outputLen) {\n super(128, outputLen, 16, false);\n }\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 [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\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 < 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 < 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 = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.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 = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.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 < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.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 = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & 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 } = u64.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 = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.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 } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.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}\n/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA512 extends SHA2_64B {\n Ah = SHA512_IV[0] | 0;\n Al = SHA512_IV[1] | 0;\n Bh = SHA512_IV[2] | 0;\n Bl = SHA512_IV[3] | 0;\n Ch = SHA512_IV[4] | 0;\n Cl = SHA512_IV[5] | 0;\n Dh = SHA512_IV[6] | 0;\n Dl = SHA512_IV[7] | 0;\n Eh = SHA512_IV[8] | 0;\n El = SHA512_IV[9] | 0;\n Fh = SHA512_IV[10] | 0;\n Fl = SHA512_IV[11] | 0;\n Gh = SHA512_IV[12] | 0;\n Gl = SHA512_IV[13] | 0;\n Hh = SHA512_IV[14] | 0;\n Hl = SHA512_IV[15] | 0;\n constructor() {\n super(64);\n }\n}\n/** Internal SHA-384 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA384 extends SHA2_64B {\n Ah = SHA384_IV[0] | 0;\n Al = SHA384_IV[1] | 0;\n Bh = SHA384_IV[2] | 0;\n Bl = SHA384_IV[3] | 0;\n Ch = SHA384_IV[4] | 0;\n Cl = SHA384_IV[5] | 0;\n Dh = SHA384_IV[6] | 0;\n Dl = SHA384_IV[7] | 0;\n Eh = SHA384_IV[8] | 0;\n El = SHA384_IV[9] | 0;\n Fh = SHA384_IV[10] | 0;\n Fl = SHA384_IV[11] | 0;\n Gh = SHA384_IV[12] | 0;\n Gl = SHA384_IV[13] | 0;\n Hh = SHA384_IV[14] | 0;\n Hl = SHA384_IV[15] | 0;\n constructor() {\n super(48);\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See the repo-side derivation recipe in `test/misc/sha2-gen-iv.js`.\n * These IV literals are checked against that script rather than a dedicated\n * local RFC section.\n */\n/** SHA-512/224 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA-512/256 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n/** Internal SHA-512/224 hash class using the derived `T224_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_224 extends SHA2_64B {\n Ah = T224_IV[0] | 0;\n Al = T224_IV[1] | 0;\n Bh = T224_IV[2] | 0;\n Bl = T224_IV[3] | 0;\n Ch = T224_IV[4] | 0;\n Cl = T224_IV[5] | 0;\n Dh = T224_IV[6] | 0;\n Dl = T224_IV[7] | 0;\n Eh = T224_IV[8] | 0;\n El = T224_IV[9] | 0;\n Fh = T224_IV[10] | 0;\n Fl = T224_IV[11] | 0;\n Gh = T224_IV[12] | 0;\n Gl = T224_IV[13] | 0;\n Hh = T224_IV[14] | 0;\n Hl = T224_IV[15] | 0;\n constructor() {\n super(28);\n }\n}\n/** Internal SHA-512/256 hash class using the derived `T256_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_256 extends SHA2_64B {\n Ah = T256_IV[0] | 0;\n Al = T256_IV[1] | 0;\n Bh = T256_IV[2] | 0;\n Bl = T256_IV[3] | 0;\n Ch = T256_IV[4] | 0;\n Cl = T256_IV[5] | 0;\n Dh = T256_IV[6] | 0;\n Dl = T256_IV[7] | 0;\n Eh = T256_IV[8] | 0;\n El = T256_IV[9] | 0;\n Fh = T256_IV[10] | 0;\n Fl = T256_IV[11] | 0;\n Gh = T256_IV[12] | 0;\n Gl = T256_IV[13] | 0;\n Hh = T256_IV[14] | 0;\n Hl = T256_IV[15] | 0;\n constructor() {\n super(32);\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 */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), \n/* @__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 */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new _SHA224(), \n/* @__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 */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new _SHA512(), \n/* @__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 */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new _SHA384(), \n/* @__PURE__ */ oidNist(0x02));\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/256.\n * ```ts\n * sha512_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new _SHA512_256(), \n/* @__PURE__ */ oidNist(0x06));\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/224.\n * ```ts\n * sha512_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new _SHA512_224(), \n/* @__PURE__ */ oidNist(0x05));\n//# sourceMappingURL=sha2.js.map","//#region src/errors/formattingErrors.ts\nconst createInvalidCutoffStyleError = (style) => `generaltranslation Formatting Error: Invalid cutoff style: ${style}.`;\nconst DEFAULT_TERMINATOR_KEY = \"DEFAULT_TERMINATOR_KEY\";\nconst TERMINATOR_MAP = {\n\tellipsis: {\n\t\tfr: {\n\t\t\tterminator: \"…\",\n\t\t\tseparator: \" \"\n\t\t},\n\t\tzh: {\n\t\t\tterminator: \"……\",\n\t\t\tseparator: void 0\n\t\t},\n\t\tja: {\n\t\t\tterminator: \"……\",\n\t\t\tseparator: void 0\n\t\t},\n\t\t[DEFAULT_TERMINATOR_KEY]: {\n\t\t\tterminator: \"…\",\n\t\t\tseparator: void 0\n\t\t}\n\t},\n\tnone: { [DEFAULT_TERMINATOR_KEY]: {\n\t\tterminator: void 0,\n\t\tseparator: void 0\n\t} }\n};\n//#endregion\n//#region src/formatting/custom-formats/CutoffFormat/CutoffFormat.ts\nvar CutoffFormatConstructor = class {\n\t/**\n\t* Constructor\n\t* @param {Intl.LocalesArgument} locales - The locales to use for formatting.\n\t* @param {CutoffFormatOptions} options - The options for formatting.\n\t* @param {number} [options.maxChars] - The maximum number of characters to display.\n\t* - Undefined values are treated as no cutoff.\n\t* - Negative values follow .slice() behavior and terminator will be added before the value.\n\t* - 0 will result in an empty string.\n\t* - If cutoff results in an empty string, no terminator is added.\n\t* @param {CutoffFormatStyle} [options.style='ellipsis'] - The style of the terminator.\n\t* @param {string} [options.terminator] - Optional override the terminator to use.\n\t* @param {string} [options.separator] - Optional override the separator to use between the terminator and the value.\n\t* - If no terminator is provided, then separator is ignored.\n\t*\n\t* @example\n\t* const format = new CutoffFormat('en', { maxChars: 5 });\n\t* format.format('Hello, world!'); // 'Hello...'\n\t*\n\t* const format = new CutoffFormat('en', { maxChars: -3 });\n\t* format.format('Hello, world!'); // '...ld!'\n\t*/\n\tconstructor(locales, options = {}) {\n\t\ttry {\n\t\t\tconst localesList = !locales ? [\"en\"] : Array.isArray(locales) ? locales.map((l) => String(l)) : [String(locales)];\n\t\t\tconst canonicalLocales = Intl.getCanonicalLocales(localesList);\n\t\t\tthis.locale = canonicalLocales.length ? canonicalLocales[0] : \"en\";\n\t\t} catch {\n\t\t\tthis.locale = \"en\";\n\t\t}\n\t\tif (!TERMINATOR_MAP[options.style ?? \"ellipsis\"]) throw new Error(createInvalidCutoffStyleError(options.style ?? \"ellipsis\"));\n\t\tlet style;\n\t\tlet presetTerminatorOptions;\n\t\tif (options.maxChars !== void 0) {\n\t\t\tstyle = options.style ?? \"ellipsis\";\n\t\t\tconst languageCode = new Intl.Locale(this.locale).language;\n\t\t\tpresetTerminatorOptions = TERMINATOR_MAP[style][languageCode] || TERMINATOR_MAP[style][\"DEFAULT_TERMINATOR_KEY\"];\n\t\t}\n\t\tlet terminator = options.terminator ?? presetTerminatorOptions?.terminator;\n\t\tlet separator = terminator != null ? options.separator ?? presetTerminatorOptions?.separator : void 0;\n\t\tthis.additionLength = (terminator?.length ?? 0) + (separator?.length ?? 0);\n\t\tif (options.maxChars !== void 0 && Math.abs(options.maxChars) < this.additionLength) {\n\t\t\tterminator = void 0;\n\t\t\tseparator = void 0;\n\t\t}\n\t\tthis.options = {\n\t\t\tmaxChars: options.maxChars,\n\t\t\tstyle,\n\t\t\tterminator,\n\t\t\tseparator\n\t\t};\n\t}\n\t/**\n\t* Format a value according to the cutoff options, returning a formatted string.\n\t*\n\t* @param {string} value - The string value to format with cutoff behavior.\n\t* @returns {string} The formatted string with terminator applied if cutoff occurs.\n\t*\n\t* @example\n\t* const formatter = new CutoffFormatConstructor('en', { maxChars: 8, style: 'ellipsis' });\n\t* formatter.format('Hello, world!'); // Returns 'Hello, w...'\n\t*/\n\tformat(value) {\n\t\treturn this.formatToParts(value).join(\"\");\n\t}\n\t/**\n\t* Format a value to parts according to the cutoff options, returning an array of string parts.\n\t* This method breaks down the formatted result into individual components for more granular control.\n\t*\n\t* @param {string} value - The string value to format with cutoff behavior.\n\t* @returns {PrependedCutoffParts | PostpendedCutoffParts} An array of string parts representing the formatted result.\n\t* - For positive maxChars: [cutoffValue, separator?, terminator?]\n\t* - For negative maxChars: [terminator?, separator?, cutoffValue]\n\t* - For no cutoff: [originalValue]\n\t*\n\t* @example\n\t* const formatter = new CutoffFormatConstructor('en', { maxChars: 5, style: 'ellipsis' });\n\t* formatter.formatToParts('Hello, world!'); // Returns ['Hello', '...']\n\t*/\n\tformatToParts(value) {\n\t\tconst { maxChars, terminator, separator } = this.options;\n\t\tconst adjustedChars = maxChars === void 0 || Math.abs(maxChars) >= value.length ? maxChars : maxChars >= 0 ? Math.max(0, maxChars - this.additionLength) : Math.min(0, maxChars + this.additionLength);\n\t\tconst slicedValue = adjustedChars !== void 0 && adjustedChars > -1 ? value.slice(0, adjustedChars) : value.slice(adjustedChars);\n\t\tif (maxChars == null || adjustedChars == null || adjustedChars === 0 || terminator == null || value.length <= Math.abs(maxChars)) return [slicedValue];\n\t\tif (adjustedChars > 0) return separator != null ? [\n\t\t\tslicedValue,\n\t\t\tseparator,\n\t\t\tterminator\n\t\t] : [slicedValue, terminator];\n\t\telse return separator != null ? [\n\t\t\tterminator,\n\t\t\tseparator,\n\t\t\tslicedValue\n\t\t] : [terminator, slicedValue];\n\t}\n\t/**\n\t* Get the resolved options\n\t* @returns {ResolvedCutoffFormatOptions} The resolved options.\n\t*/\n\tresolvedOptions() {\n\t\treturn this.options;\n\t}\n};\n//#endregion\n//#region src/cache/IntlCache.ts\n/**\n* Object mapping constructor names to their respective constructor functions\n* Includes all native Intl constructors plus custom ones like CutoffFormat\n*/\nconst CustomIntl = {\n\tCollator: Intl.Collator,\n\tDateTimeFormat: Intl.DateTimeFormat,\n\tDisplayNames: Intl.DisplayNames,\n\tListFormat: Intl.ListFormat,\n\tLocale: Intl.Locale,\n\tNumberFormat: Intl.NumberFormat,\n\tPluralRules: Intl.PluralRules,\n\tRelativeTimeFormat: Intl.RelativeTimeFormat,\n\tSegmenter: Intl.Segmenter,\n\tCutoffFormat: CutoffFormatConstructor\n};\n/**\n* Cache for Intl and custom format instances to avoid repeated instantiation\n* Uses a two-level structure: constructor name -> cache key -> instance.\n*/\nvar IntlCache = class {\n\tconstructor() {\n\t\tthis.cache = {};\n\t}\n\t/**\n\t* Generates a consistent cache key from locales and options.\n\t* Handles all LocalesArgument types (string, Locale, array, undefined).\n\t*/\n\t_generateKey(locales, options = {}) {\n\t\treturn `${!locales ? \"undefined\" : Array.isArray(locales) ? locales.map((l) => String(l)).join(\",\") : String(locales)}:${options ? JSON.stringify(options, Object.keys(options).sort()) : \"{}\"}`;\n\t}\n\t/**\n\t* Gets a cached Intl instance or creates a new one if not found\n\t* @param constructor The name of the Intl constructor to use.\n\t* @param args Constructor arguments (locales, options).\n\t* @returns Cached or newly created Intl instance.\n\t*/\n\tget(constructor, ...args) {\n\t\tconst [locales = \"en\", options = {}] = args;\n\t\tconst key = this._generateKey(locales, options);\n\t\tlet intlObject = this.cache[constructor]?.[key];\n\t\tif (intlObject === void 0) {\n\t\t\tintlObject = new CustomIntl[constructor](...args);\n\t\t\tif (!this.cache[constructor]) this.cache[constructor] = {};\n\t\t\tthis.cache[constructor][key] = intlObject;\n\t\t}\n\t\treturn intlObject;\n\t}\n};\n/**\n* Global instance of the Intl cache for use throughout the application\n*/\nconst intlCache = new IntlCache();\n//#endregion\nexport { intlCache as t };\n\n//# sourceMappingURL=IntlCache-CTlCV-1u.mjs.map","import { t as intlCache } from \"./IntlCache-CTlCV-1u.mjs\";\n//#region src/internal.ts\nfunction getCachedPluralRules(locales) {\n\treturn intlCache.get(\"PluralRules\", locales);\n}\n//#endregion\nexport { getCachedPluralRules };\n\n//# sourceMappingURL=internal.mjs.map","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ErrorKind = void 0;\nvar ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `<bold!>foo</bold!>) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo</123>`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (exports.ErrorKind = ErrorKind = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SKELETON_TYPE = exports.TYPE = void 0;\nexports.isLiteralElement = isLiteralElement;\nexports.isArgumentElement = isArgumentElement;\nexports.isNumberElement = isNumberElement;\nexports.isDateElement = isDateElement;\nexports.isTimeElement = isTimeElement;\nexports.isSelectElement = isSelectElement;\nexports.isPluralElement = isPluralElement;\nexports.isPoundElement = isPoundElement;\nexports.isTagElement = isTagElement;\nexports.isNumberSkeleton = isNumberSkeleton;\nexports.isDateTimeSkeleton = isDateTimeSkeleton;\nexports.createLiteralElement = createLiteralElement;\nexports.createNumberElement = createNumberElement;\nvar TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (exports.TYPE = TYPE = {}));\nvar SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (exports.SKELETON_TYPE = SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nfunction isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nfunction isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nfunction isNumberElement(el) {\n return el.type === TYPE.number;\n}\nfunction isDateElement(el) {\n return el.type === TYPE.date;\n}\nfunction isTimeElement(el) {\n return el.type === TYPE.time;\n}\nfunction isSelectElement(el) {\n return el.type === TYPE.select;\n}\nfunction isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nfunction isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nfunction isTagElement(el) {\n return el.type === TYPE.tag;\n}\nfunction isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nfunction isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nfunction createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nfunction createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WHITE_SPACE_REGEX = exports.SPACE_SEPARATOR_REGEX = void 0;\n// @generated from regex-gen.ts\nexports.SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexports.WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseDateTimeSkeleton = parseDateTimeSkeleton;\n/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nfunction parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: milliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WHITE_SPACE_REGEX = void 0;\n// @generated from regex-gen.ts\nexports.WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseNumberSkeletonFromString = parseNumberSkeletonFromString;\nexports.parseNumberSkeleton = parseNumberSkeleton;\nvar tslib_1 = require(\"tslib\");\nvar regex_generated_1 = require(\"./regex.generated\");\nfunction parseNumberSkeletonFromString(skeleton) {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty');\n }\n // Parse the skeleton\n var stringTokens = skeleton\n .split(regex_generated_1.WHITE_SPACE_REGEX)\n .filter(function (x) { return x.length > 0; });\n var tokens = [];\n for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {\n var stringToken = stringTokens_1[_i];\n var stemAndOptions = stringToken.split('/');\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n var stem = stemAndOptions[0], options = stemAndOptions.slice(1);\n for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {\n var option = options_1[_a];\n if (option.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n }\n tokens.push({ stem: stem, options: options });\n }\n return tokens;\n}\nfunction icuUnitToEcma(unit) {\n return unit.replace(/^(.*?)-/, '');\n}\nvar FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g;\nvar SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g;\nvar INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g;\nvar CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;\nfunction parseSignificantPrecision(str) {\n var result = {};\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision';\n }\n else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision';\n }\n str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits = g1.length;\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length;\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length;\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0);\n }\n return '';\n });\n return result;\n}\nfunction parseSign(str) {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n };\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n };\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n };\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n };\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n };\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n };\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n };\n }\n}\nfunction parseConciseScientificAndEngineeringStem(stem) {\n // Engineering\n var result;\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n };\n stem = stem.slice(2);\n }\n else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n };\n stem = stem.slice(1);\n }\n if (result) {\n var signDisplay = stem.slice(0, 2);\n if (signDisplay === '+!') {\n result.signDisplay = 'always';\n stem = stem.slice(2);\n }\n else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero';\n stem = stem.slice(2);\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation');\n }\n result.minimumIntegerDigits = stem.length;\n }\n return result;\n}\nfunction parseNotationOptions(opt) {\n var result = {};\n var signOpts = parseSign(opt);\n if (signOpts) {\n return signOpts;\n }\n return result;\n}\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nfunction parseNumberSkeleton(tokens) {\n var result = {};\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent';\n continue;\n case '%x100':\n result.style = 'percent';\n result.scale = 100;\n continue;\n case 'currency':\n result.style = 'currency';\n result.currency = token.options[0];\n continue;\n case 'group-off':\n case ',_':\n result.useGrouping = false;\n continue;\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0;\n continue;\n case 'measure-unit':\n case 'unit':\n result.style = 'unit';\n result.unit = icuUnitToEcma(token.options[0]);\n continue;\n case 'compact-short':\n case 'K':\n result.notation = 'compact';\n result.compactDisplay = 'short';\n continue;\n case 'compact-long':\n case 'KK':\n result.notation = 'compact';\n result.compactDisplay = 'long';\n continue;\n case 'scientific':\n result = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (tslib_1.__assign(tslib_1.__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'engineering':\n result = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (tslib_1.__assign(tslib_1.__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'notation-simple':\n result.notation = 'standard';\n continue;\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol';\n result.unitDisplay = 'narrow';\n continue;\n case 'unit-width-short':\n result.currencyDisplay = 'code';\n result.unitDisplay = 'short';\n continue;\n case 'unit-width-full-name':\n result.currencyDisplay = 'name';\n result.unitDisplay = 'long';\n continue;\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol';\n continue;\n case 'scale':\n result.scale = parseFloat(token.options[0]);\n continue;\n case 'rounding-mode-floor':\n result.roundingMode = 'floor';\n continue;\n case 'rounding-mode-ceiling':\n result.roundingMode = 'ceil';\n continue;\n case 'rounding-mode-down':\n result.roundingMode = 'trunc';\n continue;\n case 'rounding-mode-up':\n result.roundingMode = 'expand';\n continue;\n case 'rounding-mode-half-even':\n result.roundingMode = 'halfEven';\n continue;\n case 'rounding-mode-half-down':\n result.roundingMode = 'halfTrunc';\n continue;\n case 'rounding-mode-half-up':\n result.roundingMode = 'halfExpand';\n continue;\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError('integer-width stems only accept a single optional option');\n }\n token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {\n if (g1) {\n result.minimumIntegerDigits = g2.length;\n }\n else if (g3 && g4) {\n throw new Error('We currently do not support maximum integer digits');\n }\n else if (g5) {\n throw new Error('We currently do not support exact integer digits');\n }\n return '';\n });\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length;\n continue;\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError('Fraction-precision stems only accept a single optional option');\n }\n token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length;\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length;\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length;\n result.maximumFractionDigits = g4.length + g5.length;\n }\n else {\n result.minimumFractionDigits = g1.length;\n result.maximumFractionDigits = g1.length;\n }\n return '';\n });\n var opt = token.options[0];\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = tslib_1.__assign(tslib_1.__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });\n }\n else if (opt) {\n result = tslib_1.__assign(tslib_1.__assign({}, result), parseSignificantPrecision(opt));\n }\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = tslib_1.__assign(tslib_1.__assign({}, result), parseSignificantPrecision(token.stem));\n continue;\n }\n var signOpts = parseSign(token.stem);\n if (signOpts) {\n result = tslib_1.__assign(tslib_1.__assign({}, result), signOpts);\n }\n var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);\n if (conciseScientificAndEngineeringOpts) {\n result = tslib_1.__assign(tslib_1.__assign({}, result), conciseScientificAndEngineeringOpts);\n }\n }\n return result;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./date-time\"), exports);\ntslib_1.__exportStar(require(\"./number\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.timeData = void 0;\n// @generated from time-data-gen.ts\n// prettier-ignore \nexports.timeData = {\n \"001\": [\n \"H\",\n \"h\"\n ],\n \"419\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AD\": [\n \"H\",\n \"hB\"\n ],\n \"AE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"AF\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"AG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AL\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"AM\": [\n \"H\",\n \"hB\"\n ],\n \"AO\": [\n \"H\",\n \"hB\"\n ],\n \"AR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AS\": [\n \"h\",\n \"H\"\n ],\n \"AT\": [\n \"H\",\n \"hB\"\n ],\n \"AU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AW\": [\n \"H\",\n \"hB\"\n ],\n \"AX\": [\n \"H\"\n ],\n \"AZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BD\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"BE\": [\n \"H\",\n \"hB\"\n ],\n \"BF\": [\n \"H\",\n \"hB\"\n ],\n \"BG\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"BI\": [\n \"H\",\n \"h\"\n ],\n \"BJ\": [\n \"H\",\n \"hB\"\n ],\n \"BL\": [\n \"H\",\n \"hB\"\n ],\n \"BM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BN\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"BO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"BQ\": [\n \"H\"\n ],\n \"BR\": [\n \"H\",\n \"hB\"\n ],\n \"BS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BT\": [\n \"h\",\n \"H\"\n ],\n \"BW\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BY\": [\n \"H\",\n \"h\"\n ],\n \"BZ\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CA\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"CC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CD\": [\n \"hB\",\n \"H\"\n ],\n \"CF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CG\": [\n \"H\",\n \"hB\"\n ],\n \"CH\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"CI\": [\n \"H\",\n \"hB\"\n ],\n \"CK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CL\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CN\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"CO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CP\": [\n \"H\"\n ],\n \"CR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CU\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CV\": [\n \"H\",\n \"hB\"\n ],\n \"CW\": [\n \"H\",\n \"hB\"\n ],\n \"CX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CY\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"CZ\": [\n \"H\"\n ],\n \"DE\": [\n \"H\",\n \"hB\"\n ],\n \"DG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"DJ\": [\n \"h\",\n \"H\"\n ],\n \"DK\": [\n \"H\"\n ],\n \"DM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"DO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"DZ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"EC\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"EE\": [\n \"H\",\n \"hB\"\n ],\n \"EG\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ER\": [\n \"h\",\n \"H\"\n ],\n \"ES\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"ET\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"FI\": [\n \"H\"\n ],\n \"FJ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"FM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FO\": [\n \"H\",\n \"h\"\n ],\n \"FR\": [\n \"H\",\n \"hB\"\n ],\n \"GA\": [\n \"H\",\n \"hB\"\n ],\n \"GB\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GD\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GE\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"GF\": [\n \"H\",\n \"hB\"\n ],\n \"GG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GH\": [\n \"h\",\n \"H\"\n ],\n \"GI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GL\": [\n \"H\",\n \"h\"\n ],\n \"GM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GN\": [\n \"H\",\n \"hB\"\n ],\n \"GP\": [\n \"H\",\n \"hB\"\n ],\n \"GQ\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"GR\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"GT\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"GU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GW\": [\n \"H\",\n \"hB\"\n ],\n \"GY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"HK\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"HN\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"HR\": [\n \"H\",\n \"hB\"\n ],\n \"HU\": [\n \"H\",\n \"h\"\n ],\n \"IC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ID\": [\n \"H\"\n ],\n \"IE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IL\": [\n \"H\",\n \"hB\"\n ],\n \"IM\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IN\": [\n \"h\",\n \"H\"\n ],\n \"IO\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IQ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"IR\": [\n \"hB\",\n \"H\"\n ],\n \"IS\": [\n \"H\"\n ],\n \"IT\": [\n \"H\",\n \"hB\"\n ],\n \"JE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"JM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"JO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"JP\": [\n \"H\",\n \"K\",\n \"h\"\n ],\n \"KE\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"KG\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KH\": [\n \"hB\",\n \"h\",\n \"H\",\n \"hb\"\n ],\n \"KI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KM\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KN\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KP\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KW\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"KY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KZ\": [\n \"H\",\n \"hB\"\n ],\n \"LA\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"LB\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LI\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"LK\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"LR\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LS\": [\n \"h\",\n \"H\"\n ],\n \"LT\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"LU\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"LV\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"LY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MC\": [\n \"H\",\n \"hB\"\n ],\n \"MD\": [\n \"H\",\n \"hB\"\n ],\n \"ME\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"MF\": [\n \"H\",\n \"hB\"\n ],\n \"MG\": [\n \"H\",\n \"h\"\n ],\n \"MH\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ML\": [\n \"H\"\n ],\n \"MM\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"MN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MP\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MQ\": [\n \"H\",\n \"hB\"\n ],\n \"MR\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MS\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MT\": [\n \"H\",\n \"h\"\n ],\n \"MU\": [\n \"H\",\n \"h\"\n ],\n \"MV\": [\n \"H\",\n \"h\"\n ],\n \"MW\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MX\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"MY\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"MZ\": [\n \"H\",\n \"hB\"\n ],\n \"NA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NC\": [\n \"H\",\n \"hB\"\n ],\n \"NE\": [\n \"H\"\n ],\n \"NF\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NI\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NL\": [\n \"H\",\n \"hB\"\n ],\n \"NO\": [\n \"H\",\n \"h\"\n ],\n \"NP\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"NR\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NU\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"OM\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"PG\": [\n \"h\",\n \"H\"\n ],\n \"PH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PK\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"PL\": [\n \"H\",\n \"h\"\n ],\n \"PM\": [\n \"H\",\n \"hB\"\n ],\n \"PN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"PR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PS\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PT\": [\n \"H\",\n \"hB\"\n ],\n \"PW\": [\n \"h\",\n \"H\"\n ],\n \"PY\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"QA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"RE\": [\n \"H\",\n \"hB\"\n ],\n \"RO\": [\n \"H\",\n \"hB\"\n ],\n \"RS\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"RU\": [\n \"H\"\n ],\n \"RW\": [\n \"H\",\n \"h\"\n ],\n \"SA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SC\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SD\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SE\": [\n \"H\"\n ],\n \"SG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SH\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SI\": [\n \"H\",\n \"hB\"\n ],\n \"SJ\": [\n \"H\"\n ],\n \"SK\": [\n \"H\"\n ],\n \"SL\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SN\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SO\": [\n \"h\",\n \"H\"\n ],\n \"SR\": [\n \"H\",\n \"hB\"\n ],\n \"SS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ST\": [\n \"H\",\n \"hB\"\n ],\n \"SV\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"SX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"TC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TD\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"TF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"TG\": [\n \"H\",\n \"hB\"\n ],\n \"TH\": [\n \"H\",\n \"h\"\n ],\n \"TJ\": [\n \"H\",\n \"h\"\n ],\n \"TL\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"TM\": [\n \"H\",\n \"h\"\n ],\n \"TN\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"TO\": [\n \"h\",\n \"H\"\n ],\n \"TR\": [\n \"H\",\n \"hB\"\n ],\n \"TT\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TW\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"TZ\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UG\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"US\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"UY\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"UZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"VA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"VC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"VG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VN\": [\n \"H\",\n \"h\"\n ],\n \"VU\": [\n \"h\",\n \"H\"\n ],\n \"WF\": [\n \"H\",\n \"hB\"\n ],\n \"WS\": [\n \"h\",\n \"H\"\n ],\n \"XK\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"YE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"YT\": [\n \"H\",\n \"hB\"\n ],\n \"ZA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ZM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ZW\": [\n \"H\",\n \"h\"\n ],\n \"af-ZA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ar-001\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ca-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"en-001\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-HK\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-IL\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"en-MY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"es-BR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-ES\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-GQ\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"fr-CA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gl-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gu-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"hi-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"it-CH\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-IT\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"kn-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ml-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"mr-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"pa-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"ta-IN\": [\n \"hB\",\n \"h\",\n \"hb\",\n \"H\"\n ],\n \"te-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"zu-ZA\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ]\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getBestPattern = getBestPattern;\nvar time_data_generated_1 = require(\"./time-data.generated\");\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nfunction getBestPattern(skeleton, locale) {\n var skeletonCopy = '';\n for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {\n var patternChar = skeleton.charAt(patternPos);\n if (patternChar === 'j') {\n var extraLength = 0;\n while (patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar) {\n extraLength++;\n patternPos++;\n }\n var hourLen = 1 + (extraLength & 1);\n var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);\n var dayPeriodChar = 'a';\n var hourChar = getDefaultHourSymbolFromLocale(locale);\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0;\n }\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar;\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy;\n }\n }\n else if (patternChar === 'J') {\n skeletonCopy += 'H';\n }\n else {\n skeletonCopy += patternChar;\n }\n }\n return skeletonCopy;\n}\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-ignore hourCycle(s) is not identified yet\n locale.hourCycles &&\n // @ts-ignore\n locale.hourCycles.length) {\n // @ts-ignore\n hourCycle = locale.hourCycles[0];\n }\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k';\n case 'h23':\n return 'H';\n case 'h12':\n return 'h';\n case 'h11':\n return 'K';\n default:\n throw new Error('Invalid hourCycle');\n }\n }\n // TODO: Once hourCycle is fully supported remove the following with data generation\n var languageTag = locale.language;\n var regionTag;\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region;\n }\n var hourCycles = time_data_generated_1.timeData[regionTag || ''] ||\n time_data_generated_1.timeData[languageTag || ''] ||\n time_data_generated_1.timeData[\"\".concat(languageTag, \"-001\")] ||\n time_data_generated_1.timeData['001'];\n return hourCycles[0];\n}\n","\"use strict\";\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Parser = void 0;\nvar tslib_1 = require(\"tslib\");\nvar error_1 = require(\"./error\");\nvar types_1 = require(\"./types\");\nvar regex_generated_1 = require(\"./regex.generated\");\nvar icu_skeleton_parser_1 = require(\"@formatjs/icu-skeleton-parser\");\nvar date_time_pattern_generator_1 = require(\"./date-time-pattern-generator\");\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(regex_generated_1.SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(regex_generated_1.SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith && '_a'.startsWith('a', 1);\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: types_1.TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(error_1.ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"</\" tagName (whitespace)* \">\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: types_1.TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('</')) {\n if (this.isEOF() || !_isAlpha(this.char())) {\n return this.error(error_1.ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n var closingTagNameStartPosition = this.clonePosition();\n var closingTagName = this.parseTagName();\n if (tagName !== closingTagName) {\n return this.error(error_1.ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(closingTagNameStartPosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (!this.bumpIf('>')) {\n return this.error(error_1.ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: types_1.TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(error_1.ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(error_1.ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: types_1.TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(error_1.ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(error_1.ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: types_1.TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(error_1.ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: types_1.TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(error_1.ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = (0, date_time_pattern_generator_1.getBestPattern)(skeleton, this.locale);\n }\n var style = {\n type: types_1.SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? (0, icu_skeleton_parser_1.parseDateTimeSkeleton)(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? types_1.TYPE.date : types_1.TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? types_1.TYPE.number\n : argType === 'date'\n ? types_1.TYPE.date\n : types_1.TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(error_1.ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, tslib_1.__assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, error_1.ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: types_1.TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: types_1.TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(error_1.ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(error_1.ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = (0, icu_skeleton_parser_1.parseNumberSkeletonFromString)(skeleton);\n }\n catch (e) {\n return this.error(error_1.ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: types_1.SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? (0, icu_skeleton_parser_1.parseNumberSkeleton)(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, error_1.ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? error_1.ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : error_1.ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? error_1.ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? error_1.ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(error_1.ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexports.Parser = Parser;\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hoistSelectors = hoistSelectors;\nexports.isStructurallySame = isStructurallySame;\nvar tslib_1 = require(\"tslib\");\nvar types_1 = require(\"./types\");\nfunction cloneDeep(obj) {\n if (Array.isArray(obj)) {\n // @ts-expect-error meh\n return tslib_1.__spreadArray([], obj.map(cloneDeep), true);\n }\n if (obj !== null && typeof obj === 'object') {\n // @ts-expect-error meh\n return Object.keys(obj).reduce(function (cloned, k) {\n // @ts-expect-error meh\n cloned[k] = cloneDeep(obj[k]);\n return cloned;\n }, {});\n }\n return obj;\n}\nfunction hoistPluralOrSelectElement(ast, el, positionToInject) {\n // pull this out of the ast and move it to the top\n var cloned = cloneDeep(el);\n var options = cloned.options;\n cloned.options = Object.keys(options).reduce(function (all, k) {\n var newValue = hoistSelectors(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], ast.slice(0, positionToInject), true), options[k].value, true), ast.slice(positionToInject + 1), true));\n all[k] = {\n value: newValue,\n };\n return all;\n }, {});\n return cloned;\n}\nfunction isPluralOrSelectElement(el) {\n return (0, types_1.isPluralElement)(el) || (0, types_1.isSelectElement)(el);\n}\nfunction findPluralOrSelectElement(ast) {\n return !!ast.find(function (el) {\n if (isPluralOrSelectElement(el)) {\n return true;\n }\n if ((0, types_1.isTagElement)(el)) {\n return findPluralOrSelectElement(el.children);\n }\n return false;\n });\n}\n/**\n * Hoist all selectors to the beginning of the AST & flatten the\n * resulting options. E.g:\n * \"I have {count, plural, one{a dog} other{many dogs}}\"\n * becomes \"{count, plural, one{I have a dog} other{I have many dogs}}\".\n * If there are multiple selectors, the order of which one is hoisted 1st\n * is non-deterministic.\n * The goal is to provide as many full sentences as possible since fragmented\n * sentences are not translator-friendly\n * @param ast AST\n */\nfunction hoistSelectors(ast) {\n for (var i = 0; i < ast.length; i++) {\n var el = ast[i];\n if (isPluralOrSelectElement(el)) {\n return [hoistPluralOrSelectElement(ast, el, i)];\n }\n if ((0, types_1.isTagElement)(el) && findPluralOrSelectElement([el])) {\n throw new Error('Cannot hoist plural/select within a tag element. Please put the tag element inside each plural/select option');\n }\n }\n return ast;\n}\n/**\n * Collect all variables in an AST to Record<string, TYPE>\n * @param ast AST to collect variables from\n * @param vars Record of variable name to variable type\n */\nfunction collectVariables(ast, vars) {\n if (vars === void 0) { vars = new Map(); }\n ast.forEach(function (el) {\n if ((0, types_1.isArgumentElement)(el) ||\n (0, types_1.isDateElement)(el) ||\n (0, types_1.isTimeElement)(el) ||\n (0, types_1.isNumberElement)(el)) {\n if (el.value in vars && vars.get(el.value) !== el.type) {\n throw new Error(\"Variable \".concat(el.value, \" has conflicting types\"));\n }\n vars.set(el.value, el.type);\n }\n if ((0, types_1.isPluralElement)(el) || (0, types_1.isSelectElement)(el)) {\n vars.set(el.value, el.type);\n Object.keys(el.options).forEach(function (k) {\n collectVariables(el.options[k].value, vars);\n });\n }\n if ((0, types_1.isTagElement)(el)) {\n vars.set(el.value, el.type);\n collectVariables(el.children, vars);\n }\n });\n}\n/**\n * Check if 2 ASTs are structurally the same. This primarily means that\n * they have the same variables with the same type\n * @param a\n * @param b\n * @returns\n */\nfunction isStructurallySame(a, b) {\n var aVars = new Map();\n var bVars = new Map();\n collectVariables(a, aVars);\n collectVariables(b, bVars);\n if (aVars.size !== bVars.size) {\n return {\n success: false,\n error: new Error(\"Different number of variables: [\".concat(Array.from(aVars.keys()).join(', '), \"] vs [\").concat(Array.from(bVars.keys()).join(', '), \"]\")),\n };\n }\n return Array.from(aVars.entries()).reduce(function (result, _a) {\n var key = _a[0], type = _a[1];\n if (!result.success) {\n return result;\n }\n var bType = bVars.get(key);\n if (bType == null) {\n return {\n success: false,\n error: new Error(\"Missing variable \".concat(key, \" in message\")),\n };\n }\n if (bType !== type) {\n return {\n success: false,\n error: new Error(\"Variable \".concat(key, \" has conflicting types: \").concat(types_1.TYPE[type], \" vs \").concat(types_1.TYPE[bType])),\n };\n }\n return result;\n }, { success: true });\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isStructurallySame = exports._Parser = void 0;\nexports.parse = parse;\nvar tslib_1 = require(\"tslib\");\nvar error_1 = require(\"./error\");\nvar parser_1 = require(\"./parser\");\nvar types_1 = require(\"./types\");\nfunction pruneLocation(els) {\n els.forEach(function (el) {\n delete el.location;\n if ((0, types_1.isSelectElement)(el) || (0, types_1.isPluralElement)(el)) {\n for (var k in el.options) {\n delete el.options[k].location;\n pruneLocation(el.options[k].value);\n }\n }\n else if ((0, types_1.isNumberElement)(el) && (0, types_1.isNumberSkeleton)(el.style)) {\n delete el.style.location;\n }\n else if (((0, types_1.isDateElement)(el) || (0, types_1.isTimeElement)(el)) &&\n (0, types_1.isDateTimeSkeleton)(el.style)) {\n delete el.style.location;\n }\n else if ((0, types_1.isTagElement)(el)) {\n pruneLocation(el.children);\n }\n });\n}\nfunction parse(message, opts) {\n if (opts === void 0) { opts = {}; }\n opts = tslib_1.__assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);\n var result = new parser_1.Parser(message, opts).parse();\n if (result.err) {\n var error = SyntaxError(error_1.ErrorKind[result.err.kind]);\n // @ts-expect-error Assign to error object\n error.location = result.err.location;\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message;\n throw error;\n }\n if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {\n pruneLocation(result.val);\n }\n return result.val;\n}\ntslib_1.__exportStar(require(\"./types\"), exports);\n// only for testing\nexports._Parser = parser_1.Parser;\nvar manipulator_1 = require(\"./manipulator\");\nObject.defineProperty(exports, \"isStructurallySame\", { enumerable: true, get: function () { return manipulator_1.isStructurallySame; } });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.printAST = printAST;\nexports.doPrintAST = doPrintAST;\nexports.printDateTimeSkeleton = printDateTimeSkeleton;\nvar tslib_1 = require(\"tslib\");\nvar types_1 = require(\"./types\");\nfunction printAST(ast) {\n return doPrintAST(ast, false);\n}\nfunction doPrintAST(ast, isInPlural) {\n var printedNodes = ast.map(function (el, i) {\n if ((0, types_1.isLiteralElement)(el)) {\n return printLiteralElement(el, isInPlural, i === 0, i === ast.length - 1);\n }\n if ((0, types_1.isArgumentElement)(el)) {\n return printArgumentElement(el);\n }\n if ((0, types_1.isDateElement)(el) || (0, types_1.isTimeElement)(el) || (0, types_1.isNumberElement)(el)) {\n return printSimpleFormatElement(el);\n }\n if ((0, types_1.isPluralElement)(el)) {\n return printPluralElement(el);\n }\n if ((0, types_1.isSelectElement)(el)) {\n return printSelectElement(el);\n }\n if ((0, types_1.isPoundElement)(el)) {\n return '#';\n }\n if ((0, types_1.isTagElement)(el)) {\n return printTagElement(el);\n }\n });\n return printedNodes.join('');\n}\nfunction printTagElement(el) {\n return \"<\".concat(el.value, \">\").concat(printAST(el.children), \"</\").concat(el.value, \">\");\n}\nfunction printEscapedMessage(message) {\n return message.replace(/([{}](?:[\\s\\S]*[{}])?)/, \"'$1'\");\n}\nfunction printLiteralElement(_a, isInPlural, isFirstEl, isLastEl) {\n var value = _a.value;\n var escaped = value;\n // If this literal starts with a ' and its not the 1st node, this means the node before it is non-literal\n // and the `'` needs to be unescaped\n if (!isFirstEl && escaped[0] === \"'\") {\n escaped = \"''\".concat(escaped.slice(1));\n }\n // Same logic but for last el\n if (!isLastEl && escaped[escaped.length - 1] === \"'\") {\n escaped = \"\".concat(escaped.slice(0, escaped.length - 1), \"''\");\n }\n escaped = printEscapedMessage(escaped);\n return isInPlural ? escaped.replace('#', \"'#'\") : escaped;\n}\nfunction printArgumentElement(_a) {\n var value = _a.value;\n return \"{\".concat(value, \"}\");\n}\nfunction printSimpleFormatElement(el) {\n return \"{\".concat(el.value, \", \").concat(types_1.TYPE[el.type]).concat(el.style ? \", \".concat(printArgumentStyle(el.style)) : '', \"}\");\n}\nfunction printNumberSkeletonToken(token) {\n var stem = token.stem, options = token.options;\n return options.length === 0\n ? stem\n : \"\".concat(stem).concat(options.map(function (o) { return \"/\".concat(o); }).join(''));\n}\nfunction printArgumentStyle(style) {\n if (typeof style === 'string') {\n return printEscapedMessage(style);\n }\n else if (style.type === types_1.SKELETON_TYPE.dateTime) {\n return \"::\".concat(printDateTimeSkeleton(style));\n }\n else {\n return \"::\".concat(style.tokens.map(printNumberSkeletonToken).join(' '));\n }\n}\nfunction printDateTimeSkeleton(style) {\n return style.pattern;\n}\nfunction printSelectElement(el) {\n var msg = [\n el.value,\n 'select',\n Object.keys(el.options)\n .map(function (id) { return \"\".concat(id, \"{\").concat(doPrintAST(el.options[id].value, false), \"}\"); })\n .join(' '),\n ].join(',');\n return \"{\".concat(msg, \"}\");\n}\nfunction printPluralElement(el) {\n var type = el.pluralType === 'cardinal' ? 'plural' : 'selectordinal';\n var msg = [\n el.value,\n type,\n tslib_1.__spreadArray([\n el.offset ? \"offset:\".concat(el.offset) : ''\n ], Object.keys(el.options).map(function (id) { return \"\".concat(id, \"{\").concat(doPrintAST(el.options[id].value, true), \"}\"); }), true).filter(Boolean)\n .join(' '),\n ].join(',');\n return \"{\".concat(msg, \"}\");\n}\n","import { a as defaultBaseUrl, c as defaultTimeout, i as isSupportedFileFormatTransform, l as libraryDefaultLocale, n as encode, o as defaultCacheUrl, r as validateFileFormatTransforms, s as defaultRuntimeApiUrl, t as decode } from \"./base64-CWITCfhU.mjs\";\nimport { n as stableStringify, t as isVariable } from \"./isVariable-fAKEB7gF.mjs\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { bytesToHex, utf8ToBytes } from \"@noble/hashes/utils.js\";\nimport { getCachedPluralRules } from \"@generaltranslation/format/internal\";\nimport { TYPE, parse } from \"@formatjs/icu-messageformat-parser\";\nimport { TYPE as TYPE$1 } from \"@formatjs/icu-messageformat-parser/types.js\";\nimport { printAST } from \"@formatjs/icu-messageformat-parser/printer.js\";\n//#region src/settings/plurals.ts\nconst pluralForms = [\n\t\"singular\",\n\t\"plural\",\n\t\"dual\",\n\t\"zero\",\n\t\"one\",\n\t\"two\",\n\t\"few\",\n\t\"many\",\n\t\"other\"\n];\nfunction isAcceptedPluralForm(form) {\n\treturn pluralForms.includes(form);\n}\n//#endregion\n//#region src/locales/getPluralForm.ts\n/**\n* Given a number and a list of allowed plural forms, return the plural form that best fits the number.\n*\n* @param {number} n - The number to determine the plural form for.\n* @param {PluralType[]} forms - The allowed plural forms.\n* @returns {PluralType} The determined plural form, or an empty string if none fit.\n*/\nfunction _getPluralForm(n, forms = pluralForms, locales = [\"en\"]) {\n\tconst provisionalBranchName = getCachedPluralRules(locales).select(n);\n\tconst absN = Math.abs(n);\n\tif (absN === 0 && forms.includes(\"zero\")) return \"zero\";\n\tif (absN === 1) {\n\t\tif (forms.includes(\"singular\")) return \"singular\";\n\t\tif (forms.includes(\"one\")) return \"one\";\n\t}\n\tif (provisionalBranchName === \"one\" && forms.includes(\"singular\")) return \"singular\";\n\tif (absN === 2) {\n\t\tif (forms.includes(\"dual\")) return \"dual\";\n\t\tif (forms.includes(\"two\")) return \"two\";\n\t}\n\tif (provisionalBranchName === \"two\" && forms.includes(\"dual\")) return \"dual\";\n\tif (forms.includes(provisionalBranchName)) return provisionalBranchName;\n\tif (provisionalBranchName === \"two\" && forms.includes(\"dual\")) return \"dual\";\n\tif (provisionalBranchName === \"two\" && forms.includes(\"plural\")) return \"plural\";\n\tif (provisionalBranchName === \"two\" && forms.includes(\"other\")) return \"other\";\n\tif (provisionalBranchName === \"few\" && forms.includes(\"plural\")) return \"plural\";\n\tif (provisionalBranchName === \"few\" && forms.includes(\"other\")) return \"other\";\n\tif (provisionalBranchName === \"many\" && forms.includes(\"plural\")) return \"plural\";\n\tif (provisionalBranchName === \"many\" && forms.includes(\"other\")) return \"other\";\n\tif (provisionalBranchName === \"other\" && forms.includes(\"plural\")) return \"plural\";\n\treturn \"\";\n}\n//#endregion\n//#region src/utils/minify.ts\nconst VARIABLE_TRANSFORMATION_SUFFIXES_TO_MINIFIED_NAMES = {\n\tvariable: \"v\",\n\tnumber: \"n\",\n\tdatetime: \"d\",\n\tcurrency: \"c\",\n\t\"relative-time\": \"rt\"\n};\nfunction minifyVariableType(variableType) {\n\treturn VARIABLE_TRANSFORMATION_SUFFIXES_TO_MINIFIED_NAMES[variableType];\n}\n//#endregion\n//#region src/derive/utils/traverseIcu.ts\n/**\n* Given an ICU string, traverse the AST and call the visitor function for each element that matches the type T\n* @param icu - The ICU string to traverse\n* @param shouldVisit - A function that returns true if the element should be visited\n* @param visitor - A function that is called for each element that matches the type T\n* @returns The modified AST of the ICU string.\n*\n* @note This function is a heavy operation, use sparingly\n*/\nfunction traverseIcu({ icuString, shouldVisit, visitor, options: { recurseIntoVisited = true, ...otherOptions } }) {\n\tconst ast = parse(icuString, otherOptions);\n\thandleChildren(ast);\n\treturn ast;\n\tfunction handleChildren(children) {\n\t\tchildren.map(handleChild);\n\t}\n\tfunction handleChild(child) {\n\t\tlet visited = false;\n\t\tif (shouldVisit(child)) {\n\t\t\tvisitor(child);\n\t\t\tvisited = true;\n\t\t}\n\t\tif (!visited || recurseIntoVisited) {\n\t\t\tif (child.type === TYPE.select || child.type === TYPE.plural) Object.values(child.options).map((option) => option.value).map(handleChildren);\n\t\t\telse if (child.type === TYPE.tag) handleChildren(child.children);\n\t\t}\n\t}\n}\n//#endregion\n//#region src/derive/utils/constants.ts\nconst VAR_IDENTIFIER = \"_gt_\";\nconst VAR_NAME_IDENTIFIER = \"_gt_var_name\";\n//#endregion\n//#region src/derive/utils/regex.ts\nconst GT_INDEXED_IDENTIFIER_REGEX = new RegExp(`^${VAR_IDENTIFIER}\\\\d+$`);\nconst GT_UNINDEXED_IDENTIFIER_REGEX = new RegExp(`^${VAR_IDENTIFIER}$`);\n//#endregion\n//#region src/derive/utils/traverseHelpers.ts\nfunction isGTIndexedSelectElement(child) {\n\treturn child.type === TYPE$1.select && GT_INDEXED_IDENTIFIER_REGEX.test(child.value) && !!child.options.other && (child.options.other.value.length === 0 || child.options.other.value.length > 0 && child.options.other.value[0]?.type === TYPE$1.literal);\n}\nfunction isGTUnindexedSelectElement(child) {\n\treturn child.type === TYPE$1.select && GT_UNINDEXED_IDENTIFIER_REGEX.test(child.value) && !!child.options.other && (child.options.other.value.length === 0 || child.options.other.value.length > 0 && child.options.other.value[0]?.type === TYPE$1.literal);\n}\n//#endregion\n//#region src/derive/decodeVars.ts\n/**\n* Given an encoded ICU string, interpolate only _gt_ variables that have been marked with declareVar()\n* @example\n* const encodedIcu = \"Hi\" + declareVar(\"Brian\") + \", my name is {name}\"\n* // 'Hi {_gt_, select, other {Brian}}, my name is {name}'\n* decodeVars(encodedIcu)\n* // 'Hi Brian, my name is {name}'\n*/\nfunction decodeVars(icuString) {\n\tif (!icuString.includes(\"_gt_\")) return icuString;\n\tconst variableLocations = [];\n\tfunction visitor(child) {\n\t\tvariableLocations.push({\n\t\t\tstart: child.location?.start.offset ?? 0,\n\t\t\tend: child.location?.end.offset ?? 0,\n\t\t\tvalue: child.options.other.value.length > 0 ? child.options.other.value[0].value : \"\"\n\t\t});\n\t}\n\ttraverseIcu({\n\t\ticuString,\n\t\tshouldVisit: isGTUnindexedSelectElement,\n\t\tvisitor,\n\t\toptions: {\n\t\t\trecurseIntoVisited: false,\n\t\t\tcaptureLocation: true\n\t\t}\n\t});\n\tlet previousIndex = 0;\n\tconst outputList = [];\n\tfor (let i = 0; i < variableLocations.length; i++) {\n\t\toutputList.push(icuString.slice(previousIndex, variableLocations[i].start));\n\t\toutputList.push(variableLocations[i].value);\n\t\tpreviousIndex = variableLocations[i].end;\n\t}\n\tif (previousIndex < icuString.length) outputList.push(icuString.slice(previousIndex));\n\treturn outputList.join(\"\");\n}\n//#endregion\n//#region src/derive/utils/sanitizeVar.ts\n/**\n* Sanitizes string by escaping ICU syntax\n*\n* Sanitize arbitrary string so it does not break the following ICU message syntax:\n* {_gt_, select, other {string_here}}\n*\n* Escapes ICU special characters by:\n* 1. Doubling all single quotes (U+0027 ')\n* 2. Adding a single quote before the first special character ({}<>)\n* 3. Adding a single quote after the last special character ({}<>)\n*/\nfunction sanitizeVar(string) {\n\tlet result = string.replace(/'/g, \"''\");\n\tconst specialChars = /[{}<>]/;\n\tconst firstSpecialIndex = result.search(specialChars);\n\tif (firstSpecialIndex === -1) return result;\n\tlet lastSpecialIndex = -1;\n\tfor (let i = result.length - 1; i >= 0; i--) if (specialChars.test(result[i])) {\n\t\tlastSpecialIndex = i;\n\t\tbreak;\n\t}\n\tresult = result.slice(0, firstSpecialIndex) + \"'\" + result.slice(firstSpecialIndex, lastSpecialIndex + 1) + \"'\" + result.slice(lastSpecialIndex + 1);\n\treturn result;\n}\n//#endregion\n//#region src/derive/declareVar.ts\n/**\n* Mark as a non-translatable string. Use within a derive() call to mark content as not derivable (e.g., not possible to statically analyze).\n*\n* @example\n* function nonDerivableFunction() {\n* return Math.random();\n* }\n*\n* function derivableFunction() {\n* if (condition) {\n* return declareVar(nonDerivableFunction())\n* }\n* return 'John Doe';\n* }\n*\n* const gt = useGT();\n* gt(`My name is ${derive(derivableFunction())}`);\n*\n* @param {string | number | boolean | null | undefined} variable - The variable to sanitize.\n* @param {Object} [options] - The options for the sanitization.\n* @param {string} [options.$name] - The name of the variable.\n* @returns {string} The sanitized value.\n*/\nfunction declareVar(variable, options) {\n\tconst variableSection = ` other {${sanitizeVar(String(variable ?? \"\"))}}`;\n\tlet nameSection = \"\";\n\tif (options?.$name) nameSection = ` ${VAR_NAME_IDENTIFIER} {${sanitizeVar(options.$name)}}`;\n\treturn `{${VAR_IDENTIFIER}, select,${variableSection}${nameSection}}`;\n}\n//#endregion\n//#region src/derive/derive.ts\n/**\n* Marks content as derivable by the GT compiler and CLI.\n*\n* Use `derive()` when a translation string or context needs content that is\n* computed from source code, but should still be discovered during extraction\n* instead of treated as a runtime interpolation variable. The CLI attempts to\n* resolve the derivable expression into every possible static value and\n* includes those values in the source content that gets translated.\n*\n* `derive()` returns its argument unchanged at runtime.\n*\n* Run `gt validate` after adding or changing `derive()` calls to verify that\n* each derivable expression can be resolved by the CLI before translating or\n* building.\n*\n* @example\n* ```jsx\n* function getSubject() {\n* return (Math.random() > 0.5) ? \"Alice\" : \"Brian\";\n* }\n* ...\n* gt(`My name is ${derive(getSubject())}`);\n* ```\n*\n* @param {T extends string | boolean | number | null | undefined} content - Content to derive for translation extraction.\n* @returns {T} The same content, unchanged at runtime.\n*/\nfunction derive(content) {\n\treturn content;\n}\n/**\n* @deprecated Use derive() instead.\n*\n* Marks content as derivable by the GT compiler and CLI.\n*\n* Use `derive()` instead of `declareStatic()` for new code. This alias is kept\n* for backwards compatibility and returns its argument unchanged at runtime.\n*\n* Run `gt validate` after adding or changing derived content to verify that\n* each derivable expression can be resolved by the CLI before translating or\n* building.\n*\n* @example\n* ```jsx\n* function getSubject() {\n* return (Math.random() > 0.5) ? \"Alice\" : \"Brian\";\n* }\n* ...\n* gt(`My name is ${declareStatic(getSubject())}`);\n* ```\n*\n* @param {T extends string | boolean | number | null | undefined} content - Content to derive for translation extraction.\n* @returns {T} The same content, unchanged at runtime.\n*/\nconst declareStatic = derive;\n//#endregion\n//#region src/derive/indexVars.ts\n/**\n* Given an ICU string adds identifiers to each _gt_ placeholder\n* indexVars('Hello {_gt_} {_gt_} World') => 'Hello {_gt_1_} {_gt_2_} World'\n*/\nfunction indexVars(icuString) {\n\tif (!icuString.includes(\"_gt_\")) return icuString;\n\tconst variableLocations = [];\n\tfunction visitor(child) {\n\t\tvariableLocations.push({\n\t\t\tstart: child.location?.start.offset ?? 0,\n\t\t\tend: child.location?.end.offset ?? 0,\n\t\t\totherStart: child.options.other.location?.start.offset ?? 0,\n\t\t\totherEnd: child.options.other.location?.end.offset ?? 0\n\t\t});\n\t}\n\ttraverseIcu({\n\t\ticuString,\n\t\tshouldVisit: isGTUnindexedSelectElement,\n\t\tvisitor,\n\t\toptions: {\n\t\t\trecurseIntoVisited: false,\n\t\t\tcaptureLocation: true\n\t\t}\n\t});\n\tconst result = [];\n\tlet current = 0;\n\tfor (let i = 0; i < variableLocations.length; i++) {\n\t\tconst { start, end, otherStart, otherEnd } = variableLocations[i];\n\t\tresult.push(icuString.slice(current, start));\n\t\tresult.push(icuString.slice(start, start + 4 + 1));\n\t\tresult.push(String(i + 1));\n\t\tresult.push(icuString.slice(start + 4 + 1, otherStart));\n\t\tresult.push(\"{}\");\n\t\tresult.push(icuString.slice(otherEnd, end));\n\t\tcurrent = end;\n\t}\n\tresult.push(icuString.slice(current, icuString.length));\n\treturn result.join(\"\");\n}\n//#endregion\n//#region src/derive/extractVars.ts\n/**\n* Given an unindexed ICU string, extracts all the _gt_ variables and an indexed mapping of the variable to the values\n*\n* extractVars('Hello {_gt_, select, other {World}}') => { _gt_1: 'World' }\n*\n* @param {string} icuString - The ICU string to extract variables from.\n* @returns {Record<string, string>} A mapping of the variable to the value.\n*/\nfunction extractVars(icuString) {\n\tif (!icuString.includes(\"_gt_\")) return {};\n\tlet index = 1;\n\tconst variables = {};\n\tfunction visitor(child) {\n\t\tvariables[child.value + index] = child.options.other.value.length ? child.options.other.value[0]?.value : \"\";\n\t\tindex += 1;\n\t}\n\ttraverseIcu({\n\t\ticuString,\n\t\tshouldVisit: isGTUnindexedSelectElement,\n\t\tvisitor,\n\t\toptions: { recurseIntoVisited: false }\n\t});\n\treturn variables;\n}\n//#endregion\n//#region src/derive/condenseVars.ts\n/**\n* Given an indexed ICU string, condenses any select to an argument\n* indexVars('Hello {_gt_1, select, other {World}}') => 'Hello {_gt_1}'\n* @param {string} icuString - The ICU string to condense.\n* @returns {string} The condensed ICU string.\n*/\nfunction condenseVars(icuString) {\n\tif (!icuString.includes(\"_gt_\")) return icuString;\n\tfunction visitor(child) {\n\t\tchild.type = TYPE$1.argument;\n\t\tReflect.deleteProperty(child, \"options\");\n\t}\n\treturn printAST(traverseIcu({\n\t\ticuString,\n\t\tshouldVisit: isGTIndexedSelectElement,\n\t\tvisitor,\n\t\toptions: { recurseIntoVisited: false }\n\t}));\n}\n//#endregion\n//#region src/backwards-compatability/typeChecking.ts\n/**\n* Checks if a JSX child is an old variable object format\n* @param child - The JSX child to check.\n* @returns True if the child is an old variable object (has 'key' property)\n*/\nfunction isOldVariableObject(child) {\n\treturn typeof child === \"object\" && child != null && \"key\" in child;\n}\n/**\n* Checks if a JSX child is a new variable object format\n* @param child - The JSX child to check.\n* @returns True if the child is a new variable object (has 'k' property)\n*/\nfunction isNewVariableObject(child) {\n\treturn typeof child === \"object\" && child != null && \"k\" in child;\n}\n/**\n* Checks if a JSX child is an old JSX element format\n* @param child - The JSX child to check.\n* @returns True if the child is an old JSX element (has 'type' and 'props' properties)\n*/\nfunction isOldJsxElement(child) {\n\treturn typeof child === \"object\" && child != null && \"type\" in child && \"props\" in child;\n}\n/**\n* Checks if a JSX child follows the old format (string, old variable object, or old JSX element)\n* @param child - The JSX child to check.\n* @returns True if the child is in the old format.\n*/\nfunction isOldJsxChild(child) {\n\tif (typeof child === \"string\") return true;\n\tif (isOldVariableObject(child)) return true;\n\treturn isOldJsxElement(child);\n}\n/**\n* Checks if JSX children follow the old format\n* @param children - The JSX children to check (can be string, array, or single child)\n* @returns True if all children are in the old format.\n*/\nfunction isOldJsxChildren(children) {\n\tif (typeof children === \"string\") return true;\n\tif (Array.isArray(children)) return !children.some((child) => !isOldJsxChild(child));\n\treturn isOldJsxChild(children);\n}\n//#endregion\n//#region src/backwards-compatability/dataConversion.ts\n/**\n* Convert request data from old format to new format\n*/\nfunction getNewJsxChild(child) {\n\tif (typeof child === \"string\") return child;\n\tif (isOldVariableObject(child)) return getNewVariableObject(child);\n\treturn getNewJsxElement(child);\n}\nfunction getNewJsxChildren(children) {\n\tif (typeof children === \"string\") return children;\n\tif (Array.isArray(children)) return children.map(getNewJsxChild);\n\treturn getNewJsxChild(children);\n}\nfunction getNewJsxElement(element) {\n\tif (typeof element === \"string\") return element;\n\tlet t = void 0;\n\tif (element.type != null) t = element.type;\n\tlet c = void 0;\n\tif (element.props?.children != null) c = getNewJsxChildren(element.props.children);\n\treturn {\n\t\t...t && { t },\n\t\t...c && { c },\n\t\td: getNewGTProp(element.props[\"data-_gt\"]),\n\t\ti: element.props[\"data-_gt\"].id\n\t};\n}\nfunction getNewBranchType(branch) {\n\tif (branch === \"branch\") return \"b\";\n\treturn \"p\";\n}\nfunction getNewVariableType(variable) {\n\tswitch (variable) {\n\t\tcase \"number\": return \"n\";\n\t\tcase \"variable\": return \"v\";\n\t\tcase \"datetime\": return \"d\";\n\t\tcase \"currency\": return \"c\";\n\t\tdefault: return \"v\";\n\t}\n}\nfunction getNewVariableObject(variable) {\n\tlet v = void 0;\n\tif (variable.variable != null) v = getNewVariableType(variable.variable);\n\tlet i = void 0;\n\tif (variable.id != null) i = variable.id;\n\treturn {\n\t\tk: variable.key,\n\t\t...v && { v },\n\t\t...i && { i }\n\t};\n}\nfunction getNewGTProp(dataGT) {\n\tlet b = void 0;\n\tif (dataGT.branches) b = Object.fromEntries(Object.entries(dataGT.branches).map(([key, value]) => [key, getNewJsxChildren(value)]));\n\tlet t;\n\tif (dataGT.transformation) t = getNewBranchType(dataGT.transformation);\n\treturn {\n\t\t...b && { b },\n\t\t...t && { t }\n\t};\n}\n/**\n* Convert response data from current format to old format\n*/\nfunction getOldJsxChild(child) {\n\tif (typeof child === \"string\") return child;\n\tif (isNewVariableObject(child)) return getOldVariableObject(child);\n\treturn getOldJsxElement(child);\n}\nfunction getOldJsxChildren(children) {\n\tif (isOldJsxChildren(children)) return children;\n\tif (typeof children === \"string\") return children;\n\tif (Array.isArray(children)) return children.map(getOldJsxChild);\n\treturn getOldJsxChild(children);\n}\nfunction getOldJsxElement(element) {\n\tconst type = element.t;\n\tlet children = void 0;\n\tif (element.c != null) children = getOldJsxChildren(element.c);\n\tconst dataGT = getOldGTProp(element.d || {}, element.i);\n\treturn {\n\t\ttype,\n\t\tprops: {\n\t\t\tchildren,\n\t\t\t\"data-_gt\": dataGT\n\t\t}\n\t};\n}\nfunction getOldBranchType(branch) {\n\tif (branch === \"b\") return \"branch\";\n\treturn \"plural\";\n}\nfunction getOldVariableType(variable) {\n\tswitch (variable) {\n\t\tcase \"n\": return \"number\";\n\t\tcase \"v\": return \"variable\";\n\t\tcase \"d\": return \"datetime\";\n\t\tcase \"c\": return \"currency\";\n\t\tdefault: return \"variable\";\n\t}\n}\nfunction getOldVariableObject(variable) {\n\tlet v = void 0;\n\tif (variable.v != null) v = getOldVariableType(variable.v);\n\tlet i = void 0;\n\tif (variable.i != null) i = variable.i;\n\treturn {\n\t\tkey: variable.k,\n\t\t...v && { variable: v },\n\t\t...i && { id: i }\n\t};\n}\nfunction getOldGTProp(dataGT, i) {\n\tlet transformation = void 0;\n\tif (dataGT.t != null) transformation = getOldBranchType(dataGT.t);\n\tlet branches = void 0;\n\tif (dataGT.b != null) branches = Object.fromEntries(Object.entries(dataGT.b).map(([key, value]) => [key, getOldJsxChildren(value)]));\n\treturn {\n\t\tid: i,\n\t\t...transformation && { transformation },\n\t\t...branches && { branches }\n\t};\n}\n//#endregion\n//#region src/backwards-compatability/oldHashJsxChildren.ts\n/**\n* Calculates a unique hash for a given string using SHA-256.\n*\n* @param {string} string - The string to be hashed.\n* @returns {string} The resulting hash as a hexadecimal string.\n*/\nfunction oldHashString(string) {\n\treturn bytesToHex(sha256(utf8ToBytes(string)));\n}\n/**\n* Calculates a unique ID for the given children objects by hashing their sanitized JSON string representation.\n*\n* @param {any} childrenAsObjects - The children objects to be hashed.\n* @param {string} context - The context for the children.\n* @param {string} id - The ID for the JSX children object.\n* @param {function} hashFunction - Custom hash function.\n* @returns {string} - The unique hash of the children.\n*/\nfunction oldHashJsxChildren({ source, context, id, dataFormat }, hashFunction = oldHashString) {\n\treturn hashFunction(stableStringify({\n\t\tsource: sanitizeJsxChildren(source),\n\t\t...id && { id },\n\t\t...context && { context },\n\t\t...dataFormat && { dataFormat }\n\t}));\n}\nconst sanitizeChild = (child) => {\n\tif (child && typeof child === \"object\") {\n\t\tif (\"props\" in child) {\n\t\t\tconst newChild = {};\n\t\t\tconst dataGt = child?.props?.[\"data-_gt\"];\n\t\t\tif (dataGt?.branches) newChild.branches = Object.fromEntries(Object.entries(dataGt.branches).map(([key, value]) => [key, sanitizeJsxChildren(value)]));\n\t\t\tif (child?.props?.children) newChild.children = sanitizeJsxChildren(child.props.children);\n\t\t\tif (child?.props?.[\"data-_gt\"]?.transformation) newChild.transformation = child.props[\"data-_gt\"].transformation;\n\t\t\treturn newChild;\n\t\t}\n\t\tif (\"key\" in child) return {\n\t\t\tkey: child.key,\n\t\t\t...child.variable && { variable: child.variable }\n\t\t};\n\t}\n\treturn child;\n};\nfunction sanitizeJsxChildren(childrenAsObjects) {\n\treturn Array.isArray(childrenAsObjects) ? childrenAsObjects.map(sanitizeChild) : sanitizeChild(childrenAsObjects);\n}\n//#endregion\nexport { VAR_IDENTIFIER, VAR_NAME_IDENTIFIER, condenseVars, declareStatic, declareVar, decode, decodeVars, defaultBaseUrl, defaultCacheUrl, defaultRuntimeApiUrl, defaultTimeout, derive, encode, extractVars, getNewBranchType, getNewGTProp, getNewJsxChild, getNewJsxChildren, getNewJsxElement, getNewVariableObject, getNewVariableType, getOldBranchType, getOldGTProp, getOldJsxChild, getOldJsxChildren, getOldJsxElement, getOldVariableObject, getOldVariableType, _getPluralForm as getPluralForm, indexVars, isAcceptedPluralForm, isNewVariableObject, isOldJsxChildren, isOldVariableObject, isSupportedFileFormatTransform, isVariable, libraryDefaultLocale, minifyVariableType, oldHashJsxChildren, oldHashString, pluralForms, validateFileFormatTransforms };\n\n//# sourceMappingURL=internal.mjs.map","import React, { ReactElement, isValidElement, ReactNode } from 'react';\nimport { isAcceptedPluralForm } from 'generaltranslation/internal';\nimport {\n GTTag,\n TaggedChild,\n TaggedChildren,\n TaggedElement,\n TaggedElementProps,\n} from '../types-dir/types';\nimport {\n Transformation,\n TransformationPrefix,\n VariableTransformationSuffix,\n} from 'generaltranslation/types';\n\ntype GTComponentType = {\n _gtt?: Transformation;\n};\n\nexport default function addGTIdentifier(\n children: ReactNode,\n startingIndex: number = 0\n): TaggedChildren {\n // Object to keep track of the current index for GT IDs\n let index = startingIndex;\n\n /**\n * Function to create a GTTag object for a ReactElement\n * @param child - The ReactElement for which the GTTag is created\n * @returns - The GTTag object\n */\n const createGTTag = (child: ReactElement<Record<string, unknown>>): GTTag => {\n const { type, props } = child;\n index += 1;\n const result: GTTag = { id: index, injectionType: 'manual' };\n let transformation: Transformation | undefined;\n try {\n transformation =\n typeof type === 'function' ? (type as GTComponentType)._gtt : undefined;\n } catch {\n /* empty */\n }\n if (transformation) {\n const transformationParts = transformation.split('-');\n // If the component was inserted automatically by the compiler\n if (\n transformationParts[1] === 'automatic' ||\n transformationParts[2] === 'automatic'\n ) {\n result.injectionType = 'automatic';\n }\n\n if (transformationParts[0] === 'translate') {\n // Convert nested <T> to fragments\n // This will nullify translation specific attributes of child, i.e. id, context, etc.\n transformationParts[0] = 'fragment';\n }\n if (transformationParts[0] === 'variable') {\n result.variableType =\n (transformationParts?.[1] as VariableTransformationSuffix) ||\n 'variable';\n }\n if (transformationParts[0] === 'plural') {\n const pluralBranches = Object.entries(props).reduce(\n (acc, [branchName, branch]) => {\n if (isAcceptedPluralForm(branchName)) {\n (acc as Record<string, TaggedChildren>)[branchName] =\n addGTIdentifier(branch as ReactNode, index);\n }\n return acc;\n },\n {} as Record<string, TaggedChildren>\n );\n if (Object.keys(pluralBranches).length)\n result.branches = pluralBranches;\n }\n if (transformationParts[0] === 'branch') {\n const { children: _children, branch: _branch, ...branches } = props;\n // Filter out data-* attributes injected by build tools\n const filteredBranches = Object.fromEntries(\n Object.entries(branches).filter(([key]) => !key.startsWith('data-'))\n );\n const resultBranches = Object.entries(filteredBranches).reduce(\n (acc, [branchName, branch]) => {\n (acc as Record<string, TaggedChildren>)[branchName] =\n addGTIdentifier(branch as ReactNode, index);\n return acc;\n },\n {} as Record<string, TaggedChildren>\n );\n if (Object.keys(resultBranches).length)\n result.branches = resultBranches;\n }\n result.transformation = transformationParts[0] as TransformationPrefix;\n }\n return result;\n };\n\n function handleSingleChildElement(\n child: ReactElement<Record<string, unknown>>\n ): TaggedElement {\n const { props } = child;\n\n // Create new props for the element, including the GT identifier and a key\n const generaltranslation: GTTag = createGTTag(child);\n const newProps: TaggedElementProps = {\n ...props,\n 'data-_gt': generaltranslation,\n };\n if (props.children && !generaltranslation.variableType) {\n newProps.children = handleChildren(props.children as ReactNode);\n }\n if (child.type === React.Fragment) {\n newProps['data-_gt'].transformation = 'fragment';\n }\n return React.cloneElement(child, newProps) as TaggedElement;\n }\n\n function handleSingleChild(child: ReactNode): TaggedChild {\n if (isValidElement(child)) {\n return handleSingleChildElement(\n child as ReactElement<Record<string, unknown>>\n );\n }\n return child;\n }\n\n function handleChildren(children: ReactNode): TaggedChildren {\n if (Array.isArray(children)) {\n return React.Children.map(children, handleSingleChild);\n } else {\n return handleSingleChild(children);\n }\n }\n\n return handleChildren(children);\n}\n","export const PACKAGE_NAME = '@generaltranslation/react-core';\n","import { getLocaleProperties } from '@generaltranslation/format';\nimport { PACKAGE_NAME } from './constants';\n\n// ---- ERRORS ---- //\n\nexport const projectIdMissingError = `${PACKAGE_NAME} Error: General Translation cloud services require a project ID! Find yours at generaltranslation.com/dashboard.`;\n\nexport const devApiKeyProductionError = `${PACKAGE_NAME} Error: Production environments cannot include a development api key.`;\n\nexport const apiKeyInProductionError = `${PACKAGE_NAME} Error: Production environments cannot include an api key.`;\n\nexport const createNoAuthError = `${PACKAGE_NAME} Error: Configuration is missing a projectId and/or devApiKey. Add these values to your environment or pass them to <GTProvider> directly.`;\n\nexport const createPluralMissingError = (children: unknown) =>\n `${PACKAGE_NAME} Error: <Plural> component with children \"${children}\" requires \"n\" option.`;\n\nexport const createClientSideTDictionaryCollisionError = (id: string) =>\n `${PACKAGE_NAME} Error: <T id=\"${id}\">, \"${id}\" is also used as a key in the dictionary. Don't give <T> components the same ID as dictionary entries.`;\n\nexport const createClientSideTHydrationError = (id: string) =>\n `${PACKAGE_NAME} Error: <T id=\"${id}\"> is used in a client component without a valid saved translation. This can cause hydration errors.` +\n `\\n\\nTo fix this error, consider using a dictionary with useGT() or pushing translations from the command line in advance.`;\n\nexport const dynamicTranslationError = `${PACKAGE_NAME} Error: Fetching batched translations failed`;\n\nexport const createGenericRuntimeTranslationError = (\n id: string | undefined,\n hash: string\n) => {\n if (!id) {\n return `${PACKAGE_NAME} Error: Translation failed for hash: ${hash}`;\n } else {\n return `${PACKAGE_NAME} Error: Translation failed for id: ${id}, hash: ${hash} `;\n }\n};\n\nexport const runtimeTranslationError = `${PACKAGE_NAME} Error: Runtime translation failed: `;\n\nexport const customLoadTranslationsError = (locale: string = '') =>\n `${PACKAGE_NAME} Error: Failed to fetch locally stored translations. If using a custom loadTranslations(${locale}), make sure it is correctly implemented.`;\n\nexport const customLoadDictionaryWarning = (locale: string = '') =>\n `${PACKAGE_NAME} Error: Failed to fetch locally stored dictionary. If using a custom loadDictionary(${locale}), make sure it is correctly implemented.`;\n\nexport const missingVariablesError = (variables: string[], message: string) =>\n `${PACKAGE_NAME} Error: missing variables: \"${variables.join('\", \"')}\" in message: \"${message}\"`;\n\nexport const createStringRenderError = (\n message: string,\n id: string | undefined\n) =>\n `${PACKAGE_NAME} Error: error rendering string ${id ? `for id: \"${id}\"` : ''} original message: \"${message}\"`;\n\nexport const createStringTranslationError = (\n string: string,\n id?: string,\n functionName = 'tx'\n) =>\n `${PACKAGE_NAME} Error: string translation error. ${functionName}(\"${string}\")${\n id ? ` with id \"${id}\"` : ''\n } could not locate translation.`;\n\nexport const invalidLocalesError = (locales: string[]) =>\n `${PACKAGE_NAME} Error: Invalid locale codes in your configuration. ` +\n `Specify a list of valid locales or use \"customMapping\" to ` +\n `define aliases for the following invalid locales: ${locales.join(', ')}.`;\n\nexport const invalidCanonicalLocalesError = (locales: string[]) =>\n `${PACKAGE_NAME} Error: Invalid canonical locale codes in your configuration: ${locales.join(', ')}.`;\n\nexport const createEmptyIdError = () =>\n `${PACKAGE_NAME} Error: You cannot provide an empty id to t.obj()`;\n\nexport const createSubtreeNotFoundError = (id: string) =>\n `${PACKAGE_NAME} Error: Dictionary subtree not found for id: \"${id}\"`;\n\nexport const createDictionaryEntryError = () =>\n `${PACKAGE_NAME} Error: Cannot inject and merge a dictionary entry`;\n\nexport const createCannotInjectDictionaryEntryError = () =>\n `${PACKAGE_NAME} Error: Cannot inject and merge a dictionary entry`;\n\nexport const createInvalidIcuDictionaryEntryError = (id: string | undefined) =>\n `${PACKAGE_NAME} Error: Invalid ICU string dictionary entry found for id: \"${id}\"`;\n\n// ---- WARNINGS ---- //\n\nexport const projectIdMissingWarning = `${PACKAGE_NAME} Warning: Translation cloud services require a project ID! Find yours at generaltranslation.com/dashboard.`;\n\nexport const createNoEntryFoundWarning = (id: string) =>\n `${PACKAGE_NAME} Warning: No valid dictionary entry found for id: \"${id}\"`;\n\nexport const createInvalidDictionaryEntryWarning = (id: string) =>\n `${PACKAGE_NAME} Warning: Invalid dictionary entry found for id: \"${id}\"`;\n\nexport const createInvalidIcuDictionaryEntryWarning = (id: string) =>\n `${PACKAGE_NAME} Warning: Invalid ICU string dictionary entry found for id: \"${id}\"`;\n\nexport const createNoEntryTranslationWarning = (\n id: string,\n prefixedId: string\n) =>\n `${PACKAGE_NAME} Warning: t('${id}') finding no translation for dictionary item ${prefixedId} !`;\n\nexport const createMismatchingHashWarning = (\n expectedHash: string,\n receivedHash: string\n) =>\n `${PACKAGE_NAME} Warning: Mismatching hashes! Expected hash: ${expectedHash}, but got hash: ${receivedHash}. We will still render your translation, but make sure to update to the newest version: generaltranslation.com/docs`;\n\nexport const APIKeyMissingWarn =\n `${PACKAGE_NAME} Warning: A development API key is required for runtime translation! ` +\n `Find your development API key: generaltranslation.com/dashboard. ` +\n `(Or, disable this warning message by setting runtimeUrl to an empty string which disables runtime translation.)`;\n\nexport const createUnsupportedLocalesWarning = (locales: string[]) =>\n `${PACKAGE_NAME} Warning: The following locales are currently unsupported by our service: ${locales\n .map((locale) => {\n const { name } = getLocaleProperties(locale);\n return `${locale} (${name})`;\n })\n .join(', ')}`;\n\nexport const runtimeTranslationTimeoutWarning = `${PACKAGE_NAME} Warning: Runtime translation timed out.`;\n\nexport const createUnsupportedLocaleWarning = (\n validatedLocale: string,\n newLocale: string,\n packageName: string = PACKAGE_NAME\n) => {\n return (\n `${packageName} Warning: \"${newLocale}\" is not a supported locale. ` +\n `Update supported locales in your dashboard or gt.config.json. ` +\n `Falling back to \"${validatedLocale}\".`\n );\n};\n\nexport const dictionaryMissingWarning = `${PACKAGE_NAME} Warning: No dictionary was found. Ensure you are either passing your dictionary to the <GTProvider>.`;\n\nexport const createStringRenderWarning = (\n message: string,\n id: string | undefined\n) =>\n `${PACKAGE_NAME} Warning: failed to render string ${id ? `for id: \"${id}\"` : ''} original message: \"${message}\"`;\n\n// Unlikely edge case: A <_T> component was injected outside of a <Derive> boundary. This would be caused by the compiler overeagerly injecting <_T> components.\nexport const warnNestedInternalTComponent = `${PACKAGE_NAME} Warning: A <_T> component was found injected outside of a <Derive> boundary. This may affect translation resolution for this component.`;\n","import { isAcceptedPluralForm } from 'generaltranslation/internal';\nimport { InjectionType, TransformationPrefix } from 'generaltranslation/types';\nimport {\n ReactNode,\n ReactElement,\n isValidElement,\n cloneElement,\n Children,\n} from 'react';\nimport { warnNestedInternalTComponent } from '../errors-dir/createErrors';\n\n/**\n * Remove injected _T components at runtime. This is only for i18n-context T components to use.\n * This is necessary because when dealing with deriving fragmented content. The compiler will always\n * inject a `_T` component.\n *\n * Only remove if within a `<Derive>` or `<Static>` component as this scopes this behavior\n * to only where it can actually appear.\n */\nexport function removeInjectedT(children: ReactNode): ReactNode {\n return handleChildren(children, 0);\n}\n\n// ----- Core Logic ----- //\n\n/**\n * Traverses a single child element and removes the injected _T component.\n * @param child - The child element to traverse.\n * @param derivationDepth - The depth of the derivation.\n * @returns The traversed child element.\n *\n * Derivation depth is used for tracking whether or not to apply the _T removal transformation.\n *\n * Rules:\n * 1. Variable components (Var, Num, Currency, DateTime) - hands off\n * 2. Branching components (Branch, Plural) - explore respective branches\n * 3. Derivation components (Derive, Static) - add/remove derivation depth\n * 4. Translation components (T) - remove _T if within a derivation context\n * 5. Then move on to processing the element's children\n */\nfunction handleSingleChildElement(\n child: ReactElement,\n derivationDepth: number\n): ReactNode {\n const { type: elementType, props: elementProps } = child;\n const transformation = getTransformation(elementType);\n // unlikely edge case: encountered an element with props that cannot be processed\n if (typeof elementProps !== 'object' || elementProps === null) {\n return child;\n }\n\n if (transformation) {\n const { componentType, injectionType } = transformation;\n\n // (1) If the element is a variable component, hands off\n if (componentType === 'variable') {\n return child;\n }\n\n // (2) If the element is a branching component, explore respective branches\n else if (componentType === 'branch') {\n // Traverse into each branch (this also includes the children property)\n const newProps = Object.entries(elementProps).reduce<\n Record<string, unknown>\n >((acc, [branchName, branch]) => {\n if (branchName !== 'branch' && !branchName.startsWith('data-')) {\n acc[branchName] = handleSingleChild(branch, derivationDepth);\n } else {\n // Skip recursion on non-translated branches\n acc[branchName] = branch;\n }\n return acc;\n }, {});\n\n return cloneElement(child, {\n ...newProps,\n });\n } else if (componentType === 'plural') {\n // Traverse into each branch (this also includes the children property)\n const newProps = Object.entries(elementProps).reduce<\n Record<string, unknown>\n >((acc, [branchName, branch]) => {\n if (isAcceptedPluralForm(branchName) || branchName === 'children') {\n acc[branchName] = handleSingleChild(branch, derivationDepth);\n } else {\n // Skip Recursion on non-translated branches\n acc[branchName] = branch;\n }\n return acc;\n }, {});\n\n return cloneElement(child, {\n ...newProps,\n });\n }\n\n // (3) If the element is a derivation component, add/remove derivation depth\n else if (componentType === 'derive') {\n return cloneElement(child, {\n ...elementProps,\n ...('children' in elementProps && {\n children: handleChildren(\n elementProps.children as ReactNode,\n derivationDepth + 1\n ),\n }),\n });\n }\n\n // (4) If the element is a translation component, remove _T if within a derivation context, just return the children\n else if (\n componentType === 'translate' &&\n injectionType === 'automatic' &&\n derivationDepth > 0\n ) {\n return 'children' in elementProps\n ? handleChildren(elementProps.children as ReactNode, derivationDepth)\n : undefined;\n }\n\n // Note: componentType === 'translate': means that there is a <_T> inside of a <T>/<_T>\n else if (componentType === 'translate' && injectionType === 'automatic') {\n console.warn(warnNestedInternalTComponent);\n }\n }\n\n // (5) Recurse into children\n return cloneElement(child, {\n ...elementProps,\n ...('children' in elementProps && {\n children: handleChildren(\n elementProps.children as ReactNode,\n derivationDepth\n ),\n }),\n });\n}\n\n// ----- Traversal ----- //\n\n/**\n * Traverses a single child react node and removes the injected _T component.\n */\nfunction handleSingleChild(\n child: ReactNode,\n derivationDepth: number\n): ReactNode {\n if (isValidElement(child)) {\n return handleSingleChildElement(child, derivationDepth);\n }\n return child;\n}\n\n/**\n * Traverses an array of children and removes the injected _T component.\n *\n */\nfunction handleChildren(\n children: ReactNode,\n derivationDepth: number\n): ReactNode {\n if (Array.isArray(children)) {\n return Children.map(children, (child) =>\n handleSingleChild(child, derivationDepth)\n );\n }\n return handleSingleChild(children, derivationDepth);\n}\n\n// ----- Helper Functions ----- //\n\n/**\n * Extracts the transformation from the element type.\n * @param elementType - The element type to extract the transformation from.\n * @returns The transformation.\n */\nfunction getTransformation(elementType: ReactElement['type']):\n | {\n componentType: TransformationPrefix;\n injectionType: InjectionType;\n }\n | undefined {\n // Extract transformation string\n const transformation =\n typeof elementType === 'function' && '_gtt' in elementType\n ? elementType._gtt\n : undefined;\n if (transformation == null || typeof transformation !== 'string')\n return undefined;\n\n // Extract metadata from transformation string\n const parts = transformation.split('-');\n const componentType = parts[0] as TransformationPrefix;\n const injectionType =\n parts[1] === 'automatic' || parts[2] === 'automatic'\n ? 'automatic'\n : 'manual';\n\n return {\n componentType,\n injectionType,\n };\n}\n","const defaultVariableNames = {\n variable: 'value',\n number: 'n',\n datetime: 'date',\n currency: 'cost',\n 'relative-time': 'time',\n} as const;\n\nexport const baseVariablePrefix = '_gt_';\n\nexport default function getVariableName(\n props: Record<string, unknown> = {},\n variableType: keyof typeof defaultVariableNames\n): string {\n if (typeof props.name === 'string') return props.name;\n const baseVariableName = defaultVariableNames[variableType] || 'value';\n const gtTag = props['data-_gt'] as { id?: number } | undefined;\n return `${baseVariablePrefix}${baseVariableName}_${gtTag?.id}`;\n}\n","import React from 'react';\nimport { TaggedElement, TaggedElementProps } from '../types-dir/types';\nimport { AuthFromEnvParams, AuthFromEnvReturn } from './types';\nimport { createInternalUsageError } from '../errors-dir/internalErrors';\n\nexport function isValidTaggedElement(target: unknown): target is TaggedElement {\n return React.isValidElement<TaggedElementProps>(target);\n}\n\n/**\n * @deprecated - this function is to always be overridden by a wrapper react package\n */\nexport function readAuthFromEnv(_params: AuthFromEnvParams): AuthFromEnvReturn {\n throw createInternalUsageError('readAuthFromEnv');\n}\n","//#region src/types-dir/jsx/content.ts\n/**\n* Map of data-_gt properties to their corresponding React props\n*/\nconst HTML_CONTENT_PROPS = {\n\tpl: \"placeholder\",\n\tti: \"title\",\n\talt: \"alt\",\n\tarl: \"aria-label\",\n\tarb: \"aria-labelledby\",\n\tard: \"aria-describedby\"\n};\n//#endregion\nexport { HTML_CONTENT_PROPS as t };\n\n//# sourceMappingURL=types-DY1ZTHWr.mjs.map","import getVariableName from '../variables/getVariableName';\nimport { TaggedChild, TaggedChildren, TaggedElement } from '../types-dir/types';\nimport { isValidTaggedElement } from '../utils/utils';\nimport { minifyVariableType } from 'generaltranslation/internal';\nimport {\n GTProp,\n HTML_CONTENT_PROPS,\n HtmlContentPropKeysRecord,\n JsxChild,\n JsxChildren,\n JsxElement,\n Variable,\n} from '@generaltranslation/format/types';\nimport type { Transformation } from 'generaltranslation/types';\n\n/**\n * Gets the tag name of a React element.\n * @param {ReactElement} child - The React element.\n * @returns {string} - The tag name of the React element.\n */\nconst getTagName = (child: TaggedElement): string => {\n if (!child) return '';\n const { type, props } = child;\n if (type && typeof type === 'function') {\n if (\n 'displayName' in type &&\n typeof type.displayName === 'string' &&\n type.displayName\n )\n return type.displayName;\n if ('name' in type && typeof type.name === 'string' && type.name)\n return type.name;\n }\n if (type && typeof type === 'string') return type;\n if (props.href) return 'a';\n if (props['data-_gt']?.id) return `C${props['data-_gt'].id}`;\n return 'function';\n};\nconst createGTProp = (\n transformation: Transformation,\n props: Record<string, unknown>,\n branches?: Record<string, TaggedChildren>\n): GTProp | undefined => {\n // Add translatable HTML content props\n let newGTProp: GTProp = Object.entries(HTML_CONTENT_PROPS).reduce<GTProp>(\n (acc, [minifiedName, fullName]) => {\n const value = props[fullName];\n if (typeof value === 'string') {\n acc[minifiedName as keyof HtmlContentPropKeysRecord] = value;\n }\n return acc;\n },\n {}\n );\n\n // Check if plural\n if (transformation === 'plural' && branches) {\n const newBranches: Record<string, JsxChildren> = {};\n Object.entries(branches).forEach(\n ([key, value]: [string, TaggedChildren]) => {\n newBranches[key] = writeChildrenAsObjects(value);\n }\n );\n newGTProp = { ...newGTProp, b: newBranches, t: 'p' };\n }\n if (transformation === 'branch' && branches) {\n const newBranches: Record<string, JsxChildren> = {};\n Object.entries(branches).forEach(\n ([key, value]: [string, TaggedChildren]) => {\n newBranches[key] = writeChildrenAsObjects(value);\n }\n );\n newGTProp = { ...newGTProp, b: newBranches, t: 'b' };\n }\n\n return Object.keys(newGTProp).length ? newGTProp : undefined;\n};\n\n/**\n * Handles a single child element.\n * @param {TaggedElement} child - The child to handle.\n * @returns {JsxElement | Variable} The minified element.\n */\nconst handleSingleChildElement = (\n child: TaggedElement\n): JsxElement | Variable => {\n const { props } = child;\n const minifiedElement: JsxElement = {\n t: getTagName(child),\n };\n if (props['data-_gt']) {\n // Get generaltranslation props\n const generaltranslation = props['data-_gt'];\n\n // Check if variable\n const transformation = generaltranslation.transformation;\n if (transformation === 'variable') {\n const variableType = generaltranslation.variableType || 'variable';\n const variableName = getVariableName(props, variableType);\n const minifiedVariableType = minifyVariableType(variableType);\n return {\n i: generaltranslation.id,\n k: variableName,\n v: minifiedVariableType,\n };\n }\n\n // Add id\n minifiedElement.i = generaltranslation.id;\n\n // Add GT prop\n minifiedElement.d = createGTProp(\n transformation as Transformation,\n props,\n generaltranslation.branches\n );\n\n // Add translatable HTML content props\n let newGTProp: GTProp = Object.entries(HTML_CONTENT_PROPS).reduce<GTProp>(\n (acc, [minifiedName, fullName]) => {\n const value = props[fullName];\n if (typeof value === 'string') {\n acc[minifiedName as keyof HtmlContentPropKeysRecord] = value;\n }\n return acc;\n },\n {}\n );\n\n // Check if plural\n if (transformation === 'plural' && generaltranslation.branches) {\n const newBranches: Record<string, JsxChildren> = {};\n Object.entries(generaltranslation.branches).forEach(\n ([key, value]: [string, TaggedChildren]) => {\n newBranches[key] = writeChildrenAsObjects(value);\n }\n );\n newGTProp = { ...newGTProp, b: newBranches, t: 'p' };\n }\n if (transformation === 'branch' && generaltranslation.branches) {\n const newBranches: Record<string, JsxChildren> = {};\n Object.entries(generaltranslation.branches).forEach(\n ([key, value]: [string, TaggedChildren]) => {\n newBranches[key] = writeChildrenAsObjects(value);\n }\n );\n newGTProp = { ...newGTProp, b: newBranches, t: 'b' };\n }\n\n minifiedElement.d = Object.keys(newGTProp).length ? newGTProp : undefined;\n }\n if (props.children) {\n minifiedElement.c = writeChildrenAsObjects(props.children);\n }\n return minifiedElement;\n};\n\nconst handleSingleChild = (child: TaggedChild): JsxChild => {\n if (isValidTaggedElement(child)) {\n return handleSingleChildElement(child);\n }\n if (typeof child === 'number') return child.toString();\n return child as JsxChild;\n};\n\n/**\n * Transforms children elements into objects, processing each child recursively if needed.\n * TaggedChildren are transformed into JsxChildren\n * @param {Children} children - The children to process.\n * @returns {object} The processed children as objects.\n */\nexport default function writeChildrenAsObjects(\n children: TaggedChildren\n): JsxChildren {\n const result = Array.isArray(children)\n ? children.map(handleSingleChild)\n : handleSingleChild(children);\n return result;\n}\n","import {\n getPluralForm,\n isAcceptedPluralForm,\n} from 'generaltranslation/internal';\n\n/**\n * Main function to get the appropriate branch based on the provided number and branches.\n *\n * @param {number} n - The number to determine the branch for.\n * @param {any} branches - The object containing possible branches.\n * @returns {any} The determined branch.\n */\nexport default function getPluralBranch(\n n: number,\n locales: string[],\n branches: Record<string, unknown>\n) {\n let branchName = '';\n let branch = null;\n if (typeof n === 'number' && !branch && branches) {\n const pluralForms = Object.keys(branches).filter(isAcceptedPluralForm);\n branchName = getPluralForm(n, pluralForms, locales);\n }\n if (branchName && !branch) branch = branches[branchName];\n return branch;\n}\n","import { Dictionary, DictionaryEntry } from '../types-dir/types';\nimport { get } from './indexDict';\n\nexport function isValidDictionaryEntry(\n value: unknown\n): value is DictionaryEntry {\n if (typeof value === 'string') {\n return true;\n }\n\n if (Array.isArray(value)) {\n if (typeof value?.[0] !== 'string') {\n return false;\n }\n const provisionalMetadata = value?.[1];\n if (typeof provisionalMetadata === 'undefined') return true;\n if (provisionalMetadata && typeof provisionalMetadata === 'object')\n return true;\n }\n\n return false;\n}\n\nexport function getDictionaryEntry<T extends Dictionary>(\n dictionary: T,\n id: string\n): Dictionary | DictionaryEntry | undefined {\n let current: Dictionary | DictionaryEntry = dictionary;\n const dictionaryPath = id.split('.');\n for (const key of dictionaryPath) {\n if (typeof current !== 'object' && !Array.isArray(current)) {\n return undefined;\n }\n current = get(current as Dictionary, key);\n }\n return current;\n}\n","import { DictionaryEntry, MetaEntry } from '../types-dir/types';\n\nexport default function getEntryAndMetadata(value: DictionaryEntry): {\n entry: string;\n metadata?: MetaEntry;\n} {\n if (Array.isArray(value)) {\n if (value.length === 1) {\n return { entry: value[0] };\n }\n if (value.length === 2) {\n return { entry: value[0], metadata: value[1] as MetaEntry };\n }\n }\n return { entry: value };\n}\n","import { VariableTransformationSuffix } from 'generaltranslation/types';\nimport { GTTag, VariableProps } from '../types-dir/types';\nimport getVariableName from './getVariableName';\nimport { minifyVariableType } from 'generaltranslation/internal';\n\ntype VariableElementProps = {\n 'data-_gt': GTTag & {\n transformation: 'variable';\n };\n [key: string]: unknown;\n};\n\nexport function isVariableElementProps(\n props: unknown\n): props is VariableElementProps {\n return (\n typeof props === 'object' &&\n !!props &&\n 'data-_gt' in props &&\n typeof props['data-_gt'] === 'object' &&\n !!props['data-_gt'] &&\n 'transformation' in props['data-_gt'] &&\n props['data-_gt']?.transformation === 'variable'\n );\n}\n\nexport default function getVariableProps(\n props: VariableElementProps\n): VariableProps {\n const variableType: VariableTransformationSuffix =\n props['data-_gt']?.variableType || 'variable';\n\n const result: VariableProps = {\n variableName: getVariableName(props, variableType),\n variableType: minifyVariableType(variableType),\n injectionType: props['data-_gt']?.injectionType || 'manual',\n variableValue: (() => {\n if (typeof props.value !== 'undefined') return props.value;\n if (typeof props.date !== 'undefined') return props.date;\n if (typeof props['data-_gt-unformatted-value'] !== 'undefined')\n return props['data-_gt-unformatted-value'];\n if (typeof props.children !== 'undefined') return props.children;\n return undefined;\n })(),\n variableOptions: (() => {\n const variableOptions = {\n ...(typeof props.currency !== 'undefined' && {\n currency: props.currency,\n }),\n ...(typeof props.unit !== 'undefined' && {\n unit: props.unit,\n }),\n ...(typeof props.baseDate !== 'undefined' && {\n baseDate: props.baseDate,\n }),\n ...(typeof props.options !== 'undefined' && props.options),\n };\n if (Object.keys(variableOptions).length) return variableOptions;\n if (typeof props['data-_gt-variable-options'] === 'string')\n return JSON.parse(props['data-_gt-variable-options']);\n return props['data-_gt-variable-options'] || undefined;\n })(),\n };\n\n return result;\n}\n","import type { Variable } from '@generaltranslation/format/types';\n\nexport default function isVariableObject(obj: unknown): obj is Variable {\n const variableObj = obj as Variable;\n if (\n variableObj &&\n typeof variableObj === 'object' &&\n typeof (variableObj as Variable).k === 'string'\n ) {\n const keys = Object.keys(variableObj);\n if (keys.length === 1) return true;\n if (keys.length === 2) {\n if (typeof variableObj.i === 'number') return true;\n if (typeof variableObj.v === 'string') return true;\n }\n if (keys.length === 3) {\n if (\n typeof variableObj.v === 'string' &&\n typeof variableObj.i === 'number'\n )\n return true;\n }\n }\n return false;\n}\n","import { TaggedElement, GTTag } from '../types-dir/types';\n\nexport default function getGTTag(child: TaggedElement): GTTag | null {\n if (child && child.props && child.props['data-_gt']) {\n return child.props['data-_gt'];\n }\n return null;\n}\n","import React, { ReactNode } from 'react';\nimport getVariableProps, {\n isVariableElementProps,\n} from '../variables/_getVariableProps';\nimport { libraryDefaultLocale } from 'generaltranslation/internal';\nimport getPluralBranch from '../branches/plurals/getPluralBranch';\nimport {\n RenderVariable,\n TaggedChild,\n TaggedChildren,\n TaggedElement,\n} from '../types-dir/types';\nimport getGTTag from './getGTTag';\n\nexport default function renderDefaultChildren({\n children,\n defaultLocale = libraryDefaultLocale,\n renderVariable,\n}: {\n children: TaggedChildren;\n defaultLocale: string;\n renderVariable: RenderVariable;\n}): React.ReactNode {\n const handleSingleChildElement = (child: TaggedElement): ReactNode => {\n const generaltranslation = getGTTag(child);\n\n // Variable\n if (isVariableElementProps(child.props)) {\n const { variableType, variableValue, variableOptions, injectionType } =\n getVariableProps(child.props);\n return renderVariable({\n variableType,\n variableValue,\n variableOptions,\n locales: [defaultLocale],\n injectionType,\n });\n }\n\n // Plural\n if (generaltranslation?.transformation === 'plural') {\n const branches = generaltranslation.branches || {};\n if (typeof child.props.n !== 'number') {\n return child.props.children != null\n ? handleChildren(child.props.children)\n : null;\n }\n const resolvedBranch = getPluralBranch(\n child.props.n,\n [defaultLocale],\n branches\n );\n return handleChildren(\n (resolvedBranch !== null\n ? resolvedBranch\n : child.props.children) as TaggedChildren\n );\n }\n\n // Branch\n if (generaltranslation?.transformation === 'branch') {\n const { children, branch } = child.props;\n const branches = generaltranslation.branches || {};\n const branchKey =\n branch == null || branch === '' ? undefined : branch.toString();\n return handleChildren(\n branchKey && branches[branchKey] !== undefined\n ? branches[branchKey]\n : children\n );\n }\n\n // Fragment\n if (generaltranslation?.transformation === 'fragment') {\n return React.createElement(React.Fragment, {\n key: child.props.key,\n children: handleChildren(child.props.children),\n });\n }\n\n // Default\n if (child.props.children) {\n return React.cloneElement(child, {\n ...child.props,\n 'data-_gt': undefined,\n children: handleChildren(child.props.children) as TaggedChildren,\n });\n }\n return React.cloneElement(child, { ...child.props, 'data-_gt': undefined });\n };\n\n const handleSingleChild = (child: TaggedChild): ReactNode => {\n if (React.isValidElement(child)) {\n return handleSingleChildElement(child);\n }\n return child;\n };\n\n const handleChildren = (children: TaggedChildren): ReactNode => {\n return Array.isArray(children)\n ? React.Children.map(children, handleSingleChild)\n : handleSingleChild(children);\n };\n\n return handleChildren(children);\n}\n","import React, { ReactNode } from 'react';\nimport {\n TaggedChildren,\n TaggedElement,\n TranslatedChildren,\n RenderVariable,\n TranslatedElement,\n VariableProps,\n} from '../types-dir/types';\nimport getVariableProps, {\n isVariableElementProps,\n} from '../variables/_getVariableProps';\nimport renderDefaultChildren from './renderDefaultChildren';\nimport { isVariable, libraryDefaultLocale } from 'generaltranslation/internal';\nimport getPluralBranch from '../branches/plurals/getPluralBranch';\nimport {\n HTML_CONTENT_PROPS,\n HtmlContentPropValuesRecord,\n} from '@generaltranslation/format/types';\nimport getGTTag from './getGTTag';\n\nfunction renderTranslatedElement({\n sourceElement,\n targetElement,\n locales = [libraryDefaultLocale],\n renderVariable,\n}: {\n sourceElement: TaggedElement;\n targetElement: TranslatedElement;\n locales: string[];\n renderVariable: RenderVariable;\n}): React.ReactNode {\n // Get props and generaltranslation\n const { props: sourceProps } = sourceElement;\n const sourceGT = sourceProps['data-_gt'];\n const transformation = sourceGT?.transformation;\n\n // Get translated props\n const unprocessedTargetGT = targetElement.d;\n const translatedProps: HtmlContentPropValuesRecord = {};\n if (unprocessedTargetGT) {\n Object.entries(HTML_CONTENT_PROPS).forEach(([minifiedName, fullName]) => {\n if (\n unprocessedTargetGT[minifiedName as keyof typeof HTML_CONTENT_PROPS]\n ) {\n translatedProps[fullName] = unprocessedTargetGT[\n minifiedName as keyof typeof HTML_CONTENT_PROPS\n ] as string;\n }\n });\n }\n\n // plural (choose a branch)\n if (transformation === 'plural') {\n const n = sourceElement.props.n;\n if (typeof n !== 'number') {\n return renderDefaultChildren({\n children: sourceElement,\n defaultLocale: locales[0],\n renderVariable,\n });\n }\n const sourceBranches = sourceGT.branches || {};\n const resolvedSourceBranch = getPluralBranch(n, locales, sourceBranches);\n const sourceBranch =\n resolvedSourceBranch !== null\n ? resolvedSourceBranch\n : sourceElement.props.children;\n const targetBranches = targetElement.d?.b || {};\n const resolvedTargetBranch = getPluralBranch(n, locales, targetBranches);\n const targetBranch =\n resolvedTargetBranch !== null ? resolvedTargetBranch : targetElement.c;\n return renderTranslatedChildren({\n source: sourceBranch as TaggedChildren,\n target: targetBranch as TranslatedChildren,\n locales,\n renderVariable,\n });\n }\n\n // branch (choose a branch)\n if (transformation === 'branch') {\n const { branch, children } = sourceProps;\n const branchKey =\n branch == null || branch === '' ? undefined : branch.toString();\n const sourceBranches = sourceGT.branches || {};\n const targetBranches = targetElement.d?.b || {};\n const sourceBranch =\n branchKey && sourceBranches[branchKey] !== undefined\n ? sourceBranches[branchKey]\n : children;\n const targetBranch =\n branchKey && targetBranches[branchKey] !== undefined\n ? targetBranches[branchKey]\n : targetElement.c;\n return renderTranslatedChildren({\n source: sourceBranch as TaggedChildren,\n target: targetBranch as TranslatedChildren,\n locales,\n renderVariable,\n });\n }\n\n // fragment (create a valid fragment)\n if (transformation === 'fragment' && targetElement.c) {\n return React.createElement(React.Fragment, {\n key: sourceElement.props.key,\n children: renderTranslatedChildren({\n source: sourceProps.children as TaggedChildren,\n target: targetElement.c,\n locales,\n renderVariable,\n }) as TaggedChildren,\n });\n }\n\n // other\n if (sourceProps?.children && targetElement?.c) {\n return React.cloneElement(sourceElement, {\n ...sourceProps,\n ...translatedProps,\n 'data-_gt': undefined,\n children: renderTranslatedChildren({\n source: sourceProps.children as TaggedChildren,\n target: targetElement.c,\n locales,\n renderVariable,\n }) as TaggedChildren,\n });\n }\n\n // fallback\n return renderDefaultChildren({\n children: sourceElement,\n defaultLocale: locales[0],\n renderVariable,\n });\n}\n\nexport default function renderTranslatedChildren({\n source,\n target,\n locales = [libraryDefaultLocale],\n renderVariable,\n}: {\n source: TaggedChildren;\n target: TranslatedChildren;\n locales: string[];\n renderVariable: RenderVariable;\n}): ReactNode {\n // Most straightforward case, return a valid React node\n if ((target === null || typeof target === 'undefined') && source)\n return renderDefaultChildren({\n children: source,\n defaultLocale: locales[0],\n renderVariable,\n });\n if (typeof target === 'string') return target;\n\n // Convert source to an array in case target has multiple children where source only has one\n if (Array.isArray(target) && !Array.isArray(source) && source)\n source = [source];\n\n // Multiple children\n if (Array.isArray(source) && Array.isArray(target)) {\n // Track the variables\n const variables: Record<string, VariableProps['variableValue']> = {};\n const variablesOptions: Record<string, VariableProps['variableOptions']> =\n {};\n const variableInjectionTypes: Record<\n string,\n VariableProps['injectionType']\n > = {};\n\n // Extract source elements\n // Extract variable props\n // Filter out variable elements\n const sourceElements: TaggedElement[] = source.filter(\n (sourceChild): sourceChild is TaggedElement => {\n if (React.isValidElement(sourceChild)) {\n if (isVariableElementProps(sourceChild.props)) {\n const {\n variableName,\n variableValue,\n variableOptions,\n injectionType,\n } = getVariableProps(sourceChild.props);\n variables[variableName] = variableValue;\n variablesOptions[variableName] = variableOptions;\n variableInjectionTypes[variableName] = injectionType;\n } else {\n return true;\n }\n }\n return false;\n }\n );\n\n // TODO: pre-index these to avoid O(n/2) lookups\n const findMatchingSourceElement = (\n targetElement: TranslatedElement\n ): TaggedElement | undefined => {\n return (\n sourceElements.find((sourceChild): sourceChild is TaggedElement => {\n const generaltranslation = getGTTag(sourceChild);\n if (typeof generaltranslation?.id !== 'undefined') {\n const sourceId = generaltranslation.id;\n const targetId = targetElement.i;\n return sourceId === targetId;\n }\n return false;\n }) || sourceElements.shift()\n ); // assumes fixed order, not recommended\n };\n\n // map target to source\n return target.map((targetChild, index) => {\n if (typeof targetChild === 'string')\n return (\n <React.Fragment key={`string_${index}`}>{targetChild}</React.Fragment>\n );\n\n // Render variable\n if (isVariable(targetChild)) {\n return (\n <React.Fragment key={`var_${index}`}>\n {renderVariable({\n variableType: targetChild.v || 'v',\n variableValue: variables[targetChild.k],\n variableOptions: variablesOptions[targetChild.k],\n locales,\n injectionType: variableInjectionTypes[targetChild.k] || 'manual',\n })}\n </React.Fragment>\n );\n }\n\n // Render element (targetChild is a TranslatedElement)\n const matchingSourceElement = findMatchingSourceElement(\n targetChild as TranslatedElement\n );\n if (!matchingSourceElement) return null;\n return (\n <React.Fragment key={`element_${index}`}>\n {renderTranslatedElement({\n sourceElement: matchingSourceElement,\n targetElement: targetChild,\n locales,\n renderVariable,\n })}\n </React.Fragment>\n );\n });\n }\n\n // Single child\n if (target && typeof target === 'object' && !Array.isArray(target)) {\n const targetType: 'variable' | 'element' = isVariable(target)\n ? 'variable'\n : 'element';\n\n if (React.isValidElement(source)) {\n if (targetType === 'element') {\n return renderTranslatedElement({\n sourceElement: source,\n targetElement: target as TranslatedElement,\n locales,\n renderVariable,\n });\n }\n\n // Render variable\n if (isVariableElementProps(source.props)) {\n const { variableValue, variableOptions, variableType, injectionType } =\n getVariableProps(source.props);\n return renderVariable({\n variableType,\n variableValue,\n variableOptions,\n locales,\n injectionType,\n });\n }\n }\n }\n\n // fallback\n return renderDefaultChildren({\n children: source,\n defaultLocale: locales[0],\n renderVariable,\n });\n}\n","import { RenderMethod } from '../types-dir/types';\n\n// Apply an 8 second timeout for non dev/testing environments\nexport const getDefaultRenderSettings = (\n environment: 'development' | 'production' | 'test' = 'production'\n): {\n method: RenderMethod;\n timeout: number;\n} => ({\n method: 'default',\n timeout: environment === 'development' ? 8000 : 12000,\n});\n","import React from 'react';\n/**\n * renderSkeleton is a function that handles the rendering behavior for the skeleton loading method.\n * It replaces all content with empty strings\n * @returns an empty string\n */\nexport default function renderSkeleton(): React.ReactNode {\n return '';\n}\n","/**\n * Cookie name for tracking the referrer locale\n */\nexport const defaultLocaleCookieName = 'generaltranslation.locale';\n/**\n * Cookie name for tracking the user's selected region\n */\nexport const defaultRegionCookieName = 'generaltranslation.region';\n/**\n * Cookie name for persisting the enableI18n feature flag\n * \"true\" or \"false\"\n */\nexport const defaultEnableI18nCookieName = 'generaltranslation.enable-i18n';\n","import { Dictionary, DictionaryEntry } from '../types-dir/types';\n\n/**\n * Type guard function that checks if a value is a DictionaryEntry\n * @param value - The value to check\n * @returns true if the value is a DictionaryEntry, false otherwise\n */\nexport function isDictionaryEntry(\n value: Dictionary | DictionaryEntry | undefined\n): value is DictionaryEntry {\n if (value === undefined) {\n return false;\n }\n\n // Check if it's a string (Entry)\n if (typeof value === 'string') {\n return true;\n }\n\n // Check if it's an array\n if (Array.isArray(value)) {\n // Must have 1 or 2 elements\n if (value.length !== 1 && value.length !== 2) {\n return false;\n }\n\n // First element must be a string (Entry)\n if (typeof value[0] !== 'string') {\n return false;\n }\n\n // If there's a second element, it must be an object (MetaEntry)\n if (\n value.length === 2 &&\n (typeof value[1] !== 'object' ||\n value[1] === null ||\n (!('$context' in value[1]) &&\n !('$maxChars' in value[1]) &&\n !('$_hash' in value[1])))\n ) {\n return false;\n }\n\n return true;\n }\n\n return false;\n}\n","import { Dictionary, DictionaryEntry } from '../types-dir/types';\nimport { get } from './indexDict';\nimport { isDictionaryEntry } from './isDictionaryEntry';\n\nconst isPrimitiveOrArray = (value: unknown): boolean =>\n typeof value === 'string' || Array.isArray(value);\n\nconst isObjectDictionary = (value: unknown): boolean =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\nexport default function mergeDictionaries(\n defaultLocaleDictionary: Dictionary,\n localeDictionary: Dictionary\n): Dictionary {\n if (Array.isArray(defaultLocaleDictionary)) {\n return defaultLocaleDictionary.map((value, key) => {\n // Merge Dictionary Entry\n if (isDictionaryEntry(value)) {\n return (localeDictionary as (Dictionary | DictionaryEntry)[])[key];\n }\n // Merge Dictionary\n return mergeDictionaries(\n value as Dictionary,\n (localeDictionary as (Dictionary | DictionaryEntry)[])[\n key\n ] as Dictionary\n );\n });\n }\n // Merge primitive and array values\n const mergedDictionary: Dictionary = {\n ...Object.fromEntries(\n Object.entries(defaultLocaleDictionary).filter(([, value]) =>\n isPrimitiveOrArray(value)\n )\n ),\n ...Object.fromEntries(\n Object.entries(localeDictionary).filter(([, value]) =>\n isPrimitiveOrArray(value)\n )\n ),\n };\n\n // Get nested dictionaries\n const defaultDictionaryKeys = Object.entries(defaultLocaleDictionary)\n .filter(([, value]) => isObjectDictionary(value))\n .map(([key]) => key);\n\n const localeDictionaryKeys = Object.entries(localeDictionary)\n .filter(([, value]) => isObjectDictionary(value))\n .map(([key]) => key);\n\n // Merge nested dictionaries recursively\n const allKeys = new Set([...defaultDictionaryKeys, ...localeDictionaryKeys]);\n for (const key of allKeys) {\n mergedDictionary[key] = mergeDictionaries(\n (get(defaultLocaleDictionary, key) || {}) as Dictionary,\n (get(localeDictionary, key) || {}) as Dictionary\n );\n }\n\n return mergedDictionary;\n}\n","import * as React from 'react';\nexport const reactHasUse =\n typeof (React as typeof React & { use?: unknown }).use === 'function';\n","import { Dictionary, DictionaryEntry } from '../types-dir/types';\nimport { get, set } from './indexDict';\n\nexport function getSubtree<T extends Dictionary>({\n dictionary,\n id,\n}: {\n dictionary: T;\n id: string;\n}): Dictionary | DictionaryEntry | undefined {\n if (id === '') {\n return dictionary;\n }\n\n let current: Dictionary | DictionaryEntry = dictionary;\n const dictionaryPath = id.split('.');\n for (const key of dictionaryPath) {\n current = get(current as Dictionary, key);\n }\n return current;\n}\n\n/**\n * @description A function that gets a subtree from a dictionary\n * @param dictionary - new dictionary to get the subtree from\n * @param id - id of the subtree to get\n * @param sourceDictionary - source dictionary to model off of\n * @returns\n */\nexport function getSubtreeWithCreation<T extends Dictionary>({\n dictionary,\n id,\n sourceDictionary,\n}: {\n dictionary: T;\n id: string;\n sourceDictionary: T;\n}): Dictionary | DictionaryEntry | undefined {\n if (id === '') {\n return dictionary;\n }\n\n let current: Dictionary | DictionaryEntry = dictionary;\n const sourceCurrent: Dictionary | DictionaryEntry = sourceDictionary;\n const dictionaryPath = id.split('.');\n for (const key of dictionaryPath) {\n if (get(current as Dictionary, key) === undefined) {\n // We know this wont be type Dictionary because we should have already checked for that\n if (Array.isArray(get(sourceCurrent as Dictionary, key))) {\n set(current as Dictionary, key, [] as Dictionary);\n } else {\n set(current as Dictionary, key, {} as Dictionary);\n }\n }\n current = get(current as Dictionary, key);\n }\n return current;\n}\n","import {\n Dictionary,\n DictionaryEntry,\n TranslatedChildren,\n} from '../types-dir/types';\nimport { get, set } from './indexDict';\nimport { isDictionaryEntry } from './isDictionaryEntry';\n\nconst DANGEROUS_KEYS = ['constructor', 'prototype', '__proto__'];\nfunction isDangerousKey(key: string): boolean {\n if (DANGEROUS_KEYS.includes(key)) {\n return true;\n }\n return false;\n}\n\n/**\n * @description Injects an entry into a translations object\n * @param translations - The translations object to inject the entry into\n * @param entry - The entry to inject\n * @param hash - The hash of the entry\n * @param sourceDictionary - The source dictionary to model the new dictionary after\n */\nexport function injectEntry(\n dictionaryEntry: DictionaryEntry,\n dictionary: Dictionary | DictionaryEntry,\n id: string,\n sourceDictionary: Dictionary | DictionaryEntry\n) {\n // If the dictionary is a DictionaryEntry, return it\n if (isDictionaryEntry(dictionary)) {\n return dictionaryEntry;\n }\n\n // Iterate over all but last key\n const keys = id.split('.');\n keys.forEach((key) => {\n if (isDangerousKey(key)) {\n throw new Error(`Invalid key: ${key}`);\n }\n });\n dictionary ||= {};\n for (const key of keys.slice(0, -1)) {\n // Create new value if it doesn't exist\n if (get(dictionary, key) == null) {\n set(\n dictionary,\n key,\n Array.isArray(get(sourceDictionary as Dictionary, key))\n ? []\n : ({} as Dictionary)\n );\n }\n // Iterate\n dictionary = get(dictionary, key) as Dictionary;\n sourceDictionary = get(sourceDictionary as Dictionary, key) as Dictionary;\n }\n // Inject the entry into the last key\n const lastKey = keys[keys.length - 1];\n set(dictionary, lastKey, dictionaryEntry);\n}\n\n/**\n * @description Merge results into a dictionary\n * @param dictionary - The dictionary to merge the results into\n * @param results - The results to merge into the dictionary\n * @param sourceDictionary - The source dictionary to model the new dictionary after\n * @returns The merged dictionary\n */\nexport function mergeResultsIntoDictionary(\n dictionary: Dictionary,\n results: [string, TranslatedChildren][],\n sourceDictionary: Dictionary\n): Dictionary {\n results.forEach(([id, result]) => {\n injectEntry(result as string, dictionary, id, sourceDictionary);\n });\n return dictionary;\n}\n","import { Dictionary } from '../types-dir/types';\nimport getEntryAndMetadata from './getEntryAndMetadata';\nimport { isDictionaryEntry } from './isDictionaryEntry';\nimport { set } from './indexDict';\n\n/**\n * @description Iterate over tree and remove metadata leaving just the entry\n */\nexport function stripMetadataFromEntries(dictionary: Dictionary): Dictionary {\n let result: Dictionary = {};\n if (Array.isArray(dictionary)) {\n result = [];\n }\n Object.entries(dictionary).forEach(([key, value]) => {\n if (isDictionaryEntry(value)) {\n const { entry } = getEntryAndMetadata(value);\n set(result, key, entry);\n } else {\n set(result, key, stripMetadataFromEntries(value));\n }\n });\n return result;\n}\n","import { n as stableStringify, t as isVariable } from \"./isVariable-fAKEB7gF.mjs\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { bytesToHex, utf8ToBytes } from \"@noble/hashes/utils.js\";\n//#region src/id/hashSource.ts\n/**\n* Calculates a unique hash for a given string using SHA-256.\n*\n* First 16 characters of hash, hex encoded.\n*\n* @param {string} string - The string to be hashed.\n* @returns {string} The resulting hash as a hexadecimal string.\n*/\nfunction hashString(string) {\n\treturn bytesToHex(sha256(utf8ToBytes(string))).slice(0, 16);\n}\n/**\n* Calculates a unique ID for the given children objects by hashing their sanitized JSON string representation.\n*\n* @param {any} childrenAsObjects - The children objects to be hashed.\n* @param {string} [context] - The context for the children.\n* @param {string} [id] - The ID for the JSX children object.\n* @param {number} [maxChars] - The maxChars limit for the JSX children object.\n* @param {string} [dataFormat] - The data format of the sources.\n* @param {function} [hashFunction] - Custom hash function.\n* @returns {string} - The unique hash of the children.\n*/\nfunction hashSource({ source, context, id, maxChars, dataFormat }, hashFunction = hashString) {\n\tlet sanitizedSource;\n\tif (dataFormat === \"JSX\") sanitizedSource = sanitizeJsxChildren(source);\n\telse sanitizedSource = source;\n\treturn hashFunction(stableStringify({\n\t\tsource: sanitizedSource,\n\t\t...id && { id },\n\t\t...context && { context },\n\t\t...maxChars != null && { maxChars: Math.abs(maxChars) },\n\t\t...dataFormat && { dataFormat }\n\t}));\n}\n/**\n* Sanitizes a child object by removing the data-_gt attribute and its branches.\n*\n* @param child - The child object to sanitize.\n* @returns The sanitized child object.\n*\n*/\nconst sanitizeChild = (child) => {\n\tif (child && typeof child === \"object\") {\n\t\tconst newChild = {};\n\t\tif (\"c\" in child && child.c) newChild.c = sanitizeJsxChildren(child.c);\n\t\tif (\"d\" in child) {\n\t\t\tconst generaltranslation = child?.d;\n\t\t\tif (generaltranslation?.b) newChild.b = Object.fromEntries(Object.entries(generaltranslation.b).map(([key, value]) => [key, sanitizeJsxChildren(value)]));\n\t\t\tif (generaltranslation?.t) newChild.t = generaltranslation.t;\n\t\t}\n\t\tif (isVariable(child)) return {\n\t\t\tk: child.k,\n\t\t\t...child.v && { v: child.v }\n\t\t};\n\t\treturn newChild;\n\t}\n\treturn child;\n};\nfunction sanitizeJsxChildren(childrenAsObjects) {\n\treturn Array.isArray(childrenAsObjects) ? childrenAsObjects.map(sanitizeChild) : sanitizeChild(childrenAsObjects);\n}\n//#endregion\n//#region src/id/hashTemplate.ts\nfunction hashTemplate(template, hashFunction = hashString) {\n\treturn hashFunction(stableStringify(template));\n}\n//#endregion\nexport { hashSource as n, hashString as r, hashTemplate as t };\n\n//# sourceMappingURL=id-DEaFhGqX.mjs.map","import { hashSource } from 'generaltranslation/id';\nimport { isDictionaryEntry } from './isDictionaryEntry';\nimport { Dictionary } from '../types-dir/types';\nimport getEntryAndMetadata from './getEntryAndMetadata';\nimport { set } from './indexDict';\nimport { indexVars } from 'generaltranslation/internal';\n\n/**\n * @description Given a dictionary, adds hashes to all dictionary entries\n * @param dictionary - The dictionary to add hashes to\n * @param id - The starting point of dictionary (if subtree)\n */\nexport function injectHashes(\n dictionary: Dictionary,\n id: string = ''\n): { dictionary: Dictionary; updateDictionary: boolean } {\n let updateDictionary = false;\n Object.entries(dictionary).forEach(([key, value]) => {\n const wholeId = id ? `${id}.${key}` : key;\n if (isDictionaryEntry(value)) {\n // eslint-disable-next-line prefer-const\n let { entry, metadata } = getEntryAndMetadata(value);\n if (!metadata?.$_hash) {\n metadata ||= {};\n metadata.$_hash = hashSource({\n source: indexVars(entry),\n ...(metadata?.$context && { context: metadata.$context }),\n ...(metadata?.$maxChars != null && {\n maxChars: Math.abs(metadata.$maxChars),\n }),\n id: wholeId,\n dataFormat: 'ICU',\n });\n set(dictionary, key, [entry, metadata]);\n updateDictionary = true;\n }\n } else {\n const { updateDictionary: updateFlag } = injectHashes(value, wholeId);\n updateDictionary = updateDictionary || updateFlag;\n }\n });\n return { dictionary, updateDictionary };\n}\n","import { Dictionary, Translations } from '../types-dir/types';\nimport { getDictionaryEntry } from './getDictionaryEntry';\nimport getEntryAndMetadata from './getEntryAndMetadata';\nimport { injectEntry } from './injectEntry';\nimport { isDictionaryEntry } from './isDictionaryEntry';\n\n/**\n * @description Injects translations into a dictionary\n * @param dictionary - The dictionary to inject translations into\n * @param translationsDictionary - The translations to inject into the dictionary\n * @param translations - The translations to inject into the dictionary\n * @param id - The id of the dictionary to inject translations into\n */\nexport function injectTranslations(\n dictionary: Dictionary,\n translationsDictionary: Dictionary,\n translations: Translations,\n missingTranslations: {\n source: string;\n metadata: {\n $id: string;\n $context?: string;\n $maxChars?: number;\n $_hash: string;\n };\n }[],\n prefixToRemove: string = ''\n): { dictionary: Dictionary; updateDictionary: boolean } {\n let updateDictionary = false;\n const prefixToRemoveArray = prefixToRemove ? prefixToRemove.split('.') : [];\n missingTranslations.forEach(({ metadata }) => {\n const { $_hash, $id } = metadata;\n\n const id =\n prefixToRemoveArray.length > 0\n ? $id.split('.').slice(prefixToRemoveArray.length).join('.')\n : $id;\n\n // Look up in translations object\n const translationEntry = getDictionaryEntry(translationsDictionary, id);\n // Look up in translations dictionary\n let dictTransEntry = undefined;\n if (isDictionaryEntry(translationEntry))\n dictTransEntry = getEntryAndMetadata(translationEntry).entry;\n // Fall back to what was already in the translations dictionary\n const value = translations[$_hash] || dictTransEntry;\n if (!value) {\n return;\n }\n\n injectEntry(value as string, translationsDictionary, id, dictionary);\n updateDictionary = true;\n });\n return {\n dictionary: translationsDictionary as Dictionary,\n updateDictionary,\n };\n}\n","import { Dictionary } from '../types-dir/types';\nimport { getDictionaryEntry } from './getDictionaryEntry';\nimport getEntryAndMetadata from './getEntryAndMetadata';\nimport { injectEntry } from './injectEntry';\nimport { isDictionaryEntry } from './isDictionaryEntry';\n\n/**\n * @description Injects fallbacks into a dictionary\n * @param dictionary - The dictionary to inject translations into\n * @param translationsDictionary - The translations to inject into the dictionary\n * @param translations - The translations to inject into the dictionary\n * @param id - The id of the dictionary to inject translations into\n */\nexport function injectFallbacks(\n dictionary: Dictionary,\n translationsDictionary: Dictionary,\n missingTranslations: {\n source: string;\n metadata: {\n $id: string;\n $context?: string;\n $maxChars?: number;\n $_hash: string;\n };\n }[],\n prefixToRemove: string = ''\n) {\n const prefixToRemoveArray = prefixToRemove ? prefixToRemove.split('.') : [];\n missingTranslations.forEach(({ source, metadata }) => {\n const { $id } = metadata;\n\n const id =\n prefixToRemoveArray.length > 0\n ? $id.split('.').slice(prefixToRemoveArray.length).join('.')\n : $id;\n\n // Look up in translations object\n const translationEntry = getDictionaryEntry(translationsDictionary, id);\n // Look up in translations dictionary\n let dictTransEntry = undefined;\n if (isDictionaryEntry(translationEntry))\n dictTransEntry = getEntryAndMetadata(translationEntry).entry;\n // Fall back to source\n const value = dictTransEntry || source;\n\n injectEntry(value as string, translationsDictionary, id, dictionary);\n });\n return translationsDictionary;\n}\n","import { Dictionary, DictionaryEntry } from '../types-dir/types';\nimport { getDictionaryEntry } from './getDictionaryEntry';\nimport { getSubtree } from './getSubtree';\nimport { get, set } from './indexDict';\nimport { isDictionaryEntry } from './isDictionaryEntry';\nimport mergeDictionaries from './mergeDictionaries';\nimport {\n createDictionaryEntryError,\n createCannotInjectDictionaryEntryError,\n createSubtreeNotFoundError,\n} from '../errors-dir/createErrors';\n\n/**\n * @description Given a subtree and a dictionary, injects the subtree into the dictionary at the given id\n * @param dictionary - The dictionary to inject the subtree into\n * @param subtree - The subtree to inject into the dictionary\n * @param id - The id of the subtree to inject into the dictionary\n */\nexport function injectAndMerge(\n dictionary: Dictionary,\n subtree: Dictionary,\n id: string\n) {\n const dictionarySubtree = getSubtree({ dictionary, id });\n if (!dictionarySubtree) {\n throw new Error(createSubtreeNotFoundError(id));\n }\n if (isDictionaryEntry(dictionarySubtree)) {\n throw new Error(createDictionaryEntryError());\n }\n const mergedSubtree = mergeDictionaries(\n dictionarySubtree as Dictionary,\n subtree\n );\n // Inject the merged subtree into the dictionary\n return injectSubtree(dictionary, mergedSubtree, id);\n}\n\nfunction injectSubtree(\n dictionary: Dictionary,\n subtree: Dictionary,\n id: string\n) {\n const dictionarySubtree = getDictionaryEntry(dictionary, id);\n if (!dictionarySubtree) {\n throw new Error(createSubtreeNotFoundError(id));\n }\n if (isDictionaryEntry(dictionarySubtree)) {\n throw new Error(createCannotInjectDictionaryEntryError());\n }\n const ids = id.split('.');\n const shortenedId = ids.slice(0, -1);\n const lastId = ids[ids.length - 1];\n let current: Dictionary | DictionaryEntry = dictionary;\n shortenedId.forEach((id) => {\n current = get(current as Dictionary, id);\n });\n set(current as Dictionary, lastId, subtree);\n return dictionary;\n}\n","import { Dictionary } from '../types-dir/types';\nimport getEntryAndMetadata from './getEntryAndMetadata';\nimport { get } from './indexDict';\nimport { isDictionaryEntry } from './isDictionaryEntry';\n\n/**\n * @description Collects all untranslated entries from a dictionary\n * @param dictionary - The dictionary to collect untranslated entries from\n * @param translationsDictionary - The translated dictionary to compare against\n * @param id - The id of the dictionary to collect untranslated entries from\n * @returns An array of untranslated entries\n */\nexport function collectUntranslatedEntries(\n dictionary: Dictionary,\n translationsDictionary: Dictionary,\n id: string = ''\n): {\n source: string;\n metadata: {\n $id: string;\n $context?: string;\n $maxChars?: number;\n $_hash: string;\n };\n}[] {\n const untranslatedEntries: {\n source: string;\n metadata: {\n $id: string;\n $context?: string;\n $maxChars?: number;\n $_hash: string;\n };\n }[] = [];\n Object.entries(dictionary).forEach(([key, value]) => {\n const wholeId = id ? `${id}.${key}` : key;\n if (isDictionaryEntry(value)) {\n const { entry, metadata } = getEntryAndMetadata(value);\n\n if (!get(translationsDictionary, key)) {\n untranslatedEntries.push({\n source: entry,\n metadata: {\n $id: wholeId,\n $context: metadata?.$context,\n $maxChars: metadata?.$maxChars,\n $_hash: metadata?.$_hash || '',\n },\n });\n }\n } else {\n untranslatedEntries.push(\n ...collectUntranslatedEntries(\n value,\n (get(translationsDictionary, key) ||\n (Array.isArray(value) ? [] : {})) as Dictionary,\n wholeId\n )\n );\n }\n });\n return untranslatedEntries;\n}\n","import { VAR_IDENTIFIER, condenseVars, decode, extractVars } from \"generaltranslation/internal\";\nimport { formatCutoff, formatMessage } from \"@generaltranslation/format\";\n//#region src/logs/logger.ts\nvar logger_default = {\n\twarn(message) {\n\t\tconsole.warn(message);\n\t},\n\terror(message) {\n\t\tconsole.error(message);\n\t},\n\tinfo(message) {\n\t\tconsole.info(message);\n\t},\n\tdebug(message) {\n\t\tconsole.debug(message);\n\t}\n};\n//#endregion\n//#region src/utils/extractVariables.ts\n/**\n* Given an object of options, returns an object with no gt-related options\n*\n* TODO: next major version, this should extract any sugar syntax options\n* TODO: next major version, options should be Record<string, string>\n*/\nfunction extractVariables(options) {\n\treturn Object.fromEntries(Object.entries(options).filter(([key]) => key !== \"$id\" && key !== \"$context\" && key !== \"$maxChars\" && key !== \"$hash\" && key !== \"$_hash\" && key !== \"$_source\" && key !== \"$_fallback\" && key !== \"$format\" && key !== \"$_locales\" && key !== \"$locale\"));\n}\n//#endregion\n//#region src/translation-functions/utils/messages.ts\nconst createInterpolationFailureMessage = (message) => `String interpolation failed for message: \"${message}\".`;\n//#endregion\n//#region src/translation-functions/utils/formatMessage.ts\n/**\n* Given an encoded message and variables, formats the message.\n* On error, the original encoded message is returned with a warning.\n* @param encodedMsg\n* @param variables\n* @returns\n*/\nfunction formatMessage$1(encodedMsg, variables, locales, dataFormat) {\n\ttry {\n\t\treturn formatMessage(encodedMsg, {\n\t\t\tvariables,\n\t\t\tlocales,\n\t\t\tdataFormat\n\t\t});\n\t} catch {\n\t\tlogger_default.warn(createInterpolationFailureMessage(encodedMsg));\n\t\treturn encodedMsg;\n\t}\n}\n//#endregion\n//#region src/translation-functions/utils/interpolation/interpolateIcuMessage.ts\n/**\n* Applies string interpolation and cutoff formatting. Fallsback to the original message if interpolation fails.\n* @param {string} message - The message to interpolate.\n* @param {InlineTranslationOptions} options - The options to interpolate.\n* @returns {string} - The interpolated message.\n*/\nfunction interpolateIcuMessage(encodedMsg, options) {\n\tif (!encodedMsg) return encodedMsg;\n\tconst source = options.$_fallback;\n\tconst variables = extractVariables(options);\n\ttry {\n\t\tconst declaredVars = extractVars(source || \"\");\n\t\treturn formatCutoff(formatMessage$1(Object.keys(declaredVars).length ? condenseVars(encodedMsg) : encodedMsg, {\n\t\t\t...variables,\n\t\t\t...declaredVars,\n\t\t\t[VAR_IDENTIFIER]: \"other\"\n\t\t}, options.$locale ?? options.$_locales, options.$format), { maxChars: options.$maxChars });\n\t} catch {\n\t\tlogger_default.warn(createInterpolationFailureMessage(encodedMsg));\n\t\tif (options.$_fallback != null) return interpolateIcuMessage(options.$_fallback, {\n\t\t\t...options,\n\t\t\t$_fallback: void 0\n\t\t});\n\t\treturn formatCutoff(encodedMsg, { maxChars: options.$maxChars });\n\t}\n}\n//#endregion\n//#region src/translation-functions/msg/decodeOptions.ts\n/**\n* Decodes the options from an encoded message.\n* @param encodedMsg The message to decode.\n* @returns The decoded options.\n*/\nfunction decodeOptions(encodedMsg) {\n\tif (encodedMsg.lastIndexOf(\":\") === -1) return null;\n\tconst optionsEncoding = encodedMsg.slice(encodedMsg.lastIndexOf(\":\") + 1);\n\ttry {\n\t\treturn JSON.parse(decode(optionsEncoding));\n\t} catch {\n\t\treturn null;\n\t}\n}\n//#endregion\n//#region src/translation-functions/utils/isEncodedTranslationOptions.ts\n/**\n* Given a decoded options object, validate that includes required decoded options\n* These required options are added by msg() during the encoding process.\n*/\nfunction isEncodedTranslationOptions(decodedOptions) {\n\treturn !!(decodedOptions.$_hash && decodedOptions.$_source);\n}\n//#endregion\nexport { extractVariables as a, createInterpolationFailureMessage as i, decodeOptions as n, logger_default as o, interpolateIcuMessage as r, isEncodedTranslationOptions as t };\n\n//# sourceMappingURL=isEncodedTranslationOptions-BOwWa_-J.mjs.map","import { o as logger_default, r as interpolateIcuMessage } from \"./isEncodedTranslationOptions-BOwWa_-J.mjs\";\nimport { defaultCacheUrl, defaultRuntimeApiUrl, indexVars, libraryDefaultLocale } from \"generaltranslation/internal\";\nimport { LocaleConfig, formatCutoff, isValidLocale, resolveCanonicalLocale, standardizeLocale } from \"@generaltranslation/format\";\nimport { GT } from \"generaltranslation\";\nimport { hashSource } from \"generaltranslation/id\";\n//#region src/i18n-manager/validation/publishValidationResults.ts\n/**\n* Throw errors if there are any errors and log warnings if there are any warnings\n* @param {ValidationResult[]} results - The results to print\n* @param {string} [prefix] - The prefix to add to the results\n* @param {boolean} [throwOnError] - Whether to throw an error if there are any errors\n*\n* TODO: dedupe messages\n* TODO: logging system\n*/\nfunction publishValidationResults(results, prefix = \"\", throwOnError = true) {\n\tresults.forEach((result) => {\n\t\tswitch (result.type) {\n\t\t\tcase \"error\":\n\t\t\t\tlogger_default.error(prefix + result.message);\n\t\t\t\tbreak;\n\t\t\tcase \"warning\":\n\t\t\t\tlogger_default.warn(prefix + result.message);\n\t\t\t\tbreak;\n\t\t}\n\t});\n\tif (throwOnError && results.some((result) => result.type === \"error\")) throw new Error(\"Validation errors occurred\");\n}\n//#endregion\n//#region src/i18n-manager/utils/getLoadTranslationsType.ts\n/**\n* Based on the configurtion return the load translations type\n*\n* cacheUrl = null means disabled\n*/\nfunction getLoadTranslationsType(config) {\n\tif (config.loadTranslations) return \"custom\";\n\telse if (config.cacheUrl) return \"remote\";\n\telse if ((config.cacheUrl === void 0 || config.cacheUrl === defaultCacheUrl) && config.projectId) return \"gt-remote\";\n\telse return \"disabled\";\n}\n//#endregion\n//#region src/i18n-manager/validation/config-validation/validateLoadTranslations.ts\n/**\n* Load translation configuration\n*\n* Types of load translations:\n* - GT_REMOTE: use the default remote store URL {@link defaultCacheUrl}\n* - REMOTE: use a custom remote store URL\n* - CUSTOM: use a custom translations loader\n* - DISABLED: no translations loading\n*\n* Requirements:\n* - REMOTE:\n* - GT_REMOTE:\n* - projectId is required\n* - CUSTOM:\n* - loadTranslations is required\n* - DISABLED:\n* - no requirements\n*/\nfunction validateLoadTranslations(params) {\n\tconst results = [];\n\tconst { projectId, loadTranslations } = params;\n\tswitch (getLoadTranslationsType(params)) {\n\t\tcase \"remote\":\n\t\tcase \"gt-remote\":\n\t\t\tif (!projectId) results.push({\n\t\t\t\ttype: \"warning\",\n\t\t\t\tmessage: \"projectId is required when loading translations from a remote store\"\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"custom\":\n\t\t\tif (!loadTranslations) results.push({\n\t\t\t\ttype: \"error\",\n\t\t\t\tmessage: \"loadTranslations is required when loading translations from a custom loader\"\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"disabled\": break;\n\t}\n\treturn results;\n}\n//#endregion\n//#region src/i18n-manager/utils/getTranslationApiType.ts\n/**\n* Based on the configurtion return the runtime translation type\n* @param params - The parameters to validate\n* @returns The runtime translation type\n*/\nfunction getTranslationApiType(params) {\n\tif ((params.runtimeUrl === void 0 || params.runtimeUrl === defaultRuntimeApiUrl) && params.projectId && (params.devApiKey || params.apiKey)) return \"gt\";\n\telse if (params.runtimeUrl) return \"custom\";\n\telse return \"disabled\";\n}\n//#endregion\n//#region src/i18n-manager/validation/config-validation/validateTranslationApi.ts\n/**\n* Validate the translation API configuration\n* @param params - The parameters to validate\n* @returns The validation results\n*\n* Types of translation API:\n* - GT: use the default runtime API URL {@link defaultRuntimeApiUrl}\n* - CUSTOM: use a custom runtime API URL\n* - DISABLED: no runtime API translation\n*\n* Requirements:\n* - CUSTOM:\n* - GT:\n* - projectId is required\n* - devApiKey or apiKey is required\n* - DISABLED:\n* - no requirements\n*\n* TODO: reject dev api key in production\n*/\nfunction validateTranslationApi(params) {\n\tconst results = [];\n\tswitch (getTranslationApiType(params)) {\n\t\tcase \"custom\":\n\t\tcase \"gt\":\n\t\t\tif (!params.projectId) results.push({\n\t\t\t\ttype: \"warning\",\n\t\t\t\tmessage: \"projectId is required\"\n\t\t\t});\n\t\t\tif (!params.devApiKey && !params.apiKey) results.push({\n\t\t\t\ttype: \"warning\",\n\t\t\t\tmessage: \"devApiKey or apiKey is required\"\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"disabled\": break;\n\t}\n\treturn results;\n}\n//#endregion\n//#region src/i18n-manager/utils/getGTServicesEnabled.ts\n/**\n* Returns true if GT services are enabled\n* @param config - The configuration\n* @returns True if GT services are enabled\n*/\nfunction getGTServicesEnabled(config) {\n\treturn getLoadTranslationsType(config) === \"gt-remote\" || getTranslationApiType(config) === \"gt\";\n}\n//#endregion\n//#region src/i18n-manager/validation/config-validation/validateLocales.ts\n/**\n* Validate the locales configuration\n* @param params - The parameters to validate\n* @returns The validation results\n*\n* Only apply if using GT services\n*/\nfunction validateLocales(params) {\n\tconst results = [];\n\tif (!getGTServicesEnabled(params)) return results;\n\tconst { defaultLocale, locales, customMapping } = params;\n\tnew Set([...defaultLocale ? [defaultLocale] : [], ...locales || []]).forEach((locale) => {\n\t\tif (!isValidLocale(locale, customMapping)) results.push({\n\t\t\ttype: \"error\",\n\t\t\tmessage: `Invalid locale: ${locale}`\n\t\t});\n\t});\n\treturn results;\n}\n//#endregion\n//#region src/i18n-manager/validation/config-validation/validateDictionary.ts\n/**\n* Dictionary configuration\n*\n* Requirements:\n* - loadDictionary requires dictionary so the default locale always has a source dictionary\n*/\nfunction validateDictionary(params) {\n\tconst results = [];\n\tif (params.loadDictionary && !params.dictionary) results.push({\n\t\ttype: \"error\",\n\t\tmessage: \"dictionary is required when loadDictionary is provided\"\n\t});\n\treturn results;\n}\n//#endregion\n//#region src/i18n-manager/validation/validateConfig.ts\n/**\n* Validate the configuration\n* @param config - The configuration to validate\n* @returns The validation results\n*/\nfunction validateConfig(config) {\n\tconst results = [];\n\tresults.push(...validateLoadTranslations(config));\n\tresults.push(...validateTranslationApi(config));\n\tresults.push(...validateLocales(config));\n\tresults.push(...validateDictionary(config));\n\treturn results;\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/utils/createTranslateMany.ts\n/**\n* Create a translate many function\n* @param locale - The locale\n* @returns The translate many function\n*/\nfunction createTranslateManyFactory(gtInstance, timeout, metadata = {}) {\n\treturn (locale) => (sources) => gtInstance.translateMany(sources, {\n\t\t...metadata,\n\t\ttargetLocale: locale\n\t}, timeout);\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/translations-loaders/createRemoteTranslationLoader.ts\n/**\n* Creates a translations loader function that loads translations from a remote store (CDN or other)\n* @param params - The parameters for the createRemoteTranslationLoader function\n* @returns A translations loader function\n*\n* TODO: validate projectId, cacheUrl, _versionId, _branchId\n*/\nfunction createRemoteTranslationLoader(params) {\n\tconst unlocalizedUrl = generateUrl(params);\n\tconst loader = async (locale) => {\n\t\tlocale = resolveCanonicalLocale(locale, params.customMapping);\n\t\tconst url = unlocalizedUrl.replace(\"[locale]\", locale);\n\t\tconst response = await fetch(url);\n\t\tif (!response.ok) throw new Error(`Failed to load translations from ${url}`);\n\t\treturn await response.json();\n\t};\n\treturn loader;\n}\n/**\n* Generate a URL for a translations file\n*/\nfunction generateUrl(params) {\n\tconst { cacheUrl = defaultCacheUrl, projectId, _versionId, _branchId } = params;\n\tconst versionIdSegment = _versionId ? `/${_versionId}` : \"\";\n\tconst branchIdQuery = _branchId ? `?branchId=${_branchId}` : \"\";\n\treturn `${cacheUrl}/${projectId}/[locale]` + versionIdSegment + branchIdQuery;\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/translations-loaders/createFallbackTranslationLoader.ts\n/**\n* Creates a fallback translations loader function that loads translations from a fallback source\n* @returns A translations loader function\n*/\nfunction createFallbackTranslationLoader() {\n\tconst loader = async (_locale) => {\n\t\treturn {};\n\t};\n\treturn loader;\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/translations-loaders/routeCreateTranslationLoader.ts\n/**\n* Creates a translation loader function that loads translations from a remote store (CDN or other)\n* @param params - The parameters for the createTranslationLoader function\n* @param params.type - The type of translation loader to create\n* @param params.remoteTranslationLoaderParams - The parameters for the remote translation loader\n* @param params.loadTranslations - The custom translations loader function\n* @returns A translation loader function\n*/\nfunction routeCreateTranslationLoader({ type, remoteTranslationLoaderParams, loadTranslations }) {\n\tif (type === \"disabled\") logger_default.warn(\"I18nManager: No translation loader found. No translations will be loaded.\");\n\tconst { cacheUrl, projectId, _versionId, _branchId, customMapping } = remoteTranslationLoaderParams;\n\tswitch (type) {\n\t\tcase \"remote\":\n\t\tcase \"gt-remote\": return createRemoteTranslationLoader({\n\t\t\tcacheUrl,\n\t\t\tprojectId: projectId || \"\",\n\t\t\t_versionId,\n\t\t\t_branchId,\n\t\t\tcustomMapping\n\t\t});\n\t\tcase \"custom\": return loadTranslations;\n\t\tcase \"disabled\": return createFallbackTranslationLoader();\n\t}\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/Cache.ts\nfunction isPlainObject(value) {\n\tif (value == null || typeof value !== \"object\") return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === Object.prototype || prototype === null;\n}\nfunction copyCacheValue(value) {\n\tif (Array.isArray(value)) return [...value];\n\tif (isPlainObject(value)) return { ...value };\n\treturn value;\n}\n/**\n* Cache class\n* This is designed in such a way that it is the responsibility of the client\n* to invoke the cache miss method when a cache miss occurs.\n*\n* TODO: maybe add \"OutputValue\" as a reflection of \"InputKey\"\n*/\nvar Cache = class {\n\t/**\n\t* Constructor\n\t* @param {Object} params - The parameters for the cache\n\t* @param {Record<CacheKey, CacheValue>} params.init - The initial cache\n\t* @param {CacheLifecycle} [lifecycle] - Optional lifecycle callbacks\n\t*/\n\tconstructor(init, lifecycle) {\n\t\tthis.cache = {};\n\t\tthis.fallbackPromises = {};\n\t\tthis.cache = structuredClone(init);\n\t\tthis.onHit = lifecycle?.onHit;\n\t\tthis.onMiss = lifecycle?.onMiss;\n\t}\n\t/**\n\t* Set the value for a key\n\t*/\n\tsetCache(cacheKey, value) {\n\t\tthis.cache[cacheKey] = value;\n\t}\n\t/**\n\t* Look up the key\n\t*/\n\tgetCache(key) {\n\t\tconst cacheKey = this.genKey(key);\n\t\treturn this.cache[cacheKey];\n\t}\n\t/**\n\t* Get the internal cache\n\t* @returns The internal cache\n\t*\n\t* @internal - used by gt-tanstack-start\n\t*/\n\tgetInternalCache() {\n\t\treturn Object.fromEntries(Object.entries(this.cache).map(([key, value]) => [key, copyCacheValue(value)]));\n\t}\n\t/**\n\t* Get the mutable cache for subclasses that need custom read/write behavior.\n\t*/\n\tgetMutableCache() {\n\t\treturn this.cache;\n\t}\n\t/**\n\t* Fallback to the value from the fallback function on a cache miss\n\t* @important assumes that the fallback error handling done upstream\n\t*/\n\tasync missCache(...args) {\n\t\tconst key = args[0];\n\t\tconst cacheKey = this.genKey(key);\n\t\tif (this.fallbackPromises[cacheKey] !== void 0) return await this.fallbackPromises[cacheKey];\n\t\tconst fallbackPromise = this.fallback(...args);\n\t\tthis.fallbackPromises[cacheKey] = fallbackPromise;\n\t\ttry {\n\t\t\tconst value = await fallbackPromise;\n\t\t\tthis.setCache(cacheKey, value);\n\t\t\treturn value;\n\t\t} finally {\n\t\t\tdelete this.fallbackPromises[cacheKey];\n\t\t}\n\t}\n};\n//#endregion\n//#region src/utils/hashMessage.ts\n/**\n* Hash a message string\n*/\nfunction hashMessage(message, options) {\n\tconst metadataOptions = options;\n\tif (metadataOptions.$_hash != null) return metadataOptions.$_hash;\n\treturn hashSource({\n\t\tsource: options.$format === \"ICU\" ? indexVars(message) : message,\n\t\t...metadataOptions.$context && { context: metadataOptions.$context },\n\t\t...metadataOptions.$id && { id: metadataOptions.$id },\n\t\t...metadataOptions.$maxChars != null && { maxChars: Math.abs(metadataOptions.$maxChars) },\n\t\tdataFormat: options.$format\n\t});\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/TranslationsCache.ts\nconst DEFAULT_BATCH_CONFIG = {\n\tmaxConcurrentRequests: 100,\n\tmaxBatchSize: 25,\n\tbatchInterval: 50\n};\nfunction getPositiveValue(value, defaultValue) {\n\tif (value === void 0 || !Number.isFinite(value) || value <= 0) return defaultValue;\n\treturn value;\n}\nfunction getPositiveInteger(value, defaultValue) {\n\tif (value === void 0 || !Number.isFinite(value)) return defaultValue;\n\tconst integer = Math.trunc(value);\n\treturn integer > 0 ? integer : defaultValue;\n}\nfunction normalizeBatchConfig(batchConfig) {\n\treturn {\n\t\tmaxConcurrentRequests: getPositiveInteger(batchConfig?.maxConcurrentRequests, DEFAULT_BATCH_CONFIG.maxConcurrentRequests),\n\t\tmaxBatchSize: getPositiveInteger(batchConfig?.maxBatchSize, DEFAULT_BATCH_CONFIG.maxBatchSize),\n\t\tbatchInterval: getPositiveValue(batchConfig?.batchInterval, DEFAULT_BATCH_CONFIG.batchInterval)\n\t};\n}\n/**\n* A cache for a single locale's translations\n*\n* Principles:\n* - This class is language agnostic, and should never store the locale code as a parameter.\n* Locale logic is handled at the LocalesCache level. Use a callback function that has the\n* locale parameter embedded if you wish to use the locale code.\n*/\nvar TranslationsCache = class extends Cache {\n\t/**\n\t* Constructor\n\t* @param {Object} params - The parameters for the cache\n\t* @param {Record<Hash, TranslationValue>} params.init - The initial cache\n\t* @param {Function} params.fallback - Get the fallback value for a cache miss\n\t*/\n\tconstructor({ init, translateMany, lifecycle, batchConfig }) {\n\t\tsuper(init, lifecycle);\n\t\tthis._queue = [];\n\t\tthis._batchTimer = null;\n\t\tthis._activeRequests = 0;\n\t\tthis._translateMany = translateMany;\n\t\tthis._batchConfig = normalizeBatchConfig(batchConfig);\n\t}\n\t/**\n\t* Get the translation value for a given key\n\t* @param key - The translation key\n\t* @returns The translation value\n\t*/\n\tget(key) {\n\t\tconst value = this.getCache(key);\n\t\tif (value != null && this.onHit) this.onHit({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: value,\n\t\t\toutputValue: value\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Miss the cache\n\t* @param key - The translation key\n\t* @returns The translation value\n\t*/\n\tasync miss(key) {\n\t\tconst value = await this.missCache(key);\n\t\tif (value != null && this.onMiss) this.onMiss({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: value,\n\t\t\toutputValue: value\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Generate a key for the cache\n\t* @param key - The translation key\n\t* @returns The key\n\t*/\n\tgenKey(key) {\n\t\treturn hashMessage(key.message, key.options);\n\t}\n\t/**\n\t* Get the fallback value for a cache miss\n\t* @param key - The translation key\n\t* @returns The fallback value\n\t*/\n\tfallback(key) {\n\t\tconst translationPromise = this._enqueueTranslation(key);\n\t\tif (this._queue.length >= this._batchConfig.maxBatchSize) this._flushNow();\n\t\telse this._scheduleBatch();\n\t\treturn translationPromise;\n\t}\n\t/**\n\t* Flush the queue now\n\t*/\n\t_flushNow() {\n\t\tif (this._batchTimer) {\n\t\t\tclearTimeout(this._batchTimer);\n\t\t\tthis._batchTimer = null;\n\t\t}\n\t\tthis._drainQueue();\n\t}\n\t/**\n\t* Schedule a batch of translations\n\t*/\n\t_scheduleBatch() {\n\t\tif (this._batchTimer) return;\n\t\tthis._batchTimer = setTimeout(() => {\n\t\t\tthis._batchTimer = null;\n\t\t\tthis._drainQueue();\n\t\t}, this._batchConfig.batchInterval);\n\t}\n\t/**\n\t* Drain the queue\n\t*/\n\t_drainQueue() {\n\t\twhile (this._queue.length > 0 && this._activeRequests < this._batchConfig.maxConcurrentRequests) {\n\t\t\tconst batch = this._queue.splice(0, this._batchConfig.maxBatchSize);\n\t\t\tthis._sendBatchRequest(batch);\n\t\t}\n\t\tif (this._queue.length > 0) this._scheduleBatch();\n\t}\n\t/**\n\t* Enqueue translation request and return a promise that resolves when the translation is ready\n\t* @param {TranslationKey<TranslationValue>} key - The translation key\n\t* @returns {Promise<TranslationValue>} The translation promise\n\t*/\n\t_enqueueTranslation(key) {\n\t\tconst hash = this.genKey(key);\n\t\tconst options = key.options;\n\t\tconst metadataOptions = options;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis._queue.push({\n\t\t\t\tkey: hash,\n\t\t\t\tsource: key.message,\n\t\t\t\tmetadata: {\n\t\t\t\t\thash,\n\t\t\t\t\t...metadataOptions.$context && { context: metadataOptions.$context },\n\t\t\t\t\t...metadataOptions.$id && { id: metadataOptions.$id },\n\t\t\t\t\t...metadataOptions.$maxChars != null && { maxChars: Math.abs(metadataOptions.$maxChars) },\n\t\t\t\t\tdataFormat: options.$format\n\t\t\t\t},\n\t\t\t\tresolve: (value) => resolve(value),\n\t\t\t\treject\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t* Send a batch request for translations\n\t* @param {QueueEntry<TranslationValue>[]} batch - The batch of requests to send\n\t*/\n\tasync _sendBatchRequest(batch) {\n\t\tthis._activeRequests++;\n\t\tconst requests = convertBatchToTranslateManyParams(batch);\n\t\tconst response = await this._sendBatchRequestWithErrorHandling(batch, requests);\n\t\tif (response) this._handleTranslationResponse(batch, response);\n\t\tthis._activeRequests--;\n\t}\n\t/**\n\t* Send a translation request with error handling\n\t*/\n\tasync _sendBatchRequestWithErrorHandling(batch, requests) {\n\t\ttry {\n\t\t\treturn await this._translateMany(requests);\n\t\t} catch (error) {\n\t\t\tfor (const entry of batch) entry.reject(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Handle a translation response\n\t*/\n\t_handleTranslationResponse(batch, response) {\n\t\tfor (const entry of batch) {\n\t\t\tconst { key } = entry;\n\t\t\tconst result = response[key];\n\t\t\tif (result && result.success) {\n\t\t\t\tconst translation = result.translation;\n\t\t\t\tthis.setCache(key, translation);\n\t\t\t\tentry.resolve(translation);\n\t\t\t} else entry.reject(result?.error);\n\t\t}\n\t}\n};\n/**\n* Convert a TranslationKey to a TranslateManyEntry\n*/\nfunction convertBatchToTranslateManyParams(batch) {\n\treturn batch.reduce((acc, entry) => {\n\t\tacc[entry.key] = {\n\t\t\tsource: entry.source,\n\t\t\tmetadata: entry.metadata\n\t\t};\n\t\treturn acc;\n\t}, {});\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/utils/constants.ts\n/**\n* Default cache expiry time in milliseconds\n*/\nconst DEFAULT_CACHE_EXPIRY_TIME = 6e4;\n//#endregion\n//#region src/i18n-manager/translations-manager/LocalesCache.ts\n/**\n* Cache for looking up translations by locale\n*/\nvar LocalesCache = class extends Cache {\n\t/**\n\t* Constructor\n\t* @param {Object} params - The parameters for the cache\n\t* @param {Record<string, CacheEntry<TranslationValue>>} params.init - The initial cache\n\t* @param {number | null} params.ttl - The time to live for cache entries\n\t* @param {SafeTranslationsLoader<TranslationValue>} params.loadTranslations - The translation loader function\n\t* @param {CreateTranslateMany} params.createTranslateMany - Factory function for creating a translate many function\n\t*/\n\tconstructor({ init = {}, ttl, batchConfig, loadTranslations, createTranslateMany, lifecycle: { onLocalesCacheHit: onHit, onLocalesCacheMiss: onMiss, onTranslationsCacheHit, onTranslationsCacheMiss } }) {\n\t\tsuper(init, {\n\t\t\tonHit,\n\t\t\tonMiss\n\t\t});\n\t\tthis.ttl = DEFAULT_CACHE_EXPIRY_TIME;\n\t\tthis.ttl = ttl === null ? -1 : ttl ?? 6e4;\n\t\tthis._translationLoader = loadTranslations;\n\t\tthis._createTranslateMany = createTranslateMany;\n\t\tthis._batchConfig = batchConfig;\n\t\tthis._onTranslationsCacheHit = onTranslationsCacheHit;\n\t\tthis._onTranslationsCacheMiss = onTranslationsCacheMiss;\n\t}\n\t/**\n\t* Get the translations for a given locale\n\t* @param key - The locale\n\t* @returns The translations\n\t*/\n\tget(key) {\n\t\tconst entry = this.getCache(key);\n\t\tif (!entry || entry.expiresAt > 0 && entry.expiresAt < Date.now()) return;\n\t\tconst value = entry.translationsCache;\n\t\tif (value != null && this.onHit) this.onHit({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: entry,\n\t\t\toutputValue: value\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Miss the cache\n\t* @param key - The locale\n\t* @returns The translations cache\n\t*/\n\tasync miss(key) {\n\t\tconst cacheValue = await this.missCache(key);\n\t\tconst value = cacheValue.translationsCache;\n\t\tif (value != null && this.onMiss) this.onMiss({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue,\n\t\t\toutputValue: value\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Generate the cache key for a given locale\n\t* @param key - The locale\n\t* @returns The cache key\n\t*\n\t* This is just an identity function, no transformation needed\n\t*/\n\tgenKey(key) {\n\t\treturn key;\n\t}\n\t/**\n\t* Fallback for a cache miss\n\t* @param locale - The locale\n\t* @returns The cache entry\n\t*/\n\tasync fallback(locale) {\n\t\treturn {\n\t\t\ttranslationsCache: new TranslationsCache({\n\t\t\t\tinit: await this._translationLoader(locale),\n\t\t\t\tlifecycle: this._createTranslationsCacheLifecycle(locale),\n\t\t\t\ttranslateMany: this._createTranslateMany(locale),\n\t\t\t\tbatchConfig: this._batchConfig\n\t\t\t}),\n\t\t\texpiresAt: this.ttl < 0 ? this.ttl : Date.now() + this.ttl\n\t\t};\n\t}\n\t/**\n\t* Create the translations cache lifecycle\n\t* @param locale - The locale\n\t* @returns The translations cache lifecycle\n\t*/\n\t_createTranslationsCacheLifecycle(locale) {\n\t\treturn {\n\t\t\tonHit: this._onTranslationsCacheHit ? (params) => this._onTranslationsCacheHit({\n\t\t\t\tlocale,\n\t\t\t\t...params\n\t\t\t}) : void 0,\n\t\t\tonMiss: this._onTranslationsCacheMiss ? (params) => this._onTranslationsCacheMiss({\n\t\t\t\tlocale,\n\t\t\t\t...params\n\t\t\t}) : void 0\n\t\t};\n\t}\n};\n//#endregion\n//#region src/i18n-manager/translations-manager/utils/dictionary-helpers.ts\nfunction getDictionaryPath(id) {\n\tif (!id) return [];\n\treturn id.split(\".\");\n}\nfunction isDictionaryValue(value) {\n\treturn typeof value === \"object\" && value != null && !Array.isArray(value);\n}\nfunction getDictionaryEntry(value) {\n\tif (!isDictionaryLeafNode(value)) return;\n\treturn {\n\t\tentry: Array.isArray(value) ? value[0] : value,\n\t\toptions: Array.isArray(value) ? value[1] ?? {} : {}\n\t};\n}\nfunction getDictionaryValue(value) {\n\tif (Object.keys(value.options).length === 0) return value.entry;\n\treturn [value.entry, value.options];\n}\nfunction resolveDictionaryLookupOptions(options) {\n\tconst { $format, ...rest } = options;\n\treturn {\n\t\t...rest,\n\t\t$format: isStringFormat($format) ? $format : \"ICU\",\n\t\t...rest.$context === void 0 && typeof rest.context === \"string\" && { $context: rest.context }\n\t};\n}\nfunction isDictionaryLeafNode(value) {\n\tif (typeof value === \"string\") return true;\n\tif (!Array.isArray(value) || typeof value[0] !== \"string\") return false;\n\tif (value.length === 1) return true;\n\treturn value.length === 2 && isDictionaryOptions(value[1]);\n}\nfunction isDictionaryOptions(value) {\n\tif (typeof value !== \"object\" || value == null || Array.isArray(value)) return false;\n\tconst options = value;\n\treturn (options.$context === void 0 || typeof options.$context === \"string\") && (options.$format === void 0 || isStringFormat(options.$format)) && (options.$maxChars === void 0 || typeof options.$maxChars === \"number\") && (options.context === void 0 || typeof options.context === \"string\");\n}\nfunction isStringFormat(value) {\n\treturn value === \"ICU\" || value === \"I18NEXT\" || value === \"STRING\";\n}\nfunction replaceDictionary(target, source) {\n\tfor (const key of Object.keys(target)) delete target[key];\n\tObject.assign(target, source);\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/utils/DictionarySourceNotFoundError.ts\nvar DictionarySourceNotFoundError = class extends Error {\n\tconstructor(id) {\n\t\tsuper(`I18nManager: source dictionary entry ${id} is not defined`);\n\t\tthis.name = \"DictionarySourceNotFoundError\";\n\t}\n};\n//#endregion\n//#region src/i18n-manager/translations-manager/DictionaryCache.ts\n/**\n* A cache for a single locale's dictionary\n*\n* Principles:\n* - This class is language agnostic, and should never store the locale code as a parameter.\n* Locale logic is handled at the LocalesDictionaryCache level. Use a callback function\n* that has the locale parameter embedded if you wish to use the locale code.\n*/\nvar DictionaryCache = class extends Cache {\n\t/**\n\t* Constructor\n\t* @param {Object} params - The parameters for the cache\n\t* @param {Dictionary} params.init - The initial cache\n\t*/\n\tconstructor({ init, lifecycle, runtimeTranslate }) {\n\t\tsuper(init, lifecycle);\n\t\tthis._runtimeTranslate = runtimeTranslate;\n\t\tthis.onHitObj = lifecycle?.onHitObj;\n\t\tthis.onMissObj = lifecycle?.onMissObj;\n\t}\n\t/**\n\t* Get the dictionary value for a given key\n\t* @param key - The dictionary key\n\t* @returns The dictionary value\n\t*/\n\tget(key) {\n\t\tconst value = this.getCache(key);\n\t\tconst entry = getDictionaryEntry(value);\n\t\tif (entry === void 0) return;\n\t\tif (this.onHit) this.onHit({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: value,\n\t\t\toutputValue: entry\n\t\t});\n\t\treturn entry;\n\t}\n\tset(key, value) {\n\t\tconst dictionaryValue = getDictionaryValue(value);\n\t\tthis.setCache(this.genKey(key), dictionaryValue);\n\t}\n\tgetObj(key) {\n\t\tconst value = this.getCache(key);\n\t\tif (value === void 0) return;\n\t\tconst outputValue = structuredClone(value);\n\t\tif (this.onHitObj) this.onHitObj({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: value,\n\t\t\toutputValue\n\t\t});\n\t\treturn outputValue;\n\t}\n\tsetObj(key, value) {\n\t\tthis.setCache(this.genKey(key), structuredClone(value));\n\t}\n\tasync missObj(key, sourceObject) {\n\t\tconst sourceEntry = getDictionaryEntry(sourceObject);\n\t\tif (sourceEntry !== void 0) return getDictionaryValue(await this.miss(key, sourceEntry));\n\t\tif (!isDictionaryValue(sourceObject)) throw new DictionarySourceNotFoundError(key);\n\t\tconst translatedEntries = await Promise.all(Object.entries(sourceObject).map(async ([childKey, childSource]) => {\n\t\t\tconst childPath = key ? `${key}.${childKey}` : childKey;\n\t\t\treturn [childKey, await this.missObj(childPath, childSource)];\n\t\t}));\n\t\tconst translatedObject = Object.fromEntries(translatedEntries);\n\t\tthis.setObj(key, translatedObject);\n\t\treturn translatedObject;\n\t}\n\t/**\n\t* Miss the cache\n\t* @param key - The dictionary key\n\t* @returns The dictionary value\n\t*/\n\tasync miss(key, sourceEntry) {\n\t\tconst value = await this.missCache(key, sourceEntry);\n\t\tconst entry = getDictionaryEntry(value);\n\t\tif (entry === void 0) throw new Error(\"DictionaryCache missCache did not return a DictionaryEntry\");\n\t\tif (this.onMiss) this.onMiss({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: value,\n\t\t\toutputValue: entry\n\t\t});\n\t\treturn entry;\n\t}\n\t/**\n\t* Set the value for a key\n\t*/\n\tsetCache(cacheKey, value) {\n\t\tconst cache = this.getMutableCache();\n\t\tconst dictionaryPath = getDictionaryPath(cacheKey);\n\t\tif (dictionaryPath.length === 0) {\n\t\t\tif (isDictionaryValue(value)) replaceDictionary(cache, value);\n\t\t\treturn;\n\t\t}\n\t\tlet current = cache;\n\t\tfor (const key of dictionaryPath.slice(0, -1)) {\n\t\t\tconst next = current[key];\n\t\t\tif (!isDictionaryValue(next)) current[key] = {};\n\t\t\tcurrent = current[key];\n\t\t}\n\t\tcurrent[dictionaryPath[dictionaryPath.length - 1]] = value;\n\t}\n\t/**\n\t* Look up the key\n\t*/\n\tgetCache(key) {\n\t\tconst dictionaryPath = getDictionaryPath(this.genKey(key));\n\t\tlet current = this.getMutableCache();\n\t\tif (dictionaryPath.length === 0) return current;\n\t\tfor (const pathSegment of dictionaryPath) {\n\t\t\tif (!isDictionaryValue(current)) return;\n\t\t\tcurrent = current[pathSegment];\n\t\t}\n\t\treturn current;\n\t}\n\t/**\n\t* Generate a key for the cache\n\t* @param key - The dictionary key\n\t* @returns The key\n\t*/\n\tgenKey(key) {\n\t\treturn key;\n\t}\n\t/**\n\t* Get the fallback value for a cache miss\n\t* @param key - The dictionary key\n\t* @returns The fallback value\n\t*\n\t* @throws {Error} - If the fallback is not implemented\n\t*/\n\tfallback(key, sourceEntry) {\n\t\treturn this._runtimeTranslate(key, sourceEntry);\n\t}\n};\n//#endregion\n//#region src/i18n-manager/translations-manager/LocalesDictionaryCache.ts\n/**\n* Cache for looking up dictionaries by locale\n*/\nvar LocalesDictionaryCache = class extends Cache {\n\t/**\n\t* Constructor\n\t* @param {Object} params - The parameters for the cache\n\t* @param {number | null} params.ttl - The time to live for cache entries\n\t* @param {DictionaryLoader} params.loadDictionary - The dictionary loader function\n\t*/\n\tconstructor({ ttl, defaultLocale, dictionary = {}, loadDictionary, runtimeTranslate, lifecycle: { onLocalesDictionaryCacheHit: onHit, onLocalesDictionaryCacheMiss: onMiss, onDictionaryCacheHit, onDictionaryCacheMiss, onDictionaryObjectCacheHit } }) {\n\t\tsuper({}, {\n\t\t\tonHit,\n\t\t\tonMiss\n\t\t});\n\t\tthis.ttl = DEFAULT_CACHE_EXPIRY_TIME;\n\t\tthis.ttl = ttl === null ? -1 : ttl ?? 6e4;\n\t\tthis._dictionaryLoader = loadDictionary;\n\t\tthis._runtimeTranslate = runtimeTranslate;\n\t\tthis._onDictionaryCacheHit = onDictionaryCacheHit;\n\t\tthis._onDictionaryCacheMiss = onDictionaryCacheMiss;\n\t\tthis._onDictionaryObjectCacheHit = onDictionaryObjectCacheHit;\n\t\tthis.setCache(defaultLocale, {\n\t\t\tdictionaryCache: new DictionaryCache({\n\t\t\t\tinit: dictionary,\n\t\t\t\truntimeTranslate: this._createDictionaryRuntimeTranslate(defaultLocale),\n\t\t\t\tlifecycle: this._createDictionaryCacheLifecycle(defaultLocale)\n\t\t\t}),\n\t\t\texpiresAt: -1\n\t\t});\n\t}\n\t/**\n\t* Get the dictionary for a given locale\n\t* @param key - The locale\n\t* @returns The dictionary\n\t*/\n\tget(key) {\n\t\tconst entry = this.getCache(key);\n\t\tif (!entry || entry.expiresAt > 0 && entry.expiresAt < Date.now()) return;\n\t\tconst value = entry.dictionaryCache;\n\t\tif (value != null && this.onHit) this.onHit({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: entry,\n\t\t\toutputValue: value\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Miss the cache\n\t* @param key - The locale\n\t* @returns The dictionary cache\n\t*/\n\tasync miss(key) {\n\t\tconst cacheValue = await this.missCache(key);\n\t\tconst value = cacheValue.dictionaryCache;\n\t\tif (value != null && this.onMiss) this.onMiss({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue,\n\t\t\toutputValue: value\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Generate the cache key for a given locale\n\t* @param key - The locale\n\t* @returns The cache key\n\t*\n\t* This is just an identity function, no transformation needed\n\t*/\n\tgenKey(key) {\n\t\treturn key;\n\t}\n\t/**\n\t* Fallback for a cache miss\n\t* @param locale - The locale\n\t* @returns The cache entry\n\t*/\n\tasync fallback(locale) {\n\t\treturn {\n\t\t\tdictionaryCache: new DictionaryCache({\n\t\t\t\tinit: await this._dictionaryLoader(locale),\n\t\t\t\truntimeTranslate: this._createDictionaryRuntimeTranslate(locale),\n\t\t\t\tlifecycle: this._createDictionaryCacheLifecycle(locale)\n\t\t\t}),\n\t\t\texpiresAt: this.ttl < 0 ? this.ttl : Date.now() + this.ttl\n\t\t};\n\t}\n\t/**\n\t* Create the dictionary cache lifecycle\n\t* @param locale - The locale\n\t* @returns The dictionary cache lifecycle\n\t*/\n\t_createDictionaryCacheLifecycle(locale) {\n\t\treturn {\n\t\t\tonHit: this._onDictionaryCacheHit ? (params) => this._onDictionaryCacheHit({\n\t\t\t\tlocale,\n\t\t\t\t...params\n\t\t\t}) : void 0,\n\t\t\tonMiss: this._onDictionaryCacheMiss ? (params) => this._onDictionaryCacheMiss({\n\t\t\t\tlocale,\n\t\t\t\t...params\n\t\t\t}) : void 0,\n\t\t\tonHitObj: this._onDictionaryObjectCacheHit ? (params) => this._onDictionaryObjectCacheHit({\n\t\t\t\tlocale,\n\t\t\t\t...params\n\t\t\t}) : void 0\n\t\t};\n\t}\n\t_createDictionaryRuntimeTranslate(locale) {\n\t\treturn (key, sourceEntry) => this._runtimeTranslate(locale, key, sourceEntry);\n\t}\n};\n//#endregion\n//#region src/i18n-manager/event-subscription/types.ts\nconst LOCALES_CACHE_MISS_EVENT_NAME = \"locales-cache-miss\";\nconst TRANSLATIONS_CACHE_MISS_EVENT_NAME = \"translations-cache-miss\";\nconst LOCALES_DICTIONARY_CACHE_MISS_EVENT_NAME = \"locales-dictionary-cache-miss\";\nconst DICTIONARY_CACHE_MISS_EVENT_NAME = \"dictionary-cache-miss\";\n//#endregion\n//#region src/i18n-manager/lifecycle-hooks/createLifecycleCallbacks.ts\n/**\n* Maps consumer-facing lifecycle callbacks to internal locales cache lifecycle callbacks.\n* The consumer API exposes simplified params (locale, hash, value) while the internal\n* API uses the full cache lifecycle params (inputKey, cacheKey, cacheValue, outputValue).\n*\n* @deprecated - move to subscription api instead\n*/\nfunction createLifecycleCallbacks(emit) {\n\treturn {\n\t\tonLocalesCacheHit: (params) => {\n\t\t\temit(\"locales-cache-hit\", {\n\t\t\t\tlocale: params.inputKey,\n\t\t\t\ttranslations: params.outputValue.getInternalCache()\n\t\t\t});\n\t\t},\n\t\tonLocalesCacheMiss: (params) => {\n\t\t\temit(LOCALES_CACHE_MISS_EVENT_NAME, {\n\t\t\t\tlocale: params.inputKey,\n\t\t\t\ttranslations: params.outputValue.getInternalCache()\n\t\t\t});\n\t\t},\n\t\tonTranslationsCacheHit: (params) => {\n\t\t\temit(\"translations-cache-hit\", {\n\t\t\t\tlocale: params.locale,\n\t\t\t\thash: params.cacheKey,\n\t\t\t\ttranslation: params.outputValue\n\t\t\t});\n\t\t},\n\t\tonTranslationsCacheMiss: (params) => {\n\t\t\temit(TRANSLATIONS_CACHE_MISS_EVENT_NAME, {\n\t\t\t\tlocale: params.locale,\n\t\t\t\thash: params.cacheKey,\n\t\t\t\ttranslation: params.outputValue\n\t\t\t});\n\t\t},\n\t\tonLocalesDictionaryCacheHit: (params) => {\n\t\t\temit(\"locales-dictionary-cache-hit\", {\n\t\t\t\tlocale: params.inputKey,\n\t\t\t\tdictionary: params.outputValue.getInternalCache()\n\t\t\t});\n\t\t},\n\t\tonLocalesDictionaryCacheMiss: (params) => {\n\t\t\temit(LOCALES_DICTIONARY_CACHE_MISS_EVENT_NAME, {\n\t\t\t\tlocale: params.inputKey,\n\t\t\t\tdictionary: params.outputValue.getInternalCache()\n\t\t\t});\n\t\t},\n\t\tonDictionaryCacheHit: (params) => {\n\t\t\temit(\"dictionary-cache-hit\", {\n\t\t\t\tlocale: params.locale,\n\t\t\t\tid: params.cacheKey,\n\t\t\t\tdictionaryEntry: params.outputValue\n\t\t\t});\n\t\t},\n\t\tonDictionaryCacheMiss: (params) => {\n\t\t\temit(DICTIONARY_CACHE_MISS_EVENT_NAME, {\n\t\t\t\tlocale: params.locale,\n\t\t\t\tid: params.cacheKey,\n\t\t\t\tdictionaryEntry: params.outputValue\n\t\t\t});\n\t\t},\n\t\tonDictionaryObjectCacheHit: (params) => {\n\t\t\temit(\"dictionary-object-cache-hit\", {\n\t\t\t\tlocale: params.locale,\n\t\t\t\tid: params.cacheKey,\n\t\t\t\tdictionaryValue: params.outputValue\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/i18n-manager/event-subscription/EventEmitter.ts\n/**\n* Base class for event emitters\n*/\nvar EventEmitter = class {\n\tconstructor() {\n\t\tthis.listeners = {};\n\t}\n\tgetOrCreateListeners(eventName) {\n\t\tif (!this.listeners[eventName]) this.listeners[eventName] = /* @__PURE__ */ new Set();\n\t\treturn this.listeners[eventName];\n\t}\n\t/**\n\t* Subscribe to an event, returns an unsubscribe function\n\t*/\n\tsubscribe(eventName, listener) {\n\t\tconst set = this.getOrCreateListeners(eventName);\n\t\tset.add(listener);\n\t\treturn () => {\n\t\t\tset.delete(listener);\n\t\t};\n\t}\n\t/**\n\t* Emit an event\n\t*/\n\temit(eventName, event) {\n\t\tthis.listeners[eventName]?.forEach((subscriber) => subscriber(event));\n\t}\n};\n//#endregion\n//#region src/i18n-manager/lifecycle-hooks/subscribeLifecycleCallbacks.ts\n/**\n* Subscribes to the lifecycle callbacks and emits the events to the event emitter\n* @deprecated - move to subscription api instead\n*\n* NOTE: we do not have to worry about unsubscribe here as this is a deprecated api\n* and is only used internally\n*/\nfunction subscribeLifecycleCallbacks({ onLocalesCacheHit, onLocalesCacheMiss, onTranslationsCacheHit, onTranslationsCacheMiss, onLocalesDictionaryCacheHit, onLocalesDictionaryCacheMiss, onDictionaryCacheHit, onDictionaryCacheMiss, onDictionaryObjectCacheHit }, subscribe) {\n\tif (onLocalesCacheHit) subscribe(\"locales-cache-hit\", (event) => {\n\t\tonLocalesCacheHit({\n\t\t\t...event,\n\t\t\tvalue: event.translations\n\t\t});\n\t});\n\tif (onLocalesCacheMiss) subscribe(LOCALES_CACHE_MISS_EVENT_NAME, (event) => {\n\t\tonLocalesCacheMiss({\n\t\t\t...event,\n\t\t\tvalue: event.translations\n\t\t});\n\t});\n\tif (onTranslationsCacheHit) subscribe(\"translations-cache-hit\", (event) => {\n\t\tonTranslationsCacheHit({\n\t\t\t...event,\n\t\t\tvalue: event.translation\n\t\t});\n\t});\n\tif (onTranslationsCacheMiss) subscribe(TRANSLATIONS_CACHE_MISS_EVENT_NAME, (event) => {\n\t\tonTranslationsCacheMiss({\n\t\t\t...event,\n\t\t\tvalue: event.translation\n\t\t});\n\t});\n\tif (onLocalesDictionaryCacheHit) subscribe(\"locales-dictionary-cache-hit\", (event) => {\n\t\tonLocalesDictionaryCacheHit(event);\n\t});\n\tif (onLocalesDictionaryCacheMiss) subscribe(LOCALES_DICTIONARY_CACHE_MISS_EVENT_NAME, (event) => {\n\t\tonLocalesDictionaryCacheMiss(event);\n\t});\n\tif (onDictionaryCacheHit) subscribe(\"dictionary-cache-hit\", (event) => {\n\t\tonDictionaryCacheHit(event);\n\t});\n\tif (onDictionaryCacheMiss) subscribe(DICTIONARY_CACHE_MISS_EVENT_NAME, (event) => {\n\t\tonDictionaryCacheMiss(event);\n\t});\n\tif (onDictionaryObjectCacheHit) subscribe(\"dictionary-object-cache-hit\", (event) => {\n\t\tonDictionaryObjectCacheHit(event);\n\t});\n}\n//#endregion\n//#region src/i18n-manager/I18nManager.ts\n/**\n* Default translation timeout in milliseconds for a runtime translation request\n*/\nconst DEFAULT_TRANSLATION_TIMEOUT = 12e3;\n/**\n* Class for managing translation functionality\n* @template TranslationValue - The type of the translation that will be cached\n*/\nvar I18nManager = class extends EventEmitter {\n\t/**\n\t* Creates an instance of I18nManager.\n\t* TODO: resolve gtConfig from just file path\n\t* @param params - The parameters for the I18nManager constructor\n\t* @param params.config - The configuration for the I18nManager\n\t*/\n\tconstructor(params) {\n\t\tsuper();\n\t\tthis.resolveTranslationSync = (locale, message, options) => {\n\t\t\treturn this.lookupTranslation(locale, message, options);\n\t\t};\n\t\tpublishValidationResults(validateConfig(params), \"I18nManager: \");\n\t\tthis.config = standardizeConfig(params);\n\t\tthis.localeConfig = new LocaleConfig({\n\t\t\tdefaultLocale: this.config.defaultLocale,\n\t\t\tlocales: this.config.locales,\n\t\t\tcustomMapping: this.config.customMapping\n\t\t});\n\t\tconst loadTranslations = createTranslationLoader(params);\n\t\tconst loadDictionary = createDictionaryLoader(params);\n\t\tconst runtimeTranslationTimeout = this.config.runtimeTranslation?.timeout ?? DEFAULT_TRANSLATION_TIMEOUT;\n\t\tconst runtimeTranslationMetadata = this.config.runtimeTranslation?.metadata ?? {};\n\t\tconst createTranslateMany = createTranslateManyFactory(this.getGTClassClean(), runtimeTranslationTimeout, runtimeTranslationMetadata);\n\t\tsubscribeLifecycleCallbacks(params.lifecycle ?? {}, (...args) => this.subscribe(...args));\n\t\tconst lifecycle = createLifecycleCallbacks((...args) => this.emit(...args));\n\t\tthis.localesCache = new LocalesCache({\n\t\t\tloadTranslations,\n\t\t\tcreateTranslateMany,\n\t\t\tlifecycle,\n\t\t\tttl: this.config.cacheExpiryTime,\n\t\t\tbatchConfig: this.config.batchConfig\n\t\t});\n\t\tthis.localesDictionaryCache = new LocalesDictionaryCache({\n\t\t\tdefaultLocale: this.config.defaultLocale,\n\t\t\tdictionary: params.dictionary,\n\t\t\tloadDictionary,\n\t\t\truntimeTranslate: (locale, id, sourceEntry) => this.dictionaryRuntimeTranslate(locale, id, sourceEntry),\n\t\t\tttl: this.config.cacheExpiryTime,\n\t\t\tlifecycle\n\t\t});\n\t}\n\t/**\n\t* Subscribes to a change in a translation entry (eg a runtime translation)\n\t* @param listener - The subscriber function\n\t* @param locale - The locale of the translation entry\n\t* @param hash - The hash of the translation entry\n\t* @returns An unsubscribe function\n\t*\n\t* Pair this with {@link lookupTranslation} to get the translation entry\n\t*/\n\tsubscribeToTranslationsCacheMiss(listener, locale, hash) {\n\t\treturn this.subscribe(TRANSLATIONS_CACHE_MISS_EVENT_NAME, (event) => {\n\t\t\tif (event.locale !== locale || event.hash !== hash) return;\n\t\t\tlistener(event);\n\t\t});\n\t}\n\t/**\n\t* Get the default locale\n\t*/\n\tgetDefaultLocale() {\n\t\treturn this.config.defaultLocale;\n\t}\n\t/**\n\t* Get the locales\n\t*/\n\tgetLocales() {\n\t\treturn this.config.locales;\n\t}\n\t/**\n\t* Get the custom locale mapping\n\t*/\n\tgetCustomMapping() {\n\t\treturn this.config.customMapping;\n\t}\n\t/**\n\t* Get the version ID\n\t*/\n\tgetVersionId() {\n\t\treturn this.config._versionId;\n\t}\n\t/**\n\t* Get a gt class instance\n\t* @param locale - The locale to bind to the GT instance. When omitted, the GT instance is locale agnostic.\n\t* TODO: keep a cache to avoid creating new instances unnecessarily\n\t*/\n\tgetGTClass(locale) {\n\t\treturn this.getGTClassClean(locale ? this.resolveLocale(locale) : void 0);\n\t}\n\t/**\n\t* Is translation enabled?\n\t*/\n\tisTranslationEnabled() {\n\t\treturn this.config.enableI18n;\n\t}\n\t/**\n\t* Get the translation loader function\n\t* @deprecated wrap a cb around loadTranslations instead\n\t*/\n\tgetTranslationLoader() {\n\t\treturn (locale) => this.loadTranslations(locale);\n\t}\n\t/**\n\t* Loads in translations for a given locale\n\t* Edge case usage: access the translations object directly\n\t*/\n\tasync loadTranslations(locale) {\n\t\ttry {\n\t\t\tconst translationLocale = this.resolveCacheLocale(locale);\n\t\t\tif (!translationLocale) return {};\n\t\t\tlet txCache = this.localesCache.get(translationLocale);\n\t\t\tif (!txCache) txCache = await this.localesCache.miss(translationLocale);\n\t\t\treturn txCache.getInternalCache();\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn {};\n\t\t}\n\t}\n\t/**\n\t* Loads in the dictionary for a given locale\n\t* Edge case usage: access the dictionary object directly\n\t*/\n\tasync loadDictionary(locale) {\n\t\ttry {\n\t\t\tconst dictionaryLocale = this.resolveCacheLocale(locale);\n\t\t\tif (!dictionaryLocale) return this.localesDictionaryCache.get(this.config.defaultLocale)?.getInternalCache() ?? {};\n\t\t\tlet dictionaryCache = this.localesDictionaryCache.get(dictionaryLocale);\n\t\t\tif (!dictionaryCache) dictionaryCache = await this.localesDictionaryCache.miss(dictionaryLocale);\n\t\t\treturn dictionaryCache.getInternalCache();\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn {};\n\t\t}\n\t}\n\t/**\n\t* Look up a dictionary entry\n\t*/\n\tlookupDictionary(locale, id) {\n\t\ttry {\n\t\t\tconst dictionaryLocale = this.resolveCacheLocale(locale) ?? this.config.defaultLocale;\n\t\t\treturn this.localesDictionaryCache.get(dictionaryLocale)?.get(id);\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Look up a dictionary entry or subtree\n\t*/\n\tlookupDictionaryObj(locale, id) {\n\t\ttry {\n\t\t\tconst dictionaryLocale = this.resolveCacheLocale(locale) ?? this.config.defaultLocale;\n\t\t\treturn this.localesDictionaryCache.get(dictionaryLocale)?.getObj(id);\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Look up a dictionary entry\n\t* If it's not found, use the fallback (runtime translate)\n\t*/\n\tasync lookupDictionaryWithFallback(locale, id) {\n\t\ttry {\n\t\t\tconst dictionaryLocale = this.resolveCacheLocale(locale);\n\t\t\tif (!dictionaryLocale) {\n\t\t\t\tconst sourceEntry = this.localesDictionaryCache.get(this.config.defaultLocale)?.get(id);\n\t\t\t\tif (sourceEntry === void 0) throw new DictionarySourceNotFoundError(id);\n\t\t\t\treturn sourceEntry;\n\t\t\t}\n\t\t\tlet dictionaryCache = this.localesDictionaryCache.get(dictionaryLocale);\n\t\t\tif (!dictionaryCache) dictionaryCache = await this.localesDictionaryCache.miss(dictionaryLocale);\n\t\t\tlet dictionaryEntry = dictionaryCache.get(id);\n\t\t\tif (dictionaryEntry === void 0) {\n\t\t\t\tconst sourceEntry = this.localesDictionaryCache.get(this.config.defaultLocale)?.get(id);\n\t\t\t\tif (sourceEntry === void 0) throw new DictionarySourceNotFoundError(id);\n\t\t\t\tdictionaryEntry = await dictionaryCache.miss(id, sourceEntry);\n\t\t\t}\n\t\t\treturn dictionaryEntry;\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Look up a dictionary entry or subtree\n\t* If it's not found, use the fallback (runtime translate)\n\t*/\n\tasync lookupDictionaryObjWithFallback(locale, id) {\n\t\ttry {\n\t\t\tconst dictionaryLocale = this.resolveCacheLocale(locale);\n\t\t\tif (!dictionaryLocale) {\n\t\t\t\tconst sourceObject = this.localesDictionaryCache.get(this.config.defaultLocale)?.getObj(id);\n\t\t\t\tif (sourceObject === void 0) throw new DictionarySourceNotFoundError(id);\n\t\t\t\treturn sourceObject;\n\t\t\t}\n\t\t\tlet dictionaryCache = this.localesDictionaryCache.get(dictionaryLocale);\n\t\t\tif (!dictionaryCache) dictionaryCache = await this.localesDictionaryCache.miss(dictionaryLocale);\n\t\t\tlet dictionaryObject = dictionaryCache.getObj(id);\n\t\t\tif (dictionaryObject === void 0) {\n\t\t\t\tconst sourceObject = this.localesDictionaryCache.get(this.config.defaultLocale)?.getObj(id);\n\t\t\t\tif (sourceObject === void 0) throw new DictionarySourceNotFoundError(id);\n\t\t\t\tdictionaryObject = await dictionaryCache.missObj(id, sourceObject);\n\t\t\t}\n\t\t\treturn dictionaryObject;\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Just lookup a translation\n\t*/\n\tlookupTranslation(locale, message, options) {\n\t\ttry {\n\t\t\tconst { translationLocale, options: lookupOptions } = this.resolveLookupParams(locale, options);\n\t\t\tif (!translationLocale) return message;\n\t\t\tconst txCache = this.localesCache.get(translationLocale);\n\t\t\tif (!txCache) return void 0;\n\t\t\treturn txCache.get({\n\t\t\t\tmessage,\n\t\t\t\toptions: lookupOptions\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Look up a translation\n\t* If it's not found, use the fallback (runtime translate)\n\t*/\n\tasync lookupTranslationWithFallback(locale, message, options) {\n\t\ttry {\n\t\t\treturn await this.lookupTranslationWithFallbackResolved(locale, message, options);\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Saves a current lookup translation function immune to expiry\n\t* Useful for operations involving lookup callbacks like useGT()\n\t* @param locale - The locale to get the lookup translation for\n\t* @param prefetchEntries - Any entries we want to prefetch during the async period\n\t* @returns A lookup translation function\n\t*\n\t* @important prefetchEntries must all be the same locale\n\t*/\n\tasync getLookupTranslation(locale, prefetchEntries = []) {\n\t\ttry {\n\t\t\tconst translationLocale = this.resolveCacheLocale(locale);\n\t\t\tif (!translationLocale) return (message) => message;\n\t\t\tconst resolvedPrefetchEntries = resolvePrefetchEntriesByLocale(prefetchEntries, translationLocale, (entryLocale) => this.resolveCacheLocale(entryLocale) ?? this.resolveLocale(entryLocale));\n\t\t\tif (resolvedPrefetchEntries.length !== prefetchEntries.length) logger_default.warn(`I18nManager: getLookupTranslation(): prefetchEntries must all be the same locale, ignoring all entries that are not for ${translationLocale}`);\n\t\t\tlet txCache = this.localesCache.get(translationLocale);\n\t\t\tif (!txCache) txCache = await this.localesCache.miss(translationLocale);\n\t\t\tif (!txCache) return () => void 0;\n\t\t\tawait Promise.all(resolvedPrefetchEntries.filter((entry) => txCache.get(entry) == null).map((entry) => txCache.miss(entry)));\n\t\t\treturn (message, options = {}) => {\n\t\t\t\treturn txCache.get({\n\t\t\t\t\tmessage,\n\t\t\t\t\toptions: this.resolveLookupOptions(options)\n\t\t\t\t});\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn (message) => message;\n\t\t}\n\t}\n\t/**\n\t* Get the translations\n\t* @deprecated use loadTranslations instead\n\t*/\n\tasync getTranslations(locale) {\n\t\ttry {\n\t\t\treturn this.loadTranslations(locale);\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn {};\n\t\t}\n\t}\n\t/**\n\t* Get translation for a given locale and message\n\t*\n\t* @param {string} locale - The locale to get the translation for\n\t* @returns A function that resolves the translations for a given message and options synchronously\n\t*\n\t* Note: we can assume that the translation is a string because we are passing a string\n\t*\n\t* @deprecated use getLookupTranslation instead\n\t*/\n\tasync getTranslationResolver(locale) {\n\t\treturn this.getLookupTranslation(locale);\n\t}\n\t/**\n\t* Returns true if translation is required\n\t* @param {string} locale - The user's locale\n\t* @returns {boolean} True if translation is required, otherwise false\n\t*/\n\trequiresTranslation(locale) {\n\t\tconst defaultLocale = this.getDefaultLocale();\n\t\tconst locales = this.getLocales();\n\t\treturn this.isTranslationEnabled() && this.localeConfig.requiresTranslation(locale, defaultLocale, locales);\n\t}\n\t/**\n\t* Returns true if dialect translation is required\n\t* @param {string} locale - The user's locale\n\t* @returns {boolean} True if dialect translation is required, otherwise false\n\t*/\n\trequiresDialectTranslation(locale) {\n\t\tconst defaultLocale = this.getDefaultLocale();\n\t\treturn this.requiresTranslation(locale) && this.localeConfig.isSameLanguage(defaultLocale, locale);\n\t}\n\t/**\n\t* Handle errors\n\t* Soft error in production, throw in development\n\t*/\n\thandleError(error) {\n\t\tif (error instanceof DictionarySourceNotFoundError) throw error;\n\t\tswitch (this.config.environment) {\n\t\t\tcase \"development\": throw error;\n\t\t\tdefault:\n\t\t\t\tlogger_default.error(\"I18nManager: \" + error);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tresolveLocale(locale) {\n\t\tconst resolvedLocale = this.localeConfig.determineLocale(locale);\n\t\tif (!this.localeConfig.isValidLocale(locale) || !resolvedLocale) throw new Error(`I18nManager: validateLocale(): locale ${locale} is not valid`);\n\t\treturn resolvedLocale;\n\t}\n\t/**\n\t* Resolve the locale key used to load/read locale caches.\n\t* Returns undefined when the requested locale can use source content.\n\t*/\n\tresolveCacheLocale(locale) {\n\t\tconst resolvedLocale = this.resolveLocale(locale);\n\t\tif (this.requiresTranslation(resolvedLocale)) return resolvedLocale;\n\t\tconst aliasLocale = this.localeConfig.resolveAliasLocale(standardizeLocale(locale));\n\t\tif (this.requiresTranslation(aliasLocale)) return aliasLocale;\n\t}\n\tresolveLookupParams(locale, options) {\n\t\tconst translationLocale = this.resolveCacheLocale(locale);\n\t\treturn {\n\t\t\ttranslationLocale,\n\t\t\toptions: translationLocale ? this.resolveLookupOptions(options, translationLocale) : options\n\t\t};\n\t}\n\tresolveLookupOptions(options = {}, translationLocale) {\n\t\tif (!options.$locale) return options;\n\t\treturn {\n\t\t\t...options,\n\t\t\t$locale: translationLocale ?? this.resolveCacheLocale(options.$locale) ?? this.resolveLocale(options.$locale)\n\t\t};\n\t}\n\tasync lookupTranslationWithFallbackResolved(locale, message, options) {\n\t\tconst { translationLocale, options: lookupOptions } = this.resolveLookupParams(locale, options);\n\t\tif (!translationLocale) return message;\n\t\tlet txCache = this.localesCache.get(translationLocale);\n\t\tif (!txCache) txCache = await this.localesCache.miss(translationLocale);\n\t\tlet translation = txCache.get({\n\t\t\tmessage,\n\t\t\toptions: lookupOptions\n\t\t});\n\t\tif (translation == null) translation = await txCache.miss({\n\t\t\tmessage,\n\t\t\toptions: lookupOptions\n\t\t});\n\t\treturn translation;\n\t}\n\t/**\n\t* Runtime lookup function for dictionaries\n\t*/\n\tasync dictionaryRuntimeTranslate(locale, id, sourceEntry) {\n\t\tconst translation = await this.lookupTranslationWithFallbackResolved(locale, sourceEntry.entry, resolveDictionaryLookupOptions(sourceEntry.options));\n\t\tif (typeof translation !== \"string\") throw new Error(`I18nManager: dictionaryRuntimeTranslate(): unable to translate dictionary entry ${id}`);\n\t\treturn translation;\n\t}\n\t/**\n\t* A helper function to create a gt class that is locale agnostic\n\t* This is helpful for when our getLocale function is bound to a\n\t* specific context\n\t*/\n\tgetGTClassClean(locale) {\n\t\treturn new GT({\n\t\t\tsourceLocale: this.config.defaultLocale,\n\t\t\ttargetLocale: locale,\n\t\t\tlocales: Array.from(new Set(this.config.locales.map((locale) => this.localeConfig.resolveCanonicalLocale(locale)))),\n\t\t\tcustomMapping: this.config.customMapping,\n\t\t\tprojectId: this.config.projectId,\n\t\t\tbaseUrl: this.config.runtimeUrl || void 0,\n\t\t\tapiKey: this.config.apiKey,\n\t\t\tdevApiKey: this.config.devApiKey\n\t\t});\n\t}\n};\n/**\n* Standardize the config\n* @param config - The config to standardize\n* @returns The standardized config\n*/\nfunction standardizeConfig(config) {\n\tconst gtServicesEnabled = getGTServicesEnabled(config);\n\tconst dedupedLocales = dedupeLocales({\n\t\tdefaultLocale: config.defaultLocale || libraryDefaultLocale,\n\t\tlocales: config.locales || [libraryDefaultLocale],\n\t\tcustomMapping: config.customMapping\n\t});\n\treturn {\n\t\tenvironment: config.environment || \"production\",\n\t\tenableI18n: config.enableI18n !== void 0 ? config.enableI18n : true,\n\t\tprojectId: config.projectId,\n\t\tdevApiKey: config.devApiKey,\n\t\tapiKey: config.apiKey,\n\t\truntimeUrl: config.runtimeUrl,\n\t\tcacheExpiryTime: config.cacheExpiryTime,\n\t\tbatchConfig: config.batchConfig,\n\t\truntimeTranslation: config.runtimeTranslation,\n\t\t_versionId: config._versionId,\n\t\t...gtServicesEnabled ? standardizeLocales(dedupedLocales) : dedupedLocales\n\t};\n}\n/**\n* Dedupe locales and add defaultLocale\n*/\nfunction dedupeLocales({ defaultLocale, locales, customMapping }) {\n\treturn {\n\t\tdefaultLocale,\n\t\tlocales: Array.from(new Set([defaultLocale, ...locales])),\n\t\tcustomMapping: customMapping || {}\n\t};\n}\n/**\n* Standardize all locales in config\n* Only apply if using GT services\n*/\nfunction standardizeLocales(config) {\n\treturn {\n\t\tdefaultLocale: standardizeLocale(config.defaultLocale),\n\t\tlocales: config.locales.map((locale) => {\n\t\t\tif (typeof config.customMapping?.[locale] === \"string\" ? config.customMapping?.[locale] : config.customMapping?.[locale]?.code) return locale;\n\t\t\telse return standardizeLocale(locale);\n\t\t}),\n\t\tcustomMapping: Object.fromEntries(Object.entries(config.customMapping || {}).map(([key, value]) => [key, typeof value === \"string\" ? standardizeLocale(value) : {\n\t\t\t...value,\n\t\t\t...value.code ? { code: standardizeLocale(value.code) } : {}\n\t\t}]))\n\t};\n}\n/**\n* Resolve prefetch entry locales and keep entries matching the active locale.\n* @template TranslationType - The type of the translation\n* @param {PrefetchEntry<TranslationType>[]} prefetchEntries - The prefetch entries to filter\n* @param {string} locale - The locale to filter by\n* @returns {PrefetchEntry<TranslationType>[]} The filtered prefetch entries\n*/\nfunction resolvePrefetchEntriesByLocale(prefetchEntries, locale, resolveLocale) {\n\treturn prefetchEntries.flatMap((entry) => {\n\t\tconst entryLocale = entry.options.$locale;\n\t\tif (entryLocale == null) return [entry];\n\t\ttry {\n\t\t\tconst resolvedLocale = resolveLocale(entryLocale);\n\t\t\tif (resolvedLocale !== locale) return [];\n\t\t\treturn [{\n\t\t\t\tmessage: entry.message,\n\t\t\t\toptions: {\n\t\t\t\t\t...entry.options,\n\t\t\t\t\t$locale: resolvedLocale\n\t\t\t\t}\n\t\t\t}];\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t});\n}\n/**\n* Helper function for creating a translation loader\n*/\nfunction createTranslationLoader(params) {\n\treturn routeCreateTranslationLoader({\n\t\tloadTranslations: params.loadTranslations,\n\t\ttype: getLoadTranslationsType(params),\n\t\tremoteTranslationLoaderParams: {\n\t\t\tcacheUrl: params.cacheUrl,\n\t\t\tprojectId: params.projectId,\n\t\t\t_versionId: params._versionId,\n\t\t\t_branchId: params._branchId,\n\t\t\tcustomMapping: params.customMapping\n\t\t}\n\t});\n}\n/**\n* Helper function for creating a dictionary loader\n*/\nfunction createDictionaryLoader(params) {\n\treturn params.loadDictionary ?? (() => Promise.resolve({}));\n}\n//#endregion\n//#region src/i18n-manager/singleton-operations.ts\nlet i18nManager = void 0;\nlet fallbackDefaultLocale = libraryDefaultLocale;\nconst fallbackConditionStore = { getLocale: () => fallbackDefaultLocale };\nlet conditionStore = fallbackConditionStore;\n/**\n* Get the singleton instance of I18nManager\n* @returns The singleton instance of I18nManager\n* @template U - The type of the translation that will be cached\n*/\nfunction getI18nManager() {\n\tif (!i18nManager) {\n\t\tlogger_default.warn(\"getI18nManager(): Translation failed because I18nManager not initialized.\");\n\t\ti18nManager = new I18nManager({\n\t\t\tdefaultLocale: libraryDefaultLocale,\n\t\t\tlocales: [libraryDefaultLocale]\n\t\t});\n\t}\n\treturn i18nManager;\n}\n/**\n* Resolve the current locale from the configured runtime condition source.\n*/\nfunction getCurrentLocale() {\n\treturn conditionStore.getLocale();\n}\n/**\n* Configure the runtime condition source.\n*/\nfunction setConditionStore(nextConditionStore) {\n\tconditionStore = nextConditionStore;\n}\n/**\n* Reset the runtime condition source to the active manager's default-locale fallback.\n*/\nfunction resetConditionStore() {\n\tconditionStore = fallbackConditionStore;\n}\n/**\n* Configure the singleton instance of I18nManager\n* @param config - The configuration for the I18nManager\n*\n* Wrapper libraries will export a configure function that will call this function.\n*/\nfunction setI18nManager(i18nManagerInstance) {\n\ti18nManager = i18nManagerInstance;\n\tfallbackDefaultLocale = i18nManagerInstance.getDefaultLocale();\n\tresetConditionStore();\n}\n//#endregion\n//#region src/translation-functions/utils/interpolation/interpolateStringMessage.ts\n/**\n* String interpolation function\n*/\nfunction interpolateStringMessage(encodedMsg, options) {\n\treturn formatCutoff(encodedMsg, {\n\t\tlocales: options.$locale ?? options.$_locales,\n\t\tmaxChars: options.$maxChars\n\t});\n}\n//#endregion\n//#region src/translation-functions/utils/interpolation/interpolateMessage.ts\n/**\n* Interpolation router function for all {@link StringFormat} types\n*/\nfunction interpolateMessage({ source, target, options, sourceLocale }) {\n\tif (target != null) return routeInterpolation(target, {\n\t\t$_fallback: source,\n\t\t...options\n\t});\n\treturn routeInterpolation(source, getSourceOptions(options, sourceLocale));\n}\n/**\n* Route to appropriate formatting function\n*/\nfunction routeInterpolation(content, options) {\n\tswitch (options.$format ?? \"STRING\") {\n\t\tcase \"ICU\": return interpolateIcuMessage(content, options);\n\t\tcase \"I18NEXT\":\n\t\tcase \"STRING\": return interpolateStringMessage(content, options);\n\t\tdefault: return content;\n\t}\n}\nfunction getSourceOptions(options, sourceLocale) {\n\tif (!sourceLocale) return options;\n\treturn {\n\t\t...options,\n\t\t$locale: sourceLocale\n\t};\n}\n//#endregion\n//#region src/translation-functions/internal/helpers.ts\n/**\n* Just do a simple lookup of the translation\n*/\nfunction resolveJsx(locale, content, options = {}) {\n\tconst i18nManager = getI18nManager();\n\tconst lookupOptions = createLookupOptions(locale, options, \"JSX\");\n\treturn i18nManager.lookupTranslation(lookupOptions.$locale, content, lookupOptions);\n}\n/**\n* Lookup translation, fallback to source\n*/\nfunction resolveJsxWithFallback(locale, content, options = {}) {\n\treturn resolveJsx(locale, content, options) ?? content;\n}\n/**\n* Lookup translation\n* fallback to runtime translate\n* Fallback to source\n*/\nasync function resolveJsxWithRuntimeFallback(locale, content, options = {}) {\n\tconst i18nManager = getI18nManager();\n\tconst lookupOptions = createLookupOptions(locale, options, \"JSX\");\n\treturn await i18nManager.lookupTranslationWithFallback(lookupOptions.$locale, content, lookupOptions) ?? content;\n}\n/**\n* Just do a simple lookup of the translation\n* And interpolate\n*/\nfunction resolveStringContent(locale, content, options = {}) {\n\tconst i18nManager = getI18nManager();\n\tconst lookupOptions = createLookupOptions(locale, options, \"STRING\");\n\tconst translation = i18nManager.lookupTranslation(lookupOptions.$locale, content, lookupOptions);\n\tif (translation == null) return void 0;\n\treturn interpolateMessage({\n\t\tsource: content,\n\t\ttarget: translation,\n\t\toptions: lookupOptions,\n\t\tsourceLocale: i18nManager.getDefaultLocale()\n\t});\n}\n/**\n* Lookup translation, fallback to source\n*/\nfunction resolveStringContentWithFallback(locale, content, options = {}) {\n\tconst i18nManager = getI18nManager();\n\tconst lookupOptions = createLookupOptions(locale, options, \"STRING\");\n\treturn interpolateMessage({\n\t\tsource: content,\n\t\ttarget: i18nManager.lookupTranslation(lookupOptions.$locale, content, lookupOptions),\n\t\toptions: lookupOptions,\n\t\tsourceLocale: i18nManager.getDefaultLocale()\n\t});\n}\n/**\n* Lookup translation\n* fallback to runtime translate\n* Fallback to source\n*/\nasync function resolveStringContentWithRuntimeFallback(locale, content, options = {}) {\n\tconst i18nManager = getI18nManager();\n\tconst lookupOptions = createLookupOptions(locale, options, \"STRING\");\n\treturn interpolateMessage({\n\t\tsource: content,\n\t\ttarget: await i18nManager.lookupTranslationWithFallback(lookupOptions.$locale, content, lookupOptions),\n\t\toptions: lookupOptions,\n\t\tsourceLocale: i18nManager.getDefaultLocale()\n\t});\n}\n/**\n* Add the default format to caller-provided lookup options.\n*/\nfunction createLookupOptions(locale, options, defaultFormat) {\n\treturn {\n\t\t...options,\n\t\t$format: options.$format ?? defaultFormat,\n\t\t$locale: locale\n\t};\n}\n//#endregion\n//#region src/helpers/locale.ts\n/**\n* Get the current locale\n* @returns The current locale\n*\n* @example\n* const locale = getLocale();\n* console.log(locale); // 'en-US'\n*/\nfunction getLocale() {\n\treturn getCurrentLocale();\n}\n/**\n* Get the configured locales\n* @returns The configured locales\n*\n* @example\n* const locales = getLocales();\n* console.log(locales); // ['en-US', 'es-ES']\n*/\nfunction getLocales() {\n\treturn getI18nManager().getLocales();\n}\n/**\n* Get the default locale\n* @returns The default locale\n*\n* @example\n* const defaultLocale = getDefaultLocale();\n* console.log(defaultLocale); // 'en-US'\n*/\nfunction getDefaultLocale() {\n\treturn getI18nManager().getDefaultLocale();\n}\n/**\n* Get the locale properties\n* @param {string} [locale] - The locale to get the properties for. When not provided, uses the current locale.\n* @returns The locale properties\n*\n* @example\n* const localeProperties = getLocaleProperties();\n*\n* @example\n* const localeProperties = getLocaleProperties('en-US');\n*/\nfunction getLocaleProperties(locale = getCurrentLocale()) {\n\treturn getI18nManager().getGTClass().getLocaleProperties(locale);\n}\n//#endregion\n//#region src/helpers/versionId.ts\n/**\n* Get the version ID for the current source\n* @returns The version ID, if set\n*\n* @example\n* const versionId = getVersionId();\n* console.log(versionId); // 'abc123'\n*/\nfunction getVersionId() {\n\treturn getI18nManager().getVersionId();\n}\n//#endregion\nexport { getDictionaryEntry as C, hashMessage as E, TRANSLATIONS_CACHE_MISS_EVENT_NAME as S, resolveDictionaryLookupOptions as T, setI18nManager as _, getLocales as a, LOCALES_CACHE_MISS_EVENT_NAME as b, resolveJsxWithFallback as c, resolveStringContentWithFallback as d, resolveStringContentWithRuntimeFallback as f, setConditionStore as g, getI18nManager as h, getLocaleProperties as i, resolveJsxWithRuntimeFallback as l, getCurrentLocale as m, getDefaultLocale as n, createLookupOptions as o, interpolateMessage as p, getLocale as r, resolveJsx as s, getVersionId as t, resolveStringContent as u, I18nManager as v, isDictionaryValue as w, LOCALES_DICTIONARY_CACHE_MISS_EVENT_NAME as x, DICTIONARY_CACHE_MISS_EVENT_NAME as y };\n\n//# sourceMappingURL=versionId-B2xfz6jP.mjs.map","import { n as decodeOptions, r as interpolateIcuMessage, t as isEncodedTranslationOptions } from \"./isEncodedTranslationOptions-BOwWa_-J.mjs\";\n//#region src/translation-functions/msg/decodeMsg.ts\nfunction decodeMsg(encodedMsg) {\n\tif (typeof encodedMsg === \"string\" && encodedMsg.lastIndexOf(\":\") !== -1) return encodedMsg.slice(0, encodedMsg.lastIndexOf(\":\"));\n\treturn encodedMsg;\n}\n//#endregion\n//#region src/translation-functions/fallbacks/gtFallback.ts\n/**\n* A fallback function for the gt() function that decodes and interpolates.\n* @param {string | null | undefined} message - The ICU formatted message to interpolate.\n* @param {InlineTranslationOptions} options - The options to interpolate.\n* @returns - The decoded and interpolated message.\n*\n* @note This function is useful as a placeholder when for incrementally migrating to the m() function.\n* @example\n* // A backwards compatible translation function\n* function getMessage(gt: GTFunctionType = gtFallback) {\n* return gt('Hello, world!');\n* }\n*\n* // Here i18n has been implemented\n* function WithTranslation() {\n* const gt = useGT();\n* return <>{getMessage(gt)}</>;\n* }\n*\n*\n* // i18n has not yet been implemented yet\n* function WithoutTranslations() {\n* return <>{getMessage()}</>;\n* }\n*/\nconst gtFallback = (message, options = {}) => {\n\treturn interpolateIcuMessage(message, options);\n};\n//#endregion\n//#region src/translation-functions/fallbacks/mFallback.ts\n/**\n* A fallback function for the m() function that decodes and interpolates.\n* @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.\n* @param {InlineTranslationOptions} options - The options to interpolate.\n* @returns - The decoded and interpolated message.\n*\n* @note This function is useful as a placeholder when for incrementally migrating to the m() function.\n* @example\n* // A backwards compatible translation function\n* function getMessage(m: MFunctionType = mFallback) {\n* return m(msg('Hello, world!'));\n* }\n*\n* // Here i18n has been implemented\n* function WithTranslation() {\n* const m = useMessages();\n* return <>{getMessage(m)}</>;\n* }\n*\n*\n* // i18n has not yet been implemented yet\n* function WithoutTranslations() {\n* return <>{getMessage()}</>;\n* }\n*/\nconst mFallback = (encodedMsg, options = {}) => {\n\tif (!encodedMsg) return encodedMsg;\n\tif (isEncodedTranslationOptions(decodeOptions(encodedMsg) ?? {})) return decodeMsg(encodedMsg);\n\treturn interpolateIcuMessage(encodedMsg, options);\n};\n//#endregion\nexport { gtFallback as n, decodeMsg as r, mFallback as t };\n\n//# sourceMappingURL=mFallback-pqVm9wDk.mjs.map","import { a as extractVariables, i as createInterpolationFailureMessage, n as decodeOptions, o as logger_default } from \"./isEncodedTranslationOptions-BOwWa_-J.mjs\";\nimport { E as hashMessage, a as getLocales, d as resolveStringContentWithFallback, i as getLocaleProperties, m as getCurrentLocale, n as getDefaultLocale, r as getLocale, t as getVersionId } from \"./versionId-B2xfz6jP.mjs\";\nimport { n as gtFallback, r as decodeMsg, t as mFallback } from \"./mFallback-pqVm9wDk.mjs\";\nimport { VAR_IDENTIFIER, declareStatic, declareVar, decodeVars, derive, encode, libraryDefaultLocale } from \"generaltranslation/internal\";\nimport { formatMessage } from \"@generaltranslation/format\";\n//#region src/translation-functions/t.ts\n/**\n* Translate a message\n* @param {string} message - The message to translate.\n* @param options - The options for the translation.\n* @returns The translated message.\n*/\nfunction t(message, options = {}) {\n\treturn resolveStringContentWithFallback(options.$locale ?? getCurrentLocale(), message, {\n\t\t$format: \"ICU\",\n\t\t...options\n\t});\n}\n//#endregion\n//#region src/translation-functions/msg/msg.ts\nfunction msg(message, options) {\n\tif (typeof message !== \"string\") {\n\t\tif (!options) return message;\n\t\treturn message.map((m, i) => msg(m, {\n\t\t\t...options,\n\t\t\t...options.$id && { $id: `${options.$id}.${i}` }\n\t\t}));\n\t}\n\tif (!options) return message;\n\tconst variables = extractVariables(options);\n\tlet interpolatedString = message;\n\ttry {\n\t\tinterpolatedString = formatMessage(message, {\n\t\t\tlocales: [libraryDefaultLocale],\n\t\t\tvariables: {\n\t\t\t\t...variables,\n\t\t\t\t[VAR_IDENTIFIER]: \"other\"\n\t\t\t}\n\t\t});\n\t} catch {\n\t\tlogger_default.warn(createInterpolationFailureMessage(message));\n\t\treturn message;\n\t}\n\tconst $_source = message;\n\tconst $_hash = options.$_hash || hashMessage(message, {\n\t\t$format: \"ICU\",\n\t\t...options\n\t});\n\tconst encodedOptions = {\n\t\t...options,\n\t\t$_source,\n\t\t$_hash\n\t};\n\tconst optionsEncoding = encode(JSON.stringify(encodedOptions));\n\treturn `${interpolatedString}:${optionsEncoding}`;\n}\n//#endregion\nexport { declareStatic, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getLocale, getLocaleProperties, getLocales, getVersionId, gtFallback, mFallback, msg, t };\n\n//# sourceMappingURL=index.mjs.map","import React from 'react';\n\n/**\n * Marks JSX children as derivable by the GT compiler and CLI.\n *\n * Use `<Derive>` inside translated JSX when child content is computed from\n * source code, but should still be discovered during extraction instead of\n * treated as a runtime interpolation variable. The CLI attempts to resolve the\n * derivable children into every possible static value and includes those values\n * in the source content that gets translated.\n *\n * `<Derive>` renders its children unchanged at runtime.\n *\n * Run `gt validate` after adding or changing `<Derive>` usage to verify that\n * each derivable expression can be resolved by the CLI before translating or\n * building.\n *\n * @example\n * ```jsx\n * function getSubject() {\n * return (Math.random() > 0.5) ? \"Alice\" : \"Brian\";\n * }\n * ...\n * <T>\n * <Derive>\n * {getSubject()}\n * </Derive>\n * is going to school today.\n * </T>\n * ```\n *\n * @param {T extends React.ReactNode} children - JSX content to derive for translation extraction.\n * @returns {T} The same children, unchanged at runtime.\n */\nfunction Derive<T extends React.ReactNode>({ children }: { children: T }): T {\n return children;\n}\n\n/**\n * @deprecated Use `<Derive>` instead.\n *\n * Marks JSX children as derivable by the GT compiler and CLI.\n *\n * Use `<Derive>` instead of `<Static>` for new code. This alias is kept for\n * backwards compatibility and renders its children unchanged at runtime.\n *\n * Run `gt validate` after adding or changing derived JSX content to verify that\n * each derivable expression can be resolved by the CLI before translating or\n * building.\n *\n * @example\n * ```jsx\n * function getSubject() {\n * return (Math.random() > 0.5) ? \"Alice\" : \"Brian\";\n * }\n * ...\n * <T>\n * <Static>\n * {getSubject()}\n * </Static>\n * is going to school today.\n * </T>\n * ```\n *\n * @param {T extends React.ReactNode} children - JSX content to derive for translation extraction.\n * @returns {T} The same children, unchanged at runtime.\n */\nfunction Static<T extends React.ReactNode>(props: { children: T }): T {\n return Derive(props);\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nDerive._gtt = 'derive';\nStatic._gtt = 'derive';\n\nexport { Derive, Static };\n"],"x_google_ignoreList":[4,5,6,7,10,11,12,13,14,15,16,17,18,19,20,21,22,23],"mappings":"y9BAMA,SAAgB,EAAI,EAAwB,EAAqB,CAC/D,GAAI,GAAc,KAChB,MAAU,MAAM,4CAA4C,CAK9D,OAFS,EAAW,GAWtB,SAAgB,EACd,EACA,EACA,EACA,CAEE,EAAW,GAAgB,ECrB/B,MAAM,EAA2B,GAC/B,uCAAuC,EAAI,GAU7C,SAAwB,EACtB,EACA,EAAiB,GACI,CACrB,IAAM,EAAiC,EAAE,CACz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CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,KACA,IACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,IACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,KACA,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,QAAS,CACL,IACA,IACA,KACA,KACH,CACD,SAAU,CACN,IACA,KACA,KACA,IACH,CACD,QAAS,CACL,IACA,IACA,KACH,CACD,SAAU,CACN,IACA,KACA,IACA,KACH,CACD,QAAS,CACL,IACA,KACA,IACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACA,KACH,CACD,QAAS,CACL,IACA,KACA,IACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACH,CACD,QAAS,CACL,KACA,KACA,IACA,IACH,CACD,QAAS,CACL,KACA,IACA,IACH,CACD,QAAS,CACL,IACA,IACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACH,CACD,QAAS,CACL,KACA,IACA,IACH,CACD,QAAS,CACL,KACA,IACA,IACH,CACD,QAAS,CACL,KACA,KACA,IACA,IACH,CACD,QAAS,CACL,KACA,KACA,IACA,IACH,CACD,QAAS,CACL,KACA,IACA,KACA,IACH,CACD,QAAS,CACL,KACA,IACA,IACH,CACD,QAAS,CACL,IACA,KACA,KACA,IACH,CACJ,cC14CD,OAAO,eAAe,EAAS,aAAc,CAAE,MAAO,GAAM,CAAC,CAC7D,EAAQ,eAAiB,EACzB,IAAI,EAAA,IAAA,CAQJ,SAAS,EAAe,EAAU,EAAQ,CAEtC,IAAK,IADD,EAAe,GACV,EAAa,EAAG,EAAa,EAAS,OAAQ,IAAc,CACjE,IAAI,EAAc,EAAS,OAAO,EAAW,CAC7C,GAAI,IAAgB,IAAK,CAErB,IADA,IAAI,EAAc,EACX,EAAa,EAAI,EAAS,QAC7B,EAAS,OAAO,EAAa,EAAE,GAAK,GACpC,IACA,IAEJ,IAAI,EAAU,GAAK,EAAc,GAC7B,EAAe,EAAc,EAAI,EAAI,GAAK,GAAe,GACzD,EAAgB,IAChB,EAAW,EAA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C3E,OAAO,EAgCT,SAAS,GAAkC,EAA2B,CACpE,OAAO,GAAO,EAAM,CAItB,GAAO,KAAO,SACd,GAAO,KAAO"}
1
+ {"version":3,"file":"internal.cjs.min.cjs","names":["u64.split","TYPE","TYPE$1","React","handleSingleChildElement","handleSingleChild","Children","React","getPluralForm","React","React","React","formatMessage$1"],"sources":["../src/dictionaries/indexDict.ts","../src/internal/flattenDictionary.ts","../../core/dist/base64-r7YWJYWt.mjs","../../core/dist/isVariable-fAKEB7gF.mjs","../../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/utils.js","../../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/_md.js","../../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/_u64.js","../../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/sha2.js","../../format/dist/IntlCache-ywLCPDGw.mjs","../../format/dist/internal.mjs","../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/error.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/types.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/regex.generated.js","../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.16/node_modules/@formatjs/icu-skeleton-parser/date-time.js","../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.16/node_modules/@formatjs/icu-skeleton-parser/regex.generated.js","../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.16/node_modules/@formatjs/icu-skeleton-parser/number.js","../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.16/node_modules/@formatjs/icu-skeleton-parser/index.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/time-data.generated.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/date-time-pattern-generator.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/parser.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/manipulator.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/index.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/printer.js","../../core/dist/internal.mjs","../src/internal/addGTIdentifier.ts","../src/errors-dir/constants.ts","../src/errors-dir/diagnostics.ts","../src/errors-dir/createErrors.ts","../src/internal/removeInjectedT.ts","../src/variables/getVariableName.ts","../src/utils/utils.tsx","../../format/dist/types-DY1ZTHWr.mjs","../src/internal/writeChildrenAsObjects.ts","../src/branches/plurals/getPluralBranch.ts","../src/dictionaries/getDictionaryEntry.ts","../src/dictionaries/getEntryAndMetadata.ts","../src/variables/_getVariableProps.ts","../src/rendering/isVariableObject.ts","../src/rendering/getGTTag.ts","../src/rendering/renderDefaultChildren.tsx","../src/rendering/renderTranslatedChildren.tsx","../src/rendering/getDefaultRenderSettings.ts","../src/rendering/renderSkeleton.tsx","../src/utils/cookies.ts","../src/dictionaries/isDictionaryEntry.ts","../src/dictionaries/mergeDictionaries.ts","../src/promises/reactHasUse.ts","../src/dictionaries/getSubtree.ts","../src/dictionaries/injectEntry.ts","../src/dictionaries/stripMetadataFromEntries.ts","../../core/dist/id-DEaFhGqX.mjs","../src/dictionaries/injectHashes.ts","../src/dictionaries/injectTranslations.ts","../src/dictionaries/injectFallbacks.ts","../src/dictionaries/injectAndMerge.ts","../src/dictionaries/collectUntranslatedEntries.ts","../../i18n/dist/isEncodedTranslationOptions-BOwWa_-J.mjs","../../i18n/dist/versionId-BkJZGHXr.mjs","../../i18n/dist/mFallback-pqVm9wDk.mjs","../../i18n/dist/index.mjs","../src/variables/Derive.tsx"],"sourcesContent":["import { Dictionary, DictionaryEntry } from '../types-dir/types';\n/**\n * @description A function that gets a value from a dictionary, only one level\n * @param dictionary - dictionary to get the value from\n * @param id - id of the value to get\n */\nexport function get(dictionary: Dictionary, id: string | number) {\n if (dictionary == null) {\n throw new Error('Cannot index into an undefined dictionary');\n }\n if (Array.isArray(dictionary)) {\n return dictionary[id as number];\n }\n return dictionary[id as string];\n}\n\n/**\n * @description A function that sets a value in a dictionary\n * @param dictionary - dictionary to set the value in\n * @param id - id of the value to set\n * @param value - value to set\n */\nexport function set(\n dictionary: Dictionary,\n id: string | number,\n value: Dictionary | DictionaryEntry\n) {\n if (Array.isArray(dictionary)) {\n dictionary[id as number] = value;\n } else {\n (dictionary as Record<string, Dictionary | DictionaryEntry>)[id as string] =\n value;\n }\n}\n","import { get } from '../dictionaries/indexDict';\nimport {\n Dictionary,\n DictionaryEntry,\n FlattenedDictionary,\n} from '../types-dir/types';\n\nconst createDuplicateKeyError = (key: string) =>\n `Duplicate key found in dictionary: \"${key}\"`;\n\n/**\n * Flattens a nested dictionary by concatenating nested keys.\n * Throws an error if two keys result in the same flattened key.\n * @param {Record<string, any>} dictionary - The dictionary to flatten.\n * @param {string} [prefix=''] - The prefix for nested keys.\n * @returns {Record<string, React.ReactNode>} The flattened dictionary object.\n * @throws {Error} If two keys result in the same flattened key.\n */\nexport default function flattenDictionary(\n dictionary: Dictionary,\n prefix: string = ''\n): FlattenedDictionary {\n const flattened: FlattenedDictionary = {};\n for (const key in dictionary) {\n if (dictionary.hasOwnProperty(key)) {\n const newKey = prefix ? `${prefix}.${key}` : key;\n if (\n typeof get(dictionary, key) === 'object' &&\n get(dictionary, key) !== null &&\n !Array.isArray(get(dictionary, key))\n ) {\n const nestedFlattened = flattenDictionary(\n get(dictionary, key) as Dictionary,\n newKey\n );\n for (const flatKey in nestedFlattened) {\n if (flattened.hasOwnProperty(flatKey)) {\n throw new Error(createDuplicateKeyError(flatKey));\n }\n flattened[flatKey] = nestedFlattened[flatKey];\n }\n } else {\n if (flattened.hasOwnProperty(newKey)) {\n throw new Error(createDuplicateKeyError(newKey));\n }\n flattened[newKey] = get(dictionary, key) as DictionaryEntry;\n }\n }\n }\n return flattened;\n}\n","//#region src/settings/settings.ts\nconst libraryDefaultLocale = \"en\";\nconst defaultTimeout = 6e4;\n//#endregion\n//#region src/logging/diagnostics.ts\nfunction ensureSentence(text) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return \"\";\n\treturn /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;\n}\nfunction stripSentence(text) {\n\tconst trimmed = text.trim();\n\tlet end = trimmed.length;\n\twhile (end > 0) {\n\t\tconst char = trimmed[end - 1];\n\t\tif (char !== \".\" && char !== \"!\" && char !== \"?\") break;\n\t\tend -= 1;\n\t}\n\treturn trimmed.slice(0, end);\n}\nfunction lowercaseFirstWord(text) {\n\treturn text.replace(/^[A-Z][a-z]/, (match) => match.toLowerCase());\n}\nfunction formatDetails(details) {\n\tif (!details) return \"\";\n\tconst detailText = Array.isArray(details) ? details.join(\", \") : details;\n\tif (!detailText.trim()) return \"\";\n\treturn ensureSentence(`Details: ${detailText}`);\n}\nfunction formatDiagnosticErrorDetails(error) {\n\tif (error == null) return void 0;\n\treturn String(error);\n}\nfunction createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {\n\tconst prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : \"\";\n\tconst whatAndWhy = why ? `${stripSentence(whatHappened)} because ${lowercaseFirstWord(stripSentence(why))}` : whatHappened;\n\tconst shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));\n\tconst messageParts = [\n\t\twhatAndWhy,\n\t\treassurance,\n\t\tshouldCombineWayOut ? `${stripSentence(fix)}, or ${lowercaseFirstWord(stripSentence(wayOut))}` : fix,\n\t\tshouldCombineWayOut ? void 0 : wayOut,\n\t\tformatDetails(details)\n\t].filter((part) => !!part).map(ensureSentence);\n\tif (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);\n\tconst message = messageParts.join(\" \");\n\treturn prefix ? `${prefix} ${message}` : message;\n}\n//#endregion\n//#region src/settings/settingsUrls.ts\nconst defaultCacheUrl = \"https://cdn.gtx.dev\";\nconst defaultBaseUrl = \"https://api2.gtx.dev\";\nconst defaultRuntimeApiUrl = \"https://runtime2.gtx.dev\";\n//#endregion\n//#region src/utils/isSupportedFileFormatTransform.ts\nconst SUPPORTED_TRANSFORMATIONS = {\n\tGTJSON: [\"GTJSON\"],\n\tJSON: [\"JSON\"],\n\tPO: [\"PO\"],\n\tPOT: [\"POT\", \"PO\"],\n\tYAML: [\"YAML\"],\n\tMDX: [\"MDX\"],\n\tMD: [\"MD\"],\n\tTS: [\"TS\"],\n\tJS: [\"JS\"],\n\tHTML: [\"HTML\"],\n\tTXT: [\"TXT\"],\n\tTWILIO_CONTENT_JSON: [\"TWILIO_CONTENT_JSON\"]\n};\n/**\n* This function checks if a file format transformation is supported during translation\n* @param from - The source file format.\n* @param to - The target file format.\n* @returns True if the transformation is supported, false otherwise\n*/\nfunction isSupportedFileFormatTransform(from, to) {\n\treturn SUPPORTED_TRANSFORMATIONS[from]?.includes(to) ?? false;\n}\n//#endregion\n//#region src/translate/utils/validateFileFormatTransform.ts\n/**\n* Returns a user-facing validation error when a requested file format transform\n* is missing source format context or is not currently supported.\n*/\nfunction getFileFormatTransformError(file) {\n\tif (!file.transformFormat) return void 0;\n\tconst fileLabel = file.fileName ?? file.fileId ?? \"unknown file\";\n\tif (!file.fileFormat) return `fileFormat is required when transformFormat is provided for ${fileLabel}`;\n\tif (!isSupportedFileFormatTransform(file.fileFormat, file.transformFormat)) return `Unsupported file format transform: ${file.fileFormat} -> ${file.transformFormat}`;\n}\n/**\n* Validates file format transforms before sending upload/enqueue requests.\n*/\nfunction validateFileFormatTransforms(files) {\n\tfor (const file of files) {\n\t\tconst error = getFileFormatTransformError(file);\n\t\tif (error) throw new Error(error);\n\t}\n}\n//#endregion\n//#region src/utils/base64.ts\nfunction encode(data) {\n\tif (typeof Buffer !== \"undefined\") return Buffer.from(data, \"utf8\").toString(\"base64\");\n\tconst bytes = new TextEncoder().encode(data);\n\tlet binary = \"\";\n\tfor (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);\n\treturn btoa(binary);\n}\nfunction decode(base64) {\n\tif (typeof Buffer !== \"undefined\") return Buffer.from(base64, \"base64\").toString(\"utf8\");\n\tconst binary = atob(base64);\n\tconst bytes = new Uint8Array(binary.length);\n\tfor (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);\n\treturn new TextDecoder().decode(bytes);\n}\n//#endregion\nexport { defaultBaseUrl as a, createDiagnosticMessage as c, libraryDefaultLocale as d, isSupportedFileFormatTransform as i, formatDiagnosticErrorDetails as l, encode as n, defaultCacheUrl as o, validateFileFormatTransforms as r, defaultRuntimeApiUrl as s, decode as t, defaultTimeout as u };\n\n//# sourceMappingURL=base64-r7YWJYWt.mjs.map","//#region src/utils/stableStringify.ts\n/**\n* Deterministic JSON stringification with sorted object keys.\n* Drop-in replacement for `fast-json-stable-stringify` for plain\n* JSON-compatible data (no toJSON, no circular references).\n*/\nfunction _stringify(node) {\n\tif (node === void 0) return void 0;\n\tif (node === null) return \"null\";\n\tif (typeof node === \"number\") return isFinite(node) ? \"\" + node : \"null\";\n\tif (typeof node !== \"object\") return JSON.stringify(node);\n\tif (Array.isArray(node)) {\n\t\tlet out = \"[\";\n\t\tfor (let i = 0; i < node.length; i++) {\n\t\t\tif (i) out += \",\";\n\t\t\tout += _stringify(node[i]) || \"null\";\n\t\t}\n\t\treturn out + \"]\";\n\t}\n\tconst keys = Object.keys(node).sort();\n\tlet out = \"\";\n\tfor (const key of keys) {\n\t\tconst value = _stringify(node[key]);\n\t\tif (!value) continue;\n\t\tif (out) out += \",\";\n\t\tout += JSON.stringify(key) + \":\" + value;\n\t}\n\treturn \"{\" + out + \"}\";\n}\nfunction stableStringify(data) {\n\treturn _stringify(data) ?? \"\";\n}\n//#endregion\n//#region src/utils/isVariable.ts\nfunction isVariable(obj) {\n\tconst variableObj = obj;\n\tif (variableObj && typeof variableObj === \"object\" && typeof variableObj.k === \"string\") {\n\t\tconst k = Object.keys(variableObj);\n\t\tif (k.length === 1) return true;\n\t\tif (k.length === 2) {\n\t\t\tif (typeof variableObj.i === \"number\") return true;\n\t\t\tif (typeof variableObj.v === \"string\") return true;\n\t\t}\n\t\tif (k.length === 3) {\n\t\t\tif (typeof variableObj.v === \"string\" && typeof variableObj.i === \"number\") return true;\n\t\t}\n\t}\n\treturn false;\n}\n//#endregion\nexport { stableStringify as n, isVariable as t };\n\n//# sourceMappingURL=isVariable-fAKEB7gF.mjs.map","/**\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 */\nexport 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 ||\n (ArrayBuffer.isView(a) &&\n a.constructor.name === 'Uint8Array' &&\n 'BYTES_PER_ELEMENT' in a &&\n 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 */\nexport function anumber(n, title = '') {\n if (typeof n !== 'number') {\n const prefix = title && `\"${title}\" `;\n throw new TypeError(`${prefix}expected number, got ${typeof n}`);\n }\n if (!Number.isSafeInteger(n) || n < 0) {\n const prefix = title && `\"${title}\" `;\n throw new RangeError(`${prefix}expected integer >= 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 */\nexport function abytes(value, length, title = '') {\n const bytes = isBytes(value);\n const len = value?.length;\n const needsLen = length !== undefined;\n if (!bytes || (needsLen && len !== length)) {\n const prefix = title && `\"${title}\" `;\n const ofLen = needsLen ? ` of length ${length}` : '';\n const got = bytes ? `length=${len}` : `type=${typeof value}`;\n const message = prefix + 'expected Uint8Array' + ofLen + ', got ' + got;\n if (!bytes)\n throw new TypeError(message);\n throw new RangeError(message);\n }\n return value;\n}\n/**\n * Copies bytes into a fresh Uint8Array.\n * Buffer-style slices can alias the same backing store, so callers that need ownership should copy.\n * @param bytes - source bytes to clone\n * @returns Freshly allocated copy of `bytes`.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Clone a byte array before mutating it.\n * ```ts\n * const copy = copyBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function copyBytes(bytes) {\n // `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict\n // because callers use it at byte-validation boundaries before mutating the detached copy.\n return Uint8Array.from(abytes(bytes));\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 */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n 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 < 1)\n throw new Error('\"outputLen\" must be >= 1');\n if (h.blockLen < 1)\n throw new Error('\"blockLen\" must be >= 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 */\nexport function aexists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n 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 */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'digestInto() output');\n const min = instance.outputLen;\n if (out.length < min) {\n throw new RangeError('\"digestInto() output\" expected to be of length >=' + min);\n }\n}\n/**\n * Casts a typed array view to Uint8Array.\n * @param arr - source typed array\n * @returns Uint8Array view over the same buffer.\n * @example\n * Reinterpret a typed array as bytes.\n * ```ts\n * u8(new Uint32Array([1, 2]));\n * ```\n */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\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 */\nexport 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 */\nexport function clean(...arrays) {\n for (let i = 0; i < 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 */\nexport 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 */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> 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 */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Whether the current platform is little-endian. */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).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 */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/**\n * Conditionally byte-swaps one 32-bit word on big-endian platforms.\n * @param n - source word\n * @returns Original or byte-swapped word depending on platform endianness.\n * @example\n * Normalize a 32-bit word for host endianness.\n * ```ts\n * swap8IfBE(0x11223344);\n * ```\n */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n) >>> 0;\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 */\nexport function byteSwap32(arr) {\n for (let i = 0; i < 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 */\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string.\n * Uses the built-in function when available and assumes it matches the tested\n * fallback semantics.\n * @param bytes - bytes to encode\n * @returns Lowercase hexadecimal string.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Convert bytes to lowercase hexadecimal.\n * ```ts\n * bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'\n * ```\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };\nfunction asciiToBase16(ch) {\n if (ch >= asciis._0 && ch <= asciis._9)\n return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F)\n return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f)\n return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @param hex - hexadecimal string to decode\n * @returns Decoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Decode lowercase hexadecimal into bytes.\n * ```ts\n * hexToBytes('cafe0123'); // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n * ```\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new TypeError('hex string expected, got ' + typeof hex);\n if (hasHexBuiltin) {\n try {\n return Uint8Array.fromHex(hex);\n }\n catch (error) {\n if (error instanceof SyntaxError)\n throw new RangeError(error.message);\n throw error;\n }\n }\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new RangeError('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new RangeError('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * This yields to the Promise/microtask scheduler queue, not to timers or the\n * full macrotask event loop.\n * @example\n * Yield to the next scheduler tick.\n * ```ts\n * await nextTick();\n * ```\n */\nexport const nextTick = async () => { };\n/**\n * Returns control to the Promise/microtask scheduler every `tick`\n * milliseconds to avoid blocking long loops.\n * @param iters - number of loop iterations to run\n * @param tick - maximum time slice in milliseconds\n * @param cb - callback executed on each iteration\n * @example\n * Run a loop that periodically yields back to the event loop.\n * ```ts\n * await asyncLoop(2, 0, () => {});\n * ```\n */\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * Non-ASCII details are delegated to the platform `TextEncoder`.\n * @param str - string to encode\n * @returns UTF-8 encoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Encode a string as UTF-8 bytes.\n * ```ts\n * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99])\n * ```\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new TypeError('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Helper for KDFs: consumes Uint8Array or string.\n * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.\n * @param data - user-provided KDF input\n * @param errorTitle - label included in thrown errors\n * @returns Byte representation of the input.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Normalize KDF input to bytes.\n * ```ts\n * kdfInputToBytes('password');\n * ```\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/**\n * Copies several Uint8Arrays into one.\n * @param arrays - arrays to concatenate\n * @returns Concatenated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Concatenate multiple byte arrays.\n * ```ts\n * concatBytes(new Uint8Array([1]), new Uint8Array([2]));\n * ```\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/**\n * Merges default options and passed options.\n * @param defaults - base option object\n * @param opts - user overrides\n * @returns Merged option object. The merge mutates `defaults` in place.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Merge user overrides onto default options.\n * ```ts\n * checkOpts({ dkLen: 32 }, { asyncTick: 10 });\n * ```\n */\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new TypeError('options must be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\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 */\nexport function createHasher(hashCons, info = {}) {\n const hashC = (msg, opts) => hashCons(opts)\n .update(msg)\n .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) => hashCons(opts);\n Object.assign(hashC, info);\n return Object.freeze(hashC);\n}\n/**\n * Cryptographically secure PRNG backed by `crypto.getRandomValues`.\n * @param bytesLength - number of random bytes to generate\n * @returns Random bytes.\n * The platform `getRandomValues()` implementation still defines any\n * single-call length cap, and this helper rejects oversize requests\n * with a stable library `RangeError` instead of host-specific errors.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If the current runtime does not provide `crypto.getRandomValues`. {@link Error}\n * @example\n * Generate a fresh random key or nonce.\n * ```ts\n * const key = randomBytes(16);\n * ```\n */\nexport function randomBytes(bytesLength = 32) {\n // Match the repo's other length-taking helpers instead of relying on Uint8Array coercion.\n anumber(bytesLength, 'bytesLength');\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n // Web Cryptography API Level 2 §10.1.1:\n // if `byteLength > 65536`, throw `QuotaExceededError`.\n // Keep the guard explicit so callers can see the quota in code\n // instead of discovering it by reading the spec or host errors.\n // This wrapper surfaces the same quota as a stable library RangeError.\n if (bytesLength > 65536)\n throw new RangeError(`\"bytesLength\" expected <= 65536, got ${bytesLength}`);\n return cr.getRandomValues(new Uint8Array(bytesLength));\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 */\nexport const oidNist = (suffix) => ({\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([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]),\n});\n//# sourceMappingURL=utils.js.map","/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { abytes, aexists, aoutput, clean, createView, } from \"./utils.js\";\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 */\nexport function Chi(a, b, c) {\n return (a & b) ^ (~a & 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 */\nexport function Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & 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 */\nexport class HashMD {\n blockLen;\n outputLen;\n canXOF = false;\n padOffset;\n isLE;\n // For partial updates less than block size\n buffer;\n view;\n finished = false;\n length = 0;\n pos = 0;\n destroyed = false;\n constructor(blockLen, outputLen, padOffset, isLE) {\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 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 < 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 <= len - pos; pos += blockLen)\n 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 > 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 < blockLen; i++)\n 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)\n throw new Error('_sha2: outputLen must be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length)\n throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++)\n 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 ||= 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)\n to.buffer.set(buffer);\n return to;\n }\n clone() {\n return this._cloneInto();\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 */\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. */\nexport const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 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. */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 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. */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 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. */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n//# sourceMappingURL=_md.js.map","const 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)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\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 < len; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\n// Combine explicit `(high, low)` 32-bit halves into a bigint; `>>> 0` normalizes signed JS\n// bitwise results back to uint32 first, and little-endian callers must swap.\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`.\nconst shrSH = (h, _l, s) => h >>> s;\n// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`.\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> 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) => (h << (64 - s)) | (l >>> (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) => (h >>> (s - 32)) | (l << (64 - s));\n// High 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped low half.\nconst rotr32H = (_h, l) => l;\n// Low 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped high half.\nconst rotr32L = (h, _l) => h;\n// High 32-bit half of a 64-bit left rotate, valid for `s` in `1..31`.\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\n// Low 32-bit half of a 64-bit left rotate, valid for `s` in `1..31`.\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (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) => (l << (s - 32)) | (h >>> (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) => (h << (s - 32)) | (l >>> (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 >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\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) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\n// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`.\nconst add3H = (low, Ah, Bh, Ch) => (Ah + 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) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 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) => (Ah + 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) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 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) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig };\n// Canonical grouped namespace for callers that prefer one object.\n// Named exports stay for direct imports.\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\n// Default export mirrors named `u64` for compatibility with object-style imports.\nexport default u64;\n//# sourceMappingURL=_u64.js.map","/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}.\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, oidNist, rotr } from \"./utils.js\";\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 */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\n/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */\nclass SHA2_32B extends HashMD {\n constructor(outputLen) {\n super(64, outputLen, 8, false);\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\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 < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 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 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 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 < 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}\n/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */\nexport class _SHA256 extends SHA2_32B {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n A = SHA256_IV[0] | 0;\n B = SHA256_IV[1] | 0;\n C = SHA256_IV[2] | 0;\n D = SHA256_IV[3] | 0;\n E = SHA256_IV[4] | 0;\n F = SHA256_IV[5] | 0;\n G = SHA256_IV[6] | 0;\n H = SHA256_IV[7] | 0;\n constructor() {\n super(32);\n }\n}\n/** Internal SHA-224 hash class grounded in RFC 6234 §6.2 and §8.5. */\nexport class _SHA224 extends SHA2_32B {\n A = SHA224_IV[0] | 0;\n B = SHA224_IV[1] | 0;\n C = SHA224_IV[2] | 0;\n D = SHA224_IV[3] | 0;\n E = SHA224_IV[4] | 0;\n F = SHA224_IV[5] | 0;\n G = SHA224_IV[6] | 0;\n H = SHA224_IV[7] | 0;\n constructor() {\n super(28);\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__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[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. */\nclass SHA2_64B extends HashMD {\n constructor(outputLen) {\n super(128, outputLen, 16, false);\n }\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 [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\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 < 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 < 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 = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.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 = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.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 < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.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 = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & 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 } = u64.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 = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.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 } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.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}\n/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA512 extends SHA2_64B {\n Ah = SHA512_IV[0] | 0;\n Al = SHA512_IV[1] | 0;\n Bh = SHA512_IV[2] | 0;\n Bl = SHA512_IV[3] | 0;\n Ch = SHA512_IV[4] | 0;\n Cl = SHA512_IV[5] | 0;\n Dh = SHA512_IV[6] | 0;\n Dl = SHA512_IV[7] | 0;\n Eh = SHA512_IV[8] | 0;\n El = SHA512_IV[9] | 0;\n Fh = SHA512_IV[10] | 0;\n Fl = SHA512_IV[11] | 0;\n Gh = SHA512_IV[12] | 0;\n Gl = SHA512_IV[13] | 0;\n Hh = SHA512_IV[14] | 0;\n Hl = SHA512_IV[15] | 0;\n constructor() {\n super(64);\n }\n}\n/** Internal SHA-384 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA384 extends SHA2_64B {\n Ah = SHA384_IV[0] | 0;\n Al = SHA384_IV[1] | 0;\n Bh = SHA384_IV[2] | 0;\n Bl = SHA384_IV[3] | 0;\n Ch = SHA384_IV[4] | 0;\n Cl = SHA384_IV[5] | 0;\n Dh = SHA384_IV[6] | 0;\n Dl = SHA384_IV[7] | 0;\n Eh = SHA384_IV[8] | 0;\n El = SHA384_IV[9] | 0;\n Fh = SHA384_IV[10] | 0;\n Fl = SHA384_IV[11] | 0;\n Gh = SHA384_IV[12] | 0;\n Gl = SHA384_IV[13] | 0;\n Hh = SHA384_IV[14] | 0;\n Hl = SHA384_IV[15] | 0;\n constructor() {\n super(48);\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See the repo-side derivation recipe in `test/misc/sha2-gen-iv.js`.\n * These IV literals are checked against that script rather than a dedicated\n * local RFC section.\n */\n/** SHA-512/224 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA-512/256 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n/** Internal SHA-512/224 hash class using the derived `T224_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_224 extends SHA2_64B {\n Ah = T224_IV[0] | 0;\n Al = T224_IV[1] | 0;\n Bh = T224_IV[2] | 0;\n Bl = T224_IV[3] | 0;\n Ch = T224_IV[4] | 0;\n Cl = T224_IV[5] | 0;\n Dh = T224_IV[6] | 0;\n Dl = T224_IV[7] | 0;\n Eh = T224_IV[8] | 0;\n El = T224_IV[9] | 0;\n Fh = T224_IV[10] | 0;\n Fl = T224_IV[11] | 0;\n Gh = T224_IV[12] | 0;\n Gl = T224_IV[13] | 0;\n Hh = T224_IV[14] | 0;\n Hl = T224_IV[15] | 0;\n constructor() {\n super(28);\n }\n}\n/** Internal SHA-512/256 hash class using the derived `T256_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_256 extends SHA2_64B {\n Ah = T256_IV[0] | 0;\n Al = T256_IV[1] | 0;\n Bh = T256_IV[2] | 0;\n Bl = T256_IV[3] | 0;\n Ch = T256_IV[4] | 0;\n Cl = T256_IV[5] | 0;\n Dh = T256_IV[6] | 0;\n Dl = T256_IV[7] | 0;\n Eh = T256_IV[8] | 0;\n El = T256_IV[9] | 0;\n Fh = T256_IV[10] | 0;\n Fl = T256_IV[11] | 0;\n Gh = T256_IV[12] | 0;\n Gl = T256_IV[13] | 0;\n Hh = T256_IV[14] | 0;\n Hl = T256_IV[15] | 0;\n constructor() {\n super(32);\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 */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), \n/* @__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 */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new _SHA224(), \n/* @__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 */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new _SHA512(), \n/* @__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 */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new _SHA384(), \n/* @__PURE__ */ oidNist(0x02));\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/256.\n * ```ts\n * sha512_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new _SHA512_256(), \n/* @__PURE__ */ oidNist(0x06));\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/224.\n * ```ts\n * sha512_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new _SHA512_224(), \n/* @__PURE__ */ oidNist(0x05));\n//# sourceMappingURL=sha2.js.map","//#region src/errors/formattingErrors.ts\nconst createInvalidCutoffStyleError = (style) => `generaltranslation Formatting Error: Invalid cutoff style: ${style}.`;\nconst DEFAULT_TERMINATOR_KEY = \"DEFAULT_TERMINATOR_KEY\";\nconst TERMINATOR_MAP = {\n\tellipsis: {\n\t\tfr: {\n\t\t\tterminator: \"…\",\n\t\t\tseparator: \" \"\n\t\t},\n\t\tzh: {\n\t\t\tterminator: \"……\",\n\t\t\tseparator: void 0\n\t\t},\n\t\tja: {\n\t\t\tterminator: \"……\",\n\t\t\tseparator: void 0\n\t\t},\n\t\t[DEFAULT_TERMINATOR_KEY]: {\n\t\t\tterminator: \"…\",\n\t\t\tseparator: void 0\n\t\t}\n\t},\n\tnone: { [DEFAULT_TERMINATOR_KEY]: {\n\t\tterminator: void 0,\n\t\tseparator: void 0\n\t} }\n};\n//#endregion\n//#region src/formatting/custom-formats/CutoffFormat/CutoffFormat.ts\nvar CutoffFormatConstructor = class CutoffFormatConstructor {\n\tstatic resolveLocale(locales) {\n\t\ttry {\n\t\t\tconst localesList = !locales ? [\"en\"] : Array.isArray(locales) ? locales.map(String) : [String(locales)];\n\t\t\tconst [canonicalLocale] = Intl.getCanonicalLocales(localesList);\n\t\t\treturn canonicalLocale ?? \"en\";\n\t\t} catch {\n\t\t\treturn \"en\";\n\t\t}\n\t}\n\t/**\n\t* Constructor\n\t* @param {Intl.LocalesArgument} locales - The locales to use for formatting.\n\t* @param {CutoffFormatOptions} options - The options for formatting.\n\t* @param {number} [options.maxChars] - The maximum number of characters to display.\n\t* - Undefined values are treated as no cutoff.\n\t* - Negative values follow .slice() behavior and terminator will be added before the value.\n\t* - 0 will result in an empty string.\n\t* - If cutoff results in an empty string, no terminator is added.\n\t* @param {CutoffFormatStyle} [options.style='ellipsis'] - The style of the terminator.\n\t* @param {string} [options.terminator] - Optional override the terminator to use.\n\t* @param {string} [options.separator] - Optional override the separator to use between the terminator and the value.\n\t* - If no terminator is provided, then separator is ignored.\n\t*\n\t* @example\n\t* const format = new CutoffFormat('en', { maxChars: 5 });\n\t* format.format('Hello, world!'); // 'Hello...'\n\t*\n\t* const format = new CutoffFormat('en', { maxChars: -3 });\n\t* format.format('Hello, world!'); // '...ld!'\n\t*/\n\tconstructor(locales, options = {}) {\n\t\tthis.locale = CutoffFormatConstructor.resolveLocale(locales);\n\t\tconst style = options.style ?? \"ellipsis\";\n\t\tif (!TERMINATOR_MAP[style]) throw new Error(createInvalidCutoffStyleError(style));\n\t\tconst presetTerminatorOptions = options.maxChars === void 0 ? void 0 : TERMINATOR_MAP[style][new Intl.Locale(this.locale).language] || TERMINATOR_MAP[style][\"DEFAULT_TERMINATOR_KEY\"];\n\t\tlet terminator = options.terminator ?? presetTerminatorOptions?.terminator;\n\t\tlet separator = terminator != null ? options.separator ?? presetTerminatorOptions?.separator : void 0;\n\t\tthis.additionLength = (terminator?.length ?? 0) + (separator?.length ?? 0);\n\t\tif (options.maxChars !== void 0 && Math.abs(options.maxChars) < this.additionLength) {\n\t\t\tterminator = void 0;\n\t\t\tseparator = void 0;\n\t\t}\n\t\tthis.options = {\n\t\t\tmaxChars: options.maxChars,\n\t\t\tstyle: options.maxChars === void 0 ? void 0 : style,\n\t\t\tterminator,\n\t\t\tseparator\n\t\t};\n\t}\n\t/**\n\t* Format a value according to the cutoff options, returning a formatted string.\n\t*\n\t* @param {string} value - The string value to format with cutoff behavior.\n\t* @returns {string} The formatted string with terminator applied if cutoff occurs.\n\t*\n\t* @example\n\t* const formatter = new CutoffFormatConstructor('en', { maxChars: 8, style: 'ellipsis' });\n\t* formatter.format('Hello, world!'); // Returns 'Hello, w...'\n\t*/\n\tformat(value) {\n\t\treturn this.formatToParts(value).join(\"\");\n\t}\n\t/**\n\t* Format a value to parts according to the cutoff options, returning an array of string parts.\n\t* This method breaks down the formatted result into individual components for more granular control.\n\t*\n\t* @param {string} value - The string value to format with cutoff behavior.\n\t* @returns {PrependedCutoffParts | PostpendedCutoffParts} An array of string parts representing the formatted result.\n\t* - For positive maxChars: [cutoffValue, separator?, terminator?]\n\t* - For negative maxChars: [terminator?, separator?, cutoffValue]\n\t* - For no cutoff: [originalValue]\n\t*\n\t* @example\n\t* const formatter = new CutoffFormatConstructor('en', { maxChars: 5, style: 'ellipsis' });\n\t* formatter.formatToParts('Hello, world!'); // Returns ['Hello', '...']\n\t*/\n\tformatToParts(value) {\n\t\tconst { maxChars, terminator, separator } = this.options;\n\t\tconst adjustedChars = maxChars === void 0 || Math.abs(maxChars) >= value.length ? maxChars : maxChars >= 0 ? Math.max(0, maxChars - this.additionLength) : Math.min(0, maxChars + this.additionLength);\n\t\tconst slicedValue = adjustedChars !== void 0 && adjustedChars > -1 ? value.slice(0, adjustedChars) : value.slice(adjustedChars);\n\t\tif (maxChars == null || adjustedChars == null || adjustedChars === 0 || terminator == null || value.length <= Math.abs(maxChars)) return [slicedValue];\n\t\tif (adjustedChars > 0) return separator != null ? [\n\t\t\tslicedValue,\n\t\t\tseparator,\n\t\t\tterminator\n\t\t] : [slicedValue, terminator];\n\t\treturn separator != null ? [\n\t\t\tterminator,\n\t\t\tseparator,\n\t\t\tslicedValue\n\t\t] : [terminator, slicedValue];\n\t}\n\t/**\n\t* Get the resolved options\n\t* @returns {ResolvedCutoffFormatOptions} The resolved options.\n\t*/\n\tresolvedOptions() {\n\t\treturn this.options;\n\t}\n};\n//#endregion\n//#region src/cache/IntlCache.ts\n/**\n* Object mapping constructor names to their respective constructor functions\n* Includes all native Intl constructors plus custom ones like CutoffFormat\n*/\nconst CustomIntl = {\n\tCollator: Intl.Collator,\n\tDateTimeFormat: Intl.DateTimeFormat,\n\tDisplayNames: Intl.DisplayNames,\n\tListFormat: Intl.ListFormat,\n\tLocale: Intl.Locale,\n\tNumberFormat: Intl.NumberFormat,\n\tPluralRules: Intl.PluralRules,\n\tRelativeTimeFormat: Intl.RelativeTimeFormat,\n\tSegmenter: Intl.Segmenter,\n\tCutoffFormat: CutoffFormatConstructor\n};\n/**\n* Cache for Intl and custom format instances to avoid repeated instantiation\n* Uses a two-level structure: constructor name -> cache key -> instance.\n*/\nvar IntlCache = class {\n\tconstructor() {\n\t\tthis.cache = {};\n\t}\n\t/**\n\t* Generates a consistent cache key from locales and options.\n\t* Handles all LocalesArgument types (string, Locale, array, undefined).\n\t*/\n\tgenerateKey(locales, options = {}) {\n\t\treturn `${!locales ? \"undefined\" : Array.isArray(locales) ? locales.map((l) => String(l)).join(\",\") : String(locales)}:${options ? JSON.stringify(options, Object.keys(options).sort()) : \"{}\"}`;\n\t}\n\t/**\n\t* Gets a cached Intl instance or creates a new one if not found\n\t* @param constructor The name of the Intl constructor to use.\n\t* @param args Constructor arguments (locales, options).\n\t* @returns Cached or newly created Intl instance.\n\t*/\n\tget(constructor, ...args) {\n\t\tconst [locales = \"en\", options = {}] = args;\n\t\tconst key = this.generateKey(locales, options);\n\t\tlet cache = this.cache[constructor];\n\t\tif (cache === void 0) {\n\t\t\tcache = {};\n\t\t\tthis.cache[constructor] = cache;\n\t\t}\n\t\tlet intlObject = cache[key];\n\t\tif (intlObject === void 0) {\n\t\t\tintlObject = new CustomIntl[constructor](...args);\n\t\t\tcache[key] = intlObject;\n\t\t}\n\t\treturn intlObject;\n\t}\n};\n/**\n* Global instance of the Intl cache for use throughout the application\n*/\nconst intlCache = new IntlCache();\n//#endregion\nexport { intlCache as t };\n\n//# sourceMappingURL=IntlCache-ywLCPDGw.mjs.map","import { t as intlCache } from \"./IntlCache-ywLCPDGw.mjs\";\n//#region src/internal.ts\nfunction getCachedPluralRules(locales) {\n\treturn intlCache.get(\"PluralRules\", locales);\n}\n//#endregion\nexport { getCachedPluralRules };\n\n//# sourceMappingURL=internal.mjs.map","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ErrorKind = void 0;\nvar ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `<bold!>foo</bold!>) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo</123>`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (exports.ErrorKind = ErrorKind = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SKELETON_TYPE = exports.TYPE = void 0;\nexports.isLiteralElement = isLiteralElement;\nexports.isArgumentElement = isArgumentElement;\nexports.isNumberElement = isNumberElement;\nexports.isDateElement = isDateElement;\nexports.isTimeElement = isTimeElement;\nexports.isSelectElement = isSelectElement;\nexports.isPluralElement = isPluralElement;\nexports.isPoundElement = isPoundElement;\nexports.isTagElement = isTagElement;\nexports.isNumberSkeleton = isNumberSkeleton;\nexports.isDateTimeSkeleton = isDateTimeSkeleton;\nexports.createLiteralElement = createLiteralElement;\nexports.createNumberElement = createNumberElement;\nvar TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (exports.TYPE = TYPE = {}));\nvar SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (exports.SKELETON_TYPE = SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nfunction isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nfunction isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nfunction isNumberElement(el) {\n return el.type === TYPE.number;\n}\nfunction isDateElement(el) {\n return el.type === TYPE.date;\n}\nfunction isTimeElement(el) {\n return el.type === TYPE.time;\n}\nfunction isSelectElement(el) {\n return el.type === TYPE.select;\n}\nfunction isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nfunction isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nfunction isTagElement(el) {\n return el.type === TYPE.tag;\n}\nfunction isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nfunction isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nfunction createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nfunction createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WHITE_SPACE_REGEX = exports.SPACE_SEPARATOR_REGEX = void 0;\n// @generated from regex-gen.ts\nexports.SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexports.WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseDateTimeSkeleton = parseDateTimeSkeleton;\n/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nfunction parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: milliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WHITE_SPACE_REGEX = void 0;\n// @generated from regex-gen.ts\nexports.WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseNumberSkeletonFromString = parseNumberSkeletonFromString;\nexports.parseNumberSkeleton = parseNumberSkeleton;\nvar tslib_1 = require(\"tslib\");\nvar regex_generated_1 = require(\"./regex.generated\");\nfunction parseNumberSkeletonFromString(skeleton) {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty');\n }\n // Parse the skeleton\n var stringTokens = skeleton\n .split(regex_generated_1.WHITE_SPACE_REGEX)\n .filter(function (x) { return x.length > 0; });\n var tokens = [];\n for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {\n var stringToken = stringTokens_1[_i];\n var stemAndOptions = stringToken.split('/');\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n var stem = stemAndOptions[0], options = stemAndOptions.slice(1);\n for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {\n var option = options_1[_a];\n if (option.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n }\n tokens.push({ stem: stem, options: options });\n }\n return tokens;\n}\nfunction icuUnitToEcma(unit) {\n return unit.replace(/^(.*?)-/, '');\n}\nvar FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g;\nvar SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g;\nvar INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g;\nvar CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;\nfunction parseSignificantPrecision(str) {\n var result = {};\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision';\n }\n else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision';\n }\n str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits = g1.length;\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length;\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length;\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0);\n }\n return '';\n });\n return result;\n}\nfunction parseSign(str) {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n };\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n };\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n };\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n };\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n };\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n };\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n };\n }\n}\nfunction parseConciseScientificAndEngineeringStem(stem) {\n // Engineering\n var result;\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n };\n stem = stem.slice(2);\n }\n else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n };\n stem = stem.slice(1);\n }\n if (result) {\n var signDisplay = stem.slice(0, 2);\n if (signDisplay === '+!') {\n result.signDisplay = 'always';\n stem = stem.slice(2);\n }\n else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero';\n stem = stem.slice(2);\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation');\n }\n result.minimumIntegerDigits = stem.length;\n }\n return result;\n}\nfunction parseNotationOptions(opt) {\n var result = {};\n var signOpts = parseSign(opt);\n if (signOpts) {\n return signOpts;\n }\n return result;\n}\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nfunction parseNumberSkeleton(tokens) {\n var result = {};\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent';\n continue;\n case '%x100':\n result.style = 'percent';\n result.scale = 100;\n continue;\n case 'currency':\n result.style = 'currency';\n result.currency = token.options[0];\n continue;\n case 'group-off':\n case ',_':\n result.useGrouping = false;\n continue;\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0;\n continue;\n case 'measure-unit':\n case 'unit':\n result.style = 'unit';\n result.unit = icuUnitToEcma(token.options[0]);\n continue;\n case 'compact-short':\n case 'K':\n result.notation = 'compact';\n result.compactDisplay = 'short';\n continue;\n case 'compact-long':\n case 'KK':\n result.notation = 'compact';\n result.compactDisplay = 'long';\n continue;\n case 'scientific':\n result = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (tslib_1.__assign(tslib_1.__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'engineering':\n result = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (tslib_1.__assign(tslib_1.__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'notation-simple':\n result.notation = 'standard';\n continue;\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol';\n result.unitDisplay = 'narrow';\n continue;\n case 'unit-width-short':\n result.currencyDisplay = 'code';\n result.unitDisplay = 'short';\n continue;\n case 'unit-width-full-name':\n result.currencyDisplay = 'name';\n result.unitDisplay = 'long';\n continue;\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol';\n continue;\n case 'scale':\n result.scale = parseFloat(token.options[0]);\n continue;\n case 'rounding-mode-floor':\n result.roundingMode = 'floor';\n continue;\n case 'rounding-mode-ceiling':\n result.roundingMode = 'ceil';\n continue;\n case 'rounding-mode-down':\n result.roundingMode = 'trunc';\n continue;\n case 'rounding-mode-up':\n result.roundingMode = 'expand';\n continue;\n case 'rounding-mode-half-even':\n result.roundingMode = 'halfEven';\n continue;\n case 'rounding-mode-half-down':\n result.roundingMode = 'halfTrunc';\n continue;\n case 'rounding-mode-half-up':\n result.roundingMode = 'halfExpand';\n continue;\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError('integer-width stems only accept a single optional option');\n }\n token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {\n if (g1) {\n result.minimumIntegerDigits = g2.length;\n }\n else if (g3 && g4) {\n throw new Error('We currently do not support maximum integer digits');\n }\n else if (g5) {\n throw new Error('We currently do not support exact integer digits');\n }\n return '';\n });\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length;\n continue;\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError('Fraction-precision stems only accept a single optional option');\n }\n token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length;\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length;\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length;\n result.maximumFractionDigits = g4.length + g5.length;\n }\n else {\n result.minimumFractionDigits = g1.length;\n result.maximumFractionDigits = g1.length;\n }\n return '';\n });\n var opt = token.options[0];\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = tslib_1.__assign(tslib_1.__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });\n }\n else if (opt) {\n result = tslib_1.__assign(tslib_1.__assign({}, result), parseSignificantPrecision(opt));\n }\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = tslib_1.__assign(tslib_1.__assign({}, result), parseSignificantPrecision(token.stem));\n continue;\n }\n var signOpts = parseSign(token.stem);\n if (signOpts) {\n result = tslib_1.__assign(tslib_1.__assign({}, result), signOpts);\n }\n var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);\n if (conciseScientificAndEngineeringOpts) {\n result = tslib_1.__assign(tslib_1.__assign({}, result), conciseScientificAndEngineeringOpts);\n }\n }\n return result;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./date-time\"), exports);\ntslib_1.__exportStar(require(\"./number\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.timeData = void 0;\n// @generated from time-data-gen.ts\n// prettier-ignore \nexports.timeData = {\n \"001\": [\n \"H\",\n \"h\"\n ],\n \"419\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AD\": [\n \"H\",\n \"hB\"\n ],\n \"AE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"AF\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"AG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AL\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"AM\": [\n \"H\",\n \"hB\"\n ],\n \"AO\": [\n \"H\",\n \"hB\"\n ],\n \"AR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AS\": [\n \"h\",\n \"H\"\n ],\n \"AT\": [\n \"H\",\n \"hB\"\n ],\n \"AU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AW\": [\n \"H\",\n \"hB\"\n ],\n \"AX\": [\n \"H\"\n ],\n \"AZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BD\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"BE\": [\n \"H\",\n \"hB\"\n ],\n \"BF\": [\n \"H\",\n \"hB\"\n ],\n \"BG\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"BI\": [\n \"H\",\n \"h\"\n ],\n \"BJ\": [\n \"H\",\n \"hB\"\n ],\n \"BL\": [\n \"H\",\n \"hB\"\n ],\n \"BM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BN\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"BO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"BQ\": [\n \"H\"\n ],\n \"BR\": [\n \"H\",\n \"hB\"\n ],\n \"BS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BT\": [\n \"h\",\n \"H\"\n ],\n \"BW\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BY\": [\n \"H\",\n \"h\"\n ],\n \"BZ\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CA\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"CC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CD\": [\n \"hB\",\n \"H\"\n ],\n \"CF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CG\": [\n \"H\",\n \"hB\"\n ],\n \"CH\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"CI\": [\n \"H\",\n \"hB\"\n ],\n \"CK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CL\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CN\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"CO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CP\": [\n \"H\"\n ],\n \"CR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CU\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CV\": [\n \"H\",\n \"hB\"\n ],\n \"CW\": [\n \"H\",\n \"hB\"\n ],\n \"CX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CY\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"CZ\": [\n \"H\"\n ],\n \"DE\": [\n \"H\",\n \"hB\"\n ],\n \"DG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"DJ\": [\n \"h\",\n \"H\"\n ],\n \"DK\": [\n \"H\"\n ],\n \"DM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"DO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"DZ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"EC\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"EE\": [\n \"H\",\n \"hB\"\n ],\n \"EG\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ER\": [\n \"h\",\n \"H\"\n ],\n \"ES\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"ET\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"FI\": [\n \"H\"\n ],\n \"FJ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"FM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FO\": [\n \"H\",\n \"h\"\n ],\n \"FR\": [\n \"H\",\n \"hB\"\n ],\n \"GA\": [\n \"H\",\n \"hB\"\n ],\n \"GB\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GD\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GE\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"GF\": [\n \"H\",\n \"hB\"\n ],\n \"GG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GH\": [\n \"h\",\n \"H\"\n ],\n \"GI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GL\": [\n \"H\",\n \"h\"\n ],\n \"GM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GN\": [\n \"H\",\n \"hB\"\n ],\n \"GP\": [\n \"H\",\n \"hB\"\n ],\n \"GQ\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"GR\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"GT\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"GU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GW\": [\n \"H\",\n \"hB\"\n ],\n \"GY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"HK\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"HN\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"HR\": [\n \"H\",\n \"hB\"\n ],\n \"HU\": [\n \"H\",\n \"h\"\n ],\n \"IC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ID\": [\n \"H\"\n ],\n \"IE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IL\": [\n \"H\",\n \"hB\"\n ],\n \"IM\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IN\": [\n \"h\",\n \"H\"\n ],\n \"IO\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IQ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"IR\": [\n \"hB\",\n \"H\"\n ],\n \"IS\": [\n \"H\"\n ],\n \"IT\": [\n \"H\",\n \"hB\"\n ],\n \"JE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"JM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"JO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"JP\": [\n \"H\",\n \"K\",\n \"h\"\n ],\n \"KE\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"KG\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KH\": [\n \"hB\",\n \"h\",\n \"H\",\n \"hb\"\n ],\n \"KI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KM\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KN\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KP\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KW\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"KY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KZ\": [\n \"H\",\n \"hB\"\n ],\n \"LA\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"LB\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LI\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"LK\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"LR\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LS\": [\n \"h\",\n \"H\"\n ],\n \"LT\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"LU\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"LV\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"LY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MC\": [\n \"H\",\n \"hB\"\n ],\n \"MD\": [\n \"H\",\n \"hB\"\n ],\n \"ME\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"MF\": [\n \"H\",\n \"hB\"\n ],\n \"MG\": [\n \"H\",\n \"h\"\n ],\n \"MH\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ML\": [\n \"H\"\n ],\n \"MM\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"MN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MP\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MQ\": [\n \"H\",\n \"hB\"\n ],\n \"MR\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MS\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MT\": [\n \"H\",\n \"h\"\n ],\n \"MU\": [\n \"H\",\n \"h\"\n ],\n \"MV\": [\n \"H\",\n \"h\"\n ],\n \"MW\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MX\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"MY\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"MZ\": [\n \"H\",\n \"hB\"\n ],\n \"NA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NC\": [\n \"H\",\n \"hB\"\n ],\n \"NE\": [\n \"H\"\n ],\n \"NF\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NI\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NL\": [\n \"H\",\n \"hB\"\n ],\n \"NO\": [\n \"H\",\n \"h\"\n ],\n \"NP\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"NR\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NU\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"OM\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"PG\": [\n \"h\",\n \"H\"\n ],\n \"PH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PK\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"PL\": [\n \"H\",\n \"h\"\n ],\n \"PM\": [\n \"H\",\n \"hB\"\n ],\n \"PN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"PR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PS\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PT\": [\n \"H\",\n \"hB\"\n ],\n \"PW\": [\n \"h\",\n \"H\"\n ],\n \"PY\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"QA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"RE\": [\n \"H\",\n \"hB\"\n ],\n \"RO\": [\n \"H\",\n \"hB\"\n ],\n \"RS\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"RU\": [\n \"H\"\n ],\n \"RW\": [\n \"H\",\n \"h\"\n ],\n \"SA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SC\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SD\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SE\": [\n \"H\"\n ],\n \"SG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SH\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SI\": [\n \"H\",\n \"hB\"\n ],\n \"SJ\": [\n \"H\"\n ],\n \"SK\": [\n \"H\"\n ],\n \"SL\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SN\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SO\": [\n \"h\",\n \"H\"\n ],\n \"SR\": [\n \"H\",\n \"hB\"\n ],\n \"SS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ST\": [\n \"H\",\n \"hB\"\n ],\n \"SV\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"SX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"TC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TD\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"TF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"TG\": [\n \"H\",\n \"hB\"\n ],\n \"TH\": [\n \"H\",\n \"h\"\n ],\n \"TJ\": [\n \"H\",\n \"h\"\n ],\n \"TL\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"TM\": [\n \"H\",\n \"h\"\n ],\n \"TN\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"TO\": [\n \"h\",\n \"H\"\n ],\n \"TR\": [\n \"H\",\n \"hB\"\n ],\n \"TT\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TW\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"TZ\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UG\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"US\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"UY\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"UZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"VA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"VC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"VG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VN\": [\n \"H\",\n \"h\"\n ],\n \"VU\": [\n \"h\",\n \"H\"\n ],\n \"WF\": [\n \"H\",\n \"hB\"\n ],\n \"WS\": [\n \"h\",\n \"H\"\n ],\n \"XK\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"YE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"YT\": [\n \"H\",\n \"hB\"\n ],\n \"ZA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ZM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ZW\": [\n \"H\",\n \"h\"\n ],\n \"af-ZA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ar-001\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ca-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"en-001\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-HK\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-IL\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"en-MY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"es-BR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-ES\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-GQ\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"fr-CA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gl-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gu-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"hi-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"it-CH\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-IT\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"kn-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ml-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"mr-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"pa-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"ta-IN\": [\n \"hB\",\n \"h\",\n \"hb\",\n \"H\"\n ],\n \"te-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"zu-ZA\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ]\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getBestPattern = getBestPattern;\nvar time_data_generated_1 = require(\"./time-data.generated\");\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nfunction getBestPattern(skeleton, locale) {\n var skeletonCopy = '';\n for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {\n var patternChar = skeleton.charAt(patternPos);\n if (patternChar === 'j') {\n var extraLength = 0;\n while (patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar) {\n extraLength++;\n patternPos++;\n }\n var hourLen = 1 + (extraLength & 1);\n var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);\n var dayPeriodChar = 'a';\n var hourChar = getDefaultHourSymbolFromLocale(locale);\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0;\n }\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar;\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy;\n }\n }\n else if (patternChar === 'J') {\n skeletonCopy += 'H';\n }\n else {\n skeletonCopy += patternChar;\n }\n }\n return skeletonCopy;\n}\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-ignore hourCycle(s) is not identified yet\n locale.hourCycles &&\n // @ts-ignore\n locale.hourCycles.length) {\n // @ts-ignore\n hourCycle = locale.hourCycles[0];\n }\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k';\n case 'h23':\n return 'H';\n case 'h12':\n return 'h';\n case 'h11':\n return 'K';\n default:\n throw new Error('Invalid hourCycle');\n }\n }\n // TODO: Once hourCycle is fully supported remove the following with data generation\n var languageTag = locale.language;\n var regionTag;\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region;\n }\n var hourCycles = time_data_generated_1.timeData[regionTag || ''] ||\n time_data_generated_1.timeData[languageTag || ''] ||\n time_data_generated_1.timeData[\"\".concat(languageTag, \"-001\")] ||\n time_data_generated_1.timeData['001'];\n return hourCycles[0];\n}\n","\"use strict\";\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Parser = void 0;\nvar tslib_1 = require(\"tslib\");\nvar error_1 = require(\"./error\");\nvar types_1 = require(\"./types\");\nvar regex_generated_1 = require(\"./regex.generated\");\nvar icu_skeleton_parser_1 = require(\"@formatjs/icu-skeleton-parser\");\nvar date_time_pattern_generator_1 = require(\"./date-time-pattern-generator\");\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(regex_generated_1.SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(regex_generated_1.SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith && '_a'.startsWith('a', 1);\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: types_1.TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(error_1.ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"</\" tagName (whitespace)* \">\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: types_1.TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('</')) {\n if (this.isEOF() || !_isAlpha(this.char())) {\n return this.error(error_1.ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n var closingTagNameStartPosition = this.clonePosition();\n var closingTagName = this.parseTagName();\n if (tagName !== closingTagName) {\n return this.error(error_1.ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(closingTagNameStartPosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (!this.bumpIf('>')) {\n return this.error(error_1.ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: types_1.TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(error_1.ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(error_1.ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: types_1.TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(error_1.ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(error_1.ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: types_1.TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(error_1.ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: types_1.TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(error_1.ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = (0, date_time_pattern_generator_1.getBestPattern)(skeleton, this.locale);\n }\n var style = {\n type: types_1.SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? (0, icu_skeleton_parser_1.parseDateTimeSkeleton)(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? types_1.TYPE.date : types_1.TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? types_1.TYPE.number\n : argType === 'date'\n ? types_1.TYPE.date\n : types_1.TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(error_1.ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, tslib_1.__assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, error_1.ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: types_1.TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: types_1.TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(error_1.ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(error_1.ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = (0, icu_skeleton_parser_1.parseNumberSkeletonFromString)(skeleton);\n }\n catch (e) {\n return this.error(error_1.ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: types_1.SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? (0, icu_skeleton_parser_1.parseNumberSkeleton)(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, error_1.ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? error_1.ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : error_1.ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? error_1.ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? error_1.ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(error_1.ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexports.Parser = Parser;\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hoistSelectors = hoistSelectors;\nexports.isStructurallySame = isStructurallySame;\nvar tslib_1 = require(\"tslib\");\nvar types_1 = require(\"./types\");\nfunction cloneDeep(obj) {\n if (Array.isArray(obj)) {\n // @ts-expect-error meh\n return tslib_1.__spreadArray([], obj.map(cloneDeep), true);\n }\n if (obj !== null && typeof obj === 'object') {\n // @ts-expect-error meh\n return Object.keys(obj).reduce(function (cloned, k) {\n // @ts-expect-error meh\n cloned[k] = cloneDeep(obj[k]);\n return cloned;\n }, {});\n }\n return obj;\n}\nfunction hoistPluralOrSelectElement(ast, el, positionToInject) {\n // pull this out of the ast and move it to the top\n var cloned = cloneDeep(el);\n var options = cloned.options;\n cloned.options = Object.keys(options).reduce(function (all, k) {\n var newValue = hoistSelectors(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], ast.slice(0, positionToInject), true), options[k].value, true), ast.slice(positionToInject + 1), true));\n all[k] = {\n value: newValue,\n };\n return all;\n }, {});\n return cloned;\n}\nfunction isPluralOrSelectElement(el) {\n return (0, types_1.isPluralElement)(el) || (0, types_1.isSelectElement)(el);\n}\nfunction findPluralOrSelectElement(ast) {\n return !!ast.find(function (el) {\n if (isPluralOrSelectElement(el)) {\n return true;\n }\n if ((0, types_1.isTagElement)(el)) {\n return findPluralOrSelectElement(el.children);\n }\n return false;\n });\n}\n/**\n * Hoist all selectors to the beginning of the AST & flatten the\n * resulting options. E.g:\n * \"I have {count, plural, one{a dog} other{many dogs}}\"\n * becomes \"{count, plural, one{I have a dog} other{I have many dogs}}\".\n * If there are multiple selectors, the order of which one is hoisted 1st\n * is non-deterministic.\n * The goal is to provide as many full sentences as possible since fragmented\n * sentences are not translator-friendly\n * @param ast AST\n */\nfunction hoistSelectors(ast) {\n for (var i = 0; i < ast.length; i++) {\n var el = ast[i];\n if (isPluralOrSelectElement(el)) {\n return [hoistPluralOrSelectElement(ast, el, i)];\n }\n if ((0, types_1.isTagElement)(el) && findPluralOrSelectElement([el])) {\n throw new Error('Cannot hoist plural/select within a tag element. Please put the tag element inside each plural/select option');\n }\n }\n return ast;\n}\n/**\n * Collect all variables in an AST to Record<string, TYPE>\n * @param ast AST to collect variables from\n * @param vars Record of variable name to variable type\n */\nfunction collectVariables(ast, vars) {\n if (vars === void 0) { vars = new Map(); }\n ast.forEach(function (el) {\n if ((0, types_1.isArgumentElement)(el) ||\n (0, types_1.isDateElement)(el) ||\n (0, types_1.isTimeElement)(el) ||\n (0, types_1.isNumberElement)(el)) {\n if (el.value in vars && vars.get(el.value) !== el.type) {\n throw new Error(\"Variable \".concat(el.value, \" has conflicting types\"));\n }\n vars.set(el.value, el.type);\n }\n if ((0, types_1.isPluralElement)(el) || (0, types_1.isSelectElement)(el)) {\n vars.set(el.value, el.type);\n Object.keys(el.options).forEach(function (k) {\n collectVariables(el.options[k].value, vars);\n });\n }\n if ((0, types_1.isTagElement)(el)) {\n vars.set(el.value, el.type);\n collectVariables(el.children, vars);\n }\n });\n}\n/**\n * Check if 2 ASTs are structurally the same. This primarily means that\n * they have the same variables with the same type\n * @param a\n * @param b\n * @returns\n */\nfunction isStructurallySame(a, b) {\n var aVars = new Map();\n var bVars = new Map();\n collectVariables(a, aVars);\n collectVariables(b, bVars);\n if (aVars.size !== bVars.size) {\n return {\n success: false,\n error: new Error(\"Different number of variables: [\".concat(Array.from(aVars.keys()).join(', '), \"] vs [\").concat(Array.from(bVars.keys()).join(', '), \"]\")),\n };\n }\n return Array.from(aVars.entries()).reduce(function (result, _a) {\n var key = _a[0], type = _a[1];\n if (!result.success) {\n return result;\n }\n var bType = bVars.get(key);\n if (bType == null) {\n return {\n success: false,\n error: new Error(\"Missing variable \".concat(key, \" in message\")),\n };\n }\n if (bType !== type) {\n return {\n success: false,\n error: new Error(\"Variable \".concat(key, \" has conflicting types: \").concat(types_1.TYPE[type], \" vs \").concat(types_1.TYPE[bType])),\n };\n }\n return result;\n }, { success: true });\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isStructurallySame = exports._Parser = void 0;\nexports.parse = parse;\nvar tslib_1 = require(\"tslib\");\nvar error_1 = require(\"./error\");\nvar parser_1 = require(\"./parser\");\nvar types_1 = require(\"./types\");\nfunction pruneLocation(els) {\n els.forEach(function (el) {\n delete el.location;\n if ((0, types_1.isSelectElement)(el) || (0, types_1.isPluralElement)(el)) {\n for (var k in el.options) {\n delete el.options[k].location;\n pruneLocation(el.options[k].value);\n }\n }\n else if ((0, types_1.isNumberElement)(el) && (0, types_1.isNumberSkeleton)(el.style)) {\n delete el.style.location;\n }\n else if (((0, types_1.isDateElement)(el) || (0, types_1.isTimeElement)(el)) &&\n (0, types_1.isDateTimeSkeleton)(el.style)) {\n delete el.style.location;\n }\n else if ((0, types_1.isTagElement)(el)) {\n pruneLocation(el.children);\n }\n });\n}\nfunction parse(message, opts) {\n if (opts === void 0) { opts = {}; }\n opts = tslib_1.__assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);\n var result = new parser_1.Parser(message, opts).parse();\n if (result.err) {\n var error = SyntaxError(error_1.ErrorKind[result.err.kind]);\n // @ts-expect-error Assign to error object\n error.location = result.err.location;\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message;\n throw error;\n }\n if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {\n pruneLocation(result.val);\n }\n return result.val;\n}\ntslib_1.__exportStar(require(\"./types\"), exports);\n// only for testing\nexports._Parser = parser_1.Parser;\nvar manipulator_1 = require(\"./manipulator\");\nObject.defineProperty(exports, \"isStructurallySame\", { enumerable: true, get: function () { return manipulator_1.isStructurallySame; } });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.printAST = printAST;\nexports.doPrintAST = doPrintAST;\nexports.printDateTimeSkeleton = printDateTimeSkeleton;\nvar tslib_1 = require(\"tslib\");\nvar types_1 = require(\"./types\");\nfunction printAST(ast) {\n return doPrintAST(ast, false);\n}\nfunction doPrintAST(ast, isInPlural) {\n var printedNodes = ast.map(function (el, i) {\n if ((0, types_1.isLiteralElement)(el)) {\n return printLiteralElement(el, isInPlural, i === 0, i === ast.length - 1);\n }\n if ((0, types_1.isArgumentElement)(el)) {\n return printArgumentElement(el);\n }\n if ((0, types_1.isDateElement)(el) || (0, types_1.isTimeElement)(el) || (0, types_1.isNumberElement)(el)) {\n return printSimpleFormatElement(el);\n }\n if ((0, types_1.isPluralElement)(el)) {\n return printPluralElement(el);\n }\n if ((0, types_1.isSelectElement)(el)) {\n return printSelectElement(el);\n }\n if ((0, types_1.isPoundElement)(el)) {\n return '#';\n }\n if ((0, types_1.isTagElement)(el)) {\n return printTagElement(el);\n }\n });\n return printedNodes.join('');\n}\nfunction printTagElement(el) {\n return \"<\".concat(el.value, \">\").concat(printAST(el.children), \"</\").concat(el.value, \">\");\n}\nfunction printEscapedMessage(message) {\n return message.replace(/([{}](?:[\\s\\S]*[{}])?)/, \"'$1'\");\n}\nfunction printLiteralElement(_a, isInPlural, isFirstEl, isLastEl) {\n var value = _a.value;\n var escaped = value;\n // If this literal starts with a ' and its not the 1st node, this means the node before it is non-literal\n // and the `'` needs to be unescaped\n if (!isFirstEl && escaped[0] === \"'\") {\n escaped = \"''\".concat(escaped.slice(1));\n }\n // Same logic but for last el\n if (!isLastEl && escaped[escaped.length - 1] === \"'\") {\n escaped = \"\".concat(escaped.slice(0, escaped.length - 1), \"''\");\n }\n escaped = printEscapedMessage(escaped);\n return isInPlural ? escaped.replace('#', \"'#'\") : escaped;\n}\nfunction printArgumentElement(_a) {\n var value = _a.value;\n return \"{\".concat(value, \"}\");\n}\nfunction printSimpleFormatElement(el) {\n return \"{\".concat(el.value, \", \").concat(types_1.TYPE[el.type]).concat(el.style ? \", \".concat(printArgumentStyle(el.style)) : '', \"}\");\n}\nfunction printNumberSkeletonToken(token) {\n var stem = token.stem, options = token.options;\n return options.length === 0\n ? stem\n : \"\".concat(stem).concat(options.map(function (o) { return \"/\".concat(o); }).join(''));\n}\nfunction printArgumentStyle(style) {\n if (typeof style === 'string') {\n return printEscapedMessage(style);\n }\n else if (style.type === types_1.SKELETON_TYPE.dateTime) {\n return \"::\".concat(printDateTimeSkeleton(style));\n }\n else {\n return \"::\".concat(style.tokens.map(printNumberSkeletonToken).join(' '));\n }\n}\nfunction printDateTimeSkeleton(style) {\n return style.pattern;\n}\nfunction printSelectElement(el) {\n var msg = [\n el.value,\n 'select',\n Object.keys(el.options)\n .map(function (id) { return \"\".concat(id, \"{\").concat(doPrintAST(el.options[id].value, false), \"}\"); })\n .join(' '),\n ].join(',');\n return \"{\".concat(msg, \"}\");\n}\nfunction printPluralElement(el) {\n var type = el.pluralType === 'cardinal' ? 'plural' : 'selectordinal';\n var msg = [\n el.value,\n type,\n tslib_1.__spreadArray([\n el.offset ? \"offset:\".concat(el.offset) : ''\n ], Object.keys(el.options).map(function (id) { return \"\".concat(id, \"{\").concat(doPrintAST(el.options[id].value, true), \"}\"); }), true).filter(Boolean)\n .join(' '),\n ].join(',');\n return \"{\".concat(msg, \"}\");\n}\n","import { a as defaultBaseUrl, c as createDiagnosticMessage, d as libraryDefaultLocale, i as isSupportedFileFormatTransform, l as formatDiagnosticErrorDetails, n as encode, o as defaultCacheUrl, r as validateFileFormatTransforms, s as defaultRuntimeApiUrl, t as decode, u as defaultTimeout } from \"./base64-r7YWJYWt.mjs\";\nimport { n as stableStringify, t as isVariable } from \"./isVariable-fAKEB7gF.mjs\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { bytesToHex, utf8ToBytes } from \"@noble/hashes/utils.js\";\nimport { getCachedPluralRules } from \"@generaltranslation/format/internal\";\nimport { TYPE, parse } from \"@formatjs/icu-messageformat-parser\";\nimport { TYPE as TYPE$1 } from \"@formatjs/icu-messageformat-parser/types.js\";\nimport { printAST } from \"@formatjs/icu-messageformat-parser/printer.js\";\n//#region src/settings/plurals.ts\nconst pluralForms = [\n\t\"singular\",\n\t\"plural\",\n\t\"dual\",\n\t\"zero\",\n\t\"one\",\n\t\"two\",\n\t\"few\",\n\t\"many\",\n\t\"other\"\n];\nfunction isAcceptedPluralForm(form) {\n\treturn pluralForms.includes(form);\n}\n//#endregion\n//#region src/locales/getPluralForm.ts\n/**\n* Given a number and a list of allowed plural forms, return the plural form that best fits the number.\n*\n* @param {number} n - The number to determine the plural form for.\n* @param {PluralType[]} forms - The allowed plural forms.\n* @returns {PluralType} The determined plural form, or an empty string if none fit.\n*/\nfunction _getPluralForm(n, forms = pluralForms, locales = [\"en\"]) {\n\tconst provisionalBranchName = getCachedPluralRules(locales).select(n);\n\tconst absN = Math.abs(n);\n\tif (absN === 0 && forms.includes(\"zero\")) return \"zero\";\n\tif (absN === 1) {\n\t\tif (forms.includes(\"singular\")) return \"singular\";\n\t\tif (forms.includes(\"one\")) return \"one\";\n\t}\n\tif (provisionalBranchName === \"one\" && forms.includes(\"singular\")) return \"singular\";\n\tif (absN === 2) {\n\t\tif (forms.includes(\"dual\")) return \"dual\";\n\t\tif (forms.includes(\"two\")) return \"two\";\n\t}\n\tif (provisionalBranchName === \"two\" && forms.includes(\"dual\")) return \"dual\";\n\tif (forms.includes(provisionalBranchName)) return provisionalBranchName;\n\tif (provisionalBranchName === \"two\" && forms.includes(\"dual\")) return \"dual\";\n\tif (provisionalBranchName === \"two\" && forms.includes(\"plural\")) return \"plural\";\n\tif (provisionalBranchName === \"two\" && forms.includes(\"other\")) return \"other\";\n\tif (provisionalBranchName === \"few\" && forms.includes(\"plural\")) return \"plural\";\n\tif (provisionalBranchName === \"few\" && forms.includes(\"other\")) return \"other\";\n\tif (provisionalBranchName === \"many\" && forms.includes(\"plural\")) return \"plural\";\n\tif (provisionalBranchName === \"many\" && forms.includes(\"other\")) return \"other\";\n\tif (provisionalBranchName === \"other\" && forms.includes(\"plural\")) return \"plural\";\n\treturn \"\";\n}\n//#endregion\n//#region src/utils/minify.ts\nconst VARIABLE_TRANSFORMATION_SUFFIXES_TO_MINIFIED_NAMES = {\n\tvariable: \"v\",\n\tnumber: \"n\",\n\tdatetime: \"d\",\n\tcurrency: \"c\",\n\t\"relative-time\": \"rt\"\n};\nfunction minifyVariableType(variableType) {\n\treturn VARIABLE_TRANSFORMATION_SUFFIXES_TO_MINIFIED_NAMES[variableType];\n}\n//#endregion\n//#region src/derive/utils/traverseIcu.ts\n/**\n* Given an ICU string, traverse the AST and call the visitor function for each element that matches the type T\n* @param icu - The ICU string to traverse\n* @param shouldVisit - A function that returns true if the element should be visited\n* @param visitor - A function that is called for each element that matches the type T\n* @returns The modified AST of the ICU string.\n*\n* @note This function is a heavy operation, use sparingly\n*/\nfunction traverseIcu({ icuString, shouldVisit, visitor, options: { recurseIntoVisited = true, ...otherOptions } }) {\n\tconst ast = parse(icuString, otherOptions);\n\thandleChildren(ast);\n\treturn ast;\n\tfunction handleChildren(children) {\n\t\tchildren.map(handleChild);\n\t}\n\tfunction handleChild(child) {\n\t\tlet visited = false;\n\t\tif (shouldVisit(child)) {\n\t\t\tvisitor(child);\n\t\t\tvisited = true;\n\t\t}\n\t\tif (!visited || recurseIntoVisited) {\n\t\t\tif (child.type === TYPE.select || child.type === TYPE.plural) Object.values(child.options).map((option) => option.value).map(handleChildren);\n\t\t\telse if (child.type === TYPE.tag) handleChildren(child.children);\n\t\t}\n\t}\n}\n//#endregion\n//#region src/derive/utils/constants.ts\nconst VAR_IDENTIFIER = \"_gt_\";\nconst VAR_NAME_IDENTIFIER = \"_gt_var_name\";\n//#endregion\n//#region src/derive/utils/regex.ts\nconst GT_INDEXED_IDENTIFIER_REGEX = new RegExp(`^${VAR_IDENTIFIER}\\\\d+$`);\nconst GT_UNINDEXED_IDENTIFIER_REGEX = new RegExp(`^${VAR_IDENTIFIER}$`);\n//#endregion\n//#region src/derive/utils/traverseHelpers.ts\nfunction isGTIndexedSelectElement(child) {\n\treturn child.type === TYPE$1.select && GT_INDEXED_IDENTIFIER_REGEX.test(child.value) && !!child.options.other && (child.options.other.value.length === 0 || child.options.other.value.length > 0 && child.options.other.value[0]?.type === TYPE$1.literal);\n}\nfunction isGTUnindexedSelectElement(child) {\n\treturn child.type === TYPE$1.select && GT_UNINDEXED_IDENTIFIER_REGEX.test(child.value) && !!child.options.other && (child.options.other.value.length === 0 || child.options.other.value.length > 0 && child.options.other.value[0]?.type === TYPE$1.literal);\n}\n//#endregion\n//#region src/derive/decodeVars.ts\n/**\n* Given an encoded ICU string, interpolate only _gt_ variables that have been marked with declareVar()\n* @example\n* const encodedIcu = \"Hi\" + declareVar(\"Brian\") + \", my name is {name}\"\n* // 'Hi {_gt_, select, other {Brian}}, my name is {name}'\n* decodeVars(encodedIcu)\n* // 'Hi Brian, my name is {name}'\n*/\nfunction decodeVars(icuString) {\n\tif (!icuString.includes(\"_gt_\")) return icuString;\n\tconst variableLocations = [];\n\tfunction visitor(child) {\n\t\tvariableLocations.push({\n\t\t\tstart: child.location?.start.offset ?? 0,\n\t\t\tend: child.location?.end.offset ?? 0,\n\t\t\tvalue: child.options.other.value.length > 0 ? child.options.other.value[0].value : \"\"\n\t\t});\n\t}\n\ttraverseIcu({\n\t\ticuString,\n\t\tshouldVisit: isGTUnindexedSelectElement,\n\t\tvisitor,\n\t\toptions: {\n\t\t\trecurseIntoVisited: false,\n\t\t\tcaptureLocation: true\n\t\t}\n\t});\n\tlet previousIndex = 0;\n\tconst outputList = [];\n\tfor (let i = 0; i < variableLocations.length; i++) {\n\t\toutputList.push(icuString.slice(previousIndex, variableLocations[i].start));\n\t\toutputList.push(variableLocations[i].value);\n\t\tpreviousIndex = variableLocations[i].end;\n\t}\n\tif (previousIndex < icuString.length) outputList.push(icuString.slice(previousIndex));\n\treturn outputList.join(\"\");\n}\n//#endregion\n//#region src/derive/utils/sanitizeVar.ts\n/**\n* Sanitizes string by escaping ICU syntax\n*\n* Sanitize arbitrary string so it does not break the following ICU message syntax:\n* {_gt_, select, other {string_here}}\n*\n* Escapes ICU special characters by:\n* 1. Doubling all single quotes (U+0027 ')\n* 2. Adding a single quote before the first special character ({}<>)\n* 3. Adding a single quote after the last special character ({}<>)\n*/\nfunction sanitizeVar(string) {\n\tlet result = string.replace(/'/g, \"''\");\n\tconst specialChars = /[{}<>]/;\n\tconst firstSpecialIndex = result.search(specialChars);\n\tif (firstSpecialIndex === -1) return result;\n\tlet lastSpecialIndex = -1;\n\tfor (let i = result.length - 1; i >= 0; i--) if (specialChars.test(result[i])) {\n\t\tlastSpecialIndex = i;\n\t\tbreak;\n\t}\n\tresult = result.slice(0, firstSpecialIndex) + \"'\" + result.slice(firstSpecialIndex, lastSpecialIndex + 1) + \"'\" + result.slice(lastSpecialIndex + 1);\n\treturn result;\n}\n//#endregion\n//#region src/derive/declareVar.ts\n/**\n* Mark as a non-translatable string. Use within a derive() call to mark content as not derivable (e.g., not possible to statically analyze).\n*\n* @example\n* function nonDerivableFunction() {\n* return Math.random();\n* }\n*\n* function derivableFunction() {\n* if (condition) {\n* return declareVar(nonDerivableFunction())\n* }\n* return 'John Doe';\n* }\n*\n* const gt = useGT();\n* gt(`My name is ${derive(derivableFunction())}`);\n*\n* @param {string | number | boolean | null | undefined} variable - The variable to sanitize.\n* @param {Object} [options] - The options for the sanitization.\n* @param {string} [options.$name] - The name of the variable.\n* @returns {string} The sanitized value.\n*/\nfunction declareVar(variable, options) {\n\tconst variableSection = ` other {${sanitizeVar(String(variable ?? \"\"))}}`;\n\tlet nameSection = \"\";\n\tif (options?.$name) nameSection = ` ${VAR_NAME_IDENTIFIER} {${sanitizeVar(options.$name)}}`;\n\treturn `{${VAR_IDENTIFIER}, select,${variableSection}${nameSection}}`;\n}\n//#endregion\n//#region src/derive/derive.ts\n/**\n* Marks content as derivable by the GT compiler and CLI.\n*\n* Use `derive()` when a translation string or context needs content that is\n* computed from source code, but should still be discovered during extraction\n* instead of treated as a runtime interpolation variable. The CLI attempts to\n* resolve the derivable expression into every possible static value and\n* includes those values in the source content that gets translated.\n*\n* `derive()` returns its argument unchanged at runtime.\n*\n* Run `gt validate` after adding or changing `derive()` calls to verify that\n* each derivable expression can be resolved by the CLI before translating or\n* building.\n*\n* @example\n* ```jsx\n* function getSubject() {\n* return (Math.random() > 0.5) ? \"Alice\" : \"Brian\";\n* }\n* ...\n* gt(`My name is ${derive(getSubject())}`);\n* ```\n*\n* @param {T extends string | boolean | number | null | undefined} content - Content to derive for translation extraction.\n* @returns {T} The same content, unchanged at runtime.\n*/\nfunction derive(content) {\n\treturn content;\n}\n/**\n* @deprecated Use derive() instead.\n*\n* Marks content as derivable by the GT compiler and CLI.\n*\n* Use `derive()` instead of `declareStatic()` for new code. This alias is kept\n* for backwards compatibility and returns its argument unchanged at runtime.\n*\n* Run `gt validate` after adding or changing derived content to verify that\n* each derivable expression can be resolved by the CLI before translating or\n* building.\n*\n* @example\n* ```jsx\n* function getSubject() {\n* return (Math.random() > 0.5) ? \"Alice\" : \"Brian\";\n* }\n* ...\n* gt(`My name is ${declareStatic(getSubject())}`);\n* ```\n*\n* @param {T extends string | boolean | number | null | undefined} content - Content to derive for translation extraction.\n* @returns {T} The same content, unchanged at runtime.\n*/\nconst declareStatic = derive;\n//#endregion\n//#region src/derive/indexVars.ts\n/**\n* Given an ICU string adds identifiers to each _gt_ placeholder\n* indexVars('Hello {_gt_} {_gt_} World') => 'Hello {_gt_1_} {_gt_2_} World'\n*/\nfunction indexVars(icuString) {\n\tif (!icuString.includes(\"_gt_\")) return icuString;\n\tconst variableLocations = [];\n\tfunction visitor(child) {\n\t\tvariableLocations.push({\n\t\t\tstart: child.location?.start.offset ?? 0,\n\t\t\tend: child.location?.end.offset ?? 0,\n\t\t\totherStart: child.options.other.location?.start.offset ?? 0,\n\t\t\totherEnd: child.options.other.location?.end.offset ?? 0\n\t\t});\n\t}\n\ttraverseIcu({\n\t\ticuString,\n\t\tshouldVisit: isGTUnindexedSelectElement,\n\t\tvisitor,\n\t\toptions: {\n\t\t\trecurseIntoVisited: false,\n\t\t\tcaptureLocation: true\n\t\t}\n\t});\n\tconst result = [];\n\tlet current = 0;\n\tfor (let i = 0; i < variableLocations.length; i++) {\n\t\tconst { start, end, otherStart, otherEnd } = variableLocations[i];\n\t\tresult.push(icuString.slice(current, start));\n\t\tresult.push(icuString.slice(start, start + 4 + 1));\n\t\tresult.push(String(i + 1));\n\t\tresult.push(icuString.slice(start + 4 + 1, otherStart));\n\t\tresult.push(\"{}\");\n\t\tresult.push(icuString.slice(otherEnd, end));\n\t\tcurrent = end;\n\t}\n\tresult.push(icuString.slice(current, icuString.length));\n\treturn result.join(\"\");\n}\n//#endregion\n//#region src/derive/extractVars.ts\n/**\n* Given an unindexed ICU string, extracts all the _gt_ variables and an indexed mapping of the variable to the values\n*\n* extractVars('Hello {_gt_, select, other {World}}') => { _gt_1: 'World' }\n*\n* @param {string} icuString - The ICU string to extract variables from.\n* @returns {Record<string, string>} A mapping of the variable to the value.\n*/\nfunction extractVars(icuString) {\n\tif (!icuString.includes(\"_gt_\")) return {};\n\tlet index = 1;\n\tconst variables = {};\n\tfunction visitor(child) {\n\t\tvariables[child.value + index] = child.options.other.value.length ? child.options.other.value[0]?.value : \"\";\n\t\tindex += 1;\n\t}\n\ttraverseIcu({\n\t\ticuString,\n\t\tshouldVisit: isGTUnindexedSelectElement,\n\t\tvisitor,\n\t\toptions: { recurseIntoVisited: false }\n\t});\n\treturn variables;\n}\n//#endregion\n//#region src/derive/condenseVars.ts\n/**\n* Given an indexed ICU string, condenses any select to an argument\n* indexVars('Hello {_gt_1, select, other {World}}') => 'Hello {_gt_1}'\n* @param {string} icuString - The ICU string to condense.\n* @returns {string} The condensed ICU string.\n*/\nfunction condenseVars(icuString) {\n\tif (!icuString.includes(\"_gt_\")) return icuString;\n\tfunction visitor(child) {\n\t\tchild.type = TYPE$1.argument;\n\t\tReflect.deleteProperty(child, \"options\");\n\t}\n\treturn printAST(traverseIcu({\n\t\ticuString,\n\t\tshouldVisit: isGTIndexedSelectElement,\n\t\tvisitor,\n\t\toptions: { recurseIntoVisited: false }\n\t}));\n}\n//#endregion\n//#region src/backwards-compatability/typeChecking.ts\n/**\n* Checks if a JSX child is an old variable object format\n* @param child - The JSX child to check.\n* @returns True if the child is an old variable object (has 'key' property)\n*/\nfunction isOldVariableObject(child) {\n\treturn typeof child === \"object\" && child != null && \"key\" in child;\n}\n/**\n* Checks if a JSX child is a new variable object format\n* @param child - The JSX child to check.\n* @returns True if the child is a new variable object (has 'k' property)\n*/\nfunction isNewVariableObject(child) {\n\treturn typeof child === \"object\" && child != null && \"k\" in child;\n}\n/**\n* Checks if a JSX child is an old JSX element format\n* @param child - The JSX child to check.\n* @returns True if the child is an old JSX element (has 'type' and 'props' properties)\n*/\nfunction isOldJsxElement(child) {\n\treturn typeof child === \"object\" && child != null && \"type\" in child && \"props\" in child;\n}\n/**\n* Checks if a JSX child follows the old format (string, old variable object, or old JSX element)\n* @param child - The JSX child to check.\n* @returns True if the child is in the old format.\n*/\nfunction isOldJsxChild(child) {\n\tif (typeof child === \"string\") return true;\n\tif (isOldVariableObject(child)) return true;\n\treturn isOldJsxElement(child);\n}\n/**\n* Checks if JSX children follow the old format\n* @param children - The JSX children to check (can be string, array, or single child)\n* @returns True if all children are in the old format.\n*/\nfunction isOldJsxChildren(children) {\n\tif (typeof children === \"string\") return true;\n\tif (Array.isArray(children)) return !children.some((child) => !isOldJsxChild(child));\n\treturn isOldJsxChild(children);\n}\n//#endregion\n//#region src/backwards-compatability/dataConversion.ts\n/**\n* Convert request data from old format to new format\n*/\nfunction getNewJsxChild(child) {\n\tif (typeof child === \"string\") return child;\n\tif (isOldVariableObject(child)) return getNewVariableObject(child);\n\treturn getNewJsxElement(child);\n}\nfunction getNewJsxChildren(children) {\n\tif (typeof children === \"string\") return children;\n\tif (Array.isArray(children)) return children.map(getNewJsxChild);\n\treturn getNewJsxChild(children);\n}\nfunction getNewJsxElement(element) {\n\tif (typeof element === \"string\") return element;\n\tlet t = void 0;\n\tif (element.type != null) t = element.type;\n\tlet c = void 0;\n\tif (element.props?.children != null) c = getNewJsxChildren(element.props.children);\n\treturn {\n\t\t...t && { t },\n\t\t...c && { c },\n\t\td: getNewGTProp(element.props[\"data-_gt\"]),\n\t\ti: element.props[\"data-_gt\"].id\n\t};\n}\nfunction getNewBranchType(branch) {\n\tif (branch === \"branch\") return \"b\";\n\treturn \"p\";\n}\nfunction getNewVariableType(variable) {\n\tswitch (variable) {\n\t\tcase \"number\": return \"n\";\n\t\tcase \"variable\": return \"v\";\n\t\tcase \"datetime\": return \"d\";\n\t\tcase \"currency\": return \"c\";\n\t\tdefault: return \"v\";\n\t}\n}\nfunction getNewVariableObject(variable) {\n\tlet v = void 0;\n\tif (variable.variable != null) v = getNewVariableType(variable.variable);\n\tlet i = void 0;\n\tif (variable.id != null) i = variable.id;\n\treturn {\n\t\tk: variable.key,\n\t\t...v && { v },\n\t\t...i && { i }\n\t};\n}\nfunction getNewGTProp(dataGT) {\n\tlet b = void 0;\n\tif (dataGT.branches) b = Object.fromEntries(Object.entries(dataGT.branches).map(([key, value]) => [key, getNewJsxChildren(value)]));\n\tlet t;\n\tif (dataGT.transformation) t = getNewBranchType(dataGT.transformation);\n\treturn {\n\t\t...b && { b },\n\t\t...t && { t }\n\t};\n}\n/**\n* Convert response data from current format to old format\n*/\nfunction getOldJsxChild(child) {\n\tif (typeof child === \"string\") return child;\n\tif (isNewVariableObject(child)) return getOldVariableObject(child);\n\treturn getOldJsxElement(child);\n}\nfunction getOldJsxChildren(children) {\n\tif (isOldJsxChildren(children)) return children;\n\tif (typeof children === \"string\") return children;\n\tif (Array.isArray(children)) return children.map(getOldJsxChild);\n\treturn getOldJsxChild(children);\n}\nfunction getOldJsxElement(element) {\n\tconst type = element.t;\n\tlet children = void 0;\n\tif (element.c != null) children = getOldJsxChildren(element.c);\n\tconst dataGT = getOldGTProp(element.d || {}, element.i);\n\treturn {\n\t\ttype,\n\t\tprops: {\n\t\t\tchildren,\n\t\t\t\"data-_gt\": dataGT\n\t\t}\n\t};\n}\nfunction getOldBranchType(branch) {\n\tif (branch === \"b\") return \"branch\";\n\treturn \"plural\";\n}\nfunction getOldVariableType(variable) {\n\tswitch (variable) {\n\t\tcase \"n\": return \"number\";\n\t\tcase \"v\": return \"variable\";\n\t\tcase \"d\": return \"datetime\";\n\t\tcase \"c\": return \"currency\";\n\t\tdefault: return \"variable\";\n\t}\n}\nfunction getOldVariableObject(variable) {\n\tlet v = void 0;\n\tif (variable.v != null) v = getOldVariableType(variable.v);\n\tlet i = void 0;\n\tif (variable.i != null) i = variable.i;\n\treturn {\n\t\tkey: variable.k,\n\t\t...v && { variable: v },\n\t\t...i && { id: i }\n\t};\n}\nfunction getOldGTProp(dataGT, i) {\n\tlet transformation = void 0;\n\tif (dataGT.t != null) transformation = getOldBranchType(dataGT.t);\n\tlet branches = void 0;\n\tif (dataGT.b != null) branches = Object.fromEntries(Object.entries(dataGT.b).map(([key, value]) => [key, getOldJsxChildren(value)]));\n\treturn {\n\t\tid: i,\n\t\t...transformation && { transformation },\n\t\t...branches && { branches }\n\t};\n}\n//#endregion\n//#region src/backwards-compatability/oldHashJsxChildren.ts\n/**\n* Calculates a unique hash for a given string using SHA-256.\n*\n* @param {string} string - The string to be hashed.\n* @returns {string} The resulting hash as a hexadecimal string.\n*/\nfunction oldHashString(string) {\n\treturn bytesToHex(sha256(utf8ToBytes(string)));\n}\n/**\n* Calculates a unique ID for the given children objects by hashing their sanitized JSON string representation.\n*\n* @param {any} childrenAsObjects - The children objects to be hashed.\n* @param {string} context - The context for the children.\n* @param {string} id - The ID for the JSX children object.\n* @param {function} hashFunction - Custom hash function.\n* @returns {string} - The unique hash of the children.\n*/\nfunction oldHashJsxChildren({ source, context, id, dataFormat }, hashFunction = oldHashString) {\n\treturn hashFunction(stableStringify({\n\t\tsource: sanitizeJsxChildren(source),\n\t\t...id && { id },\n\t\t...context && { context },\n\t\t...dataFormat && { dataFormat }\n\t}));\n}\nconst sanitizeChild = (child) => {\n\tif (child && typeof child === \"object\") {\n\t\tif (\"props\" in child) {\n\t\t\tconst newChild = {};\n\t\t\tconst dataGt = child?.props?.[\"data-_gt\"];\n\t\t\tif (dataGt?.branches) newChild.branches = Object.fromEntries(Object.entries(dataGt.branches).map(([key, value]) => [key, sanitizeJsxChildren(value)]));\n\t\t\tif (child?.props?.children) newChild.children = sanitizeJsxChildren(child.props.children);\n\t\t\tif (child?.props?.[\"data-_gt\"]?.transformation) newChild.transformation = child.props[\"data-_gt\"].transformation;\n\t\t\treturn newChild;\n\t\t}\n\t\tif (\"key\" in child) return {\n\t\t\tkey: child.key,\n\t\t\t...child.variable && { variable: child.variable }\n\t\t};\n\t}\n\treturn child;\n};\nfunction sanitizeJsxChildren(childrenAsObjects) {\n\treturn Array.isArray(childrenAsObjects) ? childrenAsObjects.map(sanitizeChild) : sanitizeChild(childrenAsObjects);\n}\n//#endregion\nexport { VAR_IDENTIFIER, VAR_NAME_IDENTIFIER, condenseVars, createDiagnosticMessage, declareStatic, declareVar, decode, decodeVars, defaultBaseUrl, defaultCacheUrl, defaultRuntimeApiUrl, defaultTimeout, derive, encode, extractVars, formatDiagnosticErrorDetails, getNewBranchType, getNewGTProp, getNewJsxChild, getNewJsxChildren, getNewJsxElement, getNewVariableObject, getNewVariableType, getOldBranchType, getOldGTProp, getOldJsxChild, getOldJsxChildren, getOldJsxElement, getOldVariableObject, getOldVariableType, _getPluralForm as getPluralForm, indexVars, isAcceptedPluralForm, isNewVariableObject, isOldJsxChildren, isOldVariableObject, isSupportedFileFormatTransform, isVariable, libraryDefaultLocale, minifyVariableType, oldHashJsxChildren, oldHashString, pluralForms, validateFileFormatTransforms };\n\n//# sourceMappingURL=internal.mjs.map","import React, { ReactElement, isValidElement, ReactNode } from 'react';\nimport { isAcceptedPluralForm } from 'generaltranslation/internal';\nimport {\n GTTag,\n TaggedChild,\n TaggedChildren,\n TaggedElement,\n TaggedElementProps,\n} from '../types-dir/types';\nimport {\n Transformation,\n TransformationPrefix,\n VariableTransformationSuffix,\n} from 'generaltranslation/types';\n\ntype GTComponentType = {\n _gtt?: Transformation;\n};\n\nexport default function addGTIdentifier(\n children: ReactNode,\n startingIndex: number = 0\n): TaggedChildren {\n // Object to keep track of the current index for GT IDs\n let index = startingIndex;\n\n /**\n * Function to create a GTTag object for a ReactElement\n * @param child - The ReactElement for which the GTTag is created\n * @returns - The GTTag object\n */\n const createGTTag = (child: ReactElement<Record<string, unknown>>): GTTag => {\n const { type, props } = child;\n index += 1;\n const result: GTTag = { id: index, injectionType: 'manual' };\n let transformation: Transformation | undefined;\n try {\n transformation =\n typeof type === 'function' ? (type as GTComponentType)._gtt : undefined;\n } catch {\n /* empty */\n }\n if (transformation) {\n const transformationParts = transformation.split('-');\n // If the component was inserted automatically by the compiler\n if (\n transformationParts[1] === 'automatic' ||\n transformationParts[2] === 'automatic'\n ) {\n result.injectionType = 'automatic';\n }\n\n if (transformationParts[0] === 'translate') {\n // Convert nested <T> to fragments\n // This will nullify translation specific attributes of child, i.e. id, context, etc.\n transformationParts[0] = 'fragment';\n }\n if (transformationParts[0] === 'variable') {\n result.variableType =\n (transformationParts?.[1] as VariableTransformationSuffix) ||\n 'variable';\n }\n if (transformationParts[0] === 'plural') {\n const pluralBranches = Object.entries(props).reduce(\n (acc, [branchName, branch]) => {\n if (isAcceptedPluralForm(branchName)) {\n (acc as Record<string, TaggedChildren>)[branchName] =\n addGTIdentifier(branch as ReactNode, index);\n }\n return acc;\n },\n {} as Record<string, TaggedChildren>\n );\n if (Object.keys(pluralBranches).length)\n result.branches = pluralBranches;\n }\n if (transformationParts[0] === 'branch') {\n const { children: _children, branch: _branch, ...branches } = props;\n // Filter out data-* attributes injected by build tools\n const filteredBranches = Object.fromEntries(\n Object.entries(branches).filter(([key]) => !key.startsWith('data-'))\n );\n const resultBranches = Object.entries(filteredBranches).reduce(\n (acc, [branchName, branch]) => {\n (acc as Record<string, TaggedChildren>)[branchName] =\n addGTIdentifier(branch as ReactNode, index);\n return acc;\n },\n {} as Record<string, TaggedChildren>\n );\n if (Object.keys(resultBranches).length)\n result.branches = resultBranches;\n }\n result.transformation = transformationParts[0] as TransformationPrefix;\n }\n return result;\n };\n\n function handleSingleChildElement(\n child: ReactElement<Record<string, unknown>>\n ): TaggedElement {\n const { props } = child;\n\n // Create new props for the element, including the GT identifier and a key\n const generaltranslation: GTTag = createGTTag(child);\n const newProps: TaggedElementProps = {\n ...props,\n 'data-_gt': generaltranslation,\n };\n if (props.children && !generaltranslation.variableType) {\n newProps.children = handleChildren(props.children as ReactNode);\n }\n if (child.type === React.Fragment) {\n newProps['data-_gt'].transformation = 'fragment';\n }\n return React.cloneElement(child, newProps) as TaggedElement;\n }\n\n function handleSingleChild(child: ReactNode): TaggedChild {\n if (isValidElement(child)) {\n return handleSingleChildElement(\n child as ReactElement<Record<string, unknown>>\n );\n }\n return child;\n }\n\n function handleChildren(children: ReactNode): TaggedChildren {\n if (Array.isArray(children)) {\n return React.Children.map(children, handleSingleChild);\n } else {\n return handleSingleChild(children);\n }\n }\n\n return handleChildren(children);\n}\n","export const PACKAGE_NAME = '@generaltranslation/react-core';\n","import {\n createDiagnosticMessage,\n formatDiagnosticErrorDetails,\n type DiagnosticMessageInput,\n} from 'generaltranslation/internal';\nimport { PACKAGE_NAME } from './constants';\n\ntype ReactCoreDiagnosticInput = Omit<DiagnosticMessageInput, 'source'>;\n\nexport function createReactCoreDiagnostic(\n input: ReactCoreDiagnosticInput\n): string {\n return createDiagnosticMessage({\n source: PACKAGE_NAME,\n ...input,\n });\n}\n\nexport { formatDiagnosticErrorDetails };\n","import { getLocaleProperties } from '@generaltranslation/format';\nimport {\n createReactCoreDiagnostic,\n formatDiagnosticErrorDetails,\n} from './diagnostics';\nimport { PACKAGE_NAME } from './constants';\n\n// ---- ERRORS ---- //\n\nexport const projectIdMissingError = createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: 'Runtime translation needs a project ID',\n fix: 'Add projectId to your <GTProvider> configuration or set GT_PROJECT_ID in your environment',\n docsUrl: 'https://generaltranslation.com/dashboard',\n});\n\nexport const devApiKeyProductionError = createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: 'Production environments cannot use a development API key',\n fix: 'Replace it with a production API key before deploying',\n});\n\nexport const apiKeyInProductionError = createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: 'The API key is available to client-side production code',\n fix: 'Move translation credentials to a server-only environment before deploying',\n});\n\nexport const createNoAuthError = createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: 'Runtime translation is not configured',\n fix: 'Add projectId and devApiKey to your environment, or pass them to <GTProvider> directly',\n});\n\nexport const createPluralMissingError = (children: unknown) =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: `<Plural> could not choose a plural form for \"${children}\"`,\n fix: 'Pass the required \"n\" option to <Plural>',\n });\n\nexport const createClientSideTDictionaryCollisionError = (id: string) =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: `<T id=\"${id}\"> conflicts with a dictionary entry using the same ID`,\n fix: 'Rename the <T> id or the dictionary key so each translation source has a unique ID',\n });\n\nexport const createClientSideTHydrationError = (id: string) =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: `<T id=\"${id}\"> is rendering in a client component without a saved translation`,\n why: 'This can cause hydration mismatches',\n fix: 'Use a dictionary with useGT() or push translations from the command line before rendering this component on the client',\n });\n\nexport const dynamicTranslationError = createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: 'Runtime translations could not be loaded',\n wayOut: 'Source content will render as a fallback',\n fix: 'Check your runtime translation configuration and try again',\n});\n\nexport const createGenericRuntimeTranslationError = (\n id: string | undefined,\n hash: string,\n error?: unknown\n) =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: id\n ? `Translation could not be found for id \"${id}\" and hash \"${hash}\"`\n : `Translation could not be found for hash \"${hash}\"`,\n wayOut: 'Source content will render as a fallback',\n fix: 'Push translations again or check that runtime translation is configured',\n details: formatDiagnosticErrorDetails(error),\n });\n\nexport const runtimeTranslationError = createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: 'Runtime translation could not be completed',\n});\n\nexport const customLoadTranslationsError = (locale: string = '') =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: `Locally stored translations could not be loaded${locale ? ` for \"${locale}\"` : ''}`,\n fix: 'If you use loadTranslations(), make sure it returns translations for the requested locale',\n });\n\nexport const customLoadDictionaryWarning = (locale: string = '') =>\n createReactCoreDiagnostic({\n severity: 'Warning',\n whatHappened: `The local dictionary could not be loaded${locale ? ` for \"${locale}\"` : ''}`,\n fix: 'If you use loadDictionary(), make sure it returns a dictionary for the requested locale',\n });\n\nexport const missingVariablesError = (variables: string[], message: string) =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: `The message \"${message}\" is missing variables: \"${variables.join('\", \"')}\"`,\n fix: 'Provide values for these variables before rendering the translation',\n });\n\nexport const createStringRenderError = (\n message: string,\n id: string | undefined,\n error?: unknown\n) =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: `The string ${id ? `for id \"${id}\" ` : ''}could not be rendered`,\n fix: `Check the message syntax and variables for: \"${message}\"`,\n details: formatDiagnosticErrorDetails(error),\n });\n\nexport const createStringTranslationError = (\n string: string,\n id?: string,\n functionName = 'tx'\n) =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: `${functionName}(\"${string}\")${id ? ` with id \"${id}\"` : ''} could not find a translation`,\n wayOut: 'Source content will render as a fallback',\n fix: 'Push translations again or check your dictionary/runtime translation configuration',\n });\n\nexport const invalidLocalesError = (locales: string[]) =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: 'Invalid locale codes in your configuration',\n fix: 'Specify a list of valid locales or use \"customMapping\" to define aliases for the invalid locales',\n details: locales,\n });\n\nexport const invalidCanonicalLocalesError = (locales: string[]) =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: 'Invalid canonical locale codes in your configuration',\n fix: 'Use valid BCP 47 locale codes before starting translation',\n details: locales,\n });\n\nexport const createEmptyIdError = () =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: 't.obj() received an empty id',\n fix: 'Pass a non-empty dictionary id',\n });\n\nexport const createSubtreeNotFoundError = (id: string) =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: `Dictionary subtree \"${id}\" could not be found`,\n fix: 'Check that the id matches your dictionary structure',\n });\n\nexport const createDictionaryEntryError = () =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: 'A dictionary entry cannot be injected as a subtree',\n fix: 'Pass a dictionary object instead',\n });\n\nexport const createCannotInjectDictionaryEntryError = () =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened:\n 'A dictionary entry cannot be merged into another dictionary entry',\n fix: 'Pass a dictionary subtree instead',\n });\n\nexport const createInvalidIcuDictionaryEntryError = (id: string | undefined) =>\n createReactCoreDiagnostic({\n severity: 'Error',\n whatHappened: `Dictionary entry \"${id}\" contains invalid ICU syntax`,\n fix: 'Fix the ICU message before rendering this translation',\n });\n\n// ---- WARNINGS ---- //\n\nexport const projectIdMissingWarning = createReactCoreDiagnostic({\n severity: 'Warning',\n whatHappened: 'Runtime translation needs a project ID',\n fix: 'Add projectId to <GTProvider> or set GT_PROJECT_ID in your environment',\n docsUrl: 'https://generaltranslation.com/dashboard',\n});\n\nexport const createNoEntryFoundWarning = (id: string) =>\n createReactCoreDiagnostic({\n severity: 'Warning',\n whatHappened: `No valid dictionary entry was found for id \"${id}\"`,\n wayOut: 'Source content will render as a fallback',\n });\n\nexport const createInvalidDictionaryEntryWarning = (id: string) =>\n createReactCoreDiagnostic({\n severity: 'Warning',\n whatHappened: `Dictionary entry \"${id}\" is invalid`,\n wayOut: 'Source content will render as a fallback until the entry is fixed',\n });\n\nexport const createInvalidIcuDictionaryEntryWarning = (id: string) =>\n createReactCoreDiagnostic({\n severity: 'Warning',\n whatHappened: `Dictionary entry \"${id}\" contains invalid ICU syntax`,\n wayOut: 'Source content will render as a fallback until the entry is fixed',\n });\n\nexport const createNoEntryTranslationWarning = (\n id: string,\n prefixedId: string\n) =>\n createReactCoreDiagnostic({\n severity: 'Warning',\n whatHappened: `t(\"${id}\") could not find a translation for dictionary item \"${prefixedId}\"`,\n wayOut: 'Source content will render as a fallback',\n });\n\nexport const createMismatchingHashWarning = (\n expectedHash: string,\n receivedHash: string\n) =>\n createReactCoreDiagnostic({\n severity: 'Warning',\n whatHappened: 'Translation hashes do not match',\n reassurance: 'The translation will still render',\n fix: 'Update your translations to the newest version to avoid stale content',\n details: [`expected ${expectedHash}`, `received ${receivedHash}`],\n });\n\nexport const APIKeyMissingWarn = createReactCoreDiagnostic({\n severity: 'Warning',\n whatHappened: 'Runtime translation needs a development API key',\n fix: 'Find your development API key at generaltranslation.com/dashboard, or set runtimeUrl to an empty string to disable runtime translation',\n});\n\nexport const createUnsupportedLocalesWarning = (locales: string[]) =>\n `${PACKAGE_NAME} Warning: The following locales are currently unsupported by our service: ${locales\n .map((locale) => {\n const { name } = getLocaleProperties(locale);\n return `${locale} (${name})`;\n })\n .join(', ')}`;\n\nexport const runtimeTranslationTimeoutWarning = createReactCoreDiagnostic({\n severity: 'Warning',\n whatHappened: 'Runtime translation timed out',\n});\n\nexport const createUnsupportedLocaleWarning = (\n validatedLocale: string,\n newLocale: string,\n packageName: string = PACKAGE_NAME\n) => {\n return (\n `${packageName} Warning: \"${newLocale}\" is not a supported locale. ` +\n `Update supported locales in your dashboard or gt.config.json. ` +\n `Falling back to \"${validatedLocale}\".`\n );\n};\n\nexport const dictionaryMissingWarning = createReactCoreDiagnostic({\n severity: 'Warning',\n whatHappened: 'No dictionary was found',\n fix: 'Pass a dictionary to <GTProvider> or configure a dictionary loader before rendering translations',\n});\n\nexport const createStringRenderWarning = (\n message: string,\n id: string | undefined,\n error?: unknown\n) =>\n createReactCoreDiagnostic({\n severity: 'Warning',\n whatHappened: `The string ${id ? `for id \"${id}\" ` : ''}could not be rendered`,\n wayOut: 'Source content will render as a fallback',\n fix: `Check the message syntax and variables for: \"${message}\"`,\n details: formatDiagnosticErrorDetails(error),\n });\n\n// Unlikely edge case: A <_T> component was injected outside of a <Derive> boundary. This would be caused by the compiler overeagerly injecting <_T> components.\nexport const warnNestedInternalTComponent = `${PACKAGE_NAME} Warning: A <_T> component was found injected outside of a <Derive> boundary. This may affect translation resolution for this component.`;\n","import { isAcceptedPluralForm } from 'generaltranslation/internal';\nimport { InjectionType, TransformationPrefix } from 'generaltranslation/types';\nimport {\n ReactNode,\n ReactElement,\n isValidElement,\n cloneElement,\n Children,\n} from 'react';\nimport { warnNestedInternalTComponent } from '../errors-dir/createErrors';\n\n/**\n * Remove injected _T components at runtime. This is only for i18n-context T components to use.\n * This is necessary because when dealing with deriving fragmented content. The compiler will always\n * inject a `_T` component.\n *\n * Only remove if within a `<Derive>` or `<Static>` component as this scopes this behavior\n * to only where it can actually appear.\n */\nexport function removeInjectedT(children: ReactNode): ReactNode {\n return handleChildren(children, 0);\n}\n\n// ----- Core Logic ----- //\n\n/**\n * Traverses a single child element and removes the injected _T component.\n * @param child - The child element to traverse.\n * @param derivationDepth - The depth of the derivation.\n * @returns The traversed child element.\n *\n * Derivation depth is used for tracking whether or not to apply the _T removal transformation.\n *\n * Rules:\n * 1. Variable components (Var, Num, Currency, DateTime) - hands off\n * 2. Branching components (Branch, Plural) - explore respective branches\n * 3. Derivation components (Derive, Static) - add/remove derivation depth\n * 4. Translation components (T) - remove _T if within a derivation context\n * 5. Then move on to processing the element's children\n */\nfunction handleSingleChildElement(\n child: ReactElement,\n derivationDepth: number\n): ReactNode {\n const { type: elementType, props: elementProps } = child;\n const transformation = getTransformation(elementType);\n // unlikely edge case: encountered an element with props that cannot be processed\n if (typeof elementProps !== 'object' || elementProps === null) {\n return child;\n }\n\n if (transformation) {\n const { componentType, injectionType } = transformation;\n\n // (1) If the element is a variable component, hands off\n if (componentType === 'variable') {\n return child;\n }\n\n // (2) If the element is a branching component, explore respective branches\n else if (componentType === 'branch') {\n // Traverse into each branch (this also includes the children property)\n const newProps = Object.entries(elementProps).reduce<\n Record<string, unknown>\n >((acc, [branchName, branch]) => {\n if (branchName !== 'branch' && !branchName.startsWith('data-')) {\n acc[branchName] = handleSingleChild(branch, derivationDepth);\n } else {\n // Skip recursion on non-translated branches\n acc[branchName] = branch;\n }\n return acc;\n }, {});\n\n return cloneElement(child, {\n ...newProps,\n });\n } else if (componentType === 'plural') {\n // Traverse into each branch (this also includes the children property)\n const newProps = Object.entries(elementProps).reduce<\n Record<string, unknown>\n >((acc, [branchName, branch]) => {\n if (isAcceptedPluralForm(branchName) || branchName === 'children') {\n acc[branchName] = handleSingleChild(branch, derivationDepth);\n } else {\n // Skip Recursion on non-translated branches\n acc[branchName] = branch;\n }\n return acc;\n }, {});\n\n return cloneElement(child, {\n ...newProps,\n });\n }\n\n // (3) If the element is a derivation component, add/remove derivation depth\n else if (componentType === 'derive') {\n return cloneElement(child, {\n ...elementProps,\n ...('children' in elementProps && {\n children: handleChildren(\n elementProps.children as ReactNode,\n derivationDepth + 1\n ),\n }),\n });\n }\n\n // (4) If the element is a translation component, remove _T if within a derivation context, just return the children\n else if (\n componentType === 'translate' &&\n injectionType === 'automatic' &&\n derivationDepth > 0\n ) {\n return 'children' in elementProps\n ? handleChildren(elementProps.children as ReactNode, derivationDepth)\n : undefined;\n }\n\n // Note: componentType === 'translate': means that there is a <_T> inside of a <T>/<_T>\n else if (componentType === 'translate' && injectionType === 'automatic') {\n console.warn(warnNestedInternalTComponent);\n }\n }\n\n // (5) Recurse into children\n return cloneElement(child, {\n ...elementProps,\n ...('children' in elementProps && {\n children: handleChildren(\n elementProps.children as ReactNode,\n derivationDepth\n ),\n }),\n });\n}\n\n// ----- Traversal ----- //\n\n/**\n * Traverses a single child react node and removes the injected _T component.\n */\nfunction handleSingleChild(\n child: ReactNode,\n derivationDepth: number\n): ReactNode {\n if (isValidElement(child)) {\n return handleSingleChildElement(child, derivationDepth);\n }\n return child;\n}\n\n/**\n * Traverses an array of children and removes the injected _T component.\n *\n */\nfunction handleChildren(\n children: ReactNode,\n derivationDepth: number\n): ReactNode {\n if (Array.isArray(children)) {\n return Children.map(children, (child) =>\n handleSingleChild(child, derivationDepth)\n );\n }\n return handleSingleChild(children, derivationDepth);\n}\n\n// ----- Helper Functions ----- //\n\n/**\n * Extracts the transformation from the element type.\n * @param elementType - The element type to extract the transformation from.\n * @returns The transformation.\n */\nfunction getTransformation(elementType: ReactElement['type']):\n | {\n componentType: TransformationPrefix;\n injectionType: InjectionType;\n }\n | undefined {\n // Extract transformation string\n const transformation =\n typeof elementType === 'function' && '_gtt' in elementType\n ? elementType._gtt\n : undefined;\n if (transformation == null || typeof transformation !== 'string')\n return undefined;\n\n // Extract metadata from transformation string\n const parts = transformation.split('-');\n const componentType = parts[0] as TransformationPrefix;\n const injectionType =\n parts[1] === 'automatic' || parts[2] === 'automatic'\n ? 'automatic'\n : 'manual';\n\n return {\n componentType,\n injectionType,\n };\n}\n","const defaultVariableNames = {\n variable: 'value',\n number: 'n',\n datetime: 'date',\n currency: 'cost',\n 'relative-time': 'time',\n} as const;\n\nexport const baseVariablePrefix = '_gt_';\n\nexport default function getVariableName(\n props: Record<string, unknown> = {},\n variableType: keyof typeof defaultVariableNames\n): string {\n if (typeof props.name === 'string') return props.name;\n const baseVariableName = defaultVariableNames[variableType] || 'value';\n const gtTag = props['data-_gt'] as { id?: number } | undefined;\n return `${baseVariablePrefix}${baseVariableName}_${gtTag?.id}`;\n}\n","import React from 'react';\nimport { TaggedElement, TaggedElementProps } from '../types-dir/types';\nimport { AuthFromEnvParams, AuthFromEnvReturn } from './types';\nimport { createInternalUsageError } from '../errors-dir/internalErrors';\n\nexport function isValidTaggedElement(target: unknown): target is TaggedElement {\n return React.isValidElement<TaggedElementProps>(target);\n}\n\n/**\n * @deprecated - this function is to always be overridden by a wrapper react package\n */\nexport function readAuthFromEnv(_params: AuthFromEnvParams): AuthFromEnvReturn {\n throw createInternalUsageError('readAuthFromEnv');\n}\n","//#region src/types-dir/jsx/content.ts\n/**\n* Map of data-_gt properties to their corresponding React props\n*/\nconst HTML_CONTENT_PROPS = {\n\tpl: \"placeholder\",\n\tti: \"title\",\n\talt: \"alt\",\n\tarl: \"aria-label\",\n\tarb: \"aria-labelledby\",\n\tard: \"aria-describedby\"\n};\n//#endregion\nexport { HTML_CONTENT_PROPS as t };\n\n//# sourceMappingURL=types-DY1ZTHWr.mjs.map","import getVariableName from '../variables/getVariableName';\nimport { TaggedChild, TaggedChildren, TaggedElement } from '../types-dir/types';\nimport { isValidTaggedElement } from '../utils/utils';\nimport { minifyVariableType } from 'generaltranslation/internal';\nimport {\n GTProp,\n HTML_CONTENT_PROPS,\n HtmlContentPropKeysRecord,\n JsxChild,\n JsxChildren,\n JsxElement,\n Variable,\n} from '@generaltranslation/format/types';\nimport type { Transformation } from 'generaltranslation/types';\n\n/**\n * Gets the tag name of a React element.\n * @param {ReactElement} child - The React element.\n * @returns {string} - The tag name of the React element.\n */\nconst getTagName = (child: TaggedElement): string => {\n if (!child) return '';\n const { type, props } = child;\n if (type && typeof type === 'function') {\n if (\n 'displayName' in type &&\n typeof type.displayName === 'string' &&\n type.displayName\n )\n return type.displayName;\n if ('name' in type && typeof type.name === 'string' && type.name)\n return type.name;\n }\n if (type && typeof type === 'string') return type;\n if (props.href) return 'a';\n if (props['data-_gt']?.id) return `C${props['data-_gt'].id}`;\n return 'function';\n};\nconst createGTProp = (\n transformation: Transformation,\n props: Record<string, unknown>,\n branches?: Record<string, TaggedChildren>\n): GTProp | undefined => {\n // Add translatable HTML content props\n let newGTProp: GTProp = Object.entries(HTML_CONTENT_PROPS).reduce<GTProp>(\n (acc, [minifiedName, fullName]) => {\n const value = props[fullName];\n if (typeof value === 'string') {\n acc[minifiedName as keyof HtmlContentPropKeysRecord] = value;\n }\n return acc;\n },\n {}\n );\n\n // Check if plural\n if (transformation === 'plural' && branches) {\n const newBranches: Record<string, JsxChildren> = {};\n Object.entries(branches).forEach(\n ([key, value]: [string, TaggedChildren]) => {\n newBranches[key] = writeChildrenAsObjects(value);\n }\n );\n newGTProp = { ...newGTProp, b: newBranches, t: 'p' };\n }\n if (transformation === 'branch' && branches) {\n const newBranches: Record<string, JsxChildren> = {};\n Object.entries(branches).forEach(\n ([key, value]: [string, TaggedChildren]) => {\n newBranches[key] = writeChildrenAsObjects(value);\n }\n );\n newGTProp = { ...newGTProp, b: newBranches, t: 'b' };\n }\n\n return Object.keys(newGTProp).length ? newGTProp : undefined;\n};\n\n/**\n * Handles a single child element.\n * @param {TaggedElement} child - The child to handle.\n * @returns {JsxElement | Variable} The minified element.\n */\nconst handleSingleChildElement = (\n child: TaggedElement\n): JsxElement | Variable => {\n const { props } = child;\n const minifiedElement: JsxElement = {\n t: getTagName(child),\n };\n if (props['data-_gt']) {\n // Get generaltranslation props\n const generaltranslation = props['data-_gt'];\n\n // Check if variable\n const transformation = generaltranslation.transformation;\n if (transformation === 'variable') {\n const variableType = generaltranslation.variableType || 'variable';\n const variableName = getVariableName(props, variableType);\n const minifiedVariableType = minifyVariableType(variableType);\n return {\n i: generaltranslation.id,\n k: variableName,\n v: minifiedVariableType,\n };\n }\n\n // Add id\n minifiedElement.i = generaltranslation.id;\n\n // Add GT prop\n minifiedElement.d = createGTProp(\n transformation as Transformation,\n props,\n generaltranslation.branches\n );\n\n // Add translatable HTML content props\n let newGTProp: GTProp = Object.entries(HTML_CONTENT_PROPS).reduce<GTProp>(\n (acc, [minifiedName, fullName]) => {\n const value = props[fullName];\n if (typeof value === 'string') {\n acc[minifiedName as keyof HtmlContentPropKeysRecord] = value;\n }\n return acc;\n },\n {}\n );\n\n // Check if plural\n if (transformation === 'plural' && generaltranslation.branches) {\n const newBranches: Record<string, JsxChildren> = {};\n Object.entries(generaltranslation.branches).forEach(\n ([key, value]: [string, TaggedChildren]) => {\n newBranches[key] = writeChildrenAsObjects(value);\n }\n );\n newGTProp = { ...newGTProp, b: newBranches, t: 'p' };\n }\n if (transformation === 'branch' && generaltranslation.branches) {\n const newBranches: Record<string, JsxChildren> = {};\n Object.entries(generaltranslation.branches).forEach(\n ([key, value]: [string, TaggedChildren]) => {\n newBranches[key] = writeChildrenAsObjects(value);\n }\n );\n newGTProp = { ...newGTProp, b: newBranches, t: 'b' };\n }\n\n minifiedElement.d = Object.keys(newGTProp).length ? newGTProp : undefined;\n }\n if (props.children) {\n minifiedElement.c = writeChildrenAsObjects(props.children);\n }\n return minifiedElement;\n};\n\nconst handleSingleChild = (child: TaggedChild): JsxChild => {\n if (isValidTaggedElement(child)) {\n return handleSingleChildElement(child);\n }\n if (typeof child === 'number') return child.toString();\n return child as JsxChild;\n};\n\n/**\n * Transforms children elements into objects, processing each child recursively if needed.\n * TaggedChildren are transformed into JsxChildren\n * @param {Children} children - The children to process.\n * @returns {object} The processed children as objects.\n */\nexport default function writeChildrenAsObjects(\n children: TaggedChildren\n): JsxChildren {\n const result = Array.isArray(children)\n ? children.map(handleSingleChild)\n : handleSingleChild(children);\n return result;\n}\n","import {\n getPluralForm,\n isAcceptedPluralForm,\n} from 'generaltranslation/internal';\n\n/**\n * Main function to get the appropriate branch based on the provided number and branches.\n *\n * @param {number} n - The number to determine the branch for.\n * @param {any} branches - The object containing possible branches.\n * @returns {any} The determined branch.\n */\nexport default function getPluralBranch(\n n: number,\n locales: string[],\n branches: Record<string, unknown>\n) {\n let branchName = '';\n let branch = null;\n if (typeof n === 'number' && !branch && branches) {\n const pluralForms = Object.keys(branches).filter(isAcceptedPluralForm);\n branchName = getPluralForm(n, pluralForms, locales);\n }\n if (branchName && !branch) branch = branches[branchName];\n return branch;\n}\n","import { Dictionary, DictionaryEntry } from '../types-dir/types';\nimport { get } from './indexDict';\n\nexport function isValidDictionaryEntry(\n value: unknown\n): value is DictionaryEntry {\n if (typeof value === 'string') {\n return true;\n }\n\n if (Array.isArray(value)) {\n if (typeof value?.[0] !== 'string') {\n return false;\n }\n const provisionalMetadata = value?.[1];\n if (typeof provisionalMetadata === 'undefined') return true;\n if (provisionalMetadata && typeof provisionalMetadata === 'object')\n return true;\n }\n\n return false;\n}\n\nexport function getDictionaryEntry<T extends Dictionary>(\n dictionary: T,\n id: string\n): Dictionary | DictionaryEntry | undefined {\n let current: Dictionary | DictionaryEntry = dictionary;\n const dictionaryPath = id.split('.');\n for (const key of dictionaryPath) {\n if (typeof current !== 'object' && !Array.isArray(current)) {\n return undefined;\n }\n current = get(current as Dictionary, key);\n }\n return current;\n}\n","import { DictionaryEntry, MetaEntry } from '../types-dir/types';\n\nexport default function getEntryAndMetadata(value: DictionaryEntry): {\n entry: string;\n metadata?: MetaEntry;\n} {\n if (Array.isArray(value)) {\n if (value.length === 1) {\n return { entry: value[0] };\n }\n if (value.length === 2) {\n return { entry: value[0], metadata: value[1] as MetaEntry };\n }\n }\n return { entry: value };\n}\n","import { VariableTransformationSuffix } from 'generaltranslation/types';\nimport { GTTag, VariableProps } from '../types-dir/types';\nimport getVariableName from './getVariableName';\nimport { minifyVariableType } from 'generaltranslation/internal';\n\ntype VariableElementProps = {\n 'data-_gt': GTTag & {\n transformation: 'variable';\n };\n [key: string]: unknown;\n};\n\nexport function isVariableElementProps(\n props: unknown\n): props is VariableElementProps {\n return (\n typeof props === 'object' &&\n !!props &&\n 'data-_gt' in props &&\n typeof props['data-_gt'] === 'object' &&\n !!props['data-_gt'] &&\n 'transformation' in props['data-_gt'] &&\n props['data-_gt']?.transformation === 'variable'\n );\n}\n\nexport default function getVariableProps(\n props: VariableElementProps\n): VariableProps {\n const variableType: VariableTransformationSuffix =\n props['data-_gt']?.variableType || 'variable';\n\n const result: VariableProps = {\n variableName: getVariableName(props, variableType),\n variableType: minifyVariableType(variableType),\n injectionType: props['data-_gt']?.injectionType || 'manual',\n variableValue: (() => {\n if (typeof props.value !== 'undefined') return props.value;\n if (typeof props.date !== 'undefined') return props.date;\n if (typeof props['data-_gt-unformatted-value'] !== 'undefined')\n return props['data-_gt-unformatted-value'];\n if (typeof props.children !== 'undefined') return props.children;\n return undefined;\n })(),\n variableOptions: (() => {\n const variableOptions = {\n ...(typeof props.currency !== 'undefined' && {\n currency: props.currency,\n }),\n ...(typeof props.unit !== 'undefined' && {\n unit: props.unit,\n }),\n ...(typeof props.baseDate !== 'undefined' && {\n baseDate: props.baseDate,\n }),\n ...(typeof props.options !== 'undefined' && props.options),\n };\n if (Object.keys(variableOptions).length) return variableOptions;\n if (typeof props['data-_gt-variable-options'] === 'string')\n return JSON.parse(props['data-_gt-variable-options']);\n return props['data-_gt-variable-options'] || undefined;\n })(),\n };\n\n return result;\n}\n","import type { Variable } from '@generaltranslation/format/types';\n\nexport default function isVariableObject(obj: unknown): obj is Variable {\n const variableObj = obj as Variable;\n if (\n variableObj &&\n typeof variableObj === 'object' &&\n typeof (variableObj as Variable).k === 'string'\n ) {\n const keys = Object.keys(variableObj);\n if (keys.length === 1) return true;\n if (keys.length === 2) {\n if (typeof variableObj.i === 'number') return true;\n if (typeof variableObj.v === 'string') return true;\n }\n if (keys.length === 3) {\n if (\n typeof variableObj.v === 'string' &&\n typeof variableObj.i === 'number'\n )\n return true;\n }\n }\n return false;\n}\n","import { TaggedElement, GTTag } from '../types-dir/types';\n\nexport default function getGTTag(child: TaggedElement): GTTag | null {\n if (child && child.props && child.props['data-_gt']) {\n return child.props['data-_gt'];\n }\n return null;\n}\n","import React, { ReactNode } from 'react';\nimport getVariableProps, {\n isVariableElementProps,\n} from '../variables/_getVariableProps';\nimport { libraryDefaultLocale } from 'generaltranslation/internal';\nimport getPluralBranch from '../branches/plurals/getPluralBranch';\nimport {\n RenderVariable,\n TaggedChild,\n TaggedChildren,\n TaggedElement,\n} from '../types-dir/types';\nimport getGTTag from './getGTTag';\n\nexport default function renderDefaultChildren({\n children,\n defaultLocale = libraryDefaultLocale,\n renderVariable,\n}: {\n children: TaggedChildren;\n defaultLocale: string;\n renderVariable: RenderVariable;\n}): React.ReactNode {\n const handleSingleChildElement = (child: TaggedElement): ReactNode => {\n const generaltranslation = getGTTag(child);\n\n // Variable\n if (isVariableElementProps(child.props)) {\n const { variableType, variableValue, variableOptions, injectionType } =\n getVariableProps(child.props);\n return renderVariable({\n variableType,\n variableValue,\n variableOptions,\n locales: [defaultLocale],\n injectionType,\n });\n }\n\n // Plural\n if (generaltranslation?.transformation === 'plural') {\n const branches = generaltranslation.branches || {};\n if (typeof child.props.n !== 'number') {\n return child.props.children != null\n ? handleChildren(child.props.children)\n : null;\n }\n const resolvedBranch = getPluralBranch(\n child.props.n,\n [defaultLocale],\n branches\n );\n return handleChildren(\n (resolvedBranch !== null\n ? resolvedBranch\n : child.props.children) as TaggedChildren\n );\n }\n\n // Branch\n if (generaltranslation?.transformation === 'branch') {\n const { children, branch } = child.props;\n const branches = generaltranslation.branches || {};\n const branchKey =\n branch == null || branch === '' ? undefined : branch.toString();\n return handleChildren(\n branchKey && branches[branchKey] !== undefined\n ? branches[branchKey]\n : children\n );\n }\n\n // Fragment\n if (generaltranslation?.transformation === 'fragment') {\n return React.createElement(React.Fragment, {\n key: child.props.key,\n children: handleChildren(child.props.children),\n });\n }\n\n // Default\n if (child.props.children) {\n return React.cloneElement(child, {\n ...child.props,\n 'data-_gt': undefined,\n children: handleChildren(child.props.children) as TaggedChildren,\n });\n }\n return React.cloneElement(child, { ...child.props, 'data-_gt': undefined });\n };\n\n const handleSingleChild = (child: TaggedChild): ReactNode => {\n if (React.isValidElement(child)) {\n return handleSingleChildElement(child);\n }\n return child;\n };\n\n const handleChildren = (children: TaggedChildren): ReactNode => {\n return Array.isArray(children)\n ? React.Children.map(children, handleSingleChild)\n : handleSingleChild(children);\n };\n\n return handleChildren(children);\n}\n","import React, { ReactNode } from 'react';\nimport {\n TaggedChildren,\n TaggedElement,\n TranslatedChildren,\n RenderVariable,\n TranslatedElement,\n VariableProps,\n} from '../types-dir/types';\nimport getVariableProps, {\n isVariableElementProps,\n} from '../variables/_getVariableProps';\nimport renderDefaultChildren from './renderDefaultChildren';\nimport { isVariable, libraryDefaultLocale } from 'generaltranslation/internal';\nimport getPluralBranch from '../branches/plurals/getPluralBranch';\nimport {\n HTML_CONTENT_PROPS,\n HtmlContentPropValuesRecord,\n} from '@generaltranslation/format/types';\nimport getGTTag from './getGTTag';\n\nfunction renderTranslatedElement({\n sourceElement,\n targetElement,\n locales = [libraryDefaultLocale],\n renderVariable,\n}: {\n sourceElement: TaggedElement;\n targetElement: TranslatedElement;\n locales: string[];\n renderVariable: RenderVariable;\n}): React.ReactNode {\n // Get props and generaltranslation\n const { props: sourceProps } = sourceElement;\n const sourceGT = sourceProps['data-_gt'];\n const transformation = sourceGT?.transformation;\n\n // Get translated props\n const unprocessedTargetGT = targetElement.d;\n const translatedProps: HtmlContentPropValuesRecord = {};\n if (unprocessedTargetGT) {\n Object.entries(HTML_CONTENT_PROPS).forEach(([minifiedName, fullName]) => {\n if (\n unprocessedTargetGT[minifiedName as keyof typeof HTML_CONTENT_PROPS]\n ) {\n translatedProps[fullName] = unprocessedTargetGT[\n minifiedName as keyof typeof HTML_CONTENT_PROPS\n ] as string;\n }\n });\n }\n\n // plural (choose a branch)\n if (transformation === 'plural') {\n const n = sourceElement.props.n;\n if (typeof n !== 'number') {\n return renderDefaultChildren({\n children: sourceElement,\n defaultLocale: locales[0],\n renderVariable,\n });\n }\n const sourceBranches = sourceGT.branches || {};\n const resolvedSourceBranch = getPluralBranch(n, locales, sourceBranches);\n const sourceBranch =\n resolvedSourceBranch !== null\n ? resolvedSourceBranch\n : sourceElement.props.children;\n const targetBranches = targetElement.d?.b || {};\n const resolvedTargetBranch = getPluralBranch(n, locales, targetBranches);\n const targetBranch =\n resolvedTargetBranch !== null ? resolvedTargetBranch : targetElement.c;\n return renderTranslatedChildren({\n source: sourceBranch as TaggedChildren,\n target: targetBranch as TranslatedChildren,\n locales,\n renderVariable,\n });\n }\n\n // branch (choose a branch)\n if (transformation === 'branch') {\n const { branch, children } = sourceProps;\n const branchKey =\n branch == null || branch === '' ? undefined : branch.toString();\n const sourceBranches = sourceGT.branches || {};\n const targetBranches = targetElement.d?.b || {};\n const sourceBranch =\n branchKey && sourceBranches[branchKey] !== undefined\n ? sourceBranches[branchKey]\n : children;\n const targetBranch =\n branchKey && targetBranches[branchKey] !== undefined\n ? targetBranches[branchKey]\n : targetElement.c;\n return renderTranslatedChildren({\n source: sourceBranch as TaggedChildren,\n target: targetBranch as TranslatedChildren,\n locales,\n renderVariable,\n });\n }\n\n // fragment (create a valid fragment)\n if (transformation === 'fragment' && targetElement.c) {\n return React.createElement(React.Fragment, {\n key: sourceElement.props.key,\n children: renderTranslatedChildren({\n source: sourceProps.children as TaggedChildren,\n target: targetElement.c,\n locales,\n renderVariable,\n }) as TaggedChildren,\n });\n }\n\n // other\n if (sourceProps?.children && targetElement?.c) {\n return React.cloneElement(sourceElement, {\n ...sourceProps,\n ...translatedProps,\n 'data-_gt': undefined,\n children: renderTranslatedChildren({\n source: sourceProps.children as TaggedChildren,\n target: targetElement.c,\n locales,\n renderVariable,\n }) as TaggedChildren,\n });\n }\n\n // fallback\n return renderDefaultChildren({\n children: sourceElement,\n defaultLocale: locales[0],\n renderVariable,\n });\n}\n\nexport default function renderTranslatedChildren({\n source,\n target,\n locales = [libraryDefaultLocale],\n renderVariable,\n}: {\n source: TaggedChildren;\n target: TranslatedChildren;\n locales: string[];\n renderVariable: RenderVariable;\n}): ReactNode {\n // Most straightforward case, return a valid React node\n if ((target === null || typeof target === 'undefined') && source)\n return renderDefaultChildren({\n children: source,\n defaultLocale: locales[0],\n renderVariable,\n });\n if (typeof target === 'string') return target;\n\n // Convert source to an array in case target has multiple children where source only has one\n if (Array.isArray(target) && !Array.isArray(source) && source)\n source = [source];\n\n // Multiple children\n if (Array.isArray(source) && Array.isArray(target)) {\n // Track the variables\n const variables: Record<string, VariableProps['variableValue']> = {};\n const variablesOptions: Record<string, VariableProps['variableOptions']> =\n {};\n const variableInjectionTypes: Record<\n string,\n VariableProps['injectionType']\n > = {};\n\n // Extract source elements\n // Extract variable props\n // Filter out variable elements\n const sourceElements: TaggedElement[] = source.filter(\n (sourceChild): sourceChild is TaggedElement => {\n if (React.isValidElement(sourceChild)) {\n if (isVariableElementProps(sourceChild.props)) {\n const {\n variableName,\n variableValue,\n variableOptions,\n injectionType,\n } = getVariableProps(sourceChild.props);\n variables[variableName] = variableValue;\n variablesOptions[variableName] = variableOptions;\n variableInjectionTypes[variableName] = injectionType;\n } else {\n return true;\n }\n }\n return false;\n }\n );\n\n // TODO: pre-index these to avoid O(n/2) lookups\n const findMatchingSourceElement = (\n targetElement: TranslatedElement\n ): TaggedElement | undefined => {\n return (\n sourceElements.find((sourceChild): sourceChild is TaggedElement => {\n const generaltranslation = getGTTag(sourceChild);\n if (typeof generaltranslation?.id !== 'undefined') {\n const sourceId = generaltranslation.id;\n const targetId = targetElement.i;\n return sourceId === targetId;\n }\n return false;\n }) || sourceElements.shift()\n ); // assumes fixed order, not recommended\n };\n\n // map target to source\n return target.map((targetChild, index) => {\n if (typeof targetChild === 'string')\n return (\n <React.Fragment key={`string_${index}`}>{targetChild}</React.Fragment>\n );\n\n // Render variable\n if (isVariable(targetChild)) {\n return (\n <React.Fragment key={`var_${index}`}>\n {renderVariable({\n variableType: targetChild.v || 'v',\n variableValue: variables[targetChild.k],\n variableOptions: variablesOptions[targetChild.k],\n locales,\n injectionType: variableInjectionTypes[targetChild.k] || 'manual',\n })}\n </React.Fragment>\n );\n }\n\n // Render element (targetChild is a TranslatedElement)\n const matchingSourceElement = findMatchingSourceElement(\n targetChild as TranslatedElement\n );\n if (!matchingSourceElement) return null;\n return (\n <React.Fragment key={`element_${index}`}>\n {renderTranslatedElement({\n sourceElement: matchingSourceElement,\n targetElement: targetChild,\n locales,\n renderVariable,\n })}\n </React.Fragment>\n );\n });\n }\n\n // Single child\n if (target && typeof target === 'object' && !Array.isArray(target)) {\n const targetType: 'variable' | 'element' = isVariable(target)\n ? 'variable'\n : 'element';\n\n if (React.isValidElement(source)) {\n if (targetType === 'element') {\n return renderTranslatedElement({\n sourceElement: source,\n targetElement: target as TranslatedElement,\n locales,\n renderVariable,\n });\n }\n\n // Render variable\n if (isVariableElementProps(source.props)) {\n const { variableValue, variableOptions, variableType, injectionType } =\n getVariableProps(source.props);\n return renderVariable({\n variableType,\n variableValue,\n variableOptions,\n locales,\n injectionType,\n });\n }\n }\n }\n\n // fallback\n return renderDefaultChildren({\n children: source,\n defaultLocale: locales[0],\n renderVariable,\n });\n}\n","import { RenderMethod } from '../types-dir/types';\n\n// Apply an 8 second timeout for non dev/testing environments\nexport const getDefaultRenderSettings = (\n environment: 'development' | 'production' | 'test' = 'production'\n): {\n method: RenderMethod;\n timeout: number;\n} => ({\n method: 'default',\n timeout: environment === 'development' ? 8000 : 12000,\n});\n","import React from 'react';\n/**\n * renderSkeleton is a function that handles the rendering behavior for the skeleton loading method.\n * It replaces all content with empty strings\n * @returns an empty string\n */\nexport default function renderSkeleton(): React.ReactNode {\n return '';\n}\n","/**\n * Cookie name for tracking the referrer locale\n */\nexport const defaultLocaleCookieName = 'generaltranslation.locale';\n/**\n * Cookie name for tracking the user's selected region\n */\nexport const defaultRegionCookieName = 'generaltranslation.region';\n/**\n * Cookie name for persisting the enableI18n feature flag\n * \"true\" or \"false\"\n */\nexport const defaultEnableI18nCookieName = 'generaltranslation.enable-i18n';\n","import { Dictionary, DictionaryEntry } from '../types-dir/types';\n\n/**\n * Type guard function that checks if a value is a DictionaryEntry\n * @param value - The value to check\n * @returns true if the value is a DictionaryEntry, false otherwise\n */\nexport function isDictionaryEntry(\n value: Dictionary | DictionaryEntry | undefined\n): value is DictionaryEntry {\n if (value === undefined) {\n return false;\n }\n\n // Check if it's a string (Entry)\n if (typeof value === 'string') {\n return true;\n }\n\n // Check if it's an array\n if (Array.isArray(value)) {\n // Must have 1 or 2 elements\n if (value.length !== 1 && value.length !== 2) {\n return false;\n }\n\n // First element must be a string (Entry)\n if (typeof value[0] !== 'string') {\n return false;\n }\n\n // If there's a second element, it must be an object (MetaEntry)\n if (\n value.length === 2 &&\n (typeof value[1] !== 'object' ||\n value[1] === null ||\n (!('$context' in value[1]) &&\n !('$maxChars' in value[1]) &&\n !('$_hash' in value[1])))\n ) {\n return false;\n }\n\n return true;\n }\n\n return false;\n}\n","import { Dictionary, DictionaryEntry } from '../types-dir/types';\nimport { get } from './indexDict';\nimport { isDictionaryEntry } from './isDictionaryEntry';\n\nconst isPrimitiveOrArray = (value: unknown): boolean =>\n typeof value === 'string' || Array.isArray(value);\n\nconst isObjectDictionary = (value: unknown): boolean =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\nexport default function mergeDictionaries(\n defaultLocaleDictionary: Dictionary,\n localeDictionary: Dictionary\n): Dictionary {\n if (Array.isArray(defaultLocaleDictionary)) {\n return defaultLocaleDictionary.map((value, key) => {\n // Merge Dictionary Entry\n if (isDictionaryEntry(value)) {\n return (localeDictionary as (Dictionary | DictionaryEntry)[])[key];\n }\n // Merge Dictionary\n return mergeDictionaries(\n value as Dictionary,\n (localeDictionary as (Dictionary | DictionaryEntry)[])[\n key\n ] as Dictionary\n );\n });\n }\n // Merge primitive and array values\n const mergedDictionary: Dictionary = {\n ...Object.fromEntries(\n Object.entries(defaultLocaleDictionary).filter(([, value]) =>\n isPrimitiveOrArray(value)\n )\n ),\n ...Object.fromEntries(\n Object.entries(localeDictionary).filter(([, value]) =>\n isPrimitiveOrArray(value)\n )\n ),\n };\n\n // Get nested dictionaries\n const defaultDictionaryKeys = Object.entries(defaultLocaleDictionary)\n .filter(([, value]) => isObjectDictionary(value))\n .map(([key]) => key);\n\n const localeDictionaryKeys = Object.entries(localeDictionary)\n .filter(([, value]) => isObjectDictionary(value))\n .map(([key]) => key);\n\n // Merge nested dictionaries recursively\n const allKeys = new Set([...defaultDictionaryKeys, ...localeDictionaryKeys]);\n for (const key of allKeys) {\n mergedDictionary[key] = mergeDictionaries(\n (get(defaultLocaleDictionary, key) || {}) as Dictionary,\n (get(localeDictionary, key) || {}) as Dictionary\n );\n }\n\n return mergedDictionary;\n}\n","import * as React from 'react';\nexport const reactHasUse =\n typeof (React as typeof React & { use?: unknown }).use === 'function';\n","import { Dictionary, DictionaryEntry } from '../types-dir/types';\nimport { get, set } from './indexDict';\n\nexport function getSubtree<T extends Dictionary>({\n dictionary,\n id,\n}: {\n dictionary: T;\n id: string;\n}): Dictionary | DictionaryEntry | undefined {\n if (id === '') {\n return dictionary;\n }\n\n let current: Dictionary | DictionaryEntry = dictionary;\n const dictionaryPath = id.split('.');\n for (const key of dictionaryPath) {\n current = get(current as Dictionary, key);\n }\n return current;\n}\n\n/**\n * @description A function that gets a subtree from a dictionary\n * @param dictionary - new dictionary to get the subtree from\n * @param id - id of the subtree to get\n * @param sourceDictionary - source dictionary to model off of\n * @returns\n */\nexport function getSubtreeWithCreation<T extends Dictionary>({\n dictionary,\n id,\n sourceDictionary,\n}: {\n dictionary: T;\n id: string;\n sourceDictionary: T;\n}): Dictionary | DictionaryEntry | undefined {\n if (id === '') {\n return dictionary;\n }\n\n let current: Dictionary | DictionaryEntry = dictionary;\n const sourceCurrent: Dictionary | DictionaryEntry = sourceDictionary;\n const dictionaryPath = id.split('.');\n for (const key of dictionaryPath) {\n if (get(current as Dictionary, key) === undefined) {\n // We know this wont be type Dictionary because we should have already checked for that\n if (Array.isArray(get(sourceCurrent as Dictionary, key))) {\n set(current as Dictionary, key, [] as Dictionary);\n } else {\n set(current as Dictionary, key, {} as Dictionary);\n }\n }\n current = get(current as Dictionary, key);\n }\n return current;\n}\n","import {\n Dictionary,\n DictionaryEntry,\n TranslatedChildren,\n} from '../types-dir/types';\nimport { get, set } from './indexDict';\nimport { isDictionaryEntry } from './isDictionaryEntry';\n\nconst DANGEROUS_KEYS = ['constructor', 'prototype', '__proto__'];\nfunction isDangerousKey(key: string): boolean {\n if (DANGEROUS_KEYS.includes(key)) {\n return true;\n }\n return false;\n}\n\n/**\n * @description Injects an entry into a translations object\n * @param translations - The translations object to inject the entry into\n * @param entry - The entry to inject\n * @param hash - The hash of the entry\n * @param sourceDictionary - The source dictionary to model the new dictionary after\n */\nexport function injectEntry(\n dictionaryEntry: DictionaryEntry,\n dictionary: Dictionary | DictionaryEntry,\n id: string,\n sourceDictionary: Dictionary | DictionaryEntry\n) {\n // If the dictionary is a DictionaryEntry, return it\n if (isDictionaryEntry(dictionary)) {\n return dictionaryEntry;\n }\n\n // Iterate over all but last key\n const keys = id.split('.');\n keys.forEach((key) => {\n if (isDangerousKey(key)) {\n throw new Error(`Invalid key: ${key}`);\n }\n });\n dictionary ||= {};\n for (const key of keys.slice(0, -1)) {\n // Create new value if it doesn't exist\n if (get(dictionary, key) == null) {\n set(\n dictionary,\n key,\n Array.isArray(get(sourceDictionary as Dictionary, key))\n ? []\n : ({} as Dictionary)\n );\n }\n // Iterate\n dictionary = get(dictionary, key) as Dictionary;\n sourceDictionary = get(sourceDictionary as Dictionary, key) as Dictionary;\n }\n // Inject the entry into the last key\n const lastKey = keys[keys.length - 1];\n set(dictionary, lastKey, dictionaryEntry);\n}\n\n/**\n * @description Merge results into a dictionary\n * @param dictionary - The dictionary to merge the results into\n * @param results - The results to merge into the dictionary\n * @param sourceDictionary - The source dictionary to model the new dictionary after\n * @returns The merged dictionary\n */\nexport function mergeResultsIntoDictionary(\n dictionary: Dictionary,\n results: [string, TranslatedChildren][],\n sourceDictionary: Dictionary\n): Dictionary {\n results.forEach(([id, result]) => {\n injectEntry(result as string, dictionary, id, sourceDictionary);\n });\n return dictionary;\n}\n","import { Dictionary } from '../types-dir/types';\nimport getEntryAndMetadata from './getEntryAndMetadata';\nimport { isDictionaryEntry } from './isDictionaryEntry';\nimport { set } from './indexDict';\n\n/**\n * @description Iterate over tree and remove metadata leaving just the entry\n */\nexport function stripMetadataFromEntries(dictionary: Dictionary): Dictionary {\n let result: Dictionary = {};\n if (Array.isArray(dictionary)) {\n result = [];\n }\n Object.entries(dictionary).forEach(([key, value]) => {\n if (isDictionaryEntry(value)) {\n const { entry } = getEntryAndMetadata(value);\n set(result, key, entry);\n } else {\n set(result, key, stripMetadataFromEntries(value));\n }\n });\n return result;\n}\n","import { n as stableStringify, t as isVariable } from \"./isVariable-fAKEB7gF.mjs\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { bytesToHex, utf8ToBytes } from \"@noble/hashes/utils.js\";\n//#region src/id/hashSource.ts\n/**\n* Calculates a unique hash for a given string using SHA-256.\n*\n* First 16 characters of hash, hex encoded.\n*\n* @param {string} string - The string to be hashed.\n* @returns {string} The resulting hash as a hexadecimal string.\n*/\nfunction hashString(string) {\n\treturn bytesToHex(sha256(utf8ToBytes(string))).slice(0, 16);\n}\n/**\n* Calculates a unique ID for the given children objects by hashing their sanitized JSON string representation.\n*\n* @param {any} childrenAsObjects - The children objects to be hashed.\n* @param {string} [context] - The context for the children.\n* @param {string} [id] - The ID for the JSX children object.\n* @param {number} [maxChars] - The maxChars limit for the JSX children object.\n* @param {string} [dataFormat] - The data format of the sources.\n* @param {function} [hashFunction] - Custom hash function.\n* @returns {string} - The unique hash of the children.\n*/\nfunction hashSource({ source, context, id, maxChars, dataFormat }, hashFunction = hashString) {\n\tlet sanitizedSource;\n\tif (dataFormat === \"JSX\") sanitizedSource = sanitizeJsxChildren(source);\n\telse sanitizedSource = source;\n\treturn hashFunction(stableStringify({\n\t\tsource: sanitizedSource,\n\t\t...id && { id },\n\t\t...context && { context },\n\t\t...maxChars != null && { maxChars: Math.abs(maxChars) },\n\t\t...dataFormat && { dataFormat }\n\t}));\n}\n/**\n* Sanitizes a child object by removing the data-_gt attribute and its branches.\n*\n* @param child - The child object to sanitize.\n* @returns The sanitized child object.\n*\n*/\nconst sanitizeChild = (child) => {\n\tif (child && typeof child === \"object\") {\n\t\tconst newChild = {};\n\t\tif (\"c\" in child && child.c) newChild.c = sanitizeJsxChildren(child.c);\n\t\tif (\"d\" in child) {\n\t\t\tconst generaltranslation = child?.d;\n\t\t\tif (generaltranslation?.b) newChild.b = Object.fromEntries(Object.entries(generaltranslation.b).map(([key, value]) => [key, sanitizeJsxChildren(value)]));\n\t\t\tif (generaltranslation?.t) newChild.t = generaltranslation.t;\n\t\t}\n\t\tif (isVariable(child)) return {\n\t\t\tk: child.k,\n\t\t\t...child.v && { v: child.v }\n\t\t};\n\t\treturn newChild;\n\t}\n\treturn child;\n};\nfunction sanitizeJsxChildren(childrenAsObjects) {\n\treturn Array.isArray(childrenAsObjects) ? childrenAsObjects.map(sanitizeChild) : sanitizeChild(childrenAsObjects);\n}\n//#endregion\n//#region src/id/hashTemplate.ts\nfunction hashTemplate(template, hashFunction = hashString) {\n\treturn hashFunction(stableStringify(template));\n}\n//#endregion\nexport { hashSource as n, hashString as r, hashTemplate as t };\n\n//# sourceMappingURL=id-DEaFhGqX.mjs.map","import { hashSource } from 'generaltranslation/id';\nimport { isDictionaryEntry } from './isDictionaryEntry';\nimport { Dictionary } from '../types-dir/types';\nimport getEntryAndMetadata from './getEntryAndMetadata';\nimport { set } from './indexDict';\nimport { indexVars } from 'generaltranslation/internal';\n\n/**\n * @description Given a dictionary, adds hashes to all dictionary entries\n * @param dictionary - The dictionary to add hashes to\n * @param id - The starting point of dictionary (if subtree)\n */\nexport function injectHashes(\n dictionary: Dictionary,\n id: string = ''\n): { dictionary: Dictionary; updateDictionary: boolean } {\n let updateDictionary = false;\n Object.entries(dictionary).forEach(([key, value]) => {\n const wholeId = id ? `${id}.${key}` : key;\n if (isDictionaryEntry(value)) {\n // eslint-disable-next-line prefer-const\n let { entry, metadata } = getEntryAndMetadata(value);\n if (!metadata?.$_hash) {\n metadata ||= {};\n metadata.$_hash = hashSource({\n source: indexVars(entry),\n ...(metadata?.$context && { context: metadata.$context }),\n ...(metadata?.$maxChars != null && {\n maxChars: Math.abs(metadata.$maxChars),\n }),\n id: wholeId,\n dataFormat: 'ICU',\n });\n set(dictionary, key, [entry, metadata]);\n updateDictionary = true;\n }\n } else {\n const { updateDictionary: updateFlag } = injectHashes(value, wholeId);\n updateDictionary = updateDictionary || updateFlag;\n }\n });\n return { dictionary, updateDictionary };\n}\n","import { Dictionary, Translations } from '../types-dir/types';\nimport { getDictionaryEntry } from './getDictionaryEntry';\nimport getEntryAndMetadata from './getEntryAndMetadata';\nimport { injectEntry } from './injectEntry';\nimport { isDictionaryEntry } from './isDictionaryEntry';\n\n/**\n * @description Injects translations into a dictionary\n * @param dictionary - The dictionary to inject translations into\n * @param translationsDictionary - The translations to inject into the dictionary\n * @param translations - The translations to inject into the dictionary\n * @param id - The id of the dictionary to inject translations into\n */\nexport function injectTranslations(\n dictionary: Dictionary,\n translationsDictionary: Dictionary,\n translations: Translations,\n missingTranslations: {\n source: string;\n metadata: {\n $id: string;\n $context?: string;\n $maxChars?: number;\n $_hash: string;\n };\n }[],\n prefixToRemove: string = ''\n): { dictionary: Dictionary; updateDictionary: boolean } {\n let updateDictionary = false;\n const prefixToRemoveArray = prefixToRemove ? prefixToRemove.split('.') : [];\n missingTranslations.forEach(({ metadata }) => {\n const { $_hash, $id } = metadata;\n\n const id =\n prefixToRemoveArray.length > 0\n ? $id.split('.').slice(prefixToRemoveArray.length).join('.')\n : $id;\n\n // Look up in translations object\n const translationEntry = getDictionaryEntry(translationsDictionary, id);\n // Look up in translations dictionary\n let dictTransEntry = undefined;\n if (isDictionaryEntry(translationEntry))\n dictTransEntry = getEntryAndMetadata(translationEntry).entry;\n // Fall back to what was already in the translations dictionary\n const value = translations[$_hash] || dictTransEntry;\n if (!value) {\n return;\n }\n\n injectEntry(value as string, translationsDictionary, id, dictionary);\n updateDictionary = true;\n });\n return {\n dictionary: translationsDictionary as Dictionary,\n updateDictionary,\n };\n}\n","import { Dictionary } from '../types-dir/types';\nimport { getDictionaryEntry } from './getDictionaryEntry';\nimport getEntryAndMetadata from './getEntryAndMetadata';\nimport { injectEntry } from './injectEntry';\nimport { isDictionaryEntry } from './isDictionaryEntry';\n\n/**\n * @description Injects fallbacks into a dictionary\n * @param dictionary - The dictionary to inject translations into\n * @param translationsDictionary - The translations to inject into the dictionary\n * @param translations - The translations to inject into the dictionary\n * @param id - The id of the dictionary to inject translations into\n */\nexport function injectFallbacks(\n dictionary: Dictionary,\n translationsDictionary: Dictionary,\n missingTranslations: {\n source: string;\n metadata: {\n $id: string;\n $context?: string;\n $maxChars?: number;\n $_hash: string;\n };\n }[],\n prefixToRemove: string = ''\n) {\n const prefixToRemoveArray = prefixToRemove ? prefixToRemove.split('.') : [];\n missingTranslations.forEach(({ source, metadata }) => {\n const { $id } = metadata;\n\n const id =\n prefixToRemoveArray.length > 0\n ? $id.split('.').slice(prefixToRemoveArray.length).join('.')\n : $id;\n\n // Look up in translations object\n const translationEntry = getDictionaryEntry(translationsDictionary, id);\n // Look up in translations dictionary\n let dictTransEntry = undefined;\n if (isDictionaryEntry(translationEntry))\n dictTransEntry = getEntryAndMetadata(translationEntry).entry;\n // Fall back to source\n const value = dictTransEntry || source;\n\n injectEntry(value as string, translationsDictionary, id, dictionary);\n });\n return translationsDictionary;\n}\n","import { Dictionary, DictionaryEntry } from '../types-dir/types';\nimport { getDictionaryEntry } from './getDictionaryEntry';\nimport { getSubtree } from './getSubtree';\nimport { get, set } from './indexDict';\nimport { isDictionaryEntry } from './isDictionaryEntry';\nimport mergeDictionaries from './mergeDictionaries';\nimport {\n createDictionaryEntryError,\n createCannotInjectDictionaryEntryError,\n createSubtreeNotFoundError,\n} from '../errors-dir/createErrors';\n\n/**\n * @description Given a subtree and a dictionary, injects the subtree into the dictionary at the given id\n * @param dictionary - The dictionary to inject the subtree into\n * @param subtree - The subtree to inject into the dictionary\n * @param id - The id of the subtree to inject into the dictionary\n */\nexport function injectAndMerge(\n dictionary: Dictionary,\n subtree: Dictionary,\n id: string\n) {\n const dictionarySubtree = getSubtree({ dictionary, id });\n if (!dictionarySubtree) {\n throw new Error(createSubtreeNotFoundError(id));\n }\n if (isDictionaryEntry(dictionarySubtree)) {\n throw new Error(createDictionaryEntryError());\n }\n const mergedSubtree = mergeDictionaries(\n dictionarySubtree as Dictionary,\n subtree\n );\n // Inject the merged subtree into the dictionary\n return injectSubtree(dictionary, mergedSubtree, id);\n}\n\nfunction injectSubtree(\n dictionary: Dictionary,\n subtree: Dictionary,\n id: string\n) {\n const dictionarySubtree = getDictionaryEntry(dictionary, id);\n if (!dictionarySubtree) {\n throw new Error(createSubtreeNotFoundError(id));\n }\n if (isDictionaryEntry(dictionarySubtree)) {\n throw new Error(createCannotInjectDictionaryEntryError());\n }\n const ids = id.split('.');\n const shortenedId = ids.slice(0, -1);\n const lastId = ids[ids.length - 1];\n let current: Dictionary | DictionaryEntry = dictionary;\n shortenedId.forEach((id) => {\n current = get(current as Dictionary, id);\n });\n set(current as Dictionary, lastId, subtree);\n return dictionary;\n}\n","import { Dictionary } from '../types-dir/types';\nimport getEntryAndMetadata from './getEntryAndMetadata';\nimport { get } from './indexDict';\nimport { isDictionaryEntry } from './isDictionaryEntry';\n\n/**\n * @description Collects all untranslated entries from a dictionary\n * @param dictionary - The dictionary to collect untranslated entries from\n * @param translationsDictionary - The translated dictionary to compare against\n * @param id - The id of the dictionary to collect untranslated entries from\n * @returns An array of untranslated entries\n */\nexport function collectUntranslatedEntries(\n dictionary: Dictionary,\n translationsDictionary: Dictionary,\n id: string = ''\n): {\n source: string;\n metadata: {\n $id: string;\n $context?: string;\n $maxChars?: number;\n $_hash: string;\n };\n}[] {\n const untranslatedEntries: {\n source: string;\n metadata: {\n $id: string;\n $context?: string;\n $maxChars?: number;\n $_hash: string;\n };\n }[] = [];\n Object.entries(dictionary).forEach(([key, value]) => {\n const wholeId = id ? `${id}.${key}` : key;\n if (isDictionaryEntry(value)) {\n const { entry, metadata } = getEntryAndMetadata(value);\n\n if (!get(translationsDictionary, key)) {\n untranslatedEntries.push({\n source: entry,\n metadata: {\n $id: wholeId,\n $context: metadata?.$context,\n $maxChars: metadata?.$maxChars,\n $_hash: metadata?.$_hash || '',\n },\n });\n }\n } else {\n untranslatedEntries.push(\n ...collectUntranslatedEntries(\n value,\n (get(translationsDictionary, key) ||\n (Array.isArray(value) ? [] : {})) as Dictionary,\n wholeId\n )\n );\n }\n });\n return untranslatedEntries;\n}\n","import { VAR_IDENTIFIER, condenseVars, decode, extractVars } from \"generaltranslation/internal\";\nimport { formatCutoff, formatMessage } from \"@generaltranslation/format\";\n//#region src/logs/logger.ts\nvar logger_default = {\n\twarn(message) {\n\t\tconsole.warn(message);\n\t},\n\terror(message) {\n\t\tconsole.error(message);\n\t},\n\tinfo(message) {\n\t\tconsole.info(message);\n\t},\n\tdebug(message) {\n\t\tconsole.debug(message);\n\t}\n};\n//#endregion\n//#region src/utils/extractVariables.ts\n/**\n* Given an object of options, returns an object with no gt-related options\n*\n* TODO: next major version, this should extract any sugar syntax options\n* TODO: next major version, options should be Record<string, string>\n*/\nfunction extractVariables(options) {\n\treturn Object.fromEntries(Object.entries(options).filter(([key]) => key !== \"$id\" && key !== \"$context\" && key !== \"$maxChars\" && key !== \"$hash\" && key !== \"$_hash\" && key !== \"$_source\" && key !== \"$_fallback\" && key !== \"$format\" && key !== \"$_locales\" && key !== \"$locale\"));\n}\n//#endregion\n//#region src/translation-functions/utils/messages.ts\nconst createInterpolationFailureMessage = (message) => `String interpolation failed for message: \"${message}\".`;\n//#endregion\n//#region src/translation-functions/utils/formatMessage.ts\n/**\n* Given an encoded message and variables, formats the message.\n* On error, the original encoded message is returned with a warning.\n* @param encodedMsg\n* @param variables\n* @returns\n*/\nfunction formatMessage$1(encodedMsg, variables, locales, dataFormat) {\n\ttry {\n\t\treturn formatMessage(encodedMsg, {\n\t\t\tvariables,\n\t\t\tlocales,\n\t\t\tdataFormat\n\t\t});\n\t} catch {\n\t\tlogger_default.warn(createInterpolationFailureMessage(encodedMsg));\n\t\treturn encodedMsg;\n\t}\n}\n//#endregion\n//#region src/translation-functions/utils/interpolation/interpolateIcuMessage.ts\n/**\n* Applies string interpolation and cutoff formatting. Fallsback to the original message if interpolation fails.\n* @param {string} message - The message to interpolate.\n* @param {InlineTranslationOptions} options - The options to interpolate.\n* @returns {string} - The interpolated message.\n*/\nfunction interpolateIcuMessage(encodedMsg, options) {\n\tif (!encodedMsg) return encodedMsg;\n\tconst source = options.$_fallback;\n\tconst variables = extractVariables(options);\n\ttry {\n\t\tconst declaredVars = extractVars(source || \"\");\n\t\treturn formatCutoff(formatMessage$1(Object.keys(declaredVars).length ? condenseVars(encodedMsg) : encodedMsg, {\n\t\t\t...variables,\n\t\t\t...declaredVars,\n\t\t\t[VAR_IDENTIFIER]: \"other\"\n\t\t}, options.$locale ?? options.$_locales, options.$format), { maxChars: options.$maxChars });\n\t} catch {\n\t\tlogger_default.warn(createInterpolationFailureMessage(encodedMsg));\n\t\tif (options.$_fallback != null) return interpolateIcuMessage(options.$_fallback, {\n\t\t\t...options,\n\t\t\t$_fallback: void 0\n\t\t});\n\t\treturn formatCutoff(encodedMsg, { maxChars: options.$maxChars });\n\t}\n}\n//#endregion\n//#region src/translation-functions/msg/decodeOptions.ts\n/**\n* Decodes the options from an encoded message.\n* @param encodedMsg The message to decode.\n* @returns The decoded options.\n*/\nfunction decodeOptions(encodedMsg) {\n\tif (encodedMsg.lastIndexOf(\":\") === -1) return null;\n\tconst optionsEncoding = encodedMsg.slice(encodedMsg.lastIndexOf(\":\") + 1);\n\ttry {\n\t\treturn JSON.parse(decode(optionsEncoding));\n\t} catch {\n\t\treturn null;\n\t}\n}\n//#endregion\n//#region src/translation-functions/utils/isEncodedTranslationOptions.ts\n/**\n* Given a decoded options object, validate that includes required decoded options\n* These required options are added by msg() during the encoding process.\n*/\nfunction isEncodedTranslationOptions(decodedOptions) {\n\treturn !!(decodedOptions.$_hash && decodedOptions.$_source);\n}\n//#endregion\nexport { extractVariables as a, createInterpolationFailureMessage as i, decodeOptions as n, logger_default as o, interpolateIcuMessage as r, isEncodedTranslationOptions as t };\n\n//# sourceMappingURL=isEncodedTranslationOptions-BOwWa_-J.mjs.map","import { o as logger_default, r as interpolateIcuMessage } from \"./isEncodedTranslationOptions-BOwWa_-J.mjs\";\nimport { createDiagnosticMessage, defaultCacheUrl, defaultRuntimeApiUrl, indexVars, libraryDefaultLocale } from \"generaltranslation/internal\";\nimport { LocaleConfig, formatCutoff, isValidLocale, resolveCanonicalLocale, standardizeLocale } from \"@generaltranslation/format\";\nimport { GT } from \"generaltranslation\";\nimport { hashSource } from \"generaltranslation/id\";\n//#region src/i18n-manager/validation/publishValidationResults.ts\n/**\n* Throw errors if there are any errors and log warnings if there are any warnings\n* @param {ValidationResult[]} results - The results to print\n* @param {string} [prefix] - The prefix to add to the results\n* @param {boolean} [throwOnError] - Whether to throw an error if there are any errors\n*\n* TODO: dedupe messages\n* TODO: logging system\n*/\nfunction publishValidationResults(results, prefix = \"\", throwOnError = true) {\n\tresults.forEach((result) => {\n\t\tswitch (result.type) {\n\t\t\tcase \"error\":\n\t\t\t\tlogger_default.error(prefix + result.message);\n\t\t\t\tbreak;\n\t\t\tcase \"warning\":\n\t\t\t\tlogger_default.warn(prefix + result.message);\n\t\t\t\tbreak;\n\t\t}\n\t});\n\tif (throwOnError && results.some((result) => result.type === \"error\")) throw new Error(\"Validation errors occurred\");\n}\n//#endregion\n//#region src/i18n-manager/utils/getLoadTranslationsType.ts\n/**\n* Based on the configurtion return the load translations type\n*\n* cacheUrl = null means disabled\n*/\nfunction getLoadTranslationsType(config) {\n\tif (config.loadTranslations) return \"custom\";\n\telse if (config.cacheUrl) return \"remote\";\n\telse if ((config.cacheUrl === void 0 || config.cacheUrl === defaultCacheUrl) && config.projectId) return \"gt-remote\";\n\telse return \"disabled\";\n}\n//#endregion\n//#region src/i18n-manager/validation/config-validation/validateLoadTranslations.ts\n/**\n* Load translation configuration\n*\n* Types of load translations:\n* - GT_REMOTE: use the default remote store URL {@link defaultCacheUrl}\n* - REMOTE: use a custom remote store URL\n* - CUSTOM: use a custom translations loader\n* - DISABLED: no translations loading\n*\n* Requirements:\n* - REMOTE:\n* - GT_REMOTE:\n* - projectId is needed\n* - CUSTOM:\n* - loadTranslations is needed\n* - DISABLED:\n* - no requirements\n*/\nfunction validateLoadTranslations(params) {\n\tconst results = [];\n\tconst { projectId, loadTranslations } = params;\n\tswitch (getLoadTranslationsType(params)) {\n\t\tcase \"remote\":\n\t\tcase \"gt-remote\":\n\t\t\tif (!projectId) results.push({\n\t\t\t\ttype: \"warning\",\n\t\t\t\tmessage: createDiagnosticMessage({\n\t\t\t\t\twhatHappened: \"Loading translations from a remote store needs a projectId\",\n\t\t\t\t\tfix: \"Add projectId to the I18nManager config or disable remote translation loading\"\n\t\t\t\t})\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"custom\":\n\t\t\tif (!loadTranslations) results.push({\n\t\t\t\ttype: \"error\",\n\t\t\t\tmessage: createDiagnosticMessage({\n\t\t\t\t\twhatHappened: \"Custom translation loading needs loadTranslations\",\n\t\t\t\t\tfix: \"Provide a loadTranslations function or disable custom translation loading\"\n\t\t\t\t})\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"disabled\": break;\n\t}\n\treturn results;\n}\n//#endregion\n//#region src/i18n-manager/utils/getTranslationApiType.ts\n/**\n* Based on the configurtion return the runtime translation type\n* @param params - The parameters to validate\n* @returns The runtime translation type\n*/\nfunction getTranslationApiType(params) {\n\tconst usesDefaultRuntimeUrl = params.runtimeUrl === void 0 || params.runtimeUrl === defaultRuntimeApiUrl;\n\tif (usesDefaultRuntimeUrl && params.projectId && (params.devApiKey || params.apiKey)) return \"gt\";\n\telse if (params.runtimeUrl && !usesDefaultRuntimeUrl) return \"custom\";\n\telse return \"disabled\";\n}\n//#endregion\n//#region src/i18n-manager/validation/config-validation/validateTranslationApi.ts\n/**\n* Validate the translation API configuration\n* @param params - The parameters to validate\n* @returns The validation results\n*\n* Types of translation API:\n* - GT: use the default runtime API URL {@link defaultRuntimeApiUrl}\n* - CUSTOM: use a custom runtime API URL\n* - DISABLED: no runtime API translation\n*\n* Requirements:\n* - CUSTOM:\n* - GT:\n* - projectId is needed\n* - devApiKey or apiKey is needed\n* - DISABLED:\n* - no requirements\n*\n* TODO: reject dev api key in production\n*/\nfunction validateTranslationApi(params) {\n\tconst results = [];\n\tswitch (getTranslationApiType(params)) {\n\t\tcase \"custom\":\n\t\tcase \"gt\":\n\t\t\tif (!params.projectId) results.push({\n\t\t\t\ttype: \"warning\",\n\t\t\t\tmessage: createDiagnosticMessage({\n\t\t\t\t\twhatHappened: \"Runtime translation needs a projectId\",\n\t\t\t\t\tfix: \"Add projectId to the I18nManager config or disable runtime translation\"\n\t\t\t\t})\n\t\t\t});\n\t\t\tif (!params.devApiKey && !params.apiKey) results.push({\n\t\t\t\ttype: \"warning\",\n\t\t\t\tmessage: createDiagnosticMessage({\n\t\t\t\t\twhatHappened: \"Runtime translation needs devApiKey or apiKey\",\n\t\t\t\t\tfix: \"Add credentials to the I18nManager config or disable runtime translation\"\n\t\t\t\t})\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"disabled\": break;\n\t}\n\treturn results;\n}\n//#endregion\n//#region src/i18n-manager/utils/getGTServicesEnabled.ts\n/**\n* Returns true if GT services are enabled\n* @param config - The configuration\n* @returns True if GT services are enabled\n*/\nfunction getGTServicesEnabled(config) {\n\treturn getLoadTranslationsType(config) === \"gt-remote\" || getTranslationApiType(config) === \"gt\";\n}\n//#endregion\n//#region src/i18n-manager/validation/config-validation/validateLocales.ts\n/**\n* Validate the locales configuration\n* @param params - The parameters to validate\n* @returns The validation results\n*\n* Only apply if using GT services\n*/\nfunction validateLocales(params) {\n\tconst results = [];\n\tif (!getGTServicesEnabled(params)) return results;\n\tconst { defaultLocale, locales, customMapping } = params;\n\tnew Set([...defaultLocale ? [defaultLocale] : [], ...locales || []]).forEach((locale) => {\n\t\tif (!isValidLocale(locale, customMapping)) results.push({\n\t\t\ttype: \"error\",\n\t\t\tmessage: createDiagnosticMessage({\n\t\t\t\twhatHappened: `Locale \"${locale}\" is not valid`,\n\t\t\t\tfix: \"Use a valid BCP 47 locale code or add a custom mapping\"\n\t\t\t})\n\t\t});\n\t});\n\treturn results;\n}\n//#endregion\n//#region src/i18n-manager/validation/config-validation/validateDictionary.ts\n/**\n* Dictionary configuration\n*\n* Requirements:\n* - loadDictionary requires dictionary so the default locale always has a source dictionary\n*/\nfunction validateDictionary(params) {\n\tconst results = [];\n\tif (params.loadDictionary && !params.dictionary) results.push({\n\t\ttype: \"error\",\n\t\tmessage: createDiagnosticMessage({\n\t\t\twhatHappened: \"loadDictionary needs a source dictionary\",\n\t\t\tfix: \"Provide dictionary so the default locale has source content\"\n\t\t})\n\t});\n\treturn results;\n}\n//#endregion\n//#region src/i18n-manager/validation/validateConfig.ts\n/**\n* Validate the configuration\n* @param config - The configuration to validate\n* @returns The validation results\n*/\nfunction validateConfig(config) {\n\tconst results = [];\n\tresults.push(...validateLoadTranslations(config));\n\tresults.push(...validateTranslationApi(config));\n\tresults.push(...validateLocales(config));\n\tresults.push(...validateDictionary(config));\n\treturn results;\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/utils/createTranslateMany.ts\n/**\n* Create a translate many function\n* @param locale - The locale\n* @returns The translate many function\n*/\nfunction createTranslateManyFactory(gtInstance, timeout, metadata = {}) {\n\treturn (locale) => (sources) => gtInstance.translateMany(sources, {\n\t\t...metadata,\n\t\ttargetLocale: locale\n\t}, timeout);\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/translations-loaders/createRemoteTranslationLoader.ts\n/**\n* Creates a translations loader function that loads translations from a remote store (CDN or other)\n* @param params - The parameters for the createRemoteTranslationLoader function\n* @returns A translations loader function\n*\n* TODO: validate projectId, cacheUrl, _versionId, _branchId\n*/\nfunction createRemoteTranslationLoader(params) {\n\tconst unlocalizedUrl = generateUrl(params);\n\tconst loader = async (locale) => {\n\t\tlocale = resolveCanonicalLocale(locale, params.customMapping);\n\t\tconst url = unlocalizedUrl.replace(\"[locale]\", locale);\n\t\tconst response = await fetch(url);\n\t\tif (!response.ok) throw new Error(`Failed to load translations from ${url}`);\n\t\treturn await response.json();\n\t};\n\treturn loader;\n}\n/**\n* Generate a URL for a translations file\n*/\nfunction generateUrl(params) {\n\tconst { cacheUrl = defaultCacheUrl, projectId, _versionId, _branchId } = params;\n\tconst versionIdSegment = _versionId ? `/${_versionId}` : \"\";\n\tconst branchIdQuery = _branchId ? `?branchId=${_branchId}` : \"\";\n\treturn `${cacheUrl}/${projectId}/[locale]` + versionIdSegment + branchIdQuery;\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/translations-loaders/createFallbackTranslationLoader.ts\n/**\n* Creates a fallback translations loader function that loads translations from a fallback source\n* @returns A translations loader function\n*/\nfunction createFallbackTranslationLoader() {\n\tconst loader = async (_locale) => {\n\t\treturn {};\n\t};\n\treturn loader;\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/translations-loaders/routeCreateTranslationLoader.ts\n/**\n* Creates a translation loader function that loads translations from a remote store (CDN or other)\n* @param params - The parameters for the createTranslationLoader function\n* @param params.type - The type of translation loader to create\n* @param params.remoteTranslationLoaderParams - The parameters for the remote translation loader\n* @param params.loadTranslations - The custom translations loader function\n* @returns A translation loader function\n*/\nfunction routeCreateTranslationLoader({ type, remoteTranslationLoaderParams, loadTranslations }) {\n\tif (type === \"disabled\") logger_default.warn(\"I18nManager: No translation loader found. No translations will be loaded.\");\n\tconst { cacheUrl, projectId, _versionId, _branchId, customMapping } = remoteTranslationLoaderParams;\n\tswitch (type) {\n\t\tcase \"remote\":\n\t\tcase \"gt-remote\": return createRemoteTranslationLoader({\n\t\t\tcacheUrl,\n\t\t\tprojectId: projectId || \"\",\n\t\t\t_versionId,\n\t\t\t_branchId,\n\t\t\tcustomMapping\n\t\t});\n\t\tcase \"custom\": return loadTranslations;\n\t\tcase \"disabled\": return createFallbackTranslationLoader();\n\t}\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/Cache.ts\nfunction isPlainObject(value) {\n\tif (value == null || typeof value !== \"object\") return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === Object.prototype || prototype === null;\n}\nfunction copyCacheValue(value) {\n\tif (Array.isArray(value)) return [...value];\n\tif (isPlainObject(value)) return { ...value };\n\treturn value;\n}\n/**\n* Cache class\n* This is designed in such a way that it is the responsibility of the client\n* to invoke the cache miss method when a cache miss occurs.\n*\n* TODO: maybe add \"OutputValue\" as a reflection of \"InputKey\"\n*/\nvar Cache = class {\n\t/**\n\t* Constructor\n\t* @param {Object} params - The parameters for the cache\n\t* @param {Record<CacheKey, CacheValue>} params.init - The initial cache\n\t* @param {CacheLifecycle} [lifecycle] - Optional lifecycle callbacks\n\t*/\n\tconstructor(init, lifecycle) {\n\t\tthis.cache = {};\n\t\tthis.fallbackPromises = {};\n\t\tthis.cache = structuredClone(init);\n\t\tthis.onHit = lifecycle?.onHit;\n\t\tthis.onMiss = lifecycle?.onMiss;\n\t}\n\t/**\n\t* Set the value for a key\n\t*/\n\tsetCache(cacheKey, value) {\n\t\tthis.cache[cacheKey] = value;\n\t}\n\t/**\n\t* Look up the key\n\t*/\n\tgetCache(key) {\n\t\tconst cacheKey = this.genKey(key);\n\t\treturn this.cache[cacheKey];\n\t}\n\t/**\n\t* Get the internal cache\n\t* @returns The internal cache\n\t*\n\t* @internal - used by gt-tanstack-start\n\t*/\n\tgetInternalCache() {\n\t\treturn Object.fromEntries(Object.entries(this.cache).map(([key, value]) => [key, copyCacheValue(value)]));\n\t}\n\t/**\n\t* Get the mutable cache for subclasses that need custom read/write behavior.\n\t*/\n\tgetMutableCache() {\n\t\treturn this.cache;\n\t}\n\t/**\n\t* Fallback to the value from the fallback function on a cache miss\n\t* @important assumes that the fallback error handling done upstream\n\t*/\n\tasync missCache(...args) {\n\t\tconst key = args[0];\n\t\tconst cacheKey = this.genKey(key);\n\t\tif (this.fallbackPromises[cacheKey] !== void 0) return await this.fallbackPromises[cacheKey];\n\t\tconst fallbackPromise = this.fallback(...args);\n\t\tthis.fallbackPromises[cacheKey] = fallbackPromise;\n\t\ttry {\n\t\t\tconst value = await fallbackPromise;\n\t\t\tthis.setCache(cacheKey, value);\n\t\t\treturn value;\n\t\t} finally {\n\t\t\tdelete this.fallbackPromises[cacheKey];\n\t\t}\n\t}\n};\n//#endregion\n//#region src/utils/hashMessage.ts\n/**\n* Hash a message string\n*/\nfunction hashMessage(message, options) {\n\tconst metadataOptions = options;\n\tif (metadataOptions.$_hash != null) return metadataOptions.$_hash;\n\treturn hashSource({\n\t\tsource: options.$format === \"ICU\" ? indexVars(message) : message,\n\t\t...metadataOptions.$context && { context: metadataOptions.$context },\n\t\t...metadataOptions.$id && { id: metadataOptions.$id },\n\t\t...metadataOptions.$maxChars != null && { maxChars: Math.abs(metadataOptions.$maxChars) },\n\t\tdataFormat: options.$format\n\t});\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/TranslationsCache.ts\nconst DEFAULT_BATCH_CONFIG = {\n\tmaxConcurrentRequests: 100,\n\tmaxBatchSize: 25,\n\tbatchInterval: 50\n};\nfunction getPositiveValue(value, defaultValue) {\n\tif (value === void 0 || !Number.isFinite(value) || value <= 0) return defaultValue;\n\treturn value;\n}\nfunction getPositiveInteger(value, defaultValue) {\n\tif (value === void 0 || !Number.isFinite(value)) return defaultValue;\n\tconst integer = Math.trunc(value);\n\treturn integer > 0 ? integer : defaultValue;\n}\nfunction normalizeBatchConfig(batchConfig) {\n\treturn {\n\t\tmaxConcurrentRequests: getPositiveInteger(batchConfig?.maxConcurrentRequests, DEFAULT_BATCH_CONFIG.maxConcurrentRequests),\n\t\tmaxBatchSize: getPositiveInteger(batchConfig?.maxBatchSize, DEFAULT_BATCH_CONFIG.maxBatchSize),\n\t\tbatchInterval: getPositiveValue(batchConfig?.batchInterval, DEFAULT_BATCH_CONFIG.batchInterval)\n\t};\n}\n/**\n* A cache for a single locale's translations\n*\n* Principles:\n* - This class is language agnostic, and should never store the locale code as a parameter.\n* Locale logic is handled at the LocalesCache level. Use a callback function that has the\n* locale parameter embedded if you wish to use the locale code.\n*/\nvar TranslationsCache = class extends Cache {\n\t/**\n\t* Constructor\n\t* @param {Object} params - The parameters for the cache\n\t* @param {Record<Hash, TranslationValue>} params.init - The initial cache\n\t* @param {Function} params.fallback - Get the fallback value for a cache miss\n\t*/\n\tconstructor({ init, translateMany, lifecycle, batchConfig }) {\n\t\tsuper(init, lifecycle);\n\t\tthis._queue = [];\n\t\tthis._batchTimer = null;\n\t\tthis._activeRequests = 0;\n\t\tthis._translateMany = translateMany;\n\t\tthis._batchConfig = normalizeBatchConfig(batchConfig);\n\t}\n\t/**\n\t* Get the translation value for a given key\n\t* @param key - The translation key\n\t* @returns The translation value\n\t*/\n\tget(key) {\n\t\tconst value = this.getCache(key);\n\t\tif (value != null && this.onHit) this.onHit({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: value,\n\t\t\toutputValue: value\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Miss the cache\n\t* @param key - The translation key\n\t* @returns The translation value\n\t*/\n\tasync miss(key) {\n\t\tconst value = await this.missCache(key);\n\t\tif (value != null && this.onMiss) this.onMiss({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: value,\n\t\t\toutputValue: value\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Generate a key for the cache\n\t* @param key - The translation key\n\t* @returns The key\n\t*/\n\tgenKey(key) {\n\t\treturn hashMessage(key.message, key.options);\n\t}\n\t/**\n\t* Get the fallback value for a cache miss\n\t* @param key - The translation key\n\t* @returns The fallback value\n\t*/\n\tfallback(key) {\n\t\tconst translationPromise = this._enqueueTranslation(key);\n\t\tif (this._queue.length >= this._batchConfig.maxBatchSize) this._flushNow();\n\t\telse this._scheduleBatch();\n\t\treturn translationPromise;\n\t}\n\t/**\n\t* Flush the queue now\n\t*/\n\t_flushNow() {\n\t\tif (this._batchTimer) {\n\t\t\tclearTimeout(this._batchTimer);\n\t\t\tthis._batchTimer = null;\n\t\t}\n\t\tthis._drainQueue();\n\t}\n\t/**\n\t* Schedule a batch of translations\n\t*/\n\t_scheduleBatch() {\n\t\tif (this._batchTimer) return;\n\t\tthis._batchTimer = setTimeout(() => {\n\t\t\tthis._batchTimer = null;\n\t\t\tthis._drainQueue();\n\t\t}, this._batchConfig.batchInterval);\n\t}\n\t/**\n\t* Drain the queue\n\t*/\n\t_drainQueue() {\n\t\twhile (this._queue.length > 0 && this._activeRequests < this._batchConfig.maxConcurrentRequests) {\n\t\t\tconst batch = this._queue.splice(0, this._batchConfig.maxBatchSize);\n\t\t\tthis._sendBatchRequest(batch);\n\t\t}\n\t\tif (this._queue.length > 0) this._scheduleBatch();\n\t}\n\t/**\n\t* Enqueue translation request and return a promise that resolves when the translation is ready\n\t* @param {TranslationKey<TranslationValue>} key - The translation key\n\t* @returns {Promise<TranslationValue>} The translation promise\n\t*/\n\t_enqueueTranslation(key) {\n\t\tconst hash = this.genKey(key);\n\t\tconst options = key.options;\n\t\tconst metadataOptions = options;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis._queue.push({\n\t\t\t\tkey: hash,\n\t\t\t\tsource: key.message,\n\t\t\t\tmetadata: {\n\t\t\t\t\thash,\n\t\t\t\t\t...metadataOptions.$context && { context: metadataOptions.$context },\n\t\t\t\t\t...metadataOptions.$id && { id: metadataOptions.$id },\n\t\t\t\t\t...metadataOptions.$maxChars != null && { maxChars: Math.abs(metadataOptions.$maxChars) },\n\t\t\t\t\tdataFormat: options.$format\n\t\t\t\t},\n\t\t\t\tresolve: (value) => resolve(value),\n\t\t\t\treject\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t* Send a batch request for translations\n\t* @param {QueueEntry<TranslationValue>[]} batch - The batch of requests to send\n\t*/\n\tasync _sendBatchRequest(batch) {\n\t\tthis._activeRequests++;\n\t\tconst requests = convertBatchToTranslateManyParams(batch);\n\t\tconst response = await this._sendBatchRequestWithErrorHandling(batch, requests);\n\t\tif (response) this._handleTranslationResponse(batch, response);\n\t\tthis._activeRequests--;\n\t}\n\t/**\n\t* Send a translation request with error handling\n\t*/\n\tasync _sendBatchRequestWithErrorHandling(batch, requests) {\n\t\ttry {\n\t\t\treturn await this._translateMany(requests);\n\t\t} catch (error) {\n\t\t\tfor (const entry of batch) entry.reject(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Handle a translation response\n\t*/\n\t_handleTranslationResponse(batch, response) {\n\t\tfor (const entry of batch) {\n\t\t\tconst { key } = entry;\n\t\t\tconst result = response[key];\n\t\t\tif (result && result.success) {\n\t\t\t\tconst translation = result.translation;\n\t\t\t\tthis.setCache(key, translation);\n\t\t\t\tentry.resolve(translation);\n\t\t\t} else entry.reject(result?.error);\n\t\t}\n\t}\n};\n/**\n* Convert a TranslationKey to a TranslateManyEntry\n*/\nfunction convertBatchToTranslateManyParams(batch) {\n\treturn batch.reduce((acc, entry) => {\n\t\tacc[entry.key] = {\n\t\t\tsource: entry.source,\n\t\t\tmetadata: entry.metadata\n\t\t};\n\t\treturn acc;\n\t}, {});\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/utils/constants.ts\n/**\n* Default cache expiry time in milliseconds\n*/\nconst DEFAULT_CACHE_EXPIRY_TIME = 6e4;\n//#endregion\n//#region src/i18n-manager/translations-manager/LocalesCache.ts\n/**\n* Cache for looking up translations by locale\n*/\nvar LocalesCache = class extends Cache {\n\t/**\n\t* Constructor\n\t* @param {Object} params - The parameters for the cache\n\t* @param {Record<string, CacheEntry<TranslationValue>>} params.init - The initial cache\n\t* @param {number | null} params.ttl - The time to live for cache entries\n\t* @param {SafeTranslationsLoader<TranslationValue>} params.loadTranslations - The translation loader function\n\t* @param {CreateTranslateMany} params.createTranslateMany - Factory function for creating a translate many function\n\t*/\n\tconstructor({ init = {}, ttl, batchConfig, loadTranslations, createTranslateMany, lifecycle: { onLocalesCacheHit: onHit, onLocalesCacheMiss: onMiss, onTranslationsCacheHit, onTranslationsCacheMiss } }) {\n\t\tsuper(init, {\n\t\t\tonHit,\n\t\t\tonMiss\n\t\t});\n\t\tthis.ttl = DEFAULT_CACHE_EXPIRY_TIME;\n\t\tthis.ttl = ttl === null ? -1 : ttl ?? 6e4;\n\t\tthis._translationLoader = loadTranslations;\n\t\tthis._createTranslateMany = createTranslateMany;\n\t\tthis._batchConfig = batchConfig;\n\t\tthis._onTranslationsCacheHit = onTranslationsCacheHit;\n\t\tthis._onTranslationsCacheMiss = onTranslationsCacheMiss;\n\t}\n\t/**\n\t* Get the translations for a given locale\n\t* @param key - The locale\n\t* @returns The translations\n\t*/\n\tget(key) {\n\t\tconst entry = this.getCache(key);\n\t\tif (!entry || entry.expiresAt > 0 && entry.expiresAt < Date.now()) return;\n\t\tconst value = entry.translationsCache;\n\t\tif (value != null && this.onHit) this.onHit({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: entry,\n\t\t\toutputValue: value\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Miss the cache\n\t* @param key - The locale\n\t* @returns The translations cache\n\t*/\n\tasync miss(key) {\n\t\tconst cacheValue = await this.missCache(key);\n\t\tconst value = cacheValue.translationsCache;\n\t\tif (value != null && this.onMiss) this.onMiss({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue,\n\t\t\toutputValue: value\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Generate the cache key for a given locale\n\t* @param key - The locale\n\t* @returns The cache key\n\t*\n\t* This is just an identity function, no transformation needed\n\t*/\n\tgenKey(key) {\n\t\treturn key;\n\t}\n\t/**\n\t* Fallback for a cache miss\n\t* @param locale - The locale\n\t* @returns The cache entry\n\t*/\n\tasync fallback(locale) {\n\t\treturn {\n\t\t\ttranslationsCache: new TranslationsCache({\n\t\t\t\tinit: await this._translationLoader(locale),\n\t\t\t\tlifecycle: this._createTranslationsCacheLifecycle(locale),\n\t\t\t\ttranslateMany: this._createTranslateMany(locale),\n\t\t\t\tbatchConfig: this._batchConfig\n\t\t\t}),\n\t\t\texpiresAt: this.ttl < 0 ? this.ttl : Date.now() + this.ttl\n\t\t};\n\t}\n\t/**\n\t* Create the translations cache lifecycle\n\t* @param locale - The locale\n\t* @returns The translations cache lifecycle\n\t*/\n\t_createTranslationsCacheLifecycle(locale) {\n\t\treturn {\n\t\t\tonHit: this._onTranslationsCacheHit ? (params) => this._onTranslationsCacheHit({\n\t\t\t\tlocale,\n\t\t\t\t...params\n\t\t\t}) : void 0,\n\t\t\tonMiss: this._onTranslationsCacheMiss ? (params) => this._onTranslationsCacheMiss({\n\t\t\t\tlocale,\n\t\t\t\t...params\n\t\t\t}) : void 0\n\t\t};\n\t}\n};\n//#endregion\n//#region src/i18n-manager/translations-manager/utils/dictionary-helpers.ts\nfunction getDictionaryPath(id) {\n\tif (!id) return [];\n\treturn id.split(\".\");\n}\nfunction isDictionaryValue(value) {\n\treturn typeof value === \"object\" && value != null && !Array.isArray(value);\n}\nfunction getDictionaryEntry(value) {\n\tif (!isDictionaryLeafNode(value)) return;\n\treturn {\n\t\tentry: Array.isArray(value) ? value[0] : value,\n\t\toptions: Array.isArray(value) ? value[1] ?? {} : {}\n\t};\n}\nfunction getDictionaryValue(value) {\n\tif (Object.keys(value.options).length === 0) return value.entry;\n\treturn [value.entry, value.options];\n}\nfunction resolveDictionaryLookupOptions(options) {\n\tconst { $format, ...rest } = options;\n\treturn {\n\t\t...rest,\n\t\t$format: isStringFormat($format) ? $format : \"ICU\",\n\t\t...rest.$context === void 0 && typeof rest.context === \"string\" && { $context: rest.context }\n\t};\n}\nfunction isDictionaryLeafNode(value) {\n\tif (typeof value === \"string\") return true;\n\tif (!Array.isArray(value) || typeof value[0] !== \"string\") return false;\n\tif (value.length === 1) return true;\n\treturn value.length === 2 && isDictionaryOptions(value[1]);\n}\nfunction isDictionaryOptions(value) {\n\tif (typeof value !== \"object\" || value == null || Array.isArray(value)) return false;\n\tconst options = value;\n\treturn (options.$context === void 0 || typeof options.$context === \"string\") && (options.$format === void 0 || isStringFormat(options.$format)) && (options.$maxChars === void 0 || typeof options.$maxChars === \"number\") && (options.context === void 0 || typeof options.context === \"string\");\n}\nfunction isStringFormat(value) {\n\treturn value === \"ICU\" || value === \"I18NEXT\" || value === \"STRING\";\n}\nfunction replaceDictionary(target, source) {\n\tfor (const key of Object.keys(target)) delete target[key];\n\tObject.assign(target, source);\n}\n//#endregion\n//#region src/i18n-manager/translations-manager/utils/DictionarySourceNotFoundError.ts\nvar DictionarySourceNotFoundError = class extends Error {\n\tconstructor(id) {\n\t\tsuper(`I18nManager: source dictionary entry ${id} is not defined`);\n\t\tthis.name = \"DictionarySourceNotFoundError\";\n\t}\n};\n//#endregion\n//#region src/i18n-manager/translations-manager/DictionaryCache.ts\n/**\n* A cache for a single locale's dictionary\n*\n* Principles:\n* - This class is language agnostic, and should never store the locale code as a parameter.\n* Locale logic is handled at the LocalesDictionaryCache level. Use a callback function\n* that has the locale parameter embedded if you wish to use the locale code.\n*/\nvar DictionaryCache = class extends Cache {\n\t/**\n\t* Constructor\n\t* @param {Object} params - The parameters for the cache\n\t* @param {Dictionary} params.init - The initial cache\n\t*/\n\tconstructor({ init, lifecycle, runtimeTranslate }) {\n\t\tsuper(init, lifecycle);\n\t\tthis._runtimeTranslate = runtimeTranslate;\n\t\tthis.onHitObj = lifecycle?.onHitObj;\n\t\tthis.onMissObj = lifecycle?.onMissObj;\n\t}\n\t/**\n\t* Get the dictionary value for a given key\n\t* @param key - The dictionary key\n\t* @returns The dictionary value\n\t*/\n\tget(key) {\n\t\tconst value = this.getCache(key);\n\t\tconst entry = getDictionaryEntry(value);\n\t\tif (entry === void 0) return;\n\t\tif (this.onHit) this.onHit({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: value,\n\t\t\toutputValue: entry\n\t\t});\n\t\treturn entry;\n\t}\n\tset(key, value) {\n\t\tconst dictionaryValue = getDictionaryValue(value);\n\t\tthis.setCache(this.genKey(key), dictionaryValue);\n\t}\n\tgetObj(key) {\n\t\tconst value = this.getCache(key);\n\t\tif (value === void 0) return;\n\t\tconst outputValue = structuredClone(value);\n\t\tif (this.onHitObj) this.onHitObj({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: value,\n\t\t\toutputValue\n\t\t});\n\t\treturn outputValue;\n\t}\n\tsetObj(key, value) {\n\t\tthis.setCache(this.genKey(key), structuredClone(value));\n\t}\n\tasync missObj(key, sourceObject) {\n\t\tconst sourceEntry = getDictionaryEntry(sourceObject);\n\t\tif (sourceEntry !== void 0) return getDictionaryValue(await this.miss(key, sourceEntry));\n\t\tif (!isDictionaryValue(sourceObject)) throw new DictionarySourceNotFoundError(key);\n\t\tconst translatedEntries = await Promise.all(Object.entries(sourceObject).map(async ([childKey, childSource]) => {\n\t\t\tconst childPath = key ? `${key}.${childKey}` : childKey;\n\t\t\treturn [childKey, await this.missObj(childPath, childSource)];\n\t\t}));\n\t\tconst translatedObject = Object.fromEntries(translatedEntries);\n\t\tthis.setObj(key, translatedObject);\n\t\treturn translatedObject;\n\t}\n\t/**\n\t* Miss the cache\n\t* @param key - The dictionary key\n\t* @returns The dictionary value\n\t*/\n\tasync miss(key, sourceEntry) {\n\t\tconst value = await this.missCache(key, sourceEntry);\n\t\tconst entry = getDictionaryEntry(value);\n\t\tif (entry === void 0) throw new Error(\"DictionaryCache missCache did not return a DictionaryEntry\");\n\t\tif (this.onMiss) this.onMiss({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: value,\n\t\t\toutputValue: entry\n\t\t});\n\t\treturn entry;\n\t}\n\t/**\n\t* Set the value for a key\n\t*/\n\tsetCache(cacheKey, value) {\n\t\tconst cache = this.getMutableCache();\n\t\tconst dictionaryPath = getDictionaryPath(cacheKey);\n\t\tif (dictionaryPath.length === 0) {\n\t\t\tif (isDictionaryValue(value)) replaceDictionary(cache, value);\n\t\t\treturn;\n\t\t}\n\t\tlet current = cache;\n\t\tfor (const key of dictionaryPath.slice(0, -1)) {\n\t\t\tconst next = current[key];\n\t\t\tif (!isDictionaryValue(next)) current[key] = {};\n\t\t\tcurrent = current[key];\n\t\t}\n\t\tcurrent[dictionaryPath[dictionaryPath.length - 1]] = value;\n\t}\n\t/**\n\t* Look up the key\n\t*/\n\tgetCache(key) {\n\t\tconst dictionaryPath = getDictionaryPath(this.genKey(key));\n\t\tlet current = this.getMutableCache();\n\t\tif (dictionaryPath.length === 0) return current;\n\t\tfor (const pathSegment of dictionaryPath) {\n\t\t\tif (!isDictionaryValue(current)) return;\n\t\t\tcurrent = current[pathSegment];\n\t\t}\n\t\treturn current;\n\t}\n\t/**\n\t* Generate a key for the cache\n\t* @param key - The dictionary key\n\t* @returns The key\n\t*/\n\tgenKey(key) {\n\t\treturn key;\n\t}\n\t/**\n\t* Get the fallback value for a cache miss\n\t* @param key - The dictionary key\n\t* @returns The fallback value\n\t*\n\t* @throws {Error} - If the fallback is not implemented\n\t*/\n\tfallback(key, sourceEntry) {\n\t\treturn this._runtimeTranslate(key, sourceEntry);\n\t}\n};\n//#endregion\n//#region src/i18n-manager/translations-manager/LocalesDictionaryCache.ts\n/**\n* Cache for looking up dictionaries by locale\n*/\nvar LocalesDictionaryCache = class extends Cache {\n\t/**\n\t* Constructor\n\t* @param {Object} params - The parameters for the cache\n\t* @param {number | null} params.ttl - The time to live for cache entries\n\t* @param {DictionaryLoader} params.loadDictionary - The dictionary loader function\n\t*/\n\tconstructor({ ttl, defaultLocale, dictionary = {}, loadDictionary, runtimeTranslate, lifecycle: { onLocalesDictionaryCacheHit: onHit, onLocalesDictionaryCacheMiss: onMiss, onDictionaryCacheHit, onDictionaryCacheMiss, onDictionaryObjectCacheHit } }) {\n\t\tsuper({}, {\n\t\t\tonHit,\n\t\t\tonMiss\n\t\t});\n\t\tthis.ttl = DEFAULT_CACHE_EXPIRY_TIME;\n\t\tthis.ttl = ttl === null ? -1 : ttl ?? 6e4;\n\t\tthis._dictionaryLoader = loadDictionary;\n\t\tthis._runtimeTranslate = runtimeTranslate;\n\t\tthis._onDictionaryCacheHit = onDictionaryCacheHit;\n\t\tthis._onDictionaryCacheMiss = onDictionaryCacheMiss;\n\t\tthis._onDictionaryObjectCacheHit = onDictionaryObjectCacheHit;\n\t\tthis.setCache(defaultLocale, {\n\t\t\tdictionaryCache: new DictionaryCache({\n\t\t\t\tinit: dictionary,\n\t\t\t\truntimeTranslate: this._createDictionaryRuntimeTranslate(defaultLocale),\n\t\t\t\tlifecycle: this._createDictionaryCacheLifecycle(defaultLocale)\n\t\t\t}),\n\t\t\texpiresAt: -1\n\t\t});\n\t}\n\t/**\n\t* Get the dictionary for a given locale\n\t* @param key - The locale\n\t* @returns The dictionary\n\t*/\n\tget(key) {\n\t\tconst entry = this.getCache(key);\n\t\tif (!entry || entry.expiresAt > 0 && entry.expiresAt < Date.now()) return;\n\t\tconst value = entry.dictionaryCache;\n\t\tif (value != null && this.onHit) this.onHit({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue: entry,\n\t\t\toutputValue: value\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Miss the cache\n\t* @param key - The locale\n\t* @returns The dictionary cache\n\t*/\n\tasync miss(key) {\n\t\tconst cacheValue = await this.missCache(key);\n\t\tconst value = cacheValue.dictionaryCache;\n\t\tif (value != null && this.onMiss) this.onMiss({\n\t\t\tinputKey: key,\n\t\t\tcacheKey: this.genKey(key),\n\t\t\tcacheValue,\n\t\t\toutputValue: value\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Generate the cache key for a given locale\n\t* @param key - The locale\n\t* @returns The cache key\n\t*\n\t* This is just an identity function, no transformation needed\n\t*/\n\tgenKey(key) {\n\t\treturn key;\n\t}\n\t/**\n\t* Fallback for a cache miss\n\t* @param locale - The locale\n\t* @returns The cache entry\n\t*/\n\tasync fallback(locale) {\n\t\treturn {\n\t\t\tdictionaryCache: new DictionaryCache({\n\t\t\t\tinit: await this._dictionaryLoader(locale),\n\t\t\t\truntimeTranslate: this._createDictionaryRuntimeTranslate(locale),\n\t\t\t\tlifecycle: this._createDictionaryCacheLifecycle(locale)\n\t\t\t}),\n\t\t\texpiresAt: this.ttl < 0 ? this.ttl : Date.now() + this.ttl\n\t\t};\n\t}\n\t/**\n\t* Create the dictionary cache lifecycle\n\t* @param locale - The locale\n\t* @returns The dictionary cache lifecycle\n\t*/\n\t_createDictionaryCacheLifecycle(locale) {\n\t\treturn {\n\t\t\tonHit: this._onDictionaryCacheHit ? (params) => this._onDictionaryCacheHit({\n\t\t\t\tlocale,\n\t\t\t\t...params\n\t\t\t}) : void 0,\n\t\t\tonMiss: this._onDictionaryCacheMiss ? (params) => this._onDictionaryCacheMiss({\n\t\t\t\tlocale,\n\t\t\t\t...params\n\t\t\t}) : void 0,\n\t\t\tonHitObj: this._onDictionaryObjectCacheHit ? (params) => this._onDictionaryObjectCacheHit({\n\t\t\t\tlocale,\n\t\t\t\t...params\n\t\t\t}) : void 0\n\t\t};\n\t}\n\t_createDictionaryRuntimeTranslate(locale) {\n\t\treturn (key, sourceEntry) => this._runtimeTranslate(locale, key, sourceEntry);\n\t}\n};\n//#endregion\n//#region src/i18n-manager/event-subscription/types.ts\nconst LOCALES_CACHE_MISS_EVENT_NAME = \"locales-cache-miss\";\nconst TRANSLATIONS_CACHE_MISS_EVENT_NAME = \"translations-cache-miss\";\nconst LOCALES_DICTIONARY_CACHE_MISS_EVENT_NAME = \"locales-dictionary-cache-miss\";\nconst DICTIONARY_CACHE_MISS_EVENT_NAME = \"dictionary-cache-miss\";\n//#endregion\n//#region src/i18n-manager/lifecycle-hooks/createLifecycleCallbacks.ts\n/**\n* Maps consumer-facing lifecycle callbacks to internal locales cache lifecycle callbacks.\n* The consumer API exposes simplified params (locale, hash, value) while the internal\n* API uses the full cache lifecycle params (inputKey, cacheKey, cacheValue, outputValue).\n*\n* @deprecated - move to subscription api instead\n*/\nfunction createLifecycleCallbacks(emit) {\n\treturn {\n\t\tonLocalesCacheHit: (params) => {\n\t\t\temit(\"locales-cache-hit\", {\n\t\t\t\tlocale: params.inputKey,\n\t\t\t\ttranslations: params.outputValue.getInternalCache()\n\t\t\t});\n\t\t},\n\t\tonLocalesCacheMiss: (params) => {\n\t\t\temit(LOCALES_CACHE_MISS_EVENT_NAME, {\n\t\t\t\tlocale: params.inputKey,\n\t\t\t\ttranslations: params.outputValue.getInternalCache()\n\t\t\t});\n\t\t},\n\t\tonTranslationsCacheHit: (params) => {\n\t\t\temit(\"translations-cache-hit\", {\n\t\t\t\tlocale: params.locale,\n\t\t\t\thash: params.cacheKey,\n\t\t\t\ttranslation: params.outputValue\n\t\t\t});\n\t\t},\n\t\tonTranslationsCacheMiss: (params) => {\n\t\t\temit(TRANSLATIONS_CACHE_MISS_EVENT_NAME, {\n\t\t\t\tlocale: params.locale,\n\t\t\t\thash: params.cacheKey,\n\t\t\t\ttranslation: params.outputValue\n\t\t\t});\n\t\t},\n\t\tonLocalesDictionaryCacheHit: (params) => {\n\t\t\temit(\"locales-dictionary-cache-hit\", {\n\t\t\t\tlocale: params.inputKey,\n\t\t\t\tdictionary: params.outputValue.getInternalCache()\n\t\t\t});\n\t\t},\n\t\tonLocalesDictionaryCacheMiss: (params) => {\n\t\t\temit(LOCALES_DICTIONARY_CACHE_MISS_EVENT_NAME, {\n\t\t\t\tlocale: params.inputKey,\n\t\t\t\tdictionary: params.outputValue.getInternalCache()\n\t\t\t});\n\t\t},\n\t\tonDictionaryCacheHit: (params) => {\n\t\t\temit(\"dictionary-cache-hit\", {\n\t\t\t\tlocale: params.locale,\n\t\t\t\tid: params.cacheKey,\n\t\t\t\tdictionaryEntry: params.outputValue\n\t\t\t});\n\t\t},\n\t\tonDictionaryCacheMiss: (params) => {\n\t\t\temit(DICTIONARY_CACHE_MISS_EVENT_NAME, {\n\t\t\t\tlocale: params.locale,\n\t\t\t\tid: params.cacheKey,\n\t\t\t\tdictionaryEntry: params.outputValue\n\t\t\t});\n\t\t},\n\t\tonDictionaryObjectCacheHit: (params) => {\n\t\t\temit(\"dictionary-object-cache-hit\", {\n\t\t\t\tlocale: params.locale,\n\t\t\t\tid: params.cacheKey,\n\t\t\t\tdictionaryValue: params.outputValue\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/i18n-manager/event-subscription/EventEmitter.ts\n/**\n* Base class for event emitters\n*/\nvar EventEmitter = class {\n\tconstructor() {\n\t\tthis.listeners = {};\n\t}\n\tgetOrCreateListeners(eventName) {\n\t\tif (!this.listeners[eventName]) this.listeners[eventName] = /* @__PURE__ */ new Set();\n\t\treturn this.listeners[eventName];\n\t}\n\t/**\n\t* Subscribe to an event, returns an unsubscribe function\n\t*/\n\tsubscribe(eventName, listener) {\n\t\tconst set = this.getOrCreateListeners(eventName);\n\t\tset.add(listener);\n\t\treturn () => {\n\t\t\tset.delete(listener);\n\t\t};\n\t}\n\t/**\n\t* Emit an event\n\t*/\n\temit(eventName, event) {\n\t\tthis.listeners[eventName]?.forEach((subscriber) => subscriber(event));\n\t}\n};\n//#endregion\n//#region src/i18n-manager/lifecycle-hooks/subscribeLifecycleCallbacks.ts\n/**\n* Subscribes to the lifecycle callbacks and emits the events to the event emitter\n* @deprecated - move to subscription api instead\n*\n* NOTE: we do not have to worry about unsubscribe here as this is a deprecated api\n* and is only used internally\n*/\nfunction subscribeLifecycleCallbacks({ onLocalesCacheHit, onLocalesCacheMiss, onTranslationsCacheHit, onTranslationsCacheMiss, onLocalesDictionaryCacheHit, onLocalesDictionaryCacheMiss, onDictionaryCacheHit, onDictionaryCacheMiss, onDictionaryObjectCacheHit }, subscribe) {\n\tif (onLocalesCacheHit) subscribe(\"locales-cache-hit\", (event) => {\n\t\tonLocalesCacheHit({\n\t\t\t...event,\n\t\t\tvalue: event.translations\n\t\t});\n\t});\n\tif (onLocalesCacheMiss) subscribe(LOCALES_CACHE_MISS_EVENT_NAME, (event) => {\n\t\tonLocalesCacheMiss({\n\t\t\t...event,\n\t\t\tvalue: event.translations\n\t\t});\n\t});\n\tif (onTranslationsCacheHit) subscribe(\"translations-cache-hit\", (event) => {\n\t\tonTranslationsCacheHit({\n\t\t\t...event,\n\t\t\tvalue: event.translation\n\t\t});\n\t});\n\tif (onTranslationsCacheMiss) subscribe(TRANSLATIONS_CACHE_MISS_EVENT_NAME, (event) => {\n\t\tonTranslationsCacheMiss({\n\t\t\t...event,\n\t\t\tvalue: event.translation\n\t\t});\n\t});\n\tif (onLocalesDictionaryCacheHit) subscribe(\"locales-dictionary-cache-hit\", (event) => {\n\t\tonLocalesDictionaryCacheHit(event);\n\t});\n\tif (onLocalesDictionaryCacheMiss) subscribe(LOCALES_DICTIONARY_CACHE_MISS_EVENT_NAME, (event) => {\n\t\tonLocalesDictionaryCacheMiss(event);\n\t});\n\tif (onDictionaryCacheHit) subscribe(\"dictionary-cache-hit\", (event) => {\n\t\tonDictionaryCacheHit(event);\n\t});\n\tif (onDictionaryCacheMiss) subscribe(DICTIONARY_CACHE_MISS_EVENT_NAME, (event) => {\n\t\tonDictionaryCacheMiss(event);\n\t});\n\tif (onDictionaryObjectCacheHit) subscribe(\"dictionary-object-cache-hit\", (event) => {\n\t\tonDictionaryObjectCacheHit(event);\n\t});\n}\n//#endregion\n//#region src/i18n-manager/I18nManager.ts\n/**\n* Default translation timeout in milliseconds for a runtime translation request\n*/\nconst DEFAULT_TRANSLATION_TIMEOUT = 12e3;\n/**\n* Class for managing translation functionality\n* @template TranslationValue - The type of the translation that will be cached\n*/\nvar I18nManager = class extends EventEmitter {\n\t/**\n\t* Creates an instance of I18nManager.\n\t* TODO: resolve gtConfig from just file path\n\t* @param params - The parameters for the I18nManager constructor\n\t* @param params.config - The configuration for the I18nManager\n\t*/\n\tconstructor(params) {\n\t\tsuper();\n\t\tthis.resolveTranslationSync = (locale, message, options) => {\n\t\t\treturn this.lookupTranslation(locale, message, options);\n\t\t};\n\t\tpublishValidationResults(validateConfig(params), \"I18nManager: \");\n\t\tthis.config = standardizeConfig(params);\n\t\tthis.localeConfig = new LocaleConfig({\n\t\t\tdefaultLocale: this.config.defaultLocale,\n\t\t\tlocales: this.config.locales,\n\t\t\tcustomMapping: this.config.customMapping\n\t\t});\n\t\tconst loadTranslations = createTranslationLoader(params);\n\t\tconst loadDictionary = createDictionaryLoader(params);\n\t\tconst runtimeTranslationTimeout = this.config.runtimeTranslation?.timeout ?? DEFAULT_TRANSLATION_TIMEOUT;\n\t\tconst runtimeTranslationMetadata = this.config.runtimeTranslation?.metadata ?? {};\n\t\tconst createTranslateMany = createTranslateManyFactory(this.getGTClassClean(), runtimeTranslationTimeout, runtimeTranslationMetadata);\n\t\tsubscribeLifecycleCallbacks(params.lifecycle ?? {}, (...args) => this.subscribe(...args));\n\t\tconst lifecycle = createLifecycleCallbacks((...args) => this.emit(...args));\n\t\tthis.localesCache = new LocalesCache({\n\t\t\tloadTranslations,\n\t\t\tcreateTranslateMany,\n\t\t\tlifecycle,\n\t\t\tttl: this.config.cacheExpiryTime,\n\t\t\tbatchConfig: this.config.batchConfig\n\t\t});\n\t\tthis.localesDictionaryCache = new LocalesDictionaryCache({\n\t\t\tdefaultLocale: this.config.defaultLocale,\n\t\t\tdictionary: params.dictionary,\n\t\t\tloadDictionary,\n\t\t\truntimeTranslate: (locale, id, sourceEntry) => this.dictionaryRuntimeTranslate(locale, id, sourceEntry),\n\t\t\tttl: this.config.cacheExpiryTime,\n\t\t\tlifecycle\n\t\t});\n\t}\n\t/**\n\t* Subscribes to a change in a translation entry (eg a runtime translation)\n\t* @param listener - The subscriber function\n\t* @param locale - The locale of the translation entry\n\t* @param hash - The hash of the translation entry\n\t* @returns An unsubscribe function\n\t*\n\t* Pair this with {@link lookupTranslation} to get the translation entry\n\t*/\n\tsubscribeToTranslationsCacheMiss(listener, locale, hash) {\n\t\treturn this.subscribe(TRANSLATIONS_CACHE_MISS_EVENT_NAME, (event) => {\n\t\t\tif (event.locale !== locale || event.hash !== hash) return;\n\t\t\tlistener(event);\n\t\t});\n\t}\n\t/**\n\t* Get the default locale\n\t*/\n\tgetDefaultLocale() {\n\t\treturn this.config.defaultLocale;\n\t}\n\t/**\n\t* Get the locales\n\t*/\n\tgetLocales() {\n\t\treturn this.config.locales;\n\t}\n\t/**\n\t* Get the custom locale mapping\n\t*/\n\tgetCustomMapping() {\n\t\treturn this.config.customMapping;\n\t}\n\t/**\n\t* Get the version ID\n\t*/\n\tgetVersionId() {\n\t\treturn this.config._versionId;\n\t}\n\t/**\n\t* Get a gt class instance\n\t* @param locale - The locale to bind to the GT instance. When omitted, the GT instance is locale agnostic.\n\t* TODO: keep a cache to avoid creating new instances unnecessarily\n\t*/\n\tgetGTClass(locale) {\n\t\treturn this.getGTClassClean(locale ? this.resolveLocale(locale) : void 0);\n\t}\n\t/**\n\t* Is translation enabled?\n\t*/\n\tisTranslationEnabled() {\n\t\treturn this.config.enableI18n;\n\t}\n\t/**\n\t* Get the translation loader function\n\t* @deprecated wrap a cb around loadTranslations instead\n\t*/\n\tgetTranslationLoader() {\n\t\treturn (locale) => this.loadTranslations(locale);\n\t}\n\t/**\n\t* Loads in translations for a given locale\n\t* Edge case usage: access the translations object directly\n\t*/\n\tasync loadTranslations(locale) {\n\t\ttry {\n\t\t\tconst translationLocale = this.resolveCacheLocale(locale);\n\t\t\tif (!translationLocale) return {};\n\t\t\tlet txCache = this.localesCache.get(translationLocale);\n\t\t\tif (!txCache) txCache = await this.localesCache.miss(translationLocale);\n\t\t\treturn txCache.getInternalCache();\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn {};\n\t\t}\n\t}\n\t/**\n\t* Loads in the dictionary for a given locale\n\t* Edge case usage: access the dictionary object directly\n\t*/\n\tasync loadDictionary(locale) {\n\t\ttry {\n\t\t\tconst dictionaryLocale = this.resolveCacheLocale(locale);\n\t\t\tif (!dictionaryLocale) return this.localesDictionaryCache.get(this.config.defaultLocale)?.getInternalCache() ?? {};\n\t\t\tlet dictionaryCache = this.localesDictionaryCache.get(dictionaryLocale);\n\t\t\tif (!dictionaryCache) dictionaryCache = await this.localesDictionaryCache.miss(dictionaryLocale);\n\t\t\treturn dictionaryCache.getInternalCache();\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn {};\n\t\t}\n\t}\n\t/**\n\t* Look up a dictionary entry\n\t*/\n\tlookupDictionary(locale, id) {\n\t\ttry {\n\t\t\tconst dictionaryLocale = this.resolveCacheLocale(locale) ?? this.config.defaultLocale;\n\t\t\treturn this.localesDictionaryCache.get(dictionaryLocale)?.get(id);\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Look up a dictionary entry or subtree\n\t*/\n\tlookupDictionaryObj(locale, id) {\n\t\ttry {\n\t\t\tconst dictionaryLocale = this.resolveCacheLocale(locale) ?? this.config.defaultLocale;\n\t\t\treturn this.localesDictionaryCache.get(dictionaryLocale)?.getObj(id);\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Look up a dictionary entry\n\t* If it's not found, use the fallback (runtime translate)\n\t*/\n\tasync lookupDictionaryWithFallback(locale, id) {\n\t\ttry {\n\t\t\tconst dictionaryLocale = this.resolveCacheLocale(locale);\n\t\t\tif (!dictionaryLocale) {\n\t\t\t\tconst sourceEntry = this.localesDictionaryCache.get(this.config.defaultLocale)?.get(id);\n\t\t\t\tif (sourceEntry === void 0) throw new DictionarySourceNotFoundError(id);\n\t\t\t\treturn sourceEntry;\n\t\t\t}\n\t\t\tlet dictionaryCache = this.localesDictionaryCache.get(dictionaryLocale);\n\t\t\tif (!dictionaryCache) dictionaryCache = await this.localesDictionaryCache.miss(dictionaryLocale);\n\t\t\tlet dictionaryEntry = dictionaryCache.get(id);\n\t\t\tif (dictionaryEntry === void 0) {\n\t\t\t\tconst sourceEntry = this.localesDictionaryCache.get(this.config.defaultLocale)?.get(id);\n\t\t\t\tif (sourceEntry === void 0) throw new DictionarySourceNotFoundError(id);\n\t\t\t\tdictionaryEntry = await dictionaryCache.miss(id, sourceEntry);\n\t\t\t}\n\t\t\treturn dictionaryEntry;\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Look up a dictionary entry or subtree\n\t* If it's not found, use the fallback (runtime translate)\n\t*/\n\tasync lookupDictionaryObjWithFallback(locale, id) {\n\t\ttry {\n\t\t\tconst dictionaryLocale = this.resolveCacheLocale(locale);\n\t\t\tif (!dictionaryLocale) {\n\t\t\t\tconst sourceObject = this.localesDictionaryCache.get(this.config.defaultLocale)?.getObj(id);\n\t\t\t\tif (sourceObject === void 0) throw new DictionarySourceNotFoundError(id);\n\t\t\t\treturn sourceObject;\n\t\t\t}\n\t\t\tlet dictionaryCache = this.localesDictionaryCache.get(dictionaryLocale);\n\t\t\tif (!dictionaryCache) dictionaryCache = await this.localesDictionaryCache.miss(dictionaryLocale);\n\t\t\tlet dictionaryObject = dictionaryCache.getObj(id);\n\t\t\tif (dictionaryObject === void 0) {\n\t\t\t\tconst sourceObject = this.localesDictionaryCache.get(this.config.defaultLocale)?.getObj(id);\n\t\t\t\tif (sourceObject === void 0) throw new DictionarySourceNotFoundError(id);\n\t\t\t\tdictionaryObject = await dictionaryCache.missObj(id, sourceObject);\n\t\t\t}\n\t\t\treturn dictionaryObject;\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Just lookup a translation\n\t*/\n\tlookupTranslation(locale, message, options) {\n\t\ttry {\n\t\t\tconst { translationLocale, options: lookupOptions } = this.resolveLookupParams(locale, options);\n\t\t\tif (!translationLocale) return message;\n\t\t\tconst txCache = this.localesCache.get(translationLocale);\n\t\t\tif (!txCache) return void 0;\n\t\t\treturn txCache.get({\n\t\t\t\tmessage,\n\t\t\t\toptions: lookupOptions\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Look up a translation\n\t* If it's not found, use the fallback (runtime translate)\n\t*/\n\tasync lookupTranslationWithFallback(locale, message, options) {\n\t\ttry {\n\t\t\treturn await this.lookupTranslationWithFallbackResolved(locale, message, options);\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Saves a current lookup translation function immune to expiry\n\t* Useful for operations involving lookup callbacks like useGT()\n\t* @param locale - The locale to get the lookup translation for\n\t* @param prefetchEntries - Any entries we want to prefetch during the async period\n\t* @returns A lookup translation function\n\t*\n\t* @important prefetchEntries must all be the same locale\n\t*/\n\tasync getLookupTranslation(locale, prefetchEntries = []) {\n\t\ttry {\n\t\t\tconst translationLocale = this.resolveCacheLocale(locale);\n\t\t\tif (!translationLocale) return (message) => message;\n\t\t\tconst resolvedPrefetchEntries = resolvePrefetchEntriesByLocale(prefetchEntries, translationLocale, (entryLocale) => this.resolveCacheLocale(entryLocale) ?? this.resolveLocale(entryLocale));\n\t\t\tif (resolvedPrefetchEntries.length !== prefetchEntries.length) logger_default.warn(`I18nManager: getLookupTranslation(): prefetchEntries must all be the same locale, ignoring all entries that are not for ${translationLocale}`);\n\t\t\tlet txCache = this.localesCache.get(translationLocale);\n\t\t\tif (!txCache) txCache = await this.localesCache.miss(translationLocale);\n\t\t\tif (!txCache) return () => void 0;\n\t\t\tawait Promise.all(resolvedPrefetchEntries.filter((entry) => txCache.get(entry) == null).map((entry) => txCache.miss(entry)));\n\t\t\treturn (message, options = {}) => {\n\t\t\t\treturn txCache.get({\n\t\t\t\t\tmessage,\n\t\t\t\t\toptions: this.resolveLookupOptions(options)\n\t\t\t\t});\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn (message) => message;\n\t\t}\n\t}\n\t/**\n\t* Get the translations\n\t* @deprecated use loadTranslations instead\n\t*/\n\tasync getTranslations(locale) {\n\t\ttry {\n\t\t\treturn this.loadTranslations(locale);\n\t\t} catch (error) {\n\t\t\tthis.handleError(error);\n\t\t\treturn {};\n\t\t}\n\t}\n\t/**\n\t* Get translation for a given locale and message\n\t*\n\t* @param {string} locale - The locale to get the translation for\n\t* @returns A function that resolves the translations for a given message and options synchronously\n\t*\n\t* Note: we can assume that the translation is a string because we are passing a string\n\t*\n\t* @deprecated use getLookupTranslation instead\n\t*/\n\tasync getTranslationResolver(locale) {\n\t\treturn this.getLookupTranslation(locale);\n\t}\n\t/**\n\t* Returns true if translation is required\n\t* @param {string} locale - The user's locale\n\t* @returns {boolean} True if translation is required, otherwise false\n\t*/\n\trequiresTranslation(locale) {\n\t\tconst defaultLocale = this.getDefaultLocale();\n\t\tconst locales = this.getLocales();\n\t\treturn this.isTranslationEnabled() && this.localeConfig.requiresTranslation(locale, defaultLocale, locales);\n\t}\n\t/**\n\t* Returns true if dialect translation is required\n\t* @param {string} locale - The user's locale\n\t* @returns {boolean} True if dialect translation is required, otherwise false\n\t*/\n\trequiresDialectTranslation(locale) {\n\t\tconst defaultLocale = this.getDefaultLocale();\n\t\treturn this.requiresTranslation(locale) && this.localeConfig.isSameLanguage(defaultLocale, locale);\n\t}\n\t/**\n\t* Handle errors\n\t* Soft error in production, throw in development\n\t*/\n\thandleError(error) {\n\t\tif (error instanceof DictionarySourceNotFoundError) throw error;\n\t\tswitch (this.config.environment) {\n\t\t\tcase \"development\": throw error;\n\t\t\tdefault:\n\t\t\t\tlogger_default.error(\"I18nManager: \" + error);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tresolveLocale(locale) {\n\t\tconst resolvedLocale = this.localeConfig.determineLocale(locale);\n\t\tif (!this.localeConfig.isValidLocale(locale) || !resolvedLocale) throw new Error(`Locale \"${locale}\" is not valid. Use a valid BCP 47 locale code or add a custom mapping.`);\n\t\treturn resolvedLocale;\n\t}\n\t/**\n\t* Resolve the locale key used to load/read locale caches.\n\t* Returns undefined when the requested locale can use source content.\n\t*/\n\tresolveCacheLocale(locale) {\n\t\tconst resolvedLocale = this.resolveLocale(locale);\n\t\tif (this.requiresTranslation(resolvedLocale)) return resolvedLocale;\n\t\tconst aliasLocale = this.localeConfig.resolveAliasLocale(standardizeLocale(locale));\n\t\tif (this.requiresTranslation(aliasLocale)) return aliasLocale;\n\t}\n\tresolveLookupParams(locale, options) {\n\t\tconst translationLocale = this.resolveCacheLocale(locale);\n\t\treturn {\n\t\t\ttranslationLocale,\n\t\t\toptions: translationLocale ? this.resolveLookupOptions(options, translationLocale) : options\n\t\t};\n\t}\n\tresolveLookupOptions(options = {}, translationLocale) {\n\t\tif (!options.$locale) return options;\n\t\treturn {\n\t\t\t...options,\n\t\t\t$locale: translationLocale ?? this.resolveCacheLocale(options.$locale) ?? this.resolveLocale(options.$locale)\n\t\t};\n\t}\n\tasync lookupTranslationWithFallbackResolved(locale, message, options) {\n\t\tconst { translationLocale, options: lookupOptions } = this.resolveLookupParams(locale, options);\n\t\tif (!translationLocale) return message;\n\t\tlet txCache = this.localesCache.get(translationLocale);\n\t\tif (!txCache) txCache = await this.localesCache.miss(translationLocale);\n\t\tlet translation = txCache.get({\n\t\t\tmessage,\n\t\t\toptions: lookupOptions\n\t\t});\n\t\tif (translation == null) translation = await txCache.miss({\n\t\t\tmessage,\n\t\t\toptions: lookupOptions\n\t\t});\n\t\treturn translation;\n\t}\n\t/**\n\t* Runtime lookup function for dictionaries\n\t*/\n\tasync dictionaryRuntimeTranslate(locale, id, sourceEntry) {\n\t\tconst translation = await this.lookupTranslationWithFallbackResolved(locale, sourceEntry.entry, resolveDictionaryLookupOptions(sourceEntry.options));\n\t\tif (typeof translation !== \"string\") throw new Error(`Dictionary entry \"${id}\" could not be translated into a string. Check the source entry and translation loader output.`);\n\t\treturn translation;\n\t}\n\t/**\n\t* A helper function to create a gt class that is locale agnostic\n\t* This is helpful for when our getLocale function is bound to a\n\t* specific context\n\t*/\n\tgetGTClassClean(locale) {\n\t\treturn new GT({\n\t\t\tsourceLocale: this.config.defaultLocale,\n\t\t\ttargetLocale: locale,\n\t\t\tlocales: Array.from(new Set(this.config.locales.map((locale) => this.localeConfig.resolveCanonicalLocale(locale)))),\n\t\t\tcustomMapping: this.config.customMapping,\n\t\t\tprojectId: this.config.projectId,\n\t\t\tbaseUrl: this.config.runtimeUrl || void 0,\n\t\t\tapiKey: this.config.apiKey,\n\t\t\tdevApiKey: this.config.devApiKey\n\t\t});\n\t}\n};\n/**\n* Standardize the config\n* @param config - The config to standardize\n* @returns The standardized config\n*/\nfunction standardizeConfig(config) {\n\tconst gtServicesEnabled = getGTServicesEnabled(config);\n\tconst dedupedLocales = dedupeLocales({\n\t\tdefaultLocale: config.defaultLocale || libraryDefaultLocale,\n\t\tlocales: config.locales || [libraryDefaultLocale],\n\t\tcustomMapping: config.customMapping\n\t});\n\treturn {\n\t\tenvironment: config.environment || \"production\",\n\t\tenableI18n: config.enableI18n !== void 0 ? config.enableI18n : true,\n\t\tprojectId: config.projectId,\n\t\tdevApiKey: config.devApiKey,\n\t\tapiKey: config.apiKey,\n\t\truntimeUrl: config.runtimeUrl,\n\t\tcacheExpiryTime: config.cacheExpiryTime,\n\t\tbatchConfig: config.batchConfig,\n\t\truntimeTranslation: config.runtimeTranslation,\n\t\t_versionId: config._versionId,\n\t\t...gtServicesEnabled ? standardizeLocales(dedupedLocales) : dedupedLocales\n\t};\n}\n/**\n* Dedupe locales and add defaultLocale\n*/\nfunction dedupeLocales({ defaultLocale, locales, customMapping }) {\n\treturn {\n\t\tdefaultLocale,\n\t\tlocales: Array.from(new Set([defaultLocale, ...locales])),\n\t\tcustomMapping: customMapping || {}\n\t};\n}\n/**\n* Standardize all locales in config\n* Only apply if using GT services\n*/\nfunction standardizeLocales(config) {\n\treturn {\n\t\tdefaultLocale: standardizeLocale(config.defaultLocale),\n\t\tlocales: config.locales.map((locale) => {\n\t\t\tif (typeof config.customMapping?.[locale] === \"string\" ? config.customMapping?.[locale] : config.customMapping?.[locale]?.code) return locale;\n\t\t\telse return standardizeLocale(locale);\n\t\t}),\n\t\tcustomMapping: Object.fromEntries(Object.entries(config.customMapping || {}).map(([key, value]) => [key, typeof value === \"string\" ? standardizeLocale(value) : {\n\t\t\t...value,\n\t\t\t...value.code ? { code: standardizeLocale(value.code) } : {}\n\t\t}]))\n\t};\n}\n/**\n* Resolve prefetch entry locales and keep entries matching the active locale.\n* @template TranslationType - The type of the translation\n* @param {PrefetchEntry<TranslationType>[]} prefetchEntries - The prefetch entries to filter\n* @param {string} locale - The locale to filter by\n* @returns {PrefetchEntry<TranslationType>[]} The filtered prefetch entries\n*/\nfunction resolvePrefetchEntriesByLocale(prefetchEntries, locale, resolveLocale) {\n\treturn prefetchEntries.flatMap((entry) => {\n\t\tconst entryLocale = entry.options.$locale;\n\t\tif (entryLocale == null) return [entry];\n\t\ttry {\n\t\t\tconst resolvedLocale = resolveLocale(entryLocale);\n\t\t\tif (resolvedLocale !== locale) return [];\n\t\t\treturn [{\n\t\t\t\tmessage: entry.message,\n\t\t\t\toptions: {\n\t\t\t\t\t...entry.options,\n\t\t\t\t\t$locale: resolvedLocale\n\t\t\t\t}\n\t\t\t}];\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t});\n}\n/**\n* Helper function for creating a translation loader\n*/\nfunction createTranslationLoader(params) {\n\treturn routeCreateTranslationLoader({\n\t\tloadTranslations: params.loadTranslations,\n\t\ttype: getLoadTranslationsType(params),\n\t\tremoteTranslationLoaderParams: {\n\t\t\tcacheUrl: params.cacheUrl,\n\t\t\tprojectId: params.projectId,\n\t\t\t_versionId: params._versionId,\n\t\t\t_branchId: params._branchId,\n\t\t\tcustomMapping: params.customMapping\n\t\t}\n\t});\n}\n/**\n* Helper function for creating a dictionary loader\n*/\nfunction createDictionaryLoader(params) {\n\treturn params.loadDictionary ?? (() => Promise.resolve({}));\n}\n//#endregion\n//#region src/i18n-manager/singleton-operations.ts\nlet i18nManager = void 0;\nlet fallbackDefaultLocale = libraryDefaultLocale;\nconst fallbackConditionStore = { getLocale: () => fallbackDefaultLocale };\nlet conditionStore = fallbackConditionStore;\n/**\n* Get the singleton instance of I18nManager\n* @returns The singleton instance of I18nManager\n* @template U - The type of the translation that will be cached\n*/\nfunction getI18nManager() {\n\tif (!i18nManager) {\n\t\tlogger_default.warn(\"getI18nManager(): I18nManager was not initialized. Falling back to the default locale until initializeGT() configures translations.\");\n\t\ti18nManager = new I18nManager({\n\t\t\tdefaultLocale: libraryDefaultLocale,\n\t\t\tlocales: [libraryDefaultLocale]\n\t\t});\n\t}\n\treturn i18nManager;\n}\n/**\n* Resolve the current locale from the configured runtime condition source.\n*/\nfunction getCurrentLocale() {\n\treturn conditionStore.getLocale();\n}\n/**\n* Configure the runtime condition source.\n*/\nfunction setConditionStore(nextConditionStore) {\n\tconditionStore = nextConditionStore;\n}\n/**\n* Reset the runtime condition source to the active manager's default-locale fallback.\n*/\nfunction resetConditionStore() {\n\tconditionStore = fallbackConditionStore;\n}\n/**\n* Configure the singleton instance of I18nManager\n* @param config - The configuration for the I18nManager\n*\n* Wrapper libraries will export a configure function that will call this function.\n*/\nfunction setI18nManager(i18nManagerInstance) {\n\ti18nManager = i18nManagerInstance;\n\tfallbackDefaultLocale = i18nManagerInstance.getDefaultLocale();\n\tresetConditionStore();\n}\n//#endregion\n//#region src/translation-functions/utils/interpolation/interpolateStringMessage.ts\n/**\n* String interpolation function\n*/\nfunction interpolateStringMessage(encodedMsg, options) {\n\treturn formatCutoff(encodedMsg, {\n\t\tlocales: options.$locale ?? options.$_locales,\n\t\tmaxChars: options.$maxChars\n\t});\n}\n//#endregion\n//#region src/translation-functions/utils/interpolation/interpolateMessage.ts\n/**\n* Interpolation router function for all {@link StringFormat} types\n*/\nfunction interpolateMessage({ source, target, options, sourceLocale }) {\n\tif (target != null) return routeInterpolation(target, {\n\t\t$_fallback: source,\n\t\t...options\n\t});\n\treturn routeInterpolation(source, getSourceOptions(options, sourceLocale));\n}\n/**\n* Route to appropriate formatting function\n*/\nfunction routeInterpolation(content, options) {\n\tswitch (options.$format ?? \"STRING\") {\n\t\tcase \"ICU\": return interpolateIcuMessage(content, options);\n\t\tcase \"I18NEXT\":\n\t\tcase \"STRING\": return interpolateStringMessage(content, options);\n\t\tdefault: return content;\n\t}\n}\nfunction getSourceOptions(options, sourceLocale) {\n\tif (!sourceLocale) return options;\n\treturn {\n\t\t...options,\n\t\t$locale: sourceLocale\n\t};\n}\n//#endregion\n//#region src/translation-functions/internal/helpers.ts\n/**\n* Just do a simple lookup of the translation\n*/\nfunction resolveJsx(locale, content, options = {}) {\n\tconst i18nManager = getI18nManager();\n\tconst lookupOptions = createLookupOptions(locale, options, \"JSX\");\n\treturn i18nManager.lookupTranslation(lookupOptions.$locale, content, lookupOptions);\n}\n/**\n* Lookup translation, fallback to source\n*/\nfunction resolveJsxWithFallback(locale, content, options = {}) {\n\treturn resolveJsx(locale, content, options) ?? content;\n}\n/**\n* Lookup translation\n* fallback to runtime translate\n* Fallback to source\n*/\nasync function resolveJsxWithRuntimeFallback(locale, content, options = {}) {\n\tconst i18nManager = getI18nManager();\n\tconst lookupOptions = createLookupOptions(locale, options, \"JSX\");\n\treturn await i18nManager.lookupTranslationWithFallback(lookupOptions.$locale, content, lookupOptions) ?? content;\n}\n/**\n* Just do a simple lookup of the translation\n* And interpolate\n*/\nfunction resolveStringContent(locale, content, options = {}) {\n\tconst i18nManager = getI18nManager();\n\tconst lookupOptions = createLookupOptions(locale, options, \"STRING\");\n\tconst translation = i18nManager.lookupTranslation(lookupOptions.$locale, content, lookupOptions);\n\tif (translation == null) return void 0;\n\treturn interpolateMessage({\n\t\tsource: content,\n\t\ttarget: translation,\n\t\toptions: lookupOptions,\n\t\tsourceLocale: i18nManager.getDefaultLocale()\n\t});\n}\n/**\n* Lookup translation, fallback to source\n*/\nfunction resolveStringContentWithFallback(locale, content, options = {}) {\n\tconst i18nManager = getI18nManager();\n\tconst lookupOptions = createLookupOptions(locale, options, \"STRING\");\n\treturn interpolateMessage({\n\t\tsource: content,\n\t\ttarget: i18nManager.lookupTranslation(lookupOptions.$locale, content, lookupOptions),\n\t\toptions: lookupOptions,\n\t\tsourceLocale: i18nManager.getDefaultLocale()\n\t});\n}\n/**\n* Lookup translation\n* fallback to runtime translate\n* Fallback to source\n*/\nasync function resolveStringContentWithRuntimeFallback(locale, content, options = {}) {\n\tconst i18nManager = getI18nManager();\n\tconst lookupOptions = createLookupOptions(locale, options, \"STRING\");\n\treturn interpolateMessage({\n\t\tsource: content,\n\t\ttarget: await i18nManager.lookupTranslationWithFallback(lookupOptions.$locale, content, lookupOptions),\n\t\toptions: lookupOptions,\n\t\tsourceLocale: i18nManager.getDefaultLocale()\n\t});\n}\n/**\n* Add the default format to caller-provided lookup options.\n*/\nfunction createLookupOptions(locale, options, defaultFormat) {\n\treturn {\n\t\t...options,\n\t\t$format: options.$format ?? defaultFormat,\n\t\t$locale: locale\n\t};\n}\n//#endregion\n//#region src/helpers/locale.ts\n/**\n* Get the current locale\n* @returns The current locale\n*\n* @example\n* const locale = getLocale();\n* console.log(locale); // 'en-US'\n*/\nfunction getLocale() {\n\treturn getCurrentLocale();\n}\n/**\n* Get the configured locales\n* @returns The configured locales\n*\n* @example\n* const locales = getLocales();\n* console.log(locales); // ['en-US', 'es-ES']\n*/\nfunction getLocales() {\n\treturn getI18nManager().getLocales();\n}\n/**\n* Get the default locale\n* @returns The default locale\n*\n* @example\n* const defaultLocale = getDefaultLocale();\n* console.log(defaultLocale); // 'en-US'\n*/\nfunction getDefaultLocale() {\n\treturn getI18nManager().getDefaultLocale();\n}\n/**\n* Get the locale properties\n* @param {string} [locale] - The locale to get the properties for. When not provided, uses the current locale.\n* @returns The locale properties\n*\n* @example\n* const localeProperties = getLocaleProperties();\n*\n* @example\n* const localeProperties = getLocaleProperties('en-US');\n*/\nfunction getLocaleProperties(locale = getCurrentLocale()) {\n\treturn getI18nManager().getGTClass().getLocaleProperties(locale);\n}\n//#endregion\n//#region src/helpers/versionId.ts\n/**\n* Get the version ID for the current source\n* @returns The version ID, if set\n*\n* @example\n* const versionId = getVersionId();\n* console.log(versionId); // 'abc123'\n*/\nfunction getVersionId() {\n\treturn getI18nManager().getVersionId();\n}\n//#endregion\nexport { getDictionaryEntry as C, hashMessage as E, TRANSLATIONS_CACHE_MISS_EVENT_NAME as S, resolveDictionaryLookupOptions as T, setI18nManager as _, getLocales as a, LOCALES_CACHE_MISS_EVENT_NAME as b, resolveJsxWithFallback as c, resolveStringContentWithFallback as d, resolveStringContentWithRuntimeFallback as f, setConditionStore as g, getI18nManager as h, getLocaleProperties as i, resolveJsxWithRuntimeFallback as l, getCurrentLocale as m, getDefaultLocale as n, createLookupOptions as o, interpolateMessage as p, getLocale as r, resolveJsx as s, getVersionId as t, resolveStringContent as u, I18nManager as v, isDictionaryValue as w, LOCALES_DICTIONARY_CACHE_MISS_EVENT_NAME as x, DICTIONARY_CACHE_MISS_EVENT_NAME as y };\n\n//# sourceMappingURL=versionId-BkJZGHXr.mjs.map","import { n as decodeOptions, r as interpolateIcuMessage, t as isEncodedTranslationOptions } from \"./isEncodedTranslationOptions-BOwWa_-J.mjs\";\n//#region src/translation-functions/msg/decodeMsg.ts\nfunction decodeMsg(encodedMsg) {\n\tif (typeof encodedMsg === \"string\" && encodedMsg.lastIndexOf(\":\") !== -1) return encodedMsg.slice(0, encodedMsg.lastIndexOf(\":\"));\n\treturn encodedMsg;\n}\n//#endregion\n//#region src/translation-functions/fallbacks/gtFallback.ts\n/**\n* A fallback function for the gt() function that decodes and interpolates.\n* @param {string | null | undefined} message - The ICU formatted message to interpolate.\n* @param {InlineTranslationOptions} options - The options to interpolate.\n* @returns - The decoded and interpolated message.\n*\n* @note This function is useful as a placeholder when for incrementally migrating to the m() function.\n* @example\n* // A backwards compatible translation function\n* function getMessage(gt: GTFunctionType = gtFallback) {\n* return gt('Hello, world!');\n* }\n*\n* // Here i18n has been implemented\n* function WithTranslation() {\n* const gt = useGT();\n* return <>{getMessage(gt)}</>;\n* }\n*\n*\n* // i18n has not yet been implemented yet\n* function WithoutTranslations() {\n* return <>{getMessage()}</>;\n* }\n*/\nconst gtFallback = (message, options = {}) => {\n\treturn interpolateIcuMessage(message, options);\n};\n//#endregion\n//#region src/translation-functions/fallbacks/mFallback.ts\n/**\n* A fallback function for the m() function that decodes and interpolates.\n* @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.\n* @param {InlineTranslationOptions} options - The options to interpolate.\n* @returns - The decoded and interpolated message.\n*\n* @note This function is useful as a placeholder when for incrementally migrating to the m() function.\n* @example\n* // A backwards compatible translation function\n* function getMessage(m: MFunctionType = mFallback) {\n* return m(msg('Hello, world!'));\n* }\n*\n* // Here i18n has been implemented\n* function WithTranslation() {\n* const m = useMessages();\n* return <>{getMessage(m)}</>;\n* }\n*\n*\n* // i18n has not yet been implemented yet\n* function WithoutTranslations() {\n* return <>{getMessage()}</>;\n* }\n*/\nconst mFallback = (encodedMsg, options = {}) => {\n\tif (!encodedMsg) return encodedMsg;\n\tif (isEncodedTranslationOptions(decodeOptions(encodedMsg) ?? {})) return decodeMsg(encodedMsg);\n\treturn interpolateIcuMessage(encodedMsg, options);\n};\n//#endregion\nexport { gtFallback as n, decodeMsg as r, mFallback as t };\n\n//# sourceMappingURL=mFallback-pqVm9wDk.mjs.map","import { a as extractVariables, i as createInterpolationFailureMessage, n as decodeOptions, o as logger_default } from \"./isEncodedTranslationOptions-BOwWa_-J.mjs\";\nimport { E as hashMessage, a as getLocales, d as resolveStringContentWithFallback, i as getLocaleProperties, m as getCurrentLocale, n as getDefaultLocale, r as getLocale, t as getVersionId } from \"./versionId-BkJZGHXr.mjs\";\nimport { n as gtFallback, r as decodeMsg, t as mFallback } from \"./mFallback-pqVm9wDk.mjs\";\nimport { VAR_IDENTIFIER, declareStatic, declareVar, decodeVars, derive, encode, libraryDefaultLocale } from \"generaltranslation/internal\";\nimport { formatMessage } from \"@generaltranslation/format\";\n//#region src/translation-functions/t.ts\n/**\n* Translate a message\n* @param {string} message - The message to translate.\n* @param options - The options for the translation.\n* @returns The translated message.\n*/\nfunction t(message, options = {}) {\n\treturn resolveStringContentWithFallback(options.$locale ?? getCurrentLocale(), message, {\n\t\t$format: \"ICU\",\n\t\t...options\n\t});\n}\n//#endregion\n//#region src/translation-functions/msg/msg.ts\nfunction msg(message, options) {\n\tif (typeof message !== \"string\") {\n\t\tif (!options) return message;\n\t\treturn message.map((m, i) => msg(m, {\n\t\t\t...options,\n\t\t\t...options.$id && { $id: `${options.$id}.${i}` }\n\t\t}));\n\t}\n\tif (!options) return message;\n\tconst variables = extractVariables(options);\n\tlet interpolatedString = message;\n\ttry {\n\t\tinterpolatedString = formatMessage(message, {\n\t\t\tlocales: [libraryDefaultLocale],\n\t\t\tvariables: {\n\t\t\t\t...variables,\n\t\t\t\t[VAR_IDENTIFIER]: \"other\"\n\t\t\t}\n\t\t});\n\t} catch {\n\t\tlogger_default.warn(createInterpolationFailureMessage(message));\n\t\treturn message;\n\t}\n\tconst $_source = message;\n\tconst $_hash = options.$_hash || hashMessage(message, {\n\t\t$format: \"ICU\",\n\t\t...options\n\t});\n\tconst encodedOptions = {\n\t\t...options,\n\t\t$_source,\n\t\t$_hash\n\t};\n\tconst optionsEncoding = encode(JSON.stringify(encodedOptions));\n\treturn `${interpolatedString}:${optionsEncoding}`;\n}\n//#endregion\nexport { declareStatic, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getLocale, getLocaleProperties, getLocales, getVersionId, gtFallback, mFallback, msg, t };\n\n//# sourceMappingURL=index.mjs.map","import React from 'react';\n\n/**\n * Marks JSX children as derivable by the GT compiler and CLI.\n *\n * Use `<Derive>` inside translated JSX when child content is computed from\n * source code, but should still be discovered during extraction instead of\n * treated as a runtime interpolation variable. The CLI attempts to resolve the\n * derivable children into every possible static value and includes those values\n * in the source content that gets translated.\n *\n * `<Derive>` renders its children unchanged at runtime.\n *\n * Run `gt validate` after adding or changing `<Derive>` usage to verify that\n * each derivable expression can be resolved by the CLI before translating or\n * building.\n *\n * @example\n * ```jsx\n * function getSubject() {\n * return (Math.random() > 0.5) ? \"Alice\" : \"Brian\";\n * }\n * ...\n * <T>\n * <Derive>\n * {getSubject()}\n * </Derive>\n * is going to school today.\n * </T>\n * ```\n *\n * @param {T extends React.ReactNode} children - JSX content to derive for translation extraction.\n * @returns {T} The same children, unchanged at runtime.\n */\nfunction Derive<T extends React.ReactNode>({ children }: { children: T }): T {\n return children;\n}\n\n/**\n * @deprecated Use `<Derive>` instead.\n *\n * Marks JSX children as derivable by the GT compiler and CLI.\n *\n * Use `<Derive>` instead of `<Static>` for new code. This alias is kept for\n * backwards compatibility and renders its children unchanged at runtime.\n *\n * Run `gt validate` after adding or changing derived JSX content to verify that\n * each derivable expression can be resolved by the CLI before translating or\n * building.\n *\n * @example\n * ```jsx\n * function getSubject() {\n * return (Math.random() > 0.5) ? \"Alice\" : \"Brian\";\n * }\n * ...\n * <T>\n * <Static>\n * {getSubject()}\n * </Static>\n * is going to school today.\n * </T>\n * ```\n *\n * @param {T extends React.ReactNode} children - JSX content to derive for translation extraction.\n * @returns {T} The same children, unchanged at runtime.\n */\nfunction Static<T extends React.ReactNode>(props: { children: T }): T {\n return Derive(props);\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nDerive._gtt = 'derive';\nStatic._gtt = 'derive';\n\nexport { Derive, Static };\n"],"x_google_ignoreList":[4,5,6,7,10,11,12,13,14,15,16,17,18,19,20,21,22,23],"mappings":"y9BAMA,SAAgB,EAAI,EAAwB,EAAqB,CAC/D,GAAI,GAAc,KAChB,MAAU,MAAM,4CAA4C,CAK9D,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,CACH,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,KACA,IACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,IACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,KACA,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,KACA,KACA,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,GAAM,CACF,IACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACA,KACA,IACH,CACD,GAAM,CACF,IACA,KACH,CACD,GAAM,CACF,IACA,IACA,KACA,KACH,CACD,GAAM,CACF,IACA,KACA,IACA,KACH,CACD,GAAM,CACF,IACA,IACH,CACD,QAAS,CACL,IACA,IACA,KACA,KACH,CACD,SAAU,CACN,IACA,KACA,KACA,IACH,CACD,QAAS,CACL,IACA,IACA,KACH,CACD,SAAU,CACN,IACA,KACA,IACA,KACH,CACD,QAAS,CACL,IACA,KACA,IACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACA,KACH,CACD,QAAS,CACL,IACA,KACA,IACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACH,CACD,QAAS,CACL,KACA,KACA,IACA,IACH,CACD,QAAS,CACL,KACA,IACA,IACH,CACD,QAAS,CACL,IACA,IACA,KACH,CACD,QAAS,CACL,IACA,IACA,KACH,CACD,QAAS,CACL,KACA,IACA,IACH,CACD,QAAS,CACL,KACA,IACA,IACH,CACD,QAAS,CACL,KACA,KACA,IACA,IACH,CACD,QAAS,CACL,KACA,KACA,IACA,IACH,CACD,QAAS,CACL,KACA,IACA,KACA,IACH,CACD,QAAS,CACL,KACA,IACA,IACH,CACD,QAAS,CACL,IACA,KACA,KACA,IACH,CACJ,cC14CD,OAAO,eAAe,EAAS,aAAc,CAAE,MAAO,GAAM,CAAC,CAC7D,EAAQ,eAAiB,EACzB,IAAI,EAAA,IAAA,CAQJ,SAAS,EAAe,EAAU,EAAQ,CAEtC,IAAK,IADD,EAAe,GACV,EAAa,EAAG,EAAa,EAAS,OAAQ,IAAc,CACjE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