@feedmepos/mf-hrm-portal 2.0.24-dev.13 → 2.0.24-dev.15

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 (34) hide show
  1. package/dist/AuditLogList-iF38fTa4.js +1145 -0
  2. package/dist/{EmployeeList-DSotV-7r.js → EmployeeList-b-4gXdLJ.js} +78 -78
  3. package/dist/{FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js → FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js} +1 -1
  4. package/dist/{Main-DiqWFbg6.js → Main-CpO2af9k.js} +6 -6
  5. package/dist/{Main-pf8KD_ew.js → Main-DlPd49tp.js} +9 -9
  6. package/dist/{Main-Du7lPAnd.js → Main-DoJGIWDy.js} +6 -6
  7. package/dist/{PermissionSetList-BkP_yWYv.js → PermissionSetList-DPmzr_cs.js} +6 -6
  8. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dzmeg7P-.js +3457 -0
  9. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-CwHZrP4X.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-DX6io2IP.js} +1 -1
  10. package/dist/{RoleList-i0HAJQ9A.js → RoleList-C2viOZh7.js} +7 -7
  11. package/dist/SelectFilter-ATOm0hdn.js +269 -0
  12. package/dist/{TeamMemberList-BUCacyhN.js → TeamMemberList-C4nZL41o.js} +12 -12
  13. package/dist/{TimesheetList-BASAcu4x.js → TimesheetList--xN0jMmv.js} +10 -10
  14. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_d7ed31d7_lang-BcXV31j3.js → TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-CzA-8C42.js} +2 -2
  15. package/dist/{app-BFiZ8ZXX.js → app-BsMht81f.js} +222 -203
  16. package/dist/app.js +1 -1
  17. package/dist/{dayjs.min-UHgMNuVS.js → dayjs.min-CmJz0_dg.js} +1 -1
  18. package/dist/{employee-CzYb5bvh.js → employee-BaAu5Ucl.js} +3 -3
  19. package/dist/{iteration-BjUlb3UE.js → iteration-Cch1v6Fm.js} +1 -1
  20. package/dist/{lodash-B-oxtG88.js → lodash-BcG3T12V.js} +1 -1
  21. package/dist/{rule-C0LG2tV9.js → rule-BmIUTy0V.js} +2 -2
  22. package/dist/src/api/audit-log/index.d.ts +17 -0
  23. package/dist/src/components/form/SelectFilter.vue.d.ts +3 -0
  24. package/dist/src/stores/team.d.ts +4 -1
  25. package/dist/src/views/audit-log/locales/index.d.ts +24 -16
  26. package/dist/style.css +1 -1
  27. package/dist/tsconfig.app.tsbuildinfo +1 -1
  28. package/dist/{useAppStore-C59yWeEW.js → useAppStore-efPeNcbk.js} +1 -1
  29. package/dist/{useLoading-CTdlaX4S.js → useLoading-DGQMmdnf.js} +1 -1
  30. package/dist/{useReportPermissions-BZcS5o0u.js → useReportPermissions-BeKk9bUR.js} +3 -3
  31. package/package.json +2 -2
  32. package/dist/AuditLogList-_jMTq9y8.js +0 -1037
  33. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BURg3zZO.js +0 -3457
  34. package/dist/SelectFilter-DUj7GBtT.js +0 -251
