@tracktor/shared-module 2.1.9 → 2.2.0
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/CHANGELOG.md +2 -2
- package/dist/main.d.ts +1 -0
- package/dist/main.js +92 -88
- package/dist/main.umd.cjs +7 -7
- package/dist/utils/error/handleImportModuleError.d.ts +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/main.d.ts
CHANGED
|
@@ -30,3 +30,4 @@ export { default as getOrvalConfig } from './config/orval';
|
|
|
30
30
|
export * from './config/orval';
|
|
31
31
|
export { default as dateAdapter } from './utils/adapter/dateAdapter';
|
|
32
32
|
export { default as distanceAdapter } from './utils/adapter/distanceAdapter';
|
|
33
|
+
export { default as handleImportModuleError } from './utils/error/handleImportModuleError';
|
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Ne, { createContext as dt, useMemo as le, useContext as
|
|
1
|
+
import Ne, { createContext as dt, useMemo as le, useContext as D, useState as vt, useRef as gt, useEffect as Z, Suspense as mt, useCallback as ue } from "react";
|
|
2
2
|
var se = { exports: {} }, B = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -43,7 +43,7 @@ function ht() {
|
|
|
43
43
|
var r = j && e[j] || e[S];
|
|
44
44
|
return typeof r == "function" ? r : null;
|
|
45
45
|
}
|
|
46
|
-
var
|
|
46
|
+
var k = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
47
|
function _(e) {
|
|
48
48
|
{
|
|
49
49
|
for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), f = 1; f < r; f++)
|
|
@@ -53,7 +53,7 @@ function ht() {
|
|
|
53
53
|
}
|
|
54
54
|
function Y(e, r, o) {
|
|
55
55
|
{
|
|
56
|
-
var f =
|
|
56
|
+
var f = k.ReactDebugCurrentFrame, h = f.getStackAddendum();
|
|
57
57
|
h !== "" && (r += "%s", o = o.concat([h]));
|
|
58
58
|
var p = o.map(function(m) {
|
|
59
59
|
return String(m);
|
|
@@ -61,14 +61,14 @@ function ht() {
|
|
|
61
61
|
p.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, p);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
var N = !1, W = !1,
|
|
65
|
-
|
|
64
|
+
var N = !1, W = !1, b = !1, fe = !1, de = !1, z;
|
|
65
|
+
z = Symbol.for("react.module.reference");
|
|
66
66
|
function We(e) {
|
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e === c || e === l || de || e === a || e === y || e === E || fe || e === u || N || W ||
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === c || e === l || de || e === a || e === y || e === E || fe || e === u || N || W || b || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === w || e.$$typeof === v || e.$$typeof === d || e.$$typeof === s || // This needs to include all possible module reference object
|
|
68
68
|
// types supported by any Flight configuration anywhere since
|
|
69
69
|
// we don't know which Flight build this will end up being used
|
|
70
70
|
// with.
|
|
71
|
-
e.$$typeof ===
|
|
71
|
+
e.$$typeof === z || e.getModuleId !== void 0));
|
|
72
72
|
}
|
|
73
73
|
function Le(e, r, o) {
|
|
74
74
|
var f = e.displayName;
|
|
@@ -129,7 +129,7 @@ function ht() {
|
|
|
129
129
|
function we() {
|
|
130
130
|
}
|
|
131
131
|
we.__reactDisabledLog = !0;
|
|
132
|
-
function
|
|
132
|
+
function Me() {
|
|
133
133
|
{
|
|
134
134
|
if (U === 0) {
|
|
135
135
|
ge = console.log, me = console.info, ye = console.warn, he = console.error, Ee = console.group, pe = console.groupCollapsed, Re = console.groupEnd;
|
|
@@ -152,7 +152,7 @@ function ht() {
|
|
|
152
152
|
U++;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Ve() {
|
|
156
156
|
{
|
|
157
157
|
if (U--, U === 0) {
|
|
158
158
|
var e = {
|
|
@@ -187,7 +187,7 @@ function ht() {
|
|
|
187
187
|
U < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
var ee =
|
|
190
|
+
var ee = k.ReactCurrentDispatcher, te;
|
|
191
191
|
function Q(e, r, o) {
|
|
192
192
|
{
|
|
193
193
|
if (te === void 0)
|
|
@@ -203,8 +203,8 @@ function ht() {
|
|
|
203
203
|
}
|
|
204
204
|
var re = !1, J;
|
|
205
205
|
{
|
|
206
|
-
var
|
|
207
|
-
J = new
|
|
206
|
+
var ze = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
J = new ze();
|
|
208
208
|
}
|
|
209
209
|
function _e(e, r) {
|
|
210
210
|
if (!e || re)
|
|
@@ -219,7 +219,7 @@ function ht() {
|
|
|
219
219
|
var h = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
221
|
var p;
|
|
222
|
-
p = ee.current, ee.current = null,
|
|
222
|
+
p = ee.current, ee.current = null, Me();
|
|
223
223
|
try {
|
|
224
224
|
if (r) {
|
|
225
225
|
var m = function() {
|
|
@@ -256,25 +256,25 @@ function ht() {
|
|
|
256
256
|
if ($ && f && typeof $.stack == "string") {
|
|
257
257
|
for (var g = $.stack.split(`
|
|
258
258
|
`), T = f.stack.split(`
|
|
259
|
-
`),
|
|
259
|
+
`), C = g.length - 1, P = T.length - 1; C >= 1 && P >= 0 && g[C] !== T[P]; )
|
|
260
260
|
P--;
|
|
261
|
-
for (;
|
|
262
|
-
if (g[
|
|
263
|
-
if (
|
|
261
|
+
for (; C >= 1 && P >= 0; C--, P--)
|
|
262
|
+
if (g[C] !== T[P]) {
|
|
263
|
+
if (C !== 1 || P !== 1)
|
|
264
264
|
do
|
|
265
|
-
if (
|
|
265
|
+
if (C--, P--, P < 0 || g[C] !== T[P]) {
|
|
266
266
|
var O = `
|
|
267
|
-
` + g[
|
|
267
|
+
` + g[C].replace(" at new ", " at ");
|
|
268
268
|
return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && J.set(e, O), O;
|
|
269
269
|
}
|
|
270
|
-
while (
|
|
270
|
+
while (C >= 1 && P >= 0);
|
|
271
271
|
break;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
re = !1, ee.current = p,
|
|
275
|
+
re = !1, ee.current = p, Ve(), Error.prepareStackTrace = h;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
277
|
+
var V = e ? e.displayName || e.name : "", $e = V ? Q(V) : "";
|
|
278
278
|
return typeof e == "function" && J.set(e, $e), $e;
|
|
279
279
|
}
|
|
280
280
|
function Ue(e, r, o) {
|
|
@@ -313,13 +313,13 @@ function ht() {
|
|
|
313
313
|
}
|
|
314
314
|
return "";
|
|
315
315
|
}
|
|
316
|
-
var H = Object.prototype.hasOwnProperty,
|
|
316
|
+
var H = Object.prototype.hasOwnProperty, Ce = {}, be = k.ReactDebugCurrentFrame;
|
|
317
317
|
function K(e) {
|
|
318
318
|
if (e) {
|
|
319
319
|
var r = e._owner, o = X(e.type, e._source, r ? r.type : null);
|
|
320
|
-
|
|
320
|
+
be.setExtraStackFrame(o);
|
|
321
321
|
} else
|
|
322
|
-
|
|
322
|
+
be.setExtraStackFrame(null);
|
|
323
323
|
}
|
|
324
324
|
function Be(e, r, o, f, h) {
|
|
325
325
|
{
|
|
@@ -333,10 +333,10 @@ function ht() {
|
|
|
333
333
|
throw T.name = "Invariant Violation", T;
|
|
334
334
|
}
|
|
335
335
|
g = e[m](r, m, f, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
|
-
} catch (
|
|
337
|
-
g =
|
|
336
|
+
} catch (C) {
|
|
337
|
+
g = C;
|
|
338
338
|
}
|
|
339
|
-
g && !(g instanceof Error) && (K(h), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", f || "React class", o, m, typeof g), K(null)), g instanceof Error && !(g.message in
|
|
339
|
+
g && !(g instanceof Error) && (K(h), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", f || "React class", o, m, typeof g), K(null)), g instanceof Error && !(g.message in Ce) && (Ce[g.message] = !0, K(h), _("Failed %s type: %s", o, g.message), K(null));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
@@ -364,7 +364,7 @@ function ht() {
|
|
|
364
364
|
if (Je(e))
|
|
365
365
|
return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qe(e)), Pe(e);
|
|
366
366
|
}
|
|
367
|
-
var q =
|
|
367
|
+
var q = k.ReactCurrentOwner, Xe = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
@@ -451,9 +451,9 @@ function ht() {
|
|
|
451
451
|
for (p in r)
|
|
452
452
|
H.call(r, p) && !Xe.hasOwnProperty(p) && (m[p] = r[p]);
|
|
453
453
|
if (e && e.defaultProps) {
|
|
454
|
-
var
|
|
455
|
-
for (p in
|
|
456
|
-
m[p] === void 0 && (m[p] =
|
|
454
|
+
var C = e.defaultProps;
|
|
455
|
+
for (p in C)
|
|
456
|
+
m[p] === void 0 && (m[p] = C[p]);
|
|
457
457
|
}
|
|
458
458
|
if (g || T) {
|
|
459
459
|
var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
@@ -462,8 +462,8 @@ function ht() {
|
|
|
462
462
|
return rt(e, g, T, h, f, q.current, m);
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
|
-
var ie =
|
|
466
|
-
function
|
|
465
|
+
var ie = k.ReactCurrentOwner, Se = k.ReactDebugCurrentFrame;
|
|
466
|
+
function M(e) {
|
|
467
467
|
if (e) {
|
|
468
468
|
var r = e._owner, o = X(e.type, e._source, r ? r.type : null);
|
|
469
469
|
Se.setExtraStackFrame(o);
|
|
@@ -472,7 +472,7 @@ function ht() {
|
|
|
472
472
|
}
|
|
473
473
|
var ae;
|
|
474
474
|
ae = !1;
|
|
475
|
-
function
|
|
475
|
+
function ce(e) {
|
|
476
476
|
return typeof e == "object" && e !== null && e.$$typeof === n;
|
|
477
477
|
}
|
|
478
478
|
function Oe() {
|
|
@@ -503,7 +503,7 @@ Check the top-level render call using <` + o + ">.");
|
|
|
503
503
|
return r;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function ke(e, r) {
|
|
507
507
|
{
|
|
508
508
|
if (!e._store || e._store.validated || e.key != null)
|
|
509
509
|
return;
|
|
@@ -513,25 +513,25 @@ Check the top-level render call using <` + o + ">.");
|
|
|
513
513
|
return;
|
|
514
514
|
Ae[o] = !0;
|
|
515
515
|
var f = "";
|
|
516
|
-
e && e._owner && e._owner !== ie.current && (f = " It was passed a child from " + I(e._owner.type) + "."),
|
|
516
|
+
e && e._owner && e._owner !== ie.current && (f = " It was passed a child from " + I(e._owner.type) + "."), M(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, f), M(null);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function De(e, r) {
|
|
520
520
|
{
|
|
521
521
|
if (typeof e != "object")
|
|
522
522
|
return;
|
|
523
523
|
if (ne(e))
|
|
524
524
|
for (var o = 0; o < e.length; o++) {
|
|
525
525
|
var f = e[o];
|
|
526
|
-
|
|
526
|
+
ce(f) && ke(f, r);
|
|
527
527
|
}
|
|
528
|
-
else if (
|
|
528
|
+
else if (ce(e))
|
|
529
529
|
e._store && (e._store.validated = !0);
|
|
530
530
|
else if (e) {
|
|
531
531
|
var h = x(e);
|
|
532
532
|
if (typeof h == "function" && h !== e.entries)
|
|
533
533
|
for (var p = h.call(e), m; !(m = p.next()).done; )
|
|
534
|
-
|
|
534
|
+
ce(m.value) && ke(m.value, r);
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
537
|
}
|
|
@@ -560,16 +560,16 @@ Check the top-level render call using <` + o + ">.");
|
|
|
560
560
|
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function ct(e) {
|
|
564
564
|
{
|
|
565
565
|
for (var r = Object.keys(e.props), o = 0; o < r.length; o++) {
|
|
566
566
|
var f = r[o];
|
|
567
567
|
if (f !== "children" && f !== "key") {
|
|
568
|
-
|
|
568
|
+
M(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", f), M(null);
|
|
569
569
|
break;
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
e.ref !== null && (
|
|
572
|
+
e.ref !== null && (M(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), M(null));
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
function Ie(e, r, o, f, h, p) {
|
|
@@ -580,8 +580,8 @@ Check the top-level render call using <` + o + ">.");
|
|
|
580
580
|
(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.");
|
|
581
581
|
var T = ot();
|
|
582
582
|
T ? g += T : g += Oe();
|
|
583
|
-
var
|
|
584
|
-
e === null ?
|
|
583
|
+
var C;
|
|
584
|
+
e === null ? C = "null" : ne(e) ? C = "array" : e !== void 0 && e.$$typeof === n ? (C = "<" + (I(e.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : C = typeof e, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", C, g);
|
|
585
585
|
}
|
|
586
586
|
var P = nt(e, r, o, h, p);
|
|
587
587
|
if (P == null)
|
|
@@ -591,24 +591,24 @@ Check the top-level render call using <` + o + ">.");
|
|
|
591
591
|
if (O !== void 0)
|
|
592
592
|
if (f)
|
|
593
593
|
if (ne(O)) {
|
|
594
|
-
for (var
|
|
595
|
-
|
|
594
|
+
for (var V = 0; V < O.length; V++)
|
|
595
|
+
De(O[V], e);
|
|
596
596
|
Object.freeze && Object.freeze(O);
|
|
597
597
|
} else
|
|
598
598
|
_("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
599
599
|
else
|
|
600
|
-
|
|
600
|
+
De(O, e);
|
|
601
601
|
}
|
|
602
|
-
return e === c ?
|
|
602
|
+
return e === c ? ct(P) : at(P), P;
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function ut(e, r, o) {
|
|
606
606
|
return Ie(e, r, o, !0);
|
|
607
607
|
}
|
|
608
608
|
function st(e, r, o) {
|
|
609
609
|
return Ie(e, r, o, !1);
|
|
610
610
|
}
|
|
611
|
-
var lt = st, ft =
|
|
611
|
+
var lt = st, ft = ut;
|
|
612
612
|
G.Fragment = c, G.jsx = lt, G.jsxs = ft;
|
|
613
613
|
}()), G;
|
|
614
614
|
}
|
|
@@ -632,21 +632,21 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
632
632
|
...l
|
|
633
633
|
}) => {
|
|
634
634
|
var _, Y, N, W;
|
|
635
|
-
const { libraries: v } =
|
|
635
|
+
const { libraries: v } = D(A), d = (l == null ? void 0 : l.reactRouter) || (v == null ? void 0 : v.reactRouter), s = (l == null ? void 0 : l.axios) || (v == null ? void 0 : v.axios);
|
|
636
636
|
if (!d)
|
|
637
637
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
638
|
-
const [y, E] = vt(null), { useLocation: w, Navigate: R, Outlet: u } = d, j = w(), S = gt(!1), x = typeof n == "function" ? n() : !!n,
|
|
638
|
+
const [y, E] = vt(null), { useLocation: w, Navigate: R, Outlet: u } = d, j = w(), S = gt(!1), x = typeof n == "function" ? n() : !!n, k = typeof x == "boolean" ? x : x == null ? void 0 : x.isLogged;
|
|
639
639
|
return Z(() => {
|
|
640
640
|
S.current || (S.current = !0, s.interceptors.response.use(
|
|
641
|
-
(
|
|
642
|
-
async (
|
|
643
|
-
var
|
|
644
|
-
return typeof
|
|
641
|
+
(b) => b,
|
|
642
|
+
async (b) => {
|
|
643
|
+
var z;
|
|
644
|
+
return typeof b == "object" && b && "response" in b && b.response && typeof b.response == "object" && "status" in b.response && b.response && typeof b.response == "object" && "status" in b.response && ((z = b == null ? void 0 : b.response) == null ? void 0 : z.status) === 401 && (s.defaults.headers.common.Authorization = null, localStorage.removeItem(c), E(a)), Promise.reject(b);
|
|
645
645
|
}
|
|
646
646
|
));
|
|
647
|
-
}, [s.defaults.headers.common, s.interceptors.response, c, a]),
|
|
648
|
-
},
|
|
649
|
-
const { libraries: n } =
|
|
647
|
+
}, [s.defaults.headers.common, s.interceptors.response, c, a]), k && !y ? /* @__PURE__ */ F.jsx(mt, { fallback: t, children: (Y = (_ = j.state) == null ? void 0 : _.from) != null && Y.state && ((W = (N = j.state) == null ? void 0 : N.from) == null ? void 0 : W.pathname) === i ? /* @__PURE__ */ F.jsx(R, { to: j.state.from.state.from.pathname + j.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ F.jsx(u, {}) }) : /* @__PURE__ */ F.jsx(R, { to: i, state: { from: j }, replace: !0 });
|
|
648
|
+
}, kt = ({ ...t }) => {
|
|
649
|
+
const { libraries: n } = D(A), i = (t == null ? void 0 : t.reactRouter) || (n == null ? void 0 : n.reactRouter), c = (t == null ? void 0 : t.gtm) || (n == null ? void 0 : n.gtm);
|
|
650
650
|
if (!i)
|
|
651
651
|
throw new Error(
|
|
652
652
|
"React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView."
|
|
@@ -657,14 +657,14 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
657
657
|
return Z(() => {
|
|
658
658
|
s({ event: "pageView", pathname: d });
|
|
659
659
|
}, [d, s]), /* @__PURE__ */ F.jsx(v, {});
|
|
660
|
-
},
|
|
660
|
+
}, Dt = ({
|
|
661
661
|
tokenTypeKey: t = "tokenType",
|
|
662
662
|
userLocalStorageKey: n = "user",
|
|
663
663
|
tokenKey: i = "accessToken",
|
|
664
664
|
postContentType: c = "application/json",
|
|
665
665
|
...a
|
|
666
666
|
}) => {
|
|
667
|
-
const { apiURL: l = a.apiURL, libraries: v } =
|
|
667
|
+
const { apiURL: l = a.apiURL, libraries: v } = D(A), d = (a == null ? void 0 : a.axios) || (v == null ? void 0 : v.axios);
|
|
668
668
|
if (!d)
|
|
669
669
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
670
670
|
if (!(d != null && d.defaults))
|
|
@@ -672,7 +672,7 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
672
672
|
const s = localStorage.getItem(n), y = s ? JSON.parse(s) : null, E = y != null && y[t] ? y[t] : null, w = y != null && y[i] ? y[i] : null, R = s ? `${E} ${w}` : null;
|
|
673
673
|
return d.defaults.baseURL = l, d.defaults.headers.post["Content-Type"] = c, R && (d.defaults.headers.common.Authorization = R), null;
|
|
674
674
|
}, It = ({ debug: t, resources: n, ...i }) => {
|
|
675
|
-
const { libraries: c } =
|
|
675
|
+
const { libraries: c } = D(A), a = (i == null ? void 0 : i.i18) || (c == null ? void 0 : c.i18), { i18next: l, initReactI18next: v, languageDetector: d } = a || {};
|
|
676
676
|
if (!a)
|
|
677
677
|
throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
678
678
|
return l != null && l.isInitialized || (l.use(d).use(v).init({
|
|
@@ -705,7 +705,7 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
705
705
|
environment: s,
|
|
706
706
|
...y
|
|
707
707
|
}) => {
|
|
708
|
-
const { libraries: E } =
|
|
708
|
+
const { libraries: E } = D(A), w = (y == null ? void 0 : y.sentry) || (E == null ? void 0 : E.sentry), R = (y == null ? void 0 : y.reactRouter) || (E == null ? void 0 : E.reactRouter);
|
|
709
709
|
if (!w)
|
|
710
710
|
throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
711
711
|
if (!R)
|
|
@@ -741,12 +741,12 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
741
741
|
);
|
|
742
742
|
return /* @__PURE__ */ F.jsx(i, { ...n });
|
|
743
743
|
}, Yt = ({ accessToken: t, ...n }) => {
|
|
744
|
-
const { libraries: i } =
|
|
744
|
+
const { libraries: i } = D(A), c = (n == null ? void 0 : n.mapbox) || (i == null ? void 0 : i.mapbox);
|
|
745
745
|
if (!c)
|
|
746
746
|
throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
747
747
|
return t && (c.accessToken = t), null;
|
|
748
748
|
}, Nt = ({ language: t, ...n }) => {
|
|
749
|
-
const { libraries: i } =
|
|
749
|
+
const { libraries: i } = D(A), c = (n == null ? void 0 : n.dayjs) || (i == null ? void 0 : i.dayjs), a = (n == null ? void 0 : n.plugin) || (i == null ? void 0 : i.dayjsPlugin);
|
|
750
750
|
if (!c)
|
|
751
751
|
throw new Error(
|
|
752
752
|
"Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig."
|
|
@@ -767,7 +767,7 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
767
767
|
...c
|
|
768
768
|
}) => {
|
|
769
769
|
var s, y;
|
|
770
|
-
const { libraries: a } =
|
|
770
|
+
const { libraries: a } = D(A), l = (c == null ? void 0 : c.QueryClient) || ((s = a == null ? void 0 : a.reactQuery) == null ? void 0 : s.QueryClient), v = (c == null ? void 0 : c.QueryClientProvider) || ((y = a == null ? void 0 : a.reactQuery) == null ? void 0 : y.QueryClientProvider);
|
|
771
771
|
if (!l)
|
|
772
772
|
throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
773
773
|
if (!v)
|
|
@@ -792,20 +792,20 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
792
792
|
return /* @__PURE__ */ F.jsx(v, { client: d, children: t });
|
|
793
793
|
}, Lt = (t) => {
|
|
794
794
|
var y, E, w;
|
|
795
|
-
const { libraries: n } =
|
|
795
|
+
const { libraries: n } = D(A), i = (t == null ? void 0 : t.i18) || (n == null ? void 0 : n.i18), c = ((y = t == null ? void 0 : t.i18) == null ? void 0 : y.translateFunction) || ((E = n == null ? void 0 : n.i18) == null ? void 0 : E.translateFunction), a = ((w = i == null ? void 0 : i.i18next) == null ? void 0 : w.t) || c || ((R) => R), { unknownErrorTranslationKey: l = "error.unknownError" } = t || {}, v = a(l), d = ue(
|
|
796
796
|
(R) => {
|
|
797
|
-
var j, S, x,
|
|
797
|
+
var j, S, x, k, _, Y, N, W, b;
|
|
798
798
|
const { response: u } = R || {};
|
|
799
|
-
return u != null && u.reason ? String(u.reason) : (j = u == null ? void 0 : u.data) != null && j.reason ? String(u.data.reason) : (S = u == null ? void 0 : u.data) != null && S.message ? String(u.data.message) : (
|
|
799
|
+
return u != null && u.reason ? String(u.reason) : (j = u == null ? void 0 : u.data) != null && j.reason ? String(u.data.reason) : (S = u == null ? void 0 : u.data) != null && S.message ? String(u.data.message) : (k = (x = u == null ? void 0 : u.data) == null ? void 0 : x.detail) != null && k.length && Array.isArray((_ = u == null ? void 0 : u.data) == null ? void 0 : _.detail) && ((N = (Y = u == null ? void 0 : u.data) == null ? void 0 : Y.detail[0]) != null && N.msg) && typeof ((b = (W = u == null ? void 0 : u.data) == null ? void 0 : W.detail[0]) == null ? void 0 : b.msg) == "string" ? String(u.data.detail[0].msg) : v;
|
|
800
800
|
},
|
|
801
801
|
[v]
|
|
802
802
|
);
|
|
803
|
-
return { getErrorCode:
|
|
803
|
+
return { getErrorCode: ue((R) => {
|
|
804
804
|
var j, S, x;
|
|
805
805
|
const { response: u } = R || {};
|
|
806
806
|
return u != null && u.error_code ? String(u == null ? void 0 : u.error_code) : (j = u == null ? void 0 : u.data) != null && j.error_code ? String((S = u == null ? void 0 : u.data) == null ? void 0 : S.error_code) : u != null && u.error_code ? String(u == null ? void 0 : u.error_code) : (x = u == null ? void 0 : u.data) != null && x.error_code ? String(u.data.error_code) : "unknown_error_code";
|
|
807
807
|
}, []), printError: d };
|
|
808
|
-
},
|
|
808
|
+
}, Mt = ({
|
|
809
809
|
data: t,
|
|
810
810
|
fetchNextPage: n,
|
|
811
811
|
isFetchingNextPage: i,
|
|
@@ -813,7 +813,7 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
813
813
|
isLoading: a,
|
|
814
814
|
enabled: l = !0
|
|
815
815
|
}) => {
|
|
816
|
-
const v =
|
|
816
|
+
const v = ue(
|
|
817
817
|
async (s) => {
|
|
818
818
|
i || !l || await n({ pageParam: (s == null ? void 0 : s.pageParam) || s.visibleRowsCount });
|
|
819
819
|
},
|
|
@@ -828,8 +828,8 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
828
828
|
loadingVariant: c ? "skeleton" : "linear",
|
|
829
829
|
rows: d
|
|
830
830
|
};
|
|
831
|
-
},
|
|
832
|
-
const { libraries: n } =
|
|
831
|
+
}, Vt = (t) => {
|
|
832
|
+
const { libraries: n } = D(A), i = (t == null ? void 0 : t.axios) || (n == null ? void 0 : n.axios);
|
|
833
833
|
if (!i)
|
|
834
834
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
|
|
835
835
|
return {
|
|
@@ -843,13 +843,13 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
843
843
|
}, Rt = ({ library: t, date: n, format: i = "ll" }) => t(n).format(i), wt = (t, n = "km") => {
|
|
844
844
|
const i = Number(t);
|
|
845
845
|
return Number.isNaN(i) ? `0 ${n}` : `${i.toFixed(2)} ${n}`;
|
|
846
|
-
}, _t = (t) => t != null && t.startsWith("/") ? t != null && t.startsWith("/files") ? t : `/files${t}` : t != null && t.startsWith("files") ? `/${t}` : t != null && t.startsWith("files") ? `/${t}` : `/files/${t}`,
|
|
846
|
+
}, _t = (t) => t != null && t.startsWith("/") ? t != null && t.startsWith("/files") ? t : `/files${t}` : t != null && t.startsWith("files") ? `/${t}` : t != null && t.startsWith("files") ? `/${t}` : `/files/${t}`, Ct = ({ path: t, size: n, apiURL: i }) => {
|
|
847
847
|
if (!t)
|
|
848
848
|
return "";
|
|
849
849
|
const c = _t(t), a = `${i}${c}`, l = a.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
|
|
850
850
|
return typeof n == "number" && l ? `${a.replace("/files", `/thumbs/${n}`)}` : a;
|
|
851
|
-
},
|
|
852
|
-
const { apiURL: n, libraries: i } =
|
|
851
|
+
}, zt = (t) => {
|
|
852
|
+
const { apiURL: n, libraries: i } = D(A), c = (t == null ? void 0 : t.dayjs) || (i == null ? void 0 : i.dayjs);
|
|
853
853
|
return {
|
|
854
854
|
dateAdapter: (v, d) => {
|
|
855
855
|
if (!c)
|
|
@@ -866,18 +866,18 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
866
866
|
throw new Error(
|
|
867
867
|
"API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter."
|
|
868
868
|
);
|
|
869
|
-
return
|
|
869
|
+
return Ct({
|
|
870
870
|
apiURL: n,
|
|
871
871
|
path: v,
|
|
872
872
|
size: d
|
|
873
873
|
});
|
|
874
874
|
}
|
|
875
875
|
};
|
|
876
|
-
},
|
|
876
|
+
}, bt = (t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase(), Pt = (t) => {
|
|
877
877
|
const c = t.split("/").filter((a) => a.length > 0).map((a) => a.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join("")).join("");
|
|
878
878
|
return c.charAt(0).toLowerCase() + c.slice(1);
|
|
879
879
|
}, jt = (t) => (t.split("/").pop() || t).replace(/\.json$/, "").replace(/^openapi\./, ""), xt = (t, n, i) => {
|
|
880
|
-
const c = Pt(n), a =
|
|
880
|
+
const c = Pt(n), a = bt(i);
|
|
881
881
|
return `${c}${a}`;
|
|
882
882
|
}, Tt = (t) => {
|
|
883
883
|
if (t)
|
|
@@ -923,10 +923,13 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
923
923
|
}
|
|
924
924
|
}
|
|
925
925
|
};
|
|
926
|
-
}, {})
|
|
926
|
+
}, {}), qt = (t) => {
|
|
927
|
+
const n = "moduleFetchError";
|
|
928
|
+
throw t.message.includes("Failed to fetch dynamically imported module") && (document.cookie.split(";").some((c) => c.trim().startsWith(`${n}=`)) || (document.cookie = `${n}=true; max-age=60; path=/`, window.location.reload())), t;
|
|
929
|
+
};
|
|
927
930
|
export {
|
|
928
|
-
|
|
929
|
-
|
|
931
|
+
kt as GTMSendPageView,
|
|
932
|
+
Dt as InitializeAxiosConfig,
|
|
930
933
|
Nt as InitializeDaysJSConfig,
|
|
931
934
|
It as InitializeI18nConfig,
|
|
932
935
|
Yt as InitializeMapBoxConfig,
|
|
@@ -939,8 +942,9 @@ export {
|
|
|
939
942
|
Rt as dateAdapter,
|
|
940
943
|
wt as distanceAdapter,
|
|
941
944
|
Ut as getOrvalConfig,
|
|
942
|
-
|
|
943
|
-
zt as
|
|
944
|
-
Vt as
|
|
945
|
+
qt as handleImportModuleError,
|
|
946
|
+
zt as useAdapter,
|
|
947
|
+
Vt as useAuth,
|
|
948
|
+
Mt as useInfiniteDataGrid,
|
|
945
949
|
Lt as useResponseError
|
|
946
950
|
};
|
package/dist/main.umd.cjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ue;function Ne(){if(ue)return B;ue=1;var t=h,n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),
|
|
9
|
+
*/var ue;function Ne(){if(ue)return B;ue=1;var t=h,n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function v(d,u,y){var R,_={},C=null,s=null;y!==void 0&&(C=""+y),u.key!==void 0&&(C=""+u.key),u.ref!==void 0&&(s=u.ref);for(R in u)c.call(u,R)&&!l.hasOwnProperty(R)&&(_[R]=u[R]);if(d&&d.defaultProps)for(R in u=d.defaultProps,u)_[R]===void 0&&(_[R]=u[R]);return{$$typeof:n,type:d,key:C,ref:s,props:_,_owner:a.current}}return B.Fragment=i,B.jsx=v,B.jsxs=v,B}var G={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var le;function
|
|
18
|
-
`+re+e}}var ne=!1,K;{var
|
|
17
|
+
*/var le;function Me(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var t=h,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),d=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),s=Symbol.for("react.offscreen"),S=Symbol.iterator,I="@@iterator";function x(e){if(e===null||typeof e!="object")return null;var r=S&&e[S]||e[I];return typeof r=="function"?r:null}var D=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,o=new Array(r>1?r-1:0),f=1;f<r;f++)o[f-1]=arguments[f];N("error",e,o)}}function N(e,r,o){{var f=D.ReactDebugCurrentFrame,E=f.getStackAddendum();E!==""&&(r+="%s",o=o.concat([E]));var p=o.map(function(m){return String(m)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var M=!1,L=!1,j=!1,ve=!1,ge=!1,Q;Q=Symbol.for("react.module.reference");function ft(e){return!!(typeof e=="string"||typeof e=="function"||e===c||e===l||ge||e===a||e===y||e===R||ve||e===s||M||L||j||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===_||e.$$typeof===v||e.$$typeof===d||e.$$typeof===u||e.$$typeof===Q||e.getModuleId!==void 0))}function dt(e,r,o){var f=e.displayName;if(f)return f;var E=r.displayName||r.name||"";return E!==""?o+"("+E+")":o}function me(e){return e.displayName||"Context"}function W(e){if(e==null)return null;if(typeof e.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case c:return"Fragment";case i:return"Portal";case l:return"Profiler";case a:return"StrictMode";case y:return"Suspense";case R:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return me(r)+".Consumer";case v:var o=e;return me(o._context)+".Provider";case u:return dt(e,e.render,"ForwardRef");case _:var f=e.displayName||null;return f!==null?f:W(e.type)||"Memo";case C:{var E=e,p=E._payload,m=E._init;try{return W(m(p))}catch{return null}}}return null}var z=Object.assign,J=0,ye,he,Ee,Re,pe,we,Ce;function _e(){}_e.__reactDisabledLog=!0;function vt(){{if(J===0){ye=console.log,he=console.info,Ee=console.warn,Re=console.error,pe=console.group,we=console.groupCollapsed,Ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:_e,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}J++}}function gt(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},e,{value:ye}),info:z({},e,{value:he}),warn:z({},e,{value:Ee}),error:z({},e,{value:Re}),group:z({},e,{value:pe}),groupCollapsed:z({},e,{value:we}),groupEnd:z({},e,{value:Ce})})}J<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=D.ReactCurrentDispatcher,re;function H(e,r,o){{if(re===void 0)try{throw Error()}catch(E){var f=E.stack.trim().match(/\n( *(at )?)/);re=f&&f[1]||""}return`
|
|
18
|
+
`+re+e}}var ne=!1,K;{var mt=typeof WeakMap=="function"?WeakMap:Map;K=new mt}function be(e,r){if(!e||ne)return"";{var o=K.get(e);if(o!==void 0)return o}var f;ne=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=te.current,te.current=null,vt();try{if(r){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(Y){f=Y}Reflect.construct(e,[],m)}else{try{m.call()}catch(Y){f=Y}e.call(m.prototype)}}else{try{throw Error()}catch(Y){f=Y}e()}}catch(Y){if(Y&&f&&typeof Y.stack=="string"){for(var g=Y.stack.split(`
|
|
19
19
|
`),O=f.stack.split(`
|
|
20
|
-
`),P=g.length-1,T=O.length-1;P>=1&&T>=0&&g[P]!==O[T];)T--;for(;P>=1&&T>=0;P--,T--)if(g[P]!==O[T]){if(P!==1||T!==1)do if(P--,T--,T<0||g[P]!==O[T]){var
|
|
21
|
-
`+g[P].replace(" at new "," at ");return e.displayName&&
|
|
20
|
+
`),P=g.length-1,T=O.length-1;P>=1&&T>=0&&g[P]!==O[T];)T--;for(;P>=1&&T>=0;P--,T--)if(g[P]!==O[T]){if(P!==1||T!==1)do if(P--,T--,T<0||g[P]!==O[T]){var k=`
|
|
21
|
+
`+g[P].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,k),k}while(P>=1&&T>=0);break}}}finally{ne=!1,te.current=p,gt(),Error.prepareStackTrace=E}var U=e?e.displayName||e.name:"",Ye=U?H(U):"";return typeof e=="function"&&K.set(e,Ye),Ye}function yt(e,r,o){return be(e,!1)}function ht(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function $(e,r,o){if(e==null)return"";if(typeof e=="function")return be(e,ht(e));if(typeof e=="string")return H(e);switch(e){case y:return H("Suspense");case R:return H("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return yt(e.render);case _:return $(e.type,r,o);case C:{var f=e,E=f._payload,p=f._init;try{return $(p(E),r,o)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,Pe={},je=D.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,o=$(e.type,e._source,r?r.type:null);je.setExtraStackFrame(o)}else je.setExtraStackFrame(null)}function Et(e,r,o,f,E){{var p=Function.call.bind(Z);for(var m in e)if(p(e,m)){var g=void 0;try{if(typeof e[m]!="function"){var O=Error((f||"React class")+": "+o+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}g=e[m](r,m,f,o,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){g=P}g&&!(g instanceof Error)&&(q(E),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",f||"React class",o,m,typeof g),q(null)),g instanceof Error&&!(g.message in Pe)&&(Pe[g.message]=!0,q(E),b("Failed %s type: %s",o,g.message),q(null))}}}var Rt=Array.isArray;function oe(e){return Rt(e)}function pt(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,o=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o}}function wt(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function Se(e){if(wt(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",pt(e)),Te(e)}var X=D.ReactCurrentOwner,Ct={key:!0,ref:!0,__self:!0,__source:!0},xe,Oe,ie;ie={};function _t(e){if(Z.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function bt(e){if(Z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Pt(e,r){if(typeof e.ref=="string"&&X.current&&r&&X.current.stateNode!==r){var o=W(X.current.type);ie[o]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',W(X.current.type),e.ref),ie[o]=!0)}}function jt(e,r){{var o=function(){xe||(xe=!0,b("%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://reactjs.org/link/special-props)",r))};o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}}function Tt(e,r){{var o=function(){Oe||(Oe=!0,b("%s: `ref` 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://reactjs.org/link/special-props)",r))};o.isReactWarning=!0,Object.defineProperty(e,"ref",{get:o,configurable:!0})}}var St=function(e,r,o,f,E,p,m){var g={$$typeof:n,type:e,key:r,ref:o,props:m,_owner:p};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function xt(e,r,o,f,E){{var p,m={},g=null,O=null;o!==void 0&&(Se(o),g=""+o),bt(r)&&(Se(r.key),g=""+r.key),_t(r)&&(O=r.ref,Pt(r,E));for(p in r)Z.call(r,p)&&!Ct.hasOwnProperty(p)&&(m[p]=r[p]);if(e&&e.defaultProps){var P=e.defaultProps;for(p in P)m[p]===void 0&&(m[p]=P[p])}if(g||O){var T=typeof e=="function"?e.displayName||e.name||"Unknown":e;g&&jt(m,T),O&&Tt(m,T)}return St(e,g,O,E,f,X.current,m)}}var ae=D.ReactCurrentOwner,Ae=D.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,o=$(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(o)}else Ae.setExtraStackFrame(null)}var ce;ce=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Ie(){{if(ae.current){var e=W(ae.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function Ot(e){return""}var ke={};function At(e){{var r=Ie();if(!r){var o=typeof e=="string"?e:e.displayName||e.name;o&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+o+">.")}return r}}function ke(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=Ot(r);if(De[o])return;De[o]=!0;var f="";e&&e._owner&&e._owner!==ae.current&&(f=" It was passed a child from "+Y(e._owner.type)+"."),V(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,f),V(null)}}function Fe(e,r){{if(typeof e!="object")return;if(oe(e))for(var o=0;o<e.length;o++){var f=e[o];se(f)&&ke(f,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var E=x(e);if(typeof E=="function"&&E!==e.entries)for(var p=E.call(e),y;!(y=p.next()).done;)se(y.value)&&ke(y.value,r)}}}function At(e){{var r=e.type;if(r==null||typeof r=="string")return;var o;if(typeof r=="function")o=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===_))o=r.propTypes;else return;if(o){var f=Y(r);ht(o,e.props,"prop",f,e)}else if(r.PropTypes!==void 0&&!ce){ce=!0;var E=Y(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function It(e){{for(var r=Object.keys(e.props),o=0;o<r.length;o++){var f=r[o];if(f!=="children"&&f!=="key"){V(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),V(null);break}}e.ref!==null&&(V(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function Ye(e,r,o,f,E,p){{var y=lt(e);if(!y){var 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.");var O=xt();O?g+=O:g+=Ie();var P;e===null?P="null":oe(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(Y(e.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):P=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",P,g)}var T=St(e,r,o,E,p);if(T==null)return T;if(y){var D=r.children;if(D!==void 0)if(f)if(oe(D)){for(var U=0;U<D.length;U++)Fe(D[U],e);Object.freeze&&Object.freeze(D)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fe(D,e)}return e===s?It(T):At(T),T}}function Dt(e,r,o){return Ye(e,r,o,!0)}function kt(e,r,o){return Ye(e,r,o,!1)}var Ft=kt,Yt=Dt;G.Fragment=s,G.jsx=Ft,G.jsxs=Yt}()),G}process.env.NODE_ENV==="production"?ee.exports=Ne():ee.exports=Le();var F=ee.exports;const A=h.createContext({}),Me=({children:t,apiURL:n,libraries:i})=>{const s=h.useMemo(()=>({apiURL:n,libraries:i}),[n,i]);return F.jsx(A.Provider,{value:s,children:t})},ze=({Fallback:t,isLogged:n,loginPath:i="/login",localStorageKey:s="user",redirect401Path:a="/login",...l})=>{var b,N,L,M;const{libraries:v}=h.useContext(A),d=(l==null?void 0:l.reactRouter)||(v==null?void 0:v.reactRouter),u=(l==null?void 0:l.axios)||(v==null?void 0:v.axios);if(!d)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[m,R]=h.useState(null),{useLocation:_,Navigate:C,Outlet:c}=d,S=_(),I=h.useRef(!1),x=typeof n=="function"?n():!!n,k=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return h.useEffect(()=>{I.current||(I.current=!0,u.interceptors.response.use(j=>j,async j=>{var Q;return typeof j=="object"&&j&&"response"in j&&j.response&&typeof j.response=="object"&&"status"in j.response&&j.response&&typeof j.response=="object"&&"status"in j.response&&((Q=j==null?void 0:j.response)==null?void 0:Q.status)===401&&(u.defaults.headers.common.Authorization=null,localStorage.removeItem(s),R(a)),Promise.reject(j)}))},[u.defaults.headers.common,u.interceptors.response,s,a]),k&&!m?F.jsx(h.Suspense,{fallback:t,children:(N=(b=S.state)==null?void 0:b.from)!=null&&N.state&&((M=(L=S.state)==null?void 0:L.from)==null?void 0:M.pathname)===i?F.jsx(C,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):F.jsx(c,{})}):F.jsx(C,{to:i,state:{from:S},replace:!0})},Ve=({...t})=>{const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),s=(t==null?void 0:t.gtm)||(n==null?void 0:n.gtm);if(!i)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!s)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:a}=s,{useLocation:l,Outlet:v}=i,{pathname:d}=l(),{sendEvent:u}=a();return h.useEffect(()=>{u({event:"pageView",pathname:d})},[d,u]),F.jsx(v,{})},Ue=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:i="accessToken",postContentType:s="application/json",...a})=>{const{apiURL:l=a.apiURL,libraries:v}=h.useContext(A),d=(a==null?void 0:a.axios)||(v==null?void 0:v.axios);if(!d)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(d!=null&&d.defaults))return null;const u=localStorage.getItem(n),m=u?JSON.parse(u):null,R=m!=null&&m[t]?m[t]:null,_=m!=null&&m[i]?m[i]:null,C=u?`${R} ${_}`:null;return d.defaults.baseURL=l,d.defaults.headers.post["Content-Type"]=s,C&&(d.defaults.headers.common.Authorization=C),null},Be=({debug:t,resources:n,...i})=>{const{libraries:s}=h.useContext(A),a=(i==null?void 0:i.i18)||(s==null?void 0:s.i18),{i18next:l,initReactI18next:v,languageDetector:d}=a||{};if(!a)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return l!=null&&l.isInitialized||(l.use(d).use(v).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==l.resolvedLanguage&&l.resolvedLanguage&&document.documentElement.setAttribute("lang",l.resolvedLanguage)}),l.on("languageChanged",u=>{document.documentElement.setAttribute("lang",u)})),null},Ge=({dsn:t,integrations:n,tracesSampleRate:i,replaysSessionSampleRate:s,replaysOnErrorSampleRate:a,tracePropagationTargets:l,ignoreErrors:v,debug:d,environment:u,...m})=>{const{libraries:R}=h.useContext(A),_=(m==null?void 0:m.sentry)||(R==null?void 0:R.sentry),C=(m==null?void 0:m.reactRouter)||(R==null?void 0:R.reactRouter);if(!_)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!C)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(_.isInitialized())return null;const{createRoutesFromChildren:c,matchRoutes:S,useLocation:I,useNavigationType:x}=C;return(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:d,dsn:t,environment:u||"production",ignoreErrors:[...v||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:c,matchRoutes:S,useEffect:h.useEffect,useLocation:I,useNavigationType:x}),...n||[]],replaysOnErrorSampleRate:a||1,replaysSessionSampleRate:s||.1,tracePropagationTargets:l,tracesSampleRate:i||1}),null},Qe=({IMaskMixin:t,...n})=>{const i=h.useMemo(()=>t(({TextField:s,...a})=>F.jsx(s,{...a})),[t]);return F.jsx(i,{...n})},Je=({accessToken:t,...n})=>{const{libraries:i}=h.useContext(A),s=(n==null?void 0:n.mapbox)||(i==null?void 0:i.mapbox);if(!s)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return t&&(s.accessToken=t),null},Xe=({language:t,...n})=>{const{libraries:i}=h.useContext(A),s=(n==null?void 0:n.dayjs)||(i==null?void 0:i.dayjs),a=(n==null?void 0:n.plugin)||(i==null?void 0:i.dayjsPlugin);if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");return h.useEffect(()=>{(async()=>{var d;const v=t||((d=navigator.language)==null?void 0:d.slice(0,2))||"en";a&&a.forEach(u=>{u&&s.extend(u)}),await import("dayjs/locale/en"),await import("dayjs/locale/fr"),s.locale(v)})().then()},[s,a,t]),null},He=t=>t&&typeof t=="function",Ke=t=>t&&typeof t=="function",Ze=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:i,...s})=>{var u,m;const{libraries:a}=h.useContext(A),l=(s==null?void 0:s.QueryClient)||((u=a==null?void 0:a.reactQuery)==null?void 0:u.QueryClient),v=(s==null?void 0:s.QueryClientProvider)||((m=a==null?void 0:a.reactQuery)==null?void 0:m.QueryClientProvider);if(!l)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!v)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!He(v))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!Ke(l))throw new Error("Provided QueryClient dependencies are not valid.");const d=new l({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(R,_,C)=>R.length+(C||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(v,{client:d,children:t})},$e=t=>{var m,R,_;const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),s=((m=t==null?void 0:t.i18)==null?void 0:m.translateFunction)||((R=n==null?void 0:n.i18)==null?void 0:R.translateFunction),a=((_=i==null?void 0:i.i18next)==null?void 0:_.t)||s||(C=>C),{unknownErrorTranslationKey:l="error.unknownError"}=t||{},v=a(l),d=h.useCallback(C=>{var S,I,x,k,b,N,L,M,j;const{response:c}=C||{};return c!=null&&c.reason?String(c.reason):(S=c==null?void 0:c.data)!=null&&S.reason?String(c.data.reason):(I=c==null?void 0:c.data)!=null&&I.message?String(c.data.message):(k=(x=c==null?void 0:c.data)==null?void 0:x.detail)!=null&&k.length&&Array.isArray((b=c==null?void 0:c.data)==null?void 0:b.detail)&&((L=(N=c==null?void 0:c.data)==null?void 0:N.detail[0])!=null&&L.msg)&&typeof((j=(M=c==null?void 0:c.data)==null?void 0:M.detail[0])==null?void 0:j.msg)=="string"?String(c.data.detail[0].msg):v},[v]);return{getErrorCode:h.useCallback(C=>{var S,I,x;const{response:c}=C||{};return c!=null&&c.error_code?String(c==null?void 0:c.error_code):(S=c==null?void 0:c.data)!=null&&S.error_code?String((I=c==null?void 0:c.data)==null?void 0:I.error_code):c!=null&&c.error_code?String(c==null?void 0:c.error_code):(x=c==null?void 0:c.data)!=null&&x.error_code?String(c.data.error_code):"unknown_error_code"},[]),printError:d}},qe=({data:t,fetchNextPage:n,isFetchingNextPage:i,isInitialLoading:s,isLoading:a,enabled:l=!0})=>{const v=h.useCallback(async u=>{i||!l||await n({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[l,n,i]),d=h.useMemo(()=>{if(t)return t.pages.reduce((u,m)=>[...u,...m],[])},[t]);return{fetchNextPageOnRowsScrollEnd:v,isLoading:i||a,loadingVariant:s?"skeleton":"linear",rows:d}},et=t=>{const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.axios)||(n==null?void 0:n.axios);if(!i)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");return{clearAuthenticationToken:()=>{i.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:l,accessToken:v})=>{i.defaults.headers.common.Authorization=`${l} ${v}`}}},fe=({library:t,date:n,format:i="ll"})=>t(n).format(i),de=(t,n="km")=>{const i=Number(t);return Number.isNaN(i)?`0 ${n}`:`${i.toFixed(2)} ${n}`},tt=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,rt=({path:t,size:n,apiURL:i})=>{if(!t)return"";const s=tt(t),a=`${i}${s}`,l=a.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&l?`${a.replace("/files",`/thumbs/${n}`)}`:a},nt=t=>{const{apiURL:n,libraries:i}=h.useContext(A),s=(t==null?void 0:t.dayjs)||(i==null?void 0:i.dayjs);return{dateAdapter:(v,d)=>{if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return fe({date:v,format:d,library:s})},distanceAdapter:de,filePathAdapter:(v,d)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return rt({apiURL:n,path:v,size:d})}}},ot=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),it=t=>{const s=t.split("/").filter(a=>a.length>0).map(a=>a.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("")).join("");return s.charAt(0).toLowerCase()+s.slice(1)},at=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),ct=(t,n,i)=>{const s=it(n),a=ot(i);return`${s}${a}`},st=t=>{if(t)return(t==null?void 0:t.reduce((n,i)=>(n[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},ut=t=>(Array.isArray(t)?t:[t]).reduce((i,s)=>{const{output:a,operationsToGenerateInfiniteQueryHook:l,input:v="./openapi.json"}=s||{},d=at(v);return{...i,[d]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:v,output:{baseUrl:a==null?void 0:a.baseUrl,client:"react-query",mode:"tags-split",override:{...(l==null?void 0:l.length)&&{operations:st(l)},header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:ct,query:{useQuery:!0}},schemas:(a==null?void 0:a.schemas)||`src/api/${d}/model`,target:(a==null?void 0:a.target)||`src/api/${d}/services/api.ts`,...a}}}},{});w.GTMSendPageView=Ve,w.InitializeAxiosConfig=Ue,w.InitializeDaysJSConfig=Xe,w.InitializeI18nConfig=Be,w.InitializeMapBoxConfig=Je,w.InitializeSentryConfig=Ge,w.InjectDependenciesContext=A,w.InjectDependenciesProvider=Me,w.MaskTextField=Qe,w.QueryClientProviderWithConfig=Ze,w.RequireAuth=ze,w.dateAdapter=fe,w.distanceAdapter=de,w.getOrvalConfig=ut,w.useAdapter=nt,w.useAuth=et,w.useInfiniteDataGrid=qe,w.useResponseError=$e,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
|
25
|
+
Check the top-level render call using <`+o+">.")}return r}}function De(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=At(r);if(ke[o])return;ke[o]=!0;var f="";e&&e._owner&&e._owner!==ae.current&&(f=" It was passed a child from "+W(e._owner.type)+"."),V(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,f),V(null)}}function Fe(e,r){{if(typeof e!="object")return;if(oe(e))for(var o=0;o<e.length;o++){var f=e[o];se(f)&&De(f,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var E=x(e);if(typeof E=="function"&&E!==e.entries)for(var p=E.call(e),m;!(m=p.next()).done;)se(m.value)&&De(m.value,r)}}}function It(e){{var r=e.type;if(r==null||typeof r=="string")return;var o;if(typeof r=="function")o=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===_))o=r.propTypes;else return;if(o){var f=W(r);Et(o,e.props,"prop",f,e)}else if(r.PropTypes!==void 0&&!ce){ce=!0;var E=W(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function kt(e){{for(var r=Object.keys(e.props),o=0;o<r.length;o++){var f=r[o];if(f!=="children"&&f!=="key"){V(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),V(null);break}}e.ref!==null&&(V(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function We(e,r,o,f,E,p){{var m=ft(e);if(!m){var 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.");var O=Ot();O?g+=O:g+=Ie();var P;e===null?P="null":oe(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(W(e.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):P=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",P,g)}var T=xt(e,r,o,E,p);if(T==null)return T;if(m){var k=r.children;if(k!==void 0)if(f)if(oe(k)){for(var U=0;U<k.length;U++)Fe(k[U],e);Object.freeze&&Object.freeze(k)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fe(k,e)}return e===c?kt(T):It(T),T}}function Dt(e,r,o){return We(e,r,o,!0)}function Ft(e,r,o){return We(e,r,o,!1)}var Wt=Ft,Yt=Dt;G.Fragment=c,G.jsx=Wt,G.jsxs=Yt}()),G}process.env.NODE_ENV==="production"?ee.exports=Ne():ee.exports=Me();var F=ee.exports;const A=h.createContext({}),Le=({children:t,apiURL:n,libraries:i})=>{const c=h.useMemo(()=>({apiURL:n,libraries:i}),[n,i]);return F.jsx(A.Provider,{value:c,children:t})},ze=({Fallback:t,isLogged:n,loginPath:i="/login",localStorageKey:c="user",redirect401Path:a="/login",...l})=>{var b,N,M,L;const{libraries:v}=h.useContext(A),d=(l==null?void 0:l.reactRouter)||(v==null?void 0:v.reactRouter),u=(l==null?void 0:l.axios)||(v==null?void 0:v.axios);if(!d)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[y,R]=h.useState(null),{useLocation:_,Navigate:C,Outlet:s}=d,S=_(),I=h.useRef(!1),x=typeof n=="function"?n():!!n,D=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return h.useEffect(()=>{I.current||(I.current=!0,u.interceptors.response.use(j=>j,async j=>{var Q;return typeof j=="object"&&j&&"response"in j&&j.response&&typeof j.response=="object"&&"status"in j.response&&j.response&&typeof j.response=="object"&&"status"in j.response&&((Q=j==null?void 0:j.response)==null?void 0:Q.status)===401&&(u.defaults.headers.common.Authorization=null,localStorage.removeItem(c),R(a)),Promise.reject(j)}))},[u.defaults.headers.common,u.interceptors.response,c,a]),D&&!y?F.jsx(h.Suspense,{fallback:t,children:(N=(b=S.state)==null?void 0:b.from)!=null&&N.state&&((L=(M=S.state)==null?void 0:M.from)==null?void 0:L.pathname)===i?F.jsx(C,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):F.jsx(s,{})}):F.jsx(C,{to:i,state:{from:S},replace:!0})},Ve=({...t})=>{const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),c=(t==null?void 0:t.gtm)||(n==null?void 0:n.gtm);if(!i)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!c)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:a}=c,{useLocation:l,Outlet:v}=i,{pathname:d}=l(),{sendEvent:u}=a();return h.useEffect(()=>{u({event:"pageView",pathname:d})},[d,u]),F.jsx(v,{})},Ue=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:i="accessToken",postContentType:c="application/json",...a})=>{const{apiURL:l=a.apiURL,libraries:v}=h.useContext(A),d=(a==null?void 0:a.axios)||(v==null?void 0:v.axios);if(!d)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(d!=null&&d.defaults))return null;const u=localStorage.getItem(n),y=u?JSON.parse(u):null,R=y!=null&&y[t]?y[t]:null,_=y!=null&&y[i]?y[i]:null,C=u?`${R} ${_}`:null;return d.defaults.baseURL=l,d.defaults.headers.post["Content-Type"]=c,C&&(d.defaults.headers.common.Authorization=C),null},Be=({debug:t,resources:n,...i})=>{const{libraries:c}=h.useContext(A),a=(i==null?void 0:i.i18)||(c==null?void 0:c.i18),{i18next:l,initReactI18next:v,languageDetector:d}=a||{};if(!a)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return l!=null&&l.isInitialized||(l.use(d).use(v).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==l.resolvedLanguage&&l.resolvedLanguage&&document.documentElement.setAttribute("lang",l.resolvedLanguage)}),l.on("languageChanged",u=>{document.documentElement.setAttribute("lang",u)})),null},Ge=({dsn:t,integrations:n,tracesSampleRate:i,replaysSessionSampleRate:c,replaysOnErrorSampleRate:a,tracePropagationTargets:l,ignoreErrors:v,debug:d,environment:u,...y})=>{const{libraries:R}=h.useContext(A),_=(y==null?void 0:y.sentry)||(R==null?void 0:R.sentry),C=(y==null?void 0:y.reactRouter)||(R==null?void 0:R.reactRouter);if(!_)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!C)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(_.isInitialized())return null;const{createRoutesFromChildren:s,matchRoutes:S,useLocation:I,useNavigationType:x}=C;return(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:d,dsn:t,environment:u||"production",ignoreErrors:[...v||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:s,matchRoutes:S,useEffect:h.useEffect,useLocation:I,useNavigationType:x}),...n||[]],replaysOnErrorSampleRate:a||1,replaysSessionSampleRate:c||.1,tracePropagationTargets:l,tracesSampleRate:i||1}),null},Qe=({IMaskMixin:t,...n})=>{const i=h.useMemo(()=>t(({TextField:c,...a})=>F.jsx(c,{...a})),[t]);return F.jsx(i,{...n})},Je=({accessToken:t,...n})=>{const{libraries:i}=h.useContext(A),c=(n==null?void 0:n.mapbox)||(i==null?void 0:i.mapbox);if(!c)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return t&&(c.accessToken=t),null},Xe=({language:t,...n})=>{const{libraries:i}=h.useContext(A),c=(n==null?void 0:n.dayjs)||(i==null?void 0:i.dayjs),a=(n==null?void 0:n.plugin)||(i==null?void 0:i.dayjsPlugin);if(!c)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");return h.useEffect(()=>{(async()=>{var d;const v=t||((d=navigator.language)==null?void 0:d.slice(0,2))||"en";a&&a.forEach(u=>{u&&c.extend(u)}),await import("dayjs/locale/en"),await import("dayjs/locale/fr"),c.locale(v)})().then()},[c,a,t]),null},He=t=>t&&typeof t=="function",Ke=t=>t&&typeof t=="function",$e=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:i,...c})=>{var u,y;const{libraries:a}=h.useContext(A),l=(c==null?void 0:c.QueryClient)||((u=a==null?void 0:a.reactQuery)==null?void 0:u.QueryClient),v=(c==null?void 0:c.QueryClientProvider)||((y=a==null?void 0:a.reactQuery)==null?void 0:y.QueryClientProvider);if(!l)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!v)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!He(v))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!Ke(l))throw new Error("Provided QueryClient dependencies are not valid.");const d=new l({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(R,_,C)=>R.length+(C||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(v,{client:d,children:t})},Ze=t=>{var y,R,_;const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),c=((y=t==null?void 0:t.i18)==null?void 0:y.translateFunction)||((R=n==null?void 0:n.i18)==null?void 0:R.translateFunction),a=((_=i==null?void 0:i.i18next)==null?void 0:_.t)||c||(C=>C),{unknownErrorTranslationKey:l="error.unknownError"}=t||{},v=a(l),d=h.useCallback(C=>{var S,I,x,D,b,N,M,L,j;const{response:s}=C||{};return s!=null&&s.reason?String(s.reason):(S=s==null?void 0:s.data)!=null&&S.reason?String(s.data.reason):(I=s==null?void 0:s.data)!=null&&I.message?String(s.data.message):(D=(x=s==null?void 0:s.data)==null?void 0:x.detail)!=null&&D.length&&Array.isArray((b=s==null?void 0:s.data)==null?void 0:b.detail)&&((M=(N=s==null?void 0:s.data)==null?void 0:N.detail[0])!=null&&M.msg)&&typeof((j=(L=s==null?void 0:s.data)==null?void 0:L.detail[0])==null?void 0:j.msg)=="string"?String(s.data.detail[0].msg):v},[v]);return{getErrorCode:h.useCallback(C=>{var S,I,x;const{response:s}=C||{};return s!=null&&s.error_code?String(s==null?void 0:s.error_code):(S=s==null?void 0:s.data)!=null&&S.error_code?String((I=s==null?void 0:s.data)==null?void 0:I.error_code):s!=null&&s.error_code?String(s==null?void 0:s.error_code):(x=s==null?void 0:s.data)!=null&&x.error_code?String(s.data.error_code):"unknown_error_code"},[]),printError:d}},qe=({data:t,fetchNextPage:n,isFetchingNextPage:i,isInitialLoading:c,isLoading:a,enabled:l=!0})=>{const v=h.useCallback(async u=>{i||!l||await n({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[l,n,i]),d=h.useMemo(()=>{if(t)return t.pages.reduce((u,y)=>[...u,...y],[])},[t]);return{fetchNextPageOnRowsScrollEnd:v,isLoading:i||a,loadingVariant:c?"skeleton":"linear",rows:d}},et=t=>{const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.axios)||(n==null?void 0:n.axios);if(!i)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");return{clearAuthenticationToken:()=>{i.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:l,accessToken:v})=>{i.defaults.headers.common.Authorization=`${l} ${v}`}}},fe=({library:t,date:n,format:i="ll"})=>t(n).format(i),de=(t,n="km")=>{const i=Number(t);return Number.isNaN(i)?`0 ${n}`:`${i.toFixed(2)} ${n}`},tt=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,rt=({path:t,size:n,apiURL:i})=>{if(!t)return"";const c=tt(t),a=`${i}${c}`,l=a.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&l?`${a.replace("/files",`/thumbs/${n}`)}`:a},nt=t=>{const{apiURL:n,libraries:i}=h.useContext(A),c=(t==null?void 0:t.dayjs)||(i==null?void 0:i.dayjs);return{dateAdapter:(v,d)=>{if(!c)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return fe({date:v,format:d,library:c})},distanceAdapter:de,filePathAdapter:(v,d)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return rt({apiURL:n,path:v,size:d})}}},ot=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),it=t=>{const c=t.split("/").filter(a=>a.length>0).map(a=>a.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("")).join("");return c.charAt(0).toLowerCase()+c.slice(1)},at=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),ct=(t,n,i)=>{const c=it(n),a=ot(i);return`${c}${a}`},st=t=>{if(t)return(t==null?void 0:t.reduce((n,i)=>(n[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},ut=t=>(Array.isArray(t)?t:[t]).reduce((i,c)=>{const{output:a,operationsToGenerateInfiniteQueryHook:l,input:v="./openapi.json"}=c||{},d=at(v);return{...i,[d]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:v,output:{baseUrl:a==null?void 0:a.baseUrl,client:"react-query",mode:"tags-split",override:{...(l==null?void 0:l.length)&&{operations:st(l)},header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:ct,query:{useQuery:!0}},schemas:(a==null?void 0:a.schemas)||`src/api/${d}/model`,target:(a==null?void 0:a.target)||`src/api/${d}/services/api.ts`,...a}}}},{}),lt=t=>{const n="moduleFetchError";throw t.message.includes("Failed to fetch dynamically imported module")&&(document.cookie.split(";").some(c=>c.trim().startsWith(`${n}=`))||(document.cookie=`${n}=true; max-age=60; path=/`,window.location.reload())),t};w.GTMSendPageView=Ve,w.InitializeAxiosConfig=Ue,w.InitializeDaysJSConfig=Xe,w.InitializeI18nConfig=Be,w.InitializeMapBoxConfig=Je,w.InitializeSentryConfig=Ge,w.InjectDependenciesContext=A,w.InjectDependenciesProvider=Le,w.MaskTextField=Qe,w.QueryClientProviderWithConfig=$e,w.RequireAuth=ze,w.dateAdapter=fe,w.distanceAdapter=de,w.getOrvalConfig=ut,w.handleImportModuleError=lt,w.useAdapter=nt,w.useAuth=et,w.useInfiniteDataGrid=qe,w.useResponseError=Ze,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|