sera-components 1.1.8 → 1.1.10

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