@@ -0,0 +1,1145 @@
1
+ import { defineComponent as Xe, ref as f, computed as h, onMounted as Vt, onBeforeUnmount as Et, watch as Q, resolveComponent as C, createElementBlock as M, openBlock as y, createBlock as Z, createCommentVNode as N, createElementVNode as a, Fragment as ee, renderList as re, withCtx as K, createVNode as p, toDisplayString as i, unref as n, nextTick as Rt } from "vue";
2
+ import { d as x } from "./dayjs.min-CmJz0_dg.js";
3
+ import { useI18n as Qe, useCoreStore as Ct } from "@feedmepos/mf-common";
4
+ import { G as He, _ as Ut } from "./app-BsMht81f.js";
5
+ import { components as We } from "@feedmepos/ui-library";
6
+ import { g as Ae, b as Fe } from "./iteration-Cch1v6Fm.js";
7
+ import { S as be, _ as $t } from "./SelectFilter-ATOm0hdn.js";
8
+ import { _ as Nt } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
9
+ import { _ as Yt } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
10
+ import { t as Bt, p as Je } from "./rule-BmIUTy0V.js";
11
+ import { defineStore as Kt } from "pinia";
12
+ const ue = [
13
+ { key: "all", label: "All", subjectPrefixes: [] },
14
+ { key: "inventory", label: "Inventory", subjectPrefixes: ["business::inventory", "inventory"] },
15
+ { key: "report", label: "Report", subjectPrefixes: ["business::report", "report"] },
16
+ { key: "hrm", label: "HRM", subjectPrefixes: ["business::hrm", "hrm"] },
17
+ { key: "payment", label: "Payment", subjectPrefixes: ["business::payment", "payment"] },
18
+ { key: "menu", label: "Menu", subjectPrefixes: ["business::menu", "menu"] },
19
+ { key: "crm", label: "CRM", subjectPrefixes: ["business::crm", "crm"] }
20
+ // Add more as modules are revamped with new actionguard:
21
+ // { key: 'restaurantOperation', label: 'Restaurant Operation', subjectPrefixes: ['restaurant'] },
22
+ ], Me = "/audit-logs", pe = {
23
+ async count(l) {
24
+ var L, j, I, w, s;
25
+ const o = {
26
+ ...l != null && l.from ? { from: l.from } : {},
27
+ ...l != null && l.to ? { to: l.to } : {},
28
+ ...(L = l == null ? void 0 : l.userIds) != null && L.length ? { userIds: l.userIds } : {},
29
+ ...(j = l == null ? void 0 : l.subjects) != null && j.length ? { subjects: l.subjects } : {},
30
+ ...(I = l == null ? void 0 : l.subjectPrefixes) != null && I.length ? { subjectPrefixes: l.subjectPrefixes } : {},
31
+ ...(w = l == null ? void 0 : l.actions) != null && w.length ? { actions: l.actions } : {},
32
+ ...(s = l == null ? void 0 : l.outcomes) != null && s.length ? { outcomes: l.outcomes } : {},
33
+ ...l != null && l.feedmeAdminActors ? { feedmeAdminActors: !0 } : {}
34
+ };
35
+ return (await Ae(
36
+ await Fe().get(`${Me}/count`, {
37
+ params: o,
38
+ paramsSerializer: (D) => {
39
+ const P = new URLSearchParams();
40
+ for (const [v, A] of Object.entries(D))
41
+ if (Array.isArray(A))
42
+ for (const z of A) P.append(v, String(z));
43
+ else A != null && P.append(v, String(A));
44
+ return P.toString();
45
+ }
46
+ })
47
+ )).total;
48
+ },
49
+ async read(l) {
50
+ var c, L, j, I, w;
51
+ const o = {
52
+ limit: (l == null ? void 0 : l.limit) ?? 100,
53
+ offset: (l == null ? void 0 : l.offset) ?? 0,
54
+ ...l != null && l.from ? { from: l.from } : {},
55
+ ...l != null && l.to ? { to: l.to } : {},
56
+ ...(c = l == null ? void 0 : l.userIds) != null && c.length ? { userIds: l.userIds } : {},
57
+ ...l != null && l.feedmeAdminActors ? { feedmeAdminActors: !0 } : {},
58
+ ...(L = l == null ? void 0 : l.subjects) != null && L.length ? { subjects: l.subjects } : {},
59
+ ...(j = l == null ? void 0 : l.subjectPrefixes) != null && j.length ? { subjectPrefixes: l.subjectPrefixes } : {},
60
+ ...(I = l == null ? void 0 : l.actions) != null && I.length ? { actions: l.actions } : {},
61
+ ...(w = l == null ? void 0 : l.outcomes) != null && w.length ? { outcomes: l.outcomes } : {}
62
+ };
63
+ return Ae(
64
+ await Fe().get(Me, {
65
+ params: o,
66
+ // Serialize arrays as repeated params: key=val1&key=val2
67
+ // (NestJS @Query expects this; axios default adds brackets which break matching)
68
+ paramsSerializer: (s) => {
69
+ const D = new URLSearchParams();
70
+ for (const [P, v] of Object.entries(s))
71
+ if (Array.isArray(v))
72
+ for (const A of v) D.append(P, String(A));
73
+ else v != null && D.append(P, String(v));
74
+ return D.toString();
75
+ }
76
+ })
77
+ );
78
+ },
79
+ /**
80
+ * FeedMe-admin options for the User filter. `actors` is the named admin list (internal
81
+ * viewers only; empty for merchants). `showFeedmeAdminFilter` indicates whether to offer
82
+ * the "FeedMe Admin" catch-all (only when the business has relevant admin activity).
83
+ */
84
+ async getFeedmeAdminFilter(l) {
85
+ const o = {
86
+ ...l != null && l.from ? { from: l.from } : {},
87
+ ...l != null && l.to ? { to: l.to } : {}
88
+ };
89
+ return Ae(
90
+ await Fe().get(`${Me}/actors`, { params: o })
91
+ );
92
+ }
93
+ }, zt = { class: "flex h-[46px] items-center gap-8 rounded-sm px-16 hover:bg-fm-color-opacity-sm" }, qt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ht = {
94
+ "data-more-measure": "",
95
+ class: "flex h-[46px] items-center gap-8 rounded-sm px-16"
96
+ }, Wt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Jt = /* @__PURE__ */ Xe({
97
+ __name: "AuditLogModuleTabs",
98
+ props: {
99
+ modelValue: {},
100
+ items: {}
101
+ },
102
+ emits: ["update:modelValue"],
103
+ setup(l, { emit: o }) {
104
+ const c = l, L = o, { t: j } = Qe(), I = f(!1), w = f(null), s = f(null), D = f([]), P = f(0), v = f(0);
105
+ let A = null;
106
+ async function z() {
107
+ if (await Rt(), !s.value) return;
108
+ const m = s.value.querySelectorAll("[data-tab-measure]");
109
+ D.value = Array.from(m).map((k) => k.offsetWidth);
110
+ const _ = s.value.querySelector("[data-more-measure]");
111
+ P.value = (_ == null ? void 0 : _.offsetWidth) ?? 0;
112
+ }
113
+ const ye = h(() => {
114
+ const m = c.items.length;
115
+ if (m === 0) return 0;
116
+ if (!v.value || D.value.length !== m) return m;
117
+ const _ = D.value;
118
+ if (_.reduce((d, H) => d + H, 0) <= v.value) return m;
119
+ const S = P.value;
120
+ let O = 0, T = 0;
121
+ for (let d = 0; d < m && !(O + _[d] + S > v.value); d++)
122
+ O += _[d], T++;
123
+ return T;
124
+ }), J = h(() => {
125
+ const m = ye.value, _ = c.items.length;
126
+ if (m >= _) return [...c.items];
127
+ const k = c.items.slice(0, m), S = c.items.find((E) => E.value === c.modelValue);
128
+ if (!S || k.some((E) => E.value === S.value)) return k;
129
+ if (m === 0) return [S];
130
+ const O = c.items.findIndex((E) => E.value === S.value), T = D.value, d = P.value, H = T[O] ?? 0;
131
+ let $ = m, oe = T.slice(0, $ - 1).reduce((E, ae) => E + ae, 0);
132
+ for (; $ > 1 && oe + H + d > v.value; )
133
+ $--, oe = T.slice(0, $ - 1).reduce((E, ae) => E + ae, 0);
134
+ return [...c.items.slice(0, Math.max($ - 1, 0)), S];
135
+ }), te = h(() => {
136
+ const m = new Set(J.value.map((_) => _.value));
137
+ return c.items.filter((_) => !m.has(_.value));
138
+ });
139
+ function le(m) {
140
+ I.value = !1, L("update:modelValue", m);
141
+ }
142
+ return Vt(async () => {
143
+ await z(), w.value && (v.value = w.value.clientWidth, A = new ResizeObserver(() => {
144
+ w.value && (v.value = w.value.clientWidth);
145
+ }), A.observe(w.value));
146
+ }), Et(() => {
147
+ A == null || A.disconnect(), A = null;
148
+ }), Q(
149
+ () => c.items,
150
+ () => {
151
+ z();
152
+ },
153
+ { deep: !0 }
154
+ ), (m, _) => {
155
+ const k = C("FmTab"), S = C("FmIcon"), O = C("FmMenuItem"), T = C("FmMenu");
156
+ return y(), M("div", {
157
+ ref_key: "containerRef",
158
+ ref: w,
159
+ class: "relative flex w-full flex-row items-center"
160
+ }, [
161
+ (y(!0), M(ee, null, re(J.value, (d) => (y(), Z(k, {
162
+ key: d.value,
163
+ "model-value": l.modelValue,
164
+ label: d.label,
165
+ badge: d.badge,
166
+ disabled: d.disabled,
167
+ value: d.value,
168
+ "onUpdate:modelValue": le
169
+ }, null, 8, ["model-value", "label", "badge", "disabled", "value"]))), 128)),
170
+ te.value.length > 0 ? (y(), Z(T, {
171
+ key: 0,
172
+ "show-menu": I.value,
173
+ class: "max-w-[360px] min-w-[90px] rounded-sm",
174
+ placement: "bottom-start",
175
+ onMenuChanged: _[0] || (_[0] = (d) => I.value = d)
176
+ }, {
177
+ "menu-button": K(() => [
178
+ a("div", zt, [
179
+ p(S, { name: "more_vert" }),
180
+ a("span", qt, i(n(j)("auditLog.modules.more")), 1)
181
+ ])
182
+ ]),
183
+ default: K(() => [
184
+ (y(!0), M(ee, null, re(te.value, (d) => (y(), Z(O, {
185
+ key: d.value,
186
+ "model-value": l.modelValue === d.value,
187
+ label: d.label,
188
+ disabled: d.disabled,
189
+ onClick: (H) => le(d.value)
190
+ }, null, 8, ["model-value", "label", "disabled", "onClick"]))), 128))
191
+ ]),
192
+ _: 1
193
+ }, 8, ["show-menu"])) : N("", !0),
194
+ a("div", {
195
+ ref_key: "measurerRef",
196
+ ref: s,
197
+ "aria-hidden": "true",
198
+ class: "pointer-events-none invisible absolute -left-[9999px] -top-[9999px] flex flex-row items-center"
199
+ }, [
200
+ (y(!0), M(ee, null, re(l.items, (d) => (y(), M("div", {
201
+ key: `measure-${d.value}`,
202
+ "data-tab-measure": ""
203
+ }, [
204
+ p(k, {
205
+ "model-value": l.modelValue,
206
+ label: d.label,
207
+ badge: d.badge,
208
+ disabled: d.disabled,
209
+ value: d.value
210
+ }, null, 8, ["model-value", "label", "badge", "disabled", "value"])
211
+ ]))), 128)),
212
+ a("div", Ht, [
213
+ p(S, { name: "more_vert" }),
214
+ a("span", Wt, i(n(j)("auditLog.modules.more")), 1)
215
+ ])
216
+ ], 512)
217
+ ], 512);
218
+ };
219
+ }
220
+ }), Gt = Kt("team", () => {
221
+ const l = f([]), o = f(!1), c = f(!1), L = h(
222
+ () => Object.fromEntries(l.value.map((s) => [s.doc.userId, s.name]))
223
+ ), j = h(
224
+ () => Object.fromEntries(l.value.map((s) => [s.doc.userId, s.email]))
225
+ ), I = h(
226
+ () => Object.fromEntries(l.value.map((s) => [s.doc.userId, s.phoneNumber]))
227
+ );
228
+ async function w({ force: s = !1 } = {}) {
229
+ if (!(!s && l.value.length > 0))
230
+ try {
231
+ o.value = !0;
232
+ const D = await Bt.readTeamMembers();
233
+ l.value = D.sort((P, v) => P.doc.isOwner ? -1 : P.name.localeCompare(v.name)), c.value = !0;
234
+ } finally {
235
+ o.value = !1;
236
+ }
237
+ }
238
+ return {
239
+ members: l,
240
+ isLoading: o,
241
+ hasLoaded: c,
242
+ userIdToName: L,
243
+ userIdToEmail: j,
244
+ userIdToPhone: I,
245
+ readTeamMembers: w
246
+ };
247
+ }), Xt = {
248
+ class: "flex flex-col gap-4 p-12 w-[260px]"
249
+ }, Qt = {
250
+ class: "text-xs font-semibold text-fm-color-typo-secondary mb-4"
251
+ }, Zt = {
252
+ class: "flex min-h-0 flex-1 flex-col gap-16"
253
+ }, el = {
254
+ class: "space-y-16"
255
+ }, tl = {
256
+ class: "flex flex-wrap items-center gap-8"
257
+ }, ll = {
258
+ class: "w-fit"
259
+ }, ol = {
260
+ class: "w-fit"
261
+ }, al = {
262
+ class: "w-fit"
263
+ }, sl = {
264
+ class: "w-fit"
265
+ }, nl = {
266
+ key: 0,
267
+ class: "space-y-12 p-4 text-sm"
268
+ }, ul = {
269
+ class: "flex items-start justify-between gap-8 rounded-lg border border-fm-color-border-default p-12"
270
+ }, il = {
271
+ class: "min-w-0 flex-1"
272
+ }, rl = {
273
+ class: "audit-log-operation-label-detail text-base font-bold leading-snug text-fm-color-typo-primary"
274
+ }, dl = {
275
+ class: "rounded-lg border border-fm-color-border-default p-12"
276
+ }, cl = {
277
+ class: "space-y-12"
278
+ }, ml = {
279
+ class: "text-xs text-fm-color-typo-secondary"
280
+ }, fl = {
281
+ class: "font-semibold"
282
+ }, vl = {
283
+ class: "text-xs text-fm-color-typo-secondary"
284
+ }, gl = {
285
+ class: "font-semibold"
286
+ }, bl = {
287
+ class: "text-xs text-fm-color-typo-secondary"
288
+ }, pl = {
289
+ class: "break-all font-semibold"
290
+ }, hl = {
291
+ key: 0
292
+ }, yl = {
293
+ class: "text-xs text-fm-color-typo-secondary"
294
+ }, _l = {
295
+ class: "break-all font-mono text-xs font-semibold"
296
+ }, xl = {
297
+ class: "text-xs text-fm-color-typo-secondary"
298
+ }, Ll = {
299
+ class: "break-all font-mono text-xs font-semibold"
300
+ }, Sl = {
301
+ class: "text-xs text-fm-color-typo-secondary"
302
+ }, wl = {
303
+ class: "font-semibold"
304
+ }, kl = {
305
+ class: "rounded-lg border border-fm-color-border-default"
306
+ }, Il = {
307
+ class: "p-12"
308
+ }, Al = {
309
+ class: "text-base font-bold text-fm-color-typo-primary"
310
+ }, Fl = {
311
+ class: "space-y-12 p-12"
312
+ }, Ml = {
313
+ class: "text-xs text-fm-color-typo-secondary"
314
+ }, Dl = {
315
+ class: "font-semibold"
316
+ }, Ol = {
317
+ class: "rounded-lg border border-fm-color-border-default"
318
+ }, Tl = {
319
+ class: "p-12"
320
+ }, jl = {
321
+ class: "text-base font-bold text-fm-color-typo-primary"
322
+ }, Pl = {
323
+ class: "space-y-12 p-12"
324
+ }, Vl = {
325
+ class: "text-xs text-fm-color-typo-secondary"
326
+ }, El = {
327
+ class: "font-semibold"
328
+ }, Rl = {
329
+ key: 0
330
+ }, Cl = {
331
+ class: "text-xs text-fm-color-typo-secondary"
332
+ }, Ul = {
333
+ key: 0,
334
+ class: "font-semibold"
335
+ }, $l = {
336
+ key: 1,
337
+ class: "break-all font-mono text-xs text-fm-color-typo-secondary"
338
+ }, Nl = {
339
+ key: 1
340
+ }, Yl = {
341
+ class: "text-xs text-fm-color-typo-secondary"
342
+ }, Bl = {
343
+ class: "font-semibold whitespace-pre-line"
344
+ }, Kl = {
345
+ class: "text-xs text-fm-color-typo-secondary"
346
+ }, zl = {
347
+ class: "font-semibold"
348
+ }, ql = {
349
+ class: "text-xs text-fm-color-typo-secondary"
350
+ }, Hl = {
351
+ class: "break-all font-mono text-xs font-semibold"
352
+ }, Wl = {
353
+ key: 2
354
+ }, Jl = {
355
+ class: "text-xs text-fm-color-typo-secondary"
356
+ }, Gl = {
357
+ class: "mt-4 space-y-4"
358
+ }, Xl = {
359
+ class: "flex h-16 w-16 shrink-0 items-center justify-center rounded-full bg-fm-color-primary-default text-xs font-bold text-white"
360
+ }, Ql = {
361
+ class: "text-xs font-semibold"
362
+ }, Zl = {
363
+ key: 0,
364
+ class: "text-fm-color-typo-secondary"
365
+ }, eo = {
366
+ key: 3
367
+ }, to = {
368
+ class: "text-xs text-fm-color-typo-secondary"
369
+ }, lo = {
370
+ class: "mt-4 max-h-[400px] overflow-auto rounded bg-gray-100 p-8 font-mono text-xs leading-relaxed shadow-inner whitespace-pre-wrap break-all"
371
+ }, ie = 100, De = 1e3, he = "__feedmeAdmin__", oo = "D MMM YYYY h:mm A", ao = "YYYY-MM-DD HH:mm", V = "YYYY-MM-DD", Ge = "audit-log-export-fields", so = /* @__PURE__ */ Xe({
372
+ __name: "AuditLogList",
373
+ setup(l) {
374
+ const {
375
+ t: o
376
+ } = Qe(), c = Ct(), L = Gt(), j = f(!1), I = f(!1), w = f([]), s = f(null), D = f(!1);
377
+ async function P(e) {
378
+ const t = Uint8Array.from(atob(e), (r) => r.charCodeAt(0)), u = new DecompressionStream("gzip"), g = u.writable.getWriter();
379
+ return await g.write(t), await g.close(), new Response(u.readable).text();
380
+ }
381
+ const v = f("");
382
+ let A = 0;
383
+ Q(() => {
384
+ var e, t;
385
+ return (t = (e = s.value) == null ? void 0 : e.metadata) == null ? void 0 : t.requestBody;
386
+ }, async (e) => {
387
+ const t = ++A;
388
+ if (!e) {
389
+ v.value = "";
390
+ return;
391
+ }
392
+ if (typeof e == "object") {
393
+ v.value = JSON.stringify(e, null, 2);
394
+ return;
395
+ }
396
+ if (e.startsWith("gzip:")) {
397
+ try {
398
+ const u = await P(e.slice(5));
399
+ if (t !== A) return;
400
+ v.value = JSON.stringify(JSON.parse(u), null, 2);
401
+ } catch {
402
+ if (t !== A) return;
403
+ v.value = e;
404
+ }
405
+ return;
406
+ }
407
+ try {
408
+ v.value = JSON.stringify(JSON.parse(e), null, 2);
409
+ } catch {
410
+ v.value = e;
411
+ }
412
+ }, {
413
+ immediate: !0
414
+ });
415
+ const z = f(1), ye = f(!1), J = f(0), te = h(() => Math.max(1, Math.ceil(J.value / ie))), le = x().format("YYYY-MM-DD"), m = f({
416
+ startDate: `${le} 00:00`,
417
+ endDate: `${le} 23:59`
418
+ }), _ = f(), k = f(), S = f(), O = f(), T = f("all");
419
+ function d(e) {
420
+ return typeof e == "string" ? [e] : Array.isArray(e) ? e.filter((t) => typeof t == "string") : [];
421
+ }
422
+ const H = ue.filter((e) => e.key !== "all").map((e) => e.key);
423
+ function $(e) {
424
+ const t = ue.find((u) => u.key !== "all" && u.subjectPrefixes.some((g) => e.startsWith(g)));
425
+ return (t == null ? void 0 : t.key) ?? "other";
426
+ }
427
+ function oe(e) {
428
+ const t = H.indexOf(e);
429
+ return t === -1 ? H.length : t;
430
+ }
431
+ const Oe = h(() => ue.map(({
432
+ key: e
433
+ }) => ({
434
+ label: o(`auditLog.modules.${e}`),
435
+ value: e
436
+ }))), E = h(() => ue.find((e) => e.key === T.value) ?? ue[0]), ae = h(() => T.value === "all"), de = f([]), ce = f(!1), Ze = h(() => [...ce.value ? [{
437
+ label: o("auditLog.user.feedmeAdmin"),
438
+ value: he
439
+ }] : [], ...L.members.map((e) => ({
440
+ label: e.name,
441
+ value: e.doc.userId
442
+ })), ...de.value.map((e) => ({
443
+ label: `${e.name} (${o("auditLog.user.feedmeAdmin")})`,
444
+ value: e.userId
445
+ }))]), Y = h(() => {
446
+ const e = _.value ?? [];
447
+ return {
448
+ userIds: e.filter((t) => t !== he),
449
+ feedmeAdminActors: e.includes(he)
450
+ };
451
+ }), Te = h(() => {
452
+ const e = Je.flatMap((r) => d(r.subject).map((F) => ({
453
+ label: r.label,
454
+ value: F
455
+ }))), t = Object.entries(He).map(([r, F]) => ({
456
+ label: F,
457
+ value: r
458
+ })), u = /* @__PURE__ */ new Set(), g = [];
459
+ for (const r of [...e, ...t])
460
+ if (!u.has(r.value)) {
461
+ u.add(r.value);
462
+ const F = $(r.value);
463
+ g.push({
464
+ ...r,
465
+ group: o(`auditLog.modules.${F}`)
466
+ });
467
+ }
468
+ return g.sort((r, F) => oe($(r.value)) - oe($(F.value)));
469
+ }), et = h(() => ae.value ? Te.value : Te.value.filter((e) => $(e.value) === T.value));
470
+ function tt(e, t) {
471
+ const u = t.toLowerCase();
472
+ return e.label.toLowerCase().includes(u) || e.value.replace(/^business::/, "").toLowerCase().includes(u) ? !0 : e.value.toLowerCase().includes(u);
473
+ }
474
+ const U = h(() => ({
475
+ manage: o("auditLog.action.manage"),
476
+ create: o("auditLog.action.create"),
477
+ read: o("auditLog.action.read"),
478
+ update: o("auditLog.action.update"),
479
+ delete: o("auditLog.action.delete")
480
+ })), lt = h(() => [{
481
+ label: U.value.manage,
482
+ value: "manage"
483
+ }, {
484
+ label: U.value.create,
485
+ value: "create"
486
+ }, {
487
+ label: U.value.read,
488
+ value: "read"
489
+ }, {
490
+ label: U.value.update,
491
+ value: "update"
492
+ }, {
493
+ label: U.value.delete,
494
+ value: "delete"
495
+ }]), me = h(() => ({
496
+ allowed: o("auditLog.outcome.success"),
497
+ denied: o("auditLog.outcome.failed"),
498
+ skipped: o("auditLog.outcome.skipped")
499
+ })), _e = h(() => {
500
+ var e;
501
+ return ((e = c.sessionUser.value) == null ? void 0 : e.isInternal) ?? !1;
502
+ });
503
+ function je(e) {
504
+ return !_e.value && e === "skipped" ? "allowed" : e;
505
+ }
506
+ function xe(e) {
507
+ return !(e != null && e.length) || _e.value ? e : e.includes("allowed") ? [.../* @__PURE__ */ new Set([...e, "skipped"])] : e;
508
+ }
509
+ const ot = h(() => [{
510
+ label: me.value.allowed,
511
+ value: "allowed"
512
+ }, {
513
+ label: me.value.denied,
514
+ value: "denied"
515
+ }, ..._e.value ? [{
516
+ label: me.value.skipped,
517
+ value: "skipped"
518
+ }] : []]), at = h(() => ({
519
+ admin: o("auditLog.detail.resolvedFromValue.admin"),
520
+ staff: o("auditLog.detail.resolvedFromValue.staff"),
521
+ permissionSet: o("auditLog.detail.resolvedFromValue.permissionSet"),
522
+ systemPermissionSet: o("auditLog.detail.resolvedFromValue.systemPermissionSet"),
523
+ custom: o("auditLog.detail.resolvedFromValue.custom"),
524
+ "no-match": o("auditLog.detail.resolvedFromValue.noMatch"),
525
+ unknown: o("auditLog.detail.resolvedFromValue.unknown")
526
+ })), st = h(() => ({
527
+ GET: U.value.read,
528
+ POST: U.value.create,
529
+ PUT: U.value.update,
530
+ PATCH: U.value.update,
531
+ DELETE: U.value.delete
532
+ })), nt = {
533
+ allowed: "success",
534
+ denied: "critical",
535
+ skipped: "warning"
536
+ };
537
+ function fe(e) {
538
+ return x(e).format(oo);
539
+ }
540
+ const ut = h(() => {
541
+ const {
542
+ startDate: e,
543
+ endDate: t
544
+ } = m.value;
545
+ return e && t ? `${fe(e)} – ${fe(t)}` : e ? fe(e) : t ? fe(t) : o("auditLog.dateRange.placeholder");
546
+ }), it = h(() => [{
547
+ label: o("date.predefinedRanges.today"),
548
+ value: {
549
+ startDate: x().format(V),
550
+ endDate: x().format(V)
551
+ }
552
+ }, {
553
+ label: o("date.predefinedRanges.yesterday"),
554
+ value: {
555
+ startDate: x().subtract(1, "day").format(V),
556
+ endDate: x().subtract(1, "day").format(V)
557
+ }
558
+ }, {
559
+ label: o("date.predefinedRanges.thisWeek"),
560
+ value: {
561
+ startDate: x().startOf("week").format(V),
562
+ endDate: x().endOf("week").format(V)
563
+ }
564
+ }, {
565
+ label: o("date.predefinedRanges.lastWeek"),
566
+ value: {
567
+ startDate: x().subtract(1, "week").startOf("week").format(V),
568
+ endDate: x().subtract(1, "week").endOf("week").format(V)
569
+ }
570
+ }, {
571
+ label: o("date.predefinedRanges.last7Days"),
572
+ value: {
573
+ startDate: x().subtract(7, "day").format(V),
574
+ endDate: x().subtract(1, "day").format(V)
575
+ }
576
+ }, {
577
+ label: o("date.predefinedRanges.thisMonth"),
578
+ value: {
579
+ startDate: x().startOf("month").format(V),
580
+ endDate: x().endOf("month").format(V)
581
+ }
582
+ }, {
583
+ label: o("date.predefinedRanges.lastMonth"),
584
+ value: {
585
+ startDate: x().subtract(1, "month").startOf("month").format(V),
586
+ endDate: x().subtract(1, "month").endOf("month").format(V)
587
+ }
588
+ }]);
589
+ function Le(e) {
590
+ var t;
591
+ return ((t = Je.find((u) => u.subject === e)) == null ? void 0 : t.label) ?? He[e];
592
+ }
593
+ function ve(e) {
594
+ var u;
595
+ const t = L.userIdToName[e.userId];
596
+ return t || (L.hasLoaded ? (u = c.sessionUser.value) != null && u.isInternal ? `${e.actorName ?? e.userId} (${o("auditLog.user.feedmeAdmin")})` : o("auditLog.user.feedmeAdmin") : e.userId);
597
+ }
598
+ function Pe(e) {
599
+ return L.userIdToPhone[e.userId] || "-";
600
+ }
601
+ function rt(e) {
602
+ return L.userIdToEmail[e.userId] || "-";
603
+ }
604
+ function Ve(e) {
605
+ return x(e).format("DD MMM YYYY, HH:mm");
606
+ }
607
+ function dt(e) {
608
+ return x(e).format("DD MMM YYYY, HH:mm:ss").toUpperCase();
609
+ }
610
+ function Ee(e) {
611
+ return U.value[e] ?? e;
612
+ }
613
+ function Re(e) {
614
+ return e.metadata.operationLabel ?? Ee(e.action);
615
+ }
616
+ function ct(e) {
617
+ return Le(e.subject) ?? e.subject;
618
+ }
619
+ function Se(e) {
620
+ return me.value[je(e)];
621
+ }
622
+ function Ce(e) {
623
+ return nt[je(e)] ?? "neutral";
624
+ }
625
+ function mt(e) {
626
+ return at.value[e] ?? e;
627
+ }
628
+ function ft(e) {
629
+ return e.metadata.requestMethod ? st.value[e.metadata.requestMethod] ?? e.metadata.requestMethod : Ee(e.action);
630
+ }
631
+ function Ue(e) {
632
+ const t = String(e ?? "");
633
+ return `"${(/^[=+\-@\t\r]/.test(t) ? `'${t}` : t).replace(/"/g, '""')}"`;
634
+ }
635
+ const we = [{
636
+ key: "timestamp",
637
+ labelKey: "auditLog.exportFields.timestamp",
638
+ getValue: (e) => Ve(e.timestamp),
639
+ defaultSelected: !0
640
+ }, {
641
+ key: "userName",
642
+ labelKey: "auditLog.exportFields.userName",
643
+ getValue: (e) => ve(e),
644
+ defaultSelected: !0
645
+ }, {
646
+ key: "userPhone",
647
+ labelKey: "auditLog.exportFields.userPhone",
648
+ getValue: (e) => Pe(e),
649
+ defaultSelected: !0
650
+ }, {
651
+ key: "subject",
652
+ labelKey: "auditLog.exportFields.subject",
653
+ getValue: (e) => Le(e.subject) ?? e.subject,
654
+ defaultSelected: !0
655
+ }, {
656
+ key: "action",
657
+ labelKey: "auditLog.exportFields.action",
658
+ getValue: (e) => e.action,
659
+ defaultSelected: !0
660
+ }, {
661
+ key: "operation",
662
+ labelKey: "auditLog.exportFields.operation",
663
+ getValue: (e) => Re(e),
664
+ defaultSelected: !0
665
+ }, {
666
+ key: "outcome",
667
+ labelKey: "auditLog.exportFields.outcome",
668
+ getValue: (e) => Se(e.outcome),
669
+ defaultSelected: !0
670
+ }, {
671
+ key: "businessId",
672
+ labelKey: "auditLog.exportFields.businessId",
673
+ getValue: (e) => e.businessId,
674
+ defaultSelected: !1
675
+ }, {
676
+ key: "restaurantId",
677
+ labelKey: "auditLog.exportFields.restaurantId",
678
+ getValue: (e) => e.restaurantId,
679
+ defaultSelected: !1
680
+ }, {
681
+ key: "country",
682
+ labelKey: "auditLog.exportFields.country",
683
+ getValue: (e) => e.country,
684
+ defaultSelected: !1
685
+ }, {
686
+ key: "resolvedFrom",
687
+ labelKey: "auditLog.exportFields.resolvedFrom",
688
+ getValue: (e) => {
689
+ var t;
690
+ return (t = e.metadata) == null ? void 0 : t.resolvedFrom;
691
+ },
692
+ defaultSelected: !1
693
+ }, {
694
+ key: "requestMethod",
695
+ labelKey: "auditLog.exportFields.requestMethod",
696
+ getValue: (e) => {
697
+ var t;
698
+ return (t = e.metadata) == null ? void 0 : t.requestMethod;
699
+ },
700
+ defaultSelected: !1
701
+ }, {
702
+ key: "requestPath",
703
+ labelKey: "auditLog.exportFields.requestPath",
704
+ getValue: (e) => {
705
+ var t;
706
+ return (t = e.metadata) == null ? void 0 : t.requestPath;
707
+ },
708
+ defaultSelected: !1
709
+ }];
710
+ function vt() {
711
+ try {
712
+ const e = localStorage.getItem(Ge);
713
+ if (e) {
714
+ const t = JSON.parse(e);
715
+ if (Array.isArray(t) && t.length > 0) return new Set(t);
716
+ }
717
+ } catch {
718
+ }
719
+ return new Set(we.filter((e) => e.defaultSelected).map((e) => e.key));
720
+ }
721
+ const G = f(vt());
722
+ function gt(e) {
723
+ const t = new Set(G.value);
724
+ if (t.has(e)) {
725
+ if (t.size <= 1) return;
726
+ t.delete(e);
727
+ } else
728
+ t.add(e);
729
+ G.value = t;
730
+ try {
731
+ localStorage.setItem(Ge, JSON.stringify([...t]));
732
+ } catch {
733
+ }
734
+ }
735
+ async function bt() {
736
+ var e, t, u, g, r;
737
+ if (!I.value) {
738
+ I.value = !0;
739
+ try {
740
+ const {
741
+ startDate: F,
742
+ endDate: B
743
+ } = m.value, W = E.value.subjectPrefixes, ge = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace("T", " "), se = B ? q(B) : null, b = se && se < ge ? se : ge, X = {
744
+ ...F ? {
745
+ from: q(F)
746
+ } : {},
747
+ to: b,
748
+ ...Y.value.userIds.length ? {
749
+ userIds: Y.value.userIds
750
+ } : {},
751
+ ...Y.value.feedmeAdminActors ? {
752
+ feedmeAdminActors: !0
753
+ } : {},
754
+ ...(e = k.value) != null && e.length ? {
755
+ subjects: k.value
756
+ } : {},
757
+ ...W.length ? {
758
+ subjectPrefixes: [...W]
759
+ } : {},
760
+ ...(t = O.value) != null && t.length ? {
761
+ actions: O.value
762
+ } : {},
763
+ ...(u = S.value) != null && u.length ? {
764
+ outcomes: xe(S.value)
765
+ } : {}
766
+ }, Ye = [];
767
+ let Be = 0;
768
+ for (; ; ) {
769
+ const R = await pe.read({
770
+ ...X,
771
+ limit: De,
772
+ offset: Be
773
+ });
774
+ if (Ye.push(...R), R.length < De) break;
775
+ Be += De;
776
+ }
777
+ const Ke = we.filter((R) => G.value.has(R.key)), wt = Ke.map((R) => o(R.labelKey)), kt = Ye.map((R) => Ke.map((Pt) => Pt.getValue(R) ?? "")), Ie = -(/* @__PURE__ */ new Date()).getTimezoneOffset(), It = Ie >= 0 ? "+" : "-", At = String(Math.floor(Math.abs(Ie) / 60)).padStart(2, "0"), Ft = String(Math.abs(Ie) % 60).padStart(2, "0"), Mt = `UTC${It}${At}:${Ft}`, ze = ((g = c.currentBusiness.value) == null ? void 0 : g.name) || "", Dt = [F, B].filter(Boolean).join(" – "), Ot = [...[[o("auditLog.title")], [`${o("auditLog.frontMatter.date")}: ${Dt}`], ...ze ? [[`${o("auditLog.frontMatter.business")}: ${ze}`]] : [], [`${o("auditLog.frontMatter.generatedBy")}: ${x().format("DD MMM YYYY, HH:mm")} (${Mt})`], []].map((R) => R.map(Ue).join(",")), ...[wt, ...kt].map((R) => R.map(Ue).join(","))].join(`
778
+ `), Tt = `audit-log_${(((r = c.currentBusiness.value) == null ? void 0 : r.name) || "business").replace(/[^a-z0-9_-]+/gi, "_")}_${x().format("YYYYMMDD_HHmmss")}.csv`, jt = new Blob([`\uFEFF${Ot}`], {
779
+ type: "text/csv;charset=utf-8;"
780
+ }), qe = window.URL.createObjectURL(jt), ne = document.createElement("a");
781
+ ne.href = qe, ne.download = Tt, document.body.appendChild(ne), ne.click(), ne.remove(), window.URL.revokeObjectURL(qe);
782
+ } finally {
783
+ I.value = !1;
784
+ }
785
+ }
786
+ }
787
+ const pt = [{
788
+ accessorKey: "timestamp",
789
+ header: () => o("auditLog.columns.timestamp"),
790
+ cell(e) {
791
+ return Ve(e.row.original.timestamp);
792
+ }
793
+ }, {
794
+ accessorKey: "userId",
795
+ header: () => o("auditLog.columns.user"),
796
+ enableSorting: !1,
797
+ size: 220,
798
+ cell(e) {
799
+ const t = e.row.original;
800
+ return p("div", {
801
+ class: "flex items-center gap-8"
802
+ }, [p(We.FmAvatar, {
803
+ name: ve(t),
804
+ size: "sm",
805
+ class: "shrink-0"
806
+ }, null), p("div", {
807
+ class: "min-w-0"
808
+ }, [p("p", {
809
+ class: "truncate font-semibold"
810
+ }, [ve(t)]), p("p", {
811
+ class: "truncate text-fm-color-typo-secondary"
812
+ }, [Pe(t)])])]);
813
+ }
814
+ }, {
815
+ accessorKey: "subject",
816
+ header: () => o("auditLog.columns.subject"),
817
+ cell(e) {
818
+ const t = e.row.original;
819
+ return Le(t.subject) ?? t.subject;
820
+ }
821
+ }, {
822
+ accessorKey: "action",
823
+ header: () => o("auditLog.columns.action"),
824
+ enableSorting: !1,
825
+ size: 280,
826
+ meta: {
827
+ cellSpanClass: "audit-log-action-label"
828
+ },
829
+ cell(e) {
830
+ return Re(e.row.original);
831
+ }
832
+ }, {
833
+ accessorKey: "outcome",
834
+ header: () => o("auditLog.columns.outcome"),
835
+ enableSorting: !1,
836
+ cell(e) {
837
+ const t = e.row.original;
838
+ return p(We.FmChip, {
839
+ variant: Ce(t.outcome),
840
+ label: Se(t.outcome),
841
+ compact: !0
842
+ }, null);
843
+ }
844
+ }];
845
+ function q(e) {
846
+ const t = x(e, ao);
847
+ return new Date(t.year(), t.month(), t.date(), t.hour(), t.minute(), 0).toISOString().slice(0, 19).replace("T", " ");
848
+ }
849
+ async function $e() {
850
+ var e, t, u;
851
+ j.value = !0;
852
+ try {
853
+ const {
854
+ startDate: g,
855
+ endDate: r
856
+ } = m.value, F = (z.value - 1) * ie, B = E.value.subjectPrefixes, W = await pe.read({
857
+ limit: ie,
858
+ offset: F,
859
+ ...g ? {
860
+ from: q(g)
861
+ } : {},
862
+ ...r ? {
863
+ to: q(r)
864
+ } : {},
865
+ ...Y.value.userIds.length ? {
866
+ userIds: Y.value.userIds
867
+ } : {},
868
+ ...Y.value.feedmeAdminActors ? {
869
+ feedmeAdminActors: !0
870
+ } : {},
871
+ ...(e = k.value) != null && e.length ? {
872
+ subjects: k.value
873
+ } : {},
874
+ ...B.length ? {
875
+ subjectPrefixes: [...B]
876
+ } : {},
877
+ ...(t = O.value) != null && t.length ? {
878
+ actions: O.value
879
+ } : {},
880
+ ...(u = S.value) != null && u.length ? {
881
+ outcomes: xe(S.value)
882
+ } : {}
883
+ });
884
+ w.value = W, ye.value = W.length === ie;
885
+ } finally {
886
+ j.value = !1;
887
+ }
888
+ }
889
+ const Ne = h(() => {
890
+ var e;
891
+ return JSON.stringify({
892
+ businessId: ((e = c.currentBusiness.value) == null ? void 0 : e._id) ?? "",
893
+ dateRange: m.value,
894
+ users: [..._.value ?? []].sort(),
895
+ subjects: [...k.value ?? []].sort(),
896
+ outcomes: [...S.value ?? []].sort(),
897
+ actions: [...O.value ?? []].sort(),
898
+ moduleKey: T.value
899
+ });
900
+ });
901
+ async function ht() {
902
+ var g, r, F;
903
+ const {
904
+ startDate: e,
905
+ endDate: t
906
+ } = m.value, u = E.value.subjectPrefixes;
907
+ J.value = await pe.count({
908
+ ...e ? {
909
+ from: q(e)
910
+ } : {},
911
+ ...t ? {
912
+ to: q(t)
913
+ } : {},
914
+ ...Y.value.userIds.length ? {
915
+ userIds: Y.value.userIds
916
+ } : {},
917
+ ...Y.value.feedmeAdminActors ? {
918
+ feedmeAdminActors: !0
919
+ } : {},
920
+ ...(g = k.value) != null && g.length ? {
921
+ subjects: k.value
922
+ } : {},
923
+ ...u.length ? {
924
+ subjectPrefixes: [...u]
925
+ } : {},
926
+ ...(r = O.value) != null && r.length ? {
927
+ actions: O.value
928
+ } : {},
929
+ ...(F = S.value) != null && F.length ? {
930
+ outcomes: xe(S.value)
931
+ } : {}
932
+ });
933
+ }
934
+ Q(Ne, async () => {
935
+ var e;
936
+ z.value = 1, (e = c.currentBusiness.value) != null && e._id && await Promise.all([ht(), $e()]);
937
+ }, {
938
+ immediate: !0
939
+ }), Q(T, () => {
940
+ k.value = void 0;
941
+ });
942
+ let ke = !1;
943
+ async function yt({
944
+ pageIndex: e
945
+ }) {
946
+ var t;
947
+ if ((t = c.currentBusiness.value) != null && t._id && e !== 0 && !ke) {
948
+ ke = !0, z.value = e + 1;
949
+ try {
950
+ await $e();
951
+ } finally {
952
+ ke = !1;
953
+ }
954
+ }
955
+ }
956
+ function _t(e) {
957
+ s.value = e, D.value = !0;
958
+ }
959
+ function xt() {
960
+ D.value = !1, s.value = null;
961
+ }
962
+ Q(c.currentBusiness, (e) => {
963
+ e && L.readTeamMembers();
964
+ }, {
965
+ immediate: !0
966
+ });
967
+ function Lt() {
968
+ const e = _.value;
969
+ if (!(e != null && e.length)) return;
970
+ const t = new Set(de.value.map((r) => r.userId)), u = new Set(L.members.map((r) => r.doc.userId)), g = e.filter((r) => r === he ? ce.value : L.hasLoaded ? u.has(r) || t.has(r) : !0);
971
+ g.length !== e.length && (_.value = g.length ? g : void 0);
972
+ }
973
+ async function St() {
974
+ var u;
975
+ if (!((u = c.currentBusiness.value) != null && u._id)) return;
976
+ const {
977
+ startDate: e,
978
+ endDate: t
979
+ } = m.value;
980
+ try {
981
+ const {
982
+ actors: g,
983
+ showFeedmeAdminFilter: r
984
+ } = await pe.getFeedmeAdminFilter({
985
+ ...e ? {
986
+ from: q(e)
987
+ } : {},
988
+ ...t ? {
989
+ to: q(t)
990
+ } : {}
991
+ });
992
+ de.value = g, ce.value = r;
993
+ } catch {
994
+ de.value = [], ce.value = !1;
995
+ }
996
+ Lt();
997
+ }
998
+ return Q(() => {
999
+ var e;
1000
+ return {
1001
+ businessId: (e = c.currentBusiness.value) == null ? void 0 : e._id,
1002
+ range: m.value
1003
+ };
1004
+ }, () => St(), {
1005
+ immediate: !0,
1006
+ deep: !0
1007
+ }), (e, t) => {
1008
+ const u = C("FmSpacer"), g = C("FmButton"), r = C("FmMenuItem"), F = C("FmMenu"), B = C("FmChip"), W = C("FmDateRangePicker"), ge = C("FmTable"), se = C("FmSideSheet");
1009
+ return y(), M(ee, null, [p(Nt, {
1010
+ heading: n(o)("auditLog.title")
1011
+ }, {
1012
+ "append-heading": K(() => [p(u), p(g, {
1013
+ variant: "primary",
1014
+ "prepend-icon": "upload",
1015
+ label: n(o)("auditLog.export"),
1016
+ disabled: w.value.length === 0 || I.value || n(L).isLoading || n(L).members.length === 0,
1017
+ loading: I.value,
1018
+ onClick: bt
1019
+ }, null, 8, ["label", "disabled", "loading"]), p(F, {
1020
+ "close-on-click": !1,
1021
+ "z-index": 50
1022
+ }, {
1023
+ "menu-button": K(() => [p(g, {
1024
+ variant: "tertiary",
1025
+ icon: "settings",
1026
+ "aria-label": n(o)("auditLog.exportSettings.title"),
1027
+ disabled: I.value
1028
+ }, null, 8, ["aria-label", "disabled"])]),
1029
+ default: K(() => [a("div", Xt, [a("p", Qt, i(n(o)("auditLog.exportSettings.title")), 1), (y(), M(ee, null, re(we, (b) => p(r, {
1030
+ key: b.key,
1031
+ label: n(o)(b.labelKey),
1032
+ "has-checkbox": "",
1033
+ "model-value": G.value.has(b.key),
1034
+ disabled: G.value.has(b.key) && G.value.size === 1,
1035
+ onClick: (X) => gt(b.key)
1036
+ }, null, 8, ["label", "model-value", "disabled", "onClick"])), 64))])]),
1037
+ _: 1
1038
+ })]),
1039
+ default: K(() => [a("div", Zt, [a("div", el, [p(Jt, {
1040
+ modelValue: T.value,
1041
+ "onUpdate:modelValue": t[0] || (t[0] = (b) => T.value = b),
1042
+ items: Oe.value
1043
+ }, null, 8, ["modelValue", "items"]), a("div", tl, [p(W, {
1044
+ modelValue: m.value,
1045
+ "onUpdate:modelValue": t[1] || (t[1] = (b) => m.value = b),
1046
+ "show-predefined-range": "",
1047
+ "show-time": "",
1048
+ "predefined-range": it.value
1049
+ }, {
1050
+ "trigger-button": K(() => [p(B, {
1051
+ label: ut.value,
1052
+ icon: "calendar_month"
1053
+ }, null, 8, ["label"])]),
1054
+ _: 1
1055
+ }, 8, ["modelValue", "predefined-range"]), a("div", ll, [p(be, {
1056
+ modelValue: _.value,
1057
+ "onUpdate:modelValue": t[2] || (t[2] = (b) => _.value = b),
1058
+ items: Ze.value,
1059
+ multiple: "",
1060
+ variant: "dark",
1061
+ placeholder: n(o)("auditLog.filter.user_placeholder"),
1062
+ "selected-prefix": n(o)("auditLog.filter.selected_user_prefix"),
1063
+ "chip-icon": "account_circle"
1064
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), a("div", ol, [p(be, {
1065
+ modelValue: k.value,
1066
+ "onUpdate:modelValue": t[3] || (t[3] = (b) => k.value = b),
1067
+ items: et.value,
1068
+ "filter-fn": tt,
1069
+ multiple: "",
1070
+ variant: "dark",
1071
+ placeholder: n(o)("auditLog.filter.subject_placeholder"),
1072
+ "selected-prefix": n(o)("auditLog.filter.selected_subject_prefix"),
1073
+ "chip-icon": "badge"
1074
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), a("div", al, [p(be, {
1075
+ modelValue: O.value,
1076
+ "onUpdate:modelValue": t[4] || (t[4] = (b) => O.value = b),
1077
+ items: lt.value,
1078
+ multiple: "",
1079
+ variant: "dark",
1080
+ placeholder: n(o)("auditLog.filter.action_placeholder"),
1081
+ "selected-prefix": n(o)("auditLog.filter.selected_action_prefix"),
1082
+ searchable: !1
1083
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), a("div", sl, [p(be, {
1084
+ modelValue: S.value,
1085
+ "onUpdate:modelValue": t[5] || (t[5] = (b) => S.value = b),
1086
+ items: ot.value,
1087
+ multiple: "",
1088
+ variant: "dark",
1089
+ placeholder: n(o)("auditLog.filter.status_placeholder"),
1090
+ "selected-prefix": n(o)("auditLog.filter.selected_status_prefix"),
1091
+ searchable: !1,
1092
+ "chip-icon": "check_circle"
1093
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])])]), !j.value && w.value.length === 0 ? (y(), Z(n(Yt), {
1094
+ key: 0,
1095
+ title: n(o)("auditLog.noData.title"),
1096
+ subtitle: n(o)("auditLog.noData.subtitle")
1097
+ }, null, 8, ["title", "subtitle"])) : (y(), Z(Ut, {
1098
+ key: 1
1099
+ }, {
1100
+ default: K(() => [(y(), Z(ge, {
1101
+ key: Ne.value,
1102
+ "column-defs": pt,
1103
+ "row-data": w.value,
1104
+ "page-size": ie,
1105
+ "page-count": te.value,
1106
+ "row-count": J.value,
1107
+ "fetch-fn": yt,
1108
+ "hide-footer": te.value <= 1,
1109
+ loading: j.value,
1110
+ "pin-header-row": "",
1111
+ class: "audit-log-list-table min-h-0 flex-1 cursor-pointer",
1112
+ onRowClick: t[6] || (t[6] = (b) => _t(b.original))
1113
+ }, null, 8, ["row-data", "page-count", "row-count", "hide-footer", "loading"]))]),
1114
+ _: 1
1115
+ }))])]),
1116
+ _: 1
1117
+ }, 8, ["heading"]), p(se, {
1118
+ header: n(o)("auditLog.detail.header"),
1119
+ "model-value": D.value,
1120
+ "max-width": 480,
1121
+ "dismiss-away": "",
1122
+ "onUpdate:modelValue": t[7] || (t[7] = (b) => {
1123
+ b || xt();
1124
+ })
1125
+ }, {
1126
+ default: K(() => [s.value ? (y(), M("div", nl, [a("div", ul, [a("div", il, [a("p", rl, i(ct(s.value)), 1)]), p(B, {
1127
+ variant: Ce(s.value.outcome),
1128
+ label: Se(s.value.outcome),
1129
+ compact: ""
1130
+ }, null, 8, ["variant", "label"])]), a("div", dl, [a("div", cl, [a("div", null, [a("p", ml, i(n(o)("auditLog.detail.date")), 1), a("p", fl, i(dt(s.value.timestamp)), 1)]), a("div", null, [a("p", vl, i(n(o)("auditLog.detail.user")), 1), a("p", gl, i(ve(s.value)), 1)]), a("div", null, [a("p", bl, i(n(o)("auditLog.detail.email")), 1), a("p", pl, i(rt(s.value)), 1)]), s.value.field ? (y(), M("div", hl, [a("p", yl, i(n(o)("auditLog.detail.field")), 1), a("p", _l, i(s.value.field), 1)])) : N("", !0), a("div", null, [a("p", xl, i(n(o)("auditLog.detail.business")), 1), a("p", Ll, i(s.value.businessId || "-"), 1)]), a("div", null, [a("p", Sl, i(n(o)("auditLog.detail.restaurant")), 1), a("p", wl, i(s.value.restaurantId || "-"), 1)])])]), a("div", kl, [a("div", Il, [a("p", Al, i(n(o)("auditLog.detail.eventDetails")), 1)]), t[8] || (t[8] = a("hr", {
1131
+ class: "border-fm-color-border-default"
1132
+ }, null, -1)), a("div", Fl, [a("div", null, [a("p", Ml, i(n(o)("auditLog.detail.actionDescription")), 1), a("p", Dl, i(s.value.metadata.operationLabel || "-"), 1)])])]), a("div", Ol, [a("div", Tl, [a("p", jl, i(n(o)("auditLog.detail.metadata")), 1)]), t[9] || (t[9] = a("hr", {
1133
+ class: "border-fm-color-border-default"
1134
+ }, null, -1)), a("div", Pl, [a("div", null, [a("p", Vl, i(n(o)("auditLog.detail.resolvedFrom")), 1), a("p", El, i(mt(s.value.metadata.resolvedFrom)), 1)]), (s.value.metadata.resolvedFrom === "permissionSet" || s.value.metadata.resolvedFrom === "systemPermissionSet") && (s.value.metadata.permissionSetName || s.value.metadata.permissionSetId) ? (y(), M("div", Rl, [a("p", Cl, i(n(o)("auditLog.detail.permissionSet")), 1), s.value.metadata.permissionSetName ? (y(), M("p", Ul, i(s.value.metadata.permissionSetName), 1)) : N("", !0), s.value.metadata.permissionSetId ? (y(), M("p", $l, i(s.value.metadata.permissionSetId), 1)) : N("", !0)])) : N("", !0), s.value.metadata.reason ? (y(), M("div", Nl, [a("p", Yl, i(n(o)("auditLog.detail.reason")), 1), a("p", Bl, i(s.value.metadata.reason), 1)])) : N("", !0), a("div", null, [a("p", Kl, i(n(o)("auditLog.detail.requestMethod")), 1), a("p", zl, i(ft(s.value)), 1)]), a("div", null, [a("p", ql, i(n(o)("auditLog.detail.requestPath")), 1), a("p", Hl, i(s.value.metadata.requestPath || "-"), 1)]), s.value.metadata.trace && s.value.metadata.trace.length > 0 ? (y(), M("div", Wl, [a("p", Jl, i(n(o)("auditLog.detail.permissionTrace")), 1), a("ol", Gl, [(y(!0), M(ee, null, re(s.value.metadata.trace, (b, X) => (y(), M("li", {
1135
+ key: X,
1136
+ class: "flex items-center gap-6"
1137
+ }, [a("span", Xl, i(X + 1), 1), a("span", Ql, i(b), 1), X < s.value.metadata.trace.length - 1 ? (y(), M("span", Zl, "→")) : N("", !0)]))), 128))])])) : N("", !0), v.value ? (y(), M("div", eo, [a("p", to, i(n(o)("auditLog.detail.requestBody")), 1), a("pre", lo, i(v.value), 1)])) : N("", !0)])])])) : N("", !0)]),
1138
+ _: 1
1139
+ }, 8, ["header", "model-value"])], 64);
1140
+ };
1141
+ }
1142
+ }), _o = /* @__PURE__ */ $t(so, [["__scopeId", "data-v-e7378504"]]);
1143
+ export {
1144
+ _o as default
1145
+ };