thecore-auth 0.0.72 → 0.0.73
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/dist/thecore-auth.cjs.js +11 -11
- package/dist/thecore-auth.esm.js +669 -619
- package/package.json +1 -1
package/dist/thecore-auth.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as r from "react";
|
|
2
|
-
import W, { createContext as
|
|
2
|
+
import W, { createContext as ae, useState as j, useContext as se, useEffect as G } from "react";
|
|
3
3
|
import at from "jwt-decode";
|
|
4
|
-
import { useNavigate as
|
|
4
|
+
import { useNavigate as qe, useLocation as st, matchPath as Ge, Outlet as Ce, Navigate as it, useParams as lt, Routes as ct, Route as ee } from "react-router-dom";
|
|
5
5
|
import { BrowserRouter as Vt, Link as Xt, NavLink as Jt, Outlet as Kt, Route as Qt, Routes as e0, useLocation as t0, useMatch as r0 } from "react-router-dom";
|
|
6
6
|
import ut from "axios";
|
|
7
|
-
var me = { exports: {} },
|
|
7
|
+
var me = { exports: {} }, ue = {};
|
|
8
8
|
/**
|
|
9
9
|
* @license React
|
|
10
10
|
* react-jsx-runtime.production.js
|
|
@@ -14,17 +14,17 @@ var me = { exports: {} }, ce = {};
|
|
|
14
14
|
* This source code is licensed under the MIT license found in the
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
|
16
16
|
*/
|
|
17
|
-
var
|
|
17
|
+
var Be;
|
|
18
18
|
function ft() {
|
|
19
|
-
if (
|
|
20
|
-
|
|
19
|
+
if (Be) return ue;
|
|
20
|
+
Be = 1;
|
|
21
21
|
var t = Symbol.for("react.transitional.element"), o = Symbol.for("react.fragment");
|
|
22
22
|
function n(s, c, u) {
|
|
23
23
|
var f = null;
|
|
24
24
|
if (u !== void 0 && (f = "" + u), c.key !== void 0 && (f = "" + c.key), "key" in c) {
|
|
25
25
|
u = {};
|
|
26
|
-
for (var
|
|
27
|
-
|
|
26
|
+
for (var m in c)
|
|
27
|
+
m !== "key" && (u[m] = c[m]);
|
|
28
28
|
} else u = c;
|
|
29
29
|
return c = u.ref, {
|
|
30
30
|
$$typeof: t,
|
|
@@ -34,9 +34,9 @@ function ft() {
|
|
|
34
34
|
props: u
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return ue.Fragment = o, ue.jsx = n, ue.jsxs = n, ue;
|
|
38
38
|
}
|
|
39
|
-
var
|
|
39
|
+
var fe = {};
|
|
40
40
|
/**
|
|
41
41
|
* @license React
|
|
42
42
|
* react-jsx-runtime.development.js
|
|
@@ -52,39 +52,39 @@ function dt() {
|
|
|
52
52
|
function t(e) {
|
|
53
53
|
if (e == null) return null;
|
|
54
54
|
if (typeof e == "function")
|
|
55
|
-
return e.$$typeof ===
|
|
55
|
+
return e.$$typeof === M ? null : e.displayName || e.name || null;
|
|
56
56
|
if (typeof e == "string") return e;
|
|
57
57
|
switch (e) {
|
|
58
|
-
case
|
|
58
|
+
case H:
|
|
59
59
|
return "Fragment";
|
|
60
|
-
case
|
|
60
|
+
case N:
|
|
61
61
|
return "Portal";
|
|
62
|
-
case
|
|
62
|
+
case V:
|
|
63
63
|
return "Profiler";
|
|
64
|
-
case
|
|
64
|
+
case Y:
|
|
65
65
|
return "StrictMode";
|
|
66
|
-
case
|
|
66
|
+
case J:
|
|
67
67
|
return "Suspense";
|
|
68
|
-
case
|
|
68
|
+
case B:
|
|
69
69
|
return "SuspenseList";
|
|
70
70
|
}
|
|
71
71
|
if (typeof e == "object")
|
|
72
72
|
switch (typeof e.tag == "number" && console.error(
|
|
73
73
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
74
74
|
), e.$$typeof) {
|
|
75
|
-
case
|
|
75
|
+
case X:
|
|
76
76
|
return (e.displayName || "Context") + ".Provider";
|
|
77
|
-
case
|
|
77
|
+
case re:
|
|
78
78
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
79
|
-
case
|
|
80
|
-
var
|
|
81
|
-
return e = e.displayName, e || (e =
|
|
82
|
-
case
|
|
83
|
-
return
|
|
84
|
-
case
|
|
85
|
-
|
|
79
|
+
case Z:
|
|
80
|
+
var i = e.render;
|
|
81
|
+
return e = e.displayName, e || (e = i.displayName || i.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
82
|
+
case K:
|
|
83
|
+
return i = e.displayName || null, i !== null ? i : t(e.type) || "Memo";
|
|
84
|
+
case w:
|
|
85
|
+
i = e._payload, e = e._init;
|
|
86
86
|
try {
|
|
87
|
-
return t(e(
|
|
87
|
+
return t(e(i));
|
|
88
88
|
} catch {
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -96,17 +96,17 @@ function dt() {
|
|
|
96
96
|
function n(e) {
|
|
97
97
|
try {
|
|
98
98
|
o(e);
|
|
99
|
-
var
|
|
99
|
+
var i = !1;
|
|
100
100
|
} catch {
|
|
101
|
-
|
|
101
|
+
i = !0;
|
|
102
102
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
return
|
|
107
|
-
|
|
103
|
+
if (i) {
|
|
104
|
+
i = console;
|
|
105
|
+
var l = i.error, v = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
106
|
+
return l.call(
|
|
107
|
+
i,
|
|
108
108
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
109
|
-
|
|
109
|
+
v
|
|
110
110
|
), o(e);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
@@ -114,7 +114,7 @@ function dt() {
|
|
|
114
114
|
}
|
|
115
115
|
function c() {
|
|
116
116
|
if (le === 0) {
|
|
117
|
-
|
|
117
|
+
Se = console.log, Oe = console.info, Pe = console.warn, ke = console.error, Re = console.group, Te = console.groupCollapsed, _e = console.groupEnd;
|
|
118
118
|
var e = {
|
|
119
119
|
configurable: !0,
|
|
120
120
|
enumerable: !0,
|
|
@@ -137,13 +137,13 @@ function dt() {
|
|
|
137
137
|
if (le--, le === 0) {
|
|
138
138
|
var e = { configurable: !0, enumerable: !0, writable: !0 };
|
|
139
139
|
Object.defineProperties(console, {
|
|
140
|
-
log:
|
|
141
|
-
info:
|
|
142
|
-
warn:
|
|
143
|
-
error:
|
|
144
|
-
group:
|
|
145
|
-
groupCollapsed:
|
|
146
|
-
groupEnd:
|
|
140
|
+
log: $({}, e, { value: Se }),
|
|
141
|
+
info: $({}, e, { value: Oe }),
|
|
142
|
+
warn: $({}, e, { value: Pe }),
|
|
143
|
+
error: $({}, e, { value: ke }),
|
|
144
|
+
group: $({}, e, { value: Re }),
|
|
145
|
+
groupCollapsed: $({}, e, { value: Te }),
|
|
146
|
+
groupEnd: $({}, e, { value: _e })
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
0 > le && console.error(
|
|
@@ -154,47 +154,47 @@ function dt() {
|
|
|
154
154
|
if (Ee === void 0)
|
|
155
155
|
try {
|
|
156
156
|
throw Error();
|
|
157
|
-
} catch (
|
|
158
|
-
var
|
|
159
|
-
Ee =
|
|
160
|
-
at`) ? " (<anonymous>)" : -1 <
|
|
157
|
+
} catch (l) {
|
|
158
|
+
var i = l.stack.trim().match(/\n( *(at )?)/);
|
|
159
|
+
Ee = i && i[1] || "", Ne = -1 < l.stack.indexOf(`
|
|
160
|
+
at`) ? " (<anonymous>)" : -1 < l.stack.indexOf("@") ? "@unknown:0:0" : "";
|
|
161
161
|
}
|
|
162
162
|
return `
|
|
163
|
-
` + Ee + e +
|
|
163
|
+
` + Ee + e + Ne;
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function m(e, i) {
|
|
166
166
|
if (!e || be) return "";
|
|
167
|
-
var
|
|
168
|
-
if (
|
|
169
|
-
be = !0,
|
|
170
|
-
var
|
|
171
|
-
|
|
167
|
+
var l = ye.get(e);
|
|
168
|
+
if (l !== void 0) return l;
|
|
169
|
+
be = !0, l = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
|
|
170
|
+
var v = null;
|
|
171
|
+
v = I.H, I.H = null, c();
|
|
172
172
|
try {
|
|
173
|
-
var
|
|
173
|
+
var T = {
|
|
174
174
|
DetermineComponentFrameRoot: function() {
|
|
175
175
|
try {
|
|
176
|
-
if (
|
|
177
|
-
var
|
|
176
|
+
if (i) {
|
|
177
|
+
var q = function() {
|
|
178
178
|
throw Error();
|
|
179
179
|
};
|
|
180
|
-
if (Object.defineProperty(
|
|
180
|
+
if (Object.defineProperty(q.prototype, "props", {
|
|
181
181
|
set: function() {
|
|
182
182
|
throw Error();
|
|
183
183
|
}
|
|
184
184
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
185
185
|
try {
|
|
186
|
-
Reflect.construct(
|
|
186
|
+
Reflect.construct(q, []);
|
|
187
187
|
} catch (D) {
|
|
188
188
|
var de = D;
|
|
189
189
|
}
|
|
190
|
-
Reflect.construct(e, [],
|
|
190
|
+
Reflect.construct(e, [], q);
|
|
191
191
|
} else {
|
|
192
192
|
try {
|
|
193
|
-
|
|
193
|
+
q.call();
|
|
194
194
|
} catch (D) {
|
|
195
195
|
de = D;
|
|
196
196
|
}
|
|
197
|
-
e.call(
|
|
197
|
+
e.call(q.prototype);
|
|
198
198
|
}
|
|
199
199
|
} else {
|
|
200
200
|
try {
|
|
@@ -202,7 +202,7 @@ function dt() {
|
|
|
202
202
|
} catch (D) {
|
|
203
203
|
de = D;
|
|
204
204
|
}
|
|
205
|
-
(
|
|
205
|
+
(q = e()) && typeof q.catch == "function" && q.catch(function() {
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
} catch (D) {
|
|
@@ -212,123 +212,123 @@ function dt() {
|
|
|
212
212
|
return [null, null];
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
|
-
|
|
216
|
-
var
|
|
217
|
-
|
|
215
|
+
T.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
|
|
216
|
+
var O = Object.getOwnPropertyDescriptor(
|
|
217
|
+
T.DetermineComponentFrameRoot,
|
|
218
218
|
"name"
|
|
219
219
|
);
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
O && O.configurable && Object.defineProperty(
|
|
221
|
+
T.DetermineComponentFrameRoot,
|
|
222
222
|
"name",
|
|
223
223
|
{ value: "DetermineComponentFrameRoot" }
|
|
224
224
|
);
|
|
225
|
-
var
|
|
226
|
-
if (F &&
|
|
227
|
-
var
|
|
228
|
-
`),
|
|
225
|
+
var g = T.DetermineComponentFrameRoot(), F = g[0], oe = g[1];
|
|
226
|
+
if (F && oe) {
|
|
227
|
+
var _ = F.split(`
|
|
228
|
+
`), Q = oe.split(`
|
|
229
229
|
`);
|
|
230
|
-
for (
|
|
230
|
+
for (g = O = 0; O < _.length && !_[O].includes(
|
|
231
231
|
"DetermineComponentFrameRoot"
|
|
232
232
|
); )
|
|
233
|
-
|
|
234
|
-
for (;
|
|
233
|
+
O++;
|
|
234
|
+
for (; g < Q.length && !Q[g].includes(
|
|
235
235
|
"DetermineComponentFrameRoot"
|
|
236
236
|
); )
|
|
237
|
-
|
|
238
|
-
if (
|
|
239
|
-
for (
|
|
240
|
-
|
|
241
|
-
for (; 1 <=
|
|
242
|
-
if (
|
|
243
|
-
if (
|
|
237
|
+
g++;
|
|
238
|
+
if (O === _.length || g === Q.length)
|
|
239
|
+
for (O = _.length - 1, g = Q.length - 1; 1 <= O && 0 <= g && _[O] !== Q[g]; )
|
|
240
|
+
g--;
|
|
241
|
+
for (; 1 <= O && 0 <= g; O--, g--)
|
|
242
|
+
if (_[O] !== Q[g]) {
|
|
243
|
+
if (O !== 1 || g !== 1)
|
|
244
244
|
do
|
|
245
|
-
if (
|
|
246
|
-
var
|
|
247
|
-
` +
|
|
245
|
+
if (O--, g--, 0 > g || _[O] !== Q[g]) {
|
|
246
|
+
var ce = `
|
|
247
|
+
` + _[O].replace(
|
|
248
248
|
" at new ",
|
|
249
249
|
" at "
|
|
250
250
|
);
|
|
251
|
-
return e.displayName &&
|
|
251
|
+
return e.displayName && ce.includes("<anonymous>") && (ce = ce.replace("<anonymous>", e.displayName)), typeof e == "function" && ye.set(e, ce), ce;
|
|
252
252
|
}
|
|
253
|
-
while (1 <=
|
|
253
|
+
while (1 <= O && 0 <= g);
|
|
254
254
|
break;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
} finally {
|
|
258
|
-
be = !1,
|
|
258
|
+
be = !1, I.H = v, u(), Error.prepareStackTrace = l;
|
|
259
259
|
}
|
|
260
|
-
return
|
|
260
|
+
return _ = (_ = e ? e.displayName || e.name : "") ? f(_) : "", typeof e == "function" && ye.set(e, _), _;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function d(e) {
|
|
263
263
|
if (e == null) return "";
|
|
264
264
|
if (typeof e == "function") {
|
|
265
|
-
var
|
|
266
|
-
return
|
|
265
|
+
var i = e.prototype;
|
|
266
|
+
return m(
|
|
267
267
|
e,
|
|
268
|
-
!(!
|
|
268
|
+
!(!i || !i.isReactComponent)
|
|
269
269
|
);
|
|
270
270
|
}
|
|
271
271
|
if (typeof e == "string") return f(e);
|
|
272
272
|
switch (e) {
|
|
273
|
-
case
|
|
273
|
+
case J:
|
|
274
274
|
return f("Suspense");
|
|
275
|
-
case
|
|
275
|
+
case B:
|
|
276
276
|
return f("SuspenseList");
|
|
277
277
|
}
|
|
278
278
|
if (typeof e == "object")
|
|
279
279
|
switch (e.$$typeof) {
|
|
280
|
-
case
|
|
281
|
-
return e =
|
|
282
|
-
case
|
|
283
|
-
return
|
|
284
|
-
case
|
|
285
|
-
|
|
280
|
+
case Z:
|
|
281
|
+
return e = m(e.render, !1), e;
|
|
282
|
+
case K:
|
|
283
|
+
return d(e.type);
|
|
284
|
+
case w:
|
|
285
|
+
i = e._payload, e = e._init;
|
|
286
286
|
try {
|
|
287
|
-
return
|
|
287
|
+
return d(e(i));
|
|
288
288
|
} catch {
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
return "";
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
var e =
|
|
293
|
+
function y() {
|
|
294
|
+
var e = I.A;
|
|
295
295
|
return e === null ? null : e.getOwner();
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
if (
|
|
299
|
-
var
|
|
300
|
-
if (
|
|
297
|
+
function C(e) {
|
|
298
|
+
if (U.call(e, "key")) {
|
|
299
|
+
var i = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
300
|
+
if (i && i.isReactWarning) return !1;
|
|
301
301
|
}
|
|
302
302
|
return e.key !== void 0;
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
function
|
|
306
|
-
|
|
304
|
+
function P(e, i) {
|
|
305
|
+
function l() {
|
|
306
|
+
Ae || (Ae = !0, console.error(
|
|
307
307
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
308
|
-
|
|
308
|
+
i
|
|
309
309
|
));
|
|
310
310
|
}
|
|
311
|
-
|
|
312
|
-
get:
|
|
311
|
+
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
312
|
+
get: l,
|
|
313
313
|
configurable: !0
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function h() {
|
|
317
317
|
var e = t(this.type);
|
|
318
|
-
return
|
|
318
|
+
return Me[e] || (Me[e] = !0, console.error(
|
|
319
319
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
320
320
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
321
321
|
}
|
|
322
|
-
function
|
|
323
|
-
return
|
|
324
|
-
$$typeof:
|
|
322
|
+
function E(e, i, l, v, T, O) {
|
|
323
|
+
return l = O.ref, e = {
|
|
324
|
+
$$typeof: k,
|
|
325
325
|
type: e,
|
|
326
|
-
key:
|
|
327
|
-
props:
|
|
328
|
-
_owner:
|
|
329
|
-
}, (
|
|
326
|
+
key: i,
|
|
327
|
+
props: O,
|
|
328
|
+
_owner: T
|
|
329
|
+
}, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
|
|
330
330
|
enumerable: !1,
|
|
331
|
-
get:
|
|
331
|
+
get: h
|
|
332
332
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
333
333
|
configurable: !1,
|
|
334
334
|
enumerable: !1,
|
|
@@ -341,122 +341,122 @@ function dt() {
|
|
|
341
341
|
value: null
|
|
342
342
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
345
|
-
if (typeof e == "string" || typeof e == "function" || e ===
|
|
346
|
-
var
|
|
347
|
-
if (
|
|
348
|
-
if (
|
|
349
|
-
if (ve(
|
|
350
|
-
for (
|
|
351
|
-
|
|
352
|
-
Object.freeze && Object.freeze(
|
|
344
|
+
function p(e, i, l, v, T, O) {
|
|
345
|
+
if (typeof e == "string" || typeof e == "function" || e === H || e === V || e === Y || e === J || e === B || e === A || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === K || e.$$typeof === X || e.$$typeof === re || e.$$typeof === Z || e.$$typeof === Le || e.getModuleId !== void 0)) {
|
|
346
|
+
var g = i.children;
|
|
347
|
+
if (g !== void 0)
|
|
348
|
+
if (v)
|
|
349
|
+
if (ve(g)) {
|
|
350
|
+
for (v = 0; v < g.length; v++)
|
|
351
|
+
b(g[v], e);
|
|
352
|
+
Object.freeze && Object.freeze(g);
|
|
353
353
|
} else
|
|
354
354
|
console.error(
|
|
355
355
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
356
356
|
);
|
|
357
|
-
else
|
|
357
|
+
else b(g, e);
|
|
358
358
|
} else
|
|
359
|
-
|
|
359
|
+
g = "", (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (g += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), e === null ? v = "null" : ve(e) ? v = "array" : e !== void 0 && e.$$typeof === k ? (v = "<" + (t(e.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : v = typeof e, console.error(
|
|
360
360
|
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
|
|
361
|
-
|
|
362
|
-
|
|
361
|
+
v,
|
|
362
|
+
g
|
|
363
363
|
);
|
|
364
|
-
if (
|
|
365
|
-
|
|
366
|
-
var F = Object.keys(
|
|
367
|
-
return
|
|
364
|
+
if (U.call(i, "key")) {
|
|
365
|
+
g = t(e);
|
|
366
|
+
var F = Object.keys(i).filter(function(_) {
|
|
367
|
+
return _ !== "key";
|
|
368
368
|
});
|
|
369
|
-
|
|
369
|
+
v = 0 < F.length ? "{key: someKey, " + F.join(": ..., ") + ": ...}" : "{key: someKey}", Ie[g + v] || (F = 0 < F.length ? "{" + F.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
370
370
|
`A props object containing a "key" prop is being spread into JSX:
|
|
371
371
|
let props = %s;
|
|
372
372
|
<%s {...props} />
|
|
373
373
|
React keys must be passed directly to JSX without using spread:
|
|
374
374
|
let props = %s;
|
|
375
375
|
<%s key={someKey} {...props} />`,
|
|
376
|
-
|
|
377
|
-
|
|
376
|
+
v,
|
|
377
|
+
g,
|
|
378
378
|
F,
|
|
379
|
-
|
|
380
|
-
),
|
|
379
|
+
g
|
|
380
|
+
), Ie[g + v] = !0);
|
|
381
381
|
}
|
|
382
|
-
if (
|
|
383
|
-
|
|
384
|
-
for (var
|
|
385
|
-
|
|
386
|
-
} else
|
|
387
|
-
return
|
|
388
|
-
|
|
382
|
+
if (g = null, l !== void 0 && (n(l), g = "" + l), C(i) && (n(i.key), g = "" + i.key), "key" in i) {
|
|
383
|
+
l = {};
|
|
384
|
+
for (var oe in i)
|
|
385
|
+
oe !== "key" && (l[oe] = i[oe]);
|
|
386
|
+
} else l = i;
|
|
387
|
+
return g && P(
|
|
388
|
+
l,
|
|
389
389
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
390
|
-
),
|
|
390
|
+
), E(e, g, O, T, y(), l);
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function b(e, i) {
|
|
393
393
|
if (typeof e == "object" && e && e.$$typeof !== nt) {
|
|
394
394
|
if (ve(e))
|
|
395
|
-
for (var
|
|
396
|
-
var
|
|
397
|
-
|
|
395
|
+
for (var l = 0; l < e.length; l++) {
|
|
396
|
+
var v = e[l];
|
|
397
|
+
L(v) && S(v, i);
|
|
398
398
|
}
|
|
399
|
-
else if (
|
|
399
|
+
else if (L(e))
|
|
400
400
|
e._store && (e._store.validated = 1);
|
|
401
|
-
else if (e === null || typeof e != "object" ?
|
|
402
|
-
for (; !(e =
|
|
403
|
-
|
|
401
|
+
else if (e === null || typeof e != "object" ? l = null : (l = z && e[z] || e["@@iterator"], l = typeof l == "function" ? l : null), typeof l == "function" && l !== e.entries && (l = l.call(e), l !== e))
|
|
402
|
+
for (; !(e = l.next()).done; )
|
|
403
|
+
L(e.value) && S(e.value, i);
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
function
|
|
407
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
406
|
+
function L(e) {
|
|
407
|
+
return typeof e == "object" && e !== null && e.$$typeof === k;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
410
|
-
if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1,
|
|
411
|
-
ze[
|
|
412
|
-
var
|
|
413
|
-
e && e._owner != null && e._owner !==
|
|
414
|
-
var
|
|
415
|
-
|
|
416
|
-
var
|
|
417
|
-
return
|
|
409
|
+
function S(e, i) {
|
|
410
|
+
if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1, i = x(i), !ze[i])) {
|
|
411
|
+
ze[i] = !0;
|
|
412
|
+
var l = "";
|
|
413
|
+
e && e._owner != null && e._owner !== y() && (l = null, typeof e._owner.tag == "number" ? l = t(e._owner.type) : typeof e._owner.name == "string" && (l = e._owner.name), l = " It was passed a child from " + l + ".");
|
|
414
|
+
var v = I.getCurrentStack;
|
|
415
|
+
I.getCurrentStack = function() {
|
|
416
|
+
var T = d(e.type);
|
|
417
|
+
return v && (T += v() || ""), T;
|
|
418
418
|
}, console.error(
|
|
419
419
|
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
),
|
|
420
|
+
i,
|
|
421
|
+
l
|
|
422
|
+
), I.getCurrentStack = v;
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
function
|
|
426
|
-
var
|
|
427
|
-
return
|
|
425
|
+
function x(e) {
|
|
426
|
+
var i = "", l = y();
|
|
427
|
+
return l && (l = t(l.type)) && (i = `
|
|
428
428
|
|
|
429
|
-
Check the render method of \`` +
|
|
429
|
+
Check the render method of \`` + l + "`."), i || (e = t(e)) && (i = `
|
|
430
430
|
|
|
431
|
-
Check the top-level render call using <` + e + ">."),
|
|
431
|
+
Check the top-level render call using <` + e + ">."), i;
|
|
432
432
|
}
|
|
433
|
-
var
|
|
433
|
+
var R = W, k = Symbol.for("react.transitional.element"), N = Symbol.for("react.portal"), H = Symbol.for("react.fragment"), Y = Symbol.for("react.strict_mode"), V = Symbol.for("react.profiler"), re = Symbol.for("react.consumer"), X = Symbol.for("react.context"), Z = Symbol.for("react.forward_ref"), J = Symbol.for("react.suspense"), B = Symbol.for("react.suspense_list"), K = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), A = Symbol.for("react.offscreen"), z = Symbol.iterator, M = Symbol.for("react.client.reference"), I = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, $ = Object.assign, Le = Symbol.for("react.client.reference"), ve = Array.isArray, le = 0, Se, Oe, Pe, ke, Re, Te, _e;
|
|
434
434
|
s.__reactDisabledLog = !0;
|
|
435
|
-
var Ee,
|
|
436
|
-
|
|
437
|
-
return
|
|
438
|
-
},
|
|
439
|
-
return
|
|
435
|
+
var Ee, Ne, be = !1, ye = new (typeof WeakMap == "function" ? WeakMap : Map)(), nt = Symbol.for("react.client.reference"), Ae, Me = {}, Ie = {}, ze = {};
|
|
436
|
+
fe.Fragment = H, fe.jsx = function(e, i, l, v, T) {
|
|
437
|
+
return p(e, i, l, !1, v, T);
|
|
438
|
+
}, fe.jsxs = function(e, i, l, v, T) {
|
|
439
|
+
return p(e, i, l, !0, v, T);
|
|
440
440
|
};
|
|
441
|
-
}()),
|
|
441
|
+
}()), fe;
|
|
442
442
|
}
|
|
443
|
-
var
|
|
443
|
+
var Fe;
|
|
444
444
|
function mt() {
|
|
445
|
-
return
|
|
445
|
+
return Fe || (Fe = 1, process.env.NODE_ENV === "production" ? me.exports = ft() : me.exports = dt()), me.exports;
|
|
446
446
|
}
|
|
447
447
|
var a = mt();
|
|
448
|
-
const He =
|
|
449
|
-
const [o, n] =
|
|
448
|
+
const He = ae(), Bt = ({ children: t }) => {
|
|
449
|
+
const [o, n] = j(!1), [s, c] = j(!1), [u, f] = j({});
|
|
450
450
|
return /* @__PURE__ */ a.jsx(He.Provider, { value: { isLoading: o, setIsLoading: n, isLoadingComponent: s, setIsLoadingComponent: c, loadingProps: u, setLoadingProps: f }, children: t });
|
|
451
451
|
}, xe = () => {
|
|
452
|
-
const t =
|
|
452
|
+
const t = se(He);
|
|
453
453
|
if (t === void 0) throw new Error("Non puoi settare il loading");
|
|
454
454
|
return t;
|
|
455
455
|
}, pt = ({ errorMessage: t, errorShow: o }) => /* @__PURE__ */ a.jsx("section", { className: o ? "" : "hidden", children: /* @__PURE__ */ a.jsxs("div", { className: "container mx-auto", children: [
|
|
456
456
|
/* @__PURE__ */ a.jsx("h1", { className: "text-center text-8xl my-12", children: "Errore" }),
|
|
457
457
|
/* @__PURE__ */ a.jsx("pre", { className: "text-xl", children: t })
|
|
458
|
-
] }) }),
|
|
459
|
-
const [o, n] =
|
|
458
|
+
] }) }), Ve = ae(), $t = ({ children: t }) => {
|
|
459
|
+
const [o, n] = j({}), [s, c] = j(!1), u = `Creare un file config.json in public per il corretto funzionamento
|
|
460
460
|
Esempio di config.json:
|
|
461
461
|
|
|
462
462
|
{
|
|
@@ -478,211 +478,73 @@ Esempio di config.json:
|
|
|
478
478
|
"autoLogin": ,
|
|
479
479
|
"autoLoginEmail": ,
|
|
480
480
|
"autoLoginPassword":
|
|
481
|
-
}`, f =
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
const t = ae(qe);
|
|
494
|
-
if (t === void 0) throw new Error("Non puoi leggere i config");
|
|
495
|
-
return t;
|
|
496
|
-
}, Ve = ne(), Ft = ({ children: t }) => {
|
|
497
|
-
const [o, n] = v(!1), [s, c] = v(), [u, f] = v(), d = {
|
|
498
|
-
showAlert: o,
|
|
499
|
-
setShowAlert: n,
|
|
500
|
-
typeAlert: s,
|
|
501
|
-
setTypeAlert: c,
|
|
502
|
-
messageAlert: u,
|
|
503
|
-
setMessageAlert: f
|
|
504
|
-
};
|
|
505
|
-
return /* @__PURE__ */ a.jsx(Ve.Provider, { value: d, children: t });
|
|
506
|
-
}, se = () => {
|
|
507
|
-
const t = ae(Ve);
|
|
508
|
-
if (t === void 0) throw new Error("Non puoi modificare l'alert");
|
|
509
|
-
return t;
|
|
510
|
-
};
|
|
511
|
-
let oe;
|
|
512
|
-
const pe = async (t, o, n) => {
|
|
513
|
-
if (oe) return oe;
|
|
514
|
-
try {
|
|
515
|
-
const c = await (await fetch("/config.json")).json(), u = c.baseUri, { unauthorized: f, notFound: d, defaultMessage: p } = c.axiosErrors, b = c.axiosTimeout;
|
|
516
|
-
return oe = ut.create({
|
|
517
|
-
baseURL: u,
|
|
518
|
-
timeout: b
|
|
519
|
-
}), oe.interceptors.request.use(
|
|
520
|
-
(g) => g
|
|
521
|
-
), oe.interceptors.response.use(
|
|
522
|
-
(g) => g,
|
|
523
|
-
(g) => {
|
|
524
|
-
if (g.response)
|
|
525
|
-
switch (t(!0), o("danger"), g.response.status) {
|
|
526
|
-
case 401:
|
|
527
|
-
localStorage.removeItem("accessToken"), n(f);
|
|
528
|
-
break;
|
|
529
|
-
case 404:
|
|
530
|
-
n(d);
|
|
531
|
-
break;
|
|
532
|
-
default:
|
|
533
|
-
n(`${p} ${g.response.status} ${g.response.data.error}`);
|
|
534
|
-
}
|
|
535
|
-
return Promise.reject(g);
|
|
481
|
+
}`, f = () => new Promise((h, E) => {
|
|
482
|
+
const p = indexedDB.open("configDatabase", 1);
|
|
483
|
+
p.onupgradeneeded = (b) => {
|
|
484
|
+
const L = b.target.result;
|
|
485
|
+
L.objectStoreNames.contains("settings") || L.createObjectStore("settings", { keyPath: "id" });
|
|
486
|
+
}, p.onsuccess = (b) => h(b.target.result), p.onerror = (b) => E(b.target.error);
|
|
487
|
+
}), m = async (h, E) => {
|
|
488
|
+
let p = await f();
|
|
489
|
+
return new Promise((b, L) => {
|
|
490
|
+
if (!p) {
|
|
491
|
+
L("Errore: DB non disponibile");
|
|
492
|
+
return;
|
|
536
493
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
console.error(s);
|
|
540
|
-
}
|
|
541
|
-
}, Xe = ne(), Dt = ({ children: t }) => {
|
|
542
|
-
const { heartbeatEndpoint: o, firstPrivatePath: n, infiniteSession: s, timeDeducted: c, authenticatedEndpoint: u, autoLogin: f, autoLoginEmail: d, autoLoginPassword: p } = K(), { setIsLoading: b } = xe(), { setShowAlert: g, setMessageAlert: S, setTypeAlert: O } = se(), T = Ue(), [L, y] = v(null), [j, E] = v(), [N, M] = v(), [C, I] = v(), [G, H] = v(!1), Q = () => {
|
|
543
|
-
const x = /* @__PURE__ */ new Date(), k = String(x.getDate()).padStart(2, "0"), B = String(x.getMonth() + 1).padStart(2, "0"), _ = x.getFullYear(), te = String(x.getHours()).padStart(2, "0"), A = String(x.getMinutes()).padStart(2, "0"), fe = String(x.getSeconds()).padStart(2, "0");
|
|
544
|
-
return `${k}/${B}/${_} ${te}:${A}:${fe}`;
|
|
545
|
-
}, Y = async (x = null, k) => {
|
|
546
|
-
x && x.preventDefault(), H(!0);
|
|
547
|
-
try {
|
|
548
|
-
b(!0), g(!1);
|
|
549
|
-
const _ = await (await pe(g, O, S)).post(u, {
|
|
550
|
-
auth: k
|
|
551
|
-
}), te = _.data.id, A = _.headers.token;
|
|
552
|
-
A && (localStorage.setItem("accessToken", A), localStorage.setItem("id", te), y(!0), E(A), T(`${n}${te}`));
|
|
553
|
-
} catch (B) {
|
|
554
|
-
console.error(B);
|
|
555
|
-
} finally {
|
|
556
|
-
H(!1), b(!1);
|
|
557
|
-
}
|
|
558
|
-
}, q = () => {
|
|
559
|
-
localStorage.removeItem("accessToken"), localStorage.removeItem("id"), y(!1), E(null);
|
|
560
|
-
}, ee = async () => {
|
|
561
|
-
try {
|
|
562
|
-
const x = localStorage.getItem("accessToken"), _ = (await (await pe(g, O, S)).get(
|
|
563
|
-
`${o}`,
|
|
564
|
-
{ headers: {
|
|
565
|
-
Authorization: x
|
|
566
|
-
} }
|
|
567
|
-
)).headers.token;
|
|
568
|
-
localStorage.setItem("accessToken", _), E(_), console.log("nuovo token: ", _, "Data:", Q());
|
|
569
|
-
} catch (x) {
|
|
570
|
-
console.error(x), q();
|
|
571
|
-
}
|
|
572
|
-
}, V = () => {
|
|
573
|
-
if (!j)
|
|
574
|
-
return;
|
|
575
|
-
const k = at(j).exp, B = Math.floor(Date.now() / 1e3), _ = (k - B) * 1e3;
|
|
576
|
-
I(_), M(_ - c);
|
|
577
|
-
};
|
|
578
|
-
z(() => {
|
|
579
|
-
if (localStorage.getItem("accessToken"))
|
|
580
|
-
y(!0);
|
|
581
|
-
else {
|
|
582
|
-
y(!1);
|
|
583
|
-
return;
|
|
584
|
-
}
|
|
585
|
-
}, []), z(() => {
|
|
586
|
-
const x = localStorage.getItem("accessToken");
|
|
587
|
-
f && !x && !G && Y(null, {
|
|
588
|
-
email: d,
|
|
589
|
-
password: p
|
|
494
|
+
const S = p == null ? void 0 : p.transaction(h, "readonly"), x = S == null ? void 0 : S.objectStore(h), R = x == null ? void 0 : x.get(E);
|
|
495
|
+
R.onsuccess = () => b(R.result), R.onerror = (k) => L(k.target.error);
|
|
590
496
|
});
|
|
591
|
-
},
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
}, C)), () => {
|
|
601
|
-
x && clearInterval(x), k && clearTimeout(k);
|
|
602
|
-
};
|
|
603
|
-
}, [j, N]), z(() => {
|
|
604
|
-
L || f && !G && Y(null, {
|
|
605
|
-
email: d,
|
|
606
|
-
password: p
|
|
497
|
+
}, d = async (h, E) => {
|
|
498
|
+
let p = await f();
|
|
499
|
+
return new Promise((b, L) => {
|
|
500
|
+
if (!p) {
|
|
501
|
+
L("Errore: DB non disponibile");
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
const S = p == null ? void 0 : p.transaction(h, "readwrite"), x = S == null ? void 0 : S.objectStore(h), R = x == null ? void 0 : x.put(E);
|
|
505
|
+
R.onsuccess = () => b(R.result), R.onerror = (k) => L(k.target.error);
|
|
607
506
|
});
|
|
608
|
-
},
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
Esempio:
|
|
630
|
-
|
|
631
|
-
<RouteProvider publicRoutes={[]} privateRoutes={[]}>
|
|
632
|
-
<MyPackageRoutes />
|
|
633
|
-
</RouteProvider>`
|
|
634
|
-
);
|
|
635
|
-
return t;
|
|
636
|
-
}, Ke = ne(), Yt = ({ children: t }) => {
|
|
637
|
-
const { login: o } = we(), { clearLoginFormOnError: n } = K(), s = {
|
|
638
|
-
email: "",
|
|
639
|
-
password: ""
|
|
640
|
-
}, [c, u] = v("Accedi"), [f, d] = v("Email"), [p, b] = v("email"), [g, S] = v("example@example.it"), [O, T] = v("Accedi"), [L, y] = v(s), [j, E] = v(), [N, M] = v(), [C, I] = v(), [G, H] = v(), [Q, Y] = v({}), V = {
|
|
641
|
-
overrideStyle: Q,
|
|
642
|
-
setOverrideStyle: Y,
|
|
643
|
-
title: c,
|
|
644
|
-
setTitle: u,
|
|
645
|
-
label: f,
|
|
646
|
-
setLabel: d,
|
|
647
|
-
type: p,
|
|
648
|
-
setType: b,
|
|
649
|
-
placeholder: g,
|
|
650
|
-
setPlaceholder: S,
|
|
651
|
-
buttonText: O,
|
|
652
|
-
setButtonText: T,
|
|
653
|
-
formData: L,
|
|
654
|
-
setFormData: y,
|
|
655
|
-
LogoImg: j,
|
|
656
|
-
setLogoImg: E,
|
|
657
|
-
styleCardForm: N,
|
|
658
|
-
setStyleCardForm: M,
|
|
659
|
-
styleContainerLogo: C,
|
|
660
|
-
setStyleContainerLogo: I,
|
|
661
|
-
styleLogo: G,
|
|
662
|
-
setStyleLogo: H,
|
|
663
|
-
changeData: ($, x) => {
|
|
664
|
-
y((k) => ({ ...k, [$]: x }));
|
|
665
|
-
},
|
|
666
|
-
handleLogin: ($) => {
|
|
667
|
-
o($, L), n && y(s);
|
|
507
|
+
}, y = async (h) => {
|
|
508
|
+
let E = Date.now(), p;
|
|
509
|
+
do
|
|
510
|
+
p = await m(h, E), p && E++;
|
|
511
|
+
while (p);
|
|
512
|
+
return E;
|
|
513
|
+
}, C = async (h, E) => {
|
|
514
|
+
E.id || (E.id = await y(h)), await d(h, E);
|
|
515
|
+
}, P = async () => {
|
|
516
|
+
try {
|
|
517
|
+
const p = {
|
|
518
|
+
...await (await fetch("/config.json")).json(),
|
|
519
|
+
openIndexedDB: f,
|
|
520
|
+
getDataIndexedDB: m,
|
|
521
|
+
setDataIndexedDB: d,
|
|
522
|
+
generateUniqueId: y,
|
|
523
|
+
setDataWithAutoId: C
|
|
524
|
+
};
|
|
525
|
+
n(p);
|
|
526
|
+
} catch (h) {
|
|
527
|
+
console.error(h), c(!0);
|
|
668
528
|
}
|
|
669
529
|
};
|
|
670
|
-
return
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
530
|
+
return G(() => {
|
|
531
|
+
P();
|
|
532
|
+
}, []), Object.keys(o).length === 0 ? /* @__PURE__ */ a.jsx(pt, { errorShow: s, errorMessage: u }) : /* @__PURE__ */ a.jsx(Ve.Provider, { value: o, children: t });
|
|
533
|
+
}, te = () => {
|
|
534
|
+
const t = se(Ve);
|
|
535
|
+
if (t === void 0) throw new Error("Non puoi leggere i config");
|
|
674
536
|
return t;
|
|
675
|
-
};
|
|
676
|
-
var
|
|
537
|
+
}, gt = (t) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 500, zoomAndPan: "magnify", viewBox: "0 0 375 374.999991", height: 500, preserveAspectRatio: "xMidYMid meet", ...t }, /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("g", null), /* @__PURE__ */ r.createElement("clipPath", { id: "6ca7e2bf04" }, /* @__PURE__ */ r.createElement("path", { d: "M 265.136719 0 L 375 109.863281 L 375 265.136719 L 265.136719 375 L 109.863281 375 L 0 265.136719 L 0 109.863281 L 109.863281 0 Z M 265.136719 0 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "2c77c820c6" }, /* @__PURE__ */ r.createElement("path", { d: "M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "3d94df7d66" }, /* @__PURE__ */ r.createElement("path", { d: "M 259.804688 12.878906 L 362.121094 115.195312 L 362.121094 259.804688 L 259.804688 362.121094 L 115.195312 362.121094 L 12.878906 259.804688 L 12.878906 115.195312 L 115.195312 12.878906 Z M 259.804688 12.878906 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "8793709a64" }, /* @__PURE__ */ r.createElement("path", { d: "M 12.878906 12.878906 L 362.109375 12.878906 L 362.109375 362.109375 L 12.878906 362.109375 Z M 12.878906 12.878906 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "fdb3fe29d8" }, /* @__PURE__ */ r.createElement("path", { d: "M 259.796875 12.878906 L 362.109375 115.191406 L 362.109375 259.796875 L 259.796875 362.109375 L 115.191406 362.109375 L 12.878906 259.796875 L 12.878906 115.191406 L 115.191406 12.878906 Z M 259.796875 12.878906 ", clipRule: "nonzero" }))), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#6ca7e2bf04)" }, /* @__PURE__ */ r.createElement("rect", { x: -37.5, width: 450, fill: "#b91c1c", y: -37.499999, height: 449.999989, fillOpacity: 1 })), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#2c77c820c6)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#3d94df7d66)" }, /* @__PURE__ */ r.createElement("path", { fill: "#b91c1c", d: "M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ", fillOpacity: 1, fillRule: "nonzero" }))), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#8793709a64)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#fdb3fe29d8)" }, /* @__PURE__ */ r.createElement("path", { strokeLinecap: "butt", transform: "matrix(0.75, 0, 0, 0.75, 12.879396, 12.879392)", fill: "none", strokeLinejoin: "miter", d: "M 329.223327 -0.000647072 L 465.640003 136.416029 L 465.640003 329.223333 L 329.223327 465.640009 L 136.416023 465.640009 L -0.000653072 329.223333 L -0.000653072 136.416029 L 136.416023 -0.000647072 Z M 329.223327 -0.000647072 ", stroke: "#ffffff", strokeWidth: 34, strokeOpacity: 1, strokeMiterlimit: 4 }))), /* @__PURE__ */ r.createElement("g", { fill: "#ffffff", fillOpacity: 1 }, /* @__PURE__ */ r.createElement("g", { transform: "translate(111.648432, 267.442446)" }, /* @__PURE__ */ r.createElement("g", null, /* @__PURE__ */ r.createElement("path", { d: "M 2.828125 0 L 56.25 -79.859375 L 3.046875 -159.609375 L 37.28125 -159.609375 L 75.90625 -98.046875 L 114.53125 -159.609375 L 148.765625 -159.609375 L 95.5625 -79.859375 L 148.984375 0 L 114.765625 0 L 75.671875 -60.65625 L 37.046875 0 Z M 2.828125 0 " }))))), ht = (t) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 500, zoomAndPan: "magnify", viewBox: "0 0 375 374.999991", height: 500, preserveAspectRatio: "xMidYMid meet", ...t }, /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("g", null), /* @__PURE__ */ r.createElement("clipPath", { id: "30562604dd" }, /* @__PURE__ */ r.createElement("path", { d: "M 187.5 0 C 83.945312 0 0 83.945312 0 187.5 C 0 291.054688 83.945312 375 187.5 375 C 291.054688 375 375 291.054688 375 187.5 C 375 83.945312 291.054688 0 187.5 0 Z M 187.5 0 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "971fcd5f72" }, /* @__PURE__ */ r.createElement("path", { d: "M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "e891a7f57e" }, /* @__PURE__ */ r.createElement("path", { d: "M 187.5 18.570312 C 94.203125 18.570312 18.570312 94.203125 18.570312 187.5 C 18.570312 280.796875 94.203125 356.429688 187.5 356.429688 C 280.796875 356.429688 356.429688 280.796875 356.429688 187.5 C 356.429688 94.203125 280.796875 18.570312 187.5 18.570312 Z M 187.5 18.570312 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "19a9ddc130" }, /* @__PURE__ */ r.createElement("path", { d: "M 18.570312 18.570312 L 356.070312 18.570312 L 356.070312 356.070312 L 18.570312 356.070312 Z M 18.570312 18.570312 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "5e650d5bd0" }, /* @__PURE__ */ r.createElement("path", { d: "M 187.496094 18.570312 C 94.199219 18.570312 18.570312 94.199219 18.570312 187.496094 C 18.570312 280.792969 94.199219 356.421875 187.496094 356.421875 C 280.792969 356.421875 356.421875 280.792969 356.421875 187.496094 C 356.421875 94.199219 280.792969 18.570312 187.496094 18.570312 Z M 187.496094 18.570312 ", clipRule: "nonzero" }))), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#30562604dd)" }, /* @__PURE__ */ r.createElement("rect", { x: -37.5, width: 450, fill: "#1d4ed8", y: -37.499999, height: 449.999989, fillOpacity: 1 })), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#971fcd5f72)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#e891a7f57e)" }, /* @__PURE__ */ r.createElement("path", { fill: "#1d4ed8", d: "M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ", fillOpacity: 1, fillRule: "nonzero" }))), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#19a9ddc130)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#5e650d5bd0)" }, /* @__PURE__ */ r.createElement("path", { strokeLinecap: "butt", transform: "matrix(0.75, 0, 0, 0.75, 18.570291, 18.570286)", fill: "none", strokeLinejoin: "miter", d: "M 225.234419 0.0000349326 C 100.838577 0.0000349326 0.0000289326 100.838583 0.0000289326 225.234425 C 0.0000289326 349.630266 100.838577 450.468815 225.234419 450.468815 C 349.63026 450.468815 450.468809 349.630266 450.468809 225.234425 C 450.468809 100.838583 349.63026 0.0000349326 225.234419 0.0000349326 Z M 225.234419 0.0000349326 ", stroke: "#ffffff", strokeWidth: 34, strokeOpacity: 1, strokeMiterlimit: 4 }))), /* @__PURE__ */ r.createElement("g", { fill: "#ffffff", fillOpacity: 1 }, /* @__PURE__ */ r.createElement("g", { transform: "translate(136.121787, 300.837436)" }, /* @__PURE__ */ r.createElement("g", null, /* @__PURE__ */ r.createElement("path", { d: "M 60 -193.78125 C 54.707031 -193.78125 50.109375 -195.734375 46.203125 -199.640625 C 42.296875 -203.554688 40.34375 -208.15625 40.34375 -213.4375 C 40.34375 -218.726562 42.296875 -223.328125 46.203125 -227.234375 C 50.109375 -231.140625 54.707031 -233.09375 60 -233.09375 C 65.28125 -233.09375 69.875 -231.140625 73.78125 -227.234375 C 77.695312 -223.328125 79.65625 -218.726562 79.65625 -213.4375 C 79.65625 -208.15625 77.695312 -203.554688 73.78125 -199.640625 C 69.875 -195.734375 65.28125 -193.78125 60 -193.78125 Z M 45.171875 4.828125 C 39.191406 4.828125 35.28125 2.414062 33.4375 -2.40625 C 31.601562 -7.238281 30.6875 -13.675781 30.6875 -21.71875 C 30.6875 -34.59375 31.773438 -47.234375 33.953125 -59.640625 C 36.140625 -72.054688 38.328125 -83.894531 40.515625 -95.15625 C 42.703125 -106.425781 43.796875 -116.890625 43.796875 -126.546875 C 43.796875 -129.078125 43.675781 -131.832031 43.4375 -134.8125 C 43.207031 -137.800781 42.632812 -140.101562 41.71875 -141.71875 C 38.039062 -139.414062 33.269531 -135.617188 27.40625 -130.328125 C 21.550781 -125.046875 16.898438 -119.1875 13.453125 -112.75 C 11.835938 -114.363281 11.03125 -116.550781 11.03125 -119.3125 C 11.03125 -123.21875 12.582031 -127.46875 15.6875 -132.0625 C 18.789062 -136.65625 22.925781 -141.078125 28.09375 -145.328125 C 33.269531 -149.585938 38.847656 -153.097656 44.828125 -155.859375 C 50.804688 -158.617188 56.664062 -160 62.40625 -160 C 67.695312 -160 71.085938 -158.734375 72.578125 -156.203125 C 74.078125 -153.671875 74.828125 -150.453125 74.828125 -146.546875 C 74.828125 -140.796875 74.078125 -133.378906 72.578125 -124.296875 C 71.085938 -115.222656 69.363281 -105.515625 67.40625 -95.171875 C 65.457031 -84.828125 63.734375 -74.484375 62.234375 -64.140625 C 60.742188 -53.796875 60 -44.367188 60 -35.859375 C 60 -31.492188 60.226562 -27.414062 60.6875 -23.625 C 61.144531 -19.832031 61.71875 -16.671875 62.40625 -14.140625 C 68.15625 -16.671875 73.613281 -20.40625 78.78125 -25.34375 C 83.957031 -30.28125 87.8125 -34.9375 90.34375 -39.3125 C 91.71875 -37.238281 92.40625 -35.050781 92.40625 -32.75 C 92.40625 -29.070312 90.796875 -25.050781 87.578125 -20.6875 C 84.359375 -16.320312 80.332031 -12.179688 75.5 -8.265625 C 70.675781 -4.359375 65.5625 -1.203125 60.15625 1.203125 C 54.757812 3.617188 49.765625 4.828125 45.171875 4.828125 Z M 45.171875 4.828125 " }))))), xt = (t) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 500, zoomAndPan: "magnify", viewBox: "0 0 375 374.999991", height: 500, preserveAspectRatio: "xMidYMid meet", ...t }, /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("g", null), /* @__PURE__ */ r.createElement("clipPath", { id: "59a10ac27a" }, /* @__PURE__ */ r.createElement("path", { d: "M 17.179688 32.695312 L 360 32.695312 L 360 337.5 L 17.179688 337.5 Z M 17.179688 32.695312 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "664b27481e" }, /* @__PURE__ */ r.createElement("path", { d: "M 207.042969 43.574219 L 356.394531 304.941406 C 360.242188 311.675781 360.214844 319.953125 356.324219 326.660156 C 352.429688 333.371094 345.257812 337.5 337.5 337.5 L 39.375 337.5 C 31.617188 337.5 24.445312 333.371094 20.554688 326.660156 C 16.660156 319.953125 16.632812 311.675781 20.480469 304.941406 L 169.832031 43.574219 C 173.648438 36.898438 180.746094 32.777344 188.4375 32.777344 C 196.128906 32.777344 203.226562 36.898438 207.042969 43.574219 Z M 207.042969 43.574219 ", clipRule: "nonzero" }))), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#59a10ac27a)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#664b27481e)" }, /* @__PURE__ */ r.createElement("path", { fill: "#d97706", d: "M 1.875 11.015625 L 375.546875 11.015625 L 375.546875 337.5 L 1.875 337.5 Z M 1.875 11.015625 ", fillOpacity: 1, fillRule: "nonzero" }))), /* @__PURE__ */ r.createElement("g", { fill: "#ffffff", fillOpacity: 1 }, /* @__PURE__ */ r.createElement("g", { transform: "translate(158.410439, 295.655517)" }, /* @__PURE__ */ r.createElement("g", null, /* @__PURE__ */ r.createElement("path", { d: "M 46.890625 -63.21875 C 46.890625 -63.21875 46.890625 -64.445312 46.890625 -66.90625 L 46.890625 -176.46875 C 46.890625 -178.925781 46.1875 -180.859375 44.78125 -182.265625 C 43.375 -183.671875 41.441406 -184.375 38.984375 -184.375 L 21.078125 -184.375 C 18.617188 -184.375 16.6875 -183.671875 15.28125 -182.265625 C 13.875 -180.859375 13.171875 -178.925781 13.171875 -176.46875 L 13.171875 -66.90625 C 13.171875 -64.445312 13.875 -62.515625 15.28125 -61.109375 C 16.6875 -59.703125 18.617188 -59 21.078125 -59 L 38.984375 -59 C 41.441406 -59 43.375 -59.703125 44.78125 -61.109375 C 46.1875 -62.515625 46.890625 -63.21875 46.890625 -63.21875 Z M 46.890625 -4.21875 C 46.890625 -4.21875 46.890625 -5.445312 46.890625 -7.90625 L 46.890625 -25.546875 C 46.890625 -28.003906 46.1875 -29.9375 44.78125 -31.34375 C 43.375 -32.75 41.441406 -33.453125 38.984375 -33.453125 L 21.078125 -33.453125 C 18.617188 -33.453125 16.6875 -32.75 15.28125 -31.34375 C 13.875 -29.9375 13.171875 -28.003906 13.171875 -25.546875 L 13.171875 -7.90625 C 13.171875 -5.445312 13.875 -3.515625 15.28125 -2.109375 C 16.6875 -0.703125 18.617188 0 21.078125 0 L 38.984375 0 C 41.441406 0 43.375 -0.703125 44.78125 -2.109375 C 46.1875 -3.515625 46.890625 -4.21875 46.890625 -4.21875 Z M 46.890625 -4.21875 " })))));
|
|
538
|
+
var Xe = {
|
|
677
539
|
color: void 0,
|
|
678
540
|
size: void 0,
|
|
679
541
|
className: void 0,
|
|
680
542
|
style: void 0,
|
|
681
543
|
attr: void 0
|
|
682
|
-
},
|
|
683
|
-
function
|
|
544
|
+
}, De = W.createContext && /* @__PURE__ */ W.createContext(Xe), vt = ["attr", "size", "title"];
|
|
545
|
+
function Et(t, o) {
|
|
684
546
|
if (t == null) return {};
|
|
685
|
-
var n =
|
|
547
|
+
var n = bt(t, o), s, c;
|
|
686
548
|
if (Object.getOwnPropertySymbols) {
|
|
687
549
|
var u = Object.getOwnPropertySymbols(t);
|
|
688
550
|
for (c = 0; c < u.length; c++)
|
|
@@ -690,7 +552,7 @@ function xt(t, o) {
|
|
|
690
552
|
}
|
|
691
553
|
return n;
|
|
692
554
|
}
|
|
693
|
-
function
|
|
555
|
+
function bt(t, o) {
|
|
694
556
|
if (t == null) return {};
|
|
695
557
|
var n = {};
|
|
696
558
|
for (var s in t)
|
|
@@ -700,17 +562,17 @@ function vt(t, o) {
|
|
|
700
562
|
}
|
|
701
563
|
return n;
|
|
702
564
|
}
|
|
703
|
-
function
|
|
704
|
-
return
|
|
565
|
+
function pe() {
|
|
566
|
+
return pe = Object.assign ? Object.assign.bind() : function(t) {
|
|
705
567
|
for (var o = 1; o < arguments.length; o++) {
|
|
706
568
|
var n = arguments[o];
|
|
707
569
|
for (var s in n)
|
|
708
570
|
Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
|
|
709
571
|
}
|
|
710
572
|
return t;
|
|
711
|
-
},
|
|
573
|
+
}, pe.apply(this, arguments);
|
|
712
574
|
}
|
|
713
|
-
function
|
|
575
|
+
function We(t, o) {
|
|
714
576
|
var n = Object.keys(t);
|
|
715
577
|
if (Object.getOwnPropertySymbols) {
|
|
716
578
|
var s = Object.getOwnPropertySymbols(t);
|
|
@@ -720,25 +582,25 @@ function De(t, o) {
|
|
|
720
582
|
}
|
|
721
583
|
return n;
|
|
722
584
|
}
|
|
723
|
-
function
|
|
585
|
+
function ge(t) {
|
|
724
586
|
for (var o = 1; o < arguments.length; o++) {
|
|
725
587
|
var n = arguments[o] != null ? arguments[o] : {};
|
|
726
|
-
o % 2 ?
|
|
727
|
-
|
|
728
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) :
|
|
588
|
+
o % 2 ? We(Object(n), !0).forEach(function(s) {
|
|
589
|
+
yt(t, s, n[s]);
|
|
590
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : We(Object(n)).forEach(function(s) {
|
|
729
591
|
Object.defineProperty(t, s, Object.getOwnPropertyDescriptor(n, s));
|
|
730
592
|
});
|
|
731
593
|
}
|
|
732
594
|
return t;
|
|
733
595
|
}
|
|
734
|
-
function
|
|
735
|
-
return o =
|
|
596
|
+
function yt(t, o, n) {
|
|
597
|
+
return o = Ct(o), o in t ? Object.defineProperty(t, o, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[o] = n, t;
|
|
736
598
|
}
|
|
737
|
-
function
|
|
738
|
-
var o =
|
|
599
|
+
function Ct(t) {
|
|
600
|
+
var o = wt(t, "string");
|
|
739
601
|
return typeof o == "symbol" ? o : o + "";
|
|
740
602
|
}
|
|
741
|
-
function
|
|
603
|
+
function wt(t, o) {
|
|
742
604
|
if (typeof t != "object" || !t) return t;
|
|
743
605
|
var n = t[Symbol.toPrimitive];
|
|
744
606
|
if (n !== void 0) {
|
|
@@ -748,155 +610,343 @@ function yt(t, o) {
|
|
|
748
610
|
}
|
|
749
611
|
return (o === "string" ? String : Number)(t);
|
|
750
612
|
}
|
|
751
|
-
function
|
|
752
|
-
return t && t.map((o, n) => /* @__PURE__ */ W.createElement(o.tag,
|
|
613
|
+
function Je(t) {
|
|
614
|
+
return t && t.map((o, n) => /* @__PURE__ */ W.createElement(o.tag, ge({
|
|
753
615
|
key: n
|
|
754
|
-
}, o.attr),
|
|
616
|
+
}, o.attr), Je(o.child)));
|
|
755
617
|
}
|
|
756
|
-
function
|
|
757
|
-
return (o) => /* @__PURE__ */ W.createElement(
|
|
758
|
-
attr:
|
|
759
|
-
}, o),
|
|
618
|
+
function we(t) {
|
|
619
|
+
return (o) => /* @__PURE__ */ W.createElement(jt, pe({
|
|
620
|
+
attr: ge({}, t.attr)
|
|
621
|
+
}, o), Je(t.child));
|
|
760
622
|
}
|
|
761
|
-
function
|
|
623
|
+
function jt(t) {
|
|
762
624
|
var o = (n) => {
|
|
763
625
|
var {
|
|
764
626
|
attr: s,
|
|
765
627
|
size: c,
|
|
766
628
|
title: u
|
|
767
|
-
} = t, f =
|
|
768
|
-
return n.className && (
|
|
629
|
+
} = t, f = Et(t, vt), m = c || n.size || "1em", d;
|
|
630
|
+
return n.className && (d = n.className), t.className && (d = (d ? d + " " : "") + t.className), /* @__PURE__ */ W.createElement("svg", pe({
|
|
769
631
|
stroke: "currentColor",
|
|
770
632
|
fill: "currentColor",
|
|
771
633
|
strokeWidth: "0"
|
|
772
634
|
}, n.attr, s, f, {
|
|
773
|
-
className:
|
|
774
|
-
style:
|
|
635
|
+
className: d,
|
|
636
|
+
style: ge(ge({
|
|
775
637
|
color: t.color || n.color
|
|
776
638
|
}, n.style), t.style),
|
|
777
|
-
height:
|
|
778
|
-
width:
|
|
639
|
+
height: m,
|
|
640
|
+
width: m,
|
|
779
641
|
xmlns: "http://www.w3.org/2000/svg"
|
|
780
642
|
}), u && /* @__PURE__ */ W.createElement("title", null, u), t.children);
|
|
781
643
|
};
|
|
782
|
-
return
|
|
783
|
-
}
|
|
784
|
-
function rt(t) {
|
|
785
|
-
return je({ tag: "svg", attr: { version: "1.1", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M8 0c-4.355 0-7.898 3.481-7.998 7.812 0.092-3.779 2.966-6.812 6.498-6.812 3.59 0 6.5 3.134 6.5 7 0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5c0-4.418-3.582-8-8-8zM8 16c4.355 0 7.898-3.481 7.998-7.812-0.092 3.779-2.966 6.812-6.498 6.812-3.59 0-6.5-3.134-6.5-7 0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5c0 4.418 3.582 8 8 8z" }, child: [] }] })(t);
|
|
786
|
-
}
|
|
787
|
-
const wt = () => {
|
|
788
|
-
const { loadingProps: t } = xe(), { spinner: o = !0, spinnerStyle: n, text: s, textStyle: c, children: u, containerStyle: f, overrideStyle: d = {} } = t;
|
|
789
|
-
return /* @__PURE__ */ a.jsxs("div", { className: d.container || `fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-loading-bg z-[999] ${f}`, children: [
|
|
790
|
-
o && /* @__PURE__ */ a.jsx(rt, { className: d.spinner || `text-[20rem] relative animate-spin text-spinner ${n}` }),
|
|
791
|
-
u || /* @__PURE__ */ a.jsx("p", { className: d.text || `text-white text-2xl select-none absolute ${c}`, children: s || "Loading..." })
|
|
792
|
-
] });
|
|
793
|
-
};
|
|
794
|
-
function jt(t) {
|
|
795
|
-
return je({ tag: "svg", attr: { viewBox: "0 0 15 15", fill: "none" }, child: [{ tag: "path", attr: { fillRule: "evenodd", clipRule: "evenodd", d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor" }, child: [] }] })(t);
|
|
644
|
+
return De !== void 0 ? /* @__PURE__ */ W.createElement(De.Consumer, null, (n) => o(n)) : o(Xe);
|
|
796
645
|
}
|
|
797
646
|
function Lt(t) {
|
|
798
|
-
return
|
|
647
|
+
return we({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M17.47 250.9C88.82 328.1 158 397.6 224.5 485.5c72.3-143.8 146.3-288.1 268.4-444.37L460 26.06C356.9 135.4 276.8 238.9 207.2 361.9c-48.4-43.6-126.62-105.3-174.38-137z" }, child: [] }] })(t);
|
|
799
648
|
}
|
|
800
|
-
const St = (t) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 500, zoomAndPan: "magnify", viewBox: "0 0 375 374.999991", height: 500, preserveAspectRatio: "xMidYMid meet", ...t }, /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("g", null), /* @__PURE__ */ r.createElement("clipPath", { id: "6ca7e2bf04" }, /* @__PURE__ */ r.createElement("path", { d: "M 265.136719 0 L 375 109.863281 L 375 265.136719 L 265.136719 375 L 109.863281 375 L 0 265.136719 L 0 109.863281 L 109.863281 0 Z M 265.136719 0 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "2c77c820c6" }, /* @__PURE__ */ r.createElement("path", { d: "M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "3d94df7d66" }, /* @__PURE__ */ r.createElement("path", { d: "M 259.804688 12.878906 L 362.121094 115.195312 L 362.121094 259.804688 L 259.804688 362.121094 L 115.195312 362.121094 L 12.878906 259.804688 L 12.878906 115.195312 L 115.195312 12.878906 Z M 259.804688 12.878906 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "8793709a64" }, /* @__PURE__ */ r.createElement("path", { d: "M 12.878906 12.878906 L 362.109375 12.878906 L 362.109375 362.109375 L 12.878906 362.109375 Z M 12.878906 12.878906 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "fdb3fe29d8" }, /* @__PURE__ */ r.createElement("path", { d: "M 259.796875 12.878906 L 362.109375 115.191406 L 362.109375 259.796875 L 259.796875 362.109375 L 115.191406 362.109375 L 12.878906 259.796875 L 12.878906 115.191406 L 115.191406 12.878906 Z M 259.796875 12.878906 ", clipRule: "nonzero" }))), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#6ca7e2bf04)" }, /* @__PURE__ */ r.createElement("rect", { x: -37.5, width: 450, fill: "#b91c1c", y: -37.499999, height: 449.999989, fillOpacity: 1 })), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#2c77c820c6)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#3d94df7d66)" }, /* @__PURE__ */ r.createElement("path", { fill: "#b91c1c", d: "M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ", fillOpacity: 1, fillRule: "nonzero" }))), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#8793709a64)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#fdb3fe29d8)" }, /* @__PURE__ */ r.createElement("path", { strokeLinecap: "butt", transform: "matrix(0.75, 0, 0, 0.75, 12.879396, 12.879392)", fill: "none", strokeLinejoin: "miter", d: "M 329.223327 -0.000647072 L 465.640003 136.416029 L 465.640003 329.223333 L 329.223327 465.640009 L 136.416023 465.640009 L -0.000653072 329.223333 L -0.000653072 136.416029 L 136.416023 -0.000647072 Z M 329.223327 -0.000647072 ", stroke: "#ffffff", strokeWidth: 34, strokeOpacity: 1, strokeMiterlimit: 4 }))), /* @__PURE__ */ r.createElement("g", { fill: "#ffffff", fillOpacity: 1 }, /* @__PURE__ */ r.createElement("g", { transform: "translate(111.648432, 267.442446)" }, /* @__PURE__ */ r.createElement("g", null, /* @__PURE__ */ r.createElement("path", { d: "M 2.828125 0 L 56.25 -79.859375 L 3.046875 -159.609375 L 37.28125 -159.609375 L 75.90625 -98.046875 L 114.53125 -159.609375 L 148.765625 -159.609375 L 95.5625 -79.859375 L 148.984375 0 L 114.765625 0 L 75.671875 -60.65625 L 37.046875 0 Z M 2.828125 0 " }))))), Ot = (t) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 500, zoomAndPan: "magnify", viewBox: "0 0 375 374.999991", height: 500, preserveAspectRatio: "xMidYMid meet", ...t }, /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("g", null), /* @__PURE__ */ r.createElement("clipPath", { id: "30562604dd" }, /* @__PURE__ */ r.createElement("path", { d: "M 187.5 0 C 83.945312 0 0 83.945312 0 187.5 C 0 291.054688 83.945312 375 187.5 375 C 291.054688 375 375 291.054688 375 187.5 C 375 83.945312 291.054688 0 187.5 0 Z M 187.5 0 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "971fcd5f72" }, /* @__PURE__ */ r.createElement("path", { d: "M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "e891a7f57e" }, /* @__PURE__ */ r.createElement("path", { d: "M 187.5 18.570312 C 94.203125 18.570312 18.570312 94.203125 18.570312 187.5 C 18.570312 280.796875 94.203125 356.429688 187.5 356.429688 C 280.796875 356.429688 356.429688 280.796875 356.429688 187.5 C 356.429688 94.203125 280.796875 18.570312 187.5 18.570312 Z M 187.5 18.570312 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "19a9ddc130" }, /* @__PURE__ */ r.createElement("path", { d: "M 18.570312 18.570312 L 356.070312 18.570312 L 356.070312 356.070312 L 18.570312 356.070312 Z M 18.570312 18.570312 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "5e650d5bd0" }, /* @__PURE__ */ r.createElement("path", { d: "M 187.496094 18.570312 C 94.199219 18.570312 18.570312 94.199219 18.570312 187.496094 C 18.570312 280.792969 94.199219 356.421875 187.496094 356.421875 C 280.792969 356.421875 356.421875 280.792969 356.421875 187.496094 C 356.421875 94.199219 280.792969 18.570312 187.496094 18.570312 Z M 187.496094 18.570312 ", clipRule: "nonzero" }))), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#30562604dd)" }, /* @__PURE__ */ r.createElement("rect", { x: -37.5, width: 450, fill: "#1d4ed8", y: -37.499999, height: 449.999989, fillOpacity: 1 })), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#971fcd5f72)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#e891a7f57e)" }, /* @__PURE__ */ r.createElement("path", { fill: "#1d4ed8", d: "M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ", fillOpacity: 1, fillRule: "nonzero" }))), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#19a9ddc130)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#5e650d5bd0)" }, /* @__PURE__ */ r.createElement("path", { strokeLinecap: "butt", transform: "matrix(0.75, 0, 0, 0.75, 18.570291, 18.570286)", fill: "none", strokeLinejoin: "miter", d: "M 225.234419 0.0000349326 C 100.838577 0.0000349326 0.0000289326 100.838583 0.0000289326 225.234425 C 0.0000289326 349.630266 100.838577 450.468815 225.234419 450.468815 C 349.63026 450.468815 450.468809 349.630266 450.468809 225.234425 C 450.468809 100.838583 349.63026 0.0000349326 225.234419 0.0000349326 Z M 225.234419 0.0000349326 ", stroke: "#ffffff", strokeWidth: 34, strokeOpacity: 1, strokeMiterlimit: 4 }))), /* @__PURE__ */ r.createElement("g", { fill: "#ffffff", fillOpacity: 1 }, /* @__PURE__ */ r.createElement("g", { transform: "translate(136.121787, 300.837436)" }, /* @__PURE__ */ r.createElement("g", null, /* @__PURE__ */ r.createElement("path", { d: "M 60 -193.78125 C 54.707031 -193.78125 50.109375 -195.734375 46.203125 -199.640625 C 42.296875 -203.554688 40.34375 -208.15625 40.34375 -213.4375 C 40.34375 -218.726562 42.296875 -223.328125 46.203125 -227.234375 C 50.109375 -231.140625 54.707031 -233.09375 60 -233.09375 C 65.28125 -233.09375 69.875 -231.140625 73.78125 -227.234375 C 77.695312 -223.328125 79.65625 -218.726562 79.65625 -213.4375 C 79.65625 -208.15625 77.695312 -203.554688 73.78125 -199.640625 C 69.875 -195.734375 65.28125 -193.78125 60 -193.78125 Z M 45.171875 4.828125 C 39.191406 4.828125 35.28125 2.414062 33.4375 -2.40625 C 31.601562 -7.238281 30.6875 -13.675781 30.6875 -21.71875 C 30.6875 -34.59375 31.773438 -47.234375 33.953125 -59.640625 C 36.140625 -72.054688 38.328125 -83.894531 40.515625 -95.15625 C 42.703125 -106.425781 43.796875 -116.890625 43.796875 -126.546875 C 43.796875 -129.078125 43.675781 -131.832031 43.4375 -134.8125 C 43.207031 -137.800781 42.632812 -140.101562 41.71875 -141.71875 C 38.039062 -139.414062 33.269531 -135.617188 27.40625 -130.328125 C 21.550781 -125.046875 16.898438 -119.1875 13.453125 -112.75 C 11.835938 -114.363281 11.03125 -116.550781 11.03125 -119.3125 C 11.03125 -123.21875 12.582031 -127.46875 15.6875 -132.0625 C 18.789062 -136.65625 22.925781 -141.078125 28.09375 -145.328125 C 33.269531 -149.585938 38.847656 -153.097656 44.828125 -155.859375 C 50.804688 -158.617188 56.664062 -160 62.40625 -160 C 67.695312 -160 71.085938 -158.734375 72.578125 -156.203125 C 74.078125 -153.671875 74.828125 -150.453125 74.828125 -146.546875 C 74.828125 -140.796875 74.078125 -133.378906 72.578125 -124.296875 C 71.085938 -115.222656 69.363281 -105.515625 67.40625 -95.171875 C 65.457031 -84.828125 63.734375 -74.484375 62.234375 -64.140625 C 60.742188 -53.796875 60 -44.367188 60 -35.859375 C 60 -31.492188 60.226562 -27.414062 60.6875 -23.625 C 61.144531 -19.832031 61.71875 -16.671875 62.40625 -14.140625 C 68.15625 -16.671875 73.613281 -20.40625 78.78125 -25.34375 C 83.957031 -30.28125 87.8125 -34.9375 90.34375 -39.3125 C 91.71875 -37.238281 92.40625 -35.050781 92.40625 -32.75 C 92.40625 -29.070312 90.796875 -25.050781 87.578125 -20.6875 C 84.359375 -16.320312 80.332031 -12.179688 75.5 -8.265625 C 70.675781 -4.359375 65.5625 -1.203125 60.15625 1.203125 C 54.757812 3.617188 49.765625 4.828125 45.171875 4.828125 Z M 45.171875 4.828125 " }))))), kt = (t) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 500, zoomAndPan: "magnify", viewBox: "0 0 375 374.999991", height: 500, preserveAspectRatio: "xMidYMid meet", ...t }, /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("g", null), /* @__PURE__ */ r.createElement("clipPath", { id: "59a10ac27a" }, /* @__PURE__ */ r.createElement("path", { d: "M 17.179688 32.695312 L 360 32.695312 L 360 337.5 L 17.179688 337.5 Z M 17.179688 32.695312 ", clipRule: "nonzero" })), /* @__PURE__ */ r.createElement("clipPath", { id: "664b27481e" }, /* @__PURE__ */ r.createElement("path", { d: "M 207.042969 43.574219 L 356.394531 304.941406 C 360.242188 311.675781 360.214844 319.953125 356.324219 326.660156 C 352.429688 333.371094 345.257812 337.5 337.5 337.5 L 39.375 337.5 C 31.617188 337.5 24.445312 333.371094 20.554688 326.660156 C 16.660156 319.953125 16.632812 311.675781 20.480469 304.941406 L 169.832031 43.574219 C 173.648438 36.898438 180.746094 32.777344 188.4375 32.777344 C 196.128906 32.777344 203.226562 36.898438 207.042969 43.574219 Z M 207.042969 43.574219 ", clipRule: "nonzero" }))), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#59a10ac27a)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#664b27481e)" }, /* @__PURE__ */ r.createElement("path", { fill: "#d97706", d: "M 1.875 11.015625 L 375.546875 11.015625 L 375.546875 337.5 L 1.875 337.5 Z M 1.875 11.015625 ", fillOpacity: 1, fillRule: "nonzero" }))), /* @__PURE__ */ r.createElement("g", { fill: "#ffffff", fillOpacity: 1 }, /* @__PURE__ */ r.createElement("g", { transform: "translate(158.410439, 295.655517)" }, /* @__PURE__ */ r.createElement("g", null, /* @__PURE__ */ r.createElement("path", { d: "M 46.890625 -63.21875 C 46.890625 -63.21875 46.890625 -64.445312 46.890625 -66.90625 L 46.890625 -176.46875 C 46.890625 -178.925781 46.1875 -180.859375 44.78125 -182.265625 C 43.375 -183.671875 41.441406 -184.375 38.984375 -184.375 L 21.078125 -184.375 C 18.617188 -184.375 16.6875 -183.671875 15.28125 -182.265625 C 13.875 -180.859375 13.171875 -178.925781 13.171875 -176.46875 L 13.171875 -66.90625 C 13.171875 -64.445312 13.875 -62.515625 15.28125 -61.109375 C 16.6875 -59.703125 18.617188 -59 21.078125 -59 L 38.984375 -59 C 41.441406 -59 43.375 -59.703125 44.78125 -61.109375 C 46.1875 -62.515625 46.890625 -63.21875 46.890625 -63.21875 Z M 46.890625 -4.21875 C 46.890625 -4.21875 46.890625 -5.445312 46.890625 -7.90625 L 46.890625 -25.546875 C 46.890625 -28.003906 46.1875 -29.9375 44.78125 -31.34375 C 43.375 -32.75 41.441406 -33.453125 38.984375 -33.453125 L 21.078125 -33.453125 C 18.617188 -33.453125 16.6875 -32.75 15.28125 -31.34375 C 13.875 -29.9375 13.171875 -28.003906 13.171875 -25.546875 L 13.171875 -7.90625 C 13.171875 -5.445312 13.875 -3.515625 15.28125 -2.109375 C 16.6875 -0.703125 18.617188 0 21.078125 0 L 38.984375 0 C 41.441406 0 43.375 -0.703125 44.78125 -2.109375 C 46.1875 -3.515625 46.890625 -4.21875 46.890625 -4.21875 Z M 46.890625 -4.21875 " }))))), We = () => {
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
649
|
+
const Ke = ae(), Ft = ({ children: t }) => {
|
|
650
|
+
const [o, n] = j(!1), [s, c] = j(), [u, f] = j(), P = {
|
|
651
|
+
showAlert: o,
|
|
652
|
+
setShowAlert: n,
|
|
653
|
+
typeAlert: s,
|
|
654
|
+
setTypeAlert: c,
|
|
655
|
+
messageAlert: u,
|
|
656
|
+
setMessageAlert: f,
|
|
657
|
+
alertConfig: {
|
|
658
|
+
danger: {
|
|
659
|
+
bgColor: "bg-danger",
|
|
660
|
+
textColor: "text-danger-text",
|
|
661
|
+
buttonBg: "bg-danger",
|
|
662
|
+
hoverBg: "hover:bg-danger-hover",
|
|
663
|
+
focusRing: "focus:ring-danger-progress",
|
|
664
|
+
progressColor: "bg-danger-progress"
|
|
665
|
+
},
|
|
666
|
+
info: {
|
|
667
|
+
bgColor: "bg-info",
|
|
668
|
+
textColor: "text-info-text",
|
|
669
|
+
buttonBg: "bg-info",
|
|
670
|
+
hoverBg: "hover:bg-info-hover",
|
|
671
|
+
focusRing: "focus:ring-info-progress",
|
|
672
|
+
progressColor: "bg-info-progress"
|
|
673
|
+
},
|
|
674
|
+
success: {
|
|
675
|
+
bgColor: "bg-success",
|
|
676
|
+
textColor: "text-success-text",
|
|
677
|
+
buttonBg: "bg-success",
|
|
678
|
+
hoverBg: "hover:bg-success-hover",
|
|
679
|
+
focusRing: "focus:ring-success-progress",
|
|
680
|
+
progressColor: "bg-success-progress"
|
|
681
|
+
},
|
|
682
|
+
warning: {
|
|
683
|
+
bgColor: "bg-warning",
|
|
684
|
+
textColor: "text-warning-text",
|
|
685
|
+
buttonBg: "bg-warning",
|
|
686
|
+
hoverBg: "hover:bg-warning-hover",
|
|
687
|
+
focusRing: "focus:ring-warning-progress",
|
|
688
|
+
progressColor: "bg-warning-progress"
|
|
689
|
+
}
|
|
809
690
|
},
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
691
|
+
getIcon: (h) => {
|
|
692
|
+
switch (h) {
|
|
693
|
+
case "danger":
|
|
694
|
+
return /* @__PURE__ */ a.jsx(gt, { className: "w-[20px] h-[20px]" });
|
|
695
|
+
case "info":
|
|
696
|
+
return /* @__PURE__ */ a.jsx(ht, { className: "w-[20px] h-[20px]" });
|
|
697
|
+
case "success":
|
|
698
|
+
return /* @__PURE__ */ a.jsx(Lt, { className: "text-xl" });
|
|
699
|
+
case "warning":
|
|
700
|
+
return /* @__PURE__ */ a.jsx(xt, { className: "w-[20px] h-[20px]" });
|
|
701
|
+
}
|
|
817
702
|
},
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
textColor: "text-success-text",
|
|
821
|
-
buttonBg: "bg-success",
|
|
822
|
-
hoverBg: "hover:bg-success-hover",
|
|
823
|
-
focusRing: "focus:ring-success-progress",
|
|
824
|
-
progressColor: "bg-success-progress"
|
|
703
|
+
closeAlert: () => {
|
|
704
|
+
n(!o);
|
|
825
705
|
},
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
706
|
+
activeAlert: (h, E) => {
|
|
707
|
+
n(!1), setTimeout(() => {
|
|
708
|
+
c(h), f(E), n(!0);
|
|
709
|
+
}, 50);
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
return /* @__PURE__ */ a.jsx(Ke.Provider, { value: P, children: t });
|
|
713
|
+
}, ie = () => {
|
|
714
|
+
const t = se(Ke);
|
|
715
|
+
if (t === void 0) throw new Error("Non puoi modificare l'alert");
|
|
716
|
+
return t;
|
|
717
|
+
};
|
|
718
|
+
let ne;
|
|
719
|
+
const he = async (t, o, n) => {
|
|
720
|
+
if (ne) return ne;
|
|
721
|
+
try {
|
|
722
|
+
const c = await (await fetch("/config.json")).json(), u = c.baseUri, { unauthorized: f, notFound: m, defaultMessage: d } = c.axiosErrors, y = c.axiosTimeout;
|
|
723
|
+
return ne = ut.create({
|
|
724
|
+
baseURL: u,
|
|
725
|
+
timeout: y
|
|
726
|
+
}), ne.interceptors.request.use(
|
|
727
|
+
(C) => C
|
|
728
|
+
), ne.interceptors.response.use(
|
|
729
|
+
(C) => C,
|
|
730
|
+
(C) => {
|
|
731
|
+
if (C.response)
|
|
732
|
+
switch (t(!0), o("danger"), C.response.status) {
|
|
733
|
+
case 401:
|
|
734
|
+
localStorage.removeItem("accessToken"), n(f);
|
|
735
|
+
break;
|
|
736
|
+
case 404:
|
|
737
|
+
n(m);
|
|
738
|
+
break;
|
|
739
|
+
default:
|
|
740
|
+
n(`${d} ${C.response.status} ${C.response.data.error}`);
|
|
741
|
+
}
|
|
742
|
+
return Promise.reject(C);
|
|
743
|
+
}
|
|
744
|
+
), ne;
|
|
745
|
+
} catch (s) {
|
|
746
|
+
console.error(s);
|
|
747
|
+
}
|
|
748
|
+
}, Qe = ae(), Dt = ({ children: t }) => {
|
|
749
|
+
const { heartbeatEndpoint: o, firstPrivatePath: n, infiniteSession: s, timeDeducted: c, authenticatedEndpoint: u, autoLogin: f, autoLoginEmail: m, autoLoginPassword: d } = te(), { setIsLoading: y } = xe(), { setShowAlert: C, setMessageAlert: P, setTypeAlert: h, activeAlert: E } = ie(), p = qe(), [b, L] = j(null), [S, x] = j(), [R, k] = j(), [N, H] = j(), [Y, V] = j(!1), re = () => {
|
|
750
|
+
const w = /* @__PURE__ */ new Date(), A = String(w.getDate()).padStart(2, "0"), z = String(w.getMonth() + 1).padStart(2, "0"), M = w.getFullYear(), I = String(w.getHours()).padStart(2, "0"), U = String(w.getMinutes()).padStart(2, "0"), $ = String(w.getSeconds()).padStart(2, "0");
|
|
751
|
+
return `${A}/${z}/${M} ${I}:${U}:${$}`;
|
|
752
|
+
}, X = async (w = null, A) => {
|
|
753
|
+
w && w.preventDefault(), V(!0);
|
|
754
|
+
try {
|
|
755
|
+
y(!0), C(!1);
|
|
756
|
+
const M = await (await he(C, h, P)).post(u, {
|
|
757
|
+
auth: A
|
|
758
|
+
}), I = M.data.id, U = M.headers.token;
|
|
759
|
+
U && (localStorage.setItem("accessToken", U), localStorage.setItem("id", I), L(!0), x(U), p(`${n}${I}`));
|
|
760
|
+
} catch (z) {
|
|
761
|
+
console.error(z);
|
|
762
|
+
} finally {
|
|
763
|
+
V(!1), y(!1);
|
|
764
|
+
}
|
|
765
|
+
}, Z = () => {
|
|
766
|
+
localStorage.removeItem("accessToken"), localStorage.removeItem("id"), L(!1), x(null);
|
|
767
|
+
}, J = async () => {
|
|
768
|
+
try {
|
|
769
|
+
const w = localStorage.getItem("accessToken"), M = (await (await he(C, h, P)).get(
|
|
770
|
+
`${o}`,
|
|
771
|
+
{ headers: {
|
|
772
|
+
Authorization: w
|
|
773
|
+
} }
|
|
774
|
+
)).headers.token;
|
|
775
|
+
localStorage.setItem("accessToken", M), x(M), console.log("nuovo token: ", M, "Data:", re());
|
|
776
|
+
} catch (w) {
|
|
777
|
+
console.error(w), Z();
|
|
833
778
|
}
|
|
834
|
-
},
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
779
|
+
}, B = () => {
|
|
780
|
+
if (!S)
|
|
781
|
+
return;
|
|
782
|
+
const A = at(S).exp, z = Math.floor(Date.now() / 1e3), M = (A - z) * 1e3;
|
|
783
|
+
H(M), k(M - c);
|
|
784
|
+
};
|
|
785
|
+
G(() => {
|
|
786
|
+
if (localStorage.getItem("accessToken"))
|
|
787
|
+
L(!0);
|
|
788
|
+
else {
|
|
789
|
+
L(!1);
|
|
790
|
+
return;
|
|
791
|
+
}
|
|
792
|
+
}, []), G(() => {
|
|
793
|
+
const w = localStorage.getItem("accessToken");
|
|
794
|
+
f && !w && !Y && X(null, {
|
|
795
|
+
email: m,
|
|
796
|
+
password: d
|
|
797
|
+
});
|
|
798
|
+
}, [f, Y]), G(() => {
|
|
799
|
+
B();
|
|
800
|
+
let w;
|
|
801
|
+
s && S && R && (w = setInterval(() => {
|
|
802
|
+
J();
|
|
803
|
+
}, R));
|
|
804
|
+
let A;
|
|
805
|
+
return !s && S && N && (A = setTimeout(() => {
|
|
806
|
+
Z(), E("danger", "Sessione scaduta");
|
|
807
|
+
}, N)), () => {
|
|
808
|
+
w && clearInterval(w), A && clearTimeout(A);
|
|
809
|
+
};
|
|
810
|
+
}, [S, R]), G(() => {
|
|
811
|
+
b || f && !Y && X(null, {
|
|
812
|
+
email: m,
|
|
813
|
+
password: d
|
|
814
|
+
});
|
|
815
|
+
}, [b]);
|
|
816
|
+
const K = {
|
|
817
|
+
isAuthenticated: b,
|
|
818
|
+
setIsAuthenticated: L,
|
|
819
|
+
login: X,
|
|
820
|
+
logout: Z,
|
|
821
|
+
setCurrentToken: x
|
|
822
|
+
};
|
|
823
|
+
return /* @__PURE__ */ a.jsx(Qe.Provider, { value: K, children: t });
|
|
824
|
+
}, je = () => {
|
|
825
|
+
const t = se(Qe);
|
|
826
|
+
if (t === void 0) throw new Error("Non sei dentro al Auth Provider");
|
|
827
|
+
return t;
|
|
828
|
+
}, et = ae(), Wt = ({ children: t, publicRoutes: o = [], privateRoutes: n = [] }) => /* @__PURE__ */ a.jsx(et.Provider, { value: { publicRoutes: o, privateRoutes: n }, children: t }), St = () => {
|
|
829
|
+
const t = se(et);
|
|
830
|
+
if (t === void 0)
|
|
831
|
+
throw new Error(
|
|
832
|
+
`Errore: Le rotte non sono state inizializzate correttamente.
|
|
833
|
+
|
|
834
|
+
Soluzione: Assicurati di avvolgere il tuo componente con <RouteProvider>.
|
|
835
|
+
|
|
836
|
+
Esempio:
|
|
837
|
+
|
|
838
|
+
<RouteProvider publicRoutes={[]} privateRoutes={[]}>
|
|
839
|
+
<MyPackageRoutes />
|
|
840
|
+
</RouteProvider>`
|
|
841
|
+
);
|
|
842
|
+
return t;
|
|
843
|
+
}, tt = ae(), Yt = ({ children: t }) => {
|
|
844
|
+
const { login: o } = je(), { clearLoginFormOnError: n } = te(), s = {
|
|
845
|
+
email: "",
|
|
846
|
+
password: ""
|
|
847
|
+
}, [c, u] = j("Accedi"), [f, m] = j("Email"), [d, y] = j("email"), [C, P] = j("example@example.it"), [h, E] = j("Accedi"), [p, b] = j(s), [L, S] = j(), [x, R] = j(), [k, N] = j(), [H, Y] = j(), [V, re] = j({}), J = {
|
|
848
|
+
overrideStyle: V,
|
|
849
|
+
setOverrideStyle: re,
|
|
850
|
+
title: c,
|
|
851
|
+
setTitle: u,
|
|
852
|
+
label: f,
|
|
853
|
+
setLabel: m,
|
|
854
|
+
type: d,
|
|
855
|
+
setType: y,
|
|
856
|
+
placeholder: C,
|
|
857
|
+
setPlaceholder: P,
|
|
858
|
+
buttonText: h,
|
|
859
|
+
setButtonText: E,
|
|
860
|
+
formData: p,
|
|
861
|
+
setFormData: b,
|
|
862
|
+
LogoImg: L,
|
|
863
|
+
setLogoImg: S,
|
|
864
|
+
styleCardForm: x,
|
|
865
|
+
setStyleCardForm: R,
|
|
866
|
+
styleContainerLogo: k,
|
|
867
|
+
setStyleContainerLogo: N,
|
|
868
|
+
styleLogo: H,
|
|
869
|
+
setStyleLogo: Y,
|
|
870
|
+
changeData: (B, K) => {
|
|
871
|
+
b((w) => ({ ...w, [B]: K }));
|
|
872
|
+
},
|
|
873
|
+
handleLogin: (B) => {
|
|
874
|
+
o(B, p), n && b(s);
|
|
844
875
|
}
|
|
845
|
-
}, y = () => {
|
|
846
|
-
o(!t);
|
|
847
876
|
};
|
|
848
|
-
return
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
877
|
+
return /* @__PURE__ */ a.jsx(tt.Provider, { value: J, children: t });
|
|
878
|
+
}, rt = () => {
|
|
879
|
+
const t = se(tt);
|
|
880
|
+
if (t === void 0) throw new Error("Non puoi modificare La login");
|
|
881
|
+
return t;
|
|
882
|
+
};
|
|
883
|
+
function ot(t) {
|
|
884
|
+
return we({ tag: "svg", attr: { version: "1.1", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M8 0c-4.355 0-7.898 3.481-7.998 7.812 0.092-3.779 2.966-6.812 6.498-6.812 3.59 0 6.5 3.134 6.5 7 0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5c0-4.418-3.582-8-8-8zM8 16c4.355 0 7.898-3.481 7.998-7.812-0.092 3.779-2.966 6.812-6.498 6.812-3.59 0-6.5-3.134-6.5-7 0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5c0 4.418 3.582 8 8 8z" }, child: [] }] })(t);
|
|
885
|
+
}
|
|
886
|
+
const Ot = () => {
|
|
887
|
+
const { loadingProps: t } = xe(), { spinner: o = !0, spinnerStyle: n, text: s, textStyle: c, children: u, containerStyle: f, overrideStyle: m = {} } = t;
|
|
888
|
+
return /* @__PURE__ */ a.jsxs("div", { className: m.container || `fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-loading-bg z-[999] ${f}`, children: [
|
|
889
|
+
o && /* @__PURE__ */ a.jsx(ot, { className: m.spinner || `text-[20rem] relative animate-spin text-spinner ${n}` }),
|
|
890
|
+
u || /* @__PURE__ */ a.jsx("p", { className: m.text || `text-white text-2xl select-none absolute ${c}`, children: s || "Loading..." })
|
|
891
|
+
] });
|
|
892
|
+
};
|
|
893
|
+
function Pt(t) {
|
|
894
|
+
return we({ tag: "svg", attr: { viewBox: "0 0 15 15", fill: "none" }, child: [{ tag: "path", attr: { fillRule: "evenodd", clipRule: "evenodd", d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor" }, child: [] }] })(t);
|
|
895
|
+
}
|
|
896
|
+
const Ye = () => {
|
|
897
|
+
const { messageAlert: t, typeAlert: o, alertConfig: n, getIcon: s, closeAlert: c } = ie(), { alertTimeout: u } = te(), [f, m] = j(0), { bgColor: d, textColor: y, buttonBg: C, hoverBg: P, focusRing: h, progressColor: E } = n[o];
|
|
898
|
+
return G(() => {
|
|
899
|
+
let p;
|
|
900
|
+
const L = 100 / (u / 100);
|
|
901
|
+
p = setInterval(() => {
|
|
902
|
+
m((x) => x >= 100 ? (clearInterval(p), 100) : x + L);
|
|
853
903
|
}, 100);
|
|
854
|
-
const
|
|
855
|
-
|
|
856
|
-
},
|
|
904
|
+
const S = setTimeout(() => {
|
|
905
|
+
c();
|
|
906
|
+
}, u);
|
|
857
907
|
return () => {
|
|
858
|
-
clearTimeout(
|
|
908
|
+
clearTimeout(S), clearInterval(p);
|
|
859
909
|
};
|
|
860
|
-
}, []), /* @__PURE__ */ a.jsxs("div", { className: `flex items-center p-4 pt-6 ${
|
|
861
|
-
/* @__PURE__ */ a.jsx("div", { className: "w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 absolute top-0 left-0 right-0", children: /* @__PURE__ */ a.jsx("div", { className: `${
|
|
862
|
-
|
|
863
|
-
/* @__PURE__ */ a.jsx("div", { className: "px-4 text-sm font-medium", children:
|
|
910
|
+
}, []), /* @__PURE__ */ a.jsxs("div", { className: `flex items-center p-4 pt-6 ${y} rounded-lg ${d} mx-auto max-sm:min-w-[280px] sm:max-w-1/3 fixed top-[calc(100vh-100px)] sm:right-10 right-1/2 translate-x-1/2 sm:translate-0 z-100`, role: "alert", children: [
|
|
911
|
+
/* @__PURE__ */ a.jsx("div", { className: "w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 absolute top-0 left-0 right-0", children: /* @__PURE__ */ a.jsx("div", { className: `${E} h-2.5 rounded-t-lg`, style: { width: `${f}%` } }) }),
|
|
912
|
+
s(o),
|
|
913
|
+
/* @__PURE__ */ a.jsx("div", { className: "px-4 text-sm font-medium", children: t }),
|
|
864
914
|
/* @__PURE__ */ a.jsx(
|
|
865
915
|
"button",
|
|
866
916
|
{
|
|
867
917
|
type: "button",
|
|
868
|
-
className: `ms-auto ${
|
|
918
|
+
className: `ms-auto ${C} rounded-lg focus:ring-2 ${h} p-1.5 ${P} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,
|
|
869
919
|
title: "Close",
|
|
870
|
-
onClick:
|
|
871
|
-
children: /* @__PURE__ */ a.jsx(
|
|
920
|
+
onClick: c,
|
|
921
|
+
children: /* @__PURE__ */ a.jsx(Pt, { className: "text-xl" })
|
|
872
922
|
}
|
|
873
923
|
)
|
|
874
924
|
] });
|
|
875
|
-
},
|
|
876
|
-
const { isLoading: o } = xe(), { showAlert: n } =
|
|
925
|
+
}, kt = (t) => {
|
|
926
|
+
const { isLoading: o } = xe(), { showAlert: n } = ie(), s = st(), {
|
|
877
927
|
isMain: c = !0,
|
|
878
928
|
headerComponent: u = null,
|
|
879
929
|
showHeaderOnLogin: f = !1,
|
|
880
|
-
headerExcludedRoutes:
|
|
881
|
-
footerComponent:
|
|
882
|
-
showFooterOnLogin:
|
|
883
|
-
footerExcludedRoutes:
|
|
884
|
-
} = t,
|
|
885
|
-
let
|
|
886
|
-
s.pathname === "/" ?
|
|
887
|
-
const
|
|
888
|
-
let
|
|
889
|
-
return s.pathname === "/" ?
|
|
890
|
-
o && /* @__PURE__ */ a.jsx(
|
|
891
|
-
n && /* @__PURE__ */ a.jsx(
|
|
892
|
-
|
|
930
|
+
headerExcludedRoutes: m = [],
|
|
931
|
+
footerComponent: d = null,
|
|
932
|
+
showFooterOnLogin: y = !1,
|
|
933
|
+
footerExcludedRoutes: C = []
|
|
934
|
+
} = t, P = m.some((b) => Ge(b, s.pathname));
|
|
935
|
+
let h;
|
|
936
|
+
s.pathname === "/" ? h = u && f : h = u && !P;
|
|
937
|
+
const E = C.some((b) => Ge(b, s.pathname));
|
|
938
|
+
let p;
|
|
939
|
+
return s.pathname === "/" ? p = d && y : p = d && !E, /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
940
|
+
o && /* @__PURE__ */ a.jsx(Ot, {}),
|
|
941
|
+
n && /* @__PURE__ */ a.jsx(Ye, {}),
|
|
942
|
+
h && u,
|
|
893
943
|
c ? /* @__PURE__ */ a.jsxs("main", { className: o ? "hidden" : "", children: [
|
|
894
|
-
n && /* @__PURE__ */ a.jsx(
|
|
944
|
+
n && /* @__PURE__ */ a.jsx(Ye, {}),
|
|
895
945
|
/* @__PURE__ */ a.jsx(Ce, {})
|
|
896
946
|
] }) : /* @__PURE__ */ a.jsx(Ce, {}),
|
|
897
|
-
|
|
947
|
+
p && d
|
|
898
948
|
] });
|
|
899
|
-
},
|
|
949
|
+
}, Ze = (t) => {
|
|
900
950
|
const {
|
|
901
951
|
inputType: o,
|
|
902
952
|
inputId: n,
|
|
@@ -904,132 +954,132 @@ const St = (t) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3
|
|
|
904
954
|
inputRequired: c,
|
|
905
955
|
inputValue: u,
|
|
906
956
|
inputChange: f,
|
|
907
|
-
autoFocus:
|
|
908
|
-
inputStyle:
|
|
909
|
-
overrideStyle:
|
|
910
|
-
} = t,
|
|
957
|
+
autoFocus: m,
|
|
958
|
+
inputStyle: d,
|
|
959
|
+
overrideStyle: y
|
|
960
|
+
} = t, P = ["text", "email", "password", "search", "tel", "url"].includes(o) ? o : "text";
|
|
911
961
|
return /* @__PURE__ */ a.jsx(
|
|
912
962
|
"input",
|
|
913
963
|
{
|
|
914
|
-
type:
|
|
915
|
-
autoFocus:
|
|
964
|
+
type: P,
|
|
965
|
+
autoFocus: m,
|
|
916
966
|
id: n,
|
|
917
|
-
className:
|
|
967
|
+
className: y || `bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-primary focus:border-primary focus:outline-none focus:shadow-(--shadow-primary-input) block w-full p-input ${d}`,
|
|
918
968
|
placeholder: s,
|
|
919
969
|
required: c ?? !0,
|
|
920
970
|
value: u,
|
|
921
971
|
onChange: f
|
|
922
972
|
}
|
|
923
973
|
);
|
|
924
|
-
},
|
|
925
|
-
const { title: t, label: o, type: n, placeholder: s, buttonText: c, formData: u, changeData: f, handleLogin:
|
|
926
|
-
return /* @__PURE__ */ a.jsxs("form", { onSubmit:
|
|
927
|
-
/* @__PURE__ */ a.jsx("h1", { className:
|
|
928
|
-
/* @__PURE__ */ a.jsxs("div", { className:
|
|
929
|
-
/* @__PURE__ */ a.jsx(
|
|
974
|
+
}, Ue = ({ label: t, labelId: o, labelStyle: n, overrideStyle: s }) => /* @__PURE__ */ a.jsx("label", { htmlFor: o, className: s || `show-label mb-2 text-input-label font-medium text-color-label ${n}`, children: t }), Rt = () => {
|
|
975
|
+
const { title: t, label: o, type: n, placeholder: s, buttonText: c, formData: u, changeData: f, handleLogin: m, overrideStyle: d } = rt();
|
|
976
|
+
return /* @__PURE__ */ a.jsxs("form", { onSubmit: m, className: d.form || "form-size", children: [
|
|
977
|
+
/* @__PURE__ */ a.jsx("h1", { className: d.title || "text-form-title-size show-title title-position m-form-title", children: t }),
|
|
978
|
+
/* @__PURE__ */ a.jsxs("div", { className: d.containerEmail || "flex justify-center flex-col gap-1 m-input-form input-size mx-auto", children: [
|
|
979
|
+
/* @__PURE__ */ a.jsx(Ue, { labelId: "user-email", label: o }),
|
|
930
980
|
/* @__PURE__ */ a.jsx(
|
|
931
|
-
|
|
981
|
+
Ze,
|
|
932
982
|
{
|
|
933
983
|
inputType: n,
|
|
934
984
|
inputId: "user-email",
|
|
935
985
|
inputPlaceholder: s,
|
|
936
986
|
inputValue: u.email,
|
|
937
|
-
inputChange: (
|
|
938
|
-
f("email",
|
|
987
|
+
inputChange: (y) => {
|
|
988
|
+
f("email", y.target.value);
|
|
939
989
|
},
|
|
940
990
|
autoFocus: !0
|
|
941
991
|
}
|
|
942
992
|
)
|
|
943
993
|
] }),
|
|
944
|
-
/* @__PURE__ */ a.jsxs("div", { className:
|
|
945
|
-
/* @__PURE__ */ a.jsx(
|
|
994
|
+
/* @__PURE__ */ a.jsxs("div", { className: d.containerPassword || "flex justify-center flex-col gap-1 my-4 input-size mx-auto", children: [
|
|
995
|
+
/* @__PURE__ */ a.jsx(Ue, { labelId: "password", label: "Password" }),
|
|
946
996
|
/* @__PURE__ */ a.jsx(
|
|
947
|
-
|
|
997
|
+
Ze,
|
|
948
998
|
{
|
|
949
999
|
inputType: "password",
|
|
950
1000
|
inputId: "password",
|
|
951
1001
|
inputPlaceholder: "Password",
|
|
952
1002
|
inputValue: u.password,
|
|
953
|
-
inputChange: (
|
|
954
|
-
f("password",
|
|
1003
|
+
inputChange: (y) => {
|
|
1004
|
+
f("password", y.target.value);
|
|
955
1005
|
}
|
|
956
1006
|
}
|
|
957
1007
|
)
|
|
958
1008
|
] }),
|
|
959
|
-
/* @__PURE__ */ a.jsx("div", { className:
|
|
1009
|
+
/* @__PURE__ */ a.jsx("div", { className: d.containerButton || "flex button-position items-center m-primary-button", children: /* @__PURE__ */ a.jsx("button", { className: d.button || "font-bold cursor-pointer shadow-(--shadow-primary) transition-all duration-200 hover:shadow-(--shadow-primary-hover) active:shadow-(--shadow-primary-active) active:translate-y-[2px] p-primary-button rounded-primary-button bg-primary hover:bg-primary-hover text-primary-text", children: c }) })
|
|
960
1010
|
] });
|
|
961
1011
|
}, Tt = ({ Logo: t }) => {
|
|
962
|
-
const {
|
|
963
|
-
return
|
|
964
|
-
const
|
|
965
|
-
localStorage.getItem("accessToken") &&
|
|
966
|
-
}, []), /* @__PURE__ */ a.jsx("section", { id: "login-page", children: /* @__PURE__ */ a.jsx("div", { className:
|
|
967
|
-
/* @__PURE__ */ a.jsx("div", { className:
|
|
1012
|
+
const { activeAlert: o } = ie(), { styleCardForm: n, styleContainerLogo: s, styleLogo: c, overrideStyle: u } = rt(), { firstPrivatePath: f } = te(), m = qe();
|
|
1013
|
+
return G(() => {
|
|
1014
|
+
const d = localStorage.getItem("id");
|
|
1015
|
+
localStorage.getItem("accessToken") && d && (m(`${f}${d}`), o("info", "Sei già loggato"));
|
|
1016
|
+
}, []), /* @__PURE__ */ a.jsx("section", { id: "login-page", children: /* @__PURE__ */ a.jsx("div", { className: u.container || "container mx-auto flex items-center justify-center h-screen", children: /* @__PURE__ */ a.jsxs("div", { className: u.cardForm || `bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${n}`, children: [
|
|
1017
|
+
/* @__PURE__ */ a.jsx("div", { className: u.containerLogo || `basis-1/2 flex items-center justify-center ${s}`, children: t && /* @__PURE__ */ a.jsx(t, { className: u.logo || `login-logo h-full sm:h-auto ${c}` }) }),
|
|
968
1018
|
/* @__PURE__ */ a.jsx(Rt, {})
|
|
969
1019
|
] }) }) });
|
|
970
1020
|
}, _t = () => {
|
|
971
|
-
const { isAuthenticated: t } =
|
|
972
|
-
return
|
|
973
|
-
const
|
|
974
|
-
!t && !
|
|
975
|
-
}, []), t === null ? null : t ? /* @__PURE__ */ a.jsx(Ce, {}) : /* @__PURE__ */ a.jsx(
|
|
1021
|
+
const { isAuthenticated: t } = je(), { activeAlert: o } = ie(), { autoLogin: n } = te();
|
|
1022
|
+
return G(() => {
|
|
1023
|
+
const s = localStorage.getItem("accessToken");
|
|
1024
|
+
!t && !s && !n && o("danger", "Non sei autorizzato");
|
|
1025
|
+
}, []), t === null ? null : t ? /* @__PURE__ */ a.jsx(Ce, {}) : /* @__PURE__ */ a.jsx(it, { to: "/", replace: !0 });
|
|
976
1026
|
}, Nt = () => {
|
|
977
|
-
const { id: t } =
|
|
1027
|
+
const { id: t } = lt(), { logout: o, setCurrentToken: n } = je(), { usersEndpoint: s } = te(), { setIsLoading: c } = xe(), { setShowAlert: u, setTypeAlert: f, setMessageAlert: m, activeAlert: d } = ie(), [y, C] = j({}), [P, h] = j(null), [E, p] = j(!1), b = async () => {
|
|
978
1028
|
try {
|
|
979
1029
|
c(!0);
|
|
980
|
-
const
|
|
981
|
-
if (!
|
|
982
|
-
o(),
|
|
1030
|
+
const x = localStorage.getItem("accessToken");
|
|
1031
|
+
if (!x) {
|
|
1032
|
+
o(), d("danger", "Sessione Scaduta");
|
|
983
1033
|
return;
|
|
984
1034
|
}
|
|
985
|
-
n(
|
|
986
|
-
const
|
|
1035
|
+
n(x);
|
|
1036
|
+
const N = (await (await he(u, f, m)).get(
|
|
987
1037
|
`${s}${t}`,
|
|
988
1038
|
{ headers: {
|
|
989
|
-
Authorization:
|
|
1039
|
+
Authorization: x
|
|
990
1040
|
} }
|
|
991
1041
|
)).data;
|
|
992
|
-
|
|
993
|
-
} catch (
|
|
994
|
-
console.error(
|
|
1042
|
+
C(N);
|
|
1043
|
+
} catch (x) {
|
|
1044
|
+
console.error(x), o();
|
|
995
1045
|
} finally {
|
|
996
1046
|
c(!1);
|
|
997
1047
|
}
|
|
998
|
-
},
|
|
1048
|
+
}, L = async () => {
|
|
999
1049
|
try {
|
|
1000
|
-
|
|
1001
|
-
const
|
|
1002
|
-
if (!
|
|
1003
|
-
o(),
|
|
1050
|
+
p(!0);
|
|
1051
|
+
const x = localStorage.getItem("accessToken");
|
|
1052
|
+
if (!x) {
|
|
1053
|
+
o(), d("danger", "Sessione Scaduta");
|
|
1004
1054
|
return;
|
|
1005
1055
|
}
|
|
1006
|
-
const
|
|
1056
|
+
const N = (await (await he(u, f, m)).get(
|
|
1007
1057
|
`${s}`,
|
|
1008
1058
|
{ headers: {
|
|
1009
|
-
Authorization:
|
|
1059
|
+
Authorization: x
|
|
1010
1060
|
} }
|
|
1011
1061
|
)).data;
|
|
1012
|
-
|
|
1013
|
-
} catch (
|
|
1014
|
-
console.error(
|
|
1062
|
+
h(N);
|
|
1063
|
+
} catch (x) {
|
|
1064
|
+
console.error(x), c(!1);
|
|
1015
1065
|
} finally {
|
|
1016
|
-
|
|
1066
|
+
p(!1);
|
|
1017
1067
|
}
|
|
1018
|
-
},
|
|
1019
|
-
o(),
|
|
1068
|
+
}, S = () => {
|
|
1069
|
+
o(), d("info", "Hai effettuato il logout");
|
|
1020
1070
|
};
|
|
1021
|
-
return
|
|
1022
|
-
|
|
1071
|
+
return G(() => {
|
|
1072
|
+
b();
|
|
1023
1073
|
}, []), /* @__PURE__ */ a.jsx("section", { children: /* @__PURE__ */ a.jsxs("div", { className: "container mx-auto py-8", children: [
|
|
1024
1074
|
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center justify-center gap-8 h-20", children: [
|
|
1025
1075
|
/* @__PURE__ */ a.jsxs("h1", { className: "text-4xl text-center text-slate-800", children: [
|
|
1026
1076
|
"Email: ",
|
|
1027
|
-
|
|
1077
|
+
y.email
|
|
1028
1078
|
] }),
|
|
1029
1079
|
/* @__PURE__ */ a.jsx(
|
|
1030
1080
|
"button",
|
|
1031
1081
|
{
|
|
1032
|
-
onClick:
|
|
1082
|
+
onClick: S,
|
|
1033
1083
|
className: "bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full cursor-pointer shadow-[0_4px_10px_rgba(239,68,68,0.3),0_2px_4px_rgba(239,68,68,0.2)] hover:shadow-[0_6px_14px_rgba(185,28,28,0.4),0_3px_6px_rgba(185,28,28,0.3)] active:shadow-[0_2px_5px_rgba(239,68,68,0.3)] transition-all duration-200 active:translate-y-[2px]",
|
|
1034
1084
|
children: "Logout"
|
|
1035
1085
|
}
|
|
@@ -1038,17 +1088,17 @@ const St = (t) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3
|
|
|
1038
1088
|
/* @__PURE__ */ a.jsx("div", { className: "flex justify-center items-center my-12", children: /* @__PURE__ */ a.jsx(
|
|
1039
1089
|
"button",
|
|
1040
1090
|
{
|
|
1041
|
-
onClick:
|
|
1091
|
+
onClick: L,
|
|
1042
1092
|
className: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full disabled:bg-blue-300 disabled:text-gray-500 disabled:cursor-not-allowed cursor-pointer transition-all duration-200 active:translate-y-[2px] shadow-[0_4px_10px_rgba(59,130,246,0.3),0_2px_4px_rgba(59,130,246,0.2)] hover:shadow-[0_6px_14px_rgba(29,78,216,0.4),0_3px_6px_rgba(29,78,216,0.3)] active:shadow-[0_2px_5px_rgba(59,130,246,0.3)]",
|
|
1043
|
-
disabled:
|
|
1093
|
+
disabled: E,
|
|
1044
1094
|
children: "Lista degli utenti"
|
|
1045
1095
|
}
|
|
1046
1096
|
) }),
|
|
1047
|
-
/* @__PURE__ */ a.jsx("div", { className: "flex justify-center items-center", children:
|
|
1048
|
-
|
|
1097
|
+
/* @__PURE__ */ a.jsx("div", { className: "flex justify-center items-center", children: P && /* @__PURE__ */ a.jsx("ul", { children: P.map((x) => /* @__PURE__ */ a.jsxs("li", { className: "text-xl my-4", children: [
|
|
1098
|
+
x.id,
|
|
1049
1099
|
" - ",
|
|
1050
|
-
|
|
1051
|
-
] }, `user-${
|
|
1100
|
+
x.email
|
|
1101
|
+
] }, `user-${x.id}`)) }) })
|
|
1052
1102
|
] }) });
|
|
1053
1103
|
}, At = (t) => /* @__PURE__ */ r.createElement("svg", { width: "108.41262mm", height: "108.41262mm", viewBox: "0 0 108.41262 108.41262", id: "svg1", xmlSpace: "preserve", xmlnsXlink: "http://www.w3.org/1999/xlink", xmlns: "http://www.w3.org/2000/svg", "xmlns:svg": "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ r.createElement("defs", { id: "defs1" }, /* @__PURE__ */ r.createElement("linearGradient", { id: "linearGradient27" }, /* @__PURE__ */ r.createElement("stop", { style: {
|
|
1054
1104
|
stopColor: "#ff0000",
|
|
@@ -1097,67 +1147,67 @@ const St = (t) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3
|
|
|
1097
1147
|
strokeOpacity: 1,
|
|
1098
1148
|
paintOrder: "stroke markers fill"
|
|
1099
1149
|
}, d: "", id: "path40", transform: "scale(0.26458333)" }))), Zt = (t) => {
|
|
1100
|
-
const { publicRoutes: o, privateRoutes: n } =
|
|
1150
|
+
const { publicRoutes: o, privateRoutes: n } = St(), { firstPrivatePath: s } = te(), {
|
|
1101
1151
|
logoImg: c = At,
|
|
1102
1152
|
pathImg: u = "./src/assets/MyWarehouse.svg",
|
|
1103
1153
|
firstPrivateElement: f = /* @__PURE__ */ a.jsx(Nt, {}),
|
|
1104
|
-
globalLayout:
|
|
1105
|
-
isMain:
|
|
1106
|
-
headerComponent:
|
|
1107
|
-
showHeaderOnLogin:
|
|
1108
|
-
headerExcludedRoutes:
|
|
1109
|
-
footerComponent:
|
|
1110
|
-
showFooterOnLogin:
|
|
1111
|
-
footerExcludedRoutes:
|
|
1112
|
-
privateProvider:
|
|
1113
|
-
customProvider:
|
|
1114
|
-
} = t,
|
|
1115
|
-
|
|
1154
|
+
globalLayout: m,
|
|
1155
|
+
isMain: d,
|
|
1156
|
+
headerComponent: y,
|
|
1157
|
+
showHeaderOnLogin: C,
|
|
1158
|
+
headerExcludedRoutes: P,
|
|
1159
|
+
footerComponent: h,
|
|
1160
|
+
showFooterOnLogin: E,
|
|
1161
|
+
footerExcludedRoutes: p,
|
|
1162
|
+
privateProvider: b,
|
|
1163
|
+
customProvider: L
|
|
1164
|
+
} = t, S = m || /* @__PURE__ */ a.jsx(
|
|
1165
|
+
kt,
|
|
1116
1166
|
{
|
|
1117
|
-
isMain:
|
|
1118
|
-
headerComponent:
|
|
1119
|
-
showHeaderOnLogin:
|
|
1120
|
-
headerExcludedRoutes:
|
|
1121
|
-
footerComponent:
|
|
1122
|
-
showFooterOnLogin:
|
|
1123
|
-
footerExcludedRoutes:
|
|
1167
|
+
isMain: d,
|
|
1168
|
+
headerComponent: y,
|
|
1169
|
+
showHeaderOnLogin: C,
|
|
1170
|
+
headerExcludedRoutes: P,
|
|
1171
|
+
footerComponent: h,
|
|
1172
|
+
showFooterOnLogin: E,
|
|
1173
|
+
footerExcludedRoutes: p
|
|
1124
1174
|
}
|
|
1125
|
-
),
|
|
1126
|
-
const
|
|
1127
|
-
u && (
|
|
1175
|
+
), x = b ? W.cloneElement(b, {}, L) : /* @__PURE__ */ a.jsx(_t, { children: L }), R = () => {
|
|
1176
|
+
const k = document.querySelector("link[rel='icon']");
|
|
1177
|
+
u && (k.href = u);
|
|
1128
1178
|
};
|
|
1129
|
-
return
|
|
1130
|
-
|
|
1131
|
-
}, []), /* @__PURE__ */ a.jsx(ct, { children: /* @__PURE__ */ a.jsxs(
|
|
1132
|
-
/* @__PURE__ */ a.jsxs(
|
|
1133
|
-
/* @__PURE__ */ a.jsx(
|
|
1134
|
-
o.map((
|
|
1179
|
+
return G(() => {
|
|
1180
|
+
R();
|
|
1181
|
+
}, []), /* @__PURE__ */ a.jsx(ct, { children: /* @__PURE__ */ a.jsxs(ee, { element: m === "none" ? null : S, children: [
|
|
1182
|
+
/* @__PURE__ */ a.jsxs(ee, { path: "/", children: [
|
|
1183
|
+
/* @__PURE__ */ a.jsx(ee, { index: !0, element: /* @__PURE__ */ a.jsx(Tt, { Logo: c }) }),
|
|
1184
|
+
o.map((k, N) => /* @__PURE__ */ a.jsx(ee, { path: k.path, element: k.element }, `public-${N}`))
|
|
1135
1185
|
] }),
|
|
1136
|
-
/* @__PURE__ */ a.jsxs(
|
|
1137
|
-
/* @__PURE__ */ a.jsx(
|
|
1138
|
-
n.map((
|
|
1186
|
+
/* @__PURE__ */ a.jsxs(ee, { element: x, children: [
|
|
1187
|
+
/* @__PURE__ */ a.jsx(ee, { path: `${s ?? "/dashboard/"}:id`, element: f }),
|
|
1188
|
+
n.map((k, N) => /* @__PURE__ */ a.jsx(ee, { path: k.path, element: k.element }, `private-${N}`))
|
|
1139
1189
|
] })
|
|
1140
1190
|
] }) });
|
|
1141
1191
|
}, Ut = ({ spinner: t = !0, spinnerStyle: o, text: n, textStyle: s, children: c, containerStyle: u, overrideStyle: f = {} }) => /* @__PURE__ */ a.jsxs("div", { className: f.container || `w-full h-full relative flex items-center justify-center ${u}`, children: [
|
|
1142
|
-
t && /* @__PURE__ */ a.jsx(
|
|
1192
|
+
t && /* @__PURE__ */ a.jsx(ot, { className: f.spinner || `text-[20rem] animate-spin text-black ${o}` }),
|
|
1143
1193
|
c || /* @__PURE__ */ a.jsx("p", { className: f.text || `text-black text-2xl select-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 ${s}`, children: n || "Loading..." })
|
|
1144
1194
|
] });
|
|
1145
1195
|
export {
|
|
1146
|
-
|
|
1196
|
+
Ye as Alert,
|
|
1147
1197
|
Ft as AlertProvider,
|
|
1148
1198
|
_t as AuthPage,
|
|
1149
1199
|
Dt as AuthProvider,
|
|
1150
1200
|
Vt as BrowserRouter,
|
|
1151
|
-
|
|
1201
|
+
$t as ConfigProvider,
|
|
1152
1202
|
Nt as Dashboard,
|
|
1153
|
-
|
|
1203
|
+
kt as DefaultLayout,
|
|
1154
1204
|
pt as ErrorPage,
|
|
1155
|
-
|
|
1156
|
-
|
|
1205
|
+
Ze as Input,
|
|
1206
|
+
Ue as InputLabel,
|
|
1157
1207
|
Xt as Link,
|
|
1158
|
-
|
|
1208
|
+
Ot as Loading,
|
|
1159
1209
|
Ut as LoadingComponent,
|
|
1160
|
-
|
|
1210
|
+
Bt as LoadingProvider,
|
|
1161
1211
|
Tt as Login,
|
|
1162
1212
|
Rt as LoginForm,
|
|
1163
1213
|
Yt as LoginFormProvider,
|
|
@@ -1167,13 +1217,13 @@ export {
|
|
|
1167
1217
|
Qt as Route,
|
|
1168
1218
|
Wt as RouteProvider,
|
|
1169
1219
|
e0 as Routes,
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1220
|
+
he as fetchAxiosConfig,
|
|
1221
|
+
ie as useAlert,
|
|
1222
|
+
je as useAuth,
|
|
1223
|
+
te as useConfig,
|
|
1174
1224
|
xe as useLoading,
|
|
1175
1225
|
t0 as useLocation,
|
|
1176
|
-
|
|
1226
|
+
rt as useLoginForm,
|
|
1177
1227
|
r0 as useMatch,
|
|
1178
|
-
|
|
1228
|
+
St as useRoutesInjection
|
|
1179
1229
|
};
|