{"release_id":"01a247c3-a6b6-0000-74b2-4a83f2c91090","chunk_id":"01a247c3-a6fa-7ad3-98f1-e88ff461633e","file":"BEQ2IU9T.mjs","mappings":"qTAWO,SAASA,EAAOC,EAAkBC,EAAyB,CACjE,OAAKA,EACED,EAAS,QAAQ,aAAc,CAACE,EAAOC,IAC7CA,KAAQF,EAAS,OAAOA,EAAOE,CAAI,CAAC,EAAID,CAAA,EAFrBF,CAIrB,CAEO,SAASI,EAAUC,EAAgCC,EAAgBL,EAAyB,CAGlG,MAAMM,EAAMF,GAAY,OAAO,OAAOA,EAAUC,CAAM,EAAID,EAASC,CAAM,EAAI,OAC7E,OAAOP,EAAO,OAAOQ,GAAQ,UAAYA,IAAQ,GAAKA,EAAMD,EAAQL,CAAM,CAC3E,CAIO,MAAMO,EAAU,CAACF,EAAgBL,IAA4BF,EAAOO,EAAQL,CAAM","names":["format","template","params","whole","name","translate","messages","source","hit","english"],"sources":["../../../../../../src/lib/i18n/translate.ts"],"sourcesContent":["/**\n * Messages are keyed by their English text (gettext style): `t('Play now')`\n * renders \"Play now\" in English with no lookup, and the other languages map the\n * same English string to theirs. A string missing from a language falls back\n * to English rather than to a key name.\n */\nexport type Messages = Record<string, string>;\n\nexport type Params = Record<string, string | number>;\n\n/** Fills `{name}` placeholders. Unknown names stay as written. */\nexport function format(template: string, params?: Params): string {\n\tif (!params) return template;\n\treturn template.replace(/\\{(\\w+)\\}/g, (whole, name: string) =>\n\t\tname in params ? String(params[name]) : whole\n\t);\n}\n\nexport function translate(messages: Messages | undefined, source: string, params?: Params): string {\n\t// own string keys only: a stray array or an inherited name ('length',\n\t// 'constructor') must never stand in for the text\n\tconst hit = messages && Object.hasOwn(messages, source) ? messages[source] : undefined;\n\treturn format(typeof hit === 'string' && hit !== '' ? hit : source, params);\n}\n\n/** The English text with its placeholders filled: what a translator gives\n *  when there is no other language to give. */\nexport const english = (source: string, params?: Params): string => format(source, params);\n"],"version":3}