strapi-plugin-magic-sessionmanager 4.8.0 → 4.9.1

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.
Files changed (72) hide show
  1. package/CHANGELOG.md +90 -5
  2. package/README.md +379 -641
  3. package/dist/admin/Analytics-dyJmyxO-.mjs +418 -0
  4. package/dist/admin/Analytics-lVDnHBYp.js +420 -0
  5. package/dist/admin/App-CdgiY_Y7.js +1896 -0
  6. package/dist/admin/App-Cgf_CSjw.mjs +1894 -0
  7. package/dist/admin/License-1XUfQty5.js +443 -0
  8. package/dist/admin/License-C4WSYoqY.mjs +443 -0
  9. package/dist/admin/OnlineUsersWidget-DJC4V1KS.mjs +255 -0
  10. package/dist/admin/OnlineUsersWidget-DMPtuIpm.js +274 -0
  11. package/dist/admin/SectionCard-BlWv8CRt.js +54 -0
  12. package/dist/admin/SectionCard-D51bv4Hi.mjs +55 -0
  13. package/dist/admin/Settings-0QsyY7fe.js +3570 -0
  14. package/dist/admin/Settings-DgeuUiMF.mjs +3568 -0
  15. package/dist/admin/de-BFKoGEVT.js +544 -0
  16. package/dist/admin/de-j0oZH9Pz.mjs +544 -0
  17. package/dist/admin/en-UY4Tb5tE.mjs +544 -0
  18. package/dist/admin/en-s7Ksdkcg.js +544 -0
  19. package/dist/admin/es-07OGMe_5.js +544 -0
  20. package/dist/admin/es-DGBcZwQy.mjs +544 -0
  21. package/dist/admin/fr-B6-DWhGO.mjs +544 -0
  22. package/dist/admin/fr-ETj_2UBY.js +544 -0
  23. package/dist/admin/index-Ck19e8qw.mjs +1760 -0
  24. package/dist/admin/index-D-Nr0TCm.js +1761 -0
  25. package/dist/admin/index.js +1 -1
  26. package/dist/admin/index.mjs +2 -2
  27. package/dist/admin/maskSensitiveValue-BWcSjow7.js +9 -0
  28. package/dist/admin/maskSensitiveValue-lLRhN_S7.mjs +10 -0
  29. package/dist/admin/pt-C7PwrQtV.js +544 -0
  30. package/dist/admin/pt-YMRLm9gx.mjs +544 -0
  31. package/dist/server/index.js +1092 -463
  32. package/dist/server/index.mjs +1092 -463
  33. package/package.json +10 -1
  34. package/pics/analytics.png +0 -0
  35. package/pics/dashboard-dark.png +0 -0
  36. package/pics/dashboard.png +0 -0
  37. package/pics/dashboardsessionmodal.png +0 -0
  38. package/pics/mobile-dashboard.png +0 -0
  39. package/pics/mobile-session.png +0 -0
  40. package/pics/sessioninfopanel.png +0 -0
  41. package/pics/settings1.png +0 -0
  42. package/pics/settings2.png +0 -0
  43. package/pics/widget.png +0 -0
  44. package/scripts/geoip-updater.cjs +35 -24
  45. package/dist/admin/Analytics-CaRlu5ad.js +0 -332
  46. package/dist/admin/Analytics-THqDbNX0.mjs +0 -330
  47. package/dist/admin/App-AbZwLHtF.js +0 -1263
  48. package/dist/admin/App-hSh7guii.mjs +0 -1261
  49. package/dist/admin/FormField-C8kIT2NE.mjs +0 -59
  50. package/dist/admin/FormField-b5KBvkrj.js +0 -60
  51. package/dist/admin/License-BXBVwUVu.mjs +0 -299
  52. package/dist/admin/License-CABdPwnd.js +0 -301
  53. package/dist/admin/OnlineUsersWidget-BnWFj9IM.mjs +0 -230
  54. package/dist/admin/OnlineUsersWidget-CPFAACSb.js +0 -230
  55. package/dist/admin/PluginPageLayout-BPFMcgrx.mjs +0 -42
  56. package/dist/admin/PluginPageLayout-DmNzMdqu.js +0 -43
  57. package/dist/admin/Settings-B4DNdeKx.js +0 -2152
  58. package/dist/admin/Settings-C4RsJosh.mjs +0 -2150
  59. package/dist/admin/de-AwIFTd9i.mjs +0 -450
  60. package/dist/admin/de-D23nmqnl.js +0 -450
  61. package/dist/admin/en-C5iYQ0mC.js +0 -450
  62. package/dist/admin/en-D6QEGeRh.mjs +0 -450
  63. package/dist/admin/es-CIXnsG-p.js +0 -435
  64. package/dist/admin/es-CnFfVdKw.mjs +0 -435
  65. package/dist/admin/fr-BglXE-W4.js +0 -435
  66. package/dist/admin/fr-DefoR7uH.mjs +0 -435
  67. package/dist/admin/index-BFVITQ-o.mjs +0 -624
  68. package/dist/admin/index-DlMm-NyK.js +0 -625
  69. package/dist/admin/maskSensitiveValue-1uGWmrfG.mjs +0 -20
  70. package/dist/admin/maskSensitiveValue-B9vhxPad.js +0 -19
  71. package/dist/admin/pt-J5sf7jiY.js +0 -435
  72. package/dist/admin/pt-TODwvNQA.mjs +0 -435
