@sito/dashboard-app 0.0.38 → 0.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +1 -1
  2. package/dist/components/Actions/Actions.test.d.ts +1 -0
  3. package/dist/components/Actions/ActionsDropdown.stories.d.ts +1 -2
  4. package/dist/components/Actions/types.d.ts +3 -0
  5. package/dist/components/Buttons/IconButton.d.ts +6 -2
  6. package/dist/components/Buttons/index.d.ts +2 -1
  7. package/dist/components/Dialog/ConfirmationDialog.test.d.ts +1 -0
  8. package/dist/components/Dialog/DialogActions.d.ts +1 -17
  9. package/dist/components/Dialog/FormDialog.d.ts +1 -1
  10. package/dist/components/Dialog/FormDialog.stories.d.ts +1 -1
  11. package/dist/components/Dialog/ImportDialog/Error.d.ts +1 -1
  12. package/dist/components/Dialog/types.d.ts +17 -1
  13. package/dist/components/Empty/types.d.ts +3 -2
  14. package/dist/components/Error/types.d.ts +2 -2
  15. package/dist/components/Form/FormContainer.d.ts +1 -1
  16. package/dist/components/Form/types.d.ts +2 -4
  17. package/dist/components/Loading/SplashScreen.d.ts +2 -1
  18. package/dist/components/Loading/types.d.ts +1 -1
  19. package/dist/components/Navbar/Navbar.test.d.ts +1 -0
  20. package/dist/components/Navbar/types.d.ts +2 -2
  21. package/dist/components/Page/types.d.ts +4 -3
  22. package/dist/components/index.d.ts +0 -1
  23. package/dist/dashboard-app.cjs +1 -1
  24. package/dist/dashboard-app.js +1574 -1592
  25. package/dist/hooks/actions/useDeleteAction.test.d.ts +1 -0
  26. package/dist/hooks/actions/useEditAction.test.d.ts +1 -0
  27. package/dist/hooks/actions/useExportAction.test.d.ts +1 -0
  28. package/dist/hooks/actions/useImportAction.test.d.ts +1 -0
  29. package/dist/hooks/actions/useRestoreAction.test.d.ts +1 -0
  30. package/dist/hooks/dialogs/types.d.ts +2 -2
  31. package/dist/hooks/dialogs/useDialog.test.d.ts +1 -0
  32. package/dist/hooks/dialogs/useFormDialog.d.ts +1 -2
  33. package/dist/hooks/forms/usePostForm.d.ts +1 -2
  34. package/dist/hooks/useScrollTrigger.test.d.ts +1 -0
  35. package/dist/main.css +1 -1
  36. package/dist/main.d.ts +2 -0
  37. package/dist/providers/types.d.ts +1 -1
  38. package/package.json +11 -8
  39. package/dist/components/Buttons/Button.d.ts +0 -2
  40. package/dist/components/Buttons/Button.stories.d.ts +0 -28
  41. package/dist/components/Buttons/IconButton.stories.d.ts +0 -29
  42. package/dist/components/Buttons/types.d.ts +0 -12
  43. package/dist/components/Dropdown/Dropdown.d.ts +0 -2
  44. package/dist/components/Dropdown/Dropdown.stories.d.ts +0 -9
  45. package/dist/components/Dropdown/index.d.ts +0 -2
  46. package/dist/components/Dropdown/types.d.ts +0 -6
