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