@ibdop/platform-kit 1.0.12 → 1.0.14
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/README.md +0 -0
- package/dist/components/ErrorBoundary.d.ts +0 -0
- package/dist/components/ErrorBoundary.d.ts.map +0 -0
- package/dist/components/Notification.d.ts +0 -0
- package/dist/components/Notification.d.ts.map +0 -0
- package/dist/components/VersionInfo.d.ts +0 -0
- package/dist/components/VersionInfo.d.ts.map +0 -0
- package/dist/components/index.d.ts +0 -0
- package/dist/components/index.d.ts.map +0 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useApi.d.ts +13 -2
- package/dist/hooks/useApi.d.ts.map +1 -1
- package/dist/hooks/useFeatures.d.ts +0 -0
- package/dist/hooks/useFeatures.d.ts.map +0 -0
- package/dist/hooks/useInfoData.d.ts +0 -0
- package/dist/hooks/useInfoData.d.ts.map +0 -0
- package/dist/hooks/usePermissions.d.ts +0 -0
- package/dist/hooks/usePermissions.d.ts.map +0 -0
- package/dist/hooks/useShellAuth.d.ts +0 -0
- package/dist/hooks/useShellAuth.d.ts.map +0 -0
- package/dist/hooks/useV1Config.d.ts +0 -0
- package/dist/hooks/useV1Config.d.ts.map +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.d.ts.map +0 -0
- package/dist/index.js +10 -10
- package/dist/index.mjs +854 -809
- package/dist/index.umd.js +9 -9
- package/dist/services/api.d.ts +0 -0
- package/dist/services/api.d.ts.map +1 -1
- package/dist/services/index.d.ts +0 -0
- package/dist/services/index.d.ts.map +0 -0
- package/dist/services/logger.d.ts +0 -0
- package/dist/services/logger.d.ts.map +0 -0
- package/dist/types/index.d.ts +0 -23
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +0 -0
- package/dist/utils/index.d.ts.map +0 -0
- package/dist/utils/mfeName.d.ts +0 -0
- package/dist/utils/mfeName.d.ts.map +0 -0
- package/dist/utils/shellAuth.d.ts +1 -0
- package/dist/utils/shellAuth.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/ErrorBoundary.tsx +0 -0
- package/src/components/Notification.tsx +0 -0
- package/src/components/VersionInfo.tsx +0 -0
- package/src/components/index.ts +0 -0
- package/src/global.d.ts +0 -0
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useApi.ts +48 -40
- package/src/hooks/useFeatures.ts +0 -0
- package/src/hooks/useInfoData.ts +0 -0
- package/src/hooks/usePermissions.ts +0 -0
- package/src/hooks/useShellAuth.ts +0 -0
- package/src/hooks/useV1Config.ts +0 -0
- package/src/index.ts +0 -0
- package/src/services/api.ts +12 -1
- package/src/services/index.ts +0 -0
- package/src/services/logger.ts +0 -0
- package/src/types/index.ts +1 -24
- package/src/utils/index.ts +0 -0
- package/src/utils/mfeName.ts +0 -0
- package/src/utils/shellAuth.ts +31 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
function
|
|
1
|
+
import et, { useState as T, useRef as tt, useCallback as R, useEffect as U, useMemo as ye, Component as Lt, createContext as Ut, useContext as Vt } from "react";
|
|
2
|
+
import Bt from "axios";
|
|
3
|
+
function B() {
|
|
4
4
|
if (typeof window > "u") return null;
|
|
5
5
|
const t = window;
|
|
6
6
|
if (t.__SHELL_AUTH_INSTANCE__)
|
|
@@ -8,26 +8,41 @@ function V() {
|
|
|
8
8
|
const r = window;
|
|
9
9
|
return r.__SHELL_AUTH__?.authInstance ? r.__SHELL_AUTH__.authInstance : null;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
const t =
|
|
13
|
-
|
|
11
|
+
function Wt() {
|
|
12
|
+
const t = B();
|
|
13
|
+
if (!t)
|
|
14
|
+
return { isAuthenticated: !1 };
|
|
15
|
+
let r;
|
|
16
|
+
const o = t;
|
|
17
|
+
if (t.user?.access_token)
|
|
18
|
+
r = t.user.access_token;
|
|
19
|
+
else if (t.user?.profile?.access_token)
|
|
20
|
+
r = t.user.profile.access_token;
|
|
21
|
+
else if (typeof o.getAccessToken == "function")
|
|
22
|
+
try {
|
|
23
|
+
const a = o.getAccessToken();
|
|
24
|
+
a instanceof Promise ? console.warn("[shellAuth] getAccessToken returned Promise - token may not be available synchronously") : typeof a == "string" && (r = a);
|
|
25
|
+
} catch (a) {
|
|
26
|
+
console.warn("[shellAuth] Failed to get access token via getAccessToken:", a);
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
14
29
|
isAuthenticated: t.isAuthenticated,
|
|
15
|
-
user: t.user
|
|
16
|
-
}
|
|
30
|
+
user: t.user ? { ...t.user, access_token: r } : void 0
|
|
31
|
+
};
|
|
17
32
|
}
|
|
18
|
-
function
|
|
19
|
-
const t =
|
|
33
|
+
function dr() {
|
|
34
|
+
const t = B();
|
|
20
35
|
return t?.isAuthenticated ? t.user?.profile?.access_token ?? null : null;
|
|
21
36
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
37
|
+
function pr() {
|
|
38
|
+
return B()?.isAuthenticated ?? !1;
|
|
24
39
|
}
|
|
25
|
-
async function
|
|
26
|
-
const t =
|
|
40
|
+
async function zt() {
|
|
41
|
+
const t = B();
|
|
27
42
|
t?.signinRedirect ? await t.signinRedirect() : typeof window < "u" && (window.location.href = "/");
|
|
28
43
|
}
|
|
29
|
-
async function
|
|
30
|
-
const t =
|
|
44
|
+
async function hr() {
|
|
45
|
+
const t = B();
|
|
31
46
|
t?.removeUser && await t.removeUser();
|
|
32
47
|
}
|
|
33
48
|
const Je = {
|
|
@@ -36,41 +51,41 @@ const Je = {
|
|
|
36
51
|
warn: (...t) => {
|
|
37
52
|
}
|
|
38
53
|
};
|
|
39
|
-
function
|
|
40
|
-
const [t, r] =
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
r(
|
|
54
|
+
function ae() {
|
|
55
|
+
const [t, r] = T(null), [o, a] = T(!0), i = tt(0), d = 20, n = R(() => B(), []);
|
|
56
|
+
U(() => {
|
|
57
|
+
const v = n();
|
|
58
|
+
if (v) {
|
|
59
|
+
r(v), a(!1);
|
|
45
60
|
return;
|
|
46
61
|
}
|
|
47
|
-
const
|
|
48
|
-
r(
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
62
|
+
const c = (f) => {
|
|
63
|
+
r(f.detail), a(!1);
|
|
64
|
+
}, g = setInterval(() => {
|
|
65
|
+
i.current++;
|
|
66
|
+
const f = n();
|
|
67
|
+
f ? (Je.log("Auth found via polling, attempts:", i.current), r(f), a(!1), clearInterval(g)) : i.current >= d && (a(!1), clearInterval(g));
|
|
53
68
|
}, 500);
|
|
54
|
-
return window.addEventListener("shell-auth-ready",
|
|
55
|
-
clearInterval(
|
|
69
|
+
return window.addEventListener("shell-auth-ready", c), () => {
|
|
70
|
+
clearInterval(g), window.removeEventListener("shell-auth-ready", c);
|
|
56
71
|
};
|
|
57
72
|
}, [n]);
|
|
58
73
|
const l = t || {
|
|
59
74
|
user: null,
|
|
60
75
|
isAuthenticated: !1,
|
|
61
|
-
isLoading:
|
|
76
|
+
isLoading: o,
|
|
62
77
|
signinRedirect: async () => {
|
|
63
|
-
const
|
|
64
|
-
|
|
78
|
+
const v = B();
|
|
79
|
+
v?.signinRedirect ? await v.signinRedirect() : typeof window < "u" && (window.location.href = "/");
|
|
65
80
|
},
|
|
66
81
|
removeUser: async () => {
|
|
67
|
-
const
|
|
68
|
-
|
|
82
|
+
const v = B();
|
|
83
|
+
v?.removeUser && await v.removeUser();
|
|
69
84
|
}
|
|
70
85
|
};
|
|
71
86
|
return Je.log("Auth result:", { isAuthenticated: l.isAuthenticated, isLoading: l.isLoading }), l;
|
|
72
87
|
}
|
|
73
|
-
const
|
|
88
|
+
const Ht = {
|
|
74
89
|
log: (...t) => {
|
|
75
90
|
},
|
|
76
91
|
warn: (...t) => {
|
|
@@ -79,7 +94,7 @@ const zt = {
|
|
|
79
94
|
console.error("[useInfoData]", ...t);
|
|
80
95
|
}
|
|
81
96
|
};
|
|
82
|
-
function
|
|
97
|
+
function Gt(t) {
|
|
83
98
|
if (t) return t;
|
|
84
99
|
if (typeof window < "u") {
|
|
85
100
|
const r = window;
|
|
@@ -87,31 +102,31 @@ function Ht(t) {
|
|
|
87
102
|
}
|
|
88
103
|
return "unknown-mfe";
|
|
89
104
|
}
|
|
90
|
-
function
|
|
91
|
-
const [r,
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
if (!
|
|
95
|
-
throw new Error(`HTTP ${
|
|
96
|
-
return
|
|
97
|
-
}).then((
|
|
98
|
-
|
|
99
|
-
}).catch((
|
|
100
|
-
|
|
105
|
+
function Yt(t) {
|
|
106
|
+
const [r, o] = T(null), [a, i] = T(!0), [d, n] = T(null), p = R(() => {
|
|
107
|
+
const v = Gt(t?.mfeName).replace("@ib-dop/", "");
|
|
108
|
+
i(!0), n(null), fetch(`/svc/${v}/info.json`).then((c) => {
|
|
109
|
+
if (!c.ok)
|
|
110
|
+
throw new Error(`HTTP ${c.status}: ${c.statusText}`);
|
|
111
|
+
return c.json();
|
|
112
|
+
}).then((c) => {
|
|
113
|
+
o(c);
|
|
114
|
+
}).catch((c) => {
|
|
115
|
+
Ht.error("Failed to load info:", c), n(c instanceof Error ? c.message : String(c));
|
|
101
116
|
}).finally(() => {
|
|
102
|
-
|
|
117
|
+
i(!1);
|
|
103
118
|
});
|
|
104
119
|
}, [t?.mfeName]);
|
|
105
|
-
return
|
|
106
|
-
|
|
107
|
-
}, [
|
|
120
|
+
return U(() => {
|
|
121
|
+
p();
|
|
122
|
+
}, [p]), {
|
|
108
123
|
data: r,
|
|
109
|
-
isLoading:
|
|
110
|
-
error:
|
|
111
|
-
refetch:
|
|
124
|
+
isLoading: a,
|
|
125
|
+
error: d,
|
|
126
|
+
refetch: p
|
|
112
127
|
};
|
|
113
128
|
}
|
|
114
|
-
const
|
|
129
|
+
const _e = {
|
|
115
130
|
log: (...t) => {
|
|
116
131
|
},
|
|
117
132
|
warn: (...t) => {
|
|
@@ -119,52 +134,158 @@ const me = {
|
|
|
119
134
|
error: (...t) => {
|
|
120
135
|
console.error("[useV1Config]", ...t);
|
|
121
136
|
}
|
|
122
|
-
},
|
|
137
|
+
}, re = {
|
|
123
138
|
authority: "",
|
|
124
139
|
client_id: "",
|
|
125
140
|
environment: "development"
|
|
126
141
|
};
|
|
127
|
-
function
|
|
128
|
-
const [t, r] =
|
|
129
|
-
return
|
|
142
|
+
function gr() {
|
|
143
|
+
const [t, r] = T(null), [o, a] = T(!0), [i, d] = T(null);
|
|
144
|
+
return U(() => {
|
|
130
145
|
(() => {
|
|
131
146
|
if (typeof sessionStorage > "u") {
|
|
132
|
-
|
|
147
|
+
d("sessionStorage not available"), r(re), a(!1);
|
|
133
148
|
return;
|
|
134
149
|
}
|
|
135
150
|
try {
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
138
|
-
const l = JSON.parse(
|
|
139
|
-
r({ ...
|
|
151
|
+
const p = sessionStorage.getItem("config");
|
|
152
|
+
if (p) {
|
|
153
|
+
const l = JSON.parse(p);
|
|
154
|
+
r({ ...re, ...l }), d(null), _e.log("Config loaded successfully");
|
|
140
155
|
} else
|
|
141
|
-
r(
|
|
142
|
-
} catch (
|
|
143
|
-
|
|
156
|
+
r(re), d("Config not found in sessionStorage"), _e.warn("Config not found in sessionStorage");
|
|
157
|
+
} catch (p) {
|
|
158
|
+
_e.error("Error parsing config:", p), r(re), d("Error parsing config");
|
|
144
159
|
} finally {
|
|
145
|
-
|
|
160
|
+
a(!1);
|
|
146
161
|
}
|
|
147
162
|
})();
|
|
148
163
|
}, []), {
|
|
149
164
|
data: t,
|
|
150
|
-
isLoading:
|
|
151
|
-
error:
|
|
165
|
+
isLoading: o,
|
|
166
|
+
error: i
|
|
152
167
|
};
|
|
153
168
|
}
|
|
154
|
-
|
|
169
|
+
const rt = "platform-kit", ne = {
|
|
170
|
+
log: (...t) => {
|
|
171
|
+
},
|
|
172
|
+
warn: (...t) => {
|
|
173
|
+
},
|
|
174
|
+
error: (...t) => {
|
|
175
|
+
console.error(`[${rt}]`, ...t);
|
|
176
|
+
},
|
|
177
|
+
info: (...t) => {
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
function qt(t) {
|
|
181
|
+
const r = t.response;
|
|
182
|
+
let o = "unknown";
|
|
183
|
+
return r ? r.status === 401 ? o = "unauthorized" : r.status === 403 ? o = "forbidden" : r.status === 404 ? o = "not_found" : r.status >= 500 && (o = "server") : o = "network", {
|
|
184
|
+
message: r?.data?.message ?? t.message ?? "Unknown error",
|
|
185
|
+
code: r?.data?.code,
|
|
186
|
+
status: r?.status,
|
|
187
|
+
type: o,
|
|
188
|
+
timestamp: Date.now(),
|
|
189
|
+
url: t.config?.url
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
const Jt = 3, Kt = 1e3;
|
|
193
|
+
function Xt(t) {
|
|
194
|
+
return !t || t >= 500 || t === 429;
|
|
195
|
+
}
|
|
196
|
+
function Zt(t) {
|
|
197
|
+
return new Promise((r) => setTimeout(r, t));
|
|
198
|
+
}
|
|
199
|
+
function Qt(t = {}) {
|
|
200
|
+
const r = t.name || rt, o = t.retries ?? Jt, a = t.retryDelay ?? Kt, i = {
|
|
201
|
+
log: (...n) => ne.log(`[API:${r}]`, ...n),
|
|
202
|
+
warn: (...n) => ne.warn(`[API:${r}]`, ...n),
|
|
203
|
+
error: (...n) => ne.error(`[API:${r}]`, ...n),
|
|
204
|
+
info: (...n) => ne.info(`[API:${r}]`, ...n)
|
|
205
|
+
}, d = Bt.create({
|
|
206
|
+
timeout: t.timeout ?? 1e4,
|
|
207
|
+
baseURL: t.baseURL ?? "",
|
|
208
|
+
headers: {
|
|
209
|
+
"Content-Type": "application/json"
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
return d.interceptors.request.use(
|
|
213
|
+
(n) => {
|
|
214
|
+
const p = Wt();
|
|
215
|
+
if (i.info("Auth state check:", {
|
|
216
|
+
isAuthenticated: p?.isAuthenticated,
|
|
217
|
+
hasUser: !!p?.user,
|
|
218
|
+
userKeys: p?.user ? Object.keys(p.user) : [],
|
|
219
|
+
token: p?.user?.access_token ? "(present)" : "(missing)"
|
|
220
|
+
}), p?.isAuthenticated) {
|
|
221
|
+
const l = p.user?.access_token || p.user?.profile?.access_token;
|
|
222
|
+
l && n.headers ? (n.headers.Authorization = `Bearer ${l}`, i.info("Auth token attached")) : i.warn("User is authenticated but no token found in authState.user or authState.user.profile");
|
|
223
|
+
} else
|
|
224
|
+
i.info("User not authenticated - request without token");
|
|
225
|
+
return i.log(`${n.method?.toUpperCase()} ${n.url}`), n;
|
|
226
|
+
},
|
|
227
|
+
(n) => (i.error("Request interceptor error:", n.message), Promise.reject(n))
|
|
228
|
+
), d.interceptors.response.use(
|
|
229
|
+
(n) => (i.log(`Response ${n.status}:`, n.config.url), n),
|
|
230
|
+
async (n) => {
|
|
231
|
+
const p = n.response?.status, l = n.config?.url, v = n.config?._retryCount ?? 0;
|
|
232
|
+
if (Xt(p) && v < o) {
|
|
233
|
+
const c = n.config;
|
|
234
|
+
c._retryCount = v + 1;
|
|
235
|
+
const g = a * Math.pow(2, v);
|
|
236
|
+
return i.warn(`Retrying (${c._retryCount}/${o}) after ${g}ms:`, l), await Zt(g), d.request(c);
|
|
237
|
+
}
|
|
238
|
+
return p === 401 ? (i.warn("401 Unauthorized - triggering re-auth"), zt()) : p === 403 ? i.warn("403 Forbidden - insufficient permissions") : p === 404 ? i.warn("404 Not found:", l) : p === 429 ? i.warn("429 Rate limited") : p === 500 ? i.error("500 Server error:", l) : n.response ? i.warn(`Error ${p}:`, n.message) : i.error("Network error - backend may be unavailable:", l), Promise.reject(qt(n));
|
|
239
|
+
}
|
|
240
|
+
), d;
|
|
241
|
+
}
|
|
242
|
+
const W = Qt();
|
|
243
|
+
async function mr(t, r, o = W) {
|
|
244
|
+
const a = await o.get(t, { params: r });
|
|
245
|
+
return {
|
|
246
|
+
data: a.data,
|
|
247
|
+
status: a.status,
|
|
248
|
+
ok: a.status >= 200 && a.status < 300
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
async function _r(t, r, o = W) {
|
|
252
|
+
const a = await o.post(t, r);
|
|
253
|
+
return {
|
|
254
|
+
data: a.data,
|
|
255
|
+
status: a.status,
|
|
256
|
+
ok: a.status >= 200 && a.status < 300
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
async function vr(t, r, o = W) {
|
|
260
|
+
const a = await o.put(t, r);
|
|
261
|
+
return {
|
|
262
|
+
data: a.data,
|
|
263
|
+
status: a.status,
|
|
264
|
+
ok: a.status >= 200 && a.status < 300
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
async function yr(t, r = W) {
|
|
268
|
+
const o = await r.delete(t);
|
|
269
|
+
return {
|
|
270
|
+
data: o.data,
|
|
271
|
+
status: o.status,
|
|
272
|
+
ok: o.status >= 200 && o.status < 300
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function nt(t) {
|
|
155
276
|
if (typeof window > "u") return;
|
|
156
|
-
const r = window.__MF_NAME__ || "unknown",
|
|
277
|
+
const r = window.__MF_NAME__ || "unknown", o = {
|
|
157
278
|
...t,
|
|
158
279
|
mfeName: r,
|
|
159
280
|
timestamp: Date.now()
|
|
160
281
|
};
|
|
161
282
|
window.dispatchEvent(new CustomEvent("mfe-notification", {
|
|
162
|
-
detail:
|
|
283
|
+
detail: o,
|
|
163
284
|
bubbles: !0
|
|
164
285
|
}));
|
|
165
286
|
}
|
|
166
|
-
function
|
|
167
|
-
const
|
|
287
|
+
function Ke(t, r) {
|
|
288
|
+
const o = {
|
|
168
289
|
network: {
|
|
169
290
|
title: "Нет подключения",
|
|
170
291
|
message: "Сервер недоступен. Проверьте подключение к интернету."
|
|
@@ -193,76 +314,97 @@ function qe(t, r) {
|
|
|
193
314
|
title: "Неизвестная ошибка",
|
|
194
315
|
message: t.message || "Произошла неизвестная ошибка."
|
|
195
316
|
}
|
|
196
|
-
},
|
|
197
|
-
|
|
317
|
+
}, a = o[t.type] || o.unknown;
|
|
318
|
+
nt({
|
|
198
319
|
type: t.type === "network" ? "warning" : "error",
|
|
199
|
-
title:
|
|
200
|
-
message: r ? `${
|
|
320
|
+
title: a.title,
|
|
321
|
+
message: r ? `${a.message} (${r})` : a.message
|
|
201
322
|
});
|
|
202
323
|
}
|
|
203
|
-
function
|
|
324
|
+
function er(t) {
|
|
204
325
|
return t instanceof Error && t.name === "AbortError";
|
|
205
326
|
}
|
|
206
|
-
function
|
|
327
|
+
function ie(t, r = {}) {
|
|
207
328
|
const {
|
|
208
|
-
notifyOnError:
|
|
209
|
-
notifyOnSuccess:
|
|
210
|
-
successMessage:
|
|
211
|
-
errorContext:
|
|
329
|
+
notifyOnError: o = !0,
|
|
330
|
+
notifyOnSuccess: a = !1,
|
|
331
|
+
successMessage: i,
|
|
332
|
+
errorContext: d,
|
|
212
333
|
onSuccess: n,
|
|
213
|
-
onError:
|
|
214
|
-
} = r, [l,
|
|
215
|
-
|
|
216
|
-
|
|
334
|
+
onError: p
|
|
335
|
+
} = r, [l, v] = T(null), [c, g] = T(null), [f, E] = T(!1), y = tt(null), N = c !== null, S = l !== null && !f && !N;
|
|
336
|
+
U(() => () => {
|
|
337
|
+
y.current && y.current.abort();
|
|
217
338
|
}, []);
|
|
218
|
-
const x =
|
|
219
|
-
|
|
220
|
-
}, []), _ =
|
|
221
|
-
|
|
222
|
-
const j =
|
|
223
|
-
E(!0),
|
|
339
|
+
const x = R(() => {
|
|
340
|
+
y.current && (y.current.abort(), y.current = null, E(!1));
|
|
341
|
+
}, []), _ = R(async () => {
|
|
342
|
+
y.current && y.current.abort(), y.current = new AbortController();
|
|
343
|
+
const j = y.current.signal;
|
|
344
|
+
E(!0), g(null);
|
|
224
345
|
try {
|
|
225
|
-
const
|
|
346
|
+
const P = await t(j);
|
|
226
347
|
if (j.aborted)
|
|
227
348
|
return null;
|
|
228
|
-
if (
|
|
229
|
-
return
|
|
349
|
+
if (P.ok)
|
|
350
|
+
return v(P.data), a && i && nt({
|
|
230
351
|
type: "success",
|
|
231
352
|
title: "Успешно",
|
|
232
|
-
message:
|
|
233
|
-
}), n?.(
|
|
353
|
+
message: i
|
|
354
|
+
}), n?.(P.data), P.data;
|
|
234
355
|
{
|
|
235
356
|
const L = {
|
|
236
|
-
message:
|
|
237
|
-
status:
|
|
357
|
+
message: P.data || "Request failed",
|
|
358
|
+
status: P.status,
|
|
238
359
|
type: "client",
|
|
239
360
|
timestamp: Date.now()
|
|
240
361
|
};
|
|
241
|
-
return
|
|
362
|
+
return g(L), o && Ke(L, d), p?.(L), null;
|
|
242
363
|
}
|
|
243
|
-
} catch (
|
|
244
|
-
if (
|
|
364
|
+
} catch (P) {
|
|
365
|
+
if (er(P))
|
|
245
366
|
return null;
|
|
246
|
-
const L =
|
|
247
|
-
return
|
|
367
|
+
const L = P;
|
|
368
|
+
return g(L), o && Ke(L, d), p?.(L), null;
|
|
248
369
|
} finally {
|
|
249
|
-
j.aborted || E(!1),
|
|
370
|
+
j.aborted || E(!1), y.current = null;
|
|
250
371
|
}
|
|
251
|
-
}, [t,
|
|
252
|
-
|
|
372
|
+
}, [t, o, a, i, d, n, p]), C = R(() => {
|
|
373
|
+
v(null), g(null), E(!1);
|
|
253
374
|
}, []);
|
|
254
375
|
return {
|
|
255
376
|
data: l,
|
|
256
|
-
error:
|
|
257
|
-
isLoading:
|
|
377
|
+
error: c,
|
|
378
|
+
isLoading: f,
|
|
258
379
|
isError: N,
|
|
259
|
-
isSuccess:
|
|
380
|
+
isSuccess: S,
|
|
260
381
|
execute: _,
|
|
261
|
-
reset:
|
|
382
|
+
reset: C,
|
|
262
383
|
abort: x
|
|
263
384
|
};
|
|
264
385
|
}
|
|
265
|
-
|
|
386
|
+
function Er(t, r = {}) {
|
|
387
|
+
const { skip: o = !1, headers: a, immediate: i = !0, ...d } = r, n = ye(() => (l) => {
|
|
388
|
+
const v = a ? a() : {};
|
|
389
|
+
return W.get(t, {
|
|
390
|
+
headers: { "Content-Type": "application/json", ...v },
|
|
391
|
+
signal: l
|
|
392
|
+
}).then((c) => ({ data: c.data, status: c.status, ok: c.status >= 200 && c.status < 300 }));
|
|
393
|
+
}, [t, a]), p = ie(n, { ...d });
|
|
394
|
+
return U(() => {
|
|
395
|
+
i && !o && p.execute();
|
|
396
|
+
}, [i, o, t]), p;
|
|
397
|
+
}
|
|
398
|
+
function wr(t, r, o = {}) {
|
|
399
|
+
return ie((i) => W.post(t, r, { signal: i }).then((d) => ({ data: d.data, status: d.status, ok: d.status >= 200 && d.status < 300 })), o);
|
|
400
|
+
}
|
|
401
|
+
function br(t, r, o = {}) {
|
|
402
|
+
return ie((i) => W.put(t, r, { signal: i }).then((d) => ({ data: d.data, status: d.status, ok: d.status >= 200 && d.status < 300 })), o);
|
|
403
|
+
}
|
|
404
|
+
function xr(t, r = {}) {
|
|
405
|
+
return ie((a) => W.delete(t, { signal: a }).then((i) => ({ data: i.data, status: i.status, ok: i.status >= 200 && i.status < 300 })), r);
|
|
406
|
+
}
|
|
407
|
+
const tr = {
|
|
266
408
|
canView: ["all"],
|
|
267
409
|
canEdit: ["ibdop-user", "ibdop-admin", "ibdop-devops"],
|
|
268
410
|
canDelete: ["ibdop-admin", "ibdop-devops"],
|
|
@@ -271,293 +413,293 @@ const Jt = {
|
|
|
271
413
|
canExportData: ["ibdop-user"],
|
|
272
414
|
canManageUsers: ["ibdop-admin"]
|
|
273
415
|
};
|
|
274
|
-
function
|
|
275
|
-
const r =
|
|
276
|
-
...
|
|
416
|
+
function Ar(t = {}) {
|
|
417
|
+
const r = ae(), o = ye(() => ({
|
|
418
|
+
...tr,
|
|
277
419
|
...t
|
|
278
|
-
}), [t]),
|
|
279
|
-
const
|
|
280
|
-
return Array.isArray(
|
|
281
|
-
}, [r.user]),
|
|
420
|
+
}), [t]), a = ye(() => {
|
|
421
|
+
const d = r.user?.profile?.realm_roles || r.user?.profile?.roles || [];
|
|
422
|
+
return Array.isArray(d) ? d : [d];
|
|
423
|
+
}, [r.user]), i = (d) => d.includes("all") ? !0 : d.some((n) => a.includes(n));
|
|
282
424
|
return {
|
|
283
|
-
canView:
|
|
284
|
-
canEdit:
|
|
285
|
-
canDelete:
|
|
286
|
-
canAdmin:
|
|
287
|
-
canViewSensitiveData:
|
|
288
|
-
canExportData:
|
|
289
|
-
canManageUsers:
|
|
425
|
+
canView: i(o.canView),
|
|
426
|
+
canEdit: i(o.canEdit),
|
|
427
|
+
canDelete: i(o.canDelete),
|
|
428
|
+
canAdmin: i(o.canAdmin),
|
|
429
|
+
canViewSensitiveData: i(o.canViewSensitiveData),
|
|
430
|
+
canExportData: i(o.canExportData),
|
|
431
|
+
canManageUsers: i(o.canManageUsers)
|
|
290
432
|
};
|
|
291
433
|
}
|
|
292
|
-
function
|
|
293
|
-
const t =
|
|
434
|
+
function kr() {
|
|
435
|
+
const t = ae(), [r, o] = T([]), [a, i] = T(0), [d, n] = T([]), [p, l] = T(!0), [v, c] = T(null), g = R(async () => {
|
|
294
436
|
if (!t.isAuthenticated) {
|
|
295
437
|
console.debug("[useFeatures] Not authenticated"), l(!1);
|
|
296
438
|
return;
|
|
297
439
|
}
|
|
298
|
-
l(!0),
|
|
440
|
+
l(!0), c(null);
|
|
299
441
|
try {
|
|
300
|
-
const
|
|
442
|
+
const y = {
|
|
301
443
|
"Content-Type": "application/json"
|
|
302
444
|
}, N = t.user?.access_token;
|
|
303
|
-
N && (
|
|
304
|
-
const
|
|
305
|
-
if (!
|
|
306
|
-
throw new Error(`HTTP ${
|
|
307
|
-
const x = await
|
|
308
|
-
|
|
309
|
-
} catch (
|
|
310
|
-
console.debug("Features fetch error:",
|
|
445
|
+
N && (y.Authorization = `Bearer ${N}`);
|
|
446
|
+
const S = await fetch("/api/features", { headers: y });
|
|
447
|
+
if (!S.ok)
|
|
448
|
+
throw new Error(`HTTP ${S.status}: ${S.statusText}`);
|
|
449
|
+
const x = await S.json();
|
|
450
|
+
o(x.features || []), i(x.totalCount || 0), n(x.userRoles || []);
|
|
451
|
+
} catch (y) {
|
|
452
|
+
console.debug("Features fetch error:", y), c(y instanceof Error ? y.message : String(y)), o([]), n([]);
|
|
311
453
|
} finally {
|
|
312
454
|
l(!1);
|
|
313
455
|
}
|
|
314
456
|
}, [t.isAuthenticated, t.user?.access_token]);
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}, [
|
|
318
|
-
const
|
|
319
|
-
(
|
|
457
|
+
U(() => {
|
|
458
|
+
g();
|
|
459
|
+
}, [g]);
|
|
460
|
+
const f = R(
|
|
461
|
+
(y) => r.find((S) => S.name === y)?.userEnabled ?? !1,
|
|
320
462
|
[r]
|
|
321
|
-
), E =
|
|
322
|
-
(
|
|
463
|
+
), E = R(
|
|
464
|
+
(y) => r.filter((N) => N.mfDependencies?.includes(y)),
|
|
323
465
|
[r]
|
|
324
466
|
);
|
|
325
467
|
return {
|
|
326
468
|
features: r,
|
|
327
|
-
totalCount:
|
|
328
|
-
userRoles:
|
|
329
|
-
isLoading:
|
|
330
|
-
error:
|
|
331
|
-
refetch:
|
|
332
|
-
isFeatureEnabled:
|
|
469
|
+
totalCount: a,
|
|
470
|
+
userRoles: d,
|
|
471
|
+
isLoading: p,
|
|
472
|
+
error: v,
|
|
473
|
+
refetch: g,
|
|
474
|
+
isFeatureEnabled: f,
|
|
333
475
|
getFeaturesByMf: E
|
|
334
476
|
};
|
|
335
477
|
}
|
|
336
|
-
function
|
|
337
|
-
const t =
|
|
478
|
+
function Tr() {
|
|
479
|
+
const t = ae(), [r, o] = T([]), [a, i] = T([]), [d, n] = T(!1), [p, l] = T(!0), [v, c] = T(null), g = R(async () => {
|
|
338
480
|
if (!t.isAuthenticated) {
|
|
339
481
|
console.debug("[useFeatureAdmin] Not authenticated"), l(!1);
|
|
340
482
|
return;
|
|
341
483
|
}
|
|
342
|
-
l(!0),
|
|
484
|
+
l(!0), c(null);
|
|
343
485
|
try {
|
|
344
|
-
const
|
|
486
|
+
const S = {
|
|
345
487
|
"Content-Type": "application/json"
|
|
346
488
|
}, x = t.user?.access_token;
|
|
347
|
-
x && (
|
|
348
|
-
const _ = await fetch("/api/features/admin", { headers:
|
|
489
|
+
x && (S.Authorization = `Bearer ${x}`);
|
|
490
|
+
const _ = await fetch("/api/features/admin", { headers: S });
|
|
349
491
|
if (!_.ok) {
|
|
350
492
|
if (_.status === 403) {
|
|
351
|
-
console.warn("[useFeatureAdmin] 403 Forbidden - checking if token has admin role"), n(!1),
|
|
493
|
+
console.warn("[useFeatureAdmin] 403 Forbidden - checking if token has admin role"), n(!1), o([]), i([]), l(!1);
|
|
352
494
|
return;
|
|
353
495
|
}
|
|
354
496
|
throw new Error(`HTTP ${_.status}: ${_.statusText}`);
|
|
355
497
|
}
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
} catch (
|
|
359
|
-
console.debug("FeatureAdmin fetch error:",
|
|
498
|
+
const C = await _.json();
|
|
499
|
+
o(C.featureToggles || []), i(C.microfrontends || []), n(C.isAdmin || !1);
|
|
500
|
+
} catch (S) {
|
|
501
|
+
console.debug("FeatureAdmin fetch error:", S), o([]), i([]), n(!1);
|
|
360
502
|
} finally {
|
|
361
503
|
l(!1);
|
|
362
504
|
}
|
|
363
|
-
}, [t.isAuthenticated, t.user?.access_token]),
|
|
364
|
-
async (
|
|
505
|
+
}, [t.isAuthenticated, t.user?.access_token]), f = R(
|
|
506
|
+
async (S) => {
|
|
365
507
|
try {
|
|
366
508
|
const x = {
|
|
367
509
|
"Content-Type": "application/json"
|
|
368
510
|
}, _ = t.user?.access_token;
|
|
369
511
|
_ && (x.Authorization = `Bearer ${_}`);
|
|
370
|
-
const
|
|
512
|
+
const C = await fetch("/api/features/admin", {
|
|
371
513
|
method: "POST",
|
|
372
514
|
headers: x,
|
|
373
|
-
body: JSON.stringify(
|
|
515
|
+
body: JSON.stringify(S)
|
|
374
516
|
});
|
|
375
|
-
if (!
|
|
376
|
-
const j = await
|
|
377
|
-
throw new Error(j.error || `HTTP ${
|
|
517
|
+
if (!C.ok) {
|
|
518
|
+
const j = await C.json().catch(() => ({}));
|
|
519
|
+
throw new Error(j.error || `HTTP ${C.status}`);
|
|
378
520
|
}
|
|
379
|
-
return await
|
|
521
|
+
return await g(), !0;
|
|
380
522
|
} catch (x) {
|
|
381
|
-
return
|
|
523
|
+
return c(x instanceof Error ? x.message : String(x)), !1;
|
|
382
524
|
}
|
|
383
525
|
},
|
|
384
|
-
[
|
|
385
|
-
), E =
|
|
386
|
-
async (
|
|
526
|
+
[g]
|
|
527
|
+
), E = R(
|
|
528
|
+
async (S, x) => {
|
|
387
529
|
try {
|
|
388
530
|
const _ = {
|
|
389
531
|
"Content-Type": "application/json"
|
|
390
|
-
},
|
|
391
|
-
|
|
392
|
-
const j = await fetch(`/api/features/admin/${encodeURIComponent(
|
|
532
|
+
}, C = t.user?.access_token;
|
|
533
|
+
C && (_.Authorization = `Bearer ${C}`);
|
|
534
|
+
const j = await fetch(`/api/features/admin/${encodeURIComponent(S)}`, {
|
|
393
535
|
method: "PUT",
|
|
394
536
|
headers: _,
|
|
395
537
|
body: JSON.stringify(x)
|
|
396
538
|
});
|
|
397
539
|
if (!j.ok) {
|
|
398
|
-
const
|
|
399
|
-
throw new Error(
|
|
540
|
+
const P = await j.json().catch(() => ({}));
|
|
541
|
+
throw new Error(P.error || `HTTP ${j.status}`);
|
|
400
542
|
}
|
|
401
|
-
return await
|
|
543
|
+
return await g(), !0;
|
|
402
544
|
} catch (_) {
|
|
403
|
-
return
|
|
545
|
+
return c(_ instanceof Error ? _.message : String(_)), !1;
|
|
404
546
|
}
|
|
405
547
|
},
|
|
406
|
-
[
|
|
407
|
-
),
|
|
408
|
-
async (
|
|
548
|
+
[g]
|
|
549
|
+
), y = R(
|
|
550
|
+
async (S, x) => {
|
|
409
551
|
try {
|
|
410
|
-
const _ = {},
|
|
411
|
-
|
|
552
|
+
const _ = {}, C = t.user?.access_token;
|
|
553
|
+
C && (_.Authorization = `Bearer ${C}`);
|
|
412
554
|
const j = await fetch(
|
|
413
|
-
`/api/features/admin/${encodeURIComponent(
|
|
555
|
+
`/api/features/admin/${encodeURIComponent(S)}/toggle?enabled=${x}`,
|
|
414
556
|
{
|
|
415
557
|
method: "POST",
|
|
416
558
|
headers: _
|
|
417
559
|
}
|
|
418
560
|
);
|
|
419
561
|
if (!j.ok) {
|
|
420
|
-
const
|
|
421
|
-
throw new Error(
|
|
562
|
+
const P = await j.json().catch(() => ({}));
|
|
563
|
+
throw new Error(P.error || `HTTP ${j.status}`);
|
|
422
564
|
}
|
|
423
|
-
return await
|
|
565
|
+
return await g(), !0;
|
|
424
566
|
} catch (_) {
|
|
425
|
-
return
|
|
567
|
+
return c(_ instanceof Error ? _.message : String(_)), !1;
|
|
426
568
|
}
|
|
427
569
|
},
|
|
428
|
-
[
|
|
429
|
-
), N =
|
|
430
|
-
async (
|
|
570
|
+
[g]
|
|
571
|
+
), N = R(
|
|
572
|
+
async (S) => {
|
|
431
573
|
try {
|
|
432
574
|
const x = {}, _ = t.user?.access_token;
|
|
433
575
|
_ && (x.Authorization = `Bearer ${_}`);
|
|
434
|
-
const
|
|
576
|
+
const C = await fetch(`/api/features/admin/${encodeURIComponent(S)}`, {
|
|
435
577
|
method: "DELETE",
|
|
436
578
|
headers: x
|
|
437
579
|
});
|
|
438
|
-
if (!
|
|
439
|
-
const j = await
|
|
440
|
-
throw new Error(j.error || `HTTP ${
|
|
580
|
+
if (!C.ok) {
|
|
581
|
+
const j = await C.json().catch(() => ({}));
|
|
582
|
+
throw new Error(j.error || `HTTP ${C.status}`);
|
|
441
583
|
}
|
|
442
|
-
return await
|
|
584
|
+
return await g(), !0;
|
|
443
585
|
} catch (x) {
|
|
444
|
-
return
|
|
586
|
+
return c(x instanceof Error ? x.message : String(x)), !1;
|
|
445
587
|
}
|
|
446
588
|
},
|
|
447
|
-
[
|
|
589
|
+
[g]
|
|
448
590
|
);
|
|
449
|
-
return
|
|
450
|
-
|
|
451
|
-
}, [
|
|
591
|
+
return U(() => {
|
|
592
|
+
g();
|
|
593
|
+
}, [g]), {
|
|
452
594
|
features: r,
|
|
453
|
-
microfrontends:
|
|
454
|
-
isAdmin:
|
|
455
|
-
isLoading:
|
|
456
|
-
error:
|
|
457
|
-
refetch:
|
|
458
|
-
createFeature:
|
|
595
|
+
microfrontends: a,
|
|
596
|
+
isAdmin: d,
|
|
597
|
+
isLoading: p,
|
|
598
|
+
error: v,
|
|
599
|
+
refetch: g,
|
|
600
|
+
createFeature: f,
|
|
459
601
|
updateFeature: E,
|
|
460
|
-
toggleFeature:
|
|
602
|
+
toggleFeature: y,
|
|
461
603
|
deleteFeature: N
|
|
462
604
|
};
|
|
463
605
|
}
|
|
464
|
-
function
|
|
465
|
-
const t =
|
|
606
|
+
function Sr() {
|
|
607
|
+
const t = ae(), [r, o] = T([]), [a, i] = T(0), [d, n] = T(!0), [p, l] = T(null), v = R(async () => {
|
|
466
608
|
if (!t.isAuthenticated) {
|
|
467
609
|
n(!1);
|
|
468
610
|
return;
|
|
469
611
|
}
|
|
470
612
|
n(!0), l(null);
|
|
471
613
|
try {
|
|
472
|
-
const
|
|
614
|
+
const c = {
|
|
473
615
|
"Content-Type": "application/json"
|
|
474
|
-
},
|
|
475
|
-
|
|
476
|
-
const
|
|
477
|
-
if (!
|
|
478
|
-
throw new Error(`HTTP ${
|
|
479
|
-
const E = await
|
|
480
|
-
|
|
481
|
-
} catch (
|
|
482
|
-
l(
|
|
616
|
+
}, g = t.user?.access_token;
|
|
617
|
+
g && (c.Authorization = `Bearer ${g}`);
|
|
618
|
+
const f = await fetch("/api/features/microfrontends", { headers: c });
|
|
619
|
+
if (!f.ok)
|
|
620
|
+
throw new Error(`HTTP ${f.status}: ${f.statusText}`);
|
|
621
|
+
const E = await f.json();
|
|
622
|
+
o(E.microfrontends || []), i(E.totalCount || 0);
|
|
623
|
+
} catch (c) {
|
|
624
|
+
l(c instanceof Error ? c.message : String(c));
|
|
483
625
|
} finally {
|
|
484
626
|
n(!1);
|
|
485
627
|
}
|
|
486
628
|
}, [t.isAuthenticated, t.user?.access_token]);
|
|
487
|
-
return
|
|
488
|
-
|
|
489
|
-
}, [
|
|
629
|
+
return U(() => {
|
|
630
|
+
v();
|
|
631
|
+
}, [v]), {
|
|
490
632
|
microfrontends: r,
|
|
491
|
-
totalCount:
|
|
492
|
-
isLoading:
|
|
493
|
-
error:
|
|
494
|
-
refetch:
|
|
633
|
+
totalCount: a,
|
|
634
|
+
isLoading: d,
|
|
635
|
+
error: p,
|
|
636
|
+
refetch: v
|
|
495
637
|
};
|
|
496
638
|
}
|
|
497
|
-
var
|
|
498
|
-
var
|
|
499
|
-
function
|
|
500
|
-
if (
|
|
501
|
-
|
|
502
|
-
var t =
|
|
503
|
-
function n(
|
|
504
|
-
var
|
|
505
|
-
|
|
506
|
-
for (
|
|
507
|
-
if (
|
|
508
|
-
return { $$typeof: r, type:
|
|
639
|
+
var se = { exports: {} }, K = {};
|
|
640
|
+
var Xe;
|
|
641
|
+
function rr() {
|
|
642
|
+
if (Xe) return K;
|
|
643
|
+
Xe = 1;
|
|
644
|
+
var t = et, r = /* @__PURE__ */ Symbol.for("react.element"), o = /* @__PURE__ */ Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
645
|
+
function n(p, l, v) {
|
|
646
|
+
var c, g = {}, f = null, E = null;
|
|
647
|
+
v !== void 0 && (f = "" + v), l.key !== void 0 && (f = "" + l.key), l.ref !== void 0 && (E = l.ref);
|
|
648
|
+
for (c in l) a.call(l, c) && !d.hasOwnProperty(c) && (g[c] = l[c]);
|
|
649
|
+
if (p && p.defaultProps) for (c in l = p.defaultProps, l) g[c] === void 0 && (g[c] = l[c]);
|
|
650
|
+
return { $$typeof: r, type: p, key: f, ref: E, props: g, _owner: i.current };
|
|
509
651
|
}
|
|
510
|
-
return
|
|
652
|
+
return K.Fragment = o, K.jsx = n, K.jsxs = n, K;
|
|
511
653
|
}
|
|
512
|
-
var
|
|
513
|
-
var
|
|
514
|
-
function
|
|
515
|
-
return
|
|
516
|
-
var t =
|
|
517
|
-
function
|
|
654
|
+
var X = {};
|
|
655
|
+
var Ze;
|
|
656
|
+
function nr() {
|
|
657
|
+
return Ze || (Ze = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
658
|
+
var t = et, r = /* @__PURE__ */ Symbol.for("react.element"), o = /* @__PURE__ */ Symbol.for("react.portal"), a = /* @__PURE__ */ Symbol.for("react.fragment"), i = /* @__PURE__ */ Symbol.for("react.strict_mode"), d = /* @__PURE__ */ Symbol.for("react.profiler"), n = /* @__PURE__ */ Symbol.for("react.provider"), p = /* @__PURE__ */ Symbol.for("react.context"), l = /* @__PURE__ */ Symbol.for("react.forward_ref"), v = /* @__PURE__ */ Symbol.for("react.suspense"), c = /* @__PURE__ */ Symbol.for("react.suspense_list"), g = /* @__PURE__ */ Symbol.for("react.memo"), f = /* @__PURE__ */ Symbol.for("react.lazy"), E = /* @__PURE__ */ Symbol.for("react.offscreen"), y = Symbol.iterator, N = "@@iterator";
|
|
659
|
+
function S(e) {
|
|
518
660
|
if (e === null || typeof e != "object")
|
|
519
661
|
return null;
|
|
520
|
-
var
|
|
521
|
-
return typeof
|
|
662
|
+
var s = y && e[y] || e[N];
|
|
663
|
+
return typeof s == "function" ? s : null;
|
|
522
664
|
}
|
|
523
665
|
var x = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
524
666
|
function _(e) {
|
|
525
667
|
{
|
|
526
|
-
for (var
|
|
527
|
-
|
|
528
|
-
|
|
668
|
+
for (var s = arguments.length, u = new Array(s > 1 ? s - 1 : 0), h = 1; h < s; h++)
|
|
669
|
+
u[h - 1] = arguments[h];
|
|
670
|
+
C("error", e, u);
|
|
529
671
|
}
|
|
530
672
|
}
|
|
531
|
-
function
|
|
673
|
+
function C(e, s, u) {
|
|
532
674
|
{
|
|
533
|
-
var
|
|
534
|
-
A !== "" && (
|
|
535
|
-
var
|
|
675
|
+
var h = x.ReactDebugCurrentFrame, A = h.getStackAddendum();
|
|
676
|
+
A !== "" && (s += "%s", u = u.concat([A]));
|
|
677
|
+
var k = u.map(function(b) {
|
|
536
678
|
return String(b);
|
|
537
679
|
});
|
|
538
|
-
|
|
680
|
+
k.unshift("Warning: " + s), Function.prototype.apply.call(console[e], console, k);
|
|
539
681
|
}
|
|
540
682
|
}
|
|
541
|
-
var j = !1,
|
|
542
|
-
|
|
543
|
-
function
|
|
544
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
683
|
+
var j = !1, P = !1, L = !1, ut = !1, ct = !1, Ae;
|
|
684
|
+
Ae = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
685
|
+
function lt(e) {
|
|
686
|
+
return !!(typeof e == "string" || typeof e == "function" || e === a || e === d || ct || e === i || e === v || e === c || ut || e === E || j || P || L || typeof e == "object" && e !== null && (e.$$typeof === f || e.$$typeof === g || e.$$typeof === n || e.$$typeof === p || e.$$typeof === l || // This needs to include all possible module reference object
|
|
545
687
|
// types supported by any Flight configuration anywhere since
|
|
546
688
|
// we don't know which Flight build this will end up being used
|
|
547
689
|
// with.
|
|
548
|
-
e.$$typeof ===
|
|
690
|
+
e.$$typeof === Ae || e.getModuleId !== void 0));
|
|
549
691
|
}
|
|
550
|
-
function
|
|
551
|
-
var
|
|
552
|
-
if (
|
|
553
|
-
return
|
|
554
|
-
var A =
|
|
555
|
-
return A !== "" ?
|
|
692
|
+
function ft(e, s, u) {
|
|
693
|
+
var h = e.displayName;
|
|
694
|
+
if (h)
|
|
695
|
+
return h;
|
|
696
|
+
var A = s.displayName || s.name || "";
|
|
697
|
+
return A !== "" ? u + "(" + A + ")" : u;
|
|
556
698
|
}
|
|
557
|
-
function
|
|
699
|
+
function ke(e) {
|
|
558
700
|
return e.displayName || "Context";
|
|
559
701
|
}
|
|
560
|
-
function
|
|
702
|
+
function V(e) {
|
|
561
703
|
if (e == null)
|
|
562
704
|
return null;
|
|
563
705
|
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")
|
|
@@ -565,36 +707,36 @@ function Kt() {
|
|
|
565
707
|
if (typeof e == "string")
|
|
566
708
|
return e;
|
|
567
709
|
switch (e) {
|
|
568
|
-
case
|
|
710
|
+
case a:
|
|
569
711
|
return "Fragment";
|
|
570
|
-
case
|
|
712
|
+
case o:
|
|
571
713
|
return "Portal";
|
|
572
|
-
case
|
|
714
|
+
case d:
|
|
573
715
|
return "Profiler";
|
|
574
|
-
case
|
|
716
|
+
case i:
|
|
575
717
|
return "StrictMode";
|
|
576
|
-
case
|
|
718
|
+
case v:
|
|
577
719
|
return "Suspense";
|
|
578
|
-
case
|
|
720
|
+
case c:
|
|
579
721
|
return "SuspenseList";
|
|
580
722
|
}
|
|
581
723
|
if (typeof e == "object")
|
|
582
724
|
switch (e.$$typeof) {
|
|
583
|
-
case
|
|
584
|
-
var
|
|
585
|
-
return
|
|
725
|
+
case p:
|
|
726
|
+
var s = e;
|
|
727
|
+
return ke(s) + ".Consumer";
|
|
586
728
|
case n:
|
|
587
|
-
var
|
|
588
|
-
return
|
|
729
|
+
var u = e;
|
|
730
|
+
return ke(u._context) + ".Provider";
|
|
589
731
|
case l:
|
|
590
|
-
return
|
|
591
|
-
case
|
|
592
|
-
var
|
|
593
|
-
return
|
|
594
|
-
case
|
|
595
|
-
var A = e,
|
|
732
|
+
return ft(e, e.render, "ForwardRef");
|
|
733
|
+
case g:
|
|
734
|
+
var h = e.displayName || null;
|
|
735
|
+
return h !== null ? h : V(e.type) || "Memo";
|
|
736
|
+
case f: {
|
|
737
|
+
var A = e, k = A._payload, b = A._init;
|
|
596
738
|
try {
|
|
597
|
-
return
|
|
739
|
+
return V(b(k));
|
|
598
740
|
} catch {
|
|
599
741
|
return null;
|
|
600
742
|
}
|
|
@@ -602,18 +744,18 @@ function Kt() {
|
|
|
602
744
|
}
|
|
603
745
|
return null;
|
|
604
746
|
}
|
|
605
|
-
var
|
|
606
|
-
function
|
|
747
|
+
var z = Object.assign, q = 0, Te, Se, Re, Ce, Me, Ie, Ne;
|
|
748
|
+
function je() {
|
|
607
749
|
}
|
|
608
|
-
|
|
609
|
-
function
|
|
750
|
+
je.__reactDisabledLog = !0;
|
|
751
|
+
function dt() {
|
|
610
752
|
{
|
|
611
|
-
if (
|
|
612
|
-
|
|
753
|
+
if (q === 0) {
|
|
754
|
+
Te = console.log, Se = console.info, Re = console.warn, Ce = console.error, Me = console.group, Ie = console.groupCollapsed, Ne = console.groupEnd;
|
|
613
755
|
var e = {
|
|
614
756
|
configurable: !0,
|
|
615
757
|
enumerable: !0,
|
|
616
|
-
value:
|
|
758
|
+
value: je,
|
|
617
759
|
writable: !0
|
|
618
760
|
};
|
|
619
761
|
Object.defineProperties(console, {
|
|
@@ -626,79 +768,79 @@ function Kt() {
|
|
|
626
768
|
groupEnd: e
|
|
627
769
|
});
|
|
628
770
|
}
|
|
629
|
-
|
|
771
|
+
q++;
|
|
630
772
|
}
|
|
631
773
|
}
|
|
632
|
-
function
|
|
774
|
+
function pt() {
|
|
633
775
|
{
|
|
634
|
-
if (
|
|
776
|
+
if (q--, q === 0) {
|
|
635
777
|
var e = {
|
|
636
778
|
configurable: !0,
|
|
637
779
|
enumerable: !0,
|
|
638
780
|
writable: !0
|
|
639
781
|
};
|
|
640
782
|
Object.defineProperties(console, {
|
|
641
|
-
log:
|
|
642
|
-
value:
|
|
783
|
+
log: z({}, e, {
|
|
784
|
+
value: Te
|
|
643
785
|
}),
|
|
644
|
-
info:
|
|
786
|
+
info: z({}, e, {
|
|
645
787
|
value: Se
|
|
646
788
|
}),
|
|
647
|
-
warn:
|
|
789
|
+
warn: z({}, e, {
|
|
648
790
|
value: Re
|
|
649
791
|
}),
|
|
650
|
-
error:
|
|
651
|
-
value: Te
|
|
652
|
-
}),
|
|
653
|
-
group: W({}, e, {
|
|
792
|
+
error: z({}, e, {
|
|
654
793
|
value: Ce
|
|
655
794
|
}),
|
|
656
|
-
|
|
657
|
-
value: ke
|
|
658
|
-
}),
|
|
659
|
-
groupEnd: W({}, e, {
|
|
795
|
+
group: z({}, e, {
|
|
660
796
|
value: Me
|
|
797
|
+
}),
|
|
798
|
+
groupCollapsed: z({}, e, {
|
|
799
|
+
value: Ie
|
|
800
|
+
}),
|
|
801
|
+
groupEnd: z({}, e, {
|
|
802
|
+
value: Ne
|
|
661
803
|
})
|
|
662
804
|
});
|
|
663
805
|
}
|
|
664
|
-
|
|
806
|
+
q < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
665
807
|
}
|
|
666
808
|
}
|
|
667
|
-
var
|
|
668
|
-
function
|
|
809
|
+
var ce = x.ReactCurrentDispatcher, le;
|
|
810
|
+
function Z(e, s, u) {
|
|
669
811
|
{
|
|
670
|
-
if (
|
|
812
|
+
if (le === void 0)
|
|
671
813
|
try {
|
|
672
814
|
throw Error();
|
|
673
815
|
} catch (A) {
|
|
674
|
-
var
|
|
675
|
-
|
|
816
|
+
var h = A.stack.trim().match(/\n( *(at )?)/);
|
|
817
|
+
le = h && h[1] || "";
|
|
676
818
|
}
|
|
677
819
|
return `
|
|
678
|
-
` +
|
|
820
|
+
` + le + e;
|
|
679
821
|
}
|
|
680
822
|
}
|
|
681
|
-
var
|
|
823
|
+
var fe = !1, Q;
|
|
682
824
|
{
|
|
683
|
-
var
|
|
684
|
-
|
|
825
|
+
var ht = typeof WeakMap == "function" ? WeakMap : Map;
|
|
826
|
+
Q = new ht();
|
|
685
827
|
}
|
|
686
|
-
function
|
|
687
|
-
if (!e ||
|
|
828
|
+
function Pe(e, s) {
|
|
829
|
+
if (!e || fe)
|
|
688
830
|
return "";
|
|
689
831
|
{
|
|
690
|
-
var
|
|
691
|
-
if (
|
|
692
|
-
return
|
|
832
|
+
var u = Q.get(e);
|
|
833
|
+
if (u !== void 0)
|
|
834
|
+
return u;
|
|
693
835
|
}
|
|
694
|
-
var
|
|
695
|
-
|
|
836
|
+
var h;
|
|
837
|
+
fe = !0;
|
|
696
838
|
var A = Error.prepareStackTrace;
|
|
697
839
|
Error.prepareStackTrace = void 0;
|
|
698
|
-
var
|
|
699
|
-
|
|
840
|
+
var k;
|
|
841
|
+
k = ce.current, ce.current = null, dt();
|
|
700
842
|
try {
|
|
701
|
-
if (
|
|
843
|
+
if (s) {
|
|
702
844
|
var b = function() {
|
|
703
845
|
throw Error();
|
|
704
846
|
};
|
|
@@ -710,14 +852,14 @@ function Kt() {
|
|
|
710
852
|
try {
|
|
711
853
|
Reflect.construct(b, []);
|
|
712
854
|
} catch (F) {
|
|
713
|
-
|
|
855
|
+
h = F;
|
|
714
856
|
}
|
|
715
857
|
Reflect.construct(e, [], b);
|
|
716
858
|
} else {
|
|
717
859
|
try {
|
|
718
860
|
b.call();
|
|
719
861
|
} catch (F) {
|
|
720
|
-
|
|
862
|
+
h = F;
|
|
721
863
|
}
|
|
722
864
|
e.call(b.prototype);
|
|
723
865
|
}
|
|
@@ -725,180 +867,180 @@ function Kt() {
|
|
|
725
867
|
try {
|
|
726
868
|
throw Error();
|
|
727
869
|
} catch (F) {
|
|
728
|
-
|
|
870
|
+
h = F;
|
|
729
871
|
}
|
|
730
872
|
e();
|
|
731
873
|
}
|
|
732
874
|
} catch (F) {
|
|
733
|
-
if (F &&
|
|
875
|
+
if (F && h && typeof F.stack == "string") {
|
|
734
876
|
for (var w = F.stack.split(`
|
|
735
|
-
`),
|
|
736
|
-
`), M = w.length - 1, I =
|
|
877
|
+
`), O = h.stack.split(`
|
|
878
|
+
`), M = w.length - 1, I = O.length - 1; M >= 1 && I >= 0 && w[M] !== O[I]; )
|
|
737
879
|
I--;
|
|
738
880
|
for (; M >= 1 && I >= 0; M--, I--)
|
|
739
|
-
if (w[M] !==
|
|
881
|
+
if (w[M] !== O[I]) {
|
|
740
882
|
if (M !== 1 || I !== 1)
|
|
741
883
|
do
|
|
742
|
-
if (M--, I--, I < 0 || w[M] !==
|
|
884
|
+
if (M--, I--, I < 0 || w[M] !== O[I]) {
|
|
743
885
|
var D = `
|
|
744
886
|
` + w[M].replace(" at new ", " at ");
|
|
745
|
-
return e.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", e.displayName)), typeof e == "function" &&
|
|
887
|
+
return e.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", e.displayName)), typeof e == "function" && Q.set(e, D), D;
|
|
746
888
|
}
|
|
747
889
|
while (M >= 1 && I >= 0);
|
|
748
890
|
break;
|
|
749
891
|
}
|
|
750
892
|
}
|
|
751
893
|
} finally {
|
|
752
|
-
|
|
894
|
+
fe = !1, ce.current = k, pt(), Error.prepareStackTrace = A;
|
|
753
895
|
}
|
|
754
|
-
var
|
|
755
|
-
return typeof e == "function" &&
|
|
896
|
+
var Y = e ? e.displayName || e.name : "", H = Y ? Z(Y) : "";
|
|
897
|
+
return typeof e == "function" && Q.set(e, H), H;
|
|
756
898
|
}
|
|
757
|
-
function
|
|
758
|
-
return
|
|
899
|
+
function gt(e, s, u) {
|
|
900
|
+
return Pe(e, !1);
|
|
759
901
|
}
|
|
760
|
-
function
|
|
761
|
-
var
|
|
762
|
-
return !!(
|
|
902
|
+
function mt(e) {
|
|
903
|
+
var s = e.prototype;
|
|
904
|
+
return !!(s && s.isReactComponent);
|
|
763
905
|
}
|
|
764
|
-
function
|
|
906
|
+
function ee(e, s, u) {
|
|
765
907
|
if (e == null)
|
|
766
908
|
return "";
|
|
767
909
|
if (typeof e == "function")
|
|
768
|
-
return
|
|
910
|
+
return Pe(e, mt(e));
|
|
769
911
|
if (typeof e == "string")
|
|
770
|
-
return
|
|
912
|
+
return Z(e);
|
|
771
913
|
switch (e) {
|
|
772
|
-
case
|
|
773
|
-
return
|
|
774
|
-
case
|
|
775
|
-
return
|
|
914
|
+
case v:
|
|
915
|
+
return Z("Suspense");
|
|
916
|
+
case c:
|
|
917
|
+
return Z("SuspenseList");
|
|
776
918
|
}
|
|
777
919
|
if (typeof e == "object")
|
|
778
920
|
switch (e.$$typeof) {
|
|
779
921
|
case l:
|
|
780
|
-
return
|
|
781
|
-
case
|
|
782
|
-
return
|
|
783
|
-
case
|
|
784
|
-
var
|
|
922
|
+
return gt(e.render);
|
|
923
|
+
case g:
|
|
924
|
+
return ee(e.type, s, u);
|
|
925
|
+
case f: {
|
|
926
|
+
var h = e, A = h._payload, k = h._init;
|
|
785
927
|
try {
|
|
786
|
-
return
|
|
928
|
+
return ee(k(A), s, u);
|
|
787
929
|
} catch {
|
|
788
930
|
}
|
|
789
931
|
}
|
|
790
932
|
}
|
|
791
933
|
return "";
|
|
792
934
|
}
|
|
793
|
-
var J = Object.prototype.hasOwnProperty,
|
|
794
|
-
function
|
|
935
|
+
var J = Object.prototype.hasOwnProperty, Oe = {}, Fe = x.ReactDebugCurrentFrame;
|
|
936
|
+
function te(e) {
|
|
795
937
|
if (e) {
|
|
796
|
-
var
|
|
797
|
-
|
|
938
|
+
var s = e._owner, u = ee(e.type, e._source, s ? s.type : null);
|
|
939
|
+
Fe.setExtraStackFrame(u);
|
|
798
940
|
} else
|
|
799
|
-
|
|
941
|
+
Fe.setExtraStackFrame(null);
|
|
800
942
|
}
|
|
801
|
-
function
|
|
943
|
+
function _t(e, s, u, h, A) {
|
|
802
944
|
{
|
|
803
|
-
var
|
|
945
|
+
var k = Function.call.bind(J);
|
|
804
946
|
for (var b in e)
|
|
805
|
-
if (
|
|
947
|
+
if (k(e, b)) {
|
|
806
948
|
var w = void 0;
|
|
807
949
|
try {
|
|
808
950
|
if (typeof e[b] != "function") {
|
|
809
|
-
var
|
|
810
|
-
throw
|
|
951
|
+
var O = Error((h || "React class") + ": " + u + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
952
|
+
throw O.name = "Invariant Violation", O;
|
|
811
953
|
}
|
|
812
|
-
w = e[b](
|
|
954
|
+
w = e[b](s, b, h, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
813
955
|
} catch (M) {
|
|
814
956
|
w = M;
|
|
815
957
|
}
|
|
816
|
-
w && !(w instanceof Error) && (
|
|
958
|
+
w && !(w instanceof Error) && (te(A), _("%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).", h || "React class", u, b, typeof w), te(null)), w instanceof Error && !(w.message in Oe) && (Oe[w.message] = !0, te(A), _("Failed %s type: %s", u, w.message), te(null));
|
|
817
959
|
}
|
|
818
960
|
}
|
|
819
961
|
}
|
|
820
|
-
var
|
|
821
|
-
function
|
|
822
|
-
return
|
|
962
|
+
var vt = Array.isArray;
|
|
963
|
+
function de(e) {
|
|
964
|
+
return vt(e);
|
|
823
965
|
}
|
|
824
|
-
function
|
|
966
|
+
function yt(e) {
|
|
825
967
|
{
|
|
826
|
-
var
|
|
827
|
-
return
|
|
968
|
+
var s = typeof Symbol == "function" && Symbol.toStringTag, u = s && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
969
|
+
return u;
|
|
828
970
|
}
|
|
829
971
|
}
|
|
830
|
-
function
|
|
972
|
+
function Et(e) {
|
|
831
973
|
try {
|
|
832
|
-
return
|
|
974
|
+
return De(e), !1;
|
|
833
975
|
} catch {
|
|
834
976
|
return !0;
|
|
835
977
|
}
|
|
836
978
|
}
|
|
837
|
-
function
|
|
979
|
+
function De(e) {
|
|
838
980
|
return "" + e;
|
|
839
981
|
}
|
|
840
|
-
function
|
|
841
|
-
if (
|
|
842
|
-
return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
982
|
+
function $e(e) {
|
|
983
|
+
if (Et(e))
|
|
984
|
+
return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", yt(e)), De(e);
|
|
843
985
|
}
|
|
844
|
-
var
|
|
986
|
+
var Le = x.ReactCurrentOwner, wt = {
|
|
845
987
|
key: !0,
|
|
846
988
|
ref: !0,
|
|
847
989
|
__self: !0,
|
|
848
990
|
__source: !0
|
|
849
|
-
},
|
|
850
|
-
function
|
|
991
|
+
}, Ue, Ve;
|
|
992
|
+
function bt(e) {
|
|
851
993
|
if (J.call(e, "ref")) {
|
|
852
|
-
var
|
|
853
|
-
if (
|
|
994
|
+
var s = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
995
|
+
if (s && s.isReactWarning)
|
|
854
996
|
return !1;
|
|
855
997
|
}
|
|
856
998
|
return e.ref !== void 0;
|
|
857
999
|
}
|
|
858
|
-
function
|
|
1000
|
+
function xt(e) {
|
|
859
1001
|
if (J.call(e, "key")) {
|
|
860
|
-
var
|
|
861
|
-
if (
|
|
1002
|
+
var s = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
1003
|
+
if (s && s.isReactWarning)
|
|
862
1004
|
return !1;
|
|
863
1005
|
}
|
|
864
1006
|
return e.key !== void 0;
|
|
865
1007
|
}
|
|
866
|
-
function
|
|
867
|
-
typeof e.ref == "string" &&
|
|
1008
|
+
function At(e, s) {
|
|
1009
|
+
typeof e.ref == "string" && Le.current;
|
|
868
1010
|
}
|
|
869
|
-
function
|
|
1011
|
+
function kt(e, s) {
|
|
870
1012
|
{
|
|
871
|
-
var
|
|
872
|
-
|
|
1013
|
+
var u = function() {
|
|
1014
|
+
Ue || (Ue = !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)", s));
|
|
873
1015
|
};
|
|
874
|
-
|
|
875
|
-
get:
|
|
1016
|
+
u.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
1017
|
+
get: u,
|
|
876
1018
|
configurable: !0
|
|
877
1019
|
});
|
|
878
1020
|
}
|
|
879
1021
|
}
|
|
880
|
-
function
|
|
1022
|
+
function Tt(e, s) {
|
|
881
1023
|
{
|
|
882
|
-
var
|
|
883
|
-
|
|
1024
|
+
var u = function() {
|
|
1025
|
+
Ve || (Ve = !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)", s));
|
|
884
1026
|
};
|
|
885
|
-
|
|
886
|
-
get:
|
|
1027
|
+
u.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
1028
|
+
get: u,
|
|
887
1029
|
configurable: !0
|
|
888
1030
|
});
|
|
889
1031
|
}
|
|
890
1032
|
}
|
|
891
|
-
var
|
|
1033
|
+
var St = function(e, s, u, h, A, k, b) {
|
|
892
1034
|
var w = {
|
|
893
1035
|
// This tag allows us to uniquely identify this as a React Element
|
|
894
1036
|
$$typeof: r,
|
|
895
1037
|
// Built-in properties that belong on the element
|
|
896
1038
|
type: e,
|
|
897
|
-
key:
|
|
898
|
-
ref:
|
|
1039
|
+
key: s,
|
|
1040
|
+
ref: u,
|
|
899
1041
|
props: b,
|
|
900
1042
|
// Record the component responsible for creating this element.
|
|
901
|
-
_owner:
|
|
1043
|
+
_owner: k
|
|
902
1044
|
};
|
|
903
1045
|
return w._store = {}, Object.defineProperty(w._store, "validated", {
|
|
904
1046
|
configurable: !1,
|
|
@@ -909,7 +1051,7 @@ function Kt() {
|
|
|
909
1051
|
configurable: !1,
|
|
910
1052
|
enumerable: !1,
|
|
911
1053
|
writable: !1,
|
|
912
|
-
value:
|
|
1054
|
+
value: h
|
|
913
1055
|
}), Object.defineProperty(w, "_source", {
|
|
914
1056
|
configurable: !1,
|
|
915
1057
|
enumerable: !1,
|
|
@@ -917,41 +1059,41 @@ function Kt() {
|
|
|
917
1059
|
value: A
|
|
918
1060
|
}), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w;
|
|
919
1061
|
};
|
|
920
|
-
function
|
|
1062
|
+
function Rt(e, s, u, h, A) {
|
|
921
1063
|
{
|
|
922
|
-
var
|
|
923
|
-
|
|
924
|
-
for (
|
|
925
|
-
J.call(
|
|
1064
|
+
var k, b = {}, w = null, O = null;
|
|
1065
|
+
u !== void 0 && ($e(u), w = "" + u), xt(s) && ($e(s.key), w = "" + s.key), bt(s) && (O = s.ref, At(s, A));
|
|
1066
|
+
for (k in s)
|
|
1067
|
+
J.call(s, k) && !wt.hasOwnProperty(k) && (b[k] = s[k]);
|
|
926
1068
|
if (e && e.defaultProps) {
|
|
927
1069
|
var M = e.defaultProps;
|
|
928
|
-
for (
|
|
929
|
-
b[
|
|
1070
|
+
for (k in M)
|
|
1071
|
+
b[k] === void 0 && (b[k] = M[k]);
|
|
930
1072
|
}
|
|
931
|
-
if (w ||
|
|
1073
|
+
if (w || O) {
|
|
932
1074
|
var I = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
933
|
-
w &&
|
|
1075
|
+
w && kt(b, I), O && Tt(b, I);
|
|
934
1076
|
}
|
|
935
|
-
return
|
|
1077
|
+
return St(e, w, O, A, h, Le.current, b);
|
|
936
1078
|
}
|
|
937
1079
|
}
|
|
938
|
-
var
|
|
939
|
-
function
|
|
1080
|
+
var pe = x.ReactCurrentOwner, Be = x.ReactDebugCurrentFrame;
|
|
1081
|
+
function G(e) {
|
|
940
1082
|
if (e) {
|
|
941
|
-
var
|
|
942
|
-
|
|
1083
|
+
var s = e._owner, u = ee(e.type, e._source, s ? s.type : null);
|
|
1084
|
+
Be.setExtraStackFrame(u);
|
|
943
1085
|
} else
|
|
944
|
-
|
|
1086
|
+
Be.setExtraStackFrame(null);
|
|
945
1087
|
}
|
|
946
|
-
var
|
|
947
|
-
|
|
948
|
-
function
|
|
1088
|
+
var he;
|
|
1089
|
+
he = !1;
|
|
1090
|
+
function ge(e) {
|
|
949
1091
|
return typeof e == "object" && e !== null && e.$$typeof === r;
|
|
950
1092
|
}
|
|
951
|
-
function
|
|
1093
|
+
function We() {
|
|
952
1094
|
{
|
|
953
|
-
if (
|
|
954
|
-
var e =
|
|
1095
|
+
if (pe.current) {
|
|
1096
|
+
var e = V(pe.current.type);
|
|
955
1097
|
if (e)
|
|
956
1098
|
return `
|
|
957
1099
|
|
|
@@ -963,158 +1105,158 @@ Check the render method of \`` + e + "`.";
|
|
|
963
1105
|
function Ct(e) {
|
|
964
1106
|
return "";
|
|
965
1107
|
}
|
|
966
|
-
var
|
|
967
|
-
function
|
|
1108
|
+
var ze = {};
|
|
1109
|
+
function Mt(e) {
|
|
968
1110
|
{
|
|
969
|
-
var
|
|
970
|
-
if (!
|
|
971
|
-
var
|
|
972
|
-
|
|
1111
|
+
var s = We();
|
|
1112
|
+
if (!s) {
|
|
1113
|
+
var u = typeof e == "string" ? e : e.displayName || e.name;
|
|
1114
|
+
u && (s = `
|
|
973
1115
|
|
|
974
|
-
Check the top-level render call using <` +
|
|
1116
|
+
Check the top-level render call using <` + u + ">.");
|
|
975
1117
|
}
|
|
976
|
-
return
|
|
1118
|
+
return s;
|
|
977
1119
|
}
|
|
978
1120
|
}
|
|
979
|
-
function
|
|
1121
|
+
function He(e, s) {
|
|
980
1122
|
{
|
|
981
1123
|
if (!e._store || e._store.validated || e.key != null)
|
|
982
1124
|
return;
|
|
983
1125
|
e._store.validated = !0;
|
|
984
|
-
var
|
|
985
|
-
if (
|
|
1126
|
+
var u = Mt(s);
|
|
1127
|
+
if (ze[u])
|
|
986
1128
|
return;
|
|
987
|
-
|
|
988
|
-
var
|
|
989
|
-
e && e._owner && e._owner !==
|
|
1129
|
+
ze[u] = !0;
|
|
1130
|
+
var h = "";
|
|
1131
|
+
e && e._owner && e._owner !== pe.current && (h = " It was passed a child from " + V(e._owner.type) + "."), G(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, h), G(null);
|
|
990
1132
|
}
|
|
991
1133
|
}
|
|
992
|
-
function
|
|
1134
|
+
function Ge(e, s) {
|
|
993
1135
|
{
|
|
994
1136
|
if (typeof e != "object")
|
|
995
1137
|
return;
|
|
996
|
-
if (
|
|
997
|
-
for (var
|
|
998
|
-
var
|
|
999
|
-
|
|
1138
|
+
if (de(e))
|
|
1139
|
+
for (var u = 0; u < e.length; u++) {
|
|
1140
|
+
var h = e[u];
|
|
1141
|
+
ge(h) && He(h, s);
|
|
1000
1142
|
}
|
|
1001
|
-
else if (
|
|
1143
|
+
else if (ge(e))
|
|
1002
1144
|
e._store && (e._store.validated = !0);
|
|
1003
1145
|
else if (e) {
|
|
1004
|
-
var A =
|
|
1146
|
+
var A = S(e);
|
|
1005
1147
|
if (typeof A == "function" && A !== e.entries)
|
|
1006
|
-
for (var
|
|
1007
|
-
|
|
1148
|
+
for (var k = A.call(e), b; !(b = k.next()).done; )
|
|
1149
|
+
ge(b.value) && He(b.value, s);
|
|
1008
1150
|
}
|
|
1009
1151
|
}
|
|
1010
1152
|
}
|
|
1011
|
-
function
|
|
1153
|
+
function It(e) {
|
|
1012
1154
|
{
|
|
1013
|
-
var
|
|
1014
|
-
if (
|
|
1155
|
+
var s = e.type;
|
|
1156
|
+
if (s == null || typeof s == "string")
|
|
1015
1157
|
return;
|
|
1016
|
-
var
|
|
1017
|
-
if (typeof
|
|
1018
|
-
|
|
1019
|
-
else if (typeof
|
|
1158
|
+
var u;
|
|
1159
|
+
if (typeof s == "function")
|
|
1160
|
+
u = s.propTypes;
|
|
1161
|
+
else if (typeof s == "object" && (s.$$typeof === l || // Note: Memo only checks outer props here.
|
|
1020
1162
|
// Inner props are checked in the reconciler.
|
|
1021
|
-
|
|
1022
|
-
|
|
1163
|
+
s.$$typeof === g))
|
|
1164
|
+
u = s.propTypes;
|
|
1023
1165
|
else
|
|
1024
1166
|
return;
|
|
1025
|
-
if (
|
|
1026
|
-
var
|
|
1027
|
-
|
|
1028
|
-
} else if (
|
|
1029
|
-
|
|
1030
|
-
var A =
|
|
1167
|
+
if (u) {
|
|
1168
|
+
var h = V(s);
|
|
1169
|
+
_t(u, e.props, "prop", h, e);
|
|
1170
|
+
} else if (s.PropTypes !== void 0 && !he) {
|
|
1171
|
+
he = !0;
|
|
1172
|
+
var A = V(s);
|
|
1031
1173
|
_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", A || "Unknown");
|
|
1032
1174
|
}
|
|
1033
|
-
typeof
|
|
1175
|
+
typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
1034
1176
|
}
|
|
1035
1177
|
}
|
|
1036
|
-
function
|
|
1178
|
+
function Nt(e) {
|
|
1037
1179
|
{
|
|
1038
|
-
for (var
|
|
1039
|
-
var
|
|
1040
|
-
if (
|
|
1041
|
-
|
|
1180
|
+
for (var s = Object.keys(e.props), u = 0; u < s.length; u++) {
|
|
1181
|
+
var h = s[u];
|
|
1182
|
+
if (h !== "children" && h !== "key") {
|
|
1183
|
+
G(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", h), G(null);
|
|
1042
1184
|
break;
|
|
1043
1185
|
}
|
|
1044
1186
|
}
|
|
1045
|
-
e.ref !== null && (
|
|
1187
|
+
e.ref !== null && (G(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), G(null));
|
|
1046
1188
|
}
|
|
1047
1189
|
}
|
|
1048
|
-
var
|
|
1049
|
-
function
|
|
1190
|
+
var Ye = {};
|
|
1191
|
+
function qe(e, s, u, h, A, k) {
|
|
1050
1192
|
{
|
|
1051
|
-
var b =
|
|
1193
|
+
var b = lt(e);
|
|
1052
1194
|
if (!b) {
|
|
1053
1195
|
var w = "";
|
|
1054
1196
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (w += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
1055
|
-
var
|
|
1056
|
-
|
|
1197
|
+
var O = Ct();
|
|
1198
|
+
O ? w += O : w += We();
|
|
1057
1199
|
var M;
|
|
1058
|
-
e === null ? M = "null" :
|
|
1200
|
+
e === null ? M = "null" : de(e) ? M = "array" : e !== void 0 && e.$$typeof === r ? (M = "<" + (V(e.type) || "Unknown") + " />", w = " Did you accidentally export a JSX literal instead of a component?") : M = 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", M, w);
|
|
1059
1201
|
}
|
|
1060
|
-
var I =
|
|
1202
|
+
var I = Rt(e, s, u, A, k);
|
|
1061
1203
|
if (I == null)
|
|
1062
1204
|
return I;
|
|
1063
1205
|
if (b) {
|
|
1064
|
-
var D =
|
|
1206
|
+
var D = s.children;
|
|
1065
1207
|
if (D !== void 0)
|
|
1066
|
-
if (
|
|
1067
|
-
if (
|
|
1068
|
-
for (var
|
|
1069
|
-
|
|
1208
|
+
if (h)
|
|
1209
|
+
if (de(D)) {
|
|
1210
|
+
for (var Y = 0; Y < D.length; Y++)
|
|
1211
|
+
Ge(D[Y], e);
|
|
1070
1212
|
Object.freeze && Object.freeze(D);
|
|
1071
1213
|
} else
|
|
1072
1214
|
_("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
1073
1215
|
else
|
|
1074
|
-
|
|
1216
|
+
Ge(D, e);
|
|
1075
1217
|
}
|
|
1076
|
-
if (J.call(
|
|
1077
|
-
var
|
|
1078
|
-
return
|
|
1079
|
-
}),
|
|
1080
|
-
if (!
|
|
1081
|
-
var
|
|
1218
|
+
if (J.call(s, "key")) {
|
|
1219
|
+
var H = V(e), F = Object.keys(s).filter(function($t) {
|
|
1220
|
+
return $t !== "key";
|
|
1221
|
+
}), me = F.length > 0 ? "{key: someKey, " + F.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1222
|
+
if (!Ye[H + me]) {
|
|
1223
|
+
var Dt = F.length > 0 ? "{" + F.join(": ..., ") + ": ...}" : "{}";
|
|
1082
1224
|
_(`A props object containing a "key" prop is being spread into JSX:
|
|
1083
1225
|
let props = %s;
|
|
1084
1226
|
<%s {...props} />
|
|
1085
1227
|
React keys must be passed directly to JSX without using spread:
|
|
1086
1228
|
let props = %s;
|
|
1087
|
-
<%s key={someKey} {...props} />`,
|
|
1229
|
+
<%s key={someKey} {...props} />`, me, H, Dt, H), Ye[H + me] = !0;
|
|
1088
1230
|
}
|
|
1089
1231
|
}
|
|
1090
|
-
return e ===
|
|
1232
|
+
return e === a ? Nt(I) : It(I), I;
|
|
1091
1233
|
}
|
|
1092
1234
|
}
|
|
1093
|
-
function
|
|
1094
|
-
return
|
|
1235
|
+
function jt(e, s, u) {
|
|
1236
|
+
return qe(e, s, u, !0);
|
|
1095
1237
|
}
|
|
1096
|
-
function
|
|
1097
|
-
return
|
|
1238
|
+
function Pt(e, s, u) {
|
|
1239
|
+
return qe(e, s, u, !1);
|
|
1098
1240
|
}
|
|
1099
|
-
var Ot =
|
|
1100
|
-
|
|
1101
|
-
})()),
|
|
1241
|
+
var Ot = Pt, Ft = jt;
|
|
1242
|
+
X.Fragment = a, X.jsx = Ot, X.jsxs = Ft;
|
|
1243
|
+
})()), X;
|
|
1102
1244
|
}
|
|
1103
|
-
var
|
|
1104
|
-
function
|
|
1105
|
-
return
|
|
1245
|
+
var Qe;
|
|
1246
|
+
function sr() {
|
|
1247
|
+
return Qe || (Qe = 1, process.env.NODE_ENV === "production" ? se.exports = rr() : se.exports = nr()), se.exports;
|
|
1106
1248
|
}
|
|
1107
|
-
var
|
|
1108
|
-
const
|
|
1249
|
+
var m = sr();
|
|
1250
|
+
const st = "platform-kit", or = !1, ve = {
|
|
1109
1251
|
log: (...t) => {
|
|
1110
1252
|
},
|
|
1111
1253
|
warn: (...t) => {
|
|
1112
1254
|
},
|
|
1113
1255
|
error: (...t) => {
|
|
1114
|
-
console.error(`[${
|
|
1256
|
+
console.error(`[${st}]`, ...t);
|
|
1115
1257
|
}
|
|
1116
1258
|
};
|
|
1117
|
-
class
|
|
1259
|
+
class Rr extends Lt {
|
|
1118
1260
|
hasDispatched = !1;
|
|
1119
1261
|
constructor(r) {
|
|
1120
1262
|
super(r), this.state = { hasError: !1 };
|
|
@@ -1128,7 +1270,7 @@ class Er extends $t {
|
|
|
1128
1270
|
const r = window;
|
|
1129
1271
|
if (r.__MF_NAME__) return r.__MF_NAME__;
|
|
1130
1272
|
}
|
|
1131
|
-
return
|
|
1273
|
+
return st;
|
|
1132
1274
|
}
|
|
1133
1275
|
/**
|
|
1134
1276
|
* Определить нужно ли показывать детали ошибки
|
|
@@ -1140,35 +1282,35 @@ class Er extends $t {
|
|
|
1140
1282
|
try {
|
|
1141
1283
|
const r = sessionStorage.getItem("config");
|
|
1142
1284
|
if (r) {
|
|
1143
|
-
const
|
|
1144
|
-
if (
|
|
1145
|
-
return
|
|
1285
|
+
const o = JSON.parse(r);
|
|
1286
|
+
if (o.showErrorDetails !== void 0)
|
|
1287
|
+
return o.showErrorDetails;
|
|
1146
1288
|
}
|
|
1147
1289
|
} catch {
|
|
1148
1290
|
}
|
|
1149
|
-
return
|
|
1291
|
+
return or;
|
|
1150
1292
|
}
|
|
1151
1293
|
/**
|
|
1152
1294
|
* Dispatch ошибки в shell
|
|
1153
1295
|
*/
|
|
1154
|
-
dispatchError(r,
|
|
1296
|
+
dispatchError(r, o) {
|
|
1155
1297
|
if (this.hasDispatched || typeof window > "u") return;
|
|
1156
1298
|
this.hasDispatched = !0;
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1299
|
+
const a = this.getMfeName();
|
|
1300
|
+
ve.error("ErrorBoundary caught:", r);
|
|
1159
1301
|
try {
|
|
1160
1302
|
window.dispatchEvent(new CustomEvent("mfe-error", {
|
|
1161
1303
|
detail: {
|
|
1162
|
-
mfeName:
|
|
1304
|
+
mfeName: a,
|
|
1163
1305
|
error: r.message || String(r),
|
|
1164
1306
|
stack: r.stack,
|
|
1165
|
-
componentStack:
|
|
1307
|
+
componentStack: o?.componentStack,
|
|
1166
1308
|
timestamp: Date.now()
|
|
1167
1309
|
},
|
|
1168
1310
|
bubbles: !0
|
|
1169
1311
|
}));
|
|
1170
|
-
} catch (
|
|
1171
|
-
|
|
1312
|
+
} catch (i) {
|
|
1313
|
+
ve.error("Failed to dispatch mfe-error event:", i);
|
|
1172
1314
|
}
|
|
1173
1315
|
}
|
|
1174
1316
|
/**
|
|
@@ -1180,8 +1322,8 @@ class Er extends $t {
|
|
|
1180
1322
|
/**
|
|
1181
1323
|
* Обработать ошибку
|
|
1182
1324
|
*/
|
|
1183
|
-
componentDidCatch(r,
|
|
1184
|
-
this.dispatchError(r,
|
|
1325
|
+
componentDidCatch(r, o) {
|
|
1326
|
+
this.dispatchError(r, o), ve.error("Error info:", o.componentStack);
|
|
1185
1327
|
}
|
|
1186
1328
|
/**
|
|
1187
1329
|
* Копировать ошибку в буфер обмена
|
|
@@ -1213,8 +1355,8 @@ ${this.state.error?.stack}`;
|
|
|
1213
1355
|
*/
|
|
1214
1356
|
render() {
|
|
1215
1357
|
if (this.state.hasError) {
|
|
1216
|
-
const r = this.state.error?.message || "Unknown error",
|
|
1217
|
-
return /* @__PURE__ */
|
|
1358
|
+
const r = this.state.error?.message || "Unknown error", o = this.state.error?.stack || "", a = this.shouldShowDetails(), i = this.getMfeName();
|
|
1359
|
+
return /* @__PURE__ */ m.jsxs("div", { style: {
|
|
1218
1360
|
padding: "20px",
|
|
1219
1361
|
textAlign: "center",
|
|
1220
1362
|
color: "#d32f2f",
|
|
@@ -1224,12 +1366,12 @@ ${this.state.error?.stack}`;
|
|
|
1224
1366
|
borderRadius: "4px",
|
|
1225
1367
|
margin: "10px"
|
|
1226
1368
|
}, children: [
|
|
1227
|
-
/* @__PURE__ */
|
|
1369
|
+
/* @__PURE__ */ m.jsxs("h2", { style: { fontSize: "16px", margin: "0 0 8px 0" }, children: [
|
|
1228
1370
|
"⚠️ Ошибка в ",
|
|
1229
|
-
|
|
1371
|
+
i
|
|
1230
1372
|
] }),
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
|
|
1373
|
+
/* @__PURE__ */ m.jsx("p", { style: { fontSize: "12px", margin: 0 }, children: "Произошла ошибка в микрофронтенде. Сообщение отправлено в shell." }),
|
|
1374
|
+
a && /* @__PURE__ */ m.jsxs("details", { style: {
|
|
1233
1375
|
whiteSpace: "pre-wrap",
|
|
1234
1376
|
textAlign: "left",
|
|
1235
1377
|
marginTop: "10px",
|
|
@@ -1237,8 +1379,8 @@ ${this.state.error?.stack}`;
|
|
|
1237
1379
|
padding: "8px",
|
|
1238
1380
|
borderRadius: "4px"
|
|
1239
1381
|
}, children: [
|
|
1240
|
-
/* @__PURE__ */
|
|
1241
|
-
/* @__PURE__ */
|
|
1382
|
+
/* @__PURE__ */ m.jsx("summary", { style: { cursor: "pointer", fontWeight: "bold" }, children: "Детали ошибки" }),
|
|
1383
|
+
/* @__PURE__ */ m.jsxs("pre", { style: {
|
|
1242
1384
|
fontSize: "11px",
|
|
1243
1385
|
overflow: "auto",
|
|
1244
1386
|
maxHeight: "150px",
|
|
@@ -1248,13 +1390,13 @@ ${this.state.error?.stack}`;
|
|
|
1248
1390
|
borderRadius: "4px"
|
|
1249
1391
|
}, children: [
|
|
1250
1392
|
r,
|
|
1251
|
-
|
|
1393
|
+
o && `
|
|
1252
1394
|
|
|
1253
|
-
${
|
|
1395
|
+
${o}`
|
|
1254
1396
|
] })
|
|
1255
1397
|
] }),
|
|
1256
|
-
/* @__PURE__ */
|
|
1257
|
-
/* @__PURE__ */
|
|
1398
|
+
/* @__PURE__ */ m.jsxs("div", { style: { marginTop: "12px", display: "flex", gap: "8px", justifyContent: "center" }, children: [
|
|
1399
|
+
/* @__PURE__ */ m.jsx(
|
|
1258
1400
|
"button",
|
|
1259
1401
|
{
|
|
1260
1402
|
onClick: this.handleCopy,
|
|
@@ -1269,7 +1411,7 @@ ${s}`
|
|
|
1269
1411
|
children: "📋 Копировать"
|
|
1270
1412
|
}
|
|
1271
1413
|
),
|
|
1272
|
-
/* @__PURE__ */
|
|
1414
|
+
/* @__PURE__ */ m.jsx(
|
|
1273
1415
|
"button",
|
|
1274
1416
|
{
|
|
1275
1417
|
onClick: this.handleRetry,
|
|
@@ -1284,7 +1426,7 @@ ${s}`
|
|
|
1284
1426
|
children: "🔄 Обновить"
|
|
1285
1427
|
}
|
|
1286
1428
|
),
|
|
1287
|
-
/* @__PURE__ */
|
|
1429
|
+
/* @__PURE__ */ m.jsx(
|
|
1288
1430
|
"button",
|
|
1289
1431
|
{
|
|
1290
1432
|
onClick: this.handleGoHome,
|
|
@@ -1316,24 +1458,24 @@ const $ = {
|
|
|
1316
1458
|
tags: "🏷️",
|
|
1317
1459
|
spreadsheet: "📊"
|
|
1318
1460
|
};
|
|
1319
|
-
function
|
|
1320
|
-
const { data: r, isLoading:
|
|
1321
|
-
if (
|
|
1322
|
-
return /* @__PURE__ */
|
|
1323
|
-
/* @__PURE__ */
|
|
1461
|
+
function Cr({ mfeName: t }) {
|
|
1462
|
+
const { data: r, isLoading: o, error: a } = Yt({ mfeName: t }), [i, d] = T(!1);
|
|
1463
|
+
if (o)
|
|
1464
|
+
return /* @__PURE__ */ m.jsxs("span", { className: "text-muted small me-2", children: [
|
|
1465
|
+
/* @__PURE__ */ m.jsx("span", { className: "me-1", children: "⏳" }),
|
|
1324
1466
|
"Загрузка..."
|
|
1325
1467
|
] });
|
|
1326
|
-
if (
|
|
1327
|
-
return /* @__PURE__ */
|
|
1328
|
-
/* @__PURE__ */
|
|
1468
|
+
if (a || !r)
|
|
1469
|
+
return /* @__PURE__ */ m.jsxs("span", { className: "text-muted small me-2", title: `Ошибка: ${a || "нет данных"}`, children: [
|
|
1470
|
+
/* @__PURE__ */ m.jsx("span", { className: "me-1", children: "ℹ️" }),
|
|
1329
1471
|
"N/A"
|
|
1330
1472
|
] });
|
|
1331
|
-
const n = r,
|
|
1332
|
-
return n.APP_NAME && l.push({ key: "APP_NAME", value: n.APP_NAME, label: "Приложение", icon: $.apps }), n.BUILD_VERSION && l.push({ key: "BUILD_VERSION", value: n.BUILD_VERSION, label: "Версия", icon: $.tags }), n.IMAGE_VERSION && l.push({ key: "IMAGE_VERSION", value: n.IMAGE_VERSION, label: "Образ", icon: $.storage }), n.GIT_COMMIT && l.push({ key: "GIT_COMMIT", value: n.GIT_COMMIT, label: "Commit", icon: $.spreadsheet }), n.GIT_BRANCH && l.push({ key: "GIT_BRANCH", value: n.GIT_BRANCH, label: "Ветка", icon: $.spreadsheet }), n.CI_COMMIT_AUTHOR && l.push({ key: "CI_COMMIT_AUTHOR", value: n.CI_COMMIT_AUTHOR, label: "Автор", icon: $.user }), n.CI_COMMIT_TIMESTAMP && l.push({ key: "CI_COMMIT_TIMESTAMP", value: n.CI_COMMIT_TIMESTAMP, label: "Дата", icon: $.clock }), n.CI_JOB_URL && l.push({ key: "CI_JOB_URL", value: n.CI_JOB_URL, label: "CI Job", icon: $.link }), n.CI_PIPELINE_URL && l.push({ key: "CI_PIPELINE_URL", value: n.CI_PIPELINE_URL, label: "Pipeline", icon: $.link }), n.CI_COMMIT_MESSAGE && (n.CI_COMMIT_MESSAGE.length > 60 ? n.CI_COMMIT_MESSAGE.substring(0, 57) + "" : n.CI_COMMIT_MESSAGE, l.push({ key: "CI_COMMIT_MESSAGE", value: n.CI_COMMIT_MESSAGE, label: "Сообщение", icon: $.code })), /* @__PURE__ */
|
|
1333
|
-
/* @__PURE__ */
|
|
1473
|
+
const n = r, p = n.BUILD_VERSION || n.IMAGE_VERSION || n.APP_NAME || "N/A", l = [];
|
|
1474
|
+
return n.APP_NAME && l.push({ key: "APP_NAME", value: n.APP_NAME, label: "Приложение", icon: $.apps }), n.BUILD_VERSION && l.push({ key: "BUILD_VERSION", value: n.BUILD_VERSION, label: "Версия", icon: $.tags }), n.IMAGE_VERSION && l.push({ key: "IMAGE_VERSION", value: n.IMAGE_VERSION, label: "Образ", icon: $.storage }), n.GIT_COMMIT && l.push({ key: "GIT_COMMIT", value: n.GIT_COMMIT, label: "Commit", icon: $.spreadsheet }), n.GIT_BRANCH && l.push({ key: "GIT_BRANCH", value: n.GIT_BRANCH, label: "Ветка", icon: $.spreadsheet }), n.CI_COMMIT_AUTHOR && l.push({ key: "CI_COMMIT_AUTHOR", value: n.CI_COMMIT_AUTHOR, label: "Автор", icon: $.user }), n.CI_COMMIT_TIMESTAMP && l.push({ key: "CI_COMMIT_TIMESTAMP", value: n.CI_COMMIT_TIMESTAMP, label: "Дата", icon: $.clock }), n.CI_JOB_URL && l.push({ key: "CI_JOB_URL", value: n.CI_JOB_URL, label: "CI Job", icon: $.link }), n.CI_PIPELINE_URL && l.push({ key: "CI_PIPELINE_URL", value: n.CI_PIPELINE_URL, label: "Pipeline", icon: $.link }), n.CI_COMMIT_MESSAGE && (n.CI_COMMIT_MESSAGE.length > 60 ? n.CI_COMMIT_MESSAGE.substring(0, 57) + "" : n.CI_COMMIT_MESSAGE, l.push({ key: "CI_COMMIT_MESSAGE", value: n.CI_COMMIT_MESSAGE, label: "Сообщение", icon: $.code })), /* @__PURE__ */ m.jsxs("div", { style: { display: "inline-block", position: "relative" }, children: [
|
|
1475
|
+
/* @__PURE__ */ m.jsxs(
|
|
1334
1476
|
"button",
|
|
1335
1477
|
{
|
|
1336
|
-
onClick: () =>
|
|
1478
|
+
onClick: () => d(!i),
|
|
1337
1479
|
style: {
|
|
1338
1480
|
background: "transparent",
|
|
1339
1481
|
border: "none",
|
|
@@ -1345,12 +1487,12 @@ function wr({ mfeName: t }) {
|
|
|
1345
1487
|
},
|
|
1346
1488
|
title: "Информация о версии",
|
|
1347
1489
|
children: [
|
|
1348
|
-
/* @__PURE__ */
|
|
1349
|
-
/* @__PURE__ */
|
|
1490
|
+
/* @__PURE__ */ m.jsx("span", { className: "me-1", children: $.info }),
|
|
1491
|
+
/* @__PURE__ */ m.jsx("span", { className: "text-dark", children: p })
|
|
1350
1492
|
]
|
|
1351
1493
|
}
|
|
1352
1494
|
),
|
|
1353
|
-
|
|
1495
|
+
i && /* @__PURE__ */ m.jsxs(
|
|
1354
1496
|
"div",
|
|
1355
1497
|
{
|
|
1356
1498
|
style: {
|
|
@@ -1367,36 +1509,36 @@ function wr({ mfeName: t }) {
|
|
|
1367
1509
|
marginTop: "4px"
|
|
1368
1510
|
},
|
|
1369
1511
|
children: [
|
|
1370
|
-
/* @__PURE__ */
|
|
1512
|
+
/* @__PURE__ */ m.jsxs("div", { style: {
|
|
1371
1513
|
marginBottom: "12px",
|
|
1372
1514
|
paddingBottom: "8px",
|
|
1373
1515
|
borderBottom: "1px solid #dee2e6",
|
|
1374
1516
|
display: "flex",
|
|
1375
1517
|
alignItems: "center"
|
|
1376
1518
|
}, children: [
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
/* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ m.jsx("span", { className: "me-2", children: $.apps }),
|
|
1520
|
+
/* @__PURE__ */ m.jsx("strong", { children: n.APP_NAME || t })
|
|
1379
1521
|
] }),
|
|
1380
|
-
/* @__PURE__ */
|
|
1381
|
-
/* @__PURE__ */
|
|
1382
|
-
/* @__PURE__ */
|
|
1522
|
+
/* @__PURE__ */ m.jsxs("div", { style: { marginBottom: "12px" }, children: [
|
|
1523
|
+
/* @__PURE__ */ m.jsx("span", { className: "text-muted", children: "Версия: " }),
|
|
1524
|
+
/* @__PURE__ */ m.jsx("strong", { children: p })
|
|
1383
1525
|
] }),
|
|
1384
|
-
l.length > 0 && /* @__PURE__ */
|
|
1385
|
-
const E =
|
|
1386
|
-
return /* @__PURE__ */
|
|
1387
|
-
/* @__PURE__ */
|
|
1388
|
-
/* @__PURE__ */
|
|
1389
|
-
/* @__PURE__ */
|
|
1390
|
-
/* @__PURE__ */
|
|
1526
|
+
l.length > 0 && /* @__PURE__ */ m.jsx("div", { style: { fontSize: "13px" }, children: l.map(({ key: v, value: c, label: g, icon: f }) => {
|
|
1527
|
+
const E = c.length > 40 && (v.includes("URL") || v.includes("MESSAGE")) ? `${c.substring(0, 37)}...` : c;
|
|
1528
|
+
return /* @__PURE__ */ m.jsxs("div", { style: { marginBottom: "8px", display: "flex", alignItems: "flex-start" }, children: [
|
|
1529
|
+
/* @__PURE__ */ m.jsx("span", { className: "me-2", style: { flexShrink: 0 }, children: f }),
|
|
1530
|
+
/* @__PURE__ */ m.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1531
|
+
/* @__PURE__ */ m.jsx("div", { className: "small text-muted", children: g }),
|
|
1532
|
+
/* @__PURE__ */ m.jsx(
|
|
1391
1533
|
"div",
|
|
1392
1534
|
{
|
|
1393
1535
|
className: "font-monospace small text-truncate",
|
|
1394
1536
|
style: { maxWidth: "100%" },
|
|
1395
|
-
title:
|
|
1396
|
-
children:
|
|
1537
|
+
title: c,
|
|
1538
|
+
children: v.includes("URL") ? /* @__PURE__ */ m.jsx(
|
|
1397
1539
|
"a",
|
|
1398
1540
|
{
|
|
1399
|
-
href:
|
|
1541
|
+
href: c,
|
|
1400
1542
|
target: "_blank",
|
|
1401
1543
|
rel: "noopener noreferrer",
|
|
1402
1544
|
style: { color: "#007bff" },
|
|
@@ -1406,10 +1548,10 @@ function wr({ mfeName: t }) {
|
|
|
1406
1548
|
}
|
|
1407
1549
|
)
|
|
1408
1550
|
] })
|
|
1409
|
-
] },
|
|
1551
|
+
] }, v);
|
|
1410
1552
|
}) }),
|
|
1411
|
-
l.length === 0 && /* @__PURE__ */
|
|
1412
|
-
/* @__PURE__ */
|
|
1553
|
+
l.length === 0 && /* @__PURE__ */ m.jsx("div", { className: "text-center text-muted py-2 small", children: "Нет информации о версии" }),
|
|
1554
|
+
/* @__PURE__ */ m.jsx("div", { style: {
|
|
1413
1555
|
marginTop: "12px",
|
|
1414
1556
|
paddingTop: "8px",
|
|
1415
1557
|
borderTop: "1px solid #dee2e6",
|
|
@@ -1417,10 +1559,10 @@ function wr({ mfeName: t }) {
|
|
|
1417
1559
|
fontSize: "12px",
|
|
1418
1560
|
color: "#6c757d"
|
|
1419
1561
|
}, children: "IngoBank DevOps Platform" }),
|
|
1420
|
-
/* @__PURE__ */
|
|
1562
|
+
/* @__PURE__ */ m.jsx(
|
|
1421
1563
|
"button",
|
|
1422
1564
|
{
|
|
1423
|
-
onClick: () =>
|
|
1565
|
+
onClick: () => d(!1),
|
|
1424
1566
|
style: {
|
|
1425
1567
|
position: "absolute",
|
|
1426
1568
|
top: "8px",
|
|
@@ -1437,10 +1579,10 @@ function wr({ mfeName: t }) {
|
|
|
1437
1579
|
]
|
|
1438
1580
|
}
|
|
1439
1581
|
),
|
|
1440
|
-
|
|
1582
|
+
i && /* @__PURE__ */ m.jsx(
|
|
1441
1583
|
"div",
|
|
1442
1584
|
{
|
|
1443
|
-
onClick: () =>
|
|
1585
|
+
onClick: () => d(!1),
|
|
1444
1586
|
style: {
|
|
1445
1587
|
position: "fixed",
|
|
1446
1588
|
top: 0,
|
|
@@ -1453,64 +1595,64 @@ function wr({ mfeName: t }) {
|
|
|
1453
1595
|
)
|
|
1454
1596
|
] });
|
|
1455
1597
|
}
|
|
1456
|
-
const
|
|
1457
|
-
function
|
|
1458
|
-
const [r,
|
|
1598
|
+
const Ee = "platform-kit", ot = Ut(null);
|
|
1599
|
+
function Mr({ children: t }) {
|
|
1600
|
+
const [r, o] = T([]), a = typeof window < "u" && window.__MF_NAME__ || Ee, i = R((f, E, y, N) => ({
|
|
1459
1601
|
id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
1460
|
-
type:
|
|
1602
|
+
type: f,
|
|
1461
1603
|
title: E,
|
|
1462
|
-
message:
|
|
1463
|
-
mfeName:
|
|
1604
|
+
message: y,
|
|
1605
|
+
mfeName: a,
|
|
1464
1606
|
timestamp: Date.now(),
|
|
1465
1607
|
duration: N
|
|
1466
|
-
}), [
|
|
1467
|
-
|
|
1468
|
-
const E =
|
|
1608
|
+
}), [a]), d = R((f) => {
|
|
1609
|
+
o((y) => [...y, f].slice(0, 5));
|
|
1610
|
+
const E = f.duration || 5e3;
|
|
1469
1611
|
E > 0 && setTimeout(() => {
|
|
1470
|
-
|
|
1612
|
+
o((y) => y.filter((N) => N.id !== f.id));
|
|
1471
1613
|
}, E);
|
|
1472
|
-
}, []), n =
|
|
1473
|
-
const E =
|
|
1474
|
-
|
|
1614
|
+
}, []), n = R((f) => {
|
|
1615
|
+
const E = i(f.type, f.title, f.message, f.duration);
|
|
1616
|
+
d(E), typeof window < "u" && window.dispatchEvent(new CustomEvent("mfe-notification", {
|
|
1475
1617
|
detail: E,
|
|
1476
1618
|
bubbles: !0
|
|
1477
1619
|
}));
|
|
1478
|
-
}, [
|
|
1479
|
-
n({ type: "success", title: E, message:
|
|
1480
|
-
}, [n]), l =
|
|
1481
|
-
n({ type: "error", title: E, message:
|
|
1482
|
-
}, [n]),
|
|
1483
|
-
n({ type: "warning", title: E, message:
|
|
1484
|
-
}, [n]),
|
|
1485
|
-
n({ type: "info", title: E, message:
|
|
1486
|
-
}, [n]),
|
|
1487
|
-
|
|
1620
|
+
}, [i, d]), p = R((f, E = "Успешно") => {
|
|
1621
|
+
n({ type: "success", title: E, message: f });
|
|
1622
|
+
}, [n]), l = R((f, E = "Ошибка") => {
|
|
1623
|
+
n({ type: "error", title: E, message: f });
|
|
1624
|
+
}, [n]), v = R((f, E = "Предупреждение") => {
|
|
1625
|
+
n({ type: "warning", title: E, message: f });
|
|
1626
|
+
}, [n]), c = R((f, E = "Информация") => {
|
|
1627
|
+
n({ type: "info", title: E, message: f });
|
|
1628
|
+
}, [n]), g = R((f) => {
|
|
1629
|
+
o((E) => E.filter((y) => y.id !== f));
|
|
1488
1630
|
}, []);
|
|
1489
|
-
return
|
|
1631
|
+
return U(() => {
|
|
1490
1632
|
if (typeof window > "u") return;
|
|
1491
|
-
const
|
|
1492
|
-
const
|
|
1493
|
-
if (
|
|
1633
|
+
const f = (E) => {
|
|
1634
|
+
const y = E.detail;
|
|
1635
|
+
if (y && y.type && y.title && y.message) {
|
|
1494
1636
|
const N = {
|
|
1495
|
-
...
|
|
1637
|
+
...y,
|
|
1496
1638
|
id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`
|
|
1497
1639
|
};
|
|
1498
|
-
|
|
1640
|
+
d(N);
|
|
1499
1641
|
}
|
|
1500
1642
|
};
|
|
1501
|
-
return window.addEventListener("mfe-notification",
|
|
1502
|
-
window.removeEventListener("mfe-notification",
|
|
1643
|
+
return window.addEventListener("mfe-notification", f), () => {
|
|
1644
|
+
window.removeEventListener("mfe-notification", f);
|
|
1503
1645
|
};
|
|
1504
|
-
}, [
|
|
1646
|
+
}, [d]), /* @__PURE__ */ m.jsxs(ot.Provider, { value: {
|
|
1505
1647
|
notify: n,
|
|
1506
|
-
notifySuccess:
|
|
1648
|
+
notifySuccess: p,
|
|
1507
1649
|
notifyError: l,
|
|
1508
|
-
notifyWarning:
|
|
1509
|
-
notifyInfo:
|
|
1510
|
-
removeNotification:
|
|
1650
|
+
notifyWarning: v,
|
|
1651
|
+
notifyInfo: c,
|
|
1652
|
+
removeNotification: g
|
|
1511
1653
|
}, children: [
|
|
1512
1654
|
t,
|
|
1513
|
-
r.length > 0 && /* @__PURE__ */
|
|
1655
|
+
r.length > 0 && /* @__PURE__ */ m.jsx(
|
|
1514
1656
|
"div",
|
|
1515
1657
|
{
|
|
1516
1658
|
style: {
|
|
@@ -1525,31 +1667,31 @@ function br({ children: t }) {
|
|
|
1525
1667
|
gap: "8px",
|
|
1526
1668
|
pointerEvents: "none"
|
|
1527
1669
|
},
|
|
1528
|
-
children: r.map((
|
|
1670
|
+
children: r.map((f) => /* @__PURE__ */ m.jsxs(
|
|
1529
1671
|
"div",
|
|
1530
1672
|
{
|
|
1531
|
-
className: `notification notification-${
|
|
1673
|
+
className: `notification notification-${f.type}`,
|
|
1532
1674
|
style: {
|
|
1533
1675
|
pointerEvents: "auto",
|
|
1534
1676
|
padding: "12px 16px",
|
|
1535
1677
|
borderRadius: "8px",
|
|
1536
|
-
background:
|
|
1537
|
-
color:
|
|
1678
|
+
background: f.type === "success" ? "#d4edda" : f.type === "error" ? "#f8d7da" : f.type === "warning" ? "#fff3cd" : "#d1ecf1",
|
|
1679
|
+
color: f.type === "success" ? "#155724" : f.type === "error" ? "#721c24" : f.type === "warning" ? "#856404" : "#0c5460",
|
|
1538
1680
|
boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
|
|
1539
1681
|
display: "flex",
|
|
1540
1682
|
alignItems: "flex-start",
|
|
1541
1683
|
gap: "12px"
|
|
1542
1684
|
},
|
|
1543
1685
|
children: [
|
|
1544
|
-
/* @__PURE__ */
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
/* @__PURE__ */
|
|
1547
|
-
/* @__PURE__ */
|
|
1686
|
+
/* @__PURE__ */ m.jsxs("div", { style: { flex: 1 }, children: [
|
|
1687
|
+
/* @__PURE__ */ m.jsx("strong", { style: { display: "block", marginBottom: "4px" }, children: f.title }),
|
|
1688
|
+
/* @__PURE__ */ m.jsx("p", { style: { margin: 0, fontSize: "14px" }, children: f.message }),
|
|
1689
|
+
/* @__PURE__ */ m.jsx("small", { style: { opacity: 0.7, fontSize: "12px" }, children: f.mfeName })
|
|
1548
1690
|
] }),
|
|
1549
|
-
/* @__PURE__ */
|
|
1691
|
+
/* @__PURE__ */ m.jsx(
|
|
1550
1692
|
"button",
|
|
1551
1693
|
{
|
|
1552
|
-
onClick: () =>
|
|
1694
|
+
onClick: () => g(f.id),
|
|
1553
1695
|
style: {
|
|
1554
1696
|
background: "transparent",
|
|
1555
1697
|
border: "none",
|
|
@@ -1563,14 +1705,14 @@ function br({ children: t }) {
|
|
|
1563
1705
|
)
|
|
1564
1706
|
]
|
|
1565
1707
|
},
|
|
1566
|
-
|
|
1708
|
+
f.id
|
|
1567
1709
|
))
|
|
1568
1710
|
}
|
|
1569
1711
|
)
|
|
1570
1712
|
] });
|
|
1571
1713
|
}
|
|
1572
|
-
function
|
|
1573
|
-
const t =
|
|
1714
|
+
function Ir() {
|
|
1715
|
+
const t = Vt(ot);
|
|
1574
1716
|
return t || {
|
|
1575
1717
|
notify: () => {
|
|
1576
1718
|
},
|
|
@@ -1586,134 +1728,33 @@ function xr() {
|
|
|
1586
1728
|
}
|
|
1587
1729
|
};
|
|
1588
1730
|
}
|
|
1589
|
-
function
|
|
1731
|
+
function Nr(t) {
|
|
1590
1732
|
if (typeof window > "u") return;
|
|
1591
|
-
const r = window.__MF_NAME__ ||
|
|
1733
|
+
const r = window.__MF_NAME__ || Ee, o = {
|
|
1592
1734
|
...t,
|
|
1593
1735
|
mfeName: r,
|
|
1594
1736
|
timestamp: Date.now()
|
|
1595
1737
|
};
|
|
1596
1738
|
window.dispatchEvent(new CustomEvent("mfe-notification", {
|
|
1597
|
-
detail:
|
|
1739
|
+
detail: o,
|
|
1598
1740
|
bubbles: !0
|
|
1599
1741
|
}));
|
|
1600
1742
|
}
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
},
|
|
1604
|
-
warn: (...t) => {
|
|
1605
|
-
},
|
|
1606
|
-
error: (...t) => {
|
|
1607
|
-
console.error(`[${ot}]`, ...t);
|
|
1608
|
-
},
|
|
1609
|
-
info: (...t) => {
|
|
1610
|
-
}
|
|
1611
|
-
};
|
|
1612
|
-
function Qt(t) {
|
|
1613
|
-
const r = t.response;
|
|
1614
|
-
let s = "unknown";
|
|
1615
|
-
return r ? r.status === 401 ? s = "unauthorized" : r.status === 403 ? s = "forbidden" : r.status === 404 ? s = "not_found" : r.status >= 500 && (s = "server") : s = "network", {
|
|
1616
|
-
message: r?.data?.message ?? t.message ?? "Unknown error",
|
|
1617
|
-
code: r?.data?.code,
|
|
1618
|
-
status: r?.status,
|
|
1619
|
-
type: s,
|
|
1620
|
-
timestamp: Date.now(),
|
|
1621
|
-
url: t.config?.url
|
|
1622
|
-
};
|
|
1623
|
-
}
|
|
1624
|
-
const er = 3, tr = 1e3;
|
|
1625
|
-
function rr(t) {
|
|
1626
|
-
return !t || t >= 500 || t === 429;
|
|
1627
|
-
}
|
|
1628
|
-
function nr(t) {
|
|
1629
|
-
return new Promise((r) => setTimeout(r, t));
|
|
1630
|
-
}
|
|
1631
|
-
function or(t = {}) {
|
|
1632
|
-
const r = t.name || ot, s = t.retries ?? er, i = t.retryDelay ?? tr, c = {
|
|
1633
|
-
log: (...n) => ne.log(`[API:${r}]`, ...n),
|
|
1634
|
-
warn: (...n) => ne.warn(`[API:${r}]`, ...n),
|
|
1635
|
-
error: (...n) => ne.error(`[API:${r}]`, ...n),
|
|
1636
|
-
info: (...n) => ne.info(`[API:${r}]`, ...n)
|
|
1637
|
-
}, p = Vt.create({
|
|
1638
|
-
timeout: t.timeout ?? 1e4,
|
|
1639
|
-
baseURL: t.baseURL ?? "",
|
|
1640
|
-
headers: {
|
|
1641
|
-
"Content-Type": "application/json"
|
|
1642
|
-
}
|
|
1643
|
-
});
|
|
1644
|
-
return p.interceptors.request.use(
|
|
1645
|
-
(n) => {
|
|
1646
|
-
const m = Bt();
|
|
1647
|
-
if (m?.isAuthenticated) {
|
|
1648
|
-
const l = m.user?.profile?.access_token;
|
|
1649
|
-
l && n.headers && (n.headers.Authorization = `Bearer ${l}`, c.info("Auth token attached"));
|
|
1650
|
-
} else
|
|
1651
|
-
c.info("User not authenticated - request without token");
|
|
1652
|
-
return c.log(`${n.method?.toUpperCase()} ${n.url}`), n;
|
|
1653
|
-
},
|
|
1654
|
-
(n) => (c.error("Request interceptor error:", n.message), Promise.reject(n))
|
|
1655
|
-
), p.interceptors.response.use(
|
|
1656
|
-
(n) => (c.log(`Response ${n.status}:`, n.config.url), n),
|
|
1657
|
-
async (n) => {
|
|
1658
|
-
const m = n.response?.status, l = n.config?.url, y = n.config?._retryCount ?? 0;
|
|
1659
|
-
if (rr(m) && y < s) {
|
|
1660
|
-
const f = n.config;
|
|
1661
|
-
f._retryCount = y + 1;
|
|
1662
|
-
const h = i * Math.pow(2, y);
|
|
1663
|
-
return c.warn(`Retrying (${f._retryCount}/${s}) after ${h}ms:`, l), await nr(h), p.request(f);
|
|
1664
|
-
}
|
|
1665
|
-
return m === 401 ? (c.warn("401 Unauthorized - triggering re-auth"), Wt()) : m === 403 ? c.warn("403 Forbidden - insufficient permissions") : m === 404 ? c.warn("404 Not found:", l) : m === 429 ? c.warn("429 Rate limited") : m === 500 ? c.error("500 Server error:", l) : n.response ? c.warn(`Error ${m}:`, n.message) : c.error("Network error - backend may be unavailable:", l), Promise.reject(Qt(n));
|
|
1666
|
-
}
|
|
1667
|
-
), p;
|
|
1668
|
-
}
|
|
1669
|
-
const ae = or();
|
|
1670
|
-
async function Sr(t, r, s = ae) {
|
|
1671
|
-
const i = await s.get(t, { params: r });
|
|
1743
|
+
function ue(t, r) {
|
|
1744
|
+
const o = r?.prefix ? `[${r.prefix}]` : `[${t}]`;
|
|
1672
1745
|
return {
|
|
1673
|
-
|
|
1674
|
-
status: i.status,
|
|
1675
|
-
ok: i.status >= 200 && i.status < 300
|
|
1676
|
-
};
|
|
1677
|
-
}
|
|
1678
|
-
async function Rr(t, r, s = ae) {
|
|
1679
|
-
const i = await s.post(t, r);
|
|
1680
|
-
return {
|
|
1681
|
-
data: i.data,
|
|
1682
|
-
status: i.status,
|
|
1683
|
-
ok: i.status >= 200 && i.status < 300
|
|
1684
|
-
};
|
|
1685
|
-
}
|
|
1686
|
-
async function Tr(t, r, s = ae) {
|
|
1687
|
-
const i = await s.put(t, r);
|
|
1688
|
-
return {
|
|
1689
|
-
data: i.data,
|
|
1690
|
-
status: i.status,
|
|
1691
|
-
ok: i.status >= 200 && i.status < 300
|
|
1692
|
-
};
|
|
1693
|
-
}
|
|
1694
|
-
async function Cr(t, r = ae) {
|
|
1695
|
-
const s = await r.delete(t);
|
|
1696
|
-
return {
|
|
1697
|
-
data: s.data,
|
|
1698
|
-
status: s.status,
|
|
1699
|
-
ok: s.status >= 200 && s.status < 300
|
|
1700
|
-
};
|
|
1701
|
-
}
|
|
1702
|
-
function ie(t, r) {
|
|
1703
|
-
const s = r?.prefix ? `[${r.prefix}]` : `[${t}]`;
|
|
1704
|
-
return {
|
|
1705
|
-
log: (...i) => {
|
|
1746
|
+
log: (...a) => {
|
|
1706
1747
|
},
|
|
1707
|
-
warn: (...
|
|
1748
|
+
warn: (...a) => {
|
|
1708
1749
|
},
|
|
1709
|
-
error: (...
|
|
1710
|
-
console.error(
|
|
1750
|
+
error: (...a) => {
|
|
1751
|
+
console.error(o, ...a);
|
|
1711
1752
|
},
|
|
1712
|
-
info: (...
|
|
1753
|
+
info: (...a) => {
|
|
1713
1754
|
}
|
|
1714
1755
|
};
|
|
1715
1756
|
}
|
|
1716
|
-
const
|
|
1757
|
+
const jr = ue("platform-kit", { prefix: "AUTH" }), Pr = ue("platform-kit", { prefix: "API" }), Or = ue("platform-kit", { prefix: "ERROR" }), Fr = ue("platform-kit", { prefix: "INFO" }), ar = {}, ir = {
|
|
1717
1758
|
log: (...t) => {
|
|
1718
1759
|
},
|
|
1719
1760
|
warn: (...t) => {
|
|
@@ -1722,15 +1763,15 @@ const kr = ie("platform-kit", { prefix: "AUTH" }), Mr = ie("platform-kit", { pre
|
|
|
1722
1763
|
console.error("[getMfeName]", ...t);
|
|
1723
1764
|
}
|
|
1724
1765
|
};
|
|
1725
|
-
function
|
|
1766
|
+
function be(t) {
|
|
1726
1767
|
return t ? t.mfeName ? t.mfeName : t.name ? t.name.replace("@ib-dop/", "") : null : null;
|
|
1727
1768
|
}
|
|
1728
|
-
function
|
|
1769
|
+
function at() {
|
|
1729
1770
|
if (typeof window > "u") return null;
|
|
1730
1771
|
const t = window;
|
|
1731
1772
|
return t.__MF_NAME__ ? t.__MF_NAME__ : null;
|
|
1732
1773
|
}
|
|
1733
|
-
function
|
|
1774
|
+
function it() {
|
|
1734
1775
|
if (typeof window > "u") return null;
|
|
1735
1776
|
try {
|
|
1736
1777
|
const t = sessionStorage.getItem("mf-config");
|
|
@@ -1744,81 +1785,85 @@ function at() {
|
|
|
1744
1785
|
}
|
|
1745
1786
|
return null;
|
|
1746
1787
|
}
|
|
1747
|
-
function
|
|
1748
|
-
const t =
|
|
1788
|
+
function xe() {
|
|
1789
|
+
const t = ar;
|
|
1749
1790
|
return t.VITE_MFE_NAME ? String(t.VITE_MFE_NAME) : t.MFE_NAME ? String(t.MFE_NAME) : null;
|
|
1750
1791
|
}
|
|
1751
|
-
let oe = null,
|
|
1752
|
-
function
|
|
1753
|
-
const
|
|
1754
|
-
if (
|
|
1755
|
-
return
|
|
1756
|
-
if (
|
|
1792
|
+
let oe = null, we = !1;
|
|
1793
|
+
function ur(t, r) {
|
|
1794
|
+
const o = be(t);
|
|
1795
|
+
if (o)
|
|
1796
|
+
return o;
|
|
1797
|
+
if (we && oe)
|
|
1757
1798
|
return oe;
|
|
1758
|
-
const
|
|
1759
|
-
{ source: "window.__MF_NAME__", value:
|
|
1760
|
-
{ source: "sessionStorage.mf-config", value:
|
|
1761
|
-
{ source: "import.meta.env.VITE_MFE_NAME", value:
|
|
1799
|
+
const a = [
|
|
1800
|
+
{ source: "window.__MF_NAME__", value: at() },
|
|
1801
|
+
{ source: "sessionStorage.mf-config", value: it() },
|
|
1802
|
+
{ source: "import.meta.env.VITE_MFE_NAME", value: xe() }
|
|
1762
1803
|
];
|
|
1763
|
-
for (const { source:
|
|
1804
|
+
for (const { source: d, value: n } of a)
|
|
1764
1805
|
if (n)
|
|
1765
|
-
return oe = n,
|
|
1806
|
+
return oe = n, we = !0, n;
|
|
1766
1807
|
if (r)
|
|
1767
1808
|
return r;
|
|
1768
|
-
const
|
|
1769
|
-
throw
|
|
1809
|
+
const i = "Cannot determine MFE name. Please pass mfeName in props, set window.__MF_NAME__, sessionStorage.mf-config, or VITE_MFE_NAME";
|
|
1810
|
+
throw ir.error(i), new Error(i);
|
|
1770
1811
|
}
|
|
1771
|
-
function
|
|
1772
|
-
return
|
|
1812
|
+
function Dr(t) {
|
|
1813
|
+
return ur(t);
|
|
1773
1814
|
}
|
|
1774
|
-
function
|
|
1775
|
-
return
|
|
1815
|
+
function cr(t) {
|
|
1816
|
+
return be(t) ? "props.mfeName" : at() ? "window.__MF_NAME__" : it() ? "sessionStorage.mf-config" : xe() ? "import.meta.env.VITE_MFE_NAME" : null;
|
|
1776
1817
|
}
|
|
1777
|
-
function
|
|
1778
|
-
return
|
|
1818
|
+
function $r(t) {
|
|
1819
|
+
return cr(t) !== null;
|
|
1779
1820
|
}
|
|
1780
|
-
function
|
|
1781
|
-
oe = null,
|
|
1821
|
+
function Lr() {
|
|
1822
|
+
oe = null, we = !1;
|
|
1782
1823
|
}
|
|
1783
|
-
function
|
|
1824
|
+
function Ur(t) {
|
|
1784
1825
|
const r = [];
|
|
1785
|
-
return
|
|
1826
|
+
return be(t) && r.push("props.mfeName"), typeof window < "u" && (window.__MF_NAME__ && r.push("window.__MF_NAME__"), sessionStorage.getItem("mf-config") && r.push("sessionStorage.mf-config")), xe() && r.push("import.meta.env.VITE_MFE_NAME"), r;
|
|
1786
1827
|
}
|
|
1787
1828
|
export {
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1829
|
+
Rr as ErrorBoundary,
|
|
1830
|
+
Mr as NotificationProvider,
|
|
1831
|
+
Cr as VersionInfo,
|
|
1832
|
+
W as api,
|
|
1833
|
+
Pr as apiLogger,
|
|
1834
|
+
jr as authLogger,
|
|
1835
|
+
Qt as createApiClient,
|
|
1836
|
+
ue as createMfLogger,
|
|
1837
|
+
yr as del,
|
|
1838
|
+
Nr as dispatchNotification,
|
|
1839
|
+
Or as errorLogger,
|
|
1840
|
+
mr as get,
|
|
1841
|
+
dr as getAccessToken,
|
|
1842
|
+
Ur as getAllMfeNameSources,
|
|
1843
|
+
Wt as getAuthState,
|
|
1844
|
+
ur as getMfeName,
|
|
1845
|
+
cr as getMfeNameSource,
|
|
1846
|
+
B as getShellAuth,
|
|
1847
|
+
$r as hasMfeName,
|
|
1848
|
+
Fr as infoLogger,
|
|
1849
|
+
pr as isAuthenticated,
|
|
1850
|
+
hr as logout,
|
|
1851
|
+
_r as post,
|
|
1852
|
+
vr as put,
|
|
1853
|
+
zt as redirectToLogin,
|
|
1854
|
+
Dr as requireMfeName,
|
|
1855
|
+
Lr as resetMfeNameCache,
|
|
1856
|
+
ie as useApi,
|
|
1857
|
+
xr as useDel,
|
|
1858
|
+
Tr as useFeatureAdmin,
|
|
1859
|
+
kr as useFeatures,
|
|
1860
|
+
Er as useGet,
|
|
1861
|
+
Yt as useInfoData,
|
|
1862
|
+
Sr as useMicrofrontendsFeatures,
|
|
1863
|
+
Ir as useNotification,
|
|
1864
|
+
Ar as usePermissions,
|
|
1865
|
+
wr as usePost,
|
|
1866
|
+
br as usePut,
|
|
1867
|
+
ae as useShellAuth,
|
|
1868
|
+
gr as useV1Config
|
|
1824
1869
|
};
|