wcz-test 6.6.0 → 6.7.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.
@@ -1,13 +1,10 @@
1
1
  export { P as Platform } from './utils-ChipkRJ9.js';
2
- export { default as i18n, t } from 'i18next';
3
- export { initReactI18next, useTranslation } from 'react-i18next';
4
- export { default as LanguageDetector } from 'i18next-browser-languagedetector';
2
+ export { t } from 'i18next';
3
+ export { useTranslation } from 'react-i18next';
5
4
  import * as nanostores from 'nanostores';
6
- import * as node_modules_better_auth_dist_index_BzgT8cQd_d_mts from 'node_modules/better-auth/dist/index-BzgT8cQd.d.mts';
7
- import * as _better_auth_core_oauth2 from '@better-auth/core/oauth2';
8
5
  import * as _better_fetch_fetch from '@better-fetch/fetch';
9
6
  import * as node_modules_better_auth_dist_helper_DU33OcfW_d_mts from 'node_modules/better-auth/dist/helper-DU33OcfW.d.mts';
10
- import * as _better_auth_core from '@better-auth/core';
7
+ import * as better_auth from 'better-auth';
11
8
  import 'axios';
12
9
  import 'uuidv7';
13
10
  import '@t3-oss/env-core';
@@ -17,7 +14,7 @@ declare const WISTRON_SECONDARY_COLOR = "#64DC00";
17
14
 
18
15
  declare const authClient: {
19
16
  signIn: {
20
- social: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
17
+ social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
21
18
  provider: unknown;
22
19
  callbackURL?: string | undefined;
23
20
  newUserCallbackURL?: string | undefined;
@@ -75,7 +72,7 @@ declare const authClient: {
75
72
  }, FetchOptions["throw"] extends true ? true : false>>;
76
73
  };
77
74
  } & {
78
- signOut: <FetchOptions extends _better_auth_core.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
75
+ signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
79
76
  query?: Record<string, any> | undefined;
80
77
  fetchOptions?: FetchOptions | undefined;
81
78
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
@@ -86,7 +83,7 @@ declare const authClient: {
86
83
  }, FetchOptions["throw"] extends true ? true : false>>;
87
84
  } & {
88
85
  signUp: {
89
- email: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
86
+ email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
90
87
  name: string;
91
88
  email: string;
92
89
  password: string;
@@ -129,7 +126,7 @@ declare const authClient: {
129
126
  };
130
127
  } & {
131
128
  signIn: {
132
- email: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
129
+ email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
133
130
  email: string;
134
131
  password: string;
135
132
  callbackURL?: string | undefined;
@@ -160,7 +157,7 @@ declare const authClient: {
160
157
  }, FetchOptions["throw"] extends true ? true : false>>;
161
158
  };
162
159
  } & {
163
- resetPassword: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
160
+ resetPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
164
161
  newPassword: string;
165
162
  token?: string | undefined;
166
163
  }> & Record<string, any>, Partial<{
@@ -177,7 +174,7 @@ declare const authClient: {
177
174
  message?: string | undefined;
178
175
  }, FetchOptions["throw"] extends true ? true : false>>;
179
176
  } & {
180
- verifyEmail: <FetchOptions extends _better_auth_core.ClientFetchOption<never, Partial<{
177
+ verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
181
178
  token: string;
182
179
  callbackURL?: string | undefined;
183
180
  }> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
@@ -193,7 +190,7 @@ declare const authClient: {
193
190
  message?: string | undefined;
194
191
  }, FetchOptions["throw"] extends true ? true : false>>;
195
192
  } & {
196
- sendVerificationEmail: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
193
+ sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
197
194
  email: string;
198
195
  callbackURL?: string | undefined;
199
196
  }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
@@ -208,7 +205,7 @@ declare const authClient: {
208
205
  message?: string | undefined;
209
206
  }, FetchOptions["throw"] extends true ? true : false>>;
210
207
  } & {
211
- changeEmail: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
208
+ changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
212
209
  newEmail: string;
213
210
  callbackURL?: string | undefined;
214
211
  }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
