@rivm-loculus-tools/sequence-editor 0.1.5 → 0.2.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.
Files changed (72) hide show
  1. package/dist/_chunks/EditorWorkerService.js +12 -11
  2. package/dist/_chunks/EditorWorkerService.js.map +1 -1
  3. package/dist/_chunks/SequenceEditor.js +362 -495
  4. package/dist/_chunks/SequenceEditor.js.map +1 -1
  5. package/dist/_chunks/SequenceEditorPageDrawer.js +160 -49577
  6. package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
  7. package/dist/_chunks/comlink.js +228 -0
  8. package/dist/_chunks/comlink.js.map +1 -0
  9. package/dist/_chunks/react.js +11 -0
  10. package/dist/_chunks/react.js.map +1 -0
  11. package/dist/_chunks/sequenceEditorStore.js +40 -273
  12. package/dist/_chunks/sequenceEditorStore.js.map +1 -1
  13. package/dist/assets/index-Dn92arD_.js +8 -0
  14. package/dist/assets/index-Dn92arD_.js.map +1 -0
  15. package/dist/classes/services/EditorWorkerService/index.js +1 -2
  16. package/dist/classes/services/SequenceEditorEventBusService/index.js +16 -2
  17. package/dist/classes/services/SequenceEditorEventBusService/index.js.map +1 -0
  18. package/dist/classes/workers/EngineWorker/index.js +3 -2
  19. package/dist/classes/workers/EngineWorker/index.js.map +1 -1
  20. package/dist/components/app/App/index.js +15 -951
  21. package/dist/components/app/App/index.js.map +1 -1
  22. package/dist/components/pages/SequenceEditorErrorPage/index.js +6 -6
  23. package/dist/components/pages/SequenceEditorErrorPage/index.js.map +1 -1
  24. package/dist/components/pages/SequenceEditorMainPage/index.js +61 -2
  25. package/dist/components/pages/SequenceEditorMainPage/index.js.map +1 -0
  26. package/dist/components/ui/SequenceEditor/index.js +1 -2
  27. package/dist/components/ui/SequenceEditorPage/index.js +8 -8
  28. package/dist/components/ui/SequenceEditorPage/index.js.map +1 -1
  29. package/dist/components/ui/SequenceEditorPageDrawer/index.js +1 -2
  30. package/dist/components/ui/SequenceEditorPageHeader/index.js +60 -2
  31. package/dist/components/ui/SequenceEditorPageHeader/index.js.map +1 -0
  32. package/dist/components/ui/SequenceEditorSearchBar/index.js +27 -2
  33. package/dist/components/ui/SequenceEditorSearchBar/index.js.map +1 -0
  34. package/dist/constants/editor.js.map +1 -1
  35. package/dist/constants/keyboard.js +1 -1
  36. package/dist/constants/keyboard.js.map +1 -1
  37. package/dist/constants/palette.js.map +1 -1
  38. package/dist/models/editor.js.map +1 -1
  39. package/dist/models/model.js.map +1 -1
  40. package/dist/models/palette.js.map +1 -1
  41. package/dist/stores/sequenceEditorStore/index.js +1 -2
  42. package/dist/utils/EditorUtil/index.js +158 -150
  43. package/dist/utils/EditorUtil/index.js.map +1 -1
  44. package/dist/utils/PaletteUtil/index.js.map +1 -1
  45. package/package.json +52 -29
  46. package/dist/_chunks/Box.js +0 -6737
  47. package/dist/_chunks/Box.js.map +0 -1
  48. package/dist/_chunks/Close.js +0 -7
  49. package/dist/_chunks/Close.js.map +0 -1
  50. package/dist/_chunks/KeyboardArrowDown.js +0 -1023
  51. package/dist/_chunks/KeyboardArrowDown.js.map +0 -1
  52. package/dist/_chunks/Redo.js +0 -2559
  53. package/dist/_chunks/Redo.js.map +0 -1
  54. package/dist/_chunks/SequenceEditorEventBusService.js +0 -102
  55. package/dist/_chunks/SequenceEditorEventBusService.js.map +0 -1
  56. package/dist/_chunks/SequenceEditorMainPage.js +0 -552
  57. package/dist/_chunks/SequenceEditorMainPage.js.map +0 -1
  58. package/dist/_chunks/SequenceEditorPageHeader.js +0 -236
  59. package/dist/_chunks/SequenceEditorPageHeader.js.map +0 -1
  60. package/dist/_chunks/SequenceEditorSearchBar.js +0 -143
  61. package/dist/_chunks/SequenceEditorSearchBar.js.map +0 -1
  62. package/dist/_chunks/TestIdUtil.js +0 -4695
  63. package/dist/_chunks/TestIdUtil.js.map +0 -1
  64. package/dist/_chunks/TextField.js +0 -3083
  65. package/dist/_chunks/TextField.js.map +0 -1
  66. package/dist/_chunks/rolldown-runtime.js +0 -13
  67. package/dist/_chunks/sequence_editor.js +0 -517
  68. package/dist/_chunks/sequence_editor.js.map +0 -1
  69. package/dist/_chunks/withDialog.js +0 -289
  70. package/dist/_chunks/withDialog.js.map +0 -1
  71. package/dist/assets/index-C5rc-pJV.js +0 -8
  72. package/dist/assets/index-C5rc-pJV.js.map +0 -1