@@ -1,194 +1,138 @@
1
- var ps = Object.defineProperty;
2
- var ws = (e, t, s) => t in e ? ps(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var me = (e, t, s) => ws(e, typeof t != "symbol" ? t + "" : t, s);
1
+ var Ss = Object.defineProperty;
2
+ var Cs = (e, t, s) => t in e ? Ss(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
+ var me = (e, t, s) => Cs(e, typeof t != "symbol" ? t + "" : t, s);
4
4
  import "./main.css";
5
- import { useTranslation as T, State as vs, inputStateClassName as xs, labelStateClassName as _s, helperTextStateClassName as Cs, Loading as Ve, TextInput as Ss, FileInput as ks, useTableOptions as Ns, Badge as As } from "@sito/dashboard";
5
+ import { IconButton as Es, useTranslation as L, Dropdown as Ns, State as ks, inputStateClassName as As, labelStateClassName as xs, helperTextStateClassName as Ts, Button as _e, Loading as xe, TextInput as Fs, FileInput as $s, useTableOptions as Ls, Badge as Ds } from "@sito/dashboard";
6
6
  export * from "@sito/dashboard";
7
- import { jsxs as A, jsx as h, Fragment as De } from "react/jsx-runtime";
8
- import ae, { useRef as Be, useCallback as E, useEffect as Z, useReducer as Es, createContext as Pe, useContext as Me, useState as B, useMemo as ke, forwardRef as It } from "react";
9
- import { faTrash as $s, faRotateLeft as Ot, faPencil as Fs, faCircleNotch as Ut, faCloudArrowDown as Ls, faCloudUpload as Ts, faArrowUp as Ds, faEllipsisV as Vs, faEyeSlash as Ps, faEye as Ms, faClose as Rt, faArrowLeft as Is, faAdd as vt, faFilter as Os, faBars as Us, faSearch as Rs, faCircleCheck as qs, faWarning as Bs } from "@fortawesome/free-solid-svg-icons";
7
+ import { Button as Bn } from "@sito/dashboard";
8
+ import { jsxs as A, jsx as h, Fragment as Ve } from "react/jsx-runtime";
10
9
  import { FontAwesomeIcon as ce } from "@fortawesome/react-fontawesome";
11
- import { createPortal as qt } from "react-dom";
12
- import { css as Hs } from "@emotion/css";
13
- import { QueryClient as js, QueryClientProvider as Qs, useMutation as Ie, useQuery as Ks } from "@tanstack/react-query";
14
- import { faSadTear as Ws } from "@fortawesome/free-regular-svg-icons";
15
- function Bt(e) {
10
+ import ie, { useCallback as D, useRef as Ie, useReducer as Rt, createContext as Pe, useContext as Oe, useState as Y, useMemo as Ae, useEffect as le, forwardRef as Ut, useLayoutEffect as Vs } from "react";
11
+ import { faTrash as Is, faRotateLeft as qt, faPencil as Ps, faCircleNotch as Bt, faCloudArrowDown as Os, faCloudUpload as Ms, faArrowUp as Rs, faEllipsisV as Us, faEyeSlash as qs, faEye as Bs, faClose as Ht, faArrowLeft as Hs, faAdd as St, faFilter as Qs, faBars as Ks, faSearch as js, faCircleCheck as Ws, faWarning as Gs } from "@fortawesome/free-solid-svg-icons";
12
+ import { createPortal as Qt } from "react-dom";
13
+ import { QueryClient as Js, QueryClientProvider as zs, useMutation as Me, useQuery as Ys } from "@tanstack/react-query";
14
+ import { faSadTear as Xs } from "@fortawesome/free-regular-svg-icons";
15
+ function Kt(e) {
16
16
  const {
17
17
  id: t,
18
18
  icon: s,
19
19
  tooltip: n,
20
20
  onClick: i,
21
21
  children: r,
22
- hidden: c = !1,
23
- disabled: a = !1,
24
- showText: d = !1,
25
- showTooltips: m = !0
22
+ hidden: a = !1,
23
+ disabled: c = !1,
24
+ showText: l = !1,
25
+ showTooltips: m = !0,
26
+ className: y = ""
26
27
  } = e;
27
- return c ? null : /* @__PURE__ */ A(
28
+ return a ? null : /* @__PURE__ */ A(
28
29
  "button",
29
30
  {
30
31
  id: t,
31
- className: `action ${d ? "text-action" : "icon-action"}`,
32
- disabled: a,
33
- onClick: () => i(),
34
- "aria-disabled": a,
32
+ className: `action ${l ? "text-action" : "icon-action"} ${y}`,
33
+ disabled: c,
34
+ onClick: () => i == null ? void 0 : i(),
35
+ "aria-disabled": c,
35
36
  "data-tooltip-id": "tooltip",
36
37
  "data-tooltip-content": m ? n : "",
37
38
  children: [
38
39
  s,
39
40
  " ",
40
- d && n,
41
+ l && n,
41
42
  r
42
43
  ]
43
44
  }
44
45
  );
45
46
  }
46
- function Ht(e) {
47
+ function jt(e) {
47
48
  const {
48
49
  actions: t = [],
49
50
  className: s = "",
50
- showTooltips: n = !0,
51
- showActionTexts: i = !1
51
+ itemClassName: n = "",
52
+ actionClassName: i = "",
53
+ showTooltips: r = !0,
54
+ showActionTexts: a = !1
52
55
  } = e;
53
- return /* @__PURE__ */ h("ul", { className: `actions-container ${s}`, children: t == null ? void 0 : t.map((r) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ h(
54
- Bt,
56
+ return /* @__PURE__ */ h("ul", { className: `actions-container ${s}`, children: t.map((c) => /* @__PURE__ */ h(
57
+ "li",
55
58
  {
56
- showTooltips: n,
57
- showText: i,
58
- ...r,
59
- children: r.children
60
- }
61
- ) }, r.id)) });
62
- }
63
- const zs = (e) => {
64
- const { children: t, open: s, onClose: n } = e, i = Be(null), r = E(
65
- (a) => {
66
- const d = i.current;
67
- !s || !d || d.contains(a.target) || n();
68
- },
69
- [s, n]
70
- ), c = E(
71
- (a) => {
72
- s && a.key === "Escape" && n();
59
+ className: `actions-container-item ${n}`,
60
+ children: /* @__PURE__ */ h(
61
+ Kt,
62
+ {
63
+ showTooltips: r,
64
+ showText: a,
65
+ className: i,
66
+ ...c
67
+ }
68
+ )
73
69
  },
74
- [s, n]
75
- );
76
- return Z(() => {
77
- if (s)
78
- return setTimeout(() => {
79
- var a;
80
- return (a = i.current) == null ? void 0 : a.focus();
81
- }, 0), document.addEventListener("mousedown", r), document.addEventListener("keydown", c), () => {
82
- document.removeEventListener("mousedown", r), document.removeEventListener("keydown", c);
83
- };
84
- }, [s, r, c]), /* @__PURE__ */ h(
85
- "div",
86
- {
87
- ref: i,
88
- role: "menu",
89
- "aria-hidden": !s,
90
- tabIndex: -1,
91
- className: `dropdown-main ${s ? "opened" : "closed"}`,
92
- onClick: (a) => a.stopPropagation(),
93
- children: t
94
- }
95
- );
96
- }, be = (e) => {
97
- const {
98
- children: t,
99
- icon: s,
100
- type: n = "button",
101
- className: i = "",
102
- variant: r = "text",
103
- color: c = "default",
104
- iconClassName: a = "",
105
- ...d
106
- } = e;
107
- return /* @__PURE__ */ A(
108
- "button",
109
- {
110
- type: n,
111
- className: `icon-button ${i} ${r} ${c}`,
112
- ...d,
113
- children: [
114
- /* @__PURE__ */ h(ce, { icon: s, className: `!w-auto ${a}` }),
115
- t
116
- ]
117
- }
118
- );
119
- }, xe = (e) => {
120
- const {
121
- children: t,
122
- type: s = "button",
123
- variant: n = "text",
124
- color: i = "default",
125
- className: r = "",
126
- ...c
127
- } = e;
128
- return /* @__PURE__ */ h("button", { type: s, className: `button ${n} ${i} ${r}`, ...c, children: t });
129
- };
130
- var tt, xt;
131
- function Gs() {
132
- if (xt) return tt;
133
- xt = 1;
134
- const e = (a, d = "local", m = void 0) => {
135
- if (d === "local") {
136
- if (localStorage.getItem(a) !== void 0 && localStorage.getItem(a) !== "undefined" && localStorage.getItem(a) !== null)
137
- return m === void 0 || m !== void 0 && localStorage.getItem(a) === m;
138
- } else if (d === "session" && sessionStorage.getItem(a) !== void 0 && sessionStorage.getItem(a) !== "undefined" && sessionStorage.getItem(a) !== null)
139
- return m === void 0 || m !== void 0 && sessionStorage.getItem(a) === m;
70
+ c.id
71
+ )) });
72
+ }
73
+ const pe = ({ icon: e, ...t }) => /* @__PURE__ */ h(Es, { icon: /* @__PURE__ */ h(ce, { icon: e }), ...t });
74
+ var st, Ct;
75
+ function Zs() {
76
+ if (Ct) return st;
77
+ Ct = 1;
78
+ const e = (c, l = "local", m = void 0) => {
79
+ if (l === "local") {
80
+ if (localStorage.getItem(c) !== void 0 && localStorage.getItem(c) !== "undefined" && localStorage.getItem(c) !== null)
81
+ return m === void 0 || m !== void 0 && localStorage.getItem(c) === m;
82
+ } else if (l === "session" && sessionStorage.getItem(c) !== void 0 && sessionStorage.getItem(c) !== "undefined" && sessionStorage.getItem(c) !== null)
83
+ return m === void 0 || m !== void 0 && sessionStorage.getItem(c) === m;
140
84
  return !1;
141
- }, t = (a) => {
142
- const d = {};
143
- return a.substring(1).split("&").forEach((b) => {
144
- const [y, f] = b.split("=");
145
- d[y] = f;
146
- }), d;
147
- }, s = (a = "") => {
148
- if (r(a) && a.length) return r(a);
85
+ }, t = (c) => {
86
+ const l = {};
87
+ return c.substring(1).split("&").forEach((y) => {
88
+ const [g, f] = y.split("=");
89
+ l[g] = f;
90
+ }), l;
91
+ }, s = (c = "") => {
92
+ if (r(c) && c.length) return r(c);
149
93
  {
150
- let d = navigator.language || navigator.userLanguage;
151
- if (d.indexOf("en") < 0 && d.indexOf("es") < 0 && (d = "en-US"), d = d.split("-")[0], d)
152
- return a.length && i(a, 730, d), d;
94
+ let l = navigator.language || navigator.userLanguage;
95
+ if (l.indexOf("en") < 0 && l.indexOf("es") < 0 && (l = "en-US"), l = l.split("-")[0], l)
96
+ return c.length && i(c, 730, l), l;
153
97
  }
154
98
  return "en";
155
- }, n = (a = 0, d = 0, m = window, b = "smooth") => m.scroll({
156
- top: a,
157
- left: d,
158
- behavior: b
159
- }), i = (a, d, m, b = "/", y = "Lax") => {
99
+ }, n = (c = 0, l = 0, m = window, y = "smooth") => m.scroll({
100
+ top: c,
101
+ left: l,
102
+ behavior: y
103
+ }), i = (c, l, m, y = "/", g = "Lax") => {
160
104
  var f = /* @__PURE__ */ new Date();
161
- f.setTime(f.getTime() + d * 24 * 60 * 60 * 1e3);
162
- const w = "; expires=" + f.toUTCString();
163
- document.cookie = `${a}=${m || ""}${w};path=${b};SameSite=${y}`;
164
- }, r = (a) => {
165
- const d = `${a}=`, b = decodeURIComponent(document.cookie).split(";");
166
- for (let y = 0; y < b.length; y += 1) {
167
- let f = b[y];
105
+ f.setTime(f.getTime() + l * 24 * 60 * 60 * 1e3);
106
+ const p = "; expires=" + f.toUTCString();
107
+ document.cookie = `${c}=${m || ""}${p};path=${y};SameSite=${g}`;
108
+ }, r = (c) => {
109
+ const l = `${c}=`, y = decodeURIComponent(document.cookie).split(";");
110
+ for (let g = 0; g < y.length; g += 1) {
111
+ let f = y[g];
168
112
  for (; f.charAt(0) === " "; )
169
113
  f = f.substring(1);
170
- if (f.indexOf(d) === 0)
171
- return f.substring(d.length, f.length);
114
+ if (f.indexOf(l) === 0)
115
+ return f.substring(l.length, f.length);
172
116
  }
173
117
  return "";
174
118
  };
175
- return tt = {
119
+ return st = {
176
120
  getCookie: r,
177
121
  createCookie: i,
178
- deleteCookie: (a) => document.cookie = `${a}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`,
122
+ deleteCookie: (c) => document.cookie = `${c}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`,
179
123
  getUserLanguage: s,
180
124
  scrollTo: n,
181
125
  parseQueries: t,
182
126
  validation: e
183
- }, tt;
127
+ }, st;
184
128
  }
185
- var Js = Gs();
186
- function Xr() {
187
- const { t: e, language: t } = T();
188
- return { timeAge: E(
129
+ var er = Zs();
130
+ function an() {
131
+ const { t: e, language: t } = L();
132
+ return { timeAge: D(
189
133
  (n) => {
190
- const r = /* @__PURE__ */ new Date() - n, c = Math.floor(r / (1e3 * 60)), a = Math.floor(c / 60), d = t === "es", m = e("_accessibility:labels.ago"), b = e("_accessibility:labels.minute"), y = e("_accessibility:labels.minutes"), f = e("_accessibility:labels.hour"), w = e("_accessibility:labels.hours"), C = e("_accessibility:labels.yesterday"), g = e("_accessibility:labels.justNow");
191
- return r < 1e3 * 60 ? g : c < 60 ? `${d ? m : ""} ${c} ${c === 1 ? b : y} ${d ? "" : m}` : a < 24 ? `${d ? m : ""} ${a} ${a === 1 ? f : w} ${d ? "" : m}` : a < 48 ? C : n.toLocaleDateString(navigator.language || "es-ES", {
134
+ const r = /* @__PURE__ */ new Date() - n, a = Math.floor(r / (1e3 * 60)), c = Math.floor(a / 60), l = t === "es", m = e("_accessibility:labels.ago"), y = e("_accessibility:labels.minute"), g = e("_accessibility:labels.minutes"), f = e("_accessibility:labels.hour"), p = e("_accessibility:labels.hours"), _ = e("_accessibility:labels.yesterday"), C = e("_accessibility:labels.justNow");
135
+ return r < 1e3 * 60 ? C : a < 60 ? `${l ? m : ""} ${a} ${a === 1 ? y : g} ${l ? "" : m}` : c < 24 ? `${l ? m : ""} ${c} ${c === 1 ? f : p} ${l ? "" : m}` : c < 48 ? _ : n.toLocaleDateString(navigator.language || "es-ES", {
192
136
  day: "2-digit",
193
137
  month: "2-digit",
194
138
  year: "numeric"
@@ -197,8 +141,8 @@ function Xr() {
197
141
  [e, t]
198
142
  ) };
199
143
  }
200
- var Q = /* @__PURE__ */ ((e) => (e[e.success = 0] = "success", e[e.error = 1] = "error", e[e.warning = 2] = "warning", e[e.info = 3] = "info", e))(Q || {}), ne = /* @__PURE__ */ ((e) => (e.GET = "GET", e.POST = "POST", e.PUT = "PUT", e.PATCH = "PATCH", e.DELETE = "DELETE", e))(ne || {});
201
- async function Ee(e, t = "GET", s, n) {
144
+ var J = /* @__PURE__ */ ((e) => (e[e.success = 0] = "success", e[e.error = 1] = "error", e[e.warning = 2] = "warning", e[e.info = 3] = "info", e))(J || {}), te = /* @__PURE__ */ ((e) => (e.GET = "GET", e.POST = "POST", e.PUT = "PUT", e.PATCH = "PATCH", e.DELETE = "DELETE", e))(te || {});
145
+ async function Te(e, t = "GET", s, n) {
202
146
  const i = {
203
147
  ...s ? { "Content-Type": "application/json" } : {},
204
148
  ...n
@@ -208,26 +152,26 @@ async function Ee(e, t = "GET", s, n) {
208
152
  method: t,
209
153
  headers: i,
210
154
  ...s ? { body: JSON.stringify(s) } : {}
211
- }), c = await r.text();
212
- let a = null;
155
+ }), a = await r.text();
156
+ let c = null;
213
157
  try {
214
- a = c ? JSON.parse(c) : null;
158
+ c = a ? JSON.parse(a) : null;
215
159
  } catch {
216
- a = null;
160
+ c = null;
217
161
  }
218
162
  if (!r.ok) {
219
- const d = typeof a == "object" && a !== null ? a.message ?? a.error ?? c : c || r.statusText;
163
+ const l = typeof c == "object" && c !== null ? c.message ?? c.error ?? a : a || r.statusText;
220
164
  return {
221
165
  data: null,
222
166
  status: r.status,
223
167
  error: {
224
168
  status: r.status,
225
- message: d || "Unknown error occurred"
169
+ message: l || "Unknown error occurred"
226
170
  }
227
171
  };
228
172
  }
229
173
  return {
230
- data: r.status !== 204 && a !== null ? a : null,
174
+ data: r.status !== 204 && c !== null ? c : null,
231
175
  status: r.status,
232
176
  error: null
233
177
  };
@@ -242,7 +186,7 @@ async function Ee(e, t = "GET", s, n) {
242
186
  };
243
187
  }
244
188
  }
245
- function Ys(e, t) {
189
+ function tr(e, t) {
246
190
  if (t) {
247
191
  const s = Object.entries(t).filter(([, n]) => n != null).map(
248
192
  ([n, i]) => `${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`
@@ -251,34 +195,34 @@ function Ys(e, t) {
251
195
  }
252
196
  return e;
253
197
  }
254
- const jt = (e, t, s) => {
198
+ const Wt = (e, t, s) => {
255
199
  const n = [];
256
200
  if (t) {
257
- const { sortingBy: i, sortingOrder: r, currentPage: c, pageSize: a } = t;
201
+ const { sortingBy: i, sortingOrder: r, currentPage: a, pageSize: c } = t;
258
202
  n.push(
259
203
  `sort=${String(i)}`,
260
204
  `order=${r}`,
261
- `page=${c}`,
262
- `pageSize=${a}`
205
+ `page=${a}`,
206
+ `pageSize=${c}`
263
207
  );
264
208
  }
265
209
  if (s) {
266
210
  const i = Object.entries(s).filter(
267
211
  ([, r]) => r != null && r !== ""
268
- ).flatMap(([r, c]) => {
269
- if (Array.isArray(c))
270
- return c.map((a) => `${r}==${encodeURIComponent((a == null ? void 0 : a.id) ?? a)}`);
271
- if (typeof c == "object" && c !== null && "start" in c && "end" in c) {
272
- const a = [];
273
- return c.start != null && c.start !== "" && a.push(`${r}>=${encodeURIComponent(c.start)}`), c.end != null && c.end !== "" && a.push(`${r}<=${encodeURIComponent(c.end)}`), a;
212
+ ).flatMap(([r, a]) => {
213
+ if (Array.isArray(a))
214
+ return a.map((c) => `${r}==${encodeURIComponent((c == null ? void 0 : c.id) ?? c)}`);
215
+ if (typeof a == "object" && a !== null && "start" in a && "end" in a) {
216
+ const c = [];
217
+ return a.start != null && a.start !== "" && c.push(`${r}>=${encodeURIComponent(a.start)}`), a.end != null && a.end !== "" && c.push(`${r}<=${encodeURIComponent(a.end)}`), c;
274
218
  }
275
- return typeof c == "object" && c !== null ? `${r}==${encodeURIComponent(c.id ?? "")}` : `${r}==${encodeURIComponent(c)}`;
219
+ return typeof a == "object" && a !== null ? `${r}==${encodeURIComponent(a.id ?? "")}` : `${r}==${encodeURIComponent(a)}`;
276
220
  });
277
221
  i.length > 0 && n.push(`filters=${i.join(",")}`);
278
222
  }
279
223
  return n.length ? `${e}?${n.join("&")}` : e;
280
224
  };
281
- class Qt {
225
+ class Gt {
282
226
  /**
283
227
  * @param baseUrl the base url of the server
284
228
  * @param userKey the local storage user key
@@ -294,12 +238,12 @@ class Qt {
294
238
  }
295
239
  defaultTokenAcquirer(t) {
296
240
  if (t) return { credentials: "include" };
297
- const s = Kt(this.userKey);
241
+ const s = Jt(this.userKey);
298
242
  if (s && s.length)
299
243
  return { Authorization: `Bearer ${s}` };
300
244
  }
301
- async doQuery(t, s = ne.GET, n, i) {
302
- const r = this.secured ? this.tokenAcquirer() : {}, { data: c, status: a, error: d } = await Ee(
245
+ async doQuery(t, s = te.GET, n, i) {
246
+ const r = this.secured ? this.tokenAcquirer() : {}, { data: a, status: c, error: l } = await Te(
303
247
  `${this.baseUrl}${t}`,
304
248
  s,
305
249
  n,
@@ -308,12 +252,12 @@ class Qt {
308
252
  ...i ?? {}
309
253
  }
310
254
  );
311
- if (d || a < 200 || a >= 300)
312
- throw d ?? {
313
- status: a,
314
- message: String(a)
255
+ if (l || c < 200 || c >= 300)
256
+ throw l ?? {
257
+ status: c,
258
+ message: String(c)
315
259
  };
316
- return c;
260
+ return a;
317
261
  }
318
262
  /**
319
263
  * @description Get all objects
@@ -322,14 +266,14 @@ class Qt {
322
266
  * @returns Result list
323
267
  */
324
268
  async get(t, s, n) {
325
- const i = jt(t, s, n), r = this.secured ? this.tokenAcquirer() : void 0, { data: c, error: a } = await Ee(
269
+ const i = Wt(t, s, n), r = this.secured ? this.tokenAcquirer() : void 0, { data: a, error: c } = await Te(
326
270
  `${this.baseUrl}${i}`,
327
- ne.GET,
271
+ te.GET,
328
272
  null,
329
273
  r
330
274
  );
331
- if (a) throw a;
332
- return c;
275
+ if (c) throw c;
276
+ return a;
333
277
  }
334
278
  /**
335
279
  * @description Get entity by id
@@ -338,15 +282,15 @@ class Qt {
338
282
  * @returns updated entity
339
283
  */
340
284
  async patch(t, s) {
341
- const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status: c } = await Ee(
285
+ const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status: a } = await Te(
342
286
  `${this.baseUrl}${t}`,
343
- ne.PATCH,
287
+ te.PATCH,
344
288
  s,
345
289
  n
346
290
  );
347
291
  if (i || !r)
348
292
  throw i ?? {
349
- status: c,
293
+ status: a,
350
294
  message: "Unknown error"
351
295
  };
352
296
  return r;
@@ -357,15 +301,15 @@ class Qt {
357
301
  * @returns delete result
358
302
  */
359
303
  async delete(t, s) {
360
- const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status: c } = await Ee(
304
+ const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status: a } = await Te(
361
305
  `${this.baseUrl}${t}`,
362
- ne.DELETE,
306
+ te.DELETE,
363
307
  s,
364
308
  n
365
309
  );
366
310
  if (i || !r)
367
311
  throw i ?? {
368
- status: c,
312
+ status: a,
369
313
  message: "Unknown error"
370
314
  };
371
315
  return r;
@@ -377,53 +321,53 @@ class Qt {
377
321
  * @returns inserted item
378
322
  */
379
323
  async post(t, s) {
380
- const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status: c } = await Ee(
324
+ const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status: a } = await Te(
381
325
  `${this.baseUrl}${t}`,
382
- ne.POST,
326
+ te.POST,
383
327
  s,
384
328
  n
385
329
  );
386
330
  if (i || !r)
387
331
  throw i ?? {
388
- status: c,
332
+ status: a,
389
333
  message: "Unknown error"
390
334
  };
391
335
  return r;
392
336
  }
393
337
  }
394
- class Xs {
338
+ class sr {
395
339
  constructor(t, s = "user") {
396
340
  me(this, "api");
397
- this.api = new Qt(t, s, !1);
341
+ this.api = new Gt(t, s, !1);
398
342
  }
399
343
  async login(t) {
400
344
  const s = "auth/sign-in", n = t;
401
345
  return await this.api.doQuery(
402
346
  s,
403
- ne.POST,
347
+ te.POST,
404
348
  n
405
349
  );
406
350
  }
407
351
  async logout() {
408
- return await this.api.doQuery("auth/sign-out", ne.POST);
352
+ return await this.api.doQuery("auth/sign-out", te.POST);
409
353
  }
410
354
  async register(t) {
411
355
  return await this.api.doQuery(
412
356
  "auth/sign-up",
413
- ne.POST,
357
+ te.POST,
414
358
  t
415
359
  );
416
360
  }
417
361
  async getSession() {
418
- return await this.api.doQuery("auth/session", ne.GET, null, {
362
+ return await this.api.doQuery("auth/session", te.GET, null, {
419
363
  ...this.api.defaultTokenAcquirer()
420
364
  });
421
365
  }
422
366
  }
423
- class Zr {
367
+ class on {
424
368
  constructor(t, s) {
425
369
  me(this, "auth");
426
- this.auth = new Xs(t, s);
370
+ this.auth = new sr(t, s);
427
371
  }
428
372
  /**
429
373
  * @returns auth
@@ -432,7 +376,7 @@ class Zr {
432
376
  return this.auth;
433
377
  }
434
378
  }
435
- class en {
379
+ class cn {
436
380
  /**
437
381
  *
438
382
  * @param table
@@ -442,7 +386,7 @@ class en {
442
386
  me(this, "table");
443
387
  me(this, "secured");
444
388
  me(this, "api");
445
- this.table = t, this.secured = i, this.api = new Qt(s, n, i);
389
+ this.table = t, this.secured = i, this.api = new Gt(s, n, i);
446
390
  }
447
391
  /**
448
392
  *
@@ -460,7 +404,7 @@ class en {
460
404
  async insertMany(t) {
461
405
  return await this.api.doQuery(
462
406
  `${this.table}/batch`,
463
- ne.POST,
407
+ te.POST,
464
408
  t
465
409
  );
466
410
  }
@@ -490,12 +434,12 @@ class en {
490
434
  * @returns - List of elements
491
435
  */
492
436
  async export(t) {
493
- const s = jt(
437
+ const s = Wt(
494
438
  `${this.table}/export`,
495
439
  void 0,
496
440
  t
497
441
  );
498
- return await this.api.doQuery(s, ne.GET, void 0);
442
+ return await this.api.doQuery(s, te.GET, void 0);
499
443
  }
500
444
  /**
501
445
  *
@@ -505,7 +449,7 @@ class en {
505
449
  async import(t) {
506
450
  return await this.api.doQuery(
507
451
  `${this.table}/import`,
508
- ne.POST,
452
+ te.POST,
509
453
  t
510
454
  );
511
455
  }
@@ -516,8 +460,8 @@ class en {
516
460
  */
517
461
  async commonGet(t) {
518
462
  return await this.api.doQuery(
519
- Ys(`${this.table}/common`, t),
520
- ne.GET
463
+ tr(`${this.table}/common`, t),
464
+ te.GET
521
465
  );
522
466
  }
523
467
  /**
@@ -535,13 +479,13 @@ class en {
535
479
  return await this.api.patch(`${this.table}/restore`, t);
536
480
  }
537
481
  }
538
- function tn(e) {
482
+ function ln(e) {
539
483
  return Object.keys(e).filter((t) => isNaN(Number(t))).map((t) => ({
540
484
  key: t,
541
485
  value: e[t]
542
486
  }));
543
487
  }
544
- const Kt = (e, t = "") => {
488
+ const Jt = (e, t = "") => {
545
489
  const s = localStorage.getItem(e) ?? void 0;
546
490
  if (s && t.length)
547
491
  switch (t) {
@@ -555,11 +499,11 @@ const Kt = (e, t = "") => {
555
499
  return s;
556
500
  }
557
501
  return s;
558
- }, _t = (e, t) => localStorage.setItem(
502
+ }, Et = (e, t) => localStorage.setItem(
559
503
  e,
560
504
  typeof t == "object" ? JSON.stringify(t) : t
561
- ), Ct = (e) => localStorage.removeItem(e);
562
- function St(e) {
505
+ ), Nt = (e) => localStorage.removeItem(e);
506
+ function kt(e) {
563
507
  const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = {
564
508
  weekday: "long",
565
509
  // martes
@@ -581,83 +525,77 @@ function St(e) {
581
525
  s
582
526
  );
583
527
  }
584
- function Zs(e) {
585
- const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = String(t.getDate()).padStart(2, "0"), n = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getFullYear()).slice(-2), r = String(t.getHours()).padStart(2, "0"), c = String(t.getMinutes()).padStart(2, "0");
586
- return `${s}/${n}/${i} ${r}:${c}`;
528
+ function rr(e) {
529
+ const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = String(t.getDate()).padStart(2, "0"), n = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getFullYear()).slice(-2), r = String(t.getHours()).padStart(2, "0"), a = String(t.getMinutes()).padStart(2, "0");
530
+ return `${s}/${n}/${i} ${r}:${a}`;
587
531
  }
588
- function sn(e) {
589
- const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = t.getFullYear(), n = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getDate()).padStart(2, "0"), r = String(t.getHours()).padStart(2, "0"), c = String(t.getMinutes()).padStart(2, "0");
590
- return `${s}-${n}-${i}T${r}:${c}`;
532
+ function un(e) {
533
+ const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = t.getFullYear(), n = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getDate()).padStart(2, "0"), r = String(t.getHours()).padStart(2, "0"), a = String(t.getMinutes()).padStart(2, "0");
534
+ return `${s}-${n}-${i}T${r}:${a}`;
591
535
  }
592
- const er = () => {
536
+ const nr = () => {
593
537
  var s;
594
538
  const e = navigator, t = ((s = e == null ? void 0 : e.userAgentData) == null ? void 0 : s.platform) || (e == null ? void 0 : e.platform) || "";
595
539
  return /Mac|iPhone|iPod|iPad/i.test(t);
596
540
  };
597
- function Ke(e) {
541
+ function Ge(e) {
598
542
  if (!e || typeof e != "object") return !1;
599
543
  const t = e;
600
544
  return Array.isArray(t.errors) && t.errors.every(
601
545
  (s) => Array.isArray(s) && s.length === 2 && typeof s[0] == "string"
602
546
  );
603
547
  }
604
- function We(e) {
548
+ function Je(e) {
605
549
  if (!e || typeof e != "object") return !1;
606
550
  const t = e;
607
551
  return typeof (t == null ? void 0 : t.status) == "number" && typeof (t == null ? void 0 : t.message) == "string";
608
552
  }
609
- function rn(e, t) {
553
+ function dn(e, t) {
610
554
  return e != null && e.errors ? e.errors.map(([s, n]) => t(s, n)) : [];
611
555
  }
612
- const Wt = Pe({});
613
- function nn(e) {
614
- const { children: t } = e, [s, n] = Es(
615
- (m, b) => {
616
- const { type: y, items: f, index: w } = b;
617
- switch (y) {
556
+ const zt = Pe({});
557
+ function fn(e) {
558
+ const { children: t } = e, s = Ie(0), [n, i] = Rt(
559
+ (g, f) => {
560
+ const { type: p, items: _, id: C } = f;
561
+ switch (p) {
618
562
  case "set":
619
- return (f == null ? void 0 : f.map((C, g) => ({
620
- ...C,
621
- id: g
622
- }))) ?? [];
563
+ return _ ?? [];
623
564
  case "remove":
624
- return w !== void 0 ? m.filter((C, g) => g !== w) : [];
565
+ return C !== void 0 ? g.filter((N) => N.id !== C) : [];
625
566
  }
626
- return m;
567
+ return g;
627
568
  },
628
569
  [],
629
570
  () => []
630
- ), i = (m) => n({
571
+ ), r = (g) => g.map((f) => ({ ...f, id: s.current++ })), a = (g) => i({
631
572
  type: "set",
632
- items: [{ ...m, type: Q.error }]
633
- }), r = (m) => n({
573
+ items: r([{ ...g, type: J.error }])
574
+ }), c = (g) => i({ type: "set", items: r([{ ...g }]) }), l = (g) => i({ type: "set", items: r(g) }), m = (g) => i({
634
575
  type: "set",
635
- items: [{ ...m }]
636
- }), c = (m) => n({ type: "set", items: m }), a = (m) => n({
637
- type: "set",
638
- items: [{ ...m, type: Q.success }]
639
- }), d = (m) => n({ type: "remove", index: m });
576
+ items: r([{ ...g, type: J.success }])
577
+ }), y = (g) => i({ type: "remove", id: g });
640
578
  return /* @__PURE__ */ h(
641
- Wt.Provider,
579
+ zt.Provider,
642
580
  {
643
581
  value: {
644
- notification: s,
645
- removeNotification: d,
646
- showErrorNotification: i,
647
- showNotification: r,
648
- showSuccessNotification: a,
649
- showStackNotifications: c
582
+ notification: n,
583
+ removeNotification: y,
584
+ showErrorNotification: a,
585
+ showNotification: c,
586
+ showSuccessNotification: m,
587
+ showStackNotifications: l
650
588
  },
651
589
  children: t
652
590
  }
653
591
  );
654
592
  }
655
593
  const Ne = () => {
656
- const e = Me(Wt);
594
+ const e = Oe(zt);
657
595
  if (e === void 0)
658
596
  throw new Error("NotificationContext must be used within a Provider");
659
597
  return e;
660
- }, pe = new js({
598
+ }, be = new Js({
661
599
  defaultOptions: {
662
600
  queries: {
663
601
  refetchInterval: !1,
@@ -669,159 +607,159 @@ const Ne = () => {
669
607
  // default: true
670
608
  }
671
609
  }
672
- }), zt = Pe(
610
+ }), Yt = Pe(
673
611
  void 0
674
- ), an = (e) => {
612
+ ), mn = (e) => {
675
613
  const { children: t, manager: s } = e;
676
- return /* @__PURE__ */ h(zt.Provider, { value: { client: s }, children: /* @__PURE__ */ h(Qs, { client: pe, children: t }) });
677
- }, tr = () => {
678
- const e = Me(zt);
614
+ return /* @__PURE__ */ h(Yt.Provider, { value: { client: s }, children: /* @__PURE__ */ h(zs, { client: be, children: t }) });
615
+ }, ir = () => {
616
+ const e = Oe(Yt);
679
617
  if (!e)
680
618
  throw new Error("managerContext must be used within a Provider");
681
619
  return e.client;
682
- }, Gt = Pe(
620
+ }, Xt = Pe(
683
621
  void 0
684
- ), on = (e) => {
685
- const { children: t, guestMode: s = "guest_mode", user: n = "user" } = e, i = tr(), [r, c] = B({}), a = E(() => !!Kt(s, "boolean") && r.token === void 0, [r.token, s]), d = E((w) => {
686
- _t(s, w);
687
- }, [s]), m = E((w) => {
688
- w && (c(w), Ct(s), _t(n, w.token));
689
- }, [s, n]), b = E(async () => {
622
+ ), hn = (e) => {
623
+ const { children: t, guestMode: s = "guest_mode", user: n = "user" } = e, i = ir(), [r, a] = Y({}), c = D(() => !!Jt(s, "boolean") && r.token === void 0, [r.token, s]), l = D((p) => {
624
+ Et(s, p);
625
+ }, [s]), m = D((p) => {
626
+ p && (a(p), Nt(s), Et(n, p.token));
627
+ }, [s, n]), y = D(async () => {
690
628
  try {
691
629
  await i.Auth.logout();
692
- } catch (w) {
693
- console.error(w);
630
+ } catch (p) {
631
+ console.error(p);
694
632
  }
695
- c({}), Ct(n);
696
- }, [i.Auth, n]), y = E(async () => {
633
+ a({}), Nt(n);
634
+ }, [i.Auth, n]), g = D(async () => {
697
635
  try {
698
- const w = await i.Auth.getSession();
699
- m(w);
700
- } catch (w) {
701
- console.error(w), b();
636
+ const p = await i.Auth.getSession();
637
+ m(p);
638
+ } catch (p) {
639
+ console.error(p), y();
702
640
  }
703
- }, [m, b, i.Auth]), f = {
641
+ }, [m, y, i.Auth]), f = {
704
642
  account: r,
705
643
  logUser: m,
706
- logoutUser: b,
707
- logUserFromLocal: y,
708
- isInGuestMode: a,
709
- setGuestMode: d
644
+ logoutUser: y,
645
+ logUserFromLocal: g,
646
+ isInGuestMode: c,
647
+ setGuestMode: l
710
648
  };
711
- return /* @__PURE__ */ h(Gt.Provider, { value: f, children: t });
712
- }, Jt = () => {
713
- const e = Me(Gt);
649
+ return /* @__PURE__ */ h(Xt.Provider, { value: f, children: t });
650
+ }, Zt = () => {
651
+ const e = Oe(Xt);
714
652
  if (!e)
715
653
  throw new Error("authContext must be used within a Provider");
716
654
  return e;
717
- }, Yt = Pe({}), cn = (e) => {
655
+ }, es = Pe({}), yn = (e) => {
718
656
  const { children: t, location: s, navigate: n, linkComponent: i, searchComponent: r } = e;
719
657
  return /* @__PURE__ */ h(
720
- Yt.Provider,
658
+ es.Provider,
721
659
  {
722
660
  value: { location: s, navigate: n, linkComponent: i, searchComponent: r },
723
661
  children: t
724
662
  }
725
663
  );
726
- }, ze = () => {
727
- const e = Me(Yt);
664
+ }, Re = () => {
665
+ const e = Oe(es);
728
666
  if (e === void 0 || Object.keys(e).length === 0)
729
667
  throw new Error(
730
668
  "Config provider has not been set. This step is required and cannot be skipped."
731
669
  );
732
670
  return e;
733
- }, Xt = Pe({}), ln = (e) => {
734
- const { children: t } = e, [s, n] = B({}), i = E(
735
- (d, m) => n((b) => ({
736
- ...b,
737
- [d]: [...b[d] ?? [], m]
671
+ }, ts = Pe({}), gn = (e) => {
672
+ const { children: t } = e, [s, n] = Y({}), i = D(
673
+ (l, m) => n((y) => ({
674
+ ...y,
675
+ [l]: [...y[l] ?? [], m]
738
676
  })),
739
677
  []
740
- ), r = E(
741
- (d, m) => n((b) => ({
742
- ...b,
743
- [d]: (b[d] ?? []).filter((y, f) => f !== m)
678
+ ), r = D(
679
+ (l, m) => n((y) => ({
680
+ ...y,
681
+ [l]: (y[l] ?? []).filter((g, f) => f !== m)
744
682
  })),
745
683
  []
746
- ), c = E((d) => {
747
- n(d ? (m) => ({
684
+ ), a = D((l) => {
685
+ n(l ? (m) => ({
748
686
  ...m,
749
- [d]: []
687
+ [l]: []
750
688
  }) : {});
751
- }, []), a = ke(
689
+ }, []), c = Ae(
752
690
  () => ({
753
691
  dynamicItems: s,
754
692
  addChildItem: i,
755
693
  removeChildItem: r,
756
- clearDynamicItems: c
694
+ clearDynamicItems: a
757
695
  }),
758
- [s, c, r, i]
696
+ [s, a, r, i]
759
697
  );
760
- return /* @__PURE__ */ h(Xt.Provider, { value: a, children: t });
761
- }, sr = () => Me(
762
- Xt
763
- ), Zt = (e) => {
764
- const { showSuccessNotification: t } = Ne(), { mutationFn: s, onError: n, onSuccess: i, onSuccessMessage: r } = e, [c, a] = B([]), { open: d, handleClose: m, handleOpen: b } = cs(), y = () => {
765
- m(), a([]);
766
- }, f = async (C) => {
767
- a(C), b();
768
- }, w = Ie({
698
+ return /* @__PURE__ */ h(ts.Provider, { value: c, children: t });
699
+ }, ar = () => Oe(
700
+ ts
701
+ ), ss = (e) => {
702
+ const { showSuccessNotification: t } = Ne(), { mutationFn: s, onError: n, onSuccess: i, onSuccessMessage: r } = e, [a, c] = Y([]), { open: l, handleClose: m, handleOpen: y } = ds(), g = () => {
703
+ m(), c([]);
704
+ }, f = async (_) => {
705
+ c(_), y();
706
+ }, p = Me({
769
707
  mutationFn: () => s(
770
- Array.isArray(c) ? c : [c]
708
+ Array.isArray(a) ? a : [a]
771
709
  ),
772
- onError: (C) => {
773
- console.error(C), n && n(C), y();
710
+ onError: (_) => {
711
+ console.error(_), n && n(_), g();
774
712
  },
775
- onSuccess: async (C) => {
776
- i && i(C), t({
713
+ onSuccess: async (_) => {
714
+ i && i(_), t({
777
715
  message: r
778
- }), y();
716
+ }), g();
779
717
  }
780
718
  });
781
- return { open: d, onClick: f, close: y, dialogFn: w, isLoading: w.isPending };
719
+ return { open: l, onClick: f, close: g, dialogFn: p, isLoading: p.isPending };
782
720
  };
783
- var Oe = (e) => e.type === "checkbox", Se = (e) => e instanceof Date, se = (e) => e == null;
784
- const es = (e) => typeof e == "object";
785
- var K = (e) => !se(e) && !Array.isArray(e) && es(e) && !Se(e), rr = (e) => K(e) && e.target ? Oe(e.target) ? e.target.checked : e.target.value : e, nr = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, ir = (e, t) => e.has(nr(t)), ar = (e) => {
721
+ var Ue = (e) => e.type === "checkbox", Ee = (e) => e instanceof Date, Z = (e) => e == null;
722
+ const rs = (e) => typeof e == "object";
723
+ var H = (e) => !Z(e) && !Array.isArray(e) && rs(e) && !Ee(e), or = (e) => H(e) && e.target ? Ue(e.target) ? e.target.checked : e.target.value : e, cr = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, lr = (e, t) => e.has(cr(t)), ur = (e) => {
786
724
  const t = e.constructor && e.constructor.prototype;
787
- return K(t) && t.hasOwnProperty("isPrototypeOf");
788
- }, nt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
789
- function X(e) {
725
+ return H(t) && t.hasOwnProperty("isPrototypeOf");
726
+ }, at = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
727
+ function G(e) {
790
728
  let t;
791
729
  const s = Array.isArray(e), n = typeof FileList < "u" ? e instanceof FileList : !1;
792
730
  if (e instanceof Date)
793
731
  t = new Date(e);
794
- else if (!(nt && (e instanceof Blob || n)) && (s || K(e)))
795
- if (t = s ? [] : {}, !s && !ar(e))
732
+ else if (!(at && (e instanceof Blob || n)) && (s || H(e)))
733
+ if (t = s ? [] : {}, !s && !ur(e))
796
734
  t = e;
797
735
  else
798
736
  for (const i in e)
799
- e.hasOwnProperty(i) && (t[i] = X(e[i]));
737
+ e.hasOwnProperty(i) && (t[i] = G(e[i]));
800
738
  else
801
739
  return e;
802
740
  return t;
803
741
  }
804
- var Ge = (e) => /^\w*$/.test(e), z = (e) => e === void 0, it = (e) => Array.isArray(e) ? e.filter(Boolean) : [], at = (e) => it(e.replace(/["|']|\]/g, "").split(/\.|\[/)), _ = (e, t, s) => {
805
- if (!t || !K(e))
742
+ var ze = (e) => /^\w*$/.test(e), K = (e) => e === void 0, ot = (e) => Array.isArray(e) ? e.filter(Boolean) : [], ct = (e) => ot(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, t, s) => {
743
+ if (!t || !H(e))
806
744
  return s;
807
- const n = (Ge(t) ? [t] : at(t)).reduce((i, r) => se(i) ? i : i[r], e);
808
- return z(n) || n === e ? z(e[t]) ? s : e[t] : n;
809
- }, he = (e) => typeof e == "boolean", R = (e, t, s) => {
745
+ const n = (ze(t) ? [t] : ct(t)).reduce((i, r) => Z(i) ? i : i[r], e);
746
+ return K(n) || n === e ? K(e[t]) ? s : e[t] : n;
747
+ }, he = (e) => typeof e == "boolean", q = (e, t, s) => {
810
748
  let n = -1;
811
- const i = Ge(t) ? [t] : at(t), r = i.length, c = r - 1;
749
+ const i = ze(t) ? [t] : ct(t), r = i.length, a = r - 1;
812
750
  for (; ++n < r; ) {
813
- const a = i[n];
814
- let d = s;
815
- if (n !== c) {
816
- const m = e[a];
817
- d = K(m) || Array.isArray(m) ? m : isNaN(+i[n + 1]) ? {} : [];
751
+ const c = i[n];
752
+ let l = s;
753
+ if (n !== a) {
754
+ const m = e[c];
755
+ l = H(m) || Array.isArray(m) ? m : isNaN(+i[n + 1]) ? {} : [];
818
756
  }
819
- if (a === "__proto__" || a === "constructor" || a === "prototype")
757
+ if (c === "__proto__" || c === "constructor" || c === "prototype")
820
758
  return;
821
- e[a] = d, e = e[a];
759
+ e[c] = l, e = e[c];
822
760
  }
823
761
  };
824
- const kt = {
762
+ const At = {
825
763
  BLUR: "blur",
826
764
  FOCUS_OUT: "focusout"
827
765
  }, de = {
@@ -838,27 +776,27 @@ const kt = {
838
776
  pattern: "pattern",
839
777
  required: "required",
840
778
  validate: "validate"
841
- }, or = ae.createContext(null);
842
- or.displayName = "HookFormContext";
843
- var cr = (e, t, s, n = !0) => {
779
+ }, dr = ie.createContext(null);
780
+ dr.displayName = "HookFormContext";
781
+ var fr = (e, t, s, n = !0) => {
844
782
  const i = {
845
783
  defaultValues: t._defaultValues
846
784
  };
847
785
  for (const r in e)
848
786
  Object.defineProperty(i, r, {
849
787
  get: () => {
850
- const c = r;
851
- return t._proxyFormState[c] !== de.all && (t._proxyFormState[c] = !n || de.all), e[c];
788
+ const a = r;
789
+ return t._proxyFormState[a] !== de.all && (t._proxyFormState[a] = !n || de.all), e[a];
852
790
  }
853
791
  });
854
792
  return i;
855
793
  };
856
- const lr = typeof window < "u" ? ae.useLayoutEffect : ae.useEffect;
857
- var ye = (e) => typeof e == "string", ur = (e, t, s, n, i) => ye(e) ? (n && t.watch.add(e), _(s, e, i)) : Array.isArray(e) ? e.map((r) => (n && t.watch.add(r), _(s, r))) : (n && (t.watchAll = !0), s), rt = (e) => se(e) || !es(e);
794
+ const mr = typeof window < "u" ? ie.useLayoutEffect : ie.useEffect;
795
+ var ye = (e) => typeof e == "string", hr = (e, t, s, n, i) => ye(e) ? (n && t.watch.add(e), S(s, e, i)) : Array.isArray(e) ? e.map((r) => (n && t.watch.add(r), S(s, r))) : (n && (t.watchAll = !0), s), it = (e) => Z(e) || !rs(e);
858
796
  function ve(e, t, s = /* @__PURE__ */ new WeakSet()) {
859
- if (rt(e) || rt(t))
797
+ if (it(e) || it(t))
860
798
  return e === t;
861
- if (Se(e) && Se(t))
799
+ if (Ee(e) && Ee(t))
862
800
  return e.getTime() === t.getTime();
863
801
  const n = Object.keys(e), i = Object.keys(t);
864
802
  if (n.length !== i.length)
@@ -867,24 +805,24 @@ function ve(e, t, s = /* @__PURE__ */ new WeakSet()) {
867
805
  return !0;
868
806
  s.add(e), s.add(t);
869
807
  for (const r of n) {
870
- const c = e[r];
808
+ const a = e[r];
871
809
  if (!i.includes(r))
872
810
  return !1;
873
811
  if (r !== "ref") {
874
- const a = t[r];
875
- if (Se(c) && Se(a) || K(c) && K(a) || Array.isArray(c) && Array.isArray(a) ? !ve(c, a, s) : c !== a)
812
+ const c = t[r];
813
+ if (Ee(a) && Ee(c) || H(a) && H(c) || Array.isArray(a) && Array.isArray(c) ? !ve(a, c, s) : a !== c)
876
814
  return !1;
877
815
  }
878
816
  }
879
817
  return !0;
880
818
  }
881
- var dr = (e, t, s, n, i) => t ? {
819
+ var yr = (e, t, s, n, i) => t ? {
882
820
  ...s[e],
883
821
  types: {
884
822
  ...s[e] && s[e].types ? s[e].types : {},
885
823
  [n]: i || !0
886
824
  }
887
- } : {}, Le = (e) => Array.isArray(e) ? e : [e], Nt = () => {
825
+ } : {}, Le = (e) => Array.isArray(e) ? e : [e], xt = () => {
888
826
  let e = [];
889
827
  return {
890
828
  get observers() {
@@ -903,30 +841,30 @@ var dr = (e, t, s, n, i) => t ? {
903
841
  e = [];
904
842
  }
905
843
  };
906
- }, re = (e) => K(e) && !Object.keys(e).length, ot = (e) => e.type === "file", fe = (e) => typeof e == "function", He = (e) => {
907
- if (!nt)
844
+ }, ee = (e) => H(e) && !Object.keys(e).length, lt = (e) => e.type === "file", fe = (e) => typeof e == "function", Ke = (e) => {
845
+ if (!at)
908
846
  return !1;
909
847
  const t = e ? e.ownerDocument : 0;
910
848
  return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
911
- }, ts = (e) => e.type === "select-multiple", ct = (e) => e.type === "radio", fr = (e) => ct(e) || Oe(e), st = (e) => He(e) && e.isConnected;
912
- function mr(e, t) {
849
+ }, ns = (e) => e.type === "select-multiple", ut = (e) => e.type === "radio", gr = (e) => ut(e) || Ue(e), rt = (e) => Ke(e) && e.isConnected;
850
+ function pr(e, t) {
913
851
  const s = t.slice(0, -1).length;
914
852
  let n = 0;
915
853
  for (; n < s; )
916
- e = z(e) ? n++ : e[t[n++]];
854
+ e = K(e) ? n++ : e[t[n++]];
917
855
  return e;
918
856
  }
919
- function hr(e) {
857
+ function br(e) {
920
858
  for (const t in e)
921
- if (e.hasOwnProperty(t) && !z(e[t]))
859
+ if (e.hasOwnProperty(t) && !K(e[t]))
922
860
  return !1;
923
861
  return !0;
924
862
  }
925
- function W(e, t) {
926
- const s = Array.isArray(t) ? t : Ge(t) ? [t] : at(t), n = s.length === 1 ? e : mr(e, s), i = s.length - 1, r = s[i];
927
- return n && delete n[r], i !== 0 && (K(n) && re(n) || Array.isArray(n) && hr(n)) && W(e, s.slice(0, -1)), e;
863
+ function Q(e, t) {
864
+ const s = Array.isArray(t) ? t : ze(t) ? [t] : ct(t), n = s.length === 1 ? e : pr(e, s), i = s.length - 1, r = s[i];
865
+ return n && delete n[r], i !== 0 && (H(n) && ee(n) || Array.isArray(n) && br(n)) && Q(e, s.slice(0, -1)), e;
928
866
  }
929
- var ss = (e) => {
867
+ var is = (e) => {
930
868
  for (const t in e)
931
869
  if (fe(e[t]))
932
870
  return !0;
@@ -934,24 +872,24 @@ var ss = (e) => {
934
872
  };
935
873
  function je(e, t = {}) {
936
874
  const s = Array.isArray(e);
937
- if (K(e) || s)
875
+ if (H(e) || s)
938
876
  for (const n in e)
939
- Array.isArray(e[n]) || K(e[n]) && !ss(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, je(e[n], t[n])) : se(e[n]) || (t[n] = !0);
877
+ Array.isArray(e[n]) || H(e[n]) && !is(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, je(e[n], t[n])) : Z(e[n]) || (t[n] = !0);
940
878
  return t;
941
879
  }
942
- function rs(e, t, s) {
880
+ function as(e, t, s) {
943
881
  const n = Array.isArray(e);
944
- if (K(e) || n)
882
+ if (H(e) || n)
945
883
  for (const i in e)
946
- Array.isArray(e[i]) || K(e[i]) && !ss(e[i]) ? z(t) || rt(s[i]) ? s[i] = Array.isArray(e[i]) ? je(e[i], []) : { ...je(e[i]) } : rs(e[i], se(t) ? {} : t[i], s[i]) : s[i] = !ve(e[i], t[i]);
884
+ Array.isArray(e[i]) || H(e[i]) && !is(e[i]) ? K(t) || it(s[i]) ? s[i] = Array.isArray(e[i]) ? je(e[i], []) : { ...je(e[i]) } : as(e[i], Z(t) ? {} : t[i], s[i]) : s[i] = !ve(e[i], t[i]);
947
885
  return s;
948
886
  }
949
- var $e = (e, t) => rs(e, t, je(t));
950
- const At = {
887
+ var Fe = (e, t) => as(e, t, je(t));
888
+ const Tt = {
951
889
  value: !1,
952
890
  isValid: !1
953
- }, Et = { value: !0, isValid: !0 };
954
- var ns = (e) => {
891
+ }, Ft = { value: !0, isValid: !0 };
892
+ var os = (e) => {
955
893
  if (Array.isArray(e)) {
956
894
  if (e.length > 1) {
957
895
  const t = e.filter((s) => s && s.checked && !s.disabled).map((s) => s.value);
@@ -959,28 +897,28 @@ var ns = (e) => {
959
897
  }
960
898
  return e[0].checked && !e[0].disabled ? (
961
899
  // @ts-expect-error expected to work in the browser
962
- e[0].attributes && !z(e[0].attributes.value) ? z(e[0].value) || e[0].value === "" ? Et : { value: e[0].value, isValid: !0 } : Et
963
- ) : At;
900
+ e[0].attributes && !K(e[0].attributes.value) ? K(e[0].value) || e[0].value === "" ? Ft : { value: e[0].value, isValid: !0 } : Ft
901
+ ) : Tt;
964
902
  }
965
- return At;
966
- }, is = (e, { valueAsNumber: t, valueAsDate: s, setValueAs: n }) => z(e) ? e : t ? e === "" ? NaN : e && +e : s && ye(e) ? new Date(e) : n ? n(e) : e;
903
+ return Tt;
904
+ }, cs = (e, { valueAsNumber: t, valueAsDate: s, setValueAs: n }) => K(e) ? e : t ? e === "" ? NaN : e && +e : s && ye(e) ? new Date(e) : n ? n(e) : e;
967
905
  const $t = {
968
906
  isValid: !1,
969
907
  value: null
970
908
  };
971
- var as = (e) => Array.isArray(e) ? e.reduce((t, s) => s && s.checked && !s.disabled ? {
909
+ var ls = (e) => Array.isArray(e) ? e.reduce((t, s) => s && s.checked && !s.disabled ? {
972
910
  isValid: !0,
973
911
  value: s.value
974
912
  } : t, $t) : $t;
975
- function Ft(e) {
913
+ function Lt(e) {
976
914
  const t = e.ref;
977
- return ot(t) ? t.files : ct(t) ? as(e.refs).value : ts(t) ? [...t.selectedOptions].map(({ value: s }) => s) : Oe(t) ? ns(e.refs).value : is(z(t.value) ? e.ref.value : t.value, e);
915
+ return lt(t) ? t.files : ut(t) ? ls(e.refs).value : ns(t) ? [...t.selectedOptions].map(({ value: s }) => s) : Ue(t) ? os(e.refs).value : cs(K(t.value) ? e.ref.value : t.value, e);
978
916
  }
979
- var yr = (e, t, s, n) => {
917
+ var wr = (e, t, s, n) => {
980
918
  const i = {};
981
919
  for (const r of e) {
982
- const c = _(t, r);
983
- c && R(i, r, c._f);
920
+ const a = S(t, r);
921
+ a && q(i, r, a._f);
984
922
  }
985
923
  return {
986
924
  criteriaMode: s,
@@ -988,53 +926,53 @@ var yr = (e, t, s, n) => {
988
926
  fields: i,
989
927
  shouldUseNativeValidation: n
990
928
  };
991
- }, Qe = (e) => e instanceof RegExp, Fe = (e) => z(e) ? e : Qe(e) ? e.source : K(e) ? Qe(e.value) ? e.value.source : e.value : e, Lt = (e) => ({
929
+ }, We = (e) => e instanceof RegExp, $e = (e) => K(e) ? e : We(e) ? e.source : H(e) ? We(e.value) ? e.value.source : e.value : e, Dt = (e) => ({
992
930
  isOnSubmit: !e || e === de.onSubmit,
993
931
  isOnBlur: e === de.onBlur,
994
932
  isOnChange: e === de.onChange,
995
933
  isOnAll: e === de.all,
996
934
  isOnTouch: e === de.onTouched
997
935
  });
998
- const Tt = "AsyncFunction";
999
- var gr = (e) => !!e && !!e.validate && !!(fe(e.validate) && e.validate.constructor.name === Tt || K(e.validate) && Object.values(e.validate).find((t) => t.constructor.name === Tt)), br = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Dt = (e, t, s) => !s && (t.watchAll || t.watch.has(e) || [...t.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
1000
- const Te = (e, t, s, n) => {
936
+ const Vt = "AsyncFunction";
937
+ var vr = (e) => !!e && !!e.validate && !!(fe(e.validate) && e.validate.constructor.name === Vt || H(e.validate) && Object.values(e.validate).find((t) => t.constructor.name === Vt)), _r = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), It = (e, t, s) => !s && (t.watchAll || t.watch.has(e) || [...t.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
938
+ const De = (e, t, s, n) => {
1001
939
  for (const i of s || Object.keys(e)) {
1002
- const r = _(e, i);
940
+ const r = S(e, i);
1003
941
  if (r) {
1004
- const { _f: c, ...a } = r;
1005
- if (c) {
1006
- if (c.refs && c.refs[0] && t(c.refs[0], i) && !n)
942
+ const { _f: a, ...c } = r;
943
+ if (a) {
944
+ if (a.refs && a.refs[0] && t(a.refs[0], i) && !n)
1007
945
  return !0;
1008
- if (c.ref && t(c.ref, c.name) && !n)
946
+ if (a.ref && t(a.ref, a.name) && !n)
1009
947
  return !0;
1010
- if (Te(a, t))
948
+ if (De(c, t))
1011
949
  break;
1012
- } else if (K(a) && Te(a, t))
950
+ } else if (H(c) && De(c, t))
1013
951
  break;
1014
952
  }
1015
953
  }
1016
954
  };
1017
- function Vt(e, t, s) {
1018
- const n = _(e, s);
1019
- if (n || Ge(s))
955
+ function Pt(e, t, s) {
956
+ const n = S(e, s);
957
+ if (n || ze(s))
1020
958
  return {
1021
959
  error: n,
1022
960
  name: s
1023
961
  };
1024
962
  const i = s.split(".");
1025
963
  for (; i.length; ) {
1026
- const r = i.join("."), c = _(t, r), a = _(e, r);
1027
- if (c && !Array.isArray(c) && s !== r)
964
+ const r = i.join("."), a = S(t, r), c = S(e, r);
965
+ if (a && !Array.isArray(a) && s !== r)
1028
966
  return { name: s };
1029
- if (a && a.type)
967
+ if (c && c.type)
1030
968
  return {
1031
969
  name: r,
1032
- error: a
970
+ error: c
1033
971
  };
1034
- if (a && a.root && a.root.type)
972
+ if (c && c.root && c.root.type)
1035
973
  return {
1036
974
  name: `${r}.root`,
1037
- error: a.root
975
+ error: c.root
1038
976
  };
1039
977
  i.pop();
1040
978
  }
@@ -1042,114 +980,114 @@ function Vt(e, t, s) {
1042
980
  name: s
1043
981
  };
1044
982
  }
1045
- var pr = (e, t, s, n) => {
983
+ var Sr = (e, t, s, n) => {
1046
984
  s(e);
1047
985
  const { name: i, ...r } = e;
1048
- return re(r) || Object.keys(r).length >= Object.keys(t).length || Object.keys(r).find((c) => t[c] === (!n || de.all));
1049
- }, wr = (e, t, s) => !e || !t || e === t || Le(e).some((n) => n && (s ? n === t : n.startsWith(t) || t.startsWith(n))), vr = (e, t, s, n, i) => i.isOnAll ? !1 : !s && i.isOnTouch ? !(t || e) : (s ? n.isOnBlur : i.isOnBlur) ? !e : (s ? n.isOnChange : i.isOnChange) ? e : !0, xr = (e, t) => !it(_(e, t)).length && W(e, t), _r = (e, t, s) => {
1050
- const n = Le(_(e, s));
1051
- return R(n, "root", t[s]), R(e, s, n), e;
1052
- }, qe = (e) => ye(e);
1053
- function Pt(e, t, s = "validate") {
1054
- if (qe(e) || Array.isArray(e) && e.every(qe) || he(e) && !e)
986
+ return ee(r) || Object.keys(r).length >= Object.keys(t).length || Object.keys(r).find((a) => t[a] === (!n || de.all));
987
+ }, Cr = (e, t, s) => !e || !t || e === t || Le(e).some((n) => n && (s ? n === t : n.startsWith(t) || t.startsWith(n))), Er = (e, t, s, n, i) => i.isOnAll ? !1 : !s && i.isOnTouch ? !(t || e) : (s ? n.isOnBlur : i.isOnBlur) ? !e : (s ? n.isOnChange : i.isOnChange) ? e : !0, Nr = (e, t) => !ot(S(e, t)).length && Q(e, t), kr = (e, t, s) => {
988
+ const n = Le(S(e, s));
989
+ return q(n, "root", t[s]), q(e, s, n), e;
990
+ }, Qe = (e) => ye(e);
991
+ function Ot(e, t, s = "validate") {
992
+ if (Qe(e) || Array.isArray(e) && e.every(Qe) || he(e) && !e)
1055
993
  return {
1056
994
  type: s,
1057
- message: qe(e) ? e : "",
995
+ message: Qe(e) ? e : "",
1058
996
  ref: t
1059
997
  };
1060
998
  }
1061
- var Ae = (e) => K(e) && !Qe(e) ? e : {
999
+ var ke = (e) => H(e) && !We(e) ? e : {
1062
1000
  value: e,
1063
1001
  message: ""
1064
1002
  }, Mt = async (e, t, s, n, i, r) => {
1065
- const { ref: c, refs: a, required: d, maxLength: m, minLength: b, min: y, max: f, pattern: w, validate: C, name: g, valueAsNumber: L, mount: G } = e._f, k = _(s, g);
1066
- if (!G || t.has(g))
1003
+ const { ref: a, refs: c, required: l, maxLength: m, minLength: y, min: g, max: f, pattern: p, validate: _, name: C, valueAsNumber: N, mount: j } = e._f, k = S(s, C);
1004
+ if (!j || t.has(C))
1067
1005
  return {};
1068
- const H = a ? a[0] : c, V = (N) => {
1069
- i && H.reportValidity && (H.setCustomValidity(he(N) ? "" : N || ""), H.reportValidity());
1070
- }, F = {}, J = ct(c), P = Oe(c), le = J || P, j = (L || ot(c)) && z(c.value) && z(k) || He(c) && c.value === "" || k === "" || Array.isArray(k) && !k.length, U = dr.bind(null, g, n, F), O = (N, $, q, Y = ge.maxLength, ee = ge.minLength) => {
1071
- const M = N ? $ : q;
1072
- F[g] = {
1073
- type: N ? Y : ee,
1074
- message: M,
1075
- ref: c,
1076
- ...U(N ? Y : ee, M)
1006
+ const V = c ? c[0] : a, F = (T) => {
1007
+ i && V.reportValidity && (V.setCustomValidity(he(T) ? "" : T || ""), V.reportValidity());
1008
+ }, x = {}, M = ut(a), O = Ue(a), se = M || O, I = (N || lt(a)) && K(a.value) && K(k) || Ke(a) && a.value === "" || k === "" || Array.isArray(k) && !k.length, re = yr.bind(null, C, n, x), ae = (T, $, B, W = ge.maxLength, z = ge.minLength) => {
1009
+ const R = T ? $ : B;
1010
+ x[C] = {
1011
+ type: T ? W : z,
1012
+ message: R,
1013
+ ref: a,
1014
+ ...re(T ? W : z, R)
1077
1015
  };
1078
1016
  };
1079
- if (r ? !Array.isArray(k) || !k.length : d && (!le && (j || se(k)) || he(k) && !k || P && !ns(a).isValid || J && !as(a).isValid)) {
1080
- const { value: N, message: $ } = qe(d) ? { value: !!d, message: d } : Ae(d);
1081
- if (N && (F[g] = {
1017
+ if (r ? !Array.isArray(k) || !k.length : l && (!se && (I || Z(k)) || he(k) && !k || O && !os(c).isValid || M && !ls(c).isValid)) {
1018
+ const { value: T, message: $ } = Qe(l) ? { value: !!l, message: l } : ke(l);
1019
+ if (T && (x[C] = {
1082
1020
  type: ge.required,
1083
1021
  message: $,
1084
- ref: H,
1085
- ...U(ge.required, $)
1022
+ ref: V,
1023
+ ...re(ge.required, $)
1086
1024
  }, !n))
1087
- return V($), F;
1025
+ return F($), x;
1088
1026
  }
1089
- if (!j && (!se(y) || !se(f))) {
1090
- let N, $;
1091
- const q = Ae(f), Y = Ae(y);
1092
- if (!se(k) && !isNaN(k)) {
1093
- const ee = c.valueAsNumber || k && +k;
1094
- se(q.value) || (N = ee > q.value), se(Y.value) || ($ = ee < Y.value);
1027
+ if (!I && (!Z(g) || !Z(f))) {
1028
+ let T, $;
1029
+ const B = ke(f), W = ke(g);
1030
+ if (!Z(k) && !isNaN(k)) {
1031
+ const z = a.valueAsNumber || k && +k;
1032
+ Z(B.value) || (T = z > B.value), Z(W.value) || ($ = z < W.value);
1095
1033
  } else {
1096
- const ee = c.valueAsDate || new Date(k), M = (ue) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ue), te = c.type == "time", ie = c.type == "week";
1097
- ye(q.value) && k && (N = te ? M(k) > M(q.value) : ie ? k > q.value : ee > new Date(q.value)), ye(Y.value) && k && ($ = te ? M(k) < M(Y.value) : ie ? k < Y.value : ee < new Date(Y.value));
1034
+ const z = a.valueAsDate || new Date(k), R = (ue) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ue), X = a.type == "time", ne = a.type == "week";
1035
+ ye(B.value) && k && (T = X ? R(k) > R(B.value) : ne ? k > B.value : z > new Date(B.value)), ye(W.value) && k && ($ = X ? R(k) < R(W.value) : ne ? k < W.value : z < new Date(W.value));
1098
1036
  }
1099
- if ((N || $) && (O(!!N, q.message, Y.message, ge.max, ge.min), !n))
1100
- return V(F[g].message), F;
1037
+ if ((T || $) && (ae(!!T, B.message, W.message, ge.max, ge.min), !n))
1038
+ return F(x[C].message), x;
1101
1039
  }
1102
- if ((m || b) && !j && (ye(k) || r && Array.isArray(k))) {
1103
- const N = Ae(m), $ = Ae(b), q = !se(N.value) && k.length > +N.value, Y = !se($.value) && k.length < +$.value;
1104
- if ((q || Y) && (O(q, N.message, $.message), !n))
1105
- return V(F[g].message), F;
1040
+ if ((m || y) && !I && (ye(k) || r && Array.isArray(k))) {
1041
+ const T = ke(m), $ = ke(y), B = !Z(T.value) && k.length > +T.value, W = !Z($.value) && k.length < +$.value;
1042
+ if ((B || W) && (ae(B, T.message, $.message), !n))
1043
+ return F(x[C].message), x;
1106
1044
  }
1107
- if (w && !j && ye(k)) {
1108
- const { value: N, message: $ } = Ae(w);
1109
- if (Qe(N) && !k.match(N) && (F[g] = {
1045
+ if (p && !I && ye(k)) {
1046
+ const { value: T, message: $ } = ke(p);
1047
+ if (We(T) && !k.match(T) && (x[C] = {
1110
1048
  type: ge.pattern,
1111
1049
  message: $,
1112
- ref: c,
1113
- ...U(ge.pattern, $)
1050
+ ref: a,
1051
+ ...re(ge.pattern, $)
1114
1052
  }, !n))
1115
- return V($), F;
1053
+ return F($), x;
1116
1054
  }
1117
- if (C) {
1118
- if (fe(C)) {
1119
- const N = await C(k, s), $ = Pt(N, H);
1120
- if ($ && (F[g] = {
1055
+ if (_) {
1056
+ if (fe(_)) {
1057
+ const T = await _(k, s), $ = Ot(T, V);
1058
+ if ($ && (x[C] = {
1121
1059
  ...$,
1122
- ...U(ge.validate, $.message)
1060
+ ...re(ge.validate, $.message)
1123
1061
  }, !n))
1124
- return V($.message), F;
1125
- } else if (K(C)) {
1126
- let N = {};
1127
- for (const $ in C) {
1128
- if (!re(N) && !n)
1062
+ return F($.message), x;
1063
+ } else if (H(_)) {
1064
+ let T = {};
1065
+ for (const $ in _) {
1066
+ if (!ee(T) && !n)
1129
1067
  break;
1130
- const q = Pt(await C[$](k, s), H, $);
1131
- q && (N = {
1132
- ...q,
1133
- ...U($, q.message)
1134
- }, V(q.message), n && (F[g] = N));
1068
+ const B = Ot(await _[$](k, s), V, $);
1069
+ B && (T = {
1070
+ ...B,
1071
+ ...re($, B.message)
1072
+ }, F(B.message), n && (x[C] = T));
1135
1073
  }
1136
- if (!re(N) && (F[g] = {
1137
- ref: H,
1138
- ...N
1074
+ if (!ee(T) && (x[C] = {
1075
+ ref: V,
1076
+ ...T
1139
1077
  }, !n))
1140
- return F;
1078
+ return x;
1141
1079
  }
1142
1080
  }
1143
- return V(!0), F;
1081
+ return F(!0), x;
1144
1082
  };
1145
- const Cr = {
1083
+ const Ar = {
1146
1084
  mode: de.onSubmit,
1147
1085
  reValidateMode: de.onChange,
1148
1086
  shouldFocusError: !0
1149
1087
  };
1150
- function Sr(e = {}) {
1088
+ function xr(e = {}) {
1151
1089
  let t = {
1152
- ...Cr,
1090
+ ...Ar,
1153
1091
  ...e
1154
1092
  }, s = {
1155
1093
  submitCount: 0,
@@ -1166,18 +1104,18 @@ function Sr(e = {}) {
1166
1104
  validatingFields: {},
1167
1105
  errors: t.errors || {},
1168
1106
  disabled: t.disabled || !1
1169
- }, n = {}, i = K(t.defaultValues) || K(t.values) ? X(t.defaultValues || t.values) || {} : {}, r = t.shouldUnregister ? {} : X(i), c = {
1107
+ }, n = {}, i = H(t.defaultValues) || H(t.values) ? G(t.defaultValues || t.values) || {} : {}, r = t.shouldUnregister ? {} : G(i), a = {
1170
1108
  action: !1,
1171
1109
  mount: !1,
1172
1110
  watch: !1
1173
- }, a = {
1111
+ }, c = {
1174
1112
  mount: /* @__PURE__ */ new Set(),
1175
1113
  disabled: /* @__PURE__ */ new Set(),
1176
1114
  unMount: /* @__PURE__ */ new Set(),
1177
1115
  array: /* @__PURE__ */ new Set(),
1178
1116
  watch: /* @__PURE__ */ new Set()
1179
- }, d, m = 0;
1180
- const b = {
1117
+ }, l, m = 0;
1118
+ const y = {
1181
1119
  isDirty: !1,
1182
1120
  dirtyFields: !1,
1183
1121
  validatingFields: !1,
@@ -1186,382 +1124,382 @@ function Sr(e = {}) {
1186
1124
  isValid: !1,
1187
1125
  errors: !1
1188
1126
  };
1189
- let y = {
1190
- ...b
1127
+ let g = {
1128
+ ...y
1191
1129
  };
1192
1130
  const f = {
1193
- array: Nt(),
1194
- state: Nt()
1195
- }, w = t.criteriaMode === de.all, C = (o) => (l) => {
1196
- clearTimeout(m), m = setTimeout(o, l);
1197
- }, g = async (o) => {
1198
- if (!t.disabled && (b.isValid || y.isValid || o)) {
1199
- const l = t.resolver ? re((await P()).errors) : await j(n, !0);
1200
- l !== s.isValid && f.state.next({
1201
- isValid: l
1131
+ array: xt(),
1132
+ state: xt()
1133
+ }, p = t.criteriaMode === de.all, _ = (o) => (u) => {
1134
+ clearTimeout(m), m = setTimeout(o, u);
1135
+ }, C = async (o) => {
1136
+ if (!t.disabled && (y.isValid || g.isValid || o)) {
1137
+ const u = t.resolver ? ee((await O()).errors) : await I(n, !0);
1138
+ u !== s.isValid && f.state.next({
1139
+ isValid: u
1202
1140
  });
1203
1141
  }
1204
- }, L = (o, l) => {
1205
- !t.disabled && (b.isValidating || b.validatingFields || y.isValidating || y.validatingFields) && ((o || Array.from(a.mount)).forEach((u) => {
1206
- u && (l ? R(s.validatingFields, u, l) : W(s.validatingFields, u));
1142
+ }, N = (o, u) => {
1143
+ !t.disabled && (y.isValidating || y.validatingFields || g.isValidating || g.validatingFields) && ((o || Array.from(c.mount)).forEach((d) => {
1144
+ d && (u ? q(s.validatingFields, d, u) : Q(s.validatingFields, d));
1207
1145
  }), f.state.next({
1208
1146
  validatingFields: s.validatingFields,
1209
- isValidating: !re(s.validatingFields)
1147
+ isValidating: !ee(s.validatingFields)
1210
1148
  }));
1211
- }, G = (o, l = [], u, x, v = !0, p = !0) => {
1212
- if (x && u && !t.disabled) {
1213
- if (c.action = !0, p && Array.isArray(_(n, o))) {
1214
- const S = u(_(n, o), x.argA, x.argB);
1215
- v && R(n, o, S);
1149
+ }, j = (o, u = [], d, v, w = !0, b = !0) => {
1150
+ if (v && d && !t.disabled) {
1151
+ if (a.action = !0, b && Array.isArray(S(n, o))) {
1152
+ const E = d(S(n, o), v.argA, v.argB);
1153
+ w && q(n, o, E);
1216
1154
  }
1217
- if (p && Array.isArray(_(s.errors, o))) {
1218
- const S = u(_(s.errors, o), x.argA, x.argB);
1219
- v && R(s.errors, o, S), xr(s.errors, o);
1155
+ if (b && Array.isArray(S(s.errors, o))) {
1156
+ const E = d(S(s.errors, o), v.argA, v.argB);
1157
+ w && q(s.errors, o, E), Nr(s.errors, o);
1220
1158
  }
1221
- if ((b.touchedFields || y.touchedFields) && p && Array.isArray(_(s.touchedFields, o))) {
1222
- const S = u(_(s.touchedFields, o), x.argA, x.argB);
1223
- v && R(s.touchedFields, o, S);
1159
+ if ((y.touchedFields || g.touchedFields) && b && Array.isArray(S(s.touchedFields, o))) {
1160
+ const E = d(S(s.touchedFields, o), v.argA, v.argB);
1161
+ w && q(s.touchedFields, o, E);
1224
1162
  }
1225
- (b.dirtyFields || y.dirtyFields) && (s.dirtyFields = $e(i, r)), f.state.next({
1163
+ (y.dirtyFields || g.dirtyFields) && (s.dirtyFields = Fe(i, r)), f.state.next({
1226
1164
  name: o,
1227
- isDirty: O(o, l),
1165
+ isDirty: ae(o, u),
1228
1166
  dirtyFields: s.dirtyFields,
1229
1167
  errors: s.errors,
1230
1168
  isValid: s.isValid
1231
1169
  });
1232
1170
  } else
1233
- R(r, o, l);
1234
- }, k = (o, l) => {
1235
- R(s.errors, o, l), f.state.next({
1171
+ q(r, o, u);
1172
+ }, k = (o, u) => {
1173
+ q(s.errors, o, u), f.state.next({
1236
1174
  errors: s.errors
1237
1175
  });
1238
- }, H = (o) => {
1176
+ }, V = (o) => {
1239
1177
  s.errors = o, f.state.next({
1240
1178
  errors: s.errors,
1241
1179
  isValid: !1
1242
1180
  });
1243
- }, V = (o, l, u, x) => {
1244
- const v = _(n, o);
1245
- if (v) {
1246
- const p = _(r, o, z(u) ? _(i, o) : u);
1247
- z(p) || x && x.defaultChecked || l ? R(r, o, l ? p : Ft(v._f)) : q(o, p), c.mount && g();
1181
+ }, F = (o, u, d, v) => {
1182
+ const w = S(n, o);
1183
+ if (w) {
1184
+ const b = S(r, o, K(d) ? S(i, o) : d);
1185
+ K(b) || v && v.defaultChecked || u ? q(r, o, u ? b : Lt(w._f)) : B(o, b), a.mount && C();
1248
1186
  }
1249
- }, F = (o, l, u, x, v) => {
1250
- let p = !1, S = !1;
1251
- const D = {
1187
+ }, x = (o, u, d, v, w) => {
1188
+ let b = !1, E = !1;
1189
+ const P = {
1252
1190
  name: o
1253
1191
  };
1254
1192
  if (!t.disabled) {
1255
- if (!u || x) {
1256
- (b.isDirty || y.isDirty) && (S = s.isDirty, s.isDirty = D.isDirty = O(), p = S !== D.isDirty);
1257
- const I = ve(_(i, o), l);
1258
- S = !!_(s.dirtyFields, o), I ? W(s.dirtyFields, o) : R(s.dirtyFields, o, !0), D.dirtyFields = s.dirtyFields, p = p || (b.dirtyFields || y.dirtyFields) && S !== !I;
1193
+ if (!d || v) {
1194
+ (y.isDirty || g.isDirty) && (E = s.isDirty, s.isDirty = P.isDirty = ae(), b = E !== P.isDirty);
1195
+ const U = ve(S(i, o), u);
1196
+ E = !!S(s.dirtyFields, o), U ? Q(s.dirtyFields, o) : q(s.dirtyFields, o, !0), P.dirtyFields = s.dirtyFields, b = b || (y.dirtyFields || g.dirtyFields) && E !== !U;
1259
1197
  }
1260
- if (u) {
1261
- const I = _(s.touchedFields, o);
1262
- I || (R(s.touchedFields, o, u), D.touchedFields = s.touchedFields, p = p || (b.touchedFields || y.touchedFields) && I !== u);
1198
+ if (d) {
1199
+ const U = S(s.touchedFields, o);
1200
+ U || (q(s.touchedFields, o, d), P.touchedFields = s.touchedFields, b = b || (y.touchedFields || g.touchedFields) && U !== d);
1263
1201
  }
1264
- p && v && f.state.next(D);
1202
+ b && w && f.state.next(P);
1265
1203
  }
1266
- return p ? D : {};
1267
- }, J = (o, l, u, x) => {
1268
- const v = _(s.errors, o), p = (b.isValid || y.isValid) && he(l) && s.isValid !== l;
1269
- if (t.delayError && u ? (d = C(() => k(o, u)), d(t.delayError)) : (clearTimeout(m), d = null, u ? R(s.errors, o, u) : W(s.errors, o)), (u ? !ve(v, u) : v) || !re(x) || p) {
1270
- const S = {
1271
- ...x,
1272
- ...p && he(l) ? { isValid: l } : {},
1204
+ return b ? P : {};
1205
+ }, M = (o, u, d, v) => {
1206
+ const w = S(s.errors, o), b = (y.isValid || g.isValid) && he(u) && s.isValid !== u;
1207
+ if (t.delayError && d ? (l = _(() => k(o, d)), l(t.delayError)) : (clearTimeout(m), l = null, d ? q(s.errors, o, d) : Q(s.errors, o)), (d ? !ve(w, d) : w) || !ee(v) || b) {
1208
+ const E = {
1209
+ ...v,
1210
+ ...b && he(u) ? { isValid: u } : {},
1273
1211
  errors: s.errors,
1274
1212
  name: o
1275
1213
  };
1276
1214
  s = {
1277
1215
  ...s,
1278
- ...S
1279
- }, f.state.next(S);
1216
+ ...E
1217
+ }, f.state.next(E);
1280
1218
  }
1281
- }, P = async (o) => {
1282
- L(o, !0);
1283
- const l = await t.resolver(r, t.context, yr(o || a.mount, n, t.criteriaMode, t.shouldUseNativeValidation));
1284
- return L(o), l;
1285
- }, le = async (o) => {
1286
- const { errors: l } = await P(o);
1219
+ }, O = async (o) => {
1220
+ N(o, !0);
1221
+ const u = await t.resolver(r, t.context, wr(o || c.mount, n, t.criteriaMode, t.shouldUseNativeValidation));
1222
+ return N(o), u;
1223
+ }, se = async (o) => {
1224
+ const { errors: u } = await O(o);
1287
1225
  if (o)
1288
- for (const u of o) {
1289
- const x = _(l, u);
1290
- x ? R(s.errors, u, x) : W(s.errors, u);
1226
+ for (const d of o) {
1227
+ const v = S(u, d);
1228
+ v ? q(s.errors, d, v) : Q(s.errors, d);
1291
1229
  }
1292
1230
  else
1293
- s.errors = l;
1294
- return l;
1295
- }, j = async (o, l, u = {
1231
+ s.errors = u;
1232
+ return u;
1233
+ }, I = async (o, u, d = {
1296
1234
  valid: !0
1297
1235
  }) => {
1298
- for (const x in o) {
1299
- const v = o[x];
1300
- if (v) {
1301
- const { _f: p, ...S } = v;
1302
- if (p) {
1303
- const D = a.array.has(p.name), I = v._f && gr(v._f);
1304
- I && b.validatingFields && L([x], !0);
1305
- const oe = await Mt(v, a.disabled, r, w, t.shouldUseNativeValidation && !l, D);
1306
- if (I && b.validatingFields && L([x]), oe[p.name] && (u.valid = !1, l))
1236
+ for (const v in o) {
1237
+ const w = o[v];
1238
+ if (w) {
1239
+ const { _f: b, ...E } = w;
1240
+ if (b) {
1241
+ const P = c.array.has(b.name), U = w._f && vr(w._f);
1242
+ U && y.validatingFields && N([v], !0);
1243
+ const oe = await Mt(w, c.disabled, r, p, t.shouldUseNativeValidation && !u, P);
1244
+ if (U && y.validatingFields && N([v]), oe[b.name] && (d.valid = !1, u))
1307
1245
  break;
1308
- !l && (_(oe, p.name) ? D ? _r(s.errors, oe, p.name) : R(s.errors, p.name, oe[p.name]) : W(s.errors, p.name));
1246
+ !u && (S(oe, b.name) ? P ? kr(s.errors, oe, b.name) : q(s.errors, b.name, oe[b.name]) : Q(s.errors, b.name));
1309
1247
  }
1310
- !re(S) && await j(S, l, u);
1248
+ !ee(E) && await I(E, u, d);
1311
1249
  }
1312
1250
  }
1313
- return u.valid;
1314
- }, U = () => {
1315
- for (const o of a.unMount) {
1316
- const l = _(n, o);
1317
- l && (l._f.refs ? l._f.refs.every((u) => !st(u)) : !st(l._f.ref)) && Je(o);
1251
+ return d.valid;
1252
+ }, re = () => {
1253
+ for (const o of c.unMount) {
1254
+ const u = S(n, o);
1255
+ u && (u._f.refs ? u._f.refs.every((d) => !rt(d)) : !rt(u._f.ref)) && Ye(o);
1318
1256
  }
1319
- a.unMount = /* @__PURE__ */ new Set();
1320
- }, O = (o, l) => !t.disabled && (o && l && R(r, o, l), !ve(ue(), i)), N = (o, l, u) => ur(o, a, {
1321
- ...c.mount ? r : z(l) ? i : ye(o) ? { [o]: l } : l
1322
- }, u, l), $ = (o) => it(_(c.mount ? r : i, o, t.shouldUnregister ? _(i, o, []) : [])), q = (o, l, u = {}) => {
1323
- const x = _(n, o);
1324
- let v = l;
1325
- if (x) {
1326
- const p = x._f;
1327
- p && (!p.disabled && R(r, o, is(l, p)), v = He(p.ref) && se(l) ? "" : l, ts(p.ref) ? [...p.ref.options].forEach((S) => S.selected = v.includes(S.value)) : p.refs ? Oe(p.ref) ? p.refs.forEach((S) => {
1328
- (!S.defaultChecked || !S.disabled) && (Array.isArray(v) ? S.checked = !!v.find((D) => D === S.value) : S.checked = v === S.value || !!v);
1329
- }) : p.refs.forEach((S) => S.checked = S.value === v) : ot(p.ref) ? p.ref.value = "" : (p.ref.value = v, p.ref.type || f.state.next({
1257
+ c.unMount = /* @__PURE__ */ new Set();
1258
+ }, ae = (o, u) => !t.disabled && (o && u && q(r, o, u), !ve(ue(), i)), T = (o, u, d) => hr(o, c, {
1259
+ ...a.mount ? r : K(u) ? i : ye(o) ? { [o]: u } : u
1260
+ }, d, u), $ = (o) => ot(S(a.mount ? r : i, o, t.shouldUnregister ? S(i, o, []) : [])), B = (o, u, d = {}) => {
1261
+ const v = S(n, o);
1262
+ let w = u;
1263
+ if (v) {
1264
+ const b = v._f;
1265
+ b && (!b.disabled && q(r, o, cs(u, b)), w = Ke(b.ref) && Z(u) ? "" : u, ns(b.ref) ? [...b.ref.options].forEach((E) => E.selected = w.includes(E.value)) : b.refs ? Ue(b.ref) ? b.refs.forEach((E) => {
1266
+ (!E.defaultChecked || !E.disabled) && (Array.isArray(w) ? E.checked = !!w.find((P) => P === E.value) : E.checked = w === E.value || !!w);
1267
+ }) : b.refs.forEach((E) => E.checked = E.value === w) : lt(b.ref) ? b.ref.value = "" : (b.ref.value = w, b.ref.type || f.state.next({
1330
1268
  name: o,
1331
- values: X(r)
1269
+ values: G(r)
1332
1270
  })));
1333
1271
  }
1334
- (u.shouldDirty || u.shouldTouch) && F(o, v, u.shouldTouch, u.shouldDirty, !0), u.shouldValidate && ie(o);
1335
- }, Y = (o, l, u) => {
1336
- for (const x in l) {
1337
- if (!l.hasOwnProperty(x))
1272
+ (d.shouldDirty || d.shouldTouch) && x(o, w, d.shouldTouch, d.shouldDirty, !0), d.shouldValidate && ne(o);
1273
+ }, W = (o, u, d) => {
1274
+ for (const v in u) {
1275
+ if (!u.hasOwnProperty(v))
1338
1276
  return;
1339
- const v = l[x], p = o + "." + x, S = _(n, p);
1340
- (a.array.has(o) || K(v) || S && !S._f) && !Se(v) ? Y(p, v, u) : q(p, v, u);
1277
+ const w = u[v], b = o + "." + v, E = S(n, b);
1278
+ (c.array.has(o) || H(w) || E && !E._f) && !Ee(w) ? W(b, w, d) : B(b, w, d);
1341
1279
  }
1342
- }, ee = (o, l, u = {}) => {
1343
- const x = _(n, o), v = a.array.has(o), p = X(l);
1344
- R(r, o, p), v ? (f.array.next({
1280
+ }, z = (o, u, d = {}) => {
1281
+ const v = S(n, o), w = c.array.has(o), b = G(u);
1282
+ q(r, o, b), w ? (f.array.next({
1345
1283
  name: o,
1346
- values: X(r)
1347
- }), (b.isDirty || b.dirtyFields || y.isDirty || y.dirtyFields) && u.shouldDirty && f.state.next({
1284
+ values: G(r)
1285
+ }), (y.isDirty || y.dirtyFields || g.isDirty || g.dirtyFields) && d.shouldDirty && f.state.next({
1348
1286
  name: o,
1349
- dirtyFields: $e(i, r),
1350
- isDirty: O(o, p)
1351
- })) : x && !x._f && !se(p) ? Y(o, p, u) : q(o, p, u), Dt(o, a) && f.state.next({ ...s, name: o }), f.state.next({
1352
- name: c.mount ? o : void 0,
1353
- values: X(r)
1287
+ dirtyFields: Fe(i, r),
1288
+ isDirty: ae(o, b)
1289
+ })) : v && !v._f && !Z(b) ? W(o, b, d) : B(o, b, d), It(o, c) && f.state.next({ ...s, name: o }), f.state.next({
1290
+ name: a.mount ? o : void 0,
1291
+ values: G(r)
1354
1292
  });
1355
- }, M = async (o) => {
1356
- c.mount = !0;
1357
- const l = o.target;
1358
- let u = l.name, x = !0;
1359
- const v = _(n, u), p = (I) => {
1360
- x = Number.isNaN(I) || Se(I) && isNaN(I.getTime()) || ve(I, _(r, u, I));
1361
- }, S = Lt(t.mode), D = Lt(t.reValidateMode);
1362
- if (v) {
1363
- let I, oe;
1364
- const Re = l.type ? Ft(v._f) : rr(o), we = o.type === kt.BLUR || o.type === kt.FOCUS_OUT, ys = !br(v._f) && !t.resolver && !_(s.errors, u) && !v._f.deps || vr(we, _(s.touchedFields, u), s.isSubmitted, D, S), Ze = Dt(u, a, we);
1365
- R(r, u, Re), we ? (v._f.onBlur && v._f.onBlur(o), d && d(0)) : v._f.onChange && v._f.onChange(o);
1366
- const et = F(u, Re, we), gs = !re(et) || Ze;
1293
+ }, R = async (o) => {
1294
+ a.mount = !0;
1295
+ const u = o.target;
1296
+ let d = u.name, v = !0;
1297
+ const w = S(n, d), b = (U) => {
1298
+ v = Number.isNaN(U) || Ee(U) && isNaN(U.getTime()) || ve(U, S(r, d, U));
1299
+ }, E = Dt(t.mode), P = Dt(t.reValidateMode);
1300
+ if (w) {
1301
+ let U, oe;
1302
+ const Be = u.type ? Lt(w._f) : or(o), we = o.type === At.BLUR || o.type === At.FOCUS_OUT, ws = !_r(w._f) && !t.resolver && !S(s.errors, d) && !w._f.deps || Er(we, S(s.touchedFields, d), s.isSubmitted, P, E), et = It(d, c, we);
1303
+ q(r, d, Be), we ? (w._f.onBlur && w._f.onBlur(o), l && l(0)) : w._f.onChange && w._f.onChange(o);
1304
+ const tt = x(d, Be, we), vs = !ee(tt) || et;
1367
1305
  if (!we && f.state.next({
1368
- name: u,
1306
+ name: d,
1369
1307
  type: o.type,
1370
- values: X(r)
1371
- }), ys)
1372
- return (b.isValid || y.isValid) && (t.mode === "onBlur" ? we && g() : we || g()), gs && f.state.next({ name: u, ...Ze ? {} : et });
1373
- if (!we && Ze && f.state.next({ ...s }), t.resolver) {
1374
- const { errors: pt } = await P([u]);
1375
- if (p(Re), x) {
1376
- const bs = Vt(s.errors, n, u), wt = Vt(pt, n, bs.name || u);
1377
- I = wt.error, u = wt.name, oe = re(pt);
1308
+ values: G(r)
1309
+ }), ws)
1310
+ return (y.isValid || g.isValid) && (t.mode === "onBlur" ? we && C() : we || C()), vs && f.state.next({ name: d, ...et ? {} : tt });
1311
+ if (!we && et && f.state.next({ ...s }), t.resolver) {
1312
+ const { errors: vt } = await O([d]);
1313
+ if (b(Be), v) {
1314
+ const _s = Pt(s.errors, n, d), _t = Pt(vt, n, _s.name || d);
1315
+ U = _t.error, d = _t.name, oe = ee(vt);
1378
1316
  }
1379
1317
  } else
1380
- L([u], !0), I = (await Mt(v, a.disabled, r, w, t.shouldUseNativeValidation))[u], L([u]), p(Re), x && (I ? oe = !1 : (b.isValid || y.isValid) && (oe = await j(n, !0)));
1381
- x && (v._f.deps && ie(v._f.deps), J(u, oe, I, et));
1318
+ N([d], !0), U = (await Mt(w, c.disabled, r, p, t.shouldUseNativeValidation))[d], N([d]), b(Be), v && (U ? oe = !1 : (y.isValid || g.isValid) && (oe = await I(n, !0)));
1319
+ v && (w._f.deps && ne(w._f.deps), M(d, oe, U, tt));
1382
1320
  }
1383
- }, te = (o, l) => {
1384
- if (_(s.errors, l) && o.focus)
1321
+ }, X = (o, u) => {
1322
+ if (S(s.errors, u) && o.focus)
1385
1323
  return o.focus(), 1;
1386
- }, ie = async (o, l = {}) => {
1387
- let u, x;
1388
- const v = Le(o);
1324
+ }, ne = async (o, u = {}) => {
1325
+ let d, v;
1326
+ const w = Le(o);
1389
1327
  if (t.resolver) {
1390
- const p = await le(z(o) ? o : v);
1391
- u = re(p), x = o ? !v.some((S) => _(p, S)) : u;
1392
- } else o ? (x = (await Promise.all(v.map(async (p) => {
1393
- const S = _(n, p);
1394
- return await j(S && S._f ? { [p]: S } : S);
1395
- }))).every(Boolean), !(!x && !s.isValid) && g()) : x = u = await j(n);
1328
+ const b = await se(K(o) ? o : w);
1329
+ d = ee(b), v = o ? !w.some((E) => S(b, E)) : d;
1330
+ } else o ? (v = (await Promise.all(w.map(async (b) => {
1331
+ const E = S(n, b);
1332
+ return await I(E && E._f ? { [b]: E } : E);
1333
+ }))).every(Boolean), !(!v && !s.isValid) && C()) : v = d = await I(n);
1396
1334
  return f.state.next({
1397
- ...!ye(o) || (b.isValid || y.isValid) && u !== s.isValid ? {} : { name: o },
1398
- ...t.resolver || !o ? { isValid: u } : {},
1335
+ ...!ye(o) || (y.isValid || g.isValid) && d !== s.isValid ? {} : { name: o },
1336
+ ...t.resolver || !o ? { isValid: d } : {},
1399
1337
  errors: s.errors
1400
- }), l.shouldFocus && !x && Te(n, te, o ? v : a.mount), x;
1338
+ }), u.shouldFocus && !v && De(n, X, o ? w : c.mount), v;
1401
1339
  }, ue = (o) => {
1402
- const l = {
1403
- ...c.mount ? r : i
1340
+ const u = {
1341
+ ...a.mount ? r : i
1404
1342
  };
1405
- return z(o) ? l : ye(o) ? _(l, o) : o.map((u) => _(l, u));
1406
- }, Ue = (o, l) => ({
1407
- invalid: !!_((l || s).errors, o),
1408
- isDirty: !!_((l || s).dirtyFields, o),
1409
- error: _((l || s).errors, o),
1410
- isValidating: !!_(s.validatingFields, o),
1411
- isTouched: !!_((l || s).touchedFields, o)
1343
+ return K(o) ? u : ye(o) ? S(u, o) : o.map((d) => S(u, d));
1344
+ }, qe = (o, u) => ({
1345
+ invalid: !!S((u || s).errors, o),
1346
+ isDirty: !!S((u || s).dirtyFields, o),
1347
+ error: S((u || s).errors, o),
1348
+ isValidating: !!S(s.validatingFields, o),
1349
+ isTouched: !!S((u || s).touchedFields, o)
1412
1350
  }), Ce = (o) => {
1413
- o && Le(o).forEach((l) => W(s.errors, l)), f.state.next({
1351
+ o && Le(o).forEach((u) => Q(s.errors, u)), f.state.next({
1414
1352
  errors: o ? s.errors : {}
1415
1353
  });
1416
- }, dt = (o, l, u) => {
1417
- const x = (_(n, o, { _f: {} })._f || {}).ref, v = _(s.errors, o) || {}, { ref: p, message: S, type: D, ...I } = v;
1418
- R(s.errors, o, {
1419
- ...I,
1420
- ...l,
1421
- ref: x
1354
+ }, mt = (o, u, d) => {
1355
+ const v = (S(n, o, { _f: {} })._f || {}).ref, w = S(s.errors, o) || {}, { ref: b, message: E, type: P, ...U } = w;
1356
+ q(s.errors, o, {
1357
+ ...U,
1358
+ ...u,
1359
+ ref: v
1422
1360
  }), f.state.next({
1423
1361
  name: o,
1424
1362
  errors: s.errors,
1425
1363
  isValid: !1
1426
- }), u && u.shouldFocus && x && x.focus && x.focus();
1427
- }, ls = (o, l) => fe(o) ? f.state.subscribe({
1428
- next: (u) => "values" in u && o(N(void 0, l), u)
1429
- }) : N(o, l, !0), ft = (o) => f.state.subscribe({
1430
- next: (l) => {
1431
- wr(o.name, l.name, o.exact) && pr(l, o.formState || b, hs, o.reRenderRoot) && o.callback({
1364
+ }), d && d.shouldFocus && v && v.focus && v.focus();
1365
+ }, ms = (o, u) => fe(o) ? f.state.subscribe({
1366
+ next: (d) => "values" in d && o(T(void 0, u), d)
1367
+ }) : T(o, u, !0), ht = (o) => f.state.subscribe({
1368
+ next: (u) => {
1369
+ Cr(o.name, u.name, o.exact) && Sr(u, o.formState || y, bs, o.reRenderRoot) && o.callback({
1432
1370
  values: { ...r },
1433
1371
  ...s,
1434
- ...l,
1372
+ ...u,
1435
1373
  defaultValues: i
1436
1374
  });
1437
1375
  }
1438
- }).unsubscribe, us = (o) => (c.mount = !0, y = {
1439
- ...y,
1376
+ }).unsubscribe, hs = (o) => (a.mount = !0, g = {
1377
+ ...g,
1440
1378
  ...o.formState
1441
- }, ft({
1379
+ }, ht({
1442
1380
  ...o,
1443
- formState: y
1444
- })), Je = (o, l = {}) => {
1445
- for (const u of o ? Le(o) : a.mount)
1446
- a.mount.delete(u), a.array.delete(u), l.keepValue || (W(n, u), W(r, u)), !l.keepError && W(s.errors, u), !l.keepDirty && W(s.dirtyFields, u), !l.keepTouched && W(s.touchedFields, u), !l.keepIsValidating && W(s.validatingFields, u), !t.shouldUnregister && !l.keepDefaultValue && W(i, u);
1381
+ formState: g
1382
+ })), Ye = (o, u = {}) => {
1383
+ for (const d of o ? Le(o) : c.mount)
1384
+ c.mount.delete(d), c.array.delete(d), u.keepValue || (Q(n, d), Q(r, d)), !u.keepError && Q(s.errors, d), !u.keepDirty && Q(s.dirtyFields, d), !u.keepTouched && Q(s.touchedFields, d), !u.keepIsValidating && Q(s.validatingFields, d), !t.shouldUnregister && !u.keepDefaultValue && Q(i, d);
1447
1385
  f.state.next({
1448
- values: X(r)
1386
+ values: G(r)
1449
1387
  }), f.state.next({
1450
1388
  ...s,
1451
- ...l.keepDirty ? { isDirty: O() } : {}
1452
- }), !l.keepIsValid && g();
1453
- }, mt = ({ disabled: o, name: l }) => {
1454
- (he(o) && c.mount || o || a.disabled.has(l)) && (o ? a.disabled.add(l) : a.disabled.delete(l));
1455
- }, Ye = (o, l = {}) => {
1456
- let u = _(n, o);
1457
- const x = he(l.disabled) || he(t.disabled);
1458
- return R(n, o, {
1459
- ...u || {},
1389
+ ...u.keepDirty ? { isDirty: ae() } : {}
1390
+ }), !u.keepIsValid && C();
1391
+ }, yt = ({ disabled: o, name: u }) => {
1392
+ (he(o) && a.mount || o || c.disabled.has(u)) && (o ? c.disabled.add(u) : c.disabled.delete(u));
1393
+ }, Xe = (o, u = {}) => {
1394
+ let d = S(n, o);
1395
+ const v = he(u.disabled) || he(t.disabled);
1396
+ return q(n, o, {
1397
+ ...d || {},
1460
1398
  _f: {
1461
- ...u && u._f ? u._f : { ref: { name: o } },
1399
+ ...d && d._f ? d._f : { ref: { name: o } },
1462
1400
  name: o,
1463
1401
  mount: !0,
1464
- ...l
1402
+ ...u
1465
1403
  }
1466
- }), a.mount.add(o), u ? mt({
1467
- disabled: he(l.disabled) ? l.disabled : t.disabled,
1404
+ }), c.mount.add(o), d ? yt({
1405
+ disabled: he(u.disabled) ? u.disabled : t.disabled,
1468
1406
  name: o
1469
- }) : V(o, !0, l.value), {
1470
- ...x ? { disabled: l.disabled || t.disabled } : {},
1407
+ }) : F(o, !0, u.value), {
1408
+ ...v ? { disabled: u.disabled || t.disabled } : {},
1471
1409
  ...t.progressive ? {
1472
- required: !!l.required,
1473
- min: Fe(l.min),
1474
- max: Fe(l.max),
1475
- minLength: Fe(l.minLength),
1476
- maxLength: Fe(l.maxLength),
1477
- pattern: Fe(l.pattern)
1410
+ required: !!u.required,
1411
+ min: $e(u.min),
1412
+ max: $e(u.max),
1413
+ minLength: $e(u.minLength),
1414
+ maxLength: $e(u.maxLength),
1415
+ pattern: $e(u.pattern)
1478
1416
  } : {},
1479
1417
  name: o,
1480
- onChange: M,
1481
- onBlur: M,
1482
- ref: (v) => {
1483
- if (v) {
1484
- Ye(o, l), u = _(n, o);
1485
- const p = z(v.value) && v.querySelectorAll && v.querySelectorAll("input,select,textarea")[0] || v, S = fr(p), D = u._f.refs || [];
1486
- if (S ? D.find((I) => I === p) : p === u._f.ref)
1418
+ onChange: R,
1419
+ onBlur: R,
1420
+ ref: (w) => {
1421
+ if (w) {
1422
+ Xe(o, u), d = S(n, o);
1423
+ const b = K(w.value) && w.querySelectorAll && w.querySelectorAll("input,select,textarea")[0] || w, E = gr(b), P = d._f.refs || [];
1424
+ if (E ? P.find((U) => U === b) : b === d._f.ref)
1487
1425
  return;
1488
- R(n, o, {
1426
+ q(n, o, {
1489
1427
  _f: {
1490
- ...u._f,
1491
- ...S ? {
1428
+ ...d._f,
1429
+ ...E ? {
1492
1430
  refs: [
1493
- ...D.filter(st),
1494
- p,
1495
- ...Array.isArray(_(i, o)) ? [{}] : []
1431
+ ...P.filter(rt),
1432
+ b,
1433
+ ...Array.isArray(S(i, o)) ? [{}] : []
1496
1434
  ],
1497
- ref: { type: p.type, name: o }
1498
- } : { ref: p }
1435
+ ref: { type: b.type, name: o }
1436
+ } : { ref: b }
1499
1437
  }
1500
- }), V(o, !1, void 0, p);
1438
+ }), F(o, !1, void 0, b);
1501
1439
  } else
1502
- u = _(n, o, {}), u._f && (u._f.mount = !1), (t.shouldUnregister || l.shouldUnregister) && !(ir(a.array, o) && c.action) && a.unMount.add(o);
1440
+ d = S(n, o, {}), d._f && (d._f.mount = !1), (t.shouldUnregister || u.shouldUnregister) && !(lr(c.array, o) && a.action) && c.unMount.add(o);
1503
1441
  }
1504
1442
  };
1505
- }, Xe = () => t.shouldFocusError && Te(n, te, a.mount), ds = (o) => {
1506
- he(o) && (f.state.next({ disabled: o }), Te(n, (l, u) => {
1507
- const x = _(n, u);
1508
- x && (l.disabled = x._f.disabled || o, Array.isArray(x._f.refs) && x._f.refs.forEach((v) => {
1509
- v.disabled = x._f.disabled || o;
1443
+ }, Ze = () => t.shouldFocusError && De(n, X, c.mount), ys = (o) => {
1444
+ he(o) && (f.state.next({ disabled: o }), De(n, (u, d) => {
1445
+ const v = S(n, d);
1446
+ v && (u.disabled = v._f.disabled || o, Array.isArray(v._f.refs) && v._f.refs.forEach((w) => {
1447
+ w.disabled = v._f.disabled || o;
1510
1448
  }));
1511
1449
  }, 0, !1));
1512
- }, ht = (o, l) => async (u) => {
1513
- let x;
1514
- u && (u.preventDefault && u.preventDefault(), u.persist && u.persist());
1515
- let v = X(r);
1450
+ }, gt = (o, u) => async (d) => {
1451
+ let v;
1452
+ d && (d.preventDefault && d.preventDefault(), d.persist && d.persist());
1453
+ let w = G(r);
1516
1454
  if (f.state.next({
1517
1455
  isSubmitting: !0
1518
1456
  }), t.resolver) {
1519
- const { errors: p, values: S } = await P();
1520
- s.errors = p, v = X(S);
1457
+ const { errors: b, values: E } = await O();
1458
+ s.errors = b, w = G(E);
1521
1459
  } else
1522
- await j(n);
1523
- if (a.disabled.size)
1524
- for (const p of a.disabled)
1525
- W(v, p);
1526
- if (W(s.errors, "root"), re(s.errors)) {
1460
+ await I(n);
1461
+ if (c.disabled.size)
1462
+ for (const b of c.disabled)
1463
+ Q(w, b);
1464
+ if (Q(s.errors, "root"), ee(s.errors)) {
1527
1465
  f.state.next({
1528
1466
  errors: {}
1529
1467
  });
1530
1468
  try {
1531
- await o(v, u);
1532
- } catch (p) {
1533
- x = p;
1469
+ await o(w, d);
1470
+ } catch (b) {
1471
+ v = b;
1534
1472
  }
1535
1473
  } else
1536
- l && await l({ ...s.errors }, u), Xe(), setTimeout(Xe);
1474
+ u && await u({ ...s.errors }, d), Ze(), setTimeout(Ze);
1537
1475
  if (f.state.next({
1538
1476
  isSubmitted: !0,
1539
1477
  isSubmitting: !1,
1540
- isSubmitSuccessful: re(s.errors) && !x,
1478
+ isSubmitSuccessful: ee(s.errors) && !v,
1541
1479
  submitCount: s.submitCount + 1,
1542
1480
  errors: s.errors
1543
- }), x)
1544
- throw x;
1545
- }, fs = (o, l = {}) => {
1546
- _(n, o) && (z(l.defaultValue) ? ee(o, X(_(i, o))) : (ee(o, l.defaultValue), R(i, o, X(l.defaultValue))), l.keepTouched || W(s.touchedFields, o), l.keepDirty || (W(s.dirtyFields, o), s.isDirty = l.defaultValue ? O(o, X(_(i, o))) : O()), l.keepError || (W(s.errors, o), b.isValid && g()), f.state.next({ ...s }));
1547
- }, yt = (o, l = {}) => {
1548
- const u = o ? X(o) : i, x = X(u), v = re(o), p = v ? i : x;
1549
- if (l.keepDefaultValues || (i = u), !l.keepValues) {
1550
- if (l.keepDirtyValues) {
1551
- const S = /* @__PURE__ */ new Set([
1552
- ...a.mount,
1553
- ...Object.keys($e(i, r))
1481
+ }), v)
1482
+ throw v;
1483
+ }, gs = (o, u = {}) => {
1484
+ S(n, o) && (K(u.defaultValue) ? z(o, G(S(i, o))) : (z(o, u.defaultValue), q(i, o, G(u.defaultValue))), u.keepTouched || Q(s.touchedFields, o), u.keepDirty || (Q(s.dirtyFields, o), s.isDirty = u.defaultValue ? ae(o, G(S(i, o))) : ae()), u.keepError || (Q(s.errors, o), y.isValid && C()), f.state.next({ ...s }));
1485
+ }, pt = (o, u = {}) => {
1486
+ const d = o ? G(o) : i, v = G(d), w = ee(o), b = w ? i : v;
1487
+ if (u.keepDefaultValues || (i = d), !u.keepValues) {
1488
+ if (u.keepDirtyValues) {
1489
+ const E = /* @__PURE__ */ new Set([
1490
+ ...c.mount,
1491
+ ...Object.keys(Fe(i, r))
1554
1492
  ]);
1555
- for (const D of Array.from(S))
1556
- _(s.dirtyFields, D) ? R(p, D, _(r, D)) : ee(D, _(p, D));
1493
+ for (const P of Array.from(E))
1494
+ S(s.dirtyFields, P) ? q(b, P, S(r, P)) : z(P, S(b, P));
1557
1495
  } else {
1558
- if (nt && z(o))
1559
- for (const S of a.mount) {
1560
- const D = _(n, S);
1561
- if (D && D._f) {
1562
- const I = Array.isArray(D._f.refs) ? D._f.refs[0] : D._f.ref;
1563
- if (He(I)) {
1564
- const oe = I.closest("form");
1496
+ if (at && K(o))
1497
+ for (const E of c.mount) {
1498
+ const P = S(n, E);
1499
+ if (P && P._f) {
1500
+ const U = Array.isArray(P._f.refs) ? P._f.refs[0] : P._f.ref;
1501
+ if (Ke(U)) {
1502
+ const oe = U.closest("form");
1565
1503
  if (oe) {
1566
1504
  oe.reset();
1567
1505
  break;
@@ -1569,74 +1507,74 @@ function Sr(e = {}) {
1569
1507
  }
1570
1508
  }
1571
1509
  }
1572
- if (l.keepFieldsRef)
1573
- for (const S of a.mount)
1574
- ee(S, _(p, S));
1510
+ if (u.keepFieldsRef)
1511
+ for (const E of c.mount)
1512
+ z(E, S(b, E));
1575
1513
  else
1576
1514
  n = {};
1577
1515
  }
1578
- r = t.shouldUnregister ? l.keepDefaultValues ? X(i) : {} : X(p), f.array.next({
1579
- values: { ...p }
1516
+ r = t.shouldUnregister ? u.keepDefaultValues ? G(i) : {} : G(b), f.array.next({
1517
+ values: { ...b }
1580
1518
  }), f.state.next({
1581
- values: { ...p }
1519
+ values: { ...b }
1582
1520
  });
1583
1521
  }
1584
- a = {
1585
- mount: l.keepDirtyValues ? a.mount : /* @__PURE__ */ new Set(),
1522
+ c = {
1523
+ mount: u.keepDirtyValues ? c.mount : /* @__PURE__ */ new Set(),
1586
1524
  unMount: /* @__PURE__ */ new Set(),
1587
1525
  array: /* @__PURE__ */ new Set(),
1588
1526
  disabled: /* @__PURE__ */ new Set(),
1589
1527
  watch: /* @__PURE__ */ new Set(),
1590
1528
  watchAll: !1,
1591
1529
  focus: ""
1592
- }, c.mount = !b.isValid || !!l.keepIsValid || !!l.keepDirtyValues, c.watch = !!t.shouldUnregister, f.state.next({
1593
- submitCount: l.keepSubmitCount ? s.submitCount : 0,
1594
- isDirty: v ? !1 : l.keepDirty ? s.isDirty : !!(l.keepDefaultValues && !ve(o, i)),
1595
- isSubmitted: l.keepIsSubmitted ? s.isSubmitted : !1,
1596
- dirtyFields: v ? {} : l.keepDirtyValues ? l.keepDefaultValues && r ? $e(i, r) : s.dirtyFields : l.keepDefaultValues && o ? $e(i, o) : l.keepDirty ? s.dirtyFields : {},
1597
- touchedFields: l.keepTouched ? s.touchedFields : {},
1598
- errors: l.keepErrors ? s.errors : {},
1599
- isSubmitSuccessful: l.keepIsSubmitSuccessful ? s.isSubmitSuccessful : !1,
1530
+ }, a.mount = !y.isValid || !!u.keepIsValid || !!u.keepDirtyValues, a.watch = !!t.shouldUnregister, f.state.next({
1531
+ submitCount: u.keepSubmitCount ? s.submitCount : 0,
1532
+ isDirty: w ? !1 : u.keepDirty ? s.isDirty : !!(u.keepDefaultValues && !ve(o, i)),
1533
+ isSubmitted: u.keepIsSubmitted ? s.isSubmitted : !1,
1534
+ dirtyFields: w ? {} : u.keepDirtyValues ? u.keepDefaultValues && r ? Fe(i, r) : s.dirtyFields : u.keepDefaultValues && o ? Fe(i, o) : u.keepDirty ? s.dirtyFields : {},
1535
+ touchedFields: u.keepTouched ? s.touchedFields : {},
1536
+ errors: u.keepErrors ? s.errors : {},
1537
+ isSubmitSuccessful: u.keepIsSubmitSuccessful ? s.isSubmitSuccessful : !1,
1600
1538
  isSubmitting: !1
1601
1539
  });
1602
- }, gt = (o, l) => yt(fe(o) ? o(r) : o, l), ms = (o, l = {}) => {
1603
- const u = _(n, o), x = u && u._f;
1604
- if (x) {
1605
- const v = x.refs ? x.refs[0] : x.ref;
1606
- v.focus && (v.focus(), l.shouldSelect && fe(v.select) && v.select());
1540
+ }, bt = (o, u) => pt(fe(o) ? o(r) : o, u), ps = (o, u = {}) => {
1541
+ const d = S(n, o), v = d && d._f;
1542
+ if (v) {
1543
+ const w = v.refs ? v.refs[0] : v.ref;
1544
+ w.focus && (w.focus(), u.shouldSelect && fe(w.select) && w.select());
1607
1545
  }
1608
- }, hs = (o) => {
1546
+ }, bs = (o) => {
1609
1547
  s = {
1610
1548
  ...s,
1611
1549
  ...o
1612
1550
  };
1613
- }, bt = {
1551
+ }, wt = {
1614
1552
  control: {
1615
- register: Ye,
1616
- unregister: Je,
1617
- getFieldState: Ue,
1618
- handleSubmit: ht,
1619
- setError: dt,
1620
- _subscribe: ft,
1621
- _runSchema: P,
1622
- _focusError: Xe,
1623
- _getWatch: N,
1624
- _getDirty: O,
1625
- _setValid: g,
1626
- _setFieldArray: G,
1627
- _setDisabledField: mt,
1628
- _setErrors: H,
1553
+ register: Xe,
1554
+ unregister: Ye,
1555
+ getFieldState: qe,
1556
+ handleSubmit: gt,
1557
+ setError: mt,
1558
+ _subscribe: ht,
1559
+ _runSchema: O,
1560
+ _focusError: Ze,
1561
+ _getWatch: T,
1562
+ _getDirty: ae,
1563
+ _setValid: C,
1564
+ _setFieldArray: j,
1565
+ _setDisabledField: yt,
1566
+ _setErrors: V,
1629
1567
  _getFieldArray: $,
1630
- _reset: yt,
1568
+ _reset: pt,
1631
1569
  _resetDefaultValues: () => fe(t.defaultValues) && t.defaultValues().then((o) => {
1632
- gt(o, t.resetOptions), f.state.next({
1570
+ bt(o, t.resetOptions), f.state.next({
1633
1571
  isLoading: !1
1634
1572
  });
1635
1573
  }),
1636
- _removeUnmounted: U,
1637
- _disableForm: ds,
1574
+ _removeUnmounted: re,
1575
+ _disableForm: ys,
1638
1576
  _subjects: f,
1639
- _proxyFormState: b,
1577
+ _proxyFormState: y,
1640
1578
  get _fields() {
1641
1579
  return n;
1642
1580
  },
@@ -1644,19 +1582,19 @@ function Sr(e = {}) {
1644
1582
  return r;
1645
1583
  },
1646
1584
  get _state() {
1647
- return c;
1585
+ return a;
1648
1586
  },
1649
1587
  set _state(o) {
1650
- c = o;
1588
+ a = o;
1651
1589
  },
1652
1590
  get _defaultValues() {
1653
1591
  return i;
1654
1592
  },
1655
1593
  get _names() {
1656
- return a;
1594
+ return c;
1657
1595
  },
1658
1596
  set _names(o) {
1659
- a = o;
1597
+ c = o;
1660
1598
  },
1661
1599
  get _formState() {
1662
1600
  return s;
@@ -1671,28 +1609,28 @@ function Sr(e = {}) {
1671
1609
  };
1672
1610
  }
1673
1611
  },
1674
- subscribe: us,
1675
- trigger: ie,
1676
- register: Ye,
1677
- handleSubmit: ht,
1678
- watch: ls,
1679
- setValue: ee,
1612
+ subscribe: hs,
1613
+ trigger: ne,
1614
+ register: Xe,
1615
+ handleSubmit: gt,
1616
+ watch: ms,
1617
+ setValue: z,
1680
1618
  getValues: ue,
1681
- reset: gt,
1682
- resetField: fs,
1619
+ reset: bt,
1620
+ resetField: gs,
1683
1621
  clearErrors: Ce,
1684
- unregister: Je,
1685
- setError: dt,
1686
- setFocus: ms,
1687
- getFieldState: Ue
1622
+ unregister: Ye,
1623
+ setError: mt,
1624
+ setFocus: ps,
1625
+ getFieldState: qe
1688
1626
  };
1689
1627
  return {
1690
- ...bt,
1691
- formControl: bt
1628
+ ...wt,
1629
+ formControl: wt
1692
1630
  };
1693
1631
  }
1694
- function os(e = {}) {
1695
- const t = ae.useRef(void 0), s = ae.useRef(void 0), [n, i] = ae.useState({
1632
+ function us(e = {}) {
1633
+ const t = ie.useRef(void 0), s = ie.useRef(void 0), [n, i] = ie.useState({
1696
1634
  isDirty: !1,
1697
1635
  isValidating: !1,
1698
1636
  isLoading: fe(e.defaultValues),
@@ -1716,162 +1654,162 @@ function os(e = {}) {
1716
1654
  formState: n
1717
1655
  }, e.defaultValues && !fe(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
1718
1656
  else {
1719
- const { formControl: c, ...a } = Sr(e);
1657
+ const { formControl: a, ...c } = xr(e);
1720
1658
  t.current = {
1721
- ...a,
1659
+ ...c,
1722
1660
  formState: n
1723
1661
  };
1724
1662
  }
1725
1663
  const r = t.current.control;
1726
- return r._options = e, lr(() => {
1727
- const c = r._subscribe({
1664
+ return r._options = e, mr(() => {
1665
+ const a = r._subscribe({
1728
1666
  formState: r._proxyFormState,
1729
1667
  callback: () => i({ ...r._formState }),
1730
1668
  reRenderRoot: !0
1731
1669
  });
1732
- return i((a) => ({
1733
- ...a,
1670
+ return i((c) => ({
1671
+ ...c,
1734
1672
  isReady: !0
1735
- })), r._formState.isReady = !0, c;
1736
- }, [r]), ae.useEffect(() => r._disableForm(e.disabled), [r, e.disabled]), ae.useEffect(() => {
1673
+ })), r._formState.isReady = !0, a;
1674
+ }, [r]), ie.useEffect(() => r._disableForm(e.disabled), [r, e.disabled]), ie.useEffect(() => {
1737
1675
  e.mode && (r._options.mode = e.mode), e.reValidateMode && (r._options.reValidateMode = e.reValidateMode);
1738
- }, [r, e.mode, e.reValidateMode]), ae.useEffect(() => {
1676
+ }, [r, e.mode, e.reValidateMode]), ie.useEffect(() => {
1739
1677
  e.errors && (r._setErrors(e.errors), r._focusError());
1740
- }, [r, e.errors]), ae.useEffect(() => {
1678
+ }, [r, e.errors]), ie.useEffect(() => {
1741
1679
  e.shouldUnregister && r._subjects.state.next({
1742
1680
  values: r._getWatch()
1743
1681
  });
1744
- }, [r, e.shouldUnregister]), ae.useEffect(() => {
1682
+ }, [r, e.shouldUnregister]), ie.useEffect(() => {
1745
1683
  if (r._proxyFormState.isDirty) {
1746
- const c = r._getDirty();
1747
- c !== n.isDirty && r._subjects.state.next({
1748
- isDirty: c
1684
+ const a = r._getDirty();
1685
+ a !== n.isDirty && r._subjects.state.next({
1686
+ isDirty: a
1749
1687
  });
1750
1688
  }
1751
- }, [r, n.isDirty]), ae.useEffect(() => {
1689
+ }, [r, n.isDirty]), ie.useEffect(() => {
1752
1690
  e.values && !ve(e.values, s.current) ? (r._reset(e.values, {
1753
1691
  keepFieldsRef: !0,
1754
1692
  ...r._options.resetOptions
1755
- }), s.current = e.values, i((c) => ({ ...c }))) : r._resetDefaultValues();
1756
- }, [r, e.values]), ae.useEffect(() => {
1693
+ }), s.current = e.values, i((a) => ({ ...a }))) : r._resetDefaultValues();
1694
+ }, [r, e.values]), ie.useEffect(() => {
1757
1695
  r._state.mount || (r._setValid(), r._state.mount = !0), r._state.watch && (r._state.watch = !1, r._subjects.state.next({ ...r._formState })), r._removeUnmounted();
1758
- }), t.current.formState = cr(n, r), t.current;
1696
+ }), t.current.formState = fr(n, r), t.current;
1759
1697
  }
1760
- const un = (e) => {
1761
- const { t } = T(), { showStackNotifications: s, showSuccessNotification: n } = Ne(), {
1698
+ const pn = (e) => {
1699
+ const { t } = L(), { showStackNotifications: s, showSuccessNotification: n } = Ne(), {
1762
1700
  defaultValues: i,
1763
1701
  mutationFn: r,
1764
- formToDto: c,
1765
- onError: a,
1766
- onSuccess: d,
1702
+ formToDto: a,
1703
+ onError: c,
1704
+ onSuccess: l,
1767
1705
  queryKey: m,
1768
- onSuccessMessage: b
1769
- } = e, { control: y, handleSubmit: f, reset: w, setError: C, getValues: g, setValue: L } = os({
1706
+ onSuccessMessage: y
1707
+ } = e, { control: g, handleSubmit: f, reset: p, setError: _, getValues: C, setValue: N } = us({
1770
1708
  defaultValues: i
1771
- }), G = E(
1772
- (V) => {
1773
- const F = V == null ? void 0 : V.errors, J = [];
1774
- return F && F.forEach(([P, le]) => {
1775
- const j = document.querySelector(`[name="${P}"]`);
1776
- (j instanceof HTMLInputElement || j instanceof HTMLTextAreaElement || j instanceof HTMLSelectElement) && (j.focus(), j.classList.add("error"), J.push(t(`_entities:${m}.${P}.${le}`)));
1777
- }), J;
1709
+ }), j = D(
1710
+ (F) => {
1711
+ const x = F == null ? void 0 : F.errors, M = [];
1712
+ return x && x.forEach(([O, se]) => {
1713
+ const I = document.querySelector(`[name="${O}"]`);
1714
+ (I instanceof HTMLInputElement || I instanceof HTMLTextAreaElement || I instanceof HTMLSelectElement) && (I.focus(), I.classList.add("error"), M.push(t(`_entities:${m}.${O}.${se}`)));
1715
+ }), M;
1778
1716
  },
1779
1717
  [t, m]
1780
- ), k = E(() => {
1781
- document.querySelectorAll("input, textarea, select").forEach((F) => {
1782
- F.classList.remove("error");
1718
+ ), k = D(() => {
1719
+ document.querySelectorAll("input, textarea, select").forEach((x) => {
1720
+ x.classList.remove("error");
1783
1721
  });
1784
- }, []), H = Ie(
1722
+ }, []), V = Me(
1785
1723
  {
1786
1724
  mutationFn: r,
1787
- onError: (V) => {
1788
- console.error(V);
1789
- const F = V;
1790
- if (a) a(V);
1791
- else if (Ke(F)) {
1792
- const J = G(F);
1725
+ onError: (F) => {
1726
+ console.error(F);
1727
+ const x = F;
1728
+ if (c) c(F);
1729
+ else if (Ge(x)) {
1730
+ const M = j(x);
1793
1731
  s(
1794
- J.map(
1795
- (P) => ({
1796
- message: P,
1797
- type: Q.error
1732
+ M.map(
1733
+ (O) => ({
1734
+ message: O,
1735
+ type: J.error
1798
1736
  })
1799
1737
  )
1800
1738
  );
1801
- } else if (We(F)) {
1802
- const J = F.message || t("_accessibility:errors.500"), P = t(`_accessibility:errors.${F.status}`);
1739
+ } else if (Je(x)) {
1740
+ const M = x.message || t("_accessibility:errors.500"), O = t(`_accessibility:errors.${x.status}`);
1803
1741
  s([
1804
1742
  {
1805
- message: P || J,
1806
- type: Q.error
1743
+ message: O || M,
1744
+ type: J.error
1807
1745
  }
1808
1746
  ]);
1809
1747
  }
1810
1748
  },
1811
- onSuccess: async (V) => {
1812
- pe && await pe.invalidateQueries({ queryKey: m }), d && d(V), b && n({
1813
- message: b
1749
+ onSuccess: async (F) => {
1750
+ be && await be.invalidateQueries({ queryKey: m }), l && l(F), y && n({
1751
+ message: y
1814
1752
  });
1815
1753
  }
1816
1754
  }
1817
1755
  );
1818
1756
  return {
1819
- control: y,
1820
- getValues: g,
1821
- setValue: L,
1757
+ control: g,
1758
+ getValues: C,
1759
+ setValue: N,
1822
1760
  handleSubmit: f,
1823
- onSubmit: (V) => H.mutate(
1824
- c ? c(V) : V
1825
- ),
1826
- reset: w,
1827
- setError: C,
1828
- parseFormError: G,
1829
- releaseFormError: k,
1830
- isLoading: H.isPending
1761
+ onSubmit: (F) => {
1762
+ k(), V.mutate(
1763
+ a ? a(F) : F
1764
+ );
1765
+ },
1766
+ reset: p,
1767
+ setError: _,
1768
+ isLoading: V.isPending
1831
1769
  };
1832
- }, kr = (e) => {
1833
- const { t } = T(), { onClick: s, hidden: n = !1, disabled: i = !1 } = e;
1770
+ }, Tr = (e) => {
1771
+ const { t } = L(), { onClick: s, hidden: n = !1, disabled: i = !1 } = e;
1834
1772
  return {
1835
- action: E(
1836
- (c) => ({
1837
- id: _e.Delete,
1838
- hidden: !!c.deletedAt || n,
1839
- disabled: !!c.deletedAt || i,
1840
- icon: /* @__PURE__ */ h(ce, { className: "text-red-500", icon: $s }),
1773
+ action: D(
1774
+ (a) => ({
1775
+ id: Se.Delete,
1776
+ hidden: !!a.deletedAt || n,
1777
+ disabled: !!a.deletedAt || i,
1778
+ icon: /* @__PURE__ */ h(ce, { className: "text-error", icon: Is }),
1841
1779
  tooltip: t("_pages:common.actions.delete.text"),
1842
- onClick: () => s([c == null ? void 0 : c.id]),
1843
- onMultipleClick: (a) => s(a.map((d) => d.id)),
1780
+ onClick: () => s([a == null ? void 0 : a.id]),
1781
+ onMultipleClick: (c) => s(c.map((l) => l.id)),
1844
1782
  multiple: !0
1845
1783
  }),
1846
1784
  [i, n, s, t]
1847
1785
  )
1848
1786
  };
1849
- }, Nr = (e) => {
1850
- const { t } = T(), { onClick: s, hidden: n = !1 } = e;
1787
+ }, Fr = (e) => {
1788
+ const { t } = L(), { onClick: s, hidden: n = !1 } = e;
1851
1789
  return {
1852
- action: E(
1790
+ action: D(
1853
1791
  (r) => ({
1854
- id: _e.Restore,
1792
+ id: Se.Restore,
1855
1793
  hidden: !r.deletedAt || n,
1856
1794
  disabled: !r.deletedAt,
1857
- icon: /* @__PURE__ */ h(ce, { className: "text-red-500", icon: Ot }),
1795
+ icon: /* @__PURE__ */ h(ce, { className: "text-error", icon: qt }),
1858
1796
  tooltip: t("_pages:common.actions.restore.text"),
1859
1797
  onClick: () => s([r == null ? void 0 : r.id]),
1860
- onMultipleClick: (c) => s(c.map((a) => a.id)),
1798
+ onMultipleClick: (a) => s(a.map((c) => c.id)),
1861
1799
  multiple: !0
1862
1800
  }),
1863
1801
  [n, s, t]
1864
1802
  )
1865
1803
  };
1866
- }, dn = (e) => {
1867
- const { t } = T(), { onClick: s, hidden: n = !1 } = e;
1804
+ }, bn = (e) => {
1805
+ const { t } = L(), { onClick: s, hidden: n = !1 } = e;
1868
1806
  return {
1869
- action: E(
1807
+ action: D(
1870
1808
  (r) => ({
1871
- id: _e.Edit,
1809
+ id: Se.Edit,
1872
1810
  hidden: !!r.deletedAt || n,
1873
1811
  disabled: !!r.deletedAt,
1874
- icon: /* @__PURE__ */ h(ce, { className: "primary", icon: Fs }),
1812
+ icon: /* @__PURE__ */ h(ce, { className: "primary", icon: Ps }),
1875
1813
  tooltip: t("_pages:common.actions.edit.text"),
1876
1814
  onClick: () => s(r == null ? void 0 : r.id)
1877
1815
  }),
@@ -1879,25 +1817,25 @@ const un = (e) => {
1879
1817
  )
1880
1818
  };
1881
1819
  };
1882
- var _e = /* @__PURE__ */ ((e) => (e.Add = "add", e.Edit = "edit", e.Delete = "delete", e.Restore = "restore", e.Refresh = "refresh", e.Export = "export", e.Import = "import", e))(_e || {});
1883
- const Ar = (e) => {
1884
- const { t } = T(), {
1820
+ var Se = /* @__PURE__ */ ((e) => (e.Add = "add", e.Edit = "edit", e.Delete = "delete", e.Restore = "restore", e.Refresh = "refresh", e.Export = "export", e.Import = "import", e))(Se || {});
1821
+ const $r = (e) => {
1822
+ const { t } = L(), {
1885
1823
  onClick: s,
1886
1824
  hidden: n = !1,
1887
1825
  disabled: i = !1,
1888
1826
  isLoading: r = !1
1889
1827
  } = e;
1890
1828
  return {
1891
- action: E(
1829
+ action: D(
1892
1830
  () => ({
1893
- id: _e.Export,
1831
+ id: Se.Export,
1894
1832
  hidden: n,
1895
1833
  disabled: i,
1896
1834
  icon: /* @__PURE__ */ h(
1897
1835
  ce,
1898
1836
  {
1899
1837
  className: `${r ? "rotate" : ""}`,
1900
- icon: r ? Ut : Ls
1838
+ icon: r ? Bt : Os
1901
1839
  }
1902
1840
  ),
1903
1841
  tooltip: t("_pages:common.actions.export.text"),
@@ -1906,24 +1844,24 @@ const Ar = (e) => {
1906
1844
  [i, n, r, s, t]
1907
1845
  )
1908
1846
  };
1909
- }, Er = (e) => {
1910
- const { t } = T(), {
1847
+ }, Lr = (e) => {
1848
+ const { t } = L(), {
1911
1849
  onClick: s,
1912
1850
  hidden: n = !1,
1913
1851
  disabled: i = !1,
1914
1852
  isLoading: r = !1
1915
1853
  } = e;
1916
1854
  return {
1917
- action: E(
1855
+ action: D(
1918
1856
  () => ({
1919
- id: _e.Import,
1857
+ id: Se.Import,
1920
1858
  hidden: n,
1921
1859
  disabled: i,
1922
1860
  icon: /* @__PURE__ */ h(
1923
1861
  ce,
1924
1862
  {
1925
1863
  className: `${r ? "rotate" : ""}`,
1926
- icon: r ? Ut : Ts
1864
+ icon: r ? Bt : Ms
1927
1865
  }
1928
1866
  ),
1929
1867
  tooltip: t("_pages:common.actions.import.text"),
@@ -1932,353 +1870,366 @@ const Ar = (e) => {
1932
1870
  [i, n, r, s, t]
1933
1871
  )
1934
1872
  };
1935
- }, fn = (e) => {
1936
- const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Ne(), { t: r } = T(), { open: c, onClick: a, close: d, dialogFn: m, isLoading: b } = Zt({
1873
+ }, wn = (e) => {
1874
+ const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Ne(), { t: r } = L(), { open: a, onClick: c, close: l, dialogFn: m, isLoading: y } = ss({
1937
1875
  onSuccessMessage: r("_pages:common.actions.delete.successMessage"),
1938
1876
  onError: (f) => {
1939
- const w = f;
1940
- if (Ke(w))
1877
+ const p = f;
1878
+ if (Ge(p))
1941
1879
  i(
1942
- w.errors.map(
1943
- ([C, g]) => ({
1944
- message: r(`_pages:${C}.errors.${g}`),
1945
- type: Q.error
1880
+ p.errors.map(
1881
+ ([_, C]) => ({
1882
+ message: r(`_pages:${_}.errors.${C}`),
1883
+ type: J.error
1946
1884
  })
1947
1885
  )
1948
1886
  );
1949
- else if (We(w)) {
1950
- const C = w.message || r("_accessibility:errors.500"), g = r(`_accessibility:errors.${w.status}`);
1887
+ else if (Je(p)) {
1888
+ const _ = p.message || r("_accessibility:errors.500"), C = r(`_accessibility:errors.${p.status}`);
1951
1889
  i([
1952
1890
  {
1953
- message: g || C,
1954
- type: Q.error
1891
+ message: C || _,
1892
+ type: J.error
1955
1893
  }
1956
1894
  ]);
1957
1895
  }
1958
1896
  },
1959
1897
  onSuccess: async (f) => {
1960
- await pe.invalidateQueries({ queryKey: t }), s && s(f);
1898
+ await be.invalidateQueries({ queryKey: t }), s && s(f);
1961
1899
  },
1962
1900
  ...n
1963
- }), { action: y } = kr({ onClick: a });
1901
+ }), { action: g } = Tr({ onClick: c });
1964
1902
  return {
1965
- onClick: a,
1903
+ onClick: c,
1966
1904
  title: r("_pages:common.actions.delete.dialog.title"),
1967
- open: c,
1968
- isLoading: b,
1905
+ open: a,
1906
+ isLoading: y,
1969
1907
  handleSubmit: () => m.mutate(),
1970
- handleClose: d,
1971
- action: y
1908
+ handleClose: l,
1909
+ action: g
1972
1910
  };
1973
- }, cs = () => {
1974
- const [e, t] = B(!1);
1911
+ }, ds = () => {
1912
+ const [e, t] = Y(!1);
1975
1913
  return { open: e, setOpen: t, handleClose: () => t(!1), handleOpen: () => t(!0) };
1976
- }, mn = (e) => {
1977
- const { t } = T(), {
1914
+ }, vn = (e) => {
1915
+ const { t } = L(), {
1978
1916
  showErrorNotification: s,
1979
1917
  showStackNotifications: n,
1980
1918
  showSuccessNotification: i
1981
1919
  } = Ne(), {
1982
1920
  defaultValues: r,
1983
- getFunction: c,
1984
- mutationFn: a,
1985
- formToDto: d,
1921
+ getFunction: a,
1922
+ mutationFn: c,
1923
+ formToDto: l,
1986
1924
  dtoToForm: m,
1987
- onError: b,
1988
- onSuccess: y,
1925
+ onError: y,
1926
+ onSuccess: g,
1989
1927
  queryKey: f,
1990
- onSuccessMessage: w,
1991
- title: C
1992
- } = e, [g, L] = B(0), { open: G, handleClose: k, handleOpen: H } = cs(), { control: V, handleSubmit: F, reset: J, setError: P, getValues: le, setValue: j } = os({
1928
+ onSuccessMessage: p,
1929
+ title: _
1930
+ } = e, [C, N] = Y(0), { open: j, handleClose: k, handleOpen: V } = ds(), { control: F, handleSubmit: x, reset: M, setError: O, getValues: se, setValue: I } = us({
1993
1931
  defaultValues: r
1994
- }), { data: U, isLoading: O } = Ks({
1995
- queryFn: () => c == null ? void 0 : c(g),
1996
- queryKey: [...f, g],
1997
- enabled: !!c && !!f && !!g
1932
+ }), { data: re, isLoading: ae } = Ys({
1933
+ queryFn: () => a == null ? void 0 : a(C),
1934
+ queryKey: [...f, C],
1935
+ enabled: !!a && !!f && !!C
1998
1936
  });
1999
- Z(() => {
2000
- U && m && J({ ...m(U) });
2001
- }, [U]);
2002
- const N = E(
2003
- (M) => {
2004
- const te = M == null ? void 0 : M.errors, ie = [];
2005
- return te && te.forEach(([ue, Ue]) => {
1937
+ le(() => {
1938
+ re && m && M({ ...m(re) });
1939
+ }, [re]);
1940
+ const T = D(
1941
+ (R) => {
1942
+ const X = R == null ? void 0 : R.errors, ne = [];
1943
+ return X && X.forEach(([ue, qe]) => {
2006
1944
  const Ce = document.querySelector(`[name="${ue}"]`);
2007
- (Ce instanceof HTMLInputElement || Ce instanceof HTMLTextAreaElement || Ce instanceof HTMLSelectElement) && (Ce.focus(), Ce.classList.add("error"), ie.push(t(`_entities:${f}.${ue}.${Ue}`)));
2008
- }), ie;
1945
+ (Ce instanceof HTMLInputElement || Ce instanceof HTMLTextAreaElement || Ce instanceof HTMLSelectElement) && (Ce.focus(), Ce.classList.add("error"), ne.push(t(`_entities:${f}.${ue}.${qe}`)));
1946
+ }), ne;
2009
1947
  },
2010
1948
  [t, f]
2011
- ), $ = E(() => {
2012
- document.querySelectorAll("input, textarea, select").forEach((te) => {
2013
- te.classList.remove("error");
1949
+ ), $ = D(() => {
1950
+ document.querySelectorAll("input, textarea, select").forEach((X) => {
1951
+ X.classList.remove("error");
2014
1952
  });
2015
- }, []), q = E(
2016
- (M) => {
2017
- L(M ?? 0), H();
1953
+ }, []), B = D(
1954
+ (R) => {
1955
+ N(R ?? 0), V();
2018
1956
  },
2019
- [H]
2020
- ), Y = E(() => {
2021
- $(), k(), J();
2022
- }, [J, $, k]), ee = Ie({
2023
- mutationFn: a,
2024
- onError: (M) => {
2025
- if (console.error(M), b) b(M);
1957
+ [V]
1958
+ ), W = D(() => {
1959
+ $(), k(), M();
1960
+ }, [M, $, k]), z = Me({
1961
+ mutationFn: c,
1962
+ onError: (R) => {
1963
+ if (console.error(R), y) y(R);
2026
1964
  else {
2027
- const te = M;
2028
- if (Ke(te)) {
2029
- const ie = N(te);
1965
+ const X = R;
1966
+ if (Ge(X)) {
1967
+ const ne = T(X);
2030
1968
  n(
2031
- ie.map(
1969
+ ne.map(
2032
1970
  (ue) => ({
2033
1971
  message: ue,
2034
- type: Q.error
1972
+ type: J.error
2035
1973
  })
2036
1974
  )
2037
1975
  );
2038
- } else if (We(te)) {
2039
- const ie = te.message || t("_accessibility:errors.500"), ue = t(`_accessibility:errors.${te.status}`);
2040
- s({ message: ue || ie });
1976
+ } else if (Je(X)) {
1977
+ const ne = X.message || t("_accessibility:errors.500"), ue = t(`_accessibility:errors.${X.status}`);
1978
+ s({ message: ue || ne });
2041
1979
  } else
2042
1980
  s({ message: t("_accessibility:errors.500") });
2043
1981
  }
2044
1982
  },
2045
- onSuccess: async (M) => {
2046
- await pe.invalidateQueries({ queryKey: f }), y && y(M), i({
2047
- message: w
2048
- }), Y();
1983
+ onSuccess: async (R) => {
1984
+ await be.invalidateQueries({ queryKey: f }), g && g(R), i({
1985
+ message: p
1986
+ }), W();
2049
1987
  }
2050
1988
  });
2051
1989
  return {
2052
- open: G,
2053
- openDialog: q,
2054
- handleClose: Y,
2055
- control: V,
2056
- getValues: le,
2057
- setValue: j,
2058
- handleSubmit: F,
2059
- onSubmit: (M) => ee.mutate(
2060
- d ? d(M) : M
1990
+ open: j,
1991
+ openDialog: B,
1992
+ handleClose: W,
1993
+ control: F,
1994
+ getValues: se,
1995
+ setValue: I,
1996
+ handleSubmit: x,
1997
+ onSubmit: (R) => z.mutate(
1998
+ l ? l(R) : R
2061
1999
  ),
2062
- reset: J,
2063
- setError: P,
2064
- parseFormError: N,
2065
- releaseFormError: $,
2066
- title: C,
2067
- isLoading: O || ee.isPending
2000
+ reset: M,
2001
+ setError: O,
2002
+ title: _,
2003
+ isLoading: ae || z.isPending
2068
2004
  };
2069
- }, hn = (e) => {
2070
- const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Ne(), { t: r } = T(), { open: c, onClick: a, close: d, dialogFn: m, isLoading: b } = Zt({
2005
+ }, _n = (e) => {
2006
+ const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Ne(), { t: r } = L(), { open: a, onClick: c, close: l, dialogFn: m, isLoading: y } = ss({
2071
2007
  onSuccessMessage: r("_pages:common.actions.restore.successMessage"),
2072
2008
  onError: (f) => {
2073
- const w = f;
2074
- if (Ke(w))
2009
+ const p = f;
2010
+ if (Ge(p))
2075
2011
  i(
2076
- w.errors.map(
2077
- ([C, g]) => ({
2078
- message: r(`_pages:${C}.errors.${g}`),
2079
- type: Q.error
2012
+ p.errors.map(
2013
+ ([_, C]) => ({
2014
+ message: r(`_pages:${_}.errors.${C}`),
2015
+ type: J.error
2080
2016
  })
2081
2017
  )
2082
2018
  );
2083
- else if (We(w)) {
2084
- const C = w.message || r("_accessibility:errors.500"), g = r(`_accessibility:errors.${w.status}`);
2019
+ else if (Je(p)) {
2020
+ const _ = p.message || r("_accessibility:errors.500"), C = r(`_accessibility:errors.${p.status}`);
2085
2021
  i([
2086
2022
  {
2087
- message: g || C,
2088
- type: Q.error
2023
+ message: C || _,
2024
+ type: J.error
2089
2025
  }
2090
2026
  ]);
2091
2027
  }
2092
2028
  },
2093
2029
  onSuccess: async (f) => {
2094
- await pe.invalidateQueries({ queryKey: t }), s && s(f);
2030
+ await be.invalidateQueries({ queryKey: t }), s && s(f);
2095
2031
  },
2096
2032
  ...n
2097
- }), { action: y } = Nr({ onClick: a });
2033
+ }), { action: g } = Fr({ onClick: c });
2098
2034
  return {
2099
- onClick: a,
2035
+ onClick: c,
2100
2036
  title: r("_pages:common.actions.restore.dialog.title"),
2101
- open: c,
2102
- isLoading: b,
2037
+ open: a,
2038
+ isLoading: y,
2103
2039
  handleSubmit: () => m.mutate(),
2104
- handleClose: d,
2105
- action: y
2040
+ handleClose: l,
2041
+ action: g
2106
2042
  };
2107
2043
  };
2108
- function yn(e) {
2109
- const { t } = T(), { queryKey: s, mutationFn: n, entity: i, fileProcessor: r, onError: c } = e, [a, d] = B(!1), [m, b] = B(null), [y, f] = B(!1), w = Ie({
2044
+ function Sn(e) {
2045
+ const { t } = L(), { queryKey: s, mutationFn: n, entity: i, fileProcessor: r, onError: a } = e, [c, l] = Y(!1), [m, y] = Y(null), [g, f] = Y(!1), p = Me({
2110
2046
  mutationFn: n,
2111
- onError: (g) => {
2112
- console.error(g), c == null || c(g);
2047
+ onError: (C) => {
2048
+ console.error(C), a == null || a(C);
2113
2049
  },
2114
2050
  onSuccess: async () => {
2115
- pe && await pe.invalidateQueries({ queryKey: s });
2051
+ be && await be.invalidateQueries({ queryKey: s });
2116
2052
  }
2117
- }), { action: C } = Er({
2118
- onClick: () => d(!0)
2053
+ }), { action: _ } = Lr({
2054
+ onClick: () => l(!0)
2119
2055
  });
2120
2056
  return {
2121
2057
  handleSubmit: async () => {
2122
2058
  if (!(!m || m.length === 0))
2123
2059
  try {
2124
- await w.mutateAsync({
2060
+ await p.mutateAsync({
2125
2061
  items: m,
2126
- override: y
2127
- }), d(!1), b(null), f(!1);
2128
- } catch (g) {
2129
- console.error(g);
2062
+ override: g
2063
+ }), l(!1), y(null), f(!1);
2064
+ } catch (C) {
2065
+ console.error(C);
2130
2066
  }
2131
2067
  },
2132
- isLoading: w.isPending,
2068
+ isLoading: p.isPending,
2133
2069
  fileProcessor: r,
2134
- onFileProcessed: (g) => b(g),
2135
- onOverrideChange: (g) => f(g),
2136
- open: a,
2070
+ onFileProcessed: (C) => y(C),
2071
+ onOverrideChange: (C) => f(C),
2072
+ open: c,
2137
2073
  title: t("_pages:common.actions.import.dialog.title", {
2138
2074
  entity: t(`_pages:${i}.title`)
2139
2075
  }),
2140
2076
  handleClose: () => {
2141
- d(!1), b(null);
2077
+ l(!1), y(null);
2142
2078
  },
2143
- action: C
2079
+ action: _
2144
2080
  };
2145
2081
  }
2146
- const gn = (e) => {
2147
- const { showSuccessNotification: t } = Ne(), { t: s } = T(), {
2082
+ const Cn = (e) => {
2083
+ const { showSuccessNotification: t } = Ne(), { t: s } = L(), {
2148
2084
  entity: n,
2149
2085
  mutationFn: i,
2150
2086
  onError: r,
2151
- onSuccess: c,
2152
- onSuccessMessage: a = s("_pages:common.actions.export.successMessage")
2153
- } = e, d = Ie({
2087
+ onSuccess: a,
2088
+ onSuccessMessage: c = s("_pages:common.actions.export.successMessage")
2089
+ } = e, l = Me({
2154
2090
  mutationFn: () => i(),
2155
- onError: (y) => {
2156
- console.error(y), r && r(y);
2091
+ onError: (g) => {
2092
+ console.error(g), r && r(g);
2157
2093
  },
2158
- onSuccess: async (y) => {
2159
- const f = JSON.stringify(y, null, 2), w = new Blob([f], { type: "application/json" }), C = URL.createObjectURL(w), g = document.createElement("a");
2160
- g.href = C, g.download = `${n}.json`, g.click(), URL.revokeObjectURL(C), c && c(y), t({
2161
- message: a
2094
+ onSuccess: async (g) => {
2095
+ const f = JSON.stringify(g, null, 2), p = new Blob([f], { type: "application/json" }), _ = URL.createObjectURL(p), C = document.createElement("a");
2096
+ C.href = _, C.download = `${n}.json`, C.click(), URL.revokeObjectURL(_), a && a(g), t({
2097
+ message: c
2162
2098
  });
2163
2099
  }
2164
- }), m = E(() => {
2165
- d.mutate();
2166
- }, [d]), { action: b } = Ar({
2100
+ }), m = D(() => {
2101
+ l.mutate();
2102
+ }, [l]), { action: y } = $r({
2167
2103
  onClick: m,
2168
- isLoading: d.isPending
2104
+ isLoading: l.isPending
2169
2105
  });
2170
2106
  return {
2171
- action: b
2107
+ action: y
2172
2108
  };
2173
2109
  };
2174
- function $r(e) {
2175
- const [t, s] = B(!1), n = E(() => {
2110
+ function Dr(e) {
2111
+ const [t, s] = Y(!1), n = D(() => {
2176
2112
  const i = window.scrollY > e;
2177
2113
  s(i);
2178
2114
  }, [e]);
2179
- return Z(() => (window.addEventListener("scroll", n), () => {
2115
+ return le(() => (window.addEventListener("scroll", n), () => {
2180
2116
  window.removeEventListener("scroll", n);
2181
2117
  }), [n]), t;
2182
2118
  }
2183
- const bn = () => {
2184
- const { t: e } = T(), t = $r(200);
2119
+ const En = () => {
2120
+ const { t: e } = L(), t = Dr(200);
2185
2121
  return /* @__PURE__ */ h(
2186
- be,
2122
+ pe,
2187
2123
  {
2188
- icon: Ds,
2189
- onClick: () => Js.scrollTo(0, 0),
2124
+ variant: "submit",
2125
+ color: "primary",
2126
+ icon: Rs,
2190
2127
  "data-tooltip-id": "tooltip",
2191
- "data-tooltip-content": e("_accessibility:buttons.toTop"),
2192
- className: `submit primary to-top ${t ? "show" : "hide"}`
2128
+ onClick: () => er.scrollTo(0, 0),
2129
+ className: `to-top ${t ? "show" : "hide"}`,
2130
+ "data-tooltip-content": e("_accessibility:buttons.toTop")
2193
2131
  }
2194
2132
  );
2195
- }, Fr = (e) => {
2196
- const { actions: t = [], className: s = "" } = e, { t: n } = T(), [i, r] = B(!1);
2133
+ }, Vr = (e) => {
2134
+ const { actions: t = [], className: s = "" } = e, { t: n } = L(), [i, r] = Y(!1), [a, c] = Y(null);
2197
2135
  return /* @__PURE__ */ A("div", { className: `actions-dropdown ${s}`, children: [
2198
2136
  /* @__PURE__ */ h(
2199
- be,
2137
+ pe,
2200
2138
  {
2201
- icon: Vs,
2202
- onClick: () => r(!0),
2139
+ icon: Us,
2140
+ onClick: (l) => {
2141
+ c(l.currentTarget), r((m) => !m);
2142
+ },
2143
+ className: "actions-dropdown-trigger",
2203
2144
  "data-tooltip-id": "tooltip",
2204
2145
  "data-tooltip-content": n("_accessibility:buttons.openActions")
2205
2146
  }
2206
2147
  ),
2207
- /* @__PURE__ */ h(zs, { open: i, onClose: () => r(!1), children: /* @__PURE__ */ h(
2208
- Ht,
2148
+ /* @__PURE__ */ h(
2149
+ Ns,
2209
2150
  {
2210
- showActionTexts: !0,
2211
- actions: t,
2212
- className: "flex-col",
2213
- showTooltips: !1
2151
+ open: i,
2152
+ onClose: () => r(!1),
2153
+ anchorEl: a,
2154
+ children: /* @__PURE__ */ h(
2155
+ jt,
2156
+ {
2157
+ showActionTexts: !0,
2158
+ actions: t,
2159
+ itemClassName: "w-full",
2160
+ actionClassName: "action-dropdown-item",
2161
+ className: "actions-dropdown-list",
2162
+ showTooltips: !1
2163
+ }
2164
+ )
2214
2165
  }
2215
- ) })
2166
+ )
2216
2167
  ] });
2217
- }, pn = It(function(e, t) {
2168
+ }, Nn = Ut(function(e, t) {
2218
2169
  const {
2219
2170
  value: s,
2220
2171
  onChange: n,
2221
- state: i = vs.default,
2172
+ state: i = ks.default,
2222
2173
  name: r = "",
2223
- id: c = "",
2224
- label: a = "",
2225
- disabled: d = !1,
2174
+ id: a = "",
2175
+ label: c = "",
2176
+ disabled: l = !1,
2226
2177
  required: m = !1,
2227
- containerClassName: b = "",
2228
- inputClassName: y = "",
2178
+ containerClassName: y = "",
2179
+ inputClassName: g = "",
2229
2180
  labelClassName: f = "",
2230
- helperText: w = "",
2231
- helperTextClassName: C = "",
2232
- ...g
2181
+ helperText: p = "",
2182
+ helperTextClassName: _ = "",
2183
+ ...C
2233
2184
  } = e;
2234
- return /* @__PURE__ */ A("div", { className: `relative z-0 w-full mb-5 group ${b}`, children: [
2185
+ return /* @__PURE__ */ A("div", { className: `form-paragraph-container group ${y}`, children: [
2235
2186
  /* @__PURE__ */ h(
2236
2187
  "textarea",
2237
2188
  {
2238
2189
  ref: t,
2239
2190
  name: r,
2240
- id: c,
2241
- className: `text-input text-area ${xs(i)} ${y} peer`,
2191
+ id: a,
2192
+ className: `text-input text-area form-paragraph-textarea peer ${As(i)} ${g}`,
2242
2193
  required: m,
2243
2194
  value: s,
2244
2195
  onChange: n,
2245
- disabled: d,
2246
- ...g
2196
+ disabled: l,
2197
+ ...C
2247
2198
  }
2248
2199
  ),
2249
2200
  /* @__PURE__ */ A(
2250
2201
  "label",
2251
2202
  {
2252
- htmlFor: r,
2253
- className: `text-input-label ${_s(i)} ${f}`,
2203
+ htmlFor: a,
2204
+ className: `text-input-label ${xs(i)} ${f}`,
2254
2205
  children: [
2255
- a,
2206
+ c,
2256
2207
  m ? " *" : ""
2257
2208
  ]
2258
2209
  }
2259
2210
  ),
2260
- !!w && /* @__PURE__ */ h(
2211
+ !!p && /* @__PURE__ */ h(
2261
2212
  "p",
2262
2213
  {
2263
- className: `text-input-helper-text ${Cs(i)} ${C}`,
2264
- children: w
2214
+ className: `text-input-helper-text ${Ts(i)} ${_}`,
2215
+ children: p
2265
2216
  }
2266
2217
  )
2267
2218
  ] });
2268
- }), wn = (e) => {
2269
- const { t } = T(), {
2219
+ }), kn = (e) => {
2220
+ const { t } = L(), {
2270
2221
  children: s,
2271
2222
  handleSubmit: n,
2272
2223
  onSubmit: i,
2273
2224
  isLoading: r = !1,
2274
- buttonEnd: c = !0,
2275
- reset: a
2225
+ buttonEnd: a = !0,
2226
+ reset: c
2276
2227
  } = e;
2277
2228
  return /* @__PURE__ */ A("form", { className: "form-container", onSubmit: n(i), children: [
2278
2229
  s,
2279
- /* @__PURE__ */ A("div", { className: `flex gap-2 mt-5 ${c ? "justify-end" : ""}`, children: [
2230
+ /* @__PURE__ */ A("div", { className: `form-actions ${a ? "end" : ""}`, children: [
2280
2231
  /* @__PURE__ */ A(
2281
- xe,
2232
+ _e,
2282
2233
  {
2283
2234
  type: "submit",
2284
2235
  color: "primary",
@@ -2287,17 +2238,17 @@ const bn = () => {
2287
2238
  name: t("_accessibility:buttons.submit"),
2288
2239
  "aria-label": t("_accessibility:ariaLabels.submit"),
2289
2240
  children: [
2290
- r ? /* @__PURE__ */ h(Ve, { color: "stroke-base", loaderClass: "!w-6 mt-1", strokeWidth: "6" }) : null,
2241
+ r ? /* @__PURE__ */ h(xe, { color: "stroke-base", loaderClass: "!w-6 mt-1", strokeWidth: "6" }) : null,
2291
2242
  t("_accessibility:buttons.submit")
2292
2243
  ]
2293
2244
  }
2294
2245
  ),
2295
2246
  /* @__PURE__ */ h(
2296
- xe,
2247
+ _e,
2297
2248
  {
2298
2249
  type: "button",
2299
2250
  variant: "outlined",
2300
- onClick: () => a == null ? void 0 : a(),
2251
+ onClick: () => c == null ? void 0 : c(),
2301
2252
  name: t("_accessibility:buttons.cancel"),
2302
2253
  "aria-label": t("_accessibility:ariaLabels.cancel"),
2303
2254
  children: t("_accessibility:buttons.cancel")
@@ -2305,79 +2256,75 @@ const bn = () => {
2305
2256
  )
2306
2257
  ] })
2307
2258
  ] });
2308
- }, vn = It(function(e, t) {
2309
- const [s, n] = B(!1);
2310
- return /* @__PURE__ */ h(Ss, { ...e, type: s ? "text" : "password", ref: t, children: /* @__PURE__ */ h(
2311
- be,
2259
+ }, An = Ut(function(e, t) {
2260
+ const { t: s } = L(), [n, i] = Y(!1);
2261
+ return /* @__PURE__ */ h(Fs, { ...e, type: n ? "text" : "password", ref: t, children: /* @__PURE__ */ h(
2262
+ pe,
2312
2263
  {
2313
2264
  type: "button",
2314
2265
  tabIndex: -1,
2315
- className: "absolute right-2 password-icon",
2316
- onClick: () => n(!s),
2317
- icon: s ? Ps : Ms
2266
+ "aria-label": s(
2267
+ n ? "_accessibility:ariaLabels.hidePassword" : "_accessibility:ariaLabels.showPassword"
2268
+ ),
2269
+ className: "password-icon",
2270
+ onClick: () => i(!n),
2271
+ icon: n ? qs : Bs
2318
2272
  }
2319
2273
  ) });
2320
- }), lt = (e) => {
2321
- const { t } = T(), {
2274
+ }), dt = (e) => {
2275
+ const { t } = L(), {
2322
2276
  title: s,
2323
2277
  children: n,
2324
2278
  handleClose: i,
2325
2279
  open: r = !1,
2326
- containerClassName: c = "",
2327
- className: a = "",
2328
- animationClass: d = "appear"
2329
- } = e, [m, b] = B(window.innerWidth), y = E(
2280
+ containerClassName: a = "",
2281
+ className: c = "",
2282
+ animationClass: l = "appear"
2283
+ } = e, m = D(
2330
2284
  (g) => {
2331
2285
  g.key === "Escape" && r && i();
2332
2286
  },
2333
2287
  [r, i]
2334
2288
  );
2335
- Z(() => (window.addEventListener("keydown", y), () => {
2336
- window.removeEventListener("keydown", y);
2337
- }), [y]);
2338
- const f = E(() => {
2339
- b(window.innerWidth);
2340
- }, []);
2341
- Z(() => (window.addEventListener("resize", f), () => {
2342
- window.removeEventListener("resize", f);
2343
- }), [f]);
2344
- const w = ke(() => Hs({ width: `${m}px` }), [m]), C = E(
2289
+ le(() => (window.addEventListener("keydown", m), () => {
2290
+ window.removeEventListener("keydown", m);
2291
+ }), [m]);
2292
+ const y = D(
2345
2293
  (g) => {
2346
- var L;
2347
- ((L = g == null ? void 0 : g.currentTarget) == null ? void 0 : L.getAttribute("name")) === t("_accessibility:buttons.closeDialog") && i();
2294
+ g.target === g.currentTarget && i();
2348
2295
  },
2349
- [t, i]
2296
+ [i]
2350
2297
  );
2351
- return Z(() => {
2352
- const g = (L) => {
2353
- L ? document.body.style.overflow = "hidden" : document.body.style.overflow = "auto";
2298
+ return le(() => {
2299
+ const g = (f) => {
2300
+ f ? document.body.style.overflow = "hidden" : document.body.style.overflow = "auto";
2354
2301
  };
2355
2302
  return g(r), () => {
2356
- g(r);
2303
+ g(!1);
2357
2304
  };
2358
- }, [r]), qt(
2305
+ }, [r]), Qt(
2359
2306
  /* @__PURE__ */ h(
2360
2307
  "div",
2361
2308
  {
2362
2309
  "aria-label": t("_accessibility:ariaLabels.closeDialog"),
2363
- "aria-disabled": !r,
2364
- onClick: C,
2365
- className: `dialog-backdrop animated ${r ? `opened ${d}` : "closed"} ${w} h-screen ${r ? "bg-base/20 backdrop-blur-xl" : "pointer-events-none"} ${c}`,
2310
+ "aria-hidden": !r,
2311
+ onClick: y,
2312
+ className: `dialog-backdrop animated ${r ? `opened ${l}` : "closed"} ${a}`,
2366
2313
  children: /* @__PURE__ */ A(
2367
2314
  "div",
2368
2315
  {
2369
- className: `dialog elevated animated ${r ? `opened ${d}` : "closed"} ${a}`,
2316
+ className: `dialog elevated animated ${r ? `opened ${l}` : "closed"} ${c}`,
2370
2317
  children: [
2371
2318
  /* @__PURE__ */ A("div", { className: "dialog-header", children: [
2372
- /* @__PURE__ */ h("h3", { className: "text-text text-xl", children: s }),
2319
+ /* @__PURE__ */ h("h3", { className: "dialog-title", children: s }),
2373
2320
  /* @__PURE__ */ h(
2374
- be,
2321
+ pe,
2375
2322
  {
2376
- icon: Rt,
2323
+ icon: Ht,
2377
2324
  disabled: !r,
2378
2325
  "aria-disabled": !r,
2379
2326
  onClick: i,
2380
- className: "icon-button text-red-400",
2327
+ className: "icon-button dialog-close-btn",
2381
2328
  name: t("_accessibility:buttons.closeDialog"),
2382
2329
  "aria-label": t("_accessibility:ariaLabels.closeDialog")
2383
2330
  }
@@ -2391,54 +2338,54 @@ const bn = () => {
2391
2338
  ),
2392
2339
  document.body
2393
2340
  );
2394
- }, ut = (e) => {
2341
+ }, ft = (e) => {
2395
2342
  const {
2396
2343
  primaryText: t,
2397
2344
  cancelText: s,
2398
2345
  onPrimaryClick: n,
2399
2346
  onCancel: i,
2400
2347
  isLoading: r = !1,
2401
- disabled: c = !1,
2402
- primaryType: a = "submit",
2403
- containerClassName: d = "",
2348
+ disabled: a = !1,
2349
+ primaryType: c = "submit",
2350
+ containerClassName: l = "",
2404
2351
  primaryClassName: m = "",
2405
- alignEnd: b = !1,
2406
- primaryName: y,
2352
+ alignEnd: y = !1,
2353
+ primaryName: g,
2407
2354
  primaryAriaLabel: f,
2408
- cancelName: w,
2409
- cancelAriaLabel: C
2355
+ cancelName: p,
2356
+ cancelAriaLabel: _
2410
2357
  } = e;
2411
2358
  return /* @__PURE__ */ A(
2412
2359
  "div",
2413
2360
  {
2414
- className: `flex gap-2 mt-2 ${b ? "justify-end" : ""} ${d}`,
2361
+ className: `dialog-actions ${y ? "end" : ""} ${l}`,
2415
2362
  children: [
2416
2363
  /* @__PURE__ */ A(
2417
- xe,
2364
+ _e,
2418
2365
  {
2419
- type: a,
2366
+ type: c,
2420
2367
  color: "primary",
2421
2368
  variant: "submit",
2422
2369
  className: m,
2423
- disabled: c,
2424
- onClick: a === "button" ? n : void 0,
2425
- name: y,
2370
+ disabled: a,
2371
+ onClick: n,
2372
+ name: g,
2426
2373
  "aria-label": f,
2427
2374
  children: [
2428
- r ? /* @__PURE__ */ h(Ve, { color: "stroke-base", loaderClass: "!w-6 mt-1", strokeWidth: "6" }) : null,
2375
+ r ? /* @__PURE__ */ h(xe, { color: "stroke-base", loaderClass: "!w-6 mt-1", strokeWidth: "6" }) : null,
2429
2376
  t
2430
2377
  ]
2431
2378
  }
2432
2379
  ),
2433
2380
  /* @__PURE__ */ h(
2434
- xe,
2381
+ _e,
2435
2382
  {
2436
2383
  type: "button",
2437
2384
  variant: "outlined",
2438
- disabled: c,
2385
+ disabled: a,
2439
2386
  onClick: i,
2440
- name: w,
2441
- "aria-label": C,
2387
+ name: p,
2388
+ "aria-label": _,
2442
2389
  children: s
2443
2390
  }
2444
2391
  )
@@ -2446,28 +2393,28 @@ const bn = () => {
2446
2393
  }
2447
2394
  );
2448
2395
  }, xn = (e) => {
2449
- const { t } = T(), {
2396
+ const { t } = L(), {
2450
2397
  children: s,
2451
2398
  handleSubmit: n,
2452
2399
  onSubmit: i,
2453
2400
  handleClose: r,
2454
- isLoading: c = !1,
2455
- buttonEnd: a = !0,
2456
- ...d
2401
+ isLoading: a = !1,
2402
+ buttonEnd: c = !0,
2403
+ ...l
2457
2404
  } = e;
2458
- return /* @__PURE__ */ h(lt, { ...d, handleClose: r, children: /* @__PURE__ */ A("form", { onSubmit: n(i), children: [
2405
+ return /* @__PURE__ */ h(dt, { ...l, handleClose: r, children: /* @__PURE__ */ A("form", { onSubmit: n(i), children: [
2459
2406
  /* @__PURE__ */ h("div", { className: "form-container", children: s }),
2460
2407
  /* @__PURE__ */ h(
2461
- ut,
2408
+ ft,
2462
2409
  {
2463
2410
  primaryType: "submit",
2464
2411
  primaryText: t("_accessibility:buttons.submit"),
2465
2412
  cancelText: t("_accessibility:buttons.cancel"),
2466
2413
  onCancel: r,
2467
- isLoading: c,
2468
- disabled: c,
2469
- primaryClassName: "!px-6",
2470
- alignEnd: a,
2414
+ isLoading: a,
2415
+ disabled: a,
2416
+ primaryClassName: "dialog-form-primary",
2417
+ alignEnd: c,
2471
2418
  primaryName: t("_accessibility:buttons.submit"),
2472
2419
  primaryAriaLabel: t("_accessibility:ariaLabels.submit"),
2473
2420
  cancelName: t("_accessibility:buttons.cancel"),
@@ -2475,18 +2422,18 @@ const bn = () => {
2475
2422
  }
2476
2423
  )
2477
2424
  ] }) });
2478
- }, _n = (e) => {
2479
- const { t } = T(), {
2425
+ }, Tn = (e) => {
2426
+ const { t } = L(), {
2480
2427
  children: s,
2481
2428
  handleSubmit: n,
2482
2429
  handleClose: i,
2483
2430
  isLoading: r = !1,
2484
- ...c
2431
+ ...a
2485
2432
  } = e;
2486
- return /* @__PURE__ */ A(lt, { ...c, handleClose: i, children: [
2433
+ return /* @__PURE__ */ A(dt, { ...a, handleClose: i, children: [
2487
2434
  s,
2488
2435
  /* @__PURE__ */ h(
2489
- ut,
2436
+ ft,
2490
2437
  {
2491
2438
  primaryText: t("_accessibility:buttons.ok"),
2492
2439
  cancelText: t("_accessibility:buttons.cancel"),
@@ -2504,105 +2451,120 @@ const bn = () => {
2504
2451
  )
2505
2452
  ] });
2506
2453
  };
2507
- function Lr(e) {
2508
- const { message: t, className: s = "" } = e, { t: n } = T();
2509
- return t ? /* @__PURE__ */ h("p", { className: `text-red-600 text-sm mt-2 ${s}`, children: t || n("_messages:errors.parseFile", { defaultValue: "Failed to process file" }) }) : null;
2454
+ function Ir(e) {
2455
+ const { message: t, className: s = "" } = e, { t: n } = L();
2456
+ return /* @__PURE__ */ h("p", { className: `import-error-message ${s}`, children: t ?? n("_messages:errors.parseFile", {
2457
+ defaultValue: "Failed to process file"
2458
+ }) });
2510
2459
  }
2511
- function Tr(e) {
2512
- const { message: t, className: s = "" } = e, { t: n } = T();
2513
- return /* @__PURE__ */ A(
2514
- "div",
2515
- {
2516
- className: `my-4 mx-auto flex items-center gap-3 text-sm text-gray-600 ${s}`,
2517
- children: [
2518
- /* @__PURE__ */ h(Ve, { loaderClass: "w-5 h-5", className: "!w-auto" }),
2519
- /* @__PURE__ */ h("span", { children: t ?? n("_messages:loading.processingFile", {
2520
- defaultValue: "Processing file..."
2521
- }) })
2522
- ]
2523
- }
2524
- );
2460
+ function Pr(e) {
2461
+ const { message: t, className: s = "" } = e, { t: n } = L();
2462
+ return /* @__PURE__ */ A("div", { className: `import-loading ${s}`, children: [
2463
+ /* @__PURE__ */ h(xe, { loaderClass: "w-5 h-5", className: "!w-auto" }),
2464
+ /* @__PURE__ */ h("span", { children: t ?? n("_messages:loading.processingFile", {
2465
+ defaultValue: "Processing file..."
2466
+ }) })
2467
+ ] });
2525
2468
  }
2526
- function Dr(e) {
2527
- const { items: t, max: s = 5, className: n = "" } = e, { t: i } = T();
2469
+ function Or(e) {
2470
+ const { items: t, max: s = 5, className: n = "" } = e, { t: i } = L();
2528
2471
  if (!t || t.length === 0) return null;
2529
2472
  const r = t.slice(0, s);
2530
- return /* @__PURE__ */ A("div", { className: `mt-4 ${n}`, children: [
2531
- /* @__PURE__ */ h("p", { className: "text-sm text-gray-600", children: i("_pages:common.actions.import.previewCount", {
2473
+ return /* @__PURE__ */ A("div", { className: `import-preview ${n}`, children: [
2474
+ /* @__PURE__ */ h("p", { className: "import-preview-count", children: i("_pages:common.actions.import.previewCount", {
2532
2475
  count: t.length,
2533
2476
  defaultValue: `Preview: ${t.length} items`
2534
2477
  }) }),
2535
- /* @__PURE__ */ h("pre", { className: "mt-2 max-h-56 overflow-auto rounded bg-gray-100 p-3 text-xs", children: JSON.stringify(r, null, 2) })
2478
+ /* @__PURE__ */ h("pre", { className: "import-preview-content", children: JSON.stringify(r, null, 2) })
2536
2479
  ] });
2537
2480
  }
2538
- const Cn = (e) => {
2539
- const { t } = T(), [s, n] = B(null), [i, r] = B(null), [c, a] = B(null), [d, m] = B(!1), [b, y] = B(!1), {
2540
- children: f,
2541
- handleSubmit: w,
2542
- handleClose: C,
2543
- isLoading: g = !1,
2544
- fileProcessor: L,
2545
- onFileProcessed: G,
2546
- onOverrideChange: k,
2547
- open: H,
2548
- ...V
2549
- } = e, [F, J] = B(0), P = Be(G), le = Be(L);
2550
- Z(() => {
2551
- P.current = G;
2552
- }, [G]), Z(() => {
2553
- le.current = L;
2554
- }, [L]), Z(() => {
2555
- H || (n(null), r(null), a(null), m(!1), y(!1), J((U) => U + 1));
2556
- }, [H]);
2557
- const j = E(async () => {
2558
- var U;
2559
- if (le.current && s) {
2560
- m(!0);
2481
+ const fs = () => ({
2482
+ file: null,
2483
+ previewItems: null,
2484
+ parseError: null,
2485
+ processing: !1,
2486
+ overrideExisting: !1,
2487
+ inputKey: 0
2488
+ });
2489
+ function Mr(e, t) {
2490
+ switch (t.type) {
2491
+ case "SET_FILE":
2492
+ return { ...e, file: t.file, previewItems: null, parseError: null, processing: !1 };
2493
+ case "START_PROCESSING":
2494
+ return { ...e, processing: !0 };
2495
+ case "SET_PREVIEW":
2496
+ return { ...e, previewItems: t.items, parseError: null, processing: !1 };
2497
+ case "SET_ERROR":
2498
+ return { ...e, previewItems: null, parseError: t.message, processing: !1 };
2499
+ case "SET_OVERRIDE":
2500
+ return { ...e, overrideExisting: t.value };
2501
+ case "RESET":
2502
+ return { ...fs(), inputKey: e.inputKey + 1 };
2503
+ }
2504
+ }
2505
+ const Fn = (e) => {
2506
+ const { t } = L(), {
2507
+ children: s,
2508
+ handleSubmit: n,
2509
+ handleClose: i,
2510
+ isLoading: r = !1,
2511
+ fileProcessor: a,
2512
+ onFileProcessed: c,
2513
+ onOverrideChange: l,
2514
+ open: m,
2515
+ ...y
2516
+ } = e, [g, f] = Rt(Mr, fs()), { file: p, previewItems: _, parseError: C, processing: N, overrideExisting: j, inputKey: k } = g, V = Ie(c), F = Ie(a);
2517
+ le(() => {
2518
+ V.current = c;
2519
+ }, [c]), le(() => {
2520
+ F.current = a;
2521
+ }, [a]), le(() => {
2522
+ m || f({ type: "RESET" });
2523
+ }, [m]);
2524
+ const x = D(async (M, O) => {
2525
+ var se;
2526
+ if (F.current) {
2527
+ f({ type: "START_PROCESSING" });
2561
2528
  try {
2562
- const O = await le.current(s, {
2563
- override: b
2564
- });
2565
- r(O ?? []), a(null), (U = P.current) == null || U.call(P, O ?? []);
2566
- } catch (O) {
2567
- console.error(O), r(null);
2568
- const N = O instanceof Error ? O.message : "Failed to parse file";
2569
- a(N);
2529
+ const I = await F.current(M, { override: O });
2530
+ f({ type: "SET_PREVIEW", items: I ?? [] }), (se = V.current) == null || se.call(V, I ?? []);
2531
+ } catch (I) {
2532
+ console.error(I);
2533
+ const re = I instanceof Error ? I.message : "Failed to parse file";
2534
+ f({ type: "SET_ERROR", message: re });
2570
2535
  }
2571
- m(!1);
2572
2536
  }
2573
- }, [s, b]);
2574
- return Z(() => {
2575
- j();
2576
- }, [j]), /* @__PURE__ */ A(lt, { ...V, open: H, handleClose: C, children: [
2537
+ }, []);
2538
+ return /* @__PURE__ */ A(dt, { ...y, open: m, handleClose: i, children: [
2577
2539
  /* @__PURE__ */ h(
2578
- ks,
2540
+ $s,
2579
2541
  {
2580
2542
  onClear: () => {
2581
- var U;
2582
- n(null), r(null), a(null), m(!1), (U = P.current) == null || U.call(P, []);
2543
+ var M;
2544
+ f({ type: "SET_FILE", file: null }), (M = V.current) == null || M.call(V, []);
2583
2545
  },
2584
- onChange: (U) => {
2585
- var N, $;
2586
- const O = (N = U.target.files) == null ? void 0 : N[0];
2546
+ onChange: (M) => {
2547
+ var se, I;
2548
+ const O = (se = M.target.files) == null ? void 0 : se[0];
2587
2549
  if (!O) {
2588
- n(null), r(null), a(null), m(!1), ($ = P.current) == null || $.call(P, []);
2550
+ f({ type: "SET_FILE", file: null }), (I = V.current) == null || I.call(V, []);
2589
2551
  return;
2590
2552
  }
2591
- n(O);
2553
+ f({ type: "SET_FILE", file: O }), x(O, j);
2592
2554
  },
2593
2555
  label: t("_accessibility:labels.file")
2594
2556
  },
2595
- F
2557
+ k
2596
2558
  ),
2597
- /* @__PURE__ */ A("label", { className: "mt-3 flex items-center gap-2 text-sm", children: [
2559
+ /* @__PURE__ */ A("label", { className: "import-override-label", children: [
2598
2560
  /* @__PURE__ */ h(
2599
2561
  "input",
2600
2562
  {
2601
2563
  type: "checkbox",
2602
- checked: b,
2603
- onChange: (U) => {
2604
- const O = U.target.checked;
2605
- y(O), k == null || k(O);
2564
+ checked: j,
2565
+ onChange: (M) => {
2566
+ const O = M.target.checked;
2567
+ f({ type: "SET_OVERRIDE", value: O }), l == null || l(O), p && x(p, O);
2606
2568
  }
2607
2569
  }
2608
2570
  ),
@@ -2610,22 +2572,22 @@ const Cn = (e) => {
2610
2572
  defaultValue: "Override existing items"
2611
2573
  }) })
2612
2574
  ] }),
2613
- /* @__PURE__ */ h(Lr, { message: c ?? void 0 }),
2614
- d && /* @__PURE__ */ h(Tr, {}),
2615
- !!i && i.length > 0 && /* @__PURE__ */ h(Dr, { items: i }),
2616
- f,
2575
+ /* @__PURE__ */ h(Ir, { message: C }),
2576
+ N && /* @__PURE__ */ h(Pr, {}),
2577
+ !!_ && _.length > 0 && /* @__PURE__ */ h(Or, { items: _ }),
2578
+ s,
2617
2579
  /* @__PURE__ */ h(
2618
- ut,
2580
+ ft,
2619
2581
  {
2620
2582
  primaryText: t("_accessibility:buttons.ok"),
2621
2583
  cancelText: t("_accessibility:buttons.cancel"),
2622
2584
  onPrimaryClick: () => {
2623
- (!L || !!i && i.length > 0) && w();
2585
+ (!a || !!_ && _.length > 0) && n();
2624
2586
  },
2625
- onCancel: C,
2626
- isLoading: g,
2587
+ onCancel: i,
2588
+ isLoading: r,
2627
2589
  primaryType: "button",
2628
- containerClassName: "mt-5",
2590
+ containerClassName: "import-dialog-actions",
2629
2591
  primaryName: t("_accessibility:buttons.ok"),
2630
2592
  primaryAriaLabel: t("_accessibility:ariaLabels.ok"),
2631
2593
  cancelName: t("_accessibility:buttons.cancel"),
@@ -2634,63 +2596,67 @@ const Cn = (e) => {
2634
2596
  )
2635
2597
  ] });
2636
2598
  };
2637
- function Sn(e) {
2638
- const { t } = T(), { open: s, onClose: n, menuMap: i, logo: r } = e, { account: c } = Jt(), { dynamicItems: a } = sr(), { linkComponent: d } = ze(), m = d, b = ke(() => i.filter((g) => {
2639
- const L = g.auth, G = !!(c != null && c.email);
2640
- return L == null || L && G || !L && !G;
2641
- }), [c == null ? void 0 : c.email, i]), y = E(
2642
- (g) => {
2643
- g.key === "Escape" && s && n();
2599
+ function $n(e) {
2600
+ const { t } = L(), { open: s, onClose: n, menuMap: i, logo: r } = e, { account: a } = Zt(), { dynamicItems: c } = ar(), { linkComponent: l, location: m } = Re(), y = l, g = Ae(() => i.filter((N) => {
2601
+ const j = N.auth, k = !!(a != null && a.email);
2602
+ return j == null || j && k || !j && !k;
2603
+ }), [a == null ? void 0 : a.email, i]), f = D(
2604
+ (N) => {
2605
+ N.key === "Escape" && s && n();
2644
2606
  },
2645
2607
  [n, s]
2646
2608
  );
2647
- Z(() => (document.addEventListener("keydown", y), () => {
2648
- document.removeEventListener("keydown", y);
2649
- }), [y]);
2650
- const f = E(
2651
- (g, L) => L ? g === `${location.pathname}${location.search}` : g === location.pathname,
2652
- []
2653
- ), w = E(
2654
- (g) => /* @__PURE__ */ h(
2609
+ le(() => (document.addEventListener("keydown", f), () => {
2610
+ document.removeEventListener("keydown", f);
2611
+ }), [f]);
2612
+ const p = D(
2613
+ (N, j) => j ? N === `${m.pathname}${m.search}` : N === m.pathname,
2614
+ [m.pathname, m.search]
2615
+ ), _ = D(
2616
+ (N) => /* @__PURE__ */ h(
2655
2617
  "li",
2656
2618
  {
2657
- className: `drawer-list-item-child ${f(g.path, !0) ? "active" : ""} animated`,
2658
- children: g.path ? /* @__PURE__ */ h(
2659
- m,
2619
+ className: `drawer-list-item-child ${p(N.path, !0) ? "active" : ""} animated`,
2620
+ children: N.path ? /* @__PURE__ */ h(
2621
+ y,
2660
2622
  {
2661
- "aria-disabled": !s,
2662
- to: g.path ?? "/",
2663
- "aria-label": t(`_accessibility:ariaLabels.${g.path}`),
2623
+ tabIndex: s ? 0 : -1,
2624
+ to: N.path ?? "/",
2625
+ "aria-label": t(`_accessibility:ariaLabels.${N.id}`, {
2626
+ defaultValue: N.label
2627
+ }),
2664
2628
  className: "drawer-link",
2665
- children: g.label
2629
+ children: N.label
2666
2630
  }
2667
- ) : g.label
2631
+ ) : N.label
2668
2632
  },
2669
- g.id
2633
+ N.id
2670
2634
  ),
2671
- [m, s, t, f]
2672
- ), C = ke(() => b.map((g, L) => {
2673
- const G = g.page ?? String(L), k = `drawer-list-item ${f(g.path) ? "active" : ""} animated`;
2674
- if (g.type === "divider")
2675
- return /* @__PURE__ */ h("li", { className: k, children: /* @__PURE__ */ h("hr", { className: "drawer-divider" }) }, G);
2676
- const H = g.children ?? (g.page && a ? a[g.page] : null);
2677
- return /* @__PURE__ */ A("li", { className: k, children: [
2635
+ [y, s, t, p]
2636
+ ), C = Ae(() => g.map((N, j) => {
2637
+ const k = N.page ?? String(j), V = `drawer-list-item ${p(N.path) ? "active" : ""} animated`;
2638
+ if (N.type === "divider")
2639
+ return /* @__PURE__ */ h("li", { className: V, children: /* @__PURE__ */ h("hr", { className: "drawer-divider" }) }, k);
2640
+ const F = N.children ?? (N.page && c ? c[N.page] : null);
2641
+ return /* @__PURE__ */ A("li", { className: V, children: [
2678
2642
  /* @__PURE__ */ A(
2679
- m,
2643
+ y,
2680
2644
  {
2681
- "aria-disabled": !s,
2682
- to: g.path ?? "/",
2683
- "aria-label": t(`_accessibility:ariaLabels.${g.path}`),
2645
+ tabIndex: s ? 0 : -1,
2646
+ to: N.path ?? "/",
2647
+ "aria-label": t(`_accessibility:ariaLabels.${String(N.page)}`, {
2648
+ defaultValue: t(`_pages:${String(N.page)}.title`)
2649
+ }),
2684
2650
  className: "drawer-link",
2685
2651
  children: [
2686
- g.icon,
2687
- t(`_pages:${g.page}.title`)
2652
+ N.icon,
2653
+ t(`_pages:${N.page}.title`)
2688
2654
  ]
2689
2655
  }
2690
2656
  ),
2691
- H && /* @__PURE__ */ h("ul", { className: "drawer-children-list", children: H.map(w) })
2692
- ] }, G);
2693
- }), [m, a, f, s, b, w, t]);
2657
+ F && /* @__PURE__ */ h("ul", { className: "drawer-children-list", children: F.map(_) })
2658
+ ] }, k);
2659
+ }), [y, c, p, s, g, _, t]);
2694
2660
  return /* @__PURE__ */ h(
2695
2661
  "div",
2696
2662
  {
@@ -2703,26 +2669,27 @@ function Sn(e) {
2703
2669
  r,
2704
2670
  /* @__PURE__ */ h("h2", { className: "drawer-header poppins", children: t("_pages:home.appName") })
2705
2671
  ] }),
2706
- /* @__PURE__ */ h("ul", { className: "flex flex-col", children: C })
2672
+ /* @__PURE__ */ h("ul", { className: "drawer-menu-list", children: C })
2707
2673
  ] })
2708
2674
  }
2709
2675
  );
2710
2676
  }
2711
- function kn(e) {
2712
- const { error: t } = e, { t: s } = T();
2713
- return /* @__PURE__ */ A("div", { className: "flex flex-col items-center justify-center pt-10 gap-5", children: [
2714
- /* @__PURE__ */ h(ce, { icon: Ws, className: "text-red-300 text-4xl" }),
2715
- /* @__PURE__ */ h("p", { className: "text-text text-center", children: (t == null ? void 0 : t.message) ?? s("_accessibility:errors.unknownError") })
2677
+ function Ln(e) {
2678
+ const { error: t, resetErrorBoundary: s } = e, { t: n } = L();
2679
+ return /* @__PURE__ */ A("div", { className: "error-container", children: [
2680
+ /* @__PURE__ */ h(ce, { icon: Xs, className: "error-icon" }),
2681
+ /* @__PURE__ */ h("p", { className: "error-message", children: (t == null ? void 0 : t.message) ?? n("_accessibility:errors.unknownError") }),
2682
+ s && /* @__PURE__ */ h("button", { className: "error-retry", onClick: s, children: n("_accessibility:actions.retry", { defaultValue: "Retry" }) })
2716
2683
  ] });
2717
2684
  }
2718
- const Vr = (e) => {
2719
- const { showBackButton: t, title: s, actions: n } = e, { t: i } = T(), { navigate: r } = ze();
2685
+ const Rr = (e) => {
2686
+ const { showBackButton: t, title: s, actions: n } = e, { t: i } = L(), { navigate: r } = Re();
2720
2687
  return /* @__PURE__ */ A("div", { className: "page-header", children: [
2721
2688
  /* @__PURE__ */ A("div", { className: "page-header-left", children: [
2722
2689
  t && /* @__PURE__ */ h(
2723
- be,
2690
+ pe,
2724
2691
  {
2725
- icon: Is,
2692
+ icon: Hs,
2726
2693
  onClick: () => r(-1),
2727
2694
  name: i("_accessibility:buttons.back"),
2728
2695
  "data-tooltip-id": "tooltip",
@@ -2732,276 +2699,293 @@ const Vr = (e) => {
2732
2699
  /* @__PURE__ */ h("h2", { className: "page-header-title", children: s })
2733
2700
  ] }),
2734
2701
  /* @__PURE__ */ A("div", { children: [
2735
- /* @__PURE__ */ h(Ht, { className: "max-xs:!hidden", actions: n ?? [] }),
2736
- /* @__PURE__ */ h(Fr, { className: "min-xs:hidden", actions: n ?? [] })
2702
+ /* @__PURE__ */ h(jt, { className: "page-header-actions-desktop", actions: n ?? [] }),
2703
+ /* @__PURE__ */ h(Vr, { className: "page-header-actions-mobile", actions: n ?? [] })
2737
2704
  ] })
2738
2705
  ] });
2739
- }, Nn = (e) => {
2706
+ }, Dn = (e) => {
2740
2707
  const {
2741
2708
  title: t,
2742
2709
  children: s,
2743
2710
  addOptions: n,
2744
2711
  filterOptions: i,
2745
2712
  actions: r,
2746
- queryKey: c,
2747
- isLoading: a = !1,
2748
- isAnimated: d = !0,
2713
+ queryKey: a,
2714
+ isLoading: c = !1,
2715
+ isAnimated: l = !0,
2749
2716
  showBackButton: m = !1
2750
- } = e, { t: b } = T(), { countOfFilters: y } = Ns(), f = ke(() => {
2751
- const w = Array.isArray(r) ? [...r] : [];
2752
- if (c) {
2753
- const C = {
2754
- id: _e.Refresh,
2755
- onClick: () => pe.invalidateQueries({ queryKey: c }),
2756
- icon: /* @__PURE__ */ h(ce, { icon: Ot }),
2757
- tooltip: b("_pages:common.actions.refresh.text")
2717
+ } = e, { t: y } = L(), { countOfFilters: g } = Ls(), f = Ae(() => {
2718
+ const p = Array.isArray(r) ? [...r] : [];
2719
+ if (a) {
2720
+ const _ = {
2721
+ id: Se.Refresh,
2722
+ onClick: () => be.invalidateQueries({ queryKey: a }),
2723
+ icon: /* @__PURE__ */ h(ce, { icon: qt }),
2724
+ tooltip: y("_pages:common.actions.refresh.text")
2758
2725
  };
2759
- w.unshift(C);
2726
+ p.unshift(_);
2760
2727
  }
2761
2728
  if (n) {
2762
- const C = {
2729
+ const _ = {
2763
2730
  ...n,
2764
- id: _e.Add,
2765
- icon: /* @__PURE__ */ h(ce, { icon: vt })
2731
+ id: Se.Add,
2732
+ icon: /* @__PURE__ */ h(ce, { icon: St })
2766
2733
  };
2767
- w.unshift(C);
2734
+ p.unshift(_);
2768
2735
  }
2769
2736
  if (i) {
2770
- const C = {
2737
+ const _ = {
2771
2738
  ...i,
2772
2739
  id: "filter",
2773
- icon: /* @__PURE__ */ h(ce, { icon: Os }),
2740
+ icon: /* @__PURE__ */ h(ce, { icon: Qs }),
2774
2741
  children: /* @__PURE__ */ h(
2775
- As,
2742
+ Ds,
2776
2743
  {
2777
- className: `${y > 0 ? "show" : "hide"} `,
2778
- count: y
2744
+ className: `${g > 0 ? "show" : "hide"} `,
2745
+ count: g
2779
2746
  }
2780
2747
  )
2781
2748
  };
2782
- w.push(C);
2749
+ p.push(_);
2783
2750
  }
2784
- return w;
2785
- }, [r, n, y, i, c, b]);
2751
+ return p;
2752
+ }, [r, n, g, i, a, y]);
2786
2753
  return /* @__PURE__ */ A("main", { className: "page-main", children: [
2787
2754
  /* @__PURE__ */ h(
2788
- Vr,
2755
+ Rr,
2789
2756
  {
2790
2757
  showBackButton: m,
2791
2758
  actions: f,
2792
2759
  title: t
2793
2760
  }
2794
2761
  ),
2795
- /* @__PURE__ */ h("div", { className: `page-main-content ${d ? "appear" : ""}`, children: a ? /* @__PURE__ */ h(Ve, { className: "page-loading" }) : s }),
2762
+ /* @__PURE__ */ h("div", { className: `page-main-content ${l ? "appear" : ""}`, children: c ? /* @__PURE__ */ h(xe, { className: "page-loading" }) : s }),
2796
2763
  n && /* @__PURE__ */ h(
2797
- be,
2764
+ pe,
2798
2765
  {
2799
- icon: n.icon ?? vt,
2766
+ icon: n.icon ?? St,
2800
2767
  color: n.color ?? "primary",
2801
2768
  variant: n.variant ?? "submit",
2802
2769
  onClick: () => {
2803
- var w;
2804
- return (w = n.onClick) == null ? void 0 : w.call(n);
2770
+ var p;
2771
+ return (p = n.onClick) == null ? void 0 : p.call(n);
2805
2772
  },
2806
- className: `button fab min-xs:!hidden ${n.className ?? ""}`
2773
+ className: `button fab ${n.className ?? ""}`
2807
2774
  }
2808
2775
  )
2809
2776
  ] });
2810
- }, An = (e) => {
2811
- const { t } = T(), {
2777
+ }, Vn = (e) => {
2778
+ const { t } = L(), {
2812
2779
  className: s = "",
2813
2780
  itemClassName: n = "",
2814
2781
  loading: i = !1,
2815
2782
  emptyComponent: r = null,
2816
- emptyMessage: c = t("_accessibility:messages.empty"),
2817
- renderComponent: a,
2818
- data: d = []
2783
+ emptyMessage: a = t("_accessibility:messages.empty"),
2784
+ renderComponent: c,
2785
+ data: l = []
2819
2786
  } = e;
2820
- return /* @__PURE__ */ h(De, { children: d != null && d.length ? /* @__PURE__ */ h("ul", { className: `pretty-grid-main ${s}`, children: d == null ? void 0 : d.map((m) => /* @__PURE__ */ h("li", { className: `pretty-grid-item ${n}`, children: a(m) }, m.id)) }) : /* @__PURE__ */ h(De, { children: r || /* @__PURE__ */ h(Ur, { message: c }) }) });
2821
- }, Pr = () => {
2822
- const [e, t] = B(St());
2823
- return Z(() => {
2787
+ return i ? /* @__PURE__ */ h(xe, {}) : /* @__PURE__ */ h(Ve, { children: l != null && l.length ? /* @__PURE__ */ h("ul", { className: `pretty-grid-main ${s}`, children: l == null ? void 0 : l.map((m) => /* @__PURE__ */ h("li", { className: `pretty-grid-item ${n}`, children: c(m) }, m.id)) }) : /* @__PURE__ */ h(Ve, { children: r || /* @__PURE__ */ h(Wr, { message: a }) }) });
2788
+ }, Ur = () => {
2789
+ const [e, t] = Y(kt());
2790
+ return le(() => {
2824
2791
  const s = window.matchMedia("(min-width: 768px)"), n = () => {
2825
2792
  t(
2826
- s.matches ? St() : Zs()
2793
+ s.matches ? kt() : rr()
2827
2794
  );
2828
2795
  }, i = setInterval(n, 1e3);
2829
2796
  return s.addEventListener("change", n), () => {
2830
2797
  clearInterval(i), s.removeEventListener("change", n);
2831
2798
  };
2832
- }, []), /* @__PURE__ */ h("p", { className: "capitalize max-xs:hidden", children: e });
2799
+ }, []), /* @__PURE__ */ h("p", { className: "clock", children: e });
2833
2800
  };
2834
- function En(e) {
2835
- const { t } = T(), {
2801
+ function In(e) {
2802
+ const { t } = L(), {
2836
2803
  openDrawer: s,
2837
2804
  showClock: n = !0,
2838
2805
  showSearch: i = !0,
2839
2806
  menuButtonProps: r
2840
- } = e, c = {
2841
- ...r,
2842
- type: (r == null ? void 0 : r.type) ?? "button",
2843
- icon: (r == null ? void 0 : r.icon) ?? Us,
2844
- onClick: (f) => {
2845
- var w;
2846
- (w = r == null ? void 0 : r.onClick) == null || w.call(r, f), s();
2847
- },
2848
- name: (r == null ? void 0 : r.name) ?? t("_accessibility:buttons.openMenu"),
2849
- "aria-label": (r == null ? void 0 : r["aria-label"]) ?? t("_accessibility:ariaLabels.openMenu"),
2850
- className: `navbar-menu animated ${(r == null ? void 0 : r.className) ?? ""}`
2851
- }, { searchComponent: a } = ze(), [d, m] = B(!1), b = E((f) => {
2852
- (er() ? f.metaKey : f.ctrlKey) && f.shiftKey && f.key.toLowerCase() === "f" && (m(!0), f.preventDefault());
2807
+ } = e, { searchComponent: a, location: c } = Re(), [l, m] = Y(!1), y = D((f) => {
2808
+ (nr() ? f.metaKey : f.ctrlKey) && f.shiftKey && f.key.toLowerCase() === "f" && (m(!0), f.preventDefault());
2853
2809
  }, []);
2854
- Z(() => (window.addEventListener("keydown", b), () => {
2855
- window.removeEventListener("keydown", b);
2856
- }), [b]);
2857
- const y = a;
2858
- return /* @__PURE__ */ A(De, { children: [
2859
- location.pathname !== "/" && !!y && /* @__PURE__ */ h(y, { open: d, onClose: () => m(!1) }),
2810
+ le(() => (window.addEventListener("keydown", y), () => {
2811
+ window.removeEventListener("keydown", y);
2812
+ }), [y]);
2813
+ const g = a;
2814
+ return /* @__PURE__ */ A(Ve, { children: [
2815
+ c.pathname !== "/" && !!g && /* @__PURE__ */ h(g, { open: l, onClose: () => m(!1) }),
2860
2816
  /* @__PURE__ */ A("header", { id: "header", className: "header", children: [
2861
2817
  /* @__PURE__ */ A("div", { className: "navbar-left", children: [
2862
- /* @__PURE__ */ h(be, { ...c }),
2818
+ /* @__PURE__ */ h(
2819
+ pe,
2820
+ {
2821
+ ...r,
2822
+ type: (r == null ? void 0 : r.type) ?? "button",
2823
+ icon: (r == null ? void 0 : r.icon) ?? Ks,
2824
+ onClick: (f) => {
2825
+ var p;
2826
+ (p = r == null ? void 0 : r.onClick) == null || p.call(r, f), s();
2827
+ },
2828
+ name: (r == null ? void 0 : r.name) ?? t("_accessibility:buttons.openMenu"),
2829
+ "aria-label": (r == null ? void 0 : r["aria-label"]) ?? t("_accessibility:ariaLabels.openMenu"),
2830
+ className: `navbar-menu animated ${(r == null ? void 0 : r.className) ?? ""}`
2831
+ }
2832
+ ),
2863
2833
  /* @__PURE__ */ h("h1", { className: "poppins navbar-title", children: t("_pages:home.appName") })
2864
2834
  ] }),
2865
2835
  /* @__PURE__ */ A("div", { className: "navbar-right", children: [
2866
2836
  i && /* @__PURE__ */ h(
2867
- be,
2837
+ pe,
2868
2838
  {
2869
- icon: Rs,
2870
- className: "min-md:!hidden",
2839
+ icon: js,
2840
+ className: "navbar-search-btn",
2871
2841
  onClick: () => m(!0)
2872
2842
  }
2873
2843
  ),
2874
- n && /* @__PURE__ */ h(Pr, {})
2844
+ n && /* @__PURE__ */ h(Ur, {})
2875
2845
  ] })
2876
2846
  ] })
2877
2847
  ] });
2878
2848
  }
2879
- function $n() {
2880
- const { t: e } = T(), { notification: t, removeNotification: s } = Ne(), [n, i] = B(/* @__PURE__ */ new Set()), r = E(
2881
- (y) => {
2882
- if (y === void 0) {
2883
- const f = new Set(t.map((w, C) => C));
2884
- i(f), window.setTimeout(() => s(), 300);
2885
- } else
2886
- i((f) => new Set(f).add(y)), window.setTimeout(() => s(y), 300);
2849
+ const He = 300, qr = (e) => e ?? J.error, Br = (e) => {
2850
+ switch (e) {
2851
+ case J.error:
2852
+ return Gs;
2853
+ default:
2854
+ return Ws;
2855
+ }
2856
+ }, nt = (e) => {
2857
+ switch (e) {
2858
+ case J.success:
2859
+ return "!text-success";
2860
+ case J.error:
2861
+ return "!text-error";
2862
+ case J.warning:
2863
+ return "!text-warning";
2864
+ default:
2865
+ return "!text-info";
2866
+ }
2867
+ }, Hr = (e) => {
2868
+ switch (e) {
2869
+ case J.success:
2870
+ return "bg-bg-success";
2871
+ case J.error:
2872
+ return "bg-bg-error";
2873
+ case J.warning:
2874
+ return "bg-bg-warning";
2875
+ default:
2876
+ return "bg-bg-info";
2877
+ }
2878
+ };
2879
+ function Pn() {
2880
+ const { t: e } = L(), { notification: t, removeNotification: s } = Ne(), [n, i] = Y([]), r = Ie(n);
2881
+ Vs(() => {
2882
+ r.current = n;
2883
+ });
2884
+ const a = Ie(null), c = D(
2885
+ (l) => {
2886
+ i(
2887
+ (m) => l !== void 0 ? m.map((y) => y.id === l ? { ...y, closing: !0 } : y) : m.map((y) => ({ ...y, closing: !0 }))
2888
+ ), l !== void 0 ? setTimeout(() => {
2889
+ s(l), i((m) => m.filter((y) => y.id !== l));
2890
+ }, He) : (a.current && clearTimeout(a.current), a.current = setTimeout(() => {
2891
+ s(), i([]), a.current = null;
2892
+ }, He));
2887
2893
  },
2888
- [t, s]
2889
- ), c = E((y) => {
2890
- switch (y) {
2891
- case Q.error:
2892
- return Bs;
2893
- default:
2894
- return qs;
2895
- }
2896
- }, []), a = E((y) => {
2897
- switch (y) {
2898
- case Q.success:
2899
- return "!text-success";
2900
- case Q.error:
2901
- return "!text-error";
2902
- case Q.warning:
2903
- return "!text-warning";
2904
- default:
2905
- return "!text-info";
2906
- }
2907
- }, []), d = E((y) => {
2908
- switch (y) {
2909
- case Q.success:
2910
- return "bg-bg-success";
2911
- case Q.error:
2912
- return "bg-bg-error";
2913
- case Q.warning:
2914
- return "bg-bg-warning";
2915
- default:
2916
- return "bg-bg-info";
2894
+ [s]
2895
+ );
2896
+ return le(() => {
2897
+ let l = null;
2898
+ const m = () => {
2899
+ l && clearTimeout(l), a.current && (clearTimeout(a.current), a.current = null);
2900
+ };
2901
+ if (t.length === 0)
2902
+ return r.current.length === 0 ? void 0 : (a.current && clearTimeout(a.current), l = setTimeout(() => {
2903
+ i((p) => p.map((_) => ({ ..._, closing: !0 }))), l = null;
2904
+ }, 0), a.current = setTimeout(() => {
2905
+ i([]), a.current = null;
2906
+ }, He), m);
2907
+ const y = new Set(r.current.map((p) => p.id));
2908
+ if (!t.some(
2909
+ (p) => p.id !== void 0 && !y.has(p.id)
2910
+ )) return;
2911
+ if (r.current.length === 0) {
2912
+ const p = [...t];
2913
+ return l = setTimeout(() => {
2914
+ i(p.map((_) => ({ ..._, closing: !1 }))), l = null;
2915
+ }, 0), () => {
2916
+ l && clearTimeout(l);
2917
+ };
2917
2918
  }
2918
- }, []), m = Be();
2919
- Z(() => {
2920
- m.current = () => r();
2921
- }, [r]), Z(() => {
2922
- if (!(t != null && t.length)) return;
2923
- const y = (f) => {
2924
- var w;
2925
- return (w = m.current) == null ? void 0 : w.call(m, f);
2919
+ a.current && clearTimeout(a.current), l = setTimeout(() => {
2920
+ i(
2921
+ (p) => p.every((_) => _.closing) ? p : p.map((_) => ({ ..._, closing: !0 }))
2922
+ ), l = null;
2923
+ }, 0);
2924
+ const f = [...t];
2925
+ return a.current = setTimeout(() => {
2926
+ i(f.map((p) => ({ ...p, closing: !1 }))), a.current = null;
2927
+ }, He), m;
2928
+ }, [t]), le(() => {
2929
+ if (!n.length) return;
2930
+ let l;
2931
+ const m = window.setTimeout(() => {
2932
+ l = () => c(), window.addEventListener("click", l);
2933
+ }, 0), y = (g) => {
2934
+ g.key === "Escape" && c();
2926
2935
  };
2927
- return window.addEventListener("click", y), () => {
2928
- window.removeEventListener("click", y);
2936
+ return window.addEventListener("keydown", y), () => {
2937
+ window.clearTimeout(m), l && window.removeEventListener("click", l), window.removeEventListener("keydown", y);
2929
2938
  };
2930
- }, [t == null ? void 0 : t.length]);
2931
- const b = E(
2932
- (y) => {
2933
- y.key === "Escape" && t.length && r();
2934
- },
2935
- [t, r]
2936
- );
2937
- return Z(() => (window.addEventListener("keydown", b), () => {
2938
- window.removeEventListener("keydown", b);
2939
- }), [b]), Z(() => {
2940
- i(/* @__PURE__ */ new Set());
2941
- }, [t]), qt(
2942
- /* @__PURE__ */ h(
2943
- "div",
2944
- {
2945
- className: `notification-portal ${t != null && t.length ? "w-screen h-screen" : ""}`,
2946
- children: t != null && t.length ? t == null ? void 0 : t.map(({ id: y, type: f, message: w }, C) => /* @__PURE__ */ A(
2947
- "div",
2948
- {
2949
- className: `notification ${n.has(C) ? "closing" : ""} ${d(
2950
- f ?? Q.error
2951
- )}`,
2952
- onClick: (g) => g.stopPropagation(),
2953
- children: [
2954
- /* @__PURE__ */ A("div", { className: "flex gap-3 items-center", children: [
2955
- /* @__PURE__ */ h(
2956
- ce,
2957
- {
2958
- icon: c(f ?? Q.error),
2959
- className: `${a(f ?? Q.error)}`
2960
- }
2961
- ),
2962
- /* @__PURE__ */ h(
2963
- "p",
2964
- {
2965
- className: `whitespace-nowrap ${a(
2966
- f ?? Q.error
2967
- )}`,
2968
- children: w
2969
- }
2970
- )
2971
- ] }),
2939
+ }, [n.length, c]), Qt(
2940
+ /* @__PURE__ */ h("div", { className: `notification-portal ${n.length ? "active" : ""}`, children: n.map(({ id: l, type: m, message: y, closing: g }) => {
2941
+ const f = qr(m);
2942
+ return /* @__PURE__ */ A(
2943
+ "div",
2944
+ {
2945
+ className: `notification ${g ? "closing" : ""} ${Hr(f)}`,
2946
+ onClick: (p) => p.stopPropagation(),
2947
+ children: [
2948
+ /* @__PURE__ */ A("div", { className: "notification-body", children: [
2972
2949
  /* @__PURE__ */ h(
2973
- be,
2950
+ ce,
2974
2951
  {
2975
- type: "button",
2976
- icon: Rt,
2977
- color: "error",
2978
- className: "group",
2979
- onClick: (g) => {
2980
- g.stopPropagation(), r(C);
2981
- },
2982
- iconClassName: `${a(
2983
- f ?? Q.error
2984
- )} group-hover:!text-red-400 cursor-pointer`,
2985
- name: e("_accessibility:buttons.closeNotification"),
2986
- "aria-label": e("_accessibility:ariaLabels.closeNotification")
2952
+ icon: Br(f),
2953
+ className: `notification-icon ${nt(f)}`
2987
2954
  }
2988
- )
2989
- ]
2990
- },
2991
- y
2992
- )) : null
2993
- }
2994
- ),
2955
+ ),
2956
+ /* @__PURE__ */ h("p", { className: `notification-text ${nt(f)}`, children: y })
2957
+ ] }),
2958
+ /* @__PURE__ */ h(
2959
+ pe,
2960
+ {
2961
+ type: "button",
2962
+ icon: Ht,
2963
+ color: "error",
2964
+ className: "notification-close group",
2965
+ onClick: (p) => {
2966
+ p.stopPropagation(), l !== void 0 && c(l);
2967
+ },
2968
+ iconClassName: `${nt(f)} notification-close-icon`,
2969
+ name: e("_accessibility:buttons.closeNotification"),
2970
+ "aria-label": e("_accessibility:ariaLabels.closeNotification")
2971
+ }
2972
+ )
2973
+ ]
2974
+ },
2975
+ l
2976
+ );
2977
+ }) }),
2995
2978
  document.body
2996
2979
  );
2997
2980
  }
2998
- function Fn() {
2999
- return /* @__PURE__ */ h("div", { className: "w-screen h-screen flex items-center justify-center overflow-hidden", children: /* @__PURE__ */ h(Ve, { className: "blur-appear" }) });
2981
+ function On(e) {
2982
+ const { className: t, ...s } = e;
2983
+ return /* @__PURE__ */ h("div", { className: "splash-screen", children: /* @__PURE__ */ h(xe, { className: `blur-appear ${t ? ` ${t}` : ""}`, ...s }) });
3000
2984
  }
3001
- const Mr = (e) => {
3002
- const { id: t, active: s, onClick: n, children: i, to: r } = e, { linkComponent: c } = ze();
2985
+ const Qr = (e) => {
2986
+ const { id: t, active: s, onClick: n, children: i, to: r } = e, { linkComponent: a } = Re();
3003
2987
  return /* @__PURE__ */ h(
3004
- c,
2988
+ a,
3005
2989
  {
3006
2990
  to: r ?? `#${t}`,
3007
2991
  onClick: () => n(),
@@ -3009,199 +2993,197 @@ const Mr = (e) => {
3009
2993
  children: i
3010
2994
  }
3011
2995
  );
3012
- }, Ir = (e) => {
3013
- var d;
2996
+ }, Kr = (e) => {
2997
+ var l;
3014
2998
  const {
3015
2999
  tabs: t = [],
3016
3000
  defaultTab: s,
3017
3001
  className: n = "",
3018
3002
  tabsContainerClassName: i = ""
3019
- } = e, [r, c] = B((d = t[0]) == null ? void 0 : d.id), a = ke(() => t.find((m) => m.id === r), [t, r]);
3020
- return Z(() => {
3021
- s && c(s);
3022
- }, [s]), /* @__PURE__ */ A("div", { className: `tabs-layout-main ${n}`, children: [
3003
+ } = e, [r, a] = Y(s ?? ((l = t[0]) == null ? void 0 : l.id)), c = Ae(() => t.find((m) => m.id === r), [t, r]);
3004
+ return /* @__PURE__ */ A("div", { className: `tabs-layout-main ${n}`, children: [
3023
3005
  /* @__PURE__ */ h(
3024
3006
  "ul",
3025
3007
  {
3026
3008
  className: `horizontal tabs tabs-container ${i}`,
3027
- children: t.map(({ id: m, to: b, label: y }) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ h(
3028
- Mr,
3009
+ children: t.map(({ id: m, to: y, label: g }) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ h(
3010
+ Qr,
3029
3011
  {
3030
- onClick: () => c(m),
3012
+ onClick: () => a(m),
3031
3013
  id: m,
3032
- to: b ?? "",
3014
+ to: y ?? "",
3033
3015
  siblings: t.length > 1,
3034
3016
  active: r === m,
3035
- children: y
3017
+ children: g
3036
3018
  }
3037
3019
  ) }, m))
3038
3020
  }
3039
3021
  ),
3040
- a == null ? void 0 : a.content
3022
+ c == null ? void 0 : c.content
3041
3023
  ] });
3042
- }, Or = (e) => {
3024
+ }, jr = (e) => {
3043
3025
  const {
3044
3026
  translation: t,
3045
3027
  onClickNext: s,
3046
3028
  image: n = "",
3047
3029
  alt: i = "",
3048
3030
  final: r = !1
3049
- } = e, { setGuestMode: c } = Jt(), { t: a } = T();
3050
- return /* @__PURE__ */ A("div", { className: "big-appear w-md flex flex-col gap-20", children: [
3051
- /* @__PURE__ */ h("img", { src: n, alt: i }),
3052
- /* @__PURE__ */ h("h2", { className: "text-5xl text-center leading-16", children: a(`_pages:onboarding.${t}.title`) }),
3053
- /* @__PURE__ */ h("p", { className: "text-center !text-lg", children: a(`_pages:onboarding.${t}.body`) }),
3054
- /* @__PURE__ */ h("div", { className: "flex gap-5 items-center justify-center", children: r ? /* @__PURE__ */ A(De, { children: [
3031
+ } = e, { setGuestMode: a } = Zt(), { navigate: c } = Re(), { t: l } = L();
3032
+ return /* @__PURE__ */ A("div", { className: "big-appear step-container", children: [
3033
+ n && /* @__PURE__ */ h("img", { src: n, alt: i }),
3034
+ /* @__PURE__ */ h("h2", { className: "step-title", children: l(`_pages:onboarding.${t}.title`) }),
3035
+ /* @__PURE__ */ h("p", { className: "step-body", children: l(`_pages:onboarding.${t}.body`) }),
3036
+ /* @__PURE__ */ h("div", { className: "step-actions", children: r ? /* @__PURE__ */ A(Ve, { children: [
3055
3037
  /* @__PURE__ */ h(
3056
- xe,
3038
+ _e,
3057
3039
  {
3058
3040
  color: "primary",
3059
- className: "!px-8",
3041
+ className: "step-button",
3060
3042
  variant: "outlined",
3061
3043
  onClick: () => {
3062
- c(!0), window.location.href = "/";
3044
+ a(!0), c("/");
3063
3045
  },
3064
- "aria-label": a("_accessibility:ariaLabels.start"),
3065
- children: a("_accessibility:buttons.startAsGuest")
3046
+ "aria-label": l("_accessibility:ariaLabels.start"),
3047
+ children: l("_accessibility:buttons.startAsGuest")
3066
3048
  }
3067
3049
  ),
3068
3050
  /* @__PURE__ */ h(
3069
- xe,
3051
+ _e,
3070
3052
  {
3071
3053
  color: "primary",
3072
3054
  variant: "submit",
3073
- className: "!px-8",
3074
- "aria-label": a("_accessibility:ariaLabels.start"),
3075
- onClick: () => window.location.href = "/auth/sign-in",
3076
- children: a("_accessibility:buttons.signIn")
3055
+ className: "step-button",
3056
+ "aria-label": l("_accessibility:ariaLabels.start"),
3057
+ onClick: () => c("/auth/sign-in"),
3058
+ children: l("_accessibility:buttons.signIn")
3077
3059
  }
3078
3060
  )
3079
- ] }) : /* @__PURE__ */ A(De, { children: [
3061
+ ] }) : /* @__PURE__ */ A(Ve, { children: [
3080
3062
  /* @__PURE__ */ h(
3081
- xe,
3063
+ _e,
3082
3064
  {
3083
3065
  color: "primary",
3084
- className: "!px-8",
3066
+ className: "step-button",
3085
3067
  variant: "outlined",
3086
- onClick: () => window.location.href = "/auth/sign-in",
3087
- "aria-label": a("_accessibility:ariaLabels.skip"),
3088
- children: a("_accessibility:buttons.skip")
3068
+ onClick: () => c("/auth/sign-in"),
3069
+ "aria-label": l("_accessibility:ariaLabels.skip"),
3070
+ children: l("_accessibility:buttons.skip")
3089
3071
  }
3090
3072
  ),
3091
3073
  /* @__PURE__ */ h(
3092
- xe,
3074
+ _e,
3093
3075
  {
3094
3076
  color: "primary",
3095
- className: "!px-8",
3077
+ className: "step-button",
3096
3078
  variant: "outlined",
3097
3079
  onClick: () => s(),
3098
- "aria-label": a("_accessibility:ariaLabels.next"),
3099
- children: a("_accessibility:buttons.next")
3080
+ "aria-label": l("_accessibility:ariaLabels.next"),
3081
+ children: l("_accessibility:buttons.next")
3100
3082
  }
3101
3083
  )
3102
3084
  ] }) })
3103
3085
  ] });
3104
- }, Ln = (e) => {
3105
- const { steps: t } = e, [s, n] = B(1), i = ke(() => t.map((r, c) => ({
3106
- id: c + 1,
3086
+ }, Mn = (e) => {
3087
+ const { steps: t } = e, [s, n] = Y(1), i = Ae(() => t.map((r, a) => ({
3088
+ id: a + 1,
3107
3089
  label: "",
3108
3090
  content: /* @__PURE__ */ h(
3109
- Or,
3091
+ jr,
3110
3092
  {
3111
3093
  translation: r,
3112
- final: c === t.length - 1,
3113
- onClickNext: () => n((a) => a + 1)
3094
+ final: a === t.length - 1,
3095
+ onClickNext: () => n((c) => c + 1)
3114
3096
  }
3115
3097
  )
3116
3098
  })), [t]);
3117
- return /* @__PURE__ */ h("div", { className: "onboarding-main", children: /* @__PURE__ */ h(Ir, { defaultTab: s, tabs: i }) });
3118
- }, Ur = (e) => {
3099
+ return /* @__PURE__ */ h("div", { className: "onboarding-main", children: /* @__PURE__ */ h(Kr, { defaultTab: s, tabs: i }) });
3100
+ }, Wr = (e) => {
3119
3101
  const {
3120
3102
  message: t,
3121
- messageProps: s = { className: "text-gray-400 text-balance text-center" },
3103
+ messageProps: s = { className: "empty-message" },
3122
3104
  action: n,
3123
3105
  iconProps: i
3124
3106
  } = e;
3125
- return /* @__PURE__ */ A("div", { className: "flex flex-col items-center justify-center gap-5 pt-5", children: [
3126
- i && /* @__PURE__ */ h(ce, { ...i ?? {} }),
3127
- /* @__PURE__ */ h("p", { ...s ?? {}, children: t }),
3128
- n && /* @__PURE__ */ h(Bt, { showTooltips: !1, showText: !0, ...n })
3107
+ return /* @__PURE__ */ A("div", { className: "empty-container", children: [
3108
+ i && /* @__PURE__ */ h(ce, { ...i }),
3109
+ /* @__PURE__ */ h("p", { ...s, children: t }),
3110
+ n && /* @__PURE__ */ h(Kt, { showTooltips: !1, showText: !0, ...n })
3129
3111
  ] });
3130
3112
  };
3131
3113
  export {
3132
- Qt as APIClient,
3133
- Bt as Action,
3134
- Ht as Actions,
3135
- Fr as ActionsDropdown,
3136
- Xs as AuthClient,
3137
- on as AuthProvider,
3138
- en as BaseClient,
3139
- xe as Button,
3140
- cn as ConfigProvider,
3141
- _n as ConfirmationDialog,
3142
- lt as Dialog,
3143
- ut as DialogActions,
3144
- Sn as Drawer,
3145
- Xt as DrawerMenuContext,
3146
- ln as DrawerMenuProvider,
3147
- zs as Dropdown,
3148
- Ur as Empty,
3149
- kn as Error,
3150
- wn as FormContainer,
3114
+ Gt as APIClient,
3115
+ Kt as Action,
3116
+ jt as Actions,
3117
+ Vr as ActionsDropdown,
3118
+ pe as AppIconButton,
3119
+ sr as AuthClient,
3120
+ hn as AuthProvider,
3121
+ cn as BaseClient,
3122
+ Bn as Button,
3123
+ yn as ConfigProvider,
3124
+ Tn as ConfirmationDialog,
3125
+ dt as Dialog,
3126
+ ft as DialogActions,
3127
+ $n as Drawer,
3128
+ ts as DrawerMenuContext,
3129
+ gn as DrawerMenuProvider,
3130
+ Wr as Empty,
3131
+ Ln as Error,
3132
+ kn as FormContainer,
3151
3133
  xn as FormDialog,
3152
- _e as GlobalActions,
3153
- Zr as IManager,
3154
- be as IconButton,
3155
- Cn as ImportDialog,
3156
- an as ManagerProvider,
3157
- ne as Methods,
3158
- En as Navbar,
3159
- $n as Notification,
3160
- Q as NotificationEnumType,
3161
- nn as NotificationProvider,
3162
- Ln as Onboarding,
3163
- Nn as Page,
3164
- pn as ParagraphInput,
3165
- vn as PasswordInput,
3166
- An as PrettyGrid,
3167
- Fn as SplashScreen,
3168
- Or as Step,
3169
- Mr as Tab,
3170
- Ir as TabsLayout,
3171
- bn as ToTop,
3172
- Ys as buildQueryUrl,
3173
- tn as enumToKeyValueArray,
3174
- sn as formatForDatetimeLocal,
3175
- Kt as fromLocal,
3176
- St as getFormattedDateTime,
3177
- Zs as getShortFormattedDateTime,
3178
- We as isHttpError,
3179
- er as isMac,
3180
- Ke as isValidationError,
3181
- Ee as makeRequest,
3182
- rn as mapValidationErrors,
3183
- jt as parseQueries,
3184
- pe as queryClient,
3185
- Ct as removeFromLocal,
3186
- _t as toLocal,
3187
- Jt as useAuth,
3188
- ze as useConfig,
3189
- Zt as useConfirmationForm,
3190
- kr as useDeleteAction,
3191
- fn as useDeleteDialog,
3192
- cs as useDialog,
3193
- sr as useDrawerMenu,
3194
- dn as useEditAction,
3195
- Ar as useExportAction,
3196
- gn as useExportActionMutate,
3197
- mn as useFormDialog,
3198
- Er as useImportAction,
3199
- yn as useImportDialog,
3200
- tr as useManager,
3134
+ Se as GlobalActions,
3135
+ on as IManager,
3136
+ pe as IconButton,
3137
+ Fn as ImportDialog,
3138
+ mn as ManagerProvider,
3139
+ te as Methods,
3140
+ In as Navbar,
3141
+ Pn as Notification,
3142
+ J as NotificationEnumType,
3143
+ fn as NotificationProvider,
3144
+ Mn as Onboarding,
3145
+ Dn as Page,
3146
+ Nn as ParagraphInput,
3147
+ An as PasswordInput,
3148
+ Vn as PrettyGrid,
3149
+ On as SplashScreen,
3150
+ jr as Step,
3151
+ Qr as Tab,
3152
+ Kr as TabsLayout,
3153
+ En as ToTop,
3154
+ tr as buildQueryUrl,
3155
+ ln as enumToKeyValueArray,
3156
+ un as formatForDatetimeLocal,
3157
+ Jt as fromLocal,
3158
+ kt as getFormattedDateTime,
3159
+ rr as getShortFormattedDateTime,
3160
+ Je as isHttpError,
3161
+ nr as isMac,
3162
+ Ge as isValidationError,
3163
+ Te as makeRequest,
3164
+ dn as mapValidationErrors,
3165
+ Wt as parseQueries,
3166
+ be as queryClient,
3167
+ Nt as removeFromLocal,
3168
+ Et as toLocal,
3169
+ Zt as useAuth,
3170
+ Re as useConfig,
3171
+ ss as useConfirmationForm,
3172
+ Tr as useDeleteAction,
3173
+ wn as useDeleteDialog,
3174
+ ds as useDialog,
3175
+ ar as useDrawerMenu,
3176
+ bn as useEditAction,
3177
+ $r as useExportAction,
3178
+ Cn as useExportActionMutate,
3179
+ vn as useFormDialog,
3180
+ Lr as useImportAction,
3181
+ Sn as useImportDialog,
3182
+ ir as useManager,
3201
3183
  Ne as useNotification,
3202
- un as usePostForm,
3203
- Nr as useRestoreAction,
3204
- hn as useRestoreDialog,
3205
- $r as useScrollTrigger,
3206
- Xr as useTimeAge
3184
+ pn as usePostForm,
3185
+ Fr as useRestoreAction,
3186
+ _n as useRestoreDialog,
3187
+ Dr as useScrollTrigger,
3188
+ an as useTimeAge
3207
3189
  };