@tracktor/shared-module 0.20.0 → 0.21.1
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 -3
- package/dist/hooks/useResponseError/useResponseError.d.ts +1 -1
- package/dist/main.js +139 -142
- package/dist/main.umd.cjs +7 -7
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -28,7 +28,7 @@ export interface useResponseErrorParams {
|
|
|
28
28
|
* @param params
|
|
29
29
|
*/
|
|
30
30
|
export declare const useResponseError: <T = ResponseError>(params?: useResponseErrorParams) => {
|
|
31
|
+
getErrorCode: (error?: any) => string;
|
|
31
32
|
printError: (error?: any) => string;
|
|
32
|
-
printErrorCode: (error?: any) => string;
|
|
33
33
|
};
|
|
34
34
|
export default useResponseError;
|
package/dist/main.js
CHANGED
|
@@ -12,7 +12,7 @@ var ue = { exports: {} }, M = {};
|
|
|
12
12
|
var De;
|
|
13
13
|
function Rr() {
|
|
14
14
|
return De || (De = 1, process.env.NODE_ENV !== "production" && function() {
|
|
15
|
-
var t = Ne,
|
|
15
|
+
var t = Ne, o = Symbol.for("react.element"), i = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), n = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), k = Symbol.iterator, $ = "@@iterator";
|
|
16
16
|
function F(e) {
|
|
17
17
|
if (e === null || typeof e != "object")
|
|
18
18
|
return null;
|
|
@@ -22,14 +22,14 @@ function Rr() {
|
|
|
22
22
|
var j = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
23
23
|
function b(e) {
|
|
24
24
|
{
|
|
25
|
-
for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0),
|
|
26
|
-
a[
|
|
25
|
+
for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), u = 1; u < r; u++)
|
|
26
|
+
a[u - 1] = arguments[u];
|
|
27
27
|
_("error", e, a);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
function _(e, r, a) {
|
|
31
31
|
{
|
|
32
|
-
var
|
|
32
|
+
var u = j.ReactDebugCurrentFrame, p = u.getStackAddendum();
|
|
33
33
|
p !== "" && (r += "%s", a = a.concat([p]));
|
|
34
34
|
var g = a.map(function(d) {
|
|
35
35
|
return String(d);
|
|
@@ -40,16 +40,16 @@ function Rr() {
|
|
|
40
40
|
var ce = !1, le = !1, U = !1, We = !1, Me = !1, fe;
|
|
41
41
|
fe = Symbol.for("react.module.reference");
|
|
42
42
|
function Ve(e) {
|
|
43
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
43
|
+
return !!(typeof e == "string" || typeof e == "function" || e === s || e === v || Me || e === c || e === m || e === E || We || e === T || ce || le || U || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === C || e.$$typeof === h || e.$$typeof === n || e.$$typeof === l || // This needs to include all possible module reference object
|
|
44
44
|
// types supported by any Flight configuration anywhere since
|
|
45
45
|
// we don't know which Flight build this will end up being used
|
|
46
46
|
// with.
|
|
47
47
|
e.$$typeof === fe || e.getModuleId !== void 0));
|
|
48
48
|
}
|
|
49
49
|
function Ye(e, r, a) {
|
|
50
|
-
var
|
|
51
|
-
if (
|
|
52
|
-
return
|
|
50
|
+
var u = e.displayName;
|
|
51
|
+
if (u)
|
|
52
|
+
return u;
|
|
53
53
|
var p = r.displayName || r.name || "";
|
|
54
54
|
return p !== "" ? a + "(" + p + ")" : a;
|
|
55
55
|
}
|
|
@@ -64,9 +64,9 @@ function Rr() {
|
|
|
64
64
|
if (typeof e == "string")
|
|
65
65
|
return e;
|
|
66
66
|
switch (e) {
|
|
67
|
-
case
|
|
67
|
+
case s:
|
|
68
68
|
return "Fragment";
|
|
69
|
-
case
|
|
69
|
+
case i:
|
|
70
70
|
return "Portal";
|
|
71
71
|
case v:
|
|
72
72
|
return "Profiler";
|
|
@@ -88,8 +88,8 @@ function Rr() {
|
|
|
88
88
|
case l:
|
|
89
89
|
return Ye(e, e.render, "ForwardRef");
|
|
90
90
|
case C:
|
|
91
|
-
var
|
|
92
|
-
return
|
|
91
|
+
var u = e.displayName || null;
|
|
92
|
+
return u !== null ? u : P(e.type) || "Memo";
|
|
93
93
|
case O: {
|
|
94
94
|
var p = e, g = p._payload, d = p._init;
|
|
95
95
|
try {
|
|
@@ -170,8 +170,8 @@ function Rr() {
|
|
|
170
170
|
try {
|
|
171
171
|
throw Error();
|
|
172
172
|
} catch (p) {
|
|
173
|
-
var
|
|
174
|
-
Q =
|
|
173
|
+
var u = p.stack.trim().match(/\n( *(at )?)/);
|
|
174
|
+
Q = u && u[1] || "";
|
|
175
175
|
}
|
|
176
176
|
return `
|
|
177
177
|
` + Q + e;
|
|
@@ -190,7 +190,7 @@ function Rr() {
|
|
|
190
190
|
if (a !== void 0)
|
|
191
191
|
return a;
|
|
192
192
|
}
|
|
193
|
-
var
|
|
193
|
+
var u;
|
|
194
194
|
ee = !0;
|
|
195
195
|
var p = Error.prepareStackTrace;
|
|
196
196
|
Error.prepareStackTrace = void 0;
|
|
@@ -209,14 +209,14 @@ function Rr() {
|
|
|
209
209
|
try {
|
|
210
210
|
Reflect.construct(d, []);
|
|
211
211
|
} catch (A) {
|
|
212
|
-
|
|
212
|
+
u = A;
|
|
213
213
|
}
|
|
214
214
|
Reflect.construct(e, [], d);
|
|
215
215
|
} else {
|
|
216
216
|
try {
|
|
217
217
|
d.call();
|
|
218
218
|
} catch (A) {
|
|
219
|
-
|
|
219
|
+
u = A;
|
|
220
220
|
}
|
|
221
221
|
e.call(d.prototype);
|
|
222
222
|
}
|
|
@@ -224,14 +224,14 @@ function Rr() {
|
|
|
224
224
|
try {
|
|
225
225
|
throw Error();
|
|
226
226
|
} catch (A) {
|
|
227
|
-
|
|
227
|
+
u = A;
|
|
228
228
|
}
|
|
229
229
|
e();
|
|
230
230
|
}
|
|
231
231
|
} catch (A) {
|
|
232
|
-
if (A &&
|
|
232
|
+
if (A && u && typeof A.stack == "string") {
|
|
233
233
|
for (var f = A.stack.split(`
|
|
234
|
-
`), w =
|
|
234
|
+
`), w = u.stack.split(`
|
|
235
235
|
`), y = f.length - 1, R = w.length - 1; y >= 1 && R >= 0 && f[y] !== w[R]; )
|
|
236
236
|
R--;
|
|
237
237
|
for (; y >= 1 && R >= 0; y--, R--)
|
|
@@ -280,7 +280,7 @@ function Rr() {
|
|
|
280
280
|
case C:
|
|
281
281
|
return G(e.type, r, a);
|
|
282
282
|
case O: {
|
|
283
|
-
var
|
|
283
|
+
var u = e, p = u._payload, g = u._init;
|
|
284
284
|
try {
|
|
285
285
|
return G(g(p), r, a);
|
|
286
286
|
} catch {
|
|
@@ -297,7 +297,7 @@ function Rr() {
|
|
|
297
297
|
} else
|
|
298
298
|
we.setExtraStackFrame(null);
|
|
299
299
|
}
|
|
300
|
-
function Je(e, r, a,
|
|
300
|
+
function Je(e, r, a, u, p) {
|
|
301
301
|
{
|
|
302
302
|
var g = Function.call.bind(J);
|
|
303
303
|
for (var d in e)
|
|
@@ -305,14 +305,14 @@ function Rr() {
|
|
|
305
305
|
var f = void 0;
|
|
306
306
|
try {
|
|
307
307
|
if (typeof e[d] != "function") {
|
|
308
|
-
var w = Error((
|
|
308
|
+
var w = Error((u || "React class") + ": " + a + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
309
309
|
throw w.name = "Invariant Violation", w;
|
|
310
310
|
}
|
|
311
|
-
f = e[d](r, d,
|
|
311
|
+
f = e[d](r, d, u, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
312
312
|
} catch (y) {
|
|
313
313
|
f = y;
|
|
314
314
|
}
|
|
315
|
-
f && !(f instanceof Error) && (X(p), 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).",
|
|
315
|
+
f && !(f instanceof Error) && (X(p), 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).", u || "React class", a, d, typeof f), X(null)), f instanceof Error && !(f.message in _e) && (_e[f.message] = !0, X(p), b("Failed %s type: %s", a, f.message), X(null));
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
@@ -391,10 +391,10 @@ function Rr() {
|
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
var ar = function(e, r, a,
|
|
394
|
+
var ar = function(e, r, a, u, p, g, d) {
|
|
395
395
|
var f = {
|
|
396
396
|
// This tag allows us to uniquely identify this as a React Element
|
|
397
|
-
$$typeof:
|
|
397
|
+
$$typeof: o,
|
|
398
398
|
// Built-in properties that belong on the element
|
|
399
399
|
type: e,
|
|
400
400
|
key: r,
|
|
@@ -412,7 +412,7 @@ function Rr() {
|
|
|
412
412
|
configurable: !1,
|
|
413
413
|
enumerable: !1,
|
|
414
414
|
writable: !1,
|
|
415
|
-
value:
|
|
415
|
+
value: u
|
|
416
416
|
}), Object.defineProperty(f, "_source", {
|
|
417
417
|
configurable: !1,
|
|
418
418
|
enumerable: !1,
|
|
@@ -420,7 +420,7 @@ function Rr() {
|
|
|
420
420
|
value: p
|
|
421
421
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
422
422
|
};
|
|
423
|
-
function or(e, r, a,
|
|
423
|
+
function or(e, r, a, u, p) {
|
|
424
424
|
{
|
|
425
425
|
var g, d = {}, f = null, w = null;
|
|
426
426
|
a !== void 0 && (Te(a), f = "" + a), er(r) && (Te(r.key), f = "" + r.key), Qe(r) && (w = r.ref, rr(r, p));
|
|
@@ -435,7 +435,7 @@ function Rr() {
|
|
|
435
435
|
var R = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
436
436
|
f && tr(d, R), w && nr(d, R);
|
|
437
437
|
}
|
|
438
|
-
return ar(e, f, w, p,
|
|
438
|
+
return ar(e, f, w, p, u, W.current, d);
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
var ne = j.ReactCurrentOwner, je = j.ReactDebugCurrentFrame;
|
|
@@ -449,7 +449,7 @@ function Rr() {
|
|
|
449
449
|
var ae;
|
|
450
450
|
ae = !1;
|
|
451
451
|
function oe(e) {
|
|
452
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
452
|
+
return typeof e == "object" && e !== null && e.$$typeof === o;
|
|
453
453
|
}
|
|
454
454
|
function Pe() {
|
|
455
455
|
{
|
|
@@ -496,8 +496,8 @@ Check the top-level render call using <` + a + ">.");
|
|
|
496
496
|
if (Ae[a])
|
|
497
497
|
return;
|
|
498
498
|
Ae[a] = !0;
|
|
499
|
-
var
|
|
500
|
-
e && e._owner && e._owner !== ne.current && (
|
|
499
|
+
var u = "";
|
|
500
|
+
e && e._owner && e._owner !== ne.current && (u = " It was passed a child from " + P(e._owner.type) + "."), L(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.', a, u), L(null);
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
503
|
function ke(e, r) {
|
|
@@ -506,8 +506,8 @@ Check the top-level render call using <` + a + ">.");
|
|
|
506
506
|
return;
|
|
507
507
|
if (re(e))
|
|
508
508
|
for (var a = 0; a < e.length; a++) {
|
|
509
|
-
var
|
|
510
|
-
oe(
|
|
509
|
+
var u = e[a];
|
|
510
|
+
oe(u) && xe(u, r);
|
|
511
511
|
}
|
|
512
512
|
else if (oe(e))
|
|
513
513
|
e._store && (e._store.validated = !0);
|
|
@@ -534,8 +534,8 @@ Check the top-level render call using <` + a + ">.");
|
|
|
534
534
|
else
|
|
535
535
|
return;
|
|
536
536
|
if (a) {
|
|
537
|
-
var
|
|
538
|
-
Je(a, e.props, "prop",
|
|
537
|
+
var u = P(r);
|
|
538
|
+
Je(a, e.props, "prop", u, e);
|
|
539
539
|
} else if (r.PropTypes !== void 0 && !ae) {
|
|
540
540
|
ae = !0;
|
|
541
541
|
var p = P(r);
|
|
@@ -547,16 +547,16 @@ Check the top-level render call using <` + a + ">.");
|
|
|
547
547
|
function cr(e) {
|
|
548
548
|
{
|
|
549
549
|
for (var r = Object.keys(e.props), a = 0; a < r.length; a++) {
|
|
550
|
-
var
|
|
551
|
-
if (
|
|
552
|
-
L(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
|
|
550
|
+
var u = r[a];
|
|
551
|
+
if (u !== "children" && u !== "key") {
|
|
552
|
+
L(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), L(null);
|
|
553
553
|
break;
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
e.ref !== null && (L(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), L(null));
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
function $e(e, r, a,
|
|
559
|
+
function $e(e, r, a, u, p, g) {
|
|
560
560
|
{
|
|
561
561
|
var d = Ve(e);
|
|
562
562
|
if (!d) {
|
|
@@ -565,7 +565,7 @@ Check the top-level render call using <` + a + ">.");
|
|
|
565
565
|
var w = ir(p);
|
|
566
566
|
w ? f += w : f += Pe();
|
|
567
567
|
var y;
|
|
568
|
-
e === null ? y = "null" : re(e) ? y = "array" : e !== void 0 && e.$$typeof ===
|
|
568
|
+
e === null ? y = "null" : re(e) ? y = "array" : e !== void 0 && e.$$typeof === o ? (y = "<" + (P(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : y = 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", y, f);
|
|
569
569
|
}
|
|
570
570
|
var R = or(e, r, a, p, g);
|
|
571
571
|
if (R == null)
|
|
@@ -573,7 +573,7 @@ Check the top-level render call using <` + a + ">.");
|
|
|
573
573
|
if (d) {
|
|
574
574
|
var S = r.children;
|
|
575
575
|
if (S !== void 0)
|
|
576
|
-
if (
|
|
576
|
+
if (u)
|
|
577
577
|
if (re(S)) {
|
|
578
578
|
for (var I = 0; I < S.length; I++)
|
|
579
579
|
ke(S[I], e);
|
|
@@ -583,7 +583,7 @@ Check the top-level render call using <` + a + ">.");
|
|
|
583
583
|
else
|
|
584
584
|
ke(S, e);
|
|
585
585
|
}
|
|
586
|
-
return e ===
|
|
586
|
+
return e === s ? cr(R) : sr(R), R;
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
function lr(e, r, a) {
|
|
@@ -593,7 +593,7 @@ Check the top-level render call using <` + a + ">.");
|
|
|
593
593
|
return $e(e, r, a, !1);
|
|
594
594
|
}
|
|
595
595
|
var dr = fr, vr = lr;
|
|
596
|
-
M.Fragment =
|
|
596
|
+
M.Fragment = s, M.jsx = dr, M.jsxs = vr;
|
|
597
597
|
}()), M;
|
|
598
598
|
}
|
|
599
599
|
var V = {};
|
|
@@ -611,18 +611,18 @@ function br() {
|
|
|
611
611
|
if (Le)
|
|
612
612
|
return V;
|
|
613
613
|
Le = 1;
|
|
614
|
-
var t = Ne,
|
|
614
|
+
var t = Ne, o = Symbol.for("react.element"), i = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, c = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
615
615
|
function h(n, l, m) {
|
|
616
616
|
var E, C = {}, O = null, T = null;
|
|
617
617
|
m !== void 0 && (O = "" + m), l.key !== void 0 && (O = "" + l.key), l.ref !== void 0 && (T = l.ref);
|
|
618
618
|
for (E in l)
|
|
619
|
-
|
|
619
|
+
s.call(l, E) && !v.hasOwnProperty(E) && (C[E] = l[E]);
|
|
620
620
|
if (n && n.defaultProps)
|
|
621
621
|
for (E in l = n.defaultProps, l)
|
|
622
622
|
C[E] === void 0 && (C[E] = l[E]);
|
|
623
|
-
return { $$typeof:
|
|
623
|
+
return { $$typeof: o, type: n, key: O, ref: T, props: C, _owner: c.current };
|
|
624
624
|
}
|
|
625
|
-
return V.Fragment =
|
|
625
|
+
return V.Fragment = i, V.jsx = h, V.jsxs = h, V;
|
|
626
626
|
}
|
|
627
627
|
process.env.NODE_ENV === "production" ? ue.exports = br() : ue.exports = Rr();
|
|
628
628
|
var x = ue.exports;
|
|
@@ -637,9 +637,9 @@ const q = pr({
|
|
|
637
637
|
useLocation: void 0
|
|
638
638
|
}), jr = ({
|
|
639
639
|
axios: t,
|
|
640
|
-
children:
|
|
641
|
-
translate:
|
|
642
|
-
useAuth:
|
|
640
|
+
children: o,
|
|
641
|
+
translate: i,
|
|
642
|
+
useAuth: s,
|
|
643
643
|
Outlet: c,
|
|
644
644
|
Navigate: v,
|
|
645
645
|
useLocation: h,
|
|
@@ -652,19 +652,19 @@ const q = pr({
|
|
|
652
652
|
axios: t,
|
|
653
653
|
Navigate: v,
|
|
654
654
|
Outlet: c,
|
|
655
|
-
translate:
|
|
656
|
-
useAuth:
|
|
655
|
+
translate: i,
|
|
656
|
+
useAuth: s,
|
|
657
657
|
useGoogleTagManager: n,
|
|
658
658
|
useLocation: h
|
|
659
659
|
}),
|
|
660
|
-
[v, c, l, t,
|
|
660
|
+
[v, c, l, t, i, s, n, h]
|
|
661
661
|
);
|
|
662
|
-
return /* @__PURE__ */ x.jsx(q.Provider, { value: m, children:
|
|
662
|
+
return /* @__PURE__ */ x.jsx(q.Provider, { value: m, children: o });
|
|
663
663
|
}, H = (t) => `RequireAuth require « ${t} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Pr = ({
|
|
664
664
|
Fallback: t,
|
|
665
|
-
loginPath:
|
|
666
|
-
localStorageKey:
|
|
667
|
-
redirect401Path:
|
|
665
|
+
loginPath: o = "/login",
|
|
666
|
+
localStorageKey: i = "user",
|
|
667
|
+
redirect401Path: s = "/login",
|
|
668
668
|
...c
|
|
669
669
|
}) => {
|
|
670
670
|
var $, F, j, b;
|
|
@@ -689,46 +689,46 @@ const q = pr({
|
|
|
689
689
|
(_) => _,
|
|
690
690
|
async (_) => {
|
|
691
691
|
var U;
|
|
692
|
-
return typeof _ == "object" && _ && "response" in _ && _.response && typeof _.response == "object" && "status" in _.response && _.response && typeof _.response == "object" && "status" in _.response && ((U = _ == null ? void 0 : _.response) == null ? void 0 : U.status) === 401 && (v.defaults.headers.common.Authorization = null, localStorage.removeItem(
|
|
692
|
+
return typeof _ == "object" && _ && "response" in _ && _.response && typeof _.response == "object" && "status" in _.response && _.response && typeof _.response == "object" && "status" in _.response && ((U = _ == null ? void 0 : _.response) == null ? void 0 : U.status) === 401 && (v.defaults.headers.common.Authorization = null, localStorage.removeItem(i), C(s)), Promise.reject(_);
|
|
693
693
|
}
|
|
694
694
|
));
|
|
695
|
-
}, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response,
|
|
695
|
+
}, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response, i, s]), O && !E ? /* @__PURE__ */ x.jsx(Er, { fallback: t, children: (F = ($ = T.state) == null ? void 0 : $.from) != null && F.state && ((b = (j = T.state) == null ? void 0 : j.from) == null ? void 0 : b.pathname) === o ? /* @__PURE__ */ x.jsx(m, { to: T.state.from.state.from.pathname + T.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ x.jsx(l, {}) }) : /* @__PURE__ */ x.jsx(m, { to: o, state: { from: T }, replace: !0 });
|
|
696
696
|
}, ie = (t) => `GTMSendPageView require « ${t} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Ar = ({ ...t }) => {
|
|
697
697
|
const {
|
|
698
|
-
useLocation:
|
|
699
|
-
Outlet:
|
|
700
|
-
useGoogleTagManager:
|
|
698
|
+
useLocation: o = t.useLocation,
|
|
699
|
+
Outlet: i = t.Outlet,
|
|
700
|
+
useGoogleTagManager: s = t.useGoogleTagManager
|
|
701
701
|
} = K(q);
|
|
702
|
-
if (i === void 0)
|
|
703
|
-
throw new Error(ie("useLocation"));
|
|
704
702
|
if (o === void 0)
|
|
703
|
+
throw new Error(ie("useLocation"));
|
|
704
|
+
if (i === void 0)
|
|
705
705
|
throw new Error(ie("Outlet"));
|
|
706
|
-
if (
|
|
706
|
+
if (s === void 0)
|
|
707
707
|
throw new Error(ie("useGoogleTagManager"));
|
|
708
|
-
const { pathname: c } =
|
|
708
|
+
const { pathname: c } = o(), { sendEvent: v } = s();
|
|
709
709
|
return yr(() => {
|
|
710
710
|
v({ event: "pageView", pathname: c });
|
|
711
|
-
}, [c, v]), /* @__PURE__ */ x.jsx(
|
|
711
|
+
}, [c, v]), /* @__PURE__ */ x.jsx(i, {});
|
|
712
712
|
}, xr = ({
|
|
713
713
|
axios: t,
|
|
714
|
-
baseURL:
|
|
715
|
-
tokenTypeKey:
|
|
716
|
-
userLocalStorageKey:
|
|
714
|
+
baseURL: o,
|
|
715
|
+
tokenTypeKey: i = "tokenType",
|
|
716
|
+
userLocalStorageKey: s = "user",
|
|
717
717
|
tokenKey: c = "accessToken",
|
|
718
718
|
postContentType: v = "application/json"
|
|
719
719
|
}) => {
|
|
720
720
|
if (!t.defaults)
|
|
721
721
|
return null;
|
|
722
|
-
const h = localStorage.getItem(
|
|
723
|
-
return t.defaults.baseURL =
|
|
722
|
+
const h = localStorage.getItem(s), n = h ? JSON.parse(h) : null, l = n != null && n[i] ? n[i] : null, m = n != null && n[c] ? n[c] : null, E = h ? `${l} ${m}` : null;
|
|
723
|
+
return t.defaults.baseURL = o, t.defaults.headers.post["Content-Type"] = v, E && (t.defaults.headers.common.Authorization = E), null;
|
|
724
724
|
}, kr = ({
|
|
725
725
|
i18n: t,
|
|
726
|
-
debug:
|
|
727
|
-
initReactI18next:
|
|
728
|
-
resources:
|
|
726
|
+
debug: o,
|
|
727
|
+
initReactI18next: i,
|
|
728
|
+
resources: s,
|
|
729
729
|
LanguageDetector: c
|
|
730
|
-
}) => (t != null && t.isInitialized || (t.use(c).use(
|
|
731
|
-
debug:
|
|
730
|
+
}) => (t != null && t.isInitialized || (t.use(c).use(i).init({
|
|
731
|
+
debug: o,
|
|
732
732
|
fallbackLng: "en",
|
|
733
733
|
interpolation: {
|
|
734
734
|
escapeValue: !1
|
|
@@ -738,7 +738,7 @@ const q = pr({
|
|
|
738
738
|
bindI18n: !1,
|
|
739
739
|
useSuspense: !0
|
|
740
740
|
},
|
|
741
|
-
resources:
|
|
741
|
+
resources: s,
|
|
742
742
|
returnNull: !1
|
|
743
743
|
}).then(() => {
|
|
744
744
|
document.documentElement.lang !== t.resolvedLanguage && t.resolvedLanguage && document.documentElement.setAttribute("lang", t.resolvedLanguage);
|
|
@@ -746,22 +746,22 @@ const q = pr({
|
|
|
746
746
|
document.documentElement.setAttribute("lang", v);
|
|
747
747
|
})), null), $r = ({
|
|
748
748
|
dsn: t,
|
|
749
|
-
sentry:
|
|
750
|
-
integrations:
|
|
751
|
-
tracesSampleRate:
|
|
749
|
+
sentry: o,
|
|
750
|
+
integrations: i,
|
|
751
|
+
tracesSampleRate: s,
|
|
752
752
|
routingInstrumentationDependencies: c,
|
|
753
753
|
replaysSessionSampleRate: v,
|
|
754
754
|
replaysOnErrorSampleRate: h,
|
|
755
755
|
tracePropagationTargets: n,
|
|
756
756
|
ignoreErrors: l,
|
|
757
757
|
debug: m
|
|
758
|
-
}) => (
|
|
758
|
+
}) => (o.isInitialized() || (m || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && o.init({
|
|
759
759
|
debug: m,
|
|
760
760
|
dsn: t,
|
|
761
761
|
ignoreErrors: l || [/Failed to fetch dynamically imported module/],
|
|
762
762
|
integrations: [
|
|
763
|
-
new
|
|
764
|
-
routingInstrumentation:
|
|
763
|
+
new o.BrowserTracing({
|
|
764
|
+
routingInstrumentation: o.reactRouterV6Instrumentation(
|
|
765
765
|
c.useEffect,
|
|
766
766
|
c.useLocation,
|
|
767
767
|
c.useNavigationType,
|
|
@@ -769,80 +769,77 @@ const q = pr({
|
|
|
769
769
|
c.matchRoutes
|
|
770
770
|
)
|
|
771
771
|
}),
|
|
772
|
-
|
|
773
|
-
...
|
|
772
|
+
o.replayIntegration(),
|
|
773
|
+
...i || []
|
|
774
774
|
],
|
|
775
775
|
replaysOnErrorSampleRate: h || 1,
|
|
776
776
|
replaysSessionSampleRate: v || 0.1,
|
|
777
777
|
tracePropagationTargets: n,
|
|
778
|
-
tracesSampleRate:
|
|
779
|
-
}), null), Fr = ({ IMaskMixin: t, ...
|
|
780
|
-
const
|
|
778
|
+
tracesSampleRate: s || 1
|
|
779
|
+
}), null), Fr = ({ IMaskMixin: t, ...o }) => {
|
|
780
|
+
const i = se(
|
|
781
781
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
782
|
-
() => t(({ TextField:
|
|
782
|
+
() => t(({ TextField: s, ...c }) => /* @__PURE__ */ x.jsx(s, { ...c })),
|
|
783
783
|
[t]
|
|
784
784
|
);
|
|
785
|
-
return /* @__PURE__ */ x.jsx(
|
|
786
|
-
}, Dr = ({ mapbox: t, accessToken:
|
|
785
|
+
return /* @__PURE__ */ x.jsx(i, { ...o });
|
|
786
|
+
}, Dr = ({ mapbox: t, accessToken: o }) => (t && o && (t.accessToken = o), null), Lr = ({
|
|
787
787
|
children: t,
|
|
788
|
-
defaultOptions:
|
|
789
|
-
QueryClient:
|
|
790
|
-
QueryClientProvider:
|
|
788
|
+
defaultOptions: o,
|
|
789
|
+
QueryClient: i,
|
|
790
|
+
QueryClientProvider: s
|
|
791
791
|
}) => {
|
|
792
|
-
const c = new
|
|
792
|
+
const c = new i({
|
|
793
793
|
defaultOptions: {
|
|
794
794
|
queries: {
|
|
795
795
|
refetchOnWindowFocus: !1,
|
|
796
796
|
retry: 3,
|
|
797
|
-
...
|
|
797
|
+
...o
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
800
|
});
|
|
801
|
-
return /* @__PURE__ */ x.jsx(
|
|
801
|
+
return /* @__PURE__ */ x.jsx(s, { client: c, children: t });
|
|
802
802
|
}, Ir = (t) => {
|
|
803
|
-
const { unknownErrorTranslationKey:
|
|
803
|
+
const { unknownErrorTranslationKey: o = "error.unknownError" } = t || {}, { translate: i = t == null ? void 0 : t.translate } = K(q), s = i ? i(o) : "Unknown error", c = Y(
|
|
804
804
|
(h) => {
|
|
805
805
|
var l, m, E, C, O, T, k, $, F;
|
|
806
806
|
const { response: n } = h || {};
|
|
807
|
-
return n != null && n.reason ? String(n.reason) : (l = n == null ? void 0 : n.data) != null && l.reason ? String(n.data.reason) : (m = n == null ? void 0 : n.data) != null && m.message ? String(n.data.message) : (C = (E = n == null ? void 0 : n.data) == null ? void 0 : E.detail) != null && C.length && Array.isArray((O = n == null ? void 0 : n.data) == null ? void 0 : O.detail) && ((k = (T = n == null ? void 0 : n.data) == null ? void 0 : T.detail[0]) != null && k.msg) && typeof ((F = ($ = n == null ? void 0 : n.data) == null ? void 0 : $.detail[0]) == null ? void 0 : F.msg) == "string" ? String(n.data.detail[0].msg) :
|
|
808
|
-
},
|
|
809
|
-
[u]
|
|
810
|
-
), v = Y(
|
|
811
|
-
(h) => {
|
|
812
|
-
var l, m, E;
|
|
813
|
-
const { response: n } = h || {};
|
|
814
|
-
return o && (n != null && n.error_code) ? o(n == null ? void 0 : n.error_code) : o && ((l = n == null ? void 0 : n.data) != null && l.error_code) ? o((m = n == null ? void 0 : n.data) == null ? void 0 : m.error_code) : n != null && n.error_code ? String(n == null ? void 0 : n.error_code) : (E = n == null ? void 0 : n.data) != null && E.error_code ? String(n.data.error_code) : u;
|
|
807
|
+
return n != null && n.reason ? String(n.reason) : (l = n == null ? void 0 : n.data) != null && l.reason ? String(n.data.reason) : (m = n == null ? void 0 : n.data) != null && m.message ? String(n.data.message) : (C = (E = n == null ? void 0 : n.data) == null ? void 0 : E.detail) != null && C.length && Array.isArray((O = n == null ? void 0 : n.data) == null ? void 0 : O.detail) && ((k = (T = n == null ? void 0 : n.data) == null ? void 0 : T.detail[0]) != null && k.msg) && typeof ((F = ($ = n == null ? void 0 : n.data) == null ? void 0 : $.detail[0]) == null ? void 0 : F.msg) == "string" ? String(n.data.detail[0].msg) : s;
|
|
815
808
|
},
|
|
816
|
-
[
|
|
809
|
+
[s]
|
|
817
810
|
);
|
|
818
|
-
return {
|
|
811
|
+
return { getErrorCode: Y((h) => {
|
|
812
|
+
var l, m, E;
|
|
813
|
+
const { response: n } = h || {};
|
|
814
|
+
return n != null && n.error_code ? String(n == null ? void 0 : n.error_code) : (l = n == null ? void 0 : n.data) != null && l.error_code ? String((m = n == null ? void 0 : n.data) == null ? void 0 : m.error_code) : n != null && n.error_code ? String(n == null ? void 0 : n.error_code) : (E = n == null ? void 0 : n.data) != null && E.error_code ? String(n.data.error_code) : "unknown_error_code";
|
|
815
|
+
}, []), printError: c };
|
|
819
816
|
}, Nr = ({
|
|
820
817
|
data: t,
|
|
821
|
-
fetchNextPage:
|
|
822
|
-
isFetchingNextPage:
|
|
823
|
-
isInitialLoading:
|
|
818
|
+
fetchNextPage: o,
|
|
819
|
+
isFetchingNextPage: i,
|
|
820
|
+
isInitialLoading: s,
|
|
824
821
|
isLoading: c,
|
|
825
822
|
enabled: v = !0
|
|
826
823
|
}) => {
|
|
827
824
|
const h = Y(
|
|
828
825
|
async (l) => {
|
|
829
|
-
|
|
826
|
+
i || !v || await o({ pageParam: (l == null ? void 0 : l.pageParam) || l.visibleRowsCount });
|
|
830
827
|
},
|
|
831
|
-
[v,
|
|
828
|
+
[v, o, i]
|
|
832
829
|
), n = se(() => {
|
|
833
830
|
if (t)
|
|
834
831
|
return t.pages.reduce((l, m) => [...l, ...m], []);
|
|
835
832
|
}, [t]);
|
|
836
833
|
return {
|
|
837
834
|
fetchNextPageOnRowsScrollEnd: h,
|
|
838
|
-
isLoading:
|
|
839
|
-
loadingVariant:
|
|
835
|
+
isLoading: i || c,
|
|
836
|
+
loadingVariant: s ? "skeleton" : "linear",
|
|
840
837
|
rows: n
|
|
841
838
|
};
|
|
842
839
|
}, Wr = (t) => {
|
|
843
|
-
const
|
|
844
|
-
({ tokenType:
|
|
845
|
-
t.defaults.headers.common.Authorization = `${
|
|
840
|
+
const o = Y(
|
|
841
|
+
({ tokenType: s, accessToken: c }) => {
|
|
842
|
+
t.defaults.headers.common.Authorization = `${s} ${c}`;
|
|
846
843
|
},
|
|
847
844
|
[t.defaults.headers.common]
|
|
848
845
|
);
|
|
@@ -850,59 +847,59 @@ const q = pr({
|
|
|
850
847
|
clearAuthenticationToken: Y(() => {
|
|
851
848
|
t.defaults.headers.common.Authorization = null;
|
|
852
849
|
}, [t.defaults.headers.common]),
|
|
853
|
-
setAuthenticationToken:
|
|
850
|
+
setAuthenticationToken: o
|
|
854
851
|
};
|
|
855
|
-
}, _r = (t,
|
|
856
|
-
const
|
|
857
|
-
return Number.isNaN(
|
|
858
|
-
}, Ie = (t,
|
|
852
|
+
}, _r = (t, o = "km") => {
|
|
853
|
+
const i = Number(t);
|
|
854
|
+
return Number.isNaN(i) ? `0 ${o}` : `${i.toFixed(2)} ${o}`;
|
|
855
|
+
}, Ie = (t, o) => {
|
|
859
856
|
if (!t)
|
|
860
857
|
return "";
|
|
861
|
-
const
|
|
862
|
-
return typeof
|
|
858
|
+
const i = typeof t == "object" && "pathname" in t ? `${t.origin}${t.pathname}` : t;
|
|
859
|
+
return typeof o == "number" ? `${i.replace("/files", `/thumbs/${o}`)}` : i;
|
|
863
860
|
}, Mr = () => {
|
|
864
861
|
const { apiURL: t } = K(q);
|
|
865
862
|
return {
|
|
866
863
|
distanceAdapter: _r,
|
|
867
|
-
filePathAdapter: (
|
|
864
|
+
filePathAdapter: (i, s) => Ie(t && typeof i == "string" ? { origin: t, pathname: i } : i, s)
|
|
868
865
|
};
|
|
869
866
|
}, wr = (t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase(), Cr = (t) => {
|
|
870
|
-
const
|
|
871
|
-
return
|
|
872
|
-
}, Tr = (t,
|
|
873
|
-
const
|
|
874
|
-
return `${
|
|
867
|
+
const s = t.split("/").filter((c) => c.length > 0).map((c) => c.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((l) => l.charAt(0).toUpperCase() + l.slice(1)).join("")).join("");
|
|
868
|
+
return s.charAt(0).toLowerCase() + s.slice(1);
|
|
869
|
+
}, Tr = (t, o, i) => {
|
|
870
|
+
const s = Cr(o), c = wr(i);
|
|
871
|
+
return `${s}${c}`;
|
|
875
872
|
}, Or = (t) => {
|
|
876
873
|
if (t)
|
|
877
|
-
return (t == null ? void 0 : t.reduce((
|
|
874
|
+
return (t == null ? void 0 : t.reduce((o, i) => (o[i] = {
|
|
878
875
|
query: {
|
|
879
876
|
useInfinite: !0,
|
|
880
877
|
useInfiniteQueryParam: "offset"
|
|
881
878
|
}
|
|
882
|
-
},
|
|
879
|
+
}, o), {})) || {};
|
|
883
880
|
}, Vr = (t) => {
|
|
884
|
-
const { input:
|
|
881
|
+
const { input: o = "./openapi.json", operationsToGenerateInfiniteQueryHook: i = void 0 } = t || {};
|
|
885
882
|
return {
|
|
886
883
|
api: {
|
|
887
884
|
hooks: {
|
|
888
885
|
afterAllFilesWrite: "prettier src/api/ --write"
|
|
889
886
|
},
|
|
890
|
-
input:
|
|
887
|
+
input: o,
|
|
891
888
|
output: {
|
|
892
889
|
client: "react-query",
|
|
893
890
|
mode: "tags-split",
|
|
894
891
|
override: {
|
|
895
|
-
header: (
|
|
892
|
+
header: (s) => [
|
|
896
893
|
"Generated by orval 🍺",
|
|
897
|
-
...
|
|
898
|
-
...
|
|
894
|
+
...s.title ? [s.title] : [],
|
|
895
|
+
...s.description ? [s.description] : []
|
|
899
896
|
],
|
|
900
897
|
mutator: {
|
|
901
898
|
name: "axiosCustomInstance",
|
|
902
899
|
path: `${__dirname}/config/orval/mutator/axiosCustomInstance.ts`
|
|
903
900
|
},
|
|
904
901
|
operationName: Tr,
|
|
905
|
-
...(
|
|
902
|
+
...(i == null ? void 0 : i.length) && { operations: Or(i) },
|
|
906
903
|
query: {
|
|
907
904
|
useQuery: !0
|
|
908
905
|
}
|
package/dist/main.umd.cjs
CHANGED
|
@@ -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 Me(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var t=h,
|
|
10
|
-
`+te+e}}var ne=!1,X;{var lr=typeof WeakMap=="function"?WeakMap:Map;X=new lr}function we(e,r){if(!e||ne)return"";{var a=X.get(e);if(a!==void 0)return a}var
|
|
11
|
-
`),T=
|
|
9
|
+
*/var ce;function Me(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var t=h,o=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),n=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),F=Symbol.iterator,I="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[I];return typeof r=="function"?r:null}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var r=arguments.length,a=new Array(r>1?r-1:0),u=1;u<r;u++)a[u-1]=arguments[u];w("error",e,a)}}function w(e,r,a){{var u=k.ReactDebugCurrentFrame,p=u.getStackAddendum();p!==""&&(r+="%s",a=a.concat([p]));var g=a.map(function(d){return String(d)});g.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,g)}}var de=!1,ve=!1,J=!1,ar=!1,or=!1,pe;pe=Symbol.for("react.module.reference");function ir(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===v||or||e===c||e===m||e===y||ar||e===O||de||ve||J||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===S||e.$$typeof===E||e.$$typeof===n||e.$$typeof===l||e.$$typeof===pe||e.getModuleId!==void 0))}function ur(e,r,a){var u=e.displayName;if(u)return u;var p=r.displayName||r.name||"";return p!==""?a+"("+p+")":a}function ge(e){return e.displayName||"Context"}function x(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 s:return"Fragment";case i:return"Portal";case v:return"Profiler";case c:return"StrictMode";case m:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n:var r=e;return ge(r)+".Consumer";case E:var a=e;return ge(a._context)+".Provider";case l:return ur(e,e.render,"ForwardRef");case S:var u=e.displayName||null;return u!==null?u:x(e.type)||"Memo";case j:{var p=e,g=p._payload,d=p._init;try{return x(d(g))}catch{return null}}}return null}var N=Object.assign,z=0,me,he,Ee,ye,be,Re,_e;function Ce(){}Ce.__reactDisabledLog=!0;function sr(){{if(z===0){me=console.log,he=console.info,Ee=console.warn,ye=console.error,be=console.group,Re=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})}z++}}function cr(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:N({},e,{value:me}),info:N({},e,{value:he}),warn:N({},e,{value:Ee}),error:N({},e,{value:ye}),group:N({},e,{value:be}),groupCollapsed:N({},e,{value:Re}),groupEnd:N({},e,{value:_e})})}z<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=k.ReactCurrentDispatcher,te;function $(e,r,a){{if(te===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);te=u&&u[1]||""}return`
|
|
10
|
+
`+te+e}}var ne=!1,X;{var lr=typeof WeakMap=="function"?WeakMap:Map;X=new lr}function we(e,r){if(!e||ne)return"";{var a=X.get(e);if(a!==void 0)return a}var u;ne=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=re.current,re.current=null,sr();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(D){u=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){u=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){u=D}e()}}catch(D){if(D&&u&&typeof D.stack=="string"){for(var f=D.stack.split(`
|
|
11
|
+
`),T=u.stack.split(`
|
|
12
12
|
`),R=f.length-1,_=T.length-1;R>=1&&_>=0&&f[R]!==T[_];)_--;for(;R>=1&&_>=0;R--,_--)if(f[R]!==T[_]){if(R!==1||_!==1)do if(R--,_--,_<0||f[R]!==T[_]){var P=`
|
|
13
|
-
`+f[R].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&X.set(e,P),P}while(R>=1&&_>=0);break}}}finally{ne=!1,re.current=g,cr(),Error.prepareStackTrace=p}var V=e?e.displayName||e.name:"",Ne=V?$(V):"";return typeof e=="function"&&X.set(e,Ne),Ne}function fr(e,r,a){return we(e,!1)}function dr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function H(e,r,a){if(e==null)return"";if(typeof e=="function")return we(e,dr(e));if(typeof e=="string")return $(e);switch(e){case m:return $("Suspense");case y:return $("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return fr(e.render);case
|
|
13
|
+
`+f[R].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&X.set(e,P),P}while(R>=1&&_>=0);break}}}finally{ne=!1,re.current=g,cr(),Error.prepareStackTrace=p}var V=e?e.displayName||e.name:"",Ne=V?$(V):"";return typeof e=="function"&&X.set(e,Ne),Ne}function fr(e,r,a){return we(e,!1)}function dr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function H(e,r,a){if(e==null)return"";if(typeof e=="function")return we(e,dr(e));if(typeof e=="string")return $(e);switch(e){case m:return $("Suspense");case y:return $("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return fr(e.render);case S:return H(e.type,r,a);case j:{var u=e,p=u._payload,g=u._init;try{return H(g(p),r,a)}catch{}}}return""}var K=Object.prototype.hasOwnProperty,Te={},Se=k.ReactDebugCurrentFrame;function Z(e){if(e){var r=e._owner,a=H(e.type,e._source,r?r.type:null);Se.setExtraStackFrame(a)}else Se.setExtraStackFrame(null)}function vr(e,r,a,u,p){{var g=Function.call.bind(K);for(var d in e)if(g(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((u||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}f=e[d](r,d,u,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){f=R}f&&!(f instanceof Error)&&(Z(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).",u||"React class",a,d,typeof f),Z(null)),f instanceof Error&&!(f.message in Te)&&(Te[f.message]=!0,Z(p),C("Failed %s type: %s",a,f.message),Z(null))}}}var pr=Array.isArray;function ae(e){return pr(e)}function gr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,a=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function mr(e){try{return Oe(e),!1}catch{return!0}}function Oe(e){return""+e}function je(e){if(mr(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",gr(e)),Oe(e)}var B=k.ReactCurrentOwner,hr={key:!0,ref:!0,__self:!0,__source:!0},Pe,Ae,oe;oe={};function Er(e){if(K.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function yr(e){if(K.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function br(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var a=x(B.current.type);oe[a]||(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',x(B.current.type),e.ref),oe[a]=!0)}}function Rr(e,r){{var a=function(){Pe||(Pe=!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)",r))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function _r(e,r){{var a=function(){Ae||(Ae=!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)",r))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var Cr=function(e,r,a,u,p,g,d){var f={$$typeof:o,type:e,key:r,ref:a,props:d,_owner:g};return f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(f,"_self",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function wr(e,r,a,u,p){{var g,d={},f=null,T=null;a!==void 0&&(je(a),f=""+a),yr(r)&&(je(r.key),f=""+r.key),Er(r)&&(T=r.ref,br(r,p));for(g in r)K.call(r,g)&&!hr.hasOwnProperty(g)&&(d[g]=r[g]);if(e&&e.defaultProps){var R=e.defaultProps;for(g in R)d[g]===void 0&&(d[g]=R[g])}if(f||T){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Rr(d,_),T&&_r(d,_)}return Cr(e,f,T,p,u,B.current,d)}}var ie=k.ReactCurrentOwner,ke=k.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,a=H(e.type,e._source,r?r.type:null);ke.setExtraStackFrame(a)}else ke.setExtraStackFrame(null)}var ue;ue=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function xe(){{if(ie.current){var e=x(ie.current.type);if(e)return`
|
|
14
14
|
|
|
15
15
|
Check the render method of \``+e+"`."}return""}}function Tr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),a=e.lineNumber;return`
|
|
16
16
|
|
|
17
|
-
Check your code at `+r+":"+a+"."}return""}}var De={};function
|
|
17
|
+
Check your code at `+r+":"+a+"."}return""}}var De={};function Sr(e){{var r=xe();if(!r){var a=typeof e=="string"?e:e.displayName||e.name;a&&(r=`
|
|
18
18
|
|
|
19
|
-
Check the top-level render call using <`+a+">.")}return r}}function Fe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=
|
|
19
|
+
Check the top-level render call using <`+a+">.")}return r}}function Fe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=Sr(r);if(De[a])return;De[a]=!0;var u="";e&&e._owner&&e._owner!==ie.current&&(u=" It was passed a child from "+x(e._owner.type)+"."),W(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.',a,u),W(null)}}function Ie(e,r){{if(typeof e!="object")return;if(ae(e))for(var a=0;a<e.length;a++){var u=e[a];se(u)&&Fe(u,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var p=L(e);if(typeof p=="function"&&p!==e.entries)for(var g=p.call(e),d;!(d=g.next()).done;)se(d.value)&&Fe(d.value,r)}}}function Or(e){{var r=e.type;if(r==null||typeof r=="string")return;var a;if(typeof r=="function")a=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===S))a=r.propTypes;else return;if(a){var u=x(r);vr(a,e.props,"prop",u,e)}else if(r.PropTypes!==void 0&&!ue){ue=!0;var p=x(r);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function jr(e){{for(var r=Object.keys(e.props),a=0;a<r.length;a++){var u=r[a];if(u!=="children"&&u!=="key"){W(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",u),W(null);break}}e.ref!==null&&(W(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Le(e,r,a,u,p,g){{var d=ir(e);if(!d){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" 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=Tr(p);T?f+=T:f+=xe();var R;e===null?R="null":ae(e)?R="array":e!==void 0&&e.$$typeof===o?(R="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):R=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",R,f)}var _=wr(e,r,a,p,g);if(_==null)return _;if(d){var P=r.children;if(P!==void 0)if(u)if(ae(P)){for(var V=0;V<P.length;V++)Ie(P[V],e);Object.freeze&&Object.freeze(P)}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 Ie(P,e)}return e===s?jr(_):Or(_),_}}function Pr(e,r,a){return Le(e,r,a,!0)}function Ar(e,r,a){return Le(e,r,a,!1)}var kr=Ar,xr=Pr;Y.Fragment=s,Y.jsx=kr,Y.jsxs=xr}()),Y}var U={};/**
|
|
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 r}}function Fe(e,r){{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 We(){if(le)return U;le=1;var t=h,
|
|
27
|
+
*/var le;function We(){if(le)return U;le=1;var t=h,o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,c=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function E(n,l,m){var y,S={},j=null,O=null;m!==void 0&&(j=""+m),l.key!==void 0&&(j=""+l.key),l.ref!==void 0&&(O=l.ref);for(y in l)s.call(l,y)&&!v.hasOwnProperty(y)&&(S[y]=l[y]);if(n&&n.defaultProps)for(y in l=n.defaultProps,l)S[y]===void 0&&(S[y]=l[y]);return{$$typeof:o,type:n,key:j,ref:O,props:S,_owner:c.current}}return U.Fragment=i,U.jsx=E,U.jsxs=E,U}process.env.NODE_ENV==="production"?q.exports=We():q.exports=Me();var A=q.exports;const M=h.createContext({apiURL:void 0,axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ve=({axios:t,children:o,translate:i,useAuth:s,Outlet:c,Navigate:v,useLocation:E,useGoogleTagManager:n,apiURL:l})=>{const m=h.useMemo(()=>({apiURL:l,axios:t,Navigate:v,Outlet:c,translate:i,useAuth:s,useGoogleTagManager:n,useLocation:E}),[v,c,l,t,i,s,n,E]);return A.jsx(M.Provider,{value:m,children:o})},G=t=>`RequireAuth require « ${t} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ye=({Fallback:t,loginPath:o="/login",localStorageKey:i="user",redirect401Path:s="/login",...c})=>{var I,L,k,C;const{axios:v=c.axios,useLocation:E=c.useLocation,useAuth:n=c.useAuth,Outlet:l=c.Outlet,Navigate:m=c.Navigate}=h.useContext(M);if(n===void 0)throw new Error(G("useAuth"));if(E===void 0)throw new Error(G("useLocation"));if(l===void 0)throw new Error(G("Outlet"));if(m===void 0)throw new Error(G("Navigate"));const[y,S]=h.useState(null),{isLogged:j}=n(),O=E(),F=h.useRef(!1);return h.useLayoutEffect(()=>{F.current||(F.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var J;return typeof w=="object"&&w&&"response"in w&&w.response&&typeof w.response=="object"&&"status"in w.response&&w.response&&typeof w.response=="object"&&"status"in w.response&&((J=w==null?void 0:w.response)==null?void 0:J.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(i),S(s)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,i,s]),j&&!y?A.jsx(h.Suspense,{fallback:t,children:(L=(I=O.state)==null?void 0:I.from)!=null&&L.state&&((C=(k=O.state)==null?void 0:k.from)==null?void 0:C.pathname)===o?A.jsx(m,{to:O.state.from.state.from.pathname+O.state.from.state.from.search,replace:!0}):A.jsx(l,{})}):A.jsx(m,{to:o,state:{from:O},replace:!0})},Q=t=>`GTMSendPageView require « ${t} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ue=({...t})=>{const{useLocation:o=t.useLocation,Outlet:i=t.Outlet,useGoogleTagManager:s=t.useGoogleTagManager}=h.useContext(M);if(o===void 0)throw new Error(Q("useLocation"));if(i===void 0)throw new Error(Q("Outlet"));if(s===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:c}=o(),{sendEvent:v}=s();return h.useEffect(()=>{v({event:"pageView",pathname:c})},[c,v]),A.jsx(i,{})},ze=({axios:t,baseURL:o,tokenTypeKey:i="tokenType",userLocalStorageKey:s="user",tokenKey:c="accessToken",postContentType:v="application/json"})=>{if(!t.defaults)return null;const E=localStorage.getItem(s),n=E?JSON.parse(E):null,l=n!=null&&n[i]?n[i]:null,m=n!=null&&n[c]?n[c]:null,y=E?`${l} ${m}`:null;return t.defaults.baseURL=o,t.defaults.headers.post["Content-Type"]=v,y&&(t.defaults.headers.common.Authorization=y),null},Be=({i18n:t,debug:o,initReactI18next:i,resources:s,LanguageDetector:c})=>(t!=null&&t.isInitialized||(t.use(c).use(i).init({debug:o,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:s,returnNull:!1}).then(()=>{document.documentElement.lang!==t.resolvedLanguage&&t.resolvedLanguage&&document.documentElement.setAttribute("lang",t.resolvedLanguage)}),t.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ge=({dsn:t,sentry:o,integrations:i,tracesSampleRate:s,routingInstrumentationDependencies:c,replaysSessionSampleRate:v,replaysOnErrorSampleRate:E,tracePropagationTargets:n,ignoreErrors:l,debug:m})=>(o.isInitialized()||(m||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&o.init({debug:m,dsn:t,ignoreErrors:l||[/Failed to fetch dynamically imported module/],integrations:[new o.BrowserTracing({routingInstrumentation:o.reactRouterV6Instrumentation(c.useEffect,c.useLocation,c.useNavigationType,c.createRoutesFromChildren,c.matchRoutes)}),o.replayIntegration(),...i||[]],replaysOnErrorSampleRate:E||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:n,tracesSampleRate:s||1}),null),Je=({IMaskMixin:t,...o})=>{const i=h.useMemo(()=>t(({TextField:s,...c})=>A.jsx(s,{...c})),[t]);return A.jsx(i,{...o})},$e=({mapbox:t,accessToken:o})=>(t&&o&&(t.accessToken=o),null),Xe=({children:t,defaultOptions:o,QueryClient:i,QueryClientProvider:s})=>{const c=new i({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...o}}});return A.jsx(s,{client:c,children:t})},He=t=>{const{unknownErrorTranslationKey:o="error.unknownError"}=t||{},{translate:i=t==null?void 0:t.translate}=h.useContext(M),s=i?i(o):"Unknown error",c=h.useCallback(E=>{var l,m,y,S,j,O,F,I,L;const{response:n}=E||{};return n!=null&&n.reason?String(n.reason):(l=n==null?void 0:n.data)!=null&&l.reason?String(n.data.reason):(m=n==null?void 0:n.data)!=null&&m.message?String(n.data.message):(S=(y=n==null?void 0:n.data)==null?void 0:y.detail)!=null&&S.length&&Array.isArray((j=n==null?void 0:n.data)==null?void 0:j.detail)&&((F=(O=n==null?void 0:n.data)==null?void 0:O.detail[0])!=null&&F.msg)&&typeof((L=(I=n==null?void 0:n.data)==null?void 0:I.detail[0])==null?void 0:L.msg)=="string"?String(n.data.detail[0].msg):s},[s]);return{getErrorCode:h.useCallback(E=>{var l,m,y;const{response:n}=E||{};return n!=null&&n.error_code?String(n==null?void 0:n.error_code):(l=n==null?void 0:n.data)!=null&&l.error_code?String((m=n==null?void 0:n.data)==null?void 0:m.error_code):n!=null&&n.error_code?String(n==null?void 0:n.error_code):(y=n==null?void 0:n.data)!=null&&y.error_code?String(n.data.error_code):"unknown_error_code"},[]),printError:c}},Ke=({data:t,fetchNextPage:o,isFetchingNextPage:i,isInitialLoading:s,isLoading:c,enabled:v=!0})=>{const E=h.useCallback(async l=>{i||!v||await o({pageParam:(l==null?void 0:l.pageParam)||l.visibleRowsCount})},[v,o,i]),n=h.useMemo(()=>{if(t)return t.pages.reduce((l,m)=>[...l,...m],[])},[t]);return{fetchNextPageOnRowsScrollEnd:E,isLoading:i||c,loadingVariant:s?"skeleton":"linear",rows:n}},Ze=t=>{const o=h.useCallback(({tokenType:s,accessToken:c})=>{t.defaults.headers.common.Authorization=`${s} ${c}`},[t.defaults.headers.common]);return{clearAuthenticationToken:h.useCallback(()=>{t.defaults.headers.common.Authorization=null},[t.defaults.headers.common]),setAuthenticationToken:o}},fe=(t,o="km")=>{const i=Number(t);return Number.isNaN(i)?`0 ${o}`:`${i.toFixed(2)} ${o}`},ee=(t,o)=>{if(!t)return"";const i=typeof t=="object"&&"pathname"in t?`${t.origin}${t.pathname}`:t;return typeof o=="number"?`${i.replace("/files",`/thumbs/${o}`)}`:i},qe=()=>{const{apiURL:t}=h.useContext(M);return{distanceAdapter:fe,filePathAdapter:(i,s)=>ee(t&&typeof i=="string"?{origin:t,pathname:i}:i,s)}},Qe=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),er=t=>{const s=t.split("/").filter(c=>c.length>0).map(c=>c.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")).join("");return s.charAt(0).toLowerCase()+s.slice(1)},rr=(t,o,i)=>{const s=er(o),c=Qe(i);return`${s}${c}`},tr=t=>{if(t)return(t==null?void 0:t.reduce((o,i)=>(o[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},o),{}))||{}},nr=t=>{const{input:o="./openapi.json",operationsToGenerateInfiniteQueryHook:i=void 0}=t||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:o,output:{client:"react-query",mode:"tags-split",override:{header:s=>["Generated by orval 🍺",...s.title?[s.title]:[],...s.description?[s.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:rr,...(i==null?void 0:i.length)&&{operations:tr(i)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};b.AxiosConfig=ze,b.GTMSendPageView=Ue,b.I18nConfig=Be,b.InjectDependenciesContext=M,b.InjectDependenciesProvider=Ve,b.MapBoxConfig=$e,b.MaskTextField=Je,b.QueryClientConfigProvider=Xe,b.RequireAuth=Ye,b.SentryConfig=Ge,b.distanceAdapter=fe,b.filePathAdapter=ee,b.getOrvalConfig=nr,b.useAdapter=qe,b.useAuth=Ze,b.useInfiniteDataGrid=Ke,b.useResponseError=He,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tracktor/shared-module",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"types": "./dist/main.d.ts",
|
|
7
7
|
"main": "./dist/main.umd.cjs",
|
|
8
8
|
"module": "./dist/main.js",
|
|
9
|
-
"engines": {
|
|
10
|
-
"node": ">=20 <22"
|
|
11
|
-
},
|
|
12
9
|
"files": [
|
|
13
10
|
"dist"
|
|
14
11
|
],
|