thecore-auth 0.0.97 → 0.0.98

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.
@@ -1,10 +1,10 @@
1
1
  import * as t from "react";
2
- import H, { createContext as ie, useState as w, useContext as se, useEffect as M } from "react";
2
+ import Z, { createContext as ie, useState as j, useContext as se, useEffect as B } from "react";
3
3
  import at from "jwt-decode";
4
- import { useNavigate as ke, useLocation as Le, matchPath as $e, Outlet as je, Navigate as Je, Routes as lt, Route as Q, useMatch as ct } from "react-router-dom";
5
- import { BrowserRouter as s0, Link as a0, NavLink as l0, Outlet as c0, Route as f0, Routes as u0, useLocation as d0, useMatch as m0, useNavigate as p0 } from "react-router-dom";
4
+ import { useNavigate as ke, useLocation as Le, matchPath as $e, Outlet as je, Navigate as Je, Routes as lt, Route as ee, useMatch as ct } from "react-router-dom";
5
+ import { BrowserRouter as i0, Link as s0, NavLink as a0, Outlet as l0, Route as c0, Routes as f0, useLocation as u0, useMatch as d0, useNavigate as m0 } from "react-router-dom";
6
6
  import ft from "axios";
7
- import { default as g0 } from "axios";
7
+ import { default as h0 } from "axios";
8
8
  var he = { exports: {} }, ue = {};
