gt-react 11.1.6-iris.0 → 11.1.7-iris.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/LICENSE.md +18 -102
- package/dist/index.client.cjs +39 -77
- package/dist/index.client.cjs.map +1 -1
- package/dist/index.client.d.cts +1 -1
- package/dist/index.client.d.cts.map +1 -1
- package/dist/index.client.d.mts +1 -1
- package/dist/index.client.d.mts.map +1 -1
- package/dist/index.client.mjs +39 -77
- package/dist/index.client.mjs.map +1 -1
- package/dist/index.rsc.d.cts +1 -1
- package/dist/index.rsc.d.cts.map +1 -1
- package/dist/index.rsc.d.mts +1 -1
- package/dist/index.rsc.d.mts.map +1 -1
- package/dist/index.server.d.cts +1 -1
- package/dist/index.server.d.cts.map +1 -1
- package/dist/index.server.d.mts +1 -1
- package/dist/index.server.d.mts.map +1 -1
- package/dist/index.types.d.cts +1 -1
- package/dist/index.types.d.cts.map +1 -1
- package/dist/index.types.d.mts +1 -1
- package/dist/index.types.d.mts.map +1 -1
- package/package.json +5 -5
package/dist/index.client.mjs
CHANGED
|
@@ -5,50 +5,6 @@ import { useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, us
|
|
|
5
5
|
import { Branch, Currency, DateTime, Derive, GtInternalTranslateJsx, GtInternalVar, I18nStore as I18nStore$1, InternalGTProvider, InternalLocaleSelector, InternalRegionSelector, Num, Plural, RelativeTime, T, Var } from "@generaltranslation/react-core/components";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { useMemo, useRef } from "react";
|
|
8
|
-
//#region src/i18n-cache/constants.ts
|
|
9
|
-
const DEFAULT_HTML_TAG_OPTIONS = {
|
|
10
|
-
updateHtmlLangTag: true,
|
|
11
|
-
updateHtmlDirTag: true
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region ../core/dist/api-rqq7klYe.mjs
|
|
15
|
-
function ensureSentence(text) {
|
|
16
|
-
const trimmed = text.trim();
|
|
17
|
-
if (!trimmed) return "";
|
|
18
|
-
return /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;
|
|
19
|
-
}
|
|
20
|
-
function stripSentence(text) {
|
|
21
|
-
const trimmed = text.trim();
|
|
22
|
-
let end = trimmed.length;
|
|
23
|
-
while (end > 0) {
|
|
24
|
-
const char = trimmed[end - 1];
|
|
25
|
-
if (char !== "." && char !== "!" && char !== "?") break;
|
|
26
|
-
end -= 1;
|
|
27
|
-
}
|
|
28
|
-
return trimmed.slice(0, end);
|
|
29
|
-
}
|
|
30
|
-
function formatDetails(details) {
|
|
31
|
-
if (!details) return "";
|
|
32
|
-
const detailText = Array.isArray(details) ? details.join(", ") : details;
|
|
33
|
-
if (!detailText.trim()) return "";
|
|
34
|
-
return ensureSentence(`Details: ${detailText}`);
|
|
35
|
-
}
|
|
36
|
-
function createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {
|
|
37
|
-
const prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : "";
|
|
38
|
-
const whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;
|
|
39
|
-
const shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));
|
|
40
|
-
const messageParts = [
|
|
41
|
-
whatAndWhy,
|
|
42
|
-
reassurance,
|
|
43
|
-
shouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,
|
|
44
|
-
shouldCombineWayOut ? void 0 : wayOut,
|
|
45
|
-
formatDetails(details)
|
|
46
|
-
].filter((part) => !!part).map(ensureSentence);
|
|
47
|
-
if (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);
|
|
48
|
-
const message = messageParts.join(" ");
|
|
49
|
-
return prefix ? `${prefix} ${message}` : message;
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
8
|
//#region src/i18n-cache/BrowserI18nCache.ts
|
|
53
9
|
let localStorageCacheModulePromise;
|
|
54
10
|
/**
|
|
@@ -56,7 +12,7 @@ let localStorageCacheModulePromise;
|
|
|
56
12
|
*/
|
|
57
13
|
var BrowserI18nCache = class extends I18nCache {
|
|
58
14
|
constructor(config) {
|
|
59
|
-
const { htmlTagOptions, ...managerConfig } = config;
|
|
15
|
+
const { htmlTagOptions: _htmlTagOptions, ...managerConfig } = config;
|
|
60
16
|
const localStorageCaches = {};
|
|
61
17
|
const i18nConfig = getI18nConfig$1();
|
|
62
18
|
const devHotReloadEnabled = !!config.loadTranslations && i18nConfig.isDevHotReloadEnabled();
|
|
@@ -68,10 +24,6 @@ var BrowserI18nCache = class extends I18nCache {
|
|
|
68
24
|
});
|
|
69
25
|
this._devHotReloadJsx = false;
|
|
70
26
|
this._devHotReloadJsx = devHotReloadEnabled;
|
|
71
|
-
this.htmlTagOptions = {
|
|
72
|
-
...DEFAULT_HTML_TAG_OPTIONS,
|
|
73
|
-
...htmlTagOptions
|
|
74
|
-
};
|
|
75
27
|
if (devHotReloadEnabled) this.onTranslationsCacheMiss = ({ locale, hash, translation }) => {
|
|
76
28
|
getOrCreateLocalStorageCache(localStorageCaches, {
|
|
77
29
|
locale,
|
|
@@ -85,28 +37,6 @@ var BrowserI18nCache = class extends I18nCache {
|
|
|
85
37
|
isDevHotReloadJsx() {
|
|
86
38
|
return this._devHotReloadJsx;
|
|
87
39
|
}
|
|
88
|
-
/**
|
|
89
|
-
* Update the html tag (lang, dir)
|
|
90
|
-
*
|
|
91
|
-
* @deprecated, TODO: we should use a different system for managing this html tag
|
|
92
|
-
* this should just be for managing translations
|
|
93
|
-
*/
|
|
94
|
-
updateHtmlTag(locale, htmlTagOptions) {
|
|
95
|
-
const htmlLocale = htmlTagOptions?.lang || locale;
|
|
96
|
-
const i18nConfig = getI18nConfig$1();
|
|
97
|
-
const canonicalLocale = i18nConfig.resolveCanonicalLocale(htmlLocale);
|
|
98
|
-
if (!i18nConfig.isValidLocale(canonicalLocale)) {
|
|
99
|
-
console.warn(createInvalidLocaleWarning(htmlLocale));
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const localeDirection = htmlTagOptions?.dir || i18nConfig.getLocaleDirection(canonicalLocale);
|
|
103
|
-
const mergedHtmlTagOptions = {
|
|
104
|
-
...this.htmlTagOptions,
|
|
105
|
-
...htmlTagOptions
|
|
106
|
-
};
|
|
107
|
-
if (mergedHtmlTagOptions.updateHtmlLangTag) document.documentElement.lang = canonicalLocale;
|
|
108
|
-
if (mergedHtmlTagOptions.updateHtmlDirTag) document.documentElement.dir = localeDirection;
|
|
109
|
-
}
|
|
110
40
|
};
|
|
111
41
|
/**
|
|
112
42
|
* Wraps a translation loader to merge localStorage translations in dev mode.
|
|
@@ -131,12 +61,6 @@ function getOrCreateLocalStorageCache(localStorageCaches, params) {
|
|
|
131
61
|
function loadLocalStorageCache() {
|
|
132
62
|
return localStorageCacheModulePromise ??= import("./LocalStorageTranslationCache-B66Ni5IM.mjs");
|
|
133
63
|
}
|
|
134
|
-
const createInvalidLocaleWarning = (locale) => createDiagnosticMessage({
|
|
135
|
-
source: "gt-react",
|
|
136
|
-
severity: "Warning",
|
|
137
|
-
whatHappened: `Locale "${locale}" is not valid`,
|
|
138
|
-
fix: "Use a valid BCP 47 locale code or add a custom mapping"
|
|
139
|
-
});
|
|
140
64
|
//#endregion
|
|
141
65
|
//#region src/condition-store/cookies.ts
|
|
142
66
|
/**
|
|
@@ -254,6 +178,44 @@ function getBrowserLocale(getLocale) {
|
|
|
254
178
|
return i18nConfig.resolveSupportedLocale(candidates);
|
|
255
179
|
}
|
|
256
180
|
//#endregion
|
|
181
|
+
//#region ../core/dist/api-rqq7klYe.mjs
|
|
182
|
+
function ensureSentence(text) {
|
|
183
|
+
const trimmed = text.trim();
|
|
184
|
+
if (!trimmed) return "";
|
|
185
|
+
return /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;
|
|
186
|
+
}
|
|
187
|
+
function stripSentence(text) {
|
|
188
|
+
const trimmed = text.trim();
|
|
189
|
+
let end = trimmed.length;
|
|
190
|
+
while (end > 0) {
|
|
191
|
+
const char = trimmed[end - 1];
|
|
192
|
+
if (char !== "." && char !== "!" && char !== "?") break;
|
|
193
|
+
end -= 1;
|
|
194
|
+
}
|
|
195
|
+
return trimmed.slice(0, end);
|
|
196
|
+
}
|
|
197
|
+
function formatDetails(details) {
|
|
198
|
+
if (!details) return "";
|
|
199
|
+
const detailText = Array.isArray(details) ? details.join(", ") : details;
|
|
200
|
+
if (!detailText.trim()) return "";
|
|
201
|
+
return ensureSentence(`Details: ${detailText}`);
|
|
202
|
+
}
|
|
203
|
+
function createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {
|
|
204
|
+
const prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : "";
|
|
205
|
+
const whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;
|
|
206
|
+
const shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));
|
|
207
|
+
const messageParts = [
|
|
208
|
+
whatAndWhy,
|
|
209
|
+
reassurance,
|
|
210
|
+
shouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,
|
|
211
|
+
shouldCombineWayOut ? void 0 : wayOut,
|
|
212
|
+
formatDetails(details)
|
|
213
|
+
].filter((part) => !!part).map(ensureSentence);
|
|
214
|
+
if (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);
|
|
215
|
+
const message = messageParts.join(" ");
|
|
216
|
+
return prefix ? `${prefix} ${message}` : message;
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
257
219
|
//#region src/condition-store/singleton-operations.ts
|
|
258
220
|
const conditionStoreNotInitializedError = createDiagnosticMessage({
|
|
259
221
|
source: "gt-react",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.mjs","names":["getI18nConfig","getCookieValue","getCookieValueFromString","getCookieValue","getCookieValue","getCookieValue","getTranslationsSnapshot","useSetLocale","useSetRegion","useSetLocale","I18nStore"],"sources":["../src/i18n-cache/constants.ts","../../core/dist/api-rqq7klYe.mjs","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/cookies.ts","../src/condition-store/readBrowserLocale.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/singleton-operations.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/runtimeCredentials.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"sourcesContent":["import type { HtmlTagOptions } from './types';\n\nexport const DEFAULT_HTML_TAG_OPTIONS: HtmlTagOptions = {\n updateHtmlLangTag: true,\n updateHtmlDirTag: true,\n};\n","//#region src/settings/settings.ts\nconst libraryDefaultLocale = \"en\";\nconst defaultTimeout = 6e4;\n//#endregion\n//#region src/logging/diagnostics.ts\nfunction ensureSentence(text) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return \"\";\n\treturn /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;\n}\nfunction stripSentence(text) {\n\tconst trimmed = text.trim();\n\tlet end = trimmed.length;\n\twhile (end > 0) {\n\t\tconst char = trimmed[end - 1];\n\t\tif (char !== \".\" && char !== \"!\" && char !== \"?\") break;\n\t\tend -= 1;\n\t}\n\treturn trimmed.slice(0, end);\n}\nfunction formatDetails(details) {\n\tif (!details) return \"\";\n\tconst detailText = Array.isArray(details) ? details.join(\", \") : details;\n\tif (!detailText.trim()) return \"\";\n\treturn ensureSentence(`Details: ${detailText}`);\n}\nfunction formatDiagnosticErrorDetails(error) {\n\tif (error == null) return void 0;\n\treturn String(error);\n}\nfunction createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {\n\tconst prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : \"\";\n\tconst whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;\n\tconst shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));\n\tconst messageParts = [\n\t\twhatAndWhy,\n\t\treassurance,\n\t\tshouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,\n\t\tshouldCombineWayOut ? void 0 : wayOut,\n\t\tformatDetails(details)\n\t].filter((part) => !!part).map(ensureSentence);\n\tif (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);\n\tconst message = messageParts.join(\" \");\n\treturn prefix ? `${prefix} ${message}` : message;\n}\n//#endregion\n//#region src/settings/settingsUrls.ts\nconst defaultCacheUrl = \"https://cdn.gtx.dev\";\nconst defaultBaseUrl = \"https://api2.gtx.dev\";\nconst defaultRuntimeApiUrl = \"https://runtime2.gtx.dev\";\n//#endregion\n//#region src/translate/api.ts\nconst API_VERSION = \"2026-03-06.v1\";\n//#endregion\nexport { createDiagnosticMessage as a, libraryDefaultLocale as c, defaultRuntimeApiUrl as i, defaultBaseUrl as n, formatDiagnosticErrorDetails as o, defaultCacheUrl as r, defaultTimeout as s, API_VERSION as t };\n\n//# sourceMappingURL=api-rqq7klYe.mjs.map","import type {\n I18nCacheConstructorParams,\n TranslationsLoader,\n} from 'gt-i18n/internal/types';\nimport { getI18nConfig, I18nCache } from 'gt-i18n/internal';\nimport type { HtmlTagOptions } from './types';\nimport type { Translation } from 'gt-i18n/types';\nimport { DEFAULT_HTML_TAG_OPTIONS } from './constants';\nimport { createDiagnosticMessage } from 'generaltranslation/internal';\n\ntype LocalStorageTranslationCache =\n import('./LocalStorageTranslationCache').LocalStorageTranslationCache;\ntype LocalStorageCachePromises = Record<\n string,\n Promise<LocalStorageTranslationCache>\n>;\n\n// Lazily import the development-only cache so bundlers can keep it out of the initial client chunk.\n// `??=` saves the first import promise, so all cache instances reuse the same lazy module load.\nlet localStorageCacheModulePromise:\n | Promise<typeof import('./LocalStorageTranslationCache')>\n | undefined;\n\n/**\n * The configuration for the BrowserI18nCache\n */\nexport type BrowserI18nCacheParams = I18nCacheConstructorParams & {\n htmlTagOptions?: HtmlTagOptions;\n};\n\n/**\n * I18nCache implementation for Browser.\n */\nexport class BrowserI18nCache extends I18nCache<Translation> {\n /** Customize browser-related behavior */\n private htmlTagOptions?: HtmlTagOptions;\n\n /** Whether dev hot reload JSX (Suspense-based <T>) is active */\n private _devHotReloadJsx = false;\n\n constructor(config: BrowserI18nCacheParams) {\n // Must be initialized before super()\n const { htmlTagOptions, ...managerConfig } = config;\n const localStorageCaches: LocalStorageCachePromises = {};\n const i18nConfig = getI18nConfig();\n const devHotReloadEnabled =\n !!config.loadTranslations && i18nConfig.isDevHotReloadEnabled();\n const projectId = i18nConfig.getProjectId()!;\n const loadTranslations = devHotReloadEnabled\n ? wrapLoaderWithLocalStorage(\n config.loadTranslations!,\n projectId,\n localStorageCaches\n )\n : config.loadTranslations;\n\n // Initialize the I18nCache\n super({\n ...managerConfig,\n loadTranslations,\n });\n\n this._devHotReloadJsx = devHotReloadEnabled;\n\n this.htmlTagOptions = {\n ...DEFAULT_HTML_TAG_OPTIONS,\n ...htmlTagOptions,\n };\n\n // For dev hot reload, we need to write the translations to the localStorage cache\n if (devHotReloadEnabled) {\n this.onTranslationsCacheMiss = ({ locale, hash, translation }) => {\n void getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n }).then((cache) => cache.write(hash, translation));\n };\n }\n }\n\n /**\n * Whether dev hot reload JSX (Suspense-based <T>) is active\n */\n isDevHotReloadJsx(): boolean {\n return this._devHotReloadJsx;\n }\n\n /**\n * Update the html tag (lang, dir)\n *\n * @deprecated, TODO: we should use a different system for managing this html tag\n * this should just be for managing translations\n */\n updateHtmlTag(\n locale: string,\n htmlTagOptions?: { lang?: string; dir?: 'ltr' | 'rtl' } & HtmlTagOptions\n ): void {\n // Get parameters\n const htmlLocale = htmlTagOptions?.lang || locale;\n const i18nConfig = getI18nConfig();\n const canonicalLocale = i18nConfig.resolveCanonicalLocale(htmlLocale);\n\n // Validate parameters\n if (!i18nConfig.isValidLocale(canonicalLocale)) {\n console.warn(createInvalidLocaleWarning(htmlLocale));\n return;\n }\n\n const localeDirection =\n htmlTagOptions?.dir || i18nConfig.getLocaleDirection(canonicalLocale);\n\n // Merge options\n const mergedHtmlTagOptions = {\n ...this.htmlTagOptions,\n ...htmlTagOptions,\n };\n\n // Update html tag\n if (mergedHtmlTagOptions.updateHtmlLangTag) {\n document.documentElement.lang = canonicalLocale;\n }\n if (mergedHtmlTagOptions.updateHtmlDirTag) {\n document.documentElement.dir = localeDirection;\n }\n }\n}\n\n// ===== Helper Functions ===== //\n\n/**\n * Wraps a translation loader to merge localStorage translations in dev mode.\n * On each call: runs the original loader, seeds a LocalStorageTranslationCache\n * with the result (loader wins over stale localStorage), and returns the merged\n * translations — preserving runtime tx() translations from previous sessions.\n *\n * TODO: this should be moved to wrapping in I18nStore\n */\nfunction wrapLoaderWithLocalStorage(\n originalLoader: TranslationsLoader,\n projectId: string,\n localStorageCaches: LocalStorageCachePromises\n) {\n return async (locale: string) => {\n const loaderTranslations = await originalLoader(locale);\n const cache = await getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n init: loaderTranslations as Record<string, Translation>,\n });\n return cache.getInternalCache();\n };\n}\n\nfunction getOrCreateLocalStorageCache(\n localStorageCaches: LocalStorageCachePromises,\n params: {\n locale: string;\n projectId: string;\n init?: Record<string, Translation>;\n }\n): Promise<LocalStorageTranslationCache> {\n // `||=` saves the first promise for this locale, so concurrent calls reuse one cache instance.\n return (localStorageCaches[params.locale] ||= loadLocalStorageCache().then(\n ({ LocalStorageTranslationCache }) =>\n new LocalStorageTranslationCache(params)\n ));\n}\n\nfunction loadLocalStorageCache() {\n return (localStorageCacheModulePromise ??=\n import('./LocalStorageTranslationCache'));\n}\n\nconst createInvalidLocaleWarning = (locale: string) =>\n createDiagnosticMessage({\n source: 'gt-react',\n severity: 'Warning',\n whatHappened: `Locale \"${locale}\" is not valid`,\n fix: 'Use a valid BCP 47 locale code or add a custom mapping',\n });\n","import { getCookieValue as getCookieValueFromString } from 'gt-i18n/internal';\n\n/**\n * Minimally parses a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @returns The locale from the cookie or undefined if not found or invalid\n */\nexport function getCookieValue({\n cookieName,\n}: {\n cookieName: string;\n}): string | undefined {\n if (typeof document === 'undefined') return undefined;\n return getCookieValueFromString(document.cookie, cookieName);\n}\n\n/**\n * Sets a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @param value - The value to set\n * @returns The value that was set\n */\nexport function setCookieValue({\n cookieName,\n value,\n}: {\n cookieName: string;\n value: string;\n}): void {\n if (typeof document === 'undefined') return;\n document.cookie = `${cookieName}=${value};path=/`;\n}\n","import { getCookieValue } from './cookies';\n\nexport function readBrowserLocale(localeCookieName: string): string[] {\n const candidates = [];\n // (1) Check cookie\n\n const cookieLocale = getCookieValue({\n cookieName: localeCookieName,\n });\n if (cookieLocale) candidates.push(cookieLocale);\n\n // (2) Check navigator locales\n const navigatorLocales = navigator?.languages || [];\n candidates.push(...navigatorLocales);\n\n return candidates;\n}\n","import {\n defaultResetLocaleCookieName,\n getI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { WritableConditionStoreParams } from 'gt-i18n/internal';\nimport { getCookieValue, setCookieValue } from './cookies';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { GetEnableI18n, GetLocale, GetRegion } from '../i18n-cache/types';\nimport {\n LocaleCandidates,\n WritableConditionStoreInterface,\n} from 'gt-i18n/internal/types';\n\ntype SerializedBrowserConditionStoreState = {\n locale: string;\n region: string | undefined;\n enableI18n: boolean;\n};\nexport type ReloadType = (state: SerializedBrowserConditionStoreState) => void;\n\n/**\n * The configuration for the BrowserConditionStore\n * @param {GetLocale} getLocale - The function to get the locale\n */\nexport type BrowserConditionStoreParams = WritableConditionStoreParams & {\n _getLocale?: GetLocale;\n _getRegion?: GetRegion;\n _getEnableI18n?: GetEnableI18n;\n _reload?: ReloadType;\n};\n\n/**\n * Condition store implementation for Browser.\n */\nexport class BrowserConditionStore implements WritableConditionStoreInterface {\n private customReload: ReloadType;\n private customGetLocale?: GetLocale;\n private customGetRegion?: GetRegion;\n private customGetEnableI18n?: GetEnableI18n;\n\n constructor(config: BrowserConditionStoreParams) {\n const i18nConfig = getI18nConfig();\n this.customReload =\n config._reload ??\n (() =>\n typeof window !== 'undefined' ? window.location.reload() : undefined);\n this.customGetLocale = config._getLocale;\n this.customGetRegion = config._getRegion;\n this.customGetEnableI18n = config._getEnableI18n;\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(config.locale),\n });\n if (config.region !== undefined) {\n setCookieValue({\n cookieName: i18nConfig.getRegionCookieName(),\n value: config.region,\n });\n }\n this.updateEnableI18n(config.enableI18n ?? true);\n }\n\n getLocale = (): string => {\n return getBrowserLocale(this.customGetLocale);\n };\n\n setLocale = (locale: LocaleCandidates): void => {\n this.updateLocale(locale);\n setCookieValue({\n cookieName: defaultResetLocaleCookieName,\n value: 'true',\n });\n this.reload();\n };\n\n getRegion = (): string | undefined => {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n if (cookieRegion) return cookieRegion;\n return this.customGetRegion?.();\n };\n\n setRegion = (region: string | undefined): void => {\n this.updateRegion(region);\n this.reload();\n };\n\n getEnableI18n = (): boolean => {\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return this.customGetEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n };\n\n setEnableI18n = (enableI18n: boolean): void => {\n this.updateEnableI18n(enableI18n);\n this.reload();\n };\n\n /**\n * Soft locale update\n */\n updateLocale = (locale: LocaleCandidates): void => {\n const i18nConfig = getI18nConfig();\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(locale),\n });\n };\n\n /**\n * Soft region update\n */\n updateRegion = (region: string | undefined): void => {\n setCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n value: region ?? '',\n });\n };\n\n /**\n * Soft enableI18n update\n */\n updateEnableI18n = (enableI18n: boolean): void => {\n setCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n value: enableI18n ? 'true' : 'false',\n });\n };\n\n /**\n * Condition store updates come from either the server or the client.\n * Trigger this reload when we update a value in the condition store from\n * the client.\n */\n reload = (): void => {\n const state = {\n locale: this.getLocale(),\n region: this.getRegion(),\n enableI18n: this.getEnableI18n(),\n };\n this.customReload(state);\n };\n}\n\nfunction getBrowserLocale(getLocale?: GetLocale): string {\n const i18nConfig = getI18nConfig();\n const candidates = readBrowserLocale(i18nConfig.getLocaleCookieName());\n if (getLocale) candidates.push(getLocale());\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport {\n createConditionStoreSingleton,\n ReadonlyConditionStore,\n} from 'gt-i18n/internal';\nimport { BrowserConditionStore } from './BrowserConditionStore';\n\n// Both singletons below are typed views of the same global slot (namespace\n// 'i18n', key 'conditionStore'), so there is a single uninitialized state and\n// one message describes it for both getters.\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: 'gt-react',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'the internal ConditionStore singleton is unavailable',\n fix: 'Call initializeGT() (or initializeGTSPA() in SPA apps) before rendering and add a <GTProvider> at the root of your component tree.',\n});\n\nexport const {\n setConditionStore: setReadonlyConditionStore,\n isConditionStoreInitialized: isReadonlyConditionStoreInitialized,\n} = createConditionStoreSingleton<ReadonlyConditionStore>(\n conditionStoreNotInitializedError\n);\n\nexport const {\n getConditionStore: getBrowserConditionStore,\n setConditionStore: setBrowserConditionStore,\n isConditionStoreInitialized: isBrowserConditionStoreInitialized,\n} = createConditionStoreSingleton<BrowserConditionStore>(\n conditionStoreNotInitializedError\n);\n","import type { LocaleCandidates } from 'gt-i18n/internal';\nimport { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport {\n BrowserConditionStore,\n BrowserConditionStoreParams,\n} from './BrowserConditionStore';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { getCookieValue } from './cookies';\nimport {\n getBrowserConditionStore,\n isBrowserConditionStoreInitialized,\n setBrowserConditionStore,\n} from './singleton-operations';\n\nexport type CreateBrowserConditionStoreParams = Omit<\n BrowserConditionStoreParams,\n 'locale' | 'enableI18n'\n> & {\n locale?: LocaleCandidates;\n enableI18n?: boolean;\n};\n\n/**\n * Factory to create a BrowserConditionStore for Singleton\n *\n * This exists so we can keep the locale param as required in the constructor\n *\n * Server-provided props are the first candidates for hydration consistency.\n * Cookies fill in missing values to persist state across page reloads.\n *\n * Cookie names come from the I18nConfig singleton so custom names passed to\n * initializeGT() apply here without being threaded through provider props.\n */\nexport function createOrUpdateBrowserConditionStore(\n config: CreateBrowserConditionStoreParams\n) {\n const locale = determineLocale(config);\n const region = determineRegion(config);\n const enableI18n = determineEnableI18n(config);\n\n if (isBrowserConditionStoreInitialized()) {\n // This represents an update from server\n const conditionStore = getBrowserConditionStore();\n conditionStore.updateLocale(locale);\n if (region !== undefined) conditionStore.updateRegion(region);\n conditionStore.updateEnableI18n(enableI18n);\n return conditionStore;\n }\n\n const conditionStore = new BrowserConditionStore({\n ...config,\n locale,\n region,\n enableI18n,\n });\n setBrowserConditionStore(conditionStore);\n return conditionStore;\n}\n\nfunction determineLocale({\n _getLocale: getLocale,\n locale,\n}: CreateBrowserConditionStoreParams): string {\n const i18nConfig = getI18nConfig();\n const candidates = [];\n if (locale) {\n candidates.push(...(Array.isArray(locale) ? locale : [locale]));\n }\n if (getLocale) candidates.push(getLocale());\n candidates.push(...readBrowserLocale(i18nConfig.getLocaleCookieName()));\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n\nfunction determineRegion({\n _getRegion: getRegion,\n region,\n}: CreateBrowserConditionStoreParams): string | undefined {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n return cookieRegion || getRegion?.() || region;\n}\n\nfunction determineEnableI18n({\n enableI18n,\n _getEnableI18n: getEnableI18n,\n}: CreateBrowserConditionStoreParams): boolean {\n if (enableI18n !== undefined) return enableI18n;\n\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return getEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n}\n","import { getRuntimeEnvironment } from 'gt-i18n/internal';\nimport type { I18nConfigParams } from 'gt-i18n/internal/types';\n\ntype RuntimeCredentials = Pick<I18nConfigParams, 'projectId' | 'devApiKey'>;\ntype RuntimeEnv = {\n DEV?: boolean;\n VITE_GT_PROJECT_ID?: string;\n VITE_GT_DEV_API_KEY?: string;\n};\n\nexport function addRuntimeCredentials<T extends RuntimeCredentials>(\n config: T\n): T {\n const credentials = getRuntimeCredentials();\n return {\n ...config,\n projectId: config.projectId || credentials.projectId,\n devApiKey: config.devApiKey || credentials.devApiKey,\n };\n}\n\nfunction getRuntimeCredentials(): RuntimeCredentials {\n return {\n projectId:\n readImportMetaVite(\n () =>\n (\n import.meta as ImportMeta & {\n env?: RuntimeEnv;\n }\n ).env?.VITE_GT_PROJECT_ID\n ) || readProcessEnvViteProjectId(),\n devApiKey:\n getRuntimeEnvironment() === 'development'\n ? readImportMetaVite(() =>\n (import.meta as ImportMeta & { env?: RuntimeEnv }).env?.DEV\n ? (import.meta as ImportMeta & { env?: RuntimeEnv }).env\n ?.VITE_GT_DEV_API_KEY\n : undefined\n ) || readProcessEnvViteDevApiKey()\n : undefined,\n };\n}\n\nfunction readImportMetaVite(\n readValue: () => string | undefined\n): string | undefined {\n try {\n return normalizeEnvValue(readValue());\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteProjectId(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_PROJECT_ID);\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteDevApiKey(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_DEV_API_KEY);\n } catch {\n return undefined;\n }\n}\n\nfunction normalizeEnvValue(value: string | undefined): string | undefined {\n return value || undefined;\n}\n","import {\n getTranslationsSnapshot,\n I18nStore,\n setI18nStore,\n setReactI18nCache,\n getReadonlyConditionStore,\n initializeI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { I18nConfigParams } from '@generaltranslation/react-core/pure';\nimport { BrowserI18nCache } from '../i18n-cache/BrowserI18nCache';\nimport type { BrowserI18nCacheParams } from '../i18n-cache/BrowserI18nCache';\nimport {\n createOrUpdateBrowserConditionStore,\n CreateBrowserConditionStoreParams,\n} from '../condition-store/createBrowserConditionStore';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTSPAParams = I18nConfigParams &\n BrowserI18nCacheParams &\n CreateBrowserConditionStoreParams;\n\n/**\n * Initialize GT for an SPA\n * - i18nCache\n * - conditionStore\n * - i18nStore\n *\n * This is SPA for browser runtime\n */\nexport async function initializeGTSPA(config: InitializeGTSPAParams) {\n const runtimeConfig = addRuntimeCredentials(config);\n initializeI18nConfig(runtimeConfig, 'SPA');\n\n const i18nCache = new BrowserI18nCache(runtimeConfig);\n setReactI18nCache(i18nCache);\n\n createOrUpdateBrowserConditionStore(runtimeConfig);\n\n const i18nStore = new I18nStore();\n setI18nStore(i18nStore);\n\n // Block until translations are loaded\n await getTranslationsSnapshot(getReadonlyConditionStore().getLocale());\n}\n","import {\n internalInitializeGTSRA,\n type ReactInitializeGTParams,\n} from '@generaltranslation/react-core/pure';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTClientParams = ReactInitializeGTParams;\n\n/**\n * Initialize GT for client-side rendering.\n */\nexport function initializeGTSRAClient(config: InitializeGTClientParams): void {\n internalInitializeGTSRA(\n addRuntimeCredentials({\n cacheExpiryTime: null,\n ...config,\n })\n );\n}\n","import { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport { getCookieValue, parseAcceptLanguage } from 'gt-i18n/internal';\n\ntype RequestWithHeaders = Pick<Request, 'headers'>;\n\n/**\n * Resolve the user's locale from a Web Request.\n *\n * The configured locale cookie takes precedence over the Accept-Language\n * header. If neither contains a supported locale, the configured default\n * locale is returned.\n *\n * This is intended for incoming server requests. A Request created in the\n * browser does not automatically include document cookies or Accept-Language.\n */\nexport function parseLocale(request: RequestWithHeaders): string {\n const i18nConfig = getI18nConfig();\n const candidates: string[] = [];\n const cookieLocale = getCookieValue(\n request.headers.get('cookie'),\n i18nConfig.getLocaleCookieName()\n );\n\n if (cookieLocale) {\n candidates.push(cookieLocale);\n }\n\n candidates.push(\n ...parseAcceptLanguage(request.headers.get('accept-language'))\n );\n\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","import {\n useInternalLocaleSelector,\n useSetLocale,\n} from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a locale selector.\n * Provides locale management utilities for the application.\n *\n * @param locales an optional list of locales to use for the drop down. These locales must be a subset of the locales provided by the `<GTProvider>` context. When not provided, the list of locales from the `<GTProvider>` context is used.\n *\n * @returns {Object} An object containing locale-related utilities:\n * @returns {string} return.locale - The currently selected locale.\n * @returns {string[]} return.locales - The list of all available locales.\n * @returns {function} return.setLocale - Function to update the current locale.\n * @returns {(locale: string) => LocaleProperties} return.getLocaleProperties - Function to retrieve properties for a given locale.\n */\nexport function useLocaleSelector(locales?: string[]) {\n const setLocale = useSetLocale();\n return { setLocale, ...useInternalLocaleSelector(locales) };\n}\n","import {\n useInternalRegionSelector,\n useSetLocale,\n useSetRegion,\n} from '@generaltranslation/react-core/hooks';\nimport type { InternalRegionSelectorOptions } from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a region selector.\n * Provides region management utilities for the application.\n *\n * @param {Object} [options] - Optional configuration object.\n * @param {string[]} [options.regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from supported locales.\n * @param {Object} [options.customMapping] - Optional mapping to override region display names, emojis, or associated locales.\n * @param {boolean} [options.prioritizeCurrentLocaleRegion=true] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [options.sortRegionsAlphabetically=true] - If true, regions are sorted alphabetically by display name.\n *\n * @returns {Object} An object containing region-related utilities:\n * @returns {string | undefined} return.region - The currently selected region code.\n * @returns {function} return.setRegion - Function to update the current region.\n * @returns {string[]} return.regions - The ordered list of available region codes.\n * @returns {Map<string, RegionData>} return.regionData - Map of region codes to their display data (name, emoji, locale).\n * @returns {string} return.locale - The current locale.\n * @returns {function} return.setLocale - Function to update the current locale.\n */\nexport function useRegionSelector(options?: InternalRegionSelectorOptions) {\n const setRegion = useSetRegion();\n const setLocale = useSetLocale();\n return { setRegion, setLocale, ...useInternalRegionSelector(options) };\n}\n","import type React from 'react';\nimport { InternalLocaleSelector } from '@generaltranslation/react-core/components';\nimport { CustomMapping } from 'generaltranslation/types';\nimport { useLocaleSelector } from './useLocaleSelector';\n\n/**\n * A dropdown component that allows users to select a locale.\n * @param {string[]} [locales] - An optional list of locales to use for the dropdown. If not provided, the list of locales from the `<GTProvider>` context is used.\n * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.\n * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.\n * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.\n */\nexport function LocaleSelector({\n locales: _locales,\n ...props\n}: LocaleSelectorProps): React.JSX.Element | null {\n // Get locale selector properties\n const { locale, locales, getLocaleProperties, setLocale } =\n useLocaleSelector(_locales);\n\n return (\n <InternalLocaleSelector\n locale={locale}\n locales={locales}\n setLocale={setLocale}\n getLocaleProperties={getLocaleProperties}\n {...props}\n />\n );\n}\n\nexport type LocaleSelectorProps = {\n locales?: string[];\n customNames?: { [key: string]: string };\n customMapping?: CustomMapping;\n [key: string]: any;\n};\n","import type React from 'react';\nimport type { ReactNode } from 'react';\nimport { InternalRegionSelector } from '@generaltranslation/react-core/components';\nimport { useRegionSelector } from './useRegionSelector';\n\n/**\n * A dropdown component that allows users to select a region.\n * @param {string[]} [regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from the supported locales in the `<GTProvider>` context.\n * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.\n * @param {object} [customMapping] - An optional object to map region codes to custom display names, emojis, or associated locales.\n * @param {boolean} [prioritizeCurrentLocaleRegion] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [sortRegionsAlphabetically] - If true, regions are sorted alphabetically by display name.\n * @param {boolean} [asLocaleSelector=false] - If true, selecting a region will also update the locale to the region's associated locale.\n * @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.\n *\n * @example\n * ```tsx\n * <RegionSelector\n * regions={['US', 'CA']}\n * customMapping={{ US: { name: \"United States\", emoji: \"🇺🇸\" } }}\n * placeholder=\"Select a region\"\n * />\n * ```\n */\nexport function RegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n asLocaleSelector = false,\n ...props\n}: RegionSelectorProps): React.JSX.Element | null {\n // Get region selector properties\n const { region, regions, regionData, locale, setRegion, setLocale } =\n useRegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n });\n\n const changeRegion = (region: string) => {\n if (asLocaleSelector) {\n const regionLocale = regionData.get(region)?.locale;\n // setRegion reloads the page; update the locale cookie first\n if (regionLocale && locale !== regionLocale) setLocale(regionLocale);\n }\n setRegion(region);\n };\n\n return (\n <InternalRegionSelector\n region={region}\n regions={regions}\n regionData={regionData}\n setRegion={changeRegion}\n {...props}\n />\n );\n}\n\nexport type RegionSelectorProps = {\n regions?: string[];\n placeholder?: ReactNode;\n customMapping?: {\n [region: string]:\n | string\n | { name?: string; emoji?: string; locale?: string };\n };\n prioritizeCurrentLocaleRegion?: boolean;\n sortRegionsAlphabetically?: boolean;\n asLocaleSelector?: boolean;\n [key: string]: any;\n};\n","import {\n I18nStore,\n InternalGTProvider,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { SharedGTProviderProps } from './GTProviderProps';\nimport { createOrUpdateBrowserConditionStore } from '../condition-store/createBrowserConditionStore';\n\n/**\n * Consumes snapshot from server\n * Implementation for client-side only\n */\nexport function BrowserGTProvider(props: SharedGTProviderProps) {\n const conditionStore = useMemo(() => {\n return createOrUpdateBrowserConditionStore(props);\n }, [props.locale, props.region, props.enableI18n, props._reload]);\n\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n\n return (\n <InternalGTProvider\n {...props}\n conditionStore={conditionStore}\n i18nStore={i18nStoreRef.current}\n />\n );\n}\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport type { TxProps } from './utils/TxProps';\n\nexport { initializeGTSPA } from './setup/initializeGTSPA';\nexport { initializeGTSRAClient as initializeGT } from './setup/initializeGTSRAClient';\nexport { createOrUpdateBrowserConditionStore } from './condition-store/createBrowserConditionStore';\nexport { parseLocale } from './functions/parseLocale';\nexport { useLocaleSelector } from './components/useLocaleSelector';\nexport { useRegionSelector } from './components/useRegionSelector';\n\n// ===== Components ===== //\nexport { LocaleSelector } from './components/LocaleSelector';\nexport { RegionSelector } from './components/RegionSelector';\nexport { BrowserGTProvider as GTProvider } from './provider/BrowserGTProvider';\n\n// ===== Components ===== //\nexport {\n Branch,\n Plural,\n Derive,\n GtInternalTranslateJsx,\n GtInternalVar,\n T,\n Currency,\n DateTime,\n RelativeTime,\n Var,\n Num,\n} from '@generaltranslation/react-core/components';\n\nexport async function Tx(_props: TxProps): Promise<ReactNode> {\n throw new Error('Tx is only supported via RSC');\n}\n\n// ===== Hooks ===== //\nexport {\n useLocale,\n useRegion,\n useCustomMapping,\n useDefaultLocale,\n useEnableI18n,\n useLocales,\n useFormatLocales,\n useGT,\n useMessages,\n useTranslations,\n useLocaleDirection,\n useLocaleProperties,\n useSetLocale,\n useSetRegion,\n useSetEnableI18n,\n} from '@generaltranslation/react-core/hooks';\n\n// ===== Functions ===== //\nexport {\n msg,\n decodeMsg,\n decodeOptions,\n derive,\n declareVar,\n decodeVars,\n mFallback,\n gtFallback,\n getFormatLocales,\n getDefaultLocale,\n getLocaleProperties,\n getLocales,\n resolveCanonicalLocale,\n getReactI18nCache,\n getTranslationsSnapshot,\n getVersionId,\n createRenderPipeline,\n setReactI18nCache,\n t,\n} from '@generaltranslation/react-core/pure';\n\nexport type {\n RenderPipeline,\n RenderPreparedT,\n} from '@generaltranslation/react-core/pure';\n\nexport type { SharedGTProviderProps } from './provider/GTProviderProps';\nexport {\n GtInternalRuntimeTranslateJsx,\n GtInternalRuntimeTranslateString,\n} from 'gt-i18n/internal';\nexport type {\n GTTranslationOptions,\n RuntimeTranslationOptions,\n} from 'gt-i18n/types';\nexport type {\n SyncResolutionFunction,\n SyncResolutionFunctionWithFallback,\n} from 'gt-i18n/types';\n\n// ===== Singletons ===== //\nexport {\n ReactI18nCache,\n type ReactI18nCacheParams,\n} from '@generaltranslation/react-core/pure';\n"],"mappings":";;;;;;;;AAEA,MAAa,2BAA2C;CACtD,mBAAmB;CACnB,kBAAkB;CACnB;;;ACAD,SAAS,eAAe,MAAM;CAC7B,MAAM,UAAU,KAAK,MAAM;AAC3B,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO,UAAU,KAAK,QAAQ,GAAG,UAAU,GAAG,QAAQ;;AAEvD,SAAS,cAAc,MAAM;CAC5B,MAAM,UAAU,KAAK,MAAM;CAC3B,IAAI,MAAM,QAAQ;AAClB,QAAO,MAAM,GAAG;EACf,MAAM,OAAO,QAAQ,MAAM;AAC3B,MAAI,SAAS,OAAO,SAAS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names":["getI18nConfig","getCookieValue","getCookieValueFromString","getCookieValue","getCookieValue","getCookieValue","getTranslationsSnapshot","useSetLocale","useSetRegion","useSetLocale","I18nStore"],"sources":["../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/cookies.ts","../src/condition-store/readBrowserLocale.ts","../src/condition-store/BrowserConditionStore.ts","../../core/dist/api-rqq7klYe.mjs","../src/condition-store/singleton-operations.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/runtimeCredentials.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"sourcesContent":["import type {\n I18nCacheConstructorParams,\n TranslationsLoader,\n} from 'gt-i18n/internal/types';\nimport { getI18nConfig, I18nCache } from 'gt-i18n/internal';\nimport type { HtmlTagOptions } from './types';\nimport type { Translation } from 'gt-i18n/types';\n\ntype LocalStorageTranslationCache =\n import('./LocalStorageTranslationCache').LocalStorageTranslationCache;\ntype LocalStorageCachePromises = Record<\n string,\n Promise<LocalStorageTranslationCache>\n>;\n\n// Lazily import the development-only cache so bundlers can keep it out of the initial client chunk.\n// `??=` saves the first import promise, so all cache instances reuse the same lazy module load.\nlet localStorageCacheModulePromise:\n | Promise<typeof import('./LocalStorageTranslationCache')>\n | undefined;\n\n/**\n * The configuration for the BrowserI18nCache\n */\nexport type BrowserI18nCacheParams = I18nCacheConstructorParams & {\n htmlTagOptions?: HtmlTagOptions;\n};\n\n/**\n * I18nCache implementation for Browser.\n */\nexport class BrowserI18nCache extends I18nCache<Translation> {\n /** Whether dev hot reload JSX (Suspense-based <T>) is active */\n private _devHotReloadJsx = false;\n\n constructor(config: BrowserI18nCacheParams) {\n // Must be initialized before super()\n // Keep accepting htmlTagOptions without passing it to the translation cache.\n const { htmlTagOptions: _htmlTagOptions, ...managerConfig } = config;\n const localStorageCaches: LocalStorageCachePromises = {};\n const i18nConfig = getI18nConfig();\n const devHotReloadEnabled =\n !!config.loadTranslations && i18nConfig.isDevHotReloadEnabled();\n const projectId = i18nConfig.getProjectId()!;\n const loadTranslations = devHotReloadEnabled\n ? wrapLoaderWithLocalStorage(\n config.loadTranslations!,\n projectId,\n localStorageCaches\n )\n : config.loadTranslations;\n\n // Initialize the I18nCache\n super({\n ...managerConfig,\n loadTranslations,\n });\n\n this._devHotReloadJsx = devHotReloadEnabled;\n\n // For dev hot reload, we need to write the translations to the localStorage cache\n if (devHotReloadEnabled) {\n this.onTranslationsCacheMiss = ({ locale, hash, translation }) => {\n void getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n }).then((cache) => cache.write(hash, translation));\n };\n }\n }\n\n /**\n * Whether dev hot reload JSX (Suspense-based <T>) is active\n */\n isDevHotReloadJsx(): boolean {\n return this._devHotReloadJsx;\n }\n}\n\n// ===== Helper Functions ===== //\n\n/**\n * Wraps a translation loader to merge localStorage translations in dev mode.\n * On each call: runs the original loader, seeds a LocalStorageTranslationCache\n * with the result (loader wins over stale localStorage), and returns the merged\n * translations — preserving runtime tx() translations from previous sessions.\n *\n * TODO: this should be moved to wrapping in I18nStore\n */\nfunction wrapLoaderWithLocalStorage(\n originalLoader: TranslationsLoader,\n projectId: string,\n localStorageCaches: LocalStorageCachePromises\n) {\n return async (locale: string) => {\n const loaderTranslations = await originalLoader(locale);\n const cache = await getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n init: loaderTranslations as Record<string, Translation>,\n });\n return cache.getInternalCache();\n };\n}\nfunction getOrCreateLocalStorageCache(\n localStorageCaches: LocalStorageCachePromises,\n params: {\n locale: string;\n projectId: string;\n init?: Record<string, Translation>;\n }\n): Promise<LocalStorageTranslationCache> {\n // `||=` saves the first promise for this locale, so concurrent calls reuse one cache instance.\n return (localStorageCaches[params.locale] ||= loadLocalStorageCache().then(\n ({ LocalStorageTranslationCache }) =>\n new LocalStorageTranslationCache(params)\n ));\n}\n\nfunction loadLocalStorageCache() {\n return (localStorageCacheModulePromise ??=\n import('./LocalStorageTranslationCache'));\n}\n","import { getCookieValue as getCookieValueFromString } from 'gt-i18n/internal';\n\n/**\n * Minimally parses a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @returns The locale from the cookie or undefined if not found or invalid\n */\nexport function getCookieValue({\n cookieName,\n}: {\n cookieName: string;\n}): string | undefined {\n if (typeof document === 'undefined') return undefined;\n return getCookieValueFromString(document.cookie, cookieName);\n}\n\n/**\n * Sets a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @param value - The value to set\n * @returns The value that was set\n */\nexport function setCookieValue({\n cookieName,\n value,\n}: {\n cookieName: string;\n value: string;\n}): void {\n if (typeof document === 'undefined') return;\n document.cookie = `${cookieName}=${value};path=/`;\n}\n","import { getCookieValue } from './cookies';\n\nexport function readBrowserLocale(localeCookieName: string): string[] {\n const candidates = [];\n // (1) Check cookie\n\n const cookieLocale = getCookieValue({\n cookieName: localeCookieName,\n });\n if (cookieLocale) candidates.push(cookieLocale);\n\n // (2) Check navigator locales\n const navigatorLocales = navigator?.languages || [];\n candidates.push(...navigatorLocales);\n\n return candidates;\n}\n","import {\n defaultResetLocaleCookieName,\n getI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { WritableConditionStoreParams } from 'gt-i18n/internal';\nimport { getCookieValue, setCookieValue } from './cookies';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { GetEnableI18n, GetLocale, GetRegion } from '../i18n-cache/types';\nimport {\n LocaleCandidates,\n WritableConditionStoreInterface,\n} from 'gt-i18n/internal/types';\n\ntype SerializedBrowserConditionStoreState = {\n locale: string;\n region: string | undefined;\n enableI18n: boolean;\n};\nexport type ReloadType = (state: SerializedBrowserConditionStoreState) => void;\n\n/**\n * The configuration for the BrowserConditionStore\n * @param {GetLocale} getLocale - The function to get the locale\n */\nexport type BrowserConditionStoreParams = WritableConditionStoreParams & {\n _getLocale?: GetLocale;\n _getRegion?: GetRegion;\n _getEnableI18n?: GetEnableI18n;\n _reload?: ReloadType;\n};\n\n/**\n * Condition store implementation for Browser.\n */\nexport class BrowserConditionStore implements WritableConditionStoreInterface {\n private customReload: ReloadType;\n private customGetLocale?: GetLocale;\n private customGetRegion?: GetRegion;\n private customGetEnableI18n?: GetEnableI18n;\n\n constructor(config: BrowserConditionStoreParams) {\n const i18nConfig = getI18nConfig();\n this.customReload =\n config._reload ??\n (() =>\n typeof window !== 'undefined' ? window.location.reload() : undefined);\n this.customGetLocale = config._getLocale;\n this.customGetRegion = config._getRegion;\n this.customGetEnableI18n = config._getEnableI18n;\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(config.locale),\n });\n if (config.region !== undefined) {\n setCookieValue({\n cookieName: i18nConfig.getRegionCookieName(),\n value: config.region,\n });\n }\n this.updateEnableI18n(config.enableI18n ?? true);\n }\n\n getLocale = (): string => {\n return getBrowserLocale(this.customGetLocale);\n };\n\n setLocale = (locale: LocaleCandidates): void => {\n this.updateLocale(locale);\n setCookieValue({\n cookieName: defaultResetLocaleCookieName,\n value: 'true',\n });\n this.reload();\n };\n\n getRegion = (): string | undefined => {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n if (cookieRegion) return cookieRegion;\n return this.customGetRegion?.();\n };\n\n setRegion = (region: string | undefined): void => {\n this.updateRegion(region);\n this.reload();\n };\n\n getEnableI18n = (): boolean => {\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return this.customGetEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n };\n\n setEnableI18n = (enableI18n: boolean): void => {\n this.updateEnableI18n(enableI18n);\n this.reload();\n };\n\n /**\n * Soft locale update\n */\n updateLocale = (locale: LocaleCandidates): void => {\n const i18nConfig = getI18nConfig();\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(locale),\n });\n };\n\n /**\n * Soft region update\n */\n updateRegion = (region: string | undefined): void => {\n setCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n value: region ?? '',\n });\n };\n\n /**\n * Soft enableI18n update\n */\n updateEnableI18n = (enableI18n: boolean): void => {\n setCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n value: enableI18n ? 'true' : 'false',\n });\n };\n\n /**\n * Condition store updates come from either the server or the client.\n * Trigger this reload when we update a value in the condition store from\n * the client.\n */\n reload = (): void => {\n const state = {\n locale: this.getLocale(),\n region: this.getRegion(),\n enableI18n: this.getEnableI18n(),\n };\n this.customReload(state);\n };\n}\n\nfunction getBrowserLocale(getLocale?: GetLocale): string {\n const i18nConfig = getI18nConfig();\n const candidates = readBrowserLocale(i18nConfig.getLocaleCookieName());\n if (getLocale) candidates.push(getLocale());\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","//#region src/settings/settings.ts\nconst libraryDefaultLocale = \"en\";\nconst defaultTimeout = 6e4;\n//#endregion\n//#region src/logging/diagnostics.ts\nfunction ensureSentence(text) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return \"\";\n\treturn /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;\n}\nfunction stripSentence(text) {\n\tconst trimmed = text.trim();\n\tlet end = trimmed.length;\n\twhile (end > 0) {\n\t\tconst char = trimmed[end - 1];\n\t\tif (char !== \".\" && char !== \"!\" && char !== \"?\") break;\n\t\tend -= 1;\n\t}\n\treturn trimmed.slice(0, end);\n}\nfunction formatDetails(details) {\n\tif (!details) return \"\";\n\tconst detailText = Array.isArray(details) ? details.join(\", \") : details;\n\tif (!detailText.trim()) return \"\";\n\treturn ensureSentence(`Details: ${detailText}`);\n}\nfunction formatDiagnosticErrorDetails(error) {\n\tif (error == null) return void 0;\n\treturn String(error);\n}\nfunction createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {\n\tconst prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : \"\";\n\tconst whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;\n\tconst shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));\n\tconst messageParts = [\n\t\twhatAndWhy,\n\t\treassurance,\n\t\tshouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,\n\t\tshouldCombineWayOut ? void 0 : wayOut,\n\t\tformatDetails(details)\n\t].filter((part) => !!part).map(ensureSentence);\n\tif (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);\n\tconst message = messageParts.join(\" \");\n\treturn prefix ? `${prefix} ${message}` : message;\n}\n//#endregion\n//#region src/settings/settingsUrls.ts\nconst defaultCacheUrl = \"https://cdn.gtx.dev\";\nconst defaultBaseUrl = \"https://api2.gtx.dev\";\nconst defaultRuntimeApiUrl = \"https://runtime2.gtx.dev\";\n//#endregion\n//#region src/translate/api.ts\nconst API_VERSION = \"2026-03-06.v1\";\n//#endregion\nexport { createDiagnosticMessage as a, libraryDefaultLocale as c, defaultRuntimeApiUrl as i, defaultBaseUrl as n, formatDiagnosticErrorDetails as o, defaultCacheUrl as r, defaultTimeout as s, API_VERSION as t };\n\n//# sourceMappingURL=api-rqq7klYe.mjs.map","import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport {\n createConditionStoreSingleton,\n ReadonlyConditionStore,\n} from 'gt-i18n/internal';\nimport { BrowserConditionStore } from './BrowserConditionStore';\n\n// Both singletons below are typed views of the same global slot (namespace\n// 'i18n', key 'conditionStore'), so there is a single uninitialized state and\n// one message describes it for both getters.\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: 'gt-react',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'the internal ConditionStore singleton is unavailable',\n fix: 'Call initializeGT() (or initializeGTSPA() in SPA apps) before rendering and add a <GTProvider> at the root of your component tree.',\n});\n\nexport const {\n setConditionStore: setReadonlyConditionStore,\n isConditionStoreInitialized: isReadonlyConditionStoreInitialized,\n} = createConditionStoreSingleton<ReadonlyConditionStore>(\n conditionStoreNotInitializedError\n);\n\nexport const {\n getConditionStore: getBrowserConditionStore,\n setConditionStore: setBrowserConditionStore,\n isConditionStoreInitialized: isBrowserConditionStoreInitialized,\n} = createConditionStoreSingleton<BrowserConditionStore>(\n conditionStoreNotInitializedError\n);\n","import type { LocaleCandidates } from 'gt-i18n/internal';\nimport { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport {\n BrowserConditionStore,\n BrowserConditionStoreParams,\n} from './BrowserConditionStore';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { getCookieValue } from './cookies';\nimport {\n getBrowserConditionStore,\n isBrowserConditionStoreInitialized,\n setBrowserConditionStore,\n} from './singleton-operations';\n\nexport type CreateBrowserConditionStoreParams = Omit<\n BrowserConditionStoreParams,\n 'locale' | 'enableI18n'\n> & {\n locale?: LocaleCandidates;\n enableI18n?: boolean;\n};\n\n/**\n * Factory to create a BrowserConditionStore for Singleton\n *\n * This exists so we can keep the locale param as required in the constructor\n *\n * Server-provided props are the first candidates for hydration consistency.\n * Cookies fill in missing values to persist state across page reloads.\n *\n * Cookie names come from the I18nConfig singleton so custom names passed to\n * initializeGT() apply here without being threaded through provider props.\n */\nexport function createOrUpdateBrowserConditionStore(\n config: CreateBrowserConditionStoreParams\n) {\n const locale = determineLocale(config);\n const region = determineRegion(config);\n const enableI18n = determineEnableI18n(config);\n\n if (isBrowserConditionStoreInitialized()) {\n // This represents an update from server\n const conditionStore = getBrowserConditionStore();\n conditionStore.updateLocale(locale);\n if (region !== undefined) conditionStore.updateRegion(region);\n conditionStore.updateEnableI18n(enableI18n);\n return conditionStore;\n }\n\n const conditionStore = new BrowserConditionStore({\n ...config,\n locale,\n region,\n enableI18n,\n });\n setBrowserConditionStore(conditionStore);\n return conditionStore;\n}\n\nfunction determineLocale({\n _getLocale: getLocale,\n locale,\n}: CreateBrowserConditionStoreParams): string {\n const i18nConfig = getI18nConfig();\n const candidates = [];\n if (locale) {\n candidates.push(...(Array.isArray(locale) ? locale : [locale]));\n }\n if (getLocale) candidates.push(getLocale());\n candidates.push(...readBrowserLocale(i18nConfig.getLocaleCookieName()));\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n\nfunction determineRegion({\n _getRegion: getRegion,\n region,\n}: CreateBrowserConditionStoreParams): string | undefined {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n return cookieRegion || getRegion?.() || region;\n}\n\nfunction determineEnableI18n({\n enableI18n,\n _getEnableI18n: getEnableI18n,\n}: CreateBrowserConditionStoreParams): boolean {\n if (enableI18n !== undefined) return enableI18n;\n\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return getEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n}\n","import { getRuntimeEnvironment } from 'gt-i18n/internal';\nimport type { I18nConfigParams } from 'gt-i18n/internal/types';\n\ntype RuntimeCredentials = Pick<I18nConfigParams, 'projectId' | 'devApiKey'>;\ntype RuntimeEnv = {\n DEV?: boolean;\n VITE_GT_PROJECT_ID?: string;\n VITE_GT_DEV_API_KEY?: string;\n};\n\nexport function addRuntimeCredentials<T extends RuntimeCredentials>(\n config: T\n): T {\n const credentials = getRuntimeCredentials();\n return {\n ...config,\n projectId: config.projectId || credentials.projectId,\n devApiKey: config.devApiKey || credentials.devApiKey,\n };\n}\n\nfunction getRuntimeCredentials(): RuntimeCredentials {\n return {\n projectId:\n readImportMetaVite(\n () =>\n (\n import.meta as ImportMeta & {\n env?: RuntimeEnv;\n }\n ).env?.VITE_GT_PROJECT_ID\n ) || readProcessEnvViteProjectId(),\n devApiKey:\n getRuntimeEnvironment() === 'development'\n ? readImportMetaVite(() =>\n (import.meta as ImportMeta & { env?: RuntimeEnv }).env?.DEV\n ? (import.meta as ImportMeta & { env?: RuntimeEnv }).env\n ?.VITE_GT_DEV_API_KEY\n : undefined\n ) || readProcessEnvViteDevApiKey()\n : undefined,\n };\n}\n\nfunction readImportMetaVite(\n readValue: () => string | undefined\n): string | undefined {\n try {\n return normalizeEnvValue(readValue());\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteProjectId(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_PROJECT_ID);\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteDevApiKey(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_DEV_API_KEY);\n } catch {\n return undefined;\n }\n}\n\nfunction normalizeEnvValue(value: string | undefined): string | undefined {\n return value || undefined;\n}\n","import {\n getTranslationsSnapshot,\n I18nStore,\n setI18nStore,\n setReactI18nCache,\n getReadonlyConditionStore,\n initializeI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { I18nConfigParams } from '@generaltranslation/react-core/pure';\nimport { BrowserI18nCache } from '../i18n-cache/BrowserI18nCache';\nimport type { BrowserI18nCacheParams } from '../i18n-cache/BrowserI18nCache';\nimport {\n createOrUpdateBrowserConditionStore,\n CreateBrowserConditionStoreParams,\n} from '../condition-store/createBrowserConditionStore';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTSPAParams = I18nConfigParams &\n BrowserI18nCacheParams &\n CreateBrowserConditionStoreParams;\n\n/**\n * Initialize GT for an SPA\n * - i18nCache\n * - conditionStore\n * - i18nStore\n *\n * This is SPA for browser runtime\n */\nexport async function initializeGTSPA(config: InitializeGTSPAParams) {\n const runtimeConfig = addRuntimeCredentials(config);\n initializeI18nConfig(runtimeConfig, 'SPA');\n\n const i18nCache = new BrowserI18nCache(runtimeConfig);\n setReactI18nCache(i18nCache);\n\n createOrUpdateBrowserConditionStore(runtimeConfig);\n\n const i18nStore = new I18nStore();\n setI18nStore(i18nStore);\n\n // Block until translations are loaded\n await getTranslationsSnapshot(getReadonlyConditionStore().getLocale());\n}\n","import {\n internalInitializeGTSRA,\n type ReactInitializeGTParams,\n} from '@generaltranslation/react-core/pure';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTClientParams = ReactInitializeGTParams;\n\n/**\n * Initialize GT for client-side rendering.\n */\nexport function initializeGTSRAClient(config: InitializeGTClientParams): void {\n internalInitializeGTSRA(\n addRuntimeCredentials({\n cacheExpiryTime: null,\n ...config,\n })\n );\n}\n","import { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport { getCookieValue, parseAcceptLanguage } from 'gt-i18n/internal';\n\ntype RequestWithHeaders = Pick<Request, 'headers'>;\n\n/**\n * Resolve the user's locale from a Web Request.\n *\n * The configured locale cookie takes precedence over the Accept-Language\n * header. If neither contains a supported locale, the configured default\n * locale is returned.\n *\n * This is intended for incoming server requests. A Request created in the\n * browser does not automatically include document cookies or Accept-Language.\n */\nexport function parseLocale(request: RequestWithHeaders): string {\n const i18nConfig = getI18nConfig();\n const candidates: string[] = [];\n const cookieLocale = getCookieValue(\n request.headers.get('cookie'),\n i18nConfig.getLocaleCookieName()\n );\n\n if (cookieLocale) {\n candidates.push(cookieLocale);\n }\n\n candidates.push(\n ...parseAcceptLanguage(request.headers.get('accept-language'))\n );\n\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","import {\n useInternalLocaleSelector,\n useSetLocale,\n} from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a locale selector.\n * Provides locale management utilities for the application.\n *\n * @param locales an optional list of locales to use for the drop down. These locales must be a subset of the locales provided by the `<GTProvider>` context. When not provided, the list of locales from the `<GTProvider>` context is used.\n *\n * @returns {Object} An object containing locale-related utilities:\n * @returns {string} return.locale - The currently selected locale.\n * @returns {string[]} return.locales - The list of all available locales.\n * @returns {function} return.setLocale - Function to update the current locale.\n * @returns {(locale: string) => LocaleProperties} return.getLocaleProperties - Function to retrieve properties for a given locale.\n */\nexport function useLocaleSelector(locales?: string[]) {\n const setLocale = useSetLocale();\n return { setLocale, ...useInternalLocaleSelector(locales) };\n}\n","import {\n useInternalRegionSelector,\n useSetLocale,\n useSetRegion,\n} from '@generaltranslation/react-core/hooks';\nimport type { InternalRegionSelectorOptions } from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a region selector.\n * Provides region management utilities for the application.\n *\n * @param {Object} [options] - Optional configuration object.\n * @param {string[]} [options.regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from supported locales.\n * @param {Object} [options.customMapping] - Optional mapping to override region display names, emojis, or associated locales.\n * @param {boolean} [options.prioritizeCurrentLocaleRegion=true] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [options.sortRegionsAlphabetically=true] - If true, regions are sorted alphabetically by display name.\n *\n * @returns {Object} An object containing region-related utilities:\n * @returns {string | undefined} return.region - The currently selected region code.\n * @returns {function} return.setRegion - Function to update the current region.\n * @returns {string[]} return.regions - The ordered list of available region codes.\n * @returns {Map<string, RegionData>} return.regionData - Map of region codes to their display data (name, emoji, locale).\n * @returns {string} return.locale - The current locale.\n * @returns {function} return.setLocale - Function to update the current locale.\n */\nexport function useRegionSelector(options?: InternalRegionSelectorOptions) {\n const setRegion = useSetRegion();\n const setLocale = useSetLocale();\n return { setRegion, setLocale, ...useInternalRegionSelector(options) };\n}\n","import type React from 'react';\nimport { InternalLocaleSelector } from '@generaltranslation/react-core/components';\nimport { CustomMapping } from 'generaltranslation/types';\nimport { useLocaleSelector } from './useLocaleSelector';\n\n/**\n * A dropdown component that allows users to select a locale.\n * @param {string[]} [locales] - An optional list of locales to use for the dropdown. If not provided, the list of locales from the `<GTProvider>` context is used.\n * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.\n * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.\n * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.\n */\nexport function LocaleSelector({\n locales: _locales,\n ...props\n}: LocaleSelectorProps): React.JSX.Element | null {\n // Get locale selector properties\n const { locale, locales, getLocaleProperties, setLocale } =\n useLocaleSelector(_locales);\n\n return (\n <InternalLocaleSelector\n locale={locale}\n locales={locales}\n setLocale={setLocale}\n getLocaleProperties={getLocaleProperties}\n {...props}\n />\n );\n}\n\nexport type LocaleSelectorProps = {\n locales?: string[];\n customNames?: { [key: string]: string };\n customMapping?: CustomMapping;\n [key: string]: any;\n};\n","import type React from 'react';\nimport type { ReactNode } from 'react';\nimport { InternalRegionSelector } from '@generaltranslation/react-core/components';\nimport { useRegionSelector } from './useRegionSelector';\n\n/**\n * A dropdown component that allows users to select a region.\n * @param {string[]} [regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from the supported locales in the `<GTProvider>` context.\n * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.\n * @param {object} [customMapping] - An optional object to map region codes to custom display names, emojis, or associated locales.\n * @param {boolean} [prioritizeCurrentLocaleRegion] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [sortRegionsAlphabetically] - If true, regions are sorted alphabetically by display name.\n * @param {boolean} [asLocaleSelector=false] - If true, selecting a region will also update the locale to the region's associated locale.\n * @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.\n *\n * @example\n * ```tsx\n * <RegionSelector\n * regions={['US', 'CA']}\n * customMapping={{ US: { name: \"United States\", emoji: \"🇺🇸\" } }}\n * placeholder=\"Select a region\"\n * />\n * ```\n */\nexport function RegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n asLocaleSelector = false,\n ...props\n}: RegionSelectorProps): React.JSX.Element | null {\n // Get region selector properties\n const { region, regions, regionData, locale, setRegion, setLocale } =\n useRegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n });\n\n const changeRegion = (region: string) => {\n if (asLocaleSelector) {\n const regionLocale = regionData.get(region)?.locale;\n // setRegion reloads the page; update the locale cookie first\n if (regionLocale && locale !== regionLocale) setLocale(regionLocale);\n }\n setRegion(region);\n };\n\n return (\n <InternalRegionSelector\n region={region}\n regions={regions}\n regionData={regionData}\n setRegion={changeRegion}\n {...props}\n />\n );\n}\n\nexport type RegionSelectorProps = {\n regions?: string[];\n placeholder?: ReactNode;\n customMapping?: {\n [region: string]:\n | string\n | { name?: string; emoji?: string; locale?: string };\n };\n prioritizeCurrentLocaleRegion?: boolean;\n sortRegionsAlphabetically?: boolean;\n asLocaleSelector?: boolean;\n [key: string]: any;\n};\n","import {\n I18nStore,\n InternalGTProvider,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { SharedGTProviderProps } from './GTProviderProps';\nimport { createOrUpdateBrowserConditionStore } from '../condition-store/createBrowserConditionStore';\n\n/**\n * Consumes snapshot from server\n * Implementation for client-side only\n */\nexport function BrowserGTProvider(props: SharedGTProviderProps) {\n const conditionStore = useMemo(() => {\n return createOrUpdateBrowserConditionStore(props);\n }, [props.locale, props.region, props.enableI18n, props._reload]);\n\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n\n return (\n <InternalGTProvider\n {...props}\n conditionStore={conditionStore}\n i18nStore={i18nStoreRef.current}\n />\n );\n}\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport type { TxProps } from './utils/TxProps';\n\nexport { initializeGTSPA } from './setup/initializeGTSPA';\nexport { initializeGTSRAClient as initializeGT } from './setup/initializeGTSRAClient';\nexport { createOrUpdateBrowserConditionStore } from './condition-store/createBrowserConditionStore';\nexport { parseLocale } from './functions/parseLocale';\nexport { useLocaleSelector } from './components/useLocaleSelector';\nexport { useRegionSelector } from './components/useRegionSelector';\n\n// ===== Components ===== //\nexport { LocaleSelector } from './components/LocaleSelector';\nexport { RegionSelector } from './components/RegionSelector';\nexport { BrowserGTProvider as GTProvider } from './provider/BrowserGTProvider';\n\n// ===== Components ===== //\nexport {\n Branch,\n Plural,\n Derive,\n GtInternalTranslateJsx,\n GtInternalVar,\n T,\n Currency,\n DateTime,\n RelativeTime,\n Var,\n Num,\n} from '@generaltranslation/react-core/components';\n\nexport async function Tx(_props: TxProps): Promise<ReactNode> {\n throw new Error('Tx is only supported via RSC');\n}\n\n// ===== Hooks ===== //\nexport {\n useLocale,\n useRegion,\n useCustomMapping,\n useDefaultLocale,\n useEnableI18n,\n useLocales,\n useFormatLocales,\n useGT,\n useMessages,\n useTranslations,\n useLocaleDirection,\n useLocaleProperties,\n useSetLocale,\n useSetRegion,\n useSetEnableI18n,\n} from '@generaltranslation/react-core/hooks';\n\n// ===== Functions ===== //\nexport {\n msg,\n decodeMsg,\n decodeOptions,\n derive,\n declareVar,\n decodeVars,\n mFallback,\n gtFallback,\n getFormatLocales,\n getDefaultLocale,\n getLocaleProperties,\n getLocales,\n resolveCanonicalLocale,\n getReactI18nCache,\n getTranslationsSnapshot,\n getVersionId,\n createRenderPipeline,\n setReactI18nCache,\n t,\n} from '@generaltranslation/react-core/pure';\n\nexport type {\n RenderPipeline,\n RenderPreparedT,\n} from '@generaltranslation/react-core/pure';\n\nexport type { SharedGTProviderProps } from './provider/GTProviderProps';\nexport {\n GtInternalRuntimeTranslateJsx,\n GtInternalRuntimeTranslateString,\n} from 'gt-i18n/internal';\nexport type {\n GTTranslationOptions,\n RuntimeTranslationOptions,\n} from 'gt-i18n/types';\nexport type {\n SyncResolutionFunction,\n SyncResolutionFunctionWithFallback,\n} from 'gt-i18n/types';\n\n// ===== Singletons ===== //\nexport {\n ReactI18nCache,\n type ReactI18nCacheParams,\n} from '@generaltranslation/react-core/pure';\n"],"mappings":";;;;;;;;AAiBA,IAAI;;;;AAcJ,IAAa,mBAAb,cAAsC,UAAuB;CAI3D,YAAY,QAAgC;EAG1C,MAAM,EAAE,gBAAgB,iBAAiB,GAAG,kBAAkB;EAC9D,MAAM,qBAAgD,EAAE;EACxD,MAAM,aAAaA,iBAAe;EAClC,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OACnB,GAAG,SAC6C;CAEhD,MAAM,EAAE,QAAQ,SAAS,YAAY,QAAQ,WAAW,cACtD,kBAAkB;EAChB,SAAS;EACT;EACA;EACA;EACD,CAAC;CAEJ,MAAM,gBAAgB,WAAmB;AACvC,MAAI,kBAAkB;GACpB,MAAM,eAAe,WAAW,IAAI,OAAO,EAAE;AAE7C,OAAI,gBAAgB,WAAW,aAAc,WAAU,aAAa;;AAEtE,YAAU,OAAO;;AAGnB,QACE,oBAAC,wBAAD;EACU;EACC;EACG;EACZ,WAAW;EACX,GAAI;EACJ,CAAA;;;;;;;;AC7CN,SAAgB,kBAAkB,OAA8B;CAC9D,MAAM,iBAAiB,cAAc;AACnC,SAAO,oCAAoC,MAAM;IAChD;EAAC,MAAM;EAAQ,MAAM;EAAQ,MAAM;EAAY,MAAM;EAAQ,CAAC;CAEjE,MAAM,eAAe,OAAyB,KAAK;AACnD,KAAI,aAAa,WAAW,KAC1B,cAAa,UAAU,IAAIC,aAAW;AAGxC,QACE,oBAAC,oBAAD;EACE,GAAI;EACY;EAChB,WAAW,aAAa;EACxB,CAAA;;;;ACKN,eAAsB,GAAG,QAAqC;AAC5D,OAAM,IAAI,MAAM,+BAA+B"}
|
package/dist/index.rsc.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { Branch, Currency, CurrencyProps, DateTime, DateTimeProps, Derive, GtInt
|
|
|
4
4
|
import { ReactI18nCache, ReactI18nCacheParams, RenderPipeline, RenderPreparedT, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getLocaleProperties, getLocales, getVersionId, gtFallback, internalInitializeGTSRA as initializeGT, mFallback, msg, resolveCanonicalLocale } from "@generaltranslation/react-core/pure";
|
|
5
5
|
import { InternalGTProviderProps } from "@generaltranslation/react-core/components";
|
|
6
6
|
import { GtInternalRuntimeTranslateJsx, GtInternalRuntimeTranslateString, WritableConditionStoreParams } from "gt-i18n/internal";
|
|
7
|
-
//#region ../format/dist/types-
|
|
7
|
+
//#region ../format/dist/types-CbRDetV3.d.cts
|
|
8
8
|
//#region src/locales/customLocaleMapping.d.ts
|
|
9
9
|
type CustomMapping = Record<string, string | Partial<LocaleProperties>>; //#endregion
|
|
10
10
|
//#region src/locales/getLocaleProperties.d.ts
|
package/dist/index.rsc.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.rsc.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../../format/dist/types-
|
|
1
|
+
{"version":3,"file":"index.rsc.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../../format/dist/types-CbRDetV3.d.cts","../src/functions/parseLocale.ts","../src/i18n-cache/types.ts","../src/condition-store/BrowserConditionStore.ts","../src/provider/GTProviderProps.ts","../src/index.rsc.ts"],"mappings":";;;;;;;;KACKA,aAAAA,GAAgBG,MAAAA,kBAAwBD,OAAAA,CAAQD,gBAAAA;AAAAA;AAAAA,KAGhDA,gBAAAA;EACHG,IAAAA;EACAC,IAAAA;EACAC,UAAAA;EACAC,YAAAA;EACAC,YAAAA;EACAC,kBAAAA;EACAC,kBAAAA;EACAC,wBAAAA;EACAC,UAAAA;EACAC,UAAAA;EACAC,gBAAAA;EACAC,UAAAA;EACAC,UAAAA;EACAC,gBAAAA;EACAC,aAAAA;EACAC,aAAAA;EACAC,mBAAAA;EACAC,aAAAA;EACAC,aAAAA;EACAC,mBAAAA;EACAC,KAAAA;AAAAA;AAAAA;;;KCtBG,kBAAA,GAAqB,IAAA,CAAK,OAAA;;;;;;;;;;;iBAYf,WAAA,CAAY,OAAA,EAAS,kBAAA;;;;;;KCZzB,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;KCQP,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;;;KAMrB,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UAAA;AAAA;;;;;;;;;KCnBA,qBAAA,GAAwB,IAAA,CAClC,uBAAA,oCAGA,IAAA,CAAK,2BAAA;EACH,MAAA;AAAA;;;iBCaY,UAAA,CAAA;AAAA,iBAGA,cAAA,CAAA;AAAA,iBAGA,cAAA,CAAA;AAAA,iBAoBA,KAAA,CAAA,GAAK,gBAAA,CAAA,kCAAA;AAAA,iBAGL,eAAA,CAAgB,MAAA,YAAD,gBAAA,CAAgB,aAAA;AAAA,iBAG/B,WAAA,CAAA,GAAW,gBAAA,CAAA,aAAA;AAAA,iBAGX,SAAA,CAAA;AAAA,iBAGA,SAAA,CAAA;AAAA,iBAGA,UAAA,CAAA;AAAA,iBAGA,kBAAA,CAAmB,MAAA;AAAA,iBAGnB,mBAAA,CAAoB,MAAA,WAAD,gBAAA;AAAA,iBAGnB,gBAAA,CAAA;AAAA,iBAGA,gBAAA,CAAA,GAAoB,aAAA"}
|
package/dist/index.rsc.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { Branch, Currency, CurrencyProps, DateTime, DateTimeProps, Derive, GtInt
|
|
|
4
4
|
import * as _$gt_i18n_types0 from "gt-i18n/types";
|
|
5
5
|
import { GTTranslationOptions, RuntimeTranslationOptions, SyncResolutionFunction, SyncResolutionFunctionWithFallback } from "gt-i18n/types";
|
|
6
6
|
import { InternalGTProviderProps } from "@generaltranslation/react-core/components";
|
|
7
|
-
//#region ../format/dist/types-
|
|
7
|
+
//#region ../format/dist/types-CbRDetV3.d.cts
|
|
8
8
|
//#region src/locales/customLocaleMapping.d.ts
|
|
9
9
|
type CustomMapping = Record<string, string | Partial<LocaleProperties>>; //#endregion
|
|
10
10
|
//#region src/locales/getLocaleProperties.d.ts
|
package/dist/index.rsc.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.rsc.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../../format/dist/types-
|
|
1
|
+
{"version":3,"file":"index.rsc.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../../format/dist/types-CbRDetV3.d.cts","../src/functions/parseLocale.ts","../src/i18n-cache/types.ts","../src/condition-store/BrowserConditionStore.ts","../src/provider/GTProviderProps.ts","../src/index.rsc.ts"],"mappings":";;;;;;;;KACKA,aAAAA,GAAgBG,MAAAA,kBAAwBD,OAAAA,CAAQD,gBAAAA;AAAAA;AAAAA,KAGhDA,gBAAAA;EACHG,IAAAA;EACAC,IAAAA;EACAC,UAAAA;EACAC,YAAAA;EACAC,YAAAA;EACAC,kBAAAA;EACAC,kBAAAA;EACAC,wBAAAA;EACAC,UAAAA;EACAC,UAAAA;EACAC,gBAAAA;EACAC,UAAAA;EACAC,UAAAA;EACAC,gBAAAA;EACAC,aAAAA;EACAC,aAAAA;EACAC,mBAAAA;EACAC,aAAAA;EACAC,aAAAA;EACAC,mBAAAA;EACAC,KAAAA;AAAAA;AAAAA;;;KCtBG,kBAAA,GAAqB,IAAA,CAAK,OAAA;;;;;;;;;;;iBAYf,WAAA,CAAY,OAAA,EAAS,kBAAA;;;;;;KCZzB,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;KCQP,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;;;KAMrB,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UAAA;AAAA;;;;;;;;;KCnBA,qBAAA,GAAwB,IAAA,CAClC,uBAAA,oCAGA,IAAA,CAAK,2BAAA;EACH,MAAA;AAAA;;;iBCaY,UAAA,CAAA;AAAA,iBAGA,cAAA,CAAA;AAAA,iBAGA,cAAA,CAAA;AAAA,iBAoBA,KAAA,CAAA,GAAK,gBAAA,CAAA,kCAAA;AAAA,iBAGL,eAAA,CAAgB,MAAA,YAAD,gBAAA,CAAgB,aAAA;AAAA,iBAG/B,WAAA,CAAA,GAAW,gBAAA,CAAA,aAAA;AAAA,iBAGX,SAAA,CAAA;AAAA,iBAGA,SAAA,CAAA;AAAA,iBAGA,UAAA,CAAA;AAAA,iBAGA,kBAAA,CAAmB,MAAA;AAAA,iBAGnB,mBAAA,CAAoB,MAAA,WAAD,gBAAA;AAAA,iBAGnB,gBAAA,CAAA;AAAA,iBAGA,gBAAA,CAAA,GAAoB,aAAA"}
|
package/dist/index.server.d.cts
CHANGED
|
@@ -144,7 +144,7 @@ type RequestWithHeaders = Pick<Request, 'headers'>;
|
|
|
144
144
|
*/
|
|
145
145
|
declare function parseLocale(request: RequestWithHeaders): string;
|
|
146
146
|
//#endregion
|
|
147
|
-
//#region ../format/dist/types-
|
|
147
|
+
//#region ../format/dist/types-CbRDetV3.d.cts
|
|
148
148
|
//#region src/locales/customLocaleMapping.d.ts
|
|
149
149
|
type CustomMapping = Record<string, string | Partial<LocaleProperties>>; //#endregion
|
|
150
150
|
//#region src/locales/getLocaleProperties.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.server.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/utils/TxProps.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-
|
|
1
|
+
{"version":3,"file":"index.server.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/utils/TxProps.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-CbRDetV3.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/provider/GTProviderProps.ts","../src/provider/ServerGTProvider.tsx","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/index.server.ts"],"mappings":";;;;;;;;;;;;;;KAGY,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;AFfjC;;KEqBY,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UAAA;AAAA;;;AFvBZ;cE6Ba,qBAAA,YAAiC,+BAAA;EAAA,QACpC,YAAA;EAAA,QACA,eAAA;EAAA,QACA,eAAA;EAAA,QACA,mBAAA;cAEI,MAAA,EAAQ,2BAAA;EAsBpB,SAAA;EAIA,SAAA,GAAa,MAAA,EAAQ,gBAAA;EASrB,SAAA;E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 type RequestWithHeaders = Pick<Request, 'headers'>;
|
|
|
144
144
|
*/
|
|
145
145
|
declare function parseLocale(request: RequestWithHeaders): string;
|
|
146
146
|
//#endregion
|
|
147
|
-
//#region ../format/dist/types-
|
|
147
|
+
//#region ../format/dist/types-CbRDetV3.d.cts
|
|
148
148
|
//#region src/locales/customLocaleMapping.d.ts
|
|
149
149
|
type CustomMapping = Record<string, string | Partial<LocaleProperties>>; //#endregion
|
|
150
150
|
//#region src/locales/getLocaleProperties.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.server.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/utils/TxProps.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-
|
|
1
|
+
{"version":3,"file":"index.server.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/utils/TxProps.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-CbRDetV3.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/provider/GTProviderProps.ts","../src/provider/ServerGTProvider.tsx","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/index.server.ts"],"mappings":";;;;;;;;;;;;;;KAGY,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;AFfjC;;KEqBY,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UAAA;AAAA;;;AFvBZ;cE6Ba,qBAAA,YAAiC,+BAAA;EAAA,QACpC,YAA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ajB,mCAAA,EAAqC,mCAAA;AAAA,iBAyB5B,EAAA,CAAG,MAAA,EAAQ,OAAA,GAAU,OAAA,CAAQ,SAAA"}
|
package/dist/index.types.d.cts
CHANGED
|
@@ -145,7 +145,7 @@ type RequestWithHeaders = Pick<Request, 'headers'>;
|
|
|
145
145
|
*/
|
|
146
146
|
declare function parseLocale(request: RequestWithHeaders): string;
|
|
147
147
|
//#endregion
|
|
148
|
-
//#region ../format/dist/types-
|
|
148
|
+
//#region ../format/dist/types-CbRDetV3.d.cts
|
|
149
149
|
//#region src/locales/customLocaleMapping.d.ts
|
|
150
150
|
type CustomMapping = Record<string, string | Partial<LocaleProperties>>; //#endregion
|
|
151
151
|
//#region src/locales/getLocaleProperties.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.types.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-
|
|
1
|
+
{"version":3,"file":"index.types.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-CbRDetV3.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.types.ts"],"mappings":";;;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UA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EAAQ,OAAA,GAAU,OAAA,CAAQ,SAAA"}
|
package/dist/index.types.d.mts
CHANGED
|
@@ -145,7 +145,7 @@ type RequestWithHeaders = Pick<Request, 'headers'>;
|
|
|
145
145
|
*/
|
|
146
146
|
declare function parseLocale(request: RequestWithHeaders): string;
|
|
147
147
|
//#endregion
|
|
148
|
-
//#region ../format/dist/types-
|
|
148
|
+
//#region ../format/dist/types-CbRDetV3.d.cts
|
|
149
149
|
//#region src/locales/customLocaleMapping.d.ts
|
|
150
150
|
type CustomMapping = Record<string, string | Partial<LocaleProperties>>; //#endregion
|
|
151
151
|
//#region src/locales/getLocaleProperties.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.types.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-
|
|
1
|
+
{"version":3,"file":"index.types.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-CbRDetV3.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.types.ts"],"mappings":";;;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;;AH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
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gt-react",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.7-iris.0",
|
|
4
4
|
"description": "A React library for automatic internationalization.",
|
|
5
5
|
"main": "./dist/index.server.cjs",
|
|
6
6
|
"module": "./dist/index.server.mjs",
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"react-dom": ">=18.0.0"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"generaltranslation": "9.1.
|
|
21
|
-
"@generaltranslation/react-core": "11.1.
|
|
22
|
-
"gt-i18n": "1.0.
|
|
20
|
+
"generaltranslation": "9.1.3-iris.0",
|
|
21
|
+
"@generaltranslation/react-core": "11.1.7-iris.0",
|
|
22
|
+
"gt-i18n": "1.0.13-iris.0"
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
26
|
"url": "git+https://github.com/generaltranslation/gt.git"
|
|
27
27
|
},
|
|
28
28
|
"author": "General Translation, Inc.",
|
|
29
|
-
"license": "
|
|
29
|
+
"license": "MIT",
|
|
30
30
|
"bugs": {
|
|
31
31
|
"url": "https://github.com/generaltranslation/gt/issues"
|
|
32
32
|
},
|