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