gt-react 10.20.4 → 11.0.0-odysseus.1

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +16 -18
  2. package/dist/index.client.cjs +1044 -0
  3. package/dist/index.client.cjs.map +1 -0
  4. package/dist/index.client.d.cts +302 -0
  5. package/dist/index.client.d.cts.map +1 -0
  6. package/dist/index.client.d.mts +302 -0
  7. package/dist/index.client.d.mts.map +1 -0
  8. package/dist/index.client.mjs +743 -0
  9. package/dist/index.client.mjs.map +1 -0
  10. package/dist/index.rsc.cjs +423 -0
  11. package/dist/index.rsc.cjs.map +1 -0
  12. package/dist/index.rsc.d.cts +96 -0
  13. package/dist/index.rsc.d.cts.map +1 -0
  14. package/dist/index.rsc.d.mts +96 -0
  15. package/dist/index.rsc.d.mts.map +1 -0
  16. package/dist/index.rsc.mjs +108 -0
  17. package/dist/index.rsc.mjs.map +1 -0
  18. package/dist/index.server.cjs +1072 -0
  19. package/dist/index.server.cjs.map +1 -0
  20. package/dist/index.server.d.cts +307 -0
  21. package/dist/index.server.d.cts.map +1 -0
  22. package/dist/index.server.d.mts +307 -0
  23. package/dist/index.server.d.mts.map +1 -0
  24. package/dist/index.server.mjs +765 -0
  25. package/dist/index.server.mjs.map +1 -0
  26. package/dist/index.types.cjs +1050 -0
  27. package/dist/index.types.cjs.map +1 -0
  28. package/dist/index.types.d.cts +303 -0
  29. package/dist/index.types.d.cts.map +1 -0
  30. package/dist/index.types.d.mts +303 -0
  31. package/dist/index.types.d.mts.map +1 -0
  32. package/dist/index.types.mjs +743 -0
  33. package/dist/index.types.mjs.map +1 -0
  34. package/dist/internal.cjs +4289 -974
  35. package/dist/internal.cjs.map +1 -1
  36. package/dist/internal.d.cts +859 -867
  37. package/dist/internal.d.cts.map +1 -1
  38. package/dist/internal.d.mts +859 -867
  39. package/dist/internal.d.mts.map +1 -1
  40. package/dist/internal.mjs +4255 -939
  41. package/dist/internal.mjs.map +1 -1
  42. package/dist/macros.cjs +2 -6028
  43. package/dist/macros.cjs.map +1 -1
  44. package/dist/macros.d.cts +2 -9
  45. package/dist/macros.d.cts.map +1 -1
  46. package/dist/macros.d.mts +2 -9
  47. package/dist/macros.d.mts.map +1 -1
  48. package/dist/macros.mjs +1 -6027
  49. package/dist/macros.mjs.map +1 -1
  50. package/package.json +43 -56
  51. package/dist/browser.cjs +0 -10741
  52. package/dist/browser.cjs.map +0 -1
  53. package/dist/browser.d.cts +0 -702
  54. package/dist/browser.d.cts.map +0 -1
  55. package/dist/browser.d.mts +0 -704
  56. package/dist/browser.d.mts.map +0 -1
  57. package/dist/browser.mjs +0 -10704
  58. package/dist/browser.mjs.map +0 -1
  59. package/dist/client.cjs +0 -3452
  60. package/dist/client.cjs.map +0 -1
  61. package/dist/client.d.cts +0 -248
  62. package/dist/client.d.cts.map +0 -1
  63. package/dist/client.d.mts +0 -249
  64. package/dist/client.d.mts.map +0 -1
  65. package/dist/client.mjs +0 -3393
  66. package/dist/client.mjs.map +0 -1
  67. package/dist/index.cjs +0 -3692
  68. package/dist/index.cjs.map +0 -1
  69. package/dist/index.d.cts +0 -377
  70. package/dist/index.d.cts.map +0 -1
  71. package/dist/index.d.mts +0 -376
  72. package/dist/index.d.mts.map +0 -1
  73. package/dist/index.mjs +0 -3637
  74. package/dist/index.mjs.map +0 -1
@@ -0,0 +1,1044 @@
1
+ "use client";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ let _generaltranslation_react_core_pure = require("@generaltranslation/react-core/pure");
4
+ let gt_i18n_internal = require("gt-i18n/internal");
5
+ require("@generaltranslation/react-core/components-rsc");
6
+ let react = require("react");
7
+ let _generaltranslation_react_core_hooks = require("@generaltranslation/react-core/hooks");
8
+ let _generaltranslation_react_core_components = require("@generaltranslation/react-core/components");
9
+ let react_jsx_runtime = require("react/jsx-runtime");
10
+ //#region src/i18n-cache/constants.ts
11
+ const DEFAULT_HTML_TAG_OPTIONS = {
12
+ updateHtmlLangTag: true,
13
+ updateHtmlDirTag: true
14
+ };
15
+ //#endregion
16
+ //#region src/i18n-cache/LocalStorageTranslationCache.ts
17
+ const STORAGE_KEY_PREFIX = "gt:tx:";
18
+ const PURGE_TIMESTAMP_PREFIX = "gt:tx:purge:";
19
+ const FLUSH_INTERVAL = 500;
20
+ const DEFAULT_MAX_SIZE = 1e6;
21
+ const DEFAULT_TTL_MS = 864e5;
22
+ const DEFAULT_PURGE_INTERVAL_MS = 3e5;
23
+ const PURGE_TARGET_RATIO = .8;
24
+ const activeIntervals = /* @__PURE__ */ new Map();
25
+ /**
26
+ * A localStorage-backed translation cache for a single locale.
27
+ * Used in development mode only to persist runtime translations across page refreshes.
28
+ *
29
+ * Entries are stored with per-entry expiry timestamps and the cache is purged
30
+ * when estimated size exceeds the configured maximum.
31
+ */
32
+ var LocalStorageTranslationCache = class {
33
+ /**
34
+ * @param locale - The locale this cache is for
35
+ * @param projectId - The project id (namespaces localStorage keys)
36
+ * @param init - Optional initial translations to merge on top of localStorage data.
37
+ * init values take priority over stale localStorage entries.
38
+ * @param maxSize - Maximum cache size in characters (default: ~1M)
39
+ * @param ttl - TTL in milliseconds for each entry (default: 24 hours)
40
+ * @param purgeInterval - Background purge check interval in ms (default: 5 min)
41
+ */
42
+ constructor({ locale, projectId, init, maxSize, ttl, purgeInterval }) {
43
+ this._writeBuffer = {};
44
+ this._flushTimer = null;
45
+ this._estimatedSize = 0;
46
+ this._storageKey = `${STORAGE_KEY_PREFIX}${projectId}:${locale}`;
47
+ this._purgeTimestampKey = `${PURGE_TIMESTAMP_PREFIX}${projectId}:${locale}`;
48
+ this._maxSize = maxSize ?? DEFAULT_MAX_SIZE;
49
+ this._ttl = ttl ?? DEFAULT_TTL_MS;
50
+ this._purgeInterval = purgeInterval ?? DEFAULT_PURGE_INTERVAL_MS;
51
+ if (init) this.initStorage(init);
52
+ if (activeIntervals.has(this._storageKey)) clearInterval(activeIntervals.get(this._storageKey));
53
+ const intervalId = setInterval(() => this._backgroundPurge(), this._purgeInterval);
54
+ activeIntervals.set(this._storageKey, intervalId);
55
+ }
56
+ /**
57
+ * Returns the full translation map (cache + pending buffer writes).
58
+ * Filters out expired entries. Buffer entries take priority.
59
+ */
60
+ getInternalCache() {
61
+ const now = Date.now();
62
+ const cache = this._readFromStorage();
63
+ const result = {};
64
+ for (const [key, entry] of Object.entries(cache)) if (entry.exp > now) result[key] = entry.t;
65
+ Object.assign(result, this._writeBuffer);
66
+ return result;
67
+ }
68
+ /**
69
+ * Queue a translation for writing to localStorage.
70
+ * Writes are batched via a debounced flush.
71
+ */
72
+ write(hash, translation) {
73
+ this._writeBuffer[hash] = translation;
74
+ this._scheduleFlush();
75
+ }
76
+ /**
77
+ * Remove specific entries from the cache by hash.
78
+ */
79
+ purge(hashes) {
80
+ const cache = this._readFromStorage();
81
+ for (const hash of hashes) delete cache[hash];
82
+ this._writeRaw(JSON.stringify(cache));
83
+ }
84
+ /**
85
+ * Schedule a flush of the write buffer.
86
+ * Uses a leading throttle — the first write in a burst schedules a flush
87
+ * after FLUSH_INTERVAL ms; subsequent writes before the timer fires are
88
+ * batched into the same flush.
89
+ */
90
+ _scheduleFlush() {
91
+ if (this._flushTimer) return;
92
+ this._flushTimer = setTimeout(() => {
93
+ this._flushTimer = null;
94
+ this._flush();
95
+ }, FLUSH_INTERVAL);
96
+ }
97
+ /**
98
+ * Merge the write buffer into the cache and persist to localStorage.
99
+ * Purges before writing if estimated size exceeds max.
100
+ */
101
+ _flush() {
102
+ if (Object.keys(this._writeBuffer).length === 0) return;
103
+ try {
104
+ const cache = this._readFromStorage();
105
+ const now = Date.now();
106
+ if (this._estimatedSize > this._maxSize) this._purgeCache(cache, now);
107
+ const exp = now + this._ttl;
108
+ for (const [key, value] of Object.entries(this._writeBuffer)) cache[key] = {
109
+ t: value,
110
+ exp
111
+ };
112
+ this._writeRaw(JSON.stringify(cache));
113
+ } catch {}
114
+ this._writeBuffer = {};
115
+ }
116
+ /**
117
+ * Purge entries from the cache in place.
118
+ * Phase 1: Remove expired entries.
119
+ * Phase 2: If still over target, drop oldest entries by expiry time.
120
+ */
121
+ _purgeCache(cache, now) {
122
+ const keysBeforePurge = Object.keys(cache);
123
+ if (keysBeforePurge.length === 0) return;
124
+ const avgEntrySize = this._estimatedSize / keysBeforePurge.length;
125
+ deleteExpiredEntries(cache, now);
126
+ const targetSize = this._maxSize * PURGE_TARGET_RATIO;
127
+ const maxEntries = Math.floor(targetSize / avgEntrySize);
128
+ const remaining = Object.entries(cache);
129
+ if (remaining.length > maxEntries) {
130
+ remaining.sort((a, b) => a[1].exp - b[1].exp);
131
+ const toDrop = remaining.length - maxEntries;
132
+ for (let i = 0; i < toDrop; i++) delete cache[remaining[i][0]];
133
+ }
134
+ }
135
+ /**
136
+ * Background purge triggered by setInterval.
137
+ * Checks the last purge timestamp to avoid redundant work across tabs,
138
+ * then removes expired entries. Only writes back if something changed.
139
+ * Timestamp is updated after the purge completes.
140
+ */
141
+ _backgroundPurge() {
142
+ try {
143
+ const raw = localStorage.getItem(this._purgeTimestampKey);
144
+ const lastPurge = raw ? parseInt(raw, 10) : 0;
145
+ const now = Date.now();
146
+ if (now - lastPurge < this._purgeInterval) return;
147
+ const cache = this._readFromStorage();
148
+ const keysBefore = Object.keys(cache).length;
149
+ deleteExpiredEntries(cache, now);
150
+ if (Object.keys(cache).length < keysBefore) this._writeRaw(JSON.stringify(cache));
151
+ localStorage.setItem(this._purgeTimestampKey, String(now));
152
+ } catch {}
153
+ }
154
+ /**
155
+ * Read and parse translations from localStorage.
156
+ * Recalibrates estimated size as a side effect.
157
+ * Returns empty object on any error (unavailable, corrupt data, etc.)
158
+ */
159
+ _readFromStorage() {
160
+ try {
161
+ const raw = localStorage.getItem(this._storageKey);
162
+ if (!raw) {
163
+ this._estimatedSize = 0;
164
+ return {};
165
+ }
166
+ this._estimatedSize = raw.length;
167
+ return JSON.parse(raw);
168
+ } catch {
169
+ this._estimatedSize = 0;
170
+ return {};
171
+ }
172
+ }
173
+ /**
174
+ * Persist new entries to localStorage with expiry timestamps.
175
+ * Reads current cache, merges buffer on top, writes back.
176
+ */
177
+ initStorage(buffer) {
178
+ try {
179
+ const cache = this._readFromStorage();
180
+ const exp = Date.now() + this._ttl;
181
+ for (const [key, value] of Object.entries(buffer)) cache[key] = {
182
+ t: value,
183
+ exp
184
+ };
185
+ this._writeRaw(JSON.stringify(cache));
186
+ } catch {}
187
+ }
188
+ /**
189
+ * Write a pre-serialized string to localStorage and recalibrate estimate.
190
+ */
191
+ _writeRaw(serialized) {
192
+ try {
193
+ localStorage.setItem(this._storageKey, serialized);
194
+ this._estimatedSize = serialized.length;
195
+ } catch {}
196
+ }
197
+ };
198
+ /**
199
+ * Helper function deletes expired entries from a cache in place.
200
+ */
201
+ function deleteExpiredEntries(cache, now = Date.now()) {
202
+ for (const key of Object.keys(cache)) if (cache[key].exp <= now) delete cache[key];
203
+ }
204
+ //#endregion
205
+ //#region ../core/dist/base64-r7YWJYWt.mjs
206
+ function ensureSentence(text) {
207
+ const trimmed = text.trim();
208
+ if (!trimmed) return "";
209
+ return /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;
210
+ }
211
+ function stripSentence(text) {
212
+ const trimmed = text.trim();
213
+ let end = trimmed.length;
214
+ while (end > 0) {
215
+ const char = trimmed[end - 1];
216
+ if (char !== "." && char !== "!" && char !== "?") break;
217
+ end -= 1;
218
+ }
219
+ return trimmed.slice(0, end);
220
+ }
221
+ function lowercaseFirstWord(text) {
222
+ return text.replace(/^[A-Z][a-z]/, (match) => match.toLowerCase());
223
+ }
224
+ function formatDetails(details) {
225
+ if (!details) return "";
226
+ const detailText = Array.isArray(details) ? details.join(", ") : details;
227
+ if (!detailText.trim()) return "";
228
+ return ensureSentence(`Details: ${detailText}`);
229
+ }
230
+ function createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {
231
+ const prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : "";
232
+ const whatAndWhy = why ? `${stripSentence(whatHappened)} because ${lowercaseFirstWord(stripSentence(why))}` : whatHappened;
233
+ const shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));
234
+ const messageParts = [
235
+ whatAndWhy,
236
+ reassurance,
237
+ shouldCombineWayOut ? `${stripSentence(fix)}, or ${lowercaseFirstWord(stripSentence(wayOut))}` : fix,
238
+ shouldCombineWayOut ? void 0 : wayOut,
239
+ formatDetails(details)
240
+ ].filter((part) => !!part).map(ensureSentence);
241
+ if (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);
242
+ const message = messageParts.join(" ");
243
+ return prefix ? `${prefix} ${message}` : message;
244
+ }
245
+ //#endregion
246
+ //#region src/i18n-cache/BrowserI18nCache.ts
247
+ /**
248
+ * I18nCache implementation for Browser.
249
+ */
250
+ var BrowserI18nCache = class extends gt_i18n_internal.I18nCache {
251
+ constructor(config) {
252
+ const { htmlTagOptions, ...managerConfig } = config;
253
+ const localStorageCaches = {};
254
+ const i18nConfig = (0, gt_i18n_internal.getI18nConfig)();
255
+ const devHotReloadEnabled = !!config.loadTranslations && i18nConfig.isDevHotReloadEnabled();
256
+ const projectId = i18nConfig.getProjectId();
257
+ const loadTranslations = devHotReloadEnabled ? wrapLoaderWithLocalStorage(config.loadTranslations, projectId, localStorageCaches) : config.loadTranslations;
258
+ super({
259
+ ...managerConfig,
260
+ loadTranslations
261
+ });
262
+ this._devHotReloadJsx = false;
263
+ this._localStorageCaches = localStorageCaches;
264
+ this._devHotReloadJsx = devHotReloadEnabled;
265
+ this.htmlTagOptions = {
266
+ ...DEFAULT_HTML_TAG_OPTIONS,
267
+ ...htmlTagOptions
268
+ };
269
+ if (devHotReloadEnabled) this.subscribe("translations-cache-miss", ({ locale, hash, translation }) => {
270
+ const cache = localStorageCaches[locale];
271
+ if (cache) cache.write(hash, translation);
272
+ else localStorageCaches[locale] = new LocalStorageTranslationCache({
273
+ locale,
274
+ projectId,
275
+ init: { [hash]: translation }
276
+ });
277
+ });
278
+ }
279
+ /**
280
+ * Whether dev hot reload JSX (Suspense-based <T>) is active
281
+ */
282
+ isDevHotReloadJsx() {
283
+ return this._devHotReloadJsx;
284
+ }
285
+ /**
286
+ * Get or create a LocalStorageTranslationCache for the given locale.
287
+ * Instances are lazily created and cached per locale.
288
+ * Returns undefined if not in development mode.
289
+ */
290
+ getLocalStorageTranslationCache(locale, init) {
291
+ if (!{}?.DEV) return void 0;
292
+ if (!this._localStorageCaches[locale]) this._localStorageCaches[locale] = new LocalStorageTranslationCache({
293
+ locale,
294
+ projectId: this.config.projectId,
295
+ init
296
+ });
297
+ return this._localStorageCaches[locale];
298
+ }
299
+ /**
300
+ * Update the html tag (lang, dir)
301
+ *
302
+ * @deprecated, TODO: we should use a different system for managing this html tag
303
+ * this should just be for managing translations
304
+ */
305
+ updateHtmlTag(locale, htmlTagOptions) {
306
+ const htmlLocale = htmlTagOptions?.lang || locale;
307
+ const i18nConfig = (0, gt_i18n_internal.getI18nConfig)();
308
+ const canonicalLocale = i18nConfig.resolveCanonicalLocale(htmlLocale);
309
+ if (!i18nConfig.isValidLocale(canonicalLocale)) {
310
+ console.warn(createInvalidLocaleWarning(htmlLocale));
311
+ return;
312
+ }
313
+ const localeDirection = htmlTagOptions?.dir || i18nConfig.getLocaleDirection(canonicalLocale);
314
+ const mergedHtmlTagOptions = {
315
+ ...this.htmlTagOptions,
316
+ ...htmlTagOptions
317
+ };
318
+ if (mergedHtmlTagOptions.updateHtmlLangTag) document.documentElement.lang = canonicalLocale;
319
+ if (mergedHtmlTagOptions.updateHtmlDirTag) document.documentElement.dir = localeDirection;
320
+ }
321
+ };
322
+ /**
323
+ * Wraps a translation loader to merge localStorage translations in dev mode.
324
+ * On each call: runs the original loader, seeds a LocalStorageTranslationCache
325
+ * with the result (loader wins over stale localStorage), and returns the merged
326
+ * translations — preserving runtime tx() translations from previous sessions.
327
+ *
328
+ * TODO: this should be moved to wrapping in I18nStore
329
+ */
330
+ function wrapLoaderWithLocalStorage(originalLoader, projectId, localStorageCaches) {
331
+ return async (locale) => {
332
+ const loaderTranslations = await originalLoader(locale);
333
+ localStorageCaches[locale] ||= new LocalStorageTranslationCache({
334
+ locale,
335
+ projectId,
336
+ init: loaderTranslations
337
+ });
338
+ return localStorageCaches[locale].getInternalCache();
339
+ };
340
+ }
341
+ const createInvalidLocaleWarning = (locale) => createDiagnosticMessage({
342
+ source: "gt-react",
343
+ severity: "Warning",
344
+ whatHappened: `Locale "${locale}" is not valid`,
345
+ fix: "Use a valid BCP 47 locale code or add a custom mapping"
346
+ });
347
+ //#endregion
348
+ //#region src/condition-store/cookies.ts
349
+ /**
350
+ * Minimally parses a cookie value for a given cookie name
351
+ * @param cookieName - The name of the cookie
352
+ * @returns The locale from the cookie or undefined if not found or invalid
353
+ */
354
+ function getCookieValue({ cookieName }) {
355
+ if (typeof document === "undefined") return void 0;
356
+ return document.cookie.split("; ").find((row) => row.startsWith(`${cookieName}=`))?.split("=")[1];
357
+ }
358
+ /**
359
+ * Sets a cookie value for a given cookie name
360
+ * @param cookieName - The name of the cookie
361
+ * @param value - The value to set
362
+ * @returns The value that was set
363
+ */
364
+ function setCookieValue({ cookieName, value }) {
365
+ if (typeof document === "undefined") return;
366
+ document.cookie = `${cookieName}=${value};path=/`;
367
+ }
368
+ //#endregion
369
+ //#region src/condition-store/readBrowserLocale.ts
370
+ function readBrowserLocale(localeCookieName) {
371
+ const candidates = [];
372
+ const cookieLocale = getCookieValue({ cookieName: localeCookieName });
373
+ if (cookieLocale) candidates.push(cookieLocale);
374
+ const navigatorLocales = navigator?.languages || [];
375
+ candidates.push(...navigatorLocales);
376
+ return candidates;
377
+ }
378
+ //#endregion
379
+ //#region src/cookie-names.ts
380
+ /**
381
+ * Cookie name for tracking the user's selected locale.
382
+ */
383
+ const defaultLocaleCookieName = "generaltranslation.locale";
384
+ /**
385
+ * Cookie name for tracking the user's selected region.
386
+ */
387
+ const defaultRegionCookieName = "generaltranslation.region";
388
+ /**
389
+ * Cookie name for persisting the enableI18n feature flag.
390
+ */
391
+ const defaultEnableI18nCookieName = "generaltranslation.enable-i18n";
392
+ /**
393
+ * Cookie name for tracking the locale reset
394
+ * Used by gt-next middleware
395
+ *
396
+ * TODO: remove this cookie when come up with better solution
397
+ */
398
+ const defaultResetLocaleCookieName = "generaltranslation.locale-reset";
399
+ //#endregion
400
+ //#region src/condition-store/BrowserConditionStore.ts
401
+ /**
402
+ * Condition store implementation for Browser.
403
+ */
404
+ var BrowserConditionStore = class {
405
+ constructor(config) {
406
+ this.getLocale = () => {
407
+ return getBrowserLocale(this.localeCookieName, this.customGetLocale);
408
+ };
409
+ this.setLocale = (locale) => {
410
+ this.updateLocale(locale);
411
+ setCookieValue({
412
+ cookieName: defaultResetLocaleCookieName,
413
+ value: "true"
414
+ });
415
+ this.reload();
416
+ };
417
+ this.getRegion = () => {
418
+ const cookieRegion = getCookieValue({ cookieName: this.regionCookieName });
419
+ if (cookieRegion) return cookieRegion;
420
+ return this.customGetRegion?.();
421
+ };
422
+ this.setRegion = (region) => {
423
+ this.updateRegion(region);
424
+ this.reload();
425
+ };
426
+ this.getEnableI18n = () => {
427
+ const cookieEnableI18n = getCookieValue({ cookieName: this.enableI18nCookieName });
428
+ if (cookieEnableI18n === void 0) return this.customGetEnableI18n?.() ?? true;
429
+ return cookieEnableI18n === "true";
430
+ };
431
+ this.setEnableI18n = (enableI18n) => {
432
+ this.updateEnableI18n(enableI18n);
433
+ this.reload();
434
+ };
435
+ this.updateLocale = (locale) => {
436
+ const i18nConfig = (0, gt_i18n_internal.getI18nConfig)();
437
+ setCookieValue({
438
+ cookieName: this.localeCookieName,
439
+ value: i18nConfig.determineLocale(locale) || i18nConfig.getDefaultLocale()
440
+ });
441
+ };
442
+ this.updateRegion = (region) => {
443
+ setCookieValue({
444
+ cookieName: this.regionCookieName,
445
+ value: region ?? ""
446
+ });
447
+ };
448
+ this.updateEnableI18n = (enableI18n) => {
449
+ setCookieValue({
450
+ cookieName: this.enableI18nCookieName,
451
+ value: enableI18n ? "true" : "false"
452
+ });
453
+ };
454
+ this.reload = () => {
455
+ const state = {
456
+ locale: this.getLocale(),
457
+ region: this.getRegion(),
458
+ enableI18n: this.getEnableI18n()
459
+ };
460
+ this.customReload(state);
461
+ };
462
+ this.customReload = config._reload ?? (() => typeof window !== "undefined" ? window.location.reload() : void 0);
463
+ this.customGetLocale = config._getLocale;
464
+ this.customGetRegion = config._getRegion;
465
+ this.customGetEnableI18n = config._getEnableI18n;
466
+ this.localeCookieName = config.localeCookieName ?? "generaltranslation.locale";
467
+ this.regionCookieName = config.regionCookieName ?? "generaltranslation.region";
468
+ this.enableI18nCookieName = config.enableI18nCookieName ?? "generaltranslation.enable-i18n";
469
+ const i18nConfig = (0, gt_i18n_internal.getI18nConfig)();
470
+ setCookieValue({
471
+ cookieName: this.localeCookieName,
472
+ value: i18nConfig.determineLocale(config.locale) || i18nConfig.getDefaultLocale()
473
+ });
474
+ if (config.region !== void 0) setCookieValue({
475
+ cookieName: this.regionCookieName,
476
+ value: config.region
477
+ });
478
+ this.updateEnableI18n(config.enableI18n ?? true);
479
+ }
480
+ };
481
+ function getBrowserLocale(cookieName, getLocale) {
482
+ const candidates = readBrowserLocale(cookieName);
483
+ if (getLocale) candidates.push(getLocale());
484
+ const i18nConfig = (0, gt_i18n_internal.getI18nConfig)();
485
+ return i18nConfig.determineLocale(candidates) || i18nConfig.getDefaultLocale();
486
+ }
487
+ //#endregion
488
+ //#region src/internal.ts
489
+ /**
490
+ * @deprecated gt-react/internal is deprecated. Use public gt-react exports instead.
491
+ */
492
+ const defaultEnableI18nCookieName$1 = defaultEnableI18nCookieName;
493
+ /**
494
+ * @deprecated gt-react/internal is deprecated. Use public gt-react exports instead.
495
+ */
496
+ const defaultLocaleCookieName$1 = defaultLocaleCookieName;
497
+ /**
498
+ * @deprecated gt-react/internal is deprecated. Use public gt-react exports instead.
499
+ */
500
+ const defaultRegionCookieName$1 = defaultRegionCookieName;
501
+ //#endregion
502
+ //#region src/condition-store/singleton-operations.ts
503
+ const { setConditionStore: setReadonlyConditionStore, isConditionStoreInitialized: isReadonlyConditionStoreInitialized } = (0, gt_i18n_internal.createConditionStoreSingleton)("ReadonlyConditionStore is not initialized.");
504
+ const { getConditionStore: getBrowserConditionStore, setConditionStore: setBrowserConditionStore, isConditionStoreInitialized: isBrowserConditionStoreInitialized } = (0, gt_i18n_internal.createConditionStoreSingleton)("BrowserConditionStore is not initialized.");
505
+ //#endregion
506
+ //#region src/condition-store/createBrowserConditionStore.ts
507
+ /**
508
+ * Factory to create a BrowserConditionStore for Singleton
509
+ *
510
+ * This exists so we can keep the locale param as required in the constructor
511
+ *
512
+ * We want the values that we read from the cookies to override as this
513
+ * persists state across page reloads
514
+ */
515
+ function createOrUpdateBrowserConditionStore(config) {
516
+ const locale = determineLocale(config);
517
+ const region = determineRegion(config);
518
+ const enableI18n = determineEnableI18n(config);
519
+ if (isBrowserConditionStoreInitialized()) {
520
+ const conditionStore = getBrowserConditionStore();
521
+ conditionStore.updateLocale(locale);
522
+ if (region !== void 0) conditionStore.updateRegion(region);
523
+ conditionStore.updateEnableI18n(enableI18n);
524
+ return conditionStore;
525
+ }
526
+ const conditionStore = new BrowserConditionStore({
527
+ ...config,
528
+ localeCookieName: defaultLocaleCookieName$1,
529
+ regionCookieName: defaultRegionCookieName$1,
530
+ enableI18nCookieName: defaultEnableI18nCookieName$1,
531
+ locale,
532
+ region,
533
+ enableI18n
534
+ });
535
+ setBrowserConditionStore(conditionStore);
536
+ return conditionStore;
537
+ }
538
+ function determineLocale({ localeCookieName = defaultLocaleCookieName$1, _getLocale: getLocale, locale }) {
539
+ const candidates = [];
540
+ candidates.push(...readBrowserLocale(localeCookieName));
541
+ if (locale) candidates.push(...locale);
542
+ if (getLocale) candidates.push(getLocale());
543
+ return resolveLocale(candidates);
544
+ }
545
+ function resolveLocale(candidates) {
546
+ const i18nConfig = (0, gt_i18n_internal.getI18nConfig)();
547
+ return i18nConfig.determineLocale(candidates) || i18nConfig.getDefaultLocale();
548
+ }
549
+ function determineRegion({ regionCookieName = defaultRegionCookieName$1, _getRegion: getRegion, region }) {
550
+ return getCookieValue({ cookieName: regionCookieName }) || getRegion?.() || region;
551
+ }
552
+ function determineEnableI18n({ enableI18n, enableI18nCookieName = defaultEnableI18nCookieName$1, _getEnableI18n: getEnableI18n }) {
553
+ const cookieEnableI18n = getCookieValue({ cookieName: enableI18nCookieName });
554
+ if (cookieEnableI18n === void 0) return getEnableI18n?.() ?? enableI18n ?? true;
555
+ return cookieEnableI18n === "true";
556
+ }
557
+ //#endregion
558
+ //#region src/setup/initializeGTSPA.ts
559
+ /**
560
+ * Initialize GT for an SPA
561
+ * - i18nCache
562
+ * - conditionStore
563
+ * - i18nStore
564
+ *
565
+ * This is SPA for browser runtime
566
+ */
567
+ async function initializeGTSPA(config) {
568
+ (0, gt_i18n_internal.setupGTServicesEnabled)(config);
569
+ (0, _generaltranslation_react_core_pure.initializeI18nConfig)(config, "SPA");
570
+ (0, _generaltranslation_react_core_pure.setReactI18nCache)(new BrowserI18nCache(config));
571
+ createOrUpdateBrowserConditionStore(config);
572
+ (0, _generaltranslation_react_core_pure.setI18nStore)(new _generaltranslation_react_core_pure.I18nStore());
573
+ await (0, _generaltranslation_react_core_pure.getTranslationsSnapshot)((0, _generaltranslation_react_core_pure.getReadonlyConditionStoreWithFallback)().getLocale());
574
+ }
575
+ //#endregion
576
+ //#region src/hooks/conditions-store.ts
577
+ /**
578
+ * Returns a function that sets the locale
579
+ */
580
+ function useSetLocale() {
581
+ const conditionStore = (0, _generaltranslation_react_core_hooks.useConditionStore)();
582
+ return (0, react.useCallback)((locale) => {
583
+ conditionStore.setLocale(locale);
584
+ }, [conditionStore]);
585
+ }
586
+ /**
587
+ * Returns a function that sets the region
588
+ */
589
+ function useSetRegion() {
590
+ const conditionStore = (0, _generaltranslation_react_core_hooks.useConditionStore)();
591
+ return (0, react.useCallback)((region) => {
592
+ conditionStore.setRegion(region);
593
+ }, [conditionStore]);
594
+ }
595
+ /**
596
+ * Returns a function that sets the enableI18n flag in the condition store.
597
+ */
598
+ function useSetEnableI18n() {
599
+ const conditionStore = (0, _generaltranslation_react_core_hooks.useConditionStore)();
600
+ return (0, react.useCallback)((enableI18n) => {
601
+ conditionStore.setEnableI18n(enableI18n);
602
+ }, [conditionStore]);
603
+ }
604
+ //#endregion
605
+ //#region src/components/useLocaleSelector.ts
606
+ /**
607
+ * Gets the list of properties for using a locale selector.
608
+ * Provides locale management utilities for the application.
609
+ *
610
+ * @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.
611
+ *
612
+ * @returns {Object} An object containing locale-related utilities:
613
+ * @returns {string} return.locale - The currently selected locale.
614
+ * @returns {string[]} return.locales - The list of all available locales.
615
+ * @returns {function} return.setLocale - Function to update the current locale.
616
+ * @returns {(locale: string) => LocaleProperties} return.getLocaleProperties - Function to retrieve properties for a given locale.
617
+ */
618
+ function useLocaleSelector(locales) {
619
+ return {
620
+ setLocale: useSetLocale(),
621
+ ...(0, _generaltranslation_react_core_hooks.useInternalLocaleSelector)(locales)
622
+ };
623
+ }
624
+ //#endregion
625
+ //#region src/components/useRegionSelector.ts
626
+ /**
627
+ * Gets the list of properties for using a region selector.
628
+ * Provides region management utilities for the application.
629
+ *
630
+ * @param {Object} [options] - Optional configuration object.
631
+ * @param {string[]} [options.regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from supported locales.
632
+ * @param {Object} [options.customMapping] - Optional mapping to override region display names, emojis, or associated locales.
633
+ * @param {boolean} [options.prioritizeCurrentLocaleRegion=true] - If true, the region corresponding to the current locale is prioritized in the list.
634
+ * @param {boolean} [options.sortRegionsAlphabetically=true] - If true, regions are sorted alphabetically by display name.
635
+ *
636
+ * @returns {Object} An object containing region-related utilities:
637
+ * @returns {string | undefined} return.region - The currently selected region code.
638
+ * @returns {function} return.setRegion - Function to update the current region.
639
+ * @returns {string[]} return.regions - The ordered list of available region codes.
640
+ * @returns {Map<string, RegionData>} return.regionData - Map of region codes to their display data (name, emoji, locale).
641
+ * @returns {string} return.locale - The current locale.
642
+ * @returns {function} return.setLocale - Function to update the current locale.
643
+ */
644
+ function useRegionSelector(options) {
645
+ return {
646
+ setRegion: useSetRegion(),
647
+ setLocale: useSetLocale(),
648
+ ...(0, _generaltranslation_react_core_hooks.useInternalRegionSelector)(options)
649
+ };
650
+ }
651
+ //#endregion
652
+ //#region src/components/LocaleSelector.tsx
653
+ /**
654
+ * A dropdown component that allows users to select a locale.
655
+ * @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.
656
+ * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.
657
+ * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.
658
+ * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.
659
+ */
660
+ function LocaleSelector({ locales: _locales, ...props }) {
661
+ const { locale, locales, getLocaleProperties, setLocale } = useLocaleSelector(_locales);
662
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_generaltranslation_react_core_components.InternalLocaleSelector, {
663
+ locale,
664
+ locales,
665
+ setLocale,
666
+ getLocaleProperties,
667
+ ...props
668
+ });
669
+ }
670
+ //#endregion
671
+ //#region src/components/RegionSelector.tsx
672
+ /**
673
+ * A dropdown component that allows users to select a region.
674
+ * @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.
675
+ * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.
676
+ * @param {object} [customMapping] - An optional object to map region codes to custom display names, emojis, or associated locales.
677
+ * @param {boolean} [prioritizeCurrentLocaleRegion] - If true, the region corresponding to the current locale is prioritized in the list.
678
+ * @param {boolean} [sortRegionsAlphabetically] - If true, regions are sorted alphabetically by display name.
679
+ * @param {boolean} [asLocaleSelector=false] - If true, selecting a region will also update the locale to the region's associated locale.
680
+ * @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.
681
+ *
682
+ * @example
683
+ * ```tsx
684
+ * <RegionSelector
685
+ * regions={['US', 'CA']}
686
+ * customMapping={{ US: { name: "United States", emoji: "🇺🇸" } }}
687
+ * placeholder="Select a region"
688
+ * />
689
+ * ```
690
+ */
691
+ function RegionSelector({ regions: _regions, customMapping, prioritizeCurrentLocaleRegion, sortRegionsAlphabetically, asLocaleSelector = false, ...props }) {
692
+ const { region, regions, regionData, locale, setRegion, setLocale } = useRegionSelector({
693
+ regions: _regions,
694
+ customMapping,
695
+ prioritizeCurrentLocaleRegion,
696
+ sortRegionsAlphabetically
697
+ });
698
+ const changeRegion = (region) => {
699
+ if (asLocaleSelector) {
700
+ const regionLocale = regionData.get(region)?.locale;
701
+ if (regionLocale && locale !== regionLocale) setLocale(regionLocale);
702
+ }
703
+ setRegion(region);
704
+ };
705
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_generaltranslation_react_core_components.InternalRegionSelector, {
706
+ region,
707
+ regions,
708
+ regionData,
709
+ setRegion: changeRegion,
710
+ ...props
711
+ });
712
+ }
713
+ //#endregion
714
+ //#region src/provider/BrowserGTProvider.tsx
715
+ /**
716
+ * Consumes snapshot from server
717
+ * Implementation for client-side only
718
+ */
719
+ function BrowserGTProvider(props) {
720
+ const conditionStore = (0, react.useMemo)(() => {
721
+ return createOrUpdateBrowserConditionStore(props);
722
+ }, [
723
+ props.locale,
724
+ props.region,
725
+ props.enableI18n,
726
+ props._reload
727
+ ]);
728
+ const i18nStoreRef = (0, react.useRef)(null);
729
+ if (i18nStoreRef.current == null) i18nStoreRef.current = new _generaltranslation_react_core_components.I18nStore();
730
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_generaltranslation_react_core_components.InternalGTProvider, {
731
+ ...props,
732
+ conditionStore,
733
+ i18nStore: i18nStoreRef.current
734
+ });
735
+ }
736
+ //#endregion
737
+ //#region src/index.client.ts
738
+ async function Tx(_props) {
739
+ throw new Error("Tx is only supported via RSC");
740
+ }
741
+ //#endregion
742
+ Object.defineProperty(exports, "Branch", {
743
+ enumerable: true,
744
+ get: function() {
745
+ return _generaltranslation_react_core_components.Branch;
746
+ }
747
+ });
748
+ Object.defineProperty(exports, "Currency", {
749
+ enumerable: true,
750
+ get: function() {
751
+ return _generaltranslation_react_core_components.Currency;
752
+ }
753
+ });
754
+ Object.defineProperty(exports, "DateTime", {
755
+ enumerable: true,
756
+ get: function() {
757
+ return _generaltranslation_react_core_components.DateTime;
758
+ }
759
+ });
760
+ Object.defineProperty(exports, "Derive", {
761
+ enumerable: true,
762
+ get: function() {
763
+ return _generaltranslation_react_core_components.Derive;
764
+ }
765
+ });
766
+ exports.GTProvider = BrowserGTProvider;
767
+ Object.defineProperty(exports, "GtInternalRuntimeTranslateJsx", {
768
+ enumerable: true,
769
+ get: function() {
770
+ return gt_i18n_internal.GtInternalRuntimeTranslateJsx;
771
+ }
772
+ });
773
+ Object.defineProperty(exports, "GtInternalRuntimeTranslateString", {
774
+ enumerable: true,
775
+ get: function() {
776
+ return gt_i18n_internal.GtInternalRuntimeTranslateString;
777
+ }
778
+ });
779
+ Object.defineProperty(exports, "GtInternalTranslateJsx", {
780
+ enumerable: true,
781
+ get: function() {
782
+ return _generaltranslation_react_core_components.GtInternalTranslateJsx;
783
+ }
784
+ });
785
+ Object.defineProperty(exports, "GtInternalVar", {
786
+ enumerable: true,
787
+ get: function() {
788
+ return _generaltranslation_react_core_components.GtInternalVar;
789
+ }
790
+ });
791
+ exports.LocaleSelector = LocaleSelector;
792
+ Object.defineProperty(exports, "Num", {
793
+ enumerable: true,
794
+ get: function() {
795
+ return _generaltranslation_react_core_components.Num;
796
+ }
797
+ });
798
+ Object.defineProperty(exports, "Plural", {
799
+ enumerable: true,
800
+ get: function() {
801
+ return _generaltranslation_react_core_components.Plural;
802
+ }
803
+ });
804
+ Object.defineProperty(exports, "ReactI18nCache", {
805
+ enumerable: true,
806
+ get: function() {
807
+ return _generaltranslation_react_core_pure.ReactI18nCache;
808
+ }
809
+ });
810
+ exports.RegionSelector = RegionSelector;
811
+ Object.defineProperty(exports, "RelativeTime", {
812
+ enumerable: true,
813
+ get: function() {
814
+ return _generaltranslation_react_core_components.RelativeTime;
815
+ }
816
+ });
817
+ Object.defineProperty(exports, "T", {
818
+ enumerable: true,
819
+ get: function() {
820
+ return _generaltranslation_react_core_components.T;
821
+ }
822
+ });
823
+ exports.Tx = Tx;
824
+ Object.defineProperty(exports, "Var", {
825
+ enumerable: true,
826
+ get: function() {
827
+ return _generaltranslation_react_core_components.Var;
828
+ }
829
+ });
830
+ Object.defineProperty(exports, "createRenderPipeline", {
831
+ enumerable: true,
832
+ get: function() {
833
+ return _generaltranslation_react_core_pure.createRenderPipeline;
834
+ }
835
+ });
836
+ Object.defineProperty(exports, "declareVar", {
837
+ enumerable: true,
838
+ get: function() {
839
+ return _generaltranslation_react_core_pure.declareVar;
840
+ }
841
+ });
842
+ Object.defineProperty(exports, "decodeMsg", {
843
+ enumerable: true,
844
+ get: function() {
845
+ return _generaltranslation_react_core_pure.decodeMsg;
846
+ }
847
+ });
848
+ Object.defineProperty(exports, "decodeOptions", {
849
+ enumerable: true,
850
+ get: function() {
851
+ return _generaltranslation_react_core_pure.decodeOptions;
852
+ }
853
+ });
854
+ Object.defineProperty(exports, "decodeVars", {
855
+ enumerable: true,
856
+ get: function() {
857
+ return _generaltranslation_react_core_pure.decodeVars;
858
+ }
859
+ });
860
+ exports.defaultEnableI18nCookieName = defaultEnableI18nCookieName;
861
+ exports.defaultLocaleCookieName = defaultLocaleCookieName;
862
+ exports.defaultRegionCookieName = defaultRegionCookieName;
863
+ Object.defineProperty(exports, "derive", {
864
+ enumerable: true,
865
+ get: function() {
866
+ return _generaltranslation_react_core_pure.derive;
867
+ }
868
+ });
869
+ Object.defineProperty(exports, "getDefaultLocale", {
870
+ enumerable: true,
871
+ get: function() {
872
+ return _generaltranslation_react_core_pure.getDefaultLocale;
873
+ }
874
+ });
875
+ Object.defineProperty(exports, "getFormatLocales", {
876
+ enumerable: true,
877
+ get: function() {
878
+ return _generaltranslation_react_core_pure.getFormatLocales;
879
+ }
880
+ });
881
+ Object.defineProperty(exports, "getGTClass", {
882
+ enumerable: true,
883
+ get: function() {
884
+ return _generaltranslation_react_core_pure.getGTClass;
885
+ }
886
+ });
887
+ Object.defineProperty(exports, "getLocaleProperties", {
888
+ enumerable: true,
889
+ get: function() {
890
+ return _generaltranslation_react_core_pure.getLocaleProperties;
891
+ }
892
+ });
893
+ Object.defineProperty(exports, "getLocales", {
894
+ enumerable: true,
895
+ get: function() {
896
+ return _generaltranslation_react_core_pure.getLocales;
897
+ }
898
+ });
899
+ Object.defineProperty(exports, "getReactI18nCache", {
900
+ enumerable: true,
901
+ get: function() {
902
+ return _generaltranslation_react_core_pure.getReactI18nCache;
903
+ }
904
+ });
905
+ Object.defineProperty(exports, "getTranslationsSnapshot", {
906
+ enumerable: true,
907
+ get: function() {
908
+ return _generaltranslation_react_core_pure.getTranslationsSnapshot;
909
+ }
910
+ });
911
+ Object.defineProperty(exports, "getVersionId", {
912
+ enumerable: true,
913
+ get: function() {
914
+ return _generaltranslation_react_core_pure.getVersionId;
915
+ }
916
+ });
917
+ Object.defineProperty(exports, "gtFallback", {
918
+ enumerable: true,
919
+ get: function() {
920
+ return _generaltranslation_react_core_pure.gtFallback;
921
+ }
922
+ });
923
+ Object.defineProperty(exports, "initializeGT", {
924
+ enumerable: true,
925
+ get: function() {
926
+ return _generaltranslation_react_core_pure.initializeGT;
927
+ }
928
+ });
929
+ exports.initializeGTSPA = initializeGTSPA;
930
+ Object.defineProperty(exports, "mFallback", {
931
+ enumerable: true,
932
+ get: function() {
933
+ return _generaltranslation_react_core_pure.mFallback;
934
+ }
935
+ });
936
+ Object.defineProperty(exports, "msg", {
937
+ enumerable: true,
938
+ get: function() {
939
+ return _generaltranslation_react_core_pure.msg;
940
+ }
941
+ });
942
+ Object.defineProperty(exports, "setReactI18nCache", {
943
+ enumerable: true,
944
+ get: function() {
945
+ return _generaltranslation_react_core_pure.setReactI18nCache;
946
+ }
947
+ });
948
+ Object.defineProperty(exports, "t", {
949
+ enumerable: true,
950
+ get: function() {
951
+ return _generaltranslation_react_core_pure.t;
952
+ }
953
+ });
954
+ Object.defineProperty(exports, "useCustomMapping", {
955
+ enumerable: true,
956
+ get: function() {
957
+ return _generaltranslation_react_core_hooks.useCustomMapping;
958
+ }
959
+ });
960
+ Object.defineProperty(exports, "useDefaultLocale", {
961
+ enumerable: true,
962
+ get: function() {
963
+ return _generaltranslation_react_core_hooks.useDefaultLocale;
964
+ }
965
+ });
966
+ Object.defineProperty(exports, "useEnableI18n", {
967
+ enumerable: true,
968
+ get: function() {
969
+ return _generaltranslation_react_core_hooks.useEnableI18n;
970
+ }
971
+ });
972
+ Object.defineProperty(exports, "useFormatLocales", {
973
+ enumerable: true,
974
+ get: function() {
975
+ return _generaltranslation_react_core_hooks.useFormatLocales;
976
+ }
977
+ });
978
+ Object.defineProperty(exports, "useGT", {
979
+ enumerable: true,
980
+ get: function() {
981
+ return _generaltranslation_react_core_hooks.useGT;
982
+ }
983
+ });
984
+ Object.defineProperty(exports, "useGTClass", {
985
+ enumerable: true,
986
+ get: function() {
987
+ return _generaltranslation_react_core_hooks.useGTClass;
988
+ }
989
+ });
990
+ Object.defineProperty(exports, "useLocale", {
991
+ enumerable: true,
992
+ get: function() {
993
+ return _generaltranslation_react_core_hooks.useLocale;
994
+ }
995
+ });
996
+ Object.defineProperty(exports, "useLocaleDirection", {
997
+ enumerable: true,
998
+ get: function() {
999
+ return _generaltranslation_react_core_hooks.useLocaleDirection;
1000
+ }
1001
+ });
1002
+ Object.defineProperty(exports, "useLocaleProperties", {
1003
+ enumerable: true,
1004
+ get: function() {
1005
+ return _generaltranslation_react_core_hooks.useLocaleProperties;
1006
+ }
1007
+ });
1008
+ exports.useLocaleSelector = useLocaleSelector;
1009
+ Object.defineProperty(exports, "useLocales", {
1010
+ enumerable: true,
1011
+ get: function() {
1012
+ return _generaltranslation_react_core_hooks.useLocales;
1013
+ }
1014
+ });
1015
+ Object.defineProperty(exports, "useMessages", {
1016
+ enumerable: true,
1017
+ get: function() {
1018
+ return _generaltranslation_react_core_hooks.useMessages;
1019
+ }
1020
+ });
1021
+ Object.defineProperty(exports, "useRegion", {
1022
+ enumerable: true,
1023
+ get: function() {
1024
+ return _generaltranslation_react_core_hooks.useRegion;
1025
+ }
1026
+ });
1027
+ exports.useRegionSelector = useRegionSelector;
1028
+ exports.useSetEnableI18n = useSetEnableI18n;
1029
+ exports.useSetLocale = useSetLocale;
1030
+ exports.useSetRegion = useSetRegion;
1031
+ Object.defineProperty(exports, "useTranslations", {
1032
+ enumerable: true,
1033
+ get: function() {
1034
+ return _generaltranslation_react_core_hooks.useTranslations;
1035
+ }
1036
+ });
1037
+ Object.defineProperty(exports, "useVersionId", {
1038
+ enumerable: true,
1039
+ get: function() {
1040
+ return _generaltranslation_react_core_hooks.useVersionId;
1041
+ }
1042
+ });
1043
+
1044
+ //# sourceMappingURL=index.client.cjs.map