@tracktor/shared-module 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/dist/components/GTMSendPageView/GTMSendPageView.d.ts +8 -0
- package/dist/components/GTMSendPageView/index.d.ts +3 -0
- package/dist/components/RequireAuth/RequireAuth.d.ts +6 -19
- package/dist/context/InjectDependenciesProvider.d.ts +27 -9
- package/dist/hooks/useResponseError/useResponseError.d.ts +2 -1
- package/dist/main.d.ts +2 -0
- package/dist/main.js +308 -282
- package/dist/main.umd.cjs +10 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
|
|
2
|
+
export interface GTMSendPageViewProps {
|
|
3
|
+
useGoogleTagManager?: InjectDependenciesContextProps["useGoogleTagManager"];
|
|
4
|
+
Outlet?: InjectDependenciesContextProps["Outlet"];
|
|
5
|
+
useLocation?: InjectDependenciesContextProps["useLocation"];
|
|
6
|
+
}
|
|
7
|
+
declare const GTMSendPageView: ({ ...props }: GTMSendPageViewProps) => JSX.Element;
|
|
8
|
+
export default GTMSendPageView;
|
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
to: string;
|
|
4
|
-
replace?: boolean;
|
|
5
|
-
state?: any;
|
|
6
|
-
}
|
|
7
|
-
interface Location {
|
|
8
|
-
state: any;
|
|
9
|
-
}
|
|
10
|
-
interface Auth {
|
|
11
|
-
isLogged: boolean;
|
|
12
|
-
}
|
|
13
|
-
interface OutletProps {
|
|
14
|
-
context?: unknown;
|
|
15
|
-
}
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
|
|
16
3
|
export interface RequireAuthProps {
|
|
17
|
-
Outlet?: (props: OutletProps) => ReactElement | null;
|
|
18
|
-
Navigate?: (props: NavigateProps) => null;
|
|
19
4
|
loginPath?: string;
|
|
20
5
|
Fallback?: ReactNode;
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
Outlet?: InjectDependenciesContextProps["Outlet"];
|
|
7
|
+
Navigate?: InjectDependenciesContextProps["Navigate"];
|
|
8
|
+
useLocation?: InjectDependenciesContextProps["useLocation"];
|
|
9
|
+
useAuth?: InjectDependenciesContextProps["useAuth"];
|
|
23
10
|
}
|
|
24
11
|
/**
|
|
25
12
|
* RequireAuth component for protected routing
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import type { RequireAuthProps } from '../components/RequireAuth';
|
|
3
|
-
import type { useResponseErrorParams } from '../hooks/useResponseError';
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
4
2
|
export interface InjectDependenciesContextProps {
|
|
5
3
|
/**
|
|
6
4
|
* Children
|
|
@@ -10,24 +8,44 @@ export interface InjectDependenciesContextProps {
|
|
|
10
8
|
* Translate function dependency for useResponseError hook
|
|
11
9
|
* @param str
|
|
12
10
|
*/
|
|
13
|
-
translate
|
|
11
|
+
translate?(str: string): string;
|
|
14
12
|
/**
|
|
15
13
|
* Outlet dependency for RequireAuth component
|
|
16
14
|
*/
|
|
17
|
-
Outlet
|
|
15
|
+
Outlet?(props: {
|
|
16
|
+
context?: unknown;
|
|
17
|
+
}): ReactElement | null;
|
|
18
18
|
/**
|
|
19
19
|
* Navigate dependency for RequireAuth component
|
|
20
20
|
*/
|
|
21
|
-
Navigate
|
|
21
|
+
Navigate?(props: {
|
|
22
|
+
to: string;
|
|
23
|
+
replace?: boolean;
|
|
24
|
+
state?: any;
|
|
25
|
+
}): null;
|
|
22
26
|
/**
|
|
23
27
|
* useLocation dependency for RequireAuth component
|
|
24
28
|
*/
|
|
25
|
-
useLocation
|
|
29
|
+
useLocation?(): {
|
|
30
|
+
state: any;
|
|
31
|
+
pathname: string;
|
|
32
|
+
};
|
|
26
33
|
/**
|
|
27
34
|
* useAuth dependency for RequireAuth component
|
|
28
35
|
*/
|
|
29
|
-
useAuth
|
|
36
|
+
useAuth?(): {
|
|
37
|
+
isLogged: boolean;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* useGoogleTagManager dependency for GTMSendPageView component
|
|
41
|
+
*/
|
|
42
|
+
useGoogleTagManager?(): {
|
|
43
|
+
sendEvent: (event: {
|
|
44
|
+
event: string;
|
|
45
|
+
pathname: string;
|
|
46
|
+
}) => void;
|
|
47
|
+
};
|
|
30
48
|
}
|
|
31
49
|
export declare const InjectDependenciesContext: import("react").Context<InjectDependenciesContextProps>;
|
|
32
|
-
declare const InjectDependenciesProvider: ({ children, translate, useAuth, Outlet, Navigate, useLocation }: InjectDependenciesContextProps) => JSX.Element;
|
|
50
|
+
declare const InjectDependenciesProvider: ({ children, translate, useAuth, Outlet, Navigate, useLocation, useGoogleTagManager, }: InjectDependenciesContextProps) => JSX.Element;
|
|
33
51
|
export default InjectDependenciesProvider;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
|
|
1
2
|
export interface ResponseError {
|
|
2
3
|
data?: {
|
|
3
4
|
code?: number;
|
|
@@ -16,7 +17,7 @@ export interface useResponseErrorParams {
|
|
|
16
17
|
* Translation function if you want to use your own translation function
|
|
17
18
|
* @param str
|
|
18
19
|
*/
|
|
19
|
-
translate?:
|
|
20
|
+
translate?: InjectDependenciesContextProps["translate"];
|
|
20
21
|
/**
|
|
21
22
|
* Translation key returned for the unknown error
|
|
22
23
|
*/
|
package/dist/main.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as RequireAuth } from './components/RequireAuth';
|
|
2
2
|
export * from './components/RequireAuth';
|
|
3
|
+
export { default as GTMSendPageView } from './components/GTMSendPageView';
|
|
4
|
+
export * from './components/GTMSendPageView';
|
|
3
5
|
export { default as InjectDependenciesProvider } from './context/InjectDependenciesProvider';
|
|
4
6
|
export * from './context/InjectDependenciesProvider';
|
|
5
7
|
export { default as useResponseError } from './hooks/useResponseError';
|
package/dist/main.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import je, { createContext as lr, useMemo as dr, useContext as ne, Suspense as vr, useEffect as pr, useCallback as gr } from "react";
|
|
2
|
+
var te = {}, hr = {
|
|
3
3
|
get exports() {
|
|
4
|
-
return
|
|
4
|
+
return te;
|
|
5
5
|
},
|
|
6
|
-
set exports(
|
|
7
|
-
|
|
6
|
+
set exports(f) {
|
|
7
|
+
te = f;
|
|
8
8
|
}
|
|
9
|
-
},
|
|
9
|
+
}, L = {};
|
|
10
10
|
/**
|
|
11
11
|
* @license React
|
|
12
12
|
* react-jsx-runtime.production.min.js
|
|
@@ -16,25 +16,25 @@ var ee = {}, pr = {
|
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
18
|
*/
|
|
19
|
-
var
|
|
20
|
-
function
|
|
21
|
-
if (
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
function
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
for (
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
for (
|
|
32
|
-
|
|
33
|
-
return { $$typeof:
|
|
19
|
+
var Pe;
|
|
20
|
+
function Er() {
|
|
21
|
+
if (Pe)
|
|
22
|
+
return L;
|
|
23
|
+
Pe = 1;
|
|
24
|
+
var f = je, h = Symbol.for("react.element"), g = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, v = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
25
|
+
function o(_, c, T) {
|
|
26
|
+
var p, y = {}, w = null, P = null;
|
|
27
|
+
T !== void 0 && (w = "" + T), c.key !== void 0 && (w = "" + c.key), c.ref !== void 0 && (P = c.ref);
|
|
28
|
+
for (p in c)
|
|
29
|
+
E.call(c, p) && !m.hasOwnProperty(p) && (y[p] = c[p]);
|
|
30
|
+
if (_ && _.defaultProps)
|
|
31
|
+
for (p in c = _.defaultProps, c)
|
|
32
|
+
y[p] === void 0 && (y[p] = c[p]);
|
|
33
|
+
return { $$typeof: h, type: _, key: w, ref: P, props: y, _owner: v.current };
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return L.Fragment = g, L.jsx = o, L.jsxs = o, L;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var Y = {};
|
|
38
38
|
/**
|
|
39
39
|
* @license React
|
|
40
40
|
* react-jsx-runtime.development.js
|
|
@@ -44,91 +44,91 @@ var W = {};
|
|
|
44
44
|
* This source code is licensed under the MIT license found in the
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
var
|
|
48
|
-
function
|
|
49
|
-
return
|
|
50
|
-
var
|
|
51
|
-
function
|
|
47
|
+
var xe;
|
|
48
|
+
function mr() {
|
|
49
|
+
return xe || (xe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
+
var f = je, h = Symbol.for("react.element"), g = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), _ = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), P = Symbol.for("react.offscreen"), F = Symbol.iterator, W = "@@iterator";
|
|
51
|
+
function ke(e) {
|
|
52
52
|
if (e === null || typeof e != "object")
|
|
53
53
|
return null;
|
|
54
|
-
var r =
|
|
54
|
+
var r = F && e[F] || e[W];
|
|
55
55
|
return typeof r == "function" ? r : null;
|
|
56
56
|
}
|
|
57
|
-
var j =
|
|
58
|
-
function
|
|
57
|
+
var j = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
58
|
+
function b(e) {
|
|
59
59
|
{
|
|
60
60
|
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
61
61
|
t[n - 1] = arguments[n];
|
|
62
|
-
|
|
62
|
+
De("error", e, t);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function De(e, r, t) {
|
|
66
66
|
{
|
|
67
67
|
var n = j.ReactDebugCurrentFrame, u = n.getStackAddendum();
|
|
68
68
|
u !== "" && (r += "%s", t = t.concat([u]));
|
|
69
|
-
var s = t.map(function(
|
|
70
|
-
return String(
|
|
69
|
+
var s = t.map(function(i) {
|
|
70
|
+
return String(i);
|
|
71
71
|
});
|
|
72
72
|
s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
var Ae = !1,
|
|
76
|
-
|
|
77
|
-
function
|
|
78
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
75
|
+
var Ae = !1, Fe = !1, Ie = !1, $e = !1, Le = !1, ae;
|
|
76
|
+
ae = Symbol.for("react.module.reference");
|
|
77
|
+
function Ye(e) {
|
|
78
|
+
return !!(typeof e == "string" || typeof e == "function" || e === E || e === m || Le || e === v || e === T || e === p || $e || e === P || Ae || Fe || Ie || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === y || e.$$typeof === o || e.$$typeof === _ || e.$$typeof === c || // This needs to include all possible module reference object
|
|
79
79
|
// types supported by any Flight configuration anywhere since
|
|
80
80
|
// we don't know which Flight build this will end up being used
|
|
81
81
|
// with.
|
|
82
|
-
e.$$typeof ===
|
|
82
|
+
e.$$typeof === ae || e.getModuleId !== void 0));
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function We(e, r, t) {
|
|
85
85
|
var n = e.displayName;
|
|
86
86
|
if (n)
|
|
87
87
|
return n;
|
|
88
88
|
var u = r.displayName || r.name || "";
|
|
89
89
|
return u !== "" ? t + "(" + u + ")" : t;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function oe(e) {
|
|
92
92
|
return e.displayName || "Context";
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function S(e) {
|
|
95
95
|
if (e == null)
|
|
96
96
|
return null;
|
|
97
|
-
if (typeof e.tag == "number" &&
|
|
97
|
+
if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
98
98
|
return e.displayName || e.name || null;
|
|
99
99
|
if (typeof e == "string")
|
|
100
100
|
return e;
|
|
101
101
|
switch (e) {
|
|
102
|
-
case
|
|
102
|
+
case E:
|
|
103
103
|
return "Fragment";
|
|
104
104
|
case g:
|
|
105
105
|
return "Portal";
|
|
106
|
-
case
|
|
106
|
+
case m:
|
|
107
107
|
return "Profiler";
|
|
108
|
-
case
|
|
108
|
+
case v:
|
|
109
109
|
return "StrictMode";
|
|
110
|
-
case
|
|
110
|
+
case T:
|
|
111
111
|
return "Suspense";
|
|
112
|
-
case
|
|
112
|
+
case p:
|
|
113
113
|
return "SuspenseList";
|
|
114
114
|
}
|
|
115
115
|
if (typeof e == "object")
|
|
116
116
|
switch (e.$$typeof) {
|
|
117
|
-
case
|
|
117
|
+
case _:
|
|
118
118
|
var r = e;
|
|
119
|
-
return
|
|
120
|
-
case
|
|
119
|
+
return oe(r) + ".Consumer";
|
|
120
|
+
case o:
|
|
121
121
|
var t = e;
|
|
122
|
-
return
|
|
123
|
-
case
|
|
124
|
-
return
|
|
125
|
-
case
|
|
122
|
+
return oe(t._context) + ".Provider";
|
|
123
|
+
case c:
|
|
124
|
+
return We(e, e.render, "ForwardRef");
|
|
125
|
+
case y:
|
|
126
126
|
var n = e.displayName || null;
|
|
127
|
-
return n !== null ? n :
|
|
128
|
-
case
|
|
129
|
-
var u = e, s = u._payload,
|
|
127
|
+
return n !== null ? n : S(e.type) || "Memo";
|
|
128
|
+
case w: {
|
|
129
|
+
var u = e, s = u._payload, i = u._init;
|
|
130
130
|
try {
|
|
131
|
-
return
|
|
131
|
+
return S(i(s));
|
|
132
132
|
} catch {
|
|
133
133
|
return null;
|
|
134
134
|
}
|
|
@@ -136,18 +136,18 @@ function hr() {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
var x = Object.assign,
|
|
140
|
-
function
|
|
139
|
+
var x = Object.assign, I = 0, ie, ue, se, fe, ce, le, de;
|
|
140
|
+
function ve() {
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
function
|
|
142
|
+
ve.__reactDisabledLog = !0;
|
|
143
|
+
function Me() {
|
|
144
144
|
{
|
|
145
|
-
if (
|
|
146
|
-
|
|
145
|
+
if (I === 0) {
|
|
146
|
+
ie = console.log, ue = console.info, se = console.warn, fe = console.error, ce = console.group, le = console.groupCollapsed, de = console.groupEnd;
|
|
147
147
|
var e = {
|
|
148
148
|
configurable: !0,
|
|
149
149
|
enumerable: !0,
|
|
150
|
-
value:
|
|
150
|
+
value: ve,
|
|
151
151
|
writable: !0
|
|
152
152
|
};
|
|
153
153
|
Object.defineProperties(console, {
|
|
@@ -160,12 +160,12 @@ function hr() {
|
|
|
160
160
|
groupEnd: e
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
|
|
163
|
+
I++;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
function Ne() {
|
|
167
167
|
{
|
|
168
|
-
if (
|
|
168
|
+
if (I--, I === 0) {
|
|
169
169
|
var e = {
|
|
170
170
|
configurable: !0,
|
|
171
171
|
enumerable: !0,
|
|
@@ -173,186 +173,186 @@ function hr() {
|
|
|
173
173
|
};
|
|
174
174
|
Object.defineProperties(console, {
|
|
175
175
|
log: x({}, e, {
|
|
176
|
-
value:
|
|
176
|
+
value: ie
|
|
177
177
|
}),
|
|
178
178
|
info: x({}, e, {
|
|
179
|
-
value:
|
|
179
|
+
value: ue
|
|
180
180
|
}),
|
|
181
181
|
warn: x({}, e, {
|
|
182
|
-
value:
|
|
182
|
+
value: se
|
|
183
183
|
}),
|
|
184
184
|
error: x({}, e, {
|
|
185
|
-
value:
|
|
185
|
+
value: fe
|
|
186
186
|
}),
|
|
187
187
|
group: x({}, e, {
|
|
188
|
-
value:
|
|
188
|
+
value: ce
|
|
189
189
|
}),
|
|
190
190
|
groupCollapsed: x({}, e, {
|
|
191
|
-
value:
|
|
191
|
+
value: le
|
|
192
192
|
}),
|
|
193
193
|
groupEnd: x({}, e, {
|
|
194
|
-
value:
|
|
194
|
+
value: de
|
|
195
195
|
})
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
|
-
|
|
198
|
+
I < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
var J = j.ReactCurrentDispatcher,
|
|
202
|
-
function
|
|
201
|
+
var J = j.ReactCurrentDispatcher, z;
|
|
202
|
+
function M(e, r, t) {
|
|
203
203
|
{
|
|
204
|
-
if (
|
|
204
|
+
if (z === void 0)
|
|
205
205
|
try {
|
|
206
206
|
throw Error();
|
|
207
207
|
} catch (u) {
|
|
208
208
|
var n = u.stack.trim().match(/\n( *(at )?)/);
|
|
209
|
-
|
|
209
|
+
z = n && n[1] || "";
|
|
210
210
|
}
|
|
211
211
|
return `
|
|
212
|
-
` +
|
|
212
|
+
` + z + e;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
var
|
|
215
|
+
var K = !1, N;
|
|
216
216
|
{
|
|
217
|
-
var
|
|
218
|
-
|
|
217
|
+
var Ve = typeof WeakMap == "function" ? WeakMap : Map;
|
|
218
|
+
N = new Ve();
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
if (!e ||
|
|
220
|
+
function pe(e, r) {
|
|
221
|
+
if (!e || K)
|
|
222
222
|
return "";
|
|
223
223
|
{
|
|
224
|
-
var t =
|
|
224
|
+
var t = N.get(e);
|
|
225
225
|
if (t !== void 0)
|
|
226
226
|
return t;
|
|
227
227
|
}
|
|
228
228
|
var n;
|
|
229
|
-
|
|
229
|
+
K = !0;
|
|
230
230
|
var u = Error.prepareStackTrace;
|
|
231
231
|
Error.prepareStackTrace = void 0;
|
|
232
232
|
var s;
|
|
233
|
-
s = J.current, J.current = null,
|
|
233
|
+
s = J.current, J.current = null, Me();
|
|
234
234
|
try {
|
|
235
235
|
if (r) {
|
|
236
|
-
var
|
|
236
|
+
var i = function() {
|
|
237
237
|
throw Error();
|
|
238
238
|
};
|
|
239
|
-
if (Object.defineProperty(
|
|
239
|
+
if (Object.defineProperty(i.prototype, "props", {
|
|
240
240
|
set: function() {
|
|
241
241
|
throw Error();
|
|
242
242
|
}
|
|
243
243
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
244
244
|
try {
|
|
245
|
-
Reflect.construct(
|
|
246
|
-
} catch (
|
|
247
|
-
n =
|
|
245
|
+
Reflect.construct(i, []);
|
|
246
|
+
} catch (C) {
|
|
247
|
+
n = C;
|
|
248
248
|
}
|
|
249
|
-
Reflect.construct(e, [],
|
|
249
|
+
Reflect.construct(e, [], i);
|
|
250
250
|
} else {
|
|
251
251
|
try {
|
|
252
|
-
|
|
253
|
-
} catch (
|
|
254
|
-
n =
|
|
252
|
+
i.call();
|
|
253
|
+
} catch (C) {
|
|
254
|
+
n = C;
|
|
255
255
|
}
|
|
256
|
-
e.call(
|
|
256
|
+
e.call(i.prototype);
|
|
257
257
|
}
|
|
258
258
|
} else {
|
|
259
259
|
try {
|
|
260
260
|
throw Error();
|
|
261
|
-
} catch (
|
|
262
|
-
n =
|
|
261
|
+
} catch (C) {
|
|
262
|
+
n = C;
|
|
263
263
|
}
|
|
264
264
|
e();
|
|
265
265
|
}
|
|
266
|
-
} catch (
|
|
267
|
-
if (
|
|
268
|
-
for (var a =
|
|
269
|
-
`),
|
|
270
|
-
`), l = a.length - 1,
|
|
271
|
-
|
|
272
|
-
for (; l >= 1 &&
|
|
273
|
-
if (a[l] !==
|
|
274
|
-
if (l !== 1 ||
|
|
266
|
+
} catch (C) {
|
|
267
|
+
if (C && n && typeof C.stack == "string") {
|
|
268
|
+
for (var a = C.stack.split(`
|
|
269
|
+
`), R = n.stack.split(`
|
|
270
|
+
`), l = a.length - 1, d = R.length - 1; l >= 1 && d >= 0 && a[l] !== R[d]; )
|
|
271
|
+
d--;
|
|
272
|
+
for (; l >= 1 && d >= 0; l--, d--)
|
|
273
|
+
if (a[l] !== R[d]) {
|
|
274
|
+
if (l !== 1 || d !== 1)
|
|
275
275
|
do
|
|
276
|
-
if (l--,
|
|
276
|
+
if (l--, d--, d < 0 || a[l] !== R[d]) {
|
|
277
277
|
var O = `
|
|
278
278
|
` + a[l].replace(" at new ", " at ");
|
|
279
|
-
return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" &&
|
|
279
|
+
return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && N.set(e, O), O;
|
|
280
280
|
}
|
|
281
|
-
while (l >= 1 &&
|
|
281
|
+
while (l >= 1 && d >= 0);
|
|
282
282
|
break;
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
} finally {
|
|
286
|
-
|
|
286
|
+
K = !1, J.current = s, Ne(), Error.prepareStackTrace = u;
|
|
287
287
|
}
|
|
288
|
-
var
|
|
289
|
-
return typeof e == "function" &&
|
|
288
|
+
var D = e ? e.displayName || e.name : "", Ce = D ? M(D) : "";
|
|
289
|
+
return typeof e == "function" && N.set(e, Ce), Ce;
|
|
290
290
|
}
|
|
291
291
|
function Ue(e, r, t) {
|
|
292
|
-
return
|
|
292
|
+
return pe(e, !1);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function qe(e) {
|
|
295
295
|
var r = e.prototype;
|
|
296
296
|
return !!(r && r.isReactComponent);
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function V(e, r, t) {
|
|
299
299
|
if (e == null)
|
|
300
300
|
return "";
|
|
301
301
|
if (typeof e == "function")
|
|
302
|
-
return
|
|
302
|
+
return pe(e, qe(e));
|
|
303
303
|
if (typeof e == "string")
|
|
304
|
-
return
|
|
304
|
+
return M(e);
|
|
305
305
|
switch (e) {
|
|
306
|
-
case
|
|
307
|
-
return
|
|
308
|
-
case
|
|
309
|
-
return
|
|
306
|
+
case T:
|
|
307
|
+
return M("Suspense");
|
|
308
|
+
case p:
|
|
309
|
+
return M("SuspenseList");
|
|
310
310
|
}
|
|
311
311
|
if (typeof e == "object")
|
|
312
312
|
switch (e.$$typeof) {
|
|
313
|
-
case
|
|
313
|
+
case c:
|
|
314
314
|
return Ue(e.render);
|
|
315
|
-
case
|
|
316
|
-
return
|
|
317
|
-
case
|
|
315
|
+
case y:
|
|
316
|
+
return V(e.type, r, t);
|
|
317
|
+
case w: {
|
|
318
318
|
var n = e, u = n._payload, s = n._init;
|
|
319
319
|
try {
|
|
320
|
-
return
|
|
320
|
+
return V(s(u), r, t);
|
|
321
321
|
} catch {
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
return "";
|
|
326
326
|
}
|
|
327
|
-
var
|
|
327
|
+
var U = Object.prototype.hasOwnProperty, ge = {}, he = j.ReactDebugCurrentFrame;
|
|
328
328
|
function q(e) {
|
|
329
329
|
if (e) {
|
|
330
|
-
var r = e._owner, t =
|
|
331
|
-
|
|
330
|
+
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
331
|
+
he.setExtraStackFrame(t);
|
|
332
332
|
} else
|
|
333
|
-
|
|
333
|
+
he.setExtraStackFrame(null);
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function Ge(e, r, t, n, u) {
|
|
336
336
|
{
|
|
337
|
-
var s = Function.call.bind(
|
|
338
|
-
for (var
|
|
339
|
-
if (s(e,
|
|
337
|
+
var s = Function.call.bind(U);
|
|
338
|
+
for (var i in e)
|
|
339
|
+
if (s(e, i)) {
|
|
340
340
|
var a = void 0;
|
|
341
341
|
try {
|
|
342
|
-
if (typeof e[
|
|
343
|
-
var
|
|
344
|
-
throw
|
|
342
|
+
if (typeof e[i] != "function") {
|
|
343
|
+
var R = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
344
|
+
throw R.name = "Invariant Violation", R;
|
|
345
345
|
}
|
|
346
|
-
a = e[
|
|
346
|
+
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
347
347
|
} catch (l) {
|
|
348
348
|
a = l;
|
|
349
349
|
}
|
|
350
|
-
a && !(a instanceof Error) && (q(u),
|
|
350
|
+
a && !(a instanceof Error) && (q(u), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), q(null)), a instanceof Error && !(a.message in ge) && (ge[a.message] = !0, q(u), b("Failed %s type: %s", t, a.message), q(null));
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
var Be = Array.isArray;
|
|
355
|
-
function
|
|
355
|
+
function H(e) {
|
|
356
356
|
return Be(e);
|
|
357
357
|
}
|
|
358
358
|
function Je(e) {
|
|
@@ -361,53 +361,53 @@ function hr() {
|
|
|
361
361
|
return t;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function ze(e) {
|
|
365
365
|
try {
|
|
366
|
-
return
|
|
366
|
+
return Ee(e), !1;
|
|
367
367
|
} catch {
|
|
368
368
|
return !0;
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function Ee(e) {
|
|
372
372
|
return "" + e;
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
if (
|
|
376
|
-
return
|
|
374
|
+
function me(e) {
|
|
375
|
+
if (ze(e))
|
|
376
|
+
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), Ee(e);
|
|
377
377
|
}
|
|
378
|
-
var
|
|
378
|
+
var $ = j.ReactCurrentOwner, Ke = {
|
|
379
379
|
key: !0,
|
|
380
380
|
ref: !0,
|
|
381
381
|
__self: !0,
|
|
382
382
|
__source: !0
|
|
383
|
-
},
|
|
384
|
-
|
|
385
|
-
function
|
|
386
|
-
if (
|
|
383
|
+
}, ye, be, X;
|
|
384
|
+
X = {};
|
|
385
|
+
function He(e) {
|
|
386
|
+
if (U.call(e, "ref")) {
|
|
387
387
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
388
388
|
if (r && r.isReactWarning)
|
|
389
389
|
return !1;
|
|
390
390
|
}
|
|
391
391
|
return e.ref !== void 0;
|
|
392
392
|
}
|
|
393
|
-
function
|
|
394
|
-
if (
|
|
393
|
+
function Xe(e) {
|
|
394
|
+
if (U.call(e, "key")) {
|
|
395
395
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
396
396
|
if (r && r.isReactWarning)
|
|
397
397
|
return !1;
|
|
398
398
|
}
|
|
399
399
|
return e.key !== void 0;
|
|
400
400
|
}
|
|
401
|
-
function
|
|
402
|
-
if (typeof e.ref == "string" &&
|
|
403
|
-
var t =
|
|
404
|
-
|
|
401
|
+
function Ze(e, r) {
|
|
402
|
+
if (typeof e.ref == "string" && $.current && r && $.current.stateNode !== r) {
|
|
403
|
+
var t = S($.current.type);
|
|
404
|
+
X[t] || (b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', S($.current.type), e.ref), X[t] = !0);
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function Qe(e, r) {
|
|
408
408
|
{
|
|
409
409
|
var t = function() {
|
|
410
|
-
|
|
410
|
+
ye || (ye = !0, b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
411
411
|
};
|
|
412
412
|
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
413
413
|
get: t,
|
|
@@ -415,10 +415,10 @@ function hr() {
|
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function er(e, r) {
|
|
419
419
|
{
|
|
420
420
|
var t = function() {
|
|
421
|
-
|
|
421
|
+
be || (be = !0, b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
422
422
|
};
|
|
423
423
|
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
424
424
|
get: t,
|
|
@@ -426,15 +426,15 @@ function hr() {
|
|
|
426
426
|
});
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
var
|
|
429
|
+
var rr = function(e, r, t, n, u, s, i) {
|
|
430
430
|
var a = {
|
|
431
431
|
// This tag allows us to uniquely identify this as a React Element
|
|
432
|
-
$$typeof:
|
|
432
|
+
$$typeof: h,
|
|
433
433
|
// Built-in properties that belong on the element
|
|
434
434
|
type: e,
|
|
435
435
|
key: r,
|
|
436
436
|
ref: t,
|
|
437
|
-
props:
|
|
437
|
+
props: i,
|
|
438
438
|
// Record the component responsible for creating this element.
|
|
439
439
|
_owner: s
|
|
440
440
|
};
|
|
@@ -455,41 +455,41 @@ function hr() {
|
|
|
455
455
|
value: u
|
|
456
456
|
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
457
457
|
};
|
|
458
|
-
function
|
|
458
|
+
function tr(e, r, t, n, u) {
|
|
459
459
|
{
|
|
460
|
-
var s,
|
|
461
|
-
t !== void 0 && (
|
|
460
|
+
var s, i = {}, a = null, R = null;
|
|
461
|
+
t !== void 0 && (me(t), a = "" + t), Xe(r) && (me(r.key), a = "" + r.key), He(r) && (R = r.ref, Ze(r, u));
|
|
462
462
|
for (s in r)
|
|
463
|
-
|
|
463
|
+
U.call(r, s) && !Ke.hasOwnProperty(s) && (i[s] = r[s]);
|
|
464
464
|
if (e && e.defaultProps) {
|
|
465
465
|
var l = e.defaultProps;
|
|
466
466
|
for (s in l)
|
|
467
|
-
|
|
467
|
+
i[s] === void 0 && (i[s] = l[s]);
|
|
468
468
|
}
|
|
469
|
-
if (a ||
|
|
470
|
-
var
|
|
471
|
-
a &&
|
|
469
|
+
if (a || R) {
|
|
470
|
+
var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
471
|
+
a && Qe(i, d), R && er(i, d);
|
|
472
472
|
}
|
|
473
|
-
return
|
|
473
|
+
return rr(e, a, R, u, n, $.current, i);
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
var
|
|
476
|
+
var Z = j.ReactCurrentOwner, Re = j.ReactDebugCurrentFrame;
|
|
477
477
|
function k(e) {
|
|
478
478
|
if (e) {
|
|
479
|
-
var r = e._owner, t =
|
|
480
|
-
|
|
479
|
+
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
480
|
+
Re.setExtraStackFrame(t);
|
|
481
481
|
} else
|
|
482
|
-
|
|
482
|
+
Re.setExtraStackFrame(null);
|
|
483
483
|
}
|
|
484
|
-
var
|
|
485
|
-
|
|
486
|
-
function
|
|
487
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
484
|
+
var Q;
|
|
485
|
+
Q = !1;
|
|
486
|
+
function ee(e) {
|
|
487
|
+
return typeof e == "object" && e !== null && e.$$typeof === h;
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function _e() {
|
|
490
490
|
{
|
|
491
|
-
if (
|
|
492
|
-
var e =
|
|
491
|
+
if (Z.current) {
|
|
492
|
+
var e = S(Z.current.type);
|
|
493
493
|
if (e)
|
|
494
494
|
return `
|
|
495
495
|
|
|
@@ -498,7 +498,7 @@ Check the render method of \`` + e + "`.";
|
|
|
498
498
|
return "";
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function nr(e) {
|
|
502
502
|
{
|
|
503
503
|
if (e !== void 0) {
|
|
504
504
|
var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
|
|
@@ -509,10 +509,10 @@ Check your code at ` + r + ":" + t + ".";
|
|
|
509
509
|
return "";
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
var
|
|
513
|
-
function
|
|
512
|
+
var we = {};
|
|
513
|
+
function ar(e) {
|
|
514
514
|
{
|
|
515
|
-
var r =
|
|
515
|
+
var r = _e();
|
|
516
516
|
if (!r) {
|
|
517
517
|
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
518
518
|
t && (r = `
|
|
@@ -522,39 +522,39 @@ Check the top-level render call using <` + t + ">.");
|
|
|
522
522
|
return r;
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function Te(e, r) {
|
|
526
526
|
{
|
|
527
527
|
if (!e._store || e._store.validated || e.key != null)
|
|
528
528
|
return;
|
|
529
529
|
e._store.validated = !0;
|
|
530
|
-
var t =
|
|
531
|
-
if (
|
|
530
|
+
var t = ar(r);
|
|
531
|
+
if (we[t])
|
|
532
532
|
return;
|
|
533
|
-
|
|
533
|
+
we[t] = !0;
|
|
534
534
|
var n = "";
|
|
535
|
-
e && e._owner && e._owner !==
|
|
535
|
+
e && e._owner && e._owner !== Z.current && (n = " It was passed a child from " + S(e._owner.type) + "."), k(e), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), k(null);
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function Oe(e, r) {
|
|
539
539
|
{
|
|
540
540
|
if (typeof e != "object")
|
|
541
541
|
return;
|
|
542
|
-
if (
|
|
542
|
+
if (H(e))
|
|
543
543
|
for (var t = 0; t < e.length; t++) {
|
|
544
544
|
var n = e[t];
|
|
545
|
-
|
|
545
|
+
ee(n) && Te(n, r);
|
|
546
546
|
}
|
|
547
|
-
else if (
|
|
547
|
+
else if (ee(e))
|
|
548
548
|
e._store && (e._store.validated = !0);
|
|
549
549
|
else if (e) {
|
|
550
|
-
var u =
|
|
550
|
+
var u = ke(e);
|
|
551
551
|
if (typeof u == "function" && u !== e.entries)
|
|
552
|
-
for (var s = u.call(e),
|
|
553
|
-
|
|
552
|
+
for (var s = u.call(e), i; !(i = s.next()).done; )
|
|
553
|
+
ee(i.value) && Te(i.value, r);
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function or(e) {
|
|
558
558
|
{
|
|
559
559
|
var r = e.type;
|
|
560
560
|
if (r == null || typeof r == "string")
|
|
@@ -562,129 +562,155 @@ Check the top-level render call using <` + t + ">.");
|
|
|
562
562
|
var t;
|
|
563
563
|
if (typeof r == "function")
|
|
564
564
|
t = r.propTypes;
|
|
565
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
|
565
|
+
else if (typeof r == "object" && (r.$$typeof === c || // Note: Memo only checks outer props here.
|
|
566
566
|
// Inner props are checked in the reconciler.
|
|
567
|
-
r.$$typeof ===
|
|
567
|
+
r.$$typeof === y))
|
|
568
568
|
t = r.propTypes;
|
|
569
569
|
else
|
|
570
570
|
return;
|
|
571
571
|
if (t) {
|
|
572
|
-
var n =
|
|
573
|
-
|
|
574
|
-
} else if (r.PropTypes !== void 0 && !
|
|
575
|
-
|
|
576
|
-
var u =
|
|
577
|
-
|
|
572
|
+
var n = S(r);
|
|
573
|
+
Ge(t, e.props, "prop", n, e);
|
|
574
|
+
} else if (r.PropTypes !== void 0 && !Q) {
|
|
575
|
+
Q = !0;
|
|
576
|
+
var u = S(r);
|
|
577
|
+
b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
|
|
578
578
|
}
|
|
579
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
579
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function ir(e) {
|
|
583
583
|
{
|
|
584
584
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
585
585
|
var n = r[t];
|
|
586
586
|
if (n !== "children" && n !== "key") {
|
|
587
|
-
k(e),
|
|
587
|
+
k(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), k(null);
|
|
588
588
|
break;
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
|
-
e.ref !== null && (k(e),
|
|
591
|
+
e.ref !== null && (k(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function Se(e, r, t, n, u, s) {
|
|
595
595
|
{
|
|
596
|
-
var
|
|
597
|
-
if (!
|
|
596
|
+
var i = Ye(e);
|
|
597
|
+
if (!i) {
|
|
598
598
|
var a = "";
|
|
599
599
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
600
|
-
var
|
|
601
|
-
|
|
600
|
+
var R = nr(u);
|
|
601
|
+
R ? a += R : a += _e();
|
|
602
602
|
var l;
|
|
603
|
-
e === null ? l = "null" :
|
|
603
|
+
e === null ? l = "null" : H(e) ? l = "array" : e !== void 0 && e.$$typeof === h ? (l = "<" + (S(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
|
|
604
604
|
}
|
|
605
|
-
var
|
|
606
|
-
if (
|
|
607
|
-
return
|
|
608
|
-
if (
|
|
605
|
+
var d = tr(e, r, t, u, s);
|
|
606
|
+
if (d == null)
|
|
607
|
+
return d;
|
|
608
|
+
if (i) {
|
|
609
609
|
var O = r.children;
|
|
610
610
|
if (O !== void 0)
|
|
611
611
|
if (n)
|
|
612
|
-
if (
|
|
613
|
-
for (var
|
|
614
|
-
|
|
612
|
+
if (H(O)) {
|
|
613
|
+
for (var D = 0; D < O.length; D++)
|
|
614
|
+
Oe(O[D], e);
|
|
615
615
|
Object.freeze && Object.freeze(O);
|
|
616
616
|
} else
|
|
617
|
-
|
|
617
|
+
b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
618
618
|
else
|
|
619
|
-
|
|
619
|
+
Oe(O, e);
|
|
620
620
|
}
|
|
621
|
-
return e ===
|
|
621
|
+
return e === E ? ir(d) : or(d), d;
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
|
-
function ir(e, r, t) {
|
|
625
|
-
return we(e, r, t, !0);
|
|
626
|
-
}
|
|
627
624
|
function ur(e, r, t) {
|
|
628
|
-
return
|
|
625
|
+
return Se(e, r, t, !0);
|
|
629
626
|
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
627
|
+
function sr(e, r, t) {
|
|
628
|
+
return Se(e, r, t, !1);
|
|
629
|
+
}
|
|
630
|
+
var fr = sr, cr = ur;
|
|
631
|
+
Y.Fragment = E, Y.jsx = fr, Y.jsxs = cr;
|
|
632
|
+
}()), Y;
|
|
633
633
|
}
|
|
634
|
-
(function(
|
|
635
|
-
process.env.NODE_ENV === "production" ?
|
|
636
|
-
})(
|
|
637
|
-
const
|
|
634
|
+
(function(f) {
|
|
635
|
+
process.env.NODE_ENV === "production" ? f.exports = Er() : f.exports = mr();
|
|
636
|
+
})(hr);
|
|
637
|
+
const A = te.jsx, B = lr({
|
|
638
638
|
children: void 0,
|
|
639
639
|
Navigate: void 0,
|
|
640
640
|
Outlet: void 0,
|
|
641
641
|
translate: void 0,
|
|
642
642
|
useAuth: void 0,
|
|
643
643
|
useLocation: void 0
|
|
644
|
-
}),
|
|
645
|
-
|
|
644
|
+
}), br = ({
|
|
645
|
+
children: f,
|
|
646
|
+
translate: h,
|
|
647
|
+
useAuth: g,
|
|
648
|
+
Outlet: E,
|
|
649
|
+
Navigate: v,
|
|
650
|
+
useLocation: m,
|
|
651
|
+
useGoogleTagManager: o
|
|
652
|
+
}) => {
|
|
653
|
+
const _ = dr(
|
|
646
654
|
() => ({
|
|
647
|
-
Navigate:
|
|
648
|
-
Outlet:
|
|
649
|
-
translate:
|
|
655
|
+
Navigate: v,
|
|
656
|
+
Outlet: E,
|
|
657
|
+
translate: h,
|
|
650
658
|
useAuth: g,
|
|
651
|
-
|
|
659
|
+
useGoogleTagManager: o,
|
|
660
|
+
useLocation: m
|
|
652
661
|
}),
|
|
653
|
-
[
|
|
662
|
+
[v, E, h, g, o, m]
|
|
654
663
|
);
|
|
655
|
-
return /* @__PURE__ */
|
|
656
|
-
},
|
|
657
|
-
var
|
|
664
|
+
return /* @__PURE__ */ A(B.Provider, { value: _, children: f });
|
|
665
|
+
}, G = (f) => `RequireAuth require « ${f} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Rr = ({ Fallback: f, loginPath: h = "/login", ...g }) => {
|
|
666
|
+
var T, p, y, w;
|
|
667
|
+
const {
|
|
668
|
+
useLocation: E = g.useLocation,
|
|
669
|
+
useAuth: v = g.useAuth,
|
|
670
|
+
Outlet: m = g.Outlet,
|
|
671
|
+
Navigate: o = g.Navigate
|
|
672
|
+
} = ne(B);
|
|
673
|
+
if (v === void 0)
|
|
674
|
+
throw new Error(G("useAuth"));
|
|
675
|
+
if (E === void 0)
|
|
676
|
+
throw new Error(G("useLocation"));
|
|
677
|
+
if (m === void 0)
|
|
678
|
+
throw new Error(G("Outlet"));
|
|
679
|
+
if (o === void 0)
|
|
680
|
+
throw new Error(G("Navigate"));
|
|
681
|
+
const { isLogged: _ } = v(), c = E();
|
|
682
|
+
return _ ? /* @__PURE__ */ A(vr, { fallback: f, children: (p = (T = c.state) == null ? void 0 : T.from) != null && p.state && ((w = (y = c.state) == null ? void 0 : y.from) == null ? void 0 : w.pathname) === h ? /* @__PURE__ */ A(o, { to: c.state.from.state.from.pathname + c.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ A(m, {}) }) : /* @__PURE__ */ A(o, { to: h, state: { from: c }, replace: !0 });
|
|
683
|
+
}, re = (f) => `GTMSendPageView require « ${f} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, _r = ({ ...f }) => {
|
|
658
684
|
const {
|
|
659
|
-
useLocation:
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
},
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
return p != null && p.reason ? String(p.reason) : (T = i == null ? void 0 : i.data) != null && T.reason ? String(i.data.reason) : (f = i == null ? void 0 : i.data) != null && f.message ? String(i.data.message) : (v = (w = i == null ? void 0 : i.data) == null ? void 0 : w.detail) != null && v.length && Array.isArray((h = i == null ? void 0 : i.data) == null ? void 0 : h.detail) && ((P = (R = i == null ? void 0 : i.data) == null ? void 0 : R.detail[0]) != null && P.msg) && typeof ((L = (D = i == null ? void 0 : i.data) == null ? void 0 : D.detail[0]) == null ? void 0 : L.msg) == "string" ? String(i.data.detail[0].msg) : _;
|
|
685
|
+
useLocation: h = f.useLocation,
|
|
686
|
+
Outlet: g = f.Outlet,
|
|
687
|
+
useGoogleTagManager: E = f.useGoogleTagManager
|
|
688
|
+
} = ne(B);
|
|
689
|
+
if (h === void 0)
|
|
690
|
+
throw new Error(re("useLocation"));
|
|
691
|
+
if (g === void 0)
|
|
692
|
+
throw new Error(re("Outlet"));
|
|
693
|
+
if (E === void 0)
|
|
694
|
+
throw new Error(re("useGoogleTagManager"));
|
|
695
|
+
const { pathname: v } = h(), { sendEvent: m } = E();
|
|
696
|
+
return pr(() => {
|
|
697
|
+
m({ event: "pageView", pathname: v });
|
|
698
|
+
}, [v, m]), /* @__PURE__ */ A(g, {});
|
|
699
|
+
}, wr = (f) => {
|
|
700
|
+
const { unknownErrorTranslationKey: h = "error.unknownError" } = f || {}, { translate: g = f == null ? void 0 : f.translate } = ne(B);
|
|
701
|
+
return { printError: gr(
|
|
702
|
+
(v) => {
|
|
703
|
+
var _, c, T, p, y, w, P, F, W;
|
|
704
|
+
const m = g ? g(h) : "Unknown error", { response: o } = v || {};
|
|
705
|
+
return v != null && v.reason ? String(v.reason) : (_ = o == null ? void 0 : o.data) != null && _.reason ? String(o.data.reason) : (c = o == null ? void 0 : o.data) != null && c.message ? String(o.data.message) : (p = (T = o == null ? void 0 : o.data) == null ? void 0 : T.detail) != null && p.length && Array.isArray((y = o == null ? void 0 : o.data) == null ? void 0 : y.detail) && ((P = (w = o == null ? void 0 : o.data) == null ? void 0 : w.detail[0]) != null && P.msg) && typeof ((W = (F = o == null ? void 0 : o.data) == null ? void 0 : F.detail[0]) == null ? void 0 : W.msg) == "string" ? String(o.data.detail[0].msg) : m;
|
|
681
706
|
},
|
|
682
|
-
[g,
|
|
707
|
+
[g, h]
|
|
683
708
|
) };
|
|
684
709
|
};
|
|
685
710
|
export {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
711
|
+
_r as GTMSendPageView,
|
|
712
|
+
B as InjectDependenciesContext,
|
|
713
|
+
br as InjectDependenciesProvider,
|
|
714
|
+
Rr as RequireAuth,
|
|
715
|
+
wr as useResponseError
|
|
690
716
|
};
|
package/dist/main.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(C,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],_):(C=typeof globalThis<"u"?globalThis:C||self,_(C["@tracktor/shared-module"]={},C.React))})(this,function(C,_){"use strict";var q={},ke={get exports(){return q},set exports(c){q=c}},L={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var oe;function De(){if(oe)return L;oe=1;var c=_,h=Symbol.for("react.element"),g=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,v=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function o(w,f,O){var p,y={},T=null,x=null;O!==void 0&&(T=""+O),f.key!==void 0&&(T=""+f.key),f.ref!==void 0&&(x=f.ref);for(p in f)E.call(f,p)&&!m.hasOwnProperty(p)&&(y[p]=f[p]);if(w&&w.defaultProps)for(p in f=w.defaultProps,f)y[p]===void 0&&(y[p]=f[p]);return{$$typeof:h,type:w,key:T,ref:x,props:y,_owner:v.current}}return L.Fragment=g,L.jsx=o,L.jsxs=o,L}var M={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+a[
|
|
17
|
+
*/var ie;function Ae(){return ie||(ie=1,process.env.NODE_ENV!=="production"&&function(){var c=_,h=Symbol.for("react.element"),g=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),w=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),W=Symbol.iterator,G="@@iterator";function Ye(e){if(e===null||typeof e!="object")return null;var r=W&&e[W]||e[G];return typeof r=="function"?r:null}var A=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];We("error",e,t)}}function We(e,r,t){{var n=A.ReactDebugCurrentFrame,u=n.getStackAddendum();u!==""&&(r+="%s",t=t.concat([u]));var s=t.map(function(i){return String(i)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var Ne=!1,Ve=!1,Ue=!1,Ge=!1,Be=!1,ue;ue=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===E||e===m||Be||e===v||e===O||e===p||Ge||e===x||Ne||Ve||Ue||typeof e=="object"&&e!==null&&(e.$$typeof===T||e.$$typeof===y||e.$$typeof===o||e.$$typeof===w||e.$$typeof===f||e.$$typeof===ue||e.getModuleId!==void 0))}function Je(e,r,t){var n=e.displayName;if(n)return n;var u=r.displayName||r.name||"";return u!==""?t+"("+u+")":t}function se(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case g:return"Portal";case m:return"Profiler";case v:return"StrictMode";case O:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w:var r=e;return se(r)+".Consumer";case o:var t=e;return se(t._context)+".Provider";case f:return Je(e,e.render,"ForwardRef");case y:var n=e.displayName||null;return n!==null?n:P(e.type)||"Memo";case T:{var u=e,s=u._payload,i=u._init;try{return P(i(s))}catch{return null}}}return null}var k=Object.assign,N=0,ce,fe,le,de,ve,pe,ge;function he(){}he.__reactDisabledLog=!0;function ze(){{if(N===0){ce=console.log,fe=console.info,le=console.warn,de=console.error,ve=console.group,pe=console.groupCollapsed,ge=console.groupEnd;var e={configurable:!0,enumerable:!0,value:he,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}}function Ke(){{if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:ce}),info:k({},e,{value:fe}),warn:k({},e,{value:le}),error:k({},e,{value:de}),group:k({},e,{value:ve}),groupCollapsed:k({},e,{value:pe}),groupEnd:k({},e,{value:ge})})}N<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var X=A.ReactCurrentDispatcher,Z;function B(e,r,t){{if(Z===void 0)try{throw Error()}catch(u){var n=u.stack.trim().match(/\n( *(at )?)/);Z=n&&n[1]||""}return`
|
|
18
|
+
`+Z+e}}var Q=!1,$;{var qe=typeof WeakMap=="function"?WeakMap:Map;$=new qe}function Ee(e,r){if(!e||Q)return"";{var t=$.get(e);if(t!==void 0)return t}var n;Q=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=X.current,X.current=null,ze();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(j){n=j}Reflect.construct(e,[],i)}else{try{i.call()}catch(j){n=j}e.call(i.prototype)}}else{try{throw Error()}catch(j){n=j}e()}}catch(j){if(j&&n&&typeof j.stack=="string"){for(var a=j.stack.split(`
|
|
19
|
+
`),R=n.stack.split(`
|
|
20
|
+
`),l=a.length-1,d=R.length-1;l>=1&&d>=0&&a[l]!==R[d];)d--;for(;l>=1&&d>=0;l--,d--)if(a[l]!==R[d]){if(l!==1||d!==1)do if(l--,d--,d<0||a[l]!==R[d]){var S=`
|
|
21
|
+
`+a[l].replace(" at new "," at ");return e.displayName&&S.includes("<anonymous>")&&(S=S.replace("<anonymous>",e.displayName)),typeof e=="function"&&$.set(e,S),S}while(l>=1&&d>=0);break}}}finally{Q=!1,X.current=s,Ke(),Error.prepareStackTrace=u}var I=e?e.displayName||e.name:"",xe=I?B(I):"";return typeof e=="function"&&$.set(e,xe),xe}function He(e,r,t){return Ee(e,!1)}function Xe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function J(e,r,t){if(e==null)return"";if(typeof e=="function")return Ee(e,Xe(e));if(typeof e=="string")return B(e);switch(e){case O:return B("Suspense");case p:return B("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return He(e.render);case y:return J(e.type,r,t);case T:{var n=e,u=n._payload,s=n._init;try{return J(s(u),r,t)}catch{}}}return""}var z=Object.prototype.hasOwnProperty,me={},ye=A.ReactDebugCurrentFrame;function K(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}function Ze(e,r,t,n,u){{var s=Function.call.bind(z);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var R=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(K(u),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),K(null)),a instanceof Error&&!(a.message in me)&&(me[a.message]=!0,K(u),b("Failed %s type: %s",t,a.message),K(null))}}}var Qe=Array.isArray;function ee(e){return Qe(e)}function er(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function rr(e){try{return be(e),!1}catch{return!0}}function be(e){return""+e}function Re(e){if(rr(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",er(e)),be(e)}var V=A.ReactCurrentOwner,tr={key:!0,ref:!0,__self:!0,__source:!0},_e,we,re;re={};function nr(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 ar(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 or(e,r){if(typeof e.ref=="string"&&V.current&&r&&V.current.stateNode!==r){var t=P(V.current.type);re[t]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',P(V.current.type),e.ref),re[t]=!0)}}function ir(e,r){{var t=function(){_e||(_e=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function ur(e,r){{var t=function(){we||(we=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var sr=function(e,r,t,n,u,s,i){var a={$$typeof:h,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function cr(e,r,t,n,u){{var s,i={},a=null,R=null;t!==void 0&&(Re(t),a=""+t),ar(r)&&(Re(r.key),a=""+r.key),nr(r)&&(R=r.ref,or(r,u));for(s in r)z.call(r,s)&&!tr.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var l=e.defaultProps;for(s in l)i[s]===void 0&&(i[s]=l[s])}if(a||R){var d=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ir(i,d),R&&ur(i,d)}return sr(e,a,R,u,n,V.current,i)}}var te=A.ReactCurrentOwner,Te=A.ReactDebugCurrentFrame;function F(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}var ne;ne=!1;function ae(e){return typeof e=="object"&&e!==null&&e.$$typeof===h}function Oe(){{if(te.current){var e=P(te.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function fr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+r+":"+t+"."}return""}}var
|
|
25
|
+
Check your code at `+r+":"+t+"."}return""}}var Se={};function lr(e){{var r=Oe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+t+">.")}return r}}function Ce(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function Ce(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=lr(r);if(Se[t])return;Se[t]=!0;var n="";e&&e._owner&&e._owner!==te.current&&(n=" It was passed a child from "+P(e._owner.type)+"."),F(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),F(null)}}function Pe(e,r){{if(typeof e!="object")return;if(ee(e))for(var t=0;t<e.length;t++){var n=e[t];ae(n)&&Ce(n,r)}else if(ae(e))e._store&&(e._store.validated=!0);else if(e){var u=Ye(e);if(typeof u=="function"&&u!==e.entries)for(var s=u.call(e),i;!(i=s.next()).done;)ae(i.value)&&Ce(i.value,r)}}}function dr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===y))t=r.propTypes;else return;if(t){var n=P(r);Ze(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ne){ne=!0;var u=P(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){F(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),F(null);break}}e.ref!==null&&(F(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),F(null))}}function je(e,r,t,n,u,s){{var i=$e(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 R=fr(u);R?a+=R:a+=Oe();var l;e===null?l="null":ee(e)?l="array":e!==void 0&&e.$$typeof===h?(l="<"+(P(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var d=cr(e,r,t,u,s);if(d==null)return d;if(i){var S=r.children;if(S!==void 0)if(n)if(ee(S)){for(var I=0;I<S.length;I++)Pe(S[I],e);Object.freeze&&Object.freeze(S)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Pe(S,e)}return e===E?vr(d):dr(d),d}}function pr(e,r,t){return je(e,r,t,!0)}function gr(e,r,t){return je(e,r,t,!1)}var hr=gr,Er=pr;M.Fragment=E,M.jsx=hr,M.jsxs=Er}()),M}(function(c){process.env.NODE_ENV==="production"?c.exports=De():c.exports=Ae()})(ke);const D=q.jsx,Y=_.createContext({children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Fe=({children:c,translate:h,useAuth:g,Outlet:E,Navigate:v,useLocation:m,useGoogleTagManager:o})=>{const w=_.useMemo(()=>({Navigate:v,Outlet:E,translate:h,useAuth:g,useGoogleTagManager:o,useLocation:m}),[v,E,h,g,o,m]);return D(Y.Provider,{value:w,children:c})},U=c=>`RequireAuth require « ${c} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ie=({Fallback:c,loginPath:h="/login",...g})=>{var O,p,y,T;const{useLocation:E=g.useLocation,useAuth:v=g.useAuth,Outlet:m=g.Outlet,Navigate:o=g.Navigate}=_.useContext(Y);if(v===void 0)throw new Error(U("useAuth"));if(E===void 0)throw new Error(U("useLocation"));if(m===void 0)throw new Error(U("Outlet"));if(o===void 0)throw new Error(U("Navigate"));const{isLogged:w}=v(),f=E();return w?D(_.Suspense,{fallback:c,children:(p=(O=f.state)==null?void 0:O.from)!=null&&p.state&&((T=(y=f.state)==null?void 0:y.from)==null?void 0:T.pathname)===h?D(o,{to:f.state.from.state.from.pathname+f.state.from.state.from.search,replace:!0}):D(m,{})}):D(o,{to:h,state:{from:f},replace:!0})},H=c=>`GTMSendPageView require « ${c} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Le=({...c})=>{const{useLocation:h=c.useLocation,Outlet:g=c.Outlet,useGoogleTagManager:E=c.useGoogleTagManager}=_.useContext(Y);if(h===void 0)throw new Error(H("useLocation"));if(g===void 0)throw new Error(H("Outlet"));if(E===void 0)throw new Error(H("useGoogleTagManager"));const{pathname:v}=h(),{sendEvent:m}=E();return _.useEffect(()=>{m({event:"pageView",pathname:v})},[v,m]),D(g,{})},Me=c=>{const{unknownErrorTranslationKey:h="error.unknownError"}=c||{},{translate:g=c==null?void 0:c.translate}=_.useContext(Y);return{printError:_.useCallback(v=>{var w,f,O,p,y,T,x,W,G;const m=g?g(h):"Unknown error",{response:o}=v||{};return v!=null&&v.reason?String(v.reason):(w=o==null?void 0:o.data)!=null&&w.reason?String(o.data.reason):(f=o==null?void 0:o.data)!=null&&f.message?String(o.data.message):(p=(O=o==null?void 0:o.data)==null?void 0:O.detail)!=null&&p.length&&Array.isArray((y=o==null?void 0:o.data)==null?void 0:y.detail)&&((x=(T=o==null?void 0:o.data)==null?void 0:T.detail[0])!=null&&x.msg)&&typeof((G=(W=o==null?void 0:o.data)==null?void 0:W.detail[0])==null?void 0:G.msg)=="string"?String(o.data.detail[0].msg):m},[g,h])}};C.GTMSendPageView=Le,C.InjectDependenciesContext=Y,C.InjectDependenciesProvider=Fe,C.RequireAuth=Ie,C.useResponseError=Me,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|