@sito/dashboard-app 0.0.26 → 0.0.28
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/README.md +147 -37
- package/dist/dashboard-app.cjs +1 -1
- package/dist/dashboard-app.js +865 -856
- package/dist/main.css +1 -1
- package/package.json +1 -1
package/dist/dashboard-app.js
CHANGED
|
@@ -2,16 +2,16 @@ 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 ks, useTableOptions as Ss, Badge as Ns } from "@sito/dashboard";
|
|
6
6
|
export * from "@sito/dashboard";
|
|
7
|
-
import { jsxs as A, jsx as
|
|
8
|
-
import ie, { useRef as Re, useCallback as F, useEffect as
|
|
9
|
-
import { faTrash as Es, faRotateLeft as Mt, faPencil as $s, faCircleNotch as Ut, faCloudArrowDown as Fs, faCloudUpload as
|
|
7
|
+
import { jsxs as A, jsx as h, Fragment as Te } from "react/jsx-runtime";
|
|
8
|
+
import ie, { useRef as Re, useCallback as F, useEffect as X, useReducer as As, createContext as He, useContext as Ke, useState as H, 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 Ls, faArrowUp as Ts, 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
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
|
-
import { QueryClient as js, QueryClientProvider as Hs, useMutation as Pe, useQuery as
|
|
14
|
-
import { faSadTear as
|
|
13
|
+
import { QueryClient as js, QueryClientProvider as Hs, useMutation as Pe, useQuery as Ks } from "@tanstack/react-query";
|
|
14
|
+
import { faSadTear as Qs } from "@fortawesome/free-regular-svg-icons";
|
|
15
15
|
function Bt(e) {
|
|
16
16
|
const {
|
|
17
17
|
id: t,
|
|
@@ -20,24 +20,24 @@ function Bt(e) {
|
|
|
20
20
|
onClick: i,
|
|
21
21
|
children: r,
|
|
22
22
|
hidden: c = !1,
|
|
23
|
-
disabled:
|
|
24
|
-
showText:
|
|
25
|
-
showTooltips:
|
|
23
|
+
disabled: o = !1,
|
|
24
|
+
showText: f = !1,
|
|
25
|
+
showTooltips: y = !0
|
|
26
26
|
} = e;
|
|
27
27
|
return c ? null : /* @__PURE__ */ A(
|
|
28
28
|
"button",
|
|
29
29
|
{
|
|
30
30
|
id: t,
|
|
31
|
-
className: `action ${
|
|
32
|
-
disabled:
|
|
31
|
+
className: `action ${f ? "text-action" : "icon-action"}`,
|
|
32
|
+
disabled: o,
|
|
33
33
|
onClick: () => i(),
|
|
34
|
-
"aria-disabled":
|
|
34
|
+
"aria-disabled": o,
|
|
35
35
|
"data-tooltip-id": "tooltip",
|
|
36
|
-
"data-tooltip-content":
|
|
36
|
+
"data-tooltip-content": y ? n : "",
|
|
37
37
|
children: [
|
|
38
38
|
s,
|
|
39
39
|
" ",
|
|
40
|
-
|
|
40
|
+
f && n,
|
|
41
41
|
r
|
|
42
42
|
]
|
|
43
43
|
}
|
|
@@ -50,7 +50,7 @@ function jt(e) {
|
|
|
50
50
|
showTooltips: n = !0,
|
|
51
51
|
showActionTexts: i = !1
|
|
52
52
|
} = e;
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ h("ul", { className: `actions-container ${s}`, children: t == null ? void 0 : t.map((r) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ h(
|
|
54
54
|
Bt,
|
|
55
55
|
{
|
|
56
56
|
showTooltips: n,
|
|
@@ -62,26 +62,26 @@ function jt(e) {
|
|
|
62
62
|
}
|
|
63
63
|
const Ws = (e) => {
|
|
64
64
|
const { children: t, open: s, onClose: n } = e, i = Re(null), r = F(
|
|
65
|
-
(
|
|
66
|
-
const
|
|
67
|
-
!s || !
|
|
65
|
+
(o) => {
|
|
66
|
+
const f = i.current;
|
|
67
|
+
!s || !f || f.contains(o.target) || n();
|
|
68
68
|
},
|
|
69
69
|
[s, n]
|
|
70
70
|
), c = F(
|
|
71
|
-
(
|
|
72
|
-
s &&
|
|
71
|
+
(o) => {
|
|
72
|
+
s && o.key === "Escape" && n();
|
|
73
73
|
},
|
|
74
74
|
[s, n]
|
|
75
75
|
);
|
|
76
|
-
return
|
|
76
|
+
return X(() => {
|
|
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
|
};
|
|
84
|
-
}, [s, r, c]), /* @__PURE__ */
|
|
84
|
+
}, [s, r, c]), /* @__PURE__ */ h(
|
|
85
85
|
"div",
|
|
86
86
|
{
|
|
87
87
|
ref: i,
|
|
@@ -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:
|
|
105
|
-
...
|
|
104
|
+
iconClassName: o = "",
|
|
105
|
+
...f
|
|
106
106
|
} = e;
|
|
107
107
|
return /* @__PURE__ */ A(
|
|
108
108
|
"button",
|
|
109
109
|
{
|
|
110
110
|
type: n,
|
|
111
111
|
className: `icon-button ${i} ${r} ${c}`,
|
|
112
|
-
...
|
|
112
|
+
...f,
|
|
113
113
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ h(ce, { icon: s, className: `!w-auto ${o}` }),
|
|
115
115
|
t
|
|
116
116
|
]
|
|
117
117
|
}
|
|
@@ -125,57 +125,57 @@ const Ws = (e) => {
|
|
|
125
125
|
className: r = "",
|
|
126
126
|
...c
|
|
127
127
|
} = e;
|
|
128
|
-
return /* @__PURE__ */
|
|
128
|
+
return /* @__PURE__ */ h("button", { type: s, className: `button ${n} ${i} ${r}`, ...c, children: t });
|
|
129
129
|
};
|
|
130
130
|
var tt, xt;
|
|
131
131
|
function zs() {
|
|
132
132
|
if (xt) return tt;
|
|
133
133
|
xt = 1;
|
|
134
|
-
const e = (
|
|
135
|
-
if (
|
|
136
|
-
if (localStorage.getItem(
|
|
137
|
-
return
|
|
138
|
-
} else if (
|
|
139
|
-
return
|
|
134
|
+
const e = (o, f = "local", y = void 0) => {
|
|
135
|
+
if (f === "local") {
|
|
136
|
+
if (localStorage.getItem(o) !== void 0 && localStorage.getItem(o) !== "undefined" && localStorage.getItem(o) !== null)
|
|
137
|
+
return y === void 0 || y !== void 0 && localStorage.getItem(o) === y;
|
|
138
|
+
} else if (f === "session" && sessionStorage.getItem(o) !== void 0 && sessionStorage.getItem(o) !== "undefined" && sessionStorage.getItem(o) !== null)
|
|
139
|
+
return y === void 0 || y !== void 0 && sessionStorage.getItem(o) === y;
|
|
140
140
|
return !1;
|
|
141
|
-
}, t = (
|
|
142
|
-
const
|
|
143
|
-
return
|
|
144
|
-
const [
|
|
145
|
-
|
|
146
|
-
}),
|
|
147
|
-
}, s = (
|
|
148
|
-
if (r(
|
|
141
|
+
}, t = (o) => {
|
|
142
|
+
const f = {};
|
|
143
|
+
return o.substring(1).split("&").forEach((b) => {
|
|
144
|
+
const [m, d] = b.split("=");
|
|
145
|
+
f[m] = d;
|
|
146
|
+
}), f;
|
|
147
|
+
}, s = (o = "") => {
|
|
148
|
+
if (r(o) && o.length) return r(o);
|
|
149
149
|
{
|
|
150
|
-
let
|
|
151
|
-
if (
|
|
152
|
-
return
|
|
150
|
+
let f = navigator.language || navigator.userLanguage;
|
|
151
|
+
if (f.indexOf("en") < 0 && f.indexOf("es") < 0 && (f = "en-US"), f = f.split("-")[0], f)
|
|
152
|
+
return o.length && i(o, 730, f), f;
|
|
153
153
|
}
|
|
154
154
|
return "en";
|
|
155
|
-
}, n = (
|
|
156
|
-
top:
|
|
157
|
-
left:
|
|
158
|
-
behavior:
|
|
159
|
-
}), i = (
|
|
160
|
-
var
|
|
161
|
-
|
|
162
|
-
const w = "; expires=" +
|
|
163
|
-
document.cookie = `${
|
|
164
|
-
}, r = (
|
|
165
|
-
const
|
|
166
|
-
for (let
|
|
167
|
-
let
|
|
168
|
-
for (;
|
|
169
|
-
|
|
170
|
-
if (
|
|
171
|
-
return
|
|
155
|
+
}, n = (o = 0, f = 0, y = window, b = "smooth") => y.scroll({
|
|
156
|
+
top: o,
|
|
157
|
+
left: f,
|
|
158
|
+
behavior: b
|
|
159
|
+
}), i = (o, f, y, b = "/", m = "Lax") => {
|
|
160
|
+
var d = /* @__PURE__ */ new Date();
|
|
161
|
+
d.setTime(d.getTime() + f * 24 * 60 * 60 * 1e3);
|
|
162
|
+
const w = "; expires=" + d.toUTCString();
|
|
163
|
+
document.cookie = `${o}=${y || ""}${w};path=${b};SameSite=${m}`;
|
|
164
|
+
}, r = (o) => {
|
|
165
|
+
const f = `${o}=`, b = decodeURIComponent(document.cookie).split(";");
|
|
166
|
+
for (let m = 0; m < b.length; m += 1) {
|
|
167
|
+
let d = b[m];
|
|
168
|
+
for (; d.charAt(0) === " "; )
|
|
169
|
+
d = d.substring(1);
|
|
170
|
+
if (d.indexOf(f) === 0)
|
|
171
|
+
return d.substring(f.length, d.length);
|
|
172
172
|
}
|
|
173
173
|
return "";
|
|
174
174
|
};
|
|
175
175
|
return tt = {
|
|
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 } =
|
|
187
|
+
const { t: e, language: t } = L();
|
|
188
188
|
return { timeAge: F(
|
|
189
189
|
(n) => {
|
|
190
|
-
const r = /* @__PURE__ */ new Date() - n, c = Math.floor(r / (1e3 * 60)),
|
|
191
|
-
return r < 1e3 * 60 ?
|
|
190
|
+
const r = /* @__PURE__ */ new Date() - n, c = Math.floor(r / (1e3 * 60)), o = Math.floor(c / 60), f = t === "es", y = e("_accessibility:labels.ago"), b = e("_accessibility:labels.minute"), m = e("_accessibility:labels.minutes"), d = e("_accessibility:labels.hour"), w = e("_accessibility:labels.hours"), C = e("_accessibility:labels.yesterday"), v = e("_accessibility:labels.justNow");
|
|
191
|
+
return r < 1e3 * 60 ? v : c < 60 ? `${f ? y : ""} ${c} ${c === 1 ? b : m} ${f ? "" : y}` : o < 24 ? `${f ? y : ""} ${o} ${o === 1 ? d : w} ${f ? "" : y}` : o < 48 ? C : n.toLocaleDateString(navigator.language || "es-ES", {
|
|
192
192
|
day: "2-digit",
|
|
193
193
|
month: "2-digit",
|
|
194
194
|
year: "numeric"
|
|
@@ -209,25 +209,25 @@ 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
|
|
219
|
+
const f = 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,
|
|
223
223
|
error: {
|
|
224
224
|
status: r.status,
|
|
225
|
-
message:
|
|
225
|
+
message: f || "Unknown error occurred"
|
|
226
226
|
}
|
|
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
|
});
|
|
@@ -278,7 +278,7 @@ const Ht = (e, t, s) => {
|
|
|
278
278
|
}
|
|
279
279
|
return n.length ? `${e}?${n.join("&")}` : e;
|
|
280
280
|
};
|
|
281
|
-
class
|
|
281
|
+
class Kt {
|
|
282
282
|
/**
|
|
283
283
|
* @param baseUrl the base url of the server
|
|
284
284
|
* @param userKey the local storage user key
|
|
@@ -294,12 +294,12 @@ class Qt {
|
|
|
294
294
|
}
|
|
295
295
|
defaultTokenAcquirer(t) {
|
|
296
296
|
if (t) return { credentials: "include" };
|
|
297
|
-
const s =
|
|
297
|
+
const s = Qt(this.userKey);
|
|
298
298
|
if (s && s.length)
|
|
299
299
|
return { Authorization: `Bearer ${s}` };
|
|
300
300
|
}
|
|
301
301
|
async doQuery(t, s = re.GET, n, i) {
|
|
302
|
-
const r = this.secured ? this.defaultTokenAcquirer() : {}, { data: c, status:
|
|
302
|
+
const r = this.secured ? this.defaultTokenAcquirer() : {}, { data: c, status: o, error: f } = 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 (
|
|
312
|
-
throw
|
|
313
|
-
status:
|
|
314
|
-
message: String(
|
|
311
|
+
if (f || o < 200 || o >= 300)
|
|
312
|
+
throw f ?? {
|
|
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
|
/**
|
|
@@ -394,7 +394,7 @@ class Qt {
|
|
|
394
394
|
class Ys {
|
|
395
395
|
constructor(t, s = "user") {
|
|
396
396
|
me(this, "api");
|
|
397
|
-
this.api = new
|
|
397
|
+
this.api = new Kt(t, s, !1);
|
|
398
398
|
}
|
|
399
399
|
async login(t) {
|
|
400
400
|
const s = "auth/sign-in", n = t;
|
|
@@ -442,7 +442,7 @@ class Yr {
|
|
|
442
442
|
me(this, "table");
|
|
443
443
|
me(this, "secured");
|
|
444
444
|
me(this, "api");
|
|
445
|
-
this.table = t, this.secured = i, this.api = new
|
|
445
|
+
this.table = t, this.secured = i, this.api = new Kt(s, n, i);
|
|
446
446
|
}
|
|
447
447
|
/**
|
|
448
448
|
*
|
|
@@ -541,7 +541,7 @@ function Xr(e) {
|
|
|
541
541
|
value: e[t]
|
|
542
542
|
}));
|
|
543
543
|
}
|
|
544
|
-
const
|
|
544
|
+
const Qt = (e, t = "") => {
|
|
545
545
|
const s = localStorage.getItem(e) ?? void 0;
|
|
546
546
|
if (s && t.length)
|
|
547
547
|
switch (t) {
|
|
@@ -590,7 +590,7 @@ 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(
|
|
@@ -608,40 +608,40 @@ function en(e, t) {
|
|
|
608
608
|
const Wt = He({});
|
|
609
609
|
function tn(e) {
|
|
610
610
|
const { children: t } = e, [s, n] = As(
|
|
611
|
-
(
|
|
612
|
-
const { type:
|
|
613
|
-
switch (
|
|
611
|
+
(y, b) => {
|
|
612
|
+
const { type: m, items: d, index: w } = b;
|
|
613
|
+
switch (m) {
|
|
614
614
|
case "set":
|
|
615
|
-
return (
|
|
615
|
+
return (d == null ? void 0 : d.map((C, v) => ({
|
|
616
616
|
...C,
|
|
617
|
-
id:
|
|
617
|
+
id: v
|
|
618
618
|
}))) ?? [];
|
|
619
619
|
case "remove":
|
|
620
|
-
return w !== void 0 ?
|
|
620
|
+
return w !== void 0 ? y.filter((C, v) => v !== w) : [];
|
|
621
621
|
}
|
|
622
|
-
return
|
|
622
|
+
return y;
|
|
623
623
|
},
|
|
624
624
|
[],
|
|
625
625
|
() => []
|
|
626
|
-
), i = (
|
|
626
|
+
), i = (y) => n({
|
|
627
627
|
type: "set",
|
|
628
|
-
items: [{ ...
|
|
629
|
-
}), r = (
|
|
628
|
+
items: [{ ...y, type: j.error }]
|
|
629
|
+
}), r = (y) => n({
|
|
630
630
|
type: "set",
|
|
631
|
-
items: [{ ...
|
|
632
|
-
}), c = (
|
|
631
|
+
items: [{ ...y }]
|
|
632
|
+
}), c = (y) => n({ type: "set", items: y }), o = (y) => n({
|
|
633
633
|
type: "set",
|
|
634
|
-
items: [{ ...
|
|
635
|
-
}),
|
|
636
|
-
return /* @__PURE__ */
|
|
634
|
+
items: [{ ...y, type: j.success }]
|
|
635
|
+
}), f = (y) => n({ type: "remove", index: y });
|
|
636
|
+
return /* @__PURE__ */ h(
|
|
637
637
|
Wt.Provider,
|
|
638
638
|
{
|
|
639
639
|
value: {
|
|
640
640
|
notification: s,
|
|
641
|
-
removeNotification:
|
|
641
|
+
removeNotification: f,
|
|
642
642
|
showErrorNotification: i,
|
|
643
643
|
showNotification: r,
|
|
644
|
-
showSuccessNotification:
|
|
644
|
+
showSuccessNotification: o,
|
|
645
645
|
showStackNotifications: c
|
|
646
646
|
},
|
|
647
647
|
children: t
|
|
@@ -649,7 +649,7 @@ function tn(e) {
|
|
|
649
649
|
);
|
|
650
650
|
}
|
|
651
651
|
const Se = () => {
|
|
652
|
-
const e =
|
|
652
|
+
const e = Ke(Wt);
|
|
653
653
|
if (e === void 0)
|
|
654
654
|
throw new Error("NotificationContext must be used within a Provider");
|
|
655
655
|
return e;
|
|
@@ -667,48 +667,48 @@ const Se = () => {
|
|
|
667
667
|
}
|
|
668
668
|
}), zt = He({}), sn = (e) => {
|
|
669
669
|
const { children: t, manager: s } = e;
|
|
670
|
-
return /* @__PURE__ */
|
|
670
|
+
return /* @__PURE__ */ h(zt.Provider, { value: { client: s }, children: /* @__PURE__ */ h(Hs, { client: pe, children: t }) });
|
|
671
671
|
}, Zs = () => {
|
|
672
|
-
const e =
|
|
672
|
+
const e = Ke(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
676
|
}, Gt = He({}), rn = (e) => {
|
|
677
|
-
const { children: t, guestMode: s = "guest_mode", user: n = "user" } = e, i = Zs(), [r, c] = H({}),
|
|
677
|
+
const { children: t, guestMode: s = "guest_mode", user: n = "user" } = e, i = Zs(), [r, c] = H({}), o = F(() => !!Qt(s, "boolean") && r.token === void 0, [r.token]), f = F((w) => {
|
|
678
678
|
_t(s, w);
|
|
679
|
-
}, []),
|
|
679
|
+
}, []), y = F((w) => {
|
|
680
680
|
w && (c(w), Ct(s), _t(n, w.token));
|
|
681
|
-
}, []),
|
|
681
|
+
}, []), b = F(async () => {
|
|
682
682
|
try {
|
|
683
683
|
await i.Auth.logout();
|
|
684
684
|
} catch (w) {
|
|
685
685
|
console.error(w);
|
|
686
686
|
}
|
|
687
687
|
c({}), Ct(n);
|
|
688
|
-
}, [i.Auth]),
|
|
688
|
+
}, [i.Auth]), m = F(async () => {
|
|
689
689
|
try {
|
|
690
690
|
const w = await i.Auth.getSession();
|
|
691
|
-
|
|
691
|
+
y(w);
|
|
692
692
|
} catch (w) {
|
|
693
|
-
console.error(w),
|
|
693
|
+
console.error(w), b();
|
|
694
694
|
}
|
|
695
|
-
}, [
|
|
695
|
+
}, [y, b, i.Auth]), d = {
|
|
696
696
|
account: r,
|
|
697
|
-
logUser:
|
|
698
|
-
logoutUser:
|
|
699
|
-
logUserFromLocal:
|
|
700
|
-
isInGuestMode:
|
|
701
|
-
setGuestMode:
|
|
697
|
+
logUser: y,
|
|
698
|
+
logoutUser: b,
|
|
699
|
+
logUserFromLocal: m,
|
|
700
|
+
isInGuestMode: o,
|
|
701
|
+
setGuestMode: f
|
|
702
702
|
};
|
|
703
|
-
return /* @__PURE__ */
|
|
703
|
+
return /* @__PURE__ */ h(Gt.Provider, { value: d, children: t });
|
|
704
704
|
}, Jt = () => {
|
|
705
|
-
const e =
|
|
705
|
+
const e = Ke(Gt);
|
|
706
706
|
if (e === void 0)
|
|
707
707
|
throw new Error("authContext must be used within a Provider");
|
|
708
708
|
return e;
|
|
709
709
|
}, Yt = He({}), nn = (e) => {
|
|
710
710
|
const { children: t, location: s, navigate: n, linkComponent: i, searchComponent: r } = e;
|
|
711
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ h(
|
|
712
712
|
Yt.Provider,
|
|
713
713
|
{
|
|
714
714
|
value: { location: s, navigate: n, linkComponent: i, searchComponent: r },
|
|
@@ -716,44 +716,44 @@ const Se = () => {
|
|
|
716
716
|
}
|
|
717
717
|
);
|
|
718
718
|
}, ze = () => {
|
|
719
|
-
const e =
|
|
719
|
+
const e = Ke(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 } = Se(), { mutationFn: s, onError: n, onSuccess: i, onSuccessMessage: r } = e, [c,
|
|
727
|
-
|
|
728
|
-
},
|
|
729
|
-
|
|
726
|
+
const { showSuccessNotification: t } = Se(), { mutationFn: s, onError: n, onSuccess: i, onSuccessMessage: r } = e, [c, o] = H([]), { open: f, handleClose: y, handleOpen: b } = as(), m = () => {
|
|
727
|
+
y(), o([]);
|
|
728
|
+
}, d = async (C) => {
|
|
729
|
+
o(C), b();
|
|
730
730
|
}, w = Pe({
|
|
731
731
|
mutationFn: () => s(
|
|
732
732
|
Array.isArray(c) ? c : [c]
|
|
733
733
|
),
|
|
734
734
|
onError: (C) => {
|
|
735
|
-
console.error(C), n && n(C),
|
|
735
|
+
console.error(C), n && n(C), m();
|
|
736
736
|
},
|
|
737
737
|
onSuccess: async (C) => {
|
|
738
738
|
i && i(C), t({
|
|
739
739
|
message: r
|
|
740
|
-
}),
|
|
740
|
+
}), m();
|
|
741
741
|
}
|
|
742
742
|
});
|
|
743
|
-
return { open:
|
|
743
|
+
return { open: f, onClick: d, close: m, dialogFn: w, isLoading: w.isPending };
|
|
744
744
|
};
|
|
745
745
|
var Oe = (e) => e.type === "checkbox", ke = (e) => e instanceof Date, te = (e) => e == null;
|
|
746
746
|
const Zt = (e) => typeof e == "object";
|
|
747
|
-
var
|
|
747
|
+
var K = (e) => !te(e) && !Array.isArray(e) && Zt(e) && !ke(e), er = (e) => K(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
|
|
749
|
+
return K(t) && t.hasOwnProperty("isPrototypeOf");
|
|
750
750
|
}, nt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
751
751
|
function Y(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 (!(nt && (e instanceof Blob || n)) && (s ||
|
|
756
|
+
else if (!(nt && (e instanceof Blob || n)) && (s || K(e)))
|
|
757
757
|
if (t = s ? [] : {}, !s && !rr(e))
|
|
758
758
|
t = e;
|
|
759
759
|
else
|
|
@@ -763,24 +763,24 @@ function Y(e) {
|
|
|
763
763
|
return e;
|
|
764
764
|
return t;
|
|
765
765
|
}
|
|
766
|
-
var Ge = (e) => /^\w*$/.test(e), W = (e) => e === void 0, it = (e) => Array.isArray(e) ? e.filter(Boolean) : [],
|
|
767
|
-
if (!t || !
|
|
766
|
+
var Ge = (e) => /^\w*$/.test(e), W = (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 || !K(e))
|
|
768
768
|
return s;
|
|
769
|
-
const n = (Ge(t) ? [t] :
|
|
769
|
+
const n = (Ge(t) ? [t] : ot(t)).reduce((i, r) => te(i) ? i : i[r], e);
|
|
770
770
|
return W(n) || n === e ? W(e[t]) ? s : e[t] : n;
|
|
771
771
|
}, he = (e) => typeof e == "boolean", U = (e, t, s) => {
|
|
772
772
|
let n = -1;
|
|
773
|
-
const i = Ge(t) ? [t] :
|
|
773
|
+
const i = Ge(t) ? [t] : ot(t), r = i.length, c = r - 1;
|
|
774
774
|
for (; ++n < r; ) {
|
|
775
|
-
const
|
|
776
|
-
let
|
|
775
|
+
const o = i[n];
|
|
776
|
+
let f = s;
|
|
777
777
|
if (n !== c) {
|
|
778
|
-
const
|
|
779
|
-
|
|
778
|
+
const y = e[o];
|
|
779
|
+
f = K(y) || Array.isArray(y) ? y : isNaN(+i[n + 1]) ? {} : [];
|
|
780
780
|
}
|
|
781
|
-
if (
|
|
781
|
+
if (o === "__proto__" || o === "constructor" || o === "prototype")
|
|
782
782
|
return;
|
|
783
|
-
e[
|
|
783
|
+
e[o] = f, e = e[o];
|
|
784
784
|
}
|
|
785
785
|
};
|
|
786
786
|
const St = {
|
|
@@ -815,8 +815,8 @@ var ir = (e, t, s, n = !0) => {
|
|
|
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), rt = (e) => te(e) || !Zt(e);
|
|
820
820
|
function ve(e, t, s = /* @__PURE__ */ new WeakSet()) {
|
|
821
821
|
if (rt(e) || rt(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 (ke(c) && ke(
|
|
836
|
+
const o = t[r];
|
|
837
|
+
if (ke(c) && ke(o) || K(c) && K(o) || Array.isArray(c) && Array.isArray(o) ? !ve(c, o, s) : c !== o)
|
|
838
838
|
return !1;
|
|
839
839
|
}
|
|
840
840
|
}
|
|
@@ -865,7 +865,7 @@ var cr = (e, t, s, n, i) => t ? {
|
|
|
865
865
|
e = [];
|
|
866
866
|
}
|
|
867
867
|
};
|
|
868
|
-
}, se = (e) =>
|
|
868
|
+
}, se = (e) => K(e) && !Object.keys(e).length, at = (e) => e.type === "file", fe = (e) => typeof e == "function", qe = (e) => {
|
|
869
869
|
if (!nt)
|
|
870
870
|
return !1;
|
|
871
871
|
const t = e ? e.ownerDocument : 0;
|
|
@@ -884,9 +884,9 @@ function dr(e) {
|
|
|
884
884
|
return !1;
|
|
885
885
|
return !0;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
888
|
-
const s = Array.isArray(t) ? t : Ge(t) ? [t] :
|
|
889
|
-
return n && delete n[r], i !== 0 && (
|
|
887
|
+
function Q(e, t) {
|
|
888
|
+
const s = Array.isArray(t) ? t : Ge(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 && (K(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)
|
|
@@ -896,16 +896,16 @@ var ts = (e) => {
|
|
|
896
896
|
};
|
|
897
897
|
function Be(e, t = {}) {
|
|
898
898
|
const s = Array.isArray(e);
|
|
899
|
-
if (
|
|
899
|
+
if (K(e) || s)
|
|
900
900
|
for (const n in e)
|
|
901
|
-
Array.isArray(e[n]) ||
|
|
901
|
+
Array.isArray(e[n]) || K(e[n]) && !ts(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, Be(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 (K(e) || n)
|
|
907
907
|
for (const i in e)
|
|
908
|
-
Array.isArray(e[i]) ||
|
|
908
|
+
Array.isArray(e[i]) || K(e[i]) && !ts(e[i]) ? W(t) || rt(s[i]) ? s[i] = Array.isArray(e[i]) ? Be(e[i], []) : { ...Be(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
911
|
var Ee = (e, t) => ss(e, t, Be(t));
|
|
@@ -936,7 +936,7 @@ var is = (e) => Array.isArray(e) ? e.reduce((t, s) => s && s.checked && !s.disab
|
|
|
936
936
|
} : t, $t) : $t;
|
|
937
937
|
function Ft(e) {
|
|
938
938
|
const t = e.ref;
|
|
939
|
-
return
|
|
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(W(t.value) ? e.ref.value : t.value, e);
|
|
940
940
|
}
|
|
941
941
|
var fr = (e, t, s, n) => {
|
|
942
942
|
const i = {};
|
|
@@ -950,28 +950,28 @@ var fr = (e, t, s, n) => {
|
|
|
950
950
|
fields: i,
|
|
951
951
|
shouldUseNativeValidation: n
|
|
952
952
|
};
|
|
953
|
-
}, je = (e) => e instanceof RegExp, $e = (e) => W(e) ? e : je(e) ? e.source :
|
|
953
|
+
}, je = (e) => e instanceof RegExp, $e = (e) => W(e) ? e : je(e) ? e.source : K(e) ? je(e.value) ? e.value.source : e.value : e, Lt = (e) => ({
|
|
954
954
|
isOnSubmit: !e || e === de.onSubmit,
|
|
955
955
|
isOnBlur: e === de.onBlur,
|
|
956
956
|
isOnChange: e === de.onChange,
|
|
957
957
|
isOnAll: e === de.all,
|
|
958
958
|
isOnTouch: e === de.onTouched
|
|
959
959
|
});
|
|
960
|
-
const
|
|
961
|
-
var mr = (e) => !!e && !!e.validate && !!(fe(e.validate) && e.validate.constructor.name ===
|
|
962
|
-
const
|
|
960
|
+
const Tt = "AsyncFunction";
|
|
961
|
+
var mr = (e) => !!e && !!e.validate && !!(fe(e.validate) && e.validate.constructor.name === Tt || K(e.validate) && Object.values(e.validate).find((t) => t.constructor.name === Tt)), 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
|
+
const Le = (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 (
|
|
972
|
+
if (Le(o, t))
|
|
973
973
|
break;
|
|
974
|
-
} else if (
|
|
974
|
+
} else if (K(o) && Le(o, t))
|
|
975
975
|
break;
|
|
976
976
|
}
|
|
977
977
|
}
|
|
@@ -985,18 +985,18 @@ function Vt(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
|
}
|
|
@@ -1008,7 +1008,7 @@ var yr = (e, t, s, n) => {
|
|
|
1008
1008
|
s(e);
|
|
1009
1009
|
const { name: i, ...r } = e;
|
|
1010
1010
|
return se(r) || Object.keys(r).length >= Object.keys(t).length || Object.keys(r).find((c) => t[c] === (!n || de.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 &&
|
|
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
1013
|
return U(n, "root", t[s]), U(e, s, n), e;
|
|
1014
1014
|
}, Ue = (e) => ye(e);
|
|
@@ -1020,27 +1020,27 @@ function Pt(e, t, s = "validate") {
|
|
|
1020
1020
|
ref: t
|
|
1021
1021
|
};
|
|
1022
1022
|
}
|
|
1023
|
-
var Ne = (e) =>
|
|
1023
|
+
var Ne = (e) => K(e) && !je(e) ? e : {
|
|
1024
1024
|
value: e,
|
|
1025
1025
|
message: ""
|
|
1026
1026
|
}, Ot = async (e, t, s, n, i, r) => {
|
|
1027
|
-
const { ref: c, refs:
|
|
1028
|
-
if (!
|
|
1027
|
+
const { ref: c, refs: o, required: f, maxLength: y, minLength: b, min: m, max: d, pattern: w, validate: C, name: v, valueAsNumber: q, mount: oe } = e._f, S = _(s, v);
|
|
1028
|
+
if (!oe || t.has(v))
|
|
1029
1029
|
return {};
|
|
1030
|
-
const z =
|
|
1030
|
+
const z = o ? o[0] : c, D = (N) => {
|
|
1031
1031
|
i && z.reportValidity && (z.setCustomValidity(he(N) ? "" : N || ""), z.reportValidity());
|
|
1032
|
-
}, $ = {}, G = ct(c), V = Oe(c), le = G || V, B = (q ||
|
|
1032
|
+
}, $ = {}, G = ct(c), V = Oe(c), le = G || V, B = (q || at(c)) && W(c.value) && W(S) || qe(c) && c.value === "" || S === "" || Array.isArray(S) && !S.length, M = cr.bind(null, v, n, $), I = (N, E, R, J = ge.maxLength, Z = ge.minLength) => {
|
|
1033
1033
|
const P = N ? E : R;
|
|
1034
|
-
$[
|
|
1035
|
-
type: N ? J :
|
|
1034
|
+
$[v] = {
|
|
1035
|
+
type: N ? J : Z,
|
|
1036
1036
|
message: P,
|
|
1037
1037
|
ref: c,
|
|
1038
|
-
...M(N ? J :
|
|
1038
|
+
...M(N ? J : Z, P)
|
|
1039
1039
|
};
|
|
1040
1040
|
};
|
|
1041
|
-
if (r ? !Array.isArray(S) || !S.length :
|
|
1042
|
-
const { value: N, message: E } = Ue(
|
|
1043
|
-
if (N && ($[
|
|
1041
|
+
if (r ? !Array.isArray(S) || !S.length : f && (!le && (B || te(S)) || he(S) && !S || V && !rs(o).isValid || G && !is(o).isValid)) {
|
|
1042
|
+
const { value: N, message: E } = Ue(f) ? { value: !!f, message: f } : Ne(f);
|
|
1043
|
+
if (N && ($[v] = {
|
|
1044
1044
|
type: ge.required,
|
|
1045
1045
|
message: E,
|
|
1046
1046
|
ref: z,
|
|
@@ -1048,27 +1048,27 @@ var Ne = (e) => Q(e) && !je(e) ? e : {
|
|
|
1048
1048
|
}, !n))
|
|
1049
1049
|
return D(E), $;
|
|
1050
1050
|
}
|
|
1051
|
-
if (!B && (!te(
|
|
1051
|
+
if (!B && (!te(m) || !te(d))) {
|
|
1052
1052
|
let N, E;
|
|
1053
|
-
const R = Ne(
|
|
1053
|
+
const R = Ne(d), J = Ne(m);
|
|
1054
1054
|
if (!te(S) && !isNaN(S)) {
|
|
1055
|
-
const
|
|
1056
|
-
te(R.value) || (N =
|
|
1055
|
+
const Z = c.valueAsNumber || S && +S;
|
|
1056
|
+
te(R.value) || (N = Z > R.value), te(J.value) || (E = Z < J.value);
|
|
1057
1057
|
} else {
|
|
1058
|
-
const
|
|
1059
|
-
ye(R.value) && S && (N = ee ? P(S) > P(R.value) : ne ? S > R.value :
|
|
1058
|
+
const Z = c.valueAsDate || new Date(S), P = (ue) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ue), ee = c.type == "time", ne = c.type == "week";
|
|
1059
|
+
ye(R.value) && S && (N = ee ? P(S) > P(R.value) : ne ? S > R.value : Z > new Date(R.value)), ye(J.value) && S && (E = ee ? P(S) < P(J.value) : ne ? S < J.value : Z < new Date(J.value));
|
|
1060
1060
|
}
|
|
1061
1061
|
if ((N || E) && (I(!!N, R.message, J.message, ge.max, ge.min), !n))
|
|
1062
|
-
return D($[
|
|
1062
|
+
return D($[v].message), $;
|
|
1063
1063
|
}
|
|
1064
|
-
if ((
|
|
1065
|
-
const N = Ne(
|
|
1064
|
+
if ((y || b) && !B && (ye(S) || r && Array.isArray(S))) {
|
|
1065
|
+
const N = Ne(y), E = Ne(b), R = !te(N.value) && S.length > +N.value, J = !te(E.value) && S.length < +E.value;
|
|
1066
1066
|
if ((R || J) && (I(R, N.message, E.message), !n))
|
|
1067
|
-
return D($[
|
|
1067
|
+
return D($[v].message), $;
|
|
1068
1068
|
}
|
|
1069
1069
|
if (w && !B && ye(S)) {
|
|
1070
1070
|
const { value: N, message: E } = Ne(w);
|
|
1071
|
-
if (je(N) && !S.match(N) && ($[
|
|
1071
|
+
if (je(N) && !S.match(N) && ($[v] = {
|
|
1072
1072
|
type: ge.pattern,
|
|
1073
1073
|
message: E,
|
|
1074
1074
|
ref: c,
|
|
@@ -1079,12 +1079,12 @@ var Ne = (e) => Q(e) && !je(e) ? e : {
|
|
|
1079
1079
|
if (C) {
|
|
1080
1080
|
if (fe(C)) {
|
|
1081
1081
|
const N = await C(S, s), E = Pt(N, z);
|
|
1082
|
-
if (E && ($[
|
|
1082
|
+
if (E && ($[v] = {
|
|
1083
1083
|
...E,
|
|
1084
1084
|
...M(ge.validate, E.message)
|
|
1085
1085
|
}, !n))
|
|
1086
1086
|
return D(E.message), $;
|
|
1087
|
-
} else if (
|
|
1087
|
+
} else if (K(C)) {
|
|
1088
1088
|
let N = {};
|
|
1089
1089
|
for (const E in C) {
|
|
1090
1090
|
if (!se(N) && !n)
|
|
@@ -1093,9 +1093,9 @@ var Ne = (e) => Q(e) && !je(e) ? e : {
|
|
|
1093
1093
|
R && (N = {
|
|
1094
1094
|
...R,
|
|
1095
1095
|
...M(E, R.message)
|
|
1096
|
-
}, D(R.message), n && ($[
|
|
1096
|
+
}, D(R.message), n && ($[v] = N));
|
|
1097
1097
|
}
|
|
1098
|
-
if (!se(N) && ($[
|
|
1098
|
+
if (!se(N) && ($[v] = {
|
|
1099
1099
|
ref: z,
|
|
1100
1100
|
...N
|
|
1101
1101
|
}, !n))
|
|
@@ -1128,18 +1128,18 @@ function xr(e = {}) {
|
|
|
1128
1128
|
validatingFields: {},
|
|
1129
1129
|
errors: t.errors || {},
|
|
1130
1130
|
disabled: t.disabled || !1
|
|
1131
|
-
}, n = {}, i =
|
|
1131
|
+
}, n = {}, i = K(t.defaultValues) || K(t.values) ? Y(t.defaultValues || t.values) || {} : {}, r = t.shouldUnregister ? {} : Y(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(),
|
|
1139
1139
|
array: /* @__PURE__ */ new Set(),
|
|
1140
1140
|
watch: /* @__PURE__ */ new Set()
|
|
1141
|
-
},
|
|
1142
|
-
const
|
|
1141
|
+
}, f, y = 0;
|
|
1142
|
+
const b = {
|
|
1143
1143
|
isDirty: !1,
|
|
1144
1144
|
dirtyFields: !1,
|
|
1145
1145
|
validatingFields: !1,
|
|
@@ -1148,288 +1148,288 @@ function xr(e = {}) {
|
|
|
1148
1148
|
isValid: !1,
|
|
1149
1149
|
errors: !1
|
|
1150
1150
|
};
|
|
1151
|
-
let
|
|
1152
|
-
...
|
|
1151
|
+
let m = {
|
|
1152
|
+
...b
|
|
1153
1153
|
};
|
|
1154
|
-
const
|
|
1154
|
+
const d = {
|
|
1155
1155
|
array: Nt(),
|
|
1156
1156
|
state: Nt()
|
|
1157
|
-
}, w = t.criteriaMode === de.all, C = (
|
|
1158
|
-
clearTimeout(
|
|
1159
|
-
},
|
|
1160
|
-
if (!t.disabled && (
|
|
1157
|
+
}, w = t.criteriaMode === de.all, C = (a) => (l) => {
|
|
1158
|
+
clearTimeout(y), y = setTimeout(a, l);
|
|
1159
|
+
}, v = async (a) => {
|
|
1160
|
+
if (!t.disabled && (b.isValid || m.isValid || a)) {
|
|
1161
1161
|
const l = t.resolver ? se((await V()).errors) : await B(n, !0);
|
|
1162
|
-
l !== s.isValid &&
|
|
1162
|
+
l !== s.isValid && d.state.next({
|
|
1163
1163
|
isValid: l
|
|
1164
1164
|
});
|
|
1165
1165
|
}
|
|
1166
|
-
}, q = (
|
|
1167
|
-
!t.disabled && (
|
|
1168
|
-
u && (l ? U(s.validatingFields, u, l) :
|
|
1169
|
-
}),
|
|
1166
|
+
}, q = (a, l) => {
|
|
1167
|
+
!t.disabled && (b.isValidating || b.validatingFields || m.isValidating || m.validatingFields) && ((a || Array.from(o.mount)).forEach((u) => {
|
|
1168
|
+
u && (l ? U(s.validatingFields, u, l) : Q(s.validatingFields, u));
|
|
1169
|
+
}), d.state.next({
|
|
1170
1170
|
validatingFields: s.validatingFields,
|
|
1171
1171
|
isValidating: !se(s.validatingFields)
|
|
1172
1172
|
}));
|
|
1173
|
-
},
|
|
1174
|
-
if (
|
|
1175
|
-
if (c.action = !0,
|
|
1176
|
-
const k = u(_(n,
|
|
1177
|
-
p && U(n,
|
|
1173
|
+
}, oe = (a, l = [], u, x, p = !0, g = !0) => {
|
|
1174
|
+
if (x && u && !t.disabled) {
|
|
1175
|
+
if (c.action = !0, g && Array.isArray(_(n, a))) {
|
|
1176
|
+
const k = u(_(n, a), x.argA, x.argB);
|
|
1177
|
+
p && U(n, a, k);
|
|
1178
1178
|
}
|
|
1179
|
-
if (
|
|
1180
|
-
const k = u(_(s.errors,
|
|
1181
|
-
p && U(s.errors,
|
|
1179
|
+
if (g && Array.isArray(_(s.errors, a))) {
|
|
1180
|
+
const k = u(_(s.errors, a), x.argA, x.argB);
|
|
1181
|
+
p && U(s.errors, a, k), pr(s.errors, a);
|
|
1182
1182
|
}
|
|
1183
|
-
if ((
|
|
1184
|
-
const k = u(_(s.touchedFields,
|
|
1185
|
-
p && U(s.touchedFields,
|
|
1183
|
+
if ((b.touchedFields || m.touchedFields) && g && Array.isArray(_(s.touchedFields, a))) {
|
|
1184
|
+
const k = u(_(s.touchedFields, a), x.argA, x.argB);
|
|
1185
|
+
p && U(s.touchedFields, a, k);
|
|
1186
1186
|
}
|
|
1187
|
-
(
|
|
1188
|
-
name:
|
|
1189
|
-
isDirty: I(
|
|
1187
|
+
(b.dirtyFields || m.dirtyFields) && (s.dirtyFields = Ee(i, r)), d.state.next({
|
|
1188
|
+
name: a,
|
|
1189
|
+
isDirty: I(a, l),
|
|
1190
1190
|
dirtyFields: s.dirtyFields,
|
|
1191
1191
|
errors: s.errors,
|
|
1192
1192
|
isValid: s.isValid
|
|
1193
1193
|
});
|
|
1194
1194
|
} else
|
|
1195
|
-
U(r,
|
|
1196
|
-
}, S = (
|
|
1197
|
-
U(s.errors,
|
|
1195
|
+
U(r, a, l);
|
|
1196
|
+
}, S = (a, l) => {
|
|
1197
|
+
U(s.errors, a, l), d.state.next({
|
|
1198
1198
|
errors: s.errors
|
|
1199
1199
|
});
|
|
1200
|
-
}, z = (
|
|
1201
|
-
s.errors =
|
|
1200
|
+
}, z = (a) => {
|
|
1201
|
+
s.errors = a, d.state.next({
|
|
1202
1202
|
errors: s.errors,
|
|
1203
1203
|
isValid: !1
|
|
1204
1204
|
});
|
|
1205
|
-
}, D = (
|
|
1206
|
-
const p = _(n,
|
|
1205
|
+
}, D = (a, l, u, x) => {
|
|
1206
|
+
const p = _(n, a);
|
|
1207
1207
|
if (p) {
|
|
1208
|
-
const
|
|
1209
|
-
W(
|
|
1208
|
+
const g = _(r, a, W(u) ? _(i, a) : u);
|
|
1209
|
+
W(g) || x && x.defaultChecked || l ? U(r, a, l ? g : Ft(p._f)) : R(a, g), c.mount && v();
|
|
1210
1210
|
}
|
|
1211
|
-
}, $ = (
|
|
1212
|
-
let
|
|
1213
|
-
const
|
|
1214
|
-
name:
|
|
1211
|
+
}, $ = (a, l, u, x, p) => {
|
|
1212
|
+
let g = !1, k = !1;
|
|
1213
|
+
const T = {
|
|
1214
|
+
name: a
|
|
1215
1215
|
};
|
|
1216
1216
|
if (!t.disabled) {
|
|
1217
|
-
if (!u ||
|
|
1218
|
-
(
|
|
1219
|
-
const O = ve(_(i,
|
|
1220
|
-
k = !!_(s.dirtyFields,
|
|
1217
|
+
if (!u || x) {
|
|
1218
|
+
(b.isDirty || m.isDirty) && (k = s.isDirty, s.isDirty = T.isDirty = I(), g = k !== T.isDirty);
|
|
1219
|
+
const O = ve(_(i, a), l);
|
|
1220
|
+
k = !!_(s.dirtyFields, a), O ? Q(s.dirtyFields, a) : U(s.dirtyFields, a, !0), T.dirtyFields = s.dirtyFields, g = g || (b.dirtyFields || m.dirtyFields) && k !== !O;
|
|
1221
1221
|
}
|
|
1222
1222
|
if (u) {
|
|
1223
|
-
const O = _(s.touchedFields,
|
|
1224
|
-
O || (U(s.touchedFields,
|
|
1223
|
+
const O = _(s.touchedFields, a);
|
|
1224
|
+
O || (U(s.touchedFields, a, u), T.touchedFields = s.touchedFields, g = g || (b.touchedFields || m.touchedFields) && O !== u);
|
|
1225
1225
|
}
|
|
1226
|
-
|
|
1226
|
+
g && p && d.state.next(T);
|
|
1227
1227
|
}
|
|
1228
|
-
return
|
|
1229
|
-
}, G = (
|
|
1230
|
-
const p = _(s.errors,
|
|
1231
|
-
if (t.delayError && u ? (
|
|
1228
|
+
return g ? T : {};
|
|
1229
|
+
}, G = (a, l, u, x) => {
|
|
1230
|
+
const p = _(s.errors, a), g = (b.isValid || m.isValid) && he(l) && s.isValid !== l;
|
|
1231
|
+
if (t.delayError && u ? (f = C(() => S(a, u)), f(t.delayError)) : (clearTimeout(y), f = null, u ? U(s.errors, a, u) : Q(s.errors, a)), (u ? !ve(p, u) : p) || !se(x) || g) {
|
|
1232
1232
|
const k = {
|
|
1233
|
-
...
|
|
1234
|
-
...
|
|
1233
|
+
...x,
|
|
1234
|
+
...g && he(l) ? { isValid: l } : {},
|
|
1235
1235
|
errors: s.errors,
|
|
1236
|
-
name:
|
|
1236
|
+
name: a
|
|
1237
1237
|
};
|
|
1238
1238
|
s = {
|
|
1239
1239
|
...s,
|
|
1240
1240
|
...k
|
|
1241
|
-
},
|
|
1241
|
+
}, d.state.next(k);
|
|
1242
1242
|
}
|
|
1243
|
-
}, V = async (
|
|
1244
|
-
q(
|
|
1245
|
-
const l = await t.resolver(r, t.context, fr(
|
|
1246
|
-
return q(
|
|
1247
|
-
}, le = async (
|
|
1248
|
-
const { errors: l } = await V(
|
|
1249
|
-
if (
|
|
1250
|
-
for (const u of
|
|
1251
|
-
const
|
|
1252
|
-
|
|
1243
|
+
}, V = async (a) => {
|
|
1244
|
+
q(a, !0);
|
|
1245
|
+
const l = await t.resolver(r, t.context, fr(a || o.mount, n, t.criteriaMode, t.shouldUseNativeValidation));
|
|
1246
|
+
return q(a), l;
|
|
1247
|
+
}, le = async (a) => {
|
|
1248
|
+
const { errors: l } = await V(a);
|
|
1249
|
+
if (a)
|
|
1250
|
+
for (const u of a) {
|
|
1251
|
+
const x = _(l, u);
|
|
1252
|
+
x ? U(s.errors, u, x) : Q(s.errors, u);
|
|
1253
1253
|
}
|
|
1254
1254
|
else
|
|
1255
1255
|
s.errors = l;
|
|
1256
1256
|
return l;
|
|
1257
|
-
}, B = async (
|
|
1257
|
+
}, B = async (a, l, u = {
|
|
1258
1258
|
valid: !0
|
|
1259
1259
|
}) => {
|
|
1260
|
-
for (const
|
|
1261
|
-
const p =
|
|
1260
|
+
for (const x in a) {
|
|
1261
|
+
const p = a[x];
|
|
1262
1262
|
if (p) {
|
|
1263
|
-
const { _f:
|
|
1264
|
-
if (
|
|
1265
|
-
const
|
|
1266
|
-
O &&
|
|
1267
|
-
const
|
|
1268
|
-
if (O &&
|
|
1263
|
+
const { _f: g, ...k } = p;
|
|
1264
|
+
if (g) {
|
|
1265
|
+
const T = o.array.has(g.name), O = p._f && mr(p._f);
|
|
1266
|
+
O && b.validatingFields && q([x], !0);
|
|
1267
|
+
const ae = await Ot(p, o.disabled, r, w, t.shouldUseNativeValidation && !l, T);
|
|
1268
|
+
if (O && b.validatingFields && q([x]), ae[g.name] && (u.valid = !1, l))
|
|
1269
1269
|
break;
|
|
1270
|
-
!l && (_(
|
|
1270
|
+
!l && (_(ae, g.name) ? T ? wr(s.errors, ae, g.name) : U(s.errors, g.name, ae[g.name]) : Q(s.errors, g.name));
|
|
1271
1271
|
}
|
|
1272
1272
|
!se(k) && await B(k, l, u);
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
1275
1275
|
return u.valid;
|
|
1276
1276
|
}, M = () => {
|
|
1277
|
-
for (const
|
|
1278
|
-
const l = _(n,
|
|
1279
|
-
l && (l._f.refs ? l._f.refs.every((u) => !st(u)) : !st(l._f.ref)) && Je(
|
|
1277
|
+
for (const a of o.unMount) {
|
|
1278
|
+
const l = _(n, a);
|
|
1279
|
+
l && (l._f.refs ? l._f.refs.every((u) => !st(u)) : !st(l._f.ref)) && Je(a);
|
|
1280
1280
|
}
|
|
1281
|
-
|
|
1282
|
-
}, I = (
|
|
1283
|
-
...c.mount ? r : W(l) ? i : ye(
|
|
1284
|
-
}, u, l), E = (
|
|
1285
|
-
const
|
|
1281
|
+
o.unMount = /* @__PURE__ */ new Set();
|
|
1282
|
+
}, I = (a, l) => !t.disabled && (a && l && U(r, a, l), !ve(ue(), i)), N = (a, l, u) => ar(a, o, {
|
|
1283
|
+
...c.mount ? r : W(l) ? i : ye(a) ? { [a]: l } : l
|
|
1284
|
+
}, u, l), E = (a) => it(_(c.mount ? r : i, a, t.shouldUnregister ? _(i, a, []) : [])), R = (a, l, u = {}) => {
|
|
1285
|
+
const x = _(n, a);
|
|
1286
1286
|
let p = l;
|
|
1287
|
-
if (
|
|
1288
|
-
const
|
|
1289
|
-
|
|
1290
|
-
(!k.defaultChecked || !k.disabled) && (Array.isArray(p) ? k.checked = !!p.find((
|
|
1291
|
-
}) :
|
|
1292
|
-
name:
|
|
1287
|
+
if (x) {
|
|
1288
|
+
const g = x._f;
|
|
1289
|
+
g && (!g.disabled && U(r, a, ns(l, g)), p = qe(g.ref) && te(l) ? "" : l, es(g.ref) ? [...g.ref.options].forEach((k) => k.selected = p.includes(k.value)) : g.refs ? Oe(g.ref) ? g.refs.forEach((k) => {
|
|
1290
|
+
(!k.defaultChecked || !k.disabled) && (Array.isArray(p) ? k.checked = !!p.find((T) => T === k.value) : k.checked = p === k.value || !!p);
|
|
1291
|
+
}) : g.refs.forEach((k) => k.checked = k.value === p) : at(g.ref) ? g.ref.value = "" : (g.ref.value = p, g.ref.type || d.state.next({
|
|
1292
|
+
name: a,
|
|
1293
1293
|
values: Y(r)
|
|
1294
1294
|
})));
|
|
1295
1295
|
}
|
|
1296
|
-
(u.shouldDirty || u.shouldTouch) && $(
|
|
1297
|
-
}, J = (
|
|
1298
|
-
for (const
|
|
1299
|
-
if (!l.hasOwnProperty(
|
|
1296
|
+
(u.shouldDirty || u.shouldTouch) && $(a, p, u.shouldTouch, u.shouldDirty, !0), u.shouldValidate && ne(a);
|
|
1297
|
+
}, J = (a, l, u) => {
|
|
1298
|
+
for (const x in l) {
|
|
1299
|
+
if (!l.hasOwnProperty(x))
|
|
1300
1300
|
return;
|
|
1301
|
-
const p = l[
|
|
1302
|
-
(
|
|
1301
|
+
const p = l[x], g = a + "." + x, k = _(n, g);
|
|
1302
|
+
(o.array.has(a) || K(p) || k && !k._f) && !ke(p) ? J(g, p, u) : R(g, p, u);
|
|
1303
1303
|
}
|
|
1304
|
-
},
|
|
1305
|
-
const
|
|
1306
|
-
U(r,
|
|
1307
|
-
name:
|
|
1304
|
+
}, Z = (a, l, u = {}) => {
|
|
1305
|
+
const x = _(n, a), p = o.array.has(a), g = Y(l);
|
|
1306
|
+
U(r, a, g), p ? (d.array.next({
|
|
1307
|
+
name: a,
|
|
1308
1308
|
values: Y(r)
|
|
1309
|
-
}), (
|
|
1310
|
-
name:
|
|
1309
|
+
}), (b.isDirty || b.dirtyFields || m.isDirty || m.dirtyFields) && u.shouldDirty && d.state.next({
|
|
1310
|
+
name: a,
|
|
1311
1311
|
dirtyFields: Ee(i, r),
|
|
1312
|
-
isDirty: I(
|
|
1313
|
-
})) :
|
|
1314
|
-
name: c.mount ?
|
|
1312
|
+
isDirty: I(a, g)
|
|
1313
|
+
})) : x && !x._f && !te(g) ? J(a, g, u) : R(a, g, u), Dt(a, o) && d.state.next({ ...s, name: a }), d.state.next({
|
|
1314
|
+
name: c.mount ? a : void 0,
|
|
1315
1315
|
values: Y(r)
|
|
1316
1316
|
});
|
|
1317
|
-
}, P = async (
|
|
1317
|
+
}, P = async (a) => {
|
|
1318
1318
|
c.mount = !0;
|
|
1319
|
-
const l =
|
|
1320
|
-
let u = l.name,
|
|
1321
|
-
const p = _(n, u),
|
|
1322
|
-
|
|
1323
|
-
}, k =
|
|
1319
|
+
const l = a.target;
|
|
1320
|
+
let u = l.name, x = !0;
|
|
1321
|
+
const p = _(n, u), g = (O) => {
|
|
1322
|
+
x = Number.isNaN(O) || ke(O) && isNaN(O.getTime()) || ve(O, _(r, u, O));
|
|
1323
|
+
}, k = Lt(t.mode), T = Lt(t.reValidateMode);
|
|
1324
1324
|
if (p) {
|
|
1325
|
-
let O,
|
|
1326
|
-
const Me = l.type ? Ft(p._f) : er(
|
|
1327
|
-
U(r, u, Me), we ? (p._f.onBlur && p._f.onBlur(
|
|
1325
|
+
let O, ae;
|
|
1326
|
+
const Me = l.type ? Ft(p._f) : er(a), we = a.type === St.BLUR || a.type === St.FOCUS_OUT, hs = !hr(p._f) && !t.resolver && !_(s.errors, u) && !p._f.deps || br(we, _(s.touchedFields, u), s.isSubmitted, T, k), Ze = Dt(u, o, we);
|
|
1327
|
+
U(r, u, Me), we ? (p._f.onBlur && p._f.onBlur(a), f && f(0)) : p._f.onChange && p._f.onChange(a);
|
|
1328
1328
|
const et = $(u, Me, we), ys = !se(et) || Ze;
|
|
1329
|
-
if (!we &&
|
|
1329
|
+
if (!we && d.state.next({
|
|
1330
1330
|
name: u,
|
|
1331
|
-
type:
|
|
1331
|
+
type: a.type,
|
|
1332
1332
|
values: Y(r)
|
|
1333
1333
|
}), hs)
|
|
1334
|
-
return (
|
|
1335
|
-
if (!we && Ze &&
|
|
1334
|
+
return (b.isValid || m.isValid) && (t.mode === "onBlur" ? we && v() : we || v()), ys && d.state.next({ name: u, ...Ze ? {} : et });
|
|
1335
|
+
if (!we && Ze && d.state.next({ ...s }), t.resolver) {
|
|
1336
1336
|
const { errors: pt } = await V([u]);
|
|
1337
|
-
if (
|
|
1337
|
+
if (g(Me), x) {
|
|
1338
1338
|
const gs = Vt(s.errors, n, u), wt = Vt(pt, n, gs.name || u);
|
|
1339
|
-
O = wt.error, u = wt.name,
|
|
1339
|
+
O = wt.error, u = wt.name, ae = se(pt);
|
|
1340
1340
|
}
|
|
1341
1341
|
} else
|
|
1342
|
-
q([u], !0), O = (await Ot(p,
|
|
1343
|
-
|
|
1342
|
+
q([u], !0), O = (await Ot(p, o.disabled, r, w, t.shouldUseNativeValidation))[u], q([u]), g(Me), x && (O ? ae = !1 : (b.isValid || m.isValid) && (ae = await B(n, !0)));
|
|
1343
|
+
x && (p._f.deps && ne(p._f.deps), G(u, ae, O, et));
|
|
1344
1344
|
}
|
|
1345
|
-
}, ee = (
|
|
1346
|
-
if (_(s.errors, l) &&
|
|
1347
|
-
return
|
|
1348
|
-
}, ne = async (
|
|
1349
|
-
let u,
|
|
1350
|
-
const p = Fe(
|
|
1345
|
+
}, ee = (a, l) => {
|
|
1346
|
+
if (_(s.errors, l) && a.focus)
|
|
1347
|
+
return a.focus(), 1;
|
|
1348
|
+
}, ne = async (a, l = {}) => {
|
|
1349
|
+
let u, x;
|
|
1350
|
+
const p = Fe(a);
|
|
1351
1351
|
if (t.resolver) {
|
|
1352
|
-
const
|
|
1353
|
-
u = se(
|
|
1354
|
-
} else
|
|
1355
|
-
const k = _(n,
|
|
1356
|
-
return await B(k && k._f ? { [
|
|
1357
|
-
}))).every(Boolean), !(!
|
|
1358
|
-
return
|
|
1359
|
-
...!ye(
|
|
1360
|
-
...t.resolver || !
|
|
1352
|
+
const g = await le(W(a) ? a : p);
|
|
1353
|
+
u = se(g), x = a ? !p.some((k) => _(g, k)) : u;
|
|
1354
|
+
} else a ? (x = (await Promise.all(p.map(async (g) => {
|
|
1355
|
+
const k = _(n, g);
|
|
1356
|
+
return await B(k && k._f ? { [g]: k } : k);
|
|
1357
|
+
}))).every(Boolean), !(!x && !s.isValid) && v()) : x = u = await B(n);
|
|
1358
|
+
return d.state.next({
|
|
1359
|
+
...!ye(a) || (b.isValid || m.isValid) && u !== s.isValid ? {} : { name: a },
|
|
1360
|
+
...t.resolver || !a ? { isValid: u } : {},
|
|
1361
1361
|
errors: s.errors
|
|
1362
|
-
}), l.shouldFocus && !
|
|
1363
|
-
}, ue = (
|
|
1362
|
+
}), l.shouldFocus && !x && Le(n, ee, a ? p : o.mount), x;
|
|
1363
|
+
}, ue = (a) => {
|
|
1364
1364
|
const l = {
|
|
1365
1365
|
...c.mount ? r : i
|
|
1366
1366
|
};
|
|
1367
|
-
return W(
|
|
1368
|
-
}, Ie = (
|
|
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
|
-
}), Ce = (
|
|
1375
|
-
|
|
1376
|
-
errors:
|
|
1367
|
+
return W(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)), d.state.next({
|
|
1376
|
+
errors: a ? s.errors : {}
|
|
1377
1377
|
});
|
|
1378
|
-
}, dt = (
|
|
1379
|
-
const
|
|
1380
|
-
U(s.errors,
|
|
1378
|
+
}, dt = (a, l, u) => {
|
|
1379
|
+
const x = (_(n, a, { _f: {} })._f || {}).ref, p = _(s.errors, a) || {}, { ref: g, message: k, type: T, ...O } = p;
|
|
1380
|
+
U(s.errors, a, {
|
|
1381
1381
|
...O,
|
|
1382
1382
|
...l,
|
|
1383
|
-
ref:
|
|
1384
|
-
}),
|
|
1385
|
-
name:
|
|
1383
|
+
ref: x
|
|
1384
|
+
}), d.state.next({
|
|
1385
|
+
name: a,
|
|
1386
1386
|
errors: s.errors,
|
|
1387
1387
|
isValid: !1
|
|
1388
|
-
}), u && u.shouldFocus &&
|
|
1389
|
-
}, cs = (
|
|
1390
|
-
next: (u) => "values" in u &&
|
|
1391
|
-
}) : N(
|
|
1388
|
+
}), u && u.shouldFocus && x && x.focus && x.focus();
|
|
1389
|
+
}, cs = (a, l) => fe(a) ? d.state.subscribe({
|
|
1390
|
+
next: (u) => "values" in u && a(N(void 0, l), u)
|
|
1391
|
+
}) : N(a, l, !0), ft = (a) => d.state.subscribe({
|
|
1392
1392
|
next: (l) => {
|
|
1393
|
-
gr(
|
|
1393
|
+
gr(a.name, l.name, a.exact) && yr(l, a.formState || b, 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 = (
|
|
1401
|
-
...
|
|
1402
|
-
...
|
|
1400
|
+
}).unsubscribe, ls = (a) => (c.mount = !0, m = {
|
|
1401
|
+
...m,
|
|
1402
|
+
...a.formState
|
|
1403
1403
|
}, ft({
|
|
1404
|
-
...
|
|
1405
|
-
formState:
|
|
1406
|
-
})), Je = (
|
|
1407
|
-
for (const u of
|
|
1408
|
-
|
|
1409
|
-
|
|
1404
|
+
...a,
|
|
1405
|
+
formState: m
|
|
1406
|
+
})), Je = (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
|
+
d.state.next({
|
|
1410
1410
|
values: Y(r)
|
|
1411
|
-
}),
|
|
1411
|
+
}), d.state.next({
|
|
1412
1412
|
...s,
|
|
1413
1413
|
...l.keepDirty ? { isDirty: I() } : {}
|
|
1414
|
-
}), !l.keepIsValid &&
|
|
1415
|
-
}, mt = ({ disabled:
|
|
1416
|
-
(he(
|
|
1417
|
-
}, Ye = (
|
|
1418
|
-
let u = _(n,
|
|
1419
|
-
const
|
|
1420
|
-
return U(n,
|
|
1414
|
+
}), !l.keepIsValid && v();
|
|
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
|
+
}, Ye = (a, l = {}) => {
|
|
1418
|
+
let u = _(n, a);
|
|
1419
|
+
const x = he(l.disabled) || he(t.disabled);
|
|
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
|
-
}) : D(
|
|
1432
|
-
...
|
|
1430
|
+
name: a
|
|
1431
|
+
}) : D(a, !0, l.value), {
|
|
1432
|
+
...x ? { disabled: l.disabled || t.disabled } : {},
|
|
1433
1433
|
...t.progressive ? {
|
|
1434
1434
|
required: !!l.required,
|
|
1435
1435
|
min: $e(l.min),
|
|
@@ -1438,139 +1438,139 @@ function xr(e = {}) {
|
|
|
1438
1438
|
maxLength: $e(l.maxLength),
|
|
1439
1439
|
pattern: $e(l.pattern)
|
|
1440
1440
|
} : {},
|
|
1441
|
-
name:
|
|
1441
|
+
name: a,
|
|
1442
1442
|
onChange: P,
|
|
1443
1443
|
onBlur: P,
|
|
1444
1444
|
ref: (p) => {
|
|
1445
1445
|
if (p) {
|
|
1446
|
-
Ye(
|
|
1447
|
-
const
|
|
1448
|
-
if (k ?
|
|
1446
|
+
Ye(a, l), u = _(n, a);
|
|
1447
|
+
const g = W(p.value) && p.querySelectorAll && p.querySelectorAll("input,select,textarea")[0] || p, k = lr(g), T = u._f.refs || [];
|
|
1448
|
+
if (k ? T.find((O) => O === g) : g === u._f.ref)
|
|
1449
1449
|
return;
|
|
1450
|
-
U(n,
|
|
1450
|
+
U(n, a, {
|
|
1451
1451
|
_f: {
|
|
1452
1452
|
...u._f,
|
|
1453
1453
|
...k ? {
|
|
1454
1454
|
refs: [
|
|
1455
|
-
...
|
|
1456
|
-
|
|
1457
|
-
...Array.isArray(_(i,
|
|
1455
|
+
...T.filter(st),
|
|
1456
|
+
g,
|
|
1457
|
+
...Array.isArray(_(i, a)) ? [{}] : []
|
|
1458
1458
|
],
|
|
1459
|
-
ref: { type:
|
|
1460
|
-
} : { ref:
|
|
1459
|
+
ref: { type: g.type, name: a }
|
|
1460
|
+
} : { ref: g }
|
|
1461
1461
|
}
|
|
1462
|
-
}), D(
|
|
1462
|
+
}), D(a, !1, void 0, g);
|
|
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
|
-
}, Xe = () => t.shouldFocusError &&
|
|
1468
|
-
he(
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1471
|
-
p.disabled =
|
|
1467
|
+
}, Xe = () => t.shouldFocusError && Le(n, ee, o.mount), us = (a) => {
|
|
1468
|
+
he(a) && (d.state.next({ disabled: a }), Le(n, (l, u) => {
|
|
1469
|
+
const x = _(n, u);
|
|
1470
|
+
x && (l.disabled = x._f.disabled || a, Array.isArray(x._f.refs) && x._f.refs.forEach((p) => {
|
|
1471
|
+
p.disabled = x._f.disabled || a;
|
|
1472
1472
|
}));
|
|
1473
1473
|
}, 0, !1));
|
|
1474
|
-
}, ht = (
|
|
1475
|
-
let
|
|
1474
|
+
}, ht = (a, l) => async (u) => {
|
|
1475
|
+
let x;
|
|
1476
1476
|
u && (u.preventDefault && u.preventDefault(), u.persist && u.persist());
|
|
1477
1477
|
let p = Y(r);
|
|
1478
|
-
if (
|
|
1478
|
+
if (d.state.next({
|
|
1479
1479
|
isSubmitting: !0
|
|
1480
1480
|
}), t.resolver) {
|
|
1481
|
-
const { errors:
|
|
1482
|
-
s.errors =
|
|
1481
|
+
const { errors: g, values: k } = await V();
|
|
1482
|
+
s.errors = g, p = Y(k);
|
|
1483
1483
|
} else
|
|
1484
1484
|
await B(n);
|
|
1485
|
-
if (
|
|
1486
|
-
for (const
|
|
1487
|
-
|
|
1488
|
-
if (
|
|
1489
|
-
|
|
1485
|
+
if (o.disabled.size)
|
|
1486
|
+
for (const g of o.disabled)
|
|
1487
|
+
Q(p, g);
|
|
1488
|
+
if (Q(s.errors, "root"), se(s.errors)) {
|
|
1489
|
+
d.state.next({
|
|
1490
1490
|
errors: {}
|
|
1491
1491
|
});
|
|
1492
1492
|
try {
|
|
1493
|
-
await
|
|
1494
|
-
} catch (
|
|
1495
|
-
|
|
1493
|
+
await a(p, u);
|
|
1494
|
+
} catch (g) {
|
|
1495
|
+
x = g;
|
|
1496
1496
|
}
|
|
1497
1497
|
} else
|
|
1498
1498
|
l && await l({ ...s.errors }, u), Xe(), setTimeout(Xe);
|
|
1499
|
-
if (
|
|
1499
|
+
if (d.state.next({
|
|
1500
1500
|
isSubmitted: !0,
|
|
1501
1501
|
isSubmitting: !1,
|
|
1502
|
-
isSubmitSuccessful: se(s.errors) && !
|
|
1502
|
+
isSubmitSuccessful: se(s.errors) && !x,
|
|
1503
1503
|
submitCount: s.submitCount + 1,
|
|
1504
1504
|
errors: s.errors
|
|
1505
|
-
}),
|
|
1506
|
-
throw
|
|
1507
|
-
}, ds = (
|
|
1508
|
-
_(n,
|
|
1509
|
-
}, yt = (
|
|
1510
|
-
const u =
|
|
1505
|
+
}), x)
|
|
1506
|
+
throw x;
|
|
1507
|
+
}, ds = (a, l = {}) => {
|
|
1508
|
+
_(n, a) && (W(l.defaultValue) ? Z(a, Y(_(i, a))) : (Z(a, l.defaultValue), U(i, a, Y(l.defaultValue))), l.keepTouched || Q(s.touchedFields, a), l.keepDirty || (Q(s.dirtyFields, a), s.isDirty = l.defaultValue ? I(a, Y(_(i, a))) : I()), l.keepError || (Q(s.errors, a), b.isValid && v()), d.state.next({ ...s }));
|
|
1509
|
+
}, yt = (a, l = {}) => {
|
|
1510
|
+
const u = a ? Y(a) : i, x = Y(u), p = se(a), g = p ? i : x;
|
|
1511
1511
|
if (l.keepDefaultValues || (i = u), !l.keepValues) {
|
|
1512
1512
|
if (l.keepDirtyValues) {
|
|
1513
1513
|
const k = /* @__PURE__ */ new Set([
|
|
1514
|
-
...
|
|
1514
|
+
...o.mount,
|
|
1515
1515
|
...Object.keys(Ee(i, r))
|
|
1516
1516
|
]);
|
|
1517
|
-
for (const
|
|
1518
|
-
_(s.dirtyFields,
|
|
1517
|
+
for (const T of Array.from(k))
|
|
1518
|
+
_(s.dirtyFields, T) ? U(g, T, _(r, T)) : Z(T, _(g, T));
|
|
1519
1519
|
} else {
|
|
1520
|
-
if (nt && W(
|
|
1521
|
-
for (const k of
|
|
1522
|
-
const
|
|
1523
|
-
if (
|
|
1524
|
-
const O = Array.isArray(
|
|
1520
|
+
if (nt && W(a))
|
|
1521
|
+
for (const k of o.mount) {
|
|
1522
|
+
const T = _(n, k);
|
|
1523
|
+
if (T && T._f) {
|
|
1524
|
+
const O = Array.isArray(T._f.refs) ? T._f.refs[0] : T._f.ref;
|
|
1525
1525
|
if (qe(O)) {
|
|
1526
|
-
const
|
|
1527
|
-
if (
|
|
1528
|
-
|
|
1526
|
+
const ae = O.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 k of
|
|
1536
|
-
|
|
1535
|
+
for (const k of o.mount)
|
|
1536
|
+
Z(k, _(g, k));
|
|
1537
1537
|
else
|
|
1538
1538
|
n = {};
|
|
1539
1539
|
}
|
|
1540
|
-
r = t.shouldUnregister ? l.keepDefaultValues ? Y(i) : {} : Y(
|
|
1541
|
-
values: { ...
|
|
1542
|
-
}),
|
|
1543
|
-
values: { ...
|
|
1540
|
+
r = t.shouldUnregister ? l.keepDefaultValues ? Y(i) : {} : Y(g), d.array.next({
|
|
1541
|
+
values: { ...g }
|
|
1542
|
+
}), d.state.next({
|
|
1543
|
+
values: { ...g }
|
|
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(),
|
|
1551
1551
|
watch: /* @__PURE__ */ new Set(),
|
|
1552
1552
|
watchAll: !1,
|
|
1553
1553
|
focus: ""
|
|
1554
|
-
}, c.mount = !
|
|
1554
|
+
}, c.mount = !b.isValid || !!l.keepIsValid || !!l.keepDirtyValues, c.watch = !!t.shouldUnregister, d.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
|
-
}, gt = (
|
|
1565
|
-
const u = _(n,
|
|
1566
|
-
if (
|
|
1567
|
-
const p =
|
|
1564
|
+
}, gt = (a, l) => yt(fe(a) ? a(r) : a, l), fs = (a, l = {}) => {
|
|
1565
|
+
const u = _(n, a), x = u && u._f;
|
|
1566
|
+
if (x) {
|
|
1567
|
+
const p = x.refs ? x.refs[0] : x.ref;
|
|
1568
1568
|
p.focus && (p.focus(), l.shouldSelect && fe(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: {
|
|
@@ -1584,21 +1584,21 @@ function xr(e = {}) {
|
|
|
1584
1584
|
_focusError: Xe,
|
|
1585
1585
|
_getWatch: N,
|
|
1586
1586
|
_getDirty: I,
|
|
1587
|
-
_setValid:
|
|
1588
|
-
_setFieldArray:
|
|
1587
|
+
_setValid: v,
|
|
1588
|
+
_setFieldArray: oe,
|
|
1589
1589
|
_setDisabledField: mt,
|
|
1590
1590
|
_setErrors: z,
|
|
1591
1591
|
_getFieldArray: E,
|
|
1592
1592
|
_reset: yt,
|
|
1593
|
-
_resetDefaultValues: () => fe(t.defaultValues) && t.defaultValues().then((
|
|
1594
|
-
gt(
|
|
1593
|
+
_resetDefaultValues: () => fe(t.defaultValues) && t.defaultValues().then((a) => {
|
|
1594
|
+
gt(a, t.resetOptions), d.state.next({
|
|
1595
1595
|
isLoading: !1
|
|
1596
1596
|
});
|
|
1597
1597
|
}),
|
|
1598
1598
|
_removeUnmounted: M,
|
|
1599
1599
|
_disableForm: us,
|
|
1600
|
-
_subjects:
|
|
1601
|
-
_proxyFormState:
|
|
1600
|
+
_subjects: d,
|
|
1601
|
+
_proxyFormState: b,
|
|
1602
1602
|
get _fields() {
|
|
1603
1603
|
return n;
|
|
1604
1604
|
},
|
|
@@ -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,10 +1626,10 @@ 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
|
},
|
|
@@ -1638,7 +1638,7 @@ function xr(e = {}) {
|
|
|
1638
1638
|
register: Ye,
|
|
1639
1639
|
handleSubmit: ht,
|
|
1640
1640
|
watch: cs,
|
|
1641
|
-
setValue:
|
|
1641
|
+
setValue: Z,
|
|
1642
1642
|
getValues: ue,
|
|
1643
1643
|
reset: gt,
|
|
1644
1644
|
resetField: ds,
|
|
@@ -1653,7 +1653,7 @@ function xr(e = {}) {
|
|
|
1653
1653
|
formControl: bt
|
|
1654
1654
|
};
|
|
1655
1655
|
}
|
|
1656
|
-
function
|
|
1656
|
+
function os(e = {}) {
|
|
1657
1657
|
const t = ie.useRef(void 0), s = ie.useRef(void 0), [n, i] = ie.useState({
|
|
1658
1658
|
isDirty: !1,
|
|
1659
1659
|
isValidating: !1,
|
|
@@ -1678,21 +1678,21 @@ function as(e = {}) {
|
|
|
1678
1678
|
formState: n
|
|
1679
1679
|
}, e.defaultValues && !fe(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
1698
|
}, [r]), ie.useEffect(() => r._disableForm(e.disabled), [r, e.disabled]), ie.useEffect(() => {
|
|
@@ -1719,26 +1719,26 @@ function as(e = {}) {
|
|
|
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 } = Se(), {
|
|
1724
1724
|
defaultValues: i,
|
|
1725
1725
|
mutationFn: r,
|
|
1726
1726
|
formToDto: c,
|
|
1727
|
-
onError:
|
|
1728
|
-
onSuccess:
|
|
1729
|
-
queryKey:
|
|
1730
|
-
onSuccessMessage:
|
|
1731
|
-
} = e, { control:
|
|
1727
|
+
onError: o,
|
|
1728
|
+
onSuccess: f,
|
|
1729
|
+
queryKey: y,
|
|
1730
|
+
onSuccessMessage: b
|
|
1731
|
+
} = e, { control: m, handleSubmit: d, reset: w, setError: C, getValues: v, setValue: q } = os({
|
|
1732
1732
|
defaultValues: i
|
|
1733
|
-
}),
|
|
1733
|
+
}), oe = F(
|
|
1734
1734
|
(D) => {
|
|
1735
1735
|
const $ = D == null ? void 0 : D.errors, G = [];
|
|
1736
1736
|
return $ && $.forEach(([V, le]) => {
|
|
1737
1737
|
const B = document.querySelector(`[name="${V}"]`);
|
|
1738
|
-
(B instanceof HTMLInputElement || B instanceof HTMLTextAreaElement || B instanceof HTMLSelectElement) && (B.focus(), B.classList.add("error"), G.push(t(`_entities:${
|
|
1738
|
+
(B instanceof HTMLInputElement || B instanceof HTMLTextAreaElement || B instanceof HTMLSelectElement) && (B.focus(), B.classList.add("error"), G.push(t(`_entities:${y}.${V}.${le}`)));
|
|
1739
1739
|
}), G;
|
|
1740
1740
|
},
|
|
1741
|
-
[t,
|
|
1741
|
+
[t, y]
|
|
1742
1742
|
), S = F(() => {
|
|
1743
1743
|
document.querySelectorAll("input, textarea, select").forEach(($) => {
|
|
1744
1744
|
$.classList.remove("error");
|
|
@@ -1749,9 +1749,9 @@ const an = (e) => {
|
|
|
1749
1749
|
onError: (D) => {
|
|
1750
1750
|
console.error(D);
|
|
1751
1751
|
const $ = D;
|
|
1752
|
-
if (
|
|
1753
|
-
else if (
|
|
1754
|
-
const G =
|
|
1752
|
+
if (o) o(D);
|
|
1753
|
+
else if (Qe($)) {
|
|
1754
|
+
const G = oe($);
|
|
1755
1755
|
s(
|
|
1756
1756
|
G.map(
|
|
1757
1757
|
(V) => ({
|
|
@@ -1771,69 +1771,69 @@ const an = (e) => {
|
|
|
1771
1771
|
}
|
|
1772
1772
|
},
|
|
1773
1773
|
onSuccess: async (D) => {
|
|
1774
|
-
pe && await pe.invalidateQueries({ queryKey:
|
|
1775
|
-
message:
|
|
1774
|
+
pe && await pe.invalidateQueries({ queryKey: y }), f && f(D), b && n({
|
|
1775
|
+
message: b
|
|
1776
1776
|
});
|
|
1777
1777
|
}
|
|
1778
1778
|
}
|
|
1779
1779
|
);
|
|
1780
1780
|
return {
|
|
1781
|
-
control:
|
|
1782
|
-
getValues:
|
|
1781
|
+
control: m,
|
|
1782
|
+
getValues: v,
|
|
1783
1783
|
setValue: q,
|
|
1784
|
-
handleSubmit:
|
|
1784
|
+
handleSubmit: d,
|
|
1785
1785
|
onSubmit: (D) => z.mutate(
|
|
1786
1786
|
c ? c(D) : D
|
|
1787
1787
|
),
|
|
1788
1788
|
reset: w,
|
|
1789
1789
|
setError: C,
|
|
1790
|
-
parseFormError:
|
|
1790
|
+
parseFormError: oe,
|
|
1791
1791
|
releaseFormError: S,
|
|
1792
1792
|
isLoading: z.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
1797
|
action: F(
|
|
1798
1798
|
(c) => ({
|
|
1799
1799
|
id: _e.Delete,
|
|
1800
1800
|
hidden: !!c.deletedAt || n,
|
|
1801
1801
|
disabled: !!c.deletedAt || i,
|
|
1802
|
-
icon: /* @__PURE__ */
|
|
1802
|
+
icon: /* @__PURE__ */ h(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
|
-
onMultipleClick: (
|
|
1805
|
+
onMultipleClick: (o) => s(o.map((f) => f.id)),
|
|
1806
1806
|
multiple: !0
|
|
1807
1807
|
}),
|
|
1808
1808
|
[i, n, s, t]
|
|
1809
1809
|
)
|
|
1810
1810
|
};
|
|
1811
1811
|
}, Cr = (e) => {
|
|
1812
|
-
const { t } =
|
|
1812
|
+
const { t } = L(), { onClick: s, hidden: n = !1 } = e;
|
|
1813
1813
|
return {
|
|
1814
1814
|
action: F(
|
|
1815
1815
|
(r) => ({
|
|
1816
1816
|
id: _e.Restore,
|
|
1817
1817
|
hidden: !r.deletedAt || n,
|
|
1818
1818
|
disabled: !r.deletedAt,
|
|
1819
|
-
icon: /* @__PURE__ */
|
|
1819
|
+
icon: /* @__PURE__ */ h(ce, { className: "text-red-500", icon: Mt }),
|
|
1820
1820
|
tooltip: t("_pages:common.actions.restore.text"),
|
|
1821
1821
|
onClick: () => s([r == null ? void 0 : r.id]),
|
|
1822
|
-
onMultipleClick: (c) => s(c.map((
|
|
1822
|
+
onMultipleClick: (c) => s(c.map((o) => o.id)),
|
|
1823
1823
|
multiple: !0
|
|
1824
1824
|
}),
|
|
1825
1825
|
[n, s, t]
|
|
1826
1826
|
)
|
|
1827
1827
|
};
|
|
1828
|
-
},
|
|
1829
|
-
const { t } =
|
|
1828
|
+
}, an = (e) => {
|
|
1829
|
+
const { t } = L(), { onClick: s, hidden: n = !1 } = e;
|
|
1830
1830
|
return {
|
|
1831
1831
|
action: F(
|
|
1832
1832
|
(r) => ({
|
|
1833
1833
|
id: _e.Edit,
|
|
1834
1834
|
hidden: !!r.deletedAt || n,
|
|
1835
1835
|
disabled: !!r.deletedAt,
|
|
1836
|
-
icon: /* @__PURE__ */
|
|
1836
|
+
icon: /* @__PURE__ */ h(ce, { className: "primary", icon: $s }),
|
|
1837
1837
|
tooltip: t("_pages:common.actions.edit.text"),
|
|
1838
1838
|
onClick: () => s(r == null ? void 0 : r.id)
|
|
1839
1839
|
}),
|
|
@@ -1843,7 +1843,7 @@ const an = (e) => {
|
|
|
1843
1843
|
};
|
|
1844
1844
|
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 || {});
|
|
1845
1845
|
const kr = (e) => {
|
|
1846
|
-
const { t } =
|
|
1846
|
+
const { t } = L(), {
|
|
1847
1847
|
onClick: s,
|
|
1848
1848
|
hidden: n = !1,
|
|
1849
1849
|
disabled: i = !1,
|
|
@@ -1855,7 +1855,7 @@ const kr = (e) => {
|
|
|
1855
1855
|
id: _e.Export,
|
|
1856
1856
|
hidden: n,
|
|
1857
1857
|
disabled: i,
|
|
1858
|
-
icon: /* @__PURE__ */
|
|
1858
|
+
icon: /* @__PURE__ */ h(
|
|
1859
1859
|
ce,
|
|
1860
1860
|
{
|
|
1861
1861
|
className: `${r ? "rotate" : ""}`,
|
|
@@ -1869,7 +1869,7 @@ const kr = (e) => {
|
|
|
1869
1869
|
)
|
|
1870
1870
|
};
|
|
1871
1871
|
}, Sr = (e) => {
|
|
1872
|
-
const { t } =
|
|
1872
|
+
const { t } = L(), {
|
|
1873
1873
|
onClick: s,
|
|
1874
1874
|
hidden: n = !1,
|
|
1875
1875
|
disabled: i = !1,
|
|
@@ -1881,11 +1881,11 @@ const kr = (e) => {
|
|
|
1881
1881
|
id: _e.Import,
|
|
1882
1882
|
hidden: n,
|
|
1883
1883
|
disabled: i,
|
|
1884
|
-
icon: /* @__PURE__ */
|
|
1884
|
+
icon: /* @__PURE__ */ h(
|
|
1885
1885
|
ce,
|
|
1886
1886
|
{
|
|
1887
1887
|
className: `${r ? "rotate" : ""}`,
|
|
1888
|
-
icon: r ? Ut :
|
|
1888
|
+
icon: r ? Ut : Ls
|
|
1889
1889
|
}
|
|
1890
1890
|
),
|
|
1891
1891
|
tooltip: t("_pages:common.actions.import.text"),
|
|
@@ -1895,81 +1895,81 @@ const kr = (e) => {
|
|
|
1895
1895
|
)
|
|
1896
1896
|
};
|
|
1897
1897
|
}, cn = (e) => {
|
|
1898
|
-
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Se(), { t: r } =
|
|
1898
|
+
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Se(), { t: r } = L(), { open: c, onClick: o, close: f, dialogFn: y, isLoading: b } = Xt({
|
|
1899
1899
|
onSuccessMessage: r("_pages:common.actions.delete.successMessage"),
|
|
1900
|
-
onError: (
|
|
1901
|
-
const w =
|
|
1902
|
-
if (
|
|
1900
|
+
onError: (d) => {
|
|
1901
|
+
const w = d;
|
|
1902
|
+
if (Qe(w))
|
|
1903
1903
|
i(
|
|
1904
1904
|
w.errors.map(
|
|
1905
|
-
([C,
|
|
1906
|
-
message: r(`_pages:${C}.errors.${
|
|
1905
|
+
([C, v]) => ({
|
|
1906
|
+
message: r(`_pages:${C}.errors.${v}`),
|
|
1907
1907
|
type: j.error
|
|
1908
1908
|
})
|
|
1909
1909
|
)
|
|
1910
1910
|
);
|
|
1911
1911
|
else if (We(w)) {
|
|
1912
|
-
const C = w.message || r("_accessibility:errors.500"),
|
|
1912
|
+
const C = w.message || r("_accessibility:errors.500"), v = r(`_accessibility:errors.${w.status}`);
|
|
1913
1913
|
i([
|
|
1914
1914
|
{
|
|
1915
|
-
message:
|
|
1915
|
+
message: v || C,
|
|
1916
1916
|
type: j.error
|
|
1917
1917
|
}
|
|
1918
1918
|
]);
|
|
1919
1919
|
}
|
|
1920
1920
|
},
|
|
1921
|
-
onSuccess: async (
|
|
1922
|
-
await pe.invalidateQueries({ queryKey: t }), s && s(
|
|
1921
|
+
onSuccess: async (d) => {
|
|
1922
|
+
await pe.invalidateQueries({ queryKey: t }), s && s(d);
|
|
1923
1923
|
},
|
|
1924
1924
|
...n
|
|
1925
|
-
}), { action:
|
|
1925
|
+
}), { action: m } = _r({ onClick: o });
|
|
1926
1926
|
return {
|
|
1927
|
-
onClick:
|
|
1927
|
+
onClick: o,
|
|
1928
1928
|
title: r("_pages:common.actions.delete.dialog.title"),
|
|
1929
1929
|
open: c,
|
|
1930
|
-
isLoading:
|
|
1931
|
-
handleSubmit: () =>
|
|
1932
|
-
handleClose:
|
|
1933
|
-
action:
|
|
1930
|
+
isLoading: b,
|
|
1931
|
+
handleSubmit: () => y.mutate(),
|
|
1932
|
+
handleClose: f,
|
|
1933
|
+
action: m
|
|
1934
1934
|
};
|
|
1935
|
-
},
|
|
1935
|
+
}, as = () => {
|
|
1936
1936
|
const [e, t] = H(!1);
|
|
1937
1937
|
return { open: e, setOpen: t, handleClose: () => t(!1), handleOpen: () => t(!0) };
|
|
1938
1938
|
}, ln = (e) => {
|
|
1939
|
-
const { t } =
|
|
1939
|
+
const { t } = L(), {
|
|
1940
1940
|
showErrorNotification: s,
|
|
1941
1941
|
showStackNotifications: n,
|
|
1942
1942
|
showSuccessNotification: i
|
|
1943
1943
|
} = Se(), {
|
|
1944
1944
|
defaultValues: r,
|
|
1945
1945
|
getFunction: c,
|
|
1946
|
-
mutationFn:
|
|
1947
|
-
formToDto:
|
|
1948
|
-
dtoToForm:
|
|
1949
|
-
onError:
|
|
1950
|
-
onSuccess:
|
|
1951
|
-
queryKey:
|
|
1946
|
+
mutationFn: o,
|
|
1947
|
+
formToDto: f,
|
|
1948
|
+
dtoToForm: y,
|
|
1949
|
+
onError: b,
|
|
1950
|
+
onSuccess: m,
|
|
1951
|
+
queryKey: d,
|
|
1952
1952
|
onSuccessMessage: w,
|
|
1953
1953
|
title: C
|
|
1954
|
-
} = e, [
|
|
1954
|
+
} = e, [v, q] = H(0), { open: oe, handleClose: S, handleOpen: z } = as(), { control: D, handleSubmit: $, reset: G, setError: V, getValues: le, setValue: B } = os({
|
|
1955
1955
|
defaultValues: r
|
|
1956
|
-
}), { data: M, isLoading: I } =
|
|
1957
|
-
queryFn: () => c == null ? void 0 : c(
|
|
1958
|
-
queryKey: [...
|
|
1959
|
-
enabled: !!c && !!
|
|
1956
|
+
}), { data: M, isLoading: I } = Ks({
|
|
1957
|
+
queryFn: () => c == null ? void 0 : c(v),
|
|
1958
|
+
queryKey: [...d, v],
|
|
1959
|
+
enabled: !!c && !!d && !!v
|
|
1960
1960
|
});
|
|
1961
|
-
|
|
1962
|
-
M &&
|
|
1961
|
+
X(() => {
|
|
1962
|
+
M && y && G({ ...y(M) });
|
|
1963
1963
|
}, [M]);
|
|
1964
1964
|
const N = F(
|
|
1965
1965
|
(P) => {
|
|
1966
1966
|
const ee = P == null ? void 0 : P.errors, ne = [];
|
|
1967
1967
|
return ee && ee.forEach(([ue, Ie]) => {
|
|
1968
1968
|
const Ce = document.querySelector(`[name="${ue}"]`);
|
|
1969
|
-
(Ce instanceof HTMLInputElement || Ce instanceof HTMLTextAreaElement || Ce instanceof HTMLSelectElement) && (Ce.focus(), Ce.classList.add("error"), ne.push(t(`_entities:${
|
|
1969
|
+
(Ce instanceof HTMLInputElement || Ce instanceof HTMLTextAreaElement || Ce instanceof HTMLSelectElement) && (Ce.focus(), Ce.classList.add("error"), ne.push(t(`_entities:${d}.${ue}.${Ie}`)));
|
|
1970
1970
|
}), ne;
|
|
1971
1971
|
},
|
|
1972
|
-
[t,
|
|
1972
|
+
[t, d]
|
|
1973
1973
|
), E = F(() => {
|
|
1974
1974
|
document.querySelectorAll("input, textarea, select").forEach((ee) => {
|
|
1975
1975
|
ee.classList.remove("error");
|
|
@@ -1981,13 +1981,13 @@ const kr = (e) => {
|
|
|
1981
1981
|
[z]
|
|
1982
1982
|
), J = F(() => {
|
|
1983
1983
|
E(), S(), G();
|
|
1984
|
-
}, [G, E, S]),
|
|
1985
|
-
mutationFn:
|
|
1984
|
+
}, [G, E, S]), Z = Pe({
|
|
1985
|
+
mutationFn: o,
|
|
1986
1986
|
onError: (P) => {
|
|
1987
|
-
if (console.error(P),
|
|
1987
|
+
if (console.error(P), b) b(P);
|
|
1988
1988
|
else {
|
|
1989
1989
|
const ee = P;
|
|
1990
|
-
if (
|
|
1990
|
+
if (Qe(ee)) {
|
|
1991
1991
|
const ne = N(ee);
|
|
1992
1992
|
n(
|
|
1993
1993
|
ne.map(
|
|
@@ -2005,132 +2005,132 @@ const kr = (e) => {
|
|
|
2005
2005
|
}
|
|
2006
2006
|
},
|
|
2007
2007
|
onSuccess: async (P) => {
|
|
2008
|
-
await pe.invalidateQueries({ queryKey:
|
|
2008
|
+
await pe.invalidateQueries({ queryKey: d }), m && m(P), i({
|
|
2009
2009
|
message: w
|
|
2010
2010
|
}), J();
|
|
2011
2011
|
}
|
|
2012
2012
|
});
|
|
2013
2013
|
return {
|
|
2014
|
-
open:
|
|
2014
|
+
open: oe,
|
|
2015
2015
|
openDialog: R,
|
|
2016
2016
|
handleClose: J,
|
|
2017
2017
|
control: D,
|
|
2018
2018
|
getValues: le,
|
|
2019
2019
|
setValue: B,
|
|
2020
2020
|
handleSubmit: $,
|
|
2021
|
-
onSubmit: (P) =>
|
|
2022
|
-
|
|
2021
|
+
onSubmit: (P) => Z.mutate(
|
|
2022
|
+
f ? f(P) : P
|
|
2023
2023
|
),
|
|
2024
2024
|
reset: G,
|
|
2025
2025
|
setError: V,
|
|
2026
2026
|
parseFormError: N,
|
|
2027
2027
|
releaseFormError: E,
|
|
2028
2028
|
title: C,
|
|
2029
|
-
isLoading: I ||
|
|
2029
|
+
isLoading: I || Z.isPending
|
|
2030
2030
|
};
|
|
2031
2031
|
}, un = (e) => {
|
|
2032
|
-
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Se(), { t: r } =
|
|
2032
|
+
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Se(), { t: r } = L(), { open: c, onClick: o, close: f, dialogFn: y, isLoading: b } = Xt({
|
|
2033
2033
|
onSuccessMessage: r("_pages:common.actions.restore.successMessage"),
|
|
2034
|
-
onError: (
|
|
2035
|
-
const w =
|
|
2036
|
-
if (
|
|
2034
|
+
onError: (d) => {
|
|
2035
|
+
const w = d;
|
|
2036
|
+
if (Qe(w))
|
|
2037
2037
|
i(
|
|
2038
2038
|
w.errors.map(
|
|
2039
|
-
([C,
|
|
2040
|
-
message: r(`_pages:${C}.errors.${
|
|
2039
|
+
([C, v]) => ({
|
|
2040
|
+
message: r(`_pages:${C}.errors.${v}`),
|
|
2041
2041
|
type: j.error
|
|
2042
2042
|
})
|
|
2043
2043
|
)
|
|
2044
2044
|
);
|
|
2045
2045
|
else if (We(w)) {
|
|
2046
|
-
const C = w.message || r("_accessibility:errors.500"),
|
|
2046
|
+
const C = w.message || r("_accessibility:errors.500"), v = r(`_accessibility:errors.${w.status}`);
|
|
2047
2047
|
i([
|
|
2048
2048
|
{
|
|
2049
|
-
message:
|
|
2049
|
+
message: v || C,
|
|
2050
2050
|
type: j.error
|
|
2051
2051
|
}
|
|
2052
2052
|
]);
|
|
2053
2053
|
}
|
|
2054
2054
|
},
|
|
2055
|
-
onSuccess: async (
|
|
2056
|
-
await pe.invalidateQueries({ queryKey: t }), s && s(
|
|
2055
|
+
onSuccess: async (d) => {
|
|
2056
|
+
await pe.invalidateQueries({ queryKey: t }), s && s(d);
|
|
2057
2057
|
},
|
|
2058
2058
|
...n
|
|
2059
|
-
}), { action:
|
|
2059
|
+
}), { action: m } = Cr({ onClick: o });
|
|
2060
2060
|
return {
|
|
2061
|
-
onClick:
|
|
2061
|
+
onClick: o,
|
|
2062
2062
|
title: r("_pages:common.actions.restore.dialog.title"),
|
|
2063
2063
|
open: c,
|
|
2064
|
-
isLoading:
|
|
2065
|
-
handleSubmit: () =>
|
|
2066
|
-
handleClose:
|
|
2067
|
-
action:
|
|
2064
|
+
isLoading: b,
|
|
2065
|
+
handleSubmit: () => y.mutate(),
|
|
2066
|
+
handleClose: f,
|
|
2067
|
+
action: m
|
|
2068
2068
|
};
|
|
2069
2069
|
};
|
|
2070
2070
|
function dn(e) {
|
|
2071
|
-
const { t } =
|
|
2071
|
+
const { t } = L(), { queryKey: s, mutationFn: n, entity: i, fileProcessor: r, onError: c } = e, [o, f] = H(!1), [y, b] = H(null), [m, d] = H(!1), w = Pe({
|
|
2072
2072
|
mutationFn: n,
|
|
2073
|
-
onError: (
|
|
2074
|
-
console.error(
|
|
2073
|
+
onError: (v) => {
|
|
2074
|
+
console.error(v), c == null || c(v);
|
|
2075
2075
|
},
|
|
2076
2076
|
onSuccess: async () => {
|
|
2077
2077
|
pe && await pe.invalidateQueries({ queryKey: s });
|
|
2078
2078
|
}
|
|
2079
2079
|
}), { action: C } = Sr({
|
|
2080
|
-
onClick: () =>
|
|
2080
|
+
onClick: () => f(!0)
|
|
2081
2081
|
});
|
|
2082
2082
|
return {
|
|
2083
2083
|
handleSubmit: async () => {
|
|
2084
|
-
if (!(!
|
|
2084
|
+
if (!(!y || y.length === 0))
|
|
2085
2085
|
try {
|
|
2086
2086
|
await w.mutateAsync({
|
|
2087
|
-
items:
|
|
2088
|
-
override:
|
|
2089
|
-
}),
|
|
2090
|
-
} catch (
|
|
2091
|
-
console.error(
|
|
2087
|
+
items: y,
|
|
2088
|
+
override: m
|
|
2089
|
+
}), f(!1), b(null), d(!1);
|
|
2090
|
+
} catch (v) {
|
|
2091
|
+
console.error(v);
|
|
2092
2092
|
}
|
|
2093
2093
|
},
|
|
2094
2094
|
isLoading: w.isPending,
|
|
2095
2095
|
fileProcessor: r,
|
|
2096
|
-
onFileProcessed: (
|
|
2097
|
-
onOverrideChange: (
|
|
2098
|
-
open:
|
|
2096
|
+
onFileProcessed: (v) => b(v),
|
|
2097
|
+
onOverrideChange: (v) => d(v),
|
|
2098
|
+
open: o,
|
|
2099
2099
|
title: t("_pages:common.actions.import.dialog.title", {
|
|
2100
2100
|
entity: t(`_pages:${i}.title`)
|
|
2101
2101
|
}),
|
|
2102
2102
|
handleClose: () => {
|
|
2103
|
-
|
|
2103
|
+
f(!1), b(null);
|
|
2104
2104
|
},
|
|
2105
2105
|
action: C
|
|
2106
2106
|
};
|
|
2107
2107
|
}
|
|
2108
2108
|
const fn = (e) => {
|
|
2109
|
-
const { showSuccessNotification: t } = Se(), { t: s } =
|
|
2109
|
+
const { showSuccessNotification: t } = Se(), { t: s } = L(), {
|
|
2110
2110
|
entity: n,
|
|
2111
2111
|
mutationFn: i,
|
|
2112
2112
|
onError: r,
|
|
2113
2113
|
onSuccess: c,
|
|
2114
|
-
onSuccessMessage:
|
|
2115
|
-
} = e,
|
|
2114
|
+
onSuccessMessage: o = s("_pages:common.actions.export.successMessage")
|
|
2115
|
+
} = e, f = Pe({
|
|
2116
2116
|
mutationFn: () => i(),
|
|
2117
|
-
onError: (
|
|
2118
|
-
console.error(
|
|
2117
|
+
onError: (m) => {
|
|
2118
|
+
console.error(m), r && r(m);
|
|
2119
2119
|
},
|
|
2120
|
-
onSuccess: async (
|
|
2121
|
-
const
|
|
2122
|
-
|
|
2123
|
-
message:
|
|
2120
|
+
onSuccess: async (m) => {
|
|
2121
|
+
const d = JSON.stringify(m, null, 2), w = new Blob([d], { type: "application/json" }), C = URL.createObjectURL(w), v = document.createElement("a");
|
|
2122
|
+
v.href = C, v.download = `${n}.json`, v.click(), URL.revokeObjectURL(C), c && c(m), t({
|
|
2123
|
+
message: o
|
|
2124
2124
|
});
|
|
2125
2125
|
}
|
|
2126
|
-
}),
|
|
2127
|
-
|
|
2128
|
-
}, [
|
|
2129
|
-
onClick:
|
|
2130
|
-
isLoading:
|
|
2126
|
+
}), y = F(() => {
|
|
2127
|
+
f.mutate();
|
|
2128
|
+
}, [f]), { action: b } = kr({
|
|
2129
|
+
onClick: y,
|
|
2130
|
+
isLoading: f.isPending
|
|
2131
2131
|
});
|
|
2132
2132
|
return {
|
|
2133
|
-
action:
|
|
2133
|
+
action: b
|
|
2134
2134
|
};
|
|
2135
2135
|
};
|
|
2136
2136
|
function Nr(e) {
|
|
@@ -2138,16 +2138,16 @@ function Nr(e) {
|
|
|
2138
2138
|
const i = window.scrollY > e;
|
|
2139
2139
|
s(i);
|
|
2140
2140
|
}, [e]);
|
|
2141
|
-
return
|
|
2141
|
+
return X(() => (window.addEventListener("scroll", n), () => {
|
|
2142
2142
|
window.removeEventListener("scroll", n);
|
|
2143
2143
|
}), [n]), t;
|
|
2144
2144
|
}
|
|
2145
2145
|
const mn = () => {
|
|
2146
|
-
const { t: e } =
|
|
2147
|
-
return /* @__PURE__ */
|
|
2146
|
+
const { t: e } = L(), t = Nr(200);
|
|
2147
|
+
return /* @__PURE__ */ h(
|
|
2148
2148
|
be,
|
|
2149
2149
|
{
|
|
2150
|
-
icon:
|
|
2150
|
+
icon: Ts,
|
|
2151
2151
|
onClick: () => Gs.scrollTo(0, 0),
|
|
2152
2152
|
"data-tooltip-id": "tooltip",
|
|
2153
2153
|
"data-tooltip-content": e("_accessibility:buttons.toTop"),
|
|
@@ -2155,9 +2155,9 @@ const mn = () => {
|
|
|
2155
2155
|
}
|
|
2156
2156
|
);
|
|
2157
2157
|
}, Ar = (e) => {
|
|
2158
|
-
const { actions: t = [], className: s = "" } = e, { t: n } =
|
|
2158
|
+
const { actions: t = [], className: s = "" } = e, { t: n } = L(), [i, r] = H(!1);
|
|
2159
2159
|
return /* @__PURE__ */ A("div", { className: `actions-dropdown ${s}`, children: [
|
|
2160
|
-
/* @__PURE__ */
|
|
2160
|
+
/* @__PURE__ */ h(
|
|
2161
2161
|
be,
|
|
2162
2162
|
{
|
|
2163
2163
|
icon: Ds,
|
|
@@ -2166,7 +2166,7 @@ const mn = () => {
|
|
|
2166
2166
|
"data-tooltip-content": n("_accessibility:buttons.openActions")
|
|
2167
2167
|
}
|
|
2168
2168
|
),
|
|
2169
|
-
/* @__PURE__ */
|
|
2169
|
+
/* @__PURE__ */ h(Ws, { open: i, onClose: () => r(!1), children: /* @__PURE__ */ h(
|
|
2170
2170
|
jt,
|
|
2171
2171
|
{
|
|
2172
2172
|
showActionTexts: !0,
|
|
@@ -2183,43 +2183,43 @@ const mn = () => {
|
|
|
2183
2183
|
state: i = ws.default,
|
|
2184
2184
|
name: r = "",
|
|
2185
2185
|
id: c = "",
|
|
2186
|
-
label:
|
|
2187
|
-
disabled:
|
|
2188
|
-
required:
|
|
2189
|
-
containerClassName:
|
|
2190
|
-
inputClassName:
|
|
2191
|
-
labelClassName:
|
|
2186
|
+
label: o = "",
|
|
2187
|
+
disabled: f = !1,
|
|
2188
|
+
required: y = !1,
|
|
2189
|
+
containerClassName: b = "",
|
|
2190
|
+
inputClassName: m = "",
|
|
2191
|
+
labelClassName: d = "",
|
|
2192
2192
|
helperText: w = "",
|
|
2193
2193
|
helperTextClassName: C = "",
|
|
2194
|
-
...
|
|
2194
|
+
...v
|
|
2195
2195
|
} = e;
|
|
2196
|
-
return /* @__PURE__ */ A("div", { className: `relative z-0 w-full mb-5 group ${
|
|
2197
|
-
/* @__PURE__ */
|
|
2196
|
+
return /* @__PURE__ */ A("div", { className: `relative z-0 w-full mb-5 group ${b}`, children: [
|
|
2197
|
+
/* @__PURE__ */ h(
|
|
2198
2198
|
"textarea",
|
|
2199
2199
|
{
|
|
2200
2200
|
ref: t,
|
|
2201
2201
|
name: r,
|
|
2202
2202
|
id: c,
|
|
2203
|
-
className: `text-input text-area ${vs(i)} ${
|
|
2204
|
-
required:
|
|
2203
|
+
className: `text-input text-area ${vs(i)} ${m} peer`,
|
|
2204
|
+
required: y,
|
|
2205
2205
|
value: s,
|
|
2206
2206
|
onChange: n,
|
|
2207
|
-
disabled:
|
|
2208
|
-
...
|
|
2207
|
+
disabled: f,
|
|
2208
|
+
...v
|
|
2209
2209
|
}
|
|
2210
2210
|
),
|
|
2211
2211
|
/* @__PURE__ */ A(
|
|
2212
2212
|
"label",
|
|
2213
2213
|
{
|
|
2214
2214
|
htmlFor: r,
|
|
2215
|
-
className: `text-input-label ${xs(i)} ${
|
|
2215
|
+
className: `text-input-label ${xs(i)} ${d}`,
|
|
2216
2216
|
children: [
|
|
2217
|
-
|
|
2218
|
-
|
|
2217
|
+
o,
|
|
2218
|
+
y ? " *" : ""
|
|
2219
2219
|
]
|
|
2220
2220
|
}
|
|
2221
2221
|
),
|
|
2222
|
-
!!w && /* @__PURE__ */
|
|
2222
|
+
!!w && /* @__PURE__ */ h(
|
|
2223
2223
|
"p",
|
|
2224
2224
|
{
|
|
2225
2225
|
className: `text-input-helper-text ${_s(i)} ${C}`,
|
|
@@ -2228,13 +2228,13 @@ const mn = () => {
|
|
|
2228
2228
|
)
|
|
2229
2229
|
] });
|
|
2230
2230
|
}), yn = (e) => {
|
|
2231
|
-
const { t } =
|
|
2231
|
+
const { t } = L(), {
|
|
2232
2232
|
children: s,
|
|
2233
2233
|
handleSubmit: n,
|
|
2234
2234
|
onSubmit: i,
|
|
2235
2235
|
isLoading: r = !1,
|
|
2236
2236
|
buttonEnd: c = !0,
|
|
2237
|
-
reset:
|
|
2237
|
+
reset: o
|
|
2238
2238
|
} = e;
|
|
2239
2239
|
return /* @__PURE__ */ A("form", { className: "form-container", onSubmit: n(i), children: [
|
|
2240
2240
|
s,
|
|
@@ -2249,17 +2249,17 @@ const mn = () => {
|
|
|
2249
2249
|
name: t("_accessibility:buttons.submit"),
|
|
2250
2250
|
"aria-label": t("_accessibility:ariaLabels.submit"),
|
|
2251
2251
|
children: [
|
|
2252
|
-
r ? /* @__PURE__ */
|
|
2252
|
+
r ? /* @__PURE__ */ h(De, { color: "stroke-base", loaderClass: "!w-6 mt-1", strokeWidth: "6" }) : null,
|
|
2253
2253
|
t("_accessibility:buttons.submit")
|
|
2254
2254
|
]
|
|
2255
2255
|
}
|
|
2256
2256
|
),
|
|
2257
|
-
/* @__PURE__ */
|
|
2257
|
+
/* @__PURE__ */ h(
|
|
2258
2258
|
xe,
|
|
2259
2259
|
{
|
|
2260
2260
|
type: "button",
|
|
2261
2261
|
variant: "outlined",
|
|
2262
|
-
onClick: () =>
|
|
2262
|
+
onClick: () => o == null ? void 0 : o(),
|
|
2263
2263
|
name: t("_accessibility:buttons.cancel"),
|
|
2264
2264
|
"aria-label": t("_accessibility:ariaLabels.cancel"),
|
|
2265
2265
|
children: t("_accessibility:buttons.cancel")
|
|
@@ -2269,7 +2269,7 @@ const mn = () => {
|
|
|
2269
2269
|
] });
|
|
2270
2270
|
}, gn = It(function(e, t) {
|
|
2271
2271
|
const [s, n] = H(!1);
|
|
2272
|
-
return /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */ h(Cs, { ...e, type: s ? "text" : "password", ref: t, children: /* @__PURE__ */ h(
|
|
2273
2273
|
be,
|
|
2274
2274
|
{
|
|
2275
2275
|
type: "button",
|
|
@@ -2280,59 +2280,59 @@ const mn = () => {
|
|
|
2280
2280
|
}
|
|
2281
2281
|
) });
|
|
2282
2282
|
}), lt = (e) => {
|
|
2283
|
-
const { t } =
|
|
2283
|
+
const { t } = L(), {
|
|
2284
2284
|
title: s,
|
|
2285
2285
|
children: n,
|
|
2286
2286
|
handleClose: i,
|
|
2287
2287
|
open: r = !1,
|
|
2288
2288
|
containerClassName: c = "",
|
|
2289
|
-
className:
|
|
2290
|
-
animationClass:
|
|
2291
|
-
} = e, [
|
|
2292
|
-
(
|
|
2293
|
-
|
|
2289
|
+
className: o = "",
|
|
2290
|
+
animationClass: f = "appear"
|
|
2291
|
+
} = e, [y, b] = H(window.innerWidth), m = F(
|
|
2292
|
+
(v) => {
|
|
2293
|
+
v.key === "Escape" && r && i();
|
|
2294
2294
|
},
|
|
2295
2295
|
[r, i]
|
|
2296
2296
|
);
|
|
2297
|
-
|
|
2298
|
-
window.removeEventListener("keydown",
|
|
2299
|
-
}), [
|
|
2300
|
-
const
|
|
2301
|
-
|
|
2297
|
+
X(() => (window.addEventListener("keydown", m), () => {
|
|
2298
|
+
window.removeEventListener("keydown", m);
|
|
2299
|
+
}), [m]);
|
|
2300
|
+
const d = F(() => {
|
|
2301
|
+
b(window.innerWidth);
|
|
2302
2302
|
}, []);
|
|
2303
|
-
|
|
2304
|
-
window.removeEventListener("resize",
|
|
2305
|
-
}), [
|
|
2306
|
-
const w = Ve(() => Bs({ width: `${
|
|
2307
|
-
(
|
|
2303
|
+
X(() => (window.addEventListener("resize", d), () => {
|
|
2304
|
+
window.removeEventListener("resize", d);
|
|
2305
|
+
}), [d]);
|
|
2306
|
+
const w = Ve(() => Bs({ width: `${y}px` }), [y]), C = F(
|
|
2307
|
+
(v) => {
|
|
2308
2308
|
var q;
|
|
2309
|
-
((q =
|
|
2309
|
+
((q = v == null ? void 0 : v.currentTarget) == null ? void 0 : q.getAttribute("name")) === t("_accessibility:buttons.closeDialog") && i();
|
|
2310
2310
|
},
|
|
2311
2311
|
[t, i]
|
|
2312
2312
|
);
|
|
2313
|
-
return
|
|
2314
|
-
const
|
|
2313
|
+
return X(() => {
|
|
2314
|
+
const v = (q) => {
|
|
2315
2315
|
q ? document.body.style.overflow = "hidden" : document.body.style.overflow = "auto";
|
|
2316
2316
|
};
|
|
2317
|
-
return
|
|
2318
|
-
|
|
2317
|
+
return v(r), () => {
|
|
2318
|
+
v(r);
|
|
2319
2319
|
};
|
|
2320
2320
|
}, [r]), qt(
|
|
2321
|
-
/* @__PURE__ */
|
|
2321
|
+
/* @__PURE__ */ h(
|
|
2322
2322
|
"div",
|
|
2323
2323
|
{
|
|
2324
2324
|
"aria-label": t("_accessibility:ariaLabels.closeDialog"),
|
|
2325
2325
|
"aria-disabled": !r,
|
|
2326
2326
|
onClick: C,
|
|
2327
|
-
className: `dialog-backdrop animated ${r ? `opened ${
|
|
2327
|
+
className: `dialog-backdrop animated ${r ? `opened ${f}` : "closed"} ${w} h-screen ${r ? "bg-base/20 backdrop-blur-xl" : "pointer-events-none"} ${c}`,
|
|
2328
2328
|
children: /* @__PURE__ */ A(
|
|
2329
2329
|
"div",
|
|
2330
2330
|
{
|
|
2331
|
-
className: `dialog elevated animated ${r ? `opened ${
|
|
2331
|
+
className: `dialog elevated animated ${r ? `opened ${f}` : "closed"} ${o}`,
|
|
2332
2332
|
children: [
|
|
2333
2333
|
/* @__PURE__ */ A("div", { className: "dialog-header", children: [
|
|
2334
|
-
/* @__PURE__ */
|
|
2335
|
-
/* @__PURE__ */
|
|
2334
|
+
/* @__PURE__ */ h("h3", { className: "text-text text-xl", children: s }),
|
|
2335
|
+
/* @__PURE__ */ h(
|
|
2336
2336
|
be,
|
|
2337
2337
|
{
|
|
2338
2338
|
icon: Rt,
|
|
@@ -2361,38 +2361,38 @@ const mn = () => {
|
|
|
2361
2361
|
onCancel: i,
|
|
2362
2362
|
isLoading: r = !1,
|
|
2363
2363
|
disabled: c = !1,
|
|
2364
|
-
primaryType:
|
|
2365
|
-
containerClassName:
|
|
2366
|
-
primaryClassName:
|
|
2367
|
-
alignEnd:
|
|
2368
|
-
primaryName:
|
|
2369
|
-
primaryAriaLabel:
|
|
2364
|
+
primaryType: o = "submit",
|
|
2365
|
+
containerClassName: f = "",
|
|
2366
|
+
primaryClassName: y = "",
|
|
2367
|
+
alignEnd: b = !1,
|
|
2368
|
+
primaryName: m,
|
|
2369
|
+
primaryAriaLabel: d,
|
|
2370
2370
|
cancelName: w,
|
|
2371
2371
|
cancelAriaLabel: C
|
|
2372
2372
|
} = e;
|
|
2373
2373
|
return /* @__PURE__ */ A(
|
|
2374
2374
|
"div",
|
|
2375
2375
|
{
|
|
2376
|
-
className: `flex gap-2 mt-2 ${
|
|
2376
|
+
className: `flex gap-2 mt-2 ${b ? "justify-end" : ""} ${f}`,
|
|
2377
2377
|
children: [
|
|
2378
2378
|
/* @__PURE__ */ A(
|
|
2379
2379
|
xe,
|
|
2380
2380
|
{
|
|
2381
|
-
type:
|
|
2381
|
+
type: o,
|
|
2382
2382
|
color: "primary",
|
|
2383
2383
|
variant: "submit",
|
|
2384
|
-
className:
|
|
2384
|
+
className: y,
|
|
2385
2385
|
disabled: c,
|
|
2386
|
-
onClick:
|
|
2387
|
-
name:
|
|
2388
|
-
"aria-label":
|
|
2386
|
+
onClick: o === "button" ? n : void 0,
|
|
2387
|
+
name: m,
|
|
2388
|
+
"aria-label": d,
|
|
2389
2389
|
children: [
|
|
2390
|
-
r ? /* @__PURE__ */
|
|
2390
|
+
r ? /* @__PURE__ */ h(De, { color: "stroke-base", loaderClass: "!w-6 mt-1", strokeWidth: "6" }) : null,
|
|
2391
2391
|
t
|
|
2392
2392
|
]
|
|
2393
2393
|
}
|
|
2394
2394
|
),
|
|
2395
|
-
/* @__PURE__ */
|
|
2395
|
+
/* @__PURE__ */ h(
|
|
2396
2396
|
xe,
|
|
2397
2397
|
{
|
|
2398
2398
|
type: "button",
|
|
@@ -2408,18 +2408,18 @@ const mn = () => {
|
|
|
2408
2408
|
}
|
|
2409
2409
|
);
|
|
2410
2410
|
}, bn = (e) => {
|
|
2411
|
-
const { t } =
|
|
2411
|
+
const { t } = L(), {
|
|
2412
2412
|
children: s,
|
|
2413
2413
|
handleSubmit: n,
|
|
2414
2414
|
onSubmit: i,
|
|
2415
2415
|
handleClose: r,
|
|
2416
2416
|
isLoading: c = !1,
|
|
2417
|
-
buttonEnd:
|
|
2418
|
-
...
|
|
2417
|
+
buttonEnd: o = !0,
|
|
2418
|
+
...f
|
|
2419
2419
|
} = e;
|
|
2420
|
-
return /* @__PURE__ */
|
|
2421
|
-
/* @__PURE__ */
|
|
2422
|
-
/* @__PURE__ */
|
|
2420
|
+
return /* @__PURE__ */ h(lt, { ...f, handleClose: r, children: /* @__PURE__ */ A("form", { onSubmit: n(i), children: [
|
|
2421
|
+
/* @__PURE__ */ h("div", { className: "form-container", children: s }),
|
|
2422
|
+
/* @__PURE__ */ h(
|
|
2423
2423
|
ut,
|
|
2424
2424
|
{
|
|
2425
2425
|
primaryType: "submit",
|
|
@@ -2429,7 +2429,7 @@ const mn = () => {
|
|
|
2429
2429
|
isLoading: c,
|
|
2430
2430
|
disabled: c,
|
|
2431
2431
|
primaryClassName: "!px-6",
|
|
2432
|
-
alignEnd:
|
|
2432
|
+
alignEnd: o,
|
|
2433
2433
|
primaryName: t("_accessibility:buttons.submit"),
|
|
2434
2434
|
primaryAriaLabel: t("_accessibility:ariaLabels.submit"),
|
|
2435
2435
|
cancelName: t("_accessibility:buttons.cancel"),
|
|
@@ -2438,7 +2438,7 @@ const mn = () => {
|
|
|
2438
2438
|
)
|
|
2439
2439
|
] }) });
|
|
2440
2440
|
}, pn = (e) => {
|
|
2441
|
-
const { t } =
|
|
2441
|
+
const { t } = L(), {
|
|
2442
2442
|
children: s,
|
|
2443
2443
|
handleSubmit: n,
|
|
2444
2444
|
handleClose: i,
|
|
@@ -2447,7 +2447,7 @@ const mn = () => {
|
|
|
2447
2447
|
} = e;
|
|
2448
2448
|
return /* @__PURE__ */ A(lt, { ...c, handleClose: i, children: [
|
|
2449
2449
|
s,
|
|
2450
|
-
/* @__PURE__ */
|
|
2450
|
+
/* @__PURE__ */ h(
|
|
2451
2451
|
ut,
|
|
2452
2452
|
{
|
|
2453
2453
|
primaryText: t("_accessibility:buttons.ok"),
|
|
@@ -2467,18 +2467,18 @@ const mn = () => {
|
|
|
2467
2467
|
] });
|
|
2468
2468
|
};
|
|
2469
2469
|
function Er(e) {
|
|
2470
|
-
const { message: t, className: s = "" } = e, { t: n } =
|
|
2471
|
-
return t ? /* @__PURE__ */
|
|
2470
|
+
const { message: t, className: s = "" } = e, { t: n } = L();
|
|
2471
|
+
return t ? /* @__PURE__ */ h("p", { className: `text-red-600 text-sm mt-2 ${s}`, children: t || n("_messages:errors.parseFile", { defaultValue: "Failed to process file" }) }) : null;
|
|
2472
2472
|
}
|
|
2473
2473
|
function $r(e) {
|
|
2474
|
-
const { message: t, className: s = "" } = e, { t: n } =
|
|
2474
|
+
const { message: t, className: s = "" } = e, { t: n } = L();
|
|
2475
2475
|
return /* @__PURE__ */ A(
|
|
2476
2476
|
"div",
|
|
2477
2477
|
{
|
|
2478
2478
|
className: `my-4 mx-auto flex items-center gap-3 text-sm text-gray-600 ${s}`,
|
|
2479
2479
|
children: [
|
|
2480
|
-
/* @__PURE__ */
|
|
2481
|
-
/* @__PURE__ */
|
|
2480
|
+
/* @__PURE__ */ h(De, { loaderClass: "w-5 h-5", className: "!w-auto" }),
|
|
2481
|
+
/* @__PURE__ */ h("span", { children: t ?? n("_messages:loading.processingFile", {
|
|
2482
2482
|
defaultValue: "Processing file..."
|
|
2483
2483
|
}) })
|
|
2484
2484
|
]
|
|
@@ -2486,68 +2486,68 @@ function $r(e) {
|
|
|
2486
2486
|
);
|
|
2487
2487
|
}
|
|
2488
2488
|
function Fr(e) {
|
|
2489
|
-
const { items: t, max: s = 5, className: n = "" } = e, { t: i } =
|
|
2489
|
+
const { items: t, max: s = 5, className: n = "" } = e, { t: i } = L();
|
|
2490
2490
|
if (!t || t.length === 0) return null;
|
|
2491
2491
|
const r = t.slice(0, s);
|
|
2492
2492
|
return /* @__PURE__ */ A("div", { className: `mt-4 ${n}`, children: [
|
|
2493
|
-
/* @__PURE__ */
|
|
2493
|
+
/* @__PURE__ */ h("p", { className: "text-sm text-gray-600", children: i("_pages:common.actions.import.previewCount", {
|
|
2494
2494
|
count: t.length,
|
|
2495
2495
|
defaultValue: `Preview: ${t.length} items`
|
|
2496
2496
|
}) }),
|
|
2497
|
-
/* @__PURE__ */
|
|
2497
|
+
/* @__PURE__ */ h("pre", { className: "mt-2 max-h-56 overflow-auto rounded bg-gray-100 p-3 text-xs", children: JSON.stringify(r, null, 2) })
|
|
2498
2498
|
] });
|
|
2499
2499
|
}
|
|
2500
2500
|
const wn = (e) => {
|
|
2501
|
-
const { t } =
|
|
2502
|
-
children:
|
|
2501
|
+
const { t } = L(), [s, n] = H(null), [i, r] = H(null), [c, o] = H(null), [f, y] = H(!1), [b, m] = H(!1), {
|
|
2502
|
+
children: d,
|
|
2503
2503
|
handleSubmit: w,
|
|
2504
2504
|
handleClose: C,
|
|
2505
|
-
isLoading:
|
|
2505
|
+
isLoading: v = !1,
|
|
2506
2506
|
fileProcessor: q,
|
|
2507
|
-
onFileProcessed:
|
|
2507
|
+
onFileProcessed: oe,
|
|
2508
2508
|
onOverrideChange: S,
|
|
2509
2509
|
open: z,
|
|
2510
2510
|
...D
|
|
2511
|
-
} = e, [$, G] = H(0), V = Re(
|
|
2512
|
-
|
|
2513
|
-
V.current =
|
|
2514
|
-
}, [
|
|
2511
|
+
} = e, [$, G] = H(0), V = Re(oe), le = Re(q);
|
|
2512
|
+
X(() => {
|
|
2513
|
+
V.current = oe;
|
|
2514
|
+
}, [oe]), X(() => {
|
|
2515
2515
|
le.current = q;
|
|
2516
|
-
}, [q]),
|
|
2517
|
-
z || (n(null), r(null),
|
|
2516
|
+
}, [q]), X(() => {
|
|
2517
|
+
z || (n(null), r(null), o(null), y(!1), m(!1), G((M) => M + 1));
|
|
2518
2518
|
}, [z]);
|
|
2519
2519
|
const B = F(async () => {
|
|
2520
2520
|
var M;
|
|
2521
2521
|
if (le.current && s) {
|
|
2522
|
-
|
|
2522
|
+
y(!0);
|
|
2523
2523
|
try {
|
|
2524
2524
|
const I = await le.current(s, {
|
|
2525
|
-
override:
|
|
2525
|
+
override: b
|
|
2526
2526
|
});
|
|
2527
|
-
r(I ?? []),
|
|
2527
|
+
r(I ?? []), o(null), (M = V.current) == null || M.call(V, I ?? []);
|
|
2528
2528
|
} catch (I) {
|
|
2529
2529
|
console.error(I), r(null);
|
|
2530
2530
|
const N = I instanceof Error ? I.message : "Failed to parse file";
|
|
2531
|
-
|
|
2531
|
+
o(N);
|
|
2532
2532
|
}
|
|
2533
|
-
|
|
2533
|
+
y(!1);
|
|
2534
2534
|
}
|
|
2535
|
-
}, [s,
|
|
2536
|
-
return
|
|
2535
|
+
}, [s, b]);
|
|
2536
|
+
return X(() => {
|
|
2537
2537
|
B();
|
|
2538
2538
|
}, [B]), /* @__PURE__ */ A(lt, { ...D, open: z, handleClose: C, children: [
|
|
2539
|
-
/* @__PURE__ */
|
|
2539
|
+
/* @__PURE__ */ h(
|
|
2540
2540
|
ks,
|
|
2541
2541
|
{
|
|
2542
2542
|
onClear: () => {
|
|
2543
2543
|
var M;
|
|
2544
|
-
n(null), r(null),
|
|
2544
|
+
n(null), r(null), o(null), y(!1), (M = V.current) == null || M.call(V, []);
|
|
2545
2545
|
},
|
|
2546
2546
|
onChange: (M) => {
|
|
2547
2547
|
var N, E;
|
|
2548
2548
|
const I = (N = M.target.files) == null ? void 0 : N[0];
|
|
2549
2549
|
if (!I) {
|
|
2550
|
-
n(null), r(null),
|
|
2550
|
+
n(null), r(null), o(null), y(!1), (E = V.current) == null || E.call(V, []);
|
|
2551
2551
|
return;
|
|
2552
2552
|
}
|
|
2553
2553
|
n(I);
|
|
@@ -2557,26 +2557,26 @@ const wn = (e) => {
|
|
|
2557
2557
|
$
|
|
2558
2558
|
),
|
|
2559
2559
|
/* @__PURE__ */ A("label", { className: "mt-3 flex items-center gap-2 text-sm", children: [
|
|
2560
|
-
/* @__PURE__ */
|
|
2560
|
+
/* @__PURE__ */ h(
|
|
2561
2561
|
"input",
|
|
2562
2562
|
{
|
|
2563
2563
|
type: "checkbox",
|
|
2564
|
-
checked:
|
|
2564
|
+
checked: b,
|
|
2565
2565
|
onChange: (M) => {
|
|
2566
2566
|
const I = M.target.checked;
|
|
2567
|
-
|
|
2567
|
+
m(I), S == null || S(I);
|
|
2568
2568
|
}
|
|
2569
2569
|
}
|
|
2570
2570
|
),
|
|
2571
|
-
/* @__PURE__ */
|
|
2571
|
+
/* @__PURE__ */ h("span", { children: t("_pages:common.actions.import.override", {
|
|
2572
2572
|
defaultValue: "Override existing items"
|
|
2573
2573
|
}) })
|
|
2574
2574
|
] }),
|
|
2575
|
-
/* @__PURE__ */
|
|
2576
|
-
|
|
2577
|
-
!!i && i.length > 0 && /* @__PURE__ */
|
|
2578
|
-
|
|
2579
|
-
/* @__PURE__ */
|
|
2575
|
+
/* @__PURE__ */ h(Er, { message: c ?? void 0 }),
|
|
2576
|
+
f && /* @__PURE__ */ h($r, {}),
|
|
2577
|
+
!!i && i.length > 0 && /* @__PURE__ */ h(Fr, { items: i }),
|
|
2578
|
+
d,
|
|
2579
|
+
/* @__PURE__ */ h(
|
|
2580
2580
|
ut,
|
|
2581
2581
|
{
|
|
2582
2582
|
primaryText: t("_accessibility:buttons.ok"),
|
|
@@ -2585,7 +2585,7 @@ const wn = (e) => {
|
|
|
2585
2585
|
(!q || !!i && i.length > 0) && w();
|
|
2586
2586
|
},
|
|
2587
2587
|
onCancel: C,
|
|
2588
|
-
isLoading:
|
|
2588
|
+
isLoading: v,
|
|
2589
2589
|
primaryType: "button",
|
|
2590
2590
|
containerClassName: "mt-5",
|
|
2591
2591
|
primaryName: t("_accessibility:buttons.ok"),
|
|
@@ -2597,18 +2597,18 @@ const wn = (e) => {
|
|
|
2597
2597
|
] });
|
|
2598
2598
|
};
|
|
2599
2599
|
function vn(e) {
|
|
2600
|
-
const { t } =
|
|
2601
|
-
const
|
|
2602
|
-
return
|
|
2603
|
-
}), [c]),
|
|
2604
|
-
(
|
|
2605
|
-
|
|
2600
|
+
const { t } = L(), { open: s, onClose: n, menuMap: i, logo: r } = e, { account: c } = Jt(), { linkComponent: o } = ze(), f = o, y = Ve(() => i.filter((m) => {
|
|
2601
|
+
const d = m.auth, w = !!(c != null && c.email);
|
|
2602
|
+
return d == null || d && w || !d && !w;
|
|
2603
|
+
}), [c]), b = F(
|
|
2604
|
+
(m) => {
|
|
2605
|
+
m.key === "Escape" && s && n();
|
|
2606
2606
|
},
|
|
2607
2607
|
[n, s]
|
|
2608
2608
|
);
|
|
2609
|
-
return
|
|
2610
|
-
document.removeEventListener("keydown",
|
|
2611
|
-
}), [
|
|
2609
|
+
return X(() => (document.addEventListener("keydown", b), () => {
|
|
2610
|
+
document.removeEventListener("keydown", b);
|
|
2611
|
+
}), [b]), /* @__PURE__ */ h(
|
|
2612
2612
|
"div",
|
|
2613
2613
|
{
|
|
2614
2614
|
"aria-label": t("_accessibility:ariaLabels.closeMenu"),
|
|
@@ -2622,27 +2622,27 @@ function vn(e) {
|
|
|
2622
2622
|
children: [
|
|
2623
2623
|
/* @__PURE__ */ A("div", { className: "drawer-header-container", children: [
|
|
2624
2624
|
r,
|
|
2625
|
-
/* @__PURE__ */
|
|
2625
|
+
/* @__PURE__ */ h("h2", { className: "drawer-header poppins", children: t("_pages:home.appName") })
|
|
2626
2626
|
] }),
|
|
2627
|
-
/* @__PURE__ */
|
|
2627
|
+
/* @__PURE__ */ h("ul", { className: "flex flex-col", children: y.map((m, d) => /* @__PURE__ */ h(
|
|
2628
2628
|
"li",
|
|
2629
2629
|
{
|
|
2630
|
-
className: `drawer-list-item ${
|
|
2631
|
-
children:
|
|
2632
|
-
|
|
2630
|
+
className: `drawer-list-item ${m.path === location.pathname ? "active" : ""} animated`,
|
|
2631
|
+
children: m.type !== "divider" && f ? /* @__PURE__ */ A(
|
|
2632
|
+
f,
|
|
2633
2633
|
{
|
|
2634
2634
|
"aria-disabled": !s,
|
|
2635
|
-
to:
|
|
2636
|
-
"aria-label": t(`_accessibility:ariaLabels.${
|
|
2635
|
+
to: m.path ?? `/${m.path}`,
|
|
2636
|
+
"aria-label": t(`_accessibility:ariaLabels.${m.path}`),
|
|
2637
2637
|
className: "drawer-link",
|
|
2638
2638
|
children: [
|
|
2639
|
-
|
|
2640
|
-
t(`_pages:${
|
|
2639
|
+
m.icon,
|
|
2640
|
+
t(`_pages:${m.page}.title`)
|
|
2641
2641
|
]
|
|
2642
2642
|
}
|
|
2643
|
-
) : /* @__PURE__ */
|
|
2643
|
+
) : /* @__PURE__ */ h("hr", { className: "drawer-divider" })
|
|
2644
2644
|
},
|
|
2645
|
-
`${
|
|
2645
|
+
`${m.page ?? d}`
|
|
2646
2646
|
)) })
|
|
2647
2647
|
]
|
|
2648
2648
|
}
|
|
@@ -2651,17 +2651,17 @@ function vn(e) {
|
|
|
2651
2651
|
);
|
|
2652
2652
|
}
|
|
2653
2653
|
function xn(e) {
|
|
2654
|
-
const { error: t } = e, { t: s } =
|
|
2654
|
+
const { error: t } = e, { t: s } = L();
|
|
2655
2655
|
return /* @__PURE__ */ A("div", { className: "flex flex-col items-center justify-center pt-10 gap-5", children: [
|
|
2656
|
-
/* @__PURE__ */
|
|
2657
|
-
/* @__PURE__ */
|
|
2656
|
+
/* @__PURE__ */ h(ce, { icon: Qs, className: "text-red-300 text-4xl" }),
|
|
2657
|
+
/* @__PURE__ */ h("p", { className: "text-text text-center", children: (t == null ? void 0 : t.message) ?? s("_accessibility:errors.unknownError") })
|
|
2658
2658
|
] });
|
|
2659
2659
|
}
|
|
2660
|
-
const
|
|
2661
|
-
const { showBackButton: t, title: s, actions: n } = e, { t: i } =
|
|
2660
|
+
const Lr = (e) => {
|
|
2661
|
+
const { showBackButton: t, title: s, actions: n } = e, { t: i } = L(), { navigate: r } = ze();
|
|
2662
2662
|
return /* @__PURE__ */ A("div", { className: "page-header", children: [
|
|
2663
2663
|
/* @__PURE__ */ A("div", { className: "flex gap-2 items-center justify-start", children: [
|
|
2664
|
-
t && /* @__PURE__ */
|
|
2664
|
+
t && /* @__PURE__ */ h(
|
|
2665
2665
|
be,
|
|
2666
2666
|
{
|
|
2667
2667
|
icon: Os,
|
|
@@ -2671,11 +2671,11 @@ const Tr = (e) => {
|
|
|
2671
2671
|
"data-tooltip-content": i("_accessibility:buttons.back")
|
|
2672
2672
|
}
|
|
2673
2673
|
),
|
|
2674
|
-
/* @__PURE__ */
|
|
2674
|
+
/* @__PURE__ */ h("h2", { className: "text-3xl font-bold", children: s })
|
|
2675
2675
|
] }),
|
|
2676
2676
|
/* @__PURE__ */ A("div", { children: [
|
|
2677
|
-
/* @__PURE__ */
|
|
2678
|
-
/* @__PURE__ */
|
|
2677
|
+
/* @__PURE__ */ h(jt, { className: "max-xs:!hidden", actions: n ?? [] }),
|
|
2678
|
+
/* @__PURE__ */ h(Ar, { className: "min-xs:hidden", actions: n ?? [] })
|
|
2679
2679
|
] })
|
|
2680
2680
|
] });
|
|
2681
2681
|
}, _n = (e) => {
|
|
@@ -2686,17 +2686,17 @@ const Tr = (e) => {
|
|
|
2686
2686
|
filterOptions: i,
|
|
2687
2687
|
actions: r,
|
|
2688
2688
|
queryKey: c,
|
|
2689
|
-
isLoading:
|
|
2690
|
-
isAnimated:
|
|
2691
|
-
showBackButton:
|
|
2692
|
-
} = e, { t:
|
|
2689
|
+
isLoading: o = !1,
|
|
2690
|
+
isAnimated: f = !0,
|
|
2691
|
+
showBackButton: y = !1
|
|
2692
|
+
} = e, { t: b } = L(), { countOfFilters: m } = Ss(), d = Ve(() => {
|
|
2693
2693
|
const w = Array.isArray(r) ? [...r] : [];
|
|
2694
2694
|
if (c) {
|
|
2695
2695
|
const C = {
|
|
2696
2696
|
id: _e.Refresh,
|
|
2697
2697
|
onClick: () => pe.invalidateQueries({ queryKey: c }),
|
|
2698
|
-
icon: /* @__PURE__ */
|
|
2699
|
-
tooltip:
|
|
2698
|
+
icon: /* @__PURE__ */ h(ce, { icon: Mt }),
|
|
2699
|
+
tooltip: b("_pages:common.actions.refresh.text")
|
|
2700
2700
|
};
|
|
2701
2701
|
w.unshift(C);
|
|
2702
2702
|
}
|
|
@@ -2704,7 +2704,7 @@ const Tr = (e) => {
|
|
|
2704
2704
|
const C = {
|
|
2705
2705
|
...n,
|
|
2706
2706
|
id: _e.Add,
|
|
2707
|
-
icon: /* @__PURE__ */
|
|
2707
|
+
icon: /* @__PURE__ */ h(ce, { icon: vt })
|
|
2708
2708
|
};
|
|
2709
2709
|
w.unshift(C);
|
|
2710
2710
|
}
|
|
@@ -2712,38 +2712,38 @@ const Tr = (e) => {
|
|
|
2712
2712
|
const C = {
|
|
2713
2713
|
...i,
|
|
2714
2714
|
id: "filter",
|
|
2715
|
-
icon: /* @__PURE__ */
|
|
2716
|
-
children: /* @__PURE__ */
|
|
2715
|
+
icon: /* @__PURE__ */ h(ce, { icon: Is }),
|
|
2716
|
+
children: /* @__PURE__ */ h(
|
|
2717
2717
|
Ns,
|
|
2718
2718
|
{
|
|
2719
|
-
className: `${
|
|
2720
|
-
count:
|
|
2719
|
+
className: `${m > 0 ? "show" : "hide"} `,
|
|
2720
|
+
count: m
|
|
2721
2721
|
}
|
|
2722
2722
|
)
|
|
2723
2723
|
};
|
|
2724
2724
|
w.push(C);
|
|
2725
2725
|
}
|
|
2726
2726
|
return w;
|
|
2727
|
-
}, [r, n,
|
|
2727
|
+
}, [r, n, m, i, c, b]);
|
|
2728
2728
|
return /* @__PURE__ */ A("main", { className: "", children: [
|
|
2729
2729
|
/* @__PURE__ */ A("div", { className: "flex flex-col", children: [
|
|
2730
|
-
/* @__PURE__ */
|
|
2731
|
-
|
|
2730
|
+
/* @__PURE__ */ h(
|
|
2731
|
+
Lr,
|
|
2732
2732
|
{
|
|
2733
|
-
showBackButton:
|
|
2734
|
-
actions:
|
|
2733
|
+
showBackButton: y,
|
|
2734
|
+
actions: d,
|
|
2735
2735
|
title: t
|
|
2736
2736
|
}
|
|
2737
2737
|
),
|
|
2738
|
-
/* @__PURE__ */
|
|
2738
|
+
/* @__PURE__ */ h(
|
|
2739
2739
|
"div",
|
|
2740
2740
|
{
|
|
2741
|
-
className: `px-5 py-3 h-useConfigfull ${
|
|
2742
|
-
children:
|
|
2741
|
+
className: `px-5 py-3 h-useConfigfull ${f ? "appear" : ""}`,
|
|
2742
|
+
children: o ? /* @__PURE__ */ h(De, { className: "flex justify-center items-center h-50" }) : s
|
|
2743
2743
|
}
|
|
2744
2744
|
)
|
|
2745
2745
|
] }),
|
|
2746
|
-
/* @__PURE__ */
|
|
2746
|
+
/* @__PURE__ */ h(
|
|
2747
2747
|
be,
|
|
2748
2748
|
{
|
|
2749
2749
|
icon: vt,
|
|
@@ -2758,34 +2758,34 @@ const Tr = (e) => {
|
|
|
2758
2758
|
)
|
|
2759
2759
|
] });
|
|
2760
2760
|
}, Cn = (e) => {
|
|
2761
|
-
const { t } =
|
|
2761
|
+
const { t } = L(), {
|
|
2762
2762
|
loading: s = !1,
|
|
2763
2763
|
emptyComponent: n = null,
|
|
2764
2764
|
emptyMessage: i = t("_accessibility:messages.empty"),
|
|
2765
2765
|
renderComponent: r,
|
|
2766
2766
|
data: c = []
|
|
2767
2767
|
} = e;
|
|
2768
|
-
return /* @__PURE__ */
|
|
2769
|
-
},
|
|
2768
|
+
return /* @__PURE__ */ h(Te, { children: c != null && c.length ? /* @__PURE__ */ h("ul", { className: "pretty-grid-main", children: c == null ? void 0 : c.map((o) => /* @__PURE__ */ h("li", { className: "pretty-grid-item", children: r(o) }, o.id)) }) : /* @__PURE__ */ h(Te, { children: n || /* @__PURE__ */ h(Or, { message: i }) }) });
|
|
2769
|
+
}, Tr = () => {
|
|
2770
2770
|
const [e, t] = H(kt());
|
|
2771
|
-
return
|
|
2771
|
+
return X(() => {
|
|
2772
2772
|
const s = setInterval(() => {
|
|
2773
2773
|
t(kt());
|
|
2774
2774
|
}, 1e3);
|
|
2775
2775
|
return () => clearInterval(s);
|
|
2776
|
-
}, []), /* @__PURE__ */
|
|
2776
|
+
}, []), /* @__PURE__ */ h("p", { className: "capitalize max-xs:hidden", children: e });
|
|
2777
2777
|
};
|
|
2778
2778
|
function kn(e) {
|
|
2779
|
-
const { t } =
|
|
2780
|
-
(Xs() ?
|
|
2779
|
+
const { t } = L(), { openDrawer: s } = e, { searchComponent: n } = ze(), [i, r] = H(!1), c = F((f) => {
|
|
2780
|
+
(Xs() ? f.metaKey : f.ctrlKey) && f.shiftKey && f.key.toLowerCase() === "f" && (r(!0), f.preventDefault());
|
|
2781
2781
|
}, []);
|
|
2782
|
-
|
|
2782
|
+
X(() => (window.addEventListener("keydown", c), () => {
|
|
2783
2783
|
window.removeEventListener("keydown", c);
|
|
2784
2784
|
}), [c]);
|
|
2785
|
-
const
|
|
2786
|
-
return /* @__PURE__ */ A(
|
|
2787
|
-
location.pathname !== "/" && !!
|
|
2788
|
-
|
|
2785
|
+
const o = n;
|
|
2786
|
+
return /* @__PURE__ */ A(Te, { children: [
|
|
2787
|
+
location.pathname !== "/" && !!o && /* @__PURE__ */ h(
|
|
2788
|
+
o,
|
|
2789
2789
|
{
|
|
2790
2790
|
open: i,
|
|
2791
2791
|
onClose: () => r(!1)
|
|
@@ -2793,7 +2793,7 @@ function kn(e) {
|
|
|
2793
2793
|
),
|
|
2794
2794
|
/* @__PURE__ */ A("header", { id: "header", className: "header", children: [
|
|
2795
2795
|
/* @__PURE__ */ A("div", { className: "flex gap-2 items-center", children: [
|
|
2796
|
-
/* @__PURE__ */
|
|
2796
|
+
/* @__PURE__ */ h(
|
|
2797
2797
|
be,
|
|
2798
2798
|
{
|
|
2799
2799
|
type: "button",
|
|
@@ -2804,10 +2804,10 @@ function kn(e) {
|
|
|
2804
2804
|
className: "menu animated"
|
|
2805
2805
|
}
|
|
2806
2806
|
),
|
|
2807
|
-
/* @__PURE__ */
|
|
2807
|
+
/* @__PURE__ */ h("h1", { className: "text-lg text-text pointer-events-none poppins font-bold", children: t("_pages:home.appName") })
|
|
2808
2808
|
] }),
|
|
2809
2809
|
/* @__PURE__ */ A("div", { className: "flex items-center justify-end gap-2", children: [
|
|
2810
|
-
/* @__PURE__ */
|
|
2810
|
+
/* @__PURE__ */ h(
|
|
2811
2811
|
be,
|
|
2812
2812
|
{
|
|
2813
2813
|
icon: Us,
|
|
@@ -2815,30 +2815,30 @@ function kn(e) {
|
|
|
2815
2815
|
onClick: () => r(!0)
|
|
2816
2816
|
}
|
|
2817
2817
|
),
|
|
2818
|
-
/* @__PURE__ */
|
|
2818
|
+
/* @__PURE__ */ h(Tr, {})
|
|
2819
2819
|
] })
|
|
2820
2820
|
] })
|
|
2821
2821
|
] });
|
|
2822
2822
|
}
|
|
2823
2823
|
function Sn() {
|
|
2824
|
-
const { t: e } =
|
|
2825
|
-
(
|
|
2826
|
-
if (
|
|
2827
|
-
const
|
|
2828
|
-
i(
|
|
2824
|
+
const { t: e } = L(), { notification: t, removeNotification: s } = Se(), [n, i] = H(/* @__PURE__ */ new Set()), r = F(
|
|
2825
|
+
(m) => {
|
|
2826
|
+
if (m === void 0) {
|
|
2827
|
+
const d = new Set(t.map((w, C) => C));
|
|
2828
|
+
i(d), window.setTimeout(() => s(), 300);
|
|
2829
2829
|
} else
|
|
2830
|
-
i((
|
|
2830
|
+
i((d) => new Set(d).add(m)), window.setTimeout(() => s(m), 300);
|
|
2831
2831
|
},
|
|
2832
2832
|
[t, s]
|
|
2833
|
-
), c = F((
|
|
2834
|
-
switch (
|
|
2833
|
+
), c = F((m) => {
|
|
2834
|
+
switch (m) {
|
|
2835
2835
|
case j.error:
|
|
2836
2836
|
return qs;
|
|
2837
2837
|
default:
|
|
2838
2838
|
return Rs;
|
|
2839
2839
|
}
|
|
2840
|
-
}, []),
|
|
2841
|
-
switch (
|
|
2840
|
+
}, []), o = F((m) => {
|
|
2841
|
+
switch (m) {
|
|
2842
2842
|
case j.success:
|
|
2843
2843
|
return "!text-success";
|
|
2844
2844
|
case j.error:
|
|
@@ -2848,8 +2848,8 @@ function Sn() {
|
|
|
2848
2848
|
default:
|
|
2849
2849
|
return "!text-info";
|
|
2850
2850
|
}
|
|
2851
|
-
}, []),
|
|
2852
|
-
switch (
|
|
2851
|
+
}, []), f = F((m) => {
|
|
2852
|
+
switch (m) {
|
|
2853
2853
|
case j.success:
|
|
2854
2854
|
return "bg-bg-success";
|
|
2855
2855
|
case j.error:
|
|
@@ -2859,63 +2859,72 @@ function Sn() {
|
|
|
2859
2859
|
default:
|
|
2860
2860
|
return "bg-bg-info";
|
|
2861
2861
|
}
|
|
2862
|
-
}, []),
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
}, [r]),
|
|
2862
|
+
}, []), y = Re();
|
|
2863
|
+
X(() => {
|
|
2864
|
+
y.current = () => r();
|
|
2865
|
+
}, [r]), X(() => {
|
|
2866
2866
|
if (!(t != null && t.length)) return;
|
|
2867
|
-
const
|
|
2868
|
-
var
|
|
2869
|
-
return (
|
|
2867
|
+
const m = (d) => {
|
|
2868
|
+
var w;
|
|
2869
|
+
return (w = y.current) == null ? void 0 : w.call(y, d);
|
|
2870
2870
|
};
|
|
2871
|
-
return window.addEventListener("click",
|
|
2872
|
-
window.removeEventListener("click",
|
|
2871
|
+
return window.addEventListener("click", m), () => {
|
|
2872
|
+
window.removeEventListener("click", m);
|
|
2873
2873
|
};
|
|
2874
|
-
}, [t == null ? void 0 : t.length])
|
|
2874
|
+
}, [t == null ? void 0 : t.length]);
|
|
2875
|
+
const b = F(
|
|
2876
|
+
(m) => {
|
|
2877
|
+
m.key === "Escape" && t.length && r();
|
|
2878
|
+
},
|
|
2879
|
+
[t, r]
|
|
2880
|
+
);
|
|
2881
|
+
return X(() => (window.addEventListener("keydown", b), () => {
|
|
2882
|
+
window.removeEventListener("keydown", b);
|
|
2883
|
+
}), [b]), X(() => {
|
|
2875
2884
|
i(/* @__PURE__ */ new Set());
|
|
2876
2885
|
}, [t]), qt(
|
|
2877
|
-
/* @__PURE__ */
|
|
2886
|
+
/* @__PURE__ */ h(
|
|
2878
2887
|
"div",
|
|
2879
2888
|
{
|
|
2880
2889
|
className: `notification-portal ${t != null && t.length ? "w-screen h-screen" : ""}`,
|
|
2881
|
-
children: t != null && t.length ? t == null ? void 0 : t.map(({ id:
|
|
2890
|
+
children: t != null && t.length ? t == null ? void 0 : t.map(({ id: m, type: d, message: w }, C) => /* @__PURE__ */ A(
|
|
2882
2891
|
"div",
|
|
2883
2892
|
{
|
|
2884
|
-
className: `notification ${n.has(
|
|
2885
|
-
|
|
2893
|
+
className: `notification ${n.has(C) ? "closing" : ""} ${f(
|
|
2894
|
+
d ?? j.error
|
|
2886
2895
|
)}`,
|
|
2887
|
-
onClick: (
|
|
2896
|
+
onClick: (v) => v.stopPropagation(),
|
|
2888
2897
|
children: [
|
|
2889
2898
|
/* @__PURE__ */ A("div", { className: "flex gap-3 items-center", children: [
|
|
2890
|
-
/* @__PURE__ */
|
|
2899
|
+
/* @__PURE__ */ h(
|
|
2891
2900
|
ce,
|
|
2892
2901
|
{
|
|
2893
|
-
icon: c(
|
|
2894
|
-
className: `${
|
|
2902
|
+
icon: c(d ?? j.error),
|
|
2903
|
+
className: `${o(d ?? j.error)}`
|
|
2895
2904
|
}
|
|
2896
2905
|
),
|
|
2897
|
-
/* @__PURE__ */
|
|
2906
|
+
/* @__PURE__ */ h(
|
|
2898
2907
|
"p",
|
|
2899
2908
|
{
|
|
2900
|
-
className: `whitespace-nowrap ${
|
|
2901
|
-
|
|
2909
|
+
className: `whitespace-nowrap ${o(
|
|
2910
|
+
d ?? j.error
|
|
2902
2911
|
)}`,
|
|
2903
|
-
children:
|
|
2912
|
+
children: w
|
|
2904
2913
|
}
|
|
2905
2914
|
)
|
|
2906
2915
|
] }),
|
|
2907
|
-
/* @__PURE__ */
|
|
2916
|
+
/* @__PURE__ */ h(
|
|
2908
2917
|
be,
|
|
2909
2918
|
{
|
|
2910
2919
|
type: "button",
|
|
2911
2920
|
icon: Rt,
|
|
2912
2921
|
color: "error",
|
|
2913
2922
|
className: "group",
|
|
2914
|
-
onClick: (
|
|
2915
|
-
|
|
2923
|
+
onClick: (v) => {
|
|
2924
|
+
v.stopPropagation(), r(C);
|
|
2916
2925
|
},
|
|
2917
|
-
iconClassName: `${
|
|
2918
|
-
|
|
2926
|
+
iconClassName: `${o(
|
|
2927
|
+
d ?? j.error
|
|
2919
2928
|
)} group-hover:!text-red-400 cursor-pointer`,
|
|
2920
2929
|
name: e("_accessibility:buttons.closeNotification"),
|
|
2921
2930
|
"aria-label": e("_accessibility:ariaLabels.closeNotification")
|
|
@@ -2923,7 +2932,7 @@ function Sn() {
|
|
|
2923
2932
|
)
|
|
2924
2933
|
]
|
|
2925
2934
|
},
|
|
2926
|
-
|
|
2935
|
+
m
|
|
2927
2936
|
)) : null
|
|
2928
2937
|
}
|
|
2929
2938
|
),
|
|
@@ -2931,11 +2940,11 @@ function Sn() {
|
|
|
2931
2940
|
);
|
|
2932
2941
|
}
|
|
2933
2942
|
function Nn() {
|
|
2934
|
-
return /* @__PURE__ */
|
|
2943
|
+
return /* @__PURE__ */ h("div", { className: "w-screen h-screen flex items-center justify-center overflow-hidden", children: /* @__PURE__ */ h(De, { className: "blur-appear" }) });
|
|
2935
2944
|
}
|
|
2936
2945
|
const Dr = (e) => {
|
|
2937
2946
|
const { id: t, active: s, onClick: n, children: i, to: r } = e, { linkComponent: c } = ze();
|
|
2938
|
-
return /* @__PURE__ */
|
|
2947
|
+
return /* @__PURE__ */ h(
|
|
2939
2948
|
c,
|
|
2940
2949
|
{
|
|
2941
2950
|
to: r ?? `#${t}`,
|
|
@@ -2945,34 +2954,34 @@ const Dr = (e) => {
|
|
|
2945
2954
|
}
|
|
2946
2955
|
);
|
|
2947
2956
|
}, Vr = (e) => {
|
|
2948
|
-
var
|
|
2957
|
+
var f;
|
|
2949
2958
|
const {
|
|
2950
2959
|
tabs: t = [],
|
|
2951
2960
|
defaultTab: s,
|
|
2952
2961
|
className: n = "",
|
|
2953
2962
|
tabsContainerClassName: i = ""
|
|
2954
|
-
} = e, [r, c] = H((
|
|
2955
|
-
return
|
|
2963
|
+
} = e, [r, c] = H((f = t[0]) == null ? void 0 : f.id), o = Ve(() => t.find((y) => y.id === r), [t, r]);
|
|
2964
|
+
return X(() => {
|
|
2956
2965
|
s && c(s);
|
|
2957
2966
|
}, [s]), /* @__PURE__ */ A("div", { className: `tabs-layout-main ${n}`, children: [
|
|
2958
|
-
/* @__PURE__ */
|
|
2967
|
+
/* @__PURE__ */ h(
|
|
2959
2968
|
"ul",
|
|
2960
2969
|
{
|
|
2961
2970
|
className: `horizontal tabs tabs-container ${i}`,
|
|
2962
|
-
children: t.map(({ id:
|
|
2971
|
+
children: t.map(({ id: y, to: b, label: m }) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ h(
|
|
2963
2972
|
Dr,
|
|
2964
2973
|
{
|
|
2965
|
-
onClick: () => c(
|
|
2966
|
-
id:
|
|
2967
|
-
to:
|
|
2974
|
+
onClick: () => c(y),
|
|
2975
|
+
id: y,
|
|
2976
|
+
to: b ?? "",
|
|
2968
2977
|
siblings: t.length > 1,
|
|
2969
|
-
active: r ===
|
|
2970
|
-
children:
|
|
2978
|
+
active: r === y,
|
|
2979
|
+
children: m
|
|
2971
2980
|
}
|
|
2972
|
-
) },
|
|
2981
|
+
) }, y))
|
|
2973
2982
|
}
|
|
2974
2983
|
),
|
|
2975
|
-
|
|
2984
|
+
o == null ? void 0 : o.content
|
|
2976
2985
|
] });
|
|
2977
2986
|
}, Pr = (e) => {
|
|
2978
2987
|
const {
|
|
@@ -2981,13 +2990,13 @@ const Dr = (e) => {
|
|
|
2981
2990
|
image: n = "",
|
|
2982
2991
|
alt: i = "",
|
|
2983
2992
|
final: r = !1
|
|
2984
|
-
} = e, { setGuestMode: c } = Jt(), { t:
|
|
2993
|
+
} = e, { setGuestMode: c } = Jt(), { t: o } = L();
|
|
2985
2994
|
return /* @__PURE__ */ A("div", { className: "big-appear w-md flex flex-col gap-20", children: [
|
|
2986
|
-
/* @__PURE__ */
|
|
2987
|
-
/* @__PURE__ */
|
|
2988
|
-
/* @__PURE__ */
|
|
2989
|
-
/* @__PURE__ */
|
|
2990
|
-
/* @__PURE__ */
|
|
2995
|
+
/* @__PURE__ */ h("img", { src: n, alt: i }),
|
|
2996
|
+
/* @__PURE__ */ h("h2", { className: "text-5xl text-center leading-16", children: o(`_pages:onboarding.${t}.title`) }),
|
|
2997
|
+
/* @__PURE__ */ h("p", { className: "text-center !text-lg", children: o(`_pages:onboarding.${t}.body`) }),
|
|
2998
|
+
/* @__PURE__ */ h("div", { className: "flex gap-5 items-center justify-center", children: r ? /* @__PURE__ */ A(Te, { children: [
|
|
2999
|
+
/* @__PURE__ */ h(
|
|
2991
3000
|
xe,
|
|
2992
3001
|
{
|
|
2993
3002
|
color: "primary",
|
|
@@ -2996,42 +3005,42 @@ const Dr = (e) => {
|
|
|
2996
3005
|
onClick: () => {
|
|
2997
3006
|
c(!0), window.location.href = "/";
|
|
2998
3007
|
},
|
|
2999
|
-
"aria-label":
|
|
3000
|
-
children:
|
|
3008
|
+
"aria-label": o("_accessibility:ariaLabels.start"),
|
|
3009
|
+
children: o("_accessibility:buttons.startAsGuest")
|
|
3001
3010
|
}
|
|
3002
3011
|
),
|
|
3003
|
-
/* @__PURE__ */
|
|
3012
|
+
/* @__PURE__ */ h(
|
|
3004
3013
|
xe,
|
|
3005
3014
|
{
|
|
3006
3015
|
color: "primary",
|
|
3007
3016
|
variant: "submit",
|
|
3008
3017
|
className: "!px-8",
|
|
3009
|
-
"aria-label":
|
|
3018
|
+
"aria-label": o("_accessibility:ariaLabels.start"),
|
|
3010
3019
|
onClick: () => window.location.href = "/auth/sign-in",
|
|
3011
|
-
children:
|
|
3020
|
+
children: o("_accessibility:buttons.signIn")
|
|
3012
3021
|
}
|
|
3013
3022
|
)
|
|
3014
|
-
] }) : /* @__PURE__ */ A(
|
|
3015
|
-
/* @__PURE__ */
|
|
3023
|
+
] }) : /* @__PURE__ */ A(Te, { children: [
|
|
3024
|
+
/* @__PURE__ */ h(
|
|
3016
3025
|
xe,
|
|
3017
3026
|
{
|
|
3018
3027
|
color: "primary",
|
|
3019
3028
|
className: "!px-8",
|
|
3020
3029
|
variant: "outlined",
|
|
3021
3030
|
onClick: () => window.location.href = "/auth/sign-in",
|
|
3022
|
-
"aria-label":
|
|
3023
|
-
children:
|
|
3031
|
+
"aria-label": o("_accessibility:ariaLabels.skip"),
|
|
3032
|
+
children: o("_accessibility:buttons.skip")
|
|
3024
3033
|
}
|
|
3025
3034
|
),
|
|
3026
|
-
/* @__PURE__ */
|
|
3035
|
+
/* @__PURE__ */ h(
|
|
3027
3036
|
xe,
|
|
3028
3037
|
{
|
|
3029
3038
|
color: "primary",
|
|
3030
3039
|
className: "!px-8",
|
|
3031
3040
|
variant: "outlined",
|
|
3032
3041
|
onClick: () => s(),
|
|
3033
|
-
"aria-label":
|
|
3034
|
-
children:
|
|
3042
|
+
"aria-label": o("_accessibility:ariaLabels.next"),
|
|
3043
|
+
children: o("_accessibility:buttons.next")
|
|
3035
3044
|
}
|
|
3036
3045
|
)
|
|
3037
3046
|
] }) })
|
|
@@ -3040,7 +3049,7 @@ const Dr = (e) => {
|
|
|
3040
3049
|
const { steps: t } = e, [s, n] = H(1), i = Ve(() => t.map((r, c) => ({
|
|
3041
3050
|
id: c + 1,
|
|
3042
3051
|
label: "",
|
|
3043
|
-
content: /* @__PURE__ */
|
|
3052
|
+
content: /* @__PURE__ */ h(
|
|
3044
3053
|
Pr,
|
|
3045
3054
|
{
|
|
3046
3055
|
translation: r,
|
|
@@ -3049,7 +3058,7 @@ const Dr = (e) => {
|
|
|
3049
3058
|
}
|
|
3050
3059
|
)
|
|
3051
3060
|
})), [s]);
|
|
3052
|
-
return /* @__PURE__ */
|
|
3061
|
+
return /* @__PURE__ */ h("div", { className: "onboarding-main", children: /* @__PURE__ */ h(Vr, { defaultTab: s, tabs: i }) });
|
|
3053
3062
|
}, Or = (e) => {
|
|
3054
3063
|
const {
|
|
3055
3064
|
message: t,
|
|
@@ -3058,13 +3067,13 @@ const Dr = (e) => {
|
|
|
3058
3067
|
iconProps: i
|
|
3059
3068
|
} = e;
|
|
3060
3069
|
return /* @__PURE__ */ A("div", { className: "flex flex-col items-center justify-center gap-5 pt-5", children: [
|
|
3061
|
-
i && /* @__PURE__ */
|
|
3062
|
-
/* @__PURE__ */
|
|
3063
|
-
n && /* @__PURE__ */
|
|
3070
|
+
i && /* @__PURE__ */ h(ce, { ...i ?? {} }),
|
|
3071
|
+
/* @__PURE__ */ h("p", { ...s ?? {}, children: t }),
|
|
3072
|
+
n && /* @__PURE__ */ h(Bt, { showTooltips: !1, showText: !0, ...n })
|
|
3064
3073
|
] });
|
|
3065
3074
|
};
|
|
3066
3075
|
export {
|
|
3067
|
-
|
|
3076
|
+
Kt as APIClient,
|
|
3068
3077
|
Bt as Action,
|
|
3069
3078
|
jt as Actions,
|
|
3070
3079
|
Ar as ActionsDropdown,
|
|
@@ -3105,11 +3114,11 @@ export {
|
|
|
3105
3114
|
Js as buildQueryUrl,
|
|
3106
3115
|
Xr as enumToKeyValueArray,
|
|
3107
3116
|
Zr as formatForDatetimeLocal,
|
|
3108
|
-
|
|
3117
|
+
Qt as fromLocal,
|
|
3109
3118
|
kt as getFormattedDateTime,
|
|
3110
3119
|
We as isHttpError,
|
|
3111
3120
|
Xs as isMac,
|
|
3112
|
-
|
|
3121
|
+
Qe as isValidationError,
|
|
3113
3122
|
Ae as makeRequest,
|
|
3114
3123
|
en as mapValidationErrors,
|
|
3115
3124
|
Ht as parseQueries,
|
|
@@ -3121,8 +3130,8 @@ export {
|
|
|
3121
3130
|
Xt as useConfirmationForm,
|
|
3122
3131
|
_r as useDeleteAction,
|
|
3123
3132
|
cn as useDeleteDialog,
|
|
3124
|
-
|
|
3125
|
-
|
|
3133
|
+
as as useDialog,
|
|
3134
|
+
an as useEditAction,
|
|
3126
3135
|
kr as useExportAction,
|
|
3127
3136
|
fn as useExportActionMutate,
|
|
3128
3137
|
ln as useFormDialog,
|
|
@@ -3130,7 +3139,7 @@ export {
|
|
|
3130
3139
|
dn as useImportDialog,
|
|
3131
3140
|
Zs as useManager,
|
|
3132
3141
|
Se as useNotification,
|
|
3133
|
-
|
|
3142
|
+
on as usePostForm,
|
|
3134
3143
|
Cr as useRestoreAction,
|
|
3135
3144
|
un as useRestoreDialog,
|
|
3136
3145
|
Nr as useScrollTrigger,
|