@feedmepos/mf-hrm-portal 2.0.16-dev.1 → 2.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/{AuditLogList-BZPpMthp.js → AuditLogList-iyCwZoot.js} +384 -380
  2. package/dist/{EmployeeList-DvWJ0QUc.js → EmployeeList-CJvHFQnQ.js} +5 -5
  3. package/dist/{Main-CWilH1zx.js → Main-Br1NK5Nk.js} +9 -9
  4. package/dist/{Main-DAWaIqp9.js → Main-C-_jj0hE.js} +4 -4
  5. package/dist/{Main-BNFGDNdT.js → Main-CVLdj0vm.js} +4 -4
  6. package/dist/{PermissionSetList-BkRtZkAZ.js → PermissionSetList-4lJbnJsE.js} +5 -5
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CGYLUF1m.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DJniPhu1.js} +1049 -1049
  8. package/dist/{RoleList-D26aCQ4A.js → RoleList-C0NI4ooY.js} +7 -7
  9. package/dist/{TeamMemberList-Dh3AlL0Q.js → TeamMemberList-CGjxliOv.js} +6 -6
  10. package/dist/{TimesheetList-DDaK0iJU.js → TimesheetList-Cvco7hQ7.js} +6 -6
  11. package/dist/{app-BlFL6W1C.js → app-Deq-BbQg.js} +4 -4
  12. package/dist/app.js +1 -1
  13. package/dist/{dayjs.min-B81EyB1J.js → dayjs.min-BC7eDcw3.js} +1 -1
  14. package/dist/{employee-BaOat18O.js → employee-CSb8K1_S.js} +3 -3
  15. package/dist/{iteration-Cuw1W-W9.js → iteration-CzlBzD5p.js} +2 -2
  16. package/dist/{lodash-BtkvPA8j.js → lodash-BxgA1s7j.js} +1 -1
  17. package/dist/{rule-8ylgGfvp.js → rule-BYb8TfeP.js} +2 -2
  18. package/dist/{timesheet-BpHPcIrb.js → timesheet-BlHG7Fw5.js} +2 -2
  19. package/dist/tsconfig.app.tsbuildinfo +1 -1
  20. package/dist/{useAppStore-Bs9JwLL8.js → useAppStore-tV67t5M2.js} +1 -1
  21. package/dist/{useLoading-ZHDY--I6.js → useLoading-DWaMwG8t.js} +1 -1
  22. package/dist/{useReportPermissions-CNhcwQO7.js → useReportPermissions-DJvfurhn.js} +3 -3
  23. package/package.json +1 -1
@@ -1,14 +1,14 @@
1
- import { defineComponent as Ce, ref as p, computed as L, onMounted as mt, onBeforeUnmount as ft, watch as te, resolveComponent as C, createElementBlock as g, openBlock as m, createBlock as oe, createCommentVNode as T, createElementVNode as l, Fragment as ae, renderList as se, withCtx as z, createVNode as u, toDisplayString as i, unref as n, nextTick as vt } from "vue";
2
- import { d as _ } from "./dayjs.min-B81EyB1J.js";
3
- import { useI18n as Ee, useCoreStore as pt } from "@feedmepos/mf-common";
4
- import { f as Te, _ as bt } from "./app-BlFL6W1C.js";
5
- import { components as Oe } from "@feedmepos/ui-library";
6
- import { g as gt, b as ht } from "./iteration-Cuw1W-W9.js";
1
+ import { defineComponent as Ee, ref as p, computed as L, onMounted as ft, onBeforeUnmount as vt, watch as Q, resolveComponent as E, createElementBlock as y, openBlock as m, createBlock as oe, createCommentVNode as V, createElementVNode as l, Fragment as ee, renderList as se, withCtx as Y, createVNode as u, toDisplayString as i, unref as n, nextTick as pt } from "vue";
2
+ import { d as _ } from "./dayjs.min-BC7eDcw3.js";
3
+ import { useI18n as Ae, useCoreStore as bt } from "@feedmepos/mf-common";
4
+ import { f as Oe, _ as gt } from "./app-Deq-BbQg.js";
5
+ import { components as Ve } from "@feedmepos/ui-library";
6
+ import { g as ht, b as yt } from "./iteration-CzlBzD5p.js";
7
7
  import { S as ce } from "./SelectFilter-DUj7GBtT.js";
