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