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