8
- import { _ as yt } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
9
- import { _ as _t } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
10
- import { t as xt, p as Ve } from "./rule-8ylgGfvp.js";
11
- import { defineStore as Lt } from "pinia";
8
+ import { _ as _t } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
9
+ import { _ as xt } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
10
+ import { t as Lt, p as Pe } from "./rule-BYb8TfeP.js";
11
+ import { defineStore as St } from "pinia";
12
12
  const ge = [
13
13
  { key: "all", label: "All", subjectPrefixes: [] },
14
14
  { key: "inventory", label: "Inventory", subjectPrefixes: ["business::inventory", "inventory"] },
@@ -19,40 +19,40 @@ const ge = [
19
19
  { key: "crm", label: "CRM", subjectPrefixes: ["business::crm", "crm"] }
20
20
  // Add more as modules are revamped with new actionguard:
21
21
  // { key: 'restaurantOperation', label: 'Restaurant Operation', subjectPrefixes: ['restaurant'] },
22
- ], St = "/audit-logs", Pe = {
22
+ ], kt = "/audit-logs", je = {
23
23
  async read(o) {
24
- var x, F, O, M, c;
24
+ var x, T, P, I, c;
25
25
  const a = {
26
26
  limit: (o == null ? void 0 : o.limit) ?? 100,
27
27
  offset: (o == null ? void 0 : o.offset) ?? 0,
28
28
  ...o != null && o.from ? { from: o.from } : {},
29
29
  ...o != null && o.to ? { to: o.to } : {},
30
30
  ...(x = o == null ? void 0 : o.userIds) != null && x.length ? { userIds: o.userIds } : {},
31
- ...(F = o == null ? void 0 : o.subjects) != null && F.length ? { subjects: o.subjects } : {},
32
- ...(O = o == null ? void 0 : o.subjectPrefixes) != null && O.length ? { subjectPrefixes: o.subjectPrefixes } : {},
33
- ...(M = o == null ? void 0 : o.actions) != null && M.length ? { actions: o.actions } : {},
31
+ ...(T = o == null ? void 0 : o.subjects) != null && T.length ? { subjects: o.subjects } : {},
32
+ ...(P = o == null ? void 0 : o.subjectPrefixes) != null && P.length ? { subjectPrefixes: o.subjectPrefixes } : {},
33
+ ...(I = o == null ? void 0 : o.actions) != null && I.length ? { actions: o.actions } : {},
34
34
  ...(c = o == null ? void 0 : o.outcomes) != null && c.length ? { outcomes: o.outcomes } : {}
35
35
  };
36
- return console.log("[AuditLogAPI] request params:", a), gt(
37
- await ht().get(St, {
36
+ return console.log("[AuditLogAPI] request params:", a), ht(
37
+ await yt().get(kt, {
38
38
  params: a,
39
39
  // Serialize arrays as repeated params: key=val1&key=val2
40
40
  // (NestJS @Query expects this; axios default adds brackets which break matching)
41
41
  paramsSerializer: (s) => {
42
42
  const w = new URLSearchParams();
43
- for (const [U, b] of Object.entries(s))
44
- if (Array.isArray(b))
45
- for (const h of b) w.append(U, String(h));
46
- else b != null && w.append(U, String(b));
43
+ for (const [R, g] of Object.entries(s))
44
+ if (Array.isArray(g))
45
+ for (const j of g) w.append(R, String(j));
46
+ else g != null && w.append(R, String(g));
47
47
  return console.log("[AuditLogAPI] serialized query string:", w.toString()), w.toString();
48
48
  }
49
49
  })
50
50
  );
51
51
  }
52
- }, kt = { class: "flex h-[46px] items-center gap-8 rounded-sm px-16 hover:bg-fm-color-opacity-sm" }, wt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Mt = {
52
+ }, wt = { class: "flex h-[46px] items-center gap-8 rounded-sm px-16 hover:bg-fm-color-opacity-sm" }, Mt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ft = {
53
53
  "data-more-measure": "",
54
54
  class: "flex h-[46px] items-center gap-8 rounded-sm px-16"
55
- }, Ft = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, It = /* @__PURE__ */ Ce({
55
+ }, It = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Tt = /* @__PURE__ */ Ee({
56
56
  __name: "AuditLogModuleTabs",
57
57
  props: {
58
58
  modelValue: {},
@@ -60,107 +60,107 @@ const ge = [
60
60
  },
61
61
  emits: ["update:modelValue"],
62
62
  setup(o, { emit: a }) {
63
- const x = o, F = a, { t: O } = Ee(), M = p(!1), c = p(null), s = p(null), w = p([]), U = p(0), b = p(0);
64
- let h = null;
65
- async function W() {
66
- if (await vt(), !s.value) return;
63
+ const x = o, T = a, { t: P } = Ae(), I = p(!1), c = p(null), s = p(null), w = p([]), R = p(0), g = p(0);
64
+ let j = null;
65
+ async function D() {
66
+ if (await pt(), !s.value) return;
67
67
  const f = s.value.querySelectorAll("[data-tab-measure]");
68
- w.value = Array.from(f).map((I) => I.offsetWidth);
68
+ w.value = Array.from(f).map((M) => M.offsetWidth);
69
69
  const v = s.value.querySelector("[data-more-measure]");
70
- U.value = (v == null ? void 0 : v.offsetWidth) ?? 0;
70
+ R.value = (v == null ? void 0 : v.offsetWidth) ?? 0;
71
71
  }
72
- const ne = L(() => {
72
+ const J = L(() => {
73
73
  const f = x.items.length;
74
74
  if (f === 0) return 0;
75
- if (!b.value || w.value.length !== f) return f;
75
+ if (!g.value || w.value.length !== f) return f;
76
76
  const v = w.value;
77
- if (v.reduce((r, X) => r + X, 0) <= b.value) return f;
78
- const V = U.value;
79
- let B = 0, E = 0;
80
- for (let r = 0; r < f && !(B + v[r] + V > b.value); r++)
81
- B += v[r], E++;
82
- return E;
83
- }), Y = L(() => {
84
- const f = ne.value, v = x.items.length;
77
+ if (v.reduce((r, B) => r + B, 0) <= g.value) return f;
78
+ const F = R.value;
79
+ let z = 0, N = 0;
80
+ for (let r = 0; r < f && !(z + v[r] + F > g.value); r++)
81
+ z += v[r], N++;
82
+ return N;
83
+ }), te = L(() => {
84
+ const f = J.value, v = x.items.length;
85
85
  if (f >= v) return [...x.items];
86
- const I = x.items.slice(0, f), V = x.items.find((A) => A.value === x.modelValue);
87
- if (!V || I.some((A) => A.value === V.value)) return I;
88
- if (f === 0) return [V];
89
- const B = x.items.findIndex((A) => A.value === V.value), E = w.value, r = U.value, X = E[B] ?? 0;
90
- let J = f, ie = E.slice(0, J - 1).reduce((A, K) => A + K, 0);
91
- for (; J > 1 && ie + X + r > b.value; )
92
- J--, ie = E.slice(0, J - 1).reduce((A, K) => A + K, 0);
93
- return [...x.items.slice(0, Math.max(J - 1, 0)), V];
94
- }), N = L(() => {
95
- const f = new Set(Y.value.map((v) => v.value));
86
+ const M = x.items.slice(0, f), F = x.items.find((h) => h.value === x.modelValue);
87
+ if (!F || M.some((h) => h.value === F.value)) return M;
88
+ if (f === 0) return [F];
89
+ const z = x.items.findIndex((h) => h.value === F.value), N = w.value, r = R.value, B = N[z] ?? 0;
90
+ let H = f, ne = N.slice(0, H - 1).reduce((h, ae) => h + ae, 0);
91
+ for (; H > 1 && ne + B + r > g.value; )
92
+ H--, ne = N.slice(0, H - 1).reduce((h, ae) => h + ae, 0);
93
+ return [...x.items.slice(0, Math.max(H - 1, 0)), F];
94
+ }), $ = L(() => {
95
+ const f = new Set(te.value.map((v) => v.value));
96
96
  return x.items.filter((v) => !f.has(v.value));
97
97
  });
98
- function $(f) {
99
- M.value = !1, F("update:modelValue", f);
98
+ function U(f) {
99
+ I.value = !1, T("update:modelValue", f);
100
100
  }
101
- return mt(async () => {
102
- await W(), c.value && (b.value = c.value.clientWidth, h = new ResizeObserver(() => {
103
- c.value && (b.value = c.value.clientWidth);
104
- }), h.observe(c.value));
105
- }), ft(() => {
106
- h == null || h.disconnect(), h = null;
107
- }), te(
101
+ return ft(async () => {
102
+ await D(), c.value && (g.value = c.value.clientWidth, j = new ResizeObserver(() => {
103
+ c.value && (g.value = c.value.clientWidth);
104
+ }), j.observe(c.value));
105
+ }), vt(() => {
106
+ j == null || j.disconnect(), j = null;
107
+ }), Q(
108
108
  () => x.items,
109
109
  () => {
110
- W();
110
+ D();
111
111
  },
112
112
  { deep: !0 }
113
113
  ), (f, v) => {
114
- const I = C("FmTab"), V = C("FmIcon"), B = C("FmMenuItem"), E = C("FmMenu");
115
- return m(), g("div", {
114
+ const M = E("FmTab"), F = E("FmIcon"), z = E("FmMenuItem"), N = E("FmMenu");
115
+ return m(), y("div", {
116
116
  ref_key: "containerRef",
117
117
  ref: c,
118
118
  class: "relative flex w-full flex-row items-center"
119
119
  }, [
120
- (m(!0), g(ae, null, se(Y.value, (r) => (m(), oe(I, {
120
+ (m(!0), y(ee, null, se(te.value, (r) => (m(), oe(M, {
121
121
  key: r.value,
122
122
  "model-value": o.modelValue,
123
123
  label: r.label,
124
124
  badge: r.badge,
125
125
  disabled: r.disabled,
126
126
  value: r.value,
127
- "onUpdate:modelValue": $
127
+ "onUpdate:modelValue": U
128
128
  }, null, 8, ["model-value", "label", "badge", "disabled", "value"]))), 128)),
129
- N.value.length > 0 ? (m(), oe(E, {
129
+ $.value.length > 0 ? (m(), oe(N, {
130
130
  key: 0,
131
- "show-menu": M.value,
131
+ "show-menu": I.value,
132
132
  class: "max-w-[360px] min-w-[90px] rounded-sm",
133
133
  placement: "bottom-start",
134
- onMenuChanged: v[0] || (v[0] = (r) => M.value = r)
134
+ onMenuChanged: v[0] || (v[0] = (r) => I.value = r)
135
135
  }, {
136
- "menu-button": z(() => [
137
- l("div", kt, [
138
- u(V, { name: "more_vert" }),
139
- l("span", wt, i(n(O)("auditLog.modules.more")), 1)
136
+ "menu-button": Y(() => [
137
+ l("div", wt, [
138
+ u(F, { name: "more_vert" }),
139
+ l("span", Mt, i(n(P)("auditLog.modules.more")), 1)
140
140
  ])
141
141
  ]),
142
- default: z(() => [
143
- (m(!0), g(ae, null, se(N.value, (r) => (m(), oe(B, {
142
+ default: Y(() => [
143
+ (m(!0), y(ee, null, se($.value, (r) => (m(), oe(z, {
144
144
  key: r.value,
145
145
  "model-value": o.modelValue === r.value,
146
146
  label: r.label,
147
147
  disabled: r.disabled,
148
- onClick: (X) => $(r.value)
148
+ onClick: (B) => U(r.value)
149
149
  }, null, 8, ["model-value", "label", "disabled", "onClick"]))), 128))
150
150
  ]),
151
151
  _: 1
152
- }, 8, ["show-menu"])) : T("", !0),
152
+ }, 8, ["show-menu"])) : V("", !0),
153
153
  l("div", {
154
154
  ref_key: "measurerRef",
155
155
  ref: s,
156
156
  "aria-hidden": "true",
157
157
  class: "pointer-events-none invisible absolute -left-[9999px] -top-[9999px] flex flex-row items-center"
158
158
  }, [
159
- (m(!0), g(ae, null, se(o.items, (r) => (m(), g("div", {
159
+ (m(!0), y(ee, null, se(o.items, (r) => (m(), y("div", {
160
160
  key: `measure-${r.value}`,
161
161
  "data-tab-measure": ""
162
162
  }, [
163
- u(I, {
163
+ u(M, {
164
164
  "model-value": o.modelValue,
165
165
  label: r.label,
166
166
  badge: r.badge,
@@ -168,28 +168,28 @@ const ge = [
168
168
  value: r.value
169
169
  }, null, 8, ["model-value", "label", "badge", "disabled", "value"])
170
170
  ]))), 128)),
171
- l("div", Mt, [
172
- u(V, { name: "more_vert" }),
173
- l("span", Ft, i(n(O)("auditLog.modules.more")), 1)
171
+ l("div", Ft, [
172
+ u(F, { name: "more_vert" }),
173
+ l("span", It, i(n(P)("auditLog.modules.more")), 1)
174
174
  ])
175
175
  ], 512)
176
176
  ], 512);
177
177
  };
178
178
  }
179
- }), Dt = Lt("team", () => {
179
+ }), Dt = St("team", () => {
180
180
  const o = p([]), a = p(!1), x = L(
181
181
  () => Object.fromEntries(o.value.map((c) => [c.doc.userId, c.name]))
182
- ), F = L(
182
+ ), T = L(
183
183
  () => Object.fromEntries(o.value.map((c) => [c.doc.userId, c.email]))
184
- ), O = L(
184
+ ), P = L(
185
185
  () => Object.fromEntries(o.value.map((c) => [c.doc.userId, c.phoneNumber]))
186
186
  );
187
- async function M({ force: c = !1 } = {}) {
187
+ async function I({ force: c = !1 } = {}) {
188
188
  if (!(!c && o.value.length > 0))
189
189
  try {
190
190
  a.value = !0;
191
- const s = await xt.readTeamMembers();
192
- o.value = s.sort((w, U) => w.doc.isOwner ? -1 : w.name.localeCompare(U.name));
191
+ const s = await Lt.readTeamMembers();
192
+ o.value = s.sort((w, R) => w.doc.isOwner ? -1 : w.name.localeCompare(R.name));
193
193
  } finally {
194
194
  a.value = !1;
195
195
  }
@@ -198,253 +198,257 @@ const ge = [
198
198
  members: o,
199
199
  isLoading: a,
200
200
  userIdToName: x,
201
- userIdToEmail: F,
202
- userIdToPhone: O,
203
- readTeamMembers: M
201
+ userIdToEmail: T,
202
+ userIdToPhone: P,
203
+ readTeamMembers: I
204
204
  };
205
- }), Tt = {
205
+ }), Ot = {
206
206
  class: "flex flex-col gap-4 p-12 w-[260px]"
207
- }, Ot = {
208
- class: "text-xs font-semibold text-fm-color-typo-secondary mb-4"
209
207
  }, Vt = {
210
- class: "flex min-h-0 flex-1 flex-col gap-16"
208
+ class: "text-xs font-semibold text-fm-color-typo-secondary mb-4"
211
209
  }, Pt = {
212
- class: "space-y-16"
210
+ class: "flex min-h-0 flex-1 flex-col gap-16"
213
211
  }, jt = {
214
- class: "flex flex-wrap items-center gap-8"
212
+ class: "space-y-16"
215
213
  }, Ct = {
216
- class: "w-fit"
214
+ class: "flex flex-wrap items-center gap-8"
217
215
  }, Et = {
218
- key: 0,
219
216
  class: "w-fit"
220
217
  }, At = {
218
+ key: 0,
221
219
  class: "w-fit"
222
220
  }, Rt = {
223
221
  class: "w-fit"
224
222
  }, Ut = {
225
- class: "flex h-full flex-col"
223
+ class: "w-fit"
226
224
  }, Nt = {
225
+ class: "flex h-full flex-col"
226
+ }, $t = {
227
227
  key: 0,
228
228
  class: "flex shrink-0 items-center justify-end border-t border-fm-color-border-default py-4"
229
- }, $t = {
230
- class: "text-sm text-fm-color-typo-secondary"
231
229
  }, Yt = {
230
+ class: "text-sm text-fm-color-typo-secondary"
231
+ }, zt = {
232
232
  key: 0,
233
233
  class: "space-y-12 p-4 text-sm"
234
- }, zt = {
235
- class: "flex items-start justify-between gap-8 rounded-lg border border-fm-color-border-default p-12"
236
234
  }, Bt = {
237
- class: "min-w-0 flex-1"
235
+ class: "flex items-start justify-between gap-8 rounded-lg border border-fm-color-border-default p-12"
238
236
  }, Kt = {
239
- class: "audit-log-operation-label-detail text-base font-bold leading-snug text-fm-color-typo-primary"
237
+ class: "min-w-0 flex-1"
240
238
  }, qt = {
241
- class: "rounded-lg border border-fm-color-border-default p-12"
239
+ class: "audit-log-operation-label-detail text-base font-bold leading-snug text-fm-color-typo-primary"
242
240
  }, Ht = {
243
- class: "space-y-12"
241
+ class: "rounded-lg border border-fm-color-border-default p-12"
244
242
  }, Wt = {
245
- class: "text-xs text-fm-color-typo-secondary"
243
+ class: "space-y-12"
246
244
  }, Jt = {
247
- class: "font-semibold"
248
- }, Gt = {
249
245
  class: "text-xs text-fm-color-typo-secondary"
250
- }, Xt = {
246
+ }, Gt = {
251
247
  class: "font-semibold"
252
- }, Zt = {
248
+ }, Xt = {
253
249
  class: "text-xs text-fm-color-typo-secondary"
250
+ }, Zt = {
251
+ class: "font-semibold"
254
252
  }, Qt = {
255
- class: "break-all font-semibold"
256
- }, ea = {
257
253
  class: "text-xs text-fm-color-typo-secondary"
254
+ }, ea = {
255
+ class: "break-all font-semibold"
258
256
  }, ta = {
259
- class: "font-semibold"
257
+ class: "text-xs text-fm-color-typo-secondary"
260
258
  }, aa = {
261
- key: 0
259
+ class: "font-semibold"
262
260
  }, la = {
263
- class: "text-xs text-fm-color-typo-secondary"
261
+ key: 0
264
262
  }, oa = {
265
- class: "break-all font-mono text-xs font-semibold"
266
- }, sa = {
267
263
  class: "text-xs text-fm-color-typo-secondary"
268
- }, na = {
264
+ }, sa = {
269
265
  class: "break-all font-mono text-xs font-semibold"
270
- }, ia = {
266
+ }, na = {
271
267
  class: "text-xs text-fm-color-typo-secondary"
268
+ }, ia = {
269
+ class: "break-all font-mono text-xs font-semibold"
272
270
  }, ra = {
273
- class: "font-semibold"
271
+ class: "text-xs text-fm-color-typo-secondary"
274
272
  }, ua = {
273
+ class: "font-semibold"
274
+ }, da = {
275
275
  key: 0,
276
276
  class: "rounded-lg border border-fm-color-border-default"
277
- }, da = {
278
- class: "p-12"
279
277
  }, ca = {
280
- class: "text-base font-bold text-fm-color-typo-primary"
278
+ class: "p-12"
281
279
  }, ma = {
282
- class: "space-y-12 p-12"
280
+ class: "text-base font-bold text-fm-color-typo-primary"
283
281
  }, fa = {
284
- class: "text-xs text-fm-color-typo-secondary"
282
+ class: "space-y-12 p-12"
285
283
  }, va = {
286
- class: "font-semibold"
284
+ class: "text-xs text-fm-color-typo-secondary"
287
285
  }, pa = {
288
- class: "rounded-lg border border-fm-color-border-default"
286
+ class: "font-semibold"
289
287
  }, ba = {
290
- class: "p-12"
288
+ class: "rounded-lg border border-fm-color-border-default"
291
289
  }, ga = {
292
- class: "text-base font-bold text-fm-color-typo-primary"
290
+ class: "p-12"
293
291
  }, ha = {
294
- class: "space-y-12 p-12"
292
+ class: "text-base font-bold text-fm-color-typo-primary"
295
293
  }, ya = {
296
- class: "text-xs text-fm-color-typo-secondary"
294
+ class: "space-y-12 p-12"
297
295
  }, _a = {
298
- class: "font-semibold"
296
+ class: "text-xs text-fm-color-typo-secondary"
299
297
  }, xa = {
300
- key: 0
298
+ class: "font-semibold"
301
299
  }, La = {
302
- class: "text-xs text-fm-color-typo-secondary"
300
+ key: 0
303
301
  }, Sa = {
302
+ class: "text-xs text-fm-color-typo-secondary"
303
+ }, ka = {
304
304
  key: 0,
305
305
  class: "font-semibold"
306
- }, ka = {
306
+ }, wa = {
307
307
  key: 1,
308
308
  class: "break-all font-mono text-xs text-fm-color-typo-secondary"
309
- }, wa = {
310
- key: 1
311
309
  }, Ma = {
312
- class: "text-xs text-fm-color-typo-secondary"
310
+ key: 1
313
311
  }, Fa = {
314
- class: "font-semibold whitespace-pre-line"
312
+ class: "text-xs text-fm-color-typo-secondary"
315
313
  }, Ia = {
314
+ class: "font-semibold whitespace-pre-line"
315
+ }, Ta = {
316
316
  class: "text-xs text-fm-color-typo-secondary"
317
317
  }, Da = {
318
318
  class: "font-semibold"
319
- }, Ta = {
320
- class: "text-xs text-fm-color-typo-secondary"
321
319
  }, Oa = {
322
- class: "break-all font-mono text-xs font-semibold"
320
+ class: "text-xs text-fm-color-typo-secondary"
323
321
  }, Va = {
324
- key: 2
322
+ class: "break-all font-mono text-xs font-semibold"
325
323
  }, Pa = {
326
- class: "text-xs text-fm-color-typo-secondary"
324
+ key: 2
327
325
  }, ja = {
328
- class: "mt-4 space-y-4"
326
+ class: "text-xs text-fm-color-typo-secondary"
329
327
  }, Ca = {
330
- 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"
328
+ class: "mt-4 space-y-4"
331
329
  }, Ea = {
332
- class: "text-xs font-semibold"
330
+ 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"
333
331
  }, Aa = {
332
+ class: "text-xs font-semibold"
333
+ }, Ra = {
334
334
  key: 0,
335
335
  class: "text-fm-color-typo-secondary"
336
- }, Ra = {
337
- key: 3
338
336
  }, Ua = {
339
- class: "text-xs text-fm-color-typo-secondary"
337
+ key: 3
340
338
  }, Na = {
339
+ class: "text-xs text-fm-color-typo-secondary"
340
+ }, $a = {
341
341
  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"
342
- }, he = 100, ye = 1e3, $a = "YYYY-MM-DD HH:mm", D = "YYYY-MM-DD", je = "audit-log-export-fields", tl = /* @__PURE__ */ Ce({
342
+ }, he = 100, ye = 1e3, Ya = "YYYY-MM-DD HH:mm", O = "YYYY-MM-DD", Ce = "audit-log-export-fields", al = /* @__PURE__ */ Ee({
343
343
  __name: "AuditLogList",
344
344
  setup(o) {
345
345
  const {
346
346
  t: a
347
- } = Ee(), x = pt(), F = Dt(), O = p(!1), M = p(!1), c = p([]), s = p(null), w = p(!1);
348
- async function U(e) {
349
- const t = Uint8Array.from(atob(e), (S) => S.charCodeAt(0)), y = new DecompressionStream("gzip"), k = y.writable.getWriter();
350
- return k.write(t), k.close(), new Response(y.readable).text();
347
+ } = Ae(), x = bt(), T = Dt(), P = p(!1), I = p(!1), c = p([]), s = p(null), w = p(!1);
348
+ async function R(e) {
349
+ const t = Uint8Array.from(atob(e), (S) => S.charCodeAt(0)), b = new DecompressionStream("gzip"), k = b.writable.getWriter();
350
+ return await k.write(t), await k.close(), new Response(b.readable).text();
351
351
  }
352
- const b = p("");
353
- te(() => {
352
+ const g = p("");
353
+ let j = 0;
354
+ Q(() => {
354
355
  var e, t;
355
356
  return (t = (e = s.value) == null ? void 0 : e.metadata) == null ? void 0 : t.requestBody;
356
357
  }, async (e) => {
358
+ const t = ++j;
357
359
  if (!e) {
358
- b.value = "";
360
+ g.value = "";
359
361
  return;
360
362
  }
361
363
  if (typeof e == "object") {
362
- b.value = JSON.stringify(e, null, 2);
364
+ g.value = JSON.stringify(e, null, 2);
363
365
  return;
364
366
  }
365
367
  if (e.startsWith("gzip:")) {
366
368
  try {
367
- const t = await U(e.slice(5));
368
- b.value = JSON.stringify(JSON.parse(t), null, 2);
369
+ const b = await R(e.slice(5));
370
+ if (t !== j) return;
371
+ g.value = JSON.stringify(JSON.parse(b), null, 2);
369
372
  } catch {
370
- b.value = e;
373
+ if (t !== j) return;
374
+ g.value = e;
371
375
  }
372
376
  return;
373
377
  }
374
378
  try {
375
- b.value = JSON.stringify(JSON.parse(e), null, 2);
379
+ g.value = JSON.stringify(JSON.parse(e), null, 2);
376
380
  } catch {
377
- b.value = e;
381
+ g.value = e;
378
382
  }
379
383
  }, {
380
384
  immediate: !0
381
385
  });
382
- const h = p(1), W = p(!1), ne = _().format("YYYY-MM-DD"), Y = p({
383
- startDate: `${ne} 00:00`,
384
- endDate: `${ne} 23:59`
385
- }), N = p(), $ = p(), f = p(), v = p(), I = p("all");
386
- function V(e) {
386
+ const D = p(1), J = p(!1), te = _().format("YYYY-MM-DD"), $ = p({
387
+ startDate: `${te} 00:00`,
388
+ endDate: `${te} 23:59`
389
+ }), U = p(), f = p(), v = p(), M = p(), F = p("all");
390
+ function z(e) {
387
391
  return typeof e == "string" ? [e] : Array.isArray(e) ? e.filter((t) => typeof t == "string") : [];
388
392
  }
389
- const B = L(() => ge.map(({
393
+ const N = L(() => ge.map(({
390
394
  key: e
391
395
  }) => ({
392
396
  label: a(`auditLog.modules.${e}`),
393
397
  value: e
394
- }))), E = L(() => ge.find((e) => e.key === I.value) ?? ge[0]), r = L(() => I.value === "all"), X = L(() => F.members.map((e) => ({
398
+ }))), r = L(() => ge.find((e) => e.key === F.value) ?? ge[0]), B = L(() => F.value === "all"), H = L(() => T.members.map((e) => ({
395
399
  label: e.name,
396
400
  value: e.doc.userId
397
- }))), J = L(() => {
398
- const e = Ve.flatMap((S) => V(S.subject).map((R) => ({
401
+ }))), ne = L(() => {
402
+ const e = Pe.flatMap((S) => z(S.subject).map((A) => ({
399
403
  label: S.label,
400
- value: R
401
- }))), t = Object.entries(Te).map(([S, R]) => ({
402
- label: R,
404
+ value: A
405
+ }))), t = Object.entries(Oe).map(([S, A]) => ({
406
+ label: A,
403
407
  value: S
404
- })), y = /* @__PURE__ */ new Set(), k = [];
408
+ })), b = /* @__PURE__ */ new Set(), k = [];
405
409
  for (const S of [...e, ...t])
406
- y.has(S.value) || (y.add(S.value), k.push(S));
410
+ b.has(S.value) || (b.add(S.value), k.push(S));
407
411
  return k;
408
412
  });
409
- function ie(e, t) {
410
- const y = t.toLowerCase();
411
- return e.label.toLowerCase().includes(y) || e.value.replace(/^business::/, "").toLowerCase().includes(y) ? !0 : e.value.toLowerCase().includes(y);
413
+ function _e(e, t) {
414
+ const b = t.toLowerCase();
415
+ return e.label.toLowerCase().includes(b) || e.value.replace(/^business::/, "").toLowerCase().includes(b) ? !0 : e.value.toLowerCase().includes(b);
412
416
  }
413
- const P = L(() => ({
417
+ const h = L(() => ({
414
418
  manage: a("auditLog.action.manage"),
415
419
  create: a("auditLog.action.create"),
416
420
  read: a("auditLog.action.read"),
417
421
  update: a("auditLog.action.update"),
418
422
  delete: a("auditLog.action.delete")
419
- })), A = L(() => [{
420
- label: P.value.manage,
423
+ })), ae = L(() => [{
424
+ label: h.value.manage,
421
425
  value: "manage"
422
426
  }, {
423
- label: P.value.create,
427
+ label: h.value.create,
424
428
  value: "create"
425
429
  }, {
426
- label: P.value.read,
430
+ label: h.value.read,
427
431
  value: "read"
428
432
  }, {
429
- label: P.value.update,
433
+ label: h.value.update,
430
434
  value: "update"
431
435
  }, {
432
- label: P.value.delete,
436
+ label: h.value.delete,
433
437
  value: "delete"
434
- }]), K = L(() => ({
438
+ }]), ie = L(() => ({
435
439
  allowed: a("auditLog.outcome.success"),
436
440
  denied: a("auditLog.outcome.failed"),
437
441
  skipped: a("auditLog.outcome.skipped")
438
- })), Ae = L(() => [{
439
- label: K.value.allowed,
442
+ })), Re = L(() => [{
443
+ label: ie.value.allowed,
440
444
  value: "allowed"
441
445
  }, {
442
- label: K.value.denied,
446
+ label: ie.value.denied,
443
447
  value: "denied"
444
448
  }, {
445
- label: K.value.skipped,
449
+ label: ie.value.skipped,
446
450
  value: "skipped"
447
- }]), Re = L(() => ({
451
+ }]), Ue = L(() => ({
448
452
  admin: a("auditLog.detail.resolvedFromValue.admin"),
449
453
  staff: a("auditLog.detail.resolvedFromValue.staff"),
450
454
  permissionSet: a("auditLog.detail.resolvedFromValue.permissionSet"),
@@ -452,107 +456,107 @@ const ge = [
452
456
  custom: a("auditLog.detail.resolvedFromValue.custom"),
453
457
  "no-match": a("auditLog.detail.resolvedFromValue.noMatch"),
454
458
  unknown: a("auditLog.detail.resolvedFromValue.unknown")
455
- })), Ue = L(() => ({
456
- GET: P.value.read,
457
- POST: P.value.create,
458
- PUT: P.value.update,
459
- PATCH: P.value.update,
460
- DELETE: P.value.delete
461
- })), _e = {
459
+ })), Ne = L(() => ({
460
+ GET: h.value.read,
461
+ POST: h.value.create,
462
+ PUT: h.value.update,
463
+ PATCH: h.value.update,
464
+ DELETE: h.value.delete
465
+ })), xe = {
462
466
  allowed: "success",
463
467
  denied: "critical",
464
468
  skipped: "warning"
465
- }, Ne = L(() => {
469
+ }, $e = L(() => {
466
470
  const {
467
471
  startDate: e,
468
472
  endDate: t
469
- } = Y.value;
473
+ } = $.value;
470
474
  return e && t ? `${e} – ${t}` : e || t || a("auditLog.dateRange.placeholder");
471
- }), $e = L(() => [{
475
+ }), Ye = L(() => [{
472
476
  label: a("date.predefinedRanges.today"),
473
477
  value: {
474
- startDate: _().format(D),
475
- endDate: _().format(D)
478
+ startDate: _().format(O),
479
+ endDate: _().format(O)
476
480
  }
477
481
  }, {
478
482
  label: a("date.predefinedRanges.yesterday"),
479
483
  value: {
480
- startDate: _().subtract(1, "day").format(D),
481
- endDate: _().subtract(1, "day").format(D)
484
+ startDate: _().subtract(1, "day").format(O),
485
+ endDate: _().subtract(1, "day").format(O)
482
486
  }
483
487
  }, {
484
488
  label: a("date.predefinedRanges.thisWeek"),
485
489
  value: {
486
- startDate: _().startOf("week").format(D),
487
- endDate: _().endOf("week").format(D)
490
+ startDate: _().startOf("week").format(O),
491
+ endDate: _().endOf("week").format(O)
488
492
  }
489
493
  }, {
490
494
  label: a("date.predefinedRanges.lastWeek"),
491
495
  value: {
492
- startDate: _().subtract(1, "week").startOf("week").format(D),
493
- endDate: _().subtract(1, "week").endOf("week").format(D)
496
+ startDate: _().subtract(1, "week").startOf("week").format(O),
497
+ endDate: _().subtract(1, "week").endOf("week").format(O)
494
498
  }
495
499
  }, {
496
500
  label: a("date.predefinedRanges.last7Days"),
497
501
  value: {
498
- startDate: _().subtract(7, "day").format(D),
499
- endDate: _().subtract(1, "day").format(D)
502
+ startDate: _().subtract(7, "day").format(O),
503
+ endDate: _().subtract(1, "day").format(O)
500
504
  }
501
505
  }, {
502
506
  label: a("date.predefinedRanges.thisMonth"),
503
507
  value: {
504
- startDate: _().startOf("month").format(D),
505
- endDate: _().endOf("month").format(D)
508
+ startDate: _().startOf("month").format(O),
509
+ endDate: _().endOf("month").format(O)
506
510
  }
507
511
  }, {
508
512
  label: a("date.predefinedRanges.lastMonth"),
509
513
  value: {
510
- startDate: _().subtract(1, "month").startOf("month").format(D),
511
- endDate: _().subtract(1, "month").endOf("month").format(D)
514
+ startDate: _().subtract(1, "month").startOf("month").format(O),
515
+ endDate: _().subtract(1, "month").endOf("month").format(O)
512
516
  }
513
517
  }]);
514
518
  function me(e) {
515
519
  var t;
516
- return ((t = Ve.find((y) => y.subject === e)) == null ? void 0 : t.label) ?? Te[e];
520
+ return ((t = Pe.find((b) => b.subject === e)) == null ? void 0 : t.label) ?? Oe[e];
517
521
  }
518
522
  function re(e) {
519
- return F.userIdToName[e.userId] || e.userId;
523
+ return T.userIdToName[e.userId] || e.userId;
520
524
  }
521
- function xe(e) {
522
- return F.userIdToPhone[e.userId] || "-";
525
+ function Le(e) {
526
+ return T.userIdToPhone[e.userId] || "-";
523
527
  }
524
- function Ye(e) {
525
- return F.userIdToEmail[e.userId] || "-";
528
+ function ze(e) {
529
+ return T.userIdToEmail[e.userId] || "-";
526
530
  }
527
- function Le(e) {
531
+ function Se(e) {
528
532
  return _(e).format("DD MMM YYYY, HH:mm");
529
533
  }
530
- function ze(e) {
534
+ function Be(e) {
531
535
  return _(e).format("DD MMM YYYY, HH:mm:ss").toUpperCase();
532
536
  }
533
- function Se(e) {
534
- return P.value[e] ?? e;
537
+ function ke(e) {
538
+ return h.value[e] ?? e;
535
539
  }
536
540
  function fe(e) {
537
- return e.metadata.operationLabel ?? Se(e.action);
541
+ return e.metadata.operationLabel ?? ke(e.action);
538
542
  }
539
543
  function ve(e) {
540
- return K.value[e];
541
- }
542
- function Be(e) {
543
- return Re.value[e] ?? e;
544
+ return ie.value[e];
544
545
  }
545
546
  function Ke(e) {
546
- return e.metadata.requestMethod ? Ue.value[e.metadata.requestMethod] ?? e.metadata.requestMethod : Se(e.action);
547
+ return Ue.value[e] ?? e;
547
548
  }
548
- function ke(e) {
549
+ function qe(e) {
550
+ return e.metadata.requestMethod ? Ne.value[e.metadata.requestMethod] ?? e.metadata.requestMethod : ke(e.action);
551
+ }
552
+ function we(e) {
549
553
  const t = String(e ?? "");
550
554
  return `"${(/^[=+\-@\t\r]/.test(t) ? `'${t}` : t).replace(/"/g, '""')}"`;
551
555
  }
552
556
  const pe = [{
553
557
  key: "timestamp",
554
558
  labelKey: "auditLog.exportFields.timestamp",
555
- getValue: (e) => Le(e.timestamp),
559
+ getValue: (e) => Se(e.timestamp),
556
560
  defaultSelected: !0
557
561
  }, {
558
562
  key: "userName",
@@ -562,7 +566,7 @@ const ge = [
562
566
  }, {
563
567
  key: "userPhone",
564
568
  labelKey: "auditLog.exportFields.userPhone",
565
- getValue: (e) => xe(e),
569
+ getValue: (e) => Le(e),
566
570
  defaultSelected: !0
567
571
  }, {
568
572
  key: "subject",
@@ -624,9 +628,9 @@ const ge = [
624
628
  },
625
629
  defaultSelected: !1
626
630
  }];
627
- function qe() {
631
+ function He() {
628
632
  try {
629
- const e = localStorage.getItem(je);
633
+ const e = localStorage.getItem(Ce);
630
634
  if (e) {
631
635
  const t = JSON.parse(e);
632
636
  if (Array.isArray(t) && t.length > 0) return new Set(t);
@@ -635,74 +639,74 @@ const ge = [
635
639
  }
636
640
  return new Set(pe.filter((e) => e.defaultSelected).map((e) => e.key));
637
641
  }
638
- const Z = p(qe());
639
- function He(e) {
640
- const t = new Set(Z.value);
642
+ const G = p(He());
643
+ function We(e) {
644
+ const t = new Set(G.value);
641
645
  if (t.has(e)) {
642
646
  if (t.size <= 1) return;
643
647
  t.delete(e);
644
648
  } else
645
649
  t.add(e);
646
- Z.value = t;
650
+ G.value = t;
647
651
  try {
648
- localStorage.setItem(je, JSON.stringify([...t]));
652
+ localStorage.setItem(Ce, JSON.stringify([...t]));
649
653
  } catch {
650
654
  }
651
655
  }
652
- async function We() {
653
- var e, t, y, k, S, R;
654
- if (!M.value) {
655
- M.value = !0;
656
+ async function Je() {
657
+ var e, t, b, k, S, A;
658
+ if (!I.value) {
659
+ I.value = !0;
656
660
  try {
657
661
  const {
658
- startDate: q,
659
- endDate: H
660
- } = Y.value, G = E.value.subjectPrefixes, de = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace("T", " "), d = H ? ue(H) : null, ee = d && d < de ? d : de, et = {
661
- ...q ? {
662
- from: ue(q)
662
+ startDate: K,
663
+ endDate: q
664
+ } = $.value, W = r.value.subjectPrefixes, de = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace("T", " "), d = q ? ue(q) : null, Z = d && d < de ? d : de, tt = {
665
+ ...K ? {
666
+ from: ue(K)
663
667
  } : {},
664
- to: ee,
665
- ...(e = N.value) != null && e.length ? {
666
- userIds: N.value
668
+ to: Z,
669
+ ...(e = U.value) != null && e.length ? {
670
+ userIds: U.value
667
671
  } : {},
668
- ...r.value && ((t = $.value) != null && t.length) ? {
669
- subjects: $.value
672
+ ...B.value && ((t = f.value) != null && t.length) ? {
673
+ subjects: f.value
670
674
  } : {},
671
- ...G.length ? {
672
- subjectPrefixes: [...G]
675
+ ...W.length ? {
676
+ subjectPrefixes: [...W]
673
677
  } : {},
674
- ...(y = v.value) != null && y.length ? {
675
- actions: v.value
678
+ ...(b = M.value) != null && b.length ? {
679
+ actions: M.value
676
680
  } : {},
677
- ...(k = f.value) != null && k.length ? {
678
- outcomes: f.value
681
+ ...(k = v.value) != null && k.length ? {
682
+ outcomes: v.value
679
683
  } : {}
680
- }, we = [];
681
- let Me = 0;
684
+ }, Me = [];
685
+ let Fe = 0;
682
686
  for (; ; ) {
683
- const j = await Pe.read({
684
- ...et,
687
+ const C = await je.read({
688
+ ...tt,
685
689
  limit: ye,
686
- offset: Me
690
+ offset: Fe
687
691
  });
688
- if (we.push(...j), j.length < ye) break;
689
- Me += ye;
692
+ if (Me.push(...C), C.length < ye) break;
693
+ Fe += ye;
690
694
  }
691
- const Fe = pe.filter((j) => Z.value.has(j.key)), tt = Fe.map((j) => a(j.labelKey)), at = we.map((j) => Fe.map((ct) => ct.getValue(j) ?? "")), be = -(/* @__PURE__ */ new Date()).getTimezoneOffset(), lt = be >= 0 ? "+" : "-", ot = String(Math.floor(Math.abs(be) / 60)).padStart(2, "0"), st = String(Math.abs(be) % 60).padStart(2, "0"), nt = `UTC${lt}${ot}:${st}`, Ie = ((S = x.currentBusiness.value) == null ? void 0 : S.name) || "", it = [q, H].filter(Boolean).join(" – "), rt = [...[[a("auditLog.title")], [`${a("auditLog.frontMatter.date")}: ${it}`], ...Ie ? [[`${a("auditLog.frontMatter.business")}: ${Ie}`]] : [], [`${a("auditLog.frontMatter.generatedBy")}: ${_().format("DD MMM YYYY, HH:mm")} (${nt})`], []].map((j) => j.map(ke).join(",")), ...[tt, ...at].map((j) => j.map(ke).join(","))].join(`
692
- `), ut = `audit-log_${(((R = x.currentBusiness.value) == null ? void 0 : R.name) || "business").replace(/[^a-z0-9_-]+/gi, "_")}_${_().format("YYYYMMDD_HHmmss")}.csv`, dt = new Blob([`\uFEFF${rt}`], {
695
+ const Ie = pe.filter((C) => G.value.has(C.key)), at = Ie.map((C) => a(C.labelKey)), lt = Me.map((C) => Ie.map((mt) => mt.getValue(C) ?? "")), be = -(/* @__PURE__ */ new Date()).getTimezoneOffset(), ot = be >= 0 ? "+" : "-", st = String(Math.floor(Math.abs(be) / 60)).padStart(2, "0"), nt = String(Math.abs(be) % 60).padStart(2, "0"), it = `UTC${ot}${st}:${nt}`, Te = ((S = x.currentBusiness.value) == null ? void 0 : S.name) || "", rt = [K, q].filter(Boolean).join(" – "), ut = [...[[a("auditLog.title")], [`${a("auditLog.frontMatter.date")}: ${rt}`], ...Te ? [[`${a("auditLog.frontMatter.business")}: ${Te}`]] : [], [`${a("auditLog.frontMatter.generatedBy")}: ${_().format("DD MMM YYYY, HH:mm")} (${it})`], []].map((C) => C.map(we).join(",")), ...[at, ...lt].map((C) => C.map(we).join(","))].join(`
696
+ `), dt = `audit-log_${(((A = x.currentBusiness.value) == null ? void 0 : A.name) || "business").replace(/[^a-z0-9_-]+/gi, "_")}_${_().format("YYYYMMDD_HHmmss")}.csv`, ct = new Blob([`\uFEFF${ut}`], {
693
697
  type: "text/csv;charset=utf-8;"
694
- }), De = window.URL.createObjectURL(dt), le = document.createElement("a");
695
- le.href = De, le.download = ut, document.body.appendChild(le), le.click(), le.remove(), window.URL.revokeObjectURL(De);
698
+ }), De = window.URL.createObjectURL(ct), le = document.createElement("a");
699
+ le.href = De, le.download = dt, document.body.appendChild(le), le.click(), le.remove(), window.URL.revokeObjectURL(De);
696
700
  } finally {
697
- M.value = !1;
701
+ I.value = !1;
698
702
  }
699
703
  }
700
704
  }
701
- const Je = [{
705
+ const Ge = [{
702
706
  accessorKey: "timestamp",
703
707
  header: () => a("auditLog.columns.timestamp"),
704
708
  cell(e) {
705
- return Le(e.row.original.timestamp);
709
+ return Se(e.row.original.timestamp);
706
710
  }
707
711
  }, {
708
712
  accessorKey: "userId",
@@ -713,7 +717,7 @@ const ge = [
713
717
  const t = e.row.original;
714
718
  return u("div", {
715
719
  class: "flex items-center gap-8"
716
- }, [u(Oe.FmAvatar, {
720
+ }, [u(Ve.FmAvatar, {
717
721
  initials: re(t),
718
722
  size: "sm",
719
723
  class: "shrink-0"
@@ -723,7 +727,7 @@ const ge = [
723
727
  class: "truncate font-semibold"
724
728
  }, [re(t)]), u("p", {
725
729
  class: "truncate text-fm-color-typo-secondary"
726
- }, [xe(t)])])]);
730
+ }, [Le(t)])])]);
727
731
  }
728
732
  }, {
729
733
  accessorKey: "subject",
@@ -754,194 +758,194 @@ const ge = [
754
758
  enableSorting: !1,
755
759
  cell(e) {
756
760
  const t = e.row.original;
757
- return u(Oe.FmChip, {
758
- variant: _e[t.outcome] ?? "neutral",
761
+ return u(Ve.FmChip, {
762
+ variant: xe[t.outcome] ?? "neutral",
759
763
  label: ve(t.outcome),
760
764
  compact: !0
761
765
  }, null);
762
766
  }
763
767
  }];
764
768
  function ue(e) {
765
- const t = _(e, $a);
769
+ const t = _(e, Ya);
766
770
  return new Date(t.year(), t.month(), t.date(), t.hour(), t.minute(), 0).toISOString().slice(0, 19).replace("T", " ");
767
771
  }
768
- async function Q() {
769
- var e, t, y, k;
770
- O.value = !0;
772
+ async function X() {
773
+ var e, t, b, k;
774
+ P.value = !0;
771
775
  try {
772
776
  const {
773
777
  startDate: S,
774
- endDate: R
775
- } = Y.value, q = (h.value - 1) * he, H = E.value.subjectPrefixes, G = await Pe.read({
778
+ endDate: A
779
+ } = $.value, K = (D.value - 1) * he, q = r.value.subjectPrefixes, W = await je.read({
776
780
  limit: he,
777
- offset: q,
781
+ offset: K,
778
782
  ...S ? {
779
783
  from: ue(S)
780
784
  } : {},
781
- ...R ? {
782
- to: ue(R)
785
+ ...A ? {
786
+ to: ue(A)
783
787
  } : {},
784
- ...(e = N.value) != null && e.length ? {
785
- userIds: N.value
788
+ ...(e = U.value) != null && e.length ? {
789
+ userIds: U.value
786
790
  } : {},
787
- ...r.value && ((t = $.value) != null && t.length) ? {
788
- subjects: $.value
791
+ ...B.value && ((t = f.value) != null && t.length) ? {
792
+ subjects: f.value
789
793
  } : {},
790
- ...H.length ? {
791
- subjectPrefixes: [...H]
794
+ ...q.length ? {
795
+ subjectPrefixes: [...q]
792
796
  } : {},
793
- ...(y = v.value) != null && y.length ? {
794
- actions: v.value
797
+ ...(b = M.value) != null && b.length ? {
798
+ actions: M.value
795
799
  } : {},
796
- ...(k = f.value) != null && k.length ? {
797
- outcomes: f.value
800
+ ...(k = v.value) != null && k.length ? {
801
+ outcomes: v.value
798
802
  } : {}
799
803
  });
800
- c.value = G, W.value = G.length === he;
804
+ c.value = W, J.value = W.length === he;
801
805
  } finally {
802
- O.value = !1;
806
+ P.value = !1;
803
807
  }
804
808
  }
805
- te(Y, () => {
806
- h.value = 1, Q();
807
- }), te([N, $, f, v], () => {
808
- h.value = 1, Q();
809
- }), te(I, () => {
810
- h.value = 1, Q();
809
+ Q($, () => {
810
+ D.value = 1, X();
811
+ }), Q([U, f, v, M], () => {
812
+ D.value = 1, X();
813
+ }), Q(F, () => {
814
+ D.value = 1, X();
811
815
  });
812
- async function Ge() {
813
- h.value > 1 && (h.value--, await Q());
814
- }
815
816
  async function Xe() {
816
- W.value && (h.value++, await Q());
817
+ D.value > 1 && (D.value--, await X());
818
+ }
819
+ async function Ze() {
820
+ J.value && (D.value++, await X());
817
821
  }
818
- function Ze(e) {
822
+ function Qe(e) {
819
823
  s.value = e, w.value = !0;
820
824
  }
821
- function Qe() {
825
+ function et() {
822
826
  w.value = !1, s.value = null;
823
827
  }
824
- return te(x.currentBusiness, (e) => {
825
- e && (h.value = 1, F.readTeamMembers(), Q());
828
+ return Q(x.currentBusiness, (e) => {
829
+ e && (D.value = 1, T.readTeamMembers(), X());
826
830
  }, {
827
831
  immediate: !0
828
832
  }), (e, t) => {
829
- const y = C("FmSpacer"), k = C("FmButton"), S = C("FmMenuItem"), R = C("FmMenu"), q = C("FmChip"), H = C("FmDateRangePicker"), G = C("FmTable"), de = C("FmSideSheet");
830
- return m(), g(ae, null, [u(yt, {
833
+ const b = E("FmSpacer"), k = E("FmButton"), S = E("FmMenuItem"), A = E("FmMenu"), K = E("FmChip"), q = E("FmDateRangePicker"), W = E("FmTable"), de = E("FmSideSheet");
834
+ return m(), y(ee, null, [u(_t, {
831
835
  heading: n(a)("auditLog.title")
832
836
  }, {
833
- "append-heading": z(() => [u(y), u(k, {
837
+ "append-heading": Y(() => [u(b), u(k, {
834
838
  variant: "primary",
835
839
  "prepend-icon": "upload",
836
840
  label: n(a)("auditLog.export"),
837
- disabled: c.value.length === 0 || M.value || n(F).isLoading || n(F).members.length === 0,
838
- loading: M.value,
839
- onClick: We
840
- }, null, 8, ["label", "disabled", "loading"]), u(R, {
841
+ disabled: c.value.length === 0 || I.value || n(T).isLoading || n(T).members.length === 0,
842
+ loading: I.value,
843
+ onClick: Je
844
+ }, null, 8, ["label", "disabled", "loading"]), u(A, {
841
845
  "close-on-click": !1,
842
846
  "z-index": 50
843
847
  }, {
844
- "menu-button": z(() => [u(k, {
848
+ "menu-button": Y(() => [u(k, {
845
849
  variant: "tertiary",
846
850
  icon: "settings",
847
851
  "aria-label": n(a)("auditLog.exportSettings.title"),
848
- disabled: M.value
852
+ disabled: I.value
849
853
  }, null, 8, ["aria-label", "disabled"])]),
850
- default: z(() => [l("div", Tt, [l("p", Ot, i(n(a)("auditLog.exportSettings.title")), 1), (m(), g(ae, null, se(pe, (d) => u(S, {
854
+ default: Y(() => [l("div", Ot, [l("p", Vt, i(n(a)("auditLog.exportSettings.title")), 1), (m(), y(ee, null, se(pe, (d) => u(S, {
851
855
  key: d.key,
852
856
  label: n(a)(d.labelKey),
853
857
  "has-checkbox": "",
854
- "model-value": Z.value.has(d.key),
855
- disabled: Z.value.has(d.key) && Z.value.size === 1,
856
- onClick: (ee) => He(d.key)
858
+ "model-value": G.value.has(d.key),
859
+ disabled: G.value.has(d.key) && G.value.size === 1,
860
+ onClick: (Z) => We(d.key)
857
861
  }, null, 8, ["label", "model-value", "disabled", "onClick"])), 64))])]),
858
862
  _: 1
859
863
  })]),
860
- default: z(() => [l("div", Vt, [l("div", Pt, [u(It, {
861
- modelValue: I.value,
862
- "onUpdate:modelValue": t[0] || (t[0] = (d) => I.value = d),
863
- items: B.value
864
- }, null, 8, ["modelValue", "items"]), l("div", jt, [u(H, {
865
- modelValue: Y.value,
866
- "onUpdate:modelValue": t[1] || (t[1] = (d) => Y.value = d),
864
+ default: Y(() => [l("div", Pt, [l("div", jt, [u(Tt, {
865
+ modelValue: F.value,
866
+ "onUpdate:modelValue": t[0] || (t[0] = (d) => F.value = d),
867
+ items: N.value
868
+ }, null, 8, ["modelValue", "items"]), l("div", Ct, [u(q, {
869
+ modelValue: $.value,
870
+ "onUpdate:modelValue": t[1] || (t[1] = (d) => $.value = d),
867
871
  "show-predefined-range": "",
868
872
  "show-time": "",
869
- "predefined-range": $e.value
873
+ "predefined-range": Ye.value
870
874
  }, {
871
- "trigger-button": z(() => [u(q, {
872
- label: Ne.value,
875
+ "trigger-button": Y(() => [u(K, {
876
+ label: $e.value,
873
877
  icon: "calendar_month"
874
878
  }, null, 8, ["label"])]),
875
879
  _: 1
876
- }, 8, ["modelValue", "predefined-range"]), l("div", Ct, [u(ce, {
877
- modelValue: N.value,
878
- "onUpdate:modelValue": t[2] || (t[2] = (d) => N.value = d),
879
- items: X.value,
880
+ }, 8, ["modelValue", "predefined-range"]), l("div", Et, [u(ce, {
881
+ modelValue: U.value,
882
+ "onUpdate:modelValue": t[2] || (t[2] = (d) => U.value = d),
883
+ items: H.value,
880
884
  multiple: "",
881
885
  variant: "dark",
882
886
  placeholder: n(a)("auditLog.filter.user_placeholder"),
883
887
  "selected-prefix": n(a)("auditLog.filter.selected_user_prefix"),
884
888
  "chip-icon": "account_circle"
885
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), r.value ? (m(), g("div", Et, [u(ce, {
886
- modelValue: $.value,
887
- "onUpdate:modelValue": t[3] || (t[3] = (d) => $.value = d),
888
- items: J.value,
889
- "filter-fn": ie,
889
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), B.value ? (m(), y("div", At, [u(ce, {
890
+ modelValue: f.value,
891
+ "onUpdate:modelValue": t[3] || (t[3] = (d) => f.value = d),
892
+ items: ne.value,
893
+ "filter-fn": _e,
890
894
  multiple: "",
891
895
  variant: "dark",
892
896
  placeholder: n(a)("auditLog.filter.subject_placeholder"),
893
897
  "selected-prefix": n(a)("auditLog.filter.selected_subject_prefix"),
894
898
  "chip-icon": "badge"
895
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])) : T("", !0), l("div", At, [u(ce, {
896
- modelValue: v.value,
897
- "onUpdate:modelValue": t[4] || (t[4] = (d) => v.value = d),
898
- items: A.value,
899
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])) : V("", !0), l("div", Rt, [u(ce, {
900
+ modelValue: M.value,
901
+ "onUpdate:modelValue": t[4] || (t[4] = (d) => M.value = d),
902
+ items: ae.value,
899
903
  multiple: "",
900
904
  variant: "dark",
901
905
  placeholder: n(a)("auditLog.filter.action_placeholder"),
902
906
  "selected-prefix": n(a)("auditLog.filter.selected_action_prefix"),
903
907
  searchable: !1
904
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), l("div", Rt, [u(ce, {
905
- modelValue: f.value,
906
- "onUpdate:modelValue": t[5] || (t[5] = (d) => f.value = d),
907
- items: Ae.value,
908
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), l("div", Ut, [u(ce, {
909
+ modelValue: v.value,
910
+ "onUpdate:modelValue": t[5] || (t[5] = (d) => v.value = d),
911
+ items: Re.value,
908
912
  multiple: "",
909
913
  variant: "dark",
910
914
  placeholder: n(a)("auditLog.filter.status_placeholder"),
911
915
  "selected-prefix": n(a)("auditLog.filter.selected_status_prefix"),
912
916
  searchable: !1,
913
917
  "chip-icon": "check_circle"
914
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])])]), !O.value && c.value.length === 0 ? (m(), oe(n(_t), {
918
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])])]), !P.value && c.value.length === 0 ? (m(), oe(n(xt), {
915
919
  key: 0,
916
920
  title: n(a)("auditLog.noData.title"),
917
921
  subtitle: n(a)("auditLog.noData.subtitle")
918
- }, null, 8, ["title", "subtitle"])) : (m(), oe(bt, {
922
+ }, null, 8, ["title", "subtitle"])) : (m(), oe(gt, {
919
923
  key: 1
920
924
  }, {
921
- default: z(() => [l("div", Ut, [u(G, {
922
- "column-defs": Je,
925
+ default: Y(() => [l("div", Nt, [u(W, {
926
+ "column-defs": Ge,
923
927
  "row-data": c.value,
924
928
  "page-size": c.value.length,
925
- loading: O.value,
929
+ loading: P.value,
926
930
  "pin-header-row": "",
927
931
  "hide-footer": "",
928
932
  class: "min-h-0 flex-1 cursor-pointer",
929
- onRowClick: t[6] || (t[6] = (d) => Ze(d.original))
930
- }, null, 8, ["row-data", "page-size", "loading"]), h.value > 1 || W.value ? (m(), g("div", Nt, [u(k, {
933
+ onRowClick: t[6] || (t[6] = (d) => Qe(d.original))
934
+ }, null, 8, ["row-data", "page-size", "loading"]), D.value > 1 || J.value ? (m(), y("div", $t, [u(k, {
931
935
  variant: "tertiary",
932
936
  icon: "chevron_left",
933
- disabled: h.value === 1,
937
+ disabled: D.value === 1,
934
938
  "aria-label": n(a)("auditLog.pagination.prevPage"),
935
- onClick: Ge
936
- }, null, 8, ["disabled", "aria-label"]), l("span", $t, i(n(a)("auditLog.pagination.page", {
937
- page: h.value
939
+ onClick: Xe
940
+ }, null, 8, ["disabled", "aria-label"]), l("span", Yt, i(n(a)("auditLog.pagination.page", {
941
+ page: D.value
938
942
  })), 1), u(k, {
939
943
  variant: "tertiary",
940
944
  icon: "chevron_right",
941
- disabled: !W.value,
945
+ disabled: !J.value,
942
946
  "aria-label": n(a)("auditLog.pagination.nextPage"),
943
- onClick: Xe
944
- }, null, 8, ["disabled", "aria-label"])])) : T("", !0)])]),
947
+ onClick: Ze
948
+ }, null, 8, ["disabled", "aria-label"])])) : V("", !0)])]),
945
949
  _: 1
946
950
  }))])]),
947
951
  _: 1
@@ -951,26 +955,26 @@ const ge = [
951
955
  "max-width": 480,
952
956
  "dismiss-away": "",
953
957
  "onUpdate:modelValue": t[7] || (t[7] = (d) => {
954
- d || Qe();
958
+ d || et();
955
959
  })
956
960
  }, {
957
- default: z(() => [s.value ? (m(), g("div", Yt, [l("div", zt, [l("div", Bt, [l("p", Kt, i(fe(s.value)), 1)]), u(q, {
958
- variant: _e[s.value.outcome] ?? "neutral",
961
+ default: Y(() => [s.value ? (m(), y("div", zt, [l("div", Bt, [l("div", Kt, [l("p", qt, i(fe(s.value)), 1)]), u(K, {
962
+ variant: xe[s.value.outcome] ?? "neutral",
959
963
  label: ve(s.value.outcome),
960
964
  compact: ""
961
- }, null, 8, ["variant", "label"])]), l("div", qt, [l("div", Ht, [l("div", null, [l("p", Wt, i(n(a)("auditLog.detail.date")), 1), l("p", Jt, i(ze(s.value.timestamp)), 1)]), l("div", null, [l("p", Gt, i(n(a)("auditLog.detail.user")), 1), l("p", Xt, i(re(s.value)), 1)]), l("div", null, [l("p", Zt, i(n(a)("auditLog.detail.email")), 1), l("p", Qt, i(Ye(s.value)), 1)]), l("div", null, [l("p", ea, i(n(a)("auditLog.detail.role")), 1), l("p", ta, i(me(s.value.subject) || s.value.subject), 1)]), s.value.field ? (m(), g("div", aa, [l("p", la, i(n(a)("auditLog.detail.field")), 1), l("p", oa, i(s.value.field), 1)])) : T("", !0), l("div", null, [l("p", sa, i(n(a)("auditLog.detail.business")), 1), l("p", na, i(s.value.businessId || "-"), 1)]), l("div", null, [l("p", ia, i(n(a)("auditLog.detail.restaurant")), 1), l("p", ra, i(s.value.restaurantId || "-"), 1)])])]), s.value.metadata.operationLabel ? (m(), g("div", ua, [l("div", da, [l("p", ca, i(n(a)("auditLog.detail.changeDetails")), 1)]), t[8] || (t[8] = l("hr", {
965
+ }, null, 8, ["variant", "label"])]), l("div", Ht, [l("div", Wt, [l("div", null, [l("p", Jt, i(n(a)("auditLog.detail.date")), 1), l("p", Gt, i(Be(s.value.timestamp)), 1)]), l("div", null, [l("p", Xt, i(n(a)("auditLog.detail.user")), 1), l("p", Zt, i(re(s.value)), 1)]), l("div", null, [l("p", Qt, i(n(a)("auditLog.detail.email")), 1), l("p", ea, i(ze(s.value)), 1)]), l("div", null, [l("p", ta, i(n(a)("auditLog.detail.role")), 1), l("p", aa, i(me(s.value.subject) || s.value.subject), 1)]), s.value.field ? (m(), y("div", la, [l("p", oa, i(n(a)("auditLog.detail.field")), 1), l("p", sa, i(s.value.field), 1)])) : V("", !0), l("div", null, [l("p", na, i(n(a)("auditLog.detail.business")), 1), l("p", ia, i(s.value.businessId || "-"), 1)]), l("div", null, [l("p", ra, i(n(a)("auditLog.detail.restaurant")), 1), l("p", ua, i(s.value.restaurantId || "-"), 1)])])]), s.value.metadata.operationLabel ? (m(), y("div", da, [l("div", ca, [l("p", ma, i(n(a)("auditLog.detail.changeDetails")), 1)]), t[8] || (t[8] = l("hr", {
962
966
  class: "border-fm-color-border-default"
963
- }, null, -1)), l("div", ma, [l("div", null, [l("p", fa, i(n(a)("auditLog.detail.eventType")), 1), l("p", va, i(s.value.metadata.operationLabel), 1)])])])) : T("", !0), l("div", pa, [l("div", ba, [l("p", ga, i(n(a)("auditLog.detail.metadata")), 1)]), t[9] || (t[9] = l("hr", {
967
+ }, null, -1)), l("div", fa, [l("div", null, [l("p", va, i(n(a)("auditLog.detail.eventType")), 1), l("p", pa, i(s.value.metadata.operationLabel), 1)])])])) : V("", !0), l("div", ba, [l("div", ga, [l("p", ha, i(n(a)("auditLog.detail.metadata")), 1)]), t[9] || (t[9] = l("hr", {
964
968
  class: "border-fm-color-border-default"
965
- }, null, -1)), l("div", ha, [l("div", null, [l("p", ya, i(n(a)("auditLog.detail.resolvedFrom")), 1), l("p", _a, i(Be(s.value.metadata.resolvedFrom)), 1)]), (s.value.metadata.resolvedFrom === "permissionSet" || s.value.metadata.resolvedFrom === "systemPermissionSet") && (s.value.metadata.permissionSetName || s.value.metadata.permissionSetId) ? (m(), g("div", xa, [l("p", La, i(n(a)("auditLog.detail.permissionSet")), 1), s.value.metadata.permissionSetName ? (m(), g("p", Sa, i(s.value.metadata.permissionSetName), 1)) : T("", !0), s.value.metadata.permissionSetId ? (m(), g("p", ka, i(s.value.metadata.permissionSetId), 1)) : T("", !0)])) : T("", !0), s.value.metadata.reason ? (m(), g("div", wa, [l("p", Ma, i(n(a)("auditLog.detail.reason")), 1), l("p", Fa, i(s.value.metadata.reason), 1)])) : T("", !0), l("div", null, [l("p", Ia, i(n(a)("auditLog.detail.requestMethod")), 1), l("p", Da, i(Ke(s.value)), 1)]), l("div", null, [l("p", Ta, i(n(a)("auditLog.detail.requestPath")), 1), l("p", Oa, i(s.value.metadata.requestPath || "-"), 1)]), s.value.metadata.trace && s.value.metadata.trace.length > 0 ? (m(), g("div", Va, [l("p", Pa, i(n(a)("auditLog.detail.permissionTrace")), 1), l("ol", ja, [(m(!0), g(ae, null, se(s.value.metadata.trace, (d, ee) => (m(), g("li", {
966
- key: ee,
969
+ }, null, -1)), l("div", ya, [l("div", null, [l("p", _a, i(n(a)("auditLog.detail.resolvedFrom")), 1), l("p", xa, i(Ke(s.value.metadata.resolvedFrom)), 1)]), (s.value.metadata.resolvedFrom === "permissionSet" || s.value.metadata.resolvedFrom === "systemPermissionSet") && (s.value.metadata.permissionSetName || s.value.metadata.permissionSetId) ? (m(), y("div", La, [l("p", Sa, i(n(a)("auditLog.detail.permissionSet")), 1), s.value.metadata.permissionSetName ? (m(), y("p", ka, i(s.value.metadata.permissionSetName), 1)) : V("", !0), s.value.metadata.permissionSetId ? (m(), y("p", wa, i(s.value.metadata.permissionSetId), 1)) : V("", !0)])) : V("", !0), s.value.metadata.reason ? (m(), y("div", Ma, [l("p", Fa, i(n(a)("auditLog.detail.reason")), 1), l("p", Ia, i(s.value.metadata.reason), 1)])) : V("", !0), l("div", null, [l("p", Ta, i(n(a)("auditLog.detail.requestMethod")), 1), l("p", Da, i(qe(s.value)), 1)]), l("div", null, [l("p", Oa, i(n(a)("auditLog.detail.requestPath")), 1), l("p", Va, i(s.value.metadata.requestPath || "-"), 1)]), s.value.metadata.trace && s.value.metadata.trace.length > 0 ? (m(), y("div", Pa, [l("p", ja, i(n(a)("auditLog.detail.permissionTrace")), 1), l("ol", Ca, [(m(!0), y(ee, null, se(s.value.metadata.trace, (d, Z) => (m(), y("li", {
970
+ key: Z,
967
971
  class: "flex items-center gap-6"
968
- }, [l("span", Ca, i(ee + 1), 1), l("span", Ea, i(d), 1), ee < s.value.metadata.trace.length - 1 ? (m(), g("span", Aa, "→")) : T("", !0)]))), 128))])])) : T("", !0), b.value ? (m(), g("div", Ra, [l("p", Ua, i(n(a)("auditLog.detail.requestBody")), 1), l("pre", Na, i(b.value), 1)])) : T("", !0)])])])) : T("", !0)]),
972
+ }, [l("span", Ea, i(Z + 1), 1), l("span", Aa, i(d), 1), Z < s.value.metadata.trace.length - 1 ? (m(), y("span", Ra, "→")) : V("", !0)]))), 128))])])) : V("", !0), g.value ? (m(), y("div", Ua, [l("p", Na, i(n(a)("auditLog.detail.requestBody")), 1), l("pre", $a, i(g.value), 1)])) : V("", !0)])])])) : V("", !0)]),
969
973
  _: 1
970
974
  }, 8, ["header", "model-value"])], 64);
971
975
  };
972
976
  }
973
977
  });
974
978
  export {
975
- tl as default
979
+ al as default
976
980
  };