@@ -1,2559 +0,0 @@
1
- import { n as e } from "./rolldown-runtime.js";
2
- import { A as t, C as n, D as r, Dt as i, Lt as a, M as o, O as s, Ot as c, P as l, Q as u, S as d, W as f, Y as p, b as m, dt as h, f as g, ft as _, g as v, i as y, j as b, k as x, n as S, o as C, s as w, t as T, ut as E, w as D, x as O } from "./Box.js";
3
- import { C as k, D as A, H as j, I as ee, K as te, M, N, R as P, T as F, U as I, h as L, j as R, k as z } from "./TestIdUtil.js";
4
- //#region ../../../../node_modules/.pnpm/@mui+utils@9.4.0_@types+react@19.3.0_react@19.3.0/node_modules/@mui/utils/unsupportedProp/unsupportedProp.mjs
5
- function B(e, t, n, r, i) {
6
- if (process.env.NODE_ENV === "production") return null;
7
- let a = i || t;
8
- return e[t] === void 0 ? null : /* @__PURE__ */ Error(`The prop \`${a}\` is not supported. Please remove it.`);
9
- }
10
- //#endregion
11
- //#region ../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/utils/unsupportedProp.mjs
12
- var V = /* @__PURE__ */ e(a(), 1), H = /* @__PURE__ */ e(c(), 1), U = i(), W = B;
13
- //#endregion
14
- //#region ../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/AppBar/appBarClasses.mjs
15
- function ne(e) {
16
- return h("MuiAppBar", e);
17
- }
18
- E("MuiAppBar", [
19
- "root",
20
- "positionFixed",
21
- "positionAbsolute",
22
- "positionSticky",
23
- "positionStatic",
24
- "positionRelative",
25
- "colorDefault",
26
- "colorPrimary",
27
- "colorSecondary",
28
- "colorInherit",
29
- "colorTransparent",
30
- "colorError",
31
- "colorInfo",
32
- "colorSuccess",
33
- "colorWarning"
34
- ]);
35
- //#endregion
36
- //#region ../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/AppBar/AppBar.mjs
37
- var re = (e) => {
38
- let { color: t, position: n, classes: r } = e, i = { root: [
39
- "root",
40
- `color${s(t)}`,
41
- `position${s(n)}`
42
- ] };
43
- return u(i, ne, r);
44
- }, ie = (e, t) => e ? `${e.replace(")", "")}, ${t})` : t, ae = b(R, {
45
- name: "MuiAppBar",
46
- slot: "Root",
47
- overridesResolver: (e, t) => {
48
- let { ownerState: n } = e;
49
- return [
50
- t.root,
51
- t[`position${s(n.position)}`],
52
- t[`color${s(n.color)}`]
53
- ];
54
- }
55
- })(t(({ theme: e }) => ({
56
- display: "flex",
57
- flexDirection: "column",
58
- width: "100%",
59
- boxSizing: "border-box",
60
- flexShrink: 0,
61
- variants: [
62
- {
63
- props: { position: "fixed" },
64
- style: {
65
- position: "fixed",
66
- zIndex: (e.vars || e).zIndex.appBar,
67
- top: 0,
68
- left: "auto",
69
- right: 0,
70
- "@media print": { position: "absolute" }
71
- }
72
- },
73
- {
74
- props: { position: "absolute" },
75
- style: {
76
- position: "absolute",
77
- zIndex: (e.vars || e).zIndex.appBar,
78
- top: 0,
79
- left: "auto",
80
- right: 0
81
- }
82
- },
83
- {
84
- props: { position: "sticky" },
85
- style: {
86
- position: "sticky",
87
- zIndex: (e.vars || e).zIndex.appBar,
88
- top: 0,
89
- left: "auto",
90
- right: 0
91
- }
92
- },
93
- {
94
- props: { position: "static" },
95
- style: { position: "static" }
96
- },
97
- {
98
- props: { position: "relative" },
99
- style: { position: "relative" }
100
- },
101
- {
102
- props: { color: "inherit" },
103
- style: {
104
- "--AppBar-color": "inherit",
105
- color: "var(--AppBar-color)"
106
- }
107
- },
108
- {
109
- props: { color: "default" },
110
- style: {
111
- "--AppBar-background": e.vars ? e.vars.palette.AppBar.defaultBg : e.palette.grey[100],
112
- "--AppBar-color": e.vars ? e.vars.palette.text.primary : e.palette.getContrastText(e.palette.grey[100]),
113
- ...e.applyStyles("dark", {
114
- "--AppBar-background": e.vars ? e.vars.palette.AppBar.defaultBg : e.palette.grey[900],
115
- "--AppBar-color": e.vars ? e.vars.palette.text.primary : e.palette.getContrastText(e.palette.grey[900])
116
- })
117
- }
118
- },
119
- ...Object.entries(e.palette).filter(C(["contrastText"])).map(([t]) => ({
120
- props: { color: t },
121
- style: {
122
- "--AppBar-background": (e.vars ?? e).palette[t].main,
123
- "--AppBar-color": (e.vars ?? e).palette[t].contrastText,
124
- ...e.focusVisible && p(`0 0 0 4px ${(e.vars || e).palette.background.default}`)
125
- }
126
- })),
127
- {
128
- props: (e) => e.enableColorOnDark === !0 && !["inherit", "transparent"].includes(e.color),
129
- style: {
130
- backgroundColor: "var(--AppBar-background)",
131
- color: "var(--AppBar-color)"
132
- }
133
- },
134
- {
135
- props: (e) => e.enableColorOnDark === !1 && !["inherit", "transparent"].includes(e.color),
136
- style: {
137
- backgroundColor: "var(--AppBar-background)",
138
- color: "var(--AppBar-color)",
139
- ...e.applyStyles("dark", {
140
- backgroundColor: e.vars ? ie(e.vars.palette.AppBar.darkBg, "var(--AppBar-background)") : null,
141
- color: e.vars ? ie(e.vars.palette.AppBar.darkColor, "var(--AppBar-color)") : null
142
- })
143
- }
144
- },
145
- {
146
- props: { color: "transparent" },
147
- style: {
148
- "--AppBar-background": "transparent",
149
- "--AppBar-color": "inherit",
150
- backgroundColor: "var(--AppBar-background)",
151
- color: "var(--AppBar-color)",
152
- ...e.applyStyles("dark", { backgroundImage: "none" })
153
- }
154
- }
155
- ]
156
- }))), oe = /*#__PURE__*/ V.forwardRef(function(e, t) {
157
- let n = x({
158
- props: e,
159
- name: "MuiAppBar"
160
- }), { className: r, color: i = "primary", enableColorOnDark: a = !1, position: o = "fixed", ...s } = n, c = {
161
- ...n,
162
- color: i,
163
- position: o,
164
- enableColorOnDark: a
165
- }, l = re(c);
166
- return /*#__PURE__*/ (0, U.jsx)(ae, {
167
- square: !0,
168
- component: "header",
169
- ownerState: c,
170
- elevation: 4,
171
- className: _(l.root, r, o === "fixed" && "mui-fixed"),
172
- ref: t,
173
- ...s
174
- });
175
- });
176
- process.env.NODE_ENV !== "production" && (oe.propTypes = {
177
- children: H.default.node,
178
- classes: H.default.object,
179
- className: H.default.string,
180
- color: H.default.oneOfType([H.default.oneOf([
181
- "default",
182
- "inherit",
183
- "primary",
184
- "secondary",
185
- "transparent",
186
- "error",
187
- "info",
188
- "success",
189
- "warning"
190
- ]), H.default.string]),
191
- elevation: H.default.number,
192
- enableColorOnDark: H.default.bool,
193
- position: H.default.oneOf([
194
- "absolute",
195
- "fixed",
196
- "relative",
197
- "static",
198
- "sticky"
199
- ]),
200
- square: H.default.bool,
201
- sx: H.default.oneOfType([
202
- H.default.arrayOf(H.default.oneOfType([
203
- H.default.func,
204
- H.default.object,
205
- H.default.bool
206
- ])),
207
- H.default.func,
208
- H.default.object
209
- ])
210
- });
211
- //#endregion
212
- //#region ../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/internal/svg-icons/Cancel.mjs
213
- var se = v(/*#__PURE__*/ (0, U.jsx)("path", { d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" }), "Cancel");
214
- //#endregion
215
- //#region ../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/Chip/chipClasses.mjs
216
- function ce(e) {
217
- return h("MuiChip", e);
218
- }
219
- var G = E("MuiChip", [
220
- "root",
221
- "sizeSmall",
222
- "sizeMedium",
223
- "colorDefault",
224
- "colorError",
225
- "colorInfo",
226
- "colorPrimary",
227
- "colorSecondary",
228
- "colorSuccess",
229
- "colorWarning",
230
- "disabled",
231
- "clickable",
232
- "deletable",
233
- "outlined",
234
- "filled",
235
- "avatar",
236
- "icon",
237
- "label",
238
- "deleteIcon",
239
- "focusVisible"
240
- ]), le = (e) => {
241
- let { classes: t, disabled: n, size: r, color: i, onDelete: a, clickable: o, variant: c } = e, l = {
242
- root: [
243
- "root",
244
- c,
245
- n && "disabled",
246
- `size${s(r)}`,
247
- `color${s(i)}`,
248
- o && "clickable",
249
- a && "deletable"
250
- ],
251
- label: ["label"],
252
- avatar: ["avatar"],
253
- icon: ["icon"],
254
- deleteIcon: ["deleteIcon"]
255
- };
256
- return u(l, ce, t);
257
- }, ue = b("div", {
258
- name: "MuiChip",
259
- slot: "Root",
260
- shouldForwardProp: (e) => o(e) && e !== "focusableWhenDisabled" && e !== "skipFocusWhenDisabled",
261
- overridesResolver: (e, t) => {
262
- let { ownerState: n } = e, { color: r, clickable: i, onDelete: a, size: o, variant: c } = n;
263
- return [
264
- { [`& .${G.avatar}`]: t.avatar },
265
- { [`& .${G.icon}`]: t.icon },
266
- { [`& .${G.deleteIcon}`]: t.deleteIcon },
267
- t.root,
268
- t[`size${s(o)}`],
269
- t[`color${s(r)}`],
270
- i && t.clickable,
271
- a && t.deletable,
272
- t[c]
273
- ];
274
- }
275
- })(t(({ theme: e }) => {
276
- let t = e.palette.mode === "light" ? e.palette.grey[700] : e.palette.grey[300];
277
- return {
278
- maxWidth: "100%",
279
- fontFamily: e.typography.fontFamily,
280
- fontSize: e.typography.pxToRem(13),
281
- display: "inline-flex",
282
- alignItems: "center",
283
- justifyContent: "center",
284
- height: 32,
285
- lineHeight: 1.5,
286
- color: (e.vars || e).palette.text.primary,
287
- backgroundColor: (e.vars || e).palette.action.selected,
288
- borderRadius: 16,
289
- whiteSpace: "nowrap",
290
- ...O(e, ["background-color", "box-shadow"]),
291
- cursor: "unset",
292
- outline: 0,
293
- textDecoration: "none",
294
- border: 0,
295
- padding: 0,
296
- verticalAlign: "middle",
297
- boxSizing: "border-box",
298
- [`&.${G.disabled}`]: {
299
- opacity: (e.vars || e).palette.action.disabledOpacity,
300
- pointerEvents: "none"
301
- },
302
- [`& .${G.avatar}`]: {
303
- marginLeft: 5,
304
- marginRight: -6,
305
- width: 24,
306
- height: 24,
307
- color: e.vars ? e.vars.palette.Chip.defaultAvatarColor : t,
308
- fontSize: e.typography.pxToRem(12)
309
- },
310
- [`& .${G.icon}`]: {
311
- marginLeft: 5,
312
- marginRight: -6
313
- },
314
- [`& .${G.deleteIcon}`]: {
315
- WebkitTapHighlightColor: "transparent",
316
- color: e.alpha((e.vars || e).palette.text.primary, .26),
317
- fontSize: 22,
318
- cursor: "pointer",
319
- margin: "0 5px 0 -6px",
320
- "&:hover": { color: e.alpha((e.vars || e).palette.text.primary, .4) }
321
- },
322
- variants: [
323
- {
324
- props: { color: "primary" },
325
- style: { [`& .${G.avatar}`]: {
326
- color: (e.vars || e).palette.primary.contrastText,
327
- backgroundColor: (e.vars || e).palette.primary.dark
328
- } }
329
- },
330
- {
331
- props: { color: "secondary" },
332
- style: { [`& .${G.avatar}`]: {
333
- color: (e.vars || e).palette.secondary.contrastText,
334
- backgroundColor: (e.vars || e).palette.secondary.dark
335
- } }
336
- },
337
- {
338
- props: { size: "small" },
339
- style: {
340
- height: 24,
341
- [`& .${G.avatar}`]: {
342
- marginLeft: 4,
343
- marginRight: -4,
344
- width: 18,
345
- height: 18,
346
- fontSize: e.typography.pxToRem(10)
347
- },
348
- [`& .${G.icon}`]: {
349
- fontSize: 18,
350
- marginLeft: 4,
351
- marginRight: -4
352
- },
353
- [`& .${G.deleteIcon}`]: {
354
- fontSize: 16,
355
- marginRight: 4,
356
- marginLeft: -4
357
- }
358
- }
359
- },
360
- ...Object.entries(e.palette).filter(C(["contrastText"])).map(([t]) => ({
361
- props: { color: t },
362
- style: {
363
- backgroundColor: (e.vars || e).palette[t].main,
364
- color: (e.vars || e).palette[t].contrastText,
365
- [`& .${G.deleteIcon}`]: {
366
- color: e.alpha((e.vars || e).palette[t].contrastText, .7),
367
- "&:hover, &:active": { color: (e.vars || e).palette[t].contrastText }
368
- }
369
- }
370
- })),
371
- {
372
- props: (e) => e.iconColor === e.color,
373
- style: { [`& .${G.icon}`]: { color: e.vars ? e.vars.palette.Chip.defaultIconColor : t } }
374
- },
375
- {
376
- props: (e) => e.iconColor === e.color && e.color !== "default",
377
- style: { [`& .${G.icon}`]: { color: "inherit" } }
378
- },
379
- {
380
- props: { onDelete: !0 },
381
- style: !e.focusVisible && { [`&.${G.focusVisible}`]: { backgroundColor: e.alpha((e.vars || e).palette.action.selected, `${(e.vars || e).palette.action.selectedOpacity} + ${(e.vars || e).palette.action.focusOpacity}`) } }
382
- },
383
- ...Object.entries(e.palette).filter(C(["dark"])).map(([t]) => ({
384
- props: {
385
- color: t,
386
- onDelete: !0
387
- },
388
- style: !e.focusVisible && { [`&.${G.focusVisible}`]: { background: (e.vars || e).palette[t].dark } }
389
- })),
390
- {
391
- props: { clickable: !0 },
392
- style: {
393
- userSelect: "none",
394
- WebkitTapHighlightColor: "transparent",
395
- cursor: "pointer",
396
- "&:hover": { backgroundColor: e.alpha((e.vars || e).palette.action.selected, `${(e.vars || e).palette.action.selectedOpacity} + ${(e.vars || e).palette.action.hoverOpacity}`) },
397
- ...!e.focusVisible && { [`&.${G.focusVisible}`]: { backgroundColor: e.alpha((e.vars || e).palette.action.selected, `${(e.vars || e).palette.action.selectedOpacity} + ${(e.vars || e).palette.action.focusOpacity}`) } },
398
- "&:active": { boxShadow: (e.vars || e).shadows[1] }
399
- }
400
- },
401
- ...Object.entries(e.palette).filter(C(["dark"])).map(([t]) => ({
402
- props: {
403
- color: t,
404
- clickable: !0
405
- },
406
- style: {
407
- "&:hover": { backgroundColor: (e.vars || e).palette[t].dark },
408
- ...!e.focusVisible && { [`&.${G.focusVisible}`]: { backgroundColor: (e.vars || e).palette[t].dark } }
409
- }
410
- })),
411
- {
412
- props: { variant: "outlined" },
413
- style: {
414
- backgroundColor: "transparent",
415
- border: e.vars ? `1px solid ${e.vars.palette.Chip.defaultBorder}` : `1px solid ${e.palette.mode === "light" ? e.palette.grey[400] : e.palette.grey[700]}`,
416
- [`&.${G.clickable}:hover`]: { backgroundColor: (e.vars || e).palette.action.hover },
417
- ...!e.focusVisible && { [`&.${G.focusVisible}`]: { backgroundColor: (e.vars || e).palette.action.focus } },
418
- [`& .${G.avatar}`]: { marginLeft: 4 },
419
- [`& .${G.icon}`]: { marginLeft: 4 },
420
- [`& .${G.deleteIcon}`]: { marginRight: 5 }
421
- }
422
- },
423
- {
424
- props: {
425
- size: "small",
426
- variant: "outlined"
427
- },
428
- style: {
429
- [`& .${G.avatar}`]: { marginLeft: 2 },
430
- [`& .${G.icon}`]: { marginLeft: 2 },
431
- [`& .${G.deleteIcon}`]: { marginRight: 3 }
432
- }
433
- },
434
- ...Object.entries(e.palette).filter(C()).map(([t]) => ({
435
- props: {
436
- variant: "outlined",
437
- color: t
438
- },
439
- style: {
440
- color: (e.vars || e).palette[t].main,
441
- border: `1px solid ${e.alpha((e.vars || e).palette[t].main, .7)}`,
442
- [`&.${G.clickable}:hover`]: { backgroundColor: e.alpha((e.vars || e).palette[t].main, (e.vars || e).palette.action.hoverOpacity) },
443
- ...!e.focusVisible && { [`&.${G.focusVisible}`]: { backgroundColor: e.alpha((e.vars || e).palette[t].main, (e.vars || e).palette.action.focusOpacity) } },
444
- [`& .${G.deleteIcon}`]: {
445
- color: e.alpha((e.vars || e).palette[t].main, .7),
446
- "&:hover, &:active": { color: (e.vars || e).palette[t].main }
447
- }
448
- }
449
- }))
450
- ]
451
- };
452
- })), de = b("span", {
453
- name: "MuiChip",
454
- slot: "Label"
455
- })({
456
- overflow: "hidden",
457
- textOverflow: "ellipsis",
458
- paddingLeft: 12,
459
- paddingRight: 12,
460
- whiteSpace: "nowrap",
461
- variants: [
462
- {
463
- props: { variant: "outlined" },
464
- style: {
465
- paddingLeft: 11,
466
- paddingRight: 11
467
- }
468
- },
469
- {
470
- props: { size: "small" },
471
- style: {
472
- paddingLeft: 8,
473
- paddingRight: 8
474
- }
475
- },
476
- {
477
- props: {
478
- size: "small",
479
- variant: "outlined"
480
- },
481
- style: {
482
- paddingLeft: 7,
483
- paddingRight: 7
484
- }
485
- }
486
- ]
487
- });
488
- function fe(e) {
489
- return e.key === "Backspace" || e.key === "Delete";
490
- }
491
- var pe = /*#__PURE__*/ V.forwardRef(function(e, t) {
492
- let n = x({
493
- props: e,
494
- name: "MuiChip"
495
- }), { avatar: i, className: a, clickable: o, color: s = "default", component: c, deleteIcon: l, disabled: u = !1, icon: d, label: f, onClick: p, onDelete: m, onKeyDown: h, onKeyUp: g, size: v = "medium", variant: y = "filled", tabIndex: b, skipFocusWhenDisabled: S = !1, slots: C = {}, slotProps: T = {}, ...E } = n, { nativeButton: D, ...O } = E, k = V.useRef(null), A = r(k, t), j = (e) => {
496
- e.stopPropagation(), m(e);
497
- }, ee = (e) => {
498
- e.currentTarget === e.target && fe(e) && e.preventDefault(), h && h(e);
499
- }, te = (e) => {
500
- e.currentTarget === e.target && m && fe(e) && m(e), g && g(e);
501
- }, M = o !== !1 && p ? !0 : o, P = M || m ? w : c || "div", F = {
502
- ...n,
503
- component: P,
504
- disabled: u,
505
- size: v,
506
- color: s,
507
- iconColor: /*#__PURE__*/ V.isValidElement(d) && d.props.color || s,
508
- onDelete: !!m,
509
- clickable: M,
510
- variant: y
511
- }, I = le(F), L = P === w ? {
512
- component: c || "div",
513
- internalNativeButton: !1,
514
- focusVisibleClassName: I.focusVisible,
515
- ...m && { disableRipple: !0 },
516
- ...D !== void 0 && { nativeButton: D }
517
- } : {}, R = null;
518
- m && (R = l && /*#__PURE__*/ V.isValidElement(l) ? /*#__PURE__*/ V.cloneElement(l, {
519
- className: _(l.props.className, I.deleteIcon),
520
- onClick: j
521
- }) : /*#__PURE__*/ (0, U.jsx)(se, {
522
- className: I.deleteIcon,
523
- onClick: j
524
- }));
525
- let z = null;
526
- i && /*#__PURE__*/ V.isValidElement(i) && (z = /*#__PURE__*/ V.cloneElement(i, { className: _(I.avatar, i.props.className) }));
527
- let B = null;
528
- d && /*#__PURE__*/ V.isValidElement(d) && (B = /*#__PURE__*/ V.cloneElement(d, { className: _(I.icon, d.props.className) })), process.env.NODE_ENV !== "production" && z && B && console.error("MUI: The Chip component can not handle the avatar and the icon prop at the same time. Pick one.");
529
- let H = {
530
- slots: C,
531
- slotProps: T
532
- }, [W, ne] = N("root", {
533
- elementType: ue,
534
- externalForwardedProps: {
535
- ...H,
536
- ...O
537
- },
538
- ownerState: F,
539
- shouldForwardComponentProp: !0,
540
- ref: A,
541
- className: _(I.root, a),
542
- additionalProps: {
543
- disabled: M && u ? !0 : void 0,
544
- tabIndex: S && u ? -1 : b,
545
- ...L
546
- },
547
- getSlotProps: (e) => ({
548
- ...e,
549
- onClick: (t) => {
550
- e.onClick?.(t), p?.(t);
551
- },
552
- onKeyDown: (t) => {
553
- e.onKeyDown?.(t), ee(t);
554
- },
555
- onKeyUp: (t) => {
556
- e.onKeyUp?.(t), te(t);
557
- }
558
- })
559
- }), [re, ie] = N("label", {
560
- elementType: de,
561
- externalForwardedProps: H,
562
- ownerState: F,
563
- className: I.label
564
- });
565
- return /*#__PURE__*/ (0, U.jsxs)(W, {
566
- as: P,
567
- ...ne,
568
- children: [
569
- z || B,
570
- /*#__PURE__*/ (0, U.jsx)(re, {
571
- ...ie,
572
- children: f
573
- }),
574
- R
575
- ]
576
- });
577
- });
578
- process.env.NODE_ENV !== "production" && (pe.propTypes = {
579
- avatar: H.default.element,
580
- children: W,
581
- classes: H.default.object,
582
- className: H.default.string,
583
- clickable: H.default.bool,
584
- color: H.default.oneOfType([H.default.oneOf([
585
- "default",
586
- "primary",
587
- "secondary",
588
- "error",
589
- "info",
590
- "success",
591
- "warning"
592
- ]), H.default.string]),
593
- component: H.default.elementType,
594
- deleteIcon: H.default.element,
595
- disabled: H.default.bool,
596
- icon: H.default.element,
597
- label: H.default.node,
598
- nativeButton: H.default.bool,
599
- onClick: H.default.func,
600
- onDelete: H.default.func,
601
- onKeyDown: H.default.func,
602
- onKeyUp: H.default.func,
603
- size: H.default.oneOfType([H.default.oneOf(["medium", "small"]), H.default.string]),
604
- skipFocusWhenDisabled: H.default.bool,
605
- slotProps: H.default.shape({
606
- label: H.default.oneOfType([H.default.func, H.default.object]),
607
- root: H.default.oneOfType([H.default.func, H.default.object])
608
- }),
609
- slots: H.default.shape({
610
- label: H.default.elementType,
611
- root: H.default.elementType
612
- }),
613
- sx: H.default.oneOfType([
614
- H.default.arrayOf(H.default.oneOfType([
615
- H.default.func,
616
- H.default.object,
617
- H.default.bool
618
- ])),
619
- H.default.func,
620
- H.default.object
621
- ]),
622
- tabIndex: H.default.number,
623
- variant: H.default.oneOfType([H.default.oneOf(["filled", "outlined"]), H.default.string])
624
- });
625
- //#endregion
626
- //#region ../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/Slide/Slide.mjs
627
- var me = { visibility: "hidden" }, he = {};
628
- function ge(e) {
629
- return typeof e == "string" && /^translate\(.+,\s*.+\)$/.test(e);
630
- }
631
- function _e(e, t, n, r = he) {
632
- let { resetInlineTransform: i = !0 } = r, a = n && n.getBoundingClientRect(), o = j(t), s, c;
633
- if (i) {
634
- let e = t.style.transform, n = t.style.transition;
635
- t.style.transition = "", t.style.transform = "", s = t.getBoundingClientRect(), c = o.getComputedStyle(t).getPropertyValue("transform"), t.style.transform = e, t.style.transition = n;
636
- } else s = t.getBoundingClientRect(), c = o.getComputedStyle(t).getPropertyValue("transform");
637
- let { offsetX: l, offsetY: u } = d(c);
638
- return e === "left" ? a ? `translateX(${a.right + l - s.left}px)` : `translateX(${o.innerWidth + l - s.left}px)` : e === "right" ? a ? `translateX(-${s.right - a.left - l}px)` : `translateX(-${s.left + s.width - l}px)` : e === "up" ? a ? `translateY(${a.bottom + u - s.top}px)` : `translateY(${o.innerHeight + u - s.top}px)` : a ? `translateY(-${s.top - a.top + s.height - u}px)` : `translateY(-${s.top + s.height - u}px)`;
639
- }
640
- function ve(e) {
641
- return typeof e == "function" ? e() : e;
642
- }
643
- function ye(e, t, n, r) {
644
- let i = _e(e, t, ve(n), r);
645
- i && (t.style.transform = i);
646
- }
647
- var be = /*#__PURE__*/ V.forwardRef(function(e, t) {
648
- let i = l(), a = {
649
- enter: i.transitions.easing.easeOut,
650
- exit: i.transitions.easing.sharp
651
- }, o = {
652
- enter: i.transitions.duration.enteringScreen,
653
- exit: i.transitions.duration.leavingScreen
654
- }, { addEndListener: s, appear: c = !0, children: u, container: d, disablePrefersReducedMotion: f = !1, direction: p = "down", easing: h = a, in: _, onEnter: v, onEntered: y, onEntering: b, onExit: x, onExited: S, onExiting: C, style: w, timeout: T = o, ...E } = e, O = g(i.motion.reducedMotion, f), k = V.useRef(null), A = V.useRef(!1), te = r(F(u), k, t), M = n(k, (e, t) => {
655
- ye(p, e, d), O.shouldReduceMotion || D(e), v && v(e, t);
656
- }), N = n(k, (e, t) => {
657
- let n = m({
658
- timeout: T,
659
- style: w,
660
- easing: h
661
- }, { mode: "enter" }), r = O.getTransitionTiming({
662
- duration: n.duration,
663
- delay: n.delay
664
- });
665
- e.style.transition = i.transitions.create("transform", {
666
- duration: r.duration,
667
- easing: n.easing,
668
- delay: r.delay
669
- }), e.style.transform = "none", b && b(e, t);
670
- }), P = n(k, y), L = n(k, C), R = n(k, (e) => {
671
- let t = m({
672
- timeout: T,
673
- style: w,
674
- easing: h
675
- }, { mode: "exit" }), n = O.getTransitionTiming({
676
- duration: t.duration,
677
- delay: t.delay
678
- });
679
- e.style.transition = i.transitions.create("transform", {
680
- duration: n.duration,
681
- easing: t.easing,
682
- delay: n.delay
683
- });
684
- let r = ge(e.style.transform);
685
- A.current = r, ye(p, e, d, { resetInlineTransform: !r }), x && x(e);
686
- }), z = n(k, (e) => {
687
- A.current = !1, e.style.transition = "", S && S(e);
688
- }), B = s ? (e) => {
689
- s(k.current, e);
690
- } : void 0, H = V.useCallback(() => {
691
- k.current && ye(p, k.current, d);
692
- }, [p, d]);
693
- return V.useEffect(() => {
694
- if (_ || p === "down" || p === "right") return;
695
- let e = I(() => {
696
- k.current && ye(p, k.current, d);
697
- }), t = j(k.current);
698
- return t.addEventListener("resize", e), () => {
699
- e.clear(), t.removeEventListener("resize", e);
700
- };
701
- }, [
702
- p,
703
- _,
704
- d
705
- ]), V.useEffect(() => {
706
- !_ && !A.current && H();
707
- }, [_, H]), /*#__PURE__*/ (0, U.jsx)(ee, {
708
- nodeRef: k,
709
- onEnter: M,
710
- onEntered: P,
711
- onEntering: N,
712
- onExit: R,
713
- onExited: z,
714
- onExiting: L,
715
- addEndListener: B,
716
- appear: c,
717
- in: _,
718
- reduceMotion: O.shouldReduceMotion,
719
- timeout: T,
720
- ...E,
721
- children: (e, { ownerState: t, ...n }) => {
722
- let r;
723
- return r = e === "exited" && !_ ? w || u.props.style ? {
724
- visibility: "hidden",
725
- ...w,
726
- ...u.props.style
727
- } : me : w && u.props.style ? {
728
- ...w,
729
- ...u.props.style
730
- } : w || u.props.style, /*#__PURE__*/ V.cloneElement(u, {
731
- ref: te,
732
- style: r,
733
- ...n
734
- });
735
- }
736
- });
737
- });
738
- process.env.NODE_ENV !== "production" && (be.propTypes = {
739
- addEndListener: H.default.func,
740
- appear: H.default.bool,
741
- children: k.isRequired,
742
- container: f(H.default.oneOfType([z, H.default.func]), (e) => {
743
- if (e.open) {
744
- let t = ve(e.container);
745
- if (t && t.nodeType === 1) {
746
- let e = t.getBoundingClientRect();
747
- if (process.env.NODE_ENV !== "production" && A() && e.top === 0 && e.left === 0 && e.right === 0 && e.bottom === 0) return Error([
748
- "MUI: The `container` prop provided to the component is invalid.",
749
- "The anchor element should be part of the document layout.",
750
- "Make sure the element is present in the document or that it's not display none."
751
- ].join("\n"));
752
- } else if (!t || typeof t.getBoundingClientRect != "function" || t.contextElement != null && t.contextElement.nodeType !== 1) return Error(["MUI: The `container` prop provided to the component is invalid.", "It should be an HTML element instance."].join("\n"));
753
- }
754
- return null;
755
- }),
756
- direction: H.default.oneOf([
757
- "down",
758
- "left",
759
- "right",
760
- "up"
761
- ]),
762
- disablePrefersReducedMotion: H.default.bool,
763
- easing: H.default.oneOfType([H.default.shape({
764
- enter: H.default.string,
765
- exit: H.default.string
766
- }), H.default.string]),
767
- in: H.default.bool,
768
- onEnter: H.default.func,
769
- onEntered: H.default.func,
770
- onEntering: H.default.func,
771
- onExit: H.default.func,
772
- onExited: H.default.func,
773
- onExiting: H.default.func,
774
- style: H.default.object,
775
- timeout: H.default.oneOfType([H.default.number, H.default.shape({
776
- appear: H.default.number,
777
- enter: H.default.number,
778
- exit: H.default.number
779
- })])
780
- });
781
- //#endregion
782
- //#region ../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/Drawer/drawerClasses.mjs
783
- function xe(e) {
784
- return h("MuiDrawer", e);
785
- }
786
- E("MuiDrawer", [
787
- "root",
788
- "docked",
789
- "paper",
790
- "anchorLeft",
791
- "anchorRight",
792
- "anchorTop",
793
- "anchorBottom",
794
- "modal"
795
- ]);
796
- //#endregion
797
- //#region ../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/Drawer/Drawer.mjs
798
- var Se = (e, t) => {
799
- let { ownerState: n } = e;
800
- return [
801
- t.root,
802
- (n.variant === "permanent" || n.variant === "persistent") && t.docked,
803
- n.variant === "temporary" && t.modal
804
- ];
805
- }, Ce = (e) => {
806
- let { classes: t, anchor: n, variant: r } = e, i = {
807
- root: ["root", `anchor${s(n)}`],
808
- docked: [(r === "permanent" || r === "persistent") && "docked"],
809
- modal: ["modal"],
810
- paper: ["paper"]
811
- };
812
- return u(i, xe, t);
813
- }, we = b(L, {
814
- name: "MuiDrawer",
815
- slot: "Root",
816
- overridesResolver: Se
817
- })(t(({ theme: e }) => ({ zIndex: (e.vars || e).zIndex.drawer }))), Te = b("div", {
818
- shouldForwardProp: o,
819
- name: "MuiDrawer",
820
- slot: "Docked",
821
- skipVariantsResolver: !1,
822
- overridesResolver: Se
823
- })({ flex: "0 0 auto" }), Ee = b(R, {
824
- name: "MuiDrawer",
825
- slot: "Paper"
826
- })(t(({ theme: e }) => ({
827
- overflowY: "auto",
828
- display: "flex",
829
- flexDirection: "column",
830
- height: "100%",
831
- flex: "1 0 auto",
832
- zIndex: (e.vars || e).zIndex.drawer,
833
- WebkitOverflowScrolling: "touch",
834
- position: "fixed",
835
- top: 0,
836
- outline: 0,
837
- variants: [
838
- {
839
- props: { anchor: "left" },
840
- style: { left: 0 }
841
- },
842
- {
843
- props: { anchor: "top" },
844
- style: {
845
- top: 0,
846
- left: 0,
847
- right: 0,
848
- height: "auto",
849
- maxHeight: "100%"
850
- }
851
- },
852
- {
853
- props: { anchor: "right" },
854
- style: { right: 0 }
855
- },
856
- {
857
- props: { anchor: "bottom" },
858
- style: {
859
- top: "auto",
860
- left: 0,
861
- bottom: 0,
862
- right: 0,
863
- height: "auto",
864
- maxHeight: "100%"
865
- }
866
- },
867
- {
868
- props: ({ ownerState: e }) => e.anchor === "left" && e.variant !== "temporary",
869
- style: { borderRight: `1px solid ${(e.vars || e).palette.divider}` }
870
- },
871
- {
872
- props: ({ ownerState: e }) => e.anchor === "top" && e.variant !== "temporary",
873
- style: { borderBottom: `1px solid ${(e.vars || e).palette.divider}` }
874
- },
875
- {
876
- props: ({ ownerState: e }) => e.anchor === "right" && e.variant !== "temporary",
877
- style: { borderLeft: `1px solid ${(e.vars || e).palette.divider}` }
878
- },
879
- {
880
- props: ({ ownerState: e }) => e.anchor === "bottom" && e.variant !== "temporary",
881
- style: { borderTop: `1px solid ${(e.vars || e).palette.divider}` }
882
- }
883
- ]
884
- }))), De = {
885
- left: "right",
886
- right: "left",
887
- top: "down",
888
- bottom: "up"
889
- };
890
- function Oe(e) {
891
- return ["left", "right"].includes(e);
892
- }
893
- function ke({ direction: e }, t) {
894
- return e === "rtl" && Oe(t) ? De[t] : t;
895
- }
896
- var Ae = /*#__PURE__*/ V.forwardRef(function(e, t) {
897
- let n = x({
898
- props: e,
899
- name: "MuiDrawer"
900
- }), i = l(), a = te(), o = {
901
- enter: i.transitions.duration.enteringScreen,
902
- exit: i.transitions.duration.leavingScreen
903
- }, { anchor: s = "left", children: c, className: u, elevation: d = 16, hideBackdrop: f = !1, ModalProps: p = {}, onClose: m, open: h = !1, transitionDuration: g = o, variant: v = "temporary", slots: y = {}, slotProps: b = {}, ...S } = n, C = V.useRef(!1), w = V.useRef(null), T = r(t, w);
904
- V.useEffect(() => {
905
- C.current = !0;
906
- }, []);
907
- let E = V.useCallback(() => w.current, []), D = ke({ direction: a ? "rtl" : "ltr" }, s), O = s, k = {
908
- ...n,
909
- anchor: O,
910
- elevation: d,
911
- open: h,
912
- variant: v,
913
- ...S
914
- }, A = Ce(k), j = {
915
- slots: y,
916
- slotProps: {
917
- ...b,
918
- backdrop: P(b.backdrop, { transitionDuration: g })
919
- }
920
- }, [ee, M] = N("root", {
921
- ref: T,
922
- elementType: we,
923
- className: _(A.root, A.modal, u),
924
- shouldForwardComponentProp: !0,
925
- ownerState: k,
926
- externalForwardedProps: {
927
- ...j,
928
- ...S,
929
- ...p
930
- },
931
- additionalProps: {
932
- closeAfterTransition: !0,
933
- open: h,
934
- onClose: m,
935
- hideBackdrop: f,
936
- slots: { backdrop: j.slots.backdrop },
937
- slotProps: { backdrop: j.slotProps.backdrop }
938
- }
939
- }), [F, I] = N("paper", {
940
- elementType: Ee,
941
- shouldForwardComponentProp: !0,
942
- className: A.paper,
943
- ownerState: k,
944
- externalForwardedProps: j,
945
- additionalProps: {
946
- elevation: v === "temporary" ? d : 0,
947
- square: !0,
948
- ...v === "temporary" && {
949
- role: "dialog",
950
- "aria-modal": "true",
951
- "data-mui-focusable": "",
952
- tabIndex: -1
953
- }
954
- }
955
- }), [L, R] = N("docked", {
956
- elementType: Te,
957
- ref: T,
958
- className: _(A.root, A.docked, u),
959
- ownerState: k,
960
- externalForwardedProps: j,
961
- additionalProps: S
962
- }), [z, B] = N("transition", {
963
- elementType: be,
964
- ownerState: k,
965
- externalForwardedProps: j,
966
- additionalProps: {
967
- in: h,
968
- direction: De[D],
969
- timeout: g,
970
- appear: C.current,
971
- ...v === "temporary" && (y.transition == null || y.transition === be) && { container: E }
972
- }
973
- }), H = /*#__PURE__*/ (0, U.jsx)(F, {
974
- ...I,
975
- children: c
976
- });
977
- if (v === "permanent") return /*#__PURE__*/ (0, U.jsx)(L, {
978
- ...R,
979
- children: H
980
- });
981
- let W = /*#__PURE__*/ (0, U.jsx)(z, {
982
- ...B,
983
- children: H
984
- });
985
- return v === "persistent" ? /*#__PURE__*/ (0, U.jsx)(L, {
986
- ...R,
987
- children: W
988
- }) : /*#__PURE__*/ (0, U.jsx)(ee, {
989
- ...M,
990
- children: W
991
- });
992
- });
993
- process.env.NODE_ENV !== "production" && (Ae.propTypes = {
994
- anchor: H.default.oneOf([
995
- "bottom",
996
- "left",
997
- "right",
998
- "top"
999
- ]),
1000
- children: H.default.node,
1001
- classes: H.default.object,
1002
- className: H.default.string,
1003
- elevation: M,
1004
- hideBackdrop: H.default.bool,
1005
- ModalProps: H.default.object,
1006
- onClose: H.default.func,
1007
- open: H.default.bool,
1008
- slotProps: H.default.shape({
1009
- backdrop: H.default.oneOfType([H.default.func, H.default.object]),
1010
- docked: H.default.oneOfType([H.default.func, H.default.object]),
1011
- paper: H.default.oneOfType([H.default.func, H.default.object]),
1012
- root: H.default.oneOfType([H.default.func, H.default.object]),
1013
- transition: H.default.oneOfType([H.default.func, H.default.object])
1014
- }),
1015
- slots: H.default.shape({
1016
- backdrop: H.default.elementType,
1017
- docked: H.default.elementType,
1018
- paper: H.default.elementType,
1019
- root: H.default.elementType,
1020
- transition: H.default.elementType
1021
- }),
1022
- sx: H.default.oneOfType([
1023
- H.default.arrayOf(H.default.oneOfType([
1024
- H.default.func,
1025
- H.default.object,
1026
- H.default.bool
1027
- ])),
1028
- H.default.func,
1029
- H.default.object
1030
- ]),
1031
- transitionDuration: H.default.oneOfType([H.default.number, H.default.shape({
1032
- appear: H.default.number,
1033
- enter: H.default.number,
1034
- exit: H.default.number
1035
- })]),
1036
- variant: H.default.oneOf([
1037
- "permanent",
1038
- "persistent",
1039
- "temporary"
1040
- ])
1041
- });
1042
- //#endregion
1043
- //#region ../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/Toolbar/toolbarClasses.mjs
1044
- function je(e) {
1045
- return h("MuiToolbar", e);
1046
- }
1047
- E("MuiToolbar", [
1048
- "root",
1049
- "gutters",
1050
- "regular",
1051
- "dense"
1052
- ]);
1053
- //#endregion
1054
- //#region ../../../../node_modules/.pnpm/@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3.0_react@19.3.0_supports-co_876c01243dbcdb7de27cf1bcc84db747/node_modules/@mui/material/Toolbar/Toolbar.mjs
1055
- var Me = (e) => {
1056
- let { classes: t, disableGutters: n, variant: r } = e;
1057
- return u({ root: [
1058
- "root",
1059
- !n && "gutters",
1060
- r
1061
- ] }, je, t);
1062
- }, Ne = b("div", {
1063
- name: "MuiToolbar",
1064
- slot: "Root",
1065
- overridesResolver: (e, t) => {
1066
- let { ownerState: n } = e;
1067
- return [
1068
- t.root,
1069
- !n.disableGutters && t.gutters,
1070
- t[n.variant]
1071
- ];
1072
- }
1073
- })(t(({ theme: e }) => ({
1074
- position: "relative",
1075
- display: "flex",
1076
- alignItems: "center",
1077
- variants: [
1078
- {
1079
- props: ({ ownerState: e }) => !e.disableGutters,
1080
- style: {
1081
- paddingLeft: e.spacing(2),
1082
- paddingRight: e.spacing(2),
1083
- [e.breakpoints.up("sm")]: {
1084
- paddingLeft: e.spacing(3),
1085
- paddingRight: e.spacing(3)
1086
- }
1087
- }
1088
- },
1089
- {
1090
- props: { variant: "dense" },
1091
- style: { minHeight: 48 }
1092
- },
1093
- {
1094
- props: { variant: "regular" },
1095
- style: e.mixins.toolbar
1096
- }
1097
- ]
1098
- }))), Pe = /*#__PURE__*/ V.forwardRef(function(e, t) {
1099
- let n = x({
1100
- props: e,
1101
- name: "MuiToolbar"
1102
- }), { className: r, component: i = "div", disableGutters: a = !1, variant: o = "regular", ...s } = n, c = {
1103
- ...n,
1104
- component: i,
1105
- disableGutters: a,
1106
- variant: o
1107
- }, l = Me(c);
1108
- return /*#__PURE__*/ (0, U.jsx)(Ne, {
1109
- as: i,
1110
- className: _(l.root, r),
1111
- ref: t,
1112
- ownerState: c,
1113
- ...s
1114
- });
1115
- });
1116
- process.env.NODE_ENV !== "production" && (Pe.propTypes = {
1117
- children: H.default.node,
1118
- classes: H.default.object,
1119
- className: H.default.string,
1120
- component: H.default.elementType,
1121
- disableGutters: H.default.bool,
1122
- sx: H.default.oneOfType([
1123
- H.default.arrayOf(H.default.oneOfType([
1124
- H.default.func,
1125
- H.default.object,
1126
- H.default.bool
1127
- ])),
1128
- H.default.func,
1129
- H.default.object
1130
- ]),
1131
- variant: H.default.oneOfType([H.default.oneOf(["dense", "regular"]), H.default.string])
1132
- });
1133
- //#endregion
1134
- //#region ../../../../node_modules/.pnpm/i18next@26.4.2_typescript@6.0.3/node_modules/i18next/dist/esm/i18next.js
1135
- var K = (e) => typeof e == "string", q = () => {
1136
- let e, t, n = new Promise((n, r) => {
1137
- e = n, t = r;
1138
- });
1139
- return n.resolve = e, n.reject = t, n;
1140
- }, Fe = (e) => e == null ? "" : String(e), Ie = (e, t, n) => {
1141
- e.forEach((e) => {
1142
- t[e] && (n[e] = t[e]);
1143
- });
1144
- }, Le = /###/g, Re = (e) => e && e.includes("###") ? e.replace(Le, ".") : e, ze = (e) => !e || K(e), J = (e, t, n) => {
1145
- let r = K(t) ? t.split(".") : t, i = 0;
1146
- for (; i < r.length - 1;) {
1147
- if (ze(e)) return {};
1148
- let t = Re(r[i]);
1149
- !e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
1150
- }
1151
- return ze(e) ? {} : {
1152
- obj: e,
1153
- k: Re(r[i])
1154
- };
1155
- }, Be = (e, t, n) => {
1156
- let { obj: r, k: i } = J(e, t, Object);
1157
- if (r !== void 0 || t.length === 1) {
1158
- r[i] = n;
1159
- return;
1160
- }
1161
- let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = J(e, o, Object);
1162
- for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = J(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
1163
- s.obj[`${s.k}.${a}`] = n;
1164
- }, Ve = (e, t, n, r) => {
1165
- let { obj: i, k: a } = J(e, t, Object);
1166
- i[a] = i[a] || [], i[a].push(n);
1167
- }, He = (e, t) => {
1168
- let { obj: n, k: r } = J(e, t);
1169
- if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
1170
- }, Ue = (e, t, n) => {
1171
- let r = He(e, n);
1172
- return r === void 0 ? He(t, n) : r;
1173
- }, We = (e, t, n) => {
1174
- for (let r in t) r !== "__proto__" && r !== "constructor" && (Object.prototype.hasOwnProperty.call(e, r) ? K(e[r]) || e[r] instanceof String || K(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : We(e[r], t[r], n) : e[r] = t[r]);
1175
- return e;
1176
- }, Y = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), Ge = {
1177
- "&": "&amp;",
1178
- "<": "&lt;",
1179
- ">": "&gt;",
1180
- "\"": "&quot;",
1181
- "'": "&#39;",
1182
- "/": "&#x2F;"
1183
- }, Ke = (e) => K(e) ? e.replace(/[&<>"'\/]/g, (e) => Ge[e]) : e, qe = class {
1184
- constructor(e) {
1185
- this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
1186
- }
1187
- getRegExp(e) {
1188
- let t = this.regExpMap.get(e);
1189
- if (t !== void 0) return t;
1190
- let n = new RegExp(e);
1191
- return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
1192
- }
1193
- }, Je = [
1194
- " ",
1195
- ",",
1196
- "?",
1197
- "!",
1198
- ";"
1199
- ], Ye = new qe(20), Xe = (e, t, n) => {
1200
- t ||= "", n ||= "";
1201
- let r = Je.filter((e) => !t.includes(e) && !n.includes(e));
1202
- if (r.length === 0) return !0;
1203
- let i = Ye.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
1204
- if (!a) {
1205
- let t = e.indexOf(n);
1206
- t > 0 && !i.test(e.substring(0, t)) && (a = !0);
1207
- }
1208
- return a;
1209
- }, Ze = (e, t, n = ".") => {
1210
- if (!e) return;
1211
- if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
1212
- let r = t.split(n), i = e;
1213
- for (let e = 0; e < r.length;) {
1214
- if (!i || typeof i != "object") return;
1215
- let t, a = "";
1216
- for (let o = e; o < r.length; ++o) if (o !== e && (a += n), a += r[o], t = i[a], t !== void 0) {
1217
- if ([
1218
- "string",
1219
- "number",
1220
- "boolean"
1221
- ].includes(typeof t) && o < r.length - 1) continue;
1222
- e += o - e + 1;
1223
- break;
1224
- }
1225
- i = t;
1226
- }
1227
- return i;
1228
- }, X = (e) => e?.replace(/_/g, "-"), Qe = {
1229
- type: "logger",
1230
- log(e) {
1231
- this.output("log", e);
1232
- },
1233
- warn(e) {
1234
- this.output("warn", e);
1235
- },
1236
- error(e) {
1237
- this.output("error", e);
1238
- },
1239
- output(e, t) {
1240
- console?.[e]?.apply?.(console, t);
1241
- }
1242
- }, Z = new class e {
1243
- constructor(e, t = {}) {
1244
- this.init(e, t);
1245
- }
1246
- init(e, t = {}) {
1247
- this.prefix = t.prefix || "i18next:", this.logger = e || Qe, this.options = t, this.debug = t.debug;
1248
- }
1249
- log(...e) {
1250
- return this.forward(e, "log", "", !0);
1251
- }
1252
- warn(...e) {
1253
- return this.forward(e, "warn", "", !0);
1254
- }
1255
- error(...e) {
1256
- return this.forward(e, "error", "");
1257
- }
1258
- deprecate(...e) {
1259
- return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
1260
- }
1261
- forward(e, t, n, r) {
1262
- return r && !this.debug ? null : (e = e.map((e) => K(e) ? e.replace(/[\r\n\x00-\x1F\x7F]/g, " ") : e), K(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
1263
- }
1264
- create(t) {
1265
- return new e(this.logger, {
1266
- prefix: `${this.prefix}:${t}:`,
1267
- ...this.options
1268
- });
1269
- }
1270
- clone(t) {
1271
- return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
1272
- }
1273
- }(), $e = class {
1274
- constructor() {
1275
- this.observers = {};
1276
- }
1277
- on(e, t) {
1278
- return e.split(" ").forEach((e) => {
1279
- this.observers[e] || (this.observers[e] = /* @__PURE__ */ new Map());
1280
- let n = this.observers[e].get(t) || 0;
1281
- this.observers[e].set(t, n + 1);
1282
- }), this;
1283
- }
1284
- off(e, t) {
1285
- if (this.observers[e]) {
1286
- if (!t) {
1287
- delete this.observers[e];
1288
- return;
1289
- }
1290
- this.observers[e].delete(t);
1291
- }
1292
- }
1293
- once(e, t) {
1294
- let n = (...r) => {
1295
- t(...r), this.off(e, n);
1296
- };
1297
- return this.on(e, n), this;
1298
- }
1299
- emit(e, ...t) {
1300
- this.observers[e] && Array.from(this.observers[e].entries()).forEach(([e, n]) => {
1301
- for (let r = 0; r < n; r++) e(...t);
1302
- }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([n, r]) => {
1303
- for (let i = 0; i < r; i++) n(e, ...t);
1304
- });
1305
- }
1306
- }, et = class extends $e {
1307
- constructor(e, t = {
1308
- ns: ["translation"],
1309
- defaultNS: "translation"
1310
- }) {
1311
- super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
1312
- }
1313
- addNamespaces(e) {
1314
- this.options.ns.includes(e) || this.options.ns.push(e);
1315
- }
1316
- removeNamespaces(e) {
1317
- let t = this.options.ns.indexOf(e);
1318
- t > -1 && this.options.ns.splice(t, 1);
1319
- }
1320
- getResource(e, t, n, r = {}) {
1321
- let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
1322
- e.includes(".") ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : K(n) && i ? o.push(...n.split(i)) : o.push(n)));
1323
- let s = He(this.data, o);
1324
- return !s && !t && !n && e.includes(".") && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !K(n) ? s : Ze(this.data?.[e]?.[t], n, i);
1325
- }
1326
- addResource(e, t, n, r, i = { silent: !1 }) {
1327
- let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
1328
- n && (o = o.concat(a ? n.split(a) : n)), e.includes(".") && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), Be(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
1329
- }
1330
- addResources(e, t, n, r = { silent: !1 }) {
1331
- for (let r in n) (K(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
1332
- r.silent || this.emit("added", e, t, n);
1333
- }
1334
- addResourceBundle(e, t, n, r, i, a = {
1335
- silent: !1,
1336
- skipCopy: !1
1337
- }) {
1338
- let o = [e, t];
1339
- e.includes(".") && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
1340
- let s = He(this.data, o) || {};
1341
- a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? We(s, n, i) : s = {
1342
- ...s,
1343
- ...n
1344
- }, Be(this.data, o, s), a.silent || this.emit("added", e, t, n);
1345
- }
1346
- removeResourceBundle(e, t) {
1347
- this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
1348
- }
1349
- hasResourceBundle(e, t) {
1350
- return this.getResource(e, t) !== void 0;
1351
- }
1352
- getResourceBundle(e, t) {
1353
- return t ||= this.options.defaultNS, this.getResource(e, t);
1354
- }
1355
- getDataByLanguage(e) {
1356
- return this.data[e];
1357
- }
1358
- hasLanguageSomeTranslations(e) {
1359
- let t = this.getDataByLanguage(e);
1360
- return !!(t && Object.keys(t) || []).find((e) => t[e] && Object.keys(t[e]).length > 0);
1361
- }
1362
- toJSON() {
1363
- return this.data;
1364
- }
1365
- }, tt = {
1366
- processors: {},
1367
- addPostProcessor(e) {
1368
- this.processors[e.name] = e;
1369
- },
1370
- handle(e, t, n, r, i) {
1371
- return e.forEach((e) => {
1372
- t = this.processors[e]?.process(t, n, r, i) ?? t;
1373
- }), t;
1374
- }
1375
- }, nt = Symbol("i18next/PATH_KEY");
1376
- function rt() {
1377
- let e = [], t = Object.create(null), n;
1378
- return t.get = (r, i) => (n?.revoke?.(), i === nt ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
1379
- }
1380
- function Q(e, t) {
1381
- let { [nt]: n } = e(rt()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":", a = t?.enableSelector === "strict";
1382
- if (n.length > 1 && i) {
1383
- let e = t?.ns, o = a ? Array.isArray(e) ? e : e ? [e] : null : Array.isArray(e) ? e : null;
1384
- if (o && (a ? o : o.length > 1 ? o.slice(1) : []).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
1385
- }
1386
- return n.join(r);
1387
- }
1388
- var it = (e) => !K(e) && typeof e != "boolean" && typeof e != "number", at = class e extends $e {
1389
- constructor(e, t = {}) {
1390
- super(), Ie([
1391
- "resourceStore",
1392
- "languageUtils",
1393
- "pluralResolver",
1394
- "interpolator",
1395
- "backendConnector",
1396
- "i18nFormat",
1397
- "utils"
1398
- ], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = Z.create("translator"), this.checkedLoadedFor = {};
1399
- }
1400
- changeLanguage(e) {
1401
- e && (this.language = e);
1402
- }
1403
- exists(e, t = { interpolation: {} }) {
1404
- let n = { ...t };
1405
- if (e == null) return !1;
1406
- let r = this.resolve(e, n);
1407
- if (r?.res === void 0) return !1;
1408
- let i = it(r.res);
1409
- return !(n.returnObjects === !1 && i);
1410
- }
1411
- extractFromKey(e, t) {
1412
- let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
1413
- n === void 0 && (n = ":");
1414
- let r = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, i = t.ns || this.options.defaultNS || [], a = n && e.includes(n), o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Xe(e, n, r);
1415
- if (a && !o) {
1416
- let t = e.match(this.interpolator.nestingRegexp);
1417
- if (t && t.length > 0) return {
1418
- key: e,
1419
- namespaces: K(i) ? [i] : i
1420
- };
1421
- let a = e.split(n);
1422
- (n !== r || n === r && this.options.ns.includes(a[0])) && (i = a.shift()), e = a.join(r);
1423
- }
1424
- return {
1425
- key: e,
1426
- namespaces: K(i) ? [i] : i
1427
- };
1428
- }
1429
- translate(t, n, r) {
1430
- let i = typeof n == "object" ? { ...n } : n;
1431
- if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
1432
- typeof t == "function" && (t = Q(t, {
1433
- ...this.options,
1434
- ...i
1435
- })), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? Q(e, {
1436
- ...this.options,
1437
- ...i
1438
- }) : String(e));
1439
- let a = i.returnDetails === void 0 ? this.options.returnDetails : i.returnDetails, o = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, { key: s, namespaces: c } = this.extractFromKey(t[t.length - 1], i), l = c[c.length - 1], u = i.nsSeparator === void 0 ? this.options.nsSeparator : i.nsSeparator;
1440
- u === void 0 && (u = ":");
1441
- let d = i.lng || this.language, f = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
1442
- if (d?.toLowerCase() === "cimode") return f ? a ? {
1443
- res: `${l}${u}${s}`,
1444
- usedKey: s,
1445
- exactUsedKey: s,
1446
- usedLng: d,
1447
- usedNS: l,
1448
- usedParams: this.getUsedParamsDetails(i)
1449
- } : `${l}${u}${s}` : a ? {
1450
- res: s,
1451
- usedKey: s,
1452
- exactUsedKey: s,
1453
- usedLng: d,
1454
- usedNS: l,
1455
- usedParams: this.getUsedParamsDetails(i)
1456
- } : s;
1457
- let p = this.resolve(t, i), m = p?.res, h = p?.usedKey || s, g = p?.exactUsedKey || s, _ = [
1458
- "[object Number]",
1459
- "[object Function]",
1460
- "[object RegExp]"
1461
- ], v = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, y = !this.i18nFormat || this.i18nFormat.handleAsObject, b = i.count !== void 0 && !K(i.count), x = e.hasDefaultValue(i), S = b ? this.pluralResolver.getSuffix(d, i.count, i) : "", C = i.ordinal && b ? this.pluralResolver.getSuffix(d, i.count, { ordinal: !1 }) : "", w = b && !i.ordinal && i.count === 0, T = w && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${S}`] || i[`defaultValue${C}`] || i.defaultValue, E = m;
1462
- y && !m && x && (E = T);
1463
- let D = it(E), O = Object.prototype.toString.apply(E);
1464
- if (y && E && D && !_.includes(O) && !(K(v) && Array.isArray(E))) {
1465
- if (!i.returnObjects && !this.options.returnObjects) {
1466
- this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
1467
- let e = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h, E, {
1468
- ...i,
1469
- ns: c
1470
- }) : `key '${s} (${this.language})' returned an object instead of string.`;
1471
- return a ? (p.res = e, p.usedParams = this.getUsedParamsDetails(i), p) : e;
1472
- }
1473
- if (o) {
1474
- let e = Array.isArray(E), t = e ? [] : {}, n = e ? g : h;
1475
- for (let e in E) if (Object.prototype.hasOwnProperty.call(E, e)) {
1476
- let r = `${n}${o}${e}`;
1477
- t[e] = x && !m ? this.translate(r, {
1478
- ...i,
1479
- defaultValue: it(T) ? T[e] : void 0,
1480
- joinArrays: !1,
1481
- ns: c
1482
- }) : this.translate(r, {
1483
- ...i,
1484
- joinArrays: !1,
1485
- ns: c
1486
- }), t[e] === r && (t[e] = E[e]);
1487
- }
1488
- m = t;
1489
- }
1490
- } else if (y && K(v) && Array.isArray(m)) m = m.join(v), m &&= this.extendTranslation(m, t, i, r);
1491
- else {
1492
- let e = !1, n = !1;
1493
- !this.isValidLookup(m) && x && (e = !0, m = T), this.isValidLookup(m) || (n = !0, m = s);
1494
- let a = (i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n ? void 0 : m, c = x && T !== m && this.options.updateMissing;
1495
- if (n || e || c) {
1496
- if (this.logger.log(c ? "updateKey" : "missingKey", d, l, b && !c ? `${s}${this.pluralResolver.getSuffix(d, i.count, i)}` : s, c ? T : m), o) {
1497
- let e = this.resolve(s, {
1498
- ...i,
1499
- keySeparator: !1
1500
- });
1501
- e && e.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
1502
- }
1503
- let e = [], t = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
1504
- if (this.options.saveMissingTo === "fallback" && t && t[0]) for (let n = 0; n < t.length; n++) e.push(t[n]);
1505
- else this.options.saveMissingTo === "all" ? e = this.languageUtils.toResolveHierarchy(i.lng || this.language) : e.push(i.lng || this.language);
1506
- let n = (e, t, n) => {
1507
- let r = x && n !== m ? n : a;
1508
- this.options.missingKeyHandler ? this.options.missingKeyHandler(e, l, t, r, c, i) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(e, l, t, r, c, i), this.emit("missingKey", e, l, t, m);
1509
- };
1510
- this.options.saveMissing && (this.options.saveMissingPlurals && b ? e.forEach((e) => {
1511
- let t = this.pluralResolver.getSuffixes(e, i);
1512
- w && i[`defaultValue${this.options.pluralSeparator}zero`] && !t.includes(`${this.options.pluralSeparator}zero`) && t.push(`${this.options.pluralSeparator}zero`), t.forEach((t) => {
1513
- n([e], s + t, i[`defaultValue${t}`] || T);
1514
- });
1515
- }) : n(e, s, T));
1516
- }
1517
- m = this.extendTranslation(m, t, i, p, r), n && m === s && this.options.appendNamespaceToMissingKey && (m = `${l}${u}${s}`), (n || e) && this.options.parseMissingKeyHandler && (m = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}${u}${s}` : s, e ? m : void 0, i));
1518
- }
1519
- return a ? (p.res = m, p.usedParams = this.getUsedParamsDetails(i), p) : m;
1520
- }
1521
- extendTranslation(e, t, n, r, i) {
1522
- if (this.i18nFormat?.parse) e = this.i18nFormat.parse(e, {
1523
- ...this.options.interpolation.defaultVariables,
1524
- ...n
1525
- }, n.lng || this.language || r.usedLng, r.usedNS, r.usedKey, { resolved: r });
1526
- else if (!n.skipInterpolation) {
1527
- n.interpolation && this.interpolator.init({
1528
- ...n,
1529
- interpolation: {
1530
- ...this.options.interpolation,
1531
- ...n.interpolation
1532
- }
1533
- });
1534
- let a = K(e) && (n?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n.interpolation.skipOnVariables), o;
1535
- if (a) {
1536
- let t = e.match(this.interpolator.nestingRegexp);
1537
- o = t && t.length;
1538
- }
1539
- let s = n.replace && !K(n.replace) ? n.replace : n;
1540
- if (this.options.interpolation.defaultVariables && (s = {
1541
- ...this.options.interpolation.defaultVariables,
1542
- ...s
1543
- }), e = this.interpolator.interpolate(e, s, n.lng || this.language || r.usedLng, n), a) {
1544
- let t = e.match(this.interpolator.nestingRegexp), r = t && t.length;
1545
- o < r && (n.nest = !1);
1546
- }
1547
- !n.lng && r && r.res && (n.lng = this.language || r.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, (...e) => i?.[0] === e[0] && !n.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`), null) : this.translate(...e, t), n)), n.interpolation && this.interpolator.reset();
1548
- }
1549
- let a = n.postProcess || this.options.postProcess, o = K(a) ? [a] : a;
1550
- return e != null && o?.length && n.applyPostProcessor !== !1 && (e = tt.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
1551
- i18nResolved: {
1552
- ...r,
1553
- usedParams: this.getUsedParamsDetails(n)
1554
- },
1555
- ...n
1556
- } : n, this)), e;
1557
- }
1558
- resolve(e, t = {}) {
1559
- let n, r, i, a, o;
1560
- return K(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? Q(e, {
1561
- ...this.options,
1562
- ...t
1563
- }) : e)), e.forEach((e) => {
1564
- if (this.isValidLookup(n)) return;
1565
- let s = this.extractFromKey(e, t), c = s.key;
1566
- r = c;
1567
- let l = s.namespaces;
1568
- this.options.fallbackNS && (l = l.concat(this.options.fallbackNS));
1569
- let u = t.count !== void 0 && !K(t.count), d = u && !t.ordinal && t.count === 0, f = t.context !== void 0 && (K(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
1570
- l.forEach((e) => {
1571
- this.isValidLookup(n) || (o = e, !this.checkedLoadedFor[`${p[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (this.checkedLoadedFor[`${p[0]}-${e}`] = !0, this.logger.warn(`key "${r}" for languages "${p.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), p.forEach((r) => {
1572
- if (this.isValidLookup(n)) return;
1573
- a = r;
1574
- let o = [c];
1575
- if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(o, c, r, e, t);
1576
- else {
1577
- let e;
1578
- u && (e = this.pluralResolver.getSuffix(r, t.count, t));
1579
- let n = `${this.options.pluralSeparator}zero`, i = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
1580
- if (u && (t.ordinal && e.startsWith(i) && o.push(c + e.replace(i, this.options.pluralSeparator)), o.push(c + e), d && o.push(c + n)), f) {
1581
- let r = `${c}${this.options.contextSeparator || "_"}${t.context}`;
1582
- o.push(r), u && (t.ordinal && e.startsWith(i) && o.push(r + e.replace(i, this.options.pluralSeparator)), o.push(r + e), d && o.push(r + n));
1583
- }
1584
- }
1585
- let s;
1586
- for (; s = o.pop();) this.isValidLookup(n) || (i = s, n = this.getResource(r, e, s, t));
1587
- }));
1588
- });
1589
- }), {
1590
- res: n,
1591
- usedKey: r,
1592
- exactUsedKey: i,
1593
- usedLng: a,
1594
- usedNS: o
1595
- };
1596
- }
1597
- isValidLookup(e) {
1598
- return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
1599
- }
1600
- getResource(e, t, n, r = {}) {
1601
- return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, n, r) : this.resourceStore.getResource(e, t, n, r);
1602
- }
1603
- getUsedParamsDetails(e = {}) {
1604
- let t = [
1605
- "defaultValue",
1606
- "ordinal",
1607
- "context",
1608
- "replace",
1609
- "lng",
1610
- "lngs",
1611
- "fallbackLng",
1612
- "ns",
1613
- "keySeparator",
1614
- "nsSeparator",
1615
- "returnObjects",
1616
- "returnDetails",
1617
- "joinArrays",
1618
- "postProcess",
1619
- "interpolation"
1620
- ], n = e.replace && !K(e.replace), r = n ? e.replace : e;
1621
- if (n && e.count !== void 0 && (r = {
1622
- ...r,
1623
- count: e.count
1624
- }), this.options.interpolation.defaultVariables && (r = {
1625
- ...this.options.interpolation.defaultVariables,
1626
- ...r
1627
- }), !n) {
1628
- r = { ...r };
1629
- for (let e of t) delete r[e];
1630
- }
1631
- return r;
1632
- }
1633
- static hasDefaultValue(e) {
1634
- for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.startsWith("defaultValue") && e[t] !== void 0) return !0;
1635
- return !1;
1636
- }
1637
- }, ot = class {
1638
- constructor(e) {
1639
- this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = Z.create("languageUtils"), this.resolveHierarchyCache = {};
1640
- }
1641
- clearCache() {
1642
- this.resolveHierarchyCache = {};
1643
- }
1644
- getScriptPartFromCode(e) {
1645
- if (e = X(e), !e || !e.includes("-")) return null;
1646
- let t = e.split("-");
1647
- return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
1648
- }
1649
- getLanguagePartFromCode(e) {
1650
- if (e = X(e), !e || !e.includes("-")) return e;
1651
- let t = e.split("-");
1652
- return this.formatLanguageCode(t[0]);
1653
- }
1654
- formatLanguageCode(e) {
1655
- if (K(e) && e.includes("-")) {
1656
- let t;
1657
- try {
1658
- t = Intl.getCanonicalLocales(e)[0];
1659
- } catch {}
1660
- return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
1661
- }
1662
- return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
1663
- }
1664
- isSupportedCode(e) {
1665
- return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.includes(e);
1666
- }
1667
- getBestMatchFromCodes(e) {
1668
- if (!e) return null;
1669
- let t;
1670
- return e.forEach((e) => {
1671
- if (t) return;
1672
- let n = this.formatLanguageCode(e);
1673
- (!this.options.supportedLngs || this.isSupportedCode(n)) && (t = n);
1674
- }), !t && this.options.supportedLngs && e.forEach((e) => {
1675
- if (t) return;
1676
- let n = this.getScriptPartFromCode(e);
1677
- if (this.isSupportedCode(n)) return t = n;
1678
- let r = this.getLanguagePartFromCode(e);
1679
- if (this.isSupportedCode(r)) return t = r;
1680
- t = this.options.supportedLngs.find((e) => e === r ? !0 : !e.includes("-") && !r.includes("-") ? !1 : !!(e.includes("-") && !r.includes("-") && e.slice(0, e.indexOf("-")) === r || e.startsWith(r) && r.length > 1));
1681
- }), t ||= this.getFallbackCodes(this.options.fallbackLng)[0], t;
1682
- }
1683
- getFallbackCodes(e, t) {
1684
- if (!e) return [];
1685
- if (typeof e == "function" && (e = e(t)), K(e) && (e = [e]), Array.isArray(e)) return e;
1686
- if (!t) return e.default || [];
1687
- let n = e[t];
1688
- return n ||= e[this.getScriptPartFromCode(t)], n ||= e[this.formatLanguageCode(t)], n ||= e[this.getLanguagePartFromCode(t)], n ||= e.default, n || [];
1689
- }
1690
- toResolveHierarchy(e, t) {
1691
- let n = this.options.fallbackLng, r = Array.isArray(n) ? n.join("|") : n;
1692
- r !== this._cachedFallbackLng && (this.resolveHierarchyCache = {}, this._cachedFallbackLng = r);
1693
- let i = t === void 0 || t === !1 || K(t), a = t === void 0 && typeof this.options.fallbackLng == "function", o = K(e) && i && !a, s = null;
1694
- if (o) {
1695
- let n;
1696
- n = t === void 0 ? "undefined" : t === !1 ? "boolean:false" : `string:${t}`, s = `${e.length}:${e}|${n}`;
1697
- }
1698
- if (s !== null) {
1699
- let e = this.resolveHierarchyCache[s];
1700
- if (e !== void 0) return e.slice();
1701
- }
1702
- let c = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), l = [], u = (e) => {
1703
- e && (this.isSupportedCode(e) ? l.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
1704
- };
1705
- return K(e) && (e.includes("-") || e.includes("_")) ? (this.options.load !== "languageOnly" && u(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && u(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && u(this.getLanguagePartFromCode(e))) : K(e) && u(this.formatLanguageCode(e)), c.forEach((e) => {
1706
- l.includes(e) || u(this.formatLanguageCode(e));
1707
- }), s === null ? l : (this.resolveHierarchyCache[s] = l, l.slice());
1708
- }
1709
- }, st = {
1710
- zero: 0,
1711
- one: 1,
1712
- two: 2,
1713
- few: 3,
1714
- many: 4,
1715
- other: 5
1716
- }, ct = {
1717
- select: (e) => e === 1 ? "one" : "other",
1718
- resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
1719
- }, lt = class {
1720
- constructor(e, t = {}) {
1721
- this.languageUtils = e, this.options = t, this.logger = Z.create("pluralResolver"), this.pluralRulesCache = {};
1722
- }
1723
- clearCache() {
1724
- this.pluralRulesCache = {};
1725
- }
1726
- getRule(e, t = {}) {
1727
- let n = X(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
1728
- cleanedCode: n,
1729
- type: r
1730
- });
1731
- if (i in this.pluralRulesCache) return this.pluralRulesCache[i];
1732
- let a;
1733
- try {
1734
- a = new Intl.PluralRules(n, { type: r });
1735
- } catch {
1736
- if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), ct;
1737
- if (!e.match(/-|_/)) return ct;
1738
- let n = this.languageUtils.getLanguagePartFromCode(e);
1739
- a = this.getRule(n, t);
1740
- }
1741
- return this.pluralRulesCache[i] = a, a;
1742
- }
1743
- needsPlural(e, t = {}) {
1744
- let n = this.getRule(e, t);
1745
- return n ||= this.getRule("dev", t), n?.resolvedOptions().pluralCategories.length > 1;
1746
- }
1747
- getPluralFormsOfKey(e, t, n = {}) {
1748
- return this.getSuffixes(e, n).map((e) => `${t}${e}`);
1749
- }
1750
- getSuffixes(e, t = {}) {
1751
- let n = this.getRule(e, t);
1752
- return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => st[e] - st[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
1753
- }
1754
- getSuffix(e, t, n = {}) {
1755
- let r = this.getRule(e, n);
1756
- return r ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${r.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
1757
- }
1758
- }, ut = (e, t, n, r = ".", i = !0) => {
1759
- let a = Ue(e, t, n);
1760
- return !a && i && K(n) && (a = Ze(e, n, r), a === void 0 && (a = Ze(t, n, r))), a;
1761
- }, dt = (e) => e.replace(/\$/g, "$$$$"), ft = class {
1762
- constructor(e = {}) {
1763
- this.logger = Z.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
1764
- }
1765
- init(e = {}) {
1766
- e.interpolation ||= { escapeValue: !0 };
1767
- let { escape: t, escapeValue: n, useRawValueToEscape: r, prefix: i, prefixEscaped: a, suffix: o, suffixEscaped: s, formatSeparator: c, unescapeSuffix: l, unescapePrefix: u, nestingPrefix: d, nestingPrefixEscaped: f, nestingSuffix: p, nestingSuffixEscaped: m, nestingOptionsSeparator: h, maxReplaces: g, alwaysFormat: _ } = e.interpolation;
1768
- this.escape = t === void 0 ? Ke : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? Y(i) : a || "{{", this.suffix = o ? Y(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u ? Y(u) : "-", this.unescapeSuffix = this.unescapePrefix ? "" : l ? Y(l) : "", this.nestingPrefix = d ? Y(d) : f || Y("$t("), this.nestingSuffix = p ? Y(p) : m || Y(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = _ !== void 0 && _, this.resetRegExp();
1769
- }
1770
- reset() {
1771
- this.options && this.init(this.options);
1772
- }
1773
- resetRegExp() {
1774
- let e = (e, t) => e?.source === t ? (e.lastIndex = 0, e) : new RegExp(t, "g");
1775
- this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
1776
- }
1777
- interpolate(e, t, n, r) {
1778
- let i, a, o, s = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (e) => {
1779
- if (!e.includes(this.formatSeparator)) {
1780
- let i = ut(t, s, e, this.options.keySeparator, this.options.ignoreJSONStructure);
1781
- return this.alwaysFormat ? this.format(i, void 0, n, {
1782
- ...r,
1783
- ...t,
1784
- interpolationkey: e
1785
- }) : i;
1786
- }
1787
- let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
1788
- return this.format(ut(t, s, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
1789
- ...r,
1790
- ...t,
1791
- interpolationkey: a
1792
- });
1793
- };
1794
- this.resetRegExp(), !this.escapeValue && typeof e == "string" && /\$t\([^)]*\{[^}]*\{\{/.test(e) && this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");
1795
- let l = r?.missingInterpolationHandler || this.options.missingInterpolationHandler, u = r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables;
1796
- return [{
1797
- regex: this.regexpUnescape,
1798
- safeValue: (e) => e
1799
- }, {
1800
- regex: this.regexp,
1801
- safeValue: (e) => this.escapeValue ? this.escape(e) : e
1802
- }].forEach((t) => {
1803
- for (o = 0; i = t.regex.exec(e);) {
1804
- let n = i[1].trim();
1805
- if (a = c(n), a === void 0) {
1806
- if (typeof l == "function") {
1807
- let t = l(e, i, r);
1808
- a = K(t) ? t : "";
1809
- } else if (r && Object.prototype.hasOwnProperty.call(r, n)) a = "";
1810
- else if (u) {
1811
- a = i[0];
1812
- continue;
1813
- } else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
1814
- } else !K(a) && !this.useRawValueToEscape && (a = Fe(a));
1815
- let s = t.safeValue(a);
1816
- if (e = e.replace(i[0], dt(s)), u ? (t.regex.lastIndex += s.length, t.regex.lastIndex -= i[0].length) : t.regex.lastIndex = 0, o++, o >= this.maxReplaces) break;
1817
- }
1818
- }), e;
1819
- }
1820
- nest(e, t, n = {}) {
1821
- let r, i, a, o = (e, t) => {
1822
- let n = this.nestingOptionsSeparator;
1823
- if (!e.includes(n)) return e;
1824
- let r = e.split(RegExp(`${Y(n)}[ ]*{`)), i = `{${r[1]}`;
1825
- e = r[0], i = this.interpolate(i, a);
1826
- let o = i.match(/'/g), s = i.match(/"/g);
1827
- ((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
1828
- try {
1829
- a = JSON.parse(i), t && (a = {
1830
- ...t,
1831
- ...a
1832
- });
1833
- } catch (t) {
1834
- return this.logger.warn(`failed parsing options string in nesting for key ${e}`, t), `${e}${n}${i}`;
1835
- }
1836
- return a.defaultValue && a.defaultValue.includes(this.prefix) && delete a.defaultValue, e;
1837
- };
1838
- for (; r = this.nestingRegexp.exec(e);) {
1839
- let s = [];
1840
- a = { ...n }, a = a.replace && !K(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
1841
- let c = /{.*}/s.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
1842
- if (c !== -1 && (s = r[1].slice(c).split(this.formatSeparator).map((e) => e.trim()).filter(Boolean), r[1] = r[1].slice(0, c)), i = t(o.call(this, r[1].trim(), a), a), i && r[0] === e && !K(i)) return i;
1843
- K(i) || (i = Fe(i)), i ||= (this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`), ""), s.length && (i = s.reduce((e, t) => this.format(e, t, n.lng, {
1844
- ...n,
1845
- interpolationkey: r[1].trim()
1846
- }), i.trim())), e = e.replace(r[0], dt(Fe(i))), this.regexp.lastIndex = 0;
1847
- }
1848
- return e;
1849
- }
1850
- }, pt = (e) => {
1851
- let t = e.toLowerCase().trim(), n = {};
1852
- if (e.includes("(")) {
1853
- let r = e.split("(");
1854
- t = r[0].toLowerCase().trim();
1855
- let i = r[1].slice(0, -1);
1856
- t === "currency" && !i.includes(":") ? n.currency ||= i.trim() : t === "relativetime" && !i.includes(":") ? n.range ||= i.trim() : i.split(";").forEach((e) => {
1857
- if (e) {
1858
- let [t, ...r] = e.split(":"), i = r.join(":").trim().replace(/^'+|'+$/g, ""), a = t.trim();
1859
- n[a] || (n[a] = i), i === "false" && (n[a] = !1), i === "true" && (n[a] = !0), isNaN(i) || (n[a] = parseInt(i, 10));
1860
- }
1861
- });
1862
- }
1863
- return {
1864
- formatName: t,
1865
- formatOptions: n
1866
- };
1867
- }, mt = (e) => {
1868
- let t = {};
1869
- return (n, r, i) => {
1870
- let a = i;
1871
- i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (a = {
1872
- ...a,
1873
- [i.interpolationkey]: void 0
1874
- });
1875
- let o = r + JSON.stringify(a), s = t[o];
1876
- return s || (s = e(X(r), i), t[o] = s), s(n);
1877
- };
1878
- }, ht = (e) => (t, n, r) => e(X(n), r)(t), gt = class {
1879
- constructor(e = {}) {
1880
- this.logger = Z.create("formatter"), this.options = e, this.init(e);
1881
- }
1882
- init(e, t = { interpolation: {} }) {
1883
- this.formatSeparator = t.interpolation.formatSeparator || ",";
1884
- let n = t.cacheInBuiltFormats ? mt : ht;
1885
- this.formats = {
1886
- number: n((e, t) => {
1887
- let n = new Intl.NumberFormat(e, { ...t });
1888
- return (e) => n.format(e);
1889
- }),
1890
- currency: n((e, t) => {
1891
- let n = new Intl.NumberFormat(e, {
1892
- ...t,
1893
- style: "currency"
1894
- });
1895
- return (e) => n.format(e);
1896
- }),
1897
- datetime: n((e, t) => {
1898
- let n = new Intl.DateTimeFormat(e, { ...t });
1899
- return (e) => n.format(e);
1900
- }),
1901
- relativetime: n((e, t) => {
1902
- let n = new Intl.RelativeTimeFormat(e, { ...t });
1903
- return (e) => n.format(e, t.range || "day");
1904
- }),
1905
- list: n((e, t) => {
1906
- let n = new Intl.ListFormat(e, { ...t });
1907
- return (e) => n.format(e);
1908
- })
1909
- };
1910
- }
1911
- add(e, t) {
1912
- this.formats[e.toLowerCase().trim()] = t;
1913
- }
1914
- addCached(e, t) {
1915
- this.formats[e.toLowerCase().trim()] = mt(t);
1916
- }
1917
- format(e, t, n, r = {}) {
1918
- if (!t || e == null) return e;
1919
- let i = t.split(this.formatSeparator), a = [];
1920
- for (let e = 0; e < i.length; e++) {
1921
- let t = i[e];
1922
- for (; t.indexOf("(") > -1 && !t.includes(")") && e + 1 < i.length;) t = `${t}${this.formatSeparator}${i[++e]}`;
1923
- a.push(t);
1924
- }
1925
- return a.reduce((e, t) => {
1926
- let { formatName: i, formatOptions: a } = pt(t);
1927
- if (this.formats[i]) {
1928
- let t = e;
1929
- try {
1930
- let o = r?.formatParams?.[r.interpolationkey] || {}, s = o.locale || o.lng || r.locale || r.lng || n;
1931
- t = this.formats[i](e, s, {
1932
- ...a,
1933
- ...r,
1934
- ...o
1935
- });
1936
- } catch (e) {
1937
- this.logger.warn(e);
1938
- }
1939
- return t;
1940
- }
1941
- return this.logger.warn(`there was no format function for ${i}`), e;
1942
- }, e);
1943
- }
1944
- }, _t = (e, t) => {
1945
- e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
1946
- }, vt = class extends $e {
1947
- constructor(e, t, n, r = {}) {
1948
- super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = Z.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = r.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r.maxRetries >= 0 ? r.maxRetries : 5, this.retryTimeout = r.retryTimeout >= 1 ? r.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n, r.backend, r);
1949
- }
1950
- queueLoad(e, t, n, r) {
1951
- let i = {}, a = {}, o = {}, s = {};
1952
- return e.forEach((e) => {
1953
- let r = !0;
1954
- t.forEach((t) => {
1955
- let o = `${e}|${t}`;
1956
- !n.reload && this.store.hasResourceBundle(e, t) ? this.state[o] = 2 : this.state[o] < 0 || (this.state[o] === 1 ? a[o] === void 0 && (a[o] = !0) : (this.state[o] = 1, r = !1, a[o] === void 0 && (a[o] = !0), i[o] === void 0 && (i[o] = !0), s[t] === void 0 && (s[t] = !0)));
1957
- }), r || (o[e] = !0);
1958
- }), (Object.keys(i).length || Object.keys(a).length) && this.queue.push({
1959
- pending: a,
1960
- pendingCount: Object.keys(a).length,
1961
- loaded: {},
1962
- errors: [],
1963
- callback: r
1964
- }), {
1965
- toLoad: Object.keys(i),
1966
- pending: Object.keys(a),
1967
- toLoadLanguages: Object.keys(o),
1968
- toLoadNamespaces: Object.keys(s)
1969
- };
1970
- }
1971
- loaded(e, t, n) {
1972
- let r = e.split("|"), i = r[0], a = r[1];
1973
- t && this.emit("failedLoading", i, a, t), !t && n && this.store.addResourceBundle(i, a, n, void 0, void 0, { skipCopy: !0 }), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
1974
- let o = {};
1975
- this.queue.forEach((n) => {
1976
- Ve(n.loaded, [i], a), _t(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
1977
- o[e] || (o[e] = {});
1978
- let t = n.loaded[e];
1979
- t.length && t.forEach((t) => {
1980
- o[e][t] === void 0 && (o[e][t] = !0);
1981
- });
1982
- }), n.done = !0, n.errors.length ? n.callback(n.errors) : n.callback());
1983
- }), this.emit("loaded", o), this.queue = this.queue.filter((e) => !e.done);
1984
- }
1985
- read(e, t, n, r = 0, i = this.retryTimeout, a) {
1986
- if (!e.length) return a(null, {});
1987
- if (this.readingCalls >= this.maxParallelReads) {
1988
- this.waitingReads.push({
1989
- lng: e,
1990
- ns: t,
1991
- fcName: n,
1992
- tried: r,
1993
- wait: i,
1994
- callback: a
1995
- });
1996
- return;
1997
- }
1998
- this.readingCalls++;
1999
- let o = (o, s) => {
2000
- if (this.readingCalls--, this.waitingReads.length > 0) {
2001
- let e = this.waitingReads.shift();
2002
- this.read(e.lng, e.ns, e.fcName, e.tried, e.wait, e.callback);
2003
- }
2004
- if (o && s && r < this.maxRetries) {
2005
- setTimeout(() => {
2006
- this.read(e, t, n, r + 1, i * 2, a);
2007
- }, i);
2008
- return;
2009
- }
2010
- a(o, s);
2011
- }, s = this.backend[n].bind(this.backend);
2012
- if (s.length === 2) {
2013
- try {
2014
- let n = s(e, t);
2015
- n && typeof n.then == "function" ? n.then((e) => o(null, e)).catch(o) : o(null, n);
2016
- } catch (e) {
2017
- o(e);
2018
- }
2019
- return;
2020
- }
2021
- return s(e, t, o);
2022
- }
2023
- prepareLoading(e, t, n = {}, r) {
2024
- if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), r && r();
2025
- K(e) && (e = this.languageUtils.toResolveHierarchy(e)), K(t) && (t = [t]);
2026
- let i = this.queueLoad(e, t, n, r);
2027
- if (!i.toLoad.length) return i.pending.length || r(), null;
2028
- i.toLoad.forEach((e) => {
2029
- this.loadOne(e);
2030
- });
2031
- }
2032
- load(e, t, n) {
2033
- this.prepareLoading(e, t, {}, n);
2034
- }
2035
- reload(e, t, n) {
2036
- this.prepareLoading(e, t, { reload: !0 }, n);
2037
- }
2038
- loadOne(e, t = "") {
2039
- let n = e.split("|"), r = n[0], i = n[1];
2040
- this.read(r, i, "read", void 0, void 0, (n, a) => {
2041
- n && this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`, n), !n && a && this.logger.log(`${t}loaded namespace ${i} for language ${r}`, a), this.loaded(e, n, a);
2042
- });
2043
- }
2044
- saveMissing(e, t, n, r, i, a = {}, o = () => {}) {
2045
- if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t)) {
2046
- this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
2047
- return;
2048
- }
2049
- if (n != null && n !== "") {
2050
- if (this.backend?.create) {
2051
- let s = {
2052
- ...a,
2053
- isUpdate: i
2054
- }, c = this.backend.create.bind(this.backend);
2055
- if (c.length < 6) try {
2056
- let i;
2057
- i = c.length === 5 ? c(e, t, n, r, s) : c(e, t, n, r), i && typeof i.then == "function" ? i.then((e) => o(null, e)).catch(o) : o(null, i);
2058
- } catch (e) {
2059
- o(e);
2060
- }
2061
- else c(e, t, n, r, o, s);
2062
- }
2063
- e && e[0] && this.store.addResource(e[0], t, n, r);
2064
- }
2065
- }
2066
- }, yt = () => ({
2067
- debug: !1,
2068
- initAsync: !0,
2069
- ns: ["translation"],
2070
- defaultNS: ["translation"],
2071
- fallbackLng: ["dev"],
2072
- fallbackNS: !1,
2073
- supportedLngs: !1,
2074
- nonExplicitSupportedLngs: !1,
2075
- load: "all",
2076
- preload: !1,
2077
- keySeparator: ".",
2078
- nsSeparator: ":",
2079
- pluralSeparator: "_",
2080
- contextSeparator: "_",
2081
- enableSelector: !1,
2082
- partialBundledLanguages: !1,
2083
- saveMissing: !1,
2084
- updateMissing: !1,
2085
- saveMissingTo: "fallback",
2086
- saveMissingPlurals: !0,
2087
- missingKeyHandler: !1,
2088
- missingInterpolationHandler: !1,
2089
- postProcess: !1,
2090
- postProcessPassResolved: !1,
2091
- returnNull: !1,
2092
- returnEmptyString: !0,
2093
- returnObjects: !1,
2094
- joinArrays: !1,
2095
- returnedObjectHandler: !1,
2096
- parseMissingKeyHandler: !1,
2097
- appendNamespaceToMissingKey: !1,
2098
- appendNamespaceToCIMode: !1,
2099
- overloadTranslationOptionHandler: (e) => {
2100
- let t = {};
2101
- if (typeof e[1] == "object" && (t = e[1]), K(e[1]) && (t.defaultValue = e[1]), K(e[2]) && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
2102
- let n = e[3] || e[2];
2103
- Object.keys(n).forEach((e) => {
2104
- t[e] = n[e];
2105
- });
2106
- }
2107
- return t;
2108
- },
2109
- interpolation: {
2110
- escapeValue: !0,
2111
- prefix: "{{",
2112
- suffix: "}}",
2113
- formatSeparator: ",",
2114
- unescapePrefix: "-",
2115
- nestingPrefix: "$t(",
2116
- nestingSuffix: ")",
2117
- nestingOptionsSeparator: ",",
2118
- maxReplaces: 1e3,
2119
- skipOnVariables: !0
2120
- },
2121
- cacheInBuiltFormats: !0
2122
- }), bt = (e) => (K(e.ns) && (e.ns = [e.ns]), K(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), K(e.fallbackNS) && (e.fallbackNS = [e.fallbackNS]), e.supportedLngs && !e.supportedLngs.includes("cimode") && (e.supportedLngs = e.supportedLngs.concat(["cimode"])), e), xt = () => {}, St = (e) => {
2123
- Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
2124
- typeof e[t] == "function" && (e[t] = e[t].bind(e));
2125
- });
2126
- }, $ = class e extends $e {
2127
- constructor(e = {}, t) {
2128
- if (super(), this.options = bt(e), this.services = {}, this.logger = Z, this.modules = { external: [] }, St(this), t && !this.isInitialized && !e.isClone) {
2129
- if (!this.options.initAsync) return this.init(e, t), this;
2130
- setTimeout(() => {
2131
- this.init(e, t);
2132
- }, 0);
2133
- }
2134
- }
2135
- init(e = {}, t) {
2136
- this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (K(e.ns) ? e.defaultNS = e.ns : e.ns.includes("translation") || (e.defaultNS = e.ns[0]));
2137
- let n = yt();
2138
- this.options = {
2139
- ...n,
2140
- ...this.options,
2141
- ...bt(e)
2142
- }, this.options.interpolation = {
2143
- ...n.interpolation,
2144
- ...this.options.interpolation
2145
- }, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = n.overloadTranslationOptionHandler);
2146
- let r = (e) => e ? typeof e == "function" ? new e() : e : null;
2147
- if (!this.options.isClone) {
2148
- this.modules.logger ? Z.init(r(this.modules.logger), this.options) : Z.init(null, this.options);
2149
- let e;
2150
- e = this.modules.formatter ? this.modules.formatter : gt;
2151
- let t = new ot(this.options);
2152
- this.store = new et(this.options.resources, this.options);
2153
- let n = this.services;
2154
- n.logger = Z, n.resourceStore = this.store, n.languageUtils = t, n.pluralResolver = new lt(t, { prepend: this.options.pluralSeparator }), e && (n.formatter = r(e), n.formatter.init && n.formatter.init(n, this.options), this.options.interpolation.format = n.formatter.format.bind(n.formatter)), n.interpolator = new ft(this.options), n.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, n.backendConnector = new vt(r(this.modules.backend), n.resourceStore, n, this.options), n.backendConnector.on("*", (e, ...t) => {
2155
- this.emit(e, ...t);
2156
- }), this.modules.languageDetector && (n.languageDetector = r(this.modules.languageDetector), n.languageDetector.init && n.languageDetector.init(n, this.options.detection, this.options)), this.modules.i18nFormat && (n.i18nFormat = r(this.modules.i18nFormat), n.i18nFormat.init && n.i18nFormat.init(this)), this.translator = new at(this.services, this.options), this.translator.on("*", (e, ...t) => {
2157
- this.emit(e, ...t);
2158
- }), this.modules.external.forEach((e) => {
2159
- e.init && e.init(this);
2160
- });
2161
- }
2162
- if (this.format = this.options.interpolation.format, t ||= xt, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
2163
- let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
2164
- e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
2165
- }
2166
- !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), [
2167
- "getResource",
2168
- "hasResourceBundle",
2169
- "getResourceBundle",
2170
- "getDataByLanguage"
2171
- ].forEach((e) => {
2172
- this[e] = (...t) => this.store[e](...t);
2173
- }), [
2174
- "addResource",
2175
- "addResources",
2176
- "addResourceBundle",
2177
- "removeResourceBundle"
2178
- ].forEach((e) => {
2179
- this[e] = (...t) => (this.store[e](...t), this);
2180
- });
2181
- let i = q(), a = () => {
2182
- let e = (e, n) => {
2183
- this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), i.resolve(n), t(e, n);
2184
- };
2185
- if ((this.languages || this.isLanguageChangingTo) && !this.isInitialized) return e(null, this.t.bind(this));
2186
- this.changeLanguage(this.options.lng, e);
2187
- };
2188
- return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
2189
- }
2190
- loadResources(e, t = xt) {
2191
- let n = t, r = K(e) ? e : this.language;
2192
- if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
2193
- if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
2194
- let e = [], t = (t) => {
2195
- t && t !== "cimode" && this.services.languageUtils.toResolveHierarchy(t).forEach((t) => {
2196
- t !== "cimode" && (e.includes(t) || e.push(t));
2197
- });
2198
- };
2199
- r ? t(r) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e) => t(e)), this.options.preload?.forEach?.((e) => t(e)), this.services.backendConnector.load(e, this.options.ns, (e) => {
2200
- !e && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(e);
2201
- });
2202
- } else n(null);
2203
- }
2204
- reloadResources(e, t, n) {
2205
- let r = q();
2206
- return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e ||= this.languages, t ||= this.options.ns, n ||= xt, this.services.backendConnector.reload(e, t, (e) => {
2207
- r.resolve(), n(e);
2208
- }), r;
2209
- }
2210
- use(e) {
2211
- if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
2212
- if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
2213
- return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && tt.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
2214
- }
2215
- setResolvedLanguage(e) {
2216
- if (e && this.languages && !["cimode", "dev"].includes(e)) {
2217
- for (let e = 0; e < this.languages.length; e++) {
2218
- let t = this.languages[e];
2219
- if (!["cimode", "dev"].includes(t) && this.store.hasLanguageSomeTranslations(t)) {
2220
- this.resolvedLanguage = t;
2221
- break;
2222
- }
2223
- }
2224
- !this.resolvedLanguage && !this.languages.includes(e) && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
2225
- }
2226
- }
2227
- changeLanguage(e, t) {
2228
- this.isLanguageChangingTo = e;
2229
- let n = q();
2230
- this.emit("languageChanging", e);
2231
- let r = (e) => {
2232
- this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
2233
- }, i = (i, a) => {
2234
- a ? this.isLanguageChangingTo === e && (r(a), this.translator.changeLanguage(a), this.isLanguageChangingTo = void 0, this.emit("languageChanged", a), this.logger.log("languageChanged", a)) : this.isLanguageChangingTo = void 0, n.resolve((...e) => this.t(...e)), t && t(i, (...e) => this.t(...e));
2235
- }, a = (t) => {
2236
- !e && !t && this.services.languageDetector && (t = []);
2237
- let n = K(t) ? t : t && t[0], a = this.store.hasLanguageSomeTranslations(n) ? n : this.services.languageUtils.getBestMatchFromCodes(K(t) ? [t] : t);
2238
- a && (this.language || r(a), this.translator.language || this.translator.changeLanguage(a), this.services.languageDetector?.cacheUserLanguage?.(a)), this.loadResources(a, (e) => {
2239
- i(e, a);
2240
- });
2241
- };
2242
- return !e && this.services.languageDetector && !this.services.languageDetector.async ? a(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a) : this.services.languageDetector.detect(a) : a(e), n;
2243
- }
2244
- getFixedT(e, t, n, r) {
2245
- let i = r?.scopeNs, a = (e, t, ...r) => {
2246
- let o;
2247
- o = typeof t == "object" ? { ...t } : this.options.overloadTranslationOptionHandler([e, t].concat(r)), o.lng = o.lng || a.lng, o.lngs = o.lngs || a.lngs;
2248
- let s = o.ns !== void 0 && o.ns !== null;
2249
- o.ns = o.ns || a.ns, o.keyPrefix !== "" && (o.keyPrefix = o.keyPrefix || n || a.keyPrefix);
2250
- let c = {
2251
- ...this.options,
2252
- ...o
2253
- };
2254
- Array.isArray(i) && !s && (c.ns = i), typeof o.keyPrefix == "function" && (o.keyPrefix = Q(o.keyPrefix, c));
2255
- let l = this.options.keySeparator || ".", u;
2256
- return o.keyPrefix && Array.isArray(e) ? u = e.map((e) => (typeof e == "function" && (e = Q(e, c)), `${o.keyPrefix}${l}${e}`)) : (typeof e == "function" && (e = Q(e, c)), u = o.keyPrefix ? `${o.keyPrefix}${l}${e}` : e), this.t(u, o);
2257
- };
2258
- return K(e) ? a.lng = e : a.lngs = e, a.ns = t, a.keyPrefix = n, a;
2259
- }
2260
- t(...e) {
2261
- return this.translator?.translate(...e);
2262
- }
2263
- exists(...e) {
2264
- return this.translator?.exists(...e);
2265
- }
2266
- setDefaultNamespace(e) {
2267
- this.options.defaultNS = e;
2268
- }
2269
- hasLoadedNamespace(e, t = {}) {
2270
- if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
2271
- if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
2272
- let n = t.lng || this.resolvedLanguage || this.languages[0], r = this.options ? this.options.fallbackLng : !1, i = this.languages[this.languages.length - 1];
2273
- if (n.toLowerCase() === "cimode") return !0;
2274
- let a = (e, t) => {
2275
- let n = this.services.backendConnector.state[`${e}|${t}`];
2276
- return n === -1 || n === 0 || n === 2;
2277
- };
2278
- if (t.precheck) {
2279
- let e = t.precheck(this, a);
2280
- if (e !== void 0) return e;
2281
- }
2282
- return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
2283
- }
2284
- loadNamespaces(e, t) {
2285
- let n = q();
2286
- return this.options.ns ? (K(e) && (e = [e]), e.forEach((e) => {
2287
- this.options.ns.includes(e) || this.options.ns.push(e);
2288
- }), this.loadResources((e) => {
2289
- n.resolve(), t && t(e);
2290
- }), n) : (t && t(), Promise.resolve());
2291
- }
2292
- loadLanguages(e, t) {
2293
- let n = q();
2294
- K(e) && (e = [e]);
2295
- let r = this.options.preload || [], i = e.filter((e) => !r.includes(e) && this.services.languageUtils.isSupportedCode(e));
2296
- return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
2297
- n.resolve(), t && t(e);
2298
- }), n) : (t && t(), Promise.resolve());
2299
- }
2300
- dir(e) {
2301
- if (e ||= this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language), !e) return "rtl";
2302
- try {
2303
- let t = new Intl.Locale(e);
2304
- if (t && t.getTextInfo) {
2305
- let e = t.getTextInfo();
2306
- if (e && e.direction) return e.direction;
2307
- }
2308
- } catch {}
2309
- let t = /* @__PURE__ */ "ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb".split("."), n = this.services?.languageUtils || new ot(yt());
2310
- return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.includes(n.getLanguagePartFromCode(e)) || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
2311
- }
2312
- static createInstance(t = {}, n) {
2313
- let r = new e(t, n);
2314
- return r.createInstance = e.createInstance, r;
2315
- }
2316
- cloneInstance(t = {}, n = xt) {
2317
- let r = t.forkResourceStore;
2318
- r && delete t.forkResourceStore;
2319
- let i = {
2320
- ...this.options,
2321
- ...t,
2322
- isClone: !0
2323
- }, a = new e(i);
2324
- if ((t.debug !== void 0 || t.prefix !== void 0) && (a.logger = a.logger.clone(t)), [
2325
- "store",
2326
- "services",
2327
- "language"
2328
- ].forEach((e) => {
2329
- a[e] = this[e];
2330
- }), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new et(Object.keys(this.store.data).reduce((e, t) => (e[t] = { ...this.store.data[t] }, e[t] = Object.keys(e[t]).reduce((n, r) => (n[r] = { ...e[t][r] }, n), e[t]), e), {}), i), a.services.resourceStore = a.store), t.interpolation) {
2331
- let e = {
2332
- ...yt().interpolation,
2333
- ...this.options.interpolation,
2334
- ...t.interpolation
2335
- }, n = {
2336
- ...i,
2337
- interpolation: e
2338
- };
2339
- a.services.interpolator = new ft(n);
2340
- }
2341
- return a.translator = new at(a.services, i), a.translator.on("*", (e, ...t) => {
2342
- a.emit(e, ...t);
2343
- }), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
2344
- }
2345
- toJSON() {
2346
- return {
2347
- options: this.options,
2348
- store: this.store,
2349
- language: this.language,
2350
- languages: this.languages,
2351
- resolvedLanguage: this.resolvedLanguage
2352
- };
2353
- }
2354
- }.createInstance();
2355
- $.createInstance, $.dir, $.init, $.loadResources, $.reloadResources, $.use, $.changeLanguage, $.getFixedT;
2356
- var Ct = $.t;
2357
- $.exists, $.setDefaultNamespace, $.hasLoadedNamespace, $.loadNamespaces, $.loadLanguages;
2358
- //#endregion
2359
- //#region ../../../common/frontend/src/components/page/ErrorPageCommon.tsx
2360
- var wt = ({ error: e }) => /* @__PURE__ */ (0, U.jsxs)(T, {
2361
- sx: {
2362
- alignItems: "center",
2363
- display: "flex",
2364
- flexDirection: "column",
2365
- justifyContent: "center",
2366
- width: "100%"
2367
- },
2368
- children: [
2369
- /* @__PURE__ */ (0, U.jsx)(T, {
2370
- sx: { padding: 1 },
2371
- children: /* @__PURE__ */ (0, U.jsx)(S, {
2372
- variant: "h1",
2373
- children: Ct`Something went wrong`
2374
- })
2375
- }),
2376
- /* @__PURE__ */ (0, U.jsx)(T, {
2377
- sx: { padding: 1 },
2378
- children: /* @__PURE__ */ (0, U.jsx)(S, {
2379
- variant: "body2",
2380
- children: e instanceof Error ? e.message : Ct`An unexpected error occurred.`
2381
- })
2382
- }),
2383
- /* @__PURE__ */ (0, U.jsxs)(T, {
2384
- sx: { padding: 1 },
2385
- children: [/* @__PURE__ */ (0, U.jsx)(S, {
2386
- variant: "h6",
2387
- children: Ct`Details for our technicians`
2388
- }), /* @__PURE__ */ (0, U.jsx)(T, {
2389
- component: "pre",
2390
- sx: { fontSize: "0.8rem" },
2391
- children: e?.stack
2392
- })]
2393
- })
2394
- ]
2395
- }), Tt = (0, V.createContext)({
2396
- isDrawerOpen: !1,
2397
- isNoInteraction: !1,
2398
- setIsDrawerOpen: () => null,
2399
- setIsNoInteraction: () => null
2400
- }), Et = ({ children: e, drawerComponent: t, headerComponent: n, isNoInteraction: r }) => {
2401
- let i = l(), { isDrawerOpen: a, setIsNoInteraction: o } = (0, V.use)(Tt);
2402
- return (0, V.useEffect)(() => {
2403
- o(!!r);
2404
- }, [r, o]), /* @__PURE__ */ (0, U.jsxs)(T, {
2405
- sx: {
2406
- display: "flex",
2407
- flexDirection: "column",
2408
- height: "100vh",
2409
- overflow: "hidden",
2410
- position: "relative",
2411
- width: "100vw"
2412
- },
2413
- children: [n, /* @__PURE__ */ (0, U.jsxs)(T, {
2414
- sx: {
2415
- display: "flex",
2416
- flex: 1,
2417
- height: "calc(100vh - 56px)",
2418
- overflow: "hidden",
2419
- position: "relative",
2420
- width: "100%"
2421
- },
2422
- children: [t, /* @__PURE__ */ (0, U.jsx)(T, {
2423
- component: "main",
2424
- sx: {
2425
- flexGrow: 1,
2426
- height: "100%",
2427
- overflow: "hidden",
2428
- position: "relative",
2429
- transition: () => i.transitions.create(["margin", "width"], {
2430
- duration: i.transitions.duration.leavingScreen,
2431
- easing: i.transitions.easing.sharp
2432
- }),
2433
- width: a ? "calc(100% - 340px)" : "100%"
2434
- },
2435
- children: e
2436
- })]
2437
- })]
2438
- });
2439
- }, Dt = ({ children: e }) => {
2440
- let [t, n] = (0, V.useState)(!1), [r, i] = (0, V.useState)(!1), a = (0, V.useMemo)(() => ({
2441
- isDrawerOpen: t,
2442
- isNoInteraction: r,
2443
- setIsDrawerOpen: n,
2444
- setIsNoInteraction: i
2445
- }), [t, r]);
2446
- return /* @__PURE__ */ (0, U.jsx)(Tt, {
2447
- value: a,
2448
- children: e
2449
- });
2450
- }, Ot = ({ children: e }) => {
2451
- let { isDrawerOpen: t } = (0, V.use)(Tt);
2452
- return /* @__PURE__ */ (0, U.jsx)(Ae, {
2453
- anchor: "left",
2454
- open: t,
2455
- sx: {
2456
- "& .MuiDrawer-paper": {
2457
- height: "calc(100% - 56px)",
2458
- overflowY: "auto",
2459
- top: "56px",
2460
- width: 340
2461
- },
2462
- flexShrink: 0,
2463
- width: t ? 340 : 0
2464
- },
2465
- variant: "persistent",
2466
- children: e
2467
- });
2468
- }, kt = v(/*#__PURE__*/ (0, U.jsx)("path", { d: "M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z" }), "Menu"), At = ({ centerComponent: e, icon: t, rightComponent: n, title: r }) => {
2469
- let { isDrawerOpen: i, isNoInteraction: a, setIsDrawerOpen: o } = (0, V.use)(Tt), s = (0, V.useCallback)(() => {
2470
- o(!i);
2471
- }, [i, o]);
2472
- return /* @__PURE__ */ (0, U.jsx)(oe, {
2473
- elevation: 1,
2474
- position: "static",
2475
- sx: {
2476
- backgroundColor: "primary.main",
2477
- color: "#FFFFFF",
2478
- height: 56,
2479
- justifyContent: "center",
2480
- zIndex: (e) => e.zIndex.drawer + 1
2481
- },
2482
- children: /* @__PURE__ */ (0, U.jsxs)(Pe, {
2483
- sx: {
2484
- display: "flex",
2485
- justifyContent: "space-between",
2486
- px: 2
2487
- },
2488
- variant: "dense",
2489
- children: [
2490
- /* @__PURE__ */ (0, U.jsxs)(T, {
2491
- sx: {
2492
- alignItems: "center",
2493
- display: "flex",
2494
- gap: 1.5
2495
- },
2496
- children: [
2497
- !a && /* @__PURE__ */ (0, U.jsx)(y, {
2498
- "aria-label": "open drawer",
2499
- color: "inherit",
2500
- edge: "start",
2501
- onClick: s,
2502
- size: "small",
2503
- children: /* @__PURE__ */ (0, U.jsx)(kt, {})
2504
- }),
2505
- t && /* @__PURE__ */ (0, U.jsx)(U.Fragment, { children: t }),
2506
- /* @__PURE__ */ (0, U.jsx)(S, {
2507
- component: "div",
2508
- noWrap: !0,
2509
- sx: {
2510
- color: "inherit",
2511
- fontSize: "1.05rem",
2512
- fontWeight: 700,
2513
- letterSpacing: "-0.01em"
2514
- },
2515
- variant: "h6",
2516
- children: r
2517
- }),
2518
- /* @__PURE__ */ (0, U.jsx)(S, {
2519
- sx: {
2520
- backgroundColor: "rgba(255, 255, 255, 0.15)",
2521
- borderRadius: 1,
2522
- display: {
2523
- sm: "inline-block",
2524
- xs: "none"
2525
- },
2526
- fontSize: "0.7rem",
2527
- fontWeight: 600,
2528
- px: 1,
2529
- py: .25
2530
- },
2531
- variant: "caption",
2532
- children: "Loculus Tool"
2533
- })
2534
- ]
2535
- }),
2536
- /* @__PURE__ */ (0, U.jsx)(T, {
2537
- sx: {
2538
- alignItems: "center",
2539
- display: "flex",
2540
- gap: 1
2541
- },
2542
- children: e
2543
- }),
2544
- !a && /* @__PURE__ */ (0, U.jsx)(T, {
2545
- sx: {
2546
- alignItems: "center",
2547
- display: "flex",
2548
- gap: 1
2549
- },
2550
- children: n
2551
- })
2552
- ]
2553
- })
2554
- });
2555
- }, jt = v(/*#__PURE__*/ (0, U.jsx)("path", { d: "M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8" }), "Undo"), Mt = v(/*#__PURE__*/ (0, U.jsx)("path", { d: "M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z" }), "Redo");
2556
- //#endregion
2557
- export { Dt as a, $ as c, W as d, Ot as i, Ct as l, jt as n, Et as o, At as r, wt as s, Mt as t, pe as u };
2558
-
2559
- //# sourceMappingURL=Redo.js.map