@@ -223,7 +220,7 @@ declare const authClient: {
223
220
  message?: string | undefined;
224
221
  }, FetchOptions["throw"] extends true ? true : false>>;
225
222
  } & {
226
- changePassword: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
223
+ changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
227
224
  newPassword: string;
228
225
  currentPassword: string;
229
226
  revokeOtherSessions?: boolean | undefined;
@@ -249,7 +246,7 @@ declare const authClient: {
249
246
  message?: string | undefined;
250
247
  }, FetchOptions["throw"] extends true ? true : false>>;
251
248
  } & {
252
- updateUser: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<Partial<{}> & {
249
+ updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
253
250
  name?: string | undefined;
254
251
  image?: string | undefined;
255
252
  }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
@@ -263,7 +260,7 @@ declare const authClient: {
263
260
  message?: string | undefined;
264
261
  }, FetchOptions["throw"] extends true ? true : false>>;
265
262
  } & {
266
- deleteUser: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
263
+ deleteUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
267
264
  callbackURL?: string | undefined;
268
265
  password?: string | undefined;
269
266
  token?: string | undefined;
@@ -281,7 +278,7 @@ declare const authClient: {
281
278
  message?: string | undefined;
282
279
  }, FetchOptions["throw"] extends true ? true : false>>;
283
280
  } & {
284
- requestPasswordReset: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
281
+ requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
285
282
  email: string;
286
283
  redirectTo?: string | undefined;
287
284
  }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
@@ -298,7 +295,7 @@ declare const authClient: {
298
295
  }, FetchOptions["throw"] extends true ? true : false>>;
