@nice2dev/ui-enterprise 1.3.7 → 1.3.8

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 (3) hide show
  1. package/dist/index.cjs +3 -3
  2. package/dist/index.mjs +1126 -1085
  3. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { jsxs as c, jsx as e, Fragment as ie } from "react/jsx-runtime";
2
- import { NtdClipboard as tc, NtdFile as ac, NtdBrackets as Ye, NtdBarChart as ic, NtdFileText as Ee, NtdList as sc, NtdGrid as nc, NtdSearch as fe, NtdDownload as ye, NtdChevronDown as Le, NtdChevronRight as qe, NtdCircle as ze, NtdSettings as Ve, NtdKey as xe, NtdLogOut as Be, NtdLogIn as lc, NtdError as ge, NtdCheck as re, NtdUpload as rc, NtdEye as oc, NtdClose as we, NtdEdit as He, NtdPlus as Ae, NtdArrowRight as dc, NtdBook as hc, NtdClock as _e, NtdArrowUp as pc, NtdArrowDown as uc, NtdLock as Je, NtdOctagon as mc, NtdDollar as gc, NtdWarning as Ke, NtdCookieConsent as bc, NtdArrowLeft as vc, NtdTrash as Nc, NtdLightning as Ge, NtdHelp as We, NtdFolder as fc, NtdUser as Xe, NtdRefresh as Se, NtdMinus as yc, NtdTable as wc, NtdCalendar as kc, NtdMap as $e, NtdShield as Ze, NtdSlash as Cc, NtdFlag as xc, NtdUnlock as Sc, NtdSmartphone as De, NtdMonitor as Dc } from "@nice2dev/icons";
3
- import { useNiceTranslation as Q, clickOnActivationKey as Ie, NiceAppShell as Tc, NiceTutorialButton as Ec, resolveTutorial as Lc, useOverlayFocus as Qe, useIntent as zc, NiceKeyCap as ke } from "@nice2dev/ui";
4
- import Ac, { forwardRef as he, useState as C, useCallback as P, useImperativeHandle as pe, useEffect as Ne, useRef as oe, useId as ec, useMemo as ve } from "react";
5
- function _c(t, n, s) {
1
+ import { jsxs as c, jsx as e, Fragment as ne } from "react/jsx-runtime";
2
+ import { NtdClipboard as ic, NtdFile as sc, NtdBrackets as Ve, NtdBarChart as nc, NtdFileText as ze, NtdList as lc, NtdGrid as rc, NtdSearch as we, NtdDownload as ke, NtdChevronDown as Ae, NtdChevronRight as Be, NtdCircle as _e, NtdSettings as He, NtdKey as De, NtdLogOut as Je, NtdLogIn as oc, NtdError as ve, NtdCheck as de, NtdUpload as dc, NtdEye as hc, NtdClose as Ce, NtdEdit as Ke, NtdPlus as Ie, NtdArrowRight as pc, NtdBook as uc, NtdClock as Pe, NtdArrowUp as mc, NtdArrowDown as gc, NtdLock as Ge, NtdOctagon as bc, NtdDollar as vc, NtdWarning as We, NtdCookieConsent as Nc, NtdArrowLeft as fc, NtdTrash as yc, NtdLightning as Xe, NtdHelp as Ze, NtdFolder as wc, NtdUser as Qe, NtdRefresh as Te, NtdMinus as kc, NtdTable as Cc, NtdCalendar as xc, NtdMap as Me, NtdShield as ec, NtdSlash as Sc, NtdFlag as Dc, NtdUnlock as Tc, NtdSmartphone as Ee, NtdMonitor as Ec } from "@nice2dev/icons";
3
+ import { useNiceTranslation as ee, clickOnActivationKey as Oe, NiceAppShell as Lc, NiceTutorialButton as zc, resolveTutorial as Ac, useOverlayFocus as cc, useIntent as _c, NiceKeyCap as xe } from "@nice2dev/ui";
4
+ import Ic, { forwardRef as ue, useState as C, useCallback as I, useImperativeHandle as me, useEffect as ye, useRef as he, useId as tc, useMemo as fe } from "react";
5
+ function Pc(t, n, s) {
6
6
  const i = s.csvDelimiter || ",", a = [];
7
7
  return s.includeHeaders !== !1 && a.push(
8
8
  n.filter((l) => l.include).map((l) => `"${l.label}"`).join(i)
@@ -15,7 +15,7 @@ function _c(t, n, s) {
15
15
  }), a.join(`
16
16
  `);
17
17
  }
18
- function Ic(t, n, s) {
18
+ function Oc(t, n, s) {
19
19
  const i = n.filter((l) => l.include), a = t.map((l) => {
20
20
  const h = {};
21
21
  return i.forEach((r) => {
@@ -25,22 +25,22 @@ function Ic(t, n, s) {
25
25
  });
26
26
  return JSON.stringify(a, null, 2);
27
27
  }
28
- const Te = {
29
- csv: { label: "CSV", icon: /* @__PURE__ */ e(Ee, { size: 20 }), description: "Comma-separated values" },
30
- xlsx: { label: "Excel", icon: /* @__PURE__ */ e(ic, { size: 20 }), description: "Microsoft Excel" },
28
+ const Le = {
29
+ csv: { label: "CSV", icon: /* @__PURE__ */ e(ze, { size: 20 }), description: "Comma-separated values" },
30
+ xlsx: { label: "Excel", icon: /* @__PURE__ */ e(nc, { size: 20 }), description: "Microsoft Excel" },
31
31
  json: {
32
32
  label: "JSON",
33
- icon: /* @__PURE__ */ e(Ye, { size: 20 }),
33
+ icon: /* @__PURE__ */ e(Ve, { size: 20 }),
34
34
  description: "JavaScript Object Notation"
35
35
  },
36
- pdf: { label: "PDF", icon: /* @__PURE__ */ e(ac, { size: 20 }), description: "Portable Document Format" },
36
+ pdf: { label: "PDF", icon: /* @__PURE__ */ e(sc, { size: 20 }), description: "Portable Document Format" },
37
37
  xml: {
38
38
  label: "XML",
39
- icon: /* @__PURE__ */ e(tc, { size: 20 }),
39
+ icon: /* @__PURE__ */ e(ic, { size: 20 }),
40
40
  description: "Extensible Markup Language"
41
41
  }
42
- }, Pc = ({ formats: t, selected: n, onChange: s }) => /* @__PURE__ */ e("div", { className: "nice-export-formats", children: t.map((i) => {
43
- const a = Te[i];
42
+ }, Fc = ({ formats: t, selected: n, onChange: s }) => /* @__PURE__ */ e("div", { className: "nice-export-formats", children: t.map((i) => {
43
+ const a = Le[i];
44
44
  return /* @__PURE__ */ c(
45
45
  "button",
46
46
  {
@@ -55,8 +55,8 @@ const Te = {
55
55
  },
56
56
  i
57
57
  );
58
- }) }), Oc = ({ fields: t, onChange: n }) => {
59
- const { t: s } = Q(), i = (h) => {
58
+ }) }), $c = ({ fields: t, onChange: n }) => {
59
+ const { t: s } = ee(), i = (h) => {
60
60
  const r = [...t];
61
61
  r[h] = { ...r[h], include: !r[h].include }, n(r);
62
62
  }, a = (h) => {
@@ -76,8 +76,8 @@ const Te = {
76
76
  /* @__PURE__ */ e("span", { className: "nice-export-field-name", children: h.field })
77
77
  ] }, h.field)) })
78
78
  ] });
79
- }, Fc = ({ format: t, options: n, onChange: s }) => {
80
- const { t: i } = Q(), a = (l, h) => {
79
+ }, Rc = ({ format: t, options: n, onChange: s }) => {
80
+ const { t: i } = ee(), a = (l, h) => {
81
81
  s({ ...n, [l]: h });
82
82
  };
83
83
  return /* @__PURE__ */ c("div", { className: "nice-export-options", children: [
@@ -156,8 +156,8 @@ const Te = {
156
156
  )
157
157
  ] })
158
158
  ] });
159
- }, $c = ({ jobs: t, onDownload: n }) => {
160
- const { t: s } = Q();
159
+ }, Mc = ({ jobs: t, onDownload: n }) => {
160
+ const { t: s } = ee();
161
161
  if (t.length === 0)
162
162
  return /* @__PURE__ */ e("div", { className: "nice-export-history-empty", children: s("dataExportCenter.noExportHistory", "No export history") });
163
163
  const i = (a) => a ? a < 1024 ? `${a} B` : a < 1024 * 1024 ? `${(a / 1024).toFixed(1)} KB` : `${(a / 1024 / 1024).toFixed(1)} MB` : "-";
@@ -197,8 +197,8 @@ const Te = {
197
197
  ] })
198
198
  ] }, a.id)) })
199
199
  ] });
