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