sera-components 1.1.1 → 1.1.4

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 (43) hide show
  1. package/dist/components/src/basic/CountryFlag.d.ts +75 -0
  2. package/dist/components/src/basic/Language.d.ts +47 -0
  3. package/dist/components/src/basic/Locale.d.ts +31 -0
  4. package/dist/components/src/basic/Menu.d.ts +62 -0
  5. package/dist/components/src/basic/Transition.d.ts +18 -0
  6. package/dist/components/src/basic/index.d.ts +5 -0
  7. package/dist/components/src/data/display/BooleanDisplay.d.ts +2 -0
  8. package/dist/components/src/data/display/DateTimeDisplay.d.ts +4 -0
  9. package/dist/components/src/data/display/ForeignKeyDisplay.d.ts +7 -0
  10. package/dist/components/src/data/display/TextDisplay.d.ts +2 -0
  11. package/dist/components/src/data/display/index.d.ts +17 -0
  12. package/dist/components/src/data/index.d.ts +2 -0
  13. package/dist/components/src/data/inputs/BooleanInput.d.ts +2 -0
  14. package/dist/components/src/data/inputs/ForeignKeyInput.d.ts +22 -0
  15. package/dist/components/src/data/inputs/NumberInput.d.ts +2 -0
  16. package/dist/components/src/data/inputs/PhoneNumberInput.d.ts +13 -0
  17. package/dist/components/src/data/inputs/TextInput.d.ts +2 -0
  18. package/dist/components/src/data/inputs/index.d.ts +21 -0
  19. package/dist/components/src/form/Form.d.ts +61 -0
  20. package/dist/components/src/form/FormItem.d.ts +31 -0
  21. package/dist/components/src/form/FormItemLabel.d.ts +9 -0
  22. package/dist/components/src/form/index.d.ts +3 -0
  23. package/dist/components/src/index.d.ts +7 -0
  24. package/dist/components/src/misc/index.d.ts +2 -0
  25. package/dist/components/src/misc/trie.d.ts +36 -0
  26. package/dist/components/src/misc/utils.d.ts +9 -0
  27. package/dist/components/src/table/EmbeddedTable.d.ts +13 -0
  28. package/dist/components/src/table/Table.d.ts +23 -0
  29. package/dist/components/src/table/TableAction.d.ts +16 -0
  30. package/dist/components/src/table/TableContent.d.ts +9 -0
  31. package/dist/components/src/table/TablePagination.d.ts +14 -0
  32. package/dist/components/src/table/index.d.ts +4 -0
  33. package/dist/components/src/table/makeColumns.d.ts +54 -0
  34. package/dist/components/src/view/MultiTabView.d.ts +1 -0
  35. package/dist/components/src/view/View.d.ts +20 -0
  36. package/dist/components/src/view/ViewItem.d.ts +12 -0
  37. package/dist/components/src/view/ViewNestedPropertyItem.d.ts +43 -0
  38. package/dist/components/src/view/ViewTab.d.ts +16 -0
  39. package/dist/components/src/view/index.d.ts +2 -0
  40. package/dist/index.css +1 -0
  41. package/dist/index.js +3504 -0
  42. package/dist/index.umd.cjs +33 -0
  43. package/package.json +8 -5
package/dist/index.js ADDED
@@ -0,0 +1,3504 @@
1
+ var on = Object.defineProperty;
2
+ var ln = (e, n, t) => n in e ? on(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
+ var X = (e, n, t) => ln(e, typeof n != "symbol" ? n + "" : n, t);
4
+ import * as f from "react";
5
+ import sn, { createContext as un, useContext as ke, useMemo as E, useState as _, useEffect as Te } from "react";
6
+ import { Paper as re, Image as cn, Text as k, Menu as ie, Button as q, Container as dn, Alert as qe, Stack as ge, Flex as B, Loader as Re, NavLink as it, Checkbox as me, Group as D, Input as W, useCombobox as St, Combobox as F, Grid as A, InputBase as fn, PasswordInput as hn, CloseButton as mn, Divider as gn, Tooltip as Ct, Fieldset as pn, Table as Rt, rem as ue, Pagination as xn, MenuTarget as vn, MenuDropdown as yn, MenuItem as bn, Tabs as ye } from "@mantine/core";
7
+ import { IconCheck as wn, IconInfoCircle as We, IconChevronRight as jn, IconSearch as Et, IconHelpOctagonFilled as kt, IconPlus as Sn, IconPencil as Cn, IconReload as Rn, IconDatabaseImport as En, IconDownload as kn, IconSelector as Tn } from "@tabler/icons-react";
8
+ import { observer as ee } from "mobx-react-lite";
9
+ import { InternalLink as Tt } from "sera-route";
10
+ import { IMaskInput as Nn } from "react-imask";
11
+ import { isDraftRecord as Nt, isObjectProperty as pe } from "sera-db";
12
+ import { flexRender as lt, useReactTable as Pt, getCoreRowModel as It, getPaginationRowModel as Pn } from "@tanstack/react-table";
13
+ var be = { exports: {} }, ce = {};
14
+ /**
15
+ * @license React
16
+ * react-jsx-runtime.production.js
17
+ *
18
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
19
+ *
20
+ * This source code is licensed under the MIT license found in the
21
+ * LICENSE file in the root directory of this source tree.
22
+ */
23
+ var st;
24
+ function In() {
25
+ if (st) return ce;
26
+ st = 1;
27
+ var e = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
28
+ function t(a, r, o) {
29
+ var l = null;
30
+ if (o !== void 0 && (l = "" + o), r.key !== void 0 && (l = "" + r.key), "key" in r) {
31
+ o = {};
32
+ for (var s in r)
33
+ s !== "key" && (o[s] = r[s]);
34
+ } else o = r;
35
+ return r = o.ref, {
36
+ $$typeof: e,
37
+ type: a,
38
+ key: l,
39
+ ref: r !== void 0 ? r : null,
40
+ props: o
41
+ };
42
+ }
43
+ return ce.Fragment = n, ce.jsx = t, ce.jsxs = t, ce;
44
+ }
45
+ var de = {};
46
+ /**
47
+ * @license React
48
+ * react-jsx-runtime.development.js
49
+ *
50
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
51
+ *
52
+ * This source code is licensed under the MIT license found in the
53
+ * LICENSE file in the root directory of this source tree.
54
+ */
55
+ var ut;
56
+ function Ln() {
57
+ return ut || (ut = 1, process.env.NODE_ENV !== "production" && function() {
58
+ function e(m) {
59
+ if (m == null) return null;
60
+ if (typeof m == "function")
61
+ return m.$$typeof === G ? null : m.displayName || m.name || null;
62
+ if (typeof m == "string") return m;
63
+ switch (m) {
64
+ case h:
65
+ return "Fragment";
66
+ case b:
67
+ return "Profiler";
68
+ case j:
69
+ return "StrictMode";
70
+ case R:
71
+ return "Suspense";
72
+ case U:
73
+ return "SuspenseList";
74
+ case $:
75
+ return "Activity";
76
+ }
77
+ if (typeof m == "object")
78
+ switch (typeof m.tag == "number" && console.error(
79
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
80
+ ), m.$$typeof) {
81
+ case v:
82
+ return "Portal";
83
+ case y:
84
+ return (m.displayName || "Context") + ".Provider";
85
+ case C:
86
+ return (m._context.displayName || "Context") + ".Consumer";
87
+ case w:
88
+ var S = m.render;
89
+ return m = m.displayName, m || (m = S.displayName || S.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
90
+ case M:
91
+ return S = m.displayName || null, S !== null ? S : e(m.type) || "Memo";
92
+ case ne:
93
+ S = m._payload, m = m._init;
94
+ try {
95
+ return e(m(S));
96
+ } catch {
97
+ }
98
+ }
99
+ return null;
100
+ }
101
+ function n(m) {
102
+ return "" + m;
103
+ }
104
+ function t(m) {
105
+ try {
106
+ n(m);
107
+ var S = !1;
108
+ } catch {
109
+ S = !0;
110
+ }
111
+ if (S) {
112
+ S = console;
113
+ var T = S.error, I = typeof Symbol == "function" && Symbol.toStringTag && m[Symbol.toStringTag] || m.constructor.name || "Object";
114
+ return T.call(
115
+ S,
116
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
117
+ I
118
+ ), n(m);
119
+ }
120
+ }
121
+ function a(m) {
122
+ if (m === h) return "<>";
123
+ if (typeof m == "object" && m !== null && m.$$typeof === ne)
124
+ return "<...>";
125
+ try {
126
+ var S = e(m);
127
+ return S ? "<" + S + ">" : "<...>";
128
+ } catch {
129
+ return "<...>";
130
+ }
131
+ }
132
+ function r() {
133
+ var m = ae.A;
134
+ return m === null ? null : m.getOwner();
135
+ }
136
+ function o() {
137
+ return Error("react-stack-top-frame");
138
+ }
139
+ function l(m) {
140
+ if (et.call(m, "key")) {
141
+ var S = Object.getOwnPropertyDescriptor(m, "key").get;
142
+ if (S && S.isReactWarning) return !1;
143
+ }
144
+ return m.key !== void 0;
145
+ }
146
+ function s(m, S) {
147
+ function T() {
148
+ tt || (tt = !0, console.error(
149
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
150
+ S
151
+ ));
152
+ }
153
+ T.isReactWarning = !0, Object.defineProperty(m, "key", {
154
+ get: T,
155
+ configurable: !0
156
+ });
157
+ }
158
+ function u() {
159
+ var m = e(this.type);
160
+ return nt[m] || (nt[m] = !0, console.error(
161
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
162
+ )), m = this.props.ref, m !== void 0 ? m : null;
163
+ }
164
+ function c(m, S, T, I, J, z, _e, $e) {
165
+ return T = z.ref, m = {
166
+ $$typeof: p,
167
+ type: m,
168
+ key: S,
169
+ props: z,
170
+ _owner: J
171
+ }, (T !== void 0 ? T : null) !== null ? Object.defineProperty(m, "ref", {
172
+ enumerable: !1,
173
+ get: u
174
+ }) : Object.defineProperty(m, "ref", { enumerable: !1, value: null }), m._store = {}, Object.defineProperty(m._store, "validated", {
175
+ configurable: !1,
176
+ enumerable: !1,
177
+ writable: !0,
178
+ value: 0
179
+ }), Object.defineProperty(m, "_debugInfo", {
180
+ configurable: !1,
181
+ enumerable: !1,
182
+ writable: !0,
183
+ value: null
184
+ }), Object.defineProperty(m, "_debugStack", {
185
+ configurable: !1,
186
+ enumerable: !1,
187
+ writable: !0,
188
+ value: _e
189
+ }), Object.defineProperty(m, "_debugTask", {
190
+ configurable: !1,
191
+ enumerable: !1,
192
+ writable: !0,
193
+ value: $e
194
+ }), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
195
+ }
196
+ function d(m, S, T, I, J, z, _e, $e) {
197
+ var L = S.children;
198
+ if (L !== void 0)
199
+ if (I)
200
+ if (rn(L)) {
201
+ for (I = 0; I < L.length; I++)
202
+ x(L[I]);
203
+ Object.freeze && Object.freeze(L);
204
+ } else
205
+ console.error(
206
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
207
+ );
208
+ else x(L);
209
+ if (et.call(S, "key")) {
210
+ L = e(m);
211
+ var oe = Object.keys(S).filter(function(an) {
212
+ return an !== "key";
213
+ });
214
+ I = 0 < oe.length ? "{key: someKey, " + oe.join(": ..., ") + ": ...}" : "{key: someKey}", ot[L + I] || (oe = 0 < oe.length ? "{" + oe.join(": ..., ") + ": ...}" : "{}", console.error(
215
+ `A props object containing a "key" prop is being spread into JSX:
216
+ let props = %s;
217
+ <%s {...props} />
218
+ React keys must be passed directly to JSX without using spread:
219
+ let props = %s;
220
+ <%s key={someKey} {...props} />`,
221
+ I,
222
+ L,
223
+ oe,
224
+ L
225
+ ), ot[L + I] = !0);
226
+ }
227
+ if (L = null, T !== void 0 && (t(T), L = "" + T), l(S) && (t(S.key), L = "" + S.key), "key" in S) {
228
+ T = {};
229
+ for (var Oe in S)
230
+ Oe !== "key" && (T[Oe] = S[Oe]);
231
+ } else T = S;
232
+ return L && s(
233
+ T,
234
+ typeof m == "function" ? m.displayName || m.name || "Unknown" : m
235
+ ), c(
236
+ m,
237
+ L,
238
+ z,
239
+ J,
240
+ r(),
241
+ T,
242
+ _e,
243
+ $e
244
+ );
245
+ }
246
+ function x(m) {
247
+ typeof m == "object" && m !== null && m.$$typeof === p && m._store && (m._store.validated = 1);
248
+ }
249
+ var g = sn, p = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), C = Symbol.for("react.consumer"), y = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), U = Symbol.for("react.suspense_list"), M = Symbol.for("react.memo"), ne = Symbol.for("react.lazy"), $ = Symbol.for("react.activity"), G = Symbol.for("react.client.reference"), ae = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, et = Object.prototype.hasOwnProperty, rn = Array.isArray, Ae = console.createTask ? console.createTask : function() {
250
+ return null;
251
+ };
252
+ g = {
253
+ react_stack_bottom_frame: function(m) {
254
+ return m();
255
+ }
256
+ };
257
+ var tt, nt = {}, rt = g.react_stack_bottom_frame.bind(
258
+ g,
259
+ o
260
+ )(), at = Ae(a(o)), ot = {};
261
+ de.Fragment = h, de.jsx = function(m, S, T, I, J) {
262
+ var z = 1e4 > ae.recentlyCreatedOwnerStacks++;
263
+ return d(
264
+ m,
265
+ S,
266
+ T,
267
+ !1,
268
+ I,
269
+ J,
270
+ z ? Error("react-stack-top-frame") : rt,
271
+ z ? Ae(a(m)) : at
272
+ );
273
+ }, de.jsxs = function(m, S, T, I, J) {
274
+ var z = 1e4 > ae.recentlyCreatedOwnerStacks++;
275
+ return d(
276
+ m,
277
+ S,
278
+ T,
279
+ !0,
280
+ I,
281
+ J,
282
+ z ? Error("react-stack-top-frame") : rt,
283
+ z ? Ae(a(m)) : at
284
+ );
285
+ };
286
+ }()), de;
287
+ }
288
+ var ct;
289
+ function Fn() {
290
+ return ct || (ct = 1, process.env.NODE_ENV === "production" ? be.exports = In() : be.exports = Ln()), be.exports;
291
+ }
292
+ var i = Fn();
293
+ const N = {
294
+ UK: {
295
+ svgFlag: "https://flagcdn.com/gb.svg",
296
+ emojiFlag: "🇬🇧"
297
+ },
298
+ VN: {
299
+ svgFlag: "https://flagcdn.com/vn.svg",
300
+ emojiFlag: "🇻🇳"
301
+ },
302
+ US: {
303
+ svgFlag: "https://flagcdn.com/us.svg",
304
+ emojiFlag: "🇺🇸"
305
+ },
306
+ CA: {
307
+ svgFlag: "https://flagcdn.com/ca.svg",
308
+ emojiFlag: "🇨🇦"
309
+ },
310
+ BR: {
311
+ svgFlag: "https://flagcdn.com/br.svg",
312
+ emojiFlag: "🇧🇷"
313
+ },
314
+ ES: {
315
+ svgFlag: "https://flagcdn.com/es.svg",
316
+ emojiFlag: "🇪🇸"
317
+ },
318
+ IT: {
319
+ svgFlag: "https://flagcdn.com/it.svg",
320
+ emojiFlag: "🇮🇹"
321
+ },
322
+ NZ: {
323
+ svgFlag: "https://flagcdn.com/nz.svg",
324
+ emojiFlag: "🇳🇿"
325
+ },
326
+ MX: {
327
+ svgFlag: "https://flagcdn.com/mx.svg",
328
+ emojiFlag: "🇲🇽"
329
+ },
330
+ CN: {
331
+ svgFlag: "https://flagcdn.com/cn.svg",
332
+ emojiFlag: "🇨🇳"
333
+ },
334
+ AU: {
335
+ svgFlag: "https://flagcdn.com/au.svg",
336
+ emojiFlag: "🇦🇺"
337
+ },
338
+ JP: {
339
+ svgFlag: "https://flagcdn.com/jp.svg",
340
+ emojiFlag: "🇯🇵"
341
+ },
342
+ FR: {
343
+ svgFlag: "https://flagcdn.com/fr.svg",
344
+ emojiFlag: "🇫🇷"
345
+ },
346
+ DE: {
347
+ svgFlag: "https://flagcdn.com/de.svg",
348
+ emojiFlag: "🇩🇪"
349
+ },
350
+ IN: {
351
+ svgFlag: "https://flagcdn.com/in.svg",
352
+ emojiFlag: "🇮🇳"
353
+ }
354
+ }, An = ({ flag: e }) => /* @__PURE__ */ i.jsx(re, { shadow: "xs", w: 20, h: 14, children: /* @__PURE__ */ i.jsx(cn, { src: e.svgFlag, w: 20, h: 14, fit: "cover" }) }), _n = ({ flag: e }) => /* @__PURE__ */ i.jsx(
355
+ k,
356
+ {
357
+ component: "span",
358
+ style: (n) => ({ textShadow: n.shadows.xs }),
359
+ children: e.emojiFlag
360
+ }
361
+ ), Be = navigator.userAgent.includes("Windows") ? An : _n, xe = un(new Intl.Locale("en-US")), Ja = ee(
362
+ ({
363
+ value: e,
364
+ children: n
365
+ }) => /* @__PURE__ */ i.jsx(xe.Provider, { value: e.locale, children: n })
366
+ ), $n = {
367
+ lang2value: {
368
+ en: "Choose Language",
369
+ vi: "Chọn ngôn ngữ"
370
+ }
371
+ }, we = {
372
+ en: {
373
+ name: "English",
374
+ flag: N.US,
375
+ locale: new Intl.Locale("en-US")
376
+ },
377
+ vi: {
378
+ name: "Tiếng Việt",
379
+ flag: N.VN,
380
+ locale: new Intl.Locale("vi-VN")
381
+ }
382
+ }, Xa = ({
383
+ locale: e,
384
+ setLocale: n
385
+ }) => {
386
+ const t = E(() => Object.entries(we).map(
387
+ ([a, { flag: r, name: o, locale: l }]) => /* @__PURE__ */ i.jsx(
388
+ ie.Item,
389
+ {
390
+ onClick: () => n(l),
391
+ leftSection: /* @__PURE__ */ i.jsx(Be, { flag: r }),
392
+ rightSection: e.language === a && /* @__PURE__ */ i.jsx(wn, { size: "15", color: "#2986cc", stroke: 2 }),
393
+ children: /* @__PURE__ */ i.jsx(k, { size: "sm", children: o })
394
+ },
395
+ a
396
+ )
397
+ ), [we, e]);
398
+ return /* @__PURE__ */ i.jsxs(ie, { width: 170, children: [
399
+ /* @__PURE__ */ i.jsx(ie.Target, { children: /* @__PURE__ */ i.jsx(
400
+ q,
401
+ {
402
+ variant: "subtle",
403
+ size: "sm",
404
+ leftSection: /* @__PURE__ */ i.jsx(Be, { flag: we[e.language].flag }),
405
+ children: /* @__PURE__ */ i.jsx(k, { size: "sm", children: we[e.language].name })
406
+ }
407
+ ) }),
408
+ /* @__PURE__ */ i.jsxs(ie.Dropdown, { children: [
409
+ /* @__PURE__ */ i.jsx(ie.Label, { children: /* @__PURE__ */ i.jsx(k, { size: "sm", children: $n.lang2value[e.language] }) }),
410
+ t
411
+ ] })
412
+ ] });
413
+ }, O = ({ value: e }) => {
414
+ const n = ke(xe);
415
+ return e.lang2value[n.language] || e.lang2value[e.lang];
416
+ };
417
+ /**
418
+ * react-router v7.7.1
419
+ *
420
+ * Copyright (c) Remix Software Inc.
421
+ *
422
+ * This source code is licensed under the MIT license found in the
423
+ * LICENSE.md file in the root directory of this source tree.
424
+ *
425
+ * @license MIT
426
+ */
427
+ function P(e, n) {
428
+ if (e === !1 || e === null || typeof e > "u")
429
+ throw new Error(n);
430
+ }
431
+ function V(e, n) {
432
+ if (!e) {
433
+ typeof console < "u" && console.warn(n);
434
+ try {
435
+ throw new Error(n);
436
+ } catch {
437
+ }
438
+ }
439
+ }
440
+ function Ue({
441
+ pathname: e = "/",
442
+ search: n = "",
443
+ hash: t = ""
444
+ }) {
445
+ return n && n !== "?" && (e += n.charAt(0) === "?" ? n : "?" + n), t && t !== "#" && (e += t.charAt(0) === "#" ? t : "#" + t), e;
446
+ }
447
+ function Ke(e) {
448
+ let n = {};
449
+ if (e) {
450
+ let t = e.indexOf("#");
451
+ t >= 0 && (n.hash = e.substring(t), e = e.substring(0, t));
452
+ let a = e.indexOf("?");
453
+ a >= 0 && (n.search = e.substring(a), e = e.substring(0, a)), e && (n.pathname = e);
454
+ }
455
+ return n;
456
+ }
457
+ function Lt(e, n, t = "/") {
458
+ return On(e, n, t, !1);
459
+ }
460
+ function On(e, n, t, a) {
461
+ let r = typeof n == "string" ? Ke(n) : n, o = Z(r.pathname || "/", t);
462
+ if (o == null)
463
+ return null;
464
+ let l = Ft(e);
465
+ Dn(l);
466
+ let s = null;
467
+ for (let u = 0; s == null && u < l.length; ++u) {
468
+ let c = Gn(o);
469
+ s = Hn(
470
+ l[u],
471
+ c,
472
+ a
473
+ );
474
+ }
475
+ return s;
476
+ }
477
+ function Ft(e, n = [], t = [], a = "") {
478
+ let r = (o, l, s) => {
479
+ let u = {
480
+ relativePath: s === void 0 ? o.path || "" : s,
481
+ caseSensitive: o.caseSensitive === !0,
482
+ childrenIndex: l,
483
+ route: o
484
+ };
485
+ u.relativePath.startsWith("/") && (P(
486
+ u.relativePath.startsWith(a),
487
+ `Absolute route path "${u.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
488
+ ), u.relativePath = u.relativePath.slice(a.length));
489
+ let c = K([a, u.relativePath]), d = t.concat(u);
490
+ o.children && o.children.length > 0 && (P(
491
+ // Our types know better, but runtime JS may not!
492
+ // @ts-expect-error
493
+ o.index !== !0,
494
+ `Index routes must not have child routes. Please remove all child routes from route path "${c}".`
495
+ ), Ft(o.children, n, d, c)), !(o.path == null && !o.index) && n.push({
496
+ path: c,
497
+ score: Kn(c, o.index),
498
+ routesMeta: d
499
+ });
500
+ };
501
+ return e.forEach((o, l) => {
502
+ var s;
503
+ if (o.path === "" || !((s = o.path) != null && s.includes("?")))
504
+ r(o, l);
505
+ else
506
+ for (let u of At(o.path))
507
+ r(o, l, u);
508
+ }), n;
509
+ }
510
+ function At(e) {
511
+ let n = e.split("/");
512
+ if (n.length === 0) return [];
513
+ let [t, ...a] = n, r = t.endsWith("?"), o = t.replace(/\?$/, "");
514
+ if (a.length === 0)
515
+ return r ? [o, ""] : [o];
516
+ let l = At(a.join("/")), s = [];
517
+ return s.push(
518
+ ...l.map(
519
+ (u) => u === "" ? o : [o, u].join("/")
520
+ )
521
+ ), r && s.push(...l), s.map(
522
+ (u) => e.startsWith("/") && u === "" ? "/" : u
523
+ );
524
+ }
525
+ function Dn(e) {
526
+ e.sort(
527
+ (n, t) => n.score !== t.score ? t.score - n.score : Vn(
528
+ n.routesMeta.map((a) => a.childrenIndex),
529
+ t.routesMeta.map((a) => a.childrenIndex)
530
+ )
531
+ );
532
+ }
533
+ var Mn = /^:[\w-]+$/, zn = 3, Bn = 2, Un = 1, qn = 10, Wn = -2, dt = (e) => e === "*";
534
+ function Kn(e, n) {
535
+ let t = e.split("/"), a = t.length;
536
+ return t.some(dt) && (a += Wn), n && (a += Bn), t.filter((r) => !dt(r)).reduce(
537
+ (r, o) => r + (Mn.test(o) ? zn : o === "" ? Un : qn),
538
+ a
539
+ );
540
+ }
541
+ function Vn(e, n) {
542
+ return e.length === n.length && e.slice(0, -1).every((a, r) => a === n[r]) ? (
543
+ // If two routes are siblings, we should try to match the earlier sibling
544
+ // first. This allows people to have fine-grained control over the matching
545
+ // behavior by simply putting routes with identical paths in the order they
546
+ // want them tried.
547
+ e[e.length - 1] - n[n.length - 1]
548
+ ) : (
549
+ // Otherwise, it doesn't really make sense to rank non-siblings by index,
550
+ // so they sort equally.
551
+ 0
552
+ );
553
+ }
554
+ function Hn(e, n, t = !1) {
555
+ let { routesMeta: a } = e, r = {}, o = "/", l = [];
556
+ for (let s = 0; s < a.length; ++s) {
557
+ let u = a[s], c = s === a.length - 1, d = o === "/" ? n : n.slice(o.length) || "/", x = Ee(
558
+ { path: u.relativePath, caseSensitive: u.caseSensitive, end: c },
559
+ d
560
+ ), g = u.route;
561
+ if (!x && c && t && !a[a.length - 1].route.index && (x = Ee(
562
+ {
563
+ path: u.relativePath,
564
+ caseSensitive: u.caseSensitive,
565
+ end: !1
566
+ },
567
+ d
568
+ )), !x)
569
+ return null;
570
+ Object.assign(r, x.params), l.push({
571
+ // TODO: Can this as be avoided?
572
+ params: r,
573
+ pathname: K([o, x.pathname]),
574
+ pathnameBase: Qn(
575
+ K([o, x.pathnameBase])
576
+ ),
577
+ route: g
578
+ }), x.pathnameBase !== "/" && (o = K([o, x.pathnameBase]));
579
+ }
580
+ return l;
581
+ }
582
+ function Ee(e, n) {
583
+ typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
584
+ let [t, a] = Yn(
585
+ e.path,
586
+ e.caseSensitive,
587
+ e.end
588
+ ), r = n.match(t);
589
+ if (!r) return null;
590
+ let o = r[0], l = o.replace(/(.)\/+$/, "$1"), s = r.slice(1);
591
+ return {
592
+ params: a.reduce(
593
+ (c, { paramName: d, isOptional: x }, g) => {
594
+ if (d === "*") {
595
+ let v = s[g] || "";
596
+ l = o.slice(0, o.length - v.length).replace(/(.)\/+$/, "$1");
597
+ }
598
+ const p = s[g];
599
+ return x && !p ? c[d] = void 0 : c[d] = (p || "").replace(/%2F/g, "/"), c;
600
+ },
601
+ {}
602
+ ),
603
+ pathname: o,
604
+ pathnameBase: l,
605
+ pattern: e
606
+ };
607
+ }
608
+ function Yn(e, n = !1, t = !0) {
609
+ V(
610
+ e === "*" || !e.endsWith("*") || e.endsWith("/*"),
611
+ `Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
612
+ );
613
+ let a = [], r = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
614
+ /\/:([\w-]+)(\?)?/g,
615
+ (l, s, u) => (a.push({ paramName: s, isOptional: u != null }), u ? "/?([^\\/]+)?" : "/([^\\/]+)")
616
+ );
617
+ return e.endsWith("*") ? (a.push({ paramName: "*" }), r += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : t ? r += "\\/*$" : e !== "" && e !== "/" && (r += "(?:(?=\\/|$))"), [new RegExp(r, n ? void 0 : "i"), a];
618
+ }
619
+ function Gn(e) {
620
+ try {
621
+ return e.split("/").map((n) => decodeURIComponent(n).replace(/\//g, "%2F")).join("/");
622
+ } catch (n) {
623
+ return V(
624
+ !1,
625
+ `The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`
626
+ ), e;
627
+ }
628
+ }
629
+ function Z(e, n) {
630
+ if (n === "/") return e;
631
+ if (!e.toLowerCase().startsWith(n.toLowerCase()))
632
+ return null;
633
+ let t = n.endsWith("/") ? n.length - 1 : n.length, a = e.charAt(t);
634
+ return a && a !== "/" ? null : e.slice(t) || "/";
635
+ }
636
+ function Jn(e, n = "/") {
637
+ let {
638
+ pathname: t,
639
+ search: a = "",
640
+ hash: r = ""
641
+ } = typeof e == "string" ? Ke(e) : e;
642
+ return {
643
+ pathname: t ? t.startsWith("/") ? t : Xn(t, n) : n,
644
+ search: er(a),
645
+ hash: tr(r)
646
+ };
647
+ }
648
+ function Xn(e, n) {
649
+ let t = n.replace(/\/+$/, "").split("/");
650
+ return e.split("/").forEach((r) => {
651
+ r === ".." ? t.length > 1 && t.pop() : r !== "." && t.push(r);
652
+ }), t.length > 1 ? t.join("/") : "/";
653
+ }
654
+ function De(e, n, t, a) {
655
+ return `Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(
656
+ a
657
+ )}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
658
+ }
659
+ function Zn(e) {
660
+ return e.filter(
661
+ (n, t) => t === 0 || n.route.path && n.route.path.length > 0
662
+ );
663
+ }
664
+ function _t(e) {
665
+ let n = Zn(e);
666
+ return n.map(
667
+ (t, a) => a === n.length - 1 ? t.pathname : t.pathnameBase
668
+ );
669
+ }
670
+ function $t(e, n, t, a = !1) {
671
+ let r;
672
+ typeof e == "string" ? r = Ke(e) : (r = { ...e }, P(
673
+ !r.pathname || !r.pathname.includes("?"),
674
+ De("?", "pathname", "search", r)
675
+ ), P(
676
+ !r.pathname || !r.pathname.includes("#"),
677
+ De("#", "pathname", "hash", r)
678
+ ), P(
679
+ !r.search || !r.search.includes("#"),
680
+ De("#", "search", "hash", r)
681
+ ));
682
+ let o = e === "" || r.pathname === "", l = o ? "/" : r.pathname, s;
683
+ if (l == null)
684
+ s = t;
685
+ else {
686
+ let x = n.length - 1;
687
+ if (!a && l.startsWith("..")) {
688
+ let g = l.split("/");
689
+ for (; g[0] === ".."; )
690
+ g.shift(), x -= 1;
691
+ r.pathname = g.join("/");
692
+ }
693
+ s = x >= 0 ? n[x] : "/";
694
+ }
695
+ let u = Jn(r, s), c = l && l !== "/" && l.endsWith("/"), d = (o || l === ".") && t.endsWith("/");
696
+ return !u.pathname.endsWith("/") && (c || d) && (u.pathname += "/"), u;
697
+ }
698
+ var K = (e) => e.join("/").replace(/\/\/+/g, "/"), Qn = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), er = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, tr = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
699
+ function nr(e) {
700
+ return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
701
+ }
702
+ var Ot = [
703
+ "POST",
704
+ "PUT",
705
+ "PATCH",
706
+ "DELETE"
707
+ ];
708
+ new Set(
709
+ Ot
710
+ );
711
+ var rr = [
712
+ "GET",
713
+ ...Ot
714
+ ];
715
+ new Set(rr);
716
+ var se = f.createContext(null);
717
+ se.displayName = "DataRouter";
718
+ var Ne = f.createContext(null);
719
+ Ne.displayName = "DataRouterState";
720
+ f.createContext(!1);
721
+ var Dt = f.createContext({
722
+ isTransitioning: !1
723
+ });
724
+ Dt.displayName = "ViewTransition";
725
+ var ar = f.createContext(
726
+ /* @__PURE__ */ new Map()
727
+ );
728
+ ar.displayName = "Fetchers";
729
+ var or = f.createContext(null);
730
+ or.displayName = "Await";
731
+ var H = f.createContext(
732
+ null
733
+ );
734
+ H.displayName = "Navigation";
735
+ var Ve = f.createContext(
736
+ null
737
+ );
738
+ Ve.displayName = "Location";
739
+ var Y = f.createContext({
740
+ outlet: null,
741
+ matches: [],
742
+ isDataRoute: !1
743
+ });
744
+ Y.displayName = "Route";
745
+ var He = f.createContext(null);
746
+ He.displayName = "RouteError";
747
+ function ir(e, { relative: n } = {}) {
748
+ P(
749
+ Pe(),
750
+ // TODO: This error is probably because they somehow have 2 versions of the
751
+ // router loaded. We can help them understand how to avoid that.
752
+ "useHref() may be used only in the context of a <Router> component."
753
+ );
754
+ let { basename: t, navigator: a } = f.useContext(H), { hash: r, pathname: o, search: l } = ve(e, { relative: n }), s = o;
755
+ return t !== "/" && (s = o === "/" ? t : K([t, o])), a.createHref({ pathname: s, search: l, hash: r });
756
+ }
757
+ function Pe() {
758
+ return f.useContext(Ve) != null;
759
+ }
760
+ function te() {
761
+ return P(
762
+ Pe(),
763
+ // TODO: This error is probably because they somehow have 2 versions of the
764
+ // router loaded. We can help them understand how to avoid that.
765
+ "useLocation() may be used only in the context of a <Router> component."
766
+ ), f.useContext(Ve).location;
767
+ }
768
+ var Mt = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
769
+ function zt(e) {
770
+ f.useContext(H).static || f.useLayoutEffect(e);
771
+ }
772
+ function Ye() {
773
+ let { isDataRoute: e } = f.useContext(Y);
774
+ return e ? yr() : lr();
775
+ }
776
+ function lr() {
777
+ P(
778
+ Pe(),
779
+ // TODO: This error is probably because they somehow have 2 versions of the
780
+ // router loaded. We can help them understand how to avoid that.
781
+ "useNavigate() may be used only in the context of a <Router> component."
782
+ );
783
+ let e = f.useContext(se), { basename: n, navigator: t } = f.useContext(H), { matches: a } = f.useContext(Y), { pathname: r } = te(), o = JSON.stringify(_t(a)), l = f.useRef(!1);
784
+ return zt(() => {
785
+ l.current = !0;
786
+ }), f.useCallback(
787
+ (u, c = {}) => {
788
+ if (V(l.current, Mt), !l.current) return;
789
+ if (typeof u == "number") {
790
+ t.go(u);
791
+ return;
792
+ }
793
+ let d = $t(
794
+ u,
795
+ JSON.parse(o),
796
+ r,
797
+ c.relative === "path"
798
+ );
799
+ e == null && n !== "/" && (d.pathname = d.pathname === "/" ? n : K([n, d.pathname])), (c.replace ? t.replace : t.push)(
800
+ d,
801
+ c.state,
802
+ c
803
+ );
804
+ },
805
+ [
806
+ n,
807
+ t,
808
+ o,
809
+ r,
810
+ e
811
+ ]
812
+ );
813
+ }
814
+ f.createContext(null);
815
+ function ve(e, { relative: n } = {}) {
816
+ let { matches: t } = f.useContext(Y), { pathname: a } = te(), r = JSON.stringify(_t(t));
817
+ return f.useMemo(
818
+ () => $t(
819
+ e,
820
+ JSON.parse(r),
821
+ a,
822
+ n === "path"
823
+ ),
824
+ [e, r, a, n]
825
+ );
826
+ }
827
+ function sr(e, n, t, a) {
828
+ P(
829
+ Pe(),
830
+ // TODO: This error is probably because they somehow have 2 versions of the
831
+ // router loaded. We can help them understand how to avoid that.
832
+ "useRoutes() may be used only in the context of a <Router> component."
833
+ );
834
+ let { navigator: r } = f.useContext(H), { matches: o } = f.useContext(Y), l = o[o.length - 1], s = l ? l.params : {}, u = l ? l.pathname : "/", c = l ? l.pathnameBase : "/", d = l && l.route;
835
+ {
836
+ let b = d && d.path || "";
837
+ Bt(
838
+ u,
839
+ !d || b.endsWith("*") || b.endsWith("*?"),
840
+ `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${b}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
841
+
842
+ Please change the parent <Route path="${b}"> to <Route path="${b === "/" ? "*" : `${b}/*`}">.`
843
+ );
844
+ }
845
+ let x = te(), g;
846
+ g = x;
847
+ let p = g.pathname || "/", v = p;
848
+ if (c !== "/") {
849
+ let b = c.replace(/^\//, "").split("/");
850
+ v = "/" + p.replace(/^\//, "").split("/").slice(b.length).join("/");
851
+ }
852
+ let h = Lt(e, { pathname: v });
853
+ return V(
854
+ d || h != null,
855
+ `No routes matched location "${g.pathname}${g.search}${g.hash}" `
856
+ ), V(
857
+ h == null || h[h.length - 1].route.element !== void 0 || h[h.length - 1].route.Component !== void 0 || h[h.length - 1].route.lazy !== void 0,
858
+ `Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
859
+ ), hr(
860
+ h && h.map(
861
+ (b) => Object.assign({}, b, {
862
+ params: Object.assign({}, s, b.params),
863
+ pathname: K([
864
+ c,
865
+ // Re-encode pathnames that were decoded inside matchRoutes
866
+ r.encodeLocation ? r.encodeLocation(b.pathname).pathname : b.pathname
867
+ ]),
868
+ pathnameBase: b.pathnameBase === "/" ? c : K([
869
+ c,
870
+ // Re-encode pathnames that were decoded inside matchRoutes
871
+ r.encodeLocation ? r.encodeLocation(b.pathnameBase).pathname : b.pathnameBase
872
+ ])
873
+ })
874
+ ),
875
+ o,
876
+ t,
877
+ a
878
+ );
879
+ }
880
+ function ur() {
881
+ let e = vr(), n = nr(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), t = e instanceof Error ? e.stack : null, a = "rgba(200,200,200, 0.5)", r = { padding: "0.5rem", backgroundColor: a }, o = { padding: "2px 4px", backgroundColor: a }, l = null;
882
+ return console.error(
883
+ "Error handled by React Router default ErrorBoundary:",
884
+ e
885
+ ), l = /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ f.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ f.createElement("code", { style: o }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ f.createElement("code", { style: o }, "errorElement"), " prop on your route.")), /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ f.createElement("h3", { style: { fontStyle: "italic" } }, n), t ? /* @__PURE__ */ f.createElement("pre", { style: r }, t) : null, l);
886
+ }
887
+ var cr = /* @__PURE__ */ f.createElement(ur, null), dr = class extends f.Component {
888
+ constructor(e) {
889
+ super(e), this.state = {
890
+ location: e.location,
891
+ revalidation: e.revalidation,
892
+ error: e.error
893
+ };
894
+ }
895
+ static getDerivedStateFromError(e) {
896
+ return { error: e };
897
+ }
898
+ static getDerivedStateFromProps(e, n) {
899
+ return n.location !== e.location || n.revalidation !== "idle" && e.revalidation === "idle" ? {
900
+ error: e.error,
901
+ location: e.location,
902
+ revalidation: e.revalidation
903
+ } : {
904
+ error: e.error !== void 0 ? e.error : n.error,
905
+ location: n.location,
906
+ revalidation: e.revalidation || n.revalidation
907
+ };
908
+ }
909
+ componentDidCatch(e, n) {
910
+ console.error(
911
+ "React Router caught the following error during render",
912
+ e,
913
+ n
914
+ );
915
+ }
916
+ render() {
917
+ return this.state.error !== void 0 ? /* @__PURE__ */ f.createElement(Y.Provider, { value: this.props.routeContext }, /* @__PURE__ */ f.createElement(
918
+ He.Provider,
919
+ {
920
+ value: this.state.error,
921
+ children: this.props.component
922
+ }
923
+ )) : this.props.children;
924
+ }
925
+ };
926
+ function fr({ routeContext: e, match: n, children: t }) {
927
+ let a = f.useContext(se);
928
+ return a && a.static && a.staticContext && (n.route.errorElement || n.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = n.route.id), /* @__PURE__ */ f.createElement(Y.Provider, { value: e }, t);
929
+ }
930
+ function hr(e, n = [], t = null, a = null) {
931
+ if (e == null) {
932
+ if (!t)
933
+ return null;
934
+ if (t.errors)
935
+ e = t.matches;
936
+ else if (n.length === 0 && !t.initialized && t.matches.length > 0)
937
+ e = t.matches;
938
+ else
939
+ return null;
940
+ }
941
+ let r = e, o = t == null ? void 0 : t.errors;
942
+ if (o != null) {
943
+ let u = r.findIndex(
944
+ (c) => c.route.id && (o == null ? void 0 : o[c.route.id]) !== void 0
945
+ );
946
+ P(
947
+ u >= 0,
948
+ `Could not find a matching route for errors on route IDs: ${Object.keys(
949
+ o
950
+ ).join(",")}`
951
+ ), r = r.slice(
952
+ 0,
953
+ Math.min(r.length, u + 1)
954
+ );
955
+ }
956
+ let l = !1, s = -1;
957
+ if (t)
958
+ for (let u = 0; u < r.length; u++) {
959
+ let c = r[u];
960
+ if ((c.route.HydrateFallback || c.route.hydrateFallbackElement) && (s = u), c.route.id) {
961
+ let { loaderData: d, errors: x } = t, g = c.route.loader && !d.hasOwnProperty(c.route.id) && (!x || x[c.route.id] === void 0);
962
+ if (c.route.lazy || g) {
963
+ l = !0, s >= 0 ? r = r.slice(0, s + 1) : r = [r[0]];
964
+ break;
965
+ }
966
+ }
967
+ }
968
+ return r.reduceRight(
969
+ (u, c, d) => {
970
+ let x, g = !1, p = null, v = null;
971
+ t && (x = o && c.route.id ? o[c.route.id] : void 0, p = c.route.errorElement || cr, l && (s < 0 && d === 0 ? (Bt(
972
+ "route-fallback",
973
+ !1,
974
+ "No `HydrateFallback` element provided to render during initial hydration"
975
+ ), g = !0, v = null) : s === d && (g = !0, v = c.route.hydrateFallbackElement || null)));
976
+ let h = n.concat(r.slice(0, d + 1)), j = () => {
977
+ let b;
978
+ return x ? b = p : g ? b = v : c.route.Component ? b = /* @__PURE__ */ f.createElement(c.route.Component, null) : c.route.element ? b = c.route.element : b = u, /* @__PURE__ */ f.createElement(
979
+ fr,
980
+ {
981
+ match: c,
982
+ routeContext: {
983
+ outlet: u,
984
+ matches: h,
985
+ isDataRoute: t != null
986
+ },
987
+ children: b
988
+ }
989
+ );
990
+ };
991
+ return t && (c.route.ErrorBoundary || c.route.errorElement || d === 0) ? /* @__PURE__ */ f.createElement(
992
+ dr,
993
+ {
994
+ location: t.location,
995
+ revalidation: t.revalidation,
996
+ component: p,
997
+ error: x,
998
+ children: j(),
999
+ routeContext: { outlet: null, matches: h, isDataRoute: !0 }
1000
+ }
1001
+ ) : j();
1002
+ },
1003
+ null
1004
+ );
1005
+ }
1006
+ function Ge(e) {
1007
+ return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
1008
+ }
1009
+ function mr(e) {
1010
+ let n = f.useContext(se);
1011
+ return P(n, Ge(e)), n;
1012
+ }
1013
+ function gr(e) {
1014
+ let n = f.useContext(Ne);
1015
+ return P(n, Ge(e)), n;
1016
+ }
1017
+ function pr(e) {
1018
+ let n = f.useContext(Y);
1019
+ return P(n, Ge(e)), n;
1020
+ }
1021
+ function Je(e) {
1022
+ let n = pr(e), t = n.matches[n.matches.length - 1];
1023
+ return P(
1024
+ t.route.id,
1025
+ `${e} can only be used on routes that contain a unique "id"`
1026
+ ), t.route.id;
1027
+ }
1028
+ function xr() {
1029
+ return Je(
1030
+ "useRouteId"
1031
+ /* UseRouteId */
1032
+ );
1033
+ }
1034
+ function vr() {
1035
+ var a;
1036
+ let e = f.useContext(He), n = gr(
1037
+ "useRouteError"
1038
+ /* UseRouteError */
1039
+ ), t = Je(
1040
+ "useRouteError"
1041
+ /* UseRouteError */
1042
+ );
1043
+ return e !== void 0 ? e : (a = n.errors) == null ? void 0 : a[t];
1044
+ }
1045
+ function yr() {
1046
+ let { router: e } = mr(
1047
+ "useNavigate"
1048
+ /* UseNavigateStable */
1049
+ ), n = Je(
1050
+ "useNavigate"
1051
+ /* UseNavigateStable */
1052
+ ), t = f.useRef(!1);
1053
+ return zt(() => {
1054
+ t.current = !0;
1055
+ }), f.useCallback(
1056
+ async (r, o = {}) => {
1057
+ V(t.current, Mt), t.current && (typeof r == "number" ? e.navigate(r) : await e.navigate(r, { fromRouteId: n, ...o }));
1058
+ },
1059
+ [e, n]
1060
+ );
1061
+ }
1062
+ var ft = {};
1063
+ function Bt(e, n, t) {
1064
+ !n && !ft[e] && (ft[e] = !0, V(!1, t));
1065
+ }
1066
+ f.memo(br);
1067
+ function br({
1068
+ routes: e,
1069
+ future: n,
1070
+ state: t
1071
+ }) {
1072
+ return sr(e, void 0, t, n);
1073
+ }
1074
+ var Se = "get", Ce = "application/x-www-form-urlencoded";
1075
+ function Ie(e) {
1076
+ return e != null && typeof e.tagName == "string";
1077
+ }
1078
+ function wr(e) {
1079
+ return Ie(e) && e.tagName.toLowerCase() === "button";
1080
+ }
1081
+ function jr(e) {
1082
+ return Ie(e) && e.tagName.toLowerCase() === "form";
1083
+ }
1084
+ function Sr(e) {
1085
+ return Ie(e) && e.tagName.toLowerCase() === "input";
1086
+ }
1087
+ function Cr(e) {
1088
+ return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
1089
+ }
1090
+ function Rr(e, n) {
1091
+ return e.button === 0 && // Ignore everything but left clicks
1092
+ (!n || n === "_self") && // Let browser handle "target=_blank" etc.
1093
+ !Cr(e);
1094
+ }
1095
+ var je = null;
1096
+ function Er() {
1097
+ if (je === null)
1098
+ try {
1099
+ new FormData(
1100
+ document.createElement("form"),
1101
+ // @ts-expect-error if FormData supports the submitter parameter, this will throw
1102
+ 0
1103
+ ), je = !1;
1104
+ } catch {
1105
+ je = !0;
1106
+ }
1107
+ return je;
1108
+ }
1109
+ var kr = /* @__PURE__ */ new Set([
1110
+ "application/x-www-form-urlencoded",
1111
+ "multipart/form-data",
1112
+ "text/plain"
1113
+ ]);
1114
+ function Me(e) {
1115
+ return e != null && !kr.has(e) ? (V(
1116
+ !1,
1117
+ `"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ce}"`
1118
+ ), null) : e;
1119
+ }
1120
+ function Tr(e, n) {
1121
+ let t, a, r, o, l;
1122
+ if (jr(e)) {
1123
+ let s = e.getAttribute("action");
1124
+ a = s ? Z(s, n) : null, t = e.getAttribute("method") || Se, r = Me(e.getAttribute("enctype")) || Ce, o = new FormData(e);
1125
+ } else if (wr(e) || Sr(e) && (e.type === "submit" || e.type === "image")) {
1126
+ let s = e.form;
1127
+ if (s == null)
1128
+ throw new Error(
1129
+ 'Cannot submit a <button> or <input type="submit"> without a <form>'
1130
+ );
1131
+ let u = e.getAttribute("formaction") || s.getAttribute("action");
1132
+ if (a = u ? Z(u, n) : null, t = e.getAttribute("formmethod") || s.getAttribute("method") || Se, r = Me(e.getAttribute("formenctype")) || Me(s.getAttribute("enctype")) || Ce, o = new FormData(s, e), !Er()) {
1133
+ let { name: c, type: d, value: x } = e;
1134
+ if (d === "image") {
1135
+ let g = c ? `${c}.` : "";
1136
+ o.append(`${g}x`, "0"), o.append(`${g}y`, "0");
1137
+ } else c && o.append(c, x);
1138
+ }
1139
+ } else {
1140
+ if (Ie(e))
1141
+ throw new Error(
1142
+ 'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
1143
+ );
1144
+ t = Se, a = null, r = Ce, l = e;
1145
+ }
1146
+ return o && r === "text/plain" && (l = o, o = void 0), { action: a, method: t.toLowerCase(), encType: r, formData: o, body: l };
1147
+ }
1148
+ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
1149
+ function Xe(e, n) {
1150
+ if (e === !1 || e === null || typeof e > "u")
1151
+ throw new Error(n);
1152
+ }
1153
+ function Nr(e, n, t) {
1154
+ let a = typeof e == "string" ? new URL(
1155
+ e,
1156
+ // This can be called during the SSR flow via PrefetchPageLinksImpl so
1157
+ // don't assume window is available
1158
+ typeof window > "u" ? "server://singlefetch/" : window.location.origin
1159
+ ) : e;
1160
+ return a.pathname === "/" ? a.pathname = `_root.${t}` : n && Z(a.pathname, n) === "/" ? a.pathname = `${n.replace(/\/$/, "")}/_root.${t}` : a.pathname = `${a.pathname.replace(/\/$/, "")}.${t}`, a;
1161
+ }
1162
+ async function Pr(e, n) {
1163
+ if (e.id in n)
1164
+ return n[e.id];
1165
+ try {
1166
+ let t = await import(
1167
+ /* @vite-ignore */
1168
+ /* webpackIgnore: true */
1169
+ e.module
1170
+ );
1171
+ return n[e.id] = t, t;
1172
+ } catch (t) {
1173
+ return console.error(
1174
+ `Error loading route module \`${e.module}\`, reloading page...`
1175
+ ), console.error(t), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
1176
+ });
1177
+ }
1178
+ }
1179
+ function Ir(e) {
1180
+ return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
1181
+ }
1182
+ async function Lr(e, n, t) {
1183
+ let a = await Promise.all(
1184
+ e.map(async (r) => {
1185
+ let o = n.routes[r.route.id];
1186
+ if (o) {
1187
+ let l = await Pr(o, t);
1188
+ return l.links ? l.links() : [];
1189
+ }
1190
+ return [];
1191
+ })
1192
+ );
1193
+ return $r(
1194
+ a.flat(1).filter(Ir).filter((r) => r.rel === "stylesheet" || r.rel === "preload").map(
1195
+ (r) => r.rel === "stylesheet" ? { ...r, rel: "prefetch", as: "style" } : { ...r, rel: "prefetch" }
1196
+ )
1197
+ );
1198
+ }
1199
+ function ht(e, n, t, a, r, o) {
1200
+ let l = (u, c) => t[c] ? u.route.id !== t[c].route.id : !0, s = (u, c) => {
1201
+ var d;
1202
+ return (
1203
+ // param change, /users/123 -> /users/456
1204
+ t[c].pathname !== u.pathname || // splat param changed, which is not present in match.path
1205
+ // e.g. /files/images/avatar.jpg -> files/finances.xls
1206
+ ((d = t[c].route.path) == null ? void 0 : d.endsWith("*")) && t[c].params["*"] !== u.params["*"]
1207
+ );
1208
+ };
1209
+ return o === "assets" ? n.filter(
1210
+ (u, c) => l(u, c) || s(u, c)
1211
+ ) : o === "data" ? n.filter((u, c) => {
1212
+ var x;
1213
+ let d = a.routes[u.route.id];
1214
+ if (!d || !d.hasLoader)
1215
+ return !1;
1216
+ if (l(u, c) || s(u, c))
1217
+ return !0;
1218
+ if (u.route.shouldRevalidate) {
1219
+ let g = u.route.shouldRevalidate({
1220
+ currentUrl: new URL(
1221
+ r.pathname + r.search + r.hash,
1222
+ window.origin
1223
+ ),
1224
+ currentParams: ((x = t[0]) == null ? void 0 : x.params) || {},
1225
+ nextUrl: new URL(e, window.origin),
1226
+ nextParams: u.params,
1227
+ defaultShouldRevalidate: !0
1228
+ });
1229
+ if (typeof g == "boolean")
1230
+ return g;
1231
+ }
1232
+ return !0;
1233
+ }) : [];
1234
+ }
1235
+ function Fr(e, n, { includeHydrateFallback: t } = {}) {
1236
+ return Ar(
1237
+ e.map((a) => {
1238
+ let r = n.routes[a.route.id];
1239
+ if (!r) return [];
1240
+ let o = [r.module];
1241
+ return r.clientActionModule && (o = o.concat(r.clientActionModule)), r.clientLoaderModule && (o = o.concat(r.clientLoaderModule)), t && r.hydrateFallbackModule && (o = o.concat(r.hydrateFallbackModule)), r.imports && (o = o.concat(r.imports)), o;
1242
+ }).flat(1)
1243
+ );
1244
+ }
1245
+ function Ar(e) {
1246
+ return [...new Set(e)];
1247
+ }
1248
+ function _r(e) {
1249
+ let n = {}, t = Object.keys(e).sort();
1250
+ for (let a of t)
1251
+ n[a] = e[a];
1252
+ return n;
1253
+ }
1254
+ function $r(e, n) {
1255
+ let t = /* @__PURE__ */ new Set();
1256
+ return new Set(n), e.reduce((a, r) => {
1257
+ let o = JSON.stringify(_r(r));
1258
+ return t.has(o) || (t.add(o), a.push({ key: o, link: r })), a;
1259
+ }, []);
1260
+ }
1261
+ function Ut() {
1262
+ let e = f.useContext(se);
1263
+ return Xe(
1264
+ e,
1265
+ "You must render this element inside a <DataRouterContext.Provider> element"
1266
+ ), e;
1267
+ }
1268
+ function Or() {
1269
+ let e = f.useContext(Ne);
1270
+ return Xe(
1271
+ e,
1272
+ "You must render this element inside a <DataRouterStateContext.Provider> element"
1273
+ ), e;
1274
+ }
1275
+ var Ze = f.createContext(void 0);
1276
+ Ze.displayName = "FrameworkContext";
1277
+ function qt() {
1278
+ let e = f.useContext(Ze);
1279
+ return Xe(
1280
+ e,
1281
+ "You must render this element inside a <HydratedRouter> element"
1282
+ ), e;
1283
+ }
1284
+ function Dr(e, n) {
1285
+ let t = f.useContext(Ze), [a, r] = f.useState(!1), [o, l] = f.useState(!1), { onFocus: s, onBlur: u, onMouseEnter: c, onMouseLeave: d, onTouchStart: x } = n, g = f.useRef(null);
1286
+ f.useEffect(() => {
1287
+ if (e === "render" && l(!0), e === "viewport") {
1288
+ let h = (b) => {
1289
+ b.forEach((C) => {
1290
+ l(C.isIntersecting);
1291
+ });
1292
+ }, j = new IntersectionObserver(h, { threshold: 0.5 });
1293
+ return g.current && j.observe(g.current), () => {
1294
+ j.disconnect();
1295
+ };
1296
+ }
1297
+ }, [e]), f.useEffect(() => {
1298
+ if (a) {
1299
+ let h = setTimeout(() => {
1300
+ l(!0);
1301
+ }, 100);
1302
+ return () => {
1303
+ clearTimeout(h);
1304
+ };
1305
+ }
1306
+ }, [a]);
1307
+ let p = () => {
1308
+ r(!0);
1309
+ }, v = () => {
1310
+ r(!1), l(!1);
1311
+ };
1312
+ return t ? e !== "intent" ? [o, g, {}] : [
1313
+ o,
1314
+ g,
1315
+ {
1316
+ onFocus: fe(s, p),
1317
+ onBlur: fe(u, v),
1318
+ onMouseEnter: fe(c, p),
1319
+ onMouseLeave: fe(d, v),
1320
+ onTouchStart: fe(x, p)
1321
+ }
1322
+ ] : [!1, g, {}];
1323
+ }
1324
+ function fe(e, n) {
1325
+ return (t) => {
1326
+ e && e(t), t.defaultPrevented || n(t);
1327
+ };
1328
+ }
1329
+ function Mr({ page: e, ...n }) {
1330
+ let { router: t } = Ut(), a = f.useMemo(
1331
+ () => Lt(t.routes, e, t.basename),
1332
+ [t.routes, e, t.basename]
1333
+ );
1334
+ return a ? /* @__PURE__ */ f.createElement(Br, { page: e, matches: a, ...n }) : null;
1335
+ }
1336
+ function zr(e) {
1337
+ let { manifest: n, routeModules: t } = qt(), [a, r] = f.useState([]);
1338
+ return f.useEffect(() => {
1339
+ let o = !1;
1340
+ return Lr(e, n, t).then(
1341
+ (l) => {
1342
+ o || r(l);
1343
+ }
1344
+ ), () => {
1345
+ o = !0;
1346
+ };
1347
+ }, [e, n, t]), a;
1348
+ }
1349
+ function Br({
1350
+ page: e,
1351
+ matches: n,
1352
+ ...t
1353
+ }) {
1354
+ let a = te(), { manifest: r, routeModules: o } = qt(), { basename: l } = Ut(), { loaderData: s, matches: u } = Or(), c = f.useMemo(
1355
+ () => ht(
1356
+ e,
1357
+ n,
1358
+ u,
1359
+ r,
1360
+ a,
1361
+ "data"
1362
+ ),
1363
+ [e, n, u, r, a]
1364
+ ), d = f.useMemo(
1365
+ () => ht(
1366
+ e,
1367
+ n,
1368
+ u,
1369
+ r,
1370
+ a,
1371
+ "assets"
1372
+ ),
1373
+ [e, n, u, r, a]
1374
+ ), x = f.useMemo(() => {
1375
+ if (e === a.pathname + a.search + a.hash)
1376
+ return [];
1377
+ let v = /* @__PURE__ */ new Set(), h = !1;
1378
+ if (n.forEach((b) => {
1379
+ var y;
1380
+ let C = r.routes[b.route.id];
1381
+ !C || !C.hasLoader || (!c.some((w) => w.route.id === b.route.id) && b.route.id in s && ((y = o[b.route.id]) != null && y.shouldRevalidate) || C.hasClientLoader ? h = !0 : v.add(b.route.id));
1382
+ }), v.size === 0)
1383
+ return [];
1384
+ let j = Nr(e, l, "data");
1385
+ return h && v.size > 0 && j.searchParams.set(
1386
+ "_routes",
1387
+ n.filter((b) => v.has(b.route.id)).map((b) => b.route.id).join(",")
1388
+ ), [j.pathname + j.search];
1389
+ }, [
1390
+ l,
1391
+ s,
1392
+ a,
1393
+ r,
1394
+ c,
1395
+ n,
1396
+ e,
1397
+ o
1398
+ ]), g = f.useMemo(
1399
+ () => Fr(d, r),
1400
+ [d, r]
1401
+ ), p = zr(d);
1402
+ return /* @__PURE__ */ f.createElement(f.Fragment, null, x.map((v) => /* @__PURE__ */ f.createElement("link", { key: v, rel: "prefetch", as: "fetch", href: v, ...t })), g.map((v) => /* @__PURE__ */ f.createElement("link", { key: v, rel: "modulepreload", href: v, ...t })), p.map(({ key: v, link: h }) => (
1403
+ // these don't spread `linkProps` because they are full link descriptors
1404
+ // already with their own props
1405
+ /* @__PURE__ */ f.createElement("link", { key: v, ...h })
1406
+ )));
1407
+ }
1408
+ function Ur(...e) {
1409
+ return (n) => {
1410
+ e.forEach((t) => {
1411
+ typeof t == "function" ? t(n) : t != null && (t.current = n);
1412
+ });
1413
+ };
1414
+ }
1415
+ var Wt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
1416
+ try {
1417
+ Wt && (window.__reactRouterVersion = // @ts-expect-error
1418
+ "7.7.1");
1419
+ } catch {
1420
+ }
1421
+ var Kt = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Vt = f.forwardRef(
1422
+ function({
1423
+ onClick: n,
1424
+ discover: t = "render",
1425
+ prefetch: a = "none",
1426
+ relative: r,
1427
+ reloadDocument: o,
1428
+ replace: l,
1429
+ state: s,
1430
+ target: u,
1431
+ to: c,
1432
+ preventScrollReset: d,
1433
+ viewTransition: x,
1434
+ ...g
1435
+ }, p) {
1436
+ let { basename: v } = f.useContext(H), h = typeof c == "string" && Kt.test(c), j, b = !1;
1437
+ if (typeof c == "string" && h && (j = c, Wt))
1438
+ try {
1439
+ let $ = new URL(window.location.href), G = c.startsWith("//") ? new URL($.protocol + c) : new URL(c), ae = Z(G.pathname, v);
1440
+ G.origin === $.origin && ae != null ? c = ae + G.search + G.hash : b = !0;
1441
+ } catch {
1442
+ V(
1443
+ !1,
1444
+ `<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
1445
+ );
1446
+ }
1447
+ let C = ir(c, { relative: r }), [y, w, R] = Dr(
1448
+ a,
1449
+ g
1450
+ ), U = Vr(c, {
1451
+ replace: l,
1452
+ state: s,
1453
+ target: u,
1454
+ preventScrollReset: d,
1455
+ relative: r,
1456
+ viewTransition: x
1457
+ });
1458
+ function M($) {
1459
+ n && n($), $.defaultPrevented || U($);
1460
+ }
1461
+ let ne = (
1462
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
1463
+ /* @__PURE__ */ f.createElement(
1464
+ "a",
1465
+ {
1466
+ ...g,
1467
+ ...R,
1468
+ href: j || C,
1469
+ onClick: b || o ? n : M,
1470
+ ref: Ur(p, w),
1471
+ target: u,
1472
+ "data-discover": !h && t === "render" ? "true" : void 0
1473
+ }
1474
+ )
1475
+ );
1476
+ return y && !h ? /* @__PURE__ */ f.createElement(f.Fragment, null, ne, /* @__PURE__ */ f.createElement(Mr, { page: C })) : ne;
1477
+ }
1478
+ );
1479
+ Vt.displayName = "Link";
1480
+ var qr = f.forwardRef(
1481
+ function({
1482
+ "aria-current": n = "page",
1483
+ caseSensitive: t = !1,
1484
+ className: a = "",
1485
+ end: r = !1,
1486
+ style: o,
1487
+ to: l,
1488
+ viewTransition: s,
1489
+ children: u,
1490
+ ...c
1491
+ }, d) {
1492
+ let x = ve(l, { relative: c.relative }), g = te(), p = f.useContext(Ne), { navigator: v, basename: h } = f.useContext(H), j = p != null && // Conditional usage is OK here because the usage of a data router is static
1493
+ // eslint-disable-next-line react-hooks/rules-of-hooks
1494
+ Xr(x) && s === !0, b = v.encodeLocation ? v.encodeLocation(x).pathname : x.pathname, C = g.pathname, y = p && p.navigation && p.navigation.location ? p.navigation.location.pathname : null;
1495
+ t || (C = C.toLowerCase(), y = y ? y.toLowerCase() : null, b = b.toLowerCase()), y && h && (y = Z(y, h) || y);
1496
+ const w = b !== "/" && b.endsWith("/") ? b.length - 1 : b.length;
1497
+ let R = C === b || !r && C.startsWith(b) && C.charAt(w) === "/", U = y != null && (y === b || !r && y.startsWith(b) && y.charAt(b.length) === "/"), M = {
1498
+ isActive: R,
1499
+ isPending: U,
1500
+ isTransitioning: j
1501
+ }, ne = R ? n : void 0, $;
1502
+ typeof a == "function" ? $ = a(M) : $ = [
1503
+ a,
1504
+ R ? "active" : null,
1505
+ U ? "pending" : null,
1506
+ j ? "transitioning" : null
1507
+ ].filter(Boolean).join(" ");
1508
+ let G = typeof o == "function" ? o(M) : o;
1509
+ return /* @__PURE__ */ f.createElement(
1510
+ Vt,
1511
+ {
1512
+ ...c,
1513
+ "aria-current": ne,
1514
+ className: $,
1515
+ ref: d,
1516
+ style: G,
1517
+ to: l,
1518
+ viewTransition: s
1519
+ },
1520
+ typeof u == "function" ? u(M) : u
1521
+ );
1522
+ }
1523
+ );
1524
+ qr.displayName = "NavLink";
1525
+ var Wr = f.forwardRef(
1526
+ ({
1527
+ discover: e = "render",
1528
+ fetcherKey: n,
1529
+ navigate: t,
1530
+ reloadDocument: a,
1531
+ replace: r,
1532
+ state: o,
1533
+ method: l = Se,
1534
+ action: s,
1535
+ onSubmit: u,
1536
+ relative: c,
1537
+ preventScrollReset: d,
1538
+ viewTransition: x,
1539
+ ...g
1540
+ }, p) => {
1541
+ let v = Gr(), h = Jr(s, { relative: c }), j = l.toLowerCase() === "get" ? "get" : "post", b = typeof s == "string" && Kt.test(s), C = (y) => {
1542
+ if (u && u(y), y.defaultPrevented) return;
1543
+ y.preventDefault();
1544
+ let w = y.nativeEvent.submitter, R = (w == null ? void 0 : w.getAttribute("formmethod")) || l;
1545
+ v(w || y.currentTarget, {
1546
+ fetcherKey: n,
1547
+ method: R,
1548
+ navigate: t,
1549
+ replace: r,
1550
+ state: o,
1551
+ relative: c,
1552
+ preventScrollReset: d,
1553
+ viewTransition: x
1554
+ });
1555
+ };
1556
+ return /* @__PURE__ */ f.createElement(
1557
+ "form",
1558
+ {
1559
+ ref: p,
1560
+ method: j,
1561
+ action: h,
1562
+ onSubmit: a ? u : C,
1563
+ ...g,
1564
+ "data-discover": !b && e === "render" ? "true" : void 0
1565
+ }
1566
+ );
1567
+ }
1568
+ );
1569
+ Wr.displayName = "Form";
1570
+ function Kr(e) {
1571
+ return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
1572
+ }
1573
+ function Ht(e) {
1574
+ let n = f.useContext(se);
1575
+ return P(n, Kr(e)), n;
1576
+ }
1577
+ function Vr(e, {
1578
+ target: n,
1579
+ replace: t,
1580
+ state: a,
1581
+ preventScrollReset: r,
1582
+ relative: o,
1583
+ viewTransition: l
1584
+ } = {}) {
1585
+ let s = Ye(), u = te(), c = ve(e, { relative: o });
1586
+ return f.useCallback(
1587
+ (d) => {
1588
+ if (Rr(d, n)) {
1589
+ d.preventDefault();
1590
+ let x = t !== void 0 ? t : Ue(u) === Ue(c);
1591
+ s(e, {
1592
+ replace: x,
1593
+ state: a,
1594
+ preventScrollReset: r,
1595
+ relative: o,
1596
+ viewTransition: l
1597
+ });
1598
+ }
1599
+ },
1600
+ [
1601
+ u,
1602
+ s,
1603
+ c,
1604
+ t,
1605
+ a,
1606
+ n,
1607
+ e,
1608
+ r,
1609
+ o,
1610
+ l
1611
+ ]
1612
+ );
1613
+ }
1614
+ var Hr = 0, Yr = () => `__${String(++Hr)}__`;
1615
+ function Gr() {
1616
+ let { router: e } = Ht(
1617
+ "useSubmit"
1618
+ /* UseSubmit */
1619
+ ), { basename: n } = f.useContext(H), t = xr();
1620
+ return f.useCallback(
1621
+ async (a, r = {}) => {
1622
+ let { action: o, method: l, encType: s, formData: u, body: c } = Tr(
1623
+ a,
1624
+ n
1625
+ );
1626
+ if (r.navigate === !1) {
1627
+ let d = r.fetcherKey || Yr();
1628
+ await e.fetch(d, t, r.action || o, {
1629
+ preventScrollReset: r.preventScrollReset,
1630
+ formData: u,
1631
+ body: c,
1632
+ formMethod: r.method || l,
1633
+ formEncType: r.encType || s,
1634
+ flushSync: r.flushSync
1635
+ });
1636
+ } else
1637
+ await e.navigate(r.action || o, {
1638
+ preventScrollReset: r.preventScrollReset,
1639
+ formData: u,
1640
+ body: c,
1641
+ formMethod: r.method || l,
1642
+ formEncType: r.encType || s,
1643
+ replace: r.replace,
1644
+ state: r.state,
1645
+ fromRouteId: t,
1646
+ flushSync: r.flushSync,
1647
+ viewTransition: r.viewTransition
1648
+ });
1649
+ },
1650
+ [e, n, t]
1651
+ );
1652
+ }
1653
+ function Jr(e, { relative: n } = {}) {
1654
+ let { basename: t } = f.useContext(H), a = f.useContext(Y);
1655
+ P(a, "useFormAction must be used inside a RouteContext");
1656
+ let [r] = a.matches.slice(-1), o = { ...ve(e || ".", { relative: n }) }, l = te();
1657
+ if (e == null) {
1658
+ o.search = l.search;
1659
+ let s = new URLSearchParams(o.search), u = s.getAll("index");
1660
+ if (u.some((d) => d === "")) {
1661
+ s.delete("index"), u.filter((x) => x).forEach((x) => s.append("index", x));
1662
+ let d = s.toString();
1663
+ o.search = d ? `?${d}` : "";
1664
+ }
1665
+ }
1666
+ return (!e || e === ".") && r.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), t !== "/" && (o.pathname = o.pathname === "/" ? t : K([t, o.pathname])), Ue(o);
1667
+ }
1668
+ function Xr(e, { relative: n } = {}) {
1669
+ let t = f.useContext(Dt);
1670
+ P(
1671
+ t != null,
1672
+ "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
1673
+ );
1674
+ let { basename: a } = Ht(
1675
+ "useViewTransitionState"
1676
+ /* useViewTransitionState */
1677
+ ), r = ve(e, { relative: n });
1678
+ if (!t.isTransitioning)
1679
+ return !1;
1680
+ let o = Z(t.currentLocation.pathname, a) || t.currentLocation.pathname, l = Z(t.nextLocation.pathname, a) || t.nextLocation.pathname;
1681
+ return Ee(r.pathname, l) != null || Ee(r.pathname, o) != null;
1682
+ }
1683
+ const Za = ({ message: e }) => {
1684
+ const n = Ye();
1685
+ return /* @__PURE__ */ i.jsx(
1686
+ dn,
1687
+ {
1688
+ size: "xs",
1689
+ style: {
1690
+ height: "100vh",
1691
+ display: "flex",
1692
+ alignItems: "center",
1693
+ justifyContent: "center"
1694
+ },
1695
+ children: /* @__PURE__ */ i.jsx(
1696
+ qe,
1697
+ {
1698
+ color: "red",
1699
+ title: "Not Found",
1700
+ variant: "404 - Not Found",
1701
+ icon: /* @__PURE__ */ i.jsx(We, { size: 12, stroke: 1.5 }),
1702
+ children: /* @__PURE__ */ i.jsxs(ge, { align: "flex-start", children: [
1703
+ e || "Sorry, the page you are looking for does not exist.",
1704
+ /* @__PURE__ */ i.jsx(q, { variant: "filled", onClick: () => n("/"), size: "xs", children: "Back Home" })
1705
+ ] })
1706
+ }
1707
+ )
1708
+ }
1709
+ );
1710
+ }, Qa = ({ message: e }) => /* @__PURE__ */ i.jsx(
1711
+ qe,
1712
+ {
1713
+ color: "red",
1714
+ title: "Not Found",
1715
+ variant: "404 - Not Found",
1716
+ icon: /* @__PURE__ */ i.jsx(We, { size: 12, stroke: 1.5 }),
1717
+ children: e || "Sorry, the page you are looking for does not exist."
1718
+ }
1719
+ ), Yt = ({ message: e }) => /* @__PURE__ */ i.jsx(k, { c: "red", size: "sm", children: e || "Not Found" }), eo = ({ tip: e }) => e === void 0 ? /* @__PURE__ */ i.jsx(B, { justify: "center", align: "center", children: /* @__PURE__ */ i.jsx(Re, { color: "blue", size: "md" }) }) : /* @__PURE__ */ i.jsxs(
1720
+ B,
1721
+ {
1722
+ gap: "md",
1723
+ direction: "column",
1724
+ justify: "center",
1725
+ align: "center",
1726
+ style: { height: "100%" },
1727
+ children: [
1728
+ /* @__PURE__ */ i.jsx(Re, { color: "blue", size: "md" }),
1729
+ e
1730
+ ]
1731
+ }
1732
+ ), to = ({ tip: e }) => e === void 0 ? /* @__PURE__ */ i.jsx(Re, { color: "blue", size: "xs" }) : /* @__PURE__ */ i.jsxs(B, { gap: "md", direction: "column", justify: "center", align: "center", children: [
1733
+ /* @__PURE__ */ i.jsx(Re, { color: "blue", size: "xs" }),
1734
+ e
1735
+ ] }), no = ({ message: e }) => /* @__PURE__ */ i.jsx(
1736
+ qe,
1737
+ {
1738
+ color: "red",
1739
+ title: "Not Found",
1740
+ variant: "403 - Not Authorized",
1741
+ icon: /* @__PURE__ */ i.jsx(We, { size: 12, stroke: 1.5 }),
1742
+ children: e || "Sorry, you are not authorized to access this page."
1743
+ }
1744
+ );
1745
+ function ro(e, n) {
1746
+ return e.reduce((t, a) => {
1747
+ const r = n(a);
1748
+ return t[r] || (t[r] = []), t[r].push(a), t;
1749
+ }, {});
1750
+ }
1751
+ function ao(e, n) {
1752
+ const t = [];
1753
+ let a;
1754
+ return e.reduce((r, o) => {
1755
+ const l = n(o);
1756
+ return l === void 0 ? (a === void 0 && (a = t.length, t.push([])), t[a].push(o)) : (r[l] === void 0 && (r[l] = t.length, t.push([])), t[r[l]].push(o)), r;
1757
+ }, {}), t;
1758
+ }
1759
+ function oo(e, n) {
1760
+ const t = /* @__PURE__ */ new Set();
1761
+ return e.filter((a) => {
1762
+ const r = n(a);
1763
+ return t.has(r) ? !1 : (t.add(r), !0);
1764
+ });
1765
+ }
1766
+ class io {
1767
+ constructor() {
1768
+ X(this, "items", []);
1769
+ X(this, "seen", /* @__PURE__ */ new Set());
1770
+ }
1771
+ add(n, t) {
1772
+ const a = t(n);
1773
+ this.seen.has(a) || (this.items.push(n), this.seen.add(a));
1774
+ }
1775
+ toArray() {
1776
+ return this.items;
1777
+ }
1778
+ }
1779
+ class mt {
1780
+ constructor() {
1781
+ X(this, "children", /* @__PURE__ */ new Map());
1782
+ X(this, "isEndOfWord", !1);
1783
+ X(this, "value", "");
1784
+ }
1785
+ }
1786
+ class Gt {
1787
+ constructor() {
1788
+ X(this, "root", new mt());
1789
+ }
1790
+ /**
1791
+ * Inserts a word into the trie structure.
1792
+ * Creates new nodes as needed along the path of characters.
1793
+ *
1794
+ * @param word - The string to insert into the trie
1795
+ */
1796
+ insert(n) {
1797
+ let t = this.root;
1798
+ for (const a of n) {
1799
+ let r = t.children.get(a);
1800
+ r === void 0 && (r = new mt(), t.children.set(a, r)), t = r;
1801
+ }
1802
+ t.isEndOfWord = !0, t.value = n;
1803
+ }
1804
+ /**
1805
+ * Finds the longest prefix match for the given text.
1806
+ * Returns the longest stored word that is a prefix of the input text.
1807
+ *
1808
+ * @param text - The input string to find prefix matches for
1809
+ * @returns Object containing the longest matching prefix and remaining text
1810
+ */
1811
+ findLongestPrefix(n) {
1812
+ let t = this.root, a = { match: "", remaining: n };
1813
+ for (let r = 0; r < n.length; r++) {
1814
+ const o = n[r];
1815
+ if (!t.children.has(o))
1816
+ break;
1817
+ t = t.children.get(o), t.isEndOfWord && (a = {
1818
+ match: t.value,
1819
+ remaining: n.slice(r + 1)
1820
+ });
1821
+ }
1822
+ return a;
1823
+ }
1824
+ }
1825
+ var Zr = /* @__PURE__ */ ((e) => (e[e.Allow = 0] = "Allow", e[e.Denied = 1] = "Denied", e[e.Pending = 2] = "Pending", e))(Zr || {});
1826
+ class Qr extends Gt {
1827
+ constructor() {
1828
+ super(...arguments);
1829
+ X(this, "pathToKey", /* @__PURE__ */ new Map());
1830
+ }
1831
+ /**
1832
+ * Normalizes a URL path by removing trailing slashes
1833
+ *
1834
+ * @param path - The path which is an URL string to normalize
1835
+ * @returns The normalized path without trailing slash, except for root "/"
1836
+ */
1837
+ normalizePath(t) {
1838
+ return t === "/" ? "/" : t.replace(/\/$/, "");
1839
+ }
1840
+ /**
1841
+ * Inserts an url path into the trie and associates it with a menu key.
1842
+ *
1843
+ * @param path - The URL path to store (e.g., "/admin/users")
1844
+ * @param menuKey - The menu key to associate with this path
1845
+ */
1846
+ insertRoute(t, a) {
1847
+ const r = this.normalizePath(t);
1848
+ this.insert(r), this.pathToKey.set(r, a);
1849
+ }
1850
+ /**
1851
+ * Finds the menu key associated with the longest matching route prefix
1852
+ *
1853
+ * @param route - The URL to match against stored menu url paths
1854
+ * @returns The menu key if a valid prefix match is found, undefined otherwise
1855
+ */
1856
+ findMatchingKey(t) {
1857
+ const a = this.normalizePath(t), r = this.findLongestPrefix(a);
1858
+ if (r.match && this.pathToKey.has(r.match) && (a === r.match || r.remaining.startsWith("/") || r.remaining === ""))
1859
+ return this.pathToKey.get(r.match);
1860
+ }
1861
+ }
1862
+ function ea(e) {
1863
+ const n = {}, t = {}, a = {}, r = (o, l = []) => {
1864
+ o.forEach((s) => {
1865
+ const u = [...l, s.key];
1866
+ n[s.key] = s, t[s.key] = u, s.route !== void 0 && (a[s.key] = s.route), s.children !== void 0 && s.children.length > 0 && r(s.children, u);
1867
+ });
1868
+ };
1869
+ return r(e), { key2item: n, key2fullpath: t, key2route: a };
1870
+ }
1871
+ function ta(e) {
1872
+ const n = new Qr(), t = (a) => {
1873
+ a.forEach((r) => {
1874
+ if (r.route !== void 0) {
1875
+ const o = r.route.path.getURL();
1876
+ n.insertRoute(o, r.key);
1877
+ }
1878
+ r.children !== void 0 && r.children.length > 0 && t(r.children);
1879
+ });
1880
+ };
1881
+ return t(e), n;
1882
+ }
1883
+ function na(e, n) {
1884
+ return e.map((t) => {
1885
+ if (t.route !== void 0)
1886
+ return n(t.route.role) === 0 ? t : null;
1887
+ if (t.children !== void 0) {
1888
+ const a = t.children.filter((r) => r.route !== void 0 ? n(r.route.role) === 0 : !0);
1889
+ return a.length > 0 ? { ...t, children: a } : null;
1890
+ }
1891
+ return t;
1892
+ }).filter((t) => t !== null);
1893
+ }
1894
+ const lo = (e) => {
1895
+ const n = Ye(), t = te(), [a, r] = _(/* @__PURE__ */ new Set()), [o, l] = _(/* @__PURE__ */ new Set()), [s, u] = _(), c = E(() => na(e.items, e.checkPermission), [e.items, e.checkPermission]), d = E(() => ta(e.items), [e.items]), { key2fullpath: x, key2route: g } = E(
1896
+ () => ea(c),
1897
+ [c]
1898
+ );
1899
+ Te(() => {
1900
+ const v = t.pathname, h = d.findMatchingKey(v);
1901
+ h !== void 0 && (l(new Set(x[h])), u(h));
1902
+ }, [t, g]);
1903
+ const p = E(() => {
1904
+ function v(h, j) {
1905
+ var C, y;
1906
+ const b = h.children !== void 0 && h.children.length > 0;
1907
+ return b ? /* @__PURE__ */ i.jsxs(
1908
+ "div",
1909
+ {
1910
+ onMouseEnter: () => {
1911
+ o.has(h.key) || r((w) => {
1912
+ const R = new Set(w);
1913
+ return R.add(h.key), R;
1914
+ });
1915
+ },
1916
+ onMouseLeave: () => {
1917
+ o.has(h.key) || r((w) => {
1918
+ const R = new Set(w);
1919
+ return R.delete(h.key), R;
1920
+ });
1921
+ },
1922
+ children: [
1923
+ /* @__PURE__ */ i.jsx(
1924
+ it,
1925
+ {
1926
+ active: s === h.key,
1927
+ href: (C = h.route) == null ? void 0 : C.path.getURL(),
1928
+ label: h.label,
1929
+ leftSection: h.icon,
1930
+ styles: {
1931
+ label: { fontSize: "md" },
1932
+ root: {
1933
+ borderRadius: "var(--mantine-radius-sm)"
1934
+ }
1935
+ },
1936
+ ml: j === 0 ? void 0 : j === 1 ? "md" : `calc(var(--mantine-spacing-md) * ${j})`,
1937
+ w: "unset",
1938
+ rightSection: b ? /* @__PURE__ */ i.jsx(
1939
+ jn,
1940
+ {
1941
+ size: 12,
1942
+ stroke: 1.5,
1943
+ className: "mantine-rotate-rtl"
1944
+ }
1945
+ ) : void 0,
1946
+ opened: a.has(h.key) || o.has(h.key),
1947
+ onClick: (w) => {
1948
+ w.ctrlKey || w.metaKey || (w.preventDefault(), l((U) => {
1949
+ const M = new Set(U);
1950
+ return U.has(h.key) ? M.delete(h.key) : M.add(h.key), M;
1951
+ }));
1952
+ }
1953
+ },
1954
+ h.key
1955
+ ),
1956
+ (o.has(h.key) || a.has(h.key)) && h.children.map((w) => v(w, j + 1))
1957
+ ]
1958
+ },
1959
+ `container-${h.key}`
1960
+ ) : /* @__PURE__ */ i.jsx(
1961
+ it,
1962
+ {
1963
+ active: s === h.key,
1964
+ href: (y = h.route) == null ? void 0 : y.path.getURL(),
1965
+ label: h.label,
1966
+ leftSection: h.icon,
1967
+ styles: {
1968
+ label: { fontSize: "md" },
1969
+ root: {
1970
+ borderRadius: "var(--mantine-radius-sm)"
1971
+ }
1972
+ },
1973
+ ml: j === 0 ? void 0 : j === 1 ? "md" : `calc(var(--mantine-spacing-md) * ${j})`,
1974
+ w: "unset",
1975
+ onClick: (w) => {
1976
+ w.ctrlKey || w.metaKey || (w.preventDefault(), h.route != null && h.route.path.path().open(n));
1977
+ }
1978
+ },
1979
+ h.key
1980
+ );
1981
+ }
1982
+ return c.map((h) => v(h, 0));
1983
+ }, [c, s, o, a, n]);
1984
+ return /* @__PURE__ */ i.jsx(i.Fragment, { children: p });
1985
+ }, he = ({ value: e }) => /* @__PURE__ */ i.jsx(k, { size: "sm", children: e });
1986
+ function Qe(e, n) {
1987
+ const t = n.getDate().toString().padStart(2, "0"), a = (n.getMonth() + 1).toString().padStart(2, "0"), r = n.getFullYear();
1988
+ return e.baseName === "en-US" ? `${a}/${t}/${r}` : e.baseName === "vi-VN" ? `${t}/${a}/${r}` : `${a}/${t}/${r}`;
1989
+ }
1990
+ const ra = ({ value: e }) => {
1991
+ const n = ke(xe), t = E(() => {
1992
+ const a = e.getHours().toString().padStart(2, "0"), r = e.getMinutes().toString().padStart(2, "0"), o = e.getSeconds().toString().padStart(2, "0");
1993
+ return Qe(n, e) + `${a}:${r}:${o}`;
1994
+ }, [n, e]);
1995
+ return /* @__PURE__ */ i.jsx(k, { size: "sm", children: t });
1996
+ }, aa = ({ value: e }) => {
1997
+ const n = ke(xe), t = E(() => Qe(n, e), [n, e]);
1998
+ return /* @__PURE__ */ i.jsx(k, { size: "sm", children: t });
1999
+ }, so = ({ value: e }) => {
2000
+ const n = ke(xe), [t, a] = E(() => {
2001
+ const r = Qe(n, e), o = e.getHours().toString().padStart(2, "0"), l = e.getMinutes().toString().padStart(2, "0"), s = e.getSeconds().toString().padStart(2, "0");
2002
+ return [r, `${o}:${l}:${s}`];
2003
+ }, [n, e]);
2004
+ return /* @__PURE__ */ i.jsx(k, { size: "sm", title: a, children: t });
2005
+ }, oa = {
2006
+ yes: {
2007
+ lang2value: {
2008
+ en: "Yes",
2009
+ vi: "Có"
2010
+ },
2011
+ lang: "en"
2012
+ },
2013
+ no: {
2014
+ lang2value: {
2015
+ en: "No",
2016
+ vi: "Không"
2017
+ },
2018
+ lang: "en"
2019
+ }
2020
+ }, ia = ({ value: e }) => /* @__PURE__ */ i.jsx(
2021
+ me,
2022
+ {
2023
+ checked: e,
2024
+ label: /* @__PURE__ */ i.jsx(O, { value: oa[e ? "yes" : "no"] }),
2025
+ readOnly: !0
2026
+ }
2027
+ );
2028
+ function Jt(e, n, t, a) {
2029
+ const r = e.getByName(n.targetClass), o = a[n.targetClass];
2030
+ Te(() => {
2031
+ r.fetchByIds(t);
2032
+ }, [t]);
2033
+ const l = {};
2034
+ for (const s of t)
2035
+ l[s] = r.get(s);
2036
+ return [l, o];
2037
+ }
2038
+ const Le = ee(
2039
+ ({
2040
+ db: e,
2041
+ property: n,
2042
+ value: t,
2043
+ entityRoutes: a
2044
+ }) => {
2045
+ const r = E(() => [t], [t]), [o, l] = Jt(
2046
+ e,
2047
+ n,
2048
+ r,
2049
+ a
2050
+ ), s = o[t];
2051
+ return s === void 0 ? /* @__PURE__ */ i.jsx(k, { size: "sm", children: t }) : s === null ? /* @__PURE__ */ i.jsx(Yt, {}) : l === void 0 ? /* @__PURE__ */ i.jsx(k, { size: "sm", children: s.name }) : /* @__PURE__ */ i.jsx(
2052
+ Tt,
2053
+ {
2054
+ path: l,
2055
+ openInNewPage: !1,
2056
+ urlArgs: { id: s.id },
2057
+ queryArgs: {},
2058
+ children: s.name
2059
+ }
2060
+ );
2061
+ }
2062
+ ), Fe = ee(
2063
+ ({
2064
+ db: e,
2065
+ property: n,
2066
+ value: t,
2067
+ entityRoutes: a
2068
+ }) => {
2069
+ const [r, o] = Jt(
2070
+ e,
2071
+ n,
2072
+ t,
2073
+ a
2074
+ );
2075
+ return /* @__PURE__ */ i.jsx(D, { gap: "xs", children: t.map((l, s) => {
2076
+ const u = r[l];
2077
+ return u === void 0 ? /* @__PURE__ */ i.jsx(k, { size: "sm", children: t }, l) : u === null ? /* @__PURE__ */ i.jsx(Yt, {}, l) : o === void 0 ? /* @__PURE__ */ i.jsx(k, { size: "sm", children: u.name }, s) : /* @__PURE__ */ i.jsx(
2078
+ Tt,
2079
+ {
2080
+ path: o,
2081
+ openInNewPage: !1,
2082
+ urlArgs: { id: u.id },
2083
+ queryArgs: {},
2084
+ children: u.name
2085
+ },
2086
+ s
2087
+ );
2088
+ }) });
2089
+ }
2090
+ ), Q = {
2091
+ string: he,
2092
+ integer: he,
2093
+ float: he,
2094
+ boolean: ia,
2095
+ "string[]": he,
2096
+ enum: he,
2097
+ datetime: ra,
2098
+ date: aa
2099
+ }, la = ({ property: e, value: n, onChange: t }) => /* @__PURE__ */ i.jsx(
2100
+ W,
2101
+ {
2102
+ id: e.name,
2103
+ type: "checkbox",
2104
+ checked: n,
2105
+ onChange: (a) => {
2106
+ const r = a.target.checked;
2107
+ t(r);
2108
+ }
2109
+ }
2110
+ ), gt = ({
2111
+ property: e,
2112
+ value: n,
2113
+ onChange: t
2114
+ }) => /* @__PURE__ */ i.jsx(
2115
+ W,
2116
+ {
2117
+ id: e.name,
2118
+ type: "number",
2119
+ value: n,
2120
+ onChange: (a) => {
2121
+ const r = a.target.value;
2122
+ t(r === "" ? void 0 : Number(r));
2123
+ }
2124
+ }
2125
+ ), sa = {
2126
+ lang2value: {
2127
+ en: "The leading zero is not necessary in international phone number format. For example, if your phone number is 0123456789, you should enter it as 123-456-789.",
2128
+ vi: "Số 0 đầu tiên không cần thiết trong định dạng điện thoại quốc tế. Ví dụ, nếu số điện thoại của bạn là 0123456789, bạn nên nhập nó là 123-456-789."
2129
+ },
2130
+ lang: "en"
2131
+ }, ua = {
2132
+ lang2value: {
2133
+ en: "No valid country code found.",
2134
+ vi: "Không tìm thấy mã quốc gia hợp lệ. "
2135
+ },
2136
+ lang: "en"
2137
+ }, le = {
2138
+ 84: {
2139
+ name: "Vietnam",
2140
+ flags: [N.VN]
2141
+ },
2142
+ 1: {
2143
+ name: "US, Canada",
2144
+ flags: [N.US, N.CA]
2145
+ },
2146
+ 61: {
2147
+ name: "Australia",
2148
+ flags: [N.AU]
2149
+ },
2150
+ 81: {
2151
+ name: "Japan",
2152
+ flags: [N.JP]
2153
+ },
2154
+ 44: {
2155
+ name: "UK",
2156
+ flags: [N.UK]
2157
+ },
2158
+ 33: {
2159
+ name: "France",
2160
+ flags: [N.FR]
2161
+ },
2162
+ 49: {
2163
+ name: "Germany",
2164
+ flags: [N.DE]
2165
+ },
2166
+ 91: {
2167
+ name: "India",
2168
+ flags: [N.IN]
2169
+ },
2170
+ 55: {
2171
+ name: "Brazil",
2172
+ flags: [N.BR]
2173
+ },
2174
+ 34: {
2175
+ name: "Spain",
2176
+ flags: [N.ES]
2177
+ },
2178
+ 39: {
2179
+ name: "Italy",
2180
+ flags: [N.IT]
2181
+ },
2182
+ 64: {
2183
+ name: "New Zealand",
2184
+ flags: [N.NZ]
2185
+ },
2186
+ 52: {
2187
+ name: "Mexico",
2188
+ flags: [N.MX]
2189
+ },
2190
+ 86: {
2191
+ name: "China",
2192
+ flags: [N.CN]
2193
+ }
2194
+ }, ca = (e, n) => {
2195
+ if (e === "")
2196
+ return { match: "84", remaining: "" };
2197
+ const t = e.replace(/[^\d]/g, ""), a = n.findLongestPrefix(t);
2198
+ if (a.match === "")
2199
+ throw new Error(`No valid country code found for phone number: ${e}`);
2200
+ return a;
2201
+ }, pt = ({ value: e }) => {
2202
+ const n = le[e];
2203
+ if (n !== void 0)
2204
+ return /* @__PURE__ */ i.jsxs(D, { gap: "sm", wrap: "nowrap", align: "center", children: [
2205
+ /* @__PURE__ */ i.jsxs(k, { size: "sm", children: [
2206
+ "+",
2207
+ e
2208
+ ] }),
2209
+ /* @__PURE__ */ i.jsx(D, { gap: 4, wrap: "nowrap", children: n.flags.map((t, a) => /* @__PURE__ */ i.jsx(Be, { flag: t }, a)) })
2210
+ ] });
2211
+ }, da = ({
2212
+ value: e,
2213
+ onChange: n,
2214
+ error: t,
2215
+ id: a
2216
+ }) => {
2217
+ const [r, o] = _(""), [l, s] = _(!1), [u, c] = _(""), [d, x] = _(!1), g = E(() => {
2218
+ const y = new Gt();
2219
+ return Object.keys(le).forEach((w) => {
2220
+ y.insert(w);
2221
+ }), y;
2222
+ }, [le]), { rawInput: p } = E(() => {
2223
+ try {
2224
+ const { match: y, remaining: w } = ca(
2225
+ e,
2226
+ g
2227
+ );
2228
+ return c(y), x(!1), {
2229
+ rawInput: w
2230
+ };
2231
+ } catch {
2232
+ return x(!0), c(""), {
2233
+ rawInput: e
2234
+ };
2235
+ }
2236
+ }, [e]), v = St({
2237
+ onDropdownClose: () => {
2238
+ v.resetSelectedOption(), o("");
2239
+ },
2240
+ onDropdownOpen: () => {
2241
+ v.updateSelectedOptionIndex("active");
2242
+ }
2243
+ }), h = E(() => Object.keys(le), [le]), j = (y, w) => {
2244
+ const R = y.replace(/[^\d]/g, "");
2245
+ return R.length === 0 ? `+${w}` : R.startsWith("0") ? (s(!0), `+${w}${R}`) : (s(!1), `+${w}${R}`);
2246
+ }, b = E(() => h.filter((y) => le[y].name.toLowerCase().includes(r.toLowerCase()) || y.includes(r)), [r, h]), C = E(() => b.map((y, w) => /* @__PURE__ */ i.jsx(F.Option, { value: y, children: /* @__PURE__ */ i.jsx(pt, { value: y }) }, w)), [b]);
2247
+ return /* @__PURE__ */ i.jsxs("div", { children: [
2248
+ /* @__PURE__ */ i.jsx(A, { gutter: "xs", children: /* @__PURE__ */ i.jsx(A.Col, { children: /* @__PURE__ */ i.jsxs(D, { gap: 5, children: [
2249
+ /* @__PURE__ */ i.jsxs(
2250
+ F,
2251
+ {
2252
+ store: v,
2253
+ position: "top-start",
2254
+ onOptionSubmit: (y) => {
2255
+ o(""), v.closeDropdown(), n({
2256
+ target: { value: j(p, y) }
2257
+ });
2258
+ },
2259
+ children: [
2260
+ /* @__PURE__ */ i.jsx(F.Target, { children: /* @__PURE__ */ i.jsx(
2261
+ fn,
2262
+ {
2263
+ component: "button",
2264
+ type: "button",
2265
+ pointer: !0,
2266
+ rightSection: /* @__PURE__ */ i.jsx(F.Chevron, {}),
2267
+ onClick: () => v.toggleDropdown(),
2268
+ rightSectionPointerEvents: "none",
2269
+ w: 110,
2270
+ children: /* @__PURE__ */ i.jsx(pt, { value: u })
2271
+ }
2272
+ ) }),
2273
+ /* @__PURE__ */ i.jsxs(F.Dropdown, { children: [
2274
+ /* @__PURE__ */ i.jsx(
2275
+ F.Search,
2276
+ {
2277
+ leftSection: /* @__PURE__ */ i.jsx(Et, { size: 14, stroke: 1.5 }),
2278
+ placeholder: ".....",
2279
+ value: r,
2280
+ onChange: (y) => o(y.currentTarget.value)
2281
+ }
2282
+ ),
2283
+ /* @__PURE__ */ i.jsx(F.Options, { children: C.length > 0 ? C : /* @__PURE__ */ i.jsx(F.Empty, { children: /* @__PURE__ */ i.jsx(k, { size: "sm", children: "Nothing found" }) }) })
2284
+ ] })
2285
+ ]
2286
+ }
2287
+ ),
2288
+ u === "" ? /* @__PURE__ */ i.jsx(
2289
+ W,
2290
+ {
2291
+ id: a,
2292
+ value: p,
2293
+ type: "phone_number",
2294
+ onChange: (y) => {
2295
+ n({ target: { value: y.target.value } });
2296
+ },
2297
+ error: t,
2298
+ flex: 1
2299
+ }
2300
+ ) : /* @__PURE__ */ i.jsx(
2301
+ W,
2302
+ {
2303
+ id: a,
2304
+ value: p,
2305
+ type: "phone_number",
2306
+ onAccept: (y) => {
2307
+ const w = y.replace(/[^\d]/g, "");
2308
+ n({
2309
+ target: { value: j(w, u) }
2310
+ });
2311
+ },
2312
+ component: Nn,
2313
+ mask: "000-000-0000",
2314
+ error: t,
2315
+ flex: 1
2316
+ }
2317
+ )
2318
+ ] }) }) }),
2319
+ (l || d || t && typeof t == "string") && /* @__PURE__ */ i.jsx(A, { gutter: "xs", children: /* @__PURE__ */ i.jsx(A.Col, { children: /* @__PURE__ */ i.jsx(W.Error, { children: l ? /* @__PURE__ */ i.jsx(O, { value: sa }) : d ? /* @__PURE__ */ i.jsx(O, { value: ua }) : t }) }) })
2320
+ ] });
2321
+ }, ze = ({
2322
+ property: e,
2323
+ error: n,
2324
+ value: t,
2325
+ onChange: a
2326
+ }) => {
2327
+ const [r, o] = E(() => e.constraints.includes("password") ? ["password", hn] : e.constraints.includes("phone_number") ? ["phone_number", da] : [e.constraints.includes("email") ? "email" : e.constraints.includes("url") ? "url" : "text", W], [e.constraints]);
2328
+ return /* @__PURE__ */ i.jsx(
2329
+ o,
2330
+ {
2331
+ id: e.name,
2332
+ value: t,
2333
+ type: r,
2334
+ onChange: (l) => a(l.target.value),
2335
+ error: n
2336
+ }
2337
+ );
2338
+ }, xt = {
2339
+ integer: gt,
2340
+ float: gt,
2341
+ string: ze,
2342
+ boolean: la,
2343
+ "string[]": ze,
2344
+ enum: ze
2345
+ };
2346
+ function fa(e, n) {
2347
+ const [t, a] = _(""), [r, o] = _([]);
2348
+ return Te(() => {
2349
+ e.getByName(n.targetClass).fetch({ limit: 100, offset: 0 }).then((s) => o(s.records));
2350
+ }, [n.name]), {
2351
+ data: r,
2352
+ query: t,
2353
+ setQuery: (s) => {
2354
+ a(s);
2355
+ const u = e.getByName(n.targetClass);
2356
+ o(
2357
+ u.filter(
2358
+ (c) => c.name.toLowerCase().includes(s.toLowerCase())
2359
+ )
2360
+ );
2361
+ },
2362
+ table: e.getByName(n.targetClass)
2363
+ };
2364
+ }
2365
+ const ha = (e) => e.name, ma = (e) => /* @__PURE__ */ i.jsx(k, { size: "sm", children: e.name }), ga = ee(
2366
+ (e) => /* @__PURE__ */ i.jsx("h1", { children: "SingleForeignKey" })
2367
+ ), pa = ee(
2368
+ ({
2369
+ db: e,
2370
+ property: n,
2371
+ value: t,
2372
+ onChange: a
2373
+ }) => {
2374
+ const { table: r, data: o, query: l, setQuery: s } = fa(
2375
+ e,
2376
+ n
2377
+ );
2378
+ return /* @__PURE__ */ i.jsxs(ge, { gap: "sm", children: [
2379
+ /* @__PURE__ */ i.jsx(
2380
+ xa,
2381
+ {
2382
+ name: n.name,
2383
+ query: l,
2384
+ setQuery: s,
2385
+ data: o,
2386
+ onSelect: (u) => {
2387
+ t.includes(u) || a([...t, u]);
2388
+ },
2389
+ renderOption: ha,
2390
+ isIdInteger: n.datatype === "integer"
2391
+ }
2392
+ ),
2393
+ /* @__PURE__ */ i.jsx(
2394
+ va,
2395
+ {
2396
+ items: t.map((u) => r.get(u)),
2397
+ onDelete: (u) => {
2398
+ a(t.filter((c) => c !== u.id));
2399
+ },
2400
+ render: ma
2401
+ }
2402
+ )
2403
+ ] });
2404
+ }
2405
+ ), xa = ({
2406
+ name: e,
2407
+ data: n,
2408
+ onSelect: t,
2409
+ renderOption: a,
2410
+ isIdInteger: r,
2411
+ query: o,
2412
+ setQuery: l
2413
+ }) => {
2414
+ const s = St({
2415
+ onDropdownClose: () => s.resetSelectedOption()
2416
+ }), u = E(() => n.map((c) => (
2417
+ // value has to be a string
2418
+ /* @__PURE__ */ i.jsx(F.Option, { value: c.id.toString(), children: a(c) }, c.id)
2419
+ )), [n]);
2420
+ return /* @__PURE__ */ i.jsxs(
2421
+ F,
2422
+ {
2423
+ store: s,
2424
+ onOptionSubmit: (c) => {
2425
+ t(r ? parseInt(c) : c), l(""), s.closeDropdown();
2426
+ },
2427
+ offset: 0,
2428
+ shadow: "sm",
2429
+ children: [
2430
+ /* @__PURE__ */ i.jsx(F.Target, { children: /* @__PURE__ */ i.jsx(
2431
+ W,
2432
+ {
2433
+ id: e,
2434
+ pointer: !0,
2435
+ rightSection: /* @__PURE__ */ i.jsx(Et, { size: 16, stroke: 1.5 }),
2436
+ rightSectionPointerEvents: "none",
2437
+ onClick: () => s.toggleDropdown(),
2438
+ placeholder: "Type to search...",
2439
+ value: o,
2440
+ onChange: (c) => {
2441
+ l(c.currentTarget.value);
2442
+ }
2443
+ }
2444
+ ) }),
2445
+ /* @__PURE__ */ i.jsx(F.Dropdown, { children: /* @__PURE__ */ i.jsx(F.Options, { children: u.length === 0 ? /* @__PURE__ */ i.jsx(F.Empty, { children: "Nothing found" }) : u }) })
2446
+ ]
2447
+ }
2448
+ );
2449
+ }, va = ({
2450
+ items: e,
2451
+ onDelete: n,
2452
+ render: t
2453
+ }) => {
2454
+ const a = E(() => {
2455
+ const r = [];
2456
+ for (let o = 0; o < e.length; o++) {
2457
+ const l = e[o];
2458
+ r.push(
2459
+ /* @__PURE__ */ i.jsxs(D, { justify: "space-between", p: "sm", children: [
2460
+ t(l),
2461
+ /* @__PURE__ */ i.jsx(mn, { size: "sm", onClick: () => n(l) })
2462
+ ] }, o)
2463
+ ), o < e.length - 1 && r.push(/* @__PURE__ */ i.jsx(gn, {}, `divider-${o}`));
2464
+ }
2465
+ return r;
2466
+ }, [e]);
2467
+ if (a.length !== 0)
2468
+ return /* @__PURE__ */ i.jsx(re, { bd: "1px solid #ddd", children: a });
2469
+ }, ya = "_requiredLabelLeft_l5p83_1", ba = "_requiredLabelRight_l5p83_11", vt = {
2470
+ requiredLabelLeft: ya,
2471
+ requiredLabelRight: ba
2472
+ }, wa = ({
2473
+ label: e,
2474
+ name: n,
2475
+ required: t = !1,
2476
+ tooltip: a,
2477
+ style: r,
2478
+ align: o = "left"
2479
+ }) => {
2480
+ const l = t ? o === "left" ? vt.requiredLabelRight : vt.requiredLabelLeft : "";
2481
+ return /* @__PURE__ */ i.jsx(B, { align: "center", h: 36, children: /* @__PURE__ */ i.jsx("label", { htmlFor: n, style: r, children: /* @__PURE__ */ i.jsxs(D, { gap: 4, children: [
2482
+ /* @__PURE__ */ i.jsx(k, { size: "sm", className: l, children: e }),
2483
+ a !== void 0 && /* @__PURE__ */ i.jsx(Ct, { label: a, withArrow: !0, children: /* @__PURE__ */ i.jsx(
2484
+ kt,
2485
+ {
2486
+ size: 16,
2487
+ stroke: 1.5,
2488
+ style: { color: "var(--mantine-color-dimmed)" }
2489
+ }
2490
+ ) })
2491
+ ] }) }) });
2492
+ }, ja = {
2493
+ type: "vertical",
2494
+ helpAlwaysVisible: !1
2495
+ }, Sa = ee(
2496
+ ({
2497
+ store: e,
2498
+ record: n,
2499
+ property: t,
2500
+ layout: a = ja,
2501
+ InputComponent: r,
2502
+ validator: o
2503
+ }) => {
2504
+ const [l, s] = _(void 0), u = n[t.tsName], c = (x) => {
2505
+ var p;
2506
+ if (Nt(n))
2507
+ n[t.updateFuncName](x);
2508
+ else {
2509
+ const v = n.toDraft();
2510
+ v[t.updateFuncName](x), e.setDraft(v);
2511
+ }
2512
+ const g = o(x);
2513
+ g.isValid ? s(void 0) : s(
2514
+ (p = g.errorMessage) == null ? void 0 : p.t({ args: { name: t.label } })
2515
+ );
2516
+ };
2517
+ if (Ca(a))
2518
+ return /* @__PURE__ */ i.jsxs(ge, { gap: 5, children: [
2519
+ /* @__PURE__ */ i.jsxs(A, { gutter: "sm", children: [
2520
+ /* @__PURE__ */ i.jsx(
2521
+ A.Col,
2522
+ {
2523
+ span: a.labelCol,
2524
+ style: {
2525
+ display: "flex",
2526
+ justifyContent: a.align || "left"
2527
+ },
2528
+ children: /* @__PURE__ */ i.jsx(
2529
+ wa,
2530
+ {
2531
+ label: /* @__PURE__ */ i.jsx(O, { value: t.label }),
2532
+ name: t.name,
2533
+ required: t.isRequired,
2534
+ tooltip: t.description !== void 0 ? /* @__PURE__ */ i.jsx(O, { value: t.description }) : void 0,
2535
+ align: a.align
2536
+ }
2537
+ )
2538
+ }
2539
+ ),
2540
+ /* @__PURE__ */ i.jsx(A.Col, { span: a.itemCol, children: /* @__PURE__ */ i.jsx(
2541
+ r,
2542
+ {
2543
+ db: e.db,
2544
+ property: t,
2545
+ value: u,
2546
+ error: l !== void 0,
2547
+ onChange: c
2548
+ }
2549
+ ) })
2550
+ ] }),
2551
+ l !== void 0 && /* @__PURE__ */ i.jsxs(A, { gutter: "sm", children: [
2552
+ /* @__PURE__ */ i.jsx(A.Col, { span: a.labelCol }),
2553
+ /* @__PURE__ */ i.jsx(A.Col, { span: a.itemCol, children: /* @__PURE__ */ i.jsx(W.Error, { children: l }) })
2554
+ ] })
2555
+ ] });
2556
+ let d = /* @__PURE__ */ i.jsx(O, { value: t.label });
2557
+ return !a.helpAlwaysVisible && t.description !== void 0 && (d = /* @__PURE__ */ i.jsxs(D, { gap: 4, style: { display: "inline-flex" }, children: [
2558
+ d,
2559
+ /* @__PURE__ */ i.jsx(
2560
+ Ct,
2561
+ {
2562
+ label: /* @__PURE__ */ i.jsx(O, { value: t.description }),
2563
+ withArrow: !0,
2564
+ children: /* @__PURE__ */ i.jsx(
2565
+ kt,
2566
+ {
2567
+ size: 16,
2568
+ stroke: 1.5,
2569
+ style: { color: "var(--mantine-color-dimmed)" }
2570
+ }
2571
+ )
2572
+ }
2573
+ )
2574
+ ] })), /* @__PURE__ */ i.jsx(
2575
+ W.Wrapper,
2576
+ {
2577
+ label: d,
2578
+ description: a.helpAlwaysVisible && t.description !== void 0 ? /* @__PURE__ */ i.jsx(O, { value: t.description }) : void 0,
2579
+ required: t.isRequired,
2580
+ children: /* @__PURE__ */ i.jsx(
2581
+ r,
2582
+ {
2583
+ db: e.db,
2584
+ property: t,
2585
+ value: u,
2586
+ error: l,
2587
+ onChange: c
2588
+ }
2589
+ )
2590
+ }
2591
+ );
2592
+ }
2593
+ );
2594
+ function Ca(e) {
2595
+ return e.type === "horizontal";
2596
+ }
2597
+ const yt = 12, uo = (e) => {
2598
+ const n = e.schema, t = E(() => {
2599
+ const a = Math.max(
2600
+ ...e.fieldGroups.map((r) => Math.max(...r.fields.map((o) => o.length)))
2601
+ );
2602
+ return e.fieldGroups.map((r, o) => Ra(
2603
+ n,
2604
+ e.store,
2605
+ e.record,
2606
+ o,
2607
+ r,
2608
+ a,
2609
+ e.layout
2610
+ ));
2611
+ }, [n, e.store, e.record, e.fieldGroups, e.layout]);
2612
+ return /* @__PURE__ */ i.jsx(
2613
+ "form",
2614
+ {
2615
+ onSubmit: e.onSubmit === void 0 ? void 0 : (a) => {
2616
+ a.preventDefault(), e.onSubmit !== void 0 && Nt(e.record) && e.onSubmit(e.record);
2617
+ },
2618
+ children: /* @__PURE__ */ i.jsxs(ge, { gap: "sm", className: e.className, style: e.styles, children: [
2619
+ t,
2620
+ /* @__PURE__ */ i.jsx(D, { gap: "sm", children: e.actions.map((a, r) => /* @__PURE__ */ i.jsx(
2621
+ q,
2622
+ {
2623
+ variant: a.variant,
2624
+ onClick: () => {
2625
+ a.onClick !== void 0 && a.onClick();
2626
+ },
2627
+ disabled: a.disabled,
2628
+ children: a.label
2629
+ },
2630
+ r
2631
+ )) })
2632
+ ] })
2633
+ }
2634
+ );
2635
+ };
2636
+ function Ra(e, n, t, a, r, o, l) {
2637
+ const s = r.fields, u = [];
2638
+ for (let d = 0; d < s.length; d++) {
2639
+ const x = yt / s[d].length;
2640
+ if (!Number.isInteger(x))
2641
+ throw new Error(`Span must be an integer, but got ${x} for row ${d}`);
2642
+ let g;
2643
+ l !== void 0 && typeof l == "object" && l.type === "horizontal" ? g = {
2644
+ ...l,
2645
+ // the size of labelCol must match the minimum size of labelCol across different groups
2646
+ // and rows -- if the result isn't a whole number, we may see unaligned labels
2647
+ // but this is okay as users will need to adjust the layout anyway.
2648
+ labelCol: Math.floor(
2649
+ l.labelCol * s[d].length / o
2650
+ ),
2651
+ itemCol: yt - Math.floor(l.labelCol * s[d].length / o)
2652
+ } : g = l;
2653
+ for (let p = 0; p < s[d].length; p++) {
2654
+ const v = s[d][p], h = e.allProperties[v];
2655
+ let j;
2656
+ if (pe(h))
2657
+ j = h.cardinality === "N:N" || h.cardinality === "1:N" ? pa : ga;
2658
+ else {
2659
+ if (xt[h.datatype] === void 0)
2660
+ throw new Error(
2661
+ `No input component found for datatype ${h.datatype}`
2662
+ );
2663
+ j = xt[h.datatype];
2664
+ }
2665
+ u.push(
2666
+ /* @__PURE__ */ i.jsx(A.Col, { span: x, children: /* @__PURE__ */ i.jsx(
2667
+ Sa,
2668
+ {
2669
+ store: n,
2670
+ record: t,
2671
+ property: h,
2672
+ layout: g,
2673
+ InputComponent: j,
2674
+ validator: e.validators[v]
2675
+ }
2676
+ ) }, `${d}-${p}`)
2677
+ );
2678
+ }
2679
+ }
2680
+ const c = /* @__PURE__ */ i.jsx(A, { gutter: "sm", children: u }, a);
2681
+ return r.name !== void 0 ? /* @__PURE__ */ i.jsx(pn, { legend: r.name, children: c }, a) : c;
2682
+ }
2683
+ const Xt = ({
2684
+ actions: e,
2685
+ reloadData: n,
2686
+ selectedRowKeys: t,
2687
+ size: a = "xs"
2688
+ }) => /* @__PURE__ */ i.jsxs(D, { gap: a, children: [
2689
+ (e == null ? void 0 : e.add) && /* @__PURE__ */ i.jsx(
2690
+ q,
2691
+ {
2692
+ variant: "light",
2693
+ leftSection: /* @__PURE__ */ i.jsx(Sn, { size: 16, stroke: 1.5 }),
2694
+ size: a,
2695
+ onClick: e.add,
2696
+ children: "Add"
2697
+ }
2698
+ ),
2699
+ (e == null ? void 0 : e.edit) && /* @__PURE__ */ i.jsx(
2700
+ q,
2701
+ {
2702
+ leftSection: /* @__PURE__ */ i.jsx(Cn, { size: 16, stroke: 1.5 }),
2703
+ size: a,
2704
+ variant: "light",
2705
+ onClick: () => e.edit !== void 0 && e.edit(t[0]),
2706
+ disabled: t.length !== 1,
2707
+ children: "Edit"
2708
+ }
2709
+ ),
2710
+ (e == null ? void 0 : e.reload) && /* @__PURE__ */ i.jsx(
2711
+ q,
2712
+ {
2713
+ leftSection: /* @__PURE__ */ i.jsx(Rn, { size: 16, stroke: 1.5 }),
2714
+ size: a,
2715
+ onClick: n,
2716
+ variant: "light",
2717
+ children: "Reload"
2718
+ }
2719
+ ),
2720
+ (e == null ? void 0 : e.import) && /* @__PURE__ */ i.jsx(
2721
+ q,
2722
+ {
2723
+ leftSection: /* @__PURE__ */ i.jsx(En, { size: 16, stroke: 1.5 }),
2724
+ size: a,
2725
+ variant: "light",
2726
+ onClick: e.import,
2727
+ children: "Import"
2728
+ }
2729
+ ),
2730
+ (e == null ? void 0 : e.export) && /* @__PURE__ */ i.jsx(
2731
+ q,
2732
+ {
2733
+ leftSection: /* @__PURE__ */ i.jsx(kn, { size: 16, stroke: 1.5 }),
2734
+ size: a,
2735
+ variant: "light",
2736
+ onClick: e.export,
2737
+ children: "Export"
2738
+ }
2739
+ )
2740
+ ] }), Zt = (e) => e !== void 0 && (e.add !== void 0 || e.edit !== void 0 || e.delete !== void 0 || e.export !== void 0 || e.reload === !0 || e.import !== void 0), Ea = "__selectcol__", { Thead: ka, Tr: bt, Th: Ta, Tbody: Na, Td: Pa } = Rt, Qt = (e) => {
2741
+ const n = /* @__PURE__ */ i.jsxs(
2742
+ Rt,
2743
+ {
2744
+ striped: !0,
2745
+ highlightOnHover: !0,
2746
+ verticalSpacing: "xs",
2747
+ tabularNums: !0,
2748
+ children: [
2749
+ /* @__PURE__ */ i.jsx(ka, { children: e.table.getHeaderGroups().map((a) => /* @__PURE__ */ i.jsx(bt, { children: a.headers.map((r) => /* @__PURE__ */ i.jsx(
2750
+ Ta,
2751
+ {
2752
+ w: r.id === Ea ? "1%" : void 0,
2753
+ children: r.isPlaceholder ? null : lt(
2754
+ r.column.columnDef.header,
2755
+ r.getContext()
2756
+ )
2757
+ },
2758
+ r.id
2759
+ )) }, a.id)) }),
2760
+ /* @__PURE__ */ i.jsx(Na, { pos: "relative", children: e.table.getRowModel().rows.map((a) => /* @__PURE__ */ i.jsx(
2761
+ bt,
2762
+ {
2763
+ bg: e.selectedRowKeys[a.id] ? "var(--mantine-color-blue-light)" : void 0,
2764
+ children: a.getVisibleCells().map((r) => /* @__PURE__ */ i.jsx(Pa, { children: lt(r.column.columnDef.cell, r.getContext()) }, r.id))
2765
+ },
2766
+ a.id
2767
+ )) })
2768
+ ]
2769
+ }
2770
+ );
2771
+ if (!e.bordered) return n;
2772
+ const t = {};
2773
+ return e.hasTopSection && (t.borderTopLeftRadius = 0, t.borderTopRightRadius = 0), e.hasBottomSection && (t.borderBottomLeftRadius = 0, t.borderBottomRightRadius = 0), /* @__PURE__ */ i.jsx(re, { withBorder: !0, p: 0, style: t, children: n });
2774
+ }, Ia = "_pageSizeSelectorActive_1wv6j_1", La = {
2775
+ pageSizeSelectorActive: Ia
2776
+ }, en = ({
2777
+ total: e,
2778
+ pageIndex: n,
2779
+ pageSize: t,
2780
+ allowPageSizeChange: a = !0,
2781
+ onUpdatePagination: r
2782
+ }) => {
2783
+ const o = /* @__PURE__ */ i.jsx(
2784
+ xn,
2785
+ {
2786
+ size: "sm",
2787
+ total: e,
2788
+ value: n + 1,
2789
+ onChange: (l) => r(l - 1, t)
2790
+ }
2791
+ );
2792
+ return a ? /* @__PURE__ */ i.jsxs(D, { gap: "sm", children: [
2793
+ /* @__PURE__ */ i.jsxs("div", { children: [
2794
+ /* @__PURE__ */ i.jsx(k, { size: "sm", component: "span", pr: "xs", c: "dimmed", children: "Records per page" }),
2795
+ /* @__PURE__ */ i.jsx(
2796
+ Fa,
2797
+ {
2798
+ size: "sm",
2799
+ values: ["10", "20", "50", "100"],
2800
+ value: t.toString(),
2801
+ onChange: (l) => {
2802
+ r(0, parseInt(l, 10));
2803
+ }
2804
+ }
2805
+ )
2806
+ ] }),
2807
+ o
2808
+ ] }) : o;
2809
+ }, wt = {
2810
+ xs: ue(22),
2811
+ sm: ue(26),
2812
+ md: ue(32),
2813
+ lg: ue(38),
2814
+ xl: ue(44)
2815
+ };
2816
+ function Fa({
2817
+ size: e,
2818
+ values: n,
2819
+ value: t,
2820
+ onChange: a
2821
+ }) {
2822
+ return /* @__PURE__ */ i.jsxs(ie, { withinPortal: !0, withArrow: !0, offset: 2, children: [
2823
+ /* @__PURE__ */ i.jsx(vn, { children: /* @__PURE__ */ i.jsx(
2824
+ q,
2825
+ {
2826
+ size: e,
2827
+ variant: "default",
2828
+ rightSection: /* @__PURE__ */ i.jsx(Tn, { size: 16, stroke: 1.5 }),
2829
+ style: [
2830
+ { fontWeight: "normal" },
2831
+ (r) => ({
2832
+ height: wt[e],
2833
+ paddingLeft: r.spacing[e],
2834
+ paddingRight: r.spacing[e]
2835
+ })
2836
+ ],
2837
+ styles: {
2838
+ section: {
2839
+ marginInlineStart: 2
2840
+ }
2841
+ },
2842
+ children: t
2843
+ }
2844
+ ) }),
2845
+ /* @__PURE__ */ i.jsx(yn, { children: n.map((r) => {
2846
+ const o = r === t;
2847
+ return /* @__PURE__ */ i.jsx(
2848
+ bn,
2849
+ {
2850
+ className: o ? La.pageSizeSelectorActive : void 0,
2851
+ style: [
2852
+ { height: wt[e] }
2853
+ // isCurrent
2854
+ // ? {
2855
+ // color: "var(--mantine-color-text)",
2856
+ // // backgroundColor: "var(--mantine-primary-color-filled)",
2857
+ // opacity: 1,
2858
+ // }
2859
+ // : undefined,
2860
+ ],
2861
+ disabled: o,
2862
+ onClick: () => a(r),
2863
+ children: /* @__PURE__ */ i.jsx(k, { component: "div", size: e, children: r })
2864
+ },
2865
+ r
2866
+ );
2867
+ }) })
2868
+ ] });
2869
+ }
2870
+ const Aa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), co = (e) => {
2871
+ var b, C;
2872
+ const [n, t] = _({
2873
+ records: [],
2874
+ total: 0
2875
+ }), [a, r] = _(!1), [o, l] = _(
2876
+ {}
2877
+ ), s = (y) => {
2878
+ r(!0), e.getData(y).then((w) => {
2879
+ t(w), r(!1);
2880
+ });
2881
+ }, u = (y, w) => {
2882
+ const R = {
2883
+ ...e.query.query,
2884
+ limit: w,
2885
+ offset: y * w
2886
+ };
2887
+ e.query.update(R);
2888
+ }, [c, d, x] = E(() => {
2889
+ const y = e.query.query.limit, w = Math.floor(
2890
+ (e.query.query.offset || 0) / e.query.query.limit
2891
+ ), R = Math.ceil(n.total / e.query.query.limit);
2892
+ return [y, w, R];
2893
+ }, [e.query.query.limit, e.query.query.offset, n.total]);
2894
+ Te(() => (n.total == 0 && s(e.query.query), e.query.subscribe(s)), [e.query]);
2895
+ const g = E(() => Object.keys(o).filter((y) => o[y]).map((y) => e.normalizeRowId(y)), [o]);
2896
+ let p, v;
2897
+ Zt(e.actions) && (p = /* @__PURE__ */ i.jsx(
2898
+ Xt,
2899
+ {
2900
+ actions: e.actions,
2901
+ reloadData: () => s(e.query.query),
2902
+ selectedRowKeys: g
2903
+ }
2904
+ ));
2905
+ const h = ((b = e.pagination) == null ? void 0 : b.positions) || Aa;
2906
+ if (h.size > 0) {
2907
+ const y = /* @__PURE__ */ i.jsx(
2908
+ en,
2909
+ {
2910
+ total: x,
2911
+ pageIndex: d,
2912
+ pageSize: c,
2913
+ onUpdatePagination: u,
2914
+ allowPageSizeChange: (C = e.pagination) == null ? void 0 : C.showSizeChanger
2915
+ }
2916
+ );
2917
+ h.has("topRight") && (p !== void 0 ? p = /* @__PURE__ */ i.jsxs(D, { justify: "space-between", gap: "sm", children: [
2918
+ p,
2919
+ y
2920
+ ] }) : p = /* @__PURE__ */ i.jsx(B, { justify: "flex-end", children: y })), (h.has("bottomRight") || h.has("bottomLeft") || h.has("bottomCenter")) && (h.has("bottomLeft") ? v = /* @__PURE__ */ i.jsxs(B, { justify: "space-between", align: "center", children: [
2921
+ y,
2922
+ /* @__PURE__ */ i.jsxs(k, { size: "sm", c: "dimmed", children: [
2923
+ "Showing ",
2924
+ d * c + 1,
2925
+ " to",
2926
+ " ",
2927
+ Math.min((d + 1) * c, n.total),
2928
+ " of ",
2929
+ n.total,
2930
+ " ",
2931
+ "records"
2932
+ ] })
2933
+ ] }) : v = /* @__PURE__ */ i.jsxs(B, { justify: "space-between", align: "center", children: [
2934
+ /* @__PURE__ */ i.jsxs(k, { size: "sm", c: "dimmed", children: [
2935
+ "Showing ",
2936
+ d * c + 1,
2937
+ " to",
2938
+ " ",
2939
+ Math.min((d + 1) * c, n.total),
2940
+ " of ",
2941
+ n.total,
2942
+ " ",
2943
+ "records"
2944
+ ] }),
2945
+ y
2946
+ ] }));
2947
+ }
2948
+ const j = E(() => /* @__PURE__ */ i.jsx(
2949
+ _a,
2950
+ {
2951
+ data: n,
2952
+ loading: a,
2953
+ columns: e.columns,
2954
+ getRowId: e.getRowId,
2955
+ selectedRowKeys: o,
2956
+ setSelectedRowKeys: l,
2957
+ hasTopSection: p !== void 0,
2958
+ hasBottomSection: v !== void 0
2959
+ }
2960
+ ), [
2961
+ n,
2962
+ a,
2963
+ e.columns,
2964
+ e.getRowId,
2965
+ o,
2966
+ l,
2967
+ p !== void 0,
2968
+ v !== void 0
2969
+ ]);
2970
+ return p === void 0 || v === void 0 ? j : /* @__PURE__ */ i.jsxs("div", { children: [
2971
+ p !== void 0 && /* @__PURE__ */ i.jsx(
2972
+ re,
2973
+ {
2974
+ withBorder: !0,
2975
+ p: "xs",
2976
+ style: {
2977
+ borderBottomLeftRadius: 0,
2978
+ borderBottomRightRadius: 0,
2979
+ borderBottom: "none"
2980
+ },
2981
+ children: p
2982
+ }
2983
+ ),
2984
+ j,
2985
+ v !== void 0 && /* @__PURE__ */ i.jsx(
2986
+ re,
2987
+ {
2988
+ withBorder: !0,
2989
+ p: "xs",
2990
+ style: {
2991
+ borderTopLeftRadius: 0,
2992
+ borderTopRightRadius: 0,
2993
+ borderTop: "none"
2994
+ },
2995
+ children: v
2996
+ }
2997
+ )
2998
+ ] });
2999
+ }, _a = (e) => {
3000
+ const n = E(() => {
3001
+ const a = [
3002
+ {
3003
+ id: "selection",
3004
+ header: ({ table: r }) => /* @__PURE__ */ i.jsx(
3005
+ me,
3006
+ {
3007
+ checked: r.getIsAllRowsSelected(),
3008
+ indeterminate: r.getIsSomeRowsSelected(),
3009
+ onChange: r.getToggleAllRowsSelectedHandler()
3010
+ }
3011
+ ),
3012
+ cell: ({ row: r }) => /* @__PURE__ */ i.jsx(
3013
+ me,
3014
+ {
3015
+ checked: r.getIsSelected(),
3016
+ disabled: !r.getCanSelect(),
3017
+ onChange: r.getToggleSelectedHandler()
3018
+ }
3019
+ )
3020
+ }
3021
+ ];
3022
+ return e.columns.forEach((r) => {
3023
+ a.push({
3024
+ id: r.key,
3025
+ header: r.title,
3026
+ accessorFn: r.render,
3027
+ cell: ({ row: o }) => r.render(o.original)
3028
+ });
3029
+ }), a;
3030
+ }, [e.columns]), t = Pt({
3031
+ data: e.data.records,
3032
+ columns: n,
3033
+ getCoreRowModel: It(),
3034
+ // convert to string, but we actually can get away with number
3035
+ getRowId: (a) => e.getRowId(a).toString(),
3036
+ state: {
3037
+ rowSelection: e.selectedRowKeys
3038
+ },
3039
+ onRowSelectionChange: e.setSelectedRowKeys,
3040
+ manualPagination: !0
3041
+ });
3042
+ return /* @__PURE__ */ i.jsx(
3043
+ Qt,
3044
+ {
3045
+ table: t,
3046
+ selectedRowKeys: e.selectedRowKeys,
3047
+ bordered: !0,
3048
+ hasTopSection: e.hasTopSection,
3049
+ hasBottomSection: e.hasBottomSection
3050
+ }
3051
+ );
3052
+ };
3053
+ function tn(e, n, t, {
3054
+ title: a,
3055
+ nestedKey: r,
3056
+ component: o
3057
+ } = {}) {
3058
+ let l;
3059
+ if (o !== void 0)
3060
+ l = o;
3061
+ else if (pe(t))
3062
+ t.cardinality === "1:N" || t.cardinality === "N:N" ? l = Fe : l = Le;
3063
+ else {
3064
+ if (Q[t.datatype] === void 0)
3065
+ throw new Error(
3066
+ `No display component found for datatype ${t.datatype}`
3067
+ );
3068
+ l = Q[t.datatype];
3069
+ }
3070
+ const s = {
3071
+ key: t.name,
3072
+ title: a || /* @__PURE__ */ i.jsx(O, { value: t.label }),
3073
+ accessorFn: (u) => u[t.tsName],
3074
+ render: (u) => {
3075
+ const c = u[t.tsName];
3076
+ return /* @__PURE__ */ i.jsx(
3077
+ l,
3078
+ {
3079
+ db: e,
3080
+ property: t,
3081
+ value: c,
3082
+ entityRoutes: n
3083
+ }
3084
+ );
3085
+ }
3086
+ };
3087
+ return r !== void 0 && (s.accessorFn = (u) => u[r][t.tsName], s.render = (u) => {
3088
+ const c = u[r][t.tsName];
3089
+ return /* @__PURE__ */ i.jsx(
3090
+ l,
3091
+ {
3092
+ db: e,
3093
+ property: t,
3094
+ value: c,
3095
+ entityRoutes: n
3096
+ }
3097
+ );
3098
+ }), s;
3099
+ }
3100
+ function fo(e, n, t, a, {
3101
+ title: r,
3102
+ nestedKey: o,
3103
+ component: l
3104
+ } = {}) {
3105
+ let s;
3106
+ if (l !== void 0)
3107
+ s = l;
3108
+ else if (pe(a))
3109
+ a.cardinality === "1:N" || a.cardinality === "N:N" ? s = Fe : s = Le;
3110
+ else {
3111
+ if (Q[a.datatype] === void 0)
3112
+ throw new Error(
3113
+ `No display component found for datatype ${a.datatype}`
3114
+ );
3115
+ s = Q[a.datatype];
3116
+ }
3117
+ const u = {
3118
+ key: t + "." + a.name,
3119
+ title: r || /* @__PURE__ */ i.jsx(O, { value: a.label }),
3120
+ accessorFn: (c) => c[t.tsName][a.tsName],
3121
+ render: (c) => {
3122
+ const d = c[t.tsName][a.tsName];
3123
+ return /* @__PURE__ */ i.jsx(
3124
+ s,
3125
+ {
3126
+ db: e,
3127
+ property: a,
3128
+ value: d,
3129
+ entityRoutes: n
3130
+ }
3131
+ );
3132
+ }
3133
+ };
3134
+ return o !== void 0 && (u.accessorFn = (c) => c[o][t.tsName][a.tsName], u.render = (c) => {
3135
+ const d = c[o][t.tsName][a.tsName];
3136
+ return /* @__PURE__ */ i.jsx(
3137
+ s,
3138
+ {
3139
+ db: e,
3140
+ property: a,
3141
+ value: d,
3142
+ entityRoutes: n
3143
+ }
3144
+ );
3145
+ }), u;
3146
+ }
3147
+ function ho(e, n, t, a, r = {}) {
3148
+ return a.map((o) => nn(o) ? o : tn(
3149
+ e,
3150
+ t,
3151
+ n.publicProperties[o],
3152
+ r
3153
+ ));
3154
+ }
3155
+ function mo(e, n, t, a = [], r = {}) {
3156
+ return a.map((o) => nn(o) ? o : tn(
3157
+ e,
3158
+ t,
3159
+ n.publicProperties[o],
3160
+ r
3161
+ ));
3162
+ }
3163
+ function nn(e) {
3164
+ return typeof e == "object" && "key" in e && "title" in e;
3165
+ }
3166
+ const $a = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), go = (e) => {
3167
+ var d, x;
3168
+ const [n, t] = _(
3169
+ {}
3170
+ ), a = E(() => {
3171
+ const g = [
3172
+ {
3173
+ id: "selection",
3174
+ header: ({ table: p }) => /* @__PURE__ */ i.jsx(
3175
+ me,
3176
+ {
3177
+ checked: p.getIsAllRowsSelected(),
3178
+ indeterminate: p.getIsSomeRowsSelected(),
3179
+ onChange: p.getToggleAllRowsSelectedHandler()
3180
+ }
3181
+ ),
3182
+ cell: ({ row: p }) => /* @__PURE__ */ i.jsx(
3183
+ me,
3184
+ {
3185
+ checked: p.getIsSelected(),
3186
+ disabled: !p.getCanSelect(),
3187
+ onChange: p.getToggleSelectedHandler()
3188
+ }
3189
+ )
3190
+ }
3191
+ ];
3192
+ return e.columns.forEach((p) => {
3193
+ g.push({
3194
+ id: p.key,
3195
+ header: p.title,
3196
+ accessorFn: p.render,
3197
+ cell: ({ row: v }) => p.render(v.original)
3198
+ });
3199
+ }), g;
3200
+ }, [e.columns]), r = Pt({
3201
+ data: e.data,
3202
+ columns: a,
3203
+ getCoreRowModel: It(),
3204
+ getPaginationRowModel: Pn(),
3205
+ state: {
3206
+ rowSelection: n
3207
+ },
3208
+ onRowSelectionChange: t
3209
+ }), o = E(() => Object.keys(n).filter((g) => n[g]).map(Number), [n]);
3210
+ let l, s;
3211
+ Zt(e.actions) && (l = /* @__PURE__ */ i.jsx(
3212
+ Xt,
3213
+ {
3214
+ actions: e.actions,
3215
+ selectedRowKeys: o
3216
+ }
3217
+ ));
3218
+ const u = ((d = e.pagination) == null ? void 0 : d.positions) || $a;
3219
+ if (u.size > 0) {
3220
+ const g = r.getState().pagination, p = /* @__PURE__ */ i.jsx(
3221
+ en,
3222
+ {
3223
+ total: r.getPageCount(),
3224
+ pageIndex: g.pageIndex,
3225
+ pageSize: g.pageSize,
3226
+ onUpdatePagination: (v, h) => r.setPagination({ pageIndex: v, pageSize: h }),
3227
+ allowPageSizeChange: (x = e.pagination) == null ? void 0 : x.showSizeChanger
3228
+ }
3229
+ );
3230
+ u.has("topRight") && (l !== void 0 ? l = /* @__PURE__ */ i.jsxs(D, { justify: "space-between", gap: "sm", children: [
3231
+ l,
3232
+ p
3233
+ ] }) : l = /* @__PURE__ */ i.jsx(B, { justify: "flex-end", children: p })), (u.has("bottomRight") || u.has("bottomLeft") || u.has("bottomCenter")) && (u.has("bottomLeft") ? s = /* @__PURE__ */ i.jsxs(B, { justify: "space-between", align: "center", children: [
3234
+ p,
3235
+ /* @__PURE__ */ i.jsxs(k, { size: "sm", c: "dimmed", children: [
3236
+ "Showing ",
3237
+ g.pageIndex * g.pageSize + 1,
3238
+ " to",
3239
+ " ",
3240
+ Math.min(
3241
+ (g.pageIndex + 1) * g.pageSize,
3242
+ e.data.length
3243
+ ),
3244
+ " ",
3245
+ "of ",
3246
+ e.data.length,
3247
+ " records"
3248
+ ] })
3249
+ ] }) : s = /* @__PURE__ */ i.jsxs(B, { justify: "space-between", align: "center", children: [
3250
+ /* @__PURE__ */ i.jsxs(k, { size: "sm", c: "dimmed", children: [
3251
+ "Showing ",
3252
+ g.pageIndex * g.pageSize + 1,
3253
+ " to",
3254
+ " ",
3255
+ Math.min(
3256
+ (g.pageIndex + 1) * g.pageSize,
3257
+ e.data.length
3258
+ ),
3259
+ " ",
3260
+ "of ",
3261
+ e.data.length,
3262
+ " records"
3263
+ ] }),
3264
+ p
3265
+ ] }));
3266
+ }
3267
+ const c = /* @__PURE__ */ i.jsx(
3268
+ Qt,
3269
+ {
3270
+ selectedRowKeys: n,
3271
+ table: r,
3272
+ bordered: !0,
3273
+ hasTopSection: l !== void 0,
3274
+ hasBottomSection: s !== void 0
3275
+ }
3276
+ );
3277
+ return l === void 0 && s === void 0 ? c : /* @__PURE__ */ i.jsxs("div", { children: [
3278
+ l !== void 0 && /* @__PURE__ */ i.jsx(
3279
+ re,
3280
+ {
3281
+ withBorder: !0,
3282
+ p: "xs",
3283
+ style: {
3284
+ borderBottomLeftRadius: 0,
3285
+ borderBottomRightRadius: 0,
3286
+ borderBottom: "none"
3287
+ },
3288
+ children: l
3289
+ }
3290
+ ),
3291
+ c,
3292
+ s !== void 0 && /* @__PURE__ */ i.jsx(
3293
+ re,
3294
+ {
3295
+ withBorder: !0,
3296
+ p: "xs",
3297
+ style: {
3298
+ borderTopLeftRadius: 0,
3299
+ borderTopRightRadius: 0,
3300
+ borderTop: "none"
3301
+ },
3302
+ children: s
3303
+ }
3304
+ )
3305
+ ] });
3306
+ }, jt = ee(
3307
+ ({
3308
+ store: e,
3309
+ record: n,
3310
+ property: t,
3311
+ DisplayComponent: a,
3312
+ entityRoutes: r
3313
+ }) => {
3314
+ const o = n[t.tsName];
3315
+ return /* @__PURE__ */ i.jsxs("div", { children: [
3316
+ /* @__PURE__ */ i.jsx(k, { size: "sm", fw: 500, children: /* @__PURE__ */ i.jsx(O, { value: t.label }) }),
3317
+ /* @__PURE__ */ i.jsx(
3318
+ a,
3319
+ {
3320
+ db: e.db,
3321
+ entityRoutes: r,
3322
+ property: t,
3323
+ value: o
3324
+ }
3325
+ )
3326
+ ] });
3327
+ }
3328
+ ), Oa = ee(
3329
+ ({
3330
+ store: e,
3331
+ record: n,
3332
+ properties: t,
3333
+ DisplayComponent: a,
3334
+ entityRoutes: r
3335
+ }) => {
3336
+ const o = t[t.length - 1], l = t.reduce((s, u) => {
3337
+ if (s != null)
3338
+ return s[u.tsName];
3339
+ }, n);
3340
+ return /* @__PURE__ */ i.jsxs("div", { children: [
3341
+ /* @__PURE__ */ i.jsx(k, { size: "sm", fw: 500, children: /* @__PURE__ */ i.jsx(O, { value: o.label }) }),
3342
+ l !== void 0 && /* @__PURE__ */ i.jsx(
3343
+ a,
3344
+ {
3345
+ db: e.db,
3346
+ property: o,
3347
+ value: l,
3348
+ entityRoutes: r
3349
+ }
3350
+ )
3351
+ ] });
3352
+ }
3353
+ ), Da = 12, Ma = (e) => {
3354
+ const n = e.schema, t = E(() => e.fieldGroups.map((a, r) => za(
3355
+ n,
3356
+ e.store,
3357
+ e.record,
3358
+ r,
3359
+ a,
3360
+ e.entityRoutes
3361
+ )), [n, e.store, e.record, e.fieldGroups]);
3362
+ return /* @__PURE__ */ i.jsx(ge, { gap: "sm", className: e.className, style: e.styles, children: t });
3363
+ };
3364
+ function za(e, n, t, a, r, o) {
3365
+ const l = r.fields, s = [];
3366
+ for (let u = 0; u < l.length; u++) {
3367
+ const c = Da / l[u].length;
3368
+ if (!Number.isInteger(c))
3369
+ throw new Error(`Span must be an integer, but got ${c} for row ${u}`);
3370
+ for (let d = 0; d < l[u].length; d++) {
3371
+ const x = l[u][d];
3372
+ let g;
3373
+ if (typeof x == "function")
3374
+ g = x(n, t);
3375
+ else if (typeof x == "object" && "prop" in x) {
3376
+ const p = e.allProperties[x.prop], v = x.display;
3377
+ g = /* @__PURE__ */ i.jsx(
3378
+ jt,
3379
+ {
3380
+ store: n,
3381
+ record: t,
3382
+ property: p,
3383
+ DisplayComponent: v,
3384
+ entityRoutes: o
3385
+ }
3386
+ );
3387
+ } else {
3388
+ const p = e.allProperties[x];
3389
+ let v;
3390
+ if (pe(p))
3391
+ v = p.cardinality === "N:N" || p.cardinality === "1:N" ? Fe : Le;
3392
+ else {
3393
+ if (Q[p.datatype] === void 0)
3394
+ throw new Error(
3395
+ `No display component found for datatype ${p.datatype}`
3396
+ );
3397
+ v = Q[p.datatype];
3398
+ }
3399
+ g = /* @__PURE__ */ i.jsx(
3400
+ jt,
3401
+ {
3402
+ store: n,
3403
+ record: t,
3404
+ property: p,
3405
+ DisplayComponent: v,
3406
+ entityRoutes: o
3407
+ }
3408
+ );
3409
+ }
3410
+ s.push(
3411
+ /* @__PURE__ */ i.jsx(A.Col, { span: c, children: g }, `${u}-${d}`)
3412
+ );
3413
+ }
3414
+ }
3415
+ return /* @__PURE__ */ i.jsx(A, { gutter: "sm", children: s }, a);
3416
+ }
3417
+ function po(e, n, t) {
3418
+ const a = e[e.length - 1];
3419
+ let r;
3420
+ if (t !== void 0)
3421
+ r = t;
3422
+ else if (pe(a))
3423
+ r = a.cardinality === "N:N" || a.cardinality === "1:N" ? Fe : Le;
3424
+ else {
3425
+ if (Q[a.datatype] === void 0)
3426
+ throw new Error(
3427
+ `No display component found for datatype ${a.datatype}`
3428
+ );
3429
+ r = Q[a.datatype];
3430
+ }
3431
+ return (o, l) => /* @__PURE__ */ i.jsx(
3432
+ Oa,
3433
+ {
3434
+ store: o,
3435
+ record: l,
3436
+ properties: e,
3437
+ DisplayComponent: r,
3438
+ entityRoutes: n
3439
+ }
3440
+ );
3441
+ }
3442
+ const xo = (e) => /* @__PURE__ */ i.jsxs(ye, { defaultValue: e.fieldTabs[0].tabName, children: [
3443
+ /* @__PURE__ */ i.jsx(ye.List, { children: e.fieldTabs.map((n, t) => /* @__PURE__ */ i.jsx(ye.Tab, { value: n.tabName, children: n.tabName }, t)) }),
3444
+ e.fieldTabs.map((n, t) => /* @__PURE__ */ i.jsx(ye.Panel, { value: n.tabName, pt: "sm", children: /* @__PURE__ */ i.jsx(
3445
+ Ma,
3446
+ {
3447
+ schema: e.schema,
3448
+ store: e.store,
3449
+ record: e.record,
3450
+ fieldGroups: n.fieldGroups,
3451
+ styles: e.tabStyles,
3452
+ className: e.tabClassName,
3453
+ entityRoutes: e.entityRoutes
3454
+ }
3455
+ ) }, t))
3456
+ ] });
3457
+ export {
3458
+ Be as CountryFlagComponent,
3459
+ Aa as DEFAULT_PAGINATION_POSITIONS,
3460
+ xt as DataType2Component,
3461
+ Q as DataType2DisplayComponent,
3462
+ aa as DateDisplay,
3463
+ ra as DateTimeDisplay,
3464
+ so as DateTimeHideTimeDisplay,
3465
+ _n as EmojiCountryFlag,
3466
+ Sa as FormItem,
3467
+ wa as FormItemLabel,
3468
+ Xa as LanguageSelector,
3469
+ eo as Loading,
3470
+ to as LoadingInline,
3471
+ xe as LocaleContext,
3472
+ Ja as LocaleProvider,
3473
+ Qr as MenuTrie,
3474
+ Fe as MultiForeignKeyDisplay,
3475
+ O as MultiLingualString,
3476
+ no as NotAuthorized,
3477
+ Za as NotFound,
3478
+ Yt as NotFoundInline,
3479
+ Qa as NotFoundSubPage,
3480
+ io as OrderedUniqueList,
3481
+ Zr as Permission,
3482
+ An as SVGCountryFlag,
3483
+ go as SeraEmbeddedTable,
3484
+ uo as SeraForm,
3485
+ co as SeraTable,
3486
+ lo as SeraVerticalMenu,
3487
+ Ma as SeraView,
3488
+ xo as SeraViewTab,
3489
+ Le as SingleForeignKeyDisplay,
3490
+ Gt as Trie,
3491
+ mt as TrieNode,
3492
+ ea as buildMenuItemIndex,
3493
+ N as countryFlags,
3494
+ na as filterAllowedItems,
3495
+ ro as groupBy,
3496
+ ao as groupByAsList,
3497
+ nn as isSeraColumn,
3498
+ mo as makeEmbeddedTableColumns,
3499
+ po as makeFieldDisplay,
3500
+ tn as makeTableColumn,
3501
+ fo as makeTableColumnFromNestedProperty,
3502
+ ho as makeTableColumns,
3503
+ oo as uniqueList
3504
+ };