@tracktor/shared-module 0.18.2 → 0.18.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 CHANGED
@@ -1,4 +1,4 @@
1
1
  # [Versions](https://github.com/Tracktor/shared-module/releases)
2
2
 
3
- ## v0.18.2
4
- - **[fix]** : export entry point
3
+ ## v0.18.3
4
+ - **[fix]** : filePathAdapter import
package/dist/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import Ne, { createContext as gr, useMemo as se, useContext as ce, useState as mr, useRef as hr, useLayoutEffect as Er, Suspense as yr, useEffect as Rr, useCallback as U } from "react";
1
+ import Ne, { createContext as gr, useMemo as se, useContext as ce, useState as mr, useRef as hr, useLayoutEffect as Er, Suspense as yr, useEffect as _r, useCallback as U } from "react";
2
2
  var ue = { exports: {} }, M = {};
3
3
  /**
4
4
  * @license React
@@ -10,17 +10,17 @@ var ue = { exports: {} }, M = {};
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
  var Ie;
13
- function _r() {
13
+ function Rr() {
14
14
  return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
15
- var a = Ne, i = Symbol.for("react.element"), o = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), t = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), h = 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
- function D(e) {
15
+ var a = Ne, i = Symbol.for("react.element"), o = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), t = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), k = Symbol.iterator, D = "@@iterator";
16
+ function $(e) {
17
17
  if (e === null || typeof e != "object")
18
18
  return null;
19
- var r = k && e[k] || e[$];
19
+ var r = k && e[k] || e[D];
20
20
  return typeof r == "function" ? r : null;
21
21
  }
22
22
  var j = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
23
- function _(e) {
23
+ function R(e) {
24
24
  {
25
25
  for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
26
26
  n[s - 1] = arguments[s];
@@ -59,7 +59,7 @@ function _r() {
59
59
  function P(e) {
60
60
  if (e == null)
61
61
  return null;
62
- if (typeof e.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
62
+ if (typeof e.tag == "number" && R("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;
@@ -101,18 +101,18 @@ function _r() {
101
101
  }
102
102
  return null;
103
103
  }
104
- var F = Object.assign, N = 0, pe, ge, me, he, Ee, ye, Re;
105
- function _e() {
104
+ var F = Object.assign, N = 0, pe, ge, me, he, Ee, ye, _e;
105
+ function Re() {
106
106
  }
107
- _e.__reactDisabledLog = !0;
107
+ Re.__reactDisabledLog = !0;
108
108
  function qe() {
109
109
  {
110
110
  if (N === 0) {
111
- pe = console.log, ge = console.info, me = console.warn, he = console.error, Ee = console.group, ye = console.groupCollapsed, Re = console.groupEnd;
111
+ pe = console.log, ge = console.info, me = console.warn, he = console.error, Ee = console.group, ye = console.groupCollapsed, _e = console.groupEnd;
112
112
  var e = {
113
113
  configurable: !0,
114
114
  enumerable: !0,
115
- value: _e,
115
+ value: Re,
116
116
  writable: !0
117
117
  };
118
118
  Object.defineProperties(console, {
@@ -156,11 +156,11 @@ function _r() {
156
156
  value: ye
157
157
  }),
158
158
  groupEnd: F({}, e, {
159
- value: Re
159
+ value: _e
160
160
  })
161
161
  });
162
162
  }
163
- N < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
163
+ N < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
164
164
  }
165
165
  }
166
166
  var Z = j.ReactCurrentDispatcher, Q;
@@ -232,18 +232,18 @@ function _r() {
232
232
  if (x && s && typeof x.stack == "string") {
233
233
  for (var f = x.stack.split(`
234
234
  `), w = s.stack.split(`
235
- `), y = f.length - 1, R = w.length - 1; y >= 1 && R >= 0 && f[y] !== w[R]; )
236
- R--;
237
- for (; y >= 1 && R >= 0; y--, R--)
238
- if (f[y] !== w[R]) {
239
- if (y !== 1 || R !== 1)
235
+ `), y = f.length - 1, _ = w.length - 1; y >= 1 && _ >= 0 && f[y] !== w[_]; )
236
+ _--;
237
+ for (; y >= 1 && _ >= 0; y--, _--)
238
+ if (f[y] !== w[_]) {
239
+ if (y !== 1 || _ !== 1)
240
240
  do
241
- if (y--, R--, R < 0 || f[y] !== w[R]) {
241
+ if (y--, _--, _ < 0 || f[y] !== w[_]) {
242
242
  var S = `
243
243
  ` + f[y].replace(" at new ", " at ");
244
244
  return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && B.set(e, S), S;
245
245
  }
246
- while (y >= 1 && R >= 0);
246
+ while (y >= 1 && _ >= 0);
247
247
  break;
248
248
  }
249
249
  }
@@ -312,7 +312,7 @@ function _r() {
312
312
  } catch (y) {
313
313
  f = y;
314
314
  }
315
- f && !(f instanceof Error) && (X(p), _("%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).", s || "React class", n, d, typeof f), X(null)), f instanceof Error && !(f.message in we) && (we[f.message] = !0, X(p), _("Failed %s type: %s", n, f.message), X(null));
315
+ f && !(f instanceof Error) && (X(p), R("%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).", s || "React class", n, d, typeof f), X(null)), f instanceof Error && !(f.message in we) && (we[f.message] = !0, X(p), R("Failed %s type: %s", n, f.message), X(null));
316
316
  }
317
317
  }
318
318
  }
@@ -338,7 +338,7 @@ function _r() {
338
338
  }
339
339
  function Oe(e) {
340
340
  if (Ze(e))
341
- return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), Te(e);
341
+ return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), Te(e);
342
342
  }
343
343
  var V = j.ReactCurrentOwner, Qe = {
344
344
  key: !0,
@@ -366,13 +366,13 @@ function _r() {
366
366
  function tr(e, r) {
367
367
  if (typeof e.ref == "string" && V.current && r && V.current.stateNode !== r) {
368
368
  var n = P(V.current.type);
369
- te[n] || (_('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', P(V.current.type), e.ref), te[n] = !0);
369
+ te[n] || (R('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', P(V.current.type), e.ref), te[n] = !0);
370
370
  }
371
371
  }
372
372
  function nr(e, r) {
373
373
  {
374
374
  var n = function() {
375
- Se || (Se = !0, _("%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));
375
+ Se || (Se = !0, R("%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));
376
376
  };
377
377
  n.isReactWarning = !0, Object.defineProperty(e, "key", {
378
378
  get: n,
@@ -383,7 +383,7 @@ function _r() {
383
383
  function ar(e, r) {
384
384
  {
385
385
  var n = function() {
386
- je || (je = !0, _("%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));
386
+ je || (je = !0, R("%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));
387
387
  };
388
388
  n.isReactWarning = !0, Object.defineProperty(e, "ref", {
389
389
  get: n,
@@ -432,8 +432,8 @@ function _r() {
432
432
  d[g] === void 0 && (d[g] = y[g]);
433
433
  }
434
434
  if (f || w) {
435
- var R = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
436
- f && nr(d, R), w && ar(d, R);
435
+ var _ = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
436
+ f && nr(d, _), w && ar(d, _);
437
437
  }
438
438
  return or(e, f, w, p, s, V.current, d);
439
439
  }
@@ -497,10 +497,10 @@ Check the top-level render call using <` + n + ">.");
497
497
  return;
498
498
  Ae[n] = !0;
499
499
  var s = "";
500
- e && e._owner && e._owner !== ne.current && (s = " It was passed a child from " + P(e._owner.type) + "."), I(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, s), I(null);
500
+ e && e._owner && e._owner !== ne.current && (s = " It was passed a child from " + P(e._owner.type) + "."), I(e), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, s), I(null);
501
501
  }
502
502
  }
503
- function $e(e, r) {
503
+ function De(e, r) {
504
504
  {
505
505
  if (typeof e != "object")
506
506
  return;
@@ -512,7 +512,7 @@ Check the top-level render call using <` + n + ">.");
512
512
  else if (oe(e))
513
513
  e._store && (e._store.validated = !0);
514
514
  else if (e) {
515
- var p = D(e);
515
+ var p = $(e);
516
516
  if (typeof p == "function" && p !== e.entries)
517
517
  for (var g = p.call(e), d; !(d = g.next()).done; )
518
518
  oe(d.value) && ke(d.value, r);
@@ -539,9 +539,9 @@ Check the top-level render call using <` + n + ">.");
539
539
  } else if (r.PropTypes !== void 0 && !ae) {
540
540
  ae = !0;
541
541
  var p = P(r);
542
- _("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
542
+ R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
543
543
  }
544
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
544
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
545
545
  }
546
546
  }
547
547
  function lr(e) {
@@ -549,14 +549,14 @@ Check the top-level render call using <` + n + ">.");
549
549
  for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
550
550
  var s = r[n];
551
551
  if (s !== "children" && s !== "key") {
552
- I(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), I(null);
552
+ I(e), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), I(null);
553
553
  break;
554
554
  }
555
555
  }
556
- e.ref !== null && (I(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), I(null));
556
+ e.ref !== null && (I(e), R("Invalid attribute `ref` supplied to `React.Fragment`."), I(null));
557
557
  }
558
558
  }
559
- function De(e, r, n, s, p, g) {
559
+ function $e(e, r, n, s, p, g) {
560
560
  {
561
561
  var d = Ye(e);
562
562
  if (!d) {
@@ -565,32 +565,32 @@ Check the top-level render call using <` + n + ">.");
565
565
  var w = ur(p);
566
566
  w ? f += w : f += xe();
567
567
  var y;
568
- e === null ? y = "null" : re(e) ? y = "array" : e !== void 0 && e.$$typeof === i ? (y = "<" + (P(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", y, f);
568
+ e === null ? y = "null" : re(e) ? y = "array" : e !== void 0 && e.$$typeof === i ? (y = "<" + (P(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, R("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
- var R = ir(e, r, n, p, g);
571
- if (R == null)
572
- return R;
570
+ var _ = ir(e, r, n, p, g);
571
+ if (_ == null)
572
+ return _;
573
573
  if (d) {
574
574
  var S = r.children;
575
575
  if (S !== void 0)
576
576
  if (s)
577
577
  if (re(S)) {
578
578
  for (var L = 0; L < S.length; L++)
579
- $e(S[L], e);
579
+ De(S[L], e);
580
580
  Object.freeze && Object.freeze(S);
581
581
  } else
582
- _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
582
+ R("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
- $e(S, e);
584
+ De(S, e);
585
585
  }
586
- return e === u ? lr(R) : cr(R), R;
586
+ return e === u ? lr(_) : cr(_), _;
587
587
  }
588
588
  }
589
589
  function fr(e, r, n) {
590
- return De(e, r, n, !0);
590
+ return $e(e, r, n, !0);
591
591
  }
592
592
  function dr(e, r, n) {
593
- return De(e, r, n, !1);
593
+ return $e(e, r, n, !1);
594
594
  }
595
595
  var vr = dr, pr = fr;
596
596
  M.Fragment = u, M.jsx = vr, M.jsxs = pr;
@@ -624,7 +624,7 @@ function br() {
624
624
  }
625
625
  return Y.Fragment = o, Y.jsx = m, Y.jsxs = m, Y;
626
626
  }
627
- process.env.NODE_ENV === "production" ? ue.exports = br() : ue.exports = _r();
627
+ process.env.NODE_ENV === "production" ? ue.exports = br() : ue.exports = Rr();
628
628
  var A = ue.exports;
629
629
  const K = gr({
630
630
  axios: void 0,
@@ -634,7 +634,7 @@ const K = gr({
634
634
  translate: void 0,
635
635
  useAuth: void 0,
636
636
  useLocation: void 0
637
- }), Pr = ({
637
+ }), xr = ({
638
638
  axios: a,
639
639
  children: i,
640
640
  translate: o,
@@ -657,14 +657,14 @@ const K = gr({
657
657
  [v, c, a, o, u, t, m]
658
658
  );
659
659
  return /* @__PURE__ */ A.jsx(K.Provider, { value: l, children: i });