299
296
  } & {
300
297
  resetPassword: {
301
- ":token": <FetchOptions extends _better_auth_core.ClientFetchOption<never, Partial<{
298
+ ":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
302
299
  callbackURL: string;
303
300
  }> & Record<string, any>, {
304
301
  token: string;
@@ -313,7 +310,7 @@ declare const authClient: {
313
310
  }, FetchOptions["throw"] extends true ? true : false>>;
314
311
  };
315
312
  } & {
316
- listSessions: <FetchOptions extends _better_auth_core.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
313
+ listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
317
314
  query?: Record<string, any> | undefined;
318
315
  fetchOptions?: FetchOptions | undefined;
319
316
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
@@ -330,7 +327,7 @@ declare const authClient: {
330
327
  message?: string | undefined;
331
328
  }, FetchOptions["throw"] extends true ? true : false>>;
332
329
  } & {
333
- revokeSession: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
330
+ revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
334
331
  token: string;
335
332
  }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
336
333
  token: string;
@@ -343,7 +340,7 @@ declare const authClient: {
343
340
  message?: string | undefined;
344
341
  }, FetchOptions["throw"] extends true ? true : false>>;
345
342
  } & {
346
- revokeSessions: <FetchOptions extends _better_auth_core.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
343
+ revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
347
344
  query?: Record<string, any> | undefined;
348
345
  fetchOptions?: FetchOptions | undefined;
349
346
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
@@ -353,7 +350,7 @@ declare const authClient: {
353
350
  message?: string | undefined;
354
351
  }, FetchOptions["throw"] extends true ? true : false>>;
355
352
  } & {
356
- revokeOtherSessions: <FetchOptions extends _better_auth_core.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
353
+ revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
357
354
  query?: Record<string, any> | undefined;
358
355
  fetchOptions?: FetchOptions | undefined;
359
356
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
@@ -363,7 +360,7 @@ declare const authClient: {
363
360
  message?: string | undefined;
364
361
  }, FetchOptions["throw"] extends true ? true : false>>;
365
362
  } & {
366
- linkSocial: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
363
+ linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
367
364
  provider: unknown;
368
365
  callbackURL?: string | undefined;
369
366
  idToken?: {
@@ -403,7 +400,7 @@ declare const authClient: {
403
400
  message?: string | undefined;
404
401
  }, FetchOptions["throw"] extends true ? true : false>>;
405
402
  } & {
406
- listAccounts: <FetchOptions extends _better_auth_core.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
403
+ listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
407
404
  query?: Record<string, any> | undefined;
408
405
  fetchOptions?: FetchOptions | undefined;
409
406
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
@@ -420,7 +417,7 @@ declare const authClient: {
420
417
  }, FetchOptions["throw"] extends true ? true : false>>;
421
418
  } & {
422
419
  deleteUser: {
423
- callback: <FetchOptions extends _better_auth_core.ClientFetchOption<never, Partial<{
420
+ callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
424
421
  token: string;
425
422
  callbackURL?: string | undefined;
426
423
  }> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
@@ -438,7 +435,7 @@ declare const authClient: {
438
435
  }, FetchOptions["throw"] extends true ? true : false>>;
439
436
  };
440
437
  } & {
441
- unlinkAccount: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
438
+ unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
442
439
  providerId: string;
443
440
  accountId?: string | undefined;
444
441
  }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
@@ -453,7 +450,7 @@ declare const authClient: {
453
450
  message?: string | undefined;
454
451
  }, FetchOptions["throw"] extends true ? true : false>>;
455
452
  } & {
456
- refreshToken: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
453
+ refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
457
454
  providerId: string;
458
455
  accountId?: string | undefined;
459
456
  userId?: string | undefined;
@@ -477,7 +474,7 @@ declare const authClient: {
477
474
  message?: string | undefined;
478
475
  }, FetchOptions["throw"] extends true ? true : false>>;
479
476
  } & {
480
- getAccessToken: <FetchOptions extends _better_auth_core.ClientFetchOption<Partial<{
477
+ getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
481
478
  providerId: string;
482
479
  accountId?: string | undefined;
483
480
  userId?: string | undefined;
@@ -497,7 +494,7 @@ declare const authClient: {
497
494
  message?: string | undefined;
498
495
  }, FetchOptions["throw"] extends true ? true : false>>;
499
496
  } & {
500
- accountInfo: <FetchOptions extends _better_auth_core.ClientFetchOption<never, Partial<{
497
+ accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
501
498
  accountId?: string | undefined;
502
499
  }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
503
500
  query?: {
@@ -505,14 +502,14 @@ declare const authClient: {
505
502
  } | undefined;
506
503
  fetchOptions?: FetchOptions | undefined;
507
504
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
508
- user: _better_auth_core_oauth2.OAuth2UserInfo;
505
+ user: better_auth.OAuth2UserInfo;
509
506
  data: Record<string, any>;
510
507
  }, {
511
508
  code?: string | undefined;
512
509
  message?: string | undefined;
513
510
  }, FetchOptions["throw"] extends true ? true : false>>;
514
511
  } & {
515
- getSession: <FetchOptions extends _better_auth_core.ClientFetchOption<never, Partial<{
512
+ getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
516
513
  disableCookieCache?: unknown;
517
514
  disableRefresh?: unknown;
518
515
  }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
@@ -572,7 +569,7 @@ declare const authClient: {
572
569
  isRefetching: boolean;
573
570
  error: _better_fetch_fetch.BetterFetchError | null;
574
571
  refetch: (queryParams?: {
575
- query?: node_modules_better_auth_dist_index_BzgT8cQd_d_mts.tn;
572
+ query?: better_auth.SessionQueryParams;
576
573
  } | undefined) => Promise<void>;
577
574
  };
578
575
  $Infer: {
@@ -11,17 +11,12 @@ import "./chunk-5WRI5ZAA.js";
11
11
 
12
12
  // src/client-utils.ts
13
13
  import { t } from "i18next";
14
- import { default as default2 } from "i18next";
15
- import { initReactI18next, useTranslation } from "react-i18next";
16
- import { default as default3 } from "i18next-browser-languagedetector";
14
+ import { useTranslation } from "react-i18next";
17
15
  export {
18
- default3 as LanguageDetector,
19
16
  Platform,
20
17
  WISTRON_PRIMARY_COLOR,
21
18
  WISTRON_SECONDARY_COLOR,
22
19
  authClient,
23
- default2 as i18n,
24
- initReactI18next,
25
20
  t,
26
21
  useTranslation
27
22
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client-utils.ts"],"sourcesContent":["export { Platform } from \"./lib/utils\";\r\nexport { WISTRON_PRIMARY_COLOR, WISTRON_SECONDARY_COLOR } from \"./hooks/ThemeHook\";\r\n\r\n// Internationalization\r\nexport { t } from \"i18next\";\r\nexport { default as i18n } from \"i18next\";\r\nexport { initReactI18next, useTranslation } from \"react-i18next\";\r\nexport { default as LanguageDetector } from \"i18next-browser-languagedetector\";\r\n\r\n// Auth\r\nexport { authClient } from \"./lib/auth/auth-client\";\r\n\r\n"],"mappings":";;;;;;;;;;;;AAIA,SAAS,SAAS;AAClB,SAAoB,WAAXA,gBAAuB;AAChC,SAAS,kBAAkB,sBAAsB;AACjD,SAAoB,WAAXA,gBAAmC;","names":["default"]}
1
+ {"version":3,"sources":["../src/client-utils.ts"],"sourcesContent":["export { Platform } from \"./lib/utils\";\r\nexport { WISTRON_PRIMARY_COLOR, WISTRON_SECONDARY_COLOR } from \"./hooks/ThemeHook\";\r\n\r\n// Internationalization\r\nexport { t } from \"i18next\";\r\nexport { useTranslation } from \"react-i18next\";\r\n\r\n// Auth\r\nexport { authClient } from \"./lib/auth/auth-client\";\r\n\r\n"],"mappings":";;;;;;;;;;;;AAIA,SAAS,SAAS;AAClB,SAAS,sBAAsB;","names":[]}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,10 @@
1
+ import * as _tanstack_start_client_core from '@tanstack/start-client-core';
2
+ import { CssVarsThemeOptions } from '@mui/material';
1
3
  import { LinkOptions } from '@tanstack/react-router';
2
4
  import { FC, ReactNode } from 'react';
3
- import { CssVarsThemeOptions } from '@mui/material';
4
5
  export { r as rootRouteHead } from './utils-ChipkRJ9.js';
6
+ import { Resource } from 'i18next';
7
+ import { Plugin } from 'vite';
5
8
  import 'axios';
6
9
  import 'uuidv7';
7
10
  import '@t3-oss/env-core';
@@ -30,5 +33,16 @@ interface ProvidersProps {
30
33
  children: ReactNode;
31
34
  }
32
35
  declare const LayoutProvider: FC<ProvidersProps>;
36
+ declare const setSSRLanguage: _tanstack_start_client_core.OptionalFetcher<undefined, undefined, Promise<void>>;
37
+
38
+ type RequireEn<T extends Resource> = T & {
39
+ en: T[keyof T];
40
+ };
41
+ interface ViteLayoutOptions<T extends Resource> {
42
+ i18n: {
43
+ resources: RequireEn<T>;
44
+ };
45
+ }
46
+ declare function viteLayout<T extends Resource>({ i18n }: ViteLayoutOptions<T>): Plugin;
33
47
 
34
- export { LayoutProvider, type Navigation };
48
+ export { LayoutProvider, type Navigation, setSSRLanguage, viteLayout };
package/dist/index.js CHANGED
@@ -1641,9 +1641,16 @@ var AdapterDayjs = class {
1641
1641
  };
1642
1642
 
1643
1643
  // src/providers/LayoutProvider.tsx
1644
+ import { createServerFn } from "@tanstack/react-start";
1645
+ import { getCookie as getCookie2 } from "@tanstack/react-start/server";
1646
+ import dayjs2 from "dayjs";
1647
+ import "dayjs/locale/cs";
1648
+ import i18n from "i18next";
1649
+ import LanguageDetector from "i18next-browser-languagedetector";
1644
1650
  import { useEffect as useEffect3, useEffectEvent } from "react";
1645
- import { useTranslation as useTranslation2 } from "react-i18next";
1646
- import * as z from "zod";
1651
+ import { initReactI18next } from "react-i18next";
1652
+ import { resources } from "virtual:layout";
1653
+ import z from "zod";
1647
1654
 
1648
1655
  // src/providers/DialogsProvider.tsx
1649
1656
  import { useId, useRef as useRef2, useState } from "react";
@@ -2104,12 +2111,12 @@ var ToolbarAccount = () => {
2104
2111
  const [anchorElement, setAnchorElement] = useState4();
2105
2112
  const [tab, setTab] = useState4("settings");
2106
2113
  const open = Boolean(anchorElement);
2107
- const { t, i18n } = useTranslation();
2114
+ const { t, i18n: i18n2 } = useTranslation();
2108
2115
  const { mode, setMode } = useColorScheme();
2109
2116
  const { data: session } = authClient.useSession();
2110
2117
  const { alert } = useDialogs();
2111
- const supportedLanguages = (Array.isArray(i18n.options.supportedLngs) ? i18n.options.supportedLngs : []).filter((lng) => lng !== "cimode");
2112
- const languageDisplayNames = new Intl.DisplayNames([i18n.language], { type: "language" });
2118
+ const supportedLanguages = (Array.isArray(i18n2.options.supportedLngs) ? i18n2.options.supportedLngs : []).filter((lng) => lng !== "cimode");
2119
+ const languageDisplayNames = new Intl.DisplayNames([i18n2.language], { type: "language" });
2113
2120
  const colorModes = [
2114
2121
  { mode: "light", icon: LightMode, label: t("Layout.Light") },
2115
2122
  { mode: "dark", icon: DarkMode, label: t("Layout.Dark") },
@@ -2139,7 +2146,7 @@ var ToolbarAccount = () => {
2139
2146
  ] }),
2140
2147
  /* @__PURE__ */ jsxs4(ListItemButton2, { onClick: changeTab("language"), sx: { py: 0.3 }, children: [
2141
2148
  /* @__PURE__ */ jsx6(ListItemIcon2, { children: /* @__PURE__ */ jsx6(Translate, {}) }),
2142
- /* @__PURE__ */ jsx6(ListItemText2, { primary: t("Layout.Language"), secondary: capitalize(languageDisplayNames.of(i18n.language)) }),
2149
+ /* @__PURE__ */ jsx6(ListItemText2, { primary: t("Layout.Language"), secondary: capitalize(languageDisplayNames.of(i18n2.language)) }),
2143
2150
  /* @__PURE__ */ jsx6(ChevronRight, {})
2144
2151
  ] })
2145
2152
  ] });
