{"version":3,"file":"index.cjs","names":["intlCache","intlCache","intlCache","intlCache","intlCache","intlCache","intlCache","intlCache","intlCache","intlCache","intlCache","intlCache","intlCache"],"sources":["../src/formatting/format.ts","../src/locales/isSameLanguage.ts","../src/locales/customLocaleMapping.ts","../src/locales/isValidLocale.ts","../src/locales/approvedLocales.ts","../src/locales/isSameDialect.ts","../src/locales/requiresTranslation.ts","../src/locales/determineLocale.ts","../src/locales/resolveCanonicalLocale.ts","../src/locales/getLocaleEmoji.ts","../src/locales/getLocaleProperties.ts","../src/locales/getLocaleName.ts","../src/locales/getLocaleDirection.ts","../src/locales/isSupersetLocale.ts","../src/locales/resolveAliasLocale.ts","../src/LocaleConfig.ts","../src/locales/getRegionProperties.ts","../src/core.ts"],"sourcesContent":["import { FormatVariables } from '../types';\nimport { intlCache } from '../cache/IntlCache';\nimport { libraryDefaultLocale } from '../settings/settings';\nimport { formatMessage } from '@generaltranslation/icu';\n\ntype FormatParams<Value, Options> = {\n  value: Value;\n  locales?: string | string[];\n  options?: Options;\n};\n\n/**\n * Formats a message according to the specified locales and options.\n *\n * @param {string} message - The message to format.\n * @param {string | string[]} [locales=libraryDefaultLocale] - The locales to use for formatting.\n * @param {Record<string, any>} [variables={}] - The variables to use for formatting.\n * @returns {string} The formatted message.\n * @internal\n */\nexport function _formatMessageICU(\n  message: string,\n  locales: string | string[] = libraryDefaultLocale,\n  variables: FormatVariables = {}\n): string {\n  // Preserve the previous IntlMessageFormat wrapper behavior for truthy\n  // non-string arguments such as booleans and Dates.\n  return (\n    (formatMessage(message, locales, variables) as unknown)?.toString() ?? ''\n  );\n}\n\n/**\n * Formats a number according to the specified locales and options.\n *\n * @param {Object} params - The parameters for the number formatting.\n * @param {number} params.value - The number to format.\n * @param {string | string[]} [params.locales=[libraryDefaultLocale]] - The locales to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for number formatting.\n *\n * @returns {string} The formatted number.\n * @internal\n */\nexport function _formatNum({\n  value,\n  locales = [libraryDefaultLocale],\n  options = {},\n}: FormatParams<number, Intl.NumberFormatOptions>): string {\n  return intlCache\n    .get('NumberFormat', locales, {\n      numberingSystem: 'latn',\n      ...options,\n    })\n    .format(value);\n}\n\n/**\n * Formats a date according to the specified locales and options.\n *\n * @param {Object} params - The parameters for the date formatting.\n * @param {Date} params.value - The date to format.\n * @param {string | string[]} [params.locales=libraryDefaultLocale] - The locales to use for formatting.\n * @param {Intl.DateTimeFormatOptions} [params.options={}] - Additional options for date formatting.\n *\n * @returns {string} The formatted date.\n * @internal\n */\nexport function _formatDateTime({\n  value,\n  locales = [libraryDefaultLocale],\n  options = {},\n}: FormatParams<Date, Intl.DateTimeFormatOptions>): string {\n  return intlCache\n    .get('DateTimeFormat', locales, {\n      calendar: 'gregory',\n      numberingSystem: 'latn',\n      ...options,\n    })\n    .format(value);\n}\n\n/**\n * Formats a currency value according to the specified locales, currency, and options.\n *\n * @param {Object} params - The parameters for the currency formatting.\n * @param {number} params.value - The currency value to format.\n * @param {string} params.currency - The currency code (e.g., 'USD').\n * @param {string | string[]} [params.locales=[libraryDefaultLocale]] - The locales to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.\n *\n * @returns {string} The formatted currency value.\n * @internal\n */\n\nexport function _formatCurrency({\n  value,\n  locales = [libraryDefaultLocale],\n  currency = 'USD',\n  options = {},\n}: FormatParams<number, Intl.NumberFormatOptions> & {\n  value: number;\n  currency?: string;\n}): string {\n  return intlCache\n    .get('NumberFormat', locales, {\n      style: 'currency',\n      currency,\n      numberingSystem: 'latn',\n      ...options,\n    })\n    .format(value);\n}\n\n/**\n * Formats a list of items according to the specified locales and options.\n *\n * @param {Object} params - The parameters for the list formatting.\n * @param {Array<string | number>} params.value - The list of items to format.\n * @param {string | string[]} [params.locales=[libraryDefaultLocale]] - The locales to use for formatting.\n * @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.\n *\n * @returns {string} The formatted list.\n * @internal\n */\nexport function _formatList({\n  value,\n  locales = [libraryDefaultLocale],\n  options = {},\n}: FormatParams<Array<string | number>, Intl.ListFormatOptions>): string {\n  return intlCache\n    .get('ListFormat', locales, {\n      type: 'conjunction', // Default type, can be overridden via options\n      style: 'long', // Default style, can be overridden via options\n      ...options,\n    })\n    .format(value.map(String));\n}\n\n/**\n * Formats a list of items according to the specified locales and options.\n * @param {Object} params - The parameters for the list formatting.\n * @param {Array<T>} params.value - The list of items to format.\n * @param {string | string[]} [params.locales=[libraryDefaultLocale]] - The locales to use for formatting.\n * @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.\n * @returns {Array<T | string>} The formatted list parts.\n * @internal\n */\nexport function _formatListToParts<T>({\n  value,\n  locales = [libraryDefaultLocale],\n  options = {},\n}: FormatParams<Array<T>, Intl.ListFormatOptions>) {\n  const formatListParts = intlCache\n    .get('ListFormat', locales, {\n      type: 'conjunction', // Default type, can be overridden via options\n      style: 'long', // Default style, can be overridden via options\n      ...options,\n    })\n    .formatToParts(value.map(() => '1'));\n  let partIndex = 0;\n  return formatListParts.map((part) => {\n    if (part.type === 'element') return value[partIndex++];\n    return part.value;\n  });\n}\n\n/**\n * Selects the best unit and computes the value for relative time formatting\n * based on the difference between a date and a base date.\n * @param {Date} date - The target date.\n * @param {Date} baseDate - The base date to compute relative time from. Must be provided by the caller for hydration safety.\n * @returns {{ value: number, unit: Intl.RelativeTimeFormatUnit }} The computed value and unit.\n * @internal\n */\nexport function _selectRelativeTimeUnit(\n  date: Date,\n  baseDate: Date\n): {\n  value: number;\n  unit: Intl.RelativeTimeFormatUnit;\n} {\n  const now = baseDate.getTime();\n  const diffMs = date.getTime() - now;\n  const absDiffMs = Math.abs(diffMs);\n  const sign = diffMs < 0 ? -1 : 1;\n\n  // Use Math.floor to avoid confusing jumps near boundaries\n  // (e.g. 3.5 days rounding to \"1 week ago\" instead of \"3 days ago\")\n  const seconds = Math.floor(absDiffMs / 1000);\n  const minutes = Math.floor(absDiffMs / (1000 * 60));\n  const hours = Math.floor(absDiffMs / (1000 * 60 * 60));\n  const days = Math.floor(absDiffMs / (1000 * 60 * 60 * 24));\n  const weeks = Math.floor(absDiffMs / (1000 * 60 * 60 * 24 * 7));\n  const months = Math.floor(absDiffMs / (1000 * 60 * 60 * 24 * 30));\n  const years = Math.floor(absDiffMs / (1000 * 60 * 60 * 24 * 365));\n\n  if (seconds < 60) return { value: sign * seconds, unit: 'second' };\n  if (minutes < 60) return { value: sign * minutes, unit: 'minute' };\n  if (hours < 24) return { value: sign * hours, unit: 'hour' };\n  if (days < 7) return { value: sign * days, unit: 'day' };\n  if (days < 28) return { value: sign * weeks, unit: 'week' };\n  if (months < 1) return { value: sign * weeks, unit: 'week' };\n  if (months < 12) return { value: sign * months, unit: 'month' };\n  if (years < 1) return { value: sign * months, unit: 'month' };\n  return { value: sign * years, unit: 'year' };\n}\n\n/**\n * Formats a relative time value according to the specified locales and options.\n *\n * @param {Object} params - The parameters for the relative time formatting.\n * @param {number} params.value - The relative time value to format.\n * @param {Intl.RelativeTimeFormatUnit} params.unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year').\n * @param {string | string[]} [params.locales=[libraryDefaultLocale]] - The locales to use for formatting.\n * @param {Intl.RelativeTimeFormatOptions} [params.options={}] - Additional options for relative time formatting.\n *\n * @returns {string} The formatted relative time string.\n * @internal\n */\nexport function _formatRelativeTime({\n  value,\n  unit,\n  locales = [libraryDefaultLocale],\n  options = {},\n}: FormatParams<number, Intl.RelativeTimeFormatOptions> & {\n  unit: Intl.RelativeTimeFormatUnit;\n}): string {\n  return intlCache\n    .get('RelativeTimeFormat', locales, {\n      style: 'long',\n      numeric: 'auto',\n      ...options,\n    })\n    .format(value, unit);\n}\n","import { intlCache } from '../cache/IntlCache';\n\n/**\n * Returns the language subtag of a locale, or undefined when the locale\n * cannot be parsed.\n * @internal\n */\nexport function _getLocaleLanguage(locale: string): string | undefined {\n  try {\n    return intlCache.get('Locale', locale).language;\n  } catch {\n    return undefined;\n  }\n}\n\n/**\n * @internal\n */\nexport function _isSameLanguage(...locales: (string | string[])[]): boolean {\n  try {\n    const flattenedCodes = locales.flat();\n    // Get the language for each code\n    const languages = flattenedCodes.map(\n      (locale) => intlCache.get('Locale', locale).language\n    );\n    return languages.every((language) => language === languages[0]);\n  } catch (error) {\n    console.error(error);\n    return false;\n  }\n}\n","import type { LocaleProperties } from './getLocaleProperties';\n\nexport type CustomMapping = Record<string, string | Partial<LocaleProperties>>;\n\nfunction isCustomLocaleObject(\n  value: CustomMapping[string] | null | undefined\n): value is Partial<LocaleProperties> {\n  return typeof value === 'object' && value !== null;\n}\n\nexport const getCustomProperty = (\n  customMapping: CustomMapping,\n  locale: string,\n  property: keyof LocaleProperties\n) => {\n  const value = customMapping?.[locale];\n  if (!value) return undefined;\n  if (typeof value === 'string') {\n    return property === 'name' ? value : undefined;\n  }\n  return value[property];\n};\n\nexport const getCustomLocaleCode = (\n  customMapping: CustomMapping | undefined,\n  locale: string\n) => {\n  const value = customMapping?.[locale];\n  return isCustomLocaleObject(value) && typeof value.code === 'string'\n    ? value.code\n    : undefined;\n};\n","import { intlCache } from '../cache/IntlCache';\nimport { libraryDefaultLocale } from '../settings/settings';\nimport { getCustomLocaleCode, type CustomMapping } from './customLocaleMapping';\n\nconst scriptExceptions = new Set([\n  'Cham',\n  'Jamo',\n  'Kawi',\n  'Lisu',\n  'Toto',\n  'Thai',\n]);\n\n// According to BCP 47, the range qaa-qtz is reserved for private-use language codes\nconst isCustomLanguage = (language: string) => {\n  return language >= 'qaa' && language <= 'qtz';\n};\n\n/**\n * Checks if a given BCP 47 language code is valid.\n * @param {string} code - The BCP 47 language code to validate.\n * @param {CustomMapping} [customMapping] - The custom mapping to use for validation.\n * @returns {boolean} True if the BCP 47 code is valid, false otherwise.\n * @internal\n */\nexport const _isValidLocale = (\n  locale: string,\n  customMapping?: CustomMapping\n): boolean => {\n  // Use the canonical code from custom mappings when one is configured.\n  locale = getCustomLocaleCode(customMapping, locale) || locale;\n\n  try {\n    const { language, region, script } = intlCache.get('Locale', locale);\n    const partCount = 1 + Number(Boolean(region)) + Number(Boolean(script));\n    if (locale.split('-').length !== partCount) return false;\n    const displayLanguageNames = intlCache.get(\n      'DisplayNames',\n      [libraryDefaultLocale],\n      {\n        type: 'language',\n      }\n    );\n    if (\n      displayLanguageNames.of(language) === language &&\n      !isCustomLanguage(language)\n    )\n      return false;\n    if (region) {\n      const displayRegionNames = intlCache.get(\n        'DisplayNames',\n        [libraryDefaultLocale],\n        {\n          type: 'region',\n        }\n      );\n      if (displayRegionNames.of(region) === region) return false;\n    }\n    if (script) {\n      const displayScriptNames = intlCache.get(\n        'DisplayNames',\n        [libraryDefaultLocale],\n        {\n          type: 'script',\n        }\n      );\n      if (\n        displayScriptNames.of(script) === script &&\n        !scriptExceptions.has(script)\n      )\n        return false;\n    }\n    return true;\n  } catch {\n    return false;\n  }\n};\n\n/**\n * Standardizes a BCP 47 locale to ensure correct formatting.\n * @param {string} locale - The BCP 47 locale to standardize.\n * @returns {string} The standardized BCP 47 locale, or the input string if it cannot be standardized.\n * @internal\n */\nexport const _standardizeLocale = (locale: string): string => {\n  try {\n    return Intl.getCanonicalLocales(locale)[0];\n  } catch {\n    return locale;\n  }\n};\n","import { CustomMapping } from './customLocaleMapping';\nimport { _getLocaleLanguage } from './isSameLanguage';\nimport { _isValidLocale, _standardizeLocale } from './isValidLocale';\n\n/**\n * An approved-locales list prepared once so requiresTranslation and\n * determineLocale do not revalidate, restandardize, and reindex the whole\n * list on every call.\n * @internal\n */\nexport type ApprovedLocales = {\n  /** Whether every approved locale is valid. */\n  allValid: boolean;\n  /** Language subtags of the valid approved locales. */\n  languages: Set<string>;\n  /** Standardized valid approved codes, bucketed by language subtag. */\n  byLanguage: Map<string, Set<string>>;\n};\n\n/**\n * Validates, standardizes, and indexes an approved-locales list in a single\n * pass.\n * @internal\n */\nexport function _prepareApprovedLocales(\n  approvedLocales: string[],\n  customMapping?: CustomMapping\n): ApprovedLocales {\n  let allValid = true;\n  const languages = new Set<string>();\n  const byLanguage = new Map<string, Set<string>>();\n  for (const approvedLocale of approvedLocales) {\n    if (!_isValidLocale(approvedLocale, customMapping)) {\n      allValid = false;\n      continue;\n    }\n    const language = _getLocaleLanguage(approvedLocale);\n    if (language === undefined) continue;\n    languages.add(language);\n    let bucket = byLanguage.get(language);\n    if (bucket === undefined) {\n      bucket = new Set();\n      byLanguage.set(language, bucket);\n    }\n    bucket.add(_standardizeLocale(approvedLocale));\n  }\n  return { allValid, languages, byLanguage };\n}\n","import { intlCache } from '../cache/IntlCache';\nimport { _standardizeLocale } from './isValidLocale';\n\n/**\n * Test two or more language codes to determine if they are exactly the same\n * e.g. \"en-US\" and \"en\" would be exactly the same.\n * \"en-GB\" and \"en\" would be exactly the same.\n * \"en-GB\" and \"en-US\" would be different.\n * @internal\n */\nexport function _isSameDialect(...locales: (string | string[])[]): boolean {\n  try {\n    // standardize codes\n    const localeObjects = locales\n      .flat()\n      .map((locale) => intlCache.get('Locale', _standardizeLocale(locale)));\n    const [firstLocale] = localeObjects;\n    const regions = new Set(\n      localeObjects.map(({ region }) => region).filter(Boolean)\n    );\n    const scripts = new Set(\n      localeObjects.map(({ script }) => script).filter(Boolean)\n    );\n\n    return (\n      localeObjects.every(\n        ({ language }) => language === firstLocale?.language\n      ) &&\n      regions.size <= 1 &&\n      scripts.size <= 1\n    );\n  } catch (error) {\n    console.error(error);\n    return false;\n  }\n}\n","import {\n  _prepareApprovedLocales,\n  type ApprovedLocales,\n} from './approvedLocales';\nimport { CustomMapping } from './customLocaleMapping';\nimport { _isSameDialect } from './isSameDialect';\nimport { _getLocaleLanguage } from './isSameLanguage';\nimport { _isValidLocale } from './isValidLocale';\n\n/**\n * Same contract as _requiresTranslation, with the approved-locales work\n * hoisted into a prepared scope. An undefined scope means no approved-locales\n * restriction.\n * @internal\n */\nexport function _requiresTranslationWithScope(\n  sourceLocale: string,\n  targetLocale: string,\n  approvedScope: ApprovedLocales | undefined,\n  customMapping?: CustomMapping\n): boolean {\n  // If codes are invalid\n  if (\n    (approvedScope && !approvedScope.allValid) ||\n    !_isValidLocale(sourceLocale, customMapping) ||\n    !_isValidLocale(targetLocale, customMapping)\n  ) {\n    return false;\n  }\n\n  // Check if the languages are identical, if so, a translation is not required\n  if (_isSameDialect(sourceLocale, targetLocale)) {\n    return false;\n  }\n\n  // Check that the target locale is within the approvedLocales scope, if not, a translation is not required\n  // Language-level rather than dialect-level membership so we can show different dialects as a fallback\n  if (!approvedScope) return true;\n  const targetLanguage = _getLocaleLanguage(targetLocale);\n  return (\n    targetLanguage !== undefined && approvedScope.languages.has(targetLanguage)\n  );\n}\n\n/**\n * Given a target locale and a source locale, determines whether a translation is required\n * If the target locale and the source locale are the same, returns false, otherwise returns true\n * If a translation is not possible due to the target locale being outside of the optional approvedLanguages scope, also returns false\n * @internal\n */\nexport function _requiresTranslation(\n  sourceLocale: string,\n  targetLocale: string,\n  approvedLocales?: string[],\n  customMapping?: CustomMapping\n): boolean {\n  return _requiresTranslationWithScope(\n    sourceLocale,\n    targetLocale,\n    approvedLocales\n      ? _prepareApprovedLocales(approvedLocales, customMapping)\n      : undefined,\n    customMapping\n  );\n}\n","import {\n  _prepareApprovedLocales,\n  type ApprovedLocales,\n} from './approvedLocales';\nimport { intlCache } from '../cache/IntlCache';\nimport { CustomMapping } from './customLocaleMapping';\nimport { _getLocaleLanguage } from './isSameLanguage';\nimport { _isValidLocale, _standardizeLocale } from './isValidLocale';\n\ntype LocaleMatchCodes = {\n  languageCode: string;\n  regionCode: string;\n  scriptCode: string;\n  minimizedCode: string;\n};\n\n/**\n * Derives the subtag codes used for matching. Mirrors how\n * _getLocaleProperties derives languageCode, regionCode, scriptCode, and\n * minimizedCode without a custom mapping, but skips the display-name and\n * emoji lookups that matching never reads.\n */\nfunction getLocaleMatchCodes(locale: string): LocaleMatchCodes {\n  try {\n    const localeObject = intlCache.get('Locale', locale);\n    const languageCode = localeObject.language;\n    let regionCode = localeObject.region || '';\n    let scriptCode = localeObject.script || '';\n    if (!regionCode || !scriptCode) {\n      const maximizedLocale = localeObject.maximize();\n      regionCode ||= maximizedLocale.region || '';\n      scriptCode ||= maximizedLocale.script || '';\n    }\n    return {\n      languageCode,\n      regionCode,\n      scriptCode,\n      minimizedCode: localeObject.minimize().toString(),\n    };\n  } catch {\n    const code = _isValidLocale(locale) ? _standardizeLocale(locale) : locale;\n    const codeParts = code.split('-');\n    return {\n      languageCode: codeParts[0] || code,\n      regionCode: codeParts.length > 2 ? codeParts[2] : codeParts[1] || '',\n      scriptCode: codeParts[3] || '',\n      minimizedCode: code,\n    };\n  }\n}\n\n/**\n * Matches a valid, standardized locale against standardized candidate codes.\n * Callers are responsible for validation and canonicalization before matching.\n * @internal\n */\nexport function findMatchingCode(\n  locale: string,\n  candidates: Set<string>\n): string | undefined {\n  // Preference order: the full locale, then partial and minimized variants.\n  // The exact match needs no derived codes, so check it first.\n  if (candidates.has(locale)) return locale;\n  const { languageCode, regionCode, scriptCode, minimizedCode } =\n    getLocaleMatchCodes(locale);\n  const languageRegionCode = `${languageCode}-${regionCode}`;\n  if (candidates.has(languageRegionCode)) return languageRegionCode;\n  const languageScriptCode = `${languageCode}-${scriptCode}`;\n  if (candidates.has(languageScriptCode)) return languageScriptCode;\n  if (candidates.has(minimizedCode)) return minimizedCode;\n  return undefined;\n}\n\n/**\n * Same contract as _determineLocale, with the approved-locales work hoisted\n * into a prepared index.\n * @internal\n */\nexport function _determineLocaleWithIndex(\n  locales: string | string[],\n  approvedIndex: ApprovedLocales,\n  customMapping?: CustomMapping\n): string | undefined {\n  const candidateLocales = Array.isArray(locales) ? locales : [locales];\n  for (const candidateLocale of candidateLocales) {\n    if (!_isValidLocale(candidateLocale, customMapping)) continue;\n    const locale = _standardizeLocale(candidateLocale);\n    const language = _getLocaleLanguage(locale);\n    if (language === undefined) continue;\n    // Only approved locales of the same language can match.\n    const candidates = approvedIndex.byLanguage.get(language);\n    if (candidates === undefined) continue;\n    const matchingCode =\n      findMatchingCode(locale, candidates) ||\n      // Fall back to matching through the bare language code, whose derived\n      // codes carry the language's most likely region and script.\n      findMatchingCode(language, candidates);\n    if (matchingCode) return matchingCode;\n  }\n  return undefined;\n}\n\n/**\n * Given a list of locales and a list of approved locales, sorted in preference order\n * Determines which locale is the best match among the approved locales, prioritizing exact matches and falling back to dialects of the same language\n * @internal\n */\nexport function _determineLocale(\n  locales: string | string[],\n  approvedLocales: string[],\n  customMapping?: CustomMapping\n): string | undefined {\n  return _determineLocaleWithIndex(\n    locales,\n    _prepareApprovedLocales(approvedLocales, customMapping),\n    customMapping\n  );\n}\n","import { getCustomLocaleCode, type CustomMapping } from './customLocaleMapping';\nimport { _isValidLocale } from './isValidLocale';\n\n/**\n * Resolves the canonical locale for a given locale.\n * @param locale - The locale to resolve the canonical locale for\n * @param customMapping - The custom mapping to use for resolving the canonical locale\n * @returns The canonical locale, or the input locale when no canonical mapping exists.\n */\nexport function _resolveCanonicalLocale(\n  locale: string,\n  customMapping?: CustomMapping\n): string {\n  const customLocaleCode = getCustomLocaleCode(customMapping, locale);\n  return customLocaleCode && _isValidLocale(customLocaleCode)\n    ? customLocaleCode\n    : locale;\n}\n","import { intlCache } from '../cache/IntlCache';\nimport { getCustomProperty, type CustomMapping } from './customLocaleMapping';\nimport { _standardizeLocale } from './isValidLocale';\nimport { _resolveCanonicalLocale } from './resolveCanonicalLocale';\n\n/**\n * @internal\n */\nexport function _getLocaleEmoji(\n  locale: string,\n  customMapping?: CustomMapping\n): string {\n  const aliasedLocale = locale;\n  locale = _resolveCanonicalLocale(locale, customMapping);\n\n  try {\n    const standardizedLocale = _standardizeLocale(locale);\n    const localeObject = intlCache.get('Locale', standardizedLocale);\n    const { language, region } = localeObject;\n\n    if (customMapping) {\n      for (const l of [aliasedLocale, locale, standardizedLocale, language]) {\n        const customEmoji = getCustomProperty(customMapping, l, 'emoji');\n        if (customEmoji) return customEmoji;\n      }\n    }\n\n    const regionEmoji = region && getSupportedRegionEmoji(region);\n    if (regionEmoji) return regionEmoji;\n\n    const extrapolated = localeObject.maximize();\n\n    return (\n      exceptions[extrapolated.language] ||\n      getRegionEmoji(extrapolated.region || '')\n    );\n  } catch {\n    return defaultEmoji;\n  }\n}\n\n// Default language emoji for when none else can be found\nconst europeAfricaGlobe = '🌍';\nconst asiaAustraliaGlobe = '🌏';\nexport const defaultEmoji = europeAfricaGlobe;\n\n// Exceptions to better reflect linguistic and cultural identities\nconst exceptions = {\n  ca: europeAfricaGlobe,\n  eu: europeAfricaGlobe,\n  ku: europeAfricaGlobe,\n  bo: asiaAustraliaGlobe,\n  ug: asiaAustraliaGlobe,\n  gd: '🏴󠁧󠁢󠁳󠁣󠁴󠁿',\n  cy: '🏴󠁧󠁢󠁷󠁬󠁳󠁿',\n  gv: '🇮🇲',\n  grc: '🏺',\n} as Record<string, string>;\n\nconst specialRegionEmojis = {\n  EU: '🇪🇺',\n  '419': '🌎',\n} as Record<string, string>;\n\n// Regions with Unicode regional-indicator flag sequences.\nconst flagRegions = new Set([\n  'AF', // Afghanistan\n  'AX', // Åland Islands\n  'AL', // Albania\n  'DZ', // Algeria\n  'AS', // American Samoa\n  'AD', // Andorra\n  'AO', // Angola\n  'AI', // Anguilla\n  'AQ', // Antarctica\n  'AG', // Antigua and Barbuda\n  'AR', // Argentina\n  'AM', // Armenia\n  'AW', // Aruba\n  'AU', // Australia\n  'AT', // Austria\n  'AZ', // Azerbaijan\n  'BS', // Bahamas\n  'BH', // Bahrain\n  'BD', // Bangladesh\n  'BB', // Barbados\n  'BY', // Belarus\n  'BE', // Belgium\n  'BZ', // Belize\n  'BJ', // Benin\n  'BM', // Bermuda\n  'BT', // Bhutan\n  'BO', // Bolivia\n  'BQ', // Bonaire, Sint Eustatius and Saba\n  'BA', // Bosnia and Herzegovina\n  'BW', // Botswana\n  'BV', // Bouvet Island\n  'BR', // Brazil\n  'IO', // British Indian Ocean Territory\n  'BN', // Brunei Darussalam\n  'BG', // Bulgaria\n  'BF', // Burkina Faso\n  'BI', // Burundi\n  'CV', // Cabo Verde\n  'KH', // Cambodia\n  'CM', // Cameroon\n  'CA', // Canada\n  'KY', // Cayman Islands\n  'CF', // Central African Republic\n  'TD', // Chad\n  'CL', // Chile\n  'CN', // China\n  'CX', // Christmas Island\n  'CC', // Cocos (Keeling) Islands\n  'CO', // Colombia\n  'KM', // Comoros\n  'CD', // Congo (Democratic Republic)\n  'CG', // Congo (Republic)\n  'CK', // Cook Islands\n  'CR', // Costa Rica\n  'CI', // Côte d'Ivoire\n  'HR', // Croatia\n  'CU', // Cuba\n  'CW', // Curaçao\n  'CY', // Cyprus\n  'CZ', // Czechia\n  'DK', // Denmark\n  'DJ', // Djibouti\n  'DM', // Dominica\n  'DO', // Dominican Republic\n  'EC', // Ecuador\n  'EG', // Egypt\n  'SV', // El Salvador\n  'GQ', // Equatorial Guinea\n  'ER', // Eritrea\n  'EE', // Estonia\n  'SZ', // Eswatini\n  'ET', // Ethiopia\n  'FK', // Falkland Islands\n  'FO', // Faroe Islands\n  'FJ', // Fiji\n  'FI', // Finland\n  'FR', // France\n  'GF', // French Guiana\n  'PF', // French Polynesia\n  'TF', // French Southern Territories\n  'GA', // Gabon\n  'GM', // Gambia\n  'GE', // Georgia\n  'DE', // Germany\n  'GH', // Ghana\n  'GI', // Gibraltar\n  'GR', // Greece\n  'GL', // Greenland\n  'GD', // Grenada\n  'GP', // Guadeloupe\n  'GU', // Guam\n  'GT', // Guatemala\n  'GG', // Guernsey\n  'GN', // Guinea\n  'GW', // Guinea-Bissau\n  'GY', // Guyana\n  'HT', // Haiti\n  'HM', // Heard Island and McDonald Islands\n  'VA', // Holy See\n  'HN', // Honduras\n  'HK', // Hong Kong\n  'HU', // Hungary\n  'IS', // Iceland\n  'IN', // India\n  'ID', // Indonesia\n  'IR', // Iran\n  'IQ', // Iraq\n  'IE', // Ireland\n  'IM', // Isle of Man\n  'IL', // Israel\n  'IT', // Italy\n  'JM', // Jamaica\n  'JP', // Japan\n  'JE', // Jersey\n  'JO', // Jordan\n  'KZ', // Kazakhstan\n  'KE', // Kenya\n  'KI', // Kiribati\n  'KP', // Korea (North)\n  'KR', // Korea (South)\n  'KW', // Kuwait\n  'KG', // Kyrgyzstan\n  'LA', // Laos\n  'LV', // Latvia\n  'LB', // Lebanon\n  'LS', // Lesotho\n  'LR', // Liberia\n  'LY', // Libya\n  'LI', // Liechtenstein\n  'LT', // Lithuania\n  'LU', // Luxembourg\n  'MO', // Macao\n  'MG', // Madagascar\n  'MW', // Malawi\n  'MY', // Malaysia\n  'MV', // Maldives\n  'ML', // Mali\n  'MT', // Malta\n  'MH', // Marshall Islands\n  'MQ', // Martinique\n  'MR', // Mauritania\n  'MU', // Mauritius\n  'YT', // Mayotte\n  'MX', // Mexico\n  'FM', // Micronesia\n  'MD', // Moldova\n  'MC', // Monaco\n  'MN', // Mongolia\n  'ME', // Montenegro\n  'MS', // Montserrat\n  'MA', // Morocco\n  'MZ', // Mozambique\n  'MM', // Myanmar\n  'NA', // Namibia\n  'NR', // Nauru\n  'NP', // Nepal\n  'NL', // Netherlands\n  'NC', // New Caledonia\n  'NZ', // New Zealand\n  'NI', // Nicaragua\n  'NE', // Niger\n  'NG', // Nigeria\n  'NU', // Niue\n  'NF', // Norfolk Island\n  'MK', // North Macedonia\n  'MP', // Northern Mariana Islands\n  'NO', // Norway\n  'OM', // Oman\n  'PK', // Pakistan\n  'PW', // Palau\n  'PS', // Palestine, State of\n  'PA', // Panama\n  'PG', // Papua New Guinea\n  'PY', // Paraguay\n  'PE', // Peru\n  'PH', // Philippines\n  'PN', // Pitcairn\n  'PL', // Poland\n  'PT', // Portugal\n  'PR', // Puerto Rico\n  'QA', // Qatar\n  'RE', // Réunion\n  'RO', // Romania\n  'RU', // Russian Federation\n  'RW', // Rwanda\n  'BL', // Saint Barthélemy\n  'SH', // Saint Helena, Ascension and Tristan da Cunha\n  'KN', // Saint Kitts and Nevis\n  'LC', // Saint Lucia\n  'MF', // Saint Martin (French part)\n  'PM', // Saint Pierre and Miquelon\n  'VC', // Saint Vincent and the Grenadines\n  'WS', // Samoa\n  'SM', // San Marino\n  'ST', // São Tomé and Príncipe\n  'SA', // Saudi Arabia\n  'SN', // Senegal\n  'RS', // Serbia\n  'SC', // Seychelles\n  'SL', // Sierra Leone\n  'SG', // Singapore\n  'SX', // Sint Maarten (Dutch part)\n  'SK', // Slovakia\n  'SI', // Slovenia\n  'SB', // Solomon Islands\n  'SO', // Somalia\n  'ZA', // South Africa\n  'GS', // South Georgia and the South Sandwich Islands\n  'SS', // South Sudan\n  'ES', // Spain\n  'LK', // Sri Lanka\n  'SD', // Sudan\n  'SR', // Suriname\n  'SJ', // Svalbard and Jan Mayen\n  'SE', // Sweden\n  'CH', // Switzerland\n  'SY', // Syrian Arab Republic\n  'TW', // Taiwan\n  'TJ', // Tajikistan\n  'TZ', // Tanzania\n  'TH', // Thailand\n  'TL', // Timor-Leste\n  'TG', // Togo\n  'TK', // Tokelau\n  'TO', // Tonga\n  'TT', // Trinidad and Tobago\n  'TN', // Tunisia\n  'TR', // Türkiye\n  'TM', // Turkmenistan\n  'TC', // Turks and Caicos Islands\n  'TV', // Tuvalu\n  'UG', // Uganda\n  'UA', // Ukraine\n  'AE', // United Arab Emirates\n  'GB', // United Kingdom\n  'US', // United States of America\n  'UM', // United States Minor Outlying Islands\n  'UY', // Uruguay\n  'UZ', // Uzbekistan\n  'VU', // Vanuatu\n  'VE', // Venezuela\n  'VN', // Viet Nam\n  'VG', // Virgin Islands (British)\n  'VI', // Virgin Islands (U.S.)\n  'WF', // Wallis and Futuna\n  'EH', // Western Sahara\n  'YE', // Yemen\n  'ZM', // Zambia\n  'ZW', // Zimbabwe\n]);\n\nconst regionalIndicatorOffset = 0x1f1e6 - 'A'.charCodeAt(0);\n\nexport function getRegionEmoji(region: string) {\n  return getSupportedRegionEmoji(region) || defaultEmoji;\n}\n\nfunction getSupportedRegionEmoji(region: string) {\n  const normalizedRegion = region.toUpperCase();\n  const specialEmoji = specialRegionEmojis[normalizedRegion];\n  if (specialEmoji) return specialEmoji;\n\n  if (!flagRegions.has(normalizedRegion)) return undefined;\n\n  return String.fromCodePoint(\n    normalizedRegion.charCodeAt(0) + regionalIndicatorOffset,\n    normalizedRegion.charCodeAt(1) + regionalIndicatorOffset\n  );\n}\n","import { libraryDefaultLocale } from '../settings/settings';\nimport { defaultEmoji } from './getLocaleEmoji';\nimport { _isValidLocale, _standardizeLocale } from './isValidLocale';\nimport { _getLocaleEmoji } from './getLocaleEmoji';\nimport { intlCache } from '../cache/IntlCache';\nimport { CustomMapping } from './customLocaleMapping';\nimport { _resolveCanonicalLocale } from './resolveCanonicalLocale';\n\nexport type LocaleProperties = {\n  // assume code = \"de-AT\", defaultLocale = \"en-US\"\n\n  code: string; // \"de-AT\"\n  name: string; // \"Austrian German\"\n  nativeName: string; // \"Österreichisches Deutsch\"\n\n  languageCode: string; // \"de\"\n  languageName: string; // \"German\"\n  nativeLanguageName: string; // \"Deutsch\"\n\n  // note that maximize() is NOT called here!\n\n  nameWithRegionCode: string; // \"German (AT)\"\n  nativeNameWithRegionCode: string; // \"Deutsch (AT)\"\n\n  // for most likely script and region, maximize() is called\n\n  regionCode: string; // \"AT\"\n  regionName: string; // \"Austria\"\n  nativeRegionName: string; // Österreich\n\n  scriptCode: string; // \"Latn\"\n  scriptName: string; // \"Latin\"\n  nativeScriptName: string; // \"Lateinisch\"\n\n  maximizedCode: string; // \"de-Latn-AT\"\n  maximizedName: string; // \"Austrian German (Latin)\"\n  nativeMaximizedName: string; // Österreichisches Deutsch (Lateinisch)\n\n  minimizedCode: string; // \"de-AT\", but for \"de-DE\" it would just be \"de\"\n  minimizedName: string; // \"\"Austrian German\";\n  nativeMinimizedName: string; // \"Österreichisches Deutsch\"\n\n  // Emoji depending on region code\n  // In order not to accidentally spark international conflict, some emojis are hard-coded\n  emoji: string;\n};\n\n/**\n * Creates a set of custom locale properties from a custom mapping.\n *\n * @param lArray - An array of locale codes to search for in the custom mapping.\n * @param customMapping - Optional custom mapping of locale codes to names.\n * @returns A partial set of locale properties, or undefined if no custom mapping is provided.\n */\nexport function createCustomLocaleProperties(\n  lArray: string[],\n  customMapping?: CustomMapping\n): Partial<LocaleProperties> | undefined {\n  if (!customMapping) return undefined;\n\n  let merged: Partial<LocaleProperties> = {};\n  for (const l of lArray) {\n    const value = customMapping[l];\n    if (value) {\n      if (typeof value === 'string') {\n        merged.name ||= value;\n      } else {\n        merged = { ...value, ...merged };\n      }\n    }\n  }\n  return merged;\n}\n\n/**\n * @internal\n */\nexport function _getLocaleProperties(\n  locale: string,\n  defaultLocale: string = libraryDefaultLocale,\n  customMapping?: CustomMapping\n): LocaleProperties {\n  // Check for canonical locale\n  const aliasedLocale = locale;\n  // Override locale with canonical locale\n  locale = _resolveCanonicalLocale(locale, customMapping);\n\n  defaultLocale ||= libraryDefaultLocale;\n\n  try {\n    const standardizedLocale = _standardizeLocale(locale); // \"de-AT\"\n\n    const localeObject = intlCache.get('Locale', locale);\n    const languageCode = localeObject.language; // \"de\"\n\n    const customLocaleProperties = createCustomLocaleProperties(\n      [aliasedLocale, locale, standardizedLocale, languageCode],\n      customMapping\n    );\n\n    const baseRegion = localeObject.region; // \"AT\"\n\n    const maximizedLocale = localeObject.maximize();\n    const maximizedCode = maximizedLocale.toString(); // \"de-Latn-AT\"\n    const regionCode =\n      localeObject.region ||\n      customLocaleProperties?.regionCode ||\n      maximizedLocale.region ||\n      ''; // \"AT\"\n    const scriptCode =\n      localeObject.script ||\n      customLocaleProperties?.scriptCode ||\n      maximizedLocale.script ||\n      ''; // \"Latn\"\n\n    const minimizedLocale = localeObject.minimize();\n    const minimizedCode = minimizedLocale.toString(); // \"de-AT\"\n\n    // Language names (default and native)\n\n    const defaultLanguageOrder = [defaultLocale, locale, libraryDefaultLocale];\n    const nativeLanguageOrder = [locale, defaultLocale, libraryDefaultLocale];\n\n    const languageNames = intlCache.get('DisplayNames', defaultLanguageOrder, {\n      type: 'language',\n    });\n    const nativeLanguageNames = intlCache.get(\n      'DisplayNames',\n      nativeLanguageOrder,\n      { type: 'language' }\n    );\n\n    const customName = customLocaleProperties?.name;\n    const customNativeName =\n      customLocaleProperties?.nativeName || customLocaleProperties?.name;\n\n    const name = customName || languageNames.of(locale) || locale; // \"Austrian German\"\n    const nativeName =\n      customNativeName || nativeLanguageNames.of(locale) || locale; // \"Österreichisches Deutsch\"\n\n    const maximizedName =\n      customLocaleProperties?.maximizedName ||\n      customName ||\n      languageNames.of(maximizedCode) ||\n      locale; // \"Austrian German (Latin)\"\n    const nativeMaximizedName =\n      customLocaleProperties?.nativeMaximizedName ||\n      customNativeName ||\n      nativeLanguageNames.of(maximizedCode) ||\n      locale; // \"Österreichisches Deutsch (Lateinisch)\"\n\n    const minimizedName =\n      customLocaleProperties?.minimizedName ||\n      customName ||\n      languageNames.of(minimizedCode) ||\n      locale; // \"Austrian German\", but for \"de-DE\" would just be \"German\"\n    const nativeMinimizedName =\n      customLocaleProperties?.nativeMinimizedName ||\n      customNativeName ||\n      nativeLanguageNames.of(minimizedCode) ||\n      locale; // \"Österreichisches Deutsch\", but for \"de-DE\" would just be \"Deutsch\"\n\n    const languageName =\n      customLocaleProperties?.languageName ||\n      customName ||\n      languageNames.of(languageCode) ||\n      locale; // \"German\"\n    const nativeLanguageName =\n      customLocaleProperties?.nativeLanguageName ||\n      customNativeName ||\n      nativeLanguageNames.of(languageCode) ||\n      locale; // \"Deutsch\"\n\n    const nameWithRegionCode =\n      customLocaleProperties?.nameWithRegionCode ||\n      (baseRegion ? `${languageName} (${baseRegion})` : name); // German (AT)\n    const nativeNameWithRegionCode =\n      customLocaleProperties?.nativeNameWithRegionCode ||\n      (baseRegion ? `${nativeLanguageName} (${baseRegion})` : nativeName) ||\n      nameWithRegionCode; // \"Deutsch (AT)\"\n\n    // Region names (default and native)\n\n    const regionNames = intlCache.get('DisplayNames', defaultLanguageOrder, {\n      type: 'region',\n    });\n    const nativeRegionNames = intlCache.get(\n      'DisplayNames',\n      nativeLanguageOrder,\n      { type: 'region' }\n    );\n\n    const regionName =\n      customLocaleProperties?.regionName ||\n      (regionCode ? regionNames.of(regionCode) : '') ||\n      ''; // \"Austria\"\n    const nativeRegionName =\n      customLocaleProperties?.nativeRegionName ||\n      (regionCode ? nativeRegionNames.of(regionCode) : '') ||\n      ''; // \"Österreich\"\n\n    // Script names (default and native)\n\n    const scriptNames = intlCache.get('DisplayNames', defaultLanguageOrder, {\n      type: 'script',\n    });\n    const nativeScriptNames = intlCache.get(\n      'DisplayNames',\n      nativeLanguageOrder,\n      { type: 'script' }\n    );\n\n    const scriptName =\n      customLocaleProperties?.scriptName ||\n      (scriptCode ? scriptNames.of(scriptCode) : '') ||\n      ''; // \"Latin\"\n    const nativeScriptName =\n      customLocaleProperties?.nativeScriptName ||\n      (scriptCode ? nativeScriptNames.of(scriptCode) : '') ||\n      ''; // \"Lateinisch\"\n\n    // Emoji\n\n    const emoji =\n      customLocaleProperties?.emoji ||\n      _getLocaleEmoji(standardizedLocale, customMapping);\n\n    return {\n      code: standardizedLocale,\n      name,\n      nativeName,\n      maximizedCode,\n      maximizedName,\n      nativeMaximizedName,\n      minimizedCode,\n      minimizedName,\n      nativeMinimizedName,\n      languageCode,\n      languageName,\n      nativeLanguageName,\n      nameWithRegionCode,\n      nativeNameWithRegionCode,\n      regionCode,\n      regionName,\n      nativeRegionName,\n      scriptCode,\n      scriptName,\n      nativeScriptName,\n      emoji,\n    };\n  } catch {\n    let code = _isValidLocale(locale) ? _standardizeLocale(locale) : locale;\n    const codeParts = code.split('-');\n    let languageCode = codeParts[0] || code;\n    let regionCode = codeParts.length > 2 ? codeParts[2] : codeParts[1] || '';\n    let scriptCode = codeParts[3] || '';\n\n    const customLocaleProperties = createCustomLocaleProperties(\n      [code, languageCode],\n      customMapping\n    );\n\n    code = customLocaleProperties?.code || code;\n    const name = customLocaleProperties?.name || code;\n    const nativeName = customLocaleProperties?.nativeName || name;\n\n    const maximizedCode = customLocaleProperties?.maximizedCode || code;\n    const maximizedName = customLocaleProperties?.maximizedName || name;\n    const nativeMaximizedName =\n      customLocaleProperties?.nativeMaximizedName || nativeName;\n\n    const minimizedCode = customLocaleProperties?.minimizedCode || code;\n    const minimizedName = customLocaleProperties?.minimizedName || name;\n    const nativeMinimizedName =\n      customLocaleProperties?.nativeMinimizedName || nativeName;\n\n    languageCode = customLocaleProperties?.languageCode || languageCode;\n    const languageName = customLocaleProperties?.languageName || name;\n    const nativeLanguageName =\n      customLocaleProperties?.nativeLanguageName || nativeName;\n\n    regionCode = customLocaleProperties?.regionCode || regionCode;\n    const regionName = customLocaleProperties?.regionName || '';\n    const nativeRegionName = customLocaleProperties?.nativeRegionName || '';\n\n    scriptCode = customLocaleProperties?.scriptCode || scriptCode;\n    const scriptName = customLocaleProperties?.scriptName || '';\n    const nativeScriptName = customLocaleProperties?.nativeScriptName || '';\n\n    const nameWithRegionCode =\n      customLocaleProperties?.nameWithRegionCode ||\n      (regionName ? `${languageName} (${regionName})` : name);\n    const nativeNameWithRegionCode =\n      customLocaleProperties?.nativeNameWithRegionCode ||\n      (nativeRegionName\n        ? `${nativeLanguageName} (${nativeRegionName})`\n        : nativeName);\n\n    const emoji = customLocaleProperties?.emoji || defaultEmoji;\n\n    return {\n      code,\n      name,\n      nativeName,\n      maximizedCode,\n      maximizedName,\n      nativeMaximizedName,\n      minimizedCode,\n      minimizedName,\n      nativeMinimizedName,\n      languageCode,\n      languageName,\n      nativeLanguageName,\n      nameWithRegionCode,\n      nativeNameWithRegionCode,\n      regionCode,\n      regionName,\n      nativeRegionName,\n      scriptCode,\n      scriptName,\n      nativeScriptName,\n      emoji,\n    };\n  }\n}\n","import { intlCache } from '../cache/IntlCache';\nimport { libraryDefaultLocale } from '../settings/settings';\nimport { CustomMapping, getCustomProperty } from './customLocaleMapping';\nimport { _standardizeLocale } from './isValidLocale';\nimport { _resolveCanonicalLocale } from './resolveCanonicalLocale';\n\n/**\n * Retrieves the display name(s) of locale code(s) using Intl.DisplayNames.\n *\n * @param {string} locale - A BCP-47 locale code.\n * @param {string} [defaultLocale=libraryDefaultLocale] - The locale for display names.\n * @returns {string} The display name(s) corresponding to the code(s), or empty string(s) if invalid.\n * @internal\n */\nexport function _getLocaleName(\n  locale: string,\n  defaultLocale: string = libraryDefaultLocale,\n  customMapping?: CustomMapping\n): string {\n  // Check for canonical locale\n  const aliasedLocale = locale;\n  locale = _resolveCanonicalLocale(locale, customMapping);\n\n  defaultLocale ||= libraryDefaultLocale;\n  try {\n    const standardizedLocale = _standardizeLocale(locale);\n    if (customMapping) {\n      for (const l of [\n        aliasedLocale,\n        locale,\n        standardizedLocale,\n        intlCache.get('Locale', standardizedLocale).language,\n      ]) {\n        const customName = getCustomProperty(customMapping, l, 'name');\n        if (customName) return customName;\n      }\n    }\n    const displayNames = intlCache.get(\n      'DisplayNames',\n      [defaultLocale, standardizedLocale, libraryDefaultLocale], // default locale order\n      { type: 'language' }\n    );\n    return displayNames.of(standardizedLocale) || '';\n  } catch {\n    // In case Intl.DisplayNames construction fails, return empty string(s)\n    return '';\n  }\n}\n","import { intlCache } from '../cache/IntlCache';\nimport { _getLocaleProperties } from './getLocaleProperties';\n\n/**\n * Get the text direction for a given locale code using the Intl.Locale API.\n *\n * @param {string} code - The locale code to check.\n * @returns {string} 'rtl' if the language is right-to-left; otherwise 'ltr'.\n * @internal\n */\nexport function _getLocaleDirection(code: string): 'ltr' | 'rtl' {\n  // Extract via textInfo property\n  try {\n    const locale = intlCache.get('Locale', code);\n    const textInfoDirection = extractDirectionWithTextInfo(locale);\n    if (textInfoDirection) {\n      return textInfoDirection;\n    }\n  } catch {\n    // Fall back to language/script heuristics below.\n  }\n\n  // Fallback to simple heuristics\n  const { scriptCode, languageCode } = _getLocaleProperties(code);\n\n  // Handle RTL script or language\n  if (scriptCode) {\n    return RTL_SCRIPTS.has(scriptCode.toLowerCase()) ? 'rtl' : 'ltr';\n  }\n  if (languageCode) {\n    return RTL_LANGUAGES.has(languageCode.toLowerCase()) ? 'rtl' : 'ltr';\n  }\n\n  return 'ltr';\n}\n\n// ===== HELPER CONSTANTS ===== //\n\nconst RTL_SCRIPTS = new Set([\n  'arab',\n  'adlm',\n  'hebr',\n  'nkoo',\n  'rohg',\n  'samr',\n  'syrc',\n  'thaa',\n  'yezi',\n]);\n\nconst RTL_LANGUAGES = new Set([\n  'ar',\n  'arc',\n  'ckb',\n  'dv',\n  'fa',\n  'he',\n  'iw',\n  'ku',\n  'lrc',\n  'nqo',\n  'ps',\n  'pnb',\n  'sd',\n  'syr',\n  'ug',\n  'ur',\n  'yi',\n]);\n\n// ===== HELPER FUNCTIONS ===== //\n\n/**\n * Handles extracting direction via textInfo property\n * @param locale - Intl.Locale object.\n * @returns {'ltr' | 'rtl'} - The direction of the locale\n *\n * Intl.Locale.prototype.getTextInfo() / textInfo property incorporated in ES2024 Specification.\n * This is not supported by all browsers yet.\n * See: {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo#browser_compatibility}\n */\nfunction extractDirectionWithTextInfo(locale: Intl.Locale) {\n  const direction =\n    'textInfo' in locale &&\n    typeof locale.textInfo === 'object' &&\n    locale.textInfo !== null &&\n    'direction' in locale.textInfo\n      ? locale.textInfo.direction\n      : undefined;\n  return direction === 'rtl' || direction === 'ltr' ? direction : undefined;\n}\n","import { intlCache } from '../cache/IntlCache';\nimport { _standardizeLocale } from './isValidLocale';\n\n/**\n * @internal\n */\nexport function _isSupersetLocale(\n  superLocale: string,\n  subLocale: string\n): boolean {\n  try {\n    const {\n      language: languageSuper,\n      region: regionSuper,\n      script: scriptSuper,\n    } = intlCache.get('Locale', _standardizeLocale(superLocale));\n    const {\n      language: languageSub,\n      region: regionSub,\n      script: scriptSub,\n    } = intlCache.get('Locale', _standardizeLocale(subLocale));\n\n    if (languageSuper !== languageSub) return false;\n    if (regionSuper && regionSuper !== regionSub) return false;\n    if (scriptSuper && scriptSuper !== scriptSub) return false;\n\n    return true;\n  } catch (error) {\n    console.error(error);\n    return false;\n  }\n}\n","import { getCustomLocaleCode, type CustomMapping } from './customLocaleMapping';\n\n/**\n * Resolves the alias locale for a given locale.\n * @param locale - The locale to resolve the alias locale for\n * @param customMapping - The custom mapping to use for resolving the alias locale\n * @returns The configured alias for a canonical locale, or the input locale when already an alias or no alias mapping exists.\n */\nexport function _resolveAliasLocale(\n  locale: string,\n  customMapping?: CustomMapping\n): string {\n  if (!customMapping) return locale;\n\n  return (\n    Object.keys(customMapping).find(\n      (alias) => getCustomLocaleCode(customMapping, alias) === locale\n    ) ?? locale\n  );\n}\n","import {\n  _formatCurrency,\n  _formatDateTime,\n  _formatList,\n  _formatListToParts,\n  _formatMessageICU,\n  _formatNum,\n  _formatRelativeTime,\n  _selectRelativeTimeUnit,\n} from './formatting/format';\nimport { intlCache } from './cache/IntlCache';\nimport {\n  _prepareApprovedLocales,\n  type ApprovedLocales,\n} from './locales/approvedLocales';\nimport { _requiresTranslationWithScope } from './locales/requiresTranslation';\nimport { _determineLocaleWithIndex } from './locales/determineLocale';\nimport { _isSameLanguage } from './locales/isSameLanguage';\nimport { _getLocaleProperties } from './locales/getLocaleProperties';\nimport { _getLocaleEmoji } from './locales/getLocaleEmoji';\nimport { _isValidLocale, _standardizeLocale } from './locales/isValidLocale';\nimport { _getLocaleName } from './locales/getLocaleName';\nimport { _getLocaleDirection } from './locales/getLocaleDirection';\nimport { libraryDefaultLocale } from './settings/settings';\nimport { _isSameDialect } from './locales/isSameDialect';\nimport { _isSupersetLocale } from './locales/isSupersetLocale';\nimport type { CustomMapping, FormatVariables } from './types';\nimport { _resolveAliasLocale } from './locales/resolveAliasLocale';\nimport { _resolveCanonicalLocale } from './locales/resolveCanonicalLocale';\nimport { getCustomLocaleCode } from './locales/customLocaleMapping';\nimport type { CutoffFormatOptions } from './formatting/custom-formats/CutoffFormat/types';\nimport type { StringFormat } from './types-dir/jsx/content';\n\nexport type LocaleConfigConstructorParams = {\n  defaultLocale?: string;\n  locales?: string[];\n  customMapping?: CustomMapping;\n};\n\ntype LocalesOption = {\n  locales?: string | string[];\n};\n\ntype WithLocales<T = object> = T & LocalesOption;\n\n/**\n * Approved-locales work that requiresTranslation and determineLocale would\n * otherwise redo on every call: canonical codes plus the validated and\n * indexed scope built from them.\n */\ntype LocaleResolutionScope = {\n  approvedLocalePairs: { locale: string; canonicalLocale: string }[];\n  canonicalMappingCodes: (string | undefined)[];\n  approved: ApprovedLocales;\n};\n\n/**\n * LocaleConfig contains the locale and formatting primitives exposed through\n * the core entrypoint.\n *\n * It intentionally does not store project IDs, API keys, runtime URLs, or any\n * translation credentials. It only stores locale metadata needed to resolve\n * aliases, choose formatting fallbacks, and format values with Intl.\n */\nexport class LocaleConfig {\n  readonly defaultLocale: string;\n  readonly locales: string[];\n  readonly customMapping?: CustomMapping;\n  // Built lazily so construction stays cheap for instances that never resolve\n  // locales. The snapshot is refreshed if callers mutate the public locale or\n  // custom-mapping collections retained by this instance.\n  private resolutionScope?: LocaleResolutionScope;\n\n  private getResolutionScope(): LocaleResolutionScope {\n    if (\n      this.resolutionScope &&\n      this.isResolutionScopeCurrent(this.resolutionScope)\n    ) {\n      return this.resolutionScope;\n    }\n    const resolutionScope = this.buildResolutionScope(this.locales);\n    Object.defineProperty(this, 'resolutionScope', {\n      configurable: true,\n      value: resolutionScope,\n      writable: true,\n    });\n    return resolutionScope;\n  }\n\n  private isResolutionScopeCurrent(scope: LocaleResolutionScope): boolean {\n    if (scope.approvedLocalePairs.length !== this.locales.length) return false;\n    for (let index = 0; index < this.locales.length; index++) {\n      const locale = this.locales[index];\n      const pair = scope.approvedLocalePairs[index];\n      if (\n        pair.locale !== locale ||\n        pair.canonicalLocale !== this.resolveCanonicalLocale(locale) ||\n        scope.canonicalMappingCodes[index] !==\n          getCustomLocaleCode(this.customMapping, pair.canonicalLocale)\n      ) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  private buildResolutionScope(\n    approvedLocales: string[]\n  ): LocaleResolutionScope {\n    const approvedLocalePairs = approvedLocales.map((locale) => ({\n      locale,\n      canonicalLocale: this.resolveCanonicalLocale(locale),\n    }));\n    return {\n      approvedLocalePairs,\n      canonicalMappingCodes: approvedLocalePairs.map(({ canonicalLocale }) =>\n        getCustomLocaleCode(this.customMapping, canonicalLocale)\n      ),\n      approved: _prepareApprovedLocales(\n        approvedLocalePairs.map(({ canonicalLocale }) => canonicalLocale),\n        this.customMapping\n      ),\n    };\n  }\n\n  constructor({\n    defaultLocale = libraryDefaultLocale,\n    locales = [],\n    customMapping,\n  }: LocaleConfigConstructorParams = {}) {\n    this.defaultLocale = defaultLocale;\n    this.locales = locales;\n    this.customMapping = customMapping;\n  }\n\n  private getFormattingLocales(\n    targetLocale?: string,\n    locales?: string | string[]\n  ) {\n    return (\n      locales === undefined\n        ? [targetLocale, this.defaultLocale, libraryDefaultLocale]\n        : Array.isArray(locales)\n          ? locales\n          : [locales]\n    )\n      .filter((locale): locale is string => !!locale)\n      .map((locale) => this.resolveCanonicalLocale(locale));\n  }\n\n  formatNum(\n    value: number,\n    targetLocale?: string,\n    options: WithLocales<Intl.NumberFormatOptions> = {}\n  ) {\n    const { locales, ...intlOptions } = options;\n    return _formatNum({\n      value,\n      locales: this.getFormattingLocales(targetLocale, locales),\n      options: intlOptions,\n    });\n  }\n\n  formatDateTime(\n    value: Date,\n    targetLocale?: string,\n    options: WithLocales<Intl.DateTimeFormatOptions> = {}\n  ) {\n    const { locales, ...intlOptions } = options;\n    return _formatDateTime({\n      value,\n      locales: this.getFormattingLocales(targetLocale, locales),\n      options: intlOptions,\n    });\n  }\n\n  formatCurrency(\n    value: number,\n    currency: string,\n    targetLocale?: string,\n    options: WithLocales<Intl.NumberFormatOptions> = {}\n  ) {\n    const { locales, ...intlOptions } = options;\n    return _formatCurrency({\n      value,\n      currency,\n      locales: this.getFormattingLocales(targetLocale, locales),\n      options: intlOptions,\n    });\n  }\n\n  formatRelativeTime(\n    value: number,\n    unit: Intl.RelativeTimeFormatUnit,\n    targetLocale?: string,\n    options: WithLocales<Intl.RelativeTimeFormatOptions> = {}\n  ) {\n    const { locales, ...intlOptions } = options;\n    return _formatRelativeTime({\n      value,\n      unit,\n      locales: this.getFormattingLocales(targetLocale, locales),\n      options: intlOptions,\n    });\n  }\n\n  formatRelativeTimeFromDate(\n    date: Date,\n    targetLocale?: string,\n    options: WithLocales<\n      Intl.RelativeTimeFormatOptions & { baseDate?: Date }\n    > = {}\n  ) {\n    const { locales, baseDate, ...intlOptions } = options;\n    const { value, unit } = _selectRelativeTimeUnit(\n      date,\n      baseDate ?? new Date()\n    );\n    return _formatRelativeTime({\n      value,\n      unit,\n      locales: this.getFormattingLocales(targetLocale, locales),\n      options: intlOptions,\n    });\n  }\n\n  formatCutoff(\n    value: string,\n    targetLocale?: string,\n    options: WithLocales<CutoffFormatOptions> = {}\n  ) {\n    const { locales, ...formatOptions } = options;\n    return intlCache\n      .get(\n        'CutoffFormat',\n        this.getFormattingLocales(targetLocale, locales),\n        formatOptions\n      )\n      .format(value);\n  }\n\n  formatMessage(\n    message: string,\n    targetLocale?: string,\n    options: WithLocales<{\n      variables?: FormatVariables;\n      dataFormat?: StringFormat;\n    }> = {}\n  ) {\n    const { locales, variables, dataFormat } = options;\n    if (dataFormat === 'STRING') return message;\n    return _formatMessageICU(\n      message,\n      this.getFormattingLocales(targetLocale, locales),\n      variables\n    );\n  }\n\n  formatList(\n    array: Array<string | number>,\n    targetLocale?: string,\n    options: WithLocales<Intl.ListFormatOptions> = {}\n  ) {\n    const { locales, ...intlOptions } = options;\n    return _formatList({\n      value: array,\n      locales: this.getFormattingLocales(targetLocale, locales),\n      options: intlOptions,\n    });\n  }\n\n  formatListToParts<T>(\n    array: Array<T>,\n    targetLocale?: string,\n    options: WithLocales<Intl.ListFormatOptions> = {}\n  ) {\n    const { locales, ...intlOptions } = options;\n    return _formatListToParts<T>({\n      value: array,\n      locales: this.getFormattingLocales(targetLocale, locales),\n      options: intlOptions,\n    });\n  }\n\n  getLocaleName(locale: string) {\n    return _getLocaleName(locale, this.defaultLocale, this.customMapping);\n  }\n\n  getLocaleEmoji(locale: string) {\n    return _getLocaleEmoji(locale, this.customMapping);\n  }\n\n  getLocaleProperties(locale: string) {\n    return _getLocaleProperties(locale, this.defaultLocale, this.customMapping);\n  }\n\n  requiresTranslation(\n    targetLocale: string,\n    sourceLocale: string = this.defaultLocale,\n    approvedLocales: string[] | undefined = this.locales.length\n      ? this.locales\n      : undefined\n  ) {\n    // The default scope (this.locales) is prepared once per instance; a\n    // caller-provided list is prepared for that call only. No configured\n    // locales means no approved-locales restriction.\n    const approvedScope = approvedLocales\n      ? approvedLocales === this.locales\n        ? this.getResolutionScope().approved\n        : _prepareApprovedLocales(\n            approvedLocales.map((locale) =>\n              this.resolveCanonicalLocale(locale)\n            ),\n            this.customMapping\n          )\n      : undefined;\n    return _requiresTranslationWithScope(\n      this.resolveCanonicalLocale(sourceLocale),\n      this.resolveCanonicalLocale(targetLocale),\n      approvedScope,\n      this.customMapping\n    );\n  }\n\n  /**\n   * NOTE: consider moving LocaleCandidates type to this package, and\n   * determineLocale could accept that as a parameter.\n   */\n  determineLocale(\n    locales: string | string[],\n    approvedLocales: string[] = this.locales\n  ) {\n    const { approvedLocalePairs, approved } =\n      approvedLocales === this.locales\n        ? this.getResolutionScope()\n        : this.buildResolutionScope(approvedLocales);\n    const resolvedLocale = _determineLocaleWithIndex(\n      Array.isArray(locales)\n        ? locales.map((locale) => this.resolveCanonicalLocale(locale))\n        : this.resolveCanonicalLocale(locales),\n      approved,\n      this.customMapping\n    );\n    if (!resolvedLocale) return undefined;\n    const approvedLocale = approvedLocalePairs.find(\n      ({ canonicalLocale }) => canonicalLocale === resolvedLocale\n    );\n    return approvedLocale?.locale ?? this.resolveAliasLocale(resolvedLocale);\n  }\n\n  getLocaleDirection(locale: string) {\n    return _getLocaleDirection(this.resolveCanonicalLocale(locale));\n  }\n\n  isValidLocale(locale: string) {\n    return _isValidLocale(locale, this.customMapping);\n  }\n\n  resolveCanonicalLocale(locale: string) {\n    return _resolveCanonicalLocale(locale, this.customMapping);\n  }\n\n  resolveAliasLocale(locale: string) {\n    return _resolveAliasLocale(locale, this.customMapping);\n  }\n\n  standardizeLocale(locale: string) {\n    return _standardizeLocale(locale);\n  }\n\n  isSameDialect(...locales: (string | string[])[]) {\n    return _isSameDialect(\n      ...locales.map((locale) =>\n        Array.isArray(locale)\n          ? locale.map((code) => this.resolveCanonicalLocale(code))\n          : this.resolveCanonicalLocale(locale)\n      )\n    );\n  }\n\n  isSameLanguage(...locales: (string | string[])[]) {\n    return _isSameLanguage(\n      ...locales.map((locale) =>\n        Array.isArray(locale)\n          ? locale.map((code) => this.resolveCanonicalLocale(code))\n          : this.resolveCanonicalLocale(locale)\n      )\n    );\n  }\n\n  isSupersetLocale(superLocale: string, subLocale: string) {\n    return _isSupersetLocale(\n      this.resolveCanonicalLocale(superLocale),\n      this.resolveCanonicalLocale(subLocale)\n    );\n  }\n}\n","import { intlCache } from '../cache/IntlCache';\nimport { libraryDefaultLocale } from '../settings/settings';\nimport { defaultEmoji, getRegionEmoji } from './getLocaleEmoji';\n\nexport type CustomRegionMapping = {\n  [region: string]: { name?: string; emoji?: string; locale?: string };\n};\n\n/**\n * Retrieves multiple properties for a given region code, including:\n * - `code`: the original region code\n * - `name`: the localized display name\n * - `emoji`: the associated flag or symbol\n *\n * Behavior:\n * - Accepts ISO 3166-1 alpha-2 or UN M.49 region codes (e.g., `\"US\"`, `\"FR\"`, `\"419\"`).\n * - If `customMapping` contains a `name` or `emoji` for the region, those override the default values.\n * - Otherwise, uses `Intl.DisplayNames` to get the localized region name in the given `defaultLocale`,\n *   falling back to `libraryDefaultLocale`.\n * - Falls back to the region code as `name` if display name resolution fails.\n * - Falls back to `defaultEmoji` if no emoji can be computed or found in `customMapping`.\n *\n * @param {string} region - The region code to look up (e.g., `\"US\"`, `\"GB\"`, `\"DE\"`).\n * @param {string} [defaultLocale=libraryDefaultLocale] - The locale to use when localizing the region name.\n * @param {CustomRegionMapping} [customMapping] - Optional mapping of region codes to custom names and/or emojis.\n * @returns {{ code: string, name: string, emoji: string, locale?: string }} An object containing:\n *  - `code`: the input region code\n *  - `name`: the localized or custom region name\n *  - `emoji`: the matching emoji flag or symbol\n *  - `locale`: the optional associated locale from custom mapping\n *\n * @example\n * getRegionProperties('US', 'en');\n * // => { code: 'US', name: 'United States', emoji: '🇺🇸' }\n *\n * @example\n * getRegionProperties('US', 'fr');\n * // => { code: 'US', name: 'États-Unis', emoji: '🇺🇸' }\n *\n * @example\n * getRegionProperties('US', 'en', { US: { name: 'USA', emoji: '🗽' } });\n * // => { code: 'US', name: 'USA', emoji: '🗽' }\n */\nexport function getRegionProperties(\n  region: string,\n  defaultLocale: string = libraryDefaultLocale,\n  customMapping?: CustomRegionMapping\n): {\n  code: string;\n  name: string;\n  emoji: string;\n  locale?: string; // locale is a hidden return field, because we don't want to guarantee it, but we also need customMapping to work with it\n} {\n  defaultLocale ||= libraryDefaultLocale;\n  let name = region;\n  let emoji = defaultEmoji;\n  try {\n    const displayNames = intlCache.get(\n      'DisplayNames',\n      [defaultLocale, libraryDefaultLocale], // default language order\n      { type: 'region' }\n    );\n    name = displayNames.of(region) || region;\n    emoji = getRegionEmoji(region);\n  } catch {\n    // Keep fallbacks initialized above.\n  }\n  return { code: region, name, emoji, ...customMapping?.[region] };\n}\n","import {\n  _formatCurrency,\n  _formatDateTime,\n  _formatList,\n  _formatListToParts,\n  _formatMessageICU,\n  _formatNum,\n  _formatRelativeTime,\n  _selectRelativeTimeUnit,\n} from './formatting/format';\nimport { intlCache } from './cache/IntlCache';\nimport type { CutoffFormatOptions } from './formatting/custom-formats/CutoffFormat/types';\nimport { _determineLocale } from './locales/determineLocale';\nimport { _getLocaleDirection } from './locales/getLocaleDirection';\nimport { _getLocaleEmoji } from './locales/getLocaleEmoji';\nimport {\n  _getLocaleProperties,\n  type LocaleProperties,\n} from './locales/getLocaleProperties';\nimport { _getLocaleName } from './locales/getLocaleName';\nimport { _isSameDialect } from './locales/isSameDialect';\nimport { _isSameLanguage } from './locales/isSameLanguage';\nimport { _isSupersetLocale } from './locales/isSupersetLocale';\nimport { _isValidLocale, _standardizeLocale } from './locales/isValidLocale';\nimport { _requiresTranslation } from './locales/requiresTranslation';\nimport { _resolveAliasLocale } from './locales/resolveAliasLocale';\nimport { _resolveCanonicalLocale } from './locales/resolveCanonicalLocale';\nimport type { CustomMapping, FormatVariables } from './types';\nimport type { StringFormat } from './types-dir/jsx/content';\n\nexport {\n  LocaleConfig,\n  type LocaleConfigConstructorParams,\n} from './LocaleConfig';\nexport {\n  getRegionProperties,\n  type CustomRegionMapping,\n} from './locales/getRegionProperties';\n\ntype LocalesOption = {\n  locales?: string | string[];\n};\n\ntype MessageFormatOptions = LocalesOption & {\n  variables?: FormatVariables;\n  dataFormat?: StringFormat;\n};\n\n/**\n * Core formatting and locale helpers.\n *\n * This entry point exposes deterministic locale and formatting primitives. It\n * does not export the GT service client, project credentials, network\n * translation methods, file APIs, or other server/service concerns from the\n * root `generaltranslation` facade.\n *\n * This entry point is intended for framework and shared packages that need\n * locale metadata or formatting behavior without pulling in the full\n * translation API surface.\n */\n\n/**\n * Formats a string with cutoff behavior, applying a terminator when the string exceeds the maximum character limit.\n *\n * This standalone function provides cutoff formatting functionality without requiring a GT instance.\n * The locales parameter is required for proper terminator selection based on the target language.\n *\n * @param {string} value - The string value to format with cutoff behavior.\n * @param {Object} [options] - Configuration options for cutoff formatting.\n * @param {string | string[]} [options.locales] - The locales to use for terminator selection.\n * @param {number} [options.maxChars] - The maximum number of characters to display.\n * - Undefined values are treated as no cutoff.\n * - Negative values follow .slice() behavior and terminator will be added before the value.\n * - 0 will result in an empty string.\n * - If cutoff results in an empty string, no terminator is added.\n * @param {CutoffFormatStyle} [options.style='ellipsis'] - The style of the terminator.\n * @param {string} [options.terminator] - Optional override the terminator to use.\n * @param {string} [options.separator] - Optional override the separator to use between the terminator and the value.\n * - If no terminator is provided, then separator is ignored.\n * @returns {string} The formatted string with terminator applied if cutoff occurs.\n *\n * @example\n * formatCutoff('Hello, world!', { locales: 'en-US', maxChars: 8 });\n * // Returns: 'Hello, …'\n *\n * @example\n * formatCutoff('Hello, world!', { locales: 'en-US', maxChars: -3 });\n * // Returns: '…d!'\n *\n * @example\n * formatCutoff('Very long text that needs cutting', {\n *   locales: 'en-US',\n *   maxChars: 15,\n *   style: 'ellipsis',\n *   separator: ' '\n * });\n * // Returns: 'Very long tex …'\n */\nexport function formatCutoff(\n  value: string,\n  options?: LocalesOption & CutoffFormatOptions\n) {\n  const { locales, ...formatOptions } = options ?? {};\n  return intlCache.get('CutoffFormat', locales, formatOptions).format(value);\n}\n\n/**\n * Formats a message according to the specified locales and options.\n *\n * @param {string} message - The message to format.\n * @param {Object} [options] - Configuration options for message formatting.\n * @param {string | string[]} [options.locales] - The locales to use for formatting.\n * @param {FormatVariables} [options.variables] - The variables to use for formatting.\n * @param {StringFormat} [options.dataFormat='ICU'] - The format of the message. When STRING, the message is returned as is.\n * @returns {string} The formatted message.\n *\n * @example\n * formatMessage('Hello {name}', { variables: { name: 'John' } });\n * // Returns: \"Hello John\"\n *\n * @example\n * formatMessage('Hello {name}', {\n *   locales: ['fr'],\n *   variables: { name: 'John' }\n * });\n */\nexport function formatMessage(message: string, options?: MessageFormatOptions) {\n  if (options?.dataFormat === 'STRING') return message;\n  return _formatMessageICU(message, options?.locales, options?.variables);\n}\n\n/**\n * Formats a number according to the specified locales and options.\n * @param {Object} params - The parameters for the number formatting.\n * @param {number} params.value - The number to format.\n * @param {Intl.NumberFormatOptions} [params.options] - Additional options for number formatting.\n * @param {string | string[]} [params.options.locales] - The locales to use for formatting.\n * @returns {string} The formatted number.\n */\nexport function formatNum(\n  number: number,\n  options?: LocalesOption & Intl.NumberFormatOptions\n): string {\n  const { locales, ...intlOptions } = options ?? {};\n  return _formatNum({\n    value: number,\n    locales,\n    options: intlOptions,\n  });\n}\n\n/**\n * Formats a date according to the specified languages and options.\n * @param {Object} params - The parameters for the date formatting.\n * @param {Date} params.value - The date to format.\n * @param {Intl.DateTimeFormatOptions} [params.options] - Additional options for date formatting.\n * @param {string | string[]} [params.options.locales] - The languages to use for formatting.\n * @returns {string} The formatted date.\n */\nexport function formatDateTime(\n  date: Date,\n  options?: LocalesOption & Intl.DateTimeFormatOptions\n): string {\n  const { locales, ...intlOptions } = options ?? {};\n  return _formatDateTime({\n    value: date,\n    locales,\n    options: intlOptions,\n  });\n}\n\n/**\n * Formats a currency value according to the specified languages, currency, and options.\n * @param {Object} params - The parameters for the currency formatting.\n * @param {number} params.value - The currency value to format.\n * @param {string} params.currency - The currency code (e.g., 'USD').\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.\n * @param {string | string[]} [params.options.locales] - The locale codes to use for formatting.\n * @returns {string} The formatted currency value.\n */\nexport function formatCurrency(\n  value: number,\n  currency: string,\n  options?: LocalesOption & Intl.NumberFormatOptions\n): string {\n  const { locales, ...intlOptions } = options ?? {};\n  return _formatCurrency({\n    value,\n    currency,\n    locales,\n    options: intlOptions,\n  });\n}\n\n/**\n * Formats a list of items according to the specified locales and options.\n * @param {Object} params - The parameters for the list formatting.\n * @param {Array<string | number>} params.value - The list of items to format.\n * @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.\n * @param {string | string[]} [params.options.locales] - The locales to use for formatting.\n * @returns {string} The formatted list.\n */\nexport function formatList(\n  array: Array<string | number>,\n  options?: LocalesOption & Intl.ListFormatOptions\n): string {\n  const { locales, ...intlOptions } = options ?? {};\n  return _formatList({\n    value: array,\n    locales,\n    options: intlOptions,\n  });\n}\n\n/**\n * Formats a list of items according to the specified locales and options.\n * @param {Array<T>} array - The list of items to format.\n * @param {Object} [options] - Additional options for list formatting.\n * @param {string | string[]} [options.locales] - The locales to use for formatting.\n * @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options.\n * @returns {Array<T | string>} The formatted list parts.\n */\nexport function formatListToParts<T>(\n  array: Array<T>,\n  options?: LocalesOption & Intl.ListFormatOptions\n): Array<T | string> {\n  const { locales, ...intlOptions } = options ?? {};\n  return _formatListToParts<T>({\n    value: array,\n    locales,\n    options: intlOptions,\n  });\n}\n\n/**\n * Formats a relative time value according to the specified locales and options.\n * @param {Object} params - The parameters for the relative time formatting.\n * @param {number} params.value - The relative time value to format.\n * @param {Intl.RelativeTimeFormatUnit} params.unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year').\n * @param {Intl.RelativeTimeFormatOptions} [params.options={}] - Additional options for relative time formatting.\n * @param {string | string[]} [params.options.locales] - The locales to use for formatting.\n * @returns {string} The formatted relative time string.\n */\nexport function formatRelativeTime(\n  value: number,\n  unit: Intl.RelativeTimeFormatUnit,\n  options?: LocalesOption & Omit<Intl.RelativeTimeFormatOptions, 'locales'>\n): string {\n  const { locales, ...intlOptions } = options ?? {};\n  return _formatRelativeTime({\n    value,\n    unit,\n    locales,\n    options: intlOptions,\n  });\n}\n\n/**\n * Formats a relative time string from a Date, automatically selecting the best unit.\n * @param {Date} date - The date to format relative to now.\n * @param {Object} [options] - Formatting options.\n * @param {string | string[]} [options.locales] - The locales to use for formatting.\n * @param {Intl.RelativeTimeFormatOptions} [options] - Additional Intl.RelativeTimeFormat options.\n * @returns {string} The formatted relative time string (e.g., \"2 hours ago\", \"in 3 days\").\n */\nexport function formatRelativeTimeFromDate(\n  date: Date,\n  options?: LocalesOption &\n    Omit<Intl.RelativeTimeFormatOptions, 'locales'> & {\n      baseDate?: Date;\n    }\n): string {\n  const { locales, baseDate, ...intlOptions } = options ?? {};\n  const { value, unit } = _selectRelativeTimeUnit(date, baseDate ?? new Date());\n  return _formatRelativeTime({\n    value,\n    unit,\n    locales,\n    options: intlOptions,\n  });\n}\n\n/**\n * Checks if a given BCP 47 locale code is valid.\n *\n * @param {string} locale - The BCP 47 locale code to validate.\n * @param {CustomMapping} [customMapping] - The custom mapping to use for validation.\n * @returns {boolean} True if the BCP 47 code is valid, false otherwise.\n *\n * @example\n * isValidLocale('en-US');\n * // Returns: true\n *\n * @example\n * isValidLocale('en_US');\n * // Returns: false\n */\nexport function isValidLocale(locale: string, customMapping?: CustomMapping) {\n  return _isValidLocale(locale, customMapping);\n}\n\n/**\n * Resolves the canonical locale for a given locale.\n *\n * @param {string} locale - The locale to resolve the canonical locale for.\n * @param {CustomMapping} [customMapping] - The custom mapping to use for resolving the canonical locale.\n * @returns {string} The canonical locale, or the input locale when no canonical mapping exists.\n *\n * @example\n * resolveCanonicalLocale('en-US');\n * // Returns: 'en-US'\n *\n * @example\n * resolveCanonicalLocale('en', { en: 'en-US' });\n * // Returns: 'en-US'\n */\nexport function resolveCanonicalLocale(\n  locale: string,\n  customMapping?: CustomMapping\n) {\n  return _resolveCanonicalLocale(locale, customMapping);\n}\n\n/**\n * Standardizes a BCP 47 locale code to ensure correct formatting.\n *\n * @param {string} locale - The BCP 47 locale code to standardize.\n * @returns {string} The standardized BCP 47 locale code, or the input string if it cannot be standardized.\n *\n * @example\n * standardizeLocale('en-us');\n * // Returns: 'en-US'\n *\n * @example\n * standardizeLocale('not a locale');\n * // Returns: 'not a locale'\n */\nexport function standardizeLocale(locale: string) {\n  return _standardizeLocale(locale);\n}\n\n// -------------- Locale Properties -------------- //\n\n/**\n * Retrieves the display name of locale code using Intl.DisplayNames.\n *\n * @param {string} locale - A BCP-47 locale code.\n * @param {string} [defaultLocale] - The default locale to use for formatting.\n * @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.\n * @returns {string} The display name corresponding to the code.\n */\nexport function getLocaleName(\n  locale: string,\n  defaultLocale?: string,\n  customMapping?: CustomMapping\n): string {\n  return _getLocaleName(locale, defaultLocale, customMapping);\n}\n\n/**\n * Retrieves an emoji based on a given locale code, taking into account region, language, and specific exceptions.\n *\n * This function uses the locale's region (if present) to select an emoji or falls back on default emojis for certain languages.\n *\n * @param locale - A string representing the locale code (e.g., 'en-US', 'fr-CA').\n * @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.\n * @returns The emoji representing the locale or its region, or a default emoji if no specific match is found.\n */\nexport function getLocaleEmoji(\n  locale: string,\n  customMapping?: CustomMapping\n): string {\n  return _getLocaleEmoji(locale, customMapping);\n}\n\n/**\n * Generates linguistic details for a given locale code.\n *\n * This function returns information about the locale,\n * script, and region of a given language code both in a standard form and in a maximized form (with likely script and region).\n * The function provides these names in both your default language and native forms, and an associated emoji.\n *\n * @param {string} locale - The locale code to get properties for (e.g., \"de-AT\").\n * @param {string} [defaultLocale] - The default locale to use for formatting.\n * @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.\n * @returns {LocaleProperties} - An object containing detailed information about the locale.\n *\n * @property {string} code - The full locale code, e.g., \"de-AT\".\n * @property {string} name - Language name in the default display language, e.g., \"Austrian German\".\n * @property {string} nativeName - Language name in the locale's native language, e.g., \"Österreichisches Deutsch\".\n * @property {string} languageCode - The base language code, e.g., \"de\".\n * @property {string} languageName - The language name in the default display language, e.g., \"German\".\n * @property {string} nativeLanguageName - The language name in the native language, e.g., \"Deutsch\".\n * @property {string} nameWithRegionCode - Language name with region in the default language, e.g., \"German (AT)\".\n * @property {string} nativeNameWithRegionCode - Language name with region in the native language, e.g., \"Deutsch (AT)\".\n * @property {string} regionCode - The region code from maximization, e.g., \"AT\".\n * @property {string} regionName - The region name in the default display language, e.g., \"Austria\".\n * @property {string} nativeRegionName - The region name in the native language, e.g., \"Österreich\".\n * @property {string} scriptCode - The script code from maximization, e.g., \"Latn\".\n * @property {string} scriptName - The script name in the default display language, e.g., \"Latin\".\n * @property {string} nativeScriptName - The script name in the native language, e.g., \"Lateinisch\".\n * @property {string} maximizedCode - The maximized locale code, e.g., \"de-Latn-AT\".\n * @property {string} maximizedName - Maximized locale name with likely script in the default language, e.g., \"Austrian German (Latin)\".\n * @property {string} nativeMaximizedName - Maximized locale name in the native language, e.g., \"Österreichisches Deutsch (Lateinisch)\".\n * @property {string} minimizedCode - Minimized locale code, e.g., \"de-AT\" (or \"de\" for \"de-DE\").\n * @property {string} minimizedName - Minimized language name in the default language, e.g., \"Austrian German\".\n * @property {string} nativeMinimizedName - Minimized language name in the native language, e.g., \"Österreichisches Deutsch\".\n * @property {string} emoji - The emoji associated with the locale's region, if applicable.\n */\nexport function getLocaleProperties(\n  locale: string,\n  defaultLocale?: string,\n  customMapping?: CustomMapping\n): LocaleProperties {\n  return _getLocaleProperties(locale, defaultLocale, customMapping);\n}\n\n/**\n * Determines whether a translation is required based on the source and target locales.\n *\n * - If the target locale is not specified, the function returns `false`, as translation is not needed.\n * - If the source and target locale are the same, returns `false`, indicating that no translation is necessary.\n * - If the `approvedLocales` array is provided, and the target locale is not within that array, the function also returns `false`.\n * - Otherwise, it returns `true`, meaning that a translation is required.\n *\n * @param {string} sourceLocale - The locale code for the original content (BCP 47 locale code).\n * @param {string} targetLocale - The locale code of the language to translate the content into (BCP 47 locale code).\n * @param {string[]} [approvedLocale] - An optional array of approved target locales.\n *\n * @returns {boolean} - Returns `true` if translation is required, otherwise `false`.\n */\nexport function requiresTranslation(\n  sourceLocale: string,\n  targetLocale: string,\n  approvedLocales?: string[],\n  customMapping?: CustomMapping\n): boolean {\n  return _requiresTranslation(\n    sourceLocale,\n    targetLocale,\n    approvedLocales,\n    customMapping\n  );\n}\n\n/**\n * Determines the best matching locale from the provided approved locales list.\n * @param {string | string[]} locales - A single locale or an array of locales sorted in preference order.\n * @param {string[]} [approvedLocales=this.locales] - An array of approved locales, also sorted by preference.\n * @returns {string | undefined} - The best matching locale from the approvedLocales list, or undefined if no match is found.\n */\nexport function determineLocale(\n  locales: string | string[],\n  approvedLocales: string[] | undefined = [],\n  customMapping: CustomMapping | undefined = undefined\n): string | undefined {\n  return _determineLocale(locales, approvedLocales, customMapping);\n}\n\n/**\n * Get the text direction for a given locale code using the Intl.Locale API.\n *\n * @param {string} locale - A BCP-47 locale code.\n * @returns {string} 'rtl' if the locale is right-to-left; otherwise 'ltr'.\n */\nexport function getLocaleDirection(locale: string): 'ltr' | 'rtl' {\n  return _getLocaleDirection(locale);\n}\n\n/**\n * Resolves the alias locale for a given locale.\n * @param {string} locale - The locale to resolve the alias locale for\n * @param {CustomMapping} [customMapping] - The custom mapping to use for resolving the alias locale\n * @returns {string} The alias locale\n */\nexport function resolveAliasLocale(\n  locale: string,\n  customMapping?: CustomMapping\n): string {\n  return _resolveAliasLocale(locale, customMapping);\n}\n\n/**\n * Checks if multiple BCP 47 locale codes represent the same dialect.\n * @param {string[]} locales - The BCP 47 locale codes to compare.\n * @returns {boolean} True if all BCP 47 codes represent the same dialect, false otherwise.\n */\nexport function isSameDialect(...locales: (string | string[])[]): boolean {\n  return _isSameDialect(...locales);\n}\n\n/**\n * Checks if multiple BCP 47 locale codes represent the same language.\n * @param {string[]} locales - The BCP 47 locale codes to compare.\n * @returns {boolean} True if all BCP 47 codes represent the same language, false otherwise.\n */\nexport function isSameLanguage(...locales: (string | string[])[]): boolean {\n  return _isSameLanguage(...locales);\n}\n\n/**\n * Checks if a locale is a superset of another locale.\n * A subLocale is a subset of superLocale if it is an extension of superLocale or are otherwise identical.\n *\n * @param {string} superLocale - The locale to check if it is a superset of the other locale.\n * @param {string} subLocale - The locale to check if it is a subset of the other locale.\n * @returns {boolean} True if the first locale is a superset of the second locale, false otherwise.\n */\nexport function isSupersetLocale(\n  superLocale: string,\n  subLocale: string\n): boolean {\n  return _isSupersetLocale(superLocale, subLocale);\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,SAAgB,kBACd,SACA,UAAA,MACA,YAA6B,EAAE,EACvB;AAGR,SAAA,GAAA,wBAAA,eACiB,SAAS,SAAS,UAAU,EAAc,UAAU,IAAI;;;;;;;;;;;;;AAe3E,SAAgB,WAAW,EACzB,OACA,UAAU,CAAA,KAAsB,EAChC,UAAU,EAAE,IAC6C;AACzD,QAAOA,kBAAAA,UACJ,IAAI,gBAAgB,SAAS;EAC5B,iBAAiB;EACjB,GAAG;EACJ,CAAC,CACD,OAAO,MAAM;;;;;;;;;;;;;AAclB,SAAgB,gBAAgB,EAC9B,OACA,UAAU,CAAA,KAAsB,EAChC,UAAU,EAAE,IAC6C;AACzD,QAAOA,kBAAAA,U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;GAAQ;GAAoB;GAAS,EAAE;GACrE,MAAM,cAAc,kBAAkB,eAAe,GAAG,QAAQ;AAChE,OAAI,YAAa,QAAO;;EAI5B,MAAM,cAAc,UAAU,wBAAwB,OAAO;AAC7D,MAAI,YAAa,QAAO;EAExB,MAAM,eAAe,aAAa,UAAU;AAE5C,SACE,WAAW,aAAa,aACxB,eAAe,aAAa,UAAU,GAAG;SAErC;AACN,SAAO;;;AAKX,MAAM,oBAAoB;AAC1B,MAAM,qBAAqB;AAC3B,MAAa,eAAe;AAG5B,MAAM,aAAa;CACjB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,KAAK;CACN;AAED,MAAM,sBAAsB;CAC1B,IAAI;CACJ,OAAO;CACR;AAGD,MAAM,cAAc,IAAI,IAAI;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAM,0BAA0B,SAAU,IAAI,WAAW,EAAE;AAE3D,SAAgB,eAAe,QAAgB;AAC7C,QAAO,wBAAwB,OAAO,IAAA;;AAGxC,SAAS,wBAAwB,QAAgB;CAC/C,MAAM,mBAAmB,OAAO,aAAa;CAC7C,MAAM,eAAe,oBAAoB;AACzC,KAAI,aAAc,QAAO;AAEzB,KAAI,CAAC,YAAY,IAAI,iBAAiB,CAAE,QAAO,KAAA;AAE/C,QAAO,OAAO,cACZ,iBAAiB,WAAW,EAAE,GAAG,yBACjC,iBAAiB,WAAW,EAAE,GAAG,wBAClC;;;;;;;;;;;ACvRH,SAAgB,6BACd,QACA,eACuC;AACvC,KAAI,CAAC,cAAe,QAAO,KAAA;CAE3B,IAAI,SAAoC,EAAE;AAC1C,MAAK,MAAM,KAAK,QAAQ;EACtB,MAAM,QAAQ,cAAc;AAC5B,MAAI,MACF,KAAI,OAAO,UAAU,SACnB,QAAO,SAAS;MAEhB,UAAS;GAAE,GAAG;GAAO,GAAG;GAAQ;;AAItC,QAAO;;;;;AAMT,SAAgB,qBACd,QACA,gBAAA,MACA,eACkB;CAElB,MAAM,gBAAg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