660
- }, H = (a) => `RequireAuth require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, xr = ({
660
+ }, H = (a) => `RequireAuth require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Ar = ({
661
661
  Fallback: a,
662
662
  loginPath: i = "/login",
663
663
  localStorageKey: o = "user",
664
664
  redirect401Path: u = "/login",
665
665
  ...c
666
666
  }) => {
667
- var $, D, j, _;
667
+ var D, $, j, R;
668
668
  const {
669
669
  axios: v = c.axios,
670
670
  useLocation: m = c.useLocation,
@@ -689,8 +689,8 @@ const K = gr({
689
689
  return typeof b == "object" && b && "response" in b && b.response && typeof b.response == "object" && "status" in b.response && b.response && typeof b.response == "object" && "status" in b.response && ((q = b == null ? void 0 : b.response) == null ? void 0 : q.status) === 401 && (v.defaults.headers.common.Authorization = null, localStorage.removeItem(o), C(u)), Promise.reject(b);
690
690
  }
691
691
  ));
692
- }, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response, o, u]), O && !h ? /* @__PURE__ */ A.jsx(yr, { fallback: a, children: (D = ($ = T.state) == null ? void 0 : $.from) != null && D.state && ((_ = (j = T.state) == null ? void 0 : j.from) == null ? void 0 : _.pathname) === i ? /* @__PURE__ */ A.jsx(E, { to: T.state.from.state.from.pathname + T.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ A.jsx(l, {}) }) : /* @__PURE__ */ A.jsx(E, { to: i, state: { from: T }, replace: !0 });
693
- }, ie = (a) => `GTMSendPageView require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Ar = ({ ...a }) => {
692
+ }, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response, o, u]), O && !h ? /* @__PURE__ */ A.jsx(yr, { fallback: a, children: ($ = (D = T.state) == null ? void 0 : D.from) != null && $.state && ((R = (j = T.state) == null ? void 0 : j.from) == null ? void 0 : R.pathname) === i ? /* @__PURE__ */ A.jsx(E, { to: T.state.from.state.from.pathname + T.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ A.jsx(l, {}) }) : /* @__PURE__ */ A.jsx(E, { to: i, state: { from: T }, replace: !0 });
693
+ }, ie = (a) => `GTMSendPageView require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, kr = ({ ...a }) => {
694
694
  const {
695
695
  useLocation: i = a.useLocation,
696
696
  Outlet: o = a.Outlet,
@@ -703,10 +703,10 @@ const K = gr({
703
703
  if (u === void 0)
704
704
  throw new Error(ie("useGoogleTagManager"));
705
705
  const { pathname: c } = i(), { sendEvent: v } = u();
706
- return Rr(() => {
706
+ return _r(() => {
707
707
  v({ event: "pageView", pathname: c });
708
708
  }, [c, v]), /* @__PURE__ */ A.jsx(o, {});
709
- }, kr = ({
709
+ }, Dr = ({
710
710
  axios: a,
711
711
  baseURL: i,
712
712
  tokenTypeKey: o = "tokenType",
@@ -741,7 +741,7 @@ const K = gr({
741
741
  document.documentElement.lang !== a.resolvedLanguage && a.resolvedLanguage && document.documentElement.setAttribute("lang", a.resolvedLanguage);
742
742
  }), a.on("languageChanged", (v) => {
743
743
  document.documentElement.setAttribute("lang", v);
744
- })), null), Dr = ({
744
+ })), null), Fr = ({
745
745
  dsn: a,
746
746
  sentry: i,
747
747
  integrations: o,
@@ -773,14 +773,14 @@ const K = gr({
773
773
  replaysSessionSampleRate: v || 0.1,
774
774
  tracePropagationTargets: t,
775
775
  tracesSampleRate: u || 1
776
- }), null), Fr = ({ IMaskMixin: a, ...i }) => {
776
+ }), null), Ir = ({ IMaskMixin: a, ...i }) => {
777
777
  const o = se(
778
778
  // eslint-disable-next-line react/jsx-props-no-spreading
779
779
  () => a(({ TextField: u, ...c }) => /* @__PURE__ */ A.jsx(u, { ...c })),
780
780
  [a]
781
781
  );
782
782
  return /* @__PURE__ */ A.jsx(o, { ...i });
783
- }, Ir = ({ mapbox: a, accessToken: i }) => (a && i && (a.accessToken = i), null), Lr = ({
783
+ }, Lr = ({ mapbox: a, accessToken: i }) => (a && i && (a.accessToken = i), null), Wr = ({
784
784
  children: a,
785
785
  defaultOptions: i,
786
786
  QueryClient: o,
@@ -796,12 +796,12 @@ const K = gr({
796
796
  }
797
797
  });
798
798
  return /* @__PURE__ */ A.jsx(u, { client: c, children: a });
799
- }, Wr = (a) => {
799
+ }, Nr = (a) => {
800
800
  const { unknownErrorTranslationKey: i = "error.unknownError" } = a || {}, { translate: o = a == null ? void 0 : a.translate } = ce(K), u = o ? o(i) : "Unknown error", c = U(
801
801
  (m) => {
802
- var l, E, h, C, O, T, k, $, D;
802
+ var l, E, h, C, O, T, k, D, $;
803
803
  const { response: t } = m || {};
804
- return t != null && t.reason ? String(t.reason) : (l = t == null ? void 0 : t.data) != null && l.reason ? String(t.data.reason) : (E = t == null ? void 0 : t.data) != null && E.message ? String(t.data.message) : (C = (h = t == null ? void 0 : t.data) == null ? void 0 : h.detail) != null && C.length && Array.isArray((O = t == null ? void 0 : t.data) == null ? void 0 : O.detail) && ((k = (T = t == null ? void 0 : t.data) == null ? void 0 : T.detail[0]) != null && k.msg) && typeof ((D = ($ = t == null ? void 0 : t.data) == null ? void 0 : $.detail[0]) == null ? void 0 : D.msg) == "string" ? String(t.data.detail[0].msg) : u;
804
+ return t != null && t.reason ? String(t.reason) : (l = t == null ? void 0 : t.data) != null && l.reason ? String(t.data.reason) : (E = t == null ? void 0 : t.data) != null && E.message ? String(t.data.message) : (C = (h = t == null ? void 0 : t.data) == null ? void 0 : h.detail) != null && C.length && Array.isArray((O = t == null ? void 0 : t.data) == null ? void 0 : O.detail) && ((k = (T = t == null ? void 0 : t.data) == null ? void 0 : T.detail[0]) != null && k.msg) && typeof (($ = (D = t == null ? void 0 : t.data) == null ? void 0 : D.detail[0]) == null ? void 0 : $.msg) == "string" ? String(t.data.detail[0].msg) : u;
805
805
  },
806
806
  [u]
807
807
  ), v = U(
@@ -813,7 +813,7 @@ const K = gr({
813
813
  [u, o]
814
814
  );
815
815
  return { printError: c, printErrorCode: v };
816
- }, Nr = ({
816
+ }, Vr = ({
817
817
  data: a,
818
818
  fetchNextPage: i,
819
819
  isFetchingNextPage: o,
@@ -836,7 +836,7 @@ const K = gr({
836
836
  loadingVariant: u ? "skeleton" : "linear",
837
837
  rows: t
838
838
  };
839
- }, Vr = (a) => {
839
+ }, Mr = (a) => {
840
840
  const i = U(
841
841
  ({ tokenType: u, accessToken: c }) => {
842
842
  a.defaults.headers.common.Authorization = `${u} ${c}`;
@@ -863,7 +863,7 @@ const K = gr({
863
863
  useInfiniteQueryParam: "offset"
864
864
  }
865
865
  }, i), {})) || {};
866
- }, Mr = (a) => {
866
+ }, Yr = (a) => {
867
867
  const { input: i = "./openapi.json", operationsToGenerateInfiniteQueryHook: o = void 0 } = a || {};
868
868
  return {
869
869
  api: {
@@ -913,26 +913,28 @@ const K = gr({
913
913
  "vite-plugin-dts": "^3.7.3",
914
914
  "vite-plugin-static-copy": "^0.17.1",
915
915
  vitest: "^1.3.1"
916
- }, Sr = () => "react-native" in W && W["react-native"] && "expo" in W && W.expo ? process.env.EXPO_PUBLIC_API_URL : "react" in W && W.react && "vite" in We && We.vite ? imprort.meta.env.VITE_API_URL : "", Yr = (a, i) => {
916
+ };
917
+ var Sr = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
918
+ const jr = () => "react-native" in W && W["react-native"] && "expo" in W && W.expo ? process.env.EXPO_PUBLIC_API_URL : "react" in W && W.react && "vite" in We && We.vite ? Sr.VITE_API_URL : "", Ur = (a, i) => {
917
919
  if (!a)
918
920
  return "";
919
- const o = a.startsWith("/") ? a : `/${a}`, u = Sr();
921
+ const o = a.startsWith("/") ? a : `/${a}`, u = jr();
920
922
  return typeof i == "number" ? `${u}${o.replace("/files", `/thumbs/${i}`)}` : `${u}${o}`;
921
923
  };
922
924
  export {
923
- kr as AxiosConfig,
924
- Ar as GTMSendPageView,
925
+ Dr as AxiosConfig,
926
+ kr as GTMSendPageView,
925
927
  $r as I18nConfig,
926
928
  K as InjectDependenciesContext,
927
- Pr as InjectDependenciesProvider,
928
- Ir as MapBoxConfig,
929
- Fr as MaskTextField,
930
- Lr as QueryClientConfigProvider,
931
- xr as RequireAuth,
932
- Dr as SentryConfig,
933
- Yr as filePathAdapter,
934
- Mr as getOrvalConfig,
935
- Vr as useAuth,
936
- Nr as useInfiniteDataGrid,
937
- Wr as useResponseError
929
+ xr as InjectDependenciesProvider,
930
+ Lr as MapBoxConfig,
931
+ Ir as MaskTextField,
932
+ Wr as QueryClientConfigProvider,
933
+ Ar as RequireAuth,
934
+ Fr as SentryConfig,
935
+ Ur as filePathAdapter,
936
+ Yr as getOrvalConfig,
937
+ Mr as useAuth,
938
+ Vr as useInfiniteDataGrid,
939
+ Nr as useResponseError
938
940
  };
package/dist/main.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(b,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(b=typeof globalThis<"u"?globalThis:b||self,E(b["@tracktor/shared-module"]={},b.React))})(this,function(b,E){"use strict";var Q={exports:{}},Y={};/**
1
+ (function(R,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(R=typeof globalThis<"u"?globalThis:R||self,E(R["@tracktor/shared-module"]={},R.React))})(this,function(R,E){"use strict";var Q={exports:{}},Y={};/**
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 We(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var a=E,i=Symbol.for("react.element"),o=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),t=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),I=Symbol.iterator,F="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=I&&e[I]||e[F];return typeof r=="function"?r:null}var A=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];w("error",e,n)}}function w(e,r,n){{var s=A.ReactDebugCurrentFrame,p=s.getStackAddendum();p!==""&&(r+="%s",n=n.concat([p]));var g=n.map(function(d){return String(d)});g.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,g)}}var de=!1,ve=!1,$=!1,or=!1,ir=!1,pe;pe=Symbol.for("react.module.reference");function ur(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===v||ir||e===c||e===y||e===h||or||e===S||de||ve||$||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===O||e.$$typeof===m||e.$$typeof===t||e.$$typeof===l||e.$$typeof===pe||e.getModuleId!==void 0))}function sr(e,r,n){var s=e.displayName;if(s)return s;var p=r.displayName||r.name||"";return p!==""?n+"("+p+")":n}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 u:return"Fragment";case o:return"Portal";case v:return"Profiler";case c:return"StrictMode";case y:return"Suspense";case h:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case t:var r=e;return ge(r)+".Consumer";case m:var n=e;return ge(n._context)+".Provider";case l:return sr(e,e.render,"ForwardRef");case O:var s=e.displayName||null;return s!==null?s: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 M=Object.assign,B=0,me,he,Ee,ye,be,Re,_e;function Ce(){}Ce.__reactDisabledLog=!0;function cr(){{if(B===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})}B++}}function lr(){{if(B--,B===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:me}),info:M({},e,{value:he}),warn:M({},e,{value:Ee}),error:M({},e,{value:ye}),group:M({},e,{value:be}),groupCollapsed:M({},e,{value:Re}),groupEnd:M({},e,{value:_e})})}B<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=A.ReactCurrentDispatcher,te;function X(e,r,n){{if(te===void 0)try{throw Error()}catch(p){var s=p.stack.trim().match(/\n( *(at )?)/);te=s&&s[1]||""}return`
10
- `+te+e}}var ne=!1,H;{var fr=typeof WeakMap=="function"?WeakMap:Map;H=new fr}function we(e,r){if(!e||ne)return"";{var n=H.get(e);if(n!==void 0)return n}var s;ne=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=re.current,re.current=null,cr();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){s=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){s=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){s=D}e()}}catch(D){if(D&&s&&typeof D.stack=="string"){for(var f=D.stack.split(`
9
+ */var ce;function We(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var a=E,i=Symbol.for("react.element"),o=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),t=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),I=Symbol.iterator,F="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=I&&e[I]||e[F];return typeof r=="function"?r:null}var A=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];w("error",e,n)}}function w(e,r,n){{var s=A.ReactDebugCurrentFrame,p=s.getStackAddendum();p!==""&&(r+="%s",n=n.concat([p]));var g=n.map(function(d){return String(d)});g.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,g)}}var de=!1,ve=!1,$=!1,ir=!1,ur=!1,pe;pe=Symbol.for("react.module.reference");function sr(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===v||ur||e===c||e===y||e===h||ir||e===S||de||ve||$||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===O||e.$$typeof===m||e.$$typeof===t||e.$$typeof===l||e.$$typeof===pe||e.getModuleId!==void 0))}function cr(e,r,n){var s=e.displayName;if(s)return s;var p=r.displayName||r.name||"";return p!==""?n+"("+p+")":n}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 u:return"Fragment";case o:return"Portal";case v:return"Profiler";case c:return"StrictMode";case y:return"Suspense";case h:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case t:var r=e;return ge(r)+".Consumer";case m:var n=e;return ge(n._context)+".Provider";case l:return cr(e,e.render,"ForwardRef");case O:var s=e.displayName||null;return s!==null?s: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 M=Object.assign,B=0,me,he,Ee,ye,Re,_e,be;function Ce(){}Ce.__reactDisabledLog=!0;function lr(){{if(B===0){me=console.log,he=console.info,Ee=console.warn,ye=console.error,Re=console.group,_e=console.groupCollapsed,be=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 fr(){{if(B--,B===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:me}),info:M({},e,{value:he}),warn:M({},e,{value:Ee}),error:M({},e,{value:ye}),group:M({},e,{value:Re}),groupCollapsed:M({},e,{value:_e}),groupEnd:M({},e,{value:be})})}B<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=A.ReactCurrentDispatcher,te;function X(e,r,n){{if(te===void 0)try{throw Error()}catch(p){var s=p.stack.trim().match(/\n( *(at )?)/);te=s&&s[1]||""}return`
10
+ `+te+e}}var ne=!1,H;{var dr=typeof WeakMap=="function"?WeakMap:Map;H=new dr}function we(e,r){if(!e||ne)return"";{var n=H.get(e);if(n!==void 0)return n}var s;ne=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=re.current,re.current=null,lr();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){s=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){s=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){s=D}e()}}catch(D){if(D&&s&&typeof D.stack=="string"){for(var f=D.stack.split(`
11
11
  `),T=s.stack.split(`
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"&&H.set(e,P),P}while(R>=1&&_>=0);break}}}finally{ne=!1,re.current=g,lr(),Error.prepareStackTrace=p}var V=e?e.displayName||e.name:"",Me=V?X(V):"";return typeof e=="function"&&H.set(e,Me),Me}function dr(e,r,n){return we(e,!1)}function vr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,n){if(e==null)return"";if(typeof e=="function")return we(e,vr(e));if(typeof e=="string")return X(e);switch(e){case y:return X("Suspense");case h:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return dr(e.render);case O:return K(e.type,r,n);case j:{var s=e,p=s._payload,g=s._init;try{return K(g(p),r,n)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,Te={},Oe=A.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,n=K(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(n)}else Oe.setExtraStackFrame(null)}function pr(e,r,n,s,p){{var g=Function.call.bind(Z);for(var d in e)if(g(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((s||"React class")+": "+n+" 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,s,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){f=R}f&&!(f 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).",s||"React class",n,d,typeof f),q(null)),f instanceof Error&&!(f.message in Te)&&(Te[f.message]=!0,q(p),C("Failed %s type: %s",n,f.message),q(null))}}}var gr=Array.isArray;function ae(e){return gr(e)}function mr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function hr(e){try{return Se(e),!1}catch{return!0}}function Se(e){return""+e}function je(e){if(hr(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",mr(e)),Se(e)}var G=A.ReactCurrentOwner,Er={key:!0,ref:!0,__self:!0,__source:!0},Pe,ke,oe;oe={};function yr(e){if(Z.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function br(e){if(Z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Rr(e,r){if(typeof e.ref=="string"&&G.current&&r&&G.current.stateNode!==r){var n=x(G.current.type);oe[n]||(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(G.current.type),e.ref),oe[n]=!0)}}function _r(e,r){{var n=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))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function Cr(e,r){{var n=function(){ke||(ke=!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))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var wr=function(e,r,n,s,p,g,d){var f={$$typeof:i,type:e,key:r,ref:n,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:s}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function Tr(e,r,n,s,p){{var g,d={},f=null,T=null;n!==void 0&&(je(n),f=""+n),br(r)&&(je(r.key),f=""+r.key),yr(r)&&(T=r.ref,Rr(r,p));for(g in r)Z.call(r,g)&&!Er.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&&_r(d,_),T&&Cr(d,_)}return wr(e,f,T,p,s,G.current,d)}}var ie=A.ReactCurrentOwner,Ae=A.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,n=K(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(n)}else Ae.setExtraStackFrame(null)}var ue;ue=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===i}function xe(){{if(ie.current){var e=x(ie.current.type);if(e)return`
12
+ `),_=f.length-1,b=T.length-1;_>=1&&b>=0&&f[_]!==T[b];)b--;for(;_>=1&&b>=0;_--,b--)if(f[_]!==T[b]){if(_!==1||b!==1)do if(_--,b--,b<0||f[_]!==T[b]){var P=`
13
+ `+f[_].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,P),P}while(_>=1&&b>=0);break}}}finally{ne=!1,re.current=g,fr(),Error.prepareStackTrace=p}var V=e?e.displayName||e.name:"",Me=V?X(V):"";return typeof e=="function"&&H.set(e,Me),Me}function vr(e,r,n){return we(e,!1)}function pr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,n){if(e==null)return"";if(typeof e=="function")return we(e,pr(e));if(typeof e=="string")return X(e);switch(e){case y:return X("Suspense");case h:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return vr(e.render);case O:return K(e.type,r,n);case j:{var s=e,p=s._payload,g=s._init;try{return K(g(p),r,n)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,Te={},Oe=A.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,n=K(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(n)}else Oe.setExtraStackFrame(null)}function gr(e,r,n,s,p){{var g=Function.call.bind(Z);for(var d in e)if(g(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((s||"React class")+": "+n+" 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,s,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(_){f=_}f&&!(f 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).",s||"React class",n,d,typeof f),q(null)),f instanceof Error&&!(f.message in Te)&&(Te[f.message]=!0,q(p),C("Failed %s type: %s",n,f.message),q(null))}}}var mr=Array.isArray;function ae(e){return mr(e)}function hr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function Er(e){try{return Se(e),!1}catch{return!0}}function Se(e){return""+e}function je(e){if(Er(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",hr(e)),Se(e)}var G=A.ReactCurrentOwner,yr={key:!0,ref:!0,__self:!0,__source:!0},Pe,ke,oe;oe={};function Rr(e){if(Z.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function _r(e){if(Z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function br(e,r){if(typeof e.ref=="string"&&G.current&&r&&G.current.stateNode!==r){var n=x(G.current.type);oe[n]||(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(G.current.type),e.ref),oe[n]=!0)}}function Cr(e,r){{var n=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))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function wr(e,r){{var n=function(){ke||(ke=!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))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var Tr=function(e,r,n,s,p,g,d){var f={$$typeof:i,type:e,key:r,ref:n,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:s}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function Or(e,r,n,s,p){{var g,d={},f=null,T=null;n!==void 0&&(je(n),f=""+n),_r(r)&&(je(r.key),f=""+r.key),Rr(r)&&(T=r.ref,br(r,p));for(g in r)Z.call(r,g)&&!yr.hasOwnProperty(g)&&(d[g]=r[g]);if(e&&e.defaultProps){var _=e.defaultProps;for(g in _)d[g]===void 0&&(d[g]=_[g])}if(f||T){var b=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Cr(d,b),T&&wr(d,b)}return Tr(e,f,T,p,s,G.current,d)}}var ie=A.ReactCurrentOwner,Ae=A.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,n=K(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(n)}else Ae.setExtraStackFrame(null)}var ue;ue=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===i}function xe(){{if(ie.current){var e=x(ie.current.type);if(e)return`
14
14
 
15
- Check the render method of \``+e+"`."}return""}}function Or(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),n=e.lineNumber;return`
15
+ Check the render method of \``+e+"`."}return""}}function Sr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),n=e.lineNumber;return`
16
16
 
17
- Check your code at `+r+":"+n+"."}return""}}var De={};function Sr(e){{var r=xe();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
17
+ Check your code at `+r+":"+n+"."}return""}}var De={};function jr(e){{var r=xe();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
18
18
 
19
- Check the top-level render call using <`+n+">.")}return r}}function Ie(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=Sr(r);if(De[n])return;De[n]=!0;var s="";e&&e._owner&&e._owner!==ie.current&&(s=" It was passed a child from "+x(e._owner.type)+"."),N(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.',n,s),N(null)}}function Fe(e,r){{if(typeof e!="object")return;if(ae(e))for(var n=0;n<e.length;n++){var s=e[n];se(s)&&Ie(s,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)&&Ie(d.value,r)}}}function jr(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===O))n=r.propTypes;else return;if(n){var s=x(r);pr(n,e.props,"prop",s,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 Pr(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var s=r[n];if(s!=="children"&&s!=="key"){N(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),N(null);break}}e.ref!==null&&(N(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),N(null))}}function Le(e,r,n,s,p,g){{var d=ur(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=Or(p);T?f+=T:f+=xe();var R;e===null?R="null":ae(e)?R="array":e!==void 0&&e.$$typeof===i?(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 _=Tr(e,r,n,p,g);if(_==null)return _;if(d){var P=r.children;if(P!==void 0)if(s)if(ae(P)){for(var V=0;V<P.length;V++)Fe(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 Fe(P,e)}return e===u?Pr(_):jr(_),_}}function kr(e,r,n){return Le(e,r,n,!0)}function Ar(e,r,n){return Le(e,r,n,!1)}var xr=Ar,Dr=kr;Y.Fragment=u,Y.jsx=xr,Y.jsxs=Dr}()),Y}var U={};/**
19
+ Check the top-level render call using <`+n+">.")}return r}}function Ie(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=jr(r);if(De[n])return;De[n]=!0;var s="";e&&e._owner&&e._owner!==ie.current&&(s=" It was passed a child from "+x(e._owner.type)+"."),N(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.',n,s),N(null)}}function Fe(e,r){{if(typeof e!="object")return;if(ae(e))for(var n=0;n<e.length;n++){var s=e[n];se(s)&&Ie(s,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)&&Ie(d.value,r)}}}function Pr(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===O))n=r.propTypes;else return;if(n){var s=x(r);gr(n,e.props,"prop",s,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 kr(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var s=r[n];if(s!=="children"&&s!=="key"){N(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),N(null);break}}e.ref!==null&&(N(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),N(null))}}function Le(e,r,n,s,p,g){{var d=sr(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=Sr(p);T?f+=T:f+=xe();var _;e===null?_="null":ae(e)?_="array":e!==void 0&&e.$$typeof===i?(_="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):_=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",_,f)}var b=Or(e,r,n,p,g);if(b==null)return b;if(d){var P=r.children;if(P!==void 0)if(s)if(ae(P)){for(var V=0;V<P.length;V++)Fe(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 Fe(P,e)}return e===u?kr(b):Pr(b),b}}function Ar(e,r,n){return Le(e,r,n,!0)}function xr(e,r,n){return Le(e,r,n,!1)}var Dr=xr,Ir=Ar;Y.Fragment=u,Y.jsx=Dr,Y.jsxs=Ir}()),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 <`+n+">.")}return r}}function Ie(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 Ne(){if(le)return U;le=1;var a=E,i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,c=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function m(t,l,y){var h,O={},j=null,S=null;y!==void 0&&(j=""+y),l.key!==void 0&&(j=""+l.key),l.ref!==void 0&&(S=l.ref);for(h in l)u.call(l,h)&&!v.hasOwnProperty(h)&&(O[h]=l[h]);if(t&&t.defaultProps)for(h in l=t.defaultProps,l)O[h]===void 0&&(O[h]=l[h]);return{$$typeof:i,type:t,key:j,ref:S,props:O,_owner:c.current}}return U.Fragment=o,U.jsx=m,U.jsxs=m,U}process.env.NODE_ENV==="production"?Q.exports=Ne():Q.exports=We();var k=Q.exports;const z=E.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ve=({axios:a,children:i,translate:o,useAuth:u,Outlet:c,Navigate:v,useLocation:m,useGoogleTagManager:t})=>{const l=E.useMemo(()=>({axios:a,Navigate:v,Outlet:c,translate:o,useAuth:u,useGoogleTagManager:t,useLocation:m}),[v,c,a,o,u,t,m]);return k.jsx(z.Provider,{value:l,children:i})},J=a=>`RequireAuth require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ye=({Fallback:a,loginPath:i="/login",localStorageKey:o="user",redirect401Path:u="/login",...c})=>{var F,L,A,C;const{axios:v=c.axios,useLocation:m=c.useLocation,useAuth:t=c.useAuth,Outlet:l=c.Outlet,Navigate:y=c.Navigate}=E.useContext(z);if(t===void 0)throw new Error(J("useAuth"));if(m===void 0)throw new Error(J("useLocation"));if(l===void 0)throw new Error(J("Outlet"));if(y===void 0)throw new Error(J("Navigate"));const[h,O]=E.useState(null),{isLogged:j}=t(),S=m(),I=E.useRef(!1);return E.useLayoutEffect(()=>{I.current||(I.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var $;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&&(($=w==null?void 0:w.response)==null?void 0:$.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(o),O(u)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,o,u]),j&&!h?k.jsx(E.Suspense,{fallback:a,children:(L=(F=S.state)==null?void 0:F.from)!=null&&L.state&&((C=(A=S.state)==null?void 0:A.from)==null?void 0:C.pathname)===i?k.jsx(y,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(l,{})}):k.jsx(y,{to:i,state:{from:S},replace:!0})},ee=a=>`GTMSendPageView require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ue=({...a})=>{const{useLocation:i=a.useLocation,Outlet:o=a.Outlet,useGoogleTagManager:u=a.useGoogleTagManager}=E.useContext(z);if(i===void 0)throw new Error(ee("useLocation"));if(o===void 0)throw new Error(ee("Outlet"));if(u===void 0)throw new Error(ee("useGoogleTagManager"));const{pathname:c}=i(),{sendEvent:v}=u();return E.useEffect(()=>{v({event:"pageView",pathname:c})},[c,v]),k.jsx(o,{})},ze=({axios:a,baseURL:i,tokenTypeKey:o="tokenType",userLocalStorageKey:u="user",tokenKey:c="accessToken",postContentType:v="application/json"})=>{if(!a.defaults)return null;const m=localStorage.getItem(u),t=m?JSON.parse(m):null,l=t!=null&&t[o]?t[o]:null,y=t!=null&&t[c]?t[c]:null,h=m?`${l} ${y}`:null;return a.defaults.baseURL=i,a.defaults.headers.post["Content-Type"]=v,h&&(a.defaults.headers.common.Authorization=h),null},Be=({i18n:a,debug:i,initReactI18next:o,resources:u,LanguageDetector:c})=>(a!=null&&a.isInitialized||(a.use(c).use(o).init({debug:i,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:u,returnNull:!1}).then(()=>{document.documentElement.lang!==a.resolvedLanguage&&a.resolvedLanguage&&document.documentElement.setAttribute("lang",a.resolvedLanguage)}),a.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ge=({dsn:a,sentry:i,integrations:o,tracesSampleRate:u,routingInstrumentationDependencies:c,replaysSessionSampleRate:v,replaysOnErrorSampleRate:m,tracePropagationTargets:t,ignoreErrors:l,debug:y})=>(i.isInitialized()||(y||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&i.init({debug:y,dsn:a,ignoreErrors:l||[/Failed to fetch dynamically imported module/],integrations:[new i.BrowserTracing({routingInstrumentation:i.reactRouterV6Instrumentation(c.useEffect,c.useLocation,c.useNavigationType,c.createRoutesFromChildren,c.matchRoutes)}),i.replayIntegration(),...o||[]],replaysOnErrorSampleRate:m||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:t,tracesSampleRate:u||1}),null),Je=({IMaskMixin:a,...i})=>{const o=E.useMemo(()=>a(({TextField:u,...c})=>k.jsx(u,{...c})),[a]);return k.jsx(o,{...i})},$e=({mapbox:a,accessToken:i})=>(a&&i&&(a.accessToken=i),null),Xe=({children:a,defaultOptions:i,QueryClient:o,QueryClientProvider:u})=>{const c=new o({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...i}}});return k.jsx(u,{client:c,children:a})},He=a=>{const{unknownErrorTranslationKey:i="error.unknownError"}=a||{},{translate:o=a==null?void 0:a.translate}=E.useContext(z),u=o?o(i):"Unknown error",c=E.useCallback(m=>{var l,y,h,O,j,S,I,F,L;const{response:t}=m||{};return t!=null&&t.reason?String(t.reason):(l=t==null?void 0:t.data)!=null&&l.reason?String(t.data.reason):(y=t==null?void 0:t.data)!=null&&y.message?String(t.data.message):(O=(h=t==null?void 0:t.data)==null?void 0:h.detail)!=null&&O.length&&Array.isArray((j=t==null?void 0:t.data)==null?void 0:j.detail)&&((I=(S=t==null?void 0:t.data)==null?void 0:S.detail[0])!=null&&I.msg)&&typeof((L=(F=t==null?void 0:t.data)==null?void 0:F.detail[0])==null?void 0:L.msg)=="string"?String(t.data.detail[0].msg):u},[u]),v=E.useCallback(m=>{var l,y,h;const{response:t}=m||{};return o&&(t!=null&&t.error_code)?o(t==null?void 0:t.error_code):o&&((l=t==null?void 0:t.data)!=null&&l.error_code)?o((y=t==null?void 0:t.data)==null?void 0:y.error_code):t!=null&&t.error_code?String(t==null?void 0:t.error_code):(h=t==null?void 0:t.data)!=null&&h.error_code?String(t.data.error_code):u},[u,o]);return{printError:c,printErrorCode:v}},Ke=({data:a,fetchNextPage:i,isFetchingNextPage:o,isInitialLoading:u,isLoading:c,enabled:v=!0})=>{const m=E.useCallback(async l=>{o||!v||await i({pageParam:(l==null?void 0:l.pageParam)||l.visibleRowsCount})},[v,i,o]),t=E.useMemo(()=>{if(a)return a.pages.reduce((l,y)=>[...l,...y],[])},[a]);return{fetchNextPageOnRowsScrollEnd:m,isLoading:o||c,loadingVariant:u?"skeleton":"linear",rows:t}},Ze=a=>{const i=E.useCallback(({tokenType:u,accessToken:c})=>{a.defaults.headers.common.Authorization=`${u} ${c}`},[a.defaults.headers.common]);return{clearAuthenticationToken:E.useCallback(()=>{a.defaults.headers.common.Authorization=null},[a.defaults.headers.common]),setAuthenticationToken:i}},qe=a=>a.charAt(0).toUpperCase()+a.slice(1).toLowerCase(),Qe=a=>{const u=a.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 u.charAt(0).toLowerCase()+u.slice(1)},er=(a,i,o)=>{const u=Qe(i),c=qe(o);return`${u}${c}`},rr=a=>{if(a)return(a==null?void 0:a.reduce((i,o)=>(i[o]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},i),{}))||{}},tr=a=>{const{input:i="./openapi.json",operationsToGenerateInfiniteQueryHook:o=void 0}=a||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:i,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:er,...(o==null?void 0:o.length)&&{operations:rr(o)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}},W={react:"^18.2.0","react-dom":"^18.2.0"},fe={"@testing-library/jest-dom":"^5.17.0","@testing-library/react":"^14.0.0","@testing-library/user-event":"^14.5.1","@types/react":"^18.2.30","@types/react-dom":"^18.2.14","@vitejs/plugin-react":"^4.2.1","eslint-config-react-tracktor":"^1.7.1",husky:"^8.0.3",jsdom:"^22.1.0",typescript:"^5.3.3",vite:"^5.1.5","vite-plugin-dts":"^3.7.3","vite-plugin-static-copy":"^0.17.1",vitest:"^1.3.1"},nr=()=>"react-native"in W&&W["react-native"]&&"expo"in W&&W.expo?process.env.EXPO_PUBLIC_API_URL:"react"in W&&W.react&&"vite"in fe&&fe.vite?imprort.meta.env.VITE_API_URL:"",ar=(a,i)=>{if(!a)return"";const o=a.startsWith("/")?a:`/${a}`,u=nr();return typeof i=="number"?`${u}${o.replace("/files",`/thumbs/${i}`)}`:`${u}${o}`};b.AxiosConfig=ze,b.GTMSendPageView=Ue,b.I18nConfig=Be,b.InjectDependenciesContext=z,b.InjectDependenciesProvider=Ve,b.MapBoxConfig=$e,b.MaskTextField=Je,b.QueryClientConfigProvider=Xe,b.RequireAuth=Ye,b.SentryConfig=Ge,b.filePathAdapter=ar,b.getOrvalConfig=tr,b.useAuth=Ze,b.useInfiniteDataGrid=Ke,b.useResponseError=He,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
27
+ */var le;function Ne(){if(le)return U;le=1;var a=E,i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,c=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function m(t,l,y){var h,O={},j=null,S=null;y!==void 0&&(j=""+y),l.key!==void 0&&(j=""+l.key),l.ref!==void 0&&(S=l.ref);for(h in l)u.call(l,h)&&!v.hasOwnProperty(h)&&(O[h]=l[h]);if(t&&t.defaultProps)for(h in l=t.defaultProps,l)O[h]===void 0&&(O[h]=l[h]);return{$$typeof:i,type:t,key:j,ref:S,props:O,_owner:c.current}}return U.Fragment=o,U.jsx=m,U.jsxs=m,U}process.env.NODE_ENV==="production"?Q.exports=Ne():Q.exports=We();var k=Q.exports;const z=E.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ve=({axios:a,children:i,translate:o,useAuth:u,Outlet:c,Navigate:v,useLocation:m,useGoogleTagManager:t})=>{const l=E.useMemo(()=>({axios:a,Navigate:v,Outlet:c,translate:o,useAuth:u,useGoogleTagManager:t,useLocation:m}),[v,c,a,o,u,t,m]);return k.jsx(z.Provider,{value:l,children:i})},J=a=>`RequireAuth require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ye=({Fallback:a,loginPath:i="/login",localStorageKey:o="user",redirect401Path:u="/login",...c})=>{var F,L,A,C;const{axios:v=c.axios,useLocation:m=c.useLocation,useAuth:t=c.useAuth,Outlet:l=c.Outlet,Navigate:y=c.Navigate}=E.useContext(z);if(t===void 0)throw new Error(J("useAuth"));if(m===void 0)throw new Error(J("useLocation"));if(l===void 0)throw new Error(J("Outlet"));if(y===void 0)throw new Error(J("Navigate"));const[h,O]=E.useState(null),{isLogged:j}=t(),S=m(),I=E.useRef(!1);return E.useLayoutEffect(()=>{I.current||(I.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var $;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&&(($=w==null?void 0:w.response)==null?void 0:$.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(o),O(u)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,o,u]),j&&!h?k.jsx(E.Suspense,{fallback:a,children:(L=(F=S.state)==null?void 0:F.from)!=null&&L.state&&((C=(A=S.state)==null?void 0:A.from)==null?void 0:C.pathname)===i?k.jsx(y,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(l,{})}):k.jsx(y,{to:i,state:{from:S},replace:!0})},ee=a=>`GTMSendPageView require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ue=({...a})=>{const{useLocation:i=a.useLocation,Outlet:o=a.Outlet,useGoogleTagManager:u=a.useGoogleTagManager}=E.useContext(z);if(i===void 0)throw new Error(ee("useLocation"));if(o===void 0)throw new Error(ee("Outlet"));if(u===void 0)throw new Error(ee("useGoogleTagManager"));const{pathname:c}=i(),{sendEvent:v}=u();return E.useEffect(()=>{v({event:"pageView",pathname:c})},[c,v]),k.jsx(o,{})},ze=({axios:a,baseURL:i,tokenTypeKey:o="tokenType",userLocalStorageKey:u="user",tokenKey:c="accessToken",postContentType:v="application/json"})=>{if(!a.defaults)return null;const m=localStorage.getItem(u),t=m?JSON.parse(m):null,l=t!=null&&t[o]?t[o]:null,y=t!=null&&t[c]?t[c]:null,h=m?`${l} ${y}`:null;return a.defaults.baseURL=i,a.defaults.headers.post["Content-Type"]=v,h&&(a.defaults.headers.common.Authorization=h),null},Be=({i18n:a,debug:i,initReactI18next:o,resources:u,LanguageDetector:c})=>(a!=null&&a.isInitialized||(a.use(c).use(o).init({debug:i,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:u,returnNull:!1}).then(()=>{document.documentElement.lang!==a.resolvedLanguage&&a.resolvedLanguage&&document.documentElement.setAttribute("lang",a.resolvedLanguage)}),a.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ge=({dsn:a,sentry:i,integrations:o,tracesSampleRate:u,routingInstrumentationDependencies:c,replaysSessionSampleRate:v,replaysOnErrorSampleRate:m,tracePropagationTargets:t,ignoreErrors:l,debug:y})=>(i.isInitialized()||(y||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&i.init({debug:y,dsn:a,ignoreErrors:l||[/Failed to fetch dynamically imported module/],integrations:[new i.BrowserTracing({routingInstrumentation:i.reactRouterV6Instrumentation(c.useEffect,c.useLocation,c.useNavigationType,c.createRoutesFromChildren,c.matchRoutes)}),i.replayIntegration(),...o||[]],replaysOnErrorSampleRate:m||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:t,tracesSampleRate:u||1}),null),Je=({IMaskMixin:a,...i})=>{const o=E.useMemo(()=>a(({TextField:u,...c})=>k.jsx(u,{...c})),[a]);return k.jsx(o,{...i})},$e=({mapbox:a,accessToken:i})=>(a&&i&&(a.accessToken=i),null),Xe=({children:a,defaultOptions:i,QueryClient:o,QueryClientProvider:u})=>{const c=new o({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...i}}});return k.jsx(u,{client:c,children:a})},He=a=>{const{unknownErrorTranslationKey:i="error.unknownError"}=a||{},{translate:o=a==null?void 0:a.translate}=E.useContext(z),u=o?o(i):"Unknown error",c=E.useCallback(m=>{var l,y,h,O,j,S,I,F,L;const{response:t}=m||{};return t!=null&&t.reason?String(t.reason):(l=t==null?void 0:t.data)!=null&&l.reason?String(t.data.reason):(y=t==null?void 0:t.data)!=null&&y.message?String(t.data.message):(O=(h=t==null?void 0:t.data)==null?void 0:h.detail)!=null&&O.length&&Array.isArray((j=t==null?void 0:t.data)==null?void 0:j.detail)&&((I=(S=t==null?void 0:t.data)==null?void 0:S.detail[0])!=null&&I.msg)&&typeof((L=(F=t==null?void 0:t.data)==null?void 0:F.detail[0])==null?void 0:L.msg)=="string"?String(t.data.detail[0].msg):u},[u]),v=E.useCallback(m=>{var l,y,h;const{response:t}=m||{};return o&&(t!=null&&t.error_code)?o(t==null?void 0:t.error_code):o&&((l=t==null?void 0:t.data)!=null&&l.error_code)?o((y=t==null?void 0:t.data)==null?void 0:y.error_code):t!=null&&t.error_code?String(t==null?void 0:t.error_code):(h=t==null?void 0:t.data)!=null&&h.error_code?String(t.data.error_code):u},[u,o]);return{printError:c,printErrorCode:v}},Ke=({data:a,fetchNextPage:i,isFetchingNextPage:o,isInitialLoading:u,isLoading:c,enabled:v=!0})=>{const m=E.useCallback(async l=>{o||!v||await i({pageParam:(l==null?void 0:l.pageParam)||l.visibleRowsCount})},[v,i,o]),t=E.useMemo(()=>{if(a)return a.pages.reduce((l,y)=>[...l,...y],[])},[a]);return{fetchNextPageOnRowsScrollEnd:m,isLoading:o||c,loadingVariant:u?"skeleton":"linear",rows:t}},Ze=a=>{const i=E.useCallback(({tokenType:u,accessToken:c})=>{a.defaults.headers.common.Authorization=`${u} ${c}`},[a.defaults.headers.common]);return{clearAuthenticationToken:E.useCallback(()=>{a.defaults.headers.common.Authorization=null},[a.defaults.headers.common]),setAuthenticationToken:i}},qe=a=>a.charAt(0).toUpperCase()+a.slice(1).toLowerCase(),Qe=a=>{const u=a.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 u.charAt(0).toLowerCase()+u.slice(1)},er=(a,i,o)=>{const u=Qe(i),c=qe(o);return`${u}${c}`},rr=a=>{if(a)return(a==null?void 0:a.reduce((i,o)=>(i[o]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},i),{}))||{}},tr=a=>{const{input:i="./openapi.json",operationsToGenerateInfiniteQueryHook:o=void 0}=a||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:i,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:er,...(o==null?void 0:o.length)&&{operations:rr(o)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}},W={react:"^18.2.0","react-dom":"^18.2.0"},fe={"@testing-library/jest-dom":"^5.17.0","@testing-library/react":"^14.0.0","@testing-library/user-event":"^14.5.1","@types/react":"^18.2.30","@types/react-dom":"^18.2.14","@vitejs/plugin-react":"^4.2.1","eslint-config-react-tracktor":"^1.7.1",husky:"^8.0.3",jsdom:"^22.1.0",typescript:"^5.3.3",vite:"^5.1.5","vite-plugin-dts":"^3.7.3","vite-plugin-static-copy":"^0.17.1",vitest:"^1.3.1"};var nr={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const ar=()=>"react-native"in W&&W["react-native"]&&"expo"in W&&W.expo?process.env.EXPO_PUBLIC_API_URL:"react"in W&&W.react&&"vite"in fe&&fe.vite?nr.VITE_API_URL:"",or=(a,i)=>{if(!a)return"";const o=a.startsWith("/")?a:`/${a}`,u=ar();return typeof i=="number"?`${u}${o.replace("/files",`/thumbs/${i}`)}`:`${u}${o}`};R.AxiosConfig=ze,R.GTMSendPageView=Ue,R.I18nConfig=Be,R.InjectDependenciesContext=z,R.InjectDependenciesProvider=Ve,R.MapBoxConfig=$e,R.MaskTextField=Je,R.QueryClientConfigProvider=Xe,R.RequireAuth=Ye,R.SentryConfig=Ge,R.filePathAdapter=or,R.getOrvalConfig=tr,R.useAuth=Ze,R.useInfiniteDataGrid=Ke,R.useResponseError=He,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "0.18.2",
3
+ "version": "0.18.3",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/src/main.d.ts",