strapi-plugin-oidc 1.6.5 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,843 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const reactRouterDom = require("react-router-dom");
5
- const admin = require("@strapi/strapi/admin");
6
- const react = require("react");
7
- const designSystem = require("@strapi/design-system");
8
- const icons = require("@strapi/icons");
9
- const reactIntl = require("react-intl");
10
- const index = require("./index-C2BnnDzh.js");
11
- const styled = require("styled-components");
12
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
13
- const styled__default = /* @__PURE__ */ _interopDefault(styled);
14
- function Role({ oidcRoles, roles, onChangeRole }) {
15
- const { formatMessage } = reactIntl.useIntl();
16
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "p", variant: "omega", textColor: "neutral600", marginBottom: 4, children: formatMessage(index.getTrad("roles.notes")) }),
18
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 4, marginBottom: 4, children: oidcRoles.map((oidcRole) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
19
- designSystem.MultiSelect,
20
- {
21
- withTags: true,
22
- placeholder: formatMessage(index.getTrad("roles.placeholder")),
23
- value: oidcRole.role ? oidcRole.role.map((r) => String(r)) : [],
24
- onChange: (value) => {
25
- if (value && value.length > 0) onChangeRole(value, oidcRole.oauth_type);
26
- },
27
- children: roles.map((role) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.MultiSelectOption, { value: String(role.id), children: role.name }, role.id))
28
- }
29
- ) }, oidcRole.oauth_type)) })
30
- ] });
31
- }
32
- function LocalizedDate({
33
- date,
34
- options
35
- }) {
36
- const userLocale = navigator.language || "en-US";
37
- return new Intl.DateTimeFormat(userLocale, {
38
- year: "numeric",
39
- month: "short",
40
- day: "numeric",
41
- hour: "2-digit",
42
- minute: "2-digit",
43
- ...options
44
- }).format(new Date(date));
45
- }
46
- const CustomTable = styled__default.default(designSystem.Table)`
47
- th,
48
- td,
49
- th span,
50
- td span {
51
- font-size: 1.3rem !important;
52
- }
53
- `;
54
- function ConfirmDialog({
55
- trigger,
56
- title,
57
- body,
58
- confirmLabel,
59
- onConfirm,
60
- confirmVariant = "danger"
61
- }) {
62
- const { formatMessage } = reactIntl.useIntl();
63
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Root, { children: [
64
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Trigger, { children: trigger }),
65
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
66
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { children: title }),
67
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Body, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.WarningCircle, { fill: "danger600" }), children: body }),
68
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { children: [
69
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Cancel, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { fullWidth: true, variant: "tertiary", children: formatMessage(index.getTrad("page.cancel")) }) }),
70
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Action, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { fullWidth: true, variant: confirmVariant, onClick: onConfirm, children: confirmLabel }) })
71
- ] })
72
- ] })
73
- ] });
74
- }
75
- function TablePagination({ page, pageCount, onPageChange }) {
76
- const { formatMessage } = reactIntl.useIntl();
77
- if (pageCount <= 1) return null;
78
- const handleClick = (e, num) => {
79
- e.preventDefault();
80
- onPageChange(num);
81
- };
82
- const pageLink = (num) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.PageLink, { number: num, href: "#", onClick: (e) => handleClick(e, num), children: formatMessage(index.getTrad("pagination.page"), { page: num }) }, num);
83
- const Ellipsis = () => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral600", paddingLeft: 2, paddingRight: 2, children: "…" });
84
- let pages;
85
- if (pageCount <= 10) {
86
- pages = Array.from({ length: pageCount }, (_, i) => pageLink(i + 1));
87
- } else if (page <= 6) {
88
- pages = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
89
- Array.from({ length: 9 }, (_, i) => pageLink(i + 1)),
90
- /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, {}),
91
- pageLink(pageCount)
92
- ] });
93
- } else if (page >= pageCount - 5) {
94
- pages = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
95
- pageLink(1),
96
- /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, {}),
97
- Array.from({ length: 9 }, (_, i) => pageLink(pageCount - 8 + i))
98
- ] });
99
- } else {
100
- pages = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
101
- pageLink(1),
102
- /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, {}),
103
- Array.from({ length: 7 }, (_, i) => pageLink(page - 3 + i)),
104
- /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, {}),
105
- pageLink(pageCount)
106
- ] });
107
- }
108
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Pagination, { activePage: page, pageCount, children: [
109
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.PreviousLink, { href: "#", onClick: (e) => handleClick(e, Math.max(1, page - 1)), children: formatMessage(index.getTrad("pagination.previous")) }),
110
- pages,
111
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.NextLink, { href: "#", onClick: (e) => handleClick(e, Math.min(pageCount, page + 1)), children: formatMessage(index.getTrad("pagination.next")) })
112
- ] }) }) });
113
- }
114
- const PAGE_SIZE$1 = 10;
115
- const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
116
- function Whitelist({
117
- users,
118
- useWhitelist,
119
- loading,
120
- onSave,
121
- onDelete,
122
- onDeleteAll,
123
- onImport,
124
- onExport
125
- }) {
126
- const [email, setEmail] = react.useState("");
127
- const [page, setPage] = react.useState(1);
128
- const { formatMessage } = reactIntl.useIntl();
129
- const { toggleNotification } = admin.useNotification();
130
- const fileInputRef = react.useRef(null);
131
- const pageCount = Math.ceil(users.length / PAGE_SIZE$1) || 1;
132
- const paginatedUsers = users.slice((page - 1) * PAGE_SIZE$1, page * PAGE_SIZE$1);
133
- const onSaveEmail = react.useCallback(() => {
134
- const emailText = email.trim();
135
- if (users.some((user) => user.email === emailText)) {
136
- toggleNotification({
137
- type: "warning",
138
- message: formatMessage(index.getTrad("whitelist.error.unique"))
139
- });
140
- } else {
141
- onSave(emailText);
142
- setEmail("");
143
- }
144
- }, [email, users, onSave, formatMessage, toggleNotification]);
145
- const handleImport = react.useCallback(
146
- async (e) => {
147
- const file = e.target.files?.[0];
148
- if (!fileInputRef.current || !file) return;
149
- fileInputRef.current.value = "";
150
- try {
151
- const text = await file.text();
152
- const parsed = JSON.parse(text);
153
- if (!Array.isArray(parsed)) throw new Error();
154
- const emails = parsed.filter((item) => item?.email).map(
155
- (item) => String(item.email).trim().toLowerCase()
156
- ).filter((email2) => EMAIL_REGEX.test(email2));
157
- const count = await onImport(emails);
158
- if (count === 0) {
159
- toggleNotification({
160
- type: "info",
161
- message: formatMessage(index.getTrad("whitelist.import.none"))
162
- });
163
- } else {
164
- toggleNotification({
165
- type: "success",
166
- message: formatMessage(index.getTrad("whitelist.import.success"), { count })
167
- });
168
- }
169
- } catch {
170
- toggleNotification({
171
- type: "warning",
172
- message: formatMessage(index.getTrad("whitelist.import.error"))
173
- });
174
- }
175
- },
176
- [onImport, formatMessage, toggleNotification]
177
- );
178
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
179
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "p", variant: "omega", textColor: "neutral600", marginBottom: 4, children: formatMessage(index.getTrad("whitelist.description")) }),
180
- useWhitelist && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
181
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", marginBottom: 4, children: [
182
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: formatMessage(index.getTrad("whitelist.count"), { count: users.length }) }),
183
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
184
- /* @__PURE__ */ jsxRuntime.jsx(
185
- designSystem.Button,
186
- {
187
- size: "S",
188
- variant: "tertiary",
189
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Download, {}),
190
- onClick: onExport,
191
- disabled: users.length === 0,
192
- children: formatMessage(index.getTrad("whitelist.export"))
193
- }
194
- ),
195
- /* @__PURE__ */ jsxRuntime.jsx(
196
- designSystem.Button,
197
- {
198
- size: "S",
199
- variant: "tertiary",
200
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Upload, {}),
201
- onClick: () => fileInputRef.current?.click(),
202
- children: formatMessage(index.getTrad("whitelist.import"))
203
- }
204
- ),
205
- /* @__PURE__ */ jsxRuntime.jsx(
206
- "input",
207
- {
208
- ref: fileInputRef,
209
- type: "file",
210
- accept: ".json,application/json",
211
- style: { display: "none" },
212
- onChange: handleImport
213
- }
214
- ),
215
- users.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
216
- ConfirmDialog,
217
- {
218
- trigger: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { size: "S", variant: "danger-light", startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Trash, {}), children: formatMessage(index.getTrad("whitelist.delete.all.label")) }),
219
- title: formatMessage(index.getTrad("whitelist.delete.all.title")),
220
- body: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", textAlign: "center", children: formatMessage(index.getTrad("whitelist.delete.all.description"), {
221
- count: users.length
222
- }) }) }),
223
- confirmLabel: formatMessage(index.getTrad("whitelist.delete.all.label")),
224
- onConfirm: onDeleteAll
225
- }
226
- )
227
- ] })
228
- ] }),
229
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, marginTop: 5, marginBottom: 5, alignItems: "flex-start", children: [
230
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { flex: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsx(
231
- designSystem.Field.Input,
232
- {
233
- type: "text",
234
- disabled: loading,
235
- value: email,
236
- hasError: Boolean(email && !EMAIL_REGEX.test(email)),
237
- onChange: (e) => setEmail(e.currentTarget.value),
238
- placeholder: formatMessage(index.getTrad("whitelist.email.placeholder"))
239
- }
240
- ) }) }),
241
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
242
- designSystem.Button,
243
- {
244
- size: "L",
245
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Plus, {}),
246
- disabled: loading || email.trim() === "" || !EMAIL_REGEX.test(email),
247
- loading,
248
- onClick: onSaveEmail,
249
- children: formatMessage(index.getTrad("page.add"))
250
- }
251
- ) })
252
- ] }),
253
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, {}),
254
- /* @__PURE__ */ jsxRuntime.jsxs(CustomTable, { colCount: 4, rowCount: users.length, children: [
255
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Thead, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
256
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: formatMessage(index.getTrad("whitelist.table.no")) }),
257
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: formatMessage(index.getTrad("whitelist.table.email")) }),
258
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: formatMessage(index.getTrad("whitelist.table.created")) }),
259
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { style: { paddingRight: 0 }, children: " " })
260
- ] }) }),
261
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tbody, { children: users.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tr, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { colSpan: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", padding: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral600", children: formatMessage(index.getTrad("whitelist.table.empty")) }) }) }) }) : paginatedUsers.map((user, index$1) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
262
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: index$1 + 1 + (page - 1) * PAGE_SIZE$1 }),
263
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: user.email }),
264
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(LocalizedDate, { date: user.createdAt, options: { month: "long" } }) }),
265
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { style: { paddingRight: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(
266
- designSystem.Flex,
267
- {
268
- justifyContent: "flex-end",
269
- onClick: (e) => e.stopPropagation(),
270
- style: { width: "100%" },
271
- children: /* @__PURE__ */ jsxRuntime.jsx(
272
- ConfirmDialog,
273
- {
274
- trigger: /* @__PURE__ */ jsxRuntime.jsx(
275
- designSystem.IconButton,
276
- {
277
- label: formatMessage(index.getTrad("whitelist.delete.label")),
278
- withTooltip: false,
279
- children: /* @__PURE__ */ jsxRuntime.jsx(icons.Trash, {})
280
- }
281
- ),
282
- title: formatMessage(index.getTrad("whitelist.delete.title")),
283
- body: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "center", gap: 2, children: [
284
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { id: "confirm-description", children: formatMessage(index.getTrad("whitelist.delete.description")) }) }),
285
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "bold", children: user.email }) }),
286
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", marginTop: 2, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: formatMessage(index.getTrad("whitelist.delete.note")) }) })
287
- ] }),
288
- confirmLabel: formatMessage(index.getTrad("page.ok")),
289
- onConfirm: () => onDelete(user.email),
290
- confirmVariant: "danger-light"
291
- }
292
- )
293
- }
294
- ) })
295
- ] }, user.email)) })
296
- ] }),
297
- /* @__PURE__ */ jsxRuntime.jsx(TablePagination, { page, pageCount, onPageChange: setPage })
298
- ] })
299
- ] });
300
- }
301
- const PAGE_SIZE = 10;
302
- const DETAILS_TEXT_STYLE = {
303
- display: "block",
304
- overflow: "hidden",
305
- textOverflow: "ellipsis",
306
- whiteSpace: "nowrap",
307
- maxWidth: "180px",
308
- cursor: "help"
309
- };
310
- function AuditLog() {
311
- const { formatMessage } = reactIntl.useIntl();
312
- const { get, del } = admin.useFetchClient();
313
- const { toggleNotification } = admin.useNotification();
314
- const [records, setRecords] = react.useState([]);
315
- const [pagination, setPagination] = react.useState({
316
- page: 1,
317
- pageSize: PAGE_SIZE,
318
- total: 0,
319
- pageCount: 1
320
- });
321
- const [page, setPage] = react.useState(1);
322
- const [loading, setLoading] = react.useState(false);
323
- const fetchLogs = react.useCallback(
324
- async (p) => {
325
- setLoading(true);
326
- try {
327
- const response = await get(
328
- `/strapi-plugin-oidc/audit-logs?page=${p}&pageSize=${PAGE_SIZE}`
329
- );
330
- setRecords(response.data.results ?? []);
331
- setPagination(
332
- response.data.pagination ?? { page: p, pageSize: PAGE_SIZE, total: 0, pageCount: 1 }
333
- );
334
- } catch {
335
- setRecords([]);
336
- } finally {
337
- setLoading(false);
338
- }
339
- },
340
- [get]
341
- );
342
- react.useEffect(() => {
343
- fetchLogs(page);
344
- }, [fetchLogs, page]);
345
- const handleClearAll = async () => {
346
- try {
347
- await del("/strapi-plugin-oidc/audit-logs");
348
- toggleNotification({
349
- type: "success",
350
- message: formatMessage(index.getTrad("auditlog.clear.success"))
351
- });
352
- fetchLogs(1);
353
- } catch {
354
- toggleNotification({
355
- type: "danger",
356
- message: formatMessage(index.getTrad("auditlog.clear.error"))
357
- });
358
- }
359
- };
360
- const handleExport = async () => {
361
- try {
362
- const cookieMatch = document.cookie.match(/(?:^|;\s*)jwtToken=([^;]+)/);
363
- const token = cookieMatch ? decodeURIComponent(cookieMatch[1]) : "";
364
- const response = await fetch("/strapi-plugin-oidc/audit-logs/export", {
365
- headers: { Authorization: `Bearer ${token}` }
366
- });
367
- if (!response.ok) {
368
- toggleNotification({
369
- type: "danger",
370
- message: formatMessage(index.getTrad("auditlog.export.error"))
371
- });
372
- return;
373
- }
374
- const text = await response.text();
375
- const blob = new Blob([text], { type: "application/x-ndjson" });
376
- const url = URL.createObjectURL(blob);
377
- const a = document.createElement("a");
378
- a.href = url;
379
- a.download = `oidc-audit-log-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.ndjson`;
380
- a.click();
381
- URL.revokeObjectURL(url);
382
- } catch {
383
- toggleNotification({
384
- type: "danger",
385
- message: formatMessage(index.getTrad("auditlog.export.error"))
386
- });
387
- }
388
- };
389
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
390
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", marginBottom: 4, children: [
391
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: [
392
- pagination.total,
393
- " ",
394
- pagination.total === 1 ? "entry" : "entries"
395
- ] }),
396
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
397
- /* @__PURE__ */ jsxRuntime.jsx(
398
- designSystem.Button,
399
- {
400
- size: "S",
401
- variant: "tertiary",
402
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Download, {}),
403
- onClick: handleExport,
404
- disabled: pagination.total === 0,
405
- children: formatMessage(index.getTrad("auditlog.export"))
406
- }
407
- ),
408
- /* @__PURE__ */ jsxRuntime.jsx(
409
- ConfirmDialog,
410
- {
411
- trigger: /* @__PURE__ */ jsxRuntime.jsx(
412
- designSystem.Button,
413
- {
414
- size: "S",
415
- variant: "danger-light",
416
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Trash, {}),
417
- disabled: pagination.total === 0,
418
- children: formatMessage(index.getTrad("auditlog.clear"))
419
- }
420
- ),
421
- title: formatMessage(index.getTrad("auditlog.clear.title")),
422
- body: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", textAlign: "center", children: formatMessage(index.getTrad("auditlog.clear.description"), {
423
- count: pagination.total
424
- }) }) }),
425
- confirmLabel: formatMessage(index.getTrad("auditlog.clear")),
426
- onConfirm: handleClearAll
427
- }
428
- )
429
- ] })
430
- ] }),
431
- /* @__PURE__ */ jsxRuntime.jsxs(CustomTable, { colCount: 5, rowCount: records.length, children: [
432
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Thead, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
433
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: formatMessage(index.getTrad("auditlog.table.timestamp")) }),
434
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: formatMessage(index.getTrad("auditlog.table.action")) }),
435
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: formatMessage(index.getTrad("auditlog.table.email")) }),
436
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: formatMessage(index.getTrad("auditlog.table.ip")) }),
437
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: formatMessage(index.getTrad("auditlog.table.details")) })
438
- ] }) }),
439
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tbody, { children: [
440
- loading && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tr, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { colSpan: 5, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", padding: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral600", children: formatMessage(index.getTrad("auditlog.loading")) }) }) }) }),
441
- !loading && records.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tr, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { colSpan: 5, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", padding: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral600", children: formatMessage(index.getTrad("auditlog.table.empty")) }) }) }) }),
442
- !loading && records.map((record) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
443
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: /* @__PURE__ */ jsxRuntime.jsx(LocalizedDate, { date: record.createdAt, options: { second: "2-digit" } }) }) }),
444
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", children: [
445
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: record.action }),
446
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label: formatMessage(index.getTrad(`auditlog.action.${record.action}`)), children: /* @__PURE__ */ jsxRuntime.jsx(
447
- icons.Information,
448
- {
449
- "aria-hidden": true,
450
- style: { cursor: "help" },
451
- width: "1.4rem",
452
- height: "1.4rem",
453
- fill: "primary600"
454
- }
455
- ) })
456
- ] }) }),
457
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: record.email ?? "—" }) }),
458
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: record.ip ?? "—" }) }),
459
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { style: { maxWidth: "200px" }, children: record.details ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label: record.details, side: "top", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: DETAILS_TEXT_STYLE, children: record.details }) }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", children: "—" }) })
460
- ] }, record.id))
461
- ] })
462
- ] }),
463
- /* @__PURE__ */ jsxRuntime.jsx(TablePagination, { page, pageCount: pagination.pageCount, onPageChange: setPage })
464
- ] });
465
- }
466
- const AlertMessage = styled__default.default.div`
467
- position: fixed;
468
- left: 50%;
469
- transform: translateX(-50%);
470
- top: 2.875rem;
471
- z-index: 10;
472
- width: 31.25rem;
473
- `;
474
- function SuccessAlertMessage({ onClose }) {
475
- const { formatMessage } = reactIntl.useIntl();
476
- return /* @__PURE__ */ jsxRuntime.jsx(AlertMessage, { children: /* @__PURE__ */ jsxRuntime.jsx(
477
- designSystem.Alert,
478
- {
479
- title: formatMessage(index.getTrad("alert.title.success")),
480
- variant: "success",
481
- closeLabel: "",
482
- onClose,
483
- children: formatMessage(index.getTrad("page.save.success"))
484
- }
485
- ) });
486
- }
487
- function ErrorAlertMessage({ onClose }) {
488
- const { formatMessage } = reactIntl.useIntl();
489
- return /* @__PURE__ */ jsxRuntime.jsx(AlertMessage, { children: /* @__PURE__ */ jsxRuntime.jsx(
490
- designSystem.Alert,
491
- {
492
- title: formatMessage(index.getTrad("alert.title.error")),
493
- variant: "danger",
494
- closeLabel: "",
495
- onClose,
496
- children: formatMessage(index.getTrad("page.save.error"))
497
- }
498
- ) });
499
- }
500
- const SwitchContainer = styled__default.default.label`
501
- position: relative;
502
- display: inline-block;
503
- width: 40px;
504
- height: 24px;
505
- cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
506
- opacity: ${({ $disabled }) => $disabled ? 0.5 : 1};
507
- `;
508
- const SwitchInput = styled__default.default.input`
509
- opacity: 0;
510
- width: 0;
511
- height: 0;
512
-
513
- &:checked + span {
514
- background-color: ${({ theme }) => theme.colors.primary600};
515
- }
516
-
517
- &:focus + span {
518
- box-shadow: 0 0 1px ${({ theme }) => theme.colors.primary600};
519
- }
520
-
521
- &:checked + span:before {
522
- transform: translateX(16px);
523
- }
524
-
525
- &:disabled + span {
526
- pointer-events: none;
527
- }
528
- `;
529
- const SwitchSlider = styled__default.default.span`
530
- position: absolute;
531
- cursor: inherit;
532
- top: 0;
533
- left: 0;
534
- right: 0;
535
- bottom: 0;
536
- background-color: ${({ theme }) => theme.colors.neutral300};
537
- transition: 0.4s;
538
- border-radius: 24px;
539
-
540
- &:before {
541
- position: absolute;
542
- content: "";
543
- height: 18px;
544
- width: 18px;
545
- left: 3px;
546
- bottom: 3px;
547
- background-color: white;
548
- transition: 0.4s;
549
- border-radius: 50%;
550
- }
551
- `;
552
- function CustomSwitch({ checked, onChange, label, disabled }) {
553
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, children: [
554
- /* @__PURE__ */ jsxRuntime.jsxs(SwitchContainer, { $disabled: disabled, children: [
555
- /* @__PURE__ */ jsxRuntime.jsx(
556
- SwitchInput,
557
- {
558
- type: "checkbox",
559
- checked,
560
- onChange,
561
- disabled
562
- }
563
- ),
564
- /* @__PURE__ */ jsxRuntime.jsx(SwitchSlider, {})
565
- ] }),
566
- label && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: disabled ? "neutral500" : "neutral800", children: label })
567
- ] });
568
- }
569
- function formatDatetimeForFilename(date) {
570
- const year = date.getFullYear();
571
- const month = String(date.getMonth() + 1).padStart(2, "0");
572
- const day = String(date.getDate()).padStart(2, "0");
573
- const hours = String(date.getHours()).padStart(2, "0");
574
- const minutes = String(date.getMinutes()).padStart(2, "0");
575
- const seconds = String(date.getSeconds()).padStart(2, "0");
576
- return `${year}${month}${day}_${hours}${minutes}${seconds}`;
577
- }
578
- function deepClone(value) {
579
- return JSON.parse(JSON.stringify(value));
580
- }
581
- function useOidcSettings() {
582
- const { get, put, post } = admin.useFetchClient();
583
- const [loading, setLoading] = react.useState(false);
584
- const [showSuccess, setSuccess] = react.useState(false);
585
- const [showError, setError] = react.useState(false);
586
- const [initialOidcRoles, setInitialOIDCRoles] = react.useState([]);
587
- const [oidcRoles, setOIDCRoles] = react.useState([]);
588
- const [roles, setRoles] = react.useState([]);
589
- const [initialUseWhitelist, setInitialUseWhitelist] = react.useState(false);
590
- const [useWhitelist, setUseWhitelist] = react.useState(false);
591
- const [initialEnforceOIDC, setInitialEnforceOIDC] = react.useState(false);
592
- const [enforceOIDC, setEnforceOIDC] = react.useState(false);
593
- const [enforceOIDCConfig, setEnforceOIDCConfig] = react.useState(null);
594
- const [initialUsers, setInitialUsers] = react.useState([]);
595
- const [users, setUsers] = react.useState([]);
596
- const [whitelistResponse, setWhitelistResponse] = react.useState({});
597
- react.useEffect(() => {
598
- get(`/strapi-plugin-oidc/oidc-roles`).then((response) => {
599
- setOIDCRoles(response.data);
600
- setInitialOIDCRoles(deepClone(response.data));
601
- });
602
- get(`/admin/roles`).then((response) => {
603
- setRoles(response.data.data);
604
- });
605
- get("/strapi-plugin-oidc/whitelist").then((response) => {
606
- const data = response.data;
607
- setWhitelistResponse(data);
608
- setUsers(data.whitelistUsers);
609
- setInitialUsers(deepClone(data.whitelistUsers));
610
- setUseWhitelist(data.useWhitelist);
611
- setInitialUseWhitelist(data.useWhitelist);
612
- setEnforceOIDC(data.enforceOIDC);
613
- setInitialEnforceOIDC(data.enforceOIDC);
614
- setEnforceOIDCConfig(data.enforceOIDCConfig ?? null);
615
- });
616
- }, [get]);
617
- const onChangeRole = react.useCallback((values, oidcId) => {
618
- setOIDCRoles(
619
- (prev) => prev.map((role) => role.oauth_type === oidcId ? { ...role, role: values } : role)
620
- );
621
- }, []);
622
- const onRegisterWhitelist = react.useCallback((email) => {
623
- setUsers((prev) => [...prev, { email, createdAt: (/* @__PURE__ */ new Date()).toISOString() }]);
624
- }, []);
625
- const onDeleteWhitelist = react.useCallback(
626
- (email) => {
627
- setUsers((prev) => {
628
- const updated = prev.filter((u) => u.email !== email);
629
- if (useWhitelist && updated.length === 0) setEnforceOIDC(false);
630
- return updated;
631
- });
632
- },
633
- [useWhitelist]
634
- );
635
- const onDeleteAll = react.useCallback(() => {
636
- setUsers([]);
637
- if (useWhitelist) setEnforceOIDC(false);
638
- }, [useWhitelist]);
639
- const onImport = react.useCallback(
640
- async (emails) => {
641
- const response = await post("/strapi-plugin-oidc/whitelist/import", {
642
- users: emails.map((e) => ({ email: e }))
643
- });
644
- const refreshed = await get("/strapi-plugin-oidc/whitelist");
645
- setUsers(refreshed.data.whitelistUsers);
646
- setInitialUsers(deepClone(refreshed.data.whitelistUsers));
647
- return response.data.importedCount;
648
- },
649
- [post, get]
650
- );
651
- const onExport = react.useCallback(async () => {
652
- const response = await get("/strapi-plugin-oidc/whitelist/export");
653
- const data = response.data;
654
- const datetime = formatDatetimeForFilename(/* @__PURE__ */ new Date());
655
- const blob = new Blob([JSON.stringify(data, null, 2)], { type: "application/json" });
656
- const url = URL.createObjectURL(blob);
657
- const a = document.createElement("a");
658
- a.href = url;
659
- a.download = `strapi-oidc-whitelist-${datetime}.json`;
660
- a.click();
661
- URL.revokeObjectURL(url);
662
- }, [get]);
663
- const onToggleWhitelist = react.useCallback(
664
- (e) => {
665
- const checked = e.target.checked;
666
- setUseWhitelist(checked);
667
- if (checked && users.length === 0) setEnforceOIDC(false);
668
- },
669
- [users.length]
670
- );
671
- const onToggleEnforce = react.useCallback((e) => {
672
- setEnforceOIDC(e.target.checked);
673
- }, []);
674
- const isDirty = useWhitelist !== initialUseWhitelist || enforceOIDC !== initialEnforceOIDC || JSON.stringify(oidcRoles) !== JSON.stringify(initialOidcRoles) || JSON.stringify(users) !== JSON.stringify(initialUsers);
675
- const onSaveAll = react.useCallback(async () => {
676
- setLoading(true);
677
- try {
678
- await put("/strapi-plugin-oidc/oidc-roles", {
679
- roles: oidcRoles.map((role) => ({ oauth_type: role.oauth_type, role: role.role }))
680
- });
681
- await put("/strapi-plugin-oidc/whitelist/sync", {
682
- users: users.map((u) => ({ email: u.email }))
683
- });
684
- await put("/strapi-plugin-oidc/whitelist/settings", { useWhitelist, enforceOIDC });
685
- setInitialOIDCRoles(deepClone(oidcRoles));
686
- setInitialUseWhitelist(useWhitelist);
687
- setInitialEnforceOIDC(enforceOIDC);
688
- get("/strapi-plugin-oidc/whitelist").then((getResponse) => {
689
- const data = getResponse.data;
690
- setWhitelistResponse(data);
691
- setUsers(data.whitelistUsers);
692
- setInitialUsers(deepClone(data.whitelistUsers));
693
- });
694
- setSuccess(true);
695
- setTimeout(() => setSuccess(false), 3e3);
696
- } catch (e) {
697
- console.error(e);
698
- setError(true);
699
- setTimeout(() => setError(false), 3e3);
700
- } finally {
701
- setLoading(false);
702
- }
703
- }, [put, get, oidcRoles, users, useWhitelist, enforceOIDC]);
704
- return {
705
- state: {
706
- loading,
707
- showSuccess,
708
- showError,
709
- oidcRoles,
710
- roles,
711
- useWhitelist,
712
- enforceOIDC,
713
- enforceOIDCConfig,
714
- initialEnforceOIDC,
715
- users,
716
- isDirty,
717
- auditLogEnabled: whitelistResponse.auditLogEnabled ?? true
718
- },
719
- actions: {
720
- setSuccess,
721
- setError,
722
- onChangeRole,
723
- onRegisterWhitelist,
724
- onDeleteWhitelist,
725
- onDeleteAll,
726
- onImport,
727
- onExport,
728
- onToggleWhitelist,
729
- onToggleEnforce,
730
- onSaveAll
731
- }
732
- };
733
- }
734
- function HomePage$1() {
735
- const { formatMessage } = reactIntl.useIntl();
736
- const { state, actions } = useOidcSettings();
737
- const blocker = reactRouterDom.useBlocker(state.isDirty);
738
- return /* @__PURE__ */ jsxRuntime.jsxs(admin.Page.Protect, { permissions: [{ action: "plugin::strapi-plugin-oidc.read", subject: null }], children: [
739
- /* @__PURE__ */ jsxRuntime.jsx(
740
- admin.Layouts.Header,
741
- {
742
- title: formatMessage(index.getTrad("page.title.oidc")),
743
- subtitle: formatMessage(index.getTrad("page.title"))
744
- }
745
- ),
746
- state.showSuccess && /* @__PURE__ */ jsxRuntime.jsx(SuccessAlertMessage, { onClose: () => actions.setSuccess(false) }),
747
- state.showError && /* @__PURE__ */ jsxRuntime.jsx(ErrorAlertMessage, { onClose: () => actions.setError(false) }),
748
- /* @__PURE__ */ jsxRuntime.jsx(admin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
749
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { background: "neutral0", hasRadius: true, shadow: "filterShadow", padding: 6, children: [
750
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", tag: "h2", children: formatMessage(index.getTrad("roles.title")) }) }),
751
- /* @__PURE__ */ jsxRuntime.jsx(
752
- Role,
753
- {
754
- roles: state.roles,
755
- oidcRoles: state.oidcRoles,
756
- onChangeRole: actions.onChangeRole
757
- }
758
- )
759
- ] }),
760
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { background: "neutral0", hasRadius: true, shadow: "filterShadow", padding: 6, children: [
761
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", paddingBottom: 4, children: [
762
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", tag: "h2", children: formatMessage(index.getTrad("whitelist.title")) }),
763
- /* @__PURE__ */ jsxRuntime.jsx(
764
- CustomSwitch,
765
- {
766
- checked: state.useWhitelist,
767
- onChange: actions.onToggleWhitelist,
768
- label: state.useWhitelist ? formatMessage(index.getTrad("whitelist.toggle.enabled")) : formatMessage(index.getTrad("whitelist.toggle.disabled"))
769
- }
770
- )
771
- ] }),
772
- /* @__PURE__ */ jsxRuntime.jsx(
773
- Whitelist,
774
- {
775
- loading: state.loading,
776
- users: state.users,
777
- useWhitelist: state.useWhitelist,
778
- onSave: actions.onRegisterWhitelist,
779
- onDelete: actions.onDeleteWhitelist,
780
- onDeleteAll: actions.onDeleteAll,
781
- onImport: actions.onImport,
782
- onExport: actions.onExport
783
- }
784
- )
785
- ] }),
786
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { background: "neutral0", hasRadius: true, shadow: "filterShadow", padding: 6, children: [
787
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", tag: "h2", children: formatMessage(index.getTrad("login.settings.title")) }) }),
788
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
789
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 3, wrap: "wrap", children: [
790
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", style: { minWidth: "280px" }, children: formatMessage(index.getTrad("enforce.title")) }),
791
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { minWidth: "160px", children: /* @__PURE__ */ jsxRuntime.jsx(
792
- CustomSwitch,
793
- {
794
- checked: state.enforceOIDC,
795
- onChange: actions.onToggleEnforce,
796
- disabled: state.enforceOIDCConfig !== null || state.useWhitelist && state.users.length === 0,
797
- label: state.enforceOIDC ? formatMessage(index.getTrad("enforce.toggle.enabled")) : formatMessage(index.getTrad("enforce.toggle.disabled"))
798
- }
799
- ) })
800
- ] }),
801
- state.enforceOIDCConfig !== null && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "primary100", padding: 3, hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "center", children: [
802
- /* @__PURE__ */ jsxRuntime.jsx(icons.Information, { fill: "primary600" }),
803
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", children: formatMessage(index.getTrad("enforce.config.info")) })
804
- ] }) }),
805
- state.enforceOIDCConfig === null && state.enforceOIDC && state.enforceOIDC !== state.initialEnforceOIDC && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "danger100", padding: 3, hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "center", children: [
806
- /* @__PURE__ */ jsxRuntime.jsx(icons.WarningCircle, { fill: "danger600" }),
807
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", children: formatMessage(index.getTrad("enforce.warning")) })
808
- ] }) })
809
- ] })
810
- ] }),
811
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsx(
812
- designSystem.Button,
813
- {
814
- size: "L",
815
- onClick: actions.onSaveAll,
816
- disabled: !state.isDirty || state.loading,
817
- loading: state.loading,
818
- children: formatMessage(index.getTrad("page.save"))
819
- }
820
- ) }),
821
- state.auditLogEnabled && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { background: "neutral0", hasRadius: true, shadow: "filterShadow", padding: 6, children: [
822
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", tag: "h2", children: formatMessage(index.getTrad("auditlog.title")) }) }),
823
- /* @__PURE__ */ jsxRuntime.jsx(AuditLog, {})
824
- ] })
825
- ] }) }),
826
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: blocker.state === "blocked", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
827
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { children: formatMessage(index.getTrad("unsaved.title")) }),
828
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Body, { children: formatMessage(index.getTrad("unsaved.description")) }),
829
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { children: [
830
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Cancel, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: () => blocker.reset?.(), children: formatMessage(index.getTrad("unsaved.cancel")) }) }),
831
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Action, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "danger", onClick: () => blocker.proceed?.(), children: formatMessage(index.getTrad("unsaved.confirm")) }) })
832
- ] })
833
- ] }) })
834
- ] });
835
- }
836
- const HomePage = react.memo(HomePage$1);
837
- function App() {
838
- return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Routes, { children: [
839
- /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: /* @__PURE__ */ jsxRuntime.jsx(HomePage, {}) }),
840
- /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "*", element: /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Error, {}) })
841
- ] }) });
842
- }
843
- exports.default = App;