9
9
  /**
10
10
  * @license React
@@ -24,8 +24,8 @@ function ut() {
24
24
  var u = null;
25
25
  if (l !== void 0 && (u = "" + l), a.key !== void 0 && (u = "" + a.key), "key" in a) {
26
26
  l = {};
27
- for (var m in a)
28
- m !== "key" && (l[m] = a[m]);
27
+ for (var p in a)
28
+ p !== "key" && (l[p] = a[p]);
29
29
  } else l = a;
30
30
  return a = l.ref, {
31
31
  $$typeof: r,
@@ -56,17 +56,17 @@ function dt() {
56
56
  return e.$$typeof === ye ? null : e.displayName || e.name || null;
57
57
  if (typeof e == "string") return e;
58
58
  switch (e) {
59
- case B:
59
+ case G:
60
60
  return "Fragment";
61
- case N:
61
+ case S:
62
62
  return "Portal";
63
- case q:
63
+ case F:
64
64
  return "Profiler";
65
- case te:
65
+ case _:
66
66
  return "StrictMode";
67
- case z:
67
+ case $:
68
68
  return "Suspense";
69
- case F:
69
+ case D:
70
70
  return "SuspenseList";
71
71
  }
72
72
  if (typeof e == "object")
@@ -77,12 +77,12 @@ function dt() {
77
77
  return (e.displayName || "Context") + ".Provider";
78
78
  case re:
79
79
  return (e._context.displayName || "Context") + ".Consumer";
80
- case J:
80
+ case V:
81
81
  var c = e.render;
82
82
  return e = e.displayName, e || (e = c.displayName || c.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
83
- case $:
83
+ case W:
84
84
  return c = e.displayName || null, c !== null ? c : r(e.type) || "Memo";
85
- case V:
85
+ case X:
86
86
  c = e._payload, e = e._init;
87
87
  try {
88
88
  return r(e(c));
@@ -103,18 +103,18 @@ function dt() {
103
103
  }
104
104
  if (c) {
105
105
  c = console;
106
- var f = c.error, b = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
106
+ var f = c.error, E = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
107
107
  return f.call(
108
108
  c,
109
109
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
110
- b
110
+ E
111
111
  ), i(e);
112
112
  }
113
113
  }
114
114
  function s() {
115
115
  }
116
116
  function a() {
117
- if (Y === 0) {
117
+ if (U === 0) {
118
118
  Pe = console.log, Re = console.info, Ne = console.warn, Ge = console.error, Te = console.group, _e = console.groupCollapsed, Ie = console.groupEnd;
119
119
  var e = {
120
120
  configurable: !0,
@@ -132,22 +132,22 @@ function dt() {
132
132
  groupEnd: e
133
133
  });
134
134
  }
135
- Y++;
135
+ U++;
136
136
  }
137
137
  function l() {
138
- if (Y--, Y === 0) {
138
+ if (U--, U === 0) {
139
139
  var e = { configurable: !0, enumerable: !0, writable: !0 };
140
140
  Object.defineProperties(console, {
141
- log: A({}, e, { value: Pe }),
142
- info: A({}, e, { value: Re }),
143
- warn: A({}, e, { value: Ne }),
144
- error: A({}, e, { value: Ge }),
145
- group: A({}, e, { value: Te }),
146
- groupCollapsed: A({}, e, { value: _e }),
147
- groupEnd: A({}, e, { value: Ie })
141
+ log: z({}, e, { value: Pe }),
142
+ info: z({}, e, { value: Re }),
143
+ warn: z({}, e, { value: Ne }),
144
+ error: z({}, e, { value: Ge }),
145
+ group: z({}, e, { value: Te }),
146
+ groupCollapsed: z({}, e, { value: _e }),
147
+ groupEnd: z({}, e, { value: Ie })
148
148
  });
149
149
  }
150
- 0 > Y && console.error(
150
+ 0 > U && console.error(
151
151
  "disabledDepth fell below zero. This is a bug in React. Please file an issue."
152
152
  );
153
153
  }
@@ -163,146 +163,146 @@ function dt() {
163
163
  return `
164
164
  ` + Ee + e + Ae;
165
165
  }
166
- function m(e, c) {
166
+ function p(e, c) {
167
167
  if (!e || Ce) return "";
168
168
  var f = we.get(e);
169
169
  if (f !== void 0) return f;
170
170
  Ce = !0, f = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
171
- var b = null;
172
- b = k.H, k.H = null, a();
171
+ var E = null;
172
+ E = O.H, O.H = null, a();
173
173
  try {
174
- var G = {
174
+ var T = {
175
175
  DetermineComponentFrameRoot: function() {
176
176
  try {
177
177
  if (c) {
178
- var Z = function() {
178
+ var q = function() {
179
179
  throw Error();
180
180
  };
181
- if (Object.defineProperty(Z.prototype, "props", {
181
+ if (Object.defineProperty(q.prototype, "props", {
182
182
  set: function() {
183
183
  throw Error();
184
184
  }
185
185
  }), typeof Reflect == "object" && Reflect.construct) {
186
186
  try {
187
- Reflect.construct(Z, []);
188
- } catch (W) {
189
- var pe = W;
187
+ Reflect.construct(q, []);
188
+ } catch (Y) {
189
+ var pe = Y;
190
190
  }
191
- Reflect.construct(e, [], Z);
191
+ Reflect.construct(e, [], q);
192
192
  } else {
193
193
  try {
194
- Z.call();
195
- } catch (W) {
196
- pe = W;
194
+ q.call();
195
+ } catch (Y) {
196
+ pe = Y;
197
197
  }
198
- e.call(Z.prototype);
198
+ e.call(q.prototype);
199
199
  }
200
200
  } else {
201
201
  try {
202
202
  throw Error();
203
- } catch (W) {
204
- pe = W;
203
+ } catch (Y) {
204
+ pe = Y;
205
205
  }
206
- (Z = e()) && typeof Z.catch == "function" && Z.catch(function() {
206
+ (q = e()) && typeof q.catch == "function" && q.catch(function() {
207
207
  });
208
208
  }
209
- } catch (W) {
210
- if (W && pe && typeof W.stack == "string")
211
- return [W.stack, pe.stack];
209
+ } catch (Y) {
210
+ if (Y && pe && typeof Y.stack == "string")
211
+ return [Y.stack, pe.stack];
212
212
  }
213
213
  return [null, null];
214
214
  }
215
215
  };
216
- G.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
217
- var L = Object.getOwnPropertyDescriptor(
218
- G.DetermineComponentFrameRoot,
216
+ T.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
217
+ var k = Object.getOwnPropertyDescriptor(
218
+ T.DetermineComponentFrameRoot,
219
219
  "name"
220
220
  );
221
- L && L.configurable && Object.defineProperty(
222
- G.DetermineComponentFrameRoot,
221
+ k && k.configurable && Object.defineProperty(
222
+ T.DetermineComponentFrameRoot,
223
223
  "name",
224
224
  { value: "DetermineComponentFrameRoot" }
225
225
  );
226
- var h = G.DetermineComponentFrameRoot(), D = h[0], oe = h[1];
227
- if (D && oe) {
228
- var _ = D.split(`
229
- `), K = oe.split(`
226
+ var h = T.DetermineComponentFrameRoot(), H = h[0], oe = h[1];
227
+ if (H && oe) {
228
+ var A = H.split(`
229
+ `), Q = oe.split(`
230
230
  `);
231
- for (h = L = 0; L < _.length && !_[L].includes(
231
+ for (h = k = 0; k < A.length && !A[k].includes(
232
232
  "DetermineComponentFrameRoot"
233
233
  ); )
234
- L++;
235
- for (; h < K.length && !K[h].includes(
234
+ k++;
235
+ for (; h < Q.length && !Q[h].includes(
236
236
  "DetermineComponentFrameRoot"
237
237
  ); )
238
238
  h++;
239
- if (L === _.length || h === K.length)
240
- for (L = _.length - 1, h = K.length - 1; 1 <= L && 0 <= h && _[L] !== K[h]; )
239
+ if (k === A.length || h === Q.length)
240
+ for (k = A.length - 1, h = Q.length - 1; 1 <= k && 0 <= h && A[k] !== Q[h]; )
241
241
  h--;
242
- for (; 1 <= L && 0 <= h; L--, h--)
243
- if (_[L] !== K[h]) {
244
- if (L !== 1 || h !== 1)
242
+ for (; 1 <= k && 0 <= h; k--, h--)
243
+ if (A[k] !== Q[h]) {
244
+ if (k !== 1 || h !== 1)
245
245
  do
246
- if (L--, h--, 0 > h || _[L] !== K[h]) {
246
+ if (k--, h--, 0 > h || A[k] !== Q[h]) {
247
247
  var fe = `
248
- ` + _[L].replace(
248
+ ` + A[k].replace(
249
249
  " at new ",
250
250
  " at "
251
251
  );
252
252
  return e.displayName && fe.includes("<anonymous>") && (fe = fe.replace("<anonymous>", e.displayName)), typeof e == "function" && we.set(e, fe), fe;
253
253
  }
254
- while (1 <= L && 0 <= h);
254
+ while (1 <= k && 0 <= h);
255
255
  break;
256
256
  }
257
257
  }
258
258
  } finally {
259
- Ce = !1, k.H = b, l(), Error.prepareStackTrace = f;
259
+ Ce = !1, O.H = E, l(), Error.prepareStackTrace = f;
260
260
  }
261
- return _ = (_ = e ? e.displayName || e.name : "") ? u(_) : "", typeof e == "function" && we.set(e, _), _;
261
+ return A = (A = e ? e.displayName || e.name : "") ? u(A) : "", typeof e == "function" && we.set(e, A), A;
262
262
  }
263
- function p(e) {
263
+ function d(e) {
264
264
  if (e == null) return "";
265
265
  if (typeof e == "function") {
266
266
  var c = e.prototype;
267
- return m(
267
+ return p(
268
268
  e,
269
269
  !(!c || !c.isReactComponent)
270
270
  );
271
271
  }
272
272
  if (typeof e == "string") return u(e);
273
273
  switch (e) {
274
- case z:
274
+ case $:
275
275
  return u("Suspense");
276
- case F:
276
+ case D:
277
277
  return u("SuspenseList");
278
278
  }
279
279
  if (typeof e == "object")
280
280
  switch (e.$$typeof) {
281
- case J:
282
- return e = m(e.render, !1), e;
283
- case $:
284
- return p(e.type);
285
281
  case V:
282
+ return e = p(e.render, !1), e;
283
+ case W:
284
+ return d(e.type);
285
+ case X:
286
286
  c = e._payload, e = e._init;
287
287
  try {
288
- return p(e(c));
288
+ return d(e(c));
289
289
  } catch {
290
290
  }
291
291
  }
292
292
  return "";
293
293
  }
294
- function y() {
295
- var e = k.A;
294
+ function v() {
295
+ var e = O.A;
296
296
  return e === null ? null : e.getOwner();
297
297
  }
298
- function v(e) {
299
- if (I.call(e, "key")) {
298
+ function b(e) {
299
+ if (M.call(e, "key")) {
300
300
  var c = Object.getOwnPropertyDescriptor(e, "key").get;
301
301
  if (c && c.isReactWarning) return !1;
302
302
  }
303
303
  return e.key !== void 0;
304
304
  }
305
- function R(e, c) {
305
+ function L(e, c) {
306
306
  function f() {
307
307
  Me || (Me = !0, console.error(
308
308
  "%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)",
@@ -314,22 +314,22 @@ function dt() {
314
314
  configurable: !0
315
315
  });
316
316
  }
317
- function E() {
317
+ function C() {
318
318
  var e = r(this.type);
319
319
  return ze[e] || (ze[e] = !0, console.error(
320
320
  "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."
321
321
  )), e = this.props.ref, e !== void 0 ? e : null;
322
322
  }
323
- function d(e, c, f, b, G, L) {
324
- return f = L.ref, e = {
325
- $$typeof: C,
323
+ function y(e, c, f, E, T, k) {
324
+ return f = k.ref, e = {
325
+ $$typeof: x,
326
326
  type: e,
327
327
  key: c,
328
- props: L,
329
- _owner: G
328
+ props: k,
329
+ _owner: T
330
330
  }, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
331
331
  enumerable: !1,
332
- get: E
332
+ get: C
333
333
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
334
334
  configurable: !1,
335
335
  enumerable: !1,
@@ -342,102 +342,102 @@ function dt() {
342
342
  value: null
343
343
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
344
344
  }
345
- function g(e, c, f, b, G, L) {
346
- if (typeof e == "string" || typeof e == "function" || e === B || e === q || e === te || e === z || e === F || e === be || typeof e == "object" && e !== null && (e.$$typeof === V || e.$$typeof === $ || e.$$typeof === le || e.$$typeof === re || e.$$typeof === J || e.$$typeof === T || e.getModuleId !== void 0)) {
345
+ function P(e, c, f, E, T, k) {
346
+ if (typeof e == "string" || typeof e == "function" || e === G || e === F || e === _ || e === $ || e === D || e === be || typeof e == "object" && e !== null && (e.$$typeof === X || e.$$typeof === W || e.$$typeof === le || e.$$typeof === re || e.$$typeof === V || e.$$typeof === I || e.getModuleId !== void 0)) {
347
347
  var h = c.children;
348
348
  if (h !== void 0)
349
- if (b)
350
- if (X(h)) {
351
- for (b = 0; b < h.length; b++)
352
- x(h[b], e);
349
+ if (E)
350
+ if (K(h)) {
351
+ for (E = 0; E < h.length; E++)
352
+ N(h[E], e);
353
353
  Object.freeze && Object.freeze(h);
354
354
  } else
355
355
  console.error(
356
356
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
357
357
  );
358
- else x(h, e);
358
+ else N(h, e);
359
359
  } else
360
- h = "", (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (h += " 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 ? b = "null" : X(e) ? b = "array" : e !== void 0 && e.$$typeof === C ? (b = "<" + (r(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, console.error(
360
+ h = "", (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (h += " 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 ? E = "null" : K(e) ? E = "array" : e !== void 0 && e.$$typeof === x ? (E = "<" + (r(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : E = typeof e, console.error(
361
361
  "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
362
- b,
362
+ E,
363
363
  h
364
364
  );
365
- if (I.call(c, "key")) {
365
+ if (M.call(c, "key")) {
366
366
  h = r(e);
367
- var D = Object.keys(c).filter(function(_) {
368
- return _ !== "key";
367
+ var H = Object.keys(c).filter(function(A) {
368
+ return A !== "key";
369
369
  });
370
- b = 0 < D.length ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}", Be[h + b] || (D = 0 < D.length ? "{" + D.join(": ..., ") + ": ...}" : "{}", console.error(
370
+ E = 0 < H.length ? "{key: someKey, " + H.join(": ..., ") + ": ...}" : "{key: someKey}", Be[h + E] || (H = 0 < H.length ? "{" + H.join(": ..., ") + ": ...}" : "{}", console.error(
371
371
  `A props object containing a "key" prop is being spread into JSX:
372
372
  let props = %s;
373
373
  <%s {...props} />
374
374
  React keys must be passed directly to JSX without using spread:
375
375
  let props = %s;
376
376
  <%s key={someKey} {...props} />`,
377
- b,
377
+ E,
378
378
  h,
379
- D,
379
+ H,
380
380
  h
381
- ), Be[h + b] = !0);
381
+ ), Be[h + E] = !0);
382
382
  }
383
- if (h = null, f !== void 0 && (n(f), h = "" + f), v(c) && (n(c.key), h = "" + c.key), "key" in c) {
383
+ if (h = null, f !== void 0 && (n(f), h = "" + f), b(c) && (n(c.key), h = "" + c.key), "key" in c) {
384
384
  f = {};
385
385
  for (var oe in c)
386
386
  oe !== "key" && (f[oe] = c[oe]);
387
387
  } else f = c;
388
- return h && R(
388
+ return h && L(
389
389
  f,
390
390
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
391
- ), d(e, h, L, G, y(), f);
391
+ ), y(e, h, k, T, v(), f);
392
392
  }
393
- function x(e, c) {
393
+ function N(e, c) {
394
394
  if (typeof e == "object" && e && e.$$typeof !== st) {
395
- if (X(e))
395
+ if (K(e))
396
396
  for (var f = 0; f < e.length; f++) {
397
- var b = e[f];
398
- O(b) && j(b, c);
397
+ var E = e[f];
398
+ m(E) && w(E, c);
399
399
  }
400
- else if (O(e))
400
+ else if (m(e))
401
401
  e._store && (e._store.validated = 1);
402
402
  else if (e === null || typeof e != "object" ? f = null : (f = ce && e[ce] || e["@@iterator"], f = typeof f == "function" ? f : null), typeof f == "function" && f !== e.entries && (f = f.call(e), f !== e))
403
403
  for (; !(e = f.next()).done; )
404
- O(e.value) && j(e.value, c);
404
+ m(e.value) && w(e.value, c);
405
405
  }
406
406
  }
407
- function O(e) {
408
- return typeof e == "object" && e !== null && e.$$typeof === C;
407
+ function m(e) {
408
+ return typeof e == "object" && e !== null && e.$$typeof === x;
409
409
  }
410
- function j(e, c) {
411
- if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1, c = S(c), !Fe[c])) {
410
+ function w(e, c) {
411
+ if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1, c = g(c), !Fe[c])) {
412
412
  Fe[c] = !0;
413
413
  var f = "";
414
- e && e._owner != null && e._owner !== y() && (f = null, typeof e._owner.tag == "number" ? f = r(e._owner.type) : typeof e._owner.name == "string" && (f = e._owner.name), f = " It was passed a child from " + f + ".");
415
- var b = k.getCurrentStack;
416
- k.getCurrentStack = function() {
417
- var G = p(e.type);
418
- return b && (G += b() || ""), G;
414
+ e && e._owner != null && e._owner !== v() && (f = null, typeof e._owner.tag == "number" ? f = r(e._owner.type) : typeof e._owner.name == "string" && (f = e._owner.name), f = " It was passed a child from " + f + ".");
415
+ var E = O.getCurrentStack;
416
+ O.getCurrentStack = function() {
417
+ var T = d(e.type);
418
+ return E && (T += E() || ""), T;
419
419
  }, console.error(
420
420
  'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
421
421
  c,
422
422
  f
423
- ), k.getCurrentStack = b;
423
+ ), O.getCurrentStack = E;
424
424
  }
425
425
  }
426
- function S(e) {
427
- var c = "", f = y();
426
+ function g(e) {
427
+ var c = "", f = v();
428
428
  return f && (f = r(f.type)) && (c = `
429
429
 
430
430
  Check the render method of \`` + f + "`."), c || (e = r(e)) && (c = `
431
431
 
432
432
  Check the top-level render call using <` + e + ">."), c;
433
433
  }
434
- var P = H, C = Symbol.for("react.transitional.element"), N = Symbol.for("react.portal"), B = Symbol.for("react.fragment"), te = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), re = Symbol.for("react.consumer"), le = Symbol.for("react.context"), J = Symbol.for("react.forward_ref"), z = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), $ = Symbol.for("react.memo"), V = Symbol.for("react.lazy"), be = Symbol.for("react.offscreen"), ce = Symbol.iterator, ye = Symbol.for("react.client.reference"), k = P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, I = Object.prototype.hasOwnProperty, A = Object.assign, T = Symbol.for("react.client.reference"), X = Array.isArray, Y = 0, Pe, Re, Ne, Ge, Te, _e, Ie;
434
+ var R = Z, x = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), G = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), F = Symbol.for("react.profiler"), re = Symbol.for("react.consumer"), le = Symbol.for("react.context"), V = Symbol.for("react.forward_ref"), $ = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), W = Symbol.for("react.memo"), X = Symbol.for("react.lazy"), be = Symbol.for("react.offscreen"), ce = Symbol.iterator, ye = Symbol.for("react.client.reference"), O = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, z = Object.assign, I = Symbol.for("react.client.reference"), K = Array.isArray, U = 0, Pe, Re, Ne, Ge, Te, _e, Ie;
435
435
  s.__reactDisabledLog = !0;
436
436
  var Ee, Ae, Ce = !1, we = new (typeof WeakMap == "function" ? WeakMap : Map)(), st = Symbol.for("react.client.reference"), Me, ze = {}, Be = {}, Fe = {};
437
- de.Fragment = B, de.jsx = function(e, c, f, b, G) {
438
- return g(e, c, f, !1, b, G);
439
- }, de.jsxs = function(e, c, f, b, G) {
440
- return g(e, c, f, !0, b, G);
437
+ de.Fragment = G, de.jsx = function(e, c, f, E, T) {
438
+ return P(e, c, f, !1, E, T);
439
+ }, de.jsxs = function(e, c, f, E, T) {
440
+ return P(e, c, f, !0, E, T);
441
441
  };
442
442
  }()), de;
443
443
  }
@@ -446,8 +446,8 @@ function mt() {
446
446
  return He || (He = 1, process.env.NODE_ENV === "production" ? he.exports = ut() : he.exports = dt()), he.exports;
447
447
  }
448
448
  var o = mt();
449
- const Ve = ie(), Yt = ({ children: r }) => {
450
- const [i, n] = w(!1), [s, a] = w(!1), [l, u] = w({});
449
+ const Ve = ie(), Ht = ({ children: r }) => {
450
+ const [i, n] = j(!1), [s, a] = j(!1), [l, u] = j({});
451
451
  return /* @__PURE__ */ o.jsx(Ve.Provider, { value: { isLoading: i, setIsLoading: n, isLoadingComponent: s, setIsLoadingComponent: a, loadingProps: l, setLoadingProps: u }, children: r });
