@tracktor/shared-module 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,966 +0,0 @@
1
- import Ie, { useState as Ne, useRef as Cr, useLayoutEffect as We, Suspense as Tr, useEffect as X, createContext as Sr, useMemo as ue, useContext as Ve, useCallback as ie } from "react";
2
- import M from "axios";
3
- import { useLocation as le, Navigate as $e, Outlet as Ue, createRoutesFromChildren as wr, matchRoutes as xr, useNavigationType as Or } from "react-router-dom";
4
- import I, { t as jr } from "i18next";
5
- import Pr from "i18next-browser-languagedetector";
6
- import { initReactI18next as Ar } from "react-i18next";
7
- import * as oe from "@sentry/react";
8
- import z from "dayjs";
9
- import { QueryClient as kr, QueryClientProvider as Dr } from "@tanstack/react-query";
10
- var Mr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
11
- function $r(t) {
12
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
13
- }
14
- var se = { exports: {} }, V = {};
15
- /**
16
- * @license React
17
- * react-jsx-runtime.development.js
18
- *
19
- * Copyright (c) Facebook, Inc. and its affiliates.
20
- *
21
- * This source code is licensed under the MIT license found in the
22
- * LICENSE file in the root directory of this source tree.
23
- */
24
- var Le;
25
- function Lr() {
26
- return Le || (Le = 1, process.env.NODE_ENV !== "production" && function() {
27
- var t = Ie, n = Symbol.for("react.element"), i = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), c = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), j = Symbol.iterator, w = "@@iterator";
28
- function R(e) {
29
- if (e === null || typeof e != "object")
30
- return null;
31
- var r = j && e[j] || e[w];
32
- return typeof r == "function" ? r : null;
33
- }
34
- var D = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
35
- function _(e) {
36
- {
37
- for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), u = 1; u < r; u++)
38
- a[u - 1] = arguments[u];
39
- L("error", e, a);
40
- }
41
- }
42
- function L(e, r, a) {
43
- {
44
- var u = D.ReactDebugCurrentFrame, p = u.getStackAddendum();
45
- p !== "" && (r += "%s", a = a.concat([p]));
46
- var m = a.map(function(d) {
47
- return String(d);
48
- });
49
- m.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, m);
50
- }
51
- }
52
- var Be = !1, Ge = !1, qe = !1, Je = !1, He = !1, fe;
53
- fe = Symbol.for("react.module.reference");
54
- function Xe(e) {
55
- return !!(typeof e == "string" || typeof e == "function" || e === s || e === y || He || e === v || e === g || e === h || Je || e === O || Be || Ge || qe || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === C || e.$$typeof === o || e.$$typeof === c || e.$$typeof === l || // This needs to include all possible module reference object
56
- // types supported by any Flight configuration anywhere since
57
- // we don't know which Flight build this will end up being used
58
- // with.
59
- e.$$typeof === fe || e.getModuleId !== void 0));
60
- }
61
- function Ke(e, r, a) {
62
- var u = e.displayName;
63
- if (u)
64
- return u;
65
- var p = r.displayName || r.name || "";
66
- return p !== "" ? a + "(" + p + ")" : a;
67
- }
68
- function de(e) {
69
- return e.displayName || "Context";
70
- }
71
- function P(e) {
72
- if (e == null)
73
- return null;
74
- 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")
75
- return e.displayName || e.name || null;
76
- if (typeof e == "string")
77
- return e;
78
- switch (e) {
79
- case s:
80
- return "Fragment";
81
- case i:
82
- return "Portal";
83
- case y:
84
- return "Profiler";
85
- case v:
86
- return "StrictMode";
87
- case g:
88
- return "Suspense";
89
- case h:
90
- return "SuspenseList";
91
- }
92
- if (typeof e == "object")
93
- switch (e.$$typeof) {
94
- case c:
95
- var r = e;
96
- return de(r) + ".Consumer";
97
- case o:
98
- var a = e;
99
- return de(a._context) + ".Provider";
100
- case l:
101
- return Ke(e, e.render, "ForwardRef");
102
- case C:
103
- var u = e.displayName || null;
104
- return u !== null ? u : P(e.type) || "Memo";
105
- case T: {
106
- var p = e, m = p._payload, d = p._init;
107
- try {
108
- return P(d(m));
109
- } catch {
110
- return null;
111
- }
112
- }
113
- }
114
- return null;
115
- }
116
- var $ = Object.assign, N = 0, pe, ve, me, ge, he, ye, be;
117
- function Ee() {
118
- }
119
- Ee.__reactDisabledLog = !0;
120
- function Ze() {
121
- {
122
- if (N === 0) {
123
- pe = console.log, ve = console.info, me = console.warn, ge = console.error, he = console.group, ye = console.groupCollapsed, be = console.groupEnd;
124
- var e = {
125
- configurable: !0,
126
- enumerable: !0,
127
- value: Ee,
128
- writable: !0
129
- };
130
- Object.defineProperties(console, {
131
- info: e,
132
- log: e,
133
- warn: e,
134
- error: e,
135
- group: e,
136
- groupCollapsed: e,
137
- groupEnd: e
138
- });
139
- }
140
- N++;
141
- }
142
- }
143
- function Qe() {
144
- {
145
- if (N--, N === 0) {
146
- var e = {
147
- configurable: !0,
148
- enumerable: !0,
149
- writable: !0
150
- };
151
- Object.defineProperties(console, {
152
- log: $({}, e, {
153
- value: pe
154
- }),
155
- info: $({}, e, {
156
- value: ve
157
- }),
158
- warn: $({}, e, {
159
- value: me
160
- }),
161
- error: $({}, e, {
162
- value: ge
163
- }),
164
- group: $({}, e, {
165
- value: he
166
- }),
167
- groupCollapsed: $({}, e, {
168
- value: ye
169
- }),
170
- groupEnd: $({}, e, {
171
- value: be
172
- })
173
- });
174
- }
175
- N < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
176
- }
177
- }
178
- var K = D.ReactCurrentDispatcher, Z;
179
- function B(e, r, a) {
180
- {
181
- if (Z === void 0)
182
- try {
183
- throw Error();
184
- } catch (p) {
185
- var u = p.stack.trim().match(/\n( *(at )?)/);
186
- Z = u && u[1] || "";
187
- }
188
- return `
189
- ` + Z + e;
190
- }
191
- }
192
- var Q = !1, G;
193
- {
194
- var er = typeof WeakMap == "function" ? WeakMap : Map;
195
- G = new er();
196
- }
197
- function Re(e, r) {
198
- if (!e || Q)
199
- return "";
200
- {
201
- var a = G.get(e);
202
- if (a !== void 0)
203
- return a;
204
- }
205
- var u;
206
- Q = !0;
207
- var p = Error.prepareStackTrace;
208
- Error.prepareStackTrace = void 0;
209
- var m;
210
- m = K.current, K.current = null, Ze();
211
- try {
212
- if (r) {
213
- var d = function() {
214
- throw Error();
215
- };
216
- if (Object.defineProperty(d.prototype, "props", {
217
- set: function() {
218
- throw Error();
219
- }
220
- }), typeof Reflect == "object" && Reflect.construct) {
221
- try {
222
- Reflect.construct(d, []);
223
- } catch (A) {
224
- u = A;
225
- }
226
- Reflect.construct(e, [], d);
227
- } else {
228
- try {
229
- d.call();
230
- } catch (A) {
231
- u = A;
232
- }
233
- e.call(d.prototype);
234
- }
235
- } else {
236
- try {
237
- throw Error();
238
- } catch (A) {
239
- u = A;
240
- }
241
- e();
242
- }
243
- } catch (A) {
244
- if (A && u && typeof A.stack == "string") {
245
- for (var f = A.stack.split(`
246
- `), S = u.stack.split(`
247
- `), b = f.length - 1, E = S.length - 1; b >= 1 && E >= 0 && f[b] !== S[E]; )
248
- E--;
249
- for (; b >= 1 && E >= 0; b--, E--)
250
- if (f[b] !== S[E]) {
251
- if (b !== 1 || E !== 1)
252
- do
253
- if (b--, E--, E < 0 || f[b] !== S[E]) {
254
- var x = `
255
- ` + f[b].replace(" at new ", " at ");
256
- return e.displayName && x.includes("<anonymous>") && (x = x.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, x), x;
257
- }
258
- while (b >= 1 && E >= 0);
259
- break;
260
- }
261
- }
262
- } finally {
263
- Q = !1, K.current = m, Qe(), Error.prepareStackTrace = p;
264
- }
265
- var Y = e ? e.displayName || e.name : "", Me = Y ? B(Y) : "";
266
- return typeof e == "function" && G.set(e, Me), Me;
267
- }
268
- function rr(e, r, a) {
269
- return Re(e, !1);
270
- }
271
- function tr(e) {
272
- var r = e.prototype;
273
- return !!(r && r.isReactComponent);
274
- }
275
- function q(e, r, a) {
276
- if (e == null)
277
- return "";
278
- if (typeof e == "function")
279
- return Re(e, tr(e));
280
- if (typeof e == "string")
281
- return B(e);
282
- switch (e) {
283
- case g:
284
- return B("Suspense");
285
- case h:
286
- return B("SuspenseList");
287
- }
288
- if (typeof e == "object")
289
- switch (e.$$typeof) {
290
- case l:
291
- return rr(e.render);
292
- case C:
293
- return q(e.type, r, a);
294
- case T: {
295
- var u = e, p = u._payload, m = u._init;
296
- try {
297
- return q(m(p), r, a);
298
- } catch {
299
- }
300
- }
301
- }
302
- return "";
303
- }
304
- var J = Object.prototype.hasOwnProperty, _e = {}, Ce = D.ReactDebugCurrentFrame;
305
- function H(e) {
306
- if (e) {
307
- var r = e._owner, a = q(e.type, e._source, r ? r.type : null);
308
- Ce.setExtraStackFrame(a);
309
- } else
310
- Ce.setExtraStackFrame(null);
311
- }
312
- function nr(e, r, a, u, p) {
313
- {
314
- var m = Function.call.bind(J);
315
- for (var d in e)
316
- if (m(e, d)) {
317
- var f = void 0;
318
- try {
319
- if (typeof e[d] != "function") {
320
- var S = 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`.");
321
- throw S.name = "Invariant Violation", S;
322
- }
323
- f = e[d](r, d, u, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
324
- } catch (b) {
325
- f = b;
326
- }
327
- f && !(f instanceof Error) && (H(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).", u || "React class", a, d, typeof f), H(null)), f instanceof Error && !(f.message in _e) && (_e[f.message] = !0, H(p), _("Failed %s type: %s", a, f.message), H(null));
328
- }
329
- }
330
- }
331
- var ar = Array.isArray;
332
- function ee(e) {
333
- return ar(e);
334
- }
335
- function or(e) {
336
- {
337
- var r = typeof Symbol == "function" && Symbol.toStringTag, a = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
338
- return a;
339
- }
340
- }
341
- function ir(e) {
342
- try {
343
- return Te(e), !1;
344
- } catch {
345
- return !0;
346
- }
347
- }
348
- function Te(e) {
349
- return "" + e;
350
- }
351
- function Se(e) {
352
- if (ir(e))
353
- return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", or(e)), Te(e);
354
- }
355
- var W = D.ReactCurrentOwner, sr = {
356
- key: !0,
357
- ref: !0,
358
- __self: !0,
359
- __source: !0
360
- }, we, xe, re;
361
- re = {};
362
- function ur(e) {
363
- if (J.call(e, "ref")) {
364
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
365
- if (r && r.isReactWarning)
366
- return !1;
367
- }
368
- return e.ref !== void 0;
369
- }
370
- function lr(e) {
371
- if (J.call(e, "key")) {
372
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
373
- if (r && r.isReactWarning)
374
- return !1;
375
- }
376
- return e.key !== void 0;
377
- }
378
- function cr(e, r) {
379
- if (typeof e.ref == "string" && W.current && r && W.current.stateNode !== r) {
380
- var a = P(W.current.type);
381
- re[a] || (_('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(W.current.type), e.ref), re[a] = !0);
382
- }
383
- }
384
- function fr(e, r) {
385
- {
386
- var a = function() {
387
- we || (we = !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));
388
- };
389
- a.isReactWarning = !0, Object.defineProperty(e, "key", {
390
- get: a,
391
- configurable: !0
392
- });
393
- }
394
- }
395
- function dr(e, r) {
396
- {
397
- var a = function() {
398
- xe || (xe = !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));
399
- };
400
- a.isReactWarning = !0, Object.defineProperty(e, "ref", {
401
- get: a,
402
- configurable: !0
403
- });
404
- }
405
- }
406
- var pr = function(e, r, a, u, p, m, d) {
407
- var f = {
408
- // This tag allows us to uniquely identify this as a React Element
409
- $$typeof: n,
410
- // Built-in properties that belong on the element
411
- type: e,
412
- key: r,
413
- ref: a,
414
- props: d,
415
- // Record the component responsible for creating this element.
416
- _owner: m
417
- };
418
- return f._store = {}, Object.defineProperty(f._store, "validated", {
419
- configurable: !1,
420
- enumerable: !1,
421
- writable: !0,
422
- value: !1
423
- }), Object.defineProperty(f, "_self", {
424
- configurable: !1,
425
- enumerable: !1,
426
- writable: !1,
427
- value: u
428
- }), Object.defineProperty(f, "_source", {
429
- configurable: !1,
430
- enumerable: !1,
431
- writable: !1,
432
- value: p
433
- }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
434
- };
435
- function vr(e, r, a, u, p) {
436
- {
437
- var m, d = {}, f = null, S = null;
438
- a !== void 0 && (Se(a), f = "" + a), lr(r) && (Se(r.key), f = "" + r.key), ur(r) && (S = r.ref, cr(r, p));
439
- for (m in r)
440
- J.call(r, m) && !sr.hasOwnProperty(m) && (d[m] = r[m]);
441
- if (e && e.defaultProps) {
442
- var b = e.defaultProps;
443
- for (m in b)
444
- d[m] === void 0 && (d[m] = b[m]);
445
- }
446
- if (f || S) {
447
- var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
448
- f && fr(d, E), S && dr(d, E);
449
- }
450
- return pr(e, f, S, p, u, W.current, d);
451
- }
452
- }
453
- var te = D.ReactCurrentOwner, Oe = D.ReactDebugCurrentFrame;
454
- function F(e) {
455
- if (e) {
456
- var r = e._owner, a = q(e.type, e._source, r ? r.type : null);
457
- Oe.setExtraStackFrame(a);
458
- } else
459
- Oe.setExtraStackFrame(null);
460
- }
461
- var ne;
462
- ne = !1;
463
- function ae(e) {
464
- return typeof e == "object" && e !== null && e.$$typeof === n;
465
- }
466
- function je() {
467
- {
468
- if (te.current) {
469
- var e = P(te.current.type);
470
- if (e)
471
- return `
472
-
473
- Check the render method of \`` + e + "`.";
474
- }
475
- return "";
476
- }
477
- }
478
- function mr(e) {
479
- {
480
- if (e !== void 0) {
481
- var r = e.fileName.replace(/^.*[\\\/]/, ""), a = e.lineNumber;
482
- return `
483
-
484
- Check your code at ` + r + ":" + a + ".";
485
- }
486
- return "";
487
- }
488
- }
489
- var Pe = {};
490
- function gr(e) {
491
- {
492
- var r = je();
493
- if (!r) {
494
- var a = typeof e == "string" ? e : e.displayName || e.name;
495
- a && (r = `
496
-
497
- Check the top-level render call using <` + a + ">.");
498
- }
499
- return r;
500
- }
501
- }
502
- function Ae(e, r) {
503
- {
504
- if (!e._store || e._store.validated || e.key != null)
505
- return;
506
- e._store.validated = !0;
507
- var a = gr(r);
508
- if (Pe[a])
509
- return;
510
- Pe[a] = !0;
511
- var u = "";
512
- e && e._owner && e._owner !== te.current && (u = " It was passed a child from " + P(e._owner.type) + "."), F(e), _('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), F(null);
513
- }
514
- }
515
- function ke(e, r) {
516
- {
517
- if (typeof e != "object")
518
- return;
519
- if (ee(e))
520
- for (var a = 0; a < e.length; a++) {
521
- var u = e[a];
522
- ae(u) && Ae(u, r);
523
- }
524
- else if (ae(e))
525
- e._store && (e._store.validated = !0);
526
- else if (e) {
527
- var p = R(e);
528
- if (typeof p == "function" && p !== e.entries)
529
- for (var m = p.call(e), d; !(d = m.next()).done; )
530
- ae(d.value) && Ae(d.value, r);
531
- }
532
- }
533
- }
534
- function hr(e) {
535
- {
536
- var r = e.type;
537
- if (r == null || typeof r == "string")
538
- return;
539
- var a;
540
- if (typeof r == "function")
541
- a = r.propTypes;
542
- else if (typeof r == "object" && (r.$$typeof === l || // Note: Memo only checks outer props here.
543
- // Inner props are checked in the reconciler.
544
- r.$$typeof === C))
545
- a = r.propTypes;
546
- else
547
- return;
548
- if (a) {
549
- var u = P(r);
550
- nr(a, e.props, "prop", u, e);
551
- } else if (r.PropTypes !== void 0 && !ne) {
552
- ne = !0;
553
- var p = P(r);
554
- _("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
555
- }
556
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
557
- }
558
- }
559
- function yr(e) {
560
- {
561
- for (var r = Object.keys(e.props), a = 0; a < r.length; a++) {
562
- var u = r[a];
563
- if (u !== "children" && u !== "key") {
564
- F(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), F(null);
565
- break;
566
- }
567
- }
568
- e.ref !== null && (F(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
569
- }
570
- }
571
- function De(e, r, a, u, p, m) {
572
- {
573
- var d = Xe(e);
574
- if (!d) {
575
- var f = "";
576
- (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.");
577
- var S = mr(p);
578
- S ? f += S : f += je();
579
- var b;
580
- e === null ? b = "null" : ee(e) ? b = "array" : e !== void 0 && e.$$typeof === n ? (b = "<" + (P(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : b = 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", b, f);
581
- }
582
- var E = vr(e, r, a, p, m);
583
- if (E == null)
584
- return E;
585
- if (d) {
586
- var x = r.children;
587
- if (x !== void 0)
588
- if (u)
589
- if (ee(x)) {
590
- for (var Y = 0; Y < x.length; Y++)
591
- ke(x[Y], e);
592
- Object.freeze && Object.freeze(x);
593
- } else
594
- _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
595
- else
596
- ke(x, e);
597
- }
598
- return e === s ? yr(E) : hr(E), E;
599
- }
600
- }
601
- function br(e, r, a) {
602
- return De(e, r, a, !0);
603
- }
604
- function Er(e, r, a) {
605
- return De(e, r, a, !1);
606
- }
607
- var Rr = Er, _r = br;
608
- V.Fragment = s, V.jsx = Rr, V.jsxs = _r;
609
- }()), V;
610
- }
611
- var U = {};
612
- /**
613
- * @license React
614
- * react-jsx-runtime.production.min.js
615
- *
616
- * Copyright (c) Facebook, Inc. and its affiliates.
617
- *
618
- * This source code is licensed under the MIT license found in the
619
- * LICENSE file in the root directory of this source tree.
620
- */
621
- var Fe;
622
- function Fr() {
623
- if (Fe)
624
- return U;
625
- Fe = 1;
626
- var t = Ie, n = Symbol.for("react.element"), i = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, v = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
627
- function o(c, l, g) {
628
- var h, C = {}, T = null, O = null;
629
- g !== void 0 && (T = "" + g), l.key !== void 0 && (T = "" + l.key), l.ref !== void 0 && (O = l.ref);
630
- for (h in l)
631
- s.call(l, h) && !y.hasOwnProperty(h) && (C[h] = l[h]);
632
- if (c && c.defaultProps)
633
- for (h in l = c.defaultProps, l)
634
- C[h] === void 0 && (C[h] = l[h]);
635
- return { $$typeof: n, type: c, key: T, ref: O, props: C, _owner: v.current };
636
- }
637
- return U.Fragment = i, U.jsx = o, U.jsxs = o, U;
638
- }
639
- process.env.NODE_ENV === "production" ? se.exports = Fr() : se.exports = Lr();
640
- var k = se.exports;
641
- const tt = ({
642
- Fallback: t,
643
- loginPath: n = "/login",
644
- localStorageKey: i = "user",
645
- redirect401Path: s = "/login",
646
- isLogged: v
647
- }) => {
648
- var C, T, O, j;
649
- const [y, o] = Ne(null), c = le(), l = Cr(!1), g = typeof v == "function" ? v() : !!v, h = typeof g == "boolean" ? g : g == null ? void 0 : g.isLogged;
650
- return We(() => {
651
- var w;
652
- l.current || (l.current = !0, (w = M) == null || w.interceptors.response.use(
653
- (R) => R,
654
- async (R) => {
655
- var L;
656
- return typeof R == "object" && R && "response" in R && R.response && typeof R.response == "object" && "status" in R.response && R.response && typeof R.response == "object" && "status" in R.response && ((L = R == null ? void 0 : R.response) == null ? void 0 : L.status) === 401 && (M.defaults.headers.common.Authorization = null, localStorage.removeItem(i), o(s)), Promise.reject(R);
657
- }
658
- ));
659
- }, [i, s]), h && !y ? /* @__PURE__ */ k.jsx(Tr, { fallback: t, children: (T = (C = c.state) == null ? void 0 : C.from) != null && T.state && ((j = (O = c.state) == null ? void 0 : O.from) == null ? void 0 : j.pathname) === n ? /* @__PURE__ */ k.jsx($e, { to: c.state.from.state.from.pathname + c.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ k.jsx(Ue, {}) }) : /* @__PURE__ */ k.jsx($e, { to: n, state: { from: c }, replace: !0 });
660
- }, Yr = () => {
661
- const [t, n] = Ne();
662
- return X(() => {
663
- (async () => {
664
- try {
665
- const { useGoogleTagManager: s } = await import("@tracktor/react-google-tag-manager");
666
- n(s);
667
- } catch (s) {
668
- console.error(s);
669
- }
670
- })().then();
671
- }, []), t;
672
- }, nt = () => {
673
- const { pathname: t } = le(), n = Yr();
674
- return X(() => {
675
- if (n) {
676
- const { sendEvent: i } = n();
677
- i({ event: "pageView", pathname: t });
678
- }
679
- }, [t, n]), /* @__PURE__ */ k.jsx(Ue, {});
680
- }, ce = Sr({
681
- apiURL: void 0,
682
- children: void 0
683
- }), at = ({ children: t, apiURL: n }) => {
684
- const i = ue(
685
- () => ({
686
- apiURL: n
687
- }),
688
- [n]
689
- );
690
- return /* @__PURE__ */ k.jsx(ce.Provider, { value: i, children: t });
691
- }, ot = ({
692
- tokenTypeKey: t = "tokenType",
693
- userLocalStorageKey: n = "user",
694
- tokenKey: i = "accessToken",
695
- postContentType: s = "application/json",
696
- ...v
697
- }) => {
698
- const { apiURL: y = v.baseURL } = Ve(ce);
699
- if (!M.defaults)
700
- return null;
701
- const o = localStorage.getItem(n), c = o ? JSON.parse(o) : null, l = c != null && c[t] ? c[t] : null, g = c != null && c[i] ? c[i] : null, h = o ? `${l} ${g}` : null;
702
- return M.defaults.baseURL = y, M.defaults.headers.post["Content-Type"] = s, h && (M.defaults.headers.common.Authorization = h), null;
703
- }, it = ({ debug: t, resources: n }) => {
704
- var i;
705
- return (i = I) != null && i.isInitialized || (I.use(Pr).use(Ar).init({
706
- debug: t,
707
- fallbackLng: "en",
708
- interpolation: {
709
- escapeValue: !1
710
- },
711
- load: "languageOnly",
712
- react: {
713
- bindI18n: !1,
714
- useSuspense: !0
715
- },
716
- resources: n,
717
- returnNull: !1
718
- }).then(() => {
719
- document.documentElement.lang !== I.resolvedLanguage && I.resolvedLanguage && document.documentElement.setAttribute("lang", I.resolvedLanguage);
720
- }), I.on("languageChanged", (s) => {
721
- document.documentElement.setAttribute("lang", s);
722
- })), null;
723
- }, st = ({
724
- dsn: t,
725
- integrations: n,
726
- tracesSampleRate: i,
727
- replaysSessionSampleRate: s,
728
- replaysOnErrorSampleRate: v,
729
- tracePropagationTargets: y,
730
- ignoreErrors: o,
731
- debug: c,
732
- environment: l
733
- }) => (oe.isInitialized() || (c || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && oe.init({
734
- debug: c,
735
- dsn: t,
736
- environment: l || "production",
737
- ignoreErrors: [...o || [], /dynamically imported module/],
738
- integrations: [
739
- oe.reactRouterV6BrowserTracingIntegration({
740
- createRoutesFromChildren: wr,
741
- matchRoutes: xr,
742
- useEffect: X,
743
- useLocation: le,
744
- useNavigationType: Or
745
- }),
746
- ...n || []
747
- ],
748
- replaysOnErrorSampleRate: v || 1,
749
- replaysSessionSampleRate: s || 0.1,
750
- tracePropagationTargets: y,
751
- tracesSampleRate: i || 1
752
- }), null), ut = ({ IMaskMixin: t, ...n }) => {
753
- const i = ue(
754
- // eslint-disable-next-line react/jsx-props-no-spreading
755
- () => t(({ TextField: s, ...v }) => /* @__PURE__ */ k.jsx(s, { ...v })),
756
- [t]
757
- );
758
- return /* @__PURE__ */ k.jsx(i, { ...n });
759
- }, lt = ({ accessToken: t }) => {
760
- X(() => {
761
- if (!t)
762
- return;
763
- (async () => {
764
- try {
765
- const i = await import("mapbox-gl");
766
- i.accessToken = t;
767
- } catch (i) {
768
- console.error(i);
769
- }
770
- })().then();
771
- }, [t]);
772
- };
773
- var ze = { exports: {} };
774
- (function(t, n) {
775
- (function(i, s) {
776
- t.exports = s();
777
- })(Mr, function() {
778
- var i = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" };
779
- return function(s, v, y) {
780
- var o = v.prototype, c = o.format;
781
- y.en.formats = i, o.format = function(l) {
782
- l === void 0 && (l = "YYYY-MM-DDTHH:mm:ssZ");
783
- var g = this.$locale().formats, h = function(C, T) {
784
- return C.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(O, j, w) {
785
- var R = w && w.toUpperCase();
786
- return j || T[w] || i[w] || T[R].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(D, _, L) {
787
- return _ || L.slice(1);
788
- });
789
- });
790
- }(l, g === void 0 ? {} : g);
791
- return c.call(this, h);
792
- };
793
- };
794
- });
795
- })(ze);
796
- var Ir = ze.exports;
797
- const Nr = /* @__PURE__ */ $r(Ir);
798
- z.extend(Nr);
799
- const ct = ({ language: t }) => (We(() => {
800
- var i;
801
- const n = t || ((i = navigator.language) == null ? void 0 : i.slice(0, 2)) || "en";
802
- if (n === "en") {
803
- import("./en-QMoq2Jc6.js").then((s) => s.e).then(() => {
804
- z.locale(n);
805
- });
806
- return;
807
- }
808
- n === "fr" && import("./fr-sayL6zEF.js").then((s) => s.f).then(() => {
809
- z.locale(n);
810
- }).catch(() => {
811
- import("./en-QMoq2Jc6.js").then((s) => s.e).then(() => {
812
- z.locale("en");
813
- });
814
- });
815
- }, [t]), null), ft = ({ children: t, defaultQueriesOptions: n, defaultMutationsOptions: i }) => {
816
- const s = new kr({
817
- defaultOptions: {
818
- mutations: {
819
- ...i
820
- },
821
- queries: {
822
- getNextPageParam: (v, y, o) => v.length + (o || 0),
823
- refetchOnWindowFocus: !1,
824
- retry: 3,
825
- ...n
826
- }
827
- }
828
- });
829
- return /* @__PURE__ */ k.jsx(Dr, { client: s, children: t });
830
- }, dt = (t) => {
831
- const { unknownErrorTranslationKey: n = "error.unknownError" } = t || {}, i = jr(n), s = ie(
832
- (y) => {
833
- var c, l, g, h, C, T, O, j, w;
834
- const { response: o } = y || {};
835
- return o != null && o.reason ? String(o.reason) : (c = o == null ? void 0 : o.data) != null && c.reason ? String(o.data.reason) : (l = o == null ? void 0 : o.data) != null && l.message ? String(o.data.message) : (h = (g = o == null ? void 0 : o.data) == null ? void 0 : g.detail) != null && h.length && Array.isArray((C = o == null ? void 0 : o.data) == null ? void 0 : C.detail) && ((O = (T = o == null ? void 0 : o.data) == null ? void 0 : T.detail[0]) != null && O.msg) && typeof ((w = (j = o == null ? void 0 : o.data) == null ? void 0 : j.detail[0]) == null ? void 0 : w.msg) == "string" ? String(o.data.detail[0].msg) : i;
836
- },
837
- [i]
838
- );
839
- return { getErrorCode: ie((y) => {
840
- var c, l, g;
841
- const { response: o } = y || {};
842
- return o != null && o.error_code ? String(o == null ? void 0 : o.error_code) : (c = o == null ? void 0 : o.data) != null && c.error_code ? String((l = o == null ? void 0 : o.data) == null ? void 0 : l.error_code) : o != null && o.error_code ? String(o == null ? void 0 : o.error_code) : (g = o == null ? void 0 : o.data) != null && g.error_code ? String(o.data.error_code) : "unknown_error_code";
843
- }, []), printError: s };
844
- }, pt = ({
845
- data: t,
846
- fetchNextPage: n,
847
- isFetchingNextPage: i,
848
- isInitialLoading: s,
849
- isLoading: v,
850
- enabled: y = !0
851
- }) => {
852
- const o = ie(
853
- async (l) => {
854
- i || !y || await n({ pageParam: (l == null ? void 0 : l.pageParam) || l.visibleRowsCount });
855
- },
856
- [y, n, i]
857
- ), c = ue(() => {
858
- if (t)
859
- return t.pages.reduce((l, g) => [...l, ...g], []);
860
- }, [t]);
861
- return {
862
- fetchNextPageOnRowsScrollEnd: o,
863
- isLoading: i || v,
864
- loadingVariant: s ? "skeleton" : "linear",
865
- rows: c
866
- };
867
- }, vt = () => ({
868
- clearAuthenticationToken: () => {
869
- M.defaults.headers.common.Authorization = null;
870
- },
871
- setAuthenticationToken: ({ tokenType: i, accessToken: s }) => {
872
- M.defaults.headers.common.Authorization = `${i} ${s}`;
873
- }
874
- }), Wr = (t, n = "ll") => z(t).format(n), Vr = (t, n = "km") => {
875
- const i = Number(t);
876
- return Number.isNaN(i) ? `0 ${n}` : `${i.toFixed(2)} ${n}`;
877
- }, Ur = (t) => {
878
- const n = t && typeof t == "object" && "pathname" in t && t.pathname ? t.pathname : t;
879
- return typeof n == "string" ? n != null && n.startsWith("/") ? n != null && n.startsWith("/files") ? n : `/files${n}` : n != null && n.startsWith("files") ? `/${n}` : n != null && n.startsWith("files") ? `/${n}` : `/files/${n}` : n;
880
- }, Ye = (t, n) => {
881
- if (!t)
882
- return "";
883
- const i = Ur(t), s = typeof t == "object" && "pathname" in t ? `${t.origin}${i}` : t;
884
- return typeof n == "number" ? `${s.replace("/files", `/thumbs/${n}`)}` : s;
885
- }, mt = () => {
886
- const { apiURL: t } = Ve(ce);
887
- return {
888
- dateAdapter: Wr,
889
- distanceAdapter: Vr,
890
- filePathAdapter: (i, s) => Ye(
891
- t && typeof i == "string" ? {
892
- origin: t,
893
- pathname: i
894
- } : i,
895
- s
896
- )
897
- };
898
- }, zr = (t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase(), Br = (t) => {
899
- const s = t.split("/").filter((v) => v.length > 0).map((v) => v.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((l) => l.charAt(0).toUpperCase() + l.slice(1)).join("")).join("");
900
- return s.charAt(0).toLowerCase() + s.slice(1);
901
- }, Gr = (t, n, i) => {
902
- const s = Br(n), v = zr(i);
903
- return `${s}${v}`;
904
- }, qr = (t) => {
905
- if (t)
906
- return (t == null ? void 0 : t.reduce((n, i) => (n[i] = {
907
- query: {
908
- useInfinite: !0,
909
- useInfiniteQueryParam: "offset",
910
- useQuery: !0
911
- }
912
- }, n), {})) || {};
913
- }, gt = (t) => {
914
- const { input: n = "./openapi.json", operationsToGenerateInfiniteQueryHook: i = void 0 } = t || {};
915
- return {
916
- api: {
917
- hooks: {
918
- afterAllFilesWrite: "prettier src/api/ --write"
919
- },
920
- input: n,
921
- output: {
922
- client: "react-query",
923
- mode: "tags-split",
924
- override: {
925
- header: (s) => [
926
- "Generated by orval 🍺",
927
- ...s.title ? [s.title] : [],
928
- ...s.description ? [s.description] : []
929
- ],
930
- mutator: {
931
- name: "axiosCustomInstance",
932
- path: `${__dirname}/config/orval/mutator/axiosCustomInstance.ts`
933
- },
934
- operationName: Gr,
935
- ...(i == null ? void 0 : i.length) && { operations: qr(i) },
936
- query: {
937
- useQuery: !0
938
- }
939
- },
940
- schemas: "src/api/model",
941
- target: "src/api/services/api.ts"
942
- }
943
- }
944
- };
945
- };
946
- export {
947
- ot as A,
948
- ct as D,
949
- nt as G,
950
- it as I,
951
- ut as M,
952
- ft as Q,
953
- tt as R,
954
- st as S,
955
- lt as a,
956
- at as b,
957
- Mr as c,
958
- pt as d,
959
- vt as e,
960
- mt as f,
961
- gt as g,
962
- Wr as h,
963
- Vr as i,
964
- ce as j,
965
- dt as u
966
- };