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