@tracktor/shared-module 2.0.0-beta.2 → 2.0.0-beta.3
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 +1 -1
- package/dist/main.js +72 -68
- package/dist/main.umd.cjs +8 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Ne, { createContext as gt, useMemo as ce, useContext as
|
|
1
|
+
import Ne, { createContext as gt, useMemo as ce, useContext as D, useState as ht, useRef as mt, useLayoutEffect as We, Suspense as yt, useEffect as Le, useCallback as ue } from "react";
|
|
2
2
|
var se = { exports: {} }, z = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -12,15 +12,15 @@ var se = { exports: {} }, z = {};
|
|
|
12
12
|
var $e;
|
|
13
13
|
function pt() {
|
|
14
14
|
return $e || ($e = 1, process.env.NODE_ENV !== "production" && function() {
|
|
15
|
-
var n = Ne, r = Symbol.for("react.element"), a = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), v = Symbol.for("react.provider"), c = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), o = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), P = Symbol.iterator,
|
|
15
|
+
var n = Ne, r = Symbol.for("react.element"), a = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), v = Symbol.for("react.provider"), c = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), o = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), P = Symbol.iterator, k = "@@iterator";
|
|
16
16
|
function T(e) {
|
|
17
17
|
if (e === null || typeof e != "object")
|
|
18
18
|
return null;
|
|
19
|
-
var t = P && e[P] || e[
|
|
19
|
+
var t = P && e[P] || e[k];
|
|
20
20
|
return typeof t == "function" ? t : null;
|
|
21
21
|
}
|
|
22
22
|
var A = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
23
|
-
function
|
|
23
|
+
function w(e) {
|
|
24
24
|
{
|
|
25
25
|
for (var t = arguments.length, i = new Array(t > 1 ? t - 1 : 0), l = 1; l < t; l++)
|
|
26
26
|
i[l - 1] = arguments[l];
|
|
@@ -59,7 +59,7 @@ function pt() {
|
|
|
59
59
|
function I(e) {
|
|
60
60
|
if (e == null)
|
|
61
61
|
return null;
|
|
62
|
-
if (typeof e.tag == "number" &&
|
|
62
|
+
if (typeof e.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
63
63
|
return e.displayName || e.name || null;
|
|
64
64
|
if (typeof e == "string")
|
|
65
65
|
return e;
|
|
@@ -160,7 +160,7 @@ function pt() {
|
|
|
160
160
|
})
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
V < 0 &&
|
|
163
|
+
V < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
var Z = A.ReactCurrentDispatcher, ee;
|
|
@@ -182,7 +182,7 @@ function pt() {
|
|
|
182
182
|
var qe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
183
183
|
Q = new qe();
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function we(e, t) {
|
|
186
186
|
if (!e || te)
|
|
187
187
|
return "";
|
|
188
188
|
{
|
|
@@ -232,18 +232,18 @@ function pt() {
|
|
|
232
232
|
if ($ && l && typeof $.stack == "string") {
|
|
233
233
|
for (var g = $.stack.split(`
|
|
234
234
|
`), j = l.stack.split(`
|
|
235
|
-
`),
|
|
235
|
+
`), _ = g.length - 1, b = j.length - 1; _ >= 1 && b >= 0 && g[_] !== j[b]; )
|
|
236
236
|
b--;
|
|
237
|
-
for (;
|
|
238
|
-
if (g[
|
|
239
|
-
if (
|
|
237
|
+
for (; _ >= 1 && b >= 0; _--, b--)
|
|
238
|
+
if (g[_] !== j[b]) {
|
|
239
|
+
if (_ !== 1 || b !== 1)
|
|
240
240
|
do
|
|
241
|
-
if (
|
|
241
|
+
if (_--, b--, b < 0 || g[_] !== j[b]) {
|
|
242
242
|
var x = `
|
|
243
|
-
` + g[
|
|
243
|
+
` + g[_].replace(" at new ", " at ");
|
|
244
244
|
return e.displayName && x.includes("<anonymous>") && (x = x.replace("<anonymous>", e.displayName)), typeof e == "function" && Q.set(e, x), x;
|
|
245
245
|
}
|
|
246
|
-
while (
|
|
246
|
+
while (_ >= 1 && b >= 0);
|
|
247
247
|
break;
|
|
248
248
|
}
|
|
249
249
|
}
|
|
@@ -254,7 +254,7 @@ function pt() {
|
|
|
254
254
|
return typeof e == "function" && Q.set(e, Ie), Ie;
|
|
255
255
|
}
|
|
256
256
|
function Be(e, t, i) {
|
|
257
|
-
return
|
|
257
|
+
return we(e, !1);
|
|
258
258
|
}
|
|
259
259
|
function Ge(e) {
|
|
260
260
|
var t = e.prototype;
|
|
@@ -264,7 +264,7 @@ function pt() {
|
|
|
264
264
|
if (e == null)
|
|
265
265
|
return "";
|
|
266
266
|
if (typeof e == "function")
|
|
267
|
-
return
|
|
267
|
+
return we(e, Ge(e));
|
|
268
268
|
if (typeof e == "string")
|
|
269
269
|
return J(e);
|
|
270
270
|
switch (e) {
|
|
@@ -289,7 +289,7 @@ function pt() {
|
|
|
289
289
|
}
|
|
290
290
|
return "";
|
|
291
291
|
}
|
|
292
|
-
var H = Object.prototype.hasOwnProperty,
|
|
292
|
+
var H = Object.prototype.hasOwnProperty, _e = {}, be = A.ReactDebugCurrentFrame;
|
|
293
293
|
function K(e) {
|
|
294
294
|
if (e) {
|
|
295
295
|
var t = e._owner, i = X(e.type, e._source, t ? t.type : null);
|
|
@@ -309,10 +309,10 @@ function pt() {
|
|
|
309
309
|
throw j.name = "Invariant Violation", j;
|
|
310
310
|
}
|
|
311
311
|
g = e[h](t, h, l, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
312
|
-
} catch (
|
|
313
|
-
g =
|
|
312
|
+
} catch (_) {
|
|
313
|
+
g = _;
|
|
314
314
|
}
|
|
315
|
-
g && !(g instanceof Error) && (K(y),
|
|
315
|
+
g && !(g instanceof Error) && (K(y), w("%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).", l || "React class", i, h, typeof g), K(null)), g instanceof Error && !(g.message in _e) && (_e[g.message] = !0, K(y), w("Failed %s type: %s", i, g.message), K(null));
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
@@ -338,7 +338,7 @@ function pt() {
|
|
|
338
338
|
}
|
|
339
339
|
function je(e) {
|
|
340
340
|
if (He(e))
|
|
341
|
-
return
|
|
341
|
+
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Xe(e)), Ce(e);
|
|
342
342
|
}
|
|
343
343
|
var M = A.ReactCurrentOwner, Ke = {
|
|
344
344
|
key: !0,
|
|
@@ -366,13 +366,13 @@ function pt() {
|
|
|
366
366
|
function tt(e, t) {
|
|
367
367
|
if (typeof e.ref == "string" && M.current && t && M.current.stateNode !== t) {
|
|
368
368
|
var i = I(M.current.type);
|
|
369
|
-
ne[i] || (
|
|
369
|
+
ne[i] || (w('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', I(M.current.type), e.ref), ne[i] = !0);
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
function rt(e, t) {
|
|
373
373
|
{
|
|
374
374
|
var i = function() {
|
|
375
|
-
Pe || (Pe = !0,
|
|
375
|
+
Pe || (Pe = !0, w("%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)", t));
|
|
376
376
|
};
|
|
377
377
|
i.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
378
378
|
get: i,
|
|
@@ -383,7 +383,7 @@ function pt() {
|
|
|
383
383
|
function nt(e, t) {
|
|
384
384
|
{
|
|
385
385
|
var i = function() {
|
|
386
|
-
Te || (Te = !0,
|
|
386
|
+
Te || (Te = !0, w("%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)", t));
|
|
387
387
|
};
|
|
388
388
|
i.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
389
389
|
get: i,
|
|
@@ -427,9 +427,9 @@ function pt() {
|
|
|
427
427
|
for (p in t)
|
|
428
428
|
H.call(t, p) && !Ke.hasOwnProperty(p) && (h[p] = t[p]);
|
|
429
429
|
if (e && e.defaultProps) {
|
|
430
|
-
var
|
|
431
|
-
for (p in
|
|
432
|
-
h[p] === void 0 && (h[p] =
|
|
430
|
+
var _ = e.defaultProps;
|
|
431
|
+
for (p in _)
|
|
432
|
+
h[p] === void 0 && (h[p] = _[p]);
|
|
433
433
|
}
|
|
434
434
|
if (g || j) {
|
|
435
435
|
var b = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
@@ -497,10 +497,10 @@ Check the top-level render call using <` + i + ">.");
|
|
|
497
497
|
return;
|
|
498
498
|
Oe[i] = !0;
|
|
499
499
|
var l = "";
|
|
500
|
-
e && e._owner && e._owner !== oe.current && (l = " It was passed a child from " + I(e._owner.type) + "."), N(e),
|
|
500
|
+
e && e._owner && e._owner !== oe.current && (l = " It was passed a child from " + I(e._owner.type) + "."), N(e), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, l), N(null);
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function De(e, t) {
|
|
504
504
|
{
|
|
505
505
|
if (typeof e != "object")
|
|
506
506
|
return;
|
|
@@ -539,9 +539,9 @@ Check the top-level render call using <` + i + ">.");
|
|
|
539
539
|
} else if (t.PropTypes !== void 0 && !ie) {
|
|
540
540
|
ie = !0;
|
|
541
541
|
var y = I(t);
|
|
542
|
-
|
|
542
|
+
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", y || "Unknown");
|
|
543
543
|
}
|
|
544
|
-
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved &&
|
|
544
|
+
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
function ct(e) {
|
|
@@ -549,14 +549,14 @@ Check the top-level render call using <` + i + ">.");
|
|
|
549
549
|
for (var t = Object.keys(e.props), i = 0; i < t.length; i++) {
|
|
550
550
|
var l = t[i];
|
|
551
551
|
if (l !== "children" && l !== "key") {
|
|
552
|
-
N(e),
|
|
552
|
+
N(e), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", l), N(null);
|
|
553
553
|
break;
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
|
-
e.ref !== null && (N(e),
|
|
556
|
+
e.ref !== null && (N(e), w("Invalid attribute `ref` supplied to `React.Fragment`."), N(null));
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function ke(e, t, i, l, y, p) {
|
|
560
560
|
{
|
|
561
561
|
var h = Ve(e);
|
|
562
562
|
if (!h) {
|
|
@@ -564,8 +564,8 @@ Check the top-level render call using <` + i + ">.");
|
|
|
564
564
|
(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.");
|
|
565
565
|
var j = at(y);
|
|
566
566
|
j ? g += j : g += Se();
|
|
567
|
-
var
|
|
568
|
-
e === null ?
|
|
567
|
+
var _;
|
|
568
|
+
e === null ? _ = "null" : re(e) ? _ = "array" : e !== void 0 && e.$$typeof === r ? (_ = "<" + (I(e.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : _ = typeof e, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", _, g);
|
|
569
569
|
}
|
|
570
570
|
var b = it(e, t, i, y, p);
|
|
571
571
|
if (b == null)
|
|
@@ -576,21 +576,21 @@ Check the top-level render call using <` + i + ">.");
|
|
|
576
576
|
if (l)
|
|
577
577
|
if (re(x)) {
|
|
578
578
|
for (var W = 0; W < x.length; W++)
|
|
579
|
-
|
|
579
|
+
De(x[W], e);
|
|
580
580
|
Object.freeze && Object.freeze(x);
|
|
581
581
|
} else
|
|
582
|
-
|
|
582
|
+
w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
583
583
|
else
|
|
584
|
-
|
|
584
|
+
De(x, e);
|
|
585
585
|
}
|
|
586
586
|
return e === u ? ct(b) : st(b), b;
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
function lt(e, t, i) {
|
|
590
|
-
return
|
|
590
|
+
return ke(e, t, i, !0);
|
|
591
591
|
}
|
|
592
592
|
function ft(e, t, i) {
|
|
593
|
-
return
|
|
593
|
+
return ke(e, t, i, !1);
|
|
594
594
|
}
|
|
595
595
|
var dt = ft, vt = lt;
|
|
596
596
|
z.Fragment = u, z.jsx = dt, z.jsxs = vt;
|
|
@@ -643,24 +643,24 @@ const S = gt({}), Tt = ({ children: n, apiURL: r, libraries: a }) => {
|
|
|
643
643
|
redirect401Path: f = "/login",
|
|
644
644
|
...d
|
|
645
645
|
}) => {
|
|
646
|
-
var
|
|
647
|
-
const { libraries: v } =
|
|
646
|
+
var w, q, B, G;
|
|
647
|
+
const { libraries: v } = D(S), c = (d == null ? void 0 : d.axios) || (v == null ? void 0 : v.axios), s = (d == null ? void 0 : d.reactRouter) || (v == null ? void 0 : v.reactRouter);
|
|
648
648
|
if (s === void 0)
|
|
649
649
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
650
650
|
if (c === void 0)
|
|
651
651
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
652
|
-
const [o, m] = ht(null), { useLocation: E, Navigate: R, Outlet: O } = s, P = E(),
|
|
652
|
+
const [o, m] = ht(null), { useLocation: E, Navigate: R, Outlet: O } = s, P = E(), k = mt(!1), T = typeof r == "function" ? r() : !!r, A = typeof T == "boolean" ? T : T == null ? void 0 : T.isLogged;
|
|
653
653
|
return We(() => {
|
|
654
|
-
|
|
654
|
+
k.current || (k.current = !0, c == null || c.interceptors.response.use(
|
|
655
655
|
(C) => C,
|
|
656
656
|
async (C) => {
|
|
657
657
|
var L;
|
|
658
658
|
return typeof C == "object" && C && "response" in C && C.response && typeof C.response == "object" && "status" in C.response && C.response && typeof C.response == "object" && "status" in C.response && ((L = C == null ? void 0 : C.response) == null ? void 0 : L.status) === 401 && (c.defaults.headers.common.Authorization = null, localStorage.removeItem(u), m(f)), Promise.reject(C);
|
|
659
659
|
}
|
|
660
660
|
));
|
|
661
|
-
}, [c == null ? void 0 : c.defaults.headers.common, c == null ? void 0 : c.interceptors.response, u, f]), A && !o ? /* @__PURE__ */ F.jsx(yt, { fallback: n, children: (q = (
|
|
661
|
+
}, [c == null ? void 0 : c.defaults.headers.common, c == null ? void 0 : c.interceptors.response, u, f]), A && !o ? /* @__PURE__ */ F.jsx(yt, { fallback: n, children: (q = (w = P.state) == null ? void 0 : w.from) != null && q.state && ((G = (B = P.state) == null ? void 0 : B.from) == null ? void 0 : G.pathname) === a ? /* @__PURE__ */ F.jsx(R, { to: P.state.from.state.from.pathname + P.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ F.jsx(O, {}) }) : /* @__PURE__ */ F.jsx(R, { to: a, state: { from: P }, replace: !0 });
|
|
662
662
|
}, St = ({ ...n }) => {
|
|
663
|
-
const { libraries: r } =
|
|
663
|
+
const { libraries: r } = D(S), a = (n == null ? void 0 : n.reactRouter) || (r == null ? void 0 : r.reactRouter), u = (n == null ? void 0 : n.gtm) || (r == null ? void 0 : r.gtm);
|
|
664
664
|
if (a === void 0)
|
|
665
665
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
666
666
|
if (u === void 0)
|
|
@@ -676,7 +676,7 @@ const S = gt({}), Tt = ({ children: n, apiURL: r, libraries: a }) => {
|
|
|
676
676
|
postContentType: u = "application/json",
|
|
677
677
|
...f
|
|
678
678
|
}) => {
|
|
679
|
-
const { apiURL: d = f.apiURL, libraries: v } =
|
|
679
|
+
const { apiURL: d = f.apiURL, libraries: v } = D(S), c = (f == null ? void 0 : f.axios) || (v == null ? void 0 : v.axios);
|
|
680
680
|
if (c === void 0)
|
|
681
681
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
682
682
|
if (!c.defaults)
|
|
@@ -684,7 +684,7 @@ const S = gt({}), Tt = ({ children: n, apiURL: r, libraries: a }) => {
|
|
|
684
684
|
const s = localStorage.getItem(r), o = s ? JSON.parse(s) : null, m = o != null && o[n] ? o[n] : null, E = o != null && o[a] ? o[a] : null, R = s ? `${m} ${E}` : null;
|
|
685
685
|
return c.defaults.baseURL = d, c.defaults.headers.post["Content-Type"] = u, R && (c.defaults.headers.common.Authorization = R), null;
|
|
686
686
|
}, At = ({ debug: n, resources: r, ...a }) => {
|
|
687
|
-
const { libraries: u } =
|
|
687
|
+
const { libraries: u } = D(S), f = (a == null ? void 0 : a.i18) || (u == null ? void 0 : u.i18), { i18next: d, initReactI18next: v, languageDetector: c } = f || {};
|
|
688
688
|
if (f === void 0)
|
|
689
689
|
throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
690
690
|
return d != null && d.isInitialized || (d.use(c).use(v).init({
|
|
@@ -705,7 +705,7 @@ const S = gt({}), Tt = ({ children: n, apiURL: r, libraries: a }) => {
|
|
|
705
705
|
}), d.on("languageChanged", (s) => {
|
|
706
706
|
document.documentElement.setAttribute("lang", s);
|
|
707
707
|
})), null;
|
|
708
|
-
},
|
|
708
|
+
}, Dt = ({
|
|
709
709
|
dsn: n,
|
|
710
710
|
integrations: r,
|
|
711
711
|
tracesSampleRate: a,
|
|
@@ -717,7 +717,7 @@ const S = gt({}), Tt = ({ children: n, apiURL: r, libraries: a }) => {
|
|
|
717
717
|
environment: s,
|
|
718
718
|
...o
|
|
719
719
|
}) => {
|
|
720
|
-
const { libraries: m } =
|
|
720
|
+
const { libraries: m } = D(S), E = (o == null ? void 0 : o.sentry) || (m == null ? void 0 : m.sentry), R = (o == null ? void 0 : o.reactRouter) || (m == null ? void 0 : m.reactRouter), { createRoutesFromChildren: O, matchRoutes: P, useLocation: k, useNavigationType: T } = R;
|
|
721
721
|
if (E === void 0)
|
|
722
722
|
throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
723
723
|
if (R === void 0)
|
|
@@ -732,7 +732,7 @@ const S = gt({}), Tt = ({ children: n, apiURL: r, libraries: a }) => {
|
|
|
732
732
|
createRoutesFromChildren: O,
|
|
733
733
|
matchRoutes: P,
|
|
734
734
|
useEffect: Le,
|
|
735
|
-
useLocation:
|
|
735
|
+
useLocation: k,
|
|
736
736
|
useNavigationType: T
|
|
737
737
|
}),
|
|
738
738
|
...r || []
|
|
@@ -742,7 +742,7 @@ const S = gt({}), Tt = ({ children: n, apiURL: r, libraries: a }) => {
|
|
|
742
742
|
tracePropagationTargets: d,
|
|
743
743
|
tracesSampleRate: a || 1
|
|
744
744
|
}), null;
|
|
745
|
-
},
|
|
745
|
+
}, kt = ({ IMaskMixin: n, ...r }) => {
|
|
746
746
|
const a = ce(
|
|
747
747
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
748
748
|
() => n(({ TextField: u, ...f }) => /* @__PURE__ */ F.jsx(u, { ...f })),
|
|
@@ -750,12 +750,12 @@ const S = gt({}), Tt = ({ children: n, apiURL: r, libraries: a }) => {
|
|
|
750
750
|
);
|
|
751
751
|
return /* @__PURE__ */ F.jsx(a, { ...r });
|
|
752
752
|
}, It = ({ accessToken: n, ...r }) => {
|
|
753
|
-
const { libraries: a } =
|
|
753
|
+
const { libraries: a } = D(S), u = (r == null ? void 0 : r.mapbox) || (a == null ? void 0 : a.mapbox);
|
|
754
754
|
if (u === void 0)
|
|
755
755
|
throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
756
756
|
return n && (u.accessToken = n), null;
|
|
757
757
|
}, $t = ({ language: n, ...r }) => {
|
|
758
|
-
const { libraries: a } =
|
|
758
|
+
const { libraries: a } = D(S), u = (r == null ? void 0 : r.dayjs) || (a == null ? void 0 : a.dayjs), f = (r == null ? void 0 : r.dayjsPlugin) || (a == null ? void 0 : a.dayjsPlugin);
|
|
759
759
|
if (u === void 0)
|
|
760
760
|
throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
761
761
|
return We(() => {
|
|
@@ -774,7 +774,7 @@ const S = gt({}), Tt = ({ children: n, apiURL: r, libraries: a }) => {
|
|
|
774
774
|
...u
|
|
775
775
|
}) => {
|
|
776
776
|
var s, o;
|
|
777
|
-
const { libraries: f } =
|
|
777
|
+
const { libraries: f } = D(S), d = (u == null ? void 0 : u.QueryClient) || ((s = f == null ? void 0 : f.reactQuery) == null ? void 0 : s.QueryClient), v = (u == null ? void 0 : u.QueryClientProvider) || ((o = f == null ? void 0 : f.reactQuery) == null ? void 0 : o.QueryClientProvider);
|
|
778
778
|
if (d === void 0)
|
|
779
779
|
throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
780
780
|
if (v === void 0)
|
|
@@ -794,14 +794,14 @@ const S = gt({}), Tt = ({ children: n, apiURL: r, libraries: a }) => {
|
|
|
794
794
|
});
|
|
795
795
|
return /* @__PURE__ */ F.jsx(v, { client: c, children: n });
|
|
796
796
|
}, Yt = (n) => {
|
|
797
|
-
const { libraries: r } =
|
|
797
|
+
const { libraries: r } = D(S), a = (n == null ? void 0 : n.i18) || (r == null ? void 0 : r.i18);
|
|
798
798
|
if (a === void 0)
|
|
799
799
|
throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in params of useResponseError.");
|
|
800
800
|
const { t: u } = a.i18next, { unknownErrorTranslationKey: f = "error.unknownError" } = n || {}, d = u(f), v = ue(
|
|
801
801
|
(s) => {
|
|
802
|
-
var m, E, R, O, P,
|
|
802
|
+
var m, E, R, O, P, k, T, A, w;
|
|
803
803
|
const { response: o } = s || {};
|
|
804
|
-
return o != null && o.reason ? String(o.reason) : (m = o == null ? void 0 : o.data) != null && m.reason ? String(o.data.reason) : (E = o == null ? void 0 : o.data) != null && E.message ? String(o.data.message) : (O = (R = o == null ? void 0 : o.data) == null ? void 0 : R.detail) != null && O.length && Array.isArray((P = o == null ? void 0 : o.data) == null ? void 0 : P.detail) && ((T = (
|
|
804
|
+
return o != null && o.reason ? String(o.reason) : (m = o == null ? void 0 : o.data) != null && m.reason ? String(o.data.reason) : (E = o == null ? void 0 : o.data) != null && E.message ? String(o.data.message) : (O = (R = o == null ? void 0 : o.data) == null ? void 0 : R.detail) != null && O.length && Array.isArray((P = o == null ? void 0 : o.data) == null ? void 0 : P.detail) && ((T = (k = o == null ? void 0 : o.data) == null ? void 0 : k.detail[0]) != null && T.msg) && typeof ((w = (A = o == null ? void 0 : o.data) == null ? void 0 : A.detail[0]) == null ? void 0 : w.msg) == "string" ? String(o.data.detail[0].msg) : d;
|
|
805
805
|
},
|
|
806
806
|
[d]
|
|
807
807
|
);
|
|
@@ -834,7 +834,7 @@ const S = gt({}), Tt = ({ children: n, apiURL: r, libraries: a }) => {
|
|
|
834
834
|
rows: c
|
|
835
835
|
};
|
|
836
836
|
}, Wt = (n) => {
|
|
837
|
-
const { libraries: r } =
|
|
837
|
+
const { libraries: r } = D(S), a = (n == null ? void 0 : n.axios) || (r == null ? void 0 : r.axios);
|
|
838
838
|
if (a === void 0)
|
|
839
839
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
|
|
840
840
|
return {
|
|
@@ -848,18 +848,22 @@ const S = gt({}), Tt = ({ children: n, apiURL: r, libraries: a }) => {
|
|
|
848
848
|
}, Rt = (n, r = "km") => {
|
|
849
849
|
const a = Number(n);
|
|
850
850
|
return Number.isNaN(a) ? `0 ${r}` : `${a.toFixed(2)} ${r}`;
|
|
851
|
-
},
|
|
851
|
+
}, wt = (n) => {
|
|
852
852
|
const r = n && typeof n == "object" && "pathname" in n && n.pathname ? n.pathname : n;
|
|
853
853
|
return typeof r == "string" ? r != null && r.startsWith("/") ? r != null && r.startsWith("/files") ? r : `/files${r}` : r != null && r.startsWith("files") ? `/${r}` : r != null && r.startsWith("files") ? `/${r}` : `/files/${r}` : r;
|
|
854
854
|
}, Ye = (n, r) => {
|
|
855
855
|
if (!n)
|
|
856
856
|
return "";
|
|
857
|
-
const a =
|
|
857
|
+
const a = wt(n), u = typeof n == "object" && "pathname" in n ? `${n.origin}${a}` : n;
|
|
858
858
|
return typeof r == "number" ? `${u.replace("/files", `/thumbs/${r}`)}` : u;
|
|
859
859
|
}, Lt = (n) => {
|
|
860
|
-
const { apiURL: r, libraries: a } =
|
|
860
|
+
const { apiURL: r, libraries: a } = D(S), u = (n == null ? void 0 : n.dayjs) || (a == null ? void 0 : a.dayjs);
|
|
861
861
|
return {
|
|
862
|
-
dateAdapter: (v, c = "ll") =>
|
|
862
|
+
dateAdapter: (v, c = "ll") => {
|
|
863
|
+
if (u === void 0)
|
|
864
|
+
throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
865
|
+
return u(v).format(c);
|
|
866
|
+
},
|
|
863
867
|
distanceAdapter: Rt,
|
|
864
868
|
filePathAdapter: (v, c) => Ye(
|
|
865
869
|
r && typeof v == "string" ? {
|
|
@@ -869,11 +873,11 @@ const S = gt({}), Tt = ({ children: n, apiURL: r, libraries: a }) => {
|
|
|
869
873
|
c
|
|
870
874
|
)
|
|
871
875
|
};
|
|
872
|
-
},
|
|
876
|
+
}, _t = (n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase(), bt = (n) => {
|
|
873
877
|
const u = n.split("/").filter((f) => f.length > 0).map((f) => f.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join("")).join("");
|
|
874
878
|
return u.charAt(0).toLowerCase() + u.slice(1);
|
|
875
879
|
}, Ct = (n, r, a) => {
|
|
876
|
-
const u = bt(r), f =
|
|
880
|
+
const u = bt(r), f = _t(a);
|
|
877
881
|
return `${u}${f}`;
|
|
878
882
|
}, jt = (n) => {
|
|
879
883
|
if (n)
|
|
@@ -923,10 +927,10 @@ export {
|
|
|
923
927
|
$t as InitializeDaysJSConfig,
|
|
924
928
|
At as InitializeI18nConfig,
|
|
925
929
|
It as InitializeMapBoxConfig,
|
|
926
|
-
|
|
930
|
+
Dt as InitializeSentryConfig,
|
|
927
931
|
S as InjectDependenciesContext,
|
|
928
932
|
Tt as InjectDependenciesProvider,
|
|
929
|
-
|
|
933
|
+
kt as MaskTextField,
|
|
930
934
|
Ft as QueryClientProviderWithConfig,
|
|
931
935
|
xt as RequireAuth,
|
|
932
936
|
Mt as dateAdapter,
|
package/dist/main.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(w,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],m):(w=typeof globalThis<"u"?globalThis:w||self,m(w["@tracktor/shared-module"]={},w.React))})(this,function(w,m){"use strict";var ee={exports:{}},z={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.development.js
|
|
4
4
|
*
|
|
@@ -6,17 +6,17 @@
|
|
|
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 ce;function Ne(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var n=m,r=Symbol.for("react.element"),
|
|
10
|
-
`+re+e}}var ne=!1,K;{var ft=typeof WeakMap=="function"?WeakMap:Map;K=new ft}function be(e,t){if(!e||ne)return"";{var
|
|
9
|
+
*/var ce;function Ne(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var n=m,r=Symbol.for("react.element"),a=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),o=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),D=Symbol.for("react.offscreen"),x=Symbol.iterator,F="@@iterator";function O(e){if(e===null||typeof e!="object")return null;var t=x&&e[x]||e[F];return typeof t=="function"?t:null}var I=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var t=arguments.length,i=new Array(t>1?t-1:0),l=1;l<t;l++)i[l-1]=arguments[l];J("error",e,i)}}function J(e,t,i){{var l=I.ReactDebugCurrentFrame,p=l.getStackAddendum();p!==""&&(t+="%s",i=i.concat([p]));var E=i.map(function(h){return String(h)});E.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,E)}}var Q=!1,X=!1,P=!1,ve=!1,ge=!1,U;U=Symbol.for("react.module.reference");function ut(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===d||ge||e===f||e===o||e===y||ve||e===D||Q||X||P||typeof e=="object"&&e!==null&&(e.$$typeof===_||e.$$typeof===R||e.$$typeof===v||e.$$typeof===c||e.$$typeof===s||e.$$typeof===U||e.getModuleId!==void 0))}function st(e,t,i){var l=e.displayName;if(l)return l;var p=t.displayName||t.name||"";return p!==""?i+"("+p+")":i}function he(e){return e.displayName||"Context"}function Y(e){if(e==null)return null;if(typeof e.tag=="number"&&C("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 u:return"Fragment";case a:return"Portal";case d:return"Profiler";case f:return"StrictMode";case o:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c:var t=e;return he(t)+".Consumer";case v:var i=e;return he(i._context)+".Provider";case s:return st(e,e.render,"ForwardRef");case R:var l=e.displayName||null;return l!==null?l:Y(e.type)||"Memo";case _:{var p=e,E=p._payload,h=p._init;try{return Y(h(E))}catch{return null}}}return null}var N=Object.assign,B=0,ye,me,pe,Ee,Re,we,_e;function Ce(){}Ce.__reactDisabledLog=!0;function ct(){{if(B===0){ye=console.log,me=console.info,pe=console.warn,Ee=console.error,Re=console.group,we=console.groupCollapsed,_e=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ce,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}B++}}function lt(){{if(B--,B===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:N({},e,{value:ye}),info:N({},e,{value:me}),warn:N({},e,{value:pe}),error:N({},e,{value:Ee}),group:N({},e,{value:Re}),groupCollapsed:N({},e,{value:we}),groupEnd:N({},e,{value:_e})})}B<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=I.ReactCurrentDispatcher,re;function H(e,t,i){{if(re===void 0)try{throw Error()}catch(p){var l=p.stack.trim().match(/\n( *(at )?)/);re=l&&l[1]||""}return`
|
|
10
|
+
`+re+e}}var ne=!1,K;{var ft=typeof WeakMap=="function"?WeakMap:Map;K=new ft}function be(e,t){if(!e||ne)return"";{var i=K.get(e);if(i!==void 0)return i}var l;ne=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var E;E=te.current,te.current=null,ct();try{if(t){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(W){l=W}Reflect.construct(e,[],h)}else{try{h.call()}catch(W){l=W}e.call(h.prototype)}}else{try{throw Error()}catch(W){l=W}e()}}catch(W){if(W&&l&&typeof W.stack=="string"){for(var g=W.stack.split(`
|
|
11
11
|
`),T=l.stack.split(`
|
|
12
12
|
`),b=g.length-1,j=T.length-1;b>=1&&j>=0&&g[b]!==T[j];)j--;for(;b>=1&&j>=0;b--,j--)if(g[b]!==T[j]){if(b!==1||j!==1)do if(b--,j--,j<0||g[b]!==T[j]){var A=`
|
|
13
|
-
`+g[b].replace(" at new "," at ");return e.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,A),A}while(b>=1&&j>=0);break}}}finally{ne=!1,te.current=E,lt(),Error.prepareStackTrace=p}var M=e?e.displayName||e.name:"",We=M?H(M):"";return typeof e=="function"&&K.set(e,We),We}function dt(e,t,
|
|
13
|
+
`+g[b].replace(" at new "," at ");return e.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,A),A}while(b>=1&&j>=0);break}}}finally{ne=!1,te.current=E,lt(),Error.prepareStackTrace=p}var M=e?e.displayName||e.name:"",We=M?H(M):"";return typeof e=="function"&&K.set(e,We),We}function dt(e,t,i){return be(e,!1)}function vt(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function Z(e,t,i){if(e==null)return"";if(typeof e=="function")return be(e,vt(e));if(typeof e=="string")return H(e);switch(e){case o:return H("Suspense");case y:return H("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case s:return dt(e.render);case R:return Z(e.type,t,i);case _:{var l=e,p=l._payload,E=l._init;try{return Z(E(p),t,i)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,je={},Pe=I.ReactDebugCurrentFrame;function q(e){if(e){var t=e._owner,i=Z(e.type,e._source,t?t.type:null);Pe.setExtraStackFrame(i)}else Pe.setExtraStackFrame(null)}function gt(e,t,i,l,p){{var E=Function.call.bind($);for(var h in e)if(E(e,h)){var g=void 0;try{if(typeof e[h]!="function"){var T=Error((l||"React class")+": "+i+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}g=e[h](t,h,l,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(b){g=b}g&&!(g instanceof Error)&&(q(p),C("%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).",l||"React class",i,h,typeof g),q(null)),g instanceof Error&&!(g.message in je)&&(je[g.message]=!0,q(p),C("Failed %s type: %s",i,g.message),q(null))}}}var ht=Array.isArray;function oe(e){return ht(e)}function yt(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,i=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function mt(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function Se(e){if(mt(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",yt(e)),Te(e)}var G=I.ReactCurrentOwner,pt={key:!0,ref:!0,__self:!0,__source:!0},xe,Oe,ie;ie={};function Et(e){if($.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Rt(e){if($.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function wt(e,t){if(typeof e.ref=="string"&&G.current&&t&&G.current.stateNode!==t){var i=Y(G.current.type);ie[i]||(C('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',Y(G.current.type),e.ref),ie[i]=!0)}}function _t(e,t){{var i=function(){xe||(xe=!0,C("%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)",t))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}}function Ct(e,t){{var i=function(){Oe||(Oe=!0,C("%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)",t))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}}var bt=function(e,t,i,l,p,E,h){var g={$$typeof:r,type:e,key:t,ref:i,props:h,_owner:E};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:l}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function jt(e,t,i,l,p){{var E,h={},g=null,T=null;i!==void 0&&(Se(i),g=""+i),Rt(t)&&(Se(t.key),g=""+t.key),Et(t)&&(T=t.ref,wt(t,p));for(E in t)$.call(t,E)&&!pt.hasOwnProperty(E)&&(h[E]=t[E]);if(e&&e.defaultProps){var b=e.defaultProps;for(E in b)h[E]===void 0&&(h[E]=b[E])}if(g||T){var j=typeof e=="function"?e.displayName||e.name||"Unknown":e;g&&_t(h,j),T&&Ct(h,j)}return bt(e,g,T,p,l,G.current,h)}}var ae=I.ReactCurrentOwner,Ae=I.ReactDebugCurrentFrame;function L(e){if(e){var t=e._owner,i=Z(e.type,e._source,t?t.type:null);Ae.setExtraStackFrame(i)}else Ae.setExtraStackFrame(null)}var ue;ue=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===r}function De(){{if(ae.current){var e=Y(ae.current.type);if(e)return`
|
|
14
14
|
|
|
15
|
-
Check the render method of \``+e+"`."}return""}}function Pt(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),
|
|
15
|
+
Check the render method of \``+e+"`."}return""}}function Pt(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),i=e.lineNumber;return`
|
|
16
16
|
|
|
17
|
-
Check your code at `+t+":"+
|
|
17
|
+
Check your code at `+t+":"+i+"."}return""}}var Ie={};function Tt(e){{var t=De();if(!t){var i=typeof e=="string"?e:e.displayName||e.name;i&&(t=`
|
|
18
18
|
|
|
19
|
-
Check the top-level render call using <`+
|
|
19
|
+
Check the top-level render call using <`+i+">.")}return t}}function ke(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=Tt(t);if(Ie[i])return;Ie[i]=!0;var l="";e&&e._owner&&e._owner!==ae.current&&(l=" It was passed a child from "+Y(e._owner.type)+"."),L(e),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,l),L(null)}}function Fe(e,t){{if(typeof e!="object")return;if(oe(e))for(var i=0;i<e.length;i++){var l=e[i];se(l)&&ke(l,t)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var p=O(e);if(typeof p=="function"&&p!==e.entries)for(var E=p.call(e),h;!(h=E.next()).done;)se(h.value)&&ke(h.value,t)}}}function St(e){{var t=e.type;if(t==null||typeof t=="string")return;var i;if(typeof t=="function")i=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===s||t.$$typeof===R))i=t.propTypes;else return;if(i){var l=Y(t);gt(i,e.props,"prop",l,e)}else if(t.PropTypes!==void 0&&!ue){ue=!0;var p=Y(t);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function xt(e){{for(var t=Object.keys(e.props),i=0;i<t.length;i++){var l=t[i];if(l!=="children"&&l!=="key"){L(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",l),L(null);break}}e.ref!==null&&(L(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}function Ye(e,t,i,l,p,E){{var h=ut(e);if(!h){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 T=Pt(p);T?g+=T:g+=De();var b;e===null?b="null":oe(e)?b="array":e!==void 0&&e.$$typeof===r?(b="<"+(Y(e.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,g)}var j=jt(e,t,i,p,E);if(j==null)return j;if(h){var A=t.children;if(A!==void 0)if(l)if(oe(A)){for(var M=0;M<A.length;M++)Fe(A[M],e);Object.freeze&&Object.freeze(A)}else C("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(A,e)}return e===u?xt(j):St(j),j}}function Ot(e,t,i){return Ye(e,t,i,!0)}function At(e,t,i){return Ye(e,t,i,!1)}var Dt=At,It=Ot;z.Fragment=u,z.jsx=Dt,z.jsxs=It}()),z}var V={};/**
|
|
20
20
|
* @license React
|
|
21
21
|
* react-jsx-runtime.production.min.js
|
|
22
22
|
*
|
|
@@ -24,4 +24,4 @@ Check the top-level render call using <`+a+">.")}return t}}function De(e,t){{if(
|
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the MIT license found in the
|
|
26
26
|
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/var le;function Le(){if(le)return V;le=1;var n=m,r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,f=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function v(c,s,o){var y,R={},w=null,I=null;o!==void 0&&(w=""+o),s.key!==void 0&&(w=""+s.key),s.ref!==void 0&&(I=s.ref);for(y in s)u.call(s,y)&&!d.hasOwnProperty(y)&&(R[y]=s[y]);if(c&&c.defaultProps)for(y in s=c.defaultProps,s)R[y]===void 0&&(R[y]=s[y]);return{$$typeof:r,type:c,key:w,ref:I,props:R,_owner:f.current}}return V.Fragment=i,V.jsx=v,V.jsxs=v,V}process.env.NODE_ENV==="production"?ee.exports=Le():ee.exports=Ne();var D=ee.exports;const S=m.createContext({}),Me=({children:n,apiURL:r,libraries:i})=>{const u=m.useMemo(()=>({apiURL:r,libraries:i}),[r,i]);return D.jsx(S.Provider,{value:u,children:n})},ze=({Fallback:n,isLogged:r,loginPath:i="/login",localStorageKey:u="user",redirect401Path:f="/login",...d})=>{var C,J,Q,X;const{libraries:v}=m.useContext(S),c=(d==null?void 0:d.axios)||(v==null?void 0:v.axios),s=(d==null?void 0:d.reactRouter)||(v==null?void 0:v.reactRouter);if(s===void 0)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(c===void 0)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[o,y]=m.useState(null),{useLocation:R,Navigate:w,Outlet:I}=s,x=R(),F=m.useRef(!1),O=typeof r=="function"?r():!!r,k=typeof O=="boolean"?O:O==null?void 0:O.isLogged;return m.useLayoutEffect(()=>{F.current||(F.current=!0,c==null||c.interceptors.response.use(P=>P,async P=>{var U;return typeof P=="object"&&P&&"response"in P&&P.response&&typeof P.response=="object"&&"status"in P.response&&P.response&&typeof P.response=="object"&&"status"in P.response&&((U=P==null?void 0:P.response)==null?void 0:U.status)===401&&(c.defaults.headers.common.Authorization=null,localStorage.removeItem(u),y(f)),Promise.reject(P)}))},[c==null?void 0:c.defaults.headers.common,c==null?void 0:c.interceptors.response,u,f]),k&&!o?D.jsx(m.Suspense,{fallback:n,children:(J=(C=x.state)==null?void 0:C.from)!=null&&J.state&&((X=(Q=x.state)==null?void 0:Q.from)==null?void 0:X.pathname)===i?D.jsx(w,{to:x.state.from.state.from.pathname+x.state.from.state.from.search,replace:!0}):D.jsx(I,{})}):D.jsx(w,{to:i,state:{from:x},replace:!0})},Ve=({...n})=>{const{libraries:r}=m.useContext(S),i=(n==null?void 0:n.reactRouter)||(r==null?void 0:r.reactRouter),u=(n==null?void 0:n.gtm)||(r==null?void 0:r.gtm);if(i===void 0)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(u===void 0)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const{useGoogleTagManager:f}=u,{useLocation:d,Outlet:v}=i,{pathname:c}=d(),{sendEvent:s}=f();return m.useEffect(()=>{s({event:"pageView",pathname:c})},[c,s]),D.jsx(v,{})},Ue=({tokenTypeKey:n="tokenType",userLocalStorageKey:r="user",tokenKey:i="accessToken",postContentType:u="application/json",...f})=>{const{apiURL:d=f.apiURL,libraries:v}=m.useContext(S),c=(f==null?void 0:f.axios)||(v==null?void 0:v.axios);if(c===void 0)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!c.defaults)return null;const s=localStorage.getItem(r),o=s?JSON.parse(s):null,y=o!=null&&o[n]?o[n]:null,R=o!=null&&o[i]?o[i]:null,w=s?`${y} ${R}`:null;return c.defaults.baseURL=d,c.defaults.headers.post["Content-Type"]=u,w&&(c.defaults.headers.common.Authorization=w),null},Be=({debug:n,resources:r,...i})=>{const{libraries:u}=m.useContext(S),f=(i==null?void 0:i.i18)||(u==null?void 0:u.i18),{i18next:d,initReactI18next:v,languageDetector:c}=f||{};if(f===void 0)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return d!=null&&d.isInitialized||(d.use(c).use(v).init({debug:n,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:r,returnNull:!1}).then(()=>{document.documentElement.lang!==d.resolvedLanguage&&d.resolvedLanguage&&document.documentElement.setAttribute("lang",d.resolvedLanguage)}),d.on("languageChanged",s=>{document.documentElement.setAttribute("lang",s)})),null},Ge=({dsn:n,integrations:r,tracesSampleRate:i,replaysSessionSampleRate:u,replaysOnErrorSampleRate:f,tracePropagationTargets:d,ignoreErrors:v,debug:c,environment:s,...o})=>{const{libraries:y}=m.useContext(S),R=(o==null?void 0:o.sentry)||(y==null?void 0:y.sentry),w=(o==null?void 0:o.reactRouter)||(y==null?void 0:y.reactRouter),{createRoutesFromChildren:I,matchRoutes:x,useLocation:F,useNavigationType:O}=w;if(R===void 0)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(w===void 0)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return R.isInitialized()||(c||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&R.init({debug:c,dsn:n,environment:s||"production",ignoreErrors:[...v||[],/dynamically imported module/],integrations:[R.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:I,matchRoutes:x,useEffect:m.useEffect,useLocation:F,useNavigationType:O}),...r||[]],replaysOnErrorSampleRate:f||1,replaysSessionSampleRate:u||.1,tracePropagationTargets:d,tracesSampleRate:i||1}),null},Je=({IMaskMixin:n,...r})=>{const i=m.useMemo(()=>n(({TextField:u,...f})=>D.jsx(u,{...f})),[n]);return D.jsx(i,{...r})},Qe=({accessToken:n,...r})=>{const{libraries:i}=m.useContext(S),u=(r==null?void 0:r.mapbox)||(i==null?void 0:i.mapbox);if(u===void 0)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return n&&(u.accessToken=n),null},Xe=({language:n,...r})=>{const{libraries:i}=m.useContext(S),u=(r==null?void 0:r.dayjs)||(i==null?void 0:i.dayjs),f=(r==null?void 0:r.dayjsPlugin)||(i==null?void 0:i.dayjsPlugin);if(u===void 0)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return m.useLayoutEffect(()=>{(async()=>{var c;const v=n||((c=navigator.language)==null?void 0:c.slice(0,2))||"en";f&&f.forEach(s=>{u.extend(s.default)}),u.locale(v)})().then()},[u,f,n]),null},He=({children:n,defaultQueriesOptions:r,defaultMutationsOptions:i,...u})=>{var s,o;const{libraries:f}=m.useContext(S),d=(u==null?void 0:u.QueryClient)||((s=f==null?void 0:f.reactQuery)==null?void 0:s.QueryClient),v=(u==null?void 0:u.QueryClientProvider)||((o=f==null?void 0:f.reactQuery)==null?void 0:o.QueryClientProvider);if(d===void 0)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(v===void 0)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const c=new d({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(y,R,w)=>y.length+(w||0),refetchOnWindowFocus:!1,retry:3,...r}}});return D.jsx(v,{client:c,children:n})},Ke=n=>{const{libraries:r}=m.useContext(S),i=(n==null?void 0:n.i18)||(r==null?void 0:r.i18);if(i===void 0)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in params of useResponseError.");const{t:u}=i.i18next,{unknownErrorTranslationKey:f="error.unknownError"}=n||{},d=u(f),v=m.useCallback(s=>{var y,R,w,I,x,F,O,k,C;const{response:o}=s||{};return o!=null&&o.reason?String(o.reason):(y=o==null?void 0:o.data)!=null&&y.reason?String(o.data.reason):(R=o==null?void 0:o.data)!=null&&R.message?String(o.data.message):(I=(w=o==null?void 0:o.data)==null?void 0:w.detail)!=null&&I.length&&Array.isArray((x=o==null?void 0:o.data)==null?void 0:x.detail)&&((O=(F=o==null?void 0:o.data)==null?void 0:F.detail[0])!=null&&O.msg)&&typeof((C=(k=o==null?void 0:o.data)==null?void 0:k.detail[0])==null?void 0:C.msg)=="string"?String(o.data.detail[0].msg):d},[d]);return{getErrorCode:m.useCallback(s=>{var y,R,w;const{response:o}=s||{};return o!=null&&o.error_code?String(o==null?void 0:o.error_code):(y=o==null?void 0:o.data)!=null&&y.error_code?String((R=o==null?void 0:o.data)==null?void 0:R.error_code):o!=null&&o.error_code?String(o==null?void 0:o.error_code):(w=o==null?void 0:o.data)!=null&&w.error_code?String(o.data.error_code):"unknown_error_code"},[]),printError:v}},Ze=({data:n,fetchNextPage:r,isFetchingNextPage:i,isInitialLoading:u,isLoading:f,enabled:d=!0})=>{const v=m.useCallback(async s=>{i||!d||await r({pageParam:(s==null?void 0:s.pageParam)||s.visibleRowsCount})},[d,r,i]),c=m.useMemo(()=>{if(n)return n.pages.reduce((s,o)=>[...s,...o],[])},[n]);return{fetchNextPageOnRowsScrollEnd:v,isLoading:i||f,loadingVariant:u?"skeleton":"linear",rows:c}},$e=n=>{const{libraries:r}=m.useContext(S),i=(n==null?void 0:n.axios)||(r==null?void 0:r.axios);if(i===void 0)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:d,accessToken:v})=>{i.defaults.headers.common.Authorization=`${d} ${v}`}}},fe=(n,r="km")=>{const i=Number(n);return Number.isNaN(i)?`0 ${r}`:`${i.toFixed(2)} ${r}`},qe=n=>{const r=n&&typeof n=="object"&&"pathname"in n&&n.pathname?n.pathname:n;return typeof r=="string"?r!=null&&r.startsWith("/")?r!=null&&r.startsWith("/files")?r:`/files${r}`:r!=null&&r.startsWith("files")?`/${r}`:r!=null&&r.startsWith("files")?`/${r}`:`/files/${r}`:r},de=(n,r)=>{if(!n)return"";const i=qe(n),u=typeof n=="object"&&"pathname"in n?`${n.origin}${i}`:n;return typeof r=="number"?`${u.replace("/files",`/thumbs/${r}`)}`:u},et=n=>{const{apiURL:r,libraries:i}=m.useContext(S),u=(n==null?void 0:n.dayjs)||(i==null?void 0:i.dayjs);return{dateAdapter:(v,c="ll")=>u(v).format(c),distanceAdapter:fe,filePathAdapter:(v,c)=>de(r&&typeof v=="string"?{origin:r,pathname:v}:v,c)}},tt=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),rt=n=>{const u=n.split("/").filter(f=>f.length>0).map(f=>f.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join("")).join("");return u.charAt(0).toLowerCase()+u.slice(1)},nt=(n,r,i)=>{const u=rt(r),f=tt(i);return`${u}${f}`},ot=n=>{if(n)return(n==null?void 0:n.reduce((r,i)=>(r[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},r),{}))||{}},at=n=>{const{input:r="./openapi.json",operationsToGenerateInfiniteQueryHook:i=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:r,output:{client:"react-query",mode:"tags-split",override:{header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:nt,...(i==null?void 0:i.length)&&{operations:ot(i)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}},it=(n,r,i="ll")=>String(n(r).format(i));_.GTMSendPageView=Ve,_.InitializeAxiosConfig=Ue,_.InitializeDaysJSConfig=Xe,_.InitializeI18nConfig=Be,_.InitializeMapBoxConfig=Qe,_.InitializeSentryConfig=Ge,_.InjectDependenciesContext=S,_.InjectDependenciesProvider=Me,_.MaskTextField=Je,_.QueryClientProviderWithConfig=He,_.RequireAuth=ze,_.dateAdapter=it,_.distanceAdapter=fe,_.getOrvalConfig=at,_.useAdapter=et,_.useAuth=$e,_.useInfiniteDataGrid=Ze,_.useResponseError=Ke,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
|
|
27
|
+
*/var le;function Le(){if(le)return V;le=1;var n=m,r=Symbol.for("react.element"),a=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,f=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function v(c,s,o){var y,R={},_=null,D=null;o!==void 0&&(_=""+o),s.key!==void 0&&(_=""+s.key),s.ref!==void 0&&(D=s.ref);for(y in s)u.call(s,y)&&!d.hasOwnProperty(y)&&(R[y]=s[y]);if(c&&c.defaultProps)for(y in s=c.defaultProps,s)R[y]===void 0&&(R[y]=s[y]);return{$$typeof:r,type:c,key:_,ref:D,props:R,_owner:f.current}}return V.Fragment=a,V.jsx=v,V.jsxs=v,V}process.env.NODE_ENV==="production"?ee.exports=Le():ee.exports=Ne();var k=ee.exports;const S=m.createContext({}),Me=({children:n,apiURL:r,libraries:a})=>{const u=m.useMemo(()=>({apiURL:r,libraries:a}),[r,a]);return k.jsx(S.Provider,{value:u,children:n})},ze=({Fallback:n,isLogged:r,loginPath:a="/login",localStorageKey:u="user",redirect401Path:f="/login",...d})=>{var C,J,Q,X;const{libraries:v}=m.useContext(S),c=(d==null?void 0:d.axios)||(v==null?void 0:v.axios),s=(d==null?void 0:d.reactRouter)||(v==null?void 0:v.reactRouter);if(s===void 0)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(c===void 0)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[o,y]=m.useState(null),{useLocation:R,Navigate:_,Outlet:D}=s,x=R(),F=m.useRef(!1),O=typeof r=="function"?r():!!r,I=typeof O=="boolean"?O:O==null?void 0:O.isLogged;return m.useLayoutEffect(()=>{F.current||(F.current=!0,c==null||c.interceptors.response.use(P=>P,async P=>{var U;return typeof P=="object"&&P&&"response"in P&&P.response&&typeof P.response=="object"&&"status"in P.response&&P.response&&typeof P.response=="object"&&"status"in P.response&&((U=P==null?void 0:P.response)==null?void 0:U.status)===401&&(c.defaults.headers.common.Authorization=null,localStorage.removeItem(u),y(f)),Promise.reject(P)}))},[c==null?void 0:c.defaults.headers.common,c==null?void 0:c.interceptors.response,u,f]),I&&!o?k.jsx(m.Suspense,{fallback:n,children:(J=(C=x.state)==null?void 0:C.from)!=null&&J.state&&((X=(Q=x.state)==null?void 0:Q.from)==null?void 0:X.pathname)===a?k.jsx(_,{to:x.state.from.state.from.pathname+x.state.from.state.from.search,replace:!0}):k.jsx(D,{})}):k.jsx(_,{to:a,state:{from:x},replace:!0})},Ve=({...n})=>{const{libraries:r}=m.useContext(S),a=(n==null?void 0:n.reactRouter)||(r==null?void 0:r.reactRouter),u=(n==null?void 0:n.gtm)||(r==null?void 0:r.gtm);if(a===void 0)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(u===void 0)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const{useGoogleTagManager:f}=u,{useLocation:d,Outlet:v}=a,{pathname:c}=d(),{sendEvent:s}=f();return m.useEffect(()=>{s({event:"pageView",pathname:c})},[c,s]),k.jsx(v,{})},Ue=({tokenTypeKey:n="tokenType",userLocalStorageKey:r="user",tokenKey:a="accessToken",postContentType:u="application/json",...f})=>{const{apiURL:d=f.apiURL,libraries:v}=m.useContext(S),c=(f==null?void 0:f.axios)||(v==null?void 0:v.axios);if(c===void 0)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!c.defaults)return null;const s=localStorage.getItem(r),o=s?JSON.parse(s):null,y=o!=null&&o[n]?o[n]:null,R=o!=null&&o[a]?o[a]:null,_=s?`${y} ${R}`:null;return c.defaults.baseURL=d,c.defaults.headers.post["Content-Type"]=u,_&&(c.defaults.headers.common.Authorization=_),null},Be=({debug:n,resources:r,...a})=>{const{libraries:u}=m.useContext(S),f=(a==null?void 0:a.i18)||(u==null?void 0:u.i18),{i18next:d,initReactI18next:v,languageDetector:c}=f||{};if(f===void 0)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return d!=null&&d.isInitialized||(d.use(c).use(v).init({debug:n,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:r,returnNull:!1}).then(()=>{document.documentElement.lang!==d.resolvedLanguage&&d.resolvedLanguage&&document.documentElement.setAttribute("lang",d.resolvedLanguage)}),d.on("languageChanged",s=>{document.documentElement.setAttribute("lang",s)})),null},Ge=({dsn:n,integrations:r,tracesSampleRate:a,replaysSessionSampleRate:u,replaysOnErrorSampleRate:f,tracePropagationTargets:d,ignoreErrors:v,debug:c,environment:s,...o})=>{const{libraries:y}=m.useContext(S),R=(o==null?void 0:o.sentry)||(y==null?void 0:y.sentry),_=(o==null?void 0:o.reactRouter)||(y==null?void 0:y.reactRouter),{createRoutesFromChildren:D,matchRoutes:x,useLocation:F,useNavigationType:O}=_;if(R===void 0)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(_===void 0)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return R.isInitialized()||(c||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&R.init({debug:c,dsn:n,environment:s||"production",ignoreErrors:[...v||[],/dynamically imported module/],integrations:[R.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:D,matchRoutes:x,useEffect:m.useEffect,useLocation:F,useNavigationType:O}),...r||[]],replaysOnErrorSampleRate:f||1,replaysSessionSampleRate:u||.1,tracePropagationTargets:d,tracesSampleRate:a||1}),null},Je=({IMaskMixin:n,...r})=>{const a=m.useMemo(()=>n(({TextField:u,...f})=>k.jsx(u,{...f})),[n]);return k.jsx(a,{...r})},Qe=({accessToken:n,...r})=>{const{libraries:a}=m.useContext(S),u=(r==null?void 0:r.mapbox)||(a==null?void 0:a.mapbox);if(u===void 0)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return n&&(u.accessToken=n),null},Xe=({language:n,...r})=>{const{libraries:a}=m.useContext(S),u=(r==null?void 0:r.dayjs)||(a==null?void 0:a.dayjs),f=(r==null?void 0:r.dayjsPlugin)||(a==null?void 0:a.dayjsPlugin);if(u===void 0)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return m.useLayoutEffect(()=>{(async()=>{var c;const v=n||((c=navigator.language)==null?void 0:c.slice(0,2))||"en";f&&f.forEach(s=>{u.extend(s.default)}),u.locale(v)})().then()},[u,f,n]),null},He=({children:n,defaultQueriesOptions:r,defaultMutationsOptions:a,...u})=>{var s,o;const{libraries:f}=m.useContext(S),d=(u==null?void 0:u.QueryClient)||((s=f==null?void 0:f.reactQuery)==null?void 0:s.QueryClient),v=(u==null?void 0:u.QueryClientProvider)||((o=f==null?void 0:f.reactQuery)==null?void 0:o.QueryClientProvider);if(d===void 0)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(v===void 0)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const c=new d({defaultOptions:{mutations:{...a},queries:{getNextPageParam:(y,R,_)=>y.length+(_||0),refetchOnWindowFocus:!1,retry:3,...r}}});return k.jsx(v,{client:c,children:n})},Ke=n=>{const{libraries:r}=m.useContext(S),a=(n==null?void 0:n.i18)||(r==null?void 0:r.i18);if(a===void 0)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in params of useResponseError.");const{t:u}=a.i18next,{unknownErrorTranslationKey:f="error.unknownError"}=n||{},d=u(f),v=m.useCallback(s=>{var y,R,_,D,x,F,O,I,C;const{response:o}=s||{};return o!=null&&o.reason?String(o.reason):(y=o==null?void 0:o.data)!=null&&y.reason?String(o.data.reason):(R=o==null?void 0:o.data)!=null&&R.message?String(o.data.message):(D=(_=o==null?void 0:o.data)==null?void 0:_.detail)!=null&&D.length&&Array.isArray((x=o==null?void 0:o.data)==null?void 0:x.detail)&&((O=(F=o==null?void 0:o.data)==null?void 0:F.detail[0])!=null&&O.msg)&&typeof((C=(I=o==null?void 0:o.data)==null?void 0:I.detail[0])==null?void 0:C.msg)=="string"?String(o.data.detail[0].msg):d},[d]);return{getErrorCode:m.useCallback(s=>{var y,R,_;const{response:o}=s||{};return o!=null&&o.error_code?String(o==null?void 0:o.error_code):(y=o==null?void 0:o.data)!=null&&y.error_code?String((R=o==null?void 0:o.data)==null?void 0:R.error_code):o!=null&&o.error_code?String(o==null?void 0:o.error_code):(_=o==null?void 0:o.data)!=null&&_.error_code?String(o.data.error_code):"unknown_error_code"},[]),printError:v}},Ze=({data:n,fetchNextPage:r,isFetchingNextPage:a,isInitialLoading:u,isLoading:f,enabled:d=!0})=>{const v=m.useCallback(async s=>{a||!d||await r({pageParam:(s==null?void 0:s.pageParam)||s.visibleRowsCount})},[d,r,a]),c=m.useMemo(()=>{if(n)return n.pages.reduce((s,o)=>[...s,...o],[])},[n]);return{fetchNextPageOnRowsScrollEnd:v,isLoading:a||f,loadingVariant:u?"skeleton":"linear",rows:c}},$e=n=>{const{libraries:r}=m.useContext(S),a=(n==null?void 0:n.axios)||(r==null?void 0:r.axios);if(a===void 0)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");return{clearAuthenticationToken:()=>{a.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:d,accessToken:v})=>{a.defaults.headers.common.Authorization=`${d} ${v}`}}},fe=(n,r="km")=>{const a=Number(n);return Number.isNaN(a)?`0 ${r}`:`${a.toFixed(2)} ${r}`},qe=n=>{const r=n&&typeof n=="object"&&"pathname"in n&&n.pathname?n.pathname:n;return typeof r=="string"?r!=null&&r.startsWith("/")?r!=null&&r.startsWith("/files")?r:`/files${r}`:r!=null&&r.startsWith("files")?`/${r}`:r!=null&&r.startsWith("files")?`/${r}`:`/files/${r}`:r},de=(n,r)=>{if(!n)return"";const a=qe(n),u=typeof n=="object"&&"pathname"in n?`${n.origin}${a}`:n;return typeof r=="number"?`${u.replace("/files",`/thumbs/${r}`)}`:u},et=n=>{const{apiURL:r,libraries:a}=m.useContext(S),u=(n==null?void 0:n.dayjs)||(a==null?void 0:a.dayjs);return{dateAdapter:(v,c="ll")=>{if(u===void 0)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return u(v).format(c)},distanceAdapter:fe,filePathAdapter:(v,c)=>de(r&&typeof v=="string"?{origin:r,pathname:v}:v,c)}},tt=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),rt=n=>{const u=n.split("/").filter(f=>f.length>0).map(f=>f.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join("")).join("");return u.charAt(0).toLowerCase()+u.slice(1)},nt=(n,r,a)=>{const u=rt(r),f=tt(a);return`${u}${f}`},ot=n=>{if(n)return(n==null?void 0:n.reduce((r,a)=>(r[a]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},r),{}))||{}},it=n=>{const{input:r="./openapi.json",operationsToGenerateInfiniteQueryHook:a=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:r,output:{client:"react-query",mode:"tags-split",override:{header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:nt,...(a==null?void 0:a.length)&&{operations:ot(a)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}},at=(n,r,a="ll")=>String(n(r).format(a));w.GTMSendPageView=Ve,w.InitializeAxiosConfig=Ue,w.InitializeDaysJSConfig=Xe,w.InitializeI18nConfig=Be,w.InitializeMapBoxConfig=Qe,w.InitializeSentryConfig=Ge,w.InjectDependenciesContext=S,w.InjectDependenciesProvider=Me,w.MaskTextField=Je,w.QueryClientProviderWithConfig=He,w.RequireAuth=ze,w.dateAdapter=at,w.distanceAdapter=fe,w.getOrvalConfig=it,w.useAdapter=et,w.useAuth=$e,w.useInfiniteDataGrid=Ze,w.useResponseError=Ke,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|