@@ -0,0 +1,418 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { useState, useRef, useCallback, useEffect } from "react";
3
+ import { useIntl } from "react-intl";
4
+ import { NavLink } from "react-router-dom";
5
+ import { useFetchClient, Page } from "@strapi/strapi/admin";
6
+ import styled from "styled-components";
7
+ import { Typography, Flex, LinkButton, Button, EmptyStateLayout, VisuallyHidden } from "@strapi/design-system";
8
+ import { ArrowClockwise, ChartBubble, User, Clock, Calendar } from "@strapi/icons";
9
+ import { EmptyDocuments } from "@strapi/icons/symbols";
10
+ import { N as normalizeDeviceType, u as useSessionFormatters, m as pluginId, s as requireSessionList, n as logSafeAdminError, o as PersistentAlert, R as ReadableText, z as PageShell, A as StatGrid, B as StatCard, I as EqualGrid, b as getTranslation, O as getDeviceTypeMessage } from "./index-Ck19e8qw.mjs";
11
+ import { S as SectionCard } from "./SectionCard-D51bv4Hi.mjs";
12
+ const ANALYTICS_UNKNOWN_KEY = "unknown";
13
+ function increment(target, key) {
14
+ target[key] = (target[key] || 0) + 1;
15
+ }
16
+ function getUserKey(session) {
17
+ return session?.user?.documentId || session?.user?.id || session?.user?.email || session?.user?.username || null;
18
+ }
19
+ const toTime = (value) => value ? Date.parse(value) : Number.NaN;
20
+ const VERSION_TOKEN = /^v?\d[\w.]*$/i;
21
+ function toNameBucket(value) {
22
+ if (typeof value !== "string") return ANALYTICS_UNKNOWN_KEY;
23
+ const tokens = value.trim().split(/\s+/).filter(Boolean);
24
+ while (tokens.length > 1 && VERSION_TOKEN.test(tokens[tokens.length - 1])) tokens.pop();
25
+ const name = tokens.join(" ");
26
+ if (!name || name.toLowerCase() === ANALYTICS_UNKNOWN_KEY) return ANALYTICS_UNKNOWN_KEY;
27
+ return name;
28
+ }
29
+ function getDeviceBucket(session) {
30
+ return normalizeDeviceType(session?.deviceType) || ANALYTICS_UNKNOWN_KEY;
31
+ }
32
+ function getBrowserBucket(session) {
33
+ return toNameBucket(session?.browserName);
34
+ }
35
+ function getSessionDurationMinutes(session, now = Date.now()) {
36
+ const start = toTime(session?.loginTime);
37
+ if (!Number.isFinite(start)) return null;
38
+ const lastActive = toTime(session?.lastActive);
39
+ const logoutTime = toTime(session?.logoutTime);
40
+ let end;
41
+ if (session?.isActive) {
42
+ end = Number.isFinite(lastActive) ? lastActive : now;
43
+ } else if (Number.isFinite(logoutTime)) {
44
+ end = logoutTime;
45
+ } else {
46
+ end = lastActive;
47
+ }
48
+ if (!Number.isFinite(end)) return null;
49
+ return Math.max(0, Math.floor((end - start) / 6e4));
50
+ }
51
+ function getAnalyticsBarRows(counts) {
52
+ const entries = Object.entries(counts || {}).filter(
53
+ ([, count]) => Number.isFinite(count) && count > 0
54
+ );
55
+ if (entries.length === 0) return [];
56
+ const max = Math.max(...entries.map(([, count]) => count));
57
+ const unknownLast = (key) => key === ANALYTICS_UNKNOWN_KEY ? 1 : 0;
58
+ return entries.sort(
59
+ ([keyA, a], [keyB, b]) => unknownLast(keyA) - unknownLast(keyB) || b - a || keyA.localeCompare(keyB)
60
+ ).map(([key, count]) => ({
61
+ key,
62
+ count,
63
+ percent: Math.max(0, Math.min(100, Math.round(count / max * 100)))
64
+ }));
65
+ }
66
+ function computeSessionAnalytics(sessions = [], { now = Date.now() } = {}) {
67
+ const rows = Array.isArray(sessions) ? sessions : [];
68
+ const dayAgo = now - 24 * 60 * 60 * 1e3;
69
+ const weekAgo = now - 7 * 24 * 60 * 60 * 1e3;
70
+ const devices = {};
71
+ const browsers = {};
72
+ const uniqueUsers = /* @__PURE__ */ new Set();
73
+ const durations = [];
74
+ let activeSessions = 0;
75
+ let idleSessions = 0;
76
+ let endedSessions = 0;
77
+ let signInsLast24Hours = 0;
78
+ let signInsLast7Days = 0;
79
+ for (const session of rows) {
80
+ const loginTime = toTime(session?.loginTime);
81
+ if (Number.isFinite(loginTime)) {
82
+ if (loginTime > dayAgo) signInsLast24Hours++;
83
+ if (loginTime > weekAgo) signInsLast7Days++;
84
+ }
85
+ if (session?.isActive) {
86
+ if (session.isTrulyActive) activeSessions++;
87
+ else idleSessions++;
88
+ } else {
89
+ endedSessions++;
90
+ }
91
+ increment(devices, getDeviceBucket(session));
92
+ increment(browsers, getBrowserBucket(session));
93
+ const userKey = getUserKey(session);
94
+ if (userKey) uniqueUsers.add(userKey);
95
+ const duration = getSessionDurationMinutes(session, now);
96
+ if (duration !== null) durations.push(duration);
97
+ }
98
+ return {
99
+ totalSessions: rows.length,
100
+ activeSessions,
101
+ idleSessions,
102
+ endedSessions,
103
+ signInsLast24Hours,
104
+ signInsLast7Days,
105
+ devices,
106
+ browsers,
107
+ uniqueUsers: uniqueUsers.size,
108
+ avgSessionDuration: durations.length > 0 ? Math.floor(durations.reduce((sum, duration) => sum + duration, 0) / durations.length) : 0
109
+ };
110
+ }
111
+ const BAR_ROW_INLINE_REM = 24;
112
+ const BarList = styled.ul`
113
+ container-type: inline-size;
114
+ list-style: none;
115
+ margin: 0;
116
+ padding: 0;
117
+ display: flex;
118
+ flex-direction: column;
119
+ gap: ${({ theme }) => theme.spaces[3]};
120
+ min-width: 0;
121
+ `;
122
+ const BarRow = styled.li`
123
+ display: grid;
124
+ grid-template-columns: minmax(0, 1fr) 6ch;
125
+ grid-template-areas:
126
+ 'label count'
127
+ 'track track';
128
+ column-gap: ${({ theme }) => theme.spaces[3]};
129
+ row-gap: ${({ theme }) => theme.spaces[1]};
130
+ align-items: center;
131
+ min-width: 0;
132
+
133
+ @container (min-width: ${BAR_ROW_INLINE_REM}rem) {
134
+ grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 6ch;
135
+ grid-template-areas: 'label track count';
136
+ }
137
+
138
+ & > [data-bar-label] {
139
+ grid-area: label;
140
+ min-width: 0;
141
+ overflow-wrap: break-word;
142
+ }
143
+
144
+ & > [data-bar-count] {
145
+ grid-area: count;
146
+ text-align: end;
147
+ font-variant-numeric: tabular-nums;
148
+ }
149
+ `;
150
+ const BarTrack = styled.span`
151
+ grid-area: track;
152
+ display: block;
153
+ height: ${({ theme }) => theme.spaces[2]};
154
+ background: ${({ theme }) => theme.colors.neutral150};
155
+ border-radius: ${({ theme }) => theme.borderRadius};
156
+ overflow: hidden;
157
+ `;
158
+ const BarFill = styled.span`
159
+ display: block;
160
+ height: 100%;
161
+ background: ${({ theme }) => theme.colors.primary600};
162
+ border-radius: inherit;
163
+ `;
164
+ const SESSION_MANAGER_PATH = `/plugins/${pluginId}`;
165
+ const isForbidden = (error) => error?.status === 403 || error?.response?.status === 403;
166
+ const AnalyticsBars = ({ rows, label, getLabel, countLabel, formatCount }) => /* @__PURE__ */ jsx(BarList, { "aria-label": label, children: rows.map((row) => /* @__PURE__ */ jsxs(BarRow, { children: [
167
+ /* @__PURE__ */ jsx(Typography, { "data-bar-label": "", variant: "omega", textColor: "neutral800", tag: "span", children: getLabel(row.key) }),
168
+ /* @__PURE__ */ jsx(BarTrack, { "aria-hidden": "true", children: /* @__PURE__ */ jsx(BarFill, { style: { width: `${row.percent}%` } }) }),
169
+ /* @__PURE__ */ jsxs(
170
+ Typography,
171
+ {
172
+ "data-bar-count": "",
173
+ variant: "omega",
174
+ fontWeight: "semiBold",
175
+ textColor: "neutral800",
176
+ tag: "span",
177
+ children: [
178
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: formatCount(row.count) }),
179
+ /* @__PURE__ */ jsx(VisuallyHidden, { children: countLabel(row.count) })
180
+ ]
181
+ }
182
+ )
183
+ ] }, row.key)) });
184
+ const AnalyticsPage = () => {
185
+ const { formatMessage, formatNumber } = useIntl();
186
+ const { formatDate } = useSessionFormatters();
187
+ const { get } = useFetchClient();
188
+ const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation(id), defaultMessage }, values);
189
+ const translate = (descriptor) => formatMessage({
190
+ id: getTranslation(descriptor.messageId),
191
+ defaultMessage: descriptor.defaultMessage
192
+ });
193
+ const [loading, setLoading] = useState(true);
194
+ const [refreshing, setRefreshing] = useState(false);
195
+ const [analytics, setAnalytics] = useState(null);
196
+ const [truncated, setTruncated] = useState(false);
197
+ const [updatedAt, setUpdatedAt] = useState(null);
198
+ const [loadError, setLoadError] = useState(false);
199
+ const [forbidden, setForbidden] = useState(false);
200
+ const requestPendingRef = useRef(false);
201
+ const fetchAnalytics = useCallback(async () => {
202
+ if (requestPendingRef.current) return;
203
+ requestPendingRef.current = true;
204
+ try {
205
+ const { data } = await get(`/${pluginId}/sessions`);
206
+ const sessions = requireSessionList(data);
207
+ setAnalytics(computeSessionAnalytics(sessions));
208
+ setTruncated(data?.meta?.truncated === true);
209
+ setUpdatedAt(Date.now());
210
+ setLoadError(false);
211
+ } catch (err) {
212
+ logSafeAdminError("analytics.load", err);
213
+ if (isForbidden(err)) setForbidden(true);
214
+ setLoadError(true);
215
+ } finally {
216
+ requestPendingRef.current = false;
217
+ setRefreshing(false);
218
+ setLoading(false);
219
+ }
220
+ }, [get]);
221
+ const handleRefresh = () => {
222
+ if (requestPendingRef.current) return;
223
+ setRefreshing(true);
224
+ void fetchAnalytics();
225
+ };
226
+ useEffect(() => {
227
+ void fetchAnalytics();
228
+ }, [fetchAnalytics]);
229
+ if (loading) {
230
+ return /* @__PURE__ */ jsx(Page.Loading, {});
231
+ }
232
+ if (forbidden) {
233
+ return /* @__PURE__ */ jsx(Page.NoPermissions, {});
234
+ }
235
+ const title = t("analytics.title", "Analytics");
236
+ const totalSessions = Number(analytics?.totalSessions) || 0;
237
+ const subtitle = analytics ? /* @__PURE__ */ jsxs(Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: [
238
+ t(
239
+ "analytics.subtitle",
240
+ "{count, plural, =0 {No sessions are loaded yet.} one {Based on the latest # loaded session.} other {Based on the latest # loaded sessions.}}",
241
+ { count: totalSessions }
242
+ ),
243
+ updatedAt ? /* @__PURE__ */ jsxs(Fragment, { children: [
244
+ " ",
245
+ /* @__PURE__ */ jsx("span", { "aria-live": "polite", "data-analytics-updated": "", children: t("analytics.lastUpdated", "Last updated {time}", {
246
+ time: formatDate(updatedAt, { timeStyle: "short" })
247
+ }) })
248
+ ] }) : null
249
+ ] }) : void 0;
250
+ const headerActions = /* @__PURE__ */ jsxs(Flex, { gap: 2, wrap: "wrap", justifyContent: "flex-end", children: [
251
+ /* @__PURE__ */ jsx(LinkButton, { tag: NavLink, to: SESSION_MANAGER_PATH, variant: "tertiary", children: t("analytics.openSessionManager", "Open Session Manager") }),
252
+ /* @__PURE__ */ jsx(
253
+ Button,
254
+ {
255
+ variant: "secondary",
256
+ startIcon: /* @__PURE__ */ jsx(ArrowClockwise, { "aria-hidden": true }),
257
+ onClick: handleRefresh,
258
+ "aria-busy": refreshing,
259
+ children: t("analytics.refresh", "Refresh")
260
+ }
261
+ )
262
+ ] });
263
+ const errorAlert = loadError ? /* @__PURE__ */ jsx(
264
+ PersistentAlert,
265
+ {
266
+ variant: "danger",
267
+ closeLabel: t("common.close", "Close"),
268
+ action: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: handleRefresh, "aria-busy": refreshing, children: t("analytics.error.retry", "Try again") }),
269
+ children: /* @__PURE__ */ jsx(ReadableText, { variant: "omega", textColor: "neutral800", tag: "span", children: t("analytics.error.title", "Analytics could not be loaded.") })
270
+ }
271
+ ) : null;
272
+ if (!analytics) {
273
+ return /* @__PURE__ */ jsx(
274
+ PageShell,
275
+ {
276
+ headingId: "magic-sessionmanager-analytics-title",
277
+ title,
278
+ primaryAction: headerActions,
279
+ children: errorAlert
280
+ }
281
+ );
282
+ }
283
+ const hasSessions = totalSessions > 0;
284
+ const deviceRows = getAnalyticsBarRows(analytics.devices);
285
+ const browserRows = getAnalyticsBarRows(analytics.browsers);
286
+ const devicesTitle = t("analytics.devices.title", "Devices");
287
+ const browsersTitle = t("analytics.browsers.title", "Browsers");
288
+ const unknownLabel = t("analytics.bucket.unknown", "Unknown");
289
+ const countLabel = (count) => t("analytics.bar.sessions", "{count, plural, one {# session} other {# sessions}}", { count });
290
+ const deviceLabel = (key) => key === ANALYTICS_UNKNOWN_KEY ? unknownLabel : translate(getDeviceTypeMessage(key));
291
+ const browserLabel = (key) => key === ANALYTICS_UNKNOWN_KEY ? unknownLabel : key;
292
+ return /* @__PURE__ */ jsxs(
293
+ PageShell,
294
+ {
295
+ headingId: "magic-sessionmanager-analytics-title",
296
+ title,
297
+ subtitle,
298
+ primaryAction: headerActions,
299
+ children: [
300
+ errorAlert,
301
+ truncated ? /* @__PURE__ */ jsx(PersistentAlert, { variant: "default", closeLabel: t("common.close", "Close"), children: /* @__PURE__ */ jsx(ReadableText, { variant: "omega", textColor: "neutral800", tag: "span", children: t(
302
+ "analytics.truncated",
303
+ "Only the latest {count, number} sessions are loaded. Counts, filters and exports cover these sessions only.",
304
+ { count: totalSessions }
305
+ ) }) }) : null,
306
+ hasSessions ? /* @__PURE__ */ jsxs(Fragment, { children: [
307
+ /* @__PURE__ */ jsxs(StatGrid, { label: t("analytics.stats.label", "Session overview"), alignValues: true, children: [
308
+ /* @__PURE__ */ jsx(
309
+ StatCard,
310
+ {
311
+ icon: ChartBubble,
312
+ tone: "primary",
313
+ label: t("analytics.stats.total", "All sessions"),
314
+ value: formatNumber(analytics.totalSessions)
315
+ }
316
+ ),
317
+ /* @__PURE__ */ jsx(
318
+ StatCard,
319
+ {
320
+ icon: User,
321
+ tone: "success",
322
+ label: t("analytics.stats.active", "Active sessions"),
323
+ value: formatNumber(analytics.activeSessions)
324
+ }
325
+ ),
326
+ /* @__PURE__ */ jsx(
327
+ StatCard,
328
+ {
329
+ icon: Clock,
330
+ tone: "primary",
331
+ label: t("analytics.stats.last24Hours", "Sign-ins in the last 24 hours"),
332
+ value: formatNumber(analytics.signInsLast24Hours)
333
+ }
334
+ ),
335
+ /* @__PURE__ */ jsx(
336
+ StatCard,
337
+ {
338
+ icon: Calendar,
339
+ tone: "primary",
340
+ label: t("analytics.stats.last7Days", "Sign-ins in the last 7 days"),
341
+ value: formatNumber(analytics.signInsLast7Days)
342
+ }
343
+ )
344
+ ] }),
345
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
346
+ /* @__PURE__ */ jsxs(EqualGrid, { columns: 2, stackBelow: "medium", children: [
347
+ /* @__PURE__ */ jsx(
348
+ SectionCard,
349
+ {
350
+ fill: true,
351
+ title: devicesTitle,
352
+ subtitle: t("analytics.devices.subtitle", "Sessions by device type"),
353
+ children: /* @__PURE__ */ jsx(
354
+ AnalyticsBars,
355
+ {
356
+ rows: deviceRows,
357
+ label: devicesTitle,
358
+ getLabel: deviceLabel,
359
+ countLabel,
360
+ formatCount: formatNumber
361
+ }
362
+ )
363
+ }
364
+ ),
365
+ /* @__PURE__ */ jsx(
366
+ SectionCard,
367
+ {
368
+ fill: true,
369
+ title: browsersTitle,
370
+ subtitle: t("analytics.browsers.subtitle", "Sessions by browser"),
371
+ children: /* @__PURE__ */ jsx(
372
+ AnalyticsBars,
373
+ {
374
+ rows: browserRows,
375
+ label: browsersTitle,
376
+ getLabel: browserLabel,
377
+ countLabel,
378
+ formatCount: formatNumber
379
+ }
380
+ )
381
+ }
382
+ )
383
+ ] }),
384
+ /* @__PURE__ */ jsx(ReadableText, { variant: "pi", textColor: "neutral600", tag: "p", children: t(
385
+ "analytics.detection.note",
386
+ `Detected from the browser's user agent. Sessions without a user agent, for example Strapi sessions, appear as "Unknown".`
387
+ ) })
388
+ ] }),
389
+ /* @__PURE__ */ jsx(
390
+ SectionCard,
391
+ {
392
+ title: t("analytics.duration.title", "Average session length"),
393
+ subtitle: t(
394
+ "analytics.duration.description",
395
+ "From sign-in to the end of the session, or to its last activity while it is still open. Sessions that timed out include the unused time before they were closed."
396
+ ),
397
+ children: /* @__PURE__ */ jsx(Typography, { variant: "alpha", textColor: "neutral800", tag: "p", children: t("analytics.duration.minutes", "{count} min", {
398
+ count: formatNumber(analytics.avgSessionDuration)
399
+ }) })
400
+ }
401
+ )
402
+ ] }) : /* @__PURE__ */ jsx(
403
+ EmptyStateLayout,
404
+ {
405
+ icon: /* @__PURE__ */ jsx(EmptyDocuments, { width: "16rem", height: "8.8rem", "aria-hidden": "true" }),
406
+ content: t(
407
+ "analytics.empty",
408
+ "No sessions to analyse yet. Analytics appear after the first sign-ins."
409
+ )
410
+ }
411
+ )
412
+ ]
413
+ }
414
+ );
415
+ };
416
+ export {
417
+ AnalyticsPage as default
418
+ };