200
- }, ht = /* @__PURE__ */ Object.assign(
201
- /* @__PURE__ */ he(
200
+ }, ut = /* @__PURE__ */ Object.assign(
201
+ /* @__PURE__ */ ue(
202
202
  ({
203
203
  dataSource: t,
204
204
  formats: n = ["csv", "xlsx", "json", "pdf"],
@@ -210,60 +210,62 @@ const Te = {
210
210
  onExportError: r,
211
211
  onSaveTemplate: o,
212
212
  onDeleteTemplate: f,
213
- onSchedule: D,
214
- customExportHandler: O,
213
+ onSchedule: T,
214
+ customExportHandler: P,
215
215
  title: w,
216
216
  description: z,
217
- className: M = "",
218
- style: K
219
- }, E) => {
220
- const { t: _ } = Q(), te = w ?? _("dataExportCenter.title", "Data Export"), [j, G] = C(n[0]), [I, m] = C(t.getFields()), [b, g] = C({
217
+ className: ie = "",
218
+ style: J,
219
+ testId: D,
220
+ "data-testid": K
221
+ }, G) => {
222
+ const { t: R } = ee(), ae = w ?? R("dataExportCenter.title", "Data Export"), [q, W] = C(n[0]), [_, m] = C(t.getFields()), [b, g] = C({
221
223
  includeHeaders: !0,
222
224
  dateFormat: "YYYY-MM-DD",
223
225
  encoding: "utf-8"
224
- }), [W, u] = C(!1), [B, F] = C(0), [$, T] = C("export"), X = P(async () => {
226
+ }), [X, u] = C(!1), [V, O] = C(0), [F, E] = C("export"), Z = I(async () => {
225
227
  const N = {
226
228
  id: Date.now().toString(),
227
229
  name: `Export ${(/* @__PURE__ */ new Date()).toISOString()}`,
228
- format: j,
230
+ format: q,
229
231
  status: "processing",
230
232
  progress: 0,
231
233
  createdAt: /* @__PURE__ */ new Date()
232
234
  };
233
- u(!0), F(0), l == null || l(N);
235
+ u(!0), O(0), l == null || l(N);
234
236
  try {
235
237
  const k = await t.fetchData({
236
- fields: I,
238
+ fields: _,
237
239
  filters: void 0,
238
240
  sorting: void 0
239
241
  });
240
- F(50);
242
+ O(50);
241
243
  let A;
242
- if (O)
243
- A = await O(j, k, b);
244
+ if (P)
245
+ A = await P(q, k, b);
244
246
  else
245
- switch (j) {
247
+ switch (q) {
246
248
  case "csv":
247
- A = _c(k, I, b);
249
+ A = Pc(k, _, b);
248
250
  break;
249
251
  case "json":
250
- A = Ic(k, I, b);
252
+ A = Oc(k, _, b);
251
253
  break;
252
254
  default:
253
- throw new Error(`Format ${j} requires a custom export handler`);
255
+ throw new Error(`Format ${q} requires a custom export handler`);
254
256
  }
255
- F(100);
256
- const Z = typeof A == "string" ? new Blob([A], { type: "text/plain" }) : A, Y = URL.createObjectURL(Z), y = document.createElement("a");
257
- y.href = Y, y.download = `export-${Date.now()}.${j}`, document.body.appendChild(y), y.click(), document.body.removeChild(y), URL.revokeObjectURL(Y);
258
- const R = {
257
+ O(100);
258
+ const Q = typeof A == "string" ? new Blob([A], { type: "text/plain" }) : A, j = URL.createObjectURL(Q), y = document.createElement("a");
259
+ y.href = j, y.download = `export-${Date.now()}.${q}`, document.body.appendChild(y), y.click(), document.body.removeChild(y), URL.revokeObjectURL(j);
260
+ const $ = {
259
261
  ...N,
260
262
  status: "completed",
261
263
  progress: 100,
262
264
  completedAt: /* @__PURE__ */ new Date(),
263
265
  rowCount: k.length,
264
- fileSize: Z.size
266
+ fileSize: Q.size
265
267
  };
266
- h == null || h(R);
268
+ h == null || h($);
267
269
  } catch (k) {
268
270
  const A = {
269
271
  ...N,
@@ -272,217 +274,225 @@ const Te = {
272
274
  };
273
275
  r == null || r(A, k instanceof Error ? k : new Error("Export failed"));
274
276
  } finally {
275
- u(!1), F(0);
277
+ u(!1), O(0);
276
278
  }
277
279
  }, [
278
- j,
279
- I,
280
+ q,
281
+ _,
280
282
  b,
281
283
  t,
282
- O,
284
+ P,
283
285
  l,
284
286
  h,
285
287
  r
286
- ]), H = P(
288
+ ]), B = I(
287
289
  (N) => {
288
290
  const k = s.find((A) => A.id === N);
289
- k && (G(k.format), m(k.fields), k.options && g(k.options));
291
+ k && (W(k.format), m(k.fields), k.options && g(k.options));
290
292
  },
291
293
  [s]
292
294
  );
293
- return pe(E, () => ({
295
+ return me(G, () => ({
294
296
  exportNow: async (N) => {
295
- G(N), await X();
297
+ W(N), await Z();
296
298
  },
297
- getSelectedFields: () => I,
298
- loadTemplate: H
299
- })), /* @__PURE__ */ c("div", { className: `nice-export-center ${M}`, style: K, children: [
300
- /* @__PURE__ */ e("div", { className: "nice-export-header", children: /* @__PURE__ */ c("div", { className: "nice-export-title-area", children: [
301
- /* @__PURE__ */ e("h3", { className: "nice-export-title", children: te }),
302
- z && /* @__PURE__ */ e("p", { className: "nice-export-description", children: z })
303
- ] }) }),
304
- /* @__PURE__ */ c("div", { className: "nice-export-tabs", children: [
305
- /* @__PURE__ */ e(
306
- "button",
307
- {
308
- type: "button",
309
- className: `nice-export-tab ${$ === "export" ? "nice-export-tab--active" : ""}`,
310
- onClick: () => T("export"),
311
- children: _("dataExportCenter.export", "Export")
312
- }
313
- ),
314
- s.length > 0 && /* @__PURE__ */ e(
315
- "button",
316
- {
317
- type: "button",
318
- className: `nice-export-tab ${$ === "templates" ? "nice-export-tab--active" : ""}`,
319
- onClick: () => T("templates"),
320
- children: _("dataExportCenter.templates", "Templates ({templates})").replace(
321
- "{templates}",
322
- String(s.length)
323
- )
324
- }
325
- ),
326
- a.length > 0 && /* @__PURE__ */ e(
327
- "button",
328
- {
329
- type: "button",
330
- className: `nice-export-tab ${$ === "history" ? "nice-export-tab--active" : ""}`,
331
- onClick: () => T("history"),
332
- children: _("dataExportCenter.history", "History")
333
- }
334
- )
335
- ] }),
336
- /* @__PURE__ */ c("div", { className: "nice-export-content", children: [
337
- $ === "export" && /* @__PURE__ */ c(ie, { children: [
338
- /* @__PURE__ */ e(
339
- Pc,
340
- {
341
- formats: n,
342
- selected: j,
343
- onChange: G
344
- }
345
- ),
346
- /* @__PURE__ */ e(Oc, { fields: I, onChange: m }),
347
- /* @__PURE__ */ e(Fc, { format: j, options: b, onChange: g }),
348
- /* @__PURE__ */ c("div", { className: "nice-export-actions", children: [
299
+ getSelectedFields: () => _,
300
+ loadTemplate: B
301
+ })), /* @__PURE__ */ c(
302
+ "div",
303
+ {
304
+ className: `nice-export-center ${ie}`,
305
+ style: J,
306
+ "data-testid": K ?? D,
307
+ children: [
308
+ /* @__PURE__ */ e("div", { className: "nice-export-header", children: /* @__PURE__ */ c("div", { className: "nice-export-title-area", children: [
309
+ /* @__PURE__ */ e("h3", { className: "nice-export-title", children: ae }),
310
+ z && /* @__PURE__ */ e("p", { className: "nice-export-description", children: z })
311
+ ] }) }),
312
+ /* @__PURE__ */ c("div", { className: "nice-export-tabs", children: [
349
313
  /* @__PURE__ */ e(
350
314
  "button",
351
315
  {
352
316
  type: "button",
353
- className: "nice-export-btn nice-export-btn--primary",
354
- onClick: X,
355
- disabled: W || I.filter((N) => N.include).length === 0,
356
- children: W ? _("dataExportCenter.exporting", "Exporting... {progress}%").replace(
357
- "{progress}",
358
- String(B)
359
- ) : _("dataExportCenter.exportNow", "Export Now")
317
+ className: `nice-export-tab ${F === "export" ? "nice-export-tab--active" : ""}`,
318
+ onClick: () => E("export"),
319
+ children: R("dataExportCenter.export", "Export")
360
320
  }
361
321
  ),
362
- o && /* @__PURE__ */ e(
322
+ s.length > 0 && /* @__PURE__ */ e(
363
323
  "button",
364
324
  {
365
325
  type: "button",
366
- className: "nice-export-btn nice-export-btn--secondary",
367
- onClick: () => o({
368
- id: Date.now().toString(),
369
- name: `Template ${s.length + 1}`,
370
- format: j,
371
- fields: I,
372
- options: b
373
- }),
374
- children: _("dataExportCenter.saveAsTemplate", "Save as Template")
326
+ className: `nice-export-tab ${F === "templates" ? "nice-export-tab--active" : ""}`,
327
+ onClick: () => E("templates"),
328
+ children: R("dataExportCenter.templates", "Templates ({templates})").replace(
329
+ "{templates}",
330
+ String(s.length)
331
+ )
375
332
  }
376
- )
377
- ] })
378
- ] }),
379
- $ === "templates" && /* @__PURE__ */ e("div", { className: "nice-export-templates", children: s.map((N) => /* @__PURE__ */ c("div", { className: "nice-export-template", children: [
380
- /* @__PURE__ */ c("div", { className: "nice-export-template-info", children: [
381
- /* @__PURE__ */ e("span", { className: "nice-export-template-name", children: N.name }),
382
- /* @__PURE__ */ c("span", { className: "nice-export-template-format", children: [
383
- Te[N.format].icon,
384
- " ",
385
- Te[N.format].label
386
- ] }),
387
- N.description && /* @__PURE__ */ e("span", { className: "nice-export-template-desc", children: N.description })
388
- ] }),
389
- /* @__PURE__ */ c("div", { className: "nice-export-template-actions", children: [
390
- /* @__PURE__ */ e(
333
+ ),
334
+ a.length > 0 && /* @__PURE__ */ e(
391
335
  "button",
392
336
  {
393
337
  type: "button",
394
- onClick: () => {
395
- H(N.id), T("export");
396
- },
397
- children: _("dataExportCenter.use", "Use")
338
+ className: `nice-export-tab ${F === "history" ? "nice-export-tab--active" : ""}`,
339
+ onClick: () => E("history"),
340
+ children: R("dataExportCenter.history", "History")
398
341
  }
399
- ),
400
- f && /* @__PURE__ */ e("button", { type: "button", onClick: () => f(N.id), children: _("dataExportCenter.delete", "Delete") })
342
+ )
343
+ ] }),
344
+ /* @__PURE__ */ c("div", { className: "nice-export-content", children: [
345
+ F === "export" && /* @__PURE__ */ c(ne, { children: [
346
+ /* @__PURE__ */ e(
347
+ Fc,
348
+ {
349
+ formats: n,
350
+ selected: q,
351
+ onChange: W
352
+ }
353
+ ),
354
+ /* @__PURE__ */ e($c, { fields: _, onChange: m }),
355
+ /* @__PURE__ */ e(Rc, { format: q, options: b, onChange: g }),
356
+ /* @__PURE__ */ c("div", { className: "nice-export-actions", children: [
357
+ /* @__PURE__ */ e(
358
+ "button",
359
+ {
360
+ type: "button",
361
+ className: "nice-export-btn nice-export-btn--primary",
362
+ onClick: Z,
363
+ disabled: X || _.filter((N) => N.include).length === 0,
364
+ children: X ? R("dataExportCenter.exporting", "Exporting... {progress}%").replace(
365
+ "{progress}",
366
+ String(V)
367
+ ) : R("dataExportCenter.exportNow", "Export Now")
368
+ }
369
+ ),
370
+ o && /* @__PURE__ */ e(
371
+ "button",
372
+ {
373
+ type: "button",
374
+ className: "nice-export-btn nice-export-btn--secondary",
375
+ onClick: () => o({
376
+ id: Date.now().toString(),
377
+ name: `Template ${s.length + 1}`,
378
+ format: q,
379
+ fields: _,
380
+ options: b
381
+ }),
382
+ children: R("dataExportCenter.saveAsTemplate", "Save as Template")
383
+ }
384
+ )
385
+ ] })
386
+ ] }),
387
+ F === "templates" && /* @__PURE__ */ e("div", { className: "nice-export-templates", children: s.map((N) => /* @__PURE__ */ c("div", { className: "nice-export-template", children: [
388
+ /* @__PURE__ */ c("div", { className: "nice-export-template-info", children: [
389
+ /* @__PURE__ */ e("span", { className: "nice-export-template-name", children: N.name }),
390
+ /* @__PURE__ */ c("span", { className: "nice-export-template-format", children: [
391
+ Le[N.format].icon,
392
+ " ",
393
+ Le[N.format].label
394
+ ] }),
395
+ N.description && /* @__PURE__ */ e("span", { className: "nice-export-template-desc", children: N.description })
396
+ ] }),
397
+ /* @__PURE__ */ c("div", { className: "nice-export-template-actions", children: [
398
+ /* @__PURE__ */ e(
399
+ "button",
400
+ {
401
+ type: "button",
402
+ onClick: () => {
403
+ B(N.id), E("export");
404
+ },
405
+ children: R("dataExportCenter.use", "Use")
406
+ }
407
+ ),
408
+ f && /* @__PURE__ */ e("button", { type: "button", onClick: () => f(N.id), children: R("dataExportCenter.delete", "Delete") })
409
+ ] })
410
+ ] }, N.id)) }),
411
+ F === "history" && /* @__PURE__ */ e(
412
+ Mc,
413
+ {
414
+ jobs: a,
415
+ onDownload: (N) => {
416
+ N.downloadUrl && window.open(N.downloadUrl, "_blank");
417
+ }
418
+ }
419
+ )
401
420
  ] })
402
- ] }, N.id)) }),
403
- $ === "history" && /* @__PURE__ */ e(
404
- $c,
405
- {
406
- jobs: a,
407
- onDownload: (N) => {
408
- N.downloadUrl && window.open(N.downloadUrl, "_blank");
409
- }
410
- }
411
- )
412
- ] })
413
- ] });
421
+ ]
422
+ }
423
+ );
414
424
  }
415
425
  ),
416
426
  { displayName: "NiceDataExportCenter" }
417
- ), de = {
427
+ ), pe = {
418
428
  create: {
419
- icon: /* @__PURE__ */ e(Ae, { size: 16 }),
429
+ icon: /* @__PURE__ */ e(Ie, { size: 16 }),
420
430
  label: "Created",
421
431
  color: "var(--nice-color-success, #10b981)"
422
432
  },
423
433
  update: {
424
- icon: /* @__PURE__ */ e(He, { size: 16 }),
434
+ icon: /* @__PURE__ */ e(Ke, { size: 16 }),
425
435
  label: "Updated",
426
436
  color: "var(--nice-color-primary, #3b82f6)"
427
437
  },
428
438
  delete: {
429
- icon: /* @__PURE__ */ e(we, { size: 16 }),
439
+ icon: /* @__PURE__ */ e(Ce, { size: 16 }),
430
440
  label: "Deleted",
431
441
  color: "var(--nice-color-error, #ef4444)"
432
442
  },
433
- view: { icon: /* @__PURE__ */ e(oc, { size: 16 }), label: "Viewed", color: "var(--nice-text-muted, #6b7280)" },
443
+ view: { icon: /* @__PURE__ */ e(hc, { size: 16 }), label: "Viewed", color: "var(--nice-text-muted, #6b7280)" },
434
444
  export: {
435
- icon: /* @__PURE__ */ e(ye, { size: 16 }),
445
+ icon: /* @__PURE__ */ e(ke, { size: 16 }),
436
446
  label: "Exported",
437
447
  color: "var(--nice-color-accent, #8b5cf6)"
438
448
  },
439
449
  import: {
440
- icon: /* @__PURE__ */ e(rc, { size: 16 }),
450
+ icon: /* @__PURE__ */ e(dc, { size: 16 }),
441
451
  label: "Imported",
442
452
  color: "var(--nice-color-accent, #8b5cf6)"
443
453
  },
444
454
  approve: {
445
- icon: /* @__PURE__ */ e(re, { size: 16 }),
455
+ icon: /* @__PURE__ */ e(de, { size: 16 }),
446
456
  label: "Approved",
447
457
  color: "var(--nice-color-success, #10b981)"
448
458
  },
449
459
  reject: {
450
- icon: /* @__PURE__ */ e(ge, { size: 16 }),
460
+ icon: /* @__PURE__ */ e(ve, { size: 16 }),
451
461
  label: "Rejected",
452
462
  color: "var(--nice-color-error, #ef4444)"
453
463
  },
454
464
  login: {
455
- icon: /* @__PURE__ */ e(lc, { size: 16 }),
465
+ icon: /* @__PURE__ */ e(oc, { size: 16 }),
456
466
  label: "Login",
457
467
  color: "var(--nice-color-success, #10b981)"
458
468
  },
459
469
  logout: {
460
- icon: /* @__PURE__ */ e(Be, { size: 16 }),
470
+ icon: /* @__PURE__ */ e(Je, { size: 16 }),
461
471
  label: "Logout",
462
472
  color: "var(--nice-text-muted, #6b7280)"
463
473
  },
464
474
  permission_change: {
465
- icon: /* @__PURE__ */ e(xe, { size: 16 }),
475
+ icon: /* @__PURE__ */ e(De, { size: 16 }),
466
476
  label: "Permissions",
467
477
  color: "var(--nice-color-warning, #f59e0b)"
468
478
  },
469
479
  config_change: {
470
- icon: /* @__PURE__ */ e(Ve, { size: 16 }),
480
+ icon: /* @__PURE__ */ e(He, { size: 16 }),
471
481
  label: "Config",
472
482
  color: "var(--nice-color-warning, #f59e0b)"
473
483
  },
474
484
  custom: {
475
- icon: /* @__PURE__ */ e(ze, { size: 16 }),
485
+ icon: /* @__PURE__ */ e(_e, { size: 16 }),
476
486
  label: "Action",
477
487
  color: "var(--nice-text-muted, #6b7280)"
478
488
  }
479
- }, Rc = ({
489
+ }, jc = ({
480
490
  filter: t,
481
491
  onChange: n,
482
492
  availableFilters: s
483
493
  }) => {
484
494
  var l, h;
485
- const { t: i } = Q(), a = (r, o) => {
495
+ const { t: i } = ee(), a = (r, o) => {
486
496
  n({ ...t, [r]: o });
487
497
  };
488
498
  return /* @__PURE__ */ c("div", { className: "nice-audit-filters", children: [
@@ -510,9 +520,9 @@ const Te = {
510
520
  ] }),
511
521
  /* @__PURE__ */ c("div", { className: "nice-audit-filter-group", children: [
512
522
  /* @__PURE__ */ e("label", { children: i("auditTrail.actions", "Actions") }),
513
- /* @__PURE__ */ e("div", { className: "nice-audit-action-chips", children: Object.keys(de).slice(0, 8).map((r) => {
514
- var D;
515
- const o = de[r], f = (D = t.actions) == null ? void 0 : D.includes(r);
523
+ /* @__PURE__ */ e("div", { className: "nice-audit-action-chips", children: Object.keys(pe).slice(0, 8).map((r) => {
524
+ var T;
525
+ const o = pe[r], f = (T = t.actions) == null ? void 0 : T.includes(r);
516
526
  return /* @__PURE__ */ c(
517
527
  "button",
518
528
  {
@@ -520,10 +530,10 @@ const Te = {
520
530
  className: `nice-audit-chip ${f ? "nice-audit-chip--selected" : ""}`,
521
531
  style: { "--chip-color": o.color },
522
532
  onClick: () => {
523
- const O = t.actions || [];
533
+ const P = t.actions || [];
524
534
  a(
525
535
  "actions",
526
- f ? O.filter((w) => w !== r) : [...O, r]
536
+ f ? P.filter((w) => w !== r) : [...P, r]
527
537
  );
528
538
  },
529
539
  children: [
@@ -549,7 +559,7 @@ const Te = {
549
559
  )
550
560
  ] })
551
561
  ] });
552
- }, Mc = ({ changes: t }) => {
562
+ }, Uc = ({ changes: t }) => {
553
563
  if (!t.length)
554
564
  return null;
555
565
  const n = (s, i) => i || (s == null ? "(empty)" : typeof s == "object" ? JSON.stringify(s, null, 2) : String(s));
@@ -557,22 +567,22 @@ const Te = {
557
567
  /* @__PURE__ */ e("span", { className: "nice-audit-diff-field", children: s.field }),
558
568
  /* @__PURE__ */ c("div", { className: "nice-audit-diff-values", children: [
559
569
  /* @__PURE__ */ e("span", { className: "nice-audit-diff-old", children: n(s.oldValue, s.displayOldValue) }),
560
- /* @__PURE__ */ e("span", { className: "nice-audit-diff-arrow", children: /* @__PURE__ */ e(dc, { size: 14 }) }),
570
+ /* @__PURE__ */ e("span", { className: "nice-audit-diff-arrow", children: /* @__PURE__ */ e(pc, { size: 14 }) }),
561
571
  /* @__PURE__ */ e("span", { className: "nice-audit-diff-new", children: n(s.newValue, s.displayNewValue) })
562
572
  ] })
563
573
  ] }, i)) });
564
- }, jc = ({
574
+ }, Yc = ({
565
575
  entry: t,
566
576
  showDiff: n,
567
577
  renderActionIcon: s,
568
578
  renderUser: i,
569
579
  onClick: a
570
580
  }) => {
571
- const { t: l } = Q(), [h, r] = C(!1), o = de[t.action] || de.custom;
581
+ const { t: l } = ee(), [h, r] = C(!1), o = pe[t.action] || pe.custom;
572
582
  return /* @__PURE__ */ c(
573
583
  "div",
574
584
  {
575
- onKeyDown: Ie,
585
+ onKeyDown: Oe,
576
586
  className: `nice-audit-timeline-entry nice-audit-timeline-entry--${t.severity || "info"}`,
577
587
  onClick: a,
578
588
  role: a ? "button" : void 0,
@@ -596,13 +606,13 @@ const Te = {
596
606
  ] }),
597
607
  /* @__PURE__ */ e("span", { className: "nice-audit-timeline-time", children: new Date(t.timestamp).toLocaleString() })
598
608
  ] }),
599
- /* @__PURE__ */ e("div", { className: "nice-audit-timeline-user", children: i ? i(t) : /* @__PURE__ */ c(ie, { children: [
609
+ /* @__PURE__ */ e("div", { className: "nice-audit-timeline-user", children: i ? i(t) : /* @__PURE__ */ c(ne, { children: [
600
610
  t.userAvatar && /* @__PURE__ */ e("img", { src: t.userAvatar, alt: "", className: "nice-audit-avatar" }),
601
611
  /* @__PURE__ */ e("span", { className: "nice-audit-username", children: t.userName }),
602
612
  t.userRole && /* @__PURE__ */ e("span", { className: "nice-audit-role", children: t.userRole })
603
613
  ] }) }),
604
614
  t.notes && /* @__PURE__ */ e("div", { className: "nice-audit-timeline-notes", children: t.notes }),
605
- n && t.changes && t.changes.length > 0 && /* @__PURE__ */ c(ie, { children: [
615
+ n && t.changes && t.changes.length > 0 && /* @__PURE__ */ c(ne, { children: [
606
616
  /* @__PURE__ */ e(
607
617
  "button",
608
618
  {
@@ -611,12 +621,12 @@ const Te = {
611
621
  onClick: (f) => {
612
622
  f.stopPropagation(), r(!h);
613
623
  },
614
- children: h ? /* @__PURE__ */ c(ie, { children: [
615
- /* @__PURE__ */ e(Le, { size: 14 }),
624
+ children: h ? /* @__PURE__ */ c(ne, { children: [
625
+ /* @__PURE__ */ e(Ae, { size: 14 }),
616
626
  " ",
617
627
  l("auditTrail.hideChanges", "Hide changes")
618
- ] }) : /* @__PURE__ */ c(ie, { children: [
619
- /* @__PURE__ */ e(qe, { size: 14 }),
628
+ ] }) : /* @__PURE__ */ c(ne, { children: [
629
+ /* @__PURE__ */ e(Be, { size: 14 }),
620
630
  " ",
621
631
  l("auditTrail.showChanges", "Show {changes} changes").replace(
622
632
  "{changes}",
@@ -625,7 +635,7 @@ const Te = {
625
635
  ] })
626
636
  }
627
637
  ),
628
- h && /* @__PURE__ */ e(Mc, { changes: t.changes })
638
+ h && /* @__PURE__ */ e(Uc, { changes: t.changes })
629
639
  ] }),
630
640
  t.ipAddress && /* @__PURE__ */ c("div", { className: "nice-audit-timeline-meta", children: [
631
641
  /* @__PURE__ */ e("span", { children: l("auditTrail.ip", "IP: {ipAddress}").replace(
@@ -641,8 +651,8 @@ const Te = {
641
651
  ]
642
652
  }
643
653
  );
644
- }, Uc = ({ entries: t, showDiff: n, onEntryClick: s }) => {
645
- const { t: i } = Q();
654
+ }, qc = ({ entries: t, showDiff: n, onEntryClick: s }) => {
655
+ const { t: i } = ee();
646
656
  return /* @__PURE__ */ c("table", { className: "nice-audit-table", children: [
647
657
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { children: [
648
658
  /* @__PURE__ */ e("th", { children: i("auditTrail.timestamp", "Timestamp") }),
@@ -653,7 +663,7 @@ const Te = {
653
663
  /* @__PURE__ */ e("th", { children: i("auditTrail.ipAddress", "IP Address") })
654
664
  ] }) }),
655
665
  /* @__PURE__ */ e("tbody", { children: t.map((a) => {
656
- const l = de[a.action] || de.custom;
666
+ const l = pe[a.action] || pe.custom;
657
667
  return /* @__PURE__ */ c(
658
668
  "tr",
659
669
  {
@@ -693,8 +703,8 @@ const Te = {
693
703
  );
694
704
  }) })
695
705
  ] });
696
- }, pt = /* @__PURE__ */ Object.assign(
697
- /* @__PURE__ */ he(
706
+ }, mt = /* @__PURE__ */ Object.assign(
707
+ /* @__PURE__ */ ue(
698
708
  ({
699
709
  dataSource: t,
700
710
  initialFilter: n = {},
@@ -706,32 +716,34 @@ const Te = {
706
716
  renderUser: r,
707
717
  onEntryClick: o,
708
718
  onExport: f,
709
- title: D,
710
- className: O = "",
711
- style: w
712
- }, z) => {
713
- const { t: M } = Q(), K = D ?? M("auditTrail.title", "Audit Trail"), [E, _] = C([]), [te, j] = C(0), [G, I] = C(n), [m, b] = C(1), [g, W] = C(!1), [u, B] = C(i), [F, $] = C(!1), T = P(async () => {
714
- W(!0);
719
+ title: T,
720
+ className: P = "",
721
+ style: w,
722
+ testId: z,
723
+ "data-testid": ie
724
+ }, J) => {
725
+ const { t: D } = ee(), K = T ?? D("auditTrail.title", "Audit Trail"), [G, R] = C([]), [ae, q] = C(0), [W, _] = C(n), [m, b] = C(1), [g, X] = C(!1), [u, V] = C(i), [O, F] = C(!1), E = I(async () => {
726
+ X(!0);
715
727
  try {
716
- const N = await t.fetchEntries(G, { page: m, pageSize: s });
717
- _(N.entries), j(N.totalCount);
728
+ const N = await t.fetchEntries(W, { page: m, pageSize: s });
729
+ R(N.entries), q(N.totalCount);
718
730
  } finally {
719
- W(!1);
731
+ X(!1);
720
732
  }
721
- }, [t, G, m, s]);
722
- Ac.useEffect(() => {
723
- T();
724
- }, [T]);
725
- const X = P(
733
+ }, [t, W, m, s]);
734
+ Ic.useEffect(() => {
735
+ E();
736
+ }, [E]);
737
+ const Z = I(
726
738
  (N) => {
727
739
  if (f)
728
- f(E, N);
740
+ f(G, N);
729
741
  else {
730
742
  let k, A;
731
743
  if (N === "json")
732
- k = JSON.stringify(E, null, 2), A = "application/json";
744
+ k = JSON.stringify(G, null, 2), A = "application/json";
733
745
  else {
734
- const R = [
746
+ const $ = [
735
747
  "Timestamp",
736
748
  "Action",
737
749
  "User",
@@ -739,130 +751,138 @@ const Te = {
739
751
  "Entity",
740
752
  "IP",
741
753
  "Changes"
742
- ], J = E.map((q) => {
754
+ ], H = G.map((U) => {
743
755
  var v;
744
756
  return [
745
- new Date(q.timestamp).toISOString(),
746
- q.action,
747
- q.userName,
748
- q.entityType,
749
- q.entityName || q.entityId,
750
- q.ipAddress || "",
751
- ((v = q.changes) == null ? void 0 : v.length) || 0
757
+ new Date(U.timestamp).toISOString(),
758
+ U.action,
759
+ U.userName,
760
+ U.entityType,
761
+ U.entityName || U.entityId,
762
+ U.ipAddress || "",
763
+ ((v = U.changes) == null ? void 0 : v.length) || 0
752
764
  ];
753
765
  });
754
- k = [R.join(","), ...J.map((q) => q.join(","))].join(`
766
+ k = [$.join(","), ...H.map((U) => U.join(","))].join(`
755
767
  `), A = "text/csv";
756
768
  }
757
- const Z = new Blob([k], { type: A }), Y = URL.createObjectURL(Z), y = document.createElement("a");
758
- y.href = Y, y.download = `audit-trail-${Date.now()}.${N}`, y.click(), URL.revokeObjectURL(Y);
769
+ const Q = new Blob([k], { type: A }), j = URL.createObjectURL(Q), y = document.createElement("a");
770
+ y.href = j, y.download = `audit-trail-${Date.now()}.${N}`, y.click(), URL.revokeObjectURL(j);
759
771
  }
760
772
  },
761
- [E, f]
773
+ [G, f]
762
774
  );
763
- pe(z, () => ({
764
- refresh: T,
775
+ me(J, () => ({
776
+ refresh: E,
765
777
  setFilter: (N) => {
766
- I(N), b(1);
778
+ _(N), b(1);
767
779
  },
768
- getEntries: () => E
780
+ getEntries: () => G
769
781
  }));
770
- const H = Math.ceil(te / s);
771
- return /* @__PURE__ */ c("div", { className: `nice-audit-trail ${O}`, style: w, children: [
772
- /* @__PURE__ */ c("div", { className: "nice-audit-header", children: [
773
- /* @__PURE__ */ e("h3", { className: "nice-audit-title", children: K }),
774
- /* @__PURE__ */ c("div", { className: "nice-audit-header-actions", children: [
775
- /* @__PURE__ */ e(
776
- "button",
777
- {
778
- type: "button",
779
- className: `nice-audit-view-btn ${u === "timeline" ? "nice-audit-view-btn--active" : ""}`,
780
- onClick: () => B("timeline"),
781
- title: M("auditTrail.timelineView", "Timeline view"),
782
- children: /* @__PURE__ */ e(sc, { size: 16 })
783
- }
784
- ),
785
- /* @__PURE__ */ e(
786
- "button",
787
- {
788
- type: "button",
789
- className: `nice-audit-view-btn ${u === "table" ? "nice-audit-view-btn--active" : ""}`,
790
- onClick: () => B("table"),
791
- title: M("auditTrail.tableView", "Table view"),
792
- children: /* @__PURE__ */ e(nc, { size: 16 })
793
- }
794
- ),
795
- /* @__PURE__ */ c(
796
- "button",
797
- {
798
- type: "button",
799
- className: `nice-audit-filter-btn ${F ? "nice-audit-filter-btn--active" : ""}`,
800
- onClick: () => $(!F),
801
- children: [
802
- /* @__PURE__ */ e(fe, { size: 16 }),
803
- " ",
804
- M("auditTrail.filter", "Filter")
805
- ]
806
- }
807
- ),
808
- a && /* @__PURE__ */ c("div", { className: "nice-audit-export-dropdown", children: [
809
- /* @__PURE__ */ c("button", { type: "button", className: "nice-audit-export-btn", children: [
810
- /* @__PURE__ */ e(ye, { size: 16 }),
811
- " ",
812
- M("auditTrail.export", "Export")
813
- ] }),
814
- /* @__PURE__ */ c("div", { className: "nice-audit-export-menu", children: [
815
- /* @__PURE__ */ e("button", { type: "button", onClick: () => X("csv"), children: M("auditTrail.exportAsCsv", "Export as CSV") }),
816
- /* @__PURE__ */ e("button", { type: "button", onClick: () => X("json"), children: M("auditTrail.exportAsJson", "Export as JSON") })
782
+ const B = Math.ceil(ae / s);
783
+ return /* @__PURE__ */ c(
784
+ "div",
785
+ {
786
+ className: `nice-audit-trail ${P}`,
787
+ style: w,
788
+ "data-testid": ie ?? z,
789
+ children: [
790
+ /* @__PURE__ */ c("div", { className: "nice-audit-header", children: [
791
+ /* @__PURE__ */ e("h3", { className: "nice-audit-title", children: K }),
792
+ /* @__PURE__ */ c("div", { className: "nice-audit-header-actions", children: [
793
+ /* @__PURE__ */ e(
794
+ "button",
795
+ {
796
+ type: "button",
797
+ className: `nice-audit-view-btn ${u === "timeline" ? "nice-audit-view-btn--active" : ""}`,
798
+ onClick: () => V("timeline"),
799
+ title: D("auditTrail.timelineView", "Timeline view"),
800
+ children: /* @__PURE__ */ e(lc, { size: 16 })
801
+ }
802
+ ),
803
+ /* @__PURE__ */ e(
804
+ "button",
805
+ {
806
+ type: "button",
807
+ className: `nice-audit-view-btn ${u === "table" ? "nice-audit-view-btn--active" : ""}`,
808
+ onClick: () => V("table"),
809
+ title: D("auditTrail.tableView", "Table view"),
810
+ children: /* @__PURE__ */ e(rc, { size: 16 })
811
+ }
812
+ ),
813
+ /* @__PURE__ */ c(
814
+ "button",
815
+ {
816
+ type: "button",
817
+ className: `nice-audit-filter-btn ${O ? "nice-audit-filter-btn--active" : ""}`,
818
+ onClick: () => F(!O),
819
+ children: [
820
+ /* @__PURE__ */ e(we, { size: 16 }),
821
+ " ",
822
+ D("auditTrail.filter", "Filter")
823
+ ]
824
+ }
825
+ ),
826
+ a && /* @__PURE__ */ c("div", { className: "nice-audit-export-dropdown", children: [
827
+ /* @__PURE__ */ c("button", { type: "button", className: "nice-audit-export-btn", children: [
828
+ /* @__PURE__ */ e(ke, { size: 16 }),
829
+ " ",
830
+ D("auditTrail.export", "Export")
831
+ ] }),
832
+ /* @__PURE__ */ c("div", { className: "nice-audit-export-menu", children: [
833
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => Z("csv"), children: D("auditTrail.exportAsCsv", "Export as CSV") }),
834
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => Z("json"), children: D("auditTrail.exportAsJson", "Export as JSON") })
835
+ ] })
836
+ ] })
817
837
  ] })
838
+ ] }),
839
+ O && /* @__PURE__ */ e(jc, { filter: W, onChange: _ }),
840
+ /* @__PURE__ */ c("div", { className: "nice-audit-stats", children: [
841
+ /* @__PURE__ */ e("span", { children: D("auditTrail.showingOfEntries", "Showing {entries} of {totalCount} entries").replace("{entries}", String(G.length)).replace("{totalCount}", String(ae)) }),
842
+ W.startDate && W.endDate && /* @__PURE__ */ c("span", { className: "nice-audit-date-indicator", children: [
843
+ W.startDate.toLocaleDateString(),
844
+ " - ",
845
+ W.endDate.toLocaleDateString()
846
+ ] })
847
+ ] }),
848
+ /* @__PURE__ */ c("div", { className: `nice-audit-content ${g ? "nice-audit-content--loading" : ""}`, children: [
849
+ g && /* @__PURE__ */ e("div", { className: "nice-audit-loader", children: /* @__PURE__ */ e("div", { className: "nice-audit-spinner" }) }),
850
+ u === "timeline" ? /* @__PURE__ */ e("div", { className: "nice-audit-timeline", children: G.map((N) => /* @__PURE__ */ e(
851
+ Yc,
852
+ {
853
+ entry: N,
854
+ showDiff: l,
855
+ renderActionIcon: h,
856
+ renderUser: r,
857
+ onClick: o ? () => o(N) : void 0
858
+ },
859
+ N.id
860
+ )) }) : /* @__PURE__ */ e(qc, { entries: G, showDiff: l, onEntryClick: o }),
861
+ G.length === 0 && !g && /* @__PURE__ */ e("div", { className: "nice-audit-empty", children: D(
862
+ "auditTrail.noAuditEntriesFoundMatching",
863
+ "No audit entries found matching the current filters."
864
+ ) })
865
+ ] }),
866
+ B > 1 && /* @__PURE__ */ c("div", { className: "nice-audit-pagination", children: [
867
+ /* @__PURE__ */ e("button", { type: "button", disabled: m === 1, onClick: () => b(m - 1), children: D("auditTrail.previous", "Previous") }),
868
+ /* @__PURE__ */ e("span", { children: D("auditTrail.pageOf", "Page {page} of {totalPages}").replace("{page}", String(m)).replace("{totalPages}", String(B)) }),
869
+ /* @__PURE__ */ e(
870
+ "button",
871
+ {
872
+ type: "button",
873
+ disabled: m === B,
874
+ onClick: () => b(m + 1),
875
+ children: D("auditTrail.next", "Next")
876
+ }
877
+ )
818
878
  ] })
819
- ] })
820
- ] }),
821
- F && /* @__PURE__ */ e(Rc, { filter: G, onChange: I }),
822
- /* @__PURE__ */ c("div", { className: "nice-audit-stats", children: [
823
- /* @__PURE__ */ e("span", { children: M("auditTrail.showingOfEntries", "Showing {entries} of {totalCount} entries").replace("{entries}", String(E.length)).replace("{totalCount}", String(te)) }),
824
- G.startDate && G.endDate && /* @__PURE__ */ c("span", { className: "nice-audit-date-indicator", children: [
825
- G.startDate.toLocaleDateString(),
826
- " - ",
827
- G.endDate.toLocaleDateString()
828
- ] })
829
- ] }),
830
- /* @__PURE__ */ c("div", { className: `nice-audit-content ${g ? "nice-audit-content--loading" : ""}`, children: [
831
- g && /* @__PURE__ */ e("div", { className: "nice-audit-loader", children: /* @__PURE__ */ e("div", { className: "nice-audit-spinner" }) }),
832
- u === "timeline" ? /* @__PURE__ */ e("div", { className: "nice-audit-timeline", children: E.map((N) => /* @__PURE__ */ e(
833
- jc,
834
- {
835
- entry: N,
836
- showDiff: l,
837
- renderActionIcon: h,
838
- renderUser: r,
839
- onClick: o ? () => o(N) : void 0
840
- },
841
- N.id
842
- )) }) : /* @__PURE__ */ e(Uc, { entries: E, showDiff: l, onEntryClick: o }),
843
- E.length === 0 && !g && /* @__PURE__ */ e("div", { className: "nice-audit-empty", children: M(
844
- "auditTrail.noAuditEntriesFoundMatching",
845
- "No audit entries found matching the current filters."
846
- ) })
847
- ] }),
848
- H > 1 && /* @__PURE__ */ c("div", { className: "nice-audit-pagination", children: [
849
- /* @__PURE__ */ e("button", { type: "button", disabled: m === 1, onClick: () => b(m - 1), children: M("auditTrail.previous", "Previous") }),
850
- /* @__PURE__ */ e("span", { children: M("auditTrail.pageOf", "Page {page} of {totalPages}").replace("{page}", String(m)).replace("{totalPages}", String(H)) }),
851
- /* @__PURE__ */ e(
852
- "button",
853
- {
854
- type: "button",
855
- disabled: m === H,
856
- onClick: () => b(m + 1),
857
- children: M("auditTrail.next", "Next")
858
- }
859
- )
860
- ] })
861
- ] });
879
+ ]
880
+ }
881
+ );
862
882
  }
863
883
  ),
864
884
  { displayName: "NiceAuditTrail" }
865
- ), Yc = [
885
+ ), Vc = [
866
886
  {
867
887
  target: ".nice-contract-editor",
868
888
  titleKey: "tutorial.contractEditor.intro.title",
@@ -871,52 +891,52 @@ const Te = {
871
891
  content: "Assemble the contract from the clause library, fill template variables, track versions and approvals, then save or export to PDF/DOCX/HTML.",
872
892
  placement: "auto"
873
893
  }
874
- ], le = {
894
+ ], oe = {
875
895
  general: {
876
896
  label: "General",
877
897
  color: "var(--nice-text-muted, #6b7280)",
878
- icon: /* @__PURE__ */ e(Ee, { size: 16 })
898
+ icon: /* @__PURE__ */ e(ze, { size: 16 })
879
899
  },
880
900
  liability: {
881
901
  label: "Liability",
882
902
  color: "var(--nice-color-error, #ef4444)",
883
- icon: /* @__PURE__ */ e(Ke, { size: 16 })
903
+ icon: /* @__PURE__ */ e(We, { size: 16 })
884
904
  },
885
905
  payment: {
886
906
  label: "Payment",
887
907
  color: "var(--nice-color-success, #10b981)",
888
- icon: /* @__PURE__ */ e(gc, { size: 16 })
908
+ icon: /* @__PURE__ */ e(vc, { size: 16 })
889
909
  },
890
910
  termination: {
891
911
  label: "Termination",
892
912
  color: "var(--nice-color-warning, #f59e0b)",
893
- icon: /* @__PURE__ */ e(mc, { size: 16 })
913
+ icon: /* @__PURE__ */ e(bc, { size: 16 })
894
914
  },
895
915
  confidentiality: {
896
916
  label: "Confidentiality",
897
917
  color: "var(--nice-color-accent, #8b5cf6)",
898
- icon: /* @__PURE__ */ e(Je, { size: 16 })
918
+ icon: /* @__PURE__ */ e(Ge, { size: 16 })
899
919
  },
900
920
  compliance: {
901
921
  label: "Compliance",
902
922
  color: "var(--nice-color-primary, #3b82f6)",
903
- icon: /* @__PURE__ */ e(re, { size: 16 })
923
+ icon: /* @__PURE__ */ e(de, { size: 16 })
904
924
  },
905
925
  custom: {
906
926
  label: "Custom",
907
927
  color: "var(--nice-text-muted, #64748b)",
908
- icon: /* @__PURE__ */ e(He, { size: 16 })
928
+ icon: /* @__PURE__ */ e(Ke, { size: 16 })
909
929
  }
910
- }, qc = {
930
+ }, Bc = {
911
931
  draft: { label: "Draft", color: "var(--nice-text-muted, #6b7280)" },
912
932
  pending_review: { label: "Pending Review", color: "var(--nice-color-warning, #f59e0b)" },
913
933
  approved: { label: "Approved", color: "var(--nice-color-success, #10b981)" },
914
934
  rejected: { label: "Rejected", color: "var(--nice-color-error, #ef4444)" },
915
935
  signed: { label: "Signed", color: "var(--nice-color-accent, #8b5cf6)" }
916
- }, Vc = ({ clauses: t, onInsert: n }) => {
917
- const { t: s } = Q(), [i, a] = C(""), [l, h] = C("all"), r = t.filter((o) => {
918
- const f = i === "" || o.name.toLowerCase().includes(i.toLowerCase()) || o.content.toLowerCase().includes(i.toLowerCase()), D = l === "all" || o.category === l;
919
- return f && D;
936
+ }, Hc = ({ clauses: t, onInsert: n }) => {
937
+ const { t: s } = ee(), [i, a] = C(""), [l, h] = C("all"), r = t.filter((o) => {
938
+ const f = i === "" || o.name.toLowerCase().includes(i.toLowerCase()) || o.content.toLowerCase().includes(i.toLowerCase()), T = l === "all" || o.category === l;
939
+ return f && T;
920
940
  });
921
941
  return /* @__PURE__ */ c("div", { className: "nice-contract-library", children: [
922
942
  /* @__PURE__ */ c("div", { className: "nice-contract-library-header", children: [
@@ -942,17 +962,17 @@ const Te = {
942
962
  children: s("contractEditor.all", "All")
943
963
  }
944
964
  ),
945
- Object.keys(le).map((o) => /* @__PURE__ */ c(
965
+ Object.keys(oe).map((o) => /* @__PURE__ */ c(
946
966
  "button",
947
967
  {
948
968
  type: "button",
949
969
  className: `nice-contract-category-btn ${l === o ? "nice-contract-category-btn--active" : ""}`,
950
970
  onClick: () => h(o),
951
- style: { "--cat-color": le[o].color },
971
+ style: { "--cat-color": oe[o].color },
952
972
  children: [
953
- le[o].icon,
973
+ oe[o].icon,
954
974
  " ",
955
- le[o].label
975
+ oe[o].label
956
976
  ]
957
977
  },
958
978
  o
@@ -966,8 +986,8 @@ const Te = {
966
986
  "span",
967
987
  {
968
988
  className: "nice-contract-library-item-cat",
969
- style: { "--cat-color": le[o.category].color },
970
- children: le[o.category].icon
989
+ style: { "--cat-color": oe[o.category].color },
990
+ children: oe[o.category].icon
971
991
  }
972
992
  )
973
993
  ] }),
@@ -979,7 +999,7 @@ const Te = {
979
999
  className: "nice-contract-library-insert",
980
1000
  onClick: () => n(o),
981
1001
  children: [
982
- /* @__PURE__ */ e(Ae, { size: 14 }),
1002
+ /* @__PURE__ */ e(Ie, { size: 14 }),
983
1003
  " ",
984
1004
  s("contractEditor.insert", "Insert")
985
1005
  ]
@@ -989,8 +1009,8 @@ const Te = {
989
1009
  r.length === 0 && /* @__PURE__ */ e("div", { className: "nice-contract-library-empty", children: s("contractEditor.noMatchingClauses", "No matching clauses") })
990
1010
  ] })
991
1011
  ] });
992
- }, Bc = ({ variables: t, definitions: n, onChange: s }) => {
993
- const { t: i } = Q();
1012
+ }, Jc = ({ variables: t, definitions: n, onChange: s }) => {
1013
+ const { t: i } = ee();
994
1014
  return /* @__PURE__ */ c("div", { className: "nice-contract-variables", children: [
995
1015
  /* @__PURE__ */ e("h4", { children: i("contractEditor.variables", "Variables") }),
996
1016
  /* @__PURE__ */ e("div", { className: "nice-contract-variables-list", children: n.map((a) => /* @__PURE__ */ c("div", { className: "nice-contract-variable", children: [
@@ -1026,7 +1046,7 @@ const Te = {
1026
1046
  )
1027
1047
  ] }, a.name)) })
1028
1048
  ] });
1029
- }, Hc = ({
1049
+ }, Kc = ({
1030
1050
  section: t,
1031
1051
  variables: n,
1032
1052
  readOnly: s,
@@ -1034,7 +1054,7 @@ const Te = {
1034
1054
  onRemoveClause: a,
1035
1055
  onMoveClause: l
1036
1056
  }) => {
1037
- const { t: h } = Q(), r = (o) => o.replace(/\{\{(\w+)\}\}/g, (f, D) => n[D] || `[${D}]`);
1057
+ const { t: h } = ee(), r = (o) => o.replace(/\{\{(\w+)\}\}/g, (f, T) => n[T] || `[${T}]`);
1038
1058
  return /* @__PURE__ */ c(
1039
1059
  "div",
1040
1060
  {
@@ -1046,11 +1066,11 @@ const Te = {
1046
1066
  role: "button",
1047
1067
  tabIndex: 0,
1048
1068
  "aria-expanded": !t.collapsed,
1049
- onKeyDown: Ie,
1069
+ onKeyDown: Oe,
1050
1070
  className: "nice-contract-section-header",
1051
1071
  onClick: i,
1052
1072
  children: [
1053
- /* @__PURE__ */ e("span", { className: "nice-contract-section-toggle", children: t.collapsed ? /* @__PURE__ */ e(qe, { size: 14 }) : /* @__PURE__ */ e(Le, { size: 14 }) }),
1073
+ /* @__PURE__ */ e("span", { className: "nice-contract-section-toggle", children: t.collapsed ? /* @__PURE__ */ e(Be, { size: 14 }) : /* @__PURE__ */ e(Ae, { size: 14 }) }),
1054
1074
  /* @__PURE__ */ e("h3", { children: t.title }),
1055
1075
  /* @__PURE__ */ e("span", { className: "nice-contract-section-count", children: h("contractEditor.clauseS", "{clauses} clause(s)").replace(
1056
1076
  "{clauses}",
@@ -1066,8 +1086,8 @@ const Te = {
1066
1086
  "span",
1067
1087
  {
1068
1088
  className: "nice-contract-clause-cat",
1069
- style: { "--cat-color": le[o.category].color },
1070
- children: le[o.category].icon
1089
+ style: { "--cat-color": oe[o.category].color },
1090
+ children: oe[o.category].icon
1071
1091
  }
1072
1092
  ),
1073
1093
  /* @__PURE__ */ e("span", { className: "nice-contract-clause-name", children: o.name }),
@@ -1079,7 +1099,7 @@ const Te = {
1079
1099
  type: "button",
1080
1100
  onClick: () => l(o.id, "up"),
1081
1101
  disabled: f === 0,
1082
- children: /* @__PURE__ */ e(pc, { size: 14 })
1102
+ children: /* @__PURE__ */ e(mc, { size: 14 })
1083
1103
  }
1084
1104
  ),
1085
1105
  /* @__PURE__ */ e(
@@ -1088,10 +1108,10 @@ const Te = {
1088
1108
  type: "button",
1089
1109
  onClick: () => l(o.id, "down"),
1090
1110
  disabled: f === t.clauses.length - 1,
1091
- children: /* @__PURE__ */ e(uc, { size: 14 })
1111
+ children: /* @__PURE__ */ e(gc, { size: 14 })
1092
1112
  }
1093
1113
  ),
1094
- /* @__PURE__ */ e("button", { type: "button", onClick: () => a(o.id), children: /* @__PURE__ */ e(we, { size: 14 }) })
1114
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => a(o.id), children: /* @__PURE__ */ e(Ce, { size: 14 }) })
1095
1115
  ] })
1096
1116
  ] }),
1097
1117
  /* @__PURE__ */ e(
@@ -1110,8 +1130,8 @@ const Te = {
1110
1130
  ]
1111
1131
  }
1112
1132
  );
1113
- }, Jc = ({ workflow: t, onAction: n }) => {
1114
- const { t: s } = Q(), [i, a] = C(null), [l, h] = C("");
1133
+ }, Gc = ({ workflow: t, onAction: n }) => {
1134
+ const { t: s } = ee(), [i, a] = C(null), [l, h] = C("");
1115
1135
  return /* @__PURE__ */ c("div", { className: "nice-contract-workflow", children: [
1116
1136
  /* @__PURE__ */ e("h4", { children: s("contractEditor.approvalWorkflow", "Approval Workflow") }),
1117
1137
  /* @__PURE__ */ e("div", { className: "nice-contract-workflow-steps", children: t.steps.map((r, o) => /* @__PURE__ */ c(
@@ -1135,7 +1155,7 @@ const Te = {
1135
1155
  /* @__PURE__ */ e("span", { children: f.name }),
1136
1156
  /* @__PURE__ */ e("span", { className: "nice-contract-approver-role", children: f.role })
1137
1157
  ] }, f.id)) }),
1138
- r.status === "pending" && t.currentStep === o && /* @__PURE__ */ e("div", { className: "nice-contract-workflow-actions", children: i === r.id ? /* @__PURE__ */ c(ie, { children: [
1158
+ r.status === "pending" && t.currentStep === o && /* @__PURE__ */ e("div", { className: "nice-contract-workflow-actions", children: i === r.id ? /* @__PURE__ */ c(ne, { children: [
1139
1159
  /* @__PURE__ */ e(
1140
1160
  "textarea",
1141
1161
  {
@@ -1154,7 +1174,7 @@ const Te = {
1154
1174
  n(r.id, "approve", l), a(null), h("");
1155
1175
  },
1156
1176
  children: [
1157
- /* @__PURE__ */ e(re, { size: 14 }),
1177
+ /* @__PURE__ */ e(de, { size: 14 }),
1158
1178
  " ",
1159
1179
  s("contractEditor.approve", "Approve")
1160
1180
  ]
@@ -1169,7 +1189,7 @@ const Te = {
1169
1189
  n(r.id, "reject", l), a(null), h("");
1170
1190
  },
1171
1191
  children: [
1172
- /* @__PURE__ */ e(ge, { size: 14 }),
1192
+ /* @__PURE__ */ e(ve, { size: 14 }),
1173
1193
  " ",
1174
1194
  s("contractEditor.reject", "Reject")
1175
1195
  ]
@@ -1191,8 +1211,8 @@ const Te = {
1191
1211
  r.id
1192
1212
  )) })
1193
1213
  ] });
1194
- }, ut = /* @__PURE__ */ Object.assign(
1195
- /* @__PURE__ */ he(
1214
+ }, gt = /* @__PURE__ */ Object.assign(
1215
+ /* @__PURE__ */ ue(
1196
1216
  ({
1197
1217
  document: t,
1198
1218
  clauseLibrary: n = [],
@@ -1204,139 +1224,141 @@ const Te = {
1204
1224
  currentUser: r,
1205
1225
  onChange: o,
1206
1226
  onAddClause: f,
1207
- onRemoveClause: D,
1208
- onVariableChange: O,
1227
+ onRemoveClause: T,
1228
+ onVariableChange: P,
1209
1229
  onAddComment: w,
1210
1230
  onApprovalAction: z,
1211
- onRestoreVersion: M,
1212
- onSave: K,
1213
- onExport: E,
1214
- className: _ = "",
1215
- style: te,
1216
- tutorial: j
1217
- }, G) => {
1218
- var q;
1219
- const { t: I } = Q(), [m, b] = C(t), [g, W] = C(i ? "library" : null), [u, B] = C(
1220
- ((q = m.sections[0]) == null ? void 0 : q.id) || null
1221
- ), $ = m.sections.flatMap(
1231
+ onRestoreVersion: ie,
1232
+ onSave: J,
1233
+ onExport: D,
1234
+ className: K = "",
1235
+ style: G,
1236
+ tutorial: R,
1237
+ testId: ae,
1238
+ "data-testid": q
1239
+ }, W) => {
1240
+ var U;
1241
+ const { t: _ } = ee(), [m, b] = C(t), [g, X] = C(i ? "library" : null), [u, V] = C(
1242
+ ((U = m.sections[0]) == null ? void 0 : U.id) || null
1243
+ ), F = m.sections.flatMap(
1222
1244
  (v) => v.clauses.flatMap((x) => x.variables || [])
1223
1245
  ).filter(
1224
- (v, x, S) => S.findIndex((ee) => ee.name === v.name) === x
1225
- ), T = P(
1246
+ (v, x, S) => S.findIndex((ce) => ce.name === v.name) === x
1247
+ ), E = I(
1226
1248
  (v) => {
1227
1249
  const x = { ...m, ...v, updatedAt: /* @__PURE__ */ new Date() };
1228
1250
  b(x), o == null || o(x);
1229
1251
  },
1230
1252
  [m, o]
1231
- ), X = P(
1253
+ ), Z = I(
1232
1254
  (v, x) => {
1233
1255
  const S = m.sections.map(
1234
- (ee) => ee.id === x ? { ...ee, clauses: [...ee.clauses, { ...v, id: `${v.id}-${Date.now()}` }] } : ee
1256
+ (ce) => ce.id === x ? { ...ce, clauses: [...ce.clauses, { ...v, id: `${v.id}-${Date.now()}` }] } : ce
1235
1257
  );
1236
- T({ sections: S }), f == null || f(v, x);
1258
+ E({ sections: S }), f == null || f(v, x);
1237
1259
  },
1238
- [m, T, f]
1239
- ), H = P(
1260
+ [m, E, f]
1261
+ ), B = I(
1240
1262
  (v, x) => {
1241
1263
  const S = m.sections.map(
1242
- (ee) => ee.id === x ? { ...ee, clauses: ee.clauses.filter((ce) => ce.id !== v) } : ee
1264
+ (ce) => ce.id === x ? { ...ce, clauses: ce.clauses.filter((te) => te.id !== v) } : ce
1243
1265
  );
1244
- T({ sections: S }), D == null || D(v, x);
1266
+ E({ sections: S }), T == null || T(v, x);
1245
1267
  },
1246
- [m, T, D]
1247
- ), N = P(
1268
+ [m, E, T]
1269
+ ), N = I(
1248
1270
  (v, x, S) => {
1249
- const ee = m.sections.map((ce) => {
1250
- if (ce.id !== v)
1251
- return ce;
1252
- const d = ce.clauses.findIndex((se) => se.id === x);
1271
+ const ce = m.sections.map((te) => {
1272
+ if (te.id !== v)
1273
+ return te;
1274
+ const d = te.clauses.findIndex((le) => le.id === x);
1253
1275
  if (d === -1)
1254
- return ce;
1255
- const V = S === "up" ? d - 1 : d + 1;
1256
- if (V < 0 || V >= ce.clauses.length)
1257
- return ce;
1258
- const L = [...ce.clauses];
1259
- return [L[d], L[V]] = [L[V], L[d]], { ...ce, clauses: L };
1276
+ return te;
1277
+ const Y = S === "up" ? d - 1 : d + 1;
1278
+ if (Y < 0 || Y >= te.clauses.length)
1279
+ return te;
1280
+ const L = [...te.clauses];
1281
+ return [L[d], L[Y]] = [L[Y], L[d]], { ...te, clauses: L };
1260
1282
  });
1261
- T({ sections: ee });
1283
+ E({ sections: ce });
1262
1284
  },
1263
- [m, T]
1264
- ), k = P(
1285
+ [m, E]
1286
+ ), k = I(
1265
1287
  (v) => {
1266
1288
  const x = m.sections.map(
1267
1289
  (S) => S.id === v ? { ...S, collapsed: !S.collapsed } : S
1268
1290
  );
1269
- T({ sections: x });
1291
+ E({ sections: x });
1270
1292
  },
1271
- [m, T]
1272
- ), A = P(
1293
+ [m, E]
1294
+ ), A = I(
1273
1295
  (v, x) => {
1274
- T({ variables: { ...m.variables, [v]: x } }), O == null || O(v, x);
1296
+ E({ variables: { ...m.variables, [v]: x } }), P == null || P(v, x);
1275
1297
  },
1276
- [m, T, O]
1277
- ), Z = P(() => {
1298
+ [m, E, P]
1299
+ ), Q = I(() => {
1278
1300
  const v = [];
1279
- return $.forEach((x) => {
1301
+ return F.forEach((x) => {
1280
1302
  x.required && !m.variables[x.name] && v.push(`Missing required variable: ${x.name}`);
1281
1303
  }), m.sections.forEach((x) => {
1282
1304
  x.clauses.forEach((S) => {
1283
1305
  S.isRequired && !S.content && v.push(`Required clause "${S.name}" is empty`);
1284
1306
  });
1285
1307
  }), { valid: v.length === 0, errors: v };
1286
- }, [m, $]);
1287
- pe(G, () => ({
1308
+ }, [m, F]);
1309
+ me(W, () => ({
1288
1310
  getDocument: () => m,
1289
- insertClause: X,
1311
+ insertClause: Z,
1290
1312
  setVariable: A,
1291
- exportDocument: (v) => E == null ? void 0 : E(v),
1292
- validate: Z
1313
+ exportDocument: (v) => D == null ? void 0 : D(v),
1314
+ validate: Q
1293
1315
  }));
1294
- const Y = qc[m.status], y = /* @__PURE__ */ c("div", { className: "nice-contract-header", children: [
1316
+ const j = Bc[m.status], y = /* @__PURE__ */ c("div", { className: "nice-contract-header", children: [
1295
1317
  /* @__PURE__ */ c("div", { className: "nice-contract-header-info", children: [
1296
1318
  /* @__PURE__ */ e("h2", { className: "nice-contract-title", children: m.title }),
1297
1319
  /* @__PURE__ */ e(
1298
1320
  "span",
1299
1321
  {
1300
1322
  className: "nice-contract-status",
1301
- style: { "--status-color": Y.color },
1302
- children: Y.label
1323
+ style: { "--status-color": j.color },
1324
+ children: j.label
1303
1325
  }
1304
1326
  )
1305
1327
  ] }),
1306
1328
  /* @__PURE__ */ c("div", { className: "nice-contract-header-actions", children: [
1307
- K && !s && /* @__PURE__ */ e(
1329
+ J && !s && /* @__PURE__ */ e(
1308
1330
  "button",
1309
1331
  {
1310
1332
  type: "button",
1311
1333
  className: "nice-contract-btn nice-contract-btn--primary",
1312
- onClick: () => K(m),
1313
- children: I("contractEditor.save", "Save")
1334
+ onClick: () => J(m),
1335
+ children: _("contractEditor.save", "Save")
1314
1336
  }
1315
1337
  ),
1316
- E && /* @__PURE__ */ c("div", { className: "nice-contract-export-dropdown", children: [
1338
+ D && /* @__PURE__ */ c("div", { className: "nice-contract-export-dropdown", children: [
1317
1339
  /* @__PURE__ */ c("button", { type: "button", className: "nice-contract-btn", children: [
1318
- I("contractEditor.export", "Export"),
1340
+ _("contractEditor.export", "Export"),
1319
1341
  " ",
1320
- /* @__PURE__ */ e(Le, { size: 14 })
1342
+ /* @__PURE__ */ e(Ae, { size: 14 })
1321
1343
  ] }),
1322
1344
  /* @__PURE__ */ c("div", { className: "nice-contract-export-menu", children: [
1323
- /* @__PURE__ */ e("button", { type: "button", onClick: () => E("pdf"), children: "PDF" }),
1324
- /* @__PURE__ */ e("button", { type: "button", onClick: () => E("docx"), children: "Word (.docx)" }),
1325
- /* @__PURE__ */ e("button", { type: "button", onClick: () => E("html"), children: I("contractEditor.html", "HTML") })
1345
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => D("pdf"), children: "PDF" }),
1346
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => D("docx"), children: "Word (.docx)" }),
1347
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => D("html"), children: _("contractEditor.html", "HTML") })
1326
1348
  ] })
1327
1349
  ] })
1328
1350
  ] })
1329
- ] }), R = /* @__PURE__ */ c("div", { className: "nice-contract-toolbar", children: [
1351
+ ] }), $ = /* @__PURE__ */ c("div", { className: "nice-contract-toolbar", children: [
1330
1352
  i && /* @__PURE__ */ c(
1331
1353
  "button",
1332
1354
  {
1333
1355
  type: "button",
1334
1356
  className: `nice-contract-toolbar-btn ${g === "library" ? "nice-contract-toolbar-btn--active" : ""}`,
1335
- onClick: () => W(g === "library" ? null : "library"),
1357
+ onClick: () => X(g === "library" ? null : "library"),
1336
1358
  children: [
1337
- /* @__PURE__ */ e(hc, { size: 16 }),
1359
+ /* @__PURE__ */ e(uc, { size: 16 }),
1338
1360
  " ",
1339
- I("contractEditor.library", "Library")
1361
+ _("contractEditor.library", "Library")
1340
1362
  ]
1341
1363
  }
1342
1364
  ),
@@ -1345,11 +1367,11 @@ const Te = {
1345
1367
  {
1346
1368
  type: "button",
1347
1369
  className: `nice-contract-toolbar-btn ${g === "variables" ? "nice-contract-toolbar-btn--active" : ""}`,
1348
- onClick: () => W(g === "variables" ? null : "variables"),
1370
+ onClick: () => X(g === "variables" ? null : "variables"),
1349
1371
  children: [
1350
- /* @__PURE__ */ e(Ye, { size: 16 }),
1372
+ /* @__PURE__ */ e(Ve, { size: 16 }),
1351
1373
  " ",
1352
- I("contractEditor.variables", "Variables")
1374
+ _("contractEditor.variables", "Variables")
1353
1375
  ]
1354
1376
  }
1355
1377
  ),
@@ -1358,11 +1380,11 @@ const Te = {
1358
1380
  {
1359
1381
  type: "button",
1360
1382
  className: `nice-contract-toolbar-btn ${g === "workflow" ? "nice-contract-toolbar-btn--active" : ""}`,
1361
- onClick: () => W(g === "workflow" ? null : "workflow"),
1383
+ onClick: () => X(g === "workflow" ? null : "workflow"),
1362
1384
  children: [
1363
- /* @__PURE__ */ e(re, { size: 16 }),
1385
+ /* @__PURE__ */ e(de, { size: 16 }),
1364
1386
  " ",
1365
- I("contractEditor.workflow", "Workflow")
1387
+ _("contractEditor.workflow", "Workflow")
1366
1388
  ]
1367
1389
  }
1368
1390
  ),
@@ -1371,32 +1393,32 @@ const Te = {
1371
1393
  {
1372
1394
  type: "button",
1373
1395
  className: `nice-contract-toolbar-btn ${g === "history" ? "nice-contract-toolbar-btn--active" : ""}`,
1374
- onClick: () => W(g === "history" ? null : "history"),
1396
+ onClick: () => X(g === "history" ? null : "history"),
1375
1397
  children: [
1376
- /* @__PURE__ */ e(_e, { size: 16 }),
1398
+ /* @__PURE__ */ e(Pe, { size: 16 }),
1377
1399
  " ",
1378
- I("contractEditor.history", "History")
1400
+ _("contractEditor.history", "History")
1379
1401
  ]
1380
1402
  }
1381
1403
  )
1382
- ] }), J = g ? /* @__PURE__ */ c("div", { className: "nice-contract-panel", children: [
1404
+ ] }), H = g ? /* @__PURE__ */ c("div", { className: "nice-contract-panel", children: [
1383
1405
  g === "library" && /* @__PURE__ */ e(
1384
- Vc,
1406
+ Hc,
1385
1407
  {
1386
1408
  clauses: n,
1387
- onInsert: (v) => u && X(v, u)
1409
+ onInsert: (v) => u && Z(v, u)
1388
1410
  }
1389
1411
  ),
1390
1412
  g === "variables" && /* @__PURE__ */ e(
1391
- Bc,
1413
+ Jc,
1392
1414
  {
1393
1415
  variables: m.variables,
1394
- definitions: $,
1416
+ definitions: F,
1395
1417
  onChange: A
1396
1418
  }
1397
1419
  ),
1398
1420
  g === "workflow" && m.workflow && /* @__PURE__ */ e(
1399
- Jc,
1421
+ Gc,
1400
1422
  {
1401
1423
  workflow: m.workflow,
1402
1424
  onAction: (v, x, S) => z == null ? void 0 : z(v, x, S)
@@ -1404,24 +1426,25 @@ const Te = {
1404
1426
  )
1405
1427
  ] }) : void 0;
1406
1428
  return /* @__PURE__ */ e(
1407
- Tc,
1429
+ Lc,
1408
1430
  {
1409
1431
  flush: !0,
1410
- className: `nice-contract-editor ${_}`,
1411
- style: te,
1432
+ className: `nice-contract-editor ${K}`,
1433
+ style: G,
1434
+ "data-testid": q ?? ae,
1412
1435
  menubar: y,
1413
- toolbar: R,
1414
- sidebar: J,
1436
+ toolbar: $,
1437
+ sidebar: H,
1415
1438
  children: /* @__PURE__ */ c("div", { className: "nice-contract-document", children: [
1416
- /* @__PURE__ */ e("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 30 }, children: /* @__PURE__ */ e(Ec, { steps: Lc(j, Yc) }) }),
1439
+ /* @__PURE__ */ e("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 30 }, children: /* @__PURE__ */ e(zc, { steps: Ac(R, Vc) }) }),
1417
1440
  m.sections.map((v) => /* @__PURE__ */ e(
1418
- Hc,
1441
+ Kc,
1419
1442
  {
1420
1443
  section: v,
1421
1444
  variables: m.variables,
1422
1445
  readOnly: s,
1423
1446
  onToggle: () => k(v.id),
1424
- onRemoveClause: (x) => H(x, v.id),
1447
+ onRemoveClause: (x) => B(x, v.id),
1425
1448
  onMoveClause: (x, S) => N(v.id, x, S)
1426
1449
  },
1427
1450
  v.id
@@ -1432,7 +1455,7 @@ const Te = {
1432
1455
  }
1433
1456
  ),
1434
1457
  { displayName: "NiceContractEditor" }
1435
- ), Kc = [
1458
+ ), Wc = [
1436
1459
  {
1437
1460
  id: "necessary",
1438
1461
  label: "Necessary",
@@ -1472,7 +1495,7 @@ const Te = {
1472
1495
  cookies: ["social_session"],
1473
1496
  partners: ["Twitter", "YouTube", "Instagram"]
1474
1497
  }
1475
- ], Gc = {
1498
+ ], Xc = {
1476
1499
  title: "Cookie Preferences",
1477
1500
  description: "We use cookies to enhance your experience. Choose which types of cookies you allow.",
1478
1501
  acceptAll: "Accept All",
@@ -1491,8 +1514,8 @@ const Te = {
1491
1514
  processing: "Processing",
1492
1515
  completed: "Completed",
1493
1516
  close: "Close"
1494
- }, Wc = ({ option: t, enabled: n, onChange: s }) => {
1495
- const { t: i } = Q();
1517
+ }, Zc = ({ option: t, enabled: n, onChange: s }) => {
1518
+ const { t: i } = ee();
1496
1519
  return /* @__PURE__ */ c("div", { className: "nice-gdpr-option", children: [
1497
1520
  /* @__PURE__ */ c("div", { className: "nice-gdpr-option-header", children: [
1498
1521
  /* @__PURE__ */ c("label", { className: "nice-gdpr-option-toggle", children: [
@@ -1523,14 +1546,14 @@ const Te = {
1523
1546
  t.partners.join(", ")
1524
1547
  ] })
1525
1548
  ] });
1526
- }, Xc = ({
1549
+ }, Qc = ({
1527
1550
  requests: t,
1528
1551
  policies: n,
1529
1552
  onRequest: s,
1530
1553
  onDownload: i,
1531
1554
  labels: a
1532
1555
  }) => {
1533
- const { t: l } = Q();
1556
+ const { t: l } = ee();
1534
1557
  return /* @__PURE__ */ c("div", { className: "nice-gdpr-rights", children: [
1535
1558
  /* @__PURE__ */ e("h4", { children: a.dataRights }),
1536
1559
  /* @__PURE__ */ c("div", { className: "nice-gdpr-rights-actions", children: [
@@ -1541,7 +1564,7 @@ const Te = {
1541
1564
  className: "nice-gdpr-btn nice-gdpr-btn--secondary",
1542
1565
  onClick: () => s("export"),
1543
1566
  children: [
1544
- /* @__PURE__ */ e(ye, { size: 16 }),
1567
+ /* @__PURE__ */ e(ke, { size: 16 }),
1545
1568
  " ",
1546
1569
  a.exportData
1547
1570
  ]
@@ -1554,7 +1577,7 @@ const Te = {
1554
1577
  className: "nice-gdpr-btn nice-gdpr-btn--danger",
1555
1578
  onClick: () => s("delete"),
1556
1579
  children: [
1557
- /* @__PURE__ */ e(Nc, { size: 16 }),
1580
+ /* @__PURE__ */ e(yc, { size: 16 }),
1558
1581
  " ",
1559
1582
  a.deleteData
1560
1583
  ]
@@ -1597,12 +1620,12 @@ const Te = {
1597
1620
  ] })
1598
1621
  ] })
1599
1622
  ] });
1600
- }, mt = /* @__PURE__ */ Object.assign(
1601
- /* @__PURE__ */ he(
1623
+ }, bt = /* @__PURE__ */ Object.assign(
1624
+ /* @__PURE__ */ ue(
1602
1625
  ({
1603
1626
  appName: t,
1604
1627
  companyName: n,
1605
- options: s = Kc,
1628
+ options: s = Wc,
1606
1629
  currentConsent: i = null,
1607
1630
  retentionPolicies: a = [],
1608
1631
  dataRequests: l = [],
@@ -1610,60 +1633,62 @@ const Te = {
1610
1633
  storageKey: r = "nice_gdpr_consent",
1611
1634
  consentVersion: o = "1.0",
1612
1635
  variant: f = "banner",
1613
- position: D = "bottom",
1614
- onConsentChange: O,
1636
+ position: T = "bottom",
1637
+ onConsentChange: P,
1615
1638
  onDataRequest: w,
1616
1639
  onDownloadExport: z,
1617
- privacyPolicyUrl: M,
1618
- cookiePolicyUrl: K,
1619
- termsUrl: E,
1620
- labels: _,
1621
- className: te = "",
1622
- style: j
1623
- }, G) => {
1624
- const { t: I } = Q(), m = { ...Gc, ..._ }, [b, g] = C(!1), [W, u] = C(!1), [B, F] = C(!1), [$, T] = C(() => {
1640
+ privacyPolicyUrl: ie,
1641
+ cookiePolicyUrl: J,
1642
+ termsUrl: D,
1643
+ labels: K,
1644
+ className: G = "",
1645
+ style: R,
1646
+ testId: ae,
1647
+ "data-testid": q
1648
+ }, W) => {
1649
+ const { t: _ } = ee(), m = { ...Xc, ...K }, [b, g] = C(!1), [X, u] = C(!1), [V, O] = C(!1), [F, E] = C(() => {
1625
1650
  const y = {};
1626
- return s.forEach((R) => {
1627
- y[R.id] = (i == null ? void 0 : i.categories[R.id]) ?? R.enabled;
1651
+ return s.forEach(($) => {
1652
+ y[$.id] = (i == null ? void 0 : i.categories[$.id]) ?? $.enabled;
1628
1653
  }), y;
1629
1654
  });
1630
- Ne(() => {
1655
+ ye(() => {
1631
1656
  (!i || i.version !== o) && g(!0);
1632
1657
  }, [i, o]);
1633
- const X = P(
1634
- (y, R) => {
1635
- const J = R || $;
1636
- J.necessary = !0;
1637
- const q = {
1658
+ const Z = I(
1659
+ (y, $) => {
1660
+ const H = $ || F;
1661
+ H.necessary = !0;
1662
+ const U = {
1638
1663
  version: o,
1639
1664
  timestamp: /* @__PURE__ */ new Date(),
1640
- categories: J,
1665
+ categories: H,
1641
1666
  action: y
1642
1667
  };
1643
1668
  try {
1644
- localStorage.setItem(r, JSON.stringify(q));
1669
+ localStorage.setItem(r, JSON.stringify(U));
1645
1670
  } catch {
1646
1671
  }
1647
- T(J), g(!1), u(!1), O == null || O(q);
1672
+ E(H), g(!1), u(!1), P == null || P(U);
1648
1673
  },
1649
- [$, o, r, O]
1650
- ), H = P(() => {
1674
+ [F, o, r, P]
1675
+ ), B = I(() => {
1651
1676
  const y = {};
1652
- s.forEach((R) => {
1653
- y[R.id] = !0;
1654
- }), X("accept_all", y);
1655
- }, [s, X]), N = P(() => {
1677
+ s.forEach(($) => {
1678
+ y[$.id] = !0;
1679
+ }), Z("accept_all", y);
1680
+ }, [s, Z]), N = I(() => {
1656
1681
  const y = {};
1657
- s.forEach((R) => {
1658
- y[R.id] = R.required || !1;
1659
- }), X("reject_all", y);
1660
- }, [s, X]), k = P(
1682
+ s.forEach(($) => {
1683
+ y[$.id] = $.required || !1;
1684
+ }), Z("reject_all", y);
1685
+ }, [s, Z]), k = I(
1661
1686
  async (y) => {
1662
1687
  w && await w(y);
1663
1688
  },
1664
1689
  [w]
1665
1690
  );
1666
- pe(G, () => ({
1691
+ me(W, () => ({
1667
1692
  showBanner: () => g(!0),
1668
1693
  hideBanner: () => g(!1),
1669
1694
  getConsent: () => {
@@ -1685,24 +1710,24 @@ const Te = {
1685
1710
  g(!0), u(!0);
1686
1711
  }
1687
1712
  }));
1688
- const A = oe(null);
1689
- if (Qe(A, { open: b && f === "modal" }), !b && f !== "embedded")
1713
+ const A = he(null);
1714
+ if (cc(A, { open: b && f === "modal" }), !b && f !== "embedded")
1690
1715
  return null;
1691
- const Z = /* @__PURE__ */ c("div", { className: "nice-gdpr-content", children: [
1716
+ const Q = /* @__PURE__ */ c("div", { className: "nice-gdpr-content", children: [
1692
1717
  /* @__PURE__ */ c("div", { className: "nice-gdpr-header", children: [
1693
- /* @__PURE__ */ e("div", { className: "nice-gdpr-icon", children: /* @__PURE__ */ e(bc, { size: 32 }) }),
1718
+ /* @__PURE__ */ e("div", { className: "nice-gdpr-icon", children: /* @__PURE__ */ e(Nc, { size: 32 }) }),
1694
1719
  /* @__PURE__ */ c("div", { className: "nice-gdpr-header-text", children: [
1695
1720
  /* @__PURE__ */ e("h3", { children: m.title }),
1696
1721
  /* @__PURE__ */ e("p", { children: m.description.replace("{app}", t).replace("{company}", n) })
1697
1722
  ] })
1698
1723
  ] }),
1699
- !W && !B && /* @__PURE__ */ c("div", { className: "nice-gdpr-quick-actions", children: [
1724
+ !X && !V && /* @__PURE__ */ c("div", { className: "nice-gdpr-quick-actions", children: [
1700
1725
  /* @__PURE__ */ e(
1701
1726
  "button",
1702
1727
  {
1703
1728
  type: "button",
1704
1729
  className: "nice-gdpr-btn nice-gdpr-btn--primary",
1705
- onClick: H,
1730
+ onClick: B,
1706
1731
  children: m.acceptAll
1707
1732
  }
1708
1733
  ),
@@ -1725,13 +1750,13 @@ const Te = {
1725
1750
  }
1726
1751
  )
1727
1752
  ] }),
1728
- W && !B && /* @__PURE__ */ c("div", { className: "nice-gdpr-preferences", children: [
1753
+ X && !V && /* @__PURE__ */ c("div", { className: "nice-gdpr-preferences", children: [
1729
1754
  /* @__PURE__ */ e("div", { className: "nice-gdpr-options", children: s.map((y) => /* @__PURE__ */ e(
1730
- Wc,
1755
+ Zc,
1731
1756
  {
1732
1757
  option: y,
1733
- enabled: $[y.id],
1734
- onChange: (R) => T((J) => ({ ...J, [y.id]: R }))
1758
+ enabled: F[y.id],
1759
+ onChange: ($) => E((H) => ({ ...H, [y.id]: $ }))
1735
1760
  },
1736
1761
  y.id
1737
1762
  )) }),
@@ -1741,7 +1766,7 @@ const Te = {
1741
1766
  {
1742
1767
  type: "button",
1743
1768
  className: "nice-gdpr-btn nice-gdpr-btn--primary",
1744
- onClick: () => X("custom"),
1769
+ onClick: () => Z("custom"),
1745
1770
  children: m.savePreferences
1746
1771
  }
1747
1772
  ),
@@ -1750,15 +1775,15 @@ const Te = {
1750
1775
  {
1751
1776
  type: "button",
1752
1777
  className: "nice-gdpr-btn nice-gdpr-btn--link",
1753
- onClick: () => F(!0),
1778
+ onClick: () => O(!0),
1754
1779
  children: m.dataRights
1755
1780
  }
1756
1781
  )
1757
1782
  ] })
1758
1783
  ] }),
1759
- B && /* @__PURE__ */ c(ie, { children: [
1784
+ V && /* @__PURE__ */ c(ne, { children: [
1760
1785
  /* @__PURE__ */ e(
1761
- Xc,
1786
+ Qc,
1762
1787
  {
1763
1788
  requests: l,
1764
1789
  policies: a,
@@ -1772,46 +1797,47 @@ const Te = {
1772
1797
  {
1773
1798
  type: "button",
1774
1799
  className: "nice-gdpr-btn nice-gdpr-btn--link",
1775
- onClick: () => F(!1),
1800
+ onClick: () => O(!1),
1776
1801
  children: [
1777
- /* @__PURE__ */ e(vc, { size: 14 }),
1802
+ /* @__PURE__ */ e(fc, { size: 14 }),
1778
1803
  " ",
1779
- I("gdprConsent.backToPreferences", "Back to preferences")
1804
+ _("gdprConsent.backToPreferences", "Back to preferences")
1780
1805
  ]
1781
1806
  }
1782
1807
  )
1783
1808
  ] }),
1784
1809
  /* @__PURE__ */ c("div", { className: "nice-gdpr-footer", children: [
1785
- M && /* @__PURE__ */ e("a", { href: M, target: "_blank", rel: "noopener noreferrer", children: I("gdprConsent.privacyPolicy", "Privacy Policy") }),
1786
- K && /* @__PURE__ */ e("a", { href: K, target: "_blank", rel: "noopener noreferrer", children: I("gdprConsent.cookiePolicy", "Cookie Policy") }),
1787
- E && /* @__PURE__ */ e("a", { href: E, target: "_blank", rel: "noopener noreferrer", children: I("gdprConsent.termsOfService", "Terms of Service") })
1810
+ ie && /* @__PURE__ */ e("a", { href: ie, target: "_blank", rel: "noopener noreferrer", children: _("gdprConsent.privacyPolicy", "Privacy Policy") }),
1811
+ J && /* @__PURE__ */ e("a", { href: J, target: "_blank", rel: "noopener noreferrer", children: _("gdprConsent.cookiePolicy", "Cookie Policy") }),
1812
+ D && /* @__PURE__ */ e("a", { href: D, target: "_blank", rel: "noopener noreferrer", children: _("gdprConsent.termsOfService", "Terms of Service") })
1788
1813
  ] })
1789
- ] }), Y = `nice-gdpr-consent nice-gdpr-consent--${f} nice-gdpr-consent--${D} ${te}`;
1814
+ ] }), j = `nice-gdpr-consent nice-gdpr-consent--${f} nice-gdpr-consent--${T} ${G}`;
1790
1815
  return f === "modal" ? /* @__PURE__ */ e("div", { className: "nice-gdpr-overlay", children: /* @__PURE__ */ e(
1791
1816
  "div",
1792
1817
  {
1793
1818
  ref: A,
1794
- className: Y,
1795
- style: j,
1819
+ className: j,
1820
+ style: R,
1796
1821
  role: "dialog",
1797
1822
  "aria-modal": "true",
1798
1823
  "aria-label": m.title,
1799
- children: Z
1824
+ "data-testid": q ?? ae,
1825
+ children: Q
1800
1826
  }
1801
- ) }) : /* @__PURE__ */ e("div", { className: Y, style: j, children: Z });
1827
+ ) }) : /* @__PURE__ */ e("div", { className: j, style: R, "data-testid": q ?? ae, children: Q });
1802
1828
  }
1803
1829
  ),
1804
1830
  { displayName: "NiceGDPRConsent" }
1805
- ), Zc = [], cc = {
1806
- document: /* @__PURE__ */ e(Ee, { size: 16 }),
1807
- user: /* @__PURE__ */ e(Xe, { size: 16 }),
1808
- task: /* @__PURE__ */ e(re, { size: 16 }),
1809
- project: /* @__PURE__ */ e(fc, { size: 16 }),
1810
- setting: /* @__PURE__ */ e(Ve, { size: 16 }),
1811
- help: /* @__PURE__ */ e(We, { size: 16 }),
1812
- action: /* @__PURE__ */ e(Ge, { size: 16 }),
1813
- custom: /* @__PURE__ */ e(ze, { size: 16 })
1814
- }, Qc = ({
1831
+ ), et = [], ac = {
1832
+ document: /* @__PURE__ */ e(ze, { size: 16 }),
1833
+ user: /* @__PURE__ */ e(Qe, { size: 16 }),
1834
+ task: /* @__PURE__ */ e(de, { size: 16 }),
1835
+ project: /* @__PURE__ */ e(wc, { size: 16 }),
1836
+ setting: /* @__PURE__ */ e(He, { size: 16 }),
1837
+ help: /* @__PURE__ */ e(Ze, { size: 16 }),
1838
+ action: /* @__PURE__ */ e(Xe, { size: 16 }),
1839
+ custom: /* @__PURE__ */ e(_e, { size: 16 })
1840
+ }, ct = ({
1815
1841
  value: t,
1816
1842
  onChange: n,
1817
1843
  onKeyDown: s,
@@ -1822,9 +1848,9 @@ const Te = {
1822
1848
  activeId: r,
1823
1849
  expanded: o
1824
1850
  }) => {
1825
- const { t: f } = Q();
1851
+ const { t: f } = ee();
1826
1852
  return /* @__PURE__ */ c("div", { className: "nice-search-input-container", children: [
1827
- /* @__PURE__ */ e("span", { className: "nice-search-icon", children: /* @__PURE__ */ e(fe, { size: 16 }) }),
1853
+ /* @__PURE__ */ e("span", { className: "nice-search-icon", children: /* @__PURE__ */ e(we, { size: 16 }) }),
1828
1854
  /* @__PURE__ */ e(
1829
1855
  "input",
1830
1856
  {
@@ -1833,7 +1859,7 @@ const Te = {
1833
1859
  className: "nice-search-input",
1834
1860
  placeholder: i,
1835
1861
  value: t,
1836
- onChange: (D) => n(D.target.value),
1862
+ onChange: (T) => n(T.target.value),
1837
1863
  onKeyDown: s,
1838
1864
  "aria-label": f("globalSearch.search", "Search"),
1839
1865
  role: "combobox",
@@ -1851,11 +1877,11 @@ const Te = {
1851
1877
  className: "nice-search-clear",
1852
1878
  onClick: () => n(""),
1853
1879
  "aria-label": f("globalSearch.clearSearch", "Clear search"),
1854
- children: /* @__PURE__ */ e(we, { size: 16 })
1880
+ children: /* @__PURE__ */ e(Ce, { size: 16 })
1855
1881
  }
1856
1882
  )
1857
1883
  ] });
1858
- }, et = ({
1884
+ }, tt = ({
1859
1885
  result: t,
1860
1886
  isSelected: n,
1861
1887
  onSelect: s,
@@ -1875,7 +1901,7 @@ const Te = {
1875
1901
  role: "option",
1876
1902
  "aria-selected": n,
1877
1903
  children: [
1878
- /* @__PURE__ */ e("div", { className: "nice-search-result-icon", children: t.icon || (t.image ? /* @__PURE__ */ e("img", { src: t.image, alt: "" }) : cc[t.type]) }),
1904
+ /* @__PURE__ */ e("div", { className: "nice-search-result-icon", children: t.icon || (t.image ? /* @__PURE__ */ e("img", { src: t.image, alt: "" }) : ac[t.type]) }),
1879
1905
  /* @__PURE__ */ c("div", { className: "nice-search-result-content", children: [
1880
1906
  /* @__PURE__ */ e("span", { className: "nice-search-result-title", children: t.title }),
1881
1907
  t.subtitle && /* @__PURE__ */ e("span", { className: "nice-search-result-subtitle", children: t.subtitle }),
@@ -1901,8 +1927,8 @@ const Te = {
1901
1927
  ]
1902
1928
  }
1903
1929
  )
1904
- ), ct = ({ categories: t, selected: n, onSelect: s }) => {
1905
- const { t: i } = Q();
1930
+ ), at = ({ categories: t, selected: n, onSelect: s }) => {
1931
+ const { t: i } = ee();
1906
1932
  return /* @__PURE__ */ c("div", { className: "nice-search-categories", children: [
1907
1933
  /* @__PURE__ */ e(
1908
1934
  "button",
@@ -1928,7 +1954,7 @@ const Te = {
1928
1954
  a.id
1929
1955
  ))
1930
1956
  ] });
1931
- }, tt = ({
1957
+ }, it = ({
1932
1958
  searches: t,
1933
1959
  onSelect: n,
1934
1960
  onClear: s,
@@ -1946,13 +1972,13 @@ const Te = {
1946
1972
  className: "nice-search-recent-item",
1947
1973
  onClick: () => n(l.query),
1948
1974
  children: [
1949
- /* @__PURE__ */ e("span", { className: "nice-search-recent-icon", children: /* @__PURE__ */ e(_e, { size: 14 }) }),
1975
+ /* @__PURE__ */ e("span", { className: "nice-search-recent-icon", children: /* @__PURE__ */ e(Pe, { size: 14 }) }),
1950
1976
  /* @__PURE__ */ e("span", { className: "nice-search-recent-query", children: l.query })
1951
1977
  ]
1952
1978
  },
1953
1979
  h
1954
1980
  )) })
1955
- ] }), at = {
1981
+ ] }), st = {
1956
1982
  placeholder: "Search...",
1957
1983
  recent: "Recent Searches",
1958
1984
  noResults: "No results found for",
@@ -1960,10 +1986,10 @@ const Te = {
1960
1986
  clearRecent: "Clear",
1961
1987
  categories: "Categories",
1962
1988
  filters: "Filters"
1963
- }, gt = /* @__PURE__ */ Object.assign(
1964
- /* @__PURE__ */ he(
1989
+ }, vt = /* @__PURE__ */ Object.assign(
1990
+ /* @__PURE__ */ ue(
1965
1991
  ({
1966
- sources: t = Zc,
1992
+ sources: t = et,
1967
1993
  placeholder: n,
1968
1994
  minQueryLength: s = 2,
1969
1995
  debounceMs: i = 300,
@@ -1973,224 +1999,226 @@ const Te = {
1973
1999
  maxRecent: r = 5,
1974
2000
  showShortcuts: o = !0,
1975
2001
  hotkey: f = "k",
1976
- onResultSelect: D,
1977
- onSearch: O,
2002
+ onResultSelect: T,
2003
+ onSearch: P,
1978
2004
  onClose: w,
1979
2005
  renderResult: z,
1980
- renderEmpty: M,
1981
- defaultOpen: K = !1,
1982
- open: E,
1983
- variant: _ = "modal",
1984
- labels: te,
1985
- className: j = "",
1986
- style: G
1987
- }, I) => {
1988
- const { t: m } = Q(), b = { ...at, ...te }, g = oe(null), W = oe(void 0), [u, B] = C(K), [F, $] = C(""), [T, X] = C([]), [H, N] = C(!1), [k, A] = C(0), [Z, Y] = C(null), [y, R] = C([]), J = E !== void 0 ? E : u;
1989
- Ne(() => {
2006
+ renderEmpty: ie,
2007
+ defaultOpen: J = !1,
2008
+ open: D,
2009
+ variant: K = "modal",
2010
+ labels: G,
2011
+ className: R = "",
2012
+ style: ae,
2013
+ testId: q,
2014
+ "data-testid": W
2015
+ }, _) => {
2016
+ const { t: m } = ee(), b = { ...st, ...G }, g = he(null), X = he(void 0), [u, V] = C(J), [O, F] = C(""), [E, Z] = C([]), [B, N] = C(!1), [k, A] = C(0), [Q, j] = C(null), [y, $] = C([]), H = D !== void 0 ? D : u;
2017
+ ye(() => {
1990
2018
  try {
1991
2019
  const p = localStorage.getItem("nice_recent_searches");
1992
- p && R(JSON.parse(p));
2020
+ p && $(JSON.parse(p));
1993
2021
  } catch {
1994
2022
  }
1995
2023
  }, []);
1996
- const q = P(
1997
- (p, U) => {
1998
- const ne = [
2024
+ const U = I(
2025
+ (p, M) => {
2026
+ const re = [
1999
2027
  {
2000
2028
  query: p,
2001
2029
  timestamp: /* @__PURE__ */ new Date(),
2002
- resultCount: U
2030
+ resultCount: M
2003
2031
  },
2004
- ...y.filter((be) => be.query !== p)
2032
+ ...y.filter((Ne) => Ne.query !== p)
2005
2033
  ].slice(0, r);
2006
- R(ne);
2034
+ $(re);
2007
2035
  try {
2008
- localStorage.setItem("nice_recent_searches", JSON.stringify(ne));
2036
+ localStorage.setItem("nice_recent_searches", JSON.stringify(re));
2009
2037
  } catch {
2010
2038
  }
2011
2039
  },
2012
2040
  [y, r]
2013
- ), v = P(
2041
+ ), v = I(
2014
2042
  async (p) => {
2015
2043
  if (p.length < s) {
2016
- X([]);
2044
+ Z([]);
2017
2045
  return;
2018
2046
  }
2019
2047
  N(!0);
2020
2048
  try {
2021
- const U = t.map(async (ne) => {
2049
+ const M = t.map(async (re) => {
2022
2050
  try {
2023
- return (await ne.search(p)).map((Fe) => ({
2024
- ...Fe,
2025
- source: ne.name,
2026
- relevanceScore: Fe.relevanceScore * (ne.priority || 1)
2051
+ return (await re.search(p)).map((Re) => ({
2052
+ ...Re,
2053
+ source: re.name,
2054
+ relevanceScore: Re.relevanceScore * (re.priority || 1)
2027
2055
  }));
2028
2056
  } catch {
2029
2057
  return [];
2030
2058
  }
2031
- }), ae = (await Promise.all(U)).flat();
2032
- ae.sort((ne, be) => be.relevanceScore - ne.relevanceScore), X(ae), A(0), O == null || O(p, ae), ae.length > 0 && q(p, ae.length);
2059
+ }), se = (await Promise.all(M)).flat();
2060
+ se.sort((re, Ne) => Ne.relevanceScore - re.relevanceScore), Z(se), A(0), P == null || P(p, se), se.length > 0 && U(p, se.length);
2033
2061
  } finally {
2034
2062
  N(!1);
2035
2063
  }
2036
2064
  },
2037
- [t, s, O, q]
2038
- ), x = P(
2065
+ [t, s, P, U]
2066
+ ), x = I(
2039
2067
  (p) => {
2040
- $(p), W.current && clearTimeout(W.current), W.current = setTimeout(() => {
2068
+ F(p), X.current && clearTimeout(X.current), X.current = setTimeout(() => {
2041
2069
  v(p);
2042
2070
  }, i);
2043
2071
  },
2044
2072
  [v, i]
2045
- ), S = Z ? T.filter((p) => p.type === Z) : T, ee = P(
2073
+ ), S = Q ? E.filter((p) => p.type === Q) : E, ce = I(
2046
2074
  (p) => {
2047
2075
  switch (p.key) {
2048
2076
  case "ArrowDown":
2049
- p.preventDefault(), A((U) => Math.min(U + 1, S.length - 1));
2077
+ p.preventDefault(), A((M) => Math.min(M + 1, S.length - 1));
2050
2078
  break;
2051
2079
  case "ArrowUp":
2052
- p.preventDefault(), A((U) => Math.max(U - 1, 0));
2080
+ p.preventDefault(), A((M) => Math.max(M - 1, 0));
2053
2081
  break;
2054
2082
  case "PageDown":
2055
2083
  case "PageUp": {
2056
2084
  p.preventDefault();
2057
- const U = p.key === "PageDown" ? 10 : -10;
2085
+ const M = p.key === "PageDown" ? 10 : -10;
2058
2086
  A(
2059
- (ae) => Math.max(0, Math.min(S.length - 1, ae + U))
2087
+ (se) => Math.max(0, Math.min(S.length - 1, se + M))
2060
2088
  );
2061
2089
  break;
2062
2090
  }
2063
2091
  case "Enter":
2064
- p.preventDefault(), S[k] && (D == null || D(S[k]), B(!1), w == null || w());
2092
+ p.preventDefault(), S[k] && (T == null || T(S[k]), V(!1), w == null || w());
2065
2093
  break;
2066
2094
  case "Escape":
2067
- if (_ === "modal")
2095
+ if (K === "modal")
2068
2096
  break;
2069
- p.preventDefault(), B(!1), w == null || w();
2097
+ p.preventDefault(), V(!1), w == null || w();
2070
2098
  break;
2071
2099
  }
2072
2100
  },
2073
- [S, k, D, w, _]
2074
- ), ce = oe(null), d = oe(null), L = `${ec()}-results`, se = P(() => {
2075
- B(!1), w == null || w();
2101
+ [S, k, T, w, K]
2102
+ ), te = he(null), d = he(null), L = `${tc()}-results`, le = I(() => {
2103
+ V(!1), w == null || w();
2076
2104
  }, [w]);
2077
- Qe(ce, {
2078
- open: J && _ === "modal",
2105
+ cc(te, {
2106
+ open: H && K === "modal",
2079
2107
  initialFocus: g,
2080
- onClose: se
2081
- }), zc(
2108
+ onClose: le
2109
+ }), _c(
2082
2110
  ["navigate", "activate"],
2083
2111
  (p) => {
2084
2112
  if (p.source === "keyboard" || S.length === 0)
2085
2113
  return !1;
2086
2114
  if (p.intent === "activate") {
2087
- const U = S[k];
2088
- U && (D == null || D(U), se());
2115
+ const M = S[k];
2116
+ M && (T == null || T(M), le());
2089
2117
  } else if (p.direction === "down" || p.direction === "up") {
2090
- const U = p.direction === "down" ? 1 : -1;
2118
+ const M = p.direction === "down" ? 1 : -1;
2091
2119
  A(
2092
- (ae) => Math.min(Math.max(ae + U, 0), S.length - 1)
2120
+ (se) => Math.min(Math.max(se + M, 0), S.length - 1)
2093
2121
  );
2094
2122
  } else
2095
2123
  return !1;
2096
2124
  },
2097
- { ref: d, enabled: J || _ === "inline" }
2098
- ), Ne(() => {
2099
- const p = (U) => {
2100
- (U.metaKey || U.ctrlKey) && U.key === f && (U.preventDefault(), B(!0), setTimeout(() => {
2101
- var ae;
2102
- return (ae = g.current) == null ? void 0 : ae.focus();
2125
+ { ref: d, enabled: H || K === "inline" }
2126
+ ), ye(() => {
2127
+ const p = (M) => {
2128
+ (M.metaKey || M.ctrlKey) && M.key === f && (M.preventDefault(), V(!0), setTimeout(() => {
2129
+ var se;
2130
+ return (se = g.current) == null ? void 0 : se.focus();
2103
2131
  }, 0));
2104
2132
  };
2105
2133
  return document.addEventListener("keydown", p), () => document.removeEventListener("keydown", p);
2106
- }, [f]), Ne(() => {
2107
- J && setTimeout(() => {
2134
+ }, [f]), ye(() => {
2135
+ H && setTimeout(() => {
2108
2136
  var p;
2109
2137
  return (p = g.current) == null ? void 0 : p.focus();
2110
2138
  }, 0);
2111
- }, [J]);
2112
- const Pe = Array.from(new Set(T.map((p) => p.type))).map(
2139
+ }, [H]);
2140
+ const Fe = Array.from(new Set(E.map((p) => p.type))).map(
2113
2141
  (p) => ({
2114
2142
  id: p,
2115
2143
  label: p.charAt(0).toUpperCase() + p.slice(1),
2116
- icon: cc[p],
2117
- count: T.filter((U) => U.type === p).length
2144
+ icon: ac[p],
2145
+ count: E.filter((M) => M.type === p).length
2118
2146
  })
2119
2147
  );
2120
- if (pe(I, () => ({
2121
- open: () => B(!0),
2148
+ if (me(_, () => ({
2149
+ open: () => V(!0),
2122
2150
  close: () => {
2123
- B(!1), w == null || w();
2151
+ V(!1), w == null || w();
2124
2152
  },
2125
2153
  focus: () => {
2126
2154
  var p;
2127
2155
  return (p = g.current) == null ? void 0 : p.focus();
2128
2156
  },
2129
2157
  clear: () => {
2130
- $(""), X([]);
2158
+ F(""), Z([]);
2131
2159
  },
2132
2160
  search: async (p) => {
2133
- $(p), await v(p);
2161
+ F(p), await v(p);
2134
2162
  }
2135
- })), !J && _ !== "inline")
2163
+ })), !H && K !== "inline")
2136
2164
  return null;
2137
- const Oe = /* @__PURE__ */ c("div", { className: "nice-search-content", ref: d, children: [
2165
+ const $e = /* @__PURE__ */ c("div", { className: "nice-search-content", ref: d, children: [
2138
2166
  /* @__PURE__ */ e(
2139
- Qc,
2167
+ ct,
2140
2168
  {
2141
- value: F,
2169
+ value: O,
2142
2170
  onChange: x,
2143
- onKeyDown: ee,
2171
+ onKeyDown: ce,
2144
2172
  placeholder: n || b.placeholder,
2145
- isLoading: H,
2173
+ isLoading: B,
2146
2174
  inputRef: g,
2147
2175
  listboxId: L,
2148
2176
  activeId: S[k] ? `${L}-${k}` : void 0,
2149
2177
  expanded: S.length > 0
2150
2178
  }
2151
2179
  ),
2152
- a && Pe.length > 1 && F.length >= s && /* @__PURE__ */ e(
2153
- ct,
2180
+ a && Fe.length > 1 && O.length >= s && /* @__PURE__ */ e(
2181
+ at,
2154
2182
  {
2155
- categories: Pe,
2156
- selected: Z,
2157
- onSelect: Y
2183
+ categories: Fe,
2184
+ selected: Q,
2185
+ onSelect: j
2158
2186
  }
2159
2187
  ),
2160
2188
  /* @__PURE__ */ c("div", { className: "nice-search-results", role: "listbox", id: L, children: [
2161
- H && F.length >= s && /* @__PURE__ */ e("div", { className: "nice-search-loading", children: b.searching }),
2162
- !H && F.length >= s && S.length === 0 && /* @__PURE__ */ e("div", { className: "nice-search-empty", children: M ? M(F) : /* @__PURE__ */ c(ie, { children: [
2163
- /* @__PURE__ */ e("span", { className: "nice-search-empty-icon", children: /* @__PURE__ */ e(fe, { size: 32 }) }),
2189
+ B && O.length >= s && /* @__PURE__ */ e("div", { className: "nice-search-loading", children: b.searching }),
2190
+ !B && O.length >= s && S.length === 0 && /* @__PURE__ */ e("div", { className: "nice-search-empty", children: ie ? ie(O) : /* @__PURE__ */ c(ne, { children: [
2191
+ /* @__PURE__ */ e("span", { className: "nice-search-empty-icon", children: /* @__PURE__ */ e(we, { size: 32 }) }),
2164
2192
  /* @__PURE__ */ c("span", { children: [
2165
2193
  b.noResults,
2166
2194
  ' "',
2167
- F,
2195
+ O,
2168
2196
  '"'
2169
2197
  ] })
2170
2198
  ] }) }),
2171
- S.map((p, U) => /* @__PURE__ */ e(
2172
- et,
2199
+ S.map((p, M) => /* @__PURE__ */ e(
2200
+ tt,
2173
2201
  {
2174
- id: `${L}-${U}`,
2202
+ id: `${L}-${M}`,
2175
2203
  result: p,
2176
- isSelected: U === k,
2204
+ isSelected: M === k,
2177
2205
  onSelect: () => {
2178
- D == null || D(p), B(!1), w == null || w();
2206
+ T == null || T(p), V(!1), w == null || w();
2179
2207
  },
2180
2208
  renderResult: z
2181
2209
  },
2182
2210
  p.id
2183
2211
  ))
2184
2212
  ] }),
2185
- h && F.length < s && y.length > 0 && /* @__PURE__ */ e(
2186
- tt,
2213
+ h && O.length < s && y.length > 0 && /* @__PURE__ */ e(
2214
+ it,
2187
2215
  {
2188
2216
  searches: y,
2189
2217
  onSelect: (p) => {
2190
- $(p), v(p);
2218
+ F(p), v(p);
2191
2219
  },
2192
2220
  onClear: () => {
2193
- R([]), localStorage.removeItem("nice_recent_searches");
2221
+ $([]), localStorage.removeItem("nice_recent_searches");
2194
2222
  },
2195
2223
  label: b.recent,
2196
2224
  clearLabel: b.clearRecent
@@ -2198,55 +2226,57 @@ const Te = {
2198
2226
  ),
2199
2227
  o && /* @__PURE__ */ c("div", { className: "nice-search-shortcuts", children: [
2200
2228
  /* @__PURE__ */ c("span", { children: [
2201
- /* @__PURE__ */ e(ke, { keys: "ArrowUp ArrowDown", size: "sm" }),
2229
+ /* @__PURE__ */ e(xe, { keys: "ArrowUp ArrowDown", size: "sm" }),
2202
2230
  " ",
2203
2231
  m("globalSearch.navigate", "Navigate")
2204
2232
  ] }),
2205
2233
  /* @__PURE__ */ c("span", { children: [
2206
- /* @__PURE__ */ e(ke, { keys: "Enter", size: "sm" }),
2234
+ /* @__PURE__ */ e(xe, { keys: "Enter", size: "sm" }),
2207
2235
  " ",
2208
2236
  m("globalSearch.select", "Select")
2209
2237
  ] }),
2210
2238
  /* @__PURE__ */ c("span", { children: [
2211
- /* @__PURE__ */ e(ke, { keys: "Escape", size: "sm" }),
2239
+ /* @__PURE__ */ e(xe, { keys: "Escape", size: "sm" }),
2212
2240
  " ",
2213
2241
  m("globalSearch.close", "Close")
2214
2242
  ] })
2215
2243
  ] })
2216
2244
  ] });
2217
- return _ === "modal" ? /* @__PURE__ */ e(
2245
+ return K === "modal" ? /* @__PURE__ */ e(
2218
2246
  "div",
2219
2247
  {
2220
2248
  className: "nice-search-overlay",
2221
2249
  role: "presentation",
2222
2250
  onClick: (p) => {
2223
- p.stopPropagation(), p.target === p.currentTarget && (B(!1), w == null || w());
2251
+ p.stopPropagation(), p.target === p.currentTarget && (V(!1), w == null || w());
2224
2252
  },
2225
2253
  children: /* @__PURE__ */ e(
2226
2254
  "div",
2227
2255
  {
2228
- ref: ce,
2229
- className: `nice-global-search nice-global-search--modal ${j}`,
2230
- style: G,
2256
+ ref: te,
2257
+ className: `nice-global-search nice-global-search--modal ${R}`,
2258
+ style: ae,
2231
2259
  role: "dialog",
2232
2260
  "aria-modal": "true",
2233
2261
  "aria-label": n || b.placeholder,
2234
- children: Oe
2262
+ "data-testid": W ?? q,
2263
+ children: $e
2235
2264
  }
2236
2265
  )
2237
2266
  }
2238
2267
  ) : /* @__PURE__ */ e(
2239
2268
  "div",
2240
2269
  {
2241
- className: `nice-global-search nice-global-search--${_} ${j}`,
2242
- style: G,
2243
- children: Oe
2270
+ className: `nice-global-search nice-global-search--${K} ${R}`,
2271
+ style: ae,
2272
+ "data-testid": W ?? q,
2273
+ children: $e
2244
2274
  }
2245
2275
  );
2246
2276
  }
2247
2277
  ),
2248
2278
  { displayName: "NiceGlobalSearch" }
2249
- ), it = [], ue = {
2279
+ ), nt = [], ge = {
2250
2280
  title: "Access Log",
2251
2281
  filters: "Filters",
2252
2282
  search: "Search users, IPs...",
@@ -2298,50 +2328,50 @@ const Te = {
2298
2328
  risk: "Risk",
2299
2329
  status: "Status"
2300
2330
  }
2301
- }, Ce = {
2302
- login_success: /* @__PURE__ */ e(re, { size: 16 }),
2303
- login_failed: /* @__PURE__ */ e(ge, { size: 16 }),
2304
- logout: /* @__PURE__ */ e(Be, { size: 16 }),
2305
- password_change: /* @__PURE__ */ e(xe, { size: 16 }),
2306
- password_reset: /* @__PURE__ */ e(Se, { size: 16 }),
2307
- mfa_enabled: /* @__PURE__ */ e(Ze, { size: 16 }),
2308
- mfa_disabled: /* @__PURE__ */ e(Ke, { size: 16 }),
2309
- mfa_challenged: /* @__PURE__ */ e(De, { size: 16 }),
2310
- permission_change: /* @__PURE__ */ e(Xe, { size: 16 }),
2311
- session_expired: /* @__PURE__ */ e(_e, { size: 16 }),
2312
- account_locked: /* @__PURE__ */ e(Je, { size: 16 }),
2313
- account_unlocked: /* @__PURE__ */ e(Sc, { size: 16 }),
2314
- api_key_created: /* @__PURE__ */ e(xe, { size: 16 }),
2315
- api_key_revoked: /* @__PURE__ */ e(ge, { size: 16 }),
2316
- token_refresh: /* @__PURE__ */ e(Se, { size: 16 }),
2317
- suspicious_activity: /* @__PURE__ */ e(Ge, { size: 16 })
2318
- }, me = {
2331
+ }, Se = {
2332
+ login_success: /* @__PURE__ */ e(de, { size: 16 }),
2333
+ login_failed: /* @__PURE__ */ e(ve, { size: 16 }),
2334
+ logout: /* @__PURE__ */ e(Je, { size: 16 }),
2335
+ password_change: /* @__PURE__ */ e(De, { size: 16 }),
2336
+ password_reset: /* @__PURE__ */ e(Te, { size: 16 }),
2337
+ mfa_enabled: /* @__PURE__ */ e(ec, { size: 16 }),
2338
+ mfa_disabled: /* @__PURE__ */ e(We, { size: 16 }),
2339
+ mfa_challenged: /* @__PURE__ */ e(Ee, { size: 16 }),
2340
+ permission_change: /* @__PURE__ */ e(Qe, { size: 16 }),
2341
+ session_expired: /* @__PURE__ */ e(Pe, { size: 16 }),
2342
+ account_locked: /* @__PURE__ */ e(Ge, { size: 16 }),
2343
+ account_unlocked: /* @__PURE__ */ e(Tc, { size: 16 }),
2344
+ api_key_created: /* @__PURE__ */ e(De, { size: 16 }),
2345
+ api_key_revoked: /* @__PURE__ */ e(ve, { size: 16 }),
2346
+ token_refresh: /* @__PURE__ */ e(Te, { size: 16 }),
2347
+ suspicious_activity: /* @__PURE__ */ e(Xe, { size: 16 })
2348
+ }, be = {
2319
2349
  low: "var(--nice-color-success, #22c55e)",
2320
2350
  medium: "var(--nice-color-warning, #f59e0b)",
2321
2351
  high: "var(--nice-color-error, #ef4444)",
2322
2352
  critical: "var(--nice-color-accent-hover, #7c3aed)"
2323
- }, Re = {
2324
- desktop: /* @__PURE__ */ e(Dc, { size: 16 }),
2325
- mobile: /* @__PURE__ */ e(De, { size: 16 }),
2326
- tablet: /* @__PURE__ */ e(De, { size: 16 }),
2327
- unknown: /* @__PURE__ */ e(We, { size: 16 })
2328
- }, Me = (t) => (typeof t == "string" ? new Date(t) : t).toLocaleString("en-US", {
2353
+ }, je = {
2354
+ desktop: /* @__PURE__ */ e(Ec, { size: 16 }),
2355
+ mobile: /* @__PURE__ */ e(Ee, { size: 16 }),
2356
+ tablet: /* @__PURE__ */ e(Ee, { size: 16 }),
2357
+ unknown: /* @__PURE__ */ e(Ze, { size: 16 })
2358
+ }, Ue = (t) => (typeof t == "string" ? new Date(t) : t).toLocaleString("en-US", {
2329
2359
  month: "short",
2330
2360
  day: "numeric",
2331
2361
  hour: "2-digit",
2332
2362
  minute: "2-digit",
2333
2363
  second: "2-digit"
2334
- }), je = (t) => {
2364
+ }), Ye = (t) => {
2335
2365
  if (!t)
2336
2366
  return "Unknown";
2337
2367
  const n = [];
2338
2368
  return t.city && n.push(t.city), t.country && n.push(t.country), n.length > 0 ? n.join(", ") : "Unknown";
2339
- }, st = (t) => {
2369
+ }, lt = (t) => {
2340
2370
  if (!t)
2341
2371
  return "Unknown";
2342
2372
  const n = [];
2343
2373
  return t.browser && n.push(t.browser), t.os && n.push(t.os), n.length > 0 ? n.join(" / ") : t.type;
2344
- }, Ue = (t) => t >= 80 ? me.critical : t >= 60 ? me.high : t >= 40 ? me.medium : me.low, nt = (t, n) => {
2374
+ }, qe = (t) => t >= 80 ? be.critical : t >= 60 ? be.high : t >= 40 ? be.medium : be.low, rt = (t, n) => {
2345
2375
  var s, i, a, l, h;
2346
2376
  if (n.startDate) {
2347
2377
  const r = typeof n.startDate == "string" ? new Date(n.startDate) : n.startDate;
@@ -2368,140 +2398,142 @@ const Te = {
2368
2398
  return !1;
2369
2399
  }
2370
2400
  return !0;
2371
- }, bt = /* @__PURE__ */ Object.assign(
2372
- /* @__PURE__ */ he(
2401
+ }, Nt = /* @__PURE__ */ Object.assign(
2402
+ /* @__PURE__ */ ue(
2373
2403
  function(n, s) {
2374
- var ee, ce;
2375
- const { t: i } = Q(), {
2376
- entries: a = it,
2404
+ var ce, te;
2405
+ const { t: i } = ee(), {
2406
+ entries: a = nt,
2377
2407
  filter: l = {},
2378
2408
  stats: h,
2379
2409
  realtime: r = !1,
2380
2410
  pollingInterval: o = 3e4,
2381
2411
  showMap: f = !1,
2382
- showStats: D = !0,
2383
- showDetails: O = !0,
2412
+ showStats: T = !0,
2413
+ showDetails: P = !0,
2384
2414
  pageSize: w = 50,
2385
2415
  labels: z,
2386
- loading: M = !1,
2387
- onFilterChange: K,
2388
- onExport: E,
2389
- onEntrySelect: _,
2390
- onBlockIP: te,
2391
- onRefresh: j,
2392
- className: G = "",
2393
- ...I
2394
- } = n, m = oe(null);
2395
- ec();
2396
- const b = ve(
2416
+ loading: ie = !1,
2417
+ onFilterChange: J,
2418
+ onExport: D,
2419
+ onEntrySelect: K,
2420
+ onBlockIP: G,
2421
+ onRefresh: R,
2422
+ className: ae = "",
2423
+ testId: q,
2424
+ "data-testid": W,
2425
+ ..._
2426
+ } = n, m = he(null);
2427
+ tc();
2428
+ const b = fe(
2397
2429
  () => ({
2398
- ...ue,
2430
+ ...ge,
2399
2431
  ...z,
2400
- eventTypes: { ...ue.eventTypes, ...z == null ? void 0 : z.eventTypes },
2401
- riskLevels: { ...ue.riskLevels, ...z == null ? void 0 : z.riskLevels },
2402
- deviceTypes: { ...ue.deviceTypes, ...z == null ? void 0 : z.deviceTypes },
2403
- columns: { ...ue.columns, ...z == null ? void 0 : z.columns }
2432
+ eventTypes: { ...ge.eventTypes, ...z == null ? void 0 : z.eventTypes },
2433
+ riskLevels: { ...ge.riskLevels, ...z == null ? void 0 : z.riskLevels },
2434
+ deviceTypes: { ...ge.deviceTypes, ...z == null ? void 0 : z.deviceTypes },
2435
+ columns: { ...ge.columns, ...z == null ? void 0 : z.columns }
2404
2436
  }),
2405
2437
  [z]
2406
- ), [g, W] = C(l), [u, B] = C(null), [F, $] = C(w), [T, X] = C(!1), [H, N] = C("table"), k = ve(() => a.filter((d) => nt(d, g)), [a, g]), A = ve(() => k.slice(0, F), [k, F]), Z = ve(() => {
2438
+ ), [g, X] = C(l), [u, V] = C(null), [O, F] = C(w), [E, Z] = C(!1), [B, N] = C("table"), k = fe(() => a.filter((d) => rt(d, g)), [a, g]), A = fe(() => k.slice(0, O), [k, O]), Q = fe(() => {
2407
2439
  if (h)
2408
2440
  return h;
2409
- const d = new Set(a.map((L) => L.ipAddress)), V = new Set(a.map((L) => {
2410
- var se;
2411
- return (se = L.location) == null ? void 0 : se.country;
2441
+ const d = new Set(a.map((L) => L.ipAddress)), Y = new Set(a.map((L) => {
2442
+ var le;
2443
+ return (le = L.location) == null ? void 0 : le.country;
2412
2444
  }).filter(Boolean));
2413
2445
  return {
2414
2446
  totalEvents: a.length,
2415
2447
  successfulLogins: a.filter((L) => L.eventType === "login_success").length,
2416
2448
  failedLogins: a.filter((L) => L.eventType === "login_failed").length,
2417
2449
  uniqueIPs: d.size,
2418
- uniqueCountries: V.size,
2450
+ uniqueCountries: Y.size,
2419
2451
  highRiskEvents: a.filter(
2420
2452
  (L) => L.riskLevel === "high" || L.riskLevel === "critical"
2421
2453
  ).length,
2422
2454
  suspiciousActivities: a.filter((L) => L.eventType === "suspicious_activity").length
2423
2455
  };
2424
- }, [a, h]), Y = P(
2456
+ }, [a, h]), j = I(
2425
2457
  (d) => {
2426
- const V = { ...g, ...d };
2427
- W(V), $(w), K == null || K(V);
2458
+ const Y = { ...g, ...d };
2459
+ X(Y), F(w), J == null || J(Y);
2428
2460
  },
2429
- [g, K, w]
2430
- ), y = P(() => {
2431
- W({}), $(w), K == null || K({});
2432
- }, [K, w]), R = P(
2461
+ [g, J, w]
2462
+ ), y = I(() => {
2463
+ X({}), F(w), J == null || J({});
2464
+ }, [J, w]), $ = I(
2433
2465
  (d) => {
2434
- B(d), _ == null || _(d);
2466
+ V(d), K == null || K(d);
2435
2467
  },
2436
- [_]
2437
- ), J = P(
2468
+ [K]
2469
+ ), H = I(
2438
2470
  (d) => {
2439
- E == null || E(d);
2471
+ D == null || D(d);
2440
2472
  },
2441
- [E]
2442
- ), q = P(() => {
2443
- j == null || j();
2444
- }, [j]), v = P(() => {
2445
- $((d) => d + w);
2473
+ [D]
2474
+ ), U = I(() => {
2475
+ R == null || R();
2476
+ }, [R]), v = I(() => {
2477
+ F((d) => d + w);
2446
2478
  }, [w]);
2447
- pe(
2479
+ me(
2448
2480
  s,
2449
2481
  () => ({
2450
2482
  getFilter: () => g,
2451
- applyFilter: Y,
2483
+ applyFilter: j,
2452
2484
  clearFilters: y,
2453
- export: J,
2454
- refresh: q,
2485
+ export: H,
2486
+ refresh: U,
2455
2487
  getSelectedEntry: () => u,
2456
2488
  getElement: () => m.current
2457
2489
  }),
2458
- [g, Y, y, J, q, u]
2490
+ [g, j, y, H, U, u]
2459
2491
  );
2460
2492
  const x = (d) => {
2461
- var V, L;
2493
+ var Y, L;
2462
2494
  return /* @__PURE__ */ c(
2463
2495
  "tr",
2464
2496
  {
2465
2497
  className: `nice-accesslog-row ${(u == null ? void 0 : u.id) === d.id ? "nice-accesslog-row--selected" : ""} ${d.success ? "" : "nice-accesslog-row--failed"}`,
2466
- onClick: () => R(d),
2498
+ onClick: () => $(d),
2467
2499
  children: [
2468
- /* @__PURE__ */ e("td", { className: "nice-accesslog-cell nice-accesslog-cell--timestamp", children: Me(d.timestamp) }),
2500
+ /* @__PURE__ */ e("td", { className: "nice-accesslog-cell nice-accesslog-cell--timestamp", children: Ue(d.timestamp) }),
2469
2501
  /* @__PURE__ */ e("td", { className: "nice-accesslog-cell nice-accesslog-cell--user", children: /* @__PURE__ */ c("div", { className: "nice-accesslog-user", children: [
2470
2502
  /* @__PURE__ */ e("span", { className: "nice-accesslog-username", children: d.userName || d.userId }),
2471
2503
  d.userEmail && /* @__PURE__ */ e("span", { className: "nice-accesslog-email", children: d.userEmail })
2472
2504
  ] }) }),
2473
2505
  /* @__PURE__ */ e("td", { className: "nice-accesslog-cell nice-accesslog-cell--event", children: /* @__PURE__ */ c("span", { className: `nice-accesslog-event nice-accesslog-event--${d.eventType}`, children: [
2474
- /* @__PURE__ */ e("span", { className: "nice-accesslog-event-icon", children: Ce[d.eventType] }),
2506
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-event-icon", children: Se[d.eventType] }),
2475
2507
  b.eventTypes[d.eventType]
2476
2508
  ] }) }),
2477
2509
  /* @__PURE__ */ c("td", { className: "nice-accesslog-cell nice-accesslog-cell--ip", children: [
2478
2510
  /* @__PURE__ */ e("span", { className: "nice-accesslog-ip", children: d.ipAddress }),
2479
- te && /* @__PURE__ */ e(
2511
+ G && /* @__PURE__ */ e(
2480
2512
  "button",
2481
2513
  {
2482
2514
  type: "button",
2483
2515
  className: "nice-accesslog-block-btn",
2484
- onClick: (se) => {
2485
- se.stopPropagation(), te(d.ipAddress);
2516
+ onClick: (le) => {
2517
+ le.stopPropagation(), G(d.ipAddress);
2486
2518
  },
2487
2519
  title: i("accessLog.blockIp", "Block IP"),
2488
- children: /* @__PURE__ */ e(Cc, { size: 14 })
2520
+ children: /* @__PURE__ */ e(Sc, { size: 14 })
2489
2521
  }
2490
2522
  )
2491
2523
  ] }),
2492
2524
  /* @__PURE__ */ c("td", { className: "nice-accesslog-cell nice-accesslog-cell--location", children: [
2493
- ((V = d.location) == null ? void 0 : V.countryCode) && /* @__PURE__ */ e("span", { className: "nice-accesslog-flag", children: /* @__PURE__ */ e(xc, { size: 14 }) }),
2494
- je(d.location)
2525
+ ((Y = d.location) == null ? void 0 : Y.countryCode) && /* @__PURE__ */ e("span", { className: "nice-accesslog-flag", children: /* @__PURE__ */ e(Dc, { size: 14 }) }),
2526
+ Ye(d.location)
2495
2527
  ] }),
2496
2528
  /* @__PURE__ */ e("td", { className: "nice-accesslog-cell nice-accesslog-cell--device", children: /* @__PURE__ */ c("span", { className: "nice-accesslog-device", children: [
2497
- Re[((L = d.device) == null ? void 0 : L.type) || "unknown"],
2498
- st(d.device)
2529
+ je[((L = d.device) == null ? void 0 : L.type) || "unknown"],
2530
+ lt(d.device)
2499
2531
  ] }) }),
2500
2532
  /* @__PURE__ */ e("td", { className: "nice-accesslog-cell nice-accesslog-cell--risk", children: /* @__PURE__ */ c(
2501
2533
  "span",
2502
2534
  {
2503
2535
  className: `nice-accesslog-risk nice-accesslog-risk--${d.riskLevel}`,
2504
- style: { "--risk-color": Ue(d.riskScore) },
2536
+ style: { "--risk-color": qe(d.riskScore) },
2505
2537
  children: [
2506
2538
  /* @__PURE__ */ e("span", { className: "nice-accesslog-risk-score", children: d.riskScore }),
2507
2539
  /* @__PURE__ */ e("span", { className: "nice-accesslog-risk-label", children: b.riskLevels[d.riskLevel] })
@@ -2512,7 +2544,7 @@ const Te = {
2512
2544
  "span",
2513
2545
  {
2514
2546
  className: `nice-accesslog-status ${d.success ? "nice-accesslog-status--success" : "nice-accesslog-status--failed"}`,
2515
- children: d.success ? /* @__PURE__ */ e(re, { size: 14 }) : /* @__PURE__ */ e(ge, { size: 14 })
2547
+ children: d.success ? /* @__PURE__ */ e(de, { size: 14 }) : /* @__PURE__ */ e(ve, { size: 14 })
2516
2548
  }
2517
2549
  ) })
2518
2550
  ]
@@ -2524,419 +2556,428 @@ const Te = {
2524
2556
  {
2525
2557
  role: "button",
2526
2558
  tabIndex: 0,
2527
- onKeyDown: Ie,
2559
+ onKeyDown: Oe,
2528
2560
  className: `nice-accesslog-timeline-item nice-accesslog-timeline-item--${d.riskLevel}`,
2529
- onClick: () => R(d),
2561
+ onClick: () => $(d),
2530
2562
  children: [
2531
2563
  /* @__PURE__ */ e(
2532
2564
  "div",
2533
2565
  {
2534
2566
  className: "nice-accesslog-timeline-marker",
2535
- style: { background: me[d.riskLevel] }
2567
+ style: { background: be[d.riskLevel] }
2536
2568
  }
2537
2569
  ),
2538
2570
  /* @__PURE__ */ c("div", { className: "nice-accesslog-timeline-content", children: [
2539
2571
  /* @__PURE__ */ c("div", { className: "nice-accesslog-timeline-header", children: [
2540
2572
  /* @__PURE__ */ c("span", { className: "nice-accesslog-timeline-event", children: [
2541
- Ce[d.eventType],
2573
+ Se[d.eventType],
2542
2574
  " ",
2543
2575
  b.eventTypes[d.eventType]
2544
2576
  ] }),
2545
- /* @__PURE__ */ e("span", { className: "nice-accesslog-timeline-time", children: Me(d.timestamp) })
2577
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-timeline-time", children: Ue(d.timestamp) })
2546
2578
  ] }),
2547
2579
  /* @__PURE__ */ c("div", { className: "nice-accesslog-timeline-details", children: [
2548
2580
  /* @__PURE__ */ e("span", { children: d.userName || d.userId }),
2549
2581
  /* @__PURE__ */ e("span", { children: "•" }),
2550
2582
  /* @__PURE__ */ e("span", { children: d.ipAddress }),
2551
2583
  /* @__PURE__ */ e("span", { children: "•" }),
2552
- /* @__PURE__ */ e("span", { children: je(d.location) })
2584
+ /* @__PURE__ */ e("span", { children: Ye(d.location) })
2553
2585
  ] }),
2554
- d.flags && d.flags.length > 0 && /* @__PURE__ */ e("div", { className: "nice-accesslog-timeline-flags", children: d.flags.map((V, L) => /* @__PURE__ */ e("span", { className: "nice-accesslog-flag-badge", children: V }, L)) })
2586
+ d.flags && d.flags.length > 0 && /* @__PURE__ */ e("div", { className: "nice-accesslog-timeline-flags", children: d.flags.map((Y, L) => /* @__PURE__ */ e("span", { className: "nice-accesslog-flag-badge", children: Y }, L)) })
2555
2587
  ] })
2556
2588
  ]
2557
2589
  },
2558
2590
  d.id
2559
2591
  );
2560
- return /* @__PURE__ */ c("div", { ref: m, className: `nice-accesslog ${G}`, ...I, children: [
2561
- /* @__PURE__ */ c("div", { className: "nice-accesslog-header", children: [
2562
- /* @__PURE__ */ c("div", { className: "nice-accesslog-header-left", children: [
2563
- /* @__PURE__ */ e("h2", { className: "nice-accesslog-title", children: b.title }),
2564
- r && /* @__PURE__ */ c("span", { className: "nice-accesslog-realtime-badge", children: [
2565
- /* @__PURE__ */ e(ze, { size: 10 }),
2566
- " ",
2567
- i("accessLog.live", "Live")
2568
- ] })
2569
- ] }),
2570
- /* @__PURE__ */ c("div", { className: "nice-accesslog-header-actions", children: [
2571
- /* @__PURE__ */ c(
2572
- "button",
2573
- {
2574
- type: "button",
2575
- className: "nice-accesslog-btn",
2576
- onClick: q,
2577
- disabled: M,
2578
- children: [
2579
- /* @__PURE__ */ e(Se, { size: 16 }),
2592
+ return /* @__PURE__ */ c(
2593
+ "div",
2594
+ {
2595
+ ref: m,
2596
+ className: `nice-accesslog ${ae}`,
2597
+ "data-testid": W ?? q,
2598
+ ..._,
2599
+ children: [
2600
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-header", children: [
2601
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-header-left", children: [
2602
+ /* @__PURE__ */ e("h2", { className: "nice-accesslog-title", children: b.title }),
2603
+ r && /* @__PURE__ */ c("span", { className: "nice-accesslog-realtime-badge", children: [
2604
+ /* @__PURE__ */ e(_e, { size: 10 }),
2580
2605
  " ",
2581
- b.refresh
2582
- ]
2583
- }
2584
- ),
2585
- /* @__PURE__ */ c("div", { className: "nice-accesslog-export-dropdown", children: [
2586
- /* @__PURE__ */ c("button", { type: "button", className: "nice-accesslog-btn", children: [
2587
- /* @__PURE__ */ e(ye, { size: 16 }),
2588
- " ",
2589
- b.export
2606
+ i("accessLog.live", "Live")
2607
+ ] })
2590
2608
  ] }),
2591
- /* @__PURE__ */ c("div", { className: "nice-accesslog-export-menu", children: [
2592
- /* @__PURE__ */ e("button", { onClick: () => J("csv"), children: "CSV" }),
2593
- /* @__PURE__ */ e("button", { onClick: () => J("json"), children: i("accessLog.json", "JSON") }),
2594
- /* @__PURE__ */ e("button", { onClick: () => J("pdf"), children: "PDF" })
2609
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-header-actions", children: [
2610
+ /* @__PURE__ */ c(
2611
+ "button",
2612
+ {
2613
+ type: "button",
2614
+ className: "nice-accesslog-btn",
2615
+ onClick: U,
2616
+ disabled: ie,
2617
+ children: [
2618
+ /* @__PURE__ */ e(Te, { size: 16 }),
2619
+ " ",
2620
+ b.refresh
2621
+ ]
2622
+ }
2623
+ ),
2624
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-export-dropdown", children: [
2625
+ /* @__PURE__ */ c("button", { type: "button", className: "nice-accesslog-btn", children: [
2626
+ /* @__PURE__ */ e(ke, { size: 16 }),
2627
+ " ",
2628
+ b.export
2629
+ ] }),
2630
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-export-menu", children: [
2631
+ /* @__PURE__ */ e("button", { onClick: () => H("csv"), children: "CSV" }),
2632
+ /* @__PURE__ */ e("button", { onClick: () => H("json"), children: i("accessLog.json", "JSON") }),
2633
+ /* @__PURE__ */ e("button", { onClick: () => H("pdf"), children: "PDF" })
2634
+ ] })
2635
+ ] })
2595
2636
  ] })
2596
- ] })
2597
- ] })
2598
- ] }),
2599
- D && /* @__PURE__ */ c("div", { className: "nice-accesslog-stats", children: [
2600
- /* @__PURE__ */ c("div", { className: "nice-accesslog-stat", children: [
2601
- /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: Z.totalEvents }),
2602
- /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.totalEvents", "Total Events") })
2603
- ] }),
2604
- /* @__PURE__ */ c("div", { className: "nice-accesslog-stat nice-accesslog-stat--success", children: [
2605
- /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: Z.successfulLogins }),
2606
- /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.successful", "Successful") })
2607
- ] }),
2608
- /* @__PURE__ */ c("div", { className: "nice-accesslog-stat nice-accesslog-stat--failed", children: [
2609
- /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: Z.failedLogins }),
2610
- /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.failed", "Failed") })
2611
- ] }),
2612
- /* @__PURE__ */ c("div", { className: "nice-accesslog-stat", children: [
2613
- /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: Z.uniqueIPs }),
2614
- /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.uniqueIps", "Unique IPs") })
2615
- ] }),
2616
- /* @__PURE__ */ c("div", { className: "nice-accesslog-stat", children: [
2617
- /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: Z.uniqueCountries }),
2618
- /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.countries", "Countries") })
2619
- ] }),
2620
- /* @__PURE__ */ c("div", { className: "nice-accesslog-stat nice-accesslog-stat--warning", children: [
2621
- /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: Z.highRiskEvents }),
2622
- /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.highRisk", "High Risk") })
2623
- ] })
2624
- ] }),
2625
- /* @__PURE__ */ c("div", { className: "nice-accesslog-filters", children: [
2626
- /* @__PURE__ */ c("div", { className: "nice-accesslog-filters-row", children: [
2627
- /* @__PURE__ */ c("div", { className: "nice-accesslog-search", children: [
2628
- /* @__PURE__ */ e("span", { className: "nice-accesslog-search-icon", children: /* @__PURE__ */ e(fe, { size: 16 }) }),
2629
- /* @__PURE__ */ e(
2630
- "input",
2631
- {
2632
- type: "text",
2633
- placeholder: b.search,
2634
- value: g.searchQuery || "",
2635
- onChange: (d) => Y({ searchQuery: d.target.value })
2636
- }
2637
- )
2638
2637
  ] }),
2639
- /* @__PURE__ */ c("div", { className: "nice-accesslog-filter-quick", children: [
2640
- /* @__PURE__ */ e(
2638
+ T && /* @__PURE__ */ c("div", { className: "nice-accesslog-stats", children: [
2639
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-stat", children: [
2640
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: Q.totalEvents }),
2641
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.totalEvents", "Total Events") })
2642
+ ] }),
2643
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-stat nice-accesslog-stat--success", children: [
2644
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: Q.successfulLogins }),
2645
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.successful", "Successful") })
2646
+ ] }),
2647
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-stat nice-accesslog-stat--failed", children: [
2648
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: Q.failedLogins }),
2649
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.failed", "Failed") })
2650
+ ] }),
2651
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-stat", children: [
2652
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: Q.uniqueIPs }),
2653
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.uniqueIps", "Unique IPs") })
2654
+ ] }),
2655
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-stat", children: [
2656
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: Q.uniqueCountries }),
2657
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.countries", "Countries") })
2658
+ ] }),
2659
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-stat nice-accesslog-stat--warning", children: [
2660
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: Q.highRiskEvents }),
2661
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.highRisk", "High Risk") })
2662
+ ] })
2663
+ ] }),
2664
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-filters", children: [
2665
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-filters-row", children: [
2666
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-search", children: [
2667
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-search-icon", children: /* @__PURE__ */ e(we, { size: 16 }) }),
2668
+ /* @__PURE__ */ e(
2669
+ "input",
2670
+ {
2671
+ type: "text",
2672
+ placeholder: b.search,
2673
+ value: g.searchQuery || "",
2674
+ onChange: (d) => j({ searchQuery: d.target.value })
2675
+ }
2676
+ )
2677
+ ] }),
2678
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-filter-quick", children: [
2679
+ /* @__PURE__ */ e(
2680
+ "button",
2681
+ {
2682
+ type: "button",
2683
+ className: `nice-accesslog-filter-chip ${g.failedOnly ? "nice-accesslog-filter-chip--active" : ""}`,
2684
+ onClick: () => j({ failedOnly: !g.failedOnly, successOnly: !1 }),
2685
+ children: i("accessLog.failedOnly", "Failed Only")
2686
+ }
2687
+ ),
2688
+ /* @__PURE__ */ e(
2689
+ "button",
2690
+ {
2691
+ type: "button",
2692
+ className: `nice-accesslog-filter-chip ${(ce = g.riskLevels) != null && ce.includes("high") || (te = g.riskLevels) != null && te.includes("critical") ? "nice-accesslog-filter-chip--active" : ""}`,
2693
+ onClick: () => {
2694
+ var d;
2695
+ return j({
2696
+ riskLevels: (d = g.riskLevels) != null && d.includes("high") ? [] : ["high", "critical"]
2697
+ });
2698
+ },
2699
+ children: i("accessLog.highRisk", "High Risk")
2700
+ }
2701
+ ),
2702
+ /* @__PURE__ */ e(
2703
+ "button",
2704
+ {
2705
+ type: "button",
2706
+ className: "nice-accesslog-filter-toggle",
2707
+ onClick: () => Z(!E),
2708
+ children: E ? /* @__PURE__ */ c(ne, { children: [
2709
+ /* @__PURE__ */ e(kc, { size: 14 }),
2710
+ " ",
2711
+ i("accessLog.less", "Less")
2712
+ ] }) : /* @__PURE__ */ c(ne, { children: [
2713
+ /* @__PURE__ */ e(Ie, { size: 14 }),
2714
+ " ",
2715
+ i("accessLog.more", "More")
2716
+ ] })
2717
+ }
2718
+ )
2719
+ ] })
2720
+ ] }),
2721
+ E && /* @__PURE__ */ c("div", { className: "nice-accesslog-filters-expanded", children: [
2722
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-filter-group", children: [
2723
+ /* @__PURE__ */ e("label", { children: i("accessLog.eventType", "Event Type") }),
2724
+ /* @__PURE__ */ e(
2725
+ "select",
2726
+ {
2727
+ multiple: !0,
2728
+ value: g.eventTypes || [],
2729
+ onChange: (d) => {
2730
+ const Y = Array.from(
2731
+ d.target.selectedOptions,
2732
+ (L) => L.value
2733
+ );
2734
+ j({ eventTypes: Y.length ? Y : void 0 });
2735
+ },
2736
+ children: Object.entries(b.eventTypes).map(([d, Y]) => /* @__PURE__ */ e("option", { value: d, children: Y }, d))
2737
+ }
2738
+ )
2739
+ ] }),
2740
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-filter-group", children: [
2741
+ /* @__PURE__ */ e("label", { children: i("accessLog.dateRange", "Date Range") }),
2742
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-date-range", children: [
2743
+ /* @__PURE__ */ e(
2744
+ "input",
2745
+ {
2746
+ type: "date",
2747
+ value: g.startDate ? new Date(g.startDate).toISOString().split("T")[0] : "",
2748
+ onChange: (d) => j({ startDate: d.target.value || void 0 })
2749
+ }
2750
+ ),
2751
+ /* @__PURE__ */ e("span", { children: i("accessLog.to", "to") }),
2752
+ /* @__PURE__ */ e(
2753
+ "input",
2754
+ {
2755
+ type: "date",
2756
+ value: g.endDate ? new Date(g.endDate).toISOString().split("T")[0] : "",
2757
+ onChange: (d) => j({ endDate: d.target.value || void 0 })
2758
+ }
2759
+ )
2760
+ ] })
2761
+ ] }),
2762
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-filter-group", children: [
2763
+ /* @__PURE__ */ e("label", { children: i("accessLog.ipAddress", "IP Address") }),
2764
+ /* @__PURE__ */ e(
2765
+ "input",
2766
+ {
2767
+ type: "text",
2768
+ placeholder: "e.g., 192.168",
2769
+ value: g.ipAddress || "",
2770
+ onChange: (d) => j({ ipAddress: d.target.value || void 0 })
2771
+ }
2772
+ )
2773
+ ] }),
2774
+ /* @__PURE__ */ e(
2775
+ "button",
2776
+ {
2777
+ type: "button",
2778
+ className: "nice-accesslog-clear-filters",
2779
+ onClick: y,
2780
+ children: i("accessLog.clearAllFilters", "Clear All Filters")
2781
+ }
2782
+ )
2783
+ ] })
2784
+ ] }),
2785
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-tabs", children: [
2786
+ /* @__PURE__ */ c(
2641
2787
  "button",
2642
2788
  {
2643
2789
  type: "button",
2644
- className: `nice-accesslog-filter-chip ${g.failedOnly ? "nice-accesslog-filter-chip--active" : ""}`,
2645
- onClick: () => Y({ failedOnly: !g.failedOnly, successOnly: !1 }),
2646
- children: i("accessLog.failedOnly", "Failed Only")
2790
+ className: `nice-accesslog-tab ${B === "table" ? "nice-accesslog-tab--active" : ""}`,
2791
+ onClick: () => N("table"),
2792
+ children: [
2793
+ /* @__PURE__ */ e(Cc, { size: 16 }),
2794
+ " ",
2795
+ i("accessLog.table", "Table")
2796
+ ]
2647
2797
  }
2648
2798
  ),
2649
- /* @__PURE__ */ e(
2799
+ /* @__PURE__ */ c(
2650
2800
  "button",
2651
2801
  {
2652
2802
  type: "button",
2653
- className: `nice-accesslog-filter-chip ${(ee = g.riskLevels) != null && ee.includes("high") || (ce = g.riskLevels) != null && ce.includes("critical") ? "nice-accesslog-filter-chip--active" : ""}`,
2654
- onClick: () => {
2655
- var d;
2656
- return Y({
2657
- riskLevels: (d = g.riskLevels) != null && d.includes("high") ? [] : ["high", "critical"]
2658
- });
2659
- },
2660
- children: i("accessLog.highRisk", "High Risk")
2803
+ className: `nice-accesslog-tab ${B === "timeline" ? "nice-accesslog-tab--active" : ""}`,
2804
+ onClick: () => N("timeline"),
2805
+ children: [
2806
+ /* @__PURE__ */ e(xc, { size: 16 }),
2807
+ " ",
2808
+ b.timeline
2809
+ ]
2661
2810
  }
2662
2811
  ),
2663
- /* @__PURE__ */ e(
2812
+ f && /* @__PURE__ */ c(
2664
2813
  "button",
2665
2814
  {
2666
2815
  type: "button",
2667
- className: "nice-accesslog-filter-toggle",
2668
- onClick: () => X(!T),
2669
- children: T ? /* @__PURE__ */ c(ie, { children: [
2670
- /* @__PURE__ */ e(yc, { size: 14 }),
2671
- " ",
2672
- i("accessLog.less", "Less")
2673
- ] }) : /* @__PURE__ */ c(ie, { children: [
2674
- /* @__PURE__ */ e(Ae, { size: 14 }),
2816
+ className: `nice-accesslog-tab ${B === "map" ? "nice-accesslog-tab--active" : ""}`,
2817
+ onClick: () => N("map"),
2818
+ children: [
2819
+ /* @__PURE__ */ e(Me, { size: 16 }),
2675
2820
  " ",
2676
- i("accessLog.more", "More")
2677
- ] })
2821
+ b.map
2822
+ ]
2678
2823
  }
2679
- )
2680
- ] })
2681
- ] }),
2682
- T && /* @__PURE__ */ c("div", { className: "nice-accesslog-filters-expanded", children: [
2683
- /* @__PURE__ */ c("div", { className: "nice-accesslog-filter-group", children: [
2684
- /* @__PURE__ */ e("label", { children: i("accessLog.eventType", "Event Type") }),
2685
- /* @__PURE__ */ e(
2686
- "select",
2824
+ ),
2825
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-count", children: i("accessLog.entries", "{filteredEntries} entries").replace(
2826
+ "{filteredEntries}",
2827
+ String(k.length)
2828
+ ) })
2829
+ ] }),
2830
+ /* @__PURE__ */ e("div", { className: "nice-accesslog-content", children: ie ? /* @__PURE__ */ c("div", { className: "nice-accesslog-loading", children: [
2831
+ /* @__PURE__ */ e("div", { className: "nice-accesslog-spinner" }),
2832
+ i("accessLog.loadingAccessLogs", "Loading access logs...")
2833
+ ] }) : k.length === 0 ? /* @__PURE__ */ c("div", { className: "nice-accesslog-empty", children: [
2834
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-empty-icon", children: /* @__PURE__ */ e(ec, { size: 32 }) }),
2835
+ /* @__PURE__ */ e("span", { children: b.noResults })
2836
+ ] }) : /* @__PURE__ */ c(ne, { children: [
2837
+ B === "table" && /* @__PURE__ */ e("div", { className: "nice-accesslog-table-wrapper", children: /* @__PURE__ */ c("table", { className: "nice-accesslog-table", children: [
2838
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { children: [
2839
+ /* @__PURE__ */ e("th", { children: b.columns.timestamp }),
2840
+ /* @__PURE__ */ e("th", { children: b.columns.user }),
2841
+ /* @__PURE__ */ e("th", { children: b.columns.event }),
2842
+ /* @__PURE__ */ e("th", { children: b.columns.ip }),
2843
+ /* @__PURE__ */ e("th", { children: b.columns.location }),
2844
+ /* @__PURE__ */ e("th", { children: b.columns.device }),
2845
+ /* @__PURE__ */ e("th", { children: b.columns.risk }),
2846
+ /* @__PURE__ */ e("th", { children: b.columns.status })
2847
+ ] }) }),
2848
+ /* @__PURE__ */ e("tbody", { children: A.map(x) })
2849
+ ] }) }),
2850
+ B === "timeline" && /* @__PURE__ */ e("div", { className: "nice-accesslog-timeline", children: A.map(S) }),
2851
+ B === "map" && /* @__PURE__ */ e("div", { className: "nice-accesslog-map", children: /* @__PURE__ */ c("div", { className: "nice-accesslog-map-placeholder", children: [
2852
+ /* @__PURE__ */ e(Me, { size: 16 }),
2853
+ " ",
2854
+ i(
2855
+ "accessLog.geographicVisualizationWouldRenderHere",
2856
+ "Geographic visualization would render here"
2857
+ )
2858
+ ] }) }),
2859
+ O < k.length && /* @__PURE__ */ e(
2860
+ "button",
2687
2861
  {
2688
- multiple: !0,
2689
- value: g.eventTypes || [],
2690
- onChange: (d) => {
2691
- const V = Array.from(
2692
- d.target.selectedOptions,
2693
- (L) => L.value
2694
- );
2695
- Y({ eventTypes: V.length ? V : void 0 });
2696
- },
2697
- children: Object.entries(b.eventTypes).map(([d, V]) => /* @__PURE__ */ e("option", { value: d, children: V }, d))
2862
+ type: "button",
2863
+ className: "nice-accesslog-show-more",
2864
+ onClick: v,
2865
+ children: i("accessLog.remaining", "{showMore} ({filteredEntries} remaining)").replace("{showMore}", String(b.showMore)).replace("{filteredEntries}", String(k.length - O))
2698
2866
  }
2699
2867
  )
2700
- ] }),
2701
- /* @__PURE__ */ c("div", { className: "nice-accesslog-filter-group", children: [
2702
- /* @__PURE__ */ e("label", { children: i("accessLog.dateRange", "Date Range") }),
2703
- /* @__PURE__ */ c("div", { className: "nice-accesslog-date-range", children: [
2704
- /* @__PURE__ */ e(
2705
- "input",
2706
- {
2707
- type: "date",
2708
- value: g.startDate ? new Date(g.startDate).toISOString().split("T")[0] : "",
2709
- onChange: (d) => Y({ startDate: d.target.value || void 0 })
2710
- }
2711
- ),
2712
- /* @__PURE__ */ e("span", { children: i("accessLog.to", "to") }),
2868
+ ] }) }),
2869
+ P && u && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail", children: [
2870
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-header", children: [
2871
+ /* @__PURE__ */ e("h3", { children: b.details }),
2713
2872
  /* @__PURE__ */ e(
2714
- "input",
2873
+ "button",
2715
2874
  {
2716
- type: "date",
2717
- value: g.endDate ? new Date(g.endDate).toISOString().split("T")[0] : "",
2718
- onChange: (d) => Y({ endDate: d.target.value || void 0 })
2875
+ type: "button",
2876
+ className: "nice-accesslog-detail-close",
2877
+ onClick: () => V(null),
2878
+ children: /* @__PURE__ */ e(Ce, { size: 16 })
2719
2879
  }
2720
2880
  )
2721
- ] })
2722
- ] }),
2723
- /* @__PURE__ */ c("div", { className: "nice-accesslog-filter-group", children: [
2724
- /* @__PURE__ */ e("label", { children: i("accessLog.ipAddress", "IP Address") }),
2725
- /* @__PURE__ */ e(
2726
- "input",
2727
- {
2728
- type: "text",
2729
- placeholder: "e.g., 192.168",
2730
- value: g.ipAddress || "",
2731
- onChange: (d) => Y({ ipAddress: d.target.value || void 0 })
2732
- }
2733
- )
2734
- ] }),
2735
- /* @__PURE__ */ e(
2736
- "button",
2737
- {
2738
- type: "button",
2739
- className: "nice-accesslog-clear-filters",
2740
- onClick: y,
2741
- children: i("accessLog.clearAllFilters", "Clear All Filters")
2742
- }
2743
- )
2744
- ] })
2745
- ] }),
2746
- /* @__PURE__ */ c("div", { className: "nice-accesslog-tabs", children: [
2747
- /* @__PURE__ */ c(
2748
- "button",
2749
- {
2750
- type: "button",
2751
- className: `nice-accesslog-tab ${H === "table" ? "nice-accesslog-tab--active" : ""}`,
2752
- onClick: () => N("table"),
2753
- children: [
2754
- /* @__PURE__ */ e(wc, { size: 16 }),
2755
- " ",
2756
- i("accessLog.table", "Table")
2757
- ]
2758
- }
2759
- ),
2760
- /* @__PURE__ */ c(
2761
- "button",
2762
- {
2763
- type: "button",
2764
- className: `nice-accesslog-tab ${H === "timeline" ? "nice-accesslog-tab--active" : ""}`,
2765
- onClick: () => N("timeline"),
2766
- children: [
2767
- /* @__PURE__ */ e(kc, { size: 16 }),
2768
- " ",
2769
- b.timeline
2770
- ]
2771
- }
2772
- ),
2773
- f && /* @__PURE__ */ c(
2774
- "button",
2775
- {
2776
- type: "button",
2777
- className: `nice-accesslog-tab ${H === "map" ? "nice-accesslog-tab--active" : ""}`,
2778
- onClick: () => N("map"),
2779
- children: [
2780
- /* @__PURE__ */ e($e, { size: 16 }),
2781
- " ",
2782
- b.map
2783
- ]
2784
- }
2785
- ),
2786
- /* @__PURE__ */ e("span", { className: "nice-accesslog-count", children: i("accessLog.entries", "{filteredEntries} entries").replace(
2787
- "{filteredEntries}",
2788
- String(k.length)
2789
- ) })
2790
- ] }),
2791
- /* @__PURE__ */ e("div", { className: "nice-accesslog-content", children: M ? /* @__PURE__ */ c("div", { className: "nice-accesslog-loading", children: [
2792
- /* @__PURE__ */ e("div", { className: "nice-accesslog-spinner" }),
2793
- i("accessLog.loadingAccessLogs", "Loading access logs...")
2794
- ] }) : k.length === 0 ? /* @__PURE__ */ c("div", { className: "nice-accesslog-empty", children: [
2795
- /* @__PURE__ */ e("span", { className: "nice-accesslog-empty-icon", children: /* @__PURE__ */ e(Ze, { size: 32 }) }),
2796
- /* @__PURE__ */ e("span", { children: b.noResults })
2797
- ] }) : /* @__PURE__ */ c(ie, { children: [
2798
- H === "table" && /* @__PURE__ */ e("div", { className: "nice-accesslog-table-wrapper", children: /* @__PURE__ */ c("table", { className: "nice-accesslog-table", children: [
2799
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { children: [
2800
- /* @__PURE__ */ e("th", { children: b.columns.timestamp }),
2801
- /* @__PURE__ */ e("th", { children: b.columns.user }),
2802
- /* @__PURE__ */ e("th", { children: b.columns.event }),
2803
- /* @__PURE__ */ e("th", { children: b.columns.ip }),
2804
- /* @__PURE__ */ e("th", { children: b.columns.location }),
2805
- /* @__PURE__ */ e("th", { children: b.columns.device }),
2806
- /* @__PURE__ */ e("th", { children: b.columns.risk }),
2807
- /* @__PURE__ */ e("th", { children: b.columns.status })
2808
- ] }) }),
2809
- /* @__PURE__ */ e("tbody", { children: A.map(x) })
2810
- ] }) }),
2811
- H === "timeline" && /* @__PURE__ */ e("div", { className: "nice-accesslog-timeline", children: A.map(S) }),
2812
- H === "map" && /* @__PURE__ */ e("div", { className: "nice-accesslog-map", children: /* @__PURE__ */ c("div", { className: "nice-accesslog-map-placeholder", children: [
2813
- /* @__PURE__ */ e($e, { size: 16 }),
2814
- " ",
2815
- i(
2816
- "accessLog.geographicVisualizationWouldRenderHere",
2817
- "Geographic visualization would render here"
2818
- )
2819
- ] }) }),
2820
- F < k.length && /* @__PURE__ */ e(
2821
- "button",
2822
- {
2823
- type: "button",
2824
- className: "nice-accesslog-show-more",
2825
- onClick: v,
2826
- children: i("accessLog.remaining", "{showMore} ({filteredEntries} remaining)").replace("{showMore}", String(b.showMore)).replace("{filteredEntries}", String(k.length - F))
2827
- }
2828
- )
2829
- ] }) }),
2830
- O && u && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail", children: [
2831
- /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-header", children: [
2832
- /* @__PURE__ */ e("h3", { children: b.details }),
2833
- /* @__PURE__ */ e(
2834
- "button",
2835
- {
2836
- type: "button",
2837
- className: "nice-accesslog-detail-close",
2838
- onClick: () => B(null),
2839
- children: /* @__PURE__ */ e(we, { size: 16 })
2840
- }
2841
- )
2842
- ] }),
2843
- /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-content", children: [
2844
- /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2845
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.eventId", "Event ID") }),
2846
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: u.id })
2847
- ] }),
2848
- /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2849
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.timestamp", "Timestamp") }),
2850
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: new Date(u.timestamp).toISOString() })
2851
- ] }),
2852
- /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2853
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.user", "User") }),
2854
- /* @__PURE__ */ c("span", { className: "nice-accesslog-detail-value", children: [
2855
- u.userName,
2856
- " (",
2857
- u.userId,
2858
- ")",
2859
- u.userEmail && /* @__PURE__ */ e("div", { children: u.userEmail })
2860
- ] })
2861
- ] }),
2862
- /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2863
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.eventType", "Event Type") }),
2864
- /* @__PURE__ */ c("span", { className: "nice-accesslog-detail-value", children: [
2865
- Ce[u.eventType],
2866
- " ",
2867
- b.eventTypes[u.eventType]
2868
- ] })
2869
- ] }),
2870
- /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2871
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.ipAddress", "IP Address") }),
2872
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: u.ipAddress })
2873
- ] }),
2874
- u.location && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2875
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.location", "Location") }),
2876
- /* @__PURE__ */ c("span", { className: "nice-accesslog-detail-value", children: [
2877
- u.location.city,
2878
- ", ",
2879
- u.location.region,
2880
- ",",
2881
- " ",
2882
- u.location.country,
2883
- u.location.latitude && u.location.longitude && /* @__PURE__ */ c("div", { className: "nice-accesslog-coords", children: [
2884
- "(",
2885
- u.location.latitude,
2886
- ", ",
2887
- u.location.longitude,
2888
- ")"
2889
- ] })
2890
- ] })
2891
- ] }),
2892
- u.device && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2893
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.device", "Device") }),
2894
- /* @__PURE__ */ c("span", { className: "nice-accesslog-detail-value", children: [
2895
- Re[u.device.type],
2896
- " ",
2897
- u.device.os,
2898
- " ",
2899
- u.device.osVersion,
2900
- /* @__PURE__ */ c("div", { children: [
2901
- u.device.browser,
2902
- " ",
2903
- u.device.browserVersion
2881
+ ] }),
2882
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-content", children: [
2883
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2884
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.eventId", "Event ID") }),
2885
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: u.id })
2886
+ ] }),
2887
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2888
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.timestamp", "Timestamp") }),
2889
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: new Date(u.timestamp).toISOString() })
2890
+ ] }),
2891
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2892
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.user", "User") }),
2893
+ /* @__PURE__ */ c("span", { className: "nice-accesslog-detail-value", children: [
2894
+ u.userName,
2895
+ " (",
2896
+ u.userId,
2897
+ ")",
2898
+ u.userEmail && /* @__PURE__ */ e("div", { children: u.userEmail })
2899
+ ] })
2904
2900
  ] }),
2905
- u.device.fingerprint && /* @__PURE__ */ e("div", { className: "nice-accesslog-fingerprint", children: i("accessLog.fingerprint", "Fingerprint: {fingerprint}").replace(
2906
- "{fingerprint}",
2907
- String(u.device.fingerprint)
2908
- ) })
2901
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2902
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.eventType", "Event Type") }),
2903
+ /* @__PURE__ */ c("span", { className: "nice-accesslog-detail-value", children: [
2904
+ Se[u.eventType],
2905
+ " ",
2906
+ b.eventTypes[u.eventType]
2907
+ ] })
2908
+ ] }),
2909
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2910
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.ipAddress", "IP Address") }),
2911
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: u.ipAddress })
2912
+ ] }),
2913
+ u.location && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2914
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.location", "Location") }),
2915
+ /* @__PURE__ */ c("span", { className: "nice-accesslog-detail-value", children: [
2916
+ u.location.city,
2917
+ ", ",
2918
+ u.location.region,
2919
+ ",",
2920
+ " ",
2921
+ u.location.country,
2922
+ u.location.latitude && u.location.longitude && /* @__PURE__ */ c("div", { className: "nice-accesslog-coords", children: [
2923
+ "(",
2924
+ u.location.latitude,
2925
+ ", ",
2926
+ u.location.longitude,
2927
+ ")"
2928
+ ] })
2929
+ ] })
2930
+ ] }),
2931
+ u.device && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2932
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.device", "Device") }),
2933
+ /* @__PURE__ */ c("span", { className: "nice-accesslog-detail-value", children: [
2934
+ je[u.device.type],
2935
+ " ",
2936
+ u.device.os,
2937
+ " ",
2938
+ u.device.osVersion,
2939
+ /* @__PURE__ */ c("div", { children: [
2940
+ u.device.browser,
2941
+ " ",
2942
+ u.device.browserVersion
2943
+ ] }),
2944
+ u.device.fingerprint && /* @__PURE__ */ e("div", { className: "nice-accesslog-fingerprint", children: i("accessLog.fingerprint", "Fingerprint: {fingerprint}").replace(
2945
+ "{fingerprint}",
2946
+ String(u.device.fingerprint)
2947
+ ) })
2948
+ ] })
2949
+ ] }),
2950
+ /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2951
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.riskScore", "Risk Score") }),
2952
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: /* @__PURE__ */ c("span", { style: { color: qe(u.riskScore) }, children: [
2953
+ u.riskScore,
2954
+ "/100 (",
2955
+ b.riskLevels[u.riskLevel],
2956
+ ")"
2957
+ ] }) })
2958
+ ] }),
2959
+ u.flags && u.flags.length > 0 && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2960
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.flags", "Flags") }),
2961
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: u.flags.map((d, Y) => /* @__PURE__ */ e("span", { className: "nice-accesslog-flag-badge", children: d }, Y)) })
2962
+ ] }),
2963
+ u.details && Object.keys(u.details).length > 0 && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2964
+ /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.additionalDetails", "Additional Details") }),
2965
+ /* @__PURE__ */ e("pre", { className: "nice-accesslog-detail-json", children: JSON.stringify(u.details, null, 2) })
2966
+ ] })
2909
2967
  ] })
2910
- ] }),
2911
- /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2912
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.riskScore", "Risk Score") }),
2913
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: /* @__PURE__ */ c("span", { style: { color: Ue(u.riskScore) }, children: [
2914
- u.riskScore,
2915
- "/100 (",
2916
- b.riskLevels[u.riskLevel],
2917
- ")"
2918
- ] }) })
2919
- ] }),
2920
- u.flags && u.flags.length > 0 && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2921
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.flags", "Flags") }),
2922
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: u.flags.map((d, V) => /* @__PURE__ */ e("span", { className: "nice-accesslog-flag-badge", children: d }, V)) })
2923
- ] }),
2924
- u.details && Object.keys(u.details).length > 0 && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
2925
- /* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.additionalDetails", "Additional Details") }),
2926
- /* @__PURE__ */ e("pre", { className: "nice-accesslog-detail-json", children: JSON.stringify(u.details, null, 2) })
2927
2968
  ] })
2928
- ] })
2929
- ] })
2930
- ] });
2969
+ ]
2970
+ }
2971
+ );
2931
2972
  }
2932
2973
  ),
2933
2974
  { displayName: "NiceAccessLog" }
2934
2975
  );
2935
2976
  export {
2936
- bt as NiceAccessLog,
2937
- pt as NiceAuditTrail,
2938
- ut as NiceContractEditor,
2939
- ht as NiceDataExportCenter,
2940
- mt as NiceGDPRConsent,
2941
- gt as NiceGlobalSearch
2977
+ Nt as NiceAccessLog,
2978
+ mt as NiceAuditTrail,
2979
+ gt as NiceContractEditor,
2980
+ ut as NiceDataExportCenter,
2981
+ bt as NiceGDPRConsent,
2982
+ vt as NiceGlobalSearch
2942
2983
  };