@@ -2170,10 +2177,10 @@ var ToolbarAccount = () => {
2170
2177
  (languageCode) => /* @__PURE__ */ jsxs4(
2171
2178
  ListItemButton2,
2172
2179
  {
2173
- onClick: () => i18n.changeLanguage(languageCode).finally(() => closeMenu()),
2174
- selected: i18n.resolvedLanguage === languageCode,
2180
+ onClick: () => i18n2.changeLanguage(languageCode).finally(() => closeMenu()),
2181
+ selected: i18n2.resolvedLanguage === languageCode,
2175
2182
  children: [
2176
- /* @__PURE__ */ jsx6(ListItemIcon2, { children: i18n.resolvedLanguage === languageCode && /* @__PURE__ */ jsx6(Done, {}) }),
2183
+ /* @__PURE__ */ jsx6(ListItemIcon2, { children: i18n2.resolvedLanguage === languageCode && /* @__PURE__ */ jsx6(Done, {}) }),
2177
2184
  /* @__PURE__ */ jsx6(ListItemText2, { primary: capitalize(languageDisplayNames.of(languageCode)) })
2178
2185
  ]
2179
2186
  },
@@ -2299,11 +2306,22 @@ var Layout = (props) => {
2299
2306
 
2300
2307
  // src/providers/LayoutProvider.tsx
2301
2308
  import { jsx as jsx8 } from "react/jsx-runtime";
2309
+ var YEAR_IN_MINUTES = 60 * 24 * 365;
2310
+ i18n.use(LanguageDetector).use(initReactI18next).init({
2311
+ resources,
2312
+ fallbackLng: "en",
2313
+ supportedLngs: Object.keys(resources),
2314
+ detection: {
2315
+ caches: ["cookie"],
2316
+ cookieMinutes: YEAR_IN_MINUTES
2317
+ },
2318
+ interpolation: { escapeValue: false }
2319
+ });
2302
2320
  var LayoutProvider = ({ navigation, theme, children }) => {
2303
- const { i18n } = useTranslation2();
2304
2321
  const createdTheme = useGetTheme(theme);
2305
2322
  const languageChangedHandler = useEffectEvent(() => {
2306
2323
  z.config(z.core.locales[i18n.language]());
2324
+ dayjs2.locale(i18n.language);
2307
2325
  });
2308
2326
  useEffect3(() => {
2309
2327
  languageChangedHandler();
@@ -2312,11 +2330,39 @@ var LayoutProvider = ({ navigation, theme, children }) => {
2312
2330
  i18n.off("languageChanged", languageChangedHandler);
2313
2331
  };
2314
2332
  }, []);
2315
- return /* @__PURE__ */ jsx8(ThemeProvider, { theme: createdTheme, children: /* @__PURE__ */ jsx8(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: i18n.resolvedLanguage, children: /* @__PURE__ */ jsx8(DialogsProvider, { children: /* @__PURE__ */ jsx8(Layout, { navigation, children }) }) }) });
2333
+ return /* @__PURE__ */ jsx8(ThemeProvider, { theme: createdTheme, children: /* @__PURE__ */ jsx8(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: i18n.language, children: /* @__PURE__ */ jsx8(DialogsProvider, { children: /* @__PURE__ */ jsx8(Layout, { navigation, children }) }) }, i18n.language) });
2316
2334
  };
2335
+ var setSSRLanguage = createServerFn().handler(async () => {
2336
+ const language = getCookie2(i18n.services.languageDetector.options.lookupCookie) || "en";
2337
+ dayjs2.locale(language);
2338
+ z.config(z.core.locales[language]());
2339
+ await i18n.changeLanguage(language);
2340
+ });
2341
+
2342
+ // src/lib/vite-plugin.ts
2343
+ var VIRTUAL_ID = "virtual:layout";
2344
+ var RESOLVED_VIRTUAL_ID = "\0" + VIRTUAL_ID;
2345
+ function viteLayout({ i18n: i18n2 }) {
2346
+ return {
2347
+ name: "vite:layout",
2348
+ enforce: "pre",
2349
+ resolveId(id) {
2350
+ if (id === VIRTUAL_ID) return RESOLVED_VIRTUAL_ID;
2351
+ return null;
2352
+ },
2353
+ load(id) {
2354
+ if (id !== RESOLVED_VIRTUAL_ID) return null;
2355
+ return `
2356
+ export const resources = ${JSON.stringify(i18n2.resources)};
2357
+ `;
2358
+ }
2359
+ };
2360
+ }
2317
2361
  export {
2318
2362
  LayoutProvider,
2319
- rootRouteHead
2363
+ rootRouteHead,
2364
+ setSSRLanguage,
2365
+ viteLayout
2320
2366
  };
2321
2367
  /*! Bundled license information:
2322
2368