sera-components 1.1.10 → 1.2.0

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