452
452
  }, me = () => {
453
453
  const r = se(Ve);
@@ -456,8 +456,8 @@ const Ve = ie(), Yt = ({ children: r }) => {
456
456
  }, pt = ({ errorMessage: r, errorShow: i }) => /* @__PURE__ */ o.jsx("section", { className: i ? "" : "hidden", children: /* @__PURE__ */ o.jsxs("div", { className: "container mx-auto", children: [
457
457
  /* @__PURE__ */ o.jsx("h1", { className: "text-center text-8xl my-12", children: "Errore" }),
458
458
  /* @__PURE__ */ o.jsx("pre", { className: "text-xl", children: r })
459
- ] }) }), Xe = ie(), Zt = ({ children: r }) => {
460
- const [i, n] = w({}), [s, a] = w(!1), l = `Creare un file config.json in public per il corretto funzionamento
459
+ ] }) }), Xe = ie(), Yt = ({ children: r }) => {
460
+ const [i, n] = j({}), [s, a] = j(!1), [l, u] = j(null), p = `Creare un file config.json in public per il corretto funzionamento
461
461
  Esempio di config.json:
462
462
 
463
463
  {
@@ -484,63 +484,72 @@ Esempio di config.json:
484
484
  "backendToken": "",
485
485
  "isDebug": "",
486
486
  "showHeaderButton": ""
487
- }`, u = () => {
488
- const d = /* @__PURE__ */ new Date(), g = String(d.getDate()).padStart(2, "0"), x = String(d.getMonth() + 1).padStart(2, "0"), O = d.getFullYear(), j = String(d.getHours()).padStart(2, "0"), S = String(d.getMinutes()).padStart(2, "0"), P = String(d.getSeconds()).padStart(2, "0");
489
- return `${g}/${x}/${O} ${j}:${S}:${P}`;
490
- }, m = (d) => new Promise((g, x) => {
491
- const O = indexedDB.open("configDatabase", 1);
492
- O.onupgradeneeded = (j) => {
493
- const S = j.target.result;
494
- S.objectStoreNames.contains(d) || S.createObjectStore(d, { keyPath: "id" });
495
- }, O.onsuccess = (j) => g(j.target.result), O.onerror = (j) => x(j.target.error);
496
- }), p = async (d, g) => {
497
- let x = await m(d);
498
- return new Promise((O, j) => {
499
- if (!x) {
500
- j("Errore: DB non disponibile");
487
+ }`, d = () => {
488
+ const m = /* @__PURE__ */ new Date(), w = String(m.getDate()).padStart(2, "0"), g = String(m.getMonth() + 1).padStart(2, "0"), R = m.getFullYear(), x = String(m.getHours()).padStart(2, "0"), S = String(m.getMinutes()).padStart(2, "0"), G = String(m.getSeconds()).padStart(2, "0");
489
+ return `${w}/${g}/${R} ${x}:${S}:${G}`;
490
+ }, v = (m) => new Promise((w, g) => {
491
+ const R = indexedDB.open("configDatabase", 1);
492
+ R.onupgradeneeded = (x) => {
493
+ const S = x.target.result;
494
+ S.objectStoreNames.contains(m) || S.createObjectStore(m, { keyPath: "id" });
495
+ }, R.onsuccess = (x) => w(x.target.result), R.onerror = (x) => g(x.target.error);
496
+ }), b = async (m, w) => {
497
+ let g = await v(m);
498
+ return new Promise((R, x) => {
499
+ if (!g) {
500
+ x("Errore: DB non disponibile");
501
501
  return;
502
502
  }
503
- const S = x == null ? void 0 : x.transaction(d, "readonly"), P = S == null ? void 0 : S.objectStore(d), C = P == null ? void 0 : P.get(g);
504
- C.onsuccess = () => O(C.result), C.onerror = (N) => j(N.target.error);
503
+ const S = g == null ? void 0 : g.transaction(m, "readonly"), G = S == null ? void 0 : S.objectStore(m), _ = G == null ? void 0 : G.get(w);
504
+ _.onsuccess = () => R(_.result), _.onerror = (F) => x(F.target.error);
505
505
  });
506
- }, y = async (d, g) => {
507
- let x = await m(d);
508
- return new Promise((O, j) => {
509
- if (!x) {
510
- j("Errore: DB non disponibile");
506
+ }, L = async (m, w) => {
507
+ let g = await v(m);
508
+ return new Promise((R, x) => {
509
+ if (!g) {
510
+ x("Errore: DB non disponibile");
511
511
  return;
512
512
  }
513
- const S = x == null ? void 0 : x.transaction(d, "readwrite"), P = S == null ? void 0 : S.objectStore(d), C = P == null ? void 0 : P.put(g);
514
- C.onsuccess = () => O(C.result), C.onerror = (N) => j(N.target.error);
513
+ const S = g == null ? void 0 : g.transaction(m, "readwrite"), G = S == null ? void 0 : S.objectStore(m), _ = G == null ? void 0 : G.put(w);
514
+ _.onsuccess = () => R(_.result), _.onerror = (F) => x(F.target.error);
515
515
  });
516
- }, v = async (d) => {
517
- let g = Date.now(), x;
516
+ }, C = async (m) => {
517
+ let w = Date.now(), g;
518
518
  do
519
- x = await p(d, g), x && g++;
520
- while (x);
521
- return g;
522
- }, R = async (d, g) => {
523
- g.id || (g.id = await v(d)), await y(d, g);
524
- }, E = async () => {
519
+ g = await b(m, w), g && w++;
520
+ while (g);
521
+ return w;
522
+ }, y = async (m, w) => {
523
+ w.id || (w.id = await C(m)), await L(m, w);
524
+ }, P = async () => {
525
525
  try {
526
- const x = {
526
+ const g = {
527
527
  ...await (await fetch("/config.json")).json(),
528
- openIndexedDB: m,
529
- getDataIndexedDB: p,
530
- setDataIndexedDB: y,
531
- generateUniqueId: v,
532
- setDataWithAutoId: R,
533
- setCurrentDate: u
528
+ openIndexedDB: v,
529
+ getDataIndexedDB: b,
530
+ setDataIndexedDB: L,
531
+ generateUniqueId: C,
532
+ setDataWithAutoId: y,
533
+ setCurrentDate: d
534
534
  };
535
- n(x);
536
- } catch (d) {
537
- console.error(d), a(!0);
535
+ n(g);
536
+ } catch (m) {
537
+ console.error(m), a(!0);
538
+ }
539
+ }, N = async () => {
540
+ try {
541
+ const g = (await (await fetch("/pacakge.json")).json()).version;
542
+ u(g);
543
+ } catch (m) {
544
+ console.error(m);
538
545
  }
539
546
  };
540
- return M(() => {
541
- E();
542
- }, []), Object.keys(i).length === 0 ? /* @__PURE__ */ o.jsx(pt, { errorShow: s, errorMessage: l }) : /* @__PURE__ */ o.jsx(Xe.Provider, { value: i, children: r });
543
- }, U = () => {
547
+ return B(() => {
548
+ P();
549
+ }, []), B(() => {
550
+ i.isDevelopment === void 0 || i.isDevelopment || N();
551
+ }, [i]), Object.keys(i).length === 0 ? /* @__PURE__ */ o.jsx(pt, { errorShow: s, errorMessage: p }) : /* @__PURE__ */ o.jsx(Xe.Provider, { value: i, children: r });
552
+ }, J = () => {
544
553
  const r = se(Xe);
545
554
  if (r === void 0) throw new Error("Non puoi leggere i config");
546
555
  return r;
@@ -551,7 +560,7 @@ var Ke = {
551
560
  className: void 0,
552
561
  style: void 0,
553
562
  attr: void 0
554
- }, Ye = H.createContext && /* @__PURE__ */ H.createContext(Ke), vt = ["attr", "size", "title"];
563
+ }, Ye = Z.createContext && /* @__PURE__ */ Z.createContext(Ke), vt = ["attr", "size", "title"];
555
564
  function bt(r, i) {
556
565
  if (r == null) return {};
557
566
  var n = yt(r, i), s, a;
@@ -621,12 +630,12 @@ function wt(r, i) {
621
630
  return (i === "string" ? String : Number)(r);
622
631
  }
623
632
  function Qe(r) {
624
- return r && r.map((i, n) => /* @__PURE__ */ H.createElement(i.tag, xe({
633
+ return r && r.map((i, n) => /* @__PURE__ */ Z.createElement(i.tag, xe({
625
634
  key: n
626
635
  }, i.attr), Qe(i.child)));
627
636
  }
628
637
  function ae(r) {
629
- return (i) => /* @__PURE__ */ H.createElement(jt, ge({
638
+ return (i) => /* @__PURE__ */ Z.createElement(jt, ge({
630
639
  attr: xe({}, r.attr)
631
640
  }, i), Qe(r.child));
632
641
  }
@@ -636,28 +645,28 @@ function jt(r) {
636
645
  attr: s,
637
646
  size: a,
638
647
  title: l
639
- } = r, u = bt(r, vt), m = a || n.size || "1em", p;
640
- return n.className && (p = n.className), r.className && (p = (p ? p + " " : "") + r.className), /* @__PURE__ */ H.createElement("svg", ge({
648
+ } = r, u = bt(r, vt), p = a || n.size || "1em", d;
649
+ return n.className && (d = n.className), r.className && (d = (d ? d + " " : "") + r.className), /* @__PURE__ */ Z.createElement("svg", ge({
641
650
  stroke: "currentColor",
642
651
  fill: "currentColor",
643
652
  strokeWidth: "0"
644
653
  }, n.attr, s, u, {
645
- className: p,
654
+ className: d,
646
655
  style: xe(xe({
647
656
  color: r.color || n.color
648
657
  }, n.style), r.style),
649
- height: m,
650
- width: m,
658
+ height: p,
659
+ width: p,
651
660
  xmlns: "http://www.w3.org/2000/svg"
652
- }), l && /* @__PURE__ */ H.createElement("title", null, l), r.children);
661
+ }), l && /* @__PURE__ */ Z.createElement("title", null, l), r.children);
653
662
  };
654
- return Ye !== void 0 ? /* @__PURE__ */ H.createElement(Ye.Consumer, null, (n) => i(n)) : i(Ke);
663
+ return Ye !== void 0 ? /* @__PURE__ */ Z.createElement(Ye.Consumer, null, (n) => i(n)) : i(Ke);
655
664
  }
656
665
  function St(r) {
657
666
  return ae({ 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: [] }] })(r);
658
667
  }
659
- const et = ie(), Ut = ({ children: r }) => {
660
- const [i, n] = w(!1), [s, a] = w(), [l, u] = w(), R = {
668
+ const et = ie(), Zt = ({ children: r }) => {
669
+ const [i, n] = j(!1), [s, a] = j(), [l, u] = j(), L = {
661
670
  showAlert: i,
662
671
  setShowAlert: n,
663
672
  typeAlert: s,
@@ -698,8 +707,8 @@ const et = ie(), Ut = ({ children: r }) => {
698
707
  progressColor: "bg-warning-progress"
699
708
  }
700
709
  },
701
- getIcon: (E) => {
702
- switch (E) {
710
+ getIcon: (C) => {
711
+ switch (C) {
703
712
  case "danger":
704
713
  return /* @__PURE__ */ o.jsx(ht, { className: "w-[20px] h-[20px]" });
705
714
  case "info":
@@ -713,14 +722,14 @@ const et = ie(), Ut = ({ children: r }) => {
713
722
  closeAlert: () => {
714
723
  n(!i);
715
724
  },
716
- activeAlert: (E, d) => {
725
+ activeAlert: (C, y) => {
717
726
  n(!1), setTimeout(() => {
718
- a(E), u(d), n(!0);
727
+ a(C), u(y), n(!0);
719
728
  }, 50);
720
729
  }
721
730
  };
722
- return /* @__PURE__ */ o.jsx(et.Provider, { value: R, children: r });
723
- }, ee = () => {
731
+ return /* @__PURE__ */ o.jsx(et.Provider, { value: L, children: r });
732
+ }, te = () => {
724
733
  const r = se(et);
725
734
  if (r === void 0) throw new Error("Non puoi modificare l'alert");
726
735
  return r;
@@ -729,121 +738,121 @@ let ne;
729
738
  const Ot = async (r, i, n) => {
730
739
  if (ne) return ne;
731
740
  try {
732
- const a = await (await fetch("/config.json")).json(), l = a.baseUri, { unauthorized: u, notFound: m, defaultMessage: p } = a.axiosErrors, y = a.axiosTimeout;
741
+ const a = await (await fetch("/config.json")).json(), l = a.baseUri, { unauthorized: u, notFound: p, defaultMessage: d } = a.axiosErrors, v = a.axiosTimeout;
733
742
  return ne = ft.create({
734
743
  baseURL: l,
735
- timeout: y
744
+ timeout: v
736
745
  }), ne.interceptors.request.use(
737
- (v) => v
746
+ (b) => b
738
747
  ), ne.interceptors.response.use(
739
- (v) => v,
740
- (v) => {
741
- if (v.response)
742
- switch (r(!0), i("danger"), v.response.status) {
748
+ (b) => b,
749
+ (b) => {
750
+ if (b.response)
751
+ switch (r(!0), i("danger"), b.response.status) {
743
752
  case 401:
744
753
  localStorage.removeItem("accessToken"), n(u);
745
754
  break;
746
755
  case 404:
747
- n(m);
756
+ n(p);
748
757
  break;
749
758
  default:
750
- n(`${p} ${v.response.status || ""} ${v.response.data.error || ""}`);
759
+ n(`${d} ${b.response.status || ""} ${b.response.data.error || ""}`);
751
760
  }
752
- return Promise.reject(v);
761
+ return Promise.reject(b);
753
762
  }
754
763
  ), ne;
755
764
  } catch (s) {
756
765
  console.error(s);
757
766
  }
758
- }, tt = ie(), qt = ({ children: r }) => {
759
- const { heartbeatEndpoint: i, firstPrivatePath: n, infiniteSession: s, timeDeducted: a, authenticatedEndpoint: l, autoLogin: u, autoLoginEmail: m, autoLoginPassword: p, setCurrentDate: y, isDebug: v, backendToken: R } = U(), { setIsLoading: E } = me(), { setShowAlert: d, setMessageAlert: g, setTypeAlert: x, activeAlert: O } = ee(), j = ke(), [S, P] = w(null), [C, N] = w(), [B, te] = w(), [q, re] = w(), [le, J] = w(!1), z = async () => await Ot(d, x, g), F = async (k = null, I) => {
760
- k && k.preventDefault(), J(!0);
767
+ }, tt = ie(), Ut = ({ children: r }) => {
768
+ const { heartbeatEndpoint: i, firstPrivatePath: n, infiniteSession: s, timeDeducted: a, authenticatedEndpoint: l, autoLogin: u, autoLoginEmail: p, autoLoginPassword: d, setCurrentDate: v, isDebug: b, backendToken: L } = J(), { setIsLoading: C } = me(), { setShowAlert: y, setMessageAlert: P, setTypeAlert: N, activeAlert: m } = te(), w = ke(), [g, R] = j(null), [x, S] = j(), [G, _] = j(), [F, re] = j(), [le, V] = j(!1), $ = async () => await Ot(y, N, P), D = async (O = null, M) => {
769
+ O && O.preventDefault(), V(!0);
761
770
  try {
762
- E(!0), d(!1);
763
- const T = await (await z()).post(l, {
764
- auth: I
765
- }), X = T.headers.token, Y = T.data;
766
- X && (localStorage.setItem("accessToken", X), localStorage.setItem("user", JSON.stringify(Y)), P(!0), N(X), j(`${n}${Y.id}`));
767
- } catch (A) {
768
- console.error(A);
771
+ C(!0), y(!1);
772
+ const I = await (await $()).post(l, {
773
+ auth: M
774
+ }), K = I.headers.token, U = I.data;
775
+ K && (localStorage.setItem("accessToken", K), localStorage.setItem("user", JSON.stringify(U)), R(!0), S(K), w(`${n}${U.id}`));
776
+ } catch (z) {
777
+ console.error(z);
769
778
  } finally {
770
- J(!1), E(!1);
779
+ V(!1), C(!1);
771
780
  }
772
- }, $ = () => {
773
- localStorage.removeItem("accessToken"), localStorage.removeItem("id"), localStorage.removeItem("user"), P(!1), N(null);
774
- }, V = async () => {
781
+ }, W = () => {
782
+ localStorage.removeItem("accessToken"), localStorage.removeItem("id"), localStorage.removeItem("user"), R(!1), S(null);
783
+ }, X = async () => {
775
784
  try {
776
- const k = localStorage.getItem("accessToken"), T = (await (await z()).get(
785
+ const O = localStorage.getItem("accessToken"), I = (await (await $()).get(
777
786
  `${i}`,
778
787
  {
779
788
  headers: {
780
- Authorization: k
789
+ Authorization: O
781
790
  }
782
791
  }
783
792
  )).headers.token;
784
- localStorage.setItem("accessToken", T), N(T), v && console.log("nuovo token: ", T, "Data:", y());
785
- } catch (k) {
786
- console.error(k), $();
793
+ localStorage.setItem("accessToken", I), S(I), b && console.log("nuovo token: ", I, "Data:", v());
794
+ } catch (O) {
795
+ console.error(O), W();
787
796
  }
788
797
  }, be = () => {
789
- if (!C)
798
+ if (!x)
790
799
  return;
791
- const I = at(C).exp, A = Math.floor(Date.now() / 1e3), T = (I - A) * 1e3;
792
- re(T), te(T - a);
793
- }, ce = async (k) => {
800
+ const M = at(x).exp, z = Math.floor(Date.now() / 1e3), I = (M - z) * 1e3;
801
+ re(I), _(I - a);
802
+ }, ce = async (O) => {
794
803
  try {
795
- const T = (await (await z()).get(
804
+ const I = (await (await $()).get(
796
805
  i,
797
806
  {
798
807
  headers: {
799
- Authorization: k
808
+ Authorization: O
800
809
  }
801
810
  }
802
811
  )).data;
803
- T && (localStorage.setItem("user", JSON.stringify(T)), localStorage.setItem("accessToken", k), P(!0), j(`${n}${T.id}`));
804
- } catch (I) {
805
- console.error(I);
812
+ I && (localStorage.setItem("user", JSON.stringify(I)), localStorage.setItem("accessToken", O), R(!0), w(`${n}${I.id}`));
813
+ } catch (M) {
814
+ console.error(M);
806
815
  }
807
816
  };
808
- M(() => {
817
+ B(() => {
809
818
  if (localStorage.getItem("accessToken"))
810
- P(!0);
819
+ R(!0);
811
820
  else {
812
- P(!1);
821
+ R(!1);
813
822
  return;
814
823
  }
815
- }, []), M(() => {
816
- u && ce(R);
817
- }, [u]), M(() => {
818
- S || u && !le && ce(R);
819
- }, [S]), M(() => {
824
+ }, []), B(() => {
825
+ u && ce(L);
826
+ }, [u]), B(() => {
827
+ g || u && !le && ce(L);
828
+ }, [g]), B(() => {
820
829
  if (u) return;
821
830
  be();
822
- let k;
823
- s && C && B && (k = setInterval(() => {
824
- V();
825
- }, B));
826
- let I;
827
- return !s && C && q && (I = setTimeout(() => {
828
- $(), O("danger", "Sessione scaduta");
829
- }, q)), () => {
830
- k && clearInterval(k), I && clearTimeout(I);
831
+ let O;
832
+ s && x && G && (O = setInterval(() => {
833
+ X();
834
+ }, G));
835
+ let M;
836
+ return !s && x && F && (M = setTimeout(() => {
837
+ W(), m("danger", "Sessione scaduta");
838
+ }, F)), () => {
839
+ O && clearInterval(O), M && clearTimeout(M);
831
840
  };
832
- }, [C, B]);
841
+ }, [x, G]);
833
842
  const ye = {
834
- isAuthenticated: S,
835
- setIsAuthenticated: P,
836
- login: F,
837
- logout: $,
838
- setCurrentToken: N,
839
- createAxiosInstances: z
843
+ isAuthenticated: g,
844
+ setIsAuthenticated: R,
845
+ login: D,
846
+ logout: W,
847
+ setCurrentToken: S,
848
+ createAxiosInstances: $
840
849
  };
841
850
  return /* @__PURE__ */ o.jsx(tt.Provider, { value: ye, children: r });
842
851
  }, ve = () => {
843
852
  const r = se(tt);
844
853
  if (r === void 0) throw new Error("Non sei dentro al Auth Provider");
845
854
  return r;
846
- }, rt = ie(), Jt = ({ children: r, publicRoutes: i = [], privateRoutes: n = [] }) => /* @__PURE__ */ o.jsx(rt.Provider, { value: { publicRoutes: i, privateRoutes: n }, children: r }), kt = () => {
855
+ }, rt = ie(), qt = ({ children: r, publicRoutes: i = [], privateRoutes: n = [] }) => /* @__PURE__ */ o.jsx(rt.Provider, { value: { publicRoutes: i, privateRoutes: n }, children: r }), kt = () => {
847
856
  const r = se(rt);
848
857
  if (r === void 0)
849
858
  throw new Error(
@@ -858,41 +867,41 @@ Esempio:
858
867
  </RouteProvider>`
859
868
  );
860
869
  return r;
861
- }, ot = ie(), Vt = ({ children: r }) => {
862
- const { login: i } = ve(), { clearLoginFormOnError: n } = U(), s = {
870
+ }, ot = ie(), Jt = ({ children: r }) => {
871
+ const { login: i } = ve(), { clearLoginFormOnError: n } = J(), s = {
863
872
  email: "",
864
873
  password: ""
865
- }, [a, l] = w("Accedi"), [u, m] = w("Email"), [p, y] = w("email"), [v, R] = w("example@example.it"), [E, d] = w("Accedi"), [g, x] = w(s), [O, j] = w(), [S, P] = w(), [C, N] = w(), [B, te] = w(), [q, re] = w({}), z = {
866
- overrideStyle: q,
874
+ }, [a, l] = j("Accedi"), [u, p] = j("Email"), [d, v] = j("email"), [b, L] = j("example@example.it"), [C, y] = j("Accedi"), [P, N] = j(s), [m, w] = j(), [g, R] = j(), [x, S] = j(), [G, _] = j(), [F, re] = j({}), $ = {
875
+ overrideStyle: F,
867
876
  setOverrideStyle: re,
868
877
  title: a,
869
878
  setTitle: l,
870
879
  label: u,
871
- setLabel: m,
872
- type: p,
873
- setType: y,
874
- placeholder: v,
875
- setPlaceholder: R,
876
- buttonText: E,
877
- setButtonText: d,
878
- formData: g,
879
- setFormData: x,
880
- LogoImg: O,
881
- setLogoImg: j,
882
- styleCardForm: S,
883
- setStyleCardForm: P,
884
- styleContainerLogo: C,
885
- setStyleContainerLogo: N,
886
- styleLogo: B,
887
- setStyleLogo: te,
888
- changeData: (F, $) => {
889
- x((V) => ({ ...V, [F]: $ }));
880
+ setLabel: p,
881
+ type: d,
882
+ setType: v,
883
+ placeholder: b,
884
+ setPlaceholder: L,
885
+ buttonText: C,
886
+ setButtonText: y,
887
+ formData: P,
888
+ setFormData: N,
889
+ LogoImg: m,
890
+ setLogoImg: w,
891
+ styleCardForm: g,
892
+ setStyleCardForm: R,
893
+ styleContainerLogo: x,
894
+ setStyleContainerLogo: S,
895
+ styleLogo: G,
896
+ setStyleLogo: _,
897
+ changeData: (D, W) => {
898
+ N((X) => ({ ...X, [D]: W }));
890
899
  },
891
- handleLogin: (F) => {
892
- i(F, g), n && x(s);
900
+ handleLogin: (D) => {
901
+ i(D, P), n && N(s);
893
902
  }
894
903
  };
895
- return /* @__PURE__ */ o.jsx(ot.Provider, { value: z, children: r });
904
+ return /* @__PURE__ */ o.jsx(ot.Provider, { value: $, children: r });
896
905
  }, nt = () => {
897
906
  const r = se(ot);
898
907
  if (r === void 0) throw new Error("Non puoi modificare La login");
@@ -902,38 +911,38 @@ function it(r) {
902
911
  return ae({ 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: [] }] })(r);
903
912
  }
904
913
  const Lt = () => {
905
- const { loadingProps: r } = me(), { spinner: i = !0, spinnerStyle: n, text: s, textStyle: a, children: l, containerStyle: u, overrideStyle: m = {} } = r;
906
- return /* @__PURE__ */ o.jsxs("div", { className: m.container || `fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-loading-bg z-[999] ${u}`, children: [
907
- i && /* @__PURE__ */ o.jsx(it, { className: m.spinner || `text-[20rem] relative animate-spin text-spinner ${n}` }),
908
- l || /* @__PURE__ */ o.jsx("p", { className: m.text || `text-white text-2xl select-none absolute ${a}`, children: s || "Loading..." })
914
+ const { loadingProps: r } = me(), { spinner: i = !0, spinnerStyle: n, text: s, textStyle: a, children: l, containerStyle: u, overrideStyle: p = {} } = r;
915
+ return /* @__PURE__ */ o.jsxs("div", { className: p.container || `fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-loading-bg z-[999] ${u}`, children: [
916
+ i && /* @__PURE__ */ o.jsx(it, { className: p.spinner || `text-[20rem] relative animate-spin text-spinner ${n}` }),
917
+ l || /* @__PURE__ */ o.jsx("p", { className: p.text || `text-white text-2xl select-none absolute ${a}`, children: s || "Loading..." })
909
918
  ] });
910
919
  };
911
920
  function Pt(r) {
912
921
  return ae({ 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: [] }] })(r);
913
922
  }
914
923
  const Ue = () => {
915
- const { messageAlert: r, typeAlert: i, alertConfig: n, getIcon: s, closeAlert: a } = ee(), { alertTimeout: l } = U(), [u, m] = w(0), { bgColor: p, textColor: y, buttonBg: v, hoverBg: R, focusRing: E, progressColor: d } = n[i];
916
- return M(() => {
917
- let g;
918
- const O = 100 / (l / 100);
919
- g = setInterval(() => {
920
- m((S) => S >= 100 ? (clearInterval(g), 100) : S + O);
924
+ const { messageAlert: r, typeAlert: i, alertConfig: n, getIcon: s, closeAlert: a } = te(), { alertTimeout: l } = J(), [u, p] = j(0), { bgColor: d, textColor: v, buttonBg: b, hoverBg: L, focusRing: C, progressColor: y } = n[i];
925
+ return B(() => {
926
+ let P;
927
+ const m = 100 / (l / 100);
928
+ P = setInterval(() => {
929
+ p((g) => g >= 100 ? (clearInterval(P), 100) : g + m);
921
930
  }, 100);
922
- const j = setTimeout(() => {
931
+ const w = setTimeout(() => {
923
932
  a();
924
933
  }, l);
925
934
  return () => {
926
- clearTimeout(j), clearInterval(g);
935
+ clearTimeout(w), clearInterval(P);
927
936
  };
928
- }, []), /* @__PURE__ */ o.jsxs("div", { className: `flex items-center p-4 pt-6 ${y} rounded-lg ${p} 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: [
929
- /* @__PURE__ */ o.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__ */ o.jsx("div", { className: `${d} h-2.5 rounded-t-lg`, style: { width: `${u}%` } }) }),
937
+ }, []), /* @__PURE__ */ o.jsxs("div", { className: `flex items-center p-4 pt-6 ${v} 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: [
938
+ /* @__PURE__ */ o.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__ */ o.jsx("div", { className: `${y} h-2.5 rounded-t-lg`, style: { width: `${u}%` } }) }),
930
939
  s(i),
931
940
  /* @__PURE__ */ o.jsx("div", { className: "px-4 text-sm font-medium", children: r }),
932
941
  /* @__PURE__ */ o.jsx(
933
942
  "button",
934
943
  {
935
944
  type: "button",
936
- className: `ms-auto ${v} rounded-lg focus:ring-2 ${E} p-1.5 ${R} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,
945
+ className: `ms-auto ${b} rounded-lg focus:ring-2 ${C} p-1.5 ${L} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,
937
946
  title: "Close",
938
947
  onClick: a,
939
948
  children: /* @__PURE__ */ o.jsx(Pt, { className: "text-xl" })
@@ -941,28 +950,28 @@ const Ue = () => {
941
950
  )
942
951
  ] });
943
952
  }, Rt = (r) => {
944
- const { isLoading: i } = me(), { showAlert: n } = ee(), s = Le(), {
953
+ const { isLoading: i } = me(), { showAlert: n } = te(), s = Le(), {
945
954
  isMain: a = !0,
946
955
  headerComponent: l = null,
947
956
  showHeaderOnLogin: u = !1,
948
- headerExcludedRoutes: m = [],
949
- footerComponent: p = null,
950
- showFooterOnLogin: y = !1,
951
- footerExcludedRoutes: v = []
952
- } = r, R = m.some((x) => $e(x, s.pathname));
953
- let E;
954
- s.pathname === "/" ? E = l && u : E = l && !R;
955
- const d = v.some((x) => $e(x, s.pathname));
956
- let g;
957
- return s.pathname === "/" ? g = p && y : g = p && !d, /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
957
+ headerExcludedRoutes: p = [],
958
+ footerComponent: d = null,
959
+ showFooterOnLogin: v = !1,
960
+ footerExcludedRoutes: b = []
961
+ } = r, L = p.some((N) => $e(N, s.pathname));
962
+ let C;
963
+ s.pathname === "/" ? C = l && u : C = l && !L;
964
+ const y = b.some((N) => $e(N, s.pathname));
965
+ let P;
966
+ return s.pathname === "/" ? P = d && v : P = d && !y, /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
958
967
  i && /* @__PURE__ */ o.jsx(Lt, {}),
959
968
  n && /* @__PURE__ */ o.jsx(Ue, {}),
960
- E && l,
969
+ C && l,
961
970
  a ? /* @__PURE__ */ o.jsxs("main", { className: i ? "hidden" : "", children: [
962
971
  n && /* @__PURE__ */ o.jsx(Ue, {}),
963
972
  /* @__PURE__ */ o.jsx(je, {})
964
973
  ] }) : /* @__PURE__ */ o.jsx(je, {}),
965
- g && p
974
+ P && d
966
975
  ] });
967
976
  }, Se = (r) => {
968
977
  const {
@@ -972,30 +981,30 @@ const Ue = () => {
972
981
  inputRequired: a,
973
982
  inputValue: l,
974
983
  inputChange: u,
975
- autoFocus: m,
976
- inputStyle: p,
977
- overrideStyle: y,
978
- disabled: v
979
- } = r, E = ["text", "email", "password", "search", "tel", "url"].includes(i) ? i : "text";
984
+ autoFocus: p,
985
+ inputStyle: d,
986
+ overrideStyle: v,
987
+ disabled: b
988
+ } = r, C = ["text", "email", "password", "search", "tel", "url"].includes(i) ? i : "text";
980
989
  return /* @__PURE__ */ o.jsx(
981
990
  "input",
982
991
  {
983
- type: E,
984
- autoFocus: m,
992
+ type: C,
993
+ autoFocus: p,
985
994
  id: n,
986
- 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 ${p}`,
995
+ className: v || `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}`,
987
996
  placeholder: s,
988
997
  required: a ?? !0,
989
998
  value: l,
990
999
  onChange: u,
991
- disabled: v
1000
+ disabled: b
992
1001
  }
993
1002
  );
994
1003
  }, Oe = ({ label: r, labelId: i, labelStyle: n, overrideStyle: s }) => /* @__PURE__ */ o.jsx("label", { htmlFor: i, className: s || `show-label mb-2 text-input-label font-medium text-color-label ${n}`, children: r }), Nt = () => {
995
- const { title: r, label: i, type: n, placeholder: s, buttonText: a, formData: l, changeData: u, handleLogin: m, overrideStyle: p } = nt();
996
- return /* @__PURE__ */ o.jsxs("form", { onSubmit: m, className: p.form || "form-size", children: [
997
- /* @__PURE__ */ o.jsx("h1", { className: p.title || "text-form-title-size show-title title-position m-form-title", children: r }),
998
- /* @__PURE__ */ o.jsxs("div", { className: p.containerEmail || "flex justify-center flex-col gap-1 m-input-form input-size mx-auto", children: [
1004
+ const { title: r, label: i, type: n, placeholder: s, buttonText: a, formData: l, changeData: u, handleLogin: p, overrideStyle: d } = nt();
1005
+ return /* @__PURE__ */ o.jsxs("form", { onSubmit: p, className: d.form || "form-size", children: [
1006
+ /* @__PURE__ */ o.jsx("h1", { className: d.title || "text-form-title-size show-title title-position m-form-title", children: r }),
1007
+ /* @__PURE__ */ o.jsxs("div", { className: d.containerEmail || "flex justify-center flex-col gap-1 m-input-form input-size mx-auto", children: [
999
1008
  /* @__PURE__ */ o.jsx(Oe, { labelId: "user-email", label: i }),
1000
1009
  /* @__PURE__ */ o.jsx(
1001
1010
  Se,
@@ -1004,14 +1013,14 @@ const Ue = () => {
1004
1013
  inputId: "user-email",
1005
1014
  inputPlaceholder: s,
1006
1015
  inputValue: l.email,
1007
- inputChange: (y) => {
1008
- u("email", y.target.value);
1016
+ inputChange: (v) => {
1017
+ u("email", v.target.value);
1009
1018
  },
1010
1019
  autoFocus: !0
1011
1020
  }
1012
1021
  )
1013
1022
  ] }),
1014
- /* @__PURE__ */ o.jsxs("div", { className: p.containerPassword || "flex justify-center flex-col gap-1 my-4 input-size mx-auto", children: [
1023
+ /* @__PURE__ */ o.jsxs("div", { className: d.containerPassword || "flex justify-center flex-col gap-1 my-4 input-size mx-auto", children: [
1015
1024
  /* @__PURE__ */ o.jsx(Oe, { labelId: "password", label: "Password" }),
1016
1025
  /* @__PURE__ */ o.jsx(
1017
1026
  Se,
@@ -1020,71 +1029,71 @@ const Ue = () => {
1020
1029
  inputId: "password",
1021
1030
  inputPlaceholder: "Password",
1022
1031
  inputValue: l.password,
1023
- inputChange: (y) => {
1024
- u("password", y.target.value);
1032
+ inputChange: (v) => {
1033
+ u("password", v.target.value);
1025
1034
  }
1026
1035
  }
1027
1036
  )
1028
1037
  ] }),
1029
- /* @__PURE__ */ o.jsx("div", { className: p.containerButton || "flex button-position items-center m-primary-button", children: /* @__PURE__ */ o.jsx("button", { className: p.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: a }) })
1038
+ /* @__PURE__ */ o.jsx("div", { className: d.containerButton || "flex button-position items-center m-primary-button", children: /* @__PURE__ */ o.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: a }) })
1030
1039
  ] });
1031
- }, Gt = "0.0.97", Tt = ({ Logo: r }) => {
1032
- const { styleCardForm: i, styleContainerLogo: n, styleLogo: s, overrideStyle: a } = nt(), { firstPrivatePath: l } = U(), u = ke();
1033
- return M(() => {
1034
- const m = JSON.parse(localStorage.getItem("user"));
1035
- localStorage.getItem("accessToken") && m.id && u(`${l}${m.id}`);
1040
+ }, Gt = ({ Logo: r }) => {
1041
+ const { styleCardForm: i, styleContainerLogo: n, styleLogo: s, overrideStyle: a } = nt(), { firstPrivatePath: l, version: u } = J(), p = ke();
1042
+ return B(() => {
1043
+ const d = JSON.parse(localStorage.getItem("user"));
1044
+ localStorage.getItem("accessToken") && d.id && p(`${l}${d.id}`);
1036
1045
  }, []), /* @__PURE__ */ o.jsxs("section", { id: "login-page", children: [
1037
- /* @__PURE__ */ o.jsx("div", { className: "text-md text-primary absolute top-4 left-4", children: Gt }),
1046
+ u && /* @__PURE__ */ o.jsx("div", { className: "text-md text-primary absolute top-4 left-4", children: u }),
1038
1047
  /* @__PURE__ */ o.jsx("div", { className: a.container || "container mx-auto flex items-center justify-center h-screen", children: /* @__PURE__ */ o.jsxs("div", { className: a.cardForm || `bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${i}`, children: [
1039
1048
  /* @__PURE__ */ o.jsx("div", { className: a.containerLogo || `basis-1/2 flex items-center justify-center ${n}`, children: r && /* @__PURE__ */ o.jsx(r, { className: a.logo || `login-logo h-full sm:h-auto ${s}` }) }),
1040
1049
  /* @__PURE__ */ o.jsx(Nt, {})
1041
1050
  ] }) })
1042
1051
  ] });
1043
- }, _t = () => {
1044
- const { isAuthenticated: r } = ve(), { activeAlert: i } = ee(), { autoLogin: n } = U();
1045
- return M(() => {
1052
+ }, Tt = () => {
1053
+ const { isAuthenticated: r } = ve(), { activeAlert: i } = te(), { autoLogin: n } = J();
1054
+ return B(() => {
1046
1055
  const s = localStorage.getItem("accessToken");
1047
1056
  !r && !s && !n && i("danger", "Non sei autorizzato");
1048
1057
  }, []), r === null ? null : r ? /* @__PURE__ */ o.jsx(je, {}) : /* @__PURE__ */ o.jsx(Je, { to: "/", replace: !0 });
1049
- }, It = () => {
1050
- const { logout: r, setCurrentToken: i, createAxiosInstances: n } = ve(), { usersEndpoint: s } = U(), { setIsLoading: a } = me(), { activeAlert: l } = ee(), [u, m] = w(null), [p, y] = w(!1), v = JSON.parse(localStorage.getItem("user")), R = async () => {
1058
+ }, _t = () => {
1059
+ const { logout: r, setCurrentToken: i, createAxiosInstances: n } = ve(), { usersEndpoint: s } = J(), { setIsLoading: a } = me(), { activeAlert: l } = te(), [u, p] = j(null), [d, v] = j(!1), b = JSON.parse(localStorage.getItem("user")), L = async () => {
1051
1060
  try {
1052
- y(!0);
1053
- const d = localStorage.getItem("accessToken");
1054
- if (!d) {
1061
+ v(!0);
1062
+ const y = localStorage.getItem("accessToken");
1063
+ if (!y) {
1055
1064
  r(), l("danger", "Sessione Scaduta");
1056
1065
  return;
1057
1066
  }
1058
- const O = (await (await n()).get(
1067
+ const m = (await (await n()).get(
1059
1068
  `${s}`,
1060
1069
  {
1061
1070
  headers: {
1062
- Authorization: `Bearer ${d}`
1071
+ Authorization: `Bearer ${y}`
1063
1072
  }
1064
1073
  }
1065
1074
  )).data;
1066
- m(O);
1067
- } catch (d) {
1068
- console.error(d), a(!1);
1075
+ p(m);
1076
+ } catch (y) {
1077
+ console.error(y), a(!1);
1069
1078
  } finally {
1070
- y(!1);
1079
+ v(!1);
1071
1080
  }
1072
- }, E = () => {
1081
+ }, C = () => {
1073
1082
  r(), l("info", "Hai effettuato il logout");
1074
1083
  };
1075
- return M(() => {
1076
- const d = localStorage.getItem("accessToken");
1077
- d && i(d);
1084
+ return B(() => {
1085
+ const y = localStorage.getItem("accessToken");
1086
+ y && i(y);
1078
1087
  }, []), /* @__PURE__ */ o.jsx("section", { children: /* @__PURE__ */ o.jsxs("div", { className: "container mx-auto py-8", children: [
1079
1088
  /* @__PURE__ */ o.jsxs("div", { className: "flex items-center justify-center gap-8 h-20", children: [
1080
1089
  /* @__PURE__ */ o.jsxs("h1", { className: "text-4xl text-center text-slate-800", children: [
1081
1090
  "Email: ",
1082
- v.email
1091
+ b.email
1083
1092
  ] }),
1084
1093
  /* @__PURE__ */ o.jsx(
1085
1094
  "button",
1086
1095
  {
1087
- onClick: E,
1096
+ onClick: C,
1088
1097
  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]",
1089
1098
  children: "Logout"
1090
1099
  }
@@ -1093,19 +1102,19 @@ const Ue = () => {
1093
1102
  /* @__PURE__ */ o.jsx("div", { className: "flex justify-center items-center my-12 gap-8", children: /* @__PURE__ */ o.jsx(
1094
1103
  "button",
1095
1104
  {
1096
- onClick: R,
1105
+ onClick: L,
1097
1106
  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)]",
1098
- disabled: p,
1107
+ disabled: d,
1099
1108
  children: "Lista degli utenti"
1100
1109
  }
1101
1110
  ) }),
1102
- /* @__PURE__ */ o.jsx("div", { className: "flex justify-center items-center", children: u && /* @__PURE__ */ o.jsx("ul", { children: u.map((d) => /* @__PURE__ */ o.jsxs("li", { className: "text-xl my-4", children: [
1103
- d.id,
1111
+ /* @__PURE__ */ o.jsx("div", { className: "flex justify-center items-center", children: u && /* @__PURE__ */ o.jsx("ul", { children: u.map((y) => /* @__PURE__ */ o.jsxs("li", { className: "text-xl my-4", children: [
1112
+ y.id,
1104
1113
  " - ",
1105
- d.email
1106
- ] }, `user-${d.id}`)) }) })
1114
+ y.email
1115
+ ] }, `user-${y.id}`)) }) })
1107
1116
  ] }) });
1108
- }, At = (r) => /* @__PURE__ */ t.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", ...r }, /* @__PURE__ */ t.createElement("defs", { id: "defs1" }, /* @__PURE__ */ t.createElement("linearGradient", { id: "linearGradient27" }, /* @__PURE__ */ t.createElement("stop", { style: {
1117
+ }, It = (r) => /* @__PURE__ */ t.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", ...r }, /* @__PURE__ */ t.createElement("defs", { id: "defs1" }, /* @__PURE__ */ t.createElement("linearGradient", { id: "linearGradient27" }, /* @__PURE__ */ t.createElement("stop", { style: {
1109
1118
  stopColor: "#ff0000",
1110
1119
  stopOpacity: 1
1111
1120
  }, offset: 0, id: "stop27" }), /* @__PURE__ */ t.createElement("stop", { style: {
@@ -1151,55 +1160,55 @@ const Ue = () => {
1151
1160
  strokeWidth: 0,
1152
1161
  strokeOpacity: 1,
1153
1162
  paintOrder: "stroke markers fill"
1154
- }, d: "", id: "path40", transform: "scale(0.26458333)" }))), Xt = (r) => {
1155
- const { publicRoutes: i, privateRoutes: n } = kt(), { firstPrivatePath: s } = U(), {
1156
- logoImg: a = At,
1163
+ }, d: "", id: "path40", transform: "scale(0.26458333)" }))), Vt = (r) => {
1164
+ const { publicRoutes: i, privateRoutes: n } = kt(), { firstPrivatePath: s } = J(), {
1165
+ logoImg: a = It,
1157
1166
  pathImg: l = "./src/assets/MyWarehouse.svg",
1158
- firstPrivateElement: u = /* @__PURE__ */ o.jsx(It, {}),
1159
- globalLayout: m,
1160
- isMain: p,
1161
- headerComponent: y,
1162
- showHeaderOnLogin: v,
1163
- headerExcludedRoutes: R,
1164
- footerComponent: E,
1165
- showFooterOnLogin: d,
1166
- footerExcludedRoutes: g,
1167
- privateProvider: x,
1168
- customProvider: O
1169
- } = r, j = m || /* @__PURE__ */ o.jsx(
1167
+ firstPrivateElement: u = /* @__PURE__ */ o.jsx(_t, {}),
1168
+ globalLayout: p,
1169
+ isMain: d,
1170
+ headerComponent: v,
1171
+ showHeaderOnLogin: b,
1172
+ headerExcludedRoutes: L,
1173
+ footerComponent: C,
1174
+ showFooterOnLogin: y,
1175
+ footerExcludedRoutes: P,
1176
+ privateProvider: N,
1177
+ customProvider: m
1178
+ } = r, w = p || /* @__PURE__ */ o.jsx(
1170
1179
  Rt,
1171
1180
  {
1172
- isMain: p,
1173
- headerComponent: y,
1174
- showHeaderOnLogin: v,
1175
- headerExcludedRoutes: R,
1176
- footerComponent: E,
1177
- showFooterOnLogin: d,
1178
- footerExcludedRoutes: g
1181
+ isMain: d,
1182
+ headerComponent: v,
1183
+ showHeaderOnLogin: b,
1184
+ headerExcludedRoutes: L,
1185
+ footerComponent: C,
1186
+ showFooterOnLogin: y,
1187
+ footerExcludedRoutes: P
1179
1188
  }
1180
- ), S = x ? H.cloneElement(x, {}, O) : /* @__PURE__ */ o.jsx(_t, { children: O }), P = () => {
1181
- const C = document.querySelector("link[rel='icon']");
1182
- l && (C.href = l);
1189
+ ), g = N ? Z.cloneElement(N, {}, m) : /* @__PURE__ */ o.jsx(Tt, { children: m }), R = () => {
1190
+ const x = document.querySelector("link[rel='icon']");
1191
+ l && (x.href = l);
1183
1192
  };
1184
- return M(() => {
1185
- P();
1186
- }, []), /* @__PURE__ */ o.jsx(lt, { children: /* @__PURE__ */ o.jsxs(Q, { element: m === "none" ? null : j, children: [
1187
- /* @__PURE__ */ o.jsxs(Q, { path: "/", children: [
1188
- /* @__PURE__ */ o.jsx(Q, { index: !0, element: /* @__PURE__ */ o.jsx(Tt, { Logo: a }) }),
1189
- i.map((C, N) => /* @__PURE__ */ o.jsx(Q, { path: C.path, element: C.element }, `public-${N}`))
1193
+ return B(() => {
1194
+ R();
1195
+ }, []), /* @__PURE__ */ o.jsx(lt, { children: /* @__PURE__ */ o.jsxs(ee, { element: p === "none" ? null : w, children: [
1196
+ /* @__PURE__ */ o.jsxs(ee, { path: "/", children: [
1197
+ /* @__PURE__ */ o.jsx(ee, { index: !0, element: /* @__PURE__ */ o.jsx(Gt, { Logo: a }) }),
1198
+ i.map((x, S) => /* @__PURE__ */ o.jsx(ee, { path: x.path, element: x.element }, `public-${S}`))
1190
1199
  ] }),
1191
- /* @__PURE__ */ o.jsxs(Q, { element: S, children: [
1192
- /* @__PURE__ */ o.jsx(Q, { path: `${s ?? "/dashboard/"}:id`, element: u }),
1193
- n.map((C, N) => /* @__PURE__ */ o.jsx(Q, { path: C.path, element: C.element }, `private-${N}`))
1200
+ /* @__PURE__ */ o.jsxs(ee, { element: g, children: [
1201
+ /* @__PURE__ */ o.jsx(ee, { path: `${s ?? "/dashboard/"}:id`, element: u }),
1202
+ n.map((x, S) => /* @__PURE__ */ o.jsx(ee, { path: x.path, element: x.element }, `private-${S}`))
1194
1203
  ] })
1195
1204
  ] }) });
1196
- }, Kt = ({ children: r }) => {
1205
+ }, Xt = ({ children: r }) => {
1197
1206
  var a;
1198
- const i = Le(), { activeAlert: n } = ee(), s = JSON.parse(localStorage.getItem("user"));
1199
- return M(() => {
1207
+ const i = Le(), { activeAlert: n } = te(), s = JSON.parse(localStorage.getItem("user"));
1208
+ return B(() => {
1200
1209
  (!s || !s.admin) && n("warning", "Non puoi accedere a questa pagina");
1201
1210
  }, [s]), !s || !s.admin ? /* @__PURE__ */ o.jsx(Je, { to: ((a = i.state) == null ? void 0 : a.from) || "/", replace: !0 }) : r;
1202
- }, Qt = ({ spinner: r = !0, spinnerStyle: i, text: n, textStyle: s, children: a, containerStyle: l, overrideStyle: u = {} }) => /* @__PURE__ */ o.jsxs("div", { className: u.container || `w-full h-full relative flex items-center justify-center ${l}`, children: [
1211
+ }, Kt = ({ spinner: r = !0, spinnerStyle: i, text: n, textStyle: s, children: a, containerStyle: l, overrideStyle: u = {} }) => /* @__PURE__ */ o.jsxs("div", { className: u.container || `w-full h-full relative flex items-center justify-center ${l}`, children: [
1203
1212
  r && /* @__PURE__ */ o.jsx(it, { className: u.spinner || `text-[20rem] animate-spin text-black ${i}` }),
1204
1213
  a || /* @__PURE__ */ o.jsx("p", { className: u.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..." })
1205
1214
  ] }), qe = ({ isTag: r = !1, value: i, label: n, placeholder: s, id: a, onChange: l, error: u = null }) => /* @__PURE__ */ o.jsxs("div", { className: `flex items-center justify-center relative ${r ? "gap-4 mb-2" : "gap-1 m-4"}`, children: [
@@ -1217,7 +1226,7 @@ const Ue = () => {
1217
1226
  }
1218
1227
  ),
1219
1228
  u && /* @__PURE__ */ o.jsx("p", { className: "text-red-600 text-[13px] absolute bottom-0 left-26 translate-y-[20px]", children: u })
1220
- ] }), e0 = ({ title: r, showTag: i, value: n, tag: s, showButton: a, handleClick: l }) => /* @__PURE__ */ o.jsxs("div", { className: `border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${r === "TAG B" ? "delay-200" : "mb-4"} ${i ? "opacity-100 translate-y-0" : "opacity-0 translate-y-10"}`, children: [
1229
+ ] }), Qt = ({ title: r, showTag: i, value: n, tag: s, showButton: a, handleClick: l }) => /* @__PURE__ */ o.jsxs("div", { className: `border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${r === "TAG B" ? "delay-200" : "mb-4"} ${i ? "opacity-100 translate-y-0" : "opacity-0 translate-y-10"}`, children: [
1221
1230
  /* @__PURE__ */ o.jsx("h2", { className: "text-center mb-2 text-2xl", children: r }),
1222
1231
  /* @__PURE__ */ o.jsx(
1223
1232
  qe,
@@ -1249,11 +1258,11 @@ const Ue = () => {
1249
1258
  }
1250
1259
  ) })
1251
1260
  ] });
1252
- function Mt(r) {
1261
+ function At(r) {
1253
1262
  return ae({ tag: "svg", attr: { viewBox: "0 0 16 16", fill: "currentColor" }, child: [{ tag: "path", attr: { fillRule: "evenodd", clipRule: "evenodd", d: "M11.04 1.33L12.71 3l.29.71v.33h-.5l-.5.5v-.83l-1.67-1.67H10v4H4v-4H2v10h3l-.5 1H2l-1-1v-10l1-1h8.33l.71.29zM7 5h2V2H7v3zm6.5 0L15 6.5l-.02.69-5.5 5.5-.13.12-.37.37-.1.09-3 1.5-.67-.67 1.5-3 .09-.1.37-.37.12-.13 5.5-5.5h.71zm-6.22 7.24l-.52 1 1.04-.48-.52-.52zm.69-1.03l.79.79 5.15-5.15-.79-.79-5.15 5.15z" }, child: [] }] })(r);
1254
1263
  }
1255
- const t0 = ({ minReadingPower: r, maxReadingPower: i, stepRangePower: n, rangeValue: s, setRangeValue: a, show: l, handleClick: u }) => {
1256
- const m = (s - r) / (i - r) * 100;
1264
+ const e0 = ({ minReadingPower: r, maxReadingPower: i, stepRangePower: n, rangeValue: s, setRangeValue: a, show: l, handleClick: u }) => {
1265
+ const p = (s - r) / (i - r) * 100;
1257
1266
  return /* @__PURE__ */ o.jsxs("div", { className: `border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${l ? "opacity-100 translate-y-0" : "opacity-0 translate-y-10"}`, children: [
1258
1267
  /* @__PURE__ */ o.jsx("h2", { className: "text-center my-4 text-2xl", children: "Configurazione Potenza" }),
1259
1268
  /* @__PURE__ */ o.jsxs("div", { className: "relative my-12 w-[90%] mx-auto", children: [
@@ -1266,7 +1275,7 @@ const t0 = ({ minReadingPower: r, maxReadingPower: i, stepRangePower: n, rangeVa
1266
1275
  max: i,
1267
1276
  step: n,
1268
1277
  value: s,
1269
- onChange: (p) => a(Number(p.target.value)),
1278
+ onChange: (d) => a(Number(d.target.value)),
1270
1279
  className: "w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-primary-accent"
1271
1280
  }
1272
1281
  ),
@@ -1274,7 +1283,7 @@ const t0 = ({ minReadingPower: r, maxReadingPower: i, stepRangePower: n, rangeVa
1274
1283
  "div",
1275
1284
  {
1276
1285
  className: "absolute bottom-8 transform -translate-x-1/2 bg-white border border-gray-200 text-sm text-gray-800 py-1 px-2 rounded-lg shadow-md transition-opacity",
1277
- style: { left: `${m}%` },
1286
+ style: { left: `${p}%` },
1278
1287
  children: s
1279
1288
  }
1280
1289
  )
@@ -1286,12 +1295,12 @@ const t0 = ({ minReadingPower: r, maxReadingPower: i, stepRangePower: n, rangeVa
1286
1295
  className: "py-2 px-4 flex items-center justify-center gap-1 bg-save-button text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",
1287
1296
  children: [
1288
1297
  "Salva",
1289
- /* @__PURE__ */ o.jsx(Mt, {})
1298
+ /* @__PURE__ */ o.jsx(At, {})
1290
1299
  ]
1291
1300
  }
1292
1301
  ) })
1293
1302
  ] });
1294
- }, r0 = ({ show: r, isConfigPage: i, handleSelectFile: n }) => /* @__PURE__ */ o.jsxs("div", { className: `${i ? `${r ? "opacity-100 translate-y-0 delay-200" : "opacity-0 translate-y-10"}` : ""} p-4 text-center transition-all duration-700 transform`, children: [
1303
+ }, t0 = ({ show: r, isConfigPage: i, handleSelectFile: n }) => /* @__PURE__ */ o.jsxs("div", { className: `${i ? `${r ? "opacity-100 translate-y-0 delay-200" : "opacity-0 translate-y-10"}` : ""} p-4 text-center transition-all duration-700 transform`, children: [
1295
1304
  /* @__PURE__ */ o.jsxs("h2", { className: "text-xl my-4", children: [
1296
1305
  "Seleziona il file ",
1297
1306
  /* @__PURE__ */ o.jsx("strong", { children: "config.json" }),
@@ -1299,13 +1308,13 @@ const t0 = ({ minReadingPower: r, maxReadingPower: i, stepRangePower: n, rangeVa
1299
1308
  ] }),
1300
1309
  /* @__PURE__ */ o.jsx("button", { onClick: n, className: "my-4 bg-blue-500 text-white px-4 py-2 rounded-lg", children: "Seleziona file" })
1301
1310
  ] });
1302
- function zt(r) {
1311
+ function Mt(r) {
1303
1312
  return ae({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M312 372c-7.7 0-14 6.3-14 14 0 9.9-8.1 18-18 18H94c-9.9 0-18-8.1-18-18V126c0-9.9 8.1-18 18-18h186c9.9 0 18 8.1 18 18 0 7.7 6.3 14 14 14s14-6.3 14-14c0-25.4-20.6-46-46-46H94c-25.4 0-46 20.6-46 46v260c0 25.4 20.6 46 46 46h186c25.4 0 46-20.6 46-46 0-7.7-6.3-14-14-14z" }, child: [] }, { tag: "path", attr: { d: "M372.9 158.1c-2.6-2.6-6.1-4.1-9.9-4.1-3.7 0-7.3 1.4-9.9 4.1-5.5 5.5-5.5 14.3 0 19.8l65.2 64.2H162c-7.7 0-14 6.3-14 14s6.3 14 14 14h256.6L355 334.2c-5.4 5.4-5.4 14.3 0 19.8l.1.1c2.7 2.5 6.2 3.9 9.8 3.9 3.8 0 7.3-1.4 9.9-4.1l82.6-82.4c4.3-4.3 6.5-9.3 6.5-14.7 0-5.3-2.3-10.3-6.5-14.5l-84.5-84.2z" }, child: [] }] })(r);
1304
1313
  }
1305
- function Bt(r) {
1314
+ function zt(r) {
1306
1315
  return ae({ tag: "svg", attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 9.059v-2.559c0-.256-.098-.512-.293-.708-.195-.195-.451-.292-.707-.292s-.512.097-.707.292l-6.293 6.208 6.293 6.207c.195.195.451.293.707.293s.512-.098.707-.293.293-.452.293-.707v-2.489c2.75.068 5.755.566 8 3.989v-1c0-4.633-3.5-8.443-8-8.941z" }, child: [] }] })(r);
1307
1316
  }
1308
- const Ft = (r) => /* @__PURE__ */ t.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", ...r }, /* @__PURE__ */ t.createElement("defs", { id: "defs1" }, /* @__PURE__ */ t.createElement("linearGradient", { id: "linearGradient27" }, /* @__PURE__ */ t.createElement("stop", { style: {
1317
+ const Bt = (r) => /* @__PURE__ */ t.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", ...r }, /* @__PURE__ */ t.createElement("defs", { id: "defs1" }, /* @__PURE__ */ t.createElement("linearGradient", { id: "linearGradient27" }, /* @__PURE__ */ t.createElement("stop", { style: {
1309
1318
  stopColor: "#ff0000",
1310
1319
  stopOpacity: 1
1311
1320
  }, offset: 0, id: "stop27" }), /* @__PURE__ */ t.createElement("stop", { style: {
@@ -1370,30 +1379,30 @@ const Ft = (r) => /* @__PURE__ */ t.createElement("svg", { width: "108.41262mm",
1370
1379
  strokeWidth: 0,
1371
1380
  strokeOpacity: 1,
1372
1381
  paintOrder: "stroke markers fill"
1373
- }, d: "", id: "path40", transform: "scale(0.26458333)" }))), o0 = ({ Logo: r, logo: i }) => {
1374
- const { logout: n } = ve(), { activeAlert: s } = ee(), { autoLogin: a, configRoutes: l, firstPrivateTitle: u, showHeaderButton: m } = U(), { isLoading: p } = me(), y = Le(), v = ke(), R = () => {
1382
+ }, d: "", id: "path40", transform: "scale(0.26458333)" }))), r0 = ({ Logo: r, logo: i }) => {
1383
+ const { logout: n } = ve(), { activeAlert: s } = te(), { autoLogin: a, configRoutes: l, firstPrivateTitle: u, showHeaderButton: p } = J(), { isLoading: d } = me(), v = Le(), b = ke(), L = () => {
1375
1384
  n(), s("info", "Hai effettuato il logout");
1376
- }, E = l.find((g) => g.path === y.pathname), d = ct("home/:id");
1377
- return /* @__PURE__ */ o.jsx("header", { className: p ? "hidden" : "", children: /* @__PURE__ */ o.jsxs("nav", { className: "header-size flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300", children: [
1378
- /* @__PURE__ */ o.jsx("figure", { children: r && typeof r == "function" ? /* @__PURE__ */ o.jsx(r, { className: "header-logo-size" }) : i ? /* @__PURE__ */ o.jsx("img", { src: i, alt: "Logo", className: "header-logo-size" }) : /* @__PURE__ */ o.jsx(Ft, { className: "header-logo-size" }) }),
1379
- /* @__PURE__ */ o.jsx("div", { children: /* @__PURE__ */ o.jsx("p", { children: (E == null ? void 0 : E.title) || u }) }),
1385
+ }, C = l.find((P) => P.path === v.pathname), y = ct("home/:id");
1386
+ return /* @__PURE__ */ o.jsx("header", { className: d ? "hidden" : "", children: /* @__PURE__ */ o.jsxs("nav", { className: "header-size flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300", children: [
1387
+ /* @__PURE__ */ o.jsx("figure", { children: r && typeof r == "function" ? /* @__PURE__ */ o.jsx(r, { className: "header-logo-size" }) : i ? /* @__PURE__ */ o.jsx("img", { src: i, alt: "Logo", className: "header-logo-size" }) : /* @__PURE__ */ o.jsx(Bt, { className: "header-logo-size" }) }),
1388
+ /* @__PURE__ */ o.jsx("div", { children: /* @__PURE__ */ o.jsx("p", { children: (C == null ? void 0 : C.title) || u }) }),
1380
1389
  /* @__PURE__ */ o.jsxs("div", { children: [
1381
- !a && d && /* @__PURE__ */ o.jsx(
1390
+ !a && y && /* @__PURE__ */ o.jsx(
1382
1391
  "button",
1383
1392
  {
1384
1393
  className: "h-[48px] w-[48px] flex items-center justify-center bg-red-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",
1385
1394
  type: "button",
1386
- onClick: R,
1387
- children: /* @__PURE__ */ o.jsx(zt, { className: "text-4xl w-full" })
1395
+ onClick: L,
1396
+ children: /* @__PURE__ */ o.jsx(Mt, { className: "text-4xl w-full" })
1388
1397
  }
1389
1398
  ),
1390
- !d && m && /* @__PURE__ */ o.jsx(
1399
+ !y && p && /* @__PURE__ */ o.jsx(
1391
1400
  "button",
1392
1401
  {
1393
1402
  className: "h-[48px] w-[48px] flex items-center justify-center bg-sky-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",
1394
1403
  type: "button",
1395
- onClick: () => v(-1),
1396
- children: /* @__PURE__ */ o.jsx(Bt, { className: "text-4xl w-full" })
1404
+ onClick: () => b(-1),
1405
+ children: /* @__PURE__ */ o.jsx(zt, { className: "text-4xl w-full" })
1397
1406
  }
1398
1407
  )
1399
1408
  ] })
@@ -1401,44 +1410,44 @@ const Ft = (r) => /* @__PURE__ */ t.createElement("svg", { width: "108.41262mm",
1401
1410
  };
1402
1411
  export {
1403
1412
  Ue as Alert,
1404
- Ut as AlertProvider,
1405
- Kt as AuthAdmin,
1406
- _t as AuthPage,
1407
- qt as AuthProvider,
1408
- s0 as BrowserRouter,
1409
- t0 as CardInputRange,
1410
- e0 as CardInputTag,
1411
- r0 as ConfigFileReader,
1412
- Zt as ConfigProvider,
1413
- It as Dashboard,
1413
+ Zt as AlertProvider,
1414
+ Xt as AuthAdmin,
1415
+ Tt as AuthPage,
1416
+ Ut as AuthProvider,
1417
+ i0 as BrowserRouter,
1418
+ e0 as CardInputRange,
1419
+ Qt as CardInputTag,
1420
+ t0 as ConfigFileReader,
1421
+ Yt as ConfigProvider,
1422
+ _t as Dashboard,
1414
1423
  Rt as DefaultLayout,
1415
1424
  pt as ErrorPage,
1416
- o0 as Header,
1425
+ r0 as Header,
1417
1426
  Se as Input,
1418
1427
  qe as InputGroup,
1419
1428
  Oe as InputLabel,
1420
- a0 as Link,
1429
+ s0 as Link,
1421
1430
  Lt as Loading,
1422
- Qt as LoadingComponent,
1423
- Yt as LoadingProvider,
1424
- Tt as Login,
1431
+ Kt as LoadingComponent,
1432
+ Ht as LoadingProvider,
1433
+ Gt as Login,
1425
1434
  Nt as LoginForm,
1426
- Vt as LoginFormProvider,
1427
- l0 as NavLink,
1428
- c0 as Outlet,
1429
- Xt as PackageRoutes,
1430
- f0 as Route,
1431
- Jt as RouteProvider,
1432
- u0 as Routes,
1433
- g0 as axios,
1435
+ Jt as LoginFormProvider,
1436
+ a0 as NavLink,
1437
+ l0 as Outlet,
1438
+ Vt as PackageRoutes,
1439
+ c0 as Route,
1440
+ qt as RouteProvider,
1441
+ f0 as Routes,
1442
+ h0 as axios,
1434
1443
  Ot as fetchAxiosConfig,
1435
- ee as useAlert,
1444
+ te as useAlert,
1436
1445
  ve as useAuth,
1437
- U as useConfig,
1446
+ J as useConfig,
1438
1447
  me as useLoading,
1439
- d0 as useLocation,
1448
+ u0 as useLocation,
1440
1449
  nt as useLoginForm,
1441
- m0 as useMatch,
1442
- p0 as useNavigate,
1450
+ d0 as useMatch,
1451
+ m0 as useNavigate,
1443
1452
  kt as useRoutesInjection
1444
1453
  };