{"release_id":"01a247c3-a6b6-0000-74b2-4a83f2c91090","chunk_id":"01a247c3-a72b-71f2-b15f-4b0de5785c2d","file":"C2T6YGwO.mjs","mappings":"mcASO,SAASA,GAAiB,CAChC,MAAMC,EAAIC,EAAK,MAAM,OACrB,OAAOC,EAASF,CAAC,EAAIA,EAAIG,CAC1B,CAGO,SAASC,EAAEC,EAAgBC,EAAyB,CAC1D,OAAOC,EAAUN,EAAK,MAAM,KAA8BI,EAAQC,CAAM,CACzE,CAIO,SAASE,EAAeH,EAAyB,CACvD,GAAIN,EAAA,IAAaI,EAAgB,MAAO,GACxC,MAAMM,EAAIR,EAAK,MAAM,KACrB,MAAO,CAAC,CAACQ,GAAK,OAAO,OAAOA,EAAGJ,CAAM,GAAK,OAAOI,EAAEJ,CAAM,GAAM,UAAYI,EAAEJ,CAAM,IAAM,EAC1F,CAGO,SAASK,EAAMC,EAAsB,CAC3C,OAAOC,EAAaD,EAAMZ,GAAQ,CACnC","names":["locale","l","page","isLocale","DEFAULT_LOCALE","t","source","params","translate","hasTranslation","m","lhref","href","localizeHref"],"sources":["../../../../../../src/lib/i18n/index.ts"],"sourcesContent":["import { page } from '$app/state';\nimport { DEFAULT_LOCALE, isLocale, type Locale } from './locales';\nimport { localizeHref } from './localized-paths';\nimport { translate, type Messages, type Params } from './translate';\n\nexport * from './locales';\nexport { isLocalizedPath, localizeHref, LOCALIZED_PATHS } from './localized-paths';\n\n/** The page's language. Read during render or in a handler, like `page`. */\nexport function locale(): Locale {\n\tconst l = page.data?.locale;\n\treturn isLocale(l) ? l : DEFAULT_LOCALE;\n}\n\n/** `t('Play now')` → the page's language; English text is the key. */\nexport function t(source: string, params?: Params): string {\n\treturn translate(page.data?.i18n as Messages | undefined, source, params);\n}\n\n/** Whether `source` reads in the page's language — always, in English. Content\n *  that may lack a translation (a deck card) checks before it shows. */\nexport function hasTranslation(source: string): boolean {\n\tif (locale() === DEFAULT_LOCALE) return true;\n\tconst m = page.data?.i18n as Messages | undefined;\n\treturn !!m && Object.hasOwn(m, source) && typeof m[source] === 'string' && m[source] !== '';\n}\n\n/** A link in the page's language (prefixed only where a translated copy exists). */\nexport function lhref(href: string): string {\n\treturn localizeHref(href, locale());\n}\n"],"version":3}