@feedmepos/mf-hrm-portal 2.3.2-dev.15 → 2.3.2-dev.17

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 (108) hide show
  1. package/dist/{ApprovalCodeList-qB2eycv0.js → ApprovalCodeList-Bo8IbNxV.js} +15 -14
  2. package/dist/{AuditLogList-DaqYMXFA.js → AuditLogList-C7CjPILA.js} +833 -823
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-C-4BaMN-.js +438 -0
  4. package/dist/EmployeeList-BOP-gaTp.js +776 -0
  5. package/dist/FormItem.vue_vue_type_script_setup_true_lang-BEOR-8QD.js +45 -0
  6. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  7. package/dist/{GrantUserList-DqeHBPqr.js → GrantUserList-CXWGr3Wo.js} +16 -15
  8. package/dist/Main-BrP1frfO.js +96 -0
  9. package/dist/{Main-8SeOYhVr.js → Main-DeuWov9n.js} +5 -5
  10. package/dist/{Main-DnWIkti6.js → Main-bru10M5U.js} +2097 -2102
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  12. package/dist/{PermissionSetList-Bh0o_HFX.js → PermissionSetList--xt0piQz.js} +137 -136
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-D5nvRsW3.js +4167 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DiNDrCy0.js +35 -0
  15. package/dist/RoleList-BEE-8EQK.js +740 -0
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-BSmFLxZS.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Cqo5kHcF.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-C0Y9XHXR.js → ScheduleGeneralPage-DxhgBLix.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-B1293tLU.js → ScheduleModal.vue_vue_type_script_setup_true_lang-DGPwmNQb.js} +186 -187
  19. package/dist/{SchedulePage-Cqp0mIOQ.js → SchedulePage-oBdEvGWN.js} +20 -20
  20. package/dist/{SchedulePositionPage-DpF7fZ2G.js → SchedulePositionPage-BZps-kKs.js} +3 -3
  21. package/dist/{SelectFilter-jjUAj29l.js → SelectFilter-Bs_LCk3L.js} +1 -1
  22. package/dist/TeamMemberList-DCgNcs4P.js +1154 -0
  23. package/dist/{TimesheetList-CzUVfPGT.js → TimesheetList-BW6iCigo.js} +9 -9
  24. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-CZ6axjWg.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-Dv66Af5C.js} +3 -3
  25. package/dist/{app-IdmhLBBn.js → app-B8xnhtVI.js} +3706 -7569
  26. package/dist/app.js +3 -3
  27. package/dist/{approval-code-BOfGQEGW.js → approval-code-B0jU1bvk.js} +1 -1
  28. package/dist/{dayjs.min-DkHZ47ah.js → dayjs.min-CdpSCqn1.js} +34 -34
  29. package/dist/{employee-CJXt2fuN.js → employee-DlFGiUgI.js} +47 -48
  30. package/dist/{grant-user-Bj6DpBWc.js → grant-user-C3C6glCk.js} +1 -1
  31. package/dist/{iteration-BRk48OAH.js → iteration-BM0iyDBd.js} +1 -1
  32. package/dist/{lodash-CDREeRGa.js → lodash-KK9U7NAy.js} +1 -1
  33. package/dist/restaurant-C7o2Yk6j.js +2688 -0
  34. package/dist/{role-CtYVs62K.js → role-DYCorsOh.js} +20 -19
  35. package/dist/rule-BhGHZqKO.js +783 -0
  36. package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
  37. package/dist/src/helpers/permission-set.d.ts +102 -1
  38. package/dist/src/helpers/rule.d.ts +2 -2
  39. package/dist/src/helpers/string.d.ts +1 -10
  40. package/dist/src/router/shared.d.ts +1 -3
  41. package/dist/src/stores/restaurant.d.ts +7 -7
  42. package/dist/src/stores/team.d.ts +1 -31
  43. package/dist/src/types/team.d.ts +1 -17
  44. package/dist/src/views/audit-log/locales/index.d.ts +0 -12
  45. package/dist/src/views/audit-log/useTraceIdDeepLink.d.ts +1 -1
  46. package/dist/src/views/hr/locales/index.d.ts +0 -20
  47. package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
  48. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  49. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  50. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  51. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  52. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
  53. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
  54. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
  55. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
  56. package/dist/src/views/team/locales/index.d.ts +0 -716
  57. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
  58. package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
  59. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
  60. package/dist/string-VNuQNweN.js +15 -0
  61. package/dist/style.css +1 -1
  62. package/dist/tsconfig.app.tsbuildinfo +1 -1
  63. package/dist/{useAppStore-DAW1zVPH.js → useAppStore-C1lk2Q2j.js} +1 -1
  64. package/dist/{useLoading-C-AZgSLr.js → useLoading-CXdGsnHm.js} +1 -1
  65. package/dist/useReportPermissions-D_I4rFVo.js +82 -0
  66. package/package.json +3 -3
  67. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-orzPqq0L.js +0 -459
  68. package/dist/EmployeeList-h0fWCjea.js +0 -896
  69. package/dist/FormSection.vue_vue_type_script_setup_true_lang-rg4r9aRR.js +0 -90
  70. package/dist/Main-s-s803fq.js +0 -101
  71. package/dist/MyPosProfile-ChVMjpLY.js +0 -360
  72. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
  73. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-05XZu7a9.js +0 -4212
  74. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-rb5MPBnA.js +0 -1797
  75. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-CwzYGZNY.js +0 -547
  76. package/dist/RoleList-BjcuUCyF.js +0 -274
  77. package/dist/TeamMemberList-B2wxF6Yn.js +0 -2082
  78. package/dist/member-grant-BkZ_oF44.js +0 -54
  79. package/dist/restaurant-BEdgW6Se.js +0 -49
  80. package/dist/rule-CWR80AmG.js +0 -839
  81. package/dist/src/api/my-pos-profile/index.d.ts +0 -3
  82. package/dist/src/api/sso-provider/index.d.ts +0 -5
  83. package/dist/src/api/staff-invite/index.d.ts +0 -16
  84. package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
  85. package/dist/src/composables/useMenuAccess.d.ts +0 -56
  86. package/dist/src/composables/useSsoProviders.d.ts +0 -19
  87. package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
  88. package/dist/src/composables/useTenant.d.ts +0 -11
  89. package/dist/src/helpers/member-grant.d.ts +0 -36
  90. package/dist/src/helpers/my-pos-profile.d.ts +0 -37
  91. package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
  92. package/dist/src/helpers/staff-invite.d.ts +0 -54
  93. package/dist/src/router/courtGuard.d.ts +0 -4
  94. package/dist/src/router/menu-access-guard.d.ts +0 -17
  95. package/dist/src/types/my-pos-profile.d.ts +0 -24
  96. package/dist/src/types/sso-provider.d.ts +0 -10
  97. package/dist/src/types/staff-invite.d.ts +0 -100
  98. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
  99. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
  100. package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -236
  101. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
  102. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
  103. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
  104. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
  105. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
  106. package/dist/string-DZQ1uNjn.js +0 -22
  107. package/dist/useReportPermissions-ld6buoVe.js +0 -80
  108. package/dist/useSsoProviders-DeTogbyW.js +0 -41
@@ -1,19 +1,19 @@
1
- import { defineComponent as Vt, ref as S, computed as A, onMounted as No, onBeforeUnmount as Ko, watch as ae, resolveComponent as R, createElementBlock as g, openBlock as v, createBlock as Te, createCommentVNode as F, createElementVNode as a, Fragment as z, renderList as ce, withCtx as B, createVNode as y, toDisplayString as l, unref as u, nextTick as Yo, onUnmounted as Bo, createTextVNode as ye, normalizeClass as zo } from "vue";
2
- import { d as P } from "./dayjs.min-DkHZ47ah.js";
1
+ import { defineComponent as Vt, ref as w, computed as A, onMounted as Uo, onBeforeUnmount as Ko, watch as oe, resolveComponent as N, createElementBlock as v, openBlock as f, createBlock as Ce, createCommentVNode as M, createElementVNode as a, Fragment as z, renderList as ce, withCtx as Y, createVNode as h, toDisplayString as l, unref as u, nextTick as Bo, onUnmounted as Yo, createTextVNode as ye, normalizeClass as zo } from "vue";
2
+ import { d as T } from "./dayjs.min-CdpSCqn1.js";
3
3
  import { defineStore as qo, storeToRefs as Jo } from "pinia";
4
4
  import { useI18n as dt, useCoreStore as Ho } from "@feedmepos/mf-common";
5
- import { g as st, b as at, u as Wo, B as Mt, _ as Go, a as Xo } from "./app-IdmhLBBn.js";
5
+ import { B as Mt, _ as Wo, a as Go } from "./app-B8xnhtVI.js";
6
6
  import { components as ve } from "@feedmepos/ui-library";
7
- import { S as Me } from "./SelectFilter-jjUAj29l.js";
7
+ import { g as st, b as at, u as Xo } from "./restaurant-C7o2Yk6j.js";
8
+ import { S as Fe } from "./SelectFilter-Bs_LCk3L.js";
8
9
  import { _ as Qo } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
9
10
  import { _ as Zo } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
10
- import { t as es, p as Dt } from "./rule-CWR80AmG.js";
11
- import { u as ts } from "./restaurant-BEdgW6Se.js";
12
- import { u as os } from "./useDebounce-B8ZPVS5C.js";
13
- import { n as ss } from "./string-DZQ1uNjn.js";
14
- import { useRoute as as, useRouter as ns } from "vue-router";
15
- import { u as ls } from "./useMessage-_ywT_N9X.js";
16
- const rs = {
11
+ import { t as es, p as Dt } from "./rule-BhGHZqKO.js";
12
+ import { u as ts } from "./useDebounce-B8ZPVS5C.js";
13
+ import { n as os } from "./string-VNuQNweN.js";
14
+ import { useRoute as ss, useRouter as as } from "vue-router";
15
+ import { u as ns } from "./useMessage-_ywT_N9X.js";
16
+ const ls = {
17
17
  order: "Order",
18
18
  refund: "Refund",
19
19
  drawer: "Cash drawer",
@@ -34,7 +34,7 @@ const rs = {
34
34
  faceId: "Face ID",
35
35
  mallIntegration: "Mall integration",
36
36
  report: "Report"
37
- }, De = [
37
+ }, Me = [
38
38
  { key: "all", label: "All", subjectPrefixes: [] },
39
39
  { key: "inventory", label: "Inventory", subjectPrefixes: ["business::inventory", "inventory"], sources: ["portal"] },
40
40
  { key: "report", label: "Report", subjectPrefixes: ["business::report", "report"], sources: ["portal"] },
@@ -48,41 +48,41 @@ const rs = {
48
48
  { key: "miniProgram", label: "Mini Program", subjectPrefixes: ["business::miniProgram", "miniProgram"], sources: ["portal"] },
49
49
  { key: "media", label: "Media", subjectPrefixes: ["business::media", "media"], sources: ["portal"] },
50
50
  { key: "pos", label: "POS", subjectPrefixes: [], sources: ["pos-v8", "hrm-validate"] }
51
- ], nt = "/audit-logs", Ce = {
51
+ ], nt = "/audit-logs", Oe = {
52
52
  async count(t) {
53
- var r, c, d, b, _, w, D, O, i;
53
+ var r, d, y, _, g, S, O, i, P;
54
54
  const o = {
55
55
  ...t != null && t.from ? { from: t.from } : {},
56
56
  ...t != null && t.to ? { to: t.to } : {},
57
57
  ...(r = t == null ? void 0 : t.userIds) != null && r.length ? { userIds: t.userIds } : {},
58
- ...(c = t == null ? void 0 : t.subjects) != null && c.length ? { subjects: t.subjects } : {},
59
- ...(d = t == null ? void 0 : t.subjectPrefixes) != null && d.length ? { subjectPrefixes: t.subjectPrefixes } : {},
60
- ...(b = t == null ? void 0 : t.actions) != null && b.length ? { actions: t.actions } : {},
61
- ...(_ = t == null ? void 0 : t.outcomes) != null && _.length ? { outcomes: t.outcomes } : {},
58
+ ...(d = t == null ? void 0 : t.subjects) != null && d.length ? { subjects: t.subjects } : {},
59
+ ...(y = t == null ? void 0 : t.subjectPrefixes) != null && y.length ? { subjectPrefixes: t.subjectPrefixes } : {},
60
+ ...(_ = t == null ? void 0 : t.actions) != null && _.length ? { actions: t.actions } : {},
61
+ ...(g = t == null ? void 0 : t.outcomes) != null && g.length ? { outcomes: t.outcomes } : {},
62
62
  ...t != null && t.feedmeAdminActors ? { feedmeAdminActors: !0 } : {},
63
63
  ...t != null && t.search ? { search: t.search } : {},
64
- ...(w = t == null ? void 0 : t.searchUserIds) != null && w.length ? { searchUserIds: t.searchUserIds } : {},
65
- ...(D = t == null ? void 0 : t.searchSubjects) != null && D.length ? { searchSubjects: t.searchSubjects } : {},
66
- ...(O = t == null ? void 0 : t.sources) != null && O.length ? { sources: t.sources } : {},
67
- ...(i = t == null ? void 0 : t.restaurantIds) != null && i.length ? { restaurantIds: t.restaurantIds } : {},
64
+ ...(S = t == null ? void 0 : t.searchUserIds) != null && S.length ? { searchUserIds: t.searchUserIds } : {},
65
+ ...(O = t == null ? void 0 : t.searchSubjects) != null && O.length ? { searchSubjects: t.searchSubjects } : {},
66
+ ...(i = t == null ? void 0 : t.sources) != null && i.length ? { sources: t.sources } : {},
67
+ ...(P = t == null ? void 0 : t.restaurantIds) != null && P.length ? { restaurantIds: t.restaurantIds } : {},
68
68
  ...t != null && t.traceId ? { traceId: t.traceId } : {}
69
69
  };
70
70
  return (await st(
71
71
  await at().get(`${nt}/count`, {
72
72
  params: o,
73
- paramsSerializer: (V) => {
74
- const L = new URLSearchParams();
75
- for (const [f, M] of Object.entries(V))
76
- if (Array.isArray(M))
77
- for (const C of M) L.append(f, String(C));
78
- else M != null && L.append(f, String(M));
79
- return L.toString();
73
+ paramsSerializer: ($) => {
74
+ const m = new URLSearchParams();
75
+ for (const [x, D] of Object.entries($))
76
+ if (Array.isArray(D))
77
+ for (const F of D) m.append(x, String(F));
78
+ else D != null && m.append(x, String(D));
79
+ return m.toString();
80
80
  }
81
81
  })
82
82
  )).total;
83
83
  },
84
84
  async read(t) {
85
- var n, r, c, d, b, _, w, D, O;
85
+ var n, r, d, y, _, g, S, O, i;
86
86
  const o = {
87
87
  limit: (t == null ? void 0 : t.limit) ?? 100,
88
88
  offset: (t == null ? void 0 : t.offset) ?? 0,
@@ -91,14 +91,14 @@ const rs = {
91
91
  ...(n = t == null ? void 0 : t.userIds) != null && n.length ? { userIds: t.userIds } : {},
92
92
  ...t != null && t.feedmeAdminActors ? { feedmeAdminActors: !0 } : {},
93
93
  ...(r = t == null ? void 0 : t.subjects) != null && r.length ? { subjects: t.subjects } : {},
94
- ...(c = t == null ? void 0 : t.subjectPrefixes) != null && c.length ? { subjectPrefixes: t.subjectPrefixes } : {},
95
- ...(d = t == null ? void 0 : t.actions) != null && d.length ? { actions: t.actions } : {},
96
- ...(b = t == null ? void 0 : t.outcomes) != null && b.length ? { outcomes: t.outcomes } : {},
94
+ ...(d = t == null ? void 0 : t.subjectPrefixes) != null && d.length ? { subjectPrefixes: t.subjectPrefixes } : {},
95
+ ...(y = t == null ? void 0 : t.actions) != null && y.length ? { actions: t.actions } : {},
96
+ ...(_ = t == null ? void 0 : t.outcomes) != null && _.length ? { outcomes: t.outcomes } : {},
97
97
  ...t != null && t.search ? { search: t.search } : {},
98
- ...(_ = t == null ? void 0 : t.searchUserIds) != null && _.length ? { searchUserIds: t.searchUserIds } : {},
99
- ...(w = t == null ? void 0 : t.searchSubjects) != null && w.length ? { searchSubjects: t.searchSubjects } : {},
100
- ...(D = t == null ? void 0 : t.sources) != null && D.length ? { sources: t.sources } : {},
101
- ...(O = t == null ? void 0 : t.restaurantIds) != null && O.length ? { restaurantIds: t.restaurantIds } : {},
98
+ ...(g = t == null ? void 0 : t.searchUserIds) != null && g.length ? { searchUserIds: t.searchUserIds } : {},
99
+ ...(S = t == null ? void 0 : t.searchSubjects) != null && S.length ? { searchSubjects: t.searchSubjects } : {},
100
+ ...(O = t == null ? void 0 : t.sources) != null && O.length ? { sources: t.sources } : {},
101
+ ...(i = t == null ? void 0 : t.restaurantIds) != null && i.length ? { restaurantIds: t.restaurantIds } : {},
102
102
  ...t != null && t.traceId ? { traceId: t.traceId } : {}
103
103
  };
104
104
  return st(
@@ -106,13 +106,13 @@ const rs = {
106
106
  params: o,
107
107
  // Serialize arrays as repeated params: key=val1&key=val2
108
108
  // (NestJS @Query expects this; axios default adds brackets which break matching)
109
- paramsSerializer: (i) => {
110
- const V = new URLSearchParams();
111
- for (const [L, f] of Object.entries(i))
112
- if (Array.isArray(f))
113
- for (const M of f) V.append(L, String(M));
114
- else f != null && V.append(L, String(f));
115
- return V.toString();
109
+ paramsSerializer: (P) => {
110
+ const $ = new URLSearchParams();
111
+ for (const [m, x] of Object.entries(P))
112
+ if (Array.isArray(x))
113
+ for (const D of x) $.append(m, String(D));
114
+ else x != null && $.append(m, String(x));
115
+ return $.toString();
116
116
  }
117
117
  })
118
118
  );
@@ -131,10 +131,10 @@ const rs = {
131
131
  await at().get(`${nt}/actors`, { params: o })
132
132
  );
133
133
  }
134
- }, is = { class: "flex h-[46px] items-center gap-8 rounded-sm px-16 hover:bg-fm-color-opacity-sm" }, us = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ds = {
134
+ }, rs = { class: "flex h-[46px] items-center gap-8 rounded-sm px-16 hover:bg-fm-color-opacity-sm" }, is = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, us = {
135
135
  "data-more-measure": "",
136
136
  class: "flex h-[46px] items-center gap-8 rounded-sm px-16"
137
- }, cs = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, fs = /* @__PURE__ */ Vt({
137
+ }, ds = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, cs = /* @__PURE__ */ Vt({
138
138
  __name: "AuditLogModuleTabs",
139
139
  props: {
140
140
  modelValue: {},
@@ -142,107 +142,107 @@ const rs = {
142
142
  },
143
143
  emits: ["update:modelValue"],
144
144
  setup(t, { emit: o }) {
145
- const n = t, r = o, { t: c } = dt(), d = S(!1), b = S(null), _ = S(null), w = S([]), D = S(0), O = S(0);
146
- let i = null;
147
- async function V() {
148
- if (await Yo(), !_.value) return;
149
- const p = _.value.querySelectorAll("[data-tab-measure]");
150
- w.value = Array.from(p).map((K) => K.offsetWidth);
151
- const j = _.value.querySelector("[data-more-measure]");
152
- D.value = (j == null ? void 0 : j.offsetWidth) ?? 0;
145
+ const n = t, r = o, { t: d } = dt(), y = w(!1), _ = w(null), g = w(null), S = w([]), O = w(0), i = w(0);
146
+ let P = null;
147
+ async function $() {
148
+ if (await Bo(), !g.value) return;
149
+ const b = g.value.querySelectorAll("[data-tab-measure]");
150
+ S.value = Array.from(b).map((B) => B.offsetWidth);
151
+ const j = g.value.querySelector("[data-more-measure]");
152
+ O.value = (j == null ? void 0 : j.offsetWidth) ?? 0;
153
153
  }
154
- const L = A(() => {
155
- const p = n.items.length;
156
- if (p === 0) return 0;
157
- if (!O.value || w.value.length !== p) return p;
158
- const j = w.value;
159
- if (j.reduce((I, Q) => I + Q, 0) <= O.value) return p;
160
- const E = D.value;
161
- let X = 0, Y = 0;
162
- for (let I = 0; I < p && !(X + j[I] + E > O.value); I++)
163
- X += j[I], Y++;
164
- return Y;
165
- }), f = A(() => {
166
- const p = L.value, j = n.items.length;
167
- if (p >= j) return [...n.items];
168
- const K = n.items.slice(0, p), E = n.items.find((W) => W.value === n.modelValue);
169
- if (!E || K.some((W) => W.value === E.value)) return K;
170
- if (p === 0) return [E];
171
- const X = n.items.findIndex((W) => W.value === E.value), Y = w.value, I = D.value, Q = Y[X] ?? 0;
172
- let H = p, xe = Y.slice(0, H - 1).reduce((W, Le) => W + Le, 0);
173
- for (; H > 1 && xe + Q + I > O.value; )
174
- H--, xe = Y.slice(0, H - 1).reduce((W, Le) => W + Le, 0);
175
- return [...n.items.slice(0, Math.max(H - 1, 0)), E];
176
- }), M = A(() => {
177
- const p = new Set(f.value.map((j) => j.value));
178
- return n.items.filter((j) => !p.has(j.value));
154
+ const m = A(() => {
155
+ const b = n.items.length;
156
+ if (b === 0) return 0;
157
+ if (!i.value || S.value.length !== b) return b;
158
+ const j = S.value;
159
+ if (j.reduce((I, X) => I + X, 0) <= i.value) return b;
160
+ const E = O.value;
161
+ let H = 0, U = 0;
162
+ for (let I = 0; I < b && !(H + j[I] + E > i.value); I++)
163
+ H += j[I], U++;
164
+ return U;
165
+ }), x = A(() => {
166
+ const b = m.value, j = n.items.length;
167
+ if (b >= j) return [...n.items];
168
+ const B = n.items.slice(0, b), E = n.items.find((W) => W.value === n.modelValue);
169
+ if (!E || B.some((W) => W.value === E.value)) return B;
170
+ if (b === 0) return [E];
171
+ const H = n.items.findIndex((W) => W.value === E.value), U = S.value, I = O.value, X = U[H] ?? 0;
172
+ let ue = b, Te = U.slice(0, ue - 1).reduce((W, xe) => W + xe, 0);
173
+ for (; ue > 1 && Te + X + I > i.value; )
174
+ ue--, Te = U.slice(0, ue - 1).reduce((W, xe) => W + xe, 0);
175
+ return [...n.items.slice(0, Math.max(ue - 1, 0)), E];
176
+ }), D = A(() => {
177
+ const b = new Set(x.value.map((j) => j.value));
178
+ return n.items.filter((j) => !b.has(j.value));
179
179
  });
180
- function C(p) {
181
- d.value = !1, r("update:modelValue", p);
180
+ function F(b) {
181
+ y.value = !1, r("update:modelValue", b);
182
182
  }
183
- return No(async () => {
184
- await V(), b.value && (O.value = b.value.clientWidth, i = new ResizeObserver(() => {
185
- b.value && (O.value = b.value.clientWidth);
186
- }), i.observe(b.value));
183
+ return Uo(async () => {
184
+ await $(), _.value && (i.value = _.value.clientWidth, P = new ResizeObserver(() => {
185
+ _.value && (i.value = _.value.clientWidth);
186
+ }), P.observe(_.value));
187
187
  }), Ko(() => {
188
- i == null || i.disconnect(), i = null;
189
- }), ae(
188
+ P == null || P.disconnect(), P = null;
189
+ }), oe(
190
190
  () => n.items,
191
191
  () => {
192
- V();
192
+ $();
193
193
  },
194
194
  { deep: !0 }
195
- ), (p, j) => {
196
- const K = R("FmTab"), E = R("FmIcon"), X = R("FmMenuItem"), Y = R("FmMenu");
197
- return v(), g("div", {
195
+ ), (b, j) => {
196
+ const B = N("FmTab"), E = N("FmIcon"), H = N("FmMenuItem"), U = N("FmMenu");
197
+ return f(), v("div", {
198
198
  ref_key: "containerRef",
199
- ref: b,
199
+ ref: _,
200
200
  class: "relative flex w-full flex-row items-center"
201
201
  }, [
202
- (v(!0), g(z, null, ce(f.value, (I) => (v(), Te(K, {
202
+ (f(!0), v(z, null, ce(x.value, (I) => (f(), Ce(B, {
203
203
  key: I.value,
204
204
  "model-value": t.modelValue,
205
205
  label: I.label,
206
206
  badge: I.badge,
207
207
  disabled: I.disabled,
208
208
  value: I.value,
209
- "onUpdate:modelValue": C
209
+ "onUpdate:modelValue": F
210
210
  }, null, 8, ["model-value", "label", "badge", "disabled", "value"]))), 128)),
211
- M.value.length > 0 ? (v(), Te(Y, {
211
+ D.value.length > 0 ? (f(), Ce(U, {
212
212
  key: 0,
213
- "show-menu": d.value,
213
+ "show-menu": y.value,
214
214
  class: "max-w-[360px] min-w-[90px] rounded-sm",
215
215
  placement: "bottom-start",
216
- onMenuChanged: j[0] || (j[0] = (I) => d.value = I)
216
+ onMenuChanged: j[0] || (j[0] = (I) => y.value = I)
217
217
  }, {
218
- "menu-button": B(() => [
219
- a("div", is, [
220
- y(E, { name: "more_vert" }),
221
- a("span", us, l(u(c)("auditLog.modules.more")), 1)
218
+ "menu-button": Y(() => [
219
+ a("div", rs, [
220
+ h(E, { name: "more_vert" }),
221
+ a("span", is, l(u(d)("auditLog.modules.more")), 1)
222
222
  ])
223
223
  ]),
224
- default: B(() => [
225
- (v(!0), g(z, null, ce(M.value, (I) => (v(), Te(X, {
224
+ default: Y(() => [
225
+ (f(!0), v(z, null, ce(D.value, (I) => (f(), Ce(H, {
226
226
  key: I.value,
227
227
  "model-value": t.modelValue === I.value,
228
228
  label: I.label,
229
229
  disabled: I.disabled,
230
- onClick: (Q) => C(I.value)
230
+ onClick: (X) => F(I.value)
231
231
  }, null, 8, ["model-value", "label", "disabled", "onClick"]))), 128))
232
232
  ]),
233
233
  _: 1
234
- }, 8, ["show-menu"])) : F("", !0),
234
+ }, 8, ["show-menu"])) : M("", !0),
235
235
  a("div", {
236
236
  ref_key: "measurerRef",
237
- ref: _,
237
+ ref: g,
238
238
  "aria-hidden": "true",
239
239
  class: "pointer-events-none invisible absolute -left-[9999px] -top-[9999px] flex flex-row items-center"
240
240
  }, [
241
- (v(!0), g(z, null, ce(t.items, (I) => (v(), g("div", {
241
+ (f(!0), v(z, null, ce(t.items, (I) => (f(), v("div", {
242
242
  key: `measure-${I.value}`,
243
243
  "data-tab-measure": ""
244
244
  }, [
245
- y(K, {
245
+ h(B, {
246
246
  "model-value": t.modelValue,
247
247
  label: I.label,
248
248
  badge: I.badge,
@@ -250,28 +250,28 @@ const rs = {
250
250
  value: I.value
251
251
  }, null, 8, ["model-value", "label", "badge", "disabled", "value"])
252
252
  ]))), 128)),
253
- a("div", ds, [
254
- y(E, { name: "more_vert" }),
255
- a("span", cs, l(u(c)("auditLog.modules.more")), 1)
253
+ a("div", us, [
254
+ h(E, { name: "more_vert" }),
255
+ a("span", ds, l(u(d)("auditLog.modules.more")), 1)
256
256
  ])
257
257
  ], 512)
258
258
  ], 512);
259
259
  };
260
260
  }
261
- }), ms = qo("hrm-team", () => {
262
- const t = S([]), o = S(!1), n = S(!1), r = A(
263
- () => Object.fromEntries(t.value.map((_) => [_.doc.userId, _.name]))
264
- ), c = A(
265
- () => Object.fromEntries(t.value.map((_) => [_.doc.userId, _.email]))
261
+ }), fs = qo("hrm-team", () => {
262
+ const t = w([]), o = w(!1), n = w(!1), r = A(
263
+ () => Object.fromEntries(t.value.map((g) => [g.doc.userId, g.name]))
266
264
  ), d = A(
267
- () => Object.fromEntries(t.value.map((_) => [_.doc.userId, _.phoneNumber]))
265
+ () => Object.fromEntries(t.value.map((g) => [g.doc.userId, g.email]))
266
+ ), y = A(
267
+ () => Object.fromEntries(t.value.map((g) => [g.doc.userId, g.phoneNumber]))
268
268
  );
269
- async function b({ force: _ = !1 } = {}) {
270
- if (!(!_ && t.value.length > 0))
269
+ async function _({ force: g = !1 } = {}) {
270
+ if (!(!g && t.value.length > 0))
271
271
  try {
272
272
  o.value = !0;
273
- const w = await es.readTeamMembers();
274
- t.value = w.sort((D, O) => D.doc.isOwner ? -1 : D.name.localeCompare(O.name)), n.value = !0;
273
+ const S = await es.readTeamMembers();
274
+ t.value = S.sort((O, i) => O.doc.isOwner ? -1 : O.name.localeCompare(i.name)), n.value = !0;
275
275
  } finally {
276
276
  o.value = !1;
277
277
  }
@@ -281,12 +281,12 @@ const rs = {
281
281
  isLoading: o,
282
282
  hasLoaded: n,
283
283
  userIdToName: r,
284
- userIdToEmail: c,
285
- userIdToPhone: d,
286
- readTeamMembers: b
284
+ userIdToEmail: d,
285
+ userIdToPhone: y,
286
+ readTeamMembers: _
287
287
  };
288
288
  });
289
- function vs(t) {
289
+ function ms(t) {
290
290
  const o = t.indexOf(".");
291
291
  return o <= 0 || o === t.length - 1 ? null : { entity: t.slice(0, o), verb: t.slice(o + 1) };
292
292
  }
@@ -294,76 +294,76 @@ function Ot(t) {
294
294
  const o = t.split("-").join(" ");
295
295
  return o.charAt(0).toUpperCase() + o.slice(1);
296
296
  }
297
- function ps(t, o, n) {
297
+ function vs(t, o, n) {
298
298
  const r = t(o, n);
299
299
  return r === o ? null : r;
300
300
  }
301
301
  function ut(t, o) {
302
- const { eventKey: n, params: r, operationLabel: c } = o;
302
+ const { eventKey: n, params: r, operationLabel: d } = o;
303
303
  if (n) {
304
- const d = ps(t, `auditLog.event.sentence.${n}`, r);
305
- if (d) return d;
306
- const b = vs(n);
307
- if (b) {
308
- const _ = `${Ot(b.verb)} ${Ot(b.entity)}`, w = (r == null ? void 0 : r.label) ?? (r == null ? void 0 : r.name);
309
- return w !== void 0 && w !== "" ? `${_} — ${w}` : _;
304
+ const y = vs(t, `auditLog.event.sentence.${n}`, r);
305
+ if (y) return y;
306
+ const _ = ms(n);
307
+ if (_) {
308
+ const g = `${Ot(_.verb)} ${Ot(_.entity)}`, S = (r == null ? void 0 : r.label) ?? (r == null ? void 0 : r.name);
309
+ return S !== void 0 && S !== "" ? `${g} — ${S}` : g;
310
310
  }
311
311
  }
312
- return c ?? "";
312
+ return d ?? "";
313
313
  }
314
- function gs({ logs: t, selectedLog: o, isSheetOpen: n, businessId: r }) {
315
- const c = as(), d = ns(), { t: b } = dt(), _ = ls();
316
- let w = 0;
317
- function D(f) {
318
- const { traceId: M, ...C } = c.query;
319
- (M ?? void 0) !== f && d.replace({ query: f ? { ...C, traceId: f } : C });
314
+ function ps({ logs: t, selectedLog: o, isSheetOpen: n, businessId: r }) {
315
+ const d = ss(), y = as(), { t: _ } = dt(), g = ns();
316
+ let S = 0;
317
+ function O(x) {
318
+ const { traceId: D, ...F } = d.query;
319
+ (D ?? void 0) !== x && y.replace({ query: x ? { ...F, traceId: x } : F });
320
320
  }
321
- function O(f) {
322
- D(f.traceId || void 0);
321
+ function i(x) {
322
+ O(x.traceId || void 0);
323
323
  }
324
- function i() {
325
- w++, D(void 0);
324
+ function P() {
325
+ S++, O(void 0);
326
326
  }
327
- async function V(f) {
328
- var p;
329
- if (((p = o.value) == null ? void 0 : p.traceId) === f) return;
330
- const M = ++w;
331
- let C = t.value.find((j) => j.traceId === f);
332
- if (!C) {
327
+ async function $(x) {
328
+ var b;
329
+ if (((b = o.value) == null ? void 0 : b.traceId) === x) return;
330
+ const D = ++S;
331
+ let F = t.value.find((j) => j.traceId === x);
332
+ if (!F) {
333
333
  try {
334
- [C] = await Ce.read({ traceId: f, limit: 1 });
334
+ [F] = await Oe.read({ traceId: x, limit: 1 });
335
335
  } catch {
336
- M === w && _.error(b("auditLog.deepLink.loadFailed"));
336
+ D === S && g.error(_("auditLog.deepLink.loadFailed"));
337
337
  return;
338
338
  }
339
- if (M !== w) return;
339
+ if (D !== S) return;
340
340
  }
341
- if (!C) {
342
- _.error(b("auditLog.deepLink.notFound")), D(void 0);
341
+ if (!F) {
342
+ g.error(_("auditLog.deepLink.notFound")), O(void 0);
343
343
  return;
344
344
  }
345
- o.value = C, n.value = !0;
345
+ o.value = F, n.value = !0;
346
346
  }
347
- ae(
348
- () => [c.query.traceId, r()],
349
- ([f, M], C) => {
350
- var p;
351
- if (C != null && C[1] && M !== C[1]) {
352
- w++, n.value = !1, o.value = null, D(void 0);
347
+ oe(
348
+ () => [d.query.traceId, r()],
349
+ ([x, D], F) => {
350
+ var b;
351
+ if (F != null && F[1] && D !== F[1]) {
352
+ S++, n.value = !1, o.value = null, O(void 0);
353
353
  return;
354
354
  }
355
- typeof f == "string" && f ? M && V(f) : (w++, (p = o.value) != null && p.traceId && n.value && (n.value = !1, o.value = null));
355
+ typeof x == "string" && x ? D && $(x) : (S++, (b = o.value) != null && b.traceId && n.value && (n.value = !1, o.value = null));
356
356
  },
357
357
  { immediate: !0 }
358
358
  );
359
- async function L() {
359
+ async function m() {
360
360
  try {
361
- await navigator.clipboard.writeText(window.location.href), _.success(b("auditLog.detail.linkCopied"));
361
+ await navigator.clipboard.writeText(window.location.href), g.success(_("auditLog.detail.linkCopied"));
362
362
  } catch {
363
- _.error(b("auditLog.detail.linkCopyFailed"));
363
+ g.error(_("auditLog.detail.linkCopyFailed"));
364
364
  }
365
365
  }
366
- return { onSheetOpened: O, onSheetClosed: i, copyLink: L };
366
+ return { onSheetOpened: i, onSheetClosed: P, copyLink: m };
367
367
  }
368
368
  function _e(t) {
369
369
  return typeof t == "object" && t !== null && !Array.isArray(t);
@@ -371,7 +371,7 @@ function _e(t) {
371
371
  function je(t) {
372
372
  return Array.isArray(t);
373
373
  }
374
- function Ke(t) {
374
+ function Be(t) {
375
375
  if (t === null) return "null";
376
376
  if (typeof t == "object")
377
377
  try {
@@ -381,7 +381,7 @@ function Ke(t) {
381
381
  }
382
382
  return String(t);
383
383
  }
384
- function hs(t, o) {
384
+ function gs(t, o) {
385
385
  return t ? `${t}.${o}` : o;
386
386
  }
387
387
  function Ct(t) {
@@ -395,139 +395,139 @@ function Ct(t) {
395
395
  return { ok: !1, value: void 0 };
396
396
  }
397
397
  }
398
- const ys = ["_id", "id", "subject", "key", "name"];
399
- function bs(t, o) {
398
+ const hs = ["_id", "id", "subject", "key", "name"];
399
+ function ys(t, o) {
400
400
  if (t.length === 0 || o.length === 0) return null;
401
- const n = (c, d) => c.every((b) => _e(b) && b[d] !== void 0), r = (c, d) => {
402
- const b = c.map((_) => _[d]);
403
- return b.length === new Set(b).size;
401
+ const n = (d, y) => d.every((_) => _e(_) && _[y] !== void 0), r = (d, y) => {
402
+ const _ = d.map((g) => g[y]);
403
+ return _.length === new Set(_).size;
404
404
  };
405
- for (const c of ys)
406
- if (n(t, c) && n(o, c) && r(t, c) && r(o, c))
407
- return c;
405
+ for (const d of hs)
406
+ if (n(t, d) && n(o, d) && r(t, d) && r(o, d))
407
+ return d;
408
408
  return null;
409
409
  }
410
410
  function $t(t, o, n) {
411
- n.push({ path: t, type: "added", before: null, after: Ke(o) });
411
+ n.push({ path: t, type: "added", before: null, after: Be(o) });
412
412
  }
413
413
  function Et(t, o, n) {
414
- n.push({ path: t, type: "removed", before: Ke(o), after: null });
414
+ n.push({ path: t, type: "removed", before: Be(o), after: null });
415
415
  }
416
- function _s(t, o, n, r) {
417
- const c = /* @__PURE__ */ new Set([...Object.keys(o), ...Object.keys(n)]);
418
- for (const d of Array.from(c)) {
419
- const b = Object.prototype.hasOwnProperty.call(o, d), _ = Object.prototype.hasOwnProperty.call(n, d);
420
- Ye(hs(t, d), o[d], b, n[d], _, r);
416
+ function bs(t, o, n, r) {
417
+ const d = /* @__PURE__ */ new Set([...Object.keys(o), ...Object.keys(n)]);
418
+ for (const y of Array.from(d)) {
419
+ const _ = Object.prototype.hasOwnProperty.call(o, y), g = Object.prototype.hasOwnProperty.call(n, y);
420
+ Ye(gs(t, y), o[y], _, n[y], g, r);
421
421
  }
422
422
  }
423
- function xs(t, o, n, r) {
424
- const c = bs(o, n);
425
- if (c) {
426
- const L = new Map(
427
- o.map((p) => [p[c], p])
428
- ), f = new Map(
429
- n.map((p) => [p[c], p])
430
- ), M = Array.from(L.keys()).concat(Array.from(f.keys())), C = Array.from(new Set(M));
431
- for (const p of C) {
432
- const j = L.has(p), K = f.has(p), E = `${t}[${String(p)}]`;
423
+ function _s(t, o, n, r) {
424
+ const d = ys(o, n);
425
+ if (d) {
426
+ const m = new Map(
427
+ o.map((b) => [b[d], b])
428
+ ), x = new Map(
429
+ n.map((b) => [b[d], b])
430
+ ), D = Array.from(m.keys()).concat(Array.from(x.keys())), F = Array.from(new Set(D));
431
+ for (const b of F) {
432
+ const j = m.has(b), B = x.has(b), E = `${t}[${String(b)}]`;
433
433
  Ye(
434
434
  E,
435
- L.get(p),
435
+ m.get(b),
436
436
  j,
437
- f.get(p),
438
- K,
437
+ x.get(b),
438
+ B,
439
439
  r
440
440
  );
441
441
  }
442
442
  return;
443
443
  }
444
- const d = o.map((L, f) => ({ sig: JSON.stringify(L), idx: f, item: L })), b = n.map((L, f) => ({ sig: JSON.stringify(L), idx: f, item: L })), _ = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map();
445
- for (const L of d)
446
- _.has(L.sig) || _.set(L.sig, []), _.get(L.sig).push(L);
447
- for (const L of b)
448
- w.has(L.sig) || w.set(L.sig, []), w.get(L.sig).push(L);
449
- const D = [], O = [], i = Array.from(_.keys()).concat(Array.from(w.keys())), V = Array.from(new Set(i));
450
- for (const L of V) {
451
- const f = _.get(L) || [], M = w.get(L) || [], C = Math.min(f.length, M.length);
452
- for (let p = C; p < f.length; p++)
453
- D.push({ idx: f[p].idx, item: f[p].item });
454
- for (let p = C; p < M.length; p++)
455
- O.push({ idx: M[p].idx, item: M[p].item });
444
+ const y = o.map((m, x) => ({ sig: JSON.stringify(m), idx: x, item: m })), _ = n.map((m, x) => ({ sig: JSON.stringify(m), idx: x, item: m })), g = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map();
445
+ for (const m of y)
446
+ g.has(m.sig) || g.set(m.sig, []), g.get(m.sig).push(m);
447
+ for (const m of _)
448
+ S.has(m.sig) || S.set(m.sig, []), S.get(m.sig).push(m);
449
+ const O = [], i = [], P = Array.from(g.keys()).concat(Array.from(S.keys())), $ = Array.from(new Set(P));
450
+ for (const m of $) {
451
+ const x = g.get(m) || [], D = S.get(m) || [], F = Math.min(x.length, D.length);
452
+ for (let b = F; b < x.length; b++)
453
+ O.push({ idx: x[b].idx, item: x[b].item });
454
+ for (let b = F; b < D.length; b++)
455
+ i.push({ idx: D[b].idx, item: D[b].item });
456
456
  }
457
- for (const { idx: L, item: f } of D)
458
- Et(`${t}[${L}]`, f, r);
459
- for (const { idx: L, item: f } of O)
460
- $t(`${t}[${L}]`, f, r);
457
+ for (const { idx: m, item: x } of O)
458
+ Et(`${t}[${m}]`, x, r);
459
+ for (const { idx: m, item: x } of i)
460
+ $t(`${t}[${m}]`, x, r);
461
461
  }
462
- function Ye(t, o, n, r, c, d) {
463
- if (!n && !c) return;
464
- if (n && !c) {
465
- Et(t, o, d);
462
+ function Ye(t, o, n, r, d, y) {
463
+ if (!n && !d) return;
464
+ if (n && !d) {
465
+ Et(t, o, y);
466
466
  return;
467
467
  }
468
- if (!n && c) {
469
- $t(t, r, d);
468
+ if (!n && d) {
469
+ $t(t, r, y);
470
470
  return;
471
471
  }
472
472
  if (JSON.stringify(o) === JSON.stringify(r)) return;
473
473
  if (_e(o) && _e(r)) {
474
- _s(t, o, r, d);
474
+ bs(t, o, r, y);
475
475
  return;
476
476
  }
477
477
  if (je(o) && je(r)) {
478
- xs(t, o, r, d);
478
+ _s(t, o, r, y);
479
479
  return;
480
480
  }
481
- const b = Ct(o), _ = Ct(r);
482
- if (b.ok && _.ok) {
483
- Ye(t, b.value, !0, _.value, !0, d);
481
+ const _ = Ct(o), g = Ct(r);
482
+ if (_.ok && g.ok) {
483
+ Ye(t, _.value, !0, g.value, !0, y);
484
484
  return;
485
485
  }
486
- d.push({
486
+ y.push({
487
487
  path: t,
488
488
  type: "changed",
489
- before: Ke(o),
490
- after: Ke(r)
489
+ before: Be(o),
490
+ after: Be(r)
491
491
  });
492
492
  }
493
- function Ls(t, o) {
493
+ function xs(t, o) {
494
494
  if (JSON.stringify(t) === JSON.stringify(o)) return [];
495
495
  const n = t == null, r = o == null;
496
- let c = t;
497
- n && (_e(o) ? c = {} : je(o) && (c = []));
498
- let d = o;
499
- r && (_e(t) ? d = {} : je(t) && (d = []));
500
- const b = [];
501
- return Ye("", c, !0, d, !0, b), b;
496
+ let d = t;
497
+ n && (_e(o) ? d = {} : je(o) && (d = []));
498
+ let y = o;
499
+ r && (_e(t) ? y = {} : je(t) && (y = []));
500
+ const _ = [];
501
+ return Ye("", d, !0, y, !0, _), _;
502
502
  }
503
- function Tt(t) {
503
+ function jt(t) {
504
504
  const o = t.operations;
505
505
  return !o || o.length === 0 ? !1 : o.some((n) => n.status === "failed");
506
506
  }
507
507
  function lt(t, o) {
508
- var c, d;
508
+ var d, y;
509
509
  if (t.source === "hrm-validate") return o("auditLog.pos.device.posV7");
510
- const n = (d = (c = t.metadata) == null ? void 0 : c.pos) == null ? void 0 : d.posMode, r = t.deviceId || "-";
510
+ const n = (y = (d = t.metadata) == null ? void 0 : d.pos) == null ? void 0 : y.posMode, r = t.deviceId || "-";
511
511
  return n ? `${r} · ${o(`auditLog.pos.mode.${n}`)}` : r;
512
512
  }
513
- function ks(t, o) {
513
+ function Ls(t, o) {
514
514
  var r;
515
515
  const n = t.actorName || t.userId || "-";
516
516
  return ((r = t.metadata) == null ? void 0 : r.actorKnown) === !1 ? `${n} (${o("auditLog.pos.unverified")})` : n;
517
517
  }
518
- function jt(t, o) {
519
- var c;
518
+ function Tt(t, o) {
519
+ var d;
520
520
  const n = t.approverName || t.approverId;
521
521
  if (!n)
522
522
  return t.source === "hrm-validate" ? o("auditLog.pos.viaCode") : "-";
523
- const r = ((c = t.metadata) == null ? void 0 : c.approverKnown) === !1 ? `${n} (${o("auditLog.pos.unverified")})` : n;
523
+ const r = ((d = t.metadata) == null ? void 0 : d.approverKnown) === !1 ? `${n} (${o("auditLog.pos.unverified")})` : n;
524
524
  return t.source === "hrm-validate" ? `${r} · ${o("auditLog.pos.viaCode")}` : r;
525
525
  }
526
- function Ss(t, o) {
526
+ function ks(t, o) {
527
527
  const n = t.approverName || t.approverId;
528
528
  return n ? ` · ${o("auditLog.pos.approverInline", { name: n })}` : "";
529
529
  }
530
- function ws(t, o, n) {
530
+ function Ss(t, o, n) {
531
531
  return o || !(t != null && t.length) ? { userIds: [], feedmeAdminActors: !1 } : {
532
532
  userIds: t.filter((r) => r !== n),
533
533
  feedmeAdminActors: t.includes(n)
@@ -536,7 +536,7 @@ function ws(t, o, n) {
536
536
  function be(t) {
537
537
  return t === void 0 ? "—" : Array.isArray(t) ? t.length > 0 ? t.join(", ") : "—" : t || "—";
538
538
  }
539
- function Is(t) {
539
+ function ws(t) {
540
540
  return {
541
541
  label: t.label,
542
542
  labelKey: t.labelKey,
@@ -545,372 +545,372 @@ function Is(t) {
545
545
  afterDisplay: be(t.after)
546
546
  };
547
547
  }
548
- function As(t) {
548
+ function Is(t) {
549
549
  return Array.isArray(t) && t.length > 0;
550
550
  }
551
551
  function Rt(t, o, n) {
552
552
  return n.labelKey && o(n.labelKey) ? t(n.labelKey) : n.label;
553
553
  }
554
- function Ut(t, o) {
554
+ function Nt(t, o) {
555
555
  return ut(t, o) || t("auditLog.operation.unlabeled");
556
556
  }
557
- function Fs(t, o) {
557
+ function As(t, o) {
558
558
  return !o || o.length === 0 ? "" : o.map((n) => {
559
- const r = Ut(t, n), c = t(`auditLog.outcome.${n.status}`);
560
- let d = `${r}: ${c}`;
561
- return n.status === "failed" && n.errorMessage && (d += ` — ${n.errorMessage}`), d;
559
+ const r = Nt(t, n), d = t(`auditLog.outcome.${n.status}`);
560
+ let y = `${r}: ${d}`;
561
+ return n.status === "failed" && n.errorMessage && (y += ` — ${n.errorMessage}`), y;
562
562
  }).join(`
563
563
  `);
564
564
  }
565
- function Ms(t, o, n) {
565
+ function Fs(t, o, n) {
566
566
  const r = Rt(t, o, n);
567
567
  return n.type === "add" ? `${r}: + ${be(n.after)}` : n.type === "remove" ? `${r}: - ${be(n.before)}` : `${r}: ${be(n.before)} → ${be(n.after)}`;
568
568
  }
569
- function Ds(t, o, n) {
569
+ function Ms(t, o, n) {
570
570
  if (!n || n.length === 0) return "";
571
- const r = n.filter((b) => b.changeNodes && b.changeNodes.length > 0);
571
+ const r = n.filter((_) => _.changeNodes && _.changeNodes.length > 0);
572
572
  if (r.length === 0) return "";
573
- const c = r.length > 1;
574
- return r.map((b) => {
575
- const _ = (b.changeNodes ?? []).map((w) => Ms(t, o, w));
576
- return c ? [`[${Ut(t, b)}]`, ..._].join(`
577
- `) : _.join(`
573
+ const d = r.length > 1;
574
+ return r.map((_) => {
575
+ const g = (_.changeNodes ?? []).map((S) => Fs(t, o, S));
576
+ return d ? [`[${Nt(t, _)}]`, ...g].join(`
577
+ `) : g.join(`
578
578
  `);
579
579
  }).join(`
580
580
  `);
581
581
  }
582
- const Os = {
582
+ const Ds = {
583
583
  class: "flex flex-col gap-4 p-12 w-[260px]"
584
- }, Cs = {
584
+ }, Os = {
585
585
  class: "text-xs font-semibold text-fm-color-typo-secondary mb-4"
586
- }, Ts = {
586
+ }, Cs = {
587
587
  class: "flex min-h-0 flex-1 flex-col gap-16"
588
588
  }, js = {
589
589
  class: "space-y-16"
590
- }, Ps = {
590
+ }, Ts = {
591
591
  class: "flex flex-wrap items-center gap-8"
592
- }, Vs = {
592
+ }, Ps = {
593
593
  key: 0,
594
594
  class: "w-fit"
595
- }, $s = {
595
+ }, Vs = {
596
596
  key: 1,
597
597
  class: "w-fit"
598
+ }, $s = {
599
+ class: "w-fit"
598
600
  }, Es = {
599
601
  class: "w-fit"
600
602
  }, Rs = {
601
- class: "w-fit"
602
- }, Us = {
603
603
  key: 2,
604
604
  class: "w-fit"
605
605
  }, Ns = {
606
606
  class: "flex h-full flex-col overflow-auto"
607
- }, Ks = {
607
+ }, Us = {
608
608
  key: 0,
609
609
  class: "space-y-12 p-4 text-sm"
610
- }, Ys = {
610
+ }, Ks = {
611
611
  class: "flex items-start justify-between gap-8 rounded-lg border border-fm-color-border-default p-12"
612
612
  }, Bs = {
613
613
  class: "min-w-0 flex-1"
614
- }, zs = {
614
+ }, Ys = {
615
615
  class: "audit-log-operation-label-detail text-base font-bold leading-snug text-fm-color-typo-primary"
616
- }, qs = {
616
+ }, zs = {
617
617
  key: 0,
618
618
  class: "mt-4 break-all font-mono text-xs text-fm-color-typo-secondary"
619
- }, Js = {
619
+ }, qs = {
620
620
  key: 1,
621
621
  class: "mt-2 break-all font-mono text-xs text-fm-color-typo-secondary"
622
- }, Hs = {
622
+ }, Js = {
623
623
  class: "flex items-center gap-4"
624
- }, Ws = {
624
+ }, Hs = {
625
625
  class: "rounded-lg border border-fm-color-border-default p-12"
626
- }, Gs = {
626
+ }, Ws = {
627
627
  class: "space-y-12"
628
- }, Xs = {
628
+ }, Gs = {
629
629
  class: "text-xs text-fm-color-typo-secondary"
630
- }, Qs = {
630
+ }, Xs = {
631
631
  class: "font-semibold"
632
- }, Zs = {
632
+ }, Qs = {
633
633
  class: "text-xs text-fm-color-typo-secondary"
634
- }, ea = {
634
+ }, Zs = {
635
635
  class: "font-semibold"
636
- }, ta = {
636
+ }, ea = {
637
637
  class: "text-xs text-fm-color-typo-secondary"
638
- }, oa = {
638
+ }, ta = {
639
639
  class: "break-all font-semibold"
640
- }, sa = {
640
+ }, oa = {
641
641
  key: 0
642
- }, aa = {
642
+ }, sa = {
643
643
  class: "text-xs text-fm-color-typo-secondary"
644
- }, na = {
644
+ }, aa = {
645
645
  class: "break-all font-mono text-xs font-semibold"
646
- }, la = {
646
+ }, na = {
647
647
  class: "text-xs text-fm-color-typo-secondary"
648
- }, ra = {
648
+ }, la = {
649
649
  class: "break-all font-mono text-xs font-semibold"
650
- }, ia = {
650
+ }, ra = {
651
651
  class: "text-xs text-fm-color-typo-secondary"
652
- }, ua = {
652
+ }, ia = {
653
653
  class: "font-semibold"
654
- }, da = {
654
+ }, ua = {
655
655
  class: "rounded-lg border border-fm-color-border-default"
656
- }, ca = {
656
+ }, da = {
657
657
  class: "p-12"
658
- }, fa = {
658
+ }, ca = {
659
659
  class: "text-base font-bold text-fm-color-typo-primary"
660
- }, ma = {
660
+ }, fa = {
661
661
  class: "space-y-12 p-12"
662
- }, va = {
662
+ }, ma = {
663
663
  class: "text-xs text-fm-color-typo-secondary"
664
- }, pa = {
664
+ }, va = {
665
665
  class: "font-semibold"
666
- }, ga = {
666
+ }, pa = {
667
667
  class: "rounded-lg border border-fm-color-border-default"
668
- }, ha = {
668
+ }, ga = {
669
669
  class: "p-12"
670
- }, ya = {
670
+ }, ha = {
671
671
  class: "text-base font-bold text-fm-color-typo-primary"
672
- }, ba = {
672
+ }, ya = {
673
673
  class: "space-y-12 p-12"
674
- }, _a = {
674
+ }, ba = {
675
675
  class: "text-xs text-fm-color-typo-secondary"
676
- }, xa = {
676
+ }, _a = {
677
677
  class: "font-semibold"
678
- }, La = {
678
+ }, xa = {
679
679
  key: 0
680
- }, ka = {
680
+ }, La = {
681
681
  class: "text-xs text-fm-color-typo-secondary"
682
- }, Sa = {
682
+ }, ka = {
683
683
  key: 0,
684
684
  class: "font-semibold"
685
- }, wa = {
685
+ }, Sa = {
686
686
  key: 1,
687
687
  class: "break-all font-mono text-xs text-fm-color-typo-secondary"
688
- }, Ia = {
688
+ }, wa = {
689
689
  key: 1
690
- }, Aa = {
690
+ }, Ia = {
691
691
  class: "text-xs text-fm-color-typo-secondary"
692
- }, Fa = {
692
+ }, Aa = {
693
693
  class: "font-semibold whitespace-pre-line"
694
- }, Ma = {
694
+ }, Fa = {
695
695
  class: "text-xs text-fm-color-typo-secondary"
696
- }, Da = {
696
+ }, Ma = {
697
697
  class: "font-semibold"
698
- }, Oa = {
698
+ }, Da = {
699
699
  class: "text-xs text-fm-color-typo-secondary"
700
- }, Ca = {
700
+ }, Oa = {
701
701
  class: "break-all font-mono text-xs font-semibold"
702
- }, Ta = {
702
+ }, Ca = {
703
703
  class: "text-xs text-fm-color-typo-secondary"
704
704
  }, ja = {
705
705
  class: "break-all font-mono text-xs font-semibold"
706
- }, Pa = {
706
+ }, Ta = {
707
707
  class: "text-xs text-fm-color-typo-secondary"
708
- }, Va = {
708
+ }, Pa = {
709
709
  class: "font-semibold"
710
- }, $a = {
710
+ }, Va = {
711
711
  key: 0,
712
712
  class: "break-all font-mono text-xs"
713
- }, Ea = {
713
+ }, $a = {
714
714
  key: 0
715
- }, Ra = {
715
+ }, Ea = {
716
716
  class: "text-xs text-fm-color-typo-secondary"
717
- }, Ua = {
717
+ }, Ra = {
718
718
  class: "font-semibold"
719
719
  }, Na = {
720
720
  class: "text-xs text-fm-color-typo-secondary"
721
- }, Ka = {
721
+ }, Ua = {
722
722
  class: "font-semibold"
723
- }, Ya = {
723
+ }, Ka = {
724
724
  class: "text-xs text-fm-color-typo-secondary"
725
725
  }, Ba = {
726
726
  class: "font-semibold"
727
- }, za = {
727
+ }, Ya = {
728
728
  key: 0
729
- }, qa = {
729
+ }, za = {
730
730
  key: 1
731
- }, Ja = {
731
+ }, qa = {
732
732
  class: "text-xs text-fm-color-typo-secondary"
733
- }, Ha = {
733
+ }, Ja = {
734
734
  class: "whitespace-pre-wrap break-all font-mono text-xs"
735
- }, Wa = {
735
+ }, Ha = {
736
736
  key: 3
737
- }, Ga = {
737
+ }, Wa = {
738
738
  class: "text-xs text-fm-color-typo-secondary"
739
- }, Xa = {
739
+ }, Ga = {
740
740
  class: "mt-4 space-y-4"
741
- }, Qa = {
741
+ }, Xa = {
742
742
  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"
743
- }, Za = {
743
+ }, Qa = {
744
744
  class: "text-xs font-semibold"
745
- }, en = {
745
+ }, Za = {
746
746
  key: 0,
747
747
  class: "text-fm-color-typo-secondary"
748
- }, tn = {
748
+ }, en = {
749
749
  key: 4
750
- }, on = {
750
+ }, tn = {
751
751
  class: "text-xs text-fm-color-typo-secondary"
752
- }, sn = {
752
+ }, on = {
753
753
  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"
754
- }, an = {
754
+ }, sn = {
755
755
  key: 0,
756
756
  class: "space-y-12 p-4 text-sm"
757
- }, nn = {
757
+ }, an = {
758
758
  class: "flex items-start justify-between gap-8 rounded-lg border border-fm-color-border-default p-12"
759
- }, ln = {
759
+ }, nn = {
760
760
  class: "min-w-0 flex-1"
761
- }, rn = {
761
+ }, ln = {
762
762
  class: "text-base font-bold leading-snug text-fm-color-typo-primary"
763
- }, un = {
763
+ }, rn = {
764
764
  key: 0,
765
765
  class: "text-xs text-fm-color-typo-secondary"
766
- }, dn = {
766
+ }, un = {
767
767
  class: "rounded-lg border border-fm-color-border-default p-12"
768
- }, cn = {
768
+ }, dn = {
769
769
  class: "space-y-12"
770
- }, fn = {
770
+ }, cn = {
771
771
  class: "text-xs text-fm-color-typo-secondary"
772
- }, mn = {
772
+ }, fn = {
773
773
  class: "font-semibold"
774
- }, vn = {
774
+ }, mn = {
775
775
  key: 0
776
- }, pn = {
776
+ }, vn = {
777
777
  class: "text-xs text-fm-color-typo-secondary"
778
- }, gn = {
778
+ }, pn = {
779
779
  class: "font-semibold"
780
- }, hn = {
780
+ }, gn = {
781
781
  key: 1
782
- }, yn = {
782
+ }, hn = {
783
783
  class: "text-xs text-fm-color-typo-secondary"
784
- }, bn = {
784
+ }, yn = {
785
785
  class: "font-semibold"
786
- }, _n = {
786
+ }, bn = {
787
787
  key: 0,
788
788
  class: "rounded-lg border border-fm-color-border-default p-12"
789
- }, xn = {
789
+ }, _n = {
790
790
  class: "text-xs text-fm-color-typo-secondary"
791
- }, Ln = {
791
+ }, xn = {
792
792
  class: "whitespace-pre-line font-semibold text-fm-color-typo-error"
793
- }, kn = {
793
+ }, Ln = {
794
794
  class: "rounded-lg border border-fm-color-border-default"
795
- }, Sn = {
795
+ }, kn = {
796
796
  class: "p-12"
797
- }, wn = {
797
+ }, Sn = {
798
798
  class: "text-base font-bold text-fm-color-typo-primary"
799
- }, In = {
799
+ }, wn = {
800
800
  class: "p-12"
801
- }, An = {
801
+ }, In = {
802
802
  key: 0,
803
803
  class: "divide-y divide-fm-color-border-default"
804
- }, Fn = {
804
+ }, An = {
805
805
  class: "flex flex-wrap items-center gap-8"
806
- }, Mn = {
806
+ }, Fn = {
807
807
  class: "break-all text-xs"
808
- }, Dn = {
808
+ }, Mn = {
809
809
  class: "break-all font-mono text-xs"
810
- }, On = {
810
+ }, Dn = {
811
811
  key: 0,
812
812
  class: "text-fm-color-typo-success"
813
- }, Cn = {
813
+ }, On = {
814
814
  key: 1,
815
815
  class: "text-fm-color-typo-error"
816
- }, Tn = {
816
+ }, Cn = {
817
817
  class: "text-fm-color-typo-error"
818
818
  }, jn = {
819
819
  class: "text-fm-color-typo-success"
820
- }, Pn = {
820
+ }, Tn = {
821
821
  key: 1,
822
822
  class: "divide-y divide-fm-color-border-default"
823
- }, Vn = {
823
+ }, Pn = {
824
824
  class: "flex flex-wrap items-center gap-8"
825
- }, $n = {
825
+ }, Vn = {
826
826
  class: "break-all font-mono text-xs"
827
- }, En = {
827
+ }, $n = {
828
828
  class: "space-y-4"
829
- }, Rn = {
829
+ }, En = {
830
830
  key: 0,
831
831
  class: "text-fm-color-typo-success"
832
- }, Un = {
832
+ }, Rn = {
833
833
  key: 1,
834
834
  class: "text-fm-color-typo-error"
835
835
  }, Nn = {
836
836
  class: "text-fm-color-typo-error"
837
- }, Kn = {
837
+ }, Un = {
838
838
  class: "text-fm-color-typo-success"
839
- }, Yn = {
839
+ }, Kn = {
840
840
  key: 2,
841
841
  class: "text-fm-color-typo-secondary"
842
842
  }, Bn = {
843
843
  key: 1,
844
844
  class: "rounded-lg border border-fm-color-border-default"
845
- }, zn = {
845
+ }, Yn = {
846
846
  class: "text-base font-bold text-fm-color-typo-primary"
847
- }, qn = {
847
+ }, zn = {
848
848
  class: "space-y-12 p-12"
849
- }, Jn = {
849
+ }, qn = {
850
850
  key: 0
851
- }, Hn = {
851
+ }, Jn = {
852
852
  class: "text-xs text-fm-color-typo-secondary"
853
- }, Wn = {
853
+ }, Hn = {
854
854
  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"
855
- }, Gn = {
855
+ }, Wn = {
856
856
  key: 1
857
- }, Xn = {
857
+ }, Gn = {
858
858
  class: "text-xs text-fm-color-typo-secondary"
859
- }, Qn = {
859
+ }, Xn = {
860
860
  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"
861
- }, Oe = 100, rt = 1e3, it = "__feedmeAdmin__", Zn = "D MMM YYYY h:mm A", el = "YYYY-MM-DD HH:mm", N = "YYYY-MM-DD", Pt = "audit-log-export-fields-v3", tl = /* @__PURE__ */ Vt({
861
+ }, De = 100, rt = 1e3, it = "__feedmeAdmin__", Qn = "D MMM YYYY h:mm A", Zn = "YYYY-MM-DD HH:mm", K = "YYYY-MM-DD", Pt = "audit-log-export-fields-v3", el = /* @__PURE__ */ Vt({
862
862
  __name: "AuditLogList",
863
863
  setup(t) {
864
864
  const {
865
865
  t: o,
866
866
  te: n
867
- } = dt(), r = Ho(), c = Wo(), d = ms(), b = ts(), {
867
+ } = dt(), r = Ho(), d = fs(), y = Xo(), {
868
868
  restaurants: _
869
- } = Jo(b), w = S(!1), D = S(!1), O = S([]), i = S(null), V = S(!1), L = S({}), f = S(null), M = S(!1);
870
- async function C(e) {
871
- const s = Uint8Array.from(atob(e), (k) => k.charCodeAt(0)), m = new DecompressionStream("gzip"), x = m.writable.getWriter();
872
- return await x.write(s), await x.close(), new Response(m.readable).text();
869
+ } = Jo(y), g = w(!1), S = w(!1), O = w([]), i = w(null), P = w(!1), $ = w({}), m = w(null), x = w(!1);
870
+ async function D(e) {
871
+ const s = Uint8Array.from(atob(e), (k) => k.charCodeAt(0)), c = new DecompressionStream("gzip"), L = c.writable.getWriter();
872
+ return await L.write(s), await L.close(), new Response(c.readable).text();
873
873
  }
874
- const p = S("");
875
- let j = 0;
876
- ae(() => {
874
+ const F = w("");
875
+ let b = 0;
876
+ oe(() => {
877
877
  var e, s;
878
878
  return (s = (e = i.value) == null ? void 0 : e.metadata) == null ? void 0 : s.requestBody;
879
879
  }, async (e) => {
880
- const s = ++j;
880
+ const s = ++b;
881
881
  if (!e) {
882
- p.value = "";
882
+ F.value = "";
883
883
  return;
884
884
  }
885
885
  if (typeof e == "object") {
886
- p.value = JSON.stringify(e, null, 2);
886
+ F.value = JSON.stringify(e, null, 2);
887
887
  return;
888
888
  }
889
889
  if (e.startsWith("gzip:")) {
890
890
  try {
891
- const m = await C(e.slice(5));
892
- if (s !== j) return;
893
- p.value = JSON.stringify(JSON.parse(m), null, 2);
891
+ const c = await D(e.slice(5));
892
+ if (s !== b) return;
893
+ F.value = JSON.stringify(JSON.parse(c), null, 2);
894
894
  } catch {
895
- if (s !== j) return;
896
- p.value = e;
895
+ if (s !== b) return;
896
+ F.value = e;
897
897
  }
898
898
  return;
899
899
  }
900
900
  try {
901
- p.value = JSON.stringify(JSON.parse(e), null, 2);
901
+ F.value = JSON.stringify(JSON.parse(e), null, 2);
902
902
  } catch {
903
- p.value = e;
903
+ F.value = e;
904
904
  }
905
905
  }, {
906
906
  immediate: !0
907
907
  });
908
- async function K(e) {
908
+ async function j(e) {
909
909
  if (!e) return;
910
910
  let s = e;
911
911
  if (e.startsWith("gzip:"))
912
912
  try {
913
- s = await C(e.slice(5));
913
+ s = await D(e.slice(5));
914
914
  } catch {
915
915
  return e;
916
916
  }
@@ -920,7 +920,7 @@ const Os = {
920
920
  return s;
921
921
  }
922
922
  }
923
- function E(e) {
923
+ function B(e) {
924
924
  if (e === void 0) return "";
925
925
  if (typeof e == "object" && e !== null)
926
926
  try {
@@ -930,143 +930,144 @@ const Os = {
930
930
  }
931
931
  return String(e);
932
932
  }
933
- const X = S([]), Y = S([]), I = S(""), Q = S(""), H = S(!1);
934
- let xe = 0;
935
- ae(f, async (e) => {
936
- const s = ++xe;
937
- if (X.value = [], Y.value = [], I.value = "", Q.value = "", H.value = !1, !e) return;
938
- const [m, x] = await Promise.all([K(e.before), K(e.after)]);
939
- s === xe && (As(e.changeNodes) ? Y.value = e.changeNodes.map(Is) : X.value = Ls(m, x), I.value = E(m), Q.value = E(x));
933
+ const E = w([]), H = w([]), U = w(""), I = w(""), X = w(!1);
934
+ let ue = 0;
935
+ oe(m, async (e) => {
936
+ const s = ++ue;
937
+ if (E.value = [], H.value = [], U.value = "", I.value = "", X.value = !1, !e) return;
938
+ const [c, L] = await Promise.all([j(e.before), j(e.after)]);
939
+ s === ue && (Is(e.changeNodes) ? H.value = e.changeNodes.map(ws) : E.value = xs(c, L), U.value = B(c), I.value = B(L));
940
940
  });
941
- function ct(e) {
941
+ function Te(e) {
942
942
  return e === "added" ? "success" : e === "removed" ? "critical" : "warning";
943
943
  }
944
- function W(e) {
944
+ function ct(e) {
945
945
  return o(e === "added" ? "auditLog.operation.added" : e === "removed" ? "auditLog.operation.removed" : "auditLog.operation.updated");
946
946
  }
947
- function Le(e) {
947
+ function W(e) {
948
948
  return e.replace(/\[[^\]]*\]/g, "");
949
949
  }
950
- function Nt(e) {
950
+ function xe(e) {
951
951
  return e === "add" ? "success" : e === "remove" ? "critical" : "warning";
952
952
  }
953
- function Kt(e) {
953
+ function Ut(e) {
954
954
  return o(e === "add" ? "auditLog.operation.added" : e === "remove" ? "auditLog.operation.removed" : "auditLog.operation.updated");
955
955
  }
956
- function Yt(e) {
956
+ function Kt(e) {
957
957
  return Rt(o, n, e);
958
958
  }
959
959
  const ft = A(() => {
960
960
  const e = [], s = /* @__PURE__ */ new Map();
961
- for (const m of X.value) {
962
- const x = Le(m.path), k = `${m.type}::${x}`;
963
- let T = s.get(k);
964
- T || (T = {
961
+ for (const c of E.value) {
962
+ const L = W(c.path), k = `${c.type}::${L}`;
963
+ let C = s.get(k);
964
+ C || (C = {
965
965
  groupKey: k,
966
- displayKey: x,
967
- type: m.type,
966
+ displayKey: L,
967
+ type: c.type,
968
968
  rows: []
969
- }, s.set(k, T), e.push(T)), T.rows.push(m);
969
+ }, s.set(k, C), e.push(C)), C.rows.push(c);
970
970
  }
971
971
  return e;
972
- }), Pe = S(1), Bt = S(!1), Be = S(0), mt = A(() => Math.max(1, Math.ceil(Be.value / Oe))), vt = P().format("YYYY-MM-DD"), ne = S({
972
+ }), Pe = w(1), Bt = w(!1), ze = w(0), mt = A(() => Math.max(1, Math.ceil(ze.value / De))), vt = T().format("YYYY-MM-DD"), se = w({
973
973
  startDate: `${vt} 00:00`,
974
974
  endDate: `${vt} 23:59`
975
- }), fe = S(), Z = S(), le = S(), re = S(), ie = S("all");
976
- function zt(e) {
975
+ }), fe = w(), Q = w(), ae = w(), ne = w(), le = w("all");
976
+ function Yt(e) {
977
977
  return typeof e == "string" ? [e] : Array.isArray(e) ? e.filter((s) => typeof s == "string") : [];
978
978
  }
979
- const pt = De.filter((e) => e.key !== "all").map((e) => e.key);
979
+ const pt = Me.filter((e) => e.key !== "all").map((e) => e.key);
980
980
  function Ve(e) {
981
- const s = De.find((m) => m.key !== "all" && m.subjectPrefixes.some((x) => e.startsWith(x)));
981
+ const s = Me.find((c) => c.key !== "all" && c.subjectPrefixes.some((L) => e.startsWith(L)));
982
982
  return (s == null ? void 0 : s.key) ?? "other";
983
983
  }
984
984
  function gt(e) {
985
985
  const s = pt.indexOf(e);
986
986
  return s === -1 ? pt.length : s;
987
987
  }
988
- const qt = ["all", "report", "hrm", "payment"], Jt = A(() => De.filter(({
989
- key: e
990
- }) => !c.isFoodCourt.value || qt.includes(e)).map(({
988
+ const zt = A(() => Me.map(({
991
989
  key: e
992
990
  }) => ({
993
991
  label: o(`auditLog.modules.${e}`),
994
992
  value: e
995
- }))), $e = A(() => De.find((e) => e.key === ie.value) ?? De[0]), Ht = A(() => ie.value === "all"), q = A(() => ie.value === "pos"), pe = A(() => $e.value.sources ?? []);
996
- ae(q, (e) => {
997
- e && b.readRestaurants();
993
+ }))), $e = A(() => Me.find((e) => e.key === le.value) ?? Me[0]), qt = A(() => le.value === "all"), q = A(() => le.value === "pos"), pe = A(() => $e.value.sources ?? []);
994
+ oe(q, (e) => {
995
+ e && y.readRestaurants();
998
996
  }, {
999
997
  immediate: !0
1000
998
  });
1001
- const ee = S([]), Wt = A(() => _.value.map((e) => ({
999
+ const Z = w([]), Jt = A(() => _.value.map((e) => ({
1002
1000
  label: e.profile.name,
1003
1001
  value: String(e._id)
1004
- }))), Gt = A(() => Object.fromEntries(_.value.map((e) => [String(e._id), e.profile.name])));
1005
- ae(ie, () => {
1006
- ee.value = [];
1002
+ }))), Ht = A(() => Object.fromEntries(_.value.map((e) => [String(e._id), e.profile.name])));
1003
+ oe(le, () => {
1004
+ Z.value = [];
1007
1005
  });
1008
- const ke = S([]), Ee = S(!1), Xt = A(() => [...Ee.value ? [{
1006
+ const Le = w([]), Ee = w(!1), Wt = A(() => [...Ee.value ? [{
1009
1007
  label: o("auditLog.user.feedmeAdmin"),
1010
1008
  value: it
1011
1009
  }] : [], ...d.members.map((e) => ({
1012
1010
  label: e.name,
1013
1011
  value: e.doc.userId
1014
- })), ...ke.value.map((e) => ({
1012
+ })), ...Le.value.map((e) => ({
1015
1013
  label: `${e.name} (${o("auditLog.user.feedmeAdmin")})`,
1016
1014
  value: e.userId
1017
- }))]), ue = A(() => ws(fe.value, q.value, it)), ze = S(""), te = S(""), Qt = os(ze, (e) => {
1018
- te.value = e.trim();
1015
+ }))]), re = A(() => Ss(fe.value, q.value, it)), qe = w(""), ee = w(""), Gt = ts(qe, (e) => {
1016
+ ee.value = e.trim();
1019
1017
  });
1020
- Bo(Qt);
1018
+ Yo(Gt);
1021
1019
  const {
1022
- onSheetOpened: Zt,
1023
- onSheetClosed: eo,
1024
- copyLink: to
1025
- } = gs({
1020
+ onSheetOpened: Xt,
1021
+ onSheetClosed: Qt,
1022
+ copyLink: Zt
1023
+ } = ps({
1026
1024
  logs: O,
1027
1025
  selectedLog: i,
1028
- isSheetOpen: V,
1029
- businessId: () => c.id.value
1026
+ isSheetOpen: P,
1027
+ businessId: () => {
1028
+ var e;
1029
+ return (e = r.currentBusiness.value) == null ? void 0 : e._id;
1030
+ }
1030
1031
  }), me = A(() => {
1031
- const e = te.value.toLowerCase();
1032
+ const e = ee.value.toLowerCase();
1032
1033
  if (!e) return [];
1033
1034
  const s = /* @__PURE__ */ new Set();
1034
- for (const m of d.members) {
1035
- const x = m.doc.userId;
1036
- ((d.userIdToName[x] ?? "").toLowerCase().includes(e) || (d.userIdToEmail[x] ?? "").toLowerCase().includes(e) || (d.userIdToPhone[x] ?? "").toLowerCase().includes(e)) && s.add(x);
1035
+ for (const c of d.members) {
1036
+ const L = c.doc.userId;
1037
+ ((d.userIdToName[L] ?? "").toLowerCase().includes(e) || (d.userIdToEmail[L] ?? "").toLowerCase().includes(e) || (d.userIdToPhone[L] ?? "").toLowerCase().includes(e)) && s.add(L);
1037
1038
  }
1038
- for (const m of ke.value)
1039
- m.name.toLowerCase().includes(e) && s.add(m.userId);
1039
+ for (const c of Le.value)
1040
+ c.name.toLowerCase().includes(e) && s.add(c.userId);
1040
1041
  return [...s];
1041
- }), qe = A(() => {
1042
- const e = Dt.flatMap((k) => zt(k.subject).map((T) => ({
1042
+ }), Je = A(() => {
1043
+ const e = Dt.flatMap((k) => Yt(k.subject).map((C) => ({
1043
1044
  label: k.label,
1044
- value: T
1045
- }))), s = Object.entries(Mt).map(([k, T]) => ({
1046
- label: T,
1045
+ value: C
1046
+ }))), s = Object.entries(Mt).map(([k, C]) => ({
1047
+ label: C,
1047
1048
  value: k
1048
- })), m = /* @__PURE__ */ new Set(), x = [];
1049
+ })), c = /* @__PURE__ */ new Set(), L = [];
1049
1050
  for (const k of [...e, ...s])
1050
- if (!m.has(k.value)) {
1051
- m.add(k.value);
1052
- const T = Ve(k.value);
1053
- x.push({
1051
+ if (!c.has(k.value)) {
1052
+ c.add(k.value);
1053
+ const C = Ve(k.value);
1054
+ L.push({
1054
1055
  ...k,
1055
- group: o(`auditLog.modules.${T}`)
1056
+ group: o(`auditLog.modules.${C}`)
1056
1057
  });
1057
1058
  }
1058
- return x.sort((k, T) => gt(Ve(k.value)) - gt(Ve(T.value)));
1059
+ return L.sort((k, C) => gt(Ve(k.value)) - gt(Ve(C.value)));
1059
1060
  }), ge = A(() => {
1060
- const e = te.value.toLowerCase();
1061
+ const e = ee.value.toLowerCase();
1061
1062
  if (!e) return [];
1062
1063
  const s = /* @__PURE__ */ new Set();
1063
- for (const m of qe.value)
1064
- m.label.toLowerCase().includes(e) && s.add(m.value);
1064
+ for (const c of Je.value)
1065
+ c.label.toLowerCase().includes(e) && s.add(c.value);
1065
1066
  return [...s];
1066
- }), oo = A(() => Ht.value ? qe.value : qe.value.filter((e) => Ve(e.value) === ie.value));
1067
- function so(e, s) {
1068
- const m = s.toLowerCase();
1069
- return e.label.toLowerCase().includes(m) || e.value.replace(/^business::/, "").toLowerCase().includes(m) ? !0 : e.value.toLowerCase().includes(m);
1067
+ }), eo = A(() => qt.value ? Je.value : Je.value.filter((e) => Ve(e.value) === le.value));
1068
+ function to(e, s) {
1069
+ const c = s.toLowerCase();
1070
+ return e.label.toLowerCase().includes(c) || e.value.replace(/^business::/, "").toLowerCase().includes(c) ? !0 : e.value.toLowerCase().includes(c);
1070
1071
  }
1071
1072
  const G = A(() => ({
1072
1073
  manage: o("auditLog.action.manage"),
@@ -1074,7 +1075,7 @@ const Os = {
1074
1075
  read: o("auditLog.action.read"),
1075
1076
  update: o("auditLog.action.update"),
1076
1077
  delete: o("auditLog.action.delete")
1077
- })), ao = A(() => [{
1078
+ })), oo = A(() => [{
1078
1079
  label: G.value.manage,
1079
1080
  value: "manage"
1080
1081
  }, {
@@ -1093,26 +1094,26 @@ const Os = {
1093
1094
  allowed: o("auditLog.outcome.success"),
1094
1095
  denied: o("auditLog.outcome.failed"),
1095
1096
  skipped: o("auditLog.outcome.skipped")
1096
- })), Je = A(() => {
1097
+ })), He = A(() => {
1097
1098
  var e;
1098
1099
  return ((e = r.sessionUser.value) == null ? void 0 : e.isInternal) ?? !1;
1099
1100
  });
1100
1101
  function ht(e) {
1101
- return !Je.value && e === "skipped" ? "allowed" : e;
1102
+ return !He.value && e === "skipped" ? "allowed" : e;
1102
1103
  }
1103
- function He(e) {
1104
- return !(e != null && e.length) || Je.value ? e : e.includes("allowed") ? [.../* @__PURE__ */ new Set([...e, "skipped"])] : e;
1104
+ function We(e) {
1105
+ return !(e != null && e.length) || He.value ? e : e.includes("allowed") ? [.../* @__PURE__ */ new Set([...e, "skipped"])] : e;
1105
1106
  }
1106
- const no = A(() => [{
1107
+ const so = A(() => [{
1107
1108
  label: Re.value.allowed,
1108
1109
  value: "allowed"
1109
1110
  }, {
1110
1111
  label: Re.value.denied,
1111
1112
  value: "denied"
1112
- }, ...Je.value ? [{
1113
+ }, ...He.value ? [{
1113
1114
  label: Re.value.skipped,
1114
1115
  value: "skipped"
1115
- }] : []]), lo = A(() => ({
1116
+ }] : []]), ao = A(() => ({
1116
1117
  admin: o("auditLog.detail.resolvedFromValue.admin"),
1117
1118
  staff: o("auditLog.detail.resolvedFromValue.staff"),
1118
1119
  permissionSet: o("auditLog.detail.resolvedFromValue.permissionSet"),
@@ -1120,95 +1121,95 @@ const Os = {
1120
1121
  custom: o("auditLog.detail.resolvedFromValue.custom"),
1121
1122
  "no-match": o("auditLog.detail.resolvedFromValue.noMatch"),
1122
1123
  unknown: o("auditLog.detail.resolvedFromValue.unknown")
1123
- })), ro = A(() => ({
1124
+ })), no = A(() => ({
1124
1125
  GET: G.value.read,
1125
1126
  POST: G.value.create,
1126
1127
  PUT: G.value.update,
1127
1128
  PATCH: G.value.update,
1128
1129
  DELETE: G.value.delete
1129
- })), io = {
1130
+ })), lo = {
1130
1131
  allowed: "success",
1131
1132
  denied: "critical",
1132
1133
  skipped: "warning"
1133
1134
  };
1134
- function Ue(e) {
1135
- return P(e).format(Zn);
1135
+ function Ne(e) {
1136
+ return T(e).format(Qn);
1136
1137
  }
1137
- const uo = A(() => {
1138
+ const ro = A(() => {
1138
1139
  const {
1139
1140
  startDate: e,
1140
1141
  endDate: s
1141
- } = ne.value;
1142
- return e && s ? `${Ue(e)} – ${Ue(s)}` : e ? Ue(e) : s ? Ue(s) : o("auditLog.dateRange.placeholder");
1143
- }), co = A(() => [{
1142
+ } = se.value;
1143
+ return e && s ? `${Ne(e)} – ${Ne(s)}` : e ? Ne(e) : s ? Ne(s) : o("auditLog.dateRange.placeholder");
1144
+ }), io = A(() => [{
1144
1145
  label: o("date.predefinedRanges.today"),
1145
1146
  value: {
1146
- startDate: P().format(N),
1147
- endDate: P().format(N)
1147
+ startDate: T().format(K),
1148
+ endDate: T().format(K)
1148
1149
  }
1149
1150
  }, {
1150
1151
  label: o("date.predefinedRanges.yesterday"),
1151
1152
  value: {
1152
- startDate: P().subtract(1, "day").format(N),
1153
- endDate: P().subtract(1, "day").format(N)
1153
+ startDate: T().subtract(1, "day").format(K),
1154
+ endDate: T().subtract(1, "day").format(K)
1154
1155
  }
1155
1156
  }, {
1156
1157
  label: o("date.predefinedRanges.thisWeek"),
1157
1158
  value: {
1158
- startDate: P().startOf("week").format(N),
1159
- endDate: P().endOf("week").format(N)
1159
+ startDate: T().startOf("week").format(K),
1160
+ endDate: T().endOf("week").format(K)
1160
1161
  }
1161
1162
  }, {
1162
1163
  label: o("date.predefinedRanges.lastWeek"),
1163
1164
  value: {
1164
- startDate: P().subtract(1, "week").startOf("week").format(N),
1165
- endDate: P().subtract(1, "week").endOf("week").format(N)
1165
+ startDate: T().subtract(1, "week").startOf("week").format(K),
1166
+ endDate: T().subtract(1, "week").endOf("week").format(K)
1166
1167
  }
1167
1168
  }, {
1168
1169
  label: o("date.predefinedRanges.last7Days"),
1169
1170
  value: {
1170
- startDate: P().subtract(7, "day").format(N),
1171
- endDate: P().subtract(1, "day").format(N)
1171
+ startDate: T().subtract(7, "day").format(K),
1172
+ endDate: T().subtract(1, "day").format(K)
1172
1173
  }
1173
1174
  }, {
1174
1175
  label: o("date.predefinedRanges.thisMonth"),
1175
1176
  value: {
1176
- startDate: P().startOf("month").format(N),
1177
- endDate: P().endOf("month").format(N)
1177
+ startDate: T().startOf("month").format(K),
1178
+ endDate: T().endOf("month").format(K)
1178
1179
  }
1179
1180
  }, {
1180
1181
  label: o("date.predefinedRanges.lastMonth"),
1181
1182
  value: {
1182
- startDate: P().subtract(1, "month").startOf("month").format(N),
1183
- endDate: P().subtract(1, "month").endOf("month").format(N)
1183
+ startDate: T().subtract(1, "month").startOf("month").format(K),
1184
+ endDate: T().subtract(1, "month").endOf("month").format(K)
1184
1185
  }
1185
1186
  }]);
1186
- function We(e) {
1187
+ function Ge(e) {
1187
1188
  var s;
1188
- return ((s = Dt.find((m) => m.subject === e)) == null ? void 0 : s.label) ?? Mt[e] ?? rs[e];
1189
+ return ((s = Dt.find((c) => c.subject === e)) == null ? void 0 : s.label) ?? Mt[e] ?? ls[e];
1189
1190
  }
1190
- function Se(e) {
1191
- var m, x;
1191
+ function ke(e) {
1192
+ var c, L;
1192
1193
  if (e.actorType === "posUser")
1193
- return ks(e, o);
1194
+ return Ls(e, o);
1194
1195
  if (e.actorType === "portalUser")
1195
1196
  return e.actorName ?? e.userId;
1196
1197
  if (e.actorType === "feedmeAdmin")
1197
- return (m = r.sessionUser.value) != null && m.isInternal ? `${e.actorName ?? e.userId} (${o("auditLog.user.feedmeAdmin")})` : o("auditLog.user.feedmeAdmin");
1198
+ return (c = r.sessionUser.value) != null && c.isInternal ? `${e.actorName ?? e.userId} (${o("auditLog.user.feedmeAdmin")})` : o("auditLog.user.feedmeAdmin");
1198
1199
  const s = d.userIdToName[e.userId];
1199
- return s || (d.hasLoaded ? (x = r.sessionUser.value) != null && x.isInternal ? `${e.actorName ?? e.userId} (${o("auditLog.user.feedmeAdmin")})` : o("auditLog.user.feedmeAdmin") : e.userId);
1200
+ return s || (d.hasLoaded ? (L = r.sessionUser.value) != null && L.isInternal ? `${e.actorName ?? e.userId} (${o("auditLog.user.feedmeAdmin")})` : o("auditLog.user.feedmeAdmin") : e.userId);
1200
1201
  }
1201
1202
  function yt(e) {
1202
1203
  return e.actorType === "posUser" ? q.value ? "" : lt(e, o) : d.userIdToPhone[e.userId] || "-";
1203
1204
  }
1204
- function fo(e) {
1205
+ function uo(e) {
1205
1206
  return d.userIdToEmail[e.userId] || "-";
1206
1207
  }
1207
1208
  function bt(e) {
1208
- return P(e).format("DD MMM YYYY, HH:mm");
1209
+ return T(e).format("DD MMM YYYY, HH:mm");
1209
1210
  }
1210
- function Ge(e) {
1211
- return P(e).format("DD MMM YYYY, HH:mm:ss").toUpperCase();
1211
+ function Xe(e) {
1212
+ return T(e).format("DD MMM YYYY, HH:mm:ss").toUpperCase();
1212
1213
  }
1213
1214
  function _t(e) {
1214
1215
  return G.value[e] ?? e;
@@ -1219,31 +1220,31 @@ const Os = {
1219
1220
  params: e.params,
1220
1221
  operationLabel: e.metadata.operationLabel ?? _t(e.action)
1221
1222
  });
1222
- return e.actorType === "posUser" && !q.value ? s + Ss(e, o) : s;
1223
+ return e.actorType === "posUser" && !q.value ? s + ks(e, o) : s;
1223
1224
  }
1224
1225
  function Lt(e) {
1225
1226
  return ut(o, e) || o("auditLog.operation.unlabeled");
1226
1227
  }
1227
- function mo(e) {
1228
- return We(e.subject) ?? e.subject;
1228
+ function co(e) {
1229
+ return Ge(e.subject) ?? e.subject;
1229
1230
  }
1230
- function Xe(e) {
1231
+ function Qe(e) {
1231
1232
  return Re.value[ht(e)];
1232
1233
  }
1233
1234
  function kt(e) {
1234
- return io[ht(e)] ?? "neutral";
1235
+ return lo[ht(e)] ?? "neutral";
1235
1236
  }
1236
- function vo(e) {
1237
- return lo.value[e] ?? e;
1237
+ function fo(e) {
1238
+ return ao.value[e] ?? e;
1238
1239
  }
1239
- function po(e) {
1240
- return e.metadata.requestMethod ? ro.value[e.metadata.requestMethod] ?? e.metadata.requestMethod : _t(e.action);
1240
+ function mo(e) {
1241
+ return e.metadata.requestMethod ? no.value[e.metadata.requestMethod] ?? e.metadata.requestMethod : _t(e.action);
1241
1242
  }
1242
1243
  function St(e) {
1243
1244
  const s = String(e ?? "");
1244
1245
  return `"${(/^[=+\-@\t\r]/.test(s) ? `'${s}` : s).replace(/"/g, '""')}"`;
1245
1246
  }
1246
- const Qe = [{
1247
+ const Ze = [{
1247
1248
  key: "timestamp",
1248
1249
  labelKey: "auditLog.exportFields.timestamp",
1249
1250
  getValue: (e) => bt(e.timestamp),
@@ -1251,7 +1252,7 @@ const Os = {
1251
1252
  }, {
1252
1253
  key: "userName",
1253
1254
  labelKey: "auditLog.exportFields.userName",
1254
- getValue: (e) => Se(e),
1255
+ getValue: (e) => ke(e),
1255
1256
  defaultSelected: !0
1256
1257
  }, {
1257
1258
  key: "userPhone",
@@ -1261,7 +1262,7 @@ const Os = {
1261
1262
  }, {
1262
1263
  key: "subject",
1263
1264
  labelKey: "auditLog.exportFields.subject",
1264
- getValue: (e) => We(e.subject) ?? e.subject,
1265
+ getValue: (e) => Ge(e.subject) ?? e.subject,
1265
1266
  defaultSelected: !0
1266
1267
  }, {
1267
1268
  key: "action",
@@ -1276,17 +1277,17 @@ const Os = {
1276
1277
  }, {
1277
1278
  key: "outcome",
1278
1279
  labelKey: "auditLog.exportFields.outcome",
1279
- getValue: (e) => Xe(e.outcome),
1280
+ getValue: (e) => Qe(e.outcome),
1280
1281
  defaultSelected: !0
1281
1282
  }, {
1282
1283
  key: "operationEvents",
1283
1284
  labelKey: "auditLog.exportFields.operationEvents",
1284
- getValue: (e) => Fs(o, e.operations),
1285
+ getValue: (e) => As(o, e.operations),
1285
1286
  defaultSelected: !0
1286
1287
  }, {
1287
1288
  key: "changes",
1288
1289
  labelKey: "auditLog.exportFields.changes",
1289
- getValue: (e) => Ds(o, n, e.operations),
1290
+ getValue: (e) => Ms(o, n, e.operations),
1290
1291
  defaultSelected: !1
1291
1292
  }, {
1292
1293
  key: "businessId",
@@ -1333,7 +1334,7 @@ const Os = {
1333
1334
  getValue: (e) => e.traceId ?? "",
1334
1335
  defaultSelected: !1
1335
1336
  }];
1336
- function go() {
1337
+ function vo() {
1337
1338
  try {
1338
1339
  const e = localStorage.getItem(Pt);
1339
1340
  if (e) {
@@ -1342,10 +1343,10 @@ const Os = {
1342
1343
  }
1343
1344
  } catch {
1344
1345
  }
1345
- return new Set(Qe.filter((e) => e.defaultSelected).map((e) => e.key));
1346
+ return new Set(Ze.filter((e) => e.defaultSelected).map((e) => e.key));
1346
1347
  }
1347
- const he = S(go());
1348
- function ho(e) {
1348
+ const he = w(vo());
1349
+ function po(e) {
1349
1350
  const s = new Set(he.value);
1350
1351
  if (s.has(e)) {
1351
1352
  if (s.size <= 1) return;
@@ -1358,45 +1359,45 @@ const Os = {
1358
1359
  } catch {
1359
1360
  }
1360
1361
  }
1361
- async function yo() {
1362
- var e, s, m;
1363
- if (!D.value) {
1364
- D.value = !0;
1362
+ async function go() {
1363
+ var e, s, c, L, k;
1364
+ if (!S.value) {
1365
+ S.value = !0;
1365
1366
  try {
1366
1367
  const {
1367
- startDate: x,
1368
- endDate: k
1369
- } = ne.value, T = $e.value.subjectPrefixes, U = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace("T", " "), se = k ? de(k) : null, et = se && se < U ? se : U, tt = {
1370
- ...x ? {
1371
- from: de(x)
1368
+ startDate: C,
1369
+ endDate: R
1370
+ } = se.value, ie = $e.value.subjectPrefixes, Ue = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace("T", " "), we = R ? de(R) : null, Ke = we && we < Ue ? we : Ue, tt = {
1371
+ ...C ? {
1372
+ from: de(C)
1372
1373
  } : {},
1373
- to: et,
1374
- ...ue.value.userIds.length ? {
1375
- userIds: ue.value.userIds
1374
+ to: Ke,
1375
+ ...re.value.userIds.length ? {
1376
+ userIds: re.value.userIds
1376
1377
  } : {},
1377
- ...ue.value.feedmeAdminActors ? {
1378
+ ...re.value.feedmeAdminActors ? {
1378
1379
  feedmeAdminActors: !0
1379
1380
  } : {},
1380
- ...(e = Z.value) != null && e.length ? {
1381
- subjects: Z.value
1381
+ ...(e = Q.value) != null && e.length ? {
1382
+ subjects: Q.value
1382
1383
  } : {},
1383
- ...T.length ? {
1384
- subjectPrefixes: [...T]
1384
+ ...ie.length ? {
1385
+ subjectPrefixes: [...ie]
1385
1386
  } : {},
1386
1387
  ...pe.value.length ? {
1387
1388
  sources: [...pe.value]
1388
1389
  } : {},
1389
- ...q.value && ee.value.length ? {
1390
- restaurantIds: [...ee.value]
1390
+ ...q.value && Z.value.length ? {
1391
+ restaurantIds: [...Z.value]
1391
1392
  } : {},
1392
- ...(s = re.value) != null && s.length ? {
1393
- actions: re.value
1393
+ ...(s = ne.value) != null && s.length ? {
1394
+ actions: ne.value
1394
1395
  } : {},
1395
- ...(m = le.value) != null && m.length ? {
1396
- outcomes: He(le.value)
1396
+ ...(c = ae.value) != null && c.length ? {
1397
+ outcomes: We(ae.value)
1397
1398
  } : {},
1398
- ...te.value ? {
1399
- search: te.value
1399
+ ...ee.value ? {
1400
+ search: ee.value
1400
1401
  } : {},
1401
1402
  ...me.value.length ? {
1402
1403
  searchUserIds: me.value
@@ -1405,35 +1406,35 @@ const Os = {
1405
1406
  searchSubjects: ge.value
1406
1407
  } : {}
1407
1408
  }, Ie = [];
1408
- let Ne = 0;
1409
+ let p = 0;
1409
1410
  for (; ; ) {
1410
- const J = await Ce.read({
1411
+ const J = await Oe.read({
1411
1412
  ...tt,
1412
1413
  limit: rt,
1413
- offset: Ne
1414
+ offset: p
1414
1415
  });
1415
1416
  if (Ie.push(...J), J.length < rt) break;
1416
- Ne += rt;
1417
+ p += rt;
1417
1418
  }
1418
- const Ae = Qe.filter((J) => he.value.has(J.key)), h = Ae.map((J) => o(J.labelKey)), $ = Ie.map((J) => Ae.map((Uo) => Uo.getValue(J) ?? "")), ot = -(/* @__PURE__ */ new Date()).getTimezoneOffset(), Co = ot >= 0 ? "+" : "-", To = String(Math.floor(Math.abs(ot) / 60)).padStart(2, "0"), jo = String(Math.abs(ot) % 60).padStart(2, "0"), Po = `UTC${Co}${To}:${jo}`, At = c.name.value || "", Vo = [x, k].filter(Boolean).join(" – "), $o = [...[[o("auditLog.title")], [`${o("auditLog.frontMatter.date")}: ${Vo}`], ...At ? [[`${o("auditLog.frontMatter.business")}: ${At}`]] : [], [`${o("auditLog.frontMatter.generatedBy")}: ${P().format("DD MMM YYYY, HH:mm")} (${Po})`], []].map((J) => J.map(St).join(",")), ...[h, ...$].map((J) => J.map(St).join(","))].join(`
1419
- `), Eo = `audit-log_${(c.name.value || "business").replace(/[^a-z0-9_-]+/gi, "_")}_${P().format("YYYYMMDD_HHmmss")}.csv`, Ro = new Blob([`\uFEFF${$o}`], {
1419
+ const V = Ze.filter((J) => he.value.has(J.key)), Do = V.map((J) => o(J.labelKey)), Oo = Ie.map((J) => V.map((No) => No.getValue(J) ?? "")), ot = -(/* @__PURE__ */ new Date()).getTimezoneOffset(), Co = ot >= 0 ? "+" : "-", jo = String(Math.floor(Math.abs(ot) / 60)).padStart(2, "0"), To = String(Math.abs(ot) % 60).padStart(2, "0"), Po = `UTC${Co}${jo}:${To}`, At = ((L = r.currentBusiness.value) == null ? void 0 : L.name) || "", Vo = [C, R].filter(Boolean).join(" – "), $o = [...[[o("auditLog.title")], [`${o("auditLog.frontMatter.date")}: ${Vo}`], ...At ? [[`${o("auditLog.frontMatter.business")}: ${At}`]] : [], [`${o("auditLog.frontMatter.generatedBy")}: ${T().format("DD MMM YYYY, HH:mm")} (${Po})`], []].map((J) => J.map(St).join(",")), ...[Do, ...Oo].map((J) => J.map(St).join(","))].join(`
1420
+ `), Eo = `audit-log_${(((k = r.currentBusiness.value) == null ? void 0 : k.name) || "business").replace(/[^a-z0-9_-]+/gi, "_")}_${T().format("YYYYMMDD_HHmmss")}.csv`, Ro = new Blob([`\uFEFF${$o}`], {
1420
1421
  type: "text/csv;charset=utf-8;"
1421
- }), Ft = window.URL.createObjectURL(Ro), Fe = document.createElement("a");
1422
- Fe.href = Ft, Fe.download = Eo, document.body.appendChild(Fe), Fe.click(), Fe.remove(), window.URL.revokeObjectURL(Ft);
1422
+ }), Ft = window.URL.createObjectURL(Ro), Ae = document.createElement("a");
1423
+ Ae.href = Ft, Ae.download = Eo, document.body.appendChild(Ae), Ae.click(), Ae.remove(), window.URL.revokeObjectURL(Ft);
1423
1424
  } finally {
1424
- D.value = !1;
1425
+ S.value = !1;
1425
1426
  }
1426
1427
  }
1427
1428
  }
1428
- function oe(e) {
1429
+ function te(e) {
1429
1430
  return "status" in e;
1430
1431
  }
1431
- function bo(e) {
1432
- return Tt(e) ? y(ve.FmTooltip, {
1432
+ function ho(e) {
1433
+ return jt(e) ? h(ve.FmTooltip, {
1433
1434
  variant: "plain",
1434
1435
  placement: "top"
1435
1436
  }, {
1436
- default: () => y(ve.FmIcon, {
1437
+ default: () => h(ve.FmIcon, {
1437
1438
  name: "error",
1438
1439
  size: "sm",
1439
1440
  class: "cursor-help text-fm-color-typo-error"
@@ -1441,15 +1442,15 @@ const Os = {
1441
1442
  content: () => o("auditLog.operation.partialFailure")
1442
1443
  }) : null;
1443
1444
  }
1444
- function _o(e) {
1445
- var m;
1445
+ function yo(e) {
1446
+ var c;
1446
1447
  const s = e.original;
1447
- return e.depth === 0 && !oe(s) && !!((m = s.operations) != null && m.length);
1448
+ return e.depth === 0 && !te(s) && !!((c = s.operations) != null && c.length);
1448
1449
  }
1449
- function xo(e) {
1450
- return oe(e) ? void 0 : e.operations;
1450
+ function bo(e) {
1451
+ return te(e) ? void 0 : e.operations;
1451
1452
  }
1452
- const we = [{
1453
+ const Se = [{
1453
1454
  accessorKey: "timestamp",
1454
1455
  header: () => o("auditLog.columns.timestamp"),
1455
1456
  cell(e) {
@@ -1462,18 +1463,18 @@ const Os = {
1462
1463
  size: 220,
1463
1464
  cell(e) {
1464
1465
  const s = e.row.original;
1465
- return oe(s) ? null : y("div", {
1466
+ return te(s) ? null : h("div", {
1466
1467
  class: "flex items-center gap-8"
1467
- }, [y(ve.FmAvatar, {
1468
- name: Se(s),
1469
- initials: ss(Se(s)),
1468
+ }, [h(ve.FmAvatar, {
1469
+ name: ke(s),
1470
+ initials: os(ke(s)),
1470
1471
  size: "sm",
1471
1472
  class: "shrink-0"
1472
- }, null), y("div", {
1473
+ }, null), h("div", {
1473
1474
  class: "min-w-0"
1474
- }, [y("p", {
1475
+ }, [h("p", {
1475
1476
  class: "truncate font-semibold"
1476
- }, [Se(s)]), y("p", {
1477
+ }, [ke(s)]), h("p", {
1477
1478
  class: "truncate text-fm-color-typo-secondary"
1478
1479
  }, [yt(s)])])]);
1479
1480
  }
@@ -1482,9 +1483,9 @@ const Os = {
1482
1483
  header: () => o("auditLog.columns.subject"),
1483
1484
  cell(e) {
1484
1485
  const s = e.row.original;
1485
- return oe(s) ? y("span", {
1486
+ return te(s) ? h("span", {
1486
1487
  class: "text-fm-color-typo-secondary"
1487
- }, [o("auditLog.operation.rowHint")]) : We(s.subject) ?? s.subject;
1488
+ }, [o("auditLog.operation.rowHint")]) : Ge(s.subject) ?? s.subject;
1488
1489
  }
1489
1490
  }, {
1490
1491
  accessorKey: "action",
@@ -1495,41 +1496,41 @@ const Os = {
1495
1496
  cellSpanClass: "audit-log-action-label"
1496
1497
  },
1497
1498
  cell(e) {
1498
- var U;
1499
+ var R;
1499
1500
  const s = e.row.original;
1500
- if (oe(s))
1501
- return y("span", {
1501
+ if (te(s))
1502
+ return h("span", {
1502
1503
  class: "audit-op-marker flex flex-wrap items-baseline gap-4"
1503
- }, [y("span", {
1504
+ }, [h("span", {
1504
1505
  class: "text-fm-color-typo-secondary"
1505
- }, [ye("↳")]), y("span", {
1506
+ }, [ye("↳")]), h("span", {
1506
1507
  class: "font-semibold"
1507
- }, [Lt(s)]), s.entityId ? y("span", {
1508
+ }, [Lt(s)]), s.entityId ? h("span", {
1508
1509
  class: "text-fm-color-typo-secondary"
1509
- }, [ye("· "), s.entityId]) : null, s.status === "failed" && s.errorMessage ? y("span", {
1510
+ }, [ye("· "), s.entityId]) : null, s.status === "failed" && s.errorMessage ? h("span", {
1510
1511
  class: "text-fm-color-typo-error"
1511
1512
  }, [ye("· "), s.errorMessage]) : null]);
1512
- const m = ((U = s.operations) == null ? void 0 : U.length) ?? 0, x = (se) => {
1513
- se.stopPropagation(), e.row.getToggleExpandedHandler()();
1513
+ const c = ((R = s.operations) == null ? void 0 : R.length) ?? 0, L = (ie) => {
1514
+ ie.stopPropagation(), e.row.getToggleExpandedHandler()();
1514
1515
  }, k = {
1515
1516
  variant: "tertiary",
1516
1517
  icon: e.row.getIsExpanded() ? "keyboard_arrow_up" : "keyboard_arrow_down",
1517
1518
  "aria-label": o("auditLog.operation.toggle"),
1518
1519
  class: "ml-auto shrink-0",
1519
- onClick: x
1520
- }, T = ve.FmButton;
1521
- return y("span", {
1520
+ onClick: L
1521
+ }, C = ve.FmButton;
1522
+ return h("span", {
1522
1523
  class: "flex items-center gap-8"
1523
- }, [y("span", null, [xt(s)]), m > 0 ? y("span", {
1524
+ }, [h("span", null, [xt(s)]), c > 0 ? h("span", {
1524
1525
  class: "cursor-pointer",
1525
- onClick: x
1526
- }, [y(ve.FmChip, {
1526
+ onClick: L
1527
+ }, [h(ve.FmChip, {
1527
1528
  variant: "neutral",
1528
1529
  compact: !0,
1529
1530
  label: o("auditLog.operation.badge", {
1530
- count: m
1531
+ count: c
1531
1532
  })
1532
- }, null)]) : null, e.row.getCanExpand() ? y(T, k, null) : null]);
1533
+ }, null)]) : null, e.row.getCanExpand() ? h(C, k, null) : null]);
1533
1534
  }
1534
1535
  }, {
1535
1536
  accessorKey: "outcome",
@@ -1537,22 +1538,22 @@ const Os = {
1537
1538
  enableSorting: !1,
1538
1539
  cell(e) {
1539
1540
  const s = e.row.original;
1540
- return oe(s) ? y(ve.FmChip, {
1541
+ return te(s) ? h(ve.FmChip, {
1541
1542
  variant: s.status === "failed" ? "critical" : "success",
1542
1543
  label: s.status === "failed" ? o("auditLog.outcome.failed") : o("auditLog.outcome.success"),
1543
1544
  compact: !0
1544
- }, null) : y("span", {
1545
+ }, null) : h("span", {
1545
1546
  class: "flex items-center gap-4"
1546
- }, [y(ve.FmChip, {
1547
+ }, [h(ve.FmChip, {
1547
1548
  variant: kt(s.outcome),
1548
- label: Xe(s.outcome),
1549
+ label: Qe(s.outcome),
1549
1550
  compact: !0
1550
- }, null), bo(s)]);
1551
+ }, null), ho(s)]);
1551
1552
  }
1552
- }], Lo = [
1553
- we[0],
1553
+ }], _o = [
1554
+ Se[0],
1554
1555
  // timestamp: Date
1555
- we.find((e) => e.accessorKey === "userId"),
1556
+ Se.find((e) => e.accessorKey === "userId"),
1556
1557
  // User: getUserName -> posActorLabel for posUser rows
1557
1558
  {
1558
1559
  accessorKey: "restaurantId",
@@ -1560,7 +1561,7 @@ const Os = {
1560
1561
  enableSorting: !1,
1561
1562
  cell(e) {
1562
1563
  const s = e.row.original;
1563
- return oe(s) ? null : s.restaurantId && Gt.value[s.restaurantId] || s.restaurantId || "-";
1564
+ return te(s) ? null : s.restaurantId && Ht.value[s.restaurantId] || s.restaurantId || "-";
1564
1565
  }
1565
1566
  },
1566
1567
  {
@@ -1569,7 +1570,7 @@ const Os = {
1569
1570
  enableSorting: !1,
1570
1571
  cell(e) {
1571
1572
  const s = e.row.original;
1572
- return oe(s) ? null : lt(s, o);
1573
+ return te(s) ? null : lt(s, o);
1573
1574
  }
1574
1575
  },
1575
1576
  {
@@ -1578,60 +1579,60 @@ const Os = {
1578
1579
  enableSorting: !1,
1579
1580
  cell(e) {
1580
1581
  const s = e.row.original;
1581
- return oe(s) ? null : jt(s, o);
1582
+ return te(s) ? null : Tt(s, o);
1582
1583
  }
1583
1584
  },
1584
- we.find((e) => e.accessorKey === "action"),
1585
+ Se.find((e) => e.accessorKey === "action"),
1585
1586
  // Action Description: event line
1586
- we.find((e) => e.accessorKey === "outcome")
1587
+ Se.find((e) => e.accessorKey === "outcome")
1587
1588
  // Status
1588
- ], ko = A(() => q.value ? Lo : we);
1589
+ ], xo = A(() => q.value ? _o : Se);
1589
1590
  function de(e) {
1590
- const s = P(e, el);
1591
+ const s = T(e, Zn);
1591
1592
  return new Date(s.year(), s.month(), s.date(), s.hour(), s.minute(), 0).toISOString().slice(0, 19).replace("T", " ");
1592
1593
  }
1593
1594
  async function wt() {
1594
- var e, s, m;
1595
- w.value = !0;
1595
+ var e, s, c;
1596
+ g.value = !0;
1596
1597
  try {
1597
1598
  const {
1598
- startDate: x,
1599
+ startDate: L,
1599
1600
  endDate: k
1600
- } = ne.value, T = (Pe.value - 1) * Oe, U = $e.value.subjectPrefixes, se = await Ce.read({
1601
- limit: Oe,
1602
- offset: T,
1603
- ...x ? {
1604
- from: de(x)
1601
+ } = se.value, C = (Pe.value - 1) * De, R = $e.value.subjectPrefixes, ie = await Oe.read({
1602
+ limit: De,
1603
+ offset: C,
1604
+ ...L ? {
1605
+ from: de(L)
1605
1606
  } : {},
1606
1607
  ...k ? {
1607
1608
  to: de(k)
1608
1609
  } : {},
1609
- ...ue.value.userIds.length ? {
1610
- userIds: ue.value.userIds
1610
+ ...re.value.userIds.length ? {
1611
+ userIds: re.value.userIds
1611
1612
  } : {},
1612
- ...ue.value.feedmeAdminActors ? {
1613
+ ...re.value.feedmeAdminActors ? {
1613
1614
  feedmeAdminActors: !0
1614
1615
  } : {},
1615
- ...(e = Z.value) != null && e.length ? {
1616
- subjects: Z.value
1616
+ ...(e = Q.value) != null && e.length ? {
1617
+ subjects: Q.value
1617
1618
  } : {},
1618
- ...U.length ? {
1619
- subjectPrefixes: [...U]
1619
+ ...R.length ? {
1620
+ subjectPrefixes: [...R]
1620
1621
  } : {},
1621
1622
  ...pe.value.length ? {
1622
1623
  sources: [...pe.value]
1623
1624
  } : {},
1624
- ...q.value && ee.value.length ? {
1625
- restaurantIds: [...ee.value]
1625
+ ...q.value && Z.value.length ? {
1626
+ restaurantIds: [...Z.value]
1626
1627
  } : {},
1627
- ...(s = re.value) != null && s.length ? {
1628
- actions: re.value
1628
+ ...(s = ne.value) != null && s.length ? {
1629
+ actions: ne.value
1629
1630
  } : {},
1630
- ...(m = le.value) != null && m.length ? {
1631
- outcomes: He(le.value)
1631
+ ...(c = ae.value) != null && c.length ? {
1632
+ outcomes: We(ae.value)
1632
1633
  } : {},
1633
- ...te.value ? {
1634
- search: te.value
1634
+ ...ee.value ? {
1635
+ search: ee.value
1635
1636
  } : {},
1636
1637
  ...me.value.length ? {
1637
1638
  searchUserIds: me.value
@@ -1640,65 +1641,68 @@ const Os = {
1640
1641
  searchSubjects: ge.value
1641
1642
  } : {}
1642
1643
  });
1643
- O.value = se, Bt.value = se.length === Oe, L.value = {};
1644
+ O.value = ie, Bt.value = ie.length === De, $.value = {};
1644
1645
  } finally {
1645
- w.value = !1;
1646
+ g.value = !1;
1646
1647
  }
1647
1648
  }
1648
- const It = A(() => JSON.stringify({
1649
- businessId: c.id.value ?? "",
1650
- dateRange: ne.value,
1651
- users: [...fe.value ?? []].sort(),
1652
- subjects: [...Z.value ?? []].sort(),
1653
- outcomes: [...le.value ?? []].sort(),
1654
- actions: [...re.value ?? []].sort(),
1655
- moduleKey: ie.value,
1656
- restaurantIds: [...ee.value].sort(),
1657
- search: te.value,
1658
- // Member/feedme-admin-actor lists resolve asynchronously (and actors refetch on
1659
- // every date-range change), so searchUserIds can change after the key above is
1660
- // computed — include it explicitly or a late-arriving match never refetches.
1661
- searchUserIds: [...me.value].sort()
1662
- }));
1663
- async function So() {
1664
- var x, k, T;
1649
+ const It = A(() => {
1650
+ var e;
1651
+ return JSON.stringify({
1652
+ businessId: ((e = r.currentBusiness.value) == null ? void 0 : e._id) ?? "",
1653
+ dateRange: se.value,
1654
+ users: [...fe.value ?? []].sort(),
1655
+ subjects: [...Q.value ?? []].sort(),
1656
+ outcomes: [...ae.value ?? []].sort(),
1657
+ actions: [...ne.value ?? []].sort(),
1658
+ moduleKey: le.value,
1659
+ restaurantIds: [...Z.value].sort(),
1660
+ search: ee.value,
1661
+ // Member/feedme-admin-actor lists resolve asynchronously (and actors refetch on
1662
+ // every date-range change), so searchUserIds can change after the key above is
1663
+ // computed — include it explicitly or a late-arriving match never refetches.
1664
+ searchUserIds: [...me.value].sort()
1665
+ });
1666
+ });
1667
+ async function Lo() {
1668
+ var L, k, C;
1665
1669
  const {
1666
1670
  startDate: e,
1667
1671
  endDate: s
1668
- } = ne.value, m = $e.value.subjectPrefixes;
1669
- Be.value = await Ce.count({
1672
+ } = se.value, c = $e.value.subjectPrefixes;
1673
+ ze.value = await Oe.count({
1670
1674
  ...e ? {
1671
1675
  from: de(e)
1672
1676
  } : {},
1673
1677
  ...s ? {
1674
1678
  to: de(s)
1675
1679
  } : {},
1676
- ...ue.value.userIds.length ? {
1677
- userIds: ue.value.userIds
1680
+ ...re.value.userIds.length ? {
1681
+ userIds: re.value.userIds
1678
1682
  } : {},
1679
- ...ue.value.feedmeAdminActors ? {
1683
+ ...re.value.feedmeAdminActors ? {
1680
1684
  feedmeAdminActors: !0
1681
1685
  } : {},
1682
- ...(x = Z.value) != null && x.length ? {
1683
- subjects: Z.value
1686
+ ...(L = Q.value) != null && L.length ? {
1687
+ subjects: Q.value
1684
1688
  } : {},
1685
- ...m.length ? {
1686
- subjectPrefixes: [...m]
1689
+ ...c.length ? {
1690
+ subjectPrefixes: [...c]
1687
1691
  } : {},
1688
1692
  ...pe.value.length ? {
1689
1693
  sources: [...pe.value]
1690
1694
  } : {},
1691
- ...q.value && ee.value.length ? {
1692
- restaurantIds: [...ee.value]
1695
+ ...q.value && Z.value.length ? {
1696
+ restaurantIds: [...Z.value]
1693
1697
  } : {},
1694
- ...(k = re.value) != null && k.length ? {
1695
- actions: re.value
1698
+ ...(k = ne.value) != null && k.length ? {
1699
+ actions: ne.value
1696
1700
  } : {},
1697
- ...(T = le.value) != null && T.length ? {
1698
- outcomes: He(le.value)
1701
+ ...(C = ae.value) != null && C.length ? {
1702
+ outcomes: We(ae.value)
1699
1703
  } : {},
1700
- ...te.value ? {
1701
- search: te.value
1704
+ ...ee.value ? {
1705
+ search: ee.value
1702
1706
  } : {},
1703
1707
  ...me.value.length ? {
1704
1708
  searchUserIds: me.value
@@ -1708,64 +1712,67 @@ const Os = {
1708
1712
  } : {}
1709
1713
  });
1710
1714
  }
1711
- ae(It, async () => {
1712
- Pe.value = 1, c.id.value && await Promise.all([So(), wt()]);
1715
+ oe(It, async () => {
1716
+ var e;
1717
+ Pe.value = 1, (e = r.currentBusiness.value) != null && e._id && await Promise.all([Lo(), wt()]);
1713
1718
  }, {
1714
1719
  immediate: !0
1715
- }), ae(ie, () => {
1716
- Z.value = void 0, q.value && (fe.value = void 0);
1720
+ }), oe(le, () => {
1721
+ Q.value = void 0, q.value && (fe.value = void 0);
1717
1722
  });
1718
- let Ze = !1;
1719
- async function wo({
1723
+ let et = !1;
1724
+ async function ko({
1720
1725
  pageIndex: e
1721
1726
  }) {
1722
- if (c.id.value && !(e === 0 && Pe.value === 1) && !Ze) {
1723
- Ze = !0, Pe.value = e + 1;
1727
+ var s;
1728
+ if ((s = r.currentBusiness.value) != null && s._id && !(e === 0 && Pe.value === 1) && !et) {
1729
+ et = !0, Pe.value = e + 1;
1724
1730
  try {
1725
1731
  await wt();
1726
1732
  } finally {
1727
- Ze = !1;
1733
+ et = !1;
1728
1734
  }
1729
1735
  }
1730
1736
  }
1731
- function Io(e) {
1732
- if (oe(e)) {
1733
- Fo(e);
1737
+ function So(e) {
1738
+ if (te(e)) {
1739
+ Io(e);
1734
1740
  return;
1735
1741
  }
1736
- i.value = e, V.value = !0, Zt(e);
1742
+ i.value = e, P.value = !0, Xt(e);
1737
1743
  }
1738
- function Ao() {
1739
- V.value = !1, i.value = null, eo();
1744
+ function wo() {
1745
+ P.value = !1, i.value = null, Qt();
1740
1746
  }
1741
- function Fo(e) {
1742
- f.value = e, M.value = !0;
1747
+ function Io(e) {
1748
+ m.value = e, x.value = !0;
1743
1749
  }
1744
- function Mo() {
1745
- M.value = !1, f.value = null;
1750
+ function Ao() {
1751
+ x.value = !1, m.value = null;
1746
1752
  }
1747
- ae(c.id, (e) => {
1753
+ oe(r.currentBusiness, (e) => {
1748
1754
  e && d.readTeamMembers();
1749
1755
  }, {
1750
1756
  immediate: !0
1751
1757
  });
1752
- function Do() {
1758
+ function Fo() {
1753
1759
  const e = fe.value;
1754
1760
  if (!(e != null && e.length)) return;
1755
- const s = new Set(ke.value.map((k) => k.userId)), m = new Set(d.members.map((k) => k.doc.userId)), x = e.filter((k) => k === it ? Ee.value : d.hasLoaded ? m.has(k) || s.has(k) : !0);
1756
- x.length !== e.length && (fe.value = x.length ? x : void 0);
1761
+ const s = new Set(Le.value.map((k) => k.userId)), c = new Set(d.members.map((k) => k.doc.userId)), L = e.filter((k) => k === it ? Ee.value : d.hasLoaded ? c.has(k) || s.has(k) : !0);
1762
+ L.length !== e.length && (fe.value = L.length ? L : void 0);
1757
1763
  }
1758
- async function Oo() {
1759
- if (!c.id.value) return;
1764
+ async function Mo() {
1765
+ var c;
1766
+ if (!((c = r.currentBusiness.value) != null && c._id)) return;
1760
1767
  const {
1761
1768
  startDate: e,
1762
1769
  endDate: s
1763
- } = ne.value;
1770
+ } = se.value;
1764
1771
  try {
1765
1772
  const {
1766
- actors: m,
1767
- showFeedmeAdminFilter: x
1768
- } = await Ce.getFeedmeAdminFilter({
1773
+ actors: L,
1774
+ showFeedmeAdminFilter: k
1775
+ } = await Oe.getFeedmeAdminFilter({
1769
1776
  ...e ? {
1770
1777
  from: de(e)
1771
1778
  } : {},
@@ -1773,249 +1780,252 @@ const Os = {
1773
1780
  to: de(s)
1774
1781
  } : {}
1775
1782
  });
1776
- ke.value = m, Ee.value = x;
1783
+ Le.value = L, Ee.value = k;
1777
1784
  } catch {
1778
- ke.value = [], Ee.value = !1;
1785
+ Le.value = [], Ee.value = !1;
1779
1786
  }
1780
- Do();
1787
+ Fo();
1781
1788
  }
1782
- return ae(() => ({
1783
- businessId: c.id.value,
1784
- range: ne.value
1785
- }), () => Oo(), {
1789
+ return oe(() => {
1790
+ var e;
1791
+ return {
1792
+ businessId: (e = r.currentBusiness.value) == null ? void 0 : e._id,
1793
+ range: se.value
1794
+ };
1795
+ }, () => Mo(), {
1786
1796
  immediate: !0,
1787
1797
  deep: !0
1788
1798
  }), (e, s) => {
1789
- const m = R("FmSpacer"), x = R("FmButton"), k = R("FmMenuItem"), T = R("FmMenu"), U = R("FmChip"), se = R("FmDateRangePicker"), et = R("FmSearch"), tt = R("FmTable"), Ie = R("FmIcon"), Ne = R("FmTooltip"), Ae = R("FmSideSheet");
1790
- return v(), g(z, null, [y(Qo, {
1799
+ const c = N("FmSpacer"), L = N("FmButton"), k = N("FmMenuItem"), C = N("FmMenu"), R = N("FmChip"), ie = N("FmDateRangePicker"), Ue = N("FmSearch"), we = N("FmTable"), Ke = N("FmIcon"), tt = N("FmTooltip"), Ie = N("FmSideSheet");
1800
+ return f(), v(z, null, [h(Qo, {
1791
1801
  heading: u(o)("auditLog.title")
1792
1802
  }, {
1793
- "append-heading": B(() => [y(m), y(x, {
1803
+ "append-heading": Y(() => [h(c), h(L, {
1794
1804
  variant: "primary",
1795
1805
  "prepend-icon": "upload",
1796
1806
  label: u(o)("auditLog.export"),
1797
- disabled: O.value.length === 0 || D.value || u(d).isLoading || u(d).members.length === 0,
1798
- loading: D.value,
1799
- onClick: yo
1800
- }, null, 8, ["label", "disabled", "loading"]), y(T, {
1807
+ disabled: O.value.length === 0 || S.value || u(d).isLoading || u(d).members.length === 0,
1808
+ loading: S.value,
1809
+ onClick: go
1810
+ }, null, 8, ["label", "disabled", "loading"]), h(C, {
1801
1811
  "close-on-click": !1,
1802
1812
  "z-index": 50
1803
1813
  }, {
1804
- "menu-button": B(() => [y(x, {
1814
+ "menu-button": Y(() => [h(L, {
1805
1815
  variant: "tertiary",
1806
1816
  icon: "settings",
1807
1817
  "aria-label": u(o)("auditLog.exportSettings.title"),
1808
- disabled: D.value
1818
+ disabled: S.value
1809
1819
  }, null, 8, ["aria-label", "disabled"])]),
1810
- default: B(() => [a("div", Os, [a("p", Cs, l(u(o)("auditLog.exportSettings.title")), 1), (v(), g(z, null, ce(Qe, (h) => y(k, {
1811
- key: h.key,
1812
- label: u(o)(h.labelKey),
1820
+ default: Y(() => [a("div", Ds, [a("p", Os, l(u(o)("auditLog.exportSettings.title")), 1), (f(), v(z, null, ce(Ze, (p) => h(k, {
1821
+ key: p.key,
1822
+ label: u(o)(p.labelKey),
1813
1823
  "has-checkbox": "",
1814
- "model-value": he.value.has(h.key),
1815
- disabled: he.value.has(h.key) && he.value.size === 1,
1816
- onClick: ($) => ho(h.key)
1824
+ "model-value": he.value.has(p.key),
1825
+ disabled: he.value.has(p.key) && he.value.size === 1,
1826
+ onClick: (V) => po(p.key)
1817
1827
  }, null, 8, ["label", "model-value", "disabled", "onClick"])), 64))])]),
1818
1828
  _: 1
1819
1829
  })]),
1820
- default: B(() => [a("div", Ts, [a("div", js, [y(fs, {
1821
- modelValue: ie.value,
1822
- "onUpdate:modelValue": s[0] || (s[0] = (h) => ie.value = h),
1823
- items: Jt.value
1824
- }, null, 8, ["modelValue", "items"]), a("div", Ps, [y(se, {
1825
- modelValue: ne.value,
1826
- "onUpdate:modelValue": s[1] || (s[1] = (h) => ne.value = h),
1830
+ default: Y(() => [a("div", Cs, [a("div", js, [h(cs, {
1831
+ modelValue: le.value,
1832
+ "onUpdate:modelValue": s[0] || (s[0] = (p) => le.value = p),
1833
+ items: zt.value
1834
+ }, null, 8, ["modelValue", "items"]), a("div", Ts, [h(ie, {
1835
+ modelValue: se.value,
1836
+ "onUpdate:modelValue": s[1] || (s[1] = (p) => se.value = p),
1827
1837
  "show-predefined-range": "",
1828
1838
  "show-time": "",
1829
- "predefined-range": co.value
1839
+ "predefined-range": io.value
1830
1840
  }, {
1831
- "trigger-button": B(() => [y(U, {
1832
- label: uo.value,
1841
+ "trigger-button": Y(() => [h(R, {
1842
+ label: ro.value,
1833
1843
  icon: "calendar_month"
1834
1844
  }, null, 8, ["label"])]),
1835
1845
  _: 1
1836
- }, 8, ["modelValue", "predefined-range"]), q.value ? F("", !0) : (v(), g("div", Vs, [y(Me, {
1846
+ }, 8, ["modelValue", "predefined-range"]), q.value ? M("", !0) : (f(), v("div", Ps, [h(Fe, {
1837
1847
  modelValue: fe.value,
1838
- "onUpdate:modelValue": s[2] || (s[2] = (h) => fe.value = h),
1839
- items: Xt.value,
1848
+ "onUpdate:modelValue": s[2] || (s[2] = (p) => fe.value = p),
1849
+ items: Wt.value,
1840
1850
  multiple: "",
1841
1851
  variant: "dark",
1842
1852
  placeholder: u(o)("auditLog.filter.user_placeholder"),
1843
1853
  "selected-prefix": u(o)("auditLog.filter.selected_user_prefix"),
1844
1854
  "chip-icon": "account_circle"
1845
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])), q.value ? F("", !0) : (v(), g("div", $s, [y(Me, {
1846
- modelValue: Z.value,
1847
- "onUpdate:modelValue": s[3] || (s[3] = (h) => Z.value = h),
1848
- items: oo.value,
1849
- "filter-fn": so,
1855
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])), q.value ? M("", !0) : (f(), v("div", Vs, [h(Fe, {
1856
+ modelValue: Q.value,
1857
+ "onUpdate:modelValue": s[3] || (s[3] = (p) => Q.value = p),
1858
+ items: eo.value,
1859
+ "filter-fn": to,
1850
1860
  multiple: "",
1851
1861
  variant: "dark",
1852
1862
  placeholder: u(o)("auditLog.filter.subject_placeholder"),
1853
1863
  "selected-prefix": u(o)("auditLog.filter.selected_subject_prefix"),
1854
1864
  "chip-icon": "badge"
1855
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])), a("div", Es, [y(Me, {
1856
- modelValue: re.value,
1857
- "onUpdate:modelValue": s[4] || (s[4] = (h) => re.value = h),
1858
- items: ao.value,
1865
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])), a("div", $s, [h(Fe, {
1866
+ modelValue: ne.value,
1867
+ "onUpdate:modelValue": s[4] || (s[4] = (p) => ne.value = p),
1868
+ items: oo.value,
1859
1869
  multiple: "",
1860
1870
  variant: "dark",
1861
1871
  placeholder: u(o)("auditLog.filter.action_placeholder"),
1862
1872
  "selected-prefix": u(o)("auditLog.filter.selected_action_prefix"),
1863
1873
  searchable: !1
1864
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), a("div", Rs, [y(Me, {
1865
- modelValue: le.value,
1866
- "onUpdate:modelValue": s[5] || (s[5] = (h) => le.value = h),
1867
- items: no.value,
1874
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), a("div", Es, [h(Fe, {
1875
+ modelValue: ae.value,
1876
+ "onUpdate:modelValue": s[5] || (s[5] = (p) => ae.value = p),
1877
+ items: so.value,
1868
1878
  multiple: "",
1869
1879
  variant: "dark",
1870
1880
  placeholder: u(o)("auditLog.filter.status_placeholder"),
1871
1881
  "selected-prefix": u(o)("auditLog.filter.selected_status_prefix"),
1872
1882
  searchable: !1,
1873
1883
  "chip-icon": "check_circle"
1874
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), q.value ? (v(), g("div", Us, [y(Me, {
1875
- modelValue: ee.value,
1876
- "onUpdate:modelValue": s[6] || (s[6] = (h) => ee.value = h),
1877
- items: Wt.value,
1884
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), q.value ? (f(), v("div", Rs, [h(Fe, {
1885
+ modelValue: Z.value,
1886
+ "onUpdate:modelValue": s[6] || (s[6] = (p) => Z.value = p),
1887
+ items: Jt.value,
1878
1888
  multiple: "",
1879
1889
  variant: "dark",
1880
1890
  placeholder: u(o)("auditLog.filter.restaurant_placeholder"),
1881
1891
  "selected-prefix": u(o)("auditLog.filter.selected_restaurant_prefix"),
1882
1892
  "chip-icon": "storefront"
1883
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])) : F("", !0), y(et, {
1884
- modelValue: ze.value,
1885
- "onUpdate:modelValue": s[7] || (s[7] = (h) => ze.value = h),
1893
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])) : M("", !0), h(Ue, {
1894
+ modelValue: qe.value,
1895
+ "onUpdate:modelValue": s[7] || (s[7] = (p) => qe.value = p),
1886
1896
  class: "ml-auto w-[280px]",
1887
1897
  placeholder: u(o)("auditLog.search.placeholder")
1888
- }, null, 8, ["modelValue", "placeholder"])])]), y(Go, null, {
1889
- default: B(() => [a("div", Ns, [y(Zo, {
1890
- "is-loading": w.value,
1898
+ }, null, 8, ["modelValue", "placeholder"])])]), h(Wo, null, {
1899
+ default: Y(() => [a("div", Ns, [h(Zo, {
1900
+ "is-loading": g.value,
1891
1901
  "is-empty": O.value.length === 0,
1892
1902
  title: u(o)("auditLog.noData.title"),
1893
1903
  subtitle: u(o)("auditLog.noData.subtitle")
1894
1904
  }, {
1895
- default: B(() => [(v(), Te(tt, {
1905
+ default: Y(() => [(f(), Ce(we, {
1896
1906
  key: It.value,
1897
- "column-defs": ko.value,
1907
+ "column-defs": xo.value,
1898
1908
  "row-data": O.value,
1899
- "page-size": Oe,
1909
+ "page-size": De,
1900
1910
  "page-count": mt.value,
1901
- "row-count": Be.value,
1902
- "fetch-fn": wo,
1911
+ "row-count": ze.value,
1912
+ "fetch-fn": ko,
1903
1913
  "hide-footer": mt.value <= 1,
1904
- loading: w.value,
1905
- "expanded-state": L.value,
1906
- "get-row-can-expand": _o,
1907
- "get-sub-row": xo,
1914
+ loading: g.value,
1915
+ "expanded-state": $.value,
1916
+ "get-row-can-expand": yo,
1917
+ "get-sub-row": bo,
1908
1918
  "pin-header-row": "",
1909
1919
  class: "audit-log-list-table cursor-pointer",
1910
- "onUpdate:expandedState": s[8] || (s[8] = (h) => L.value = h),
1911
- onRowClick: s[9] || (s[9] = (h) => Io(h.original))
1920
+ "onUpdate:expandedState": s[8] || (s[8] = (p) => $.value = p),
1921
+ onRowClick: s[9] || (s[9] = (p) => So(p.original))
1912
1922
  }, null, 8, ["column-defs", "row-data", "page-count", "row-count", "hide-footer", "loading", "expanded-state"]))]),
1913
1923
  _: 1
1914
1924
  }, 8, ["is-loading", "is-empty", "title", "subtitle"])])]),
1915
1925
  _: 1
1916
1926
  })])]),
1917
1927
  _: 1
1918
- }, 8, ["heading"]), y(Ae, {
1928
+ }, 8, ["heading"]), h(Ie, {
1919
1929
  header: u(o)("auditLog.detail.header"),
1920
- "model-value": V.value,
1930
+ "model-value": P.value,
1921
1931
  "max-width": 768,
1922
1932
  "dismiss-away": "",
1923
- "onUpdate:modelValue": s[10] || (s[10] = (h) => {
1924
- h || Ao();
1933
+ "onUpdate:modelValue": s[10] || (s[10] = (p) => {
1934
+ p || wo();
1925
1935
  })
1926
1936
  }, {
1927
- default: B(() => [i.value ? (v(), g("div", Ks, [a("div", Ys, [a("div", Bs, [a("p", zs, l(mo(i.value)), 1), i.value.traceId ? (v(), g("p", qs, [ye(" Trace ID: " + l(i.value.traceId) + " ", 1), y(x, {
1937
+ default: Y(() => [i.value ? (f(), v("div", Us, [a("div", Ks, [a("div", Bs, [a("p", Ys, l(co(i.value)), 1), i.value.traceId ? (f(), v("p", zs, [ye(" Trace ID: " + l(i.value.traceId) + " ", 1), h(L, {
1928
1938
  variant: "tertiary",
1929
1939
  icon: "link",
1930
1940
  class: "ml-4 align-middle",
1931
1941
  "aria-label": u(o)("auditLog.detail.copyLink"),
1932
- onClick: u(to)
1933
- }, null, 8, ["aria-label", "onClick"])])) : F("", !0), i.value.eventId ? (v(), g("p", Js, " Event ID: " + l(i.value.eventId), 1)) : F("", !0)]), a("div", Hs, [y(U, {
1942
+ onClick: u(Zt)
1943
+ }, null, 8, ["aria-label", "onClick"])])) : M("", !0), i.value.eventId ? (f(), v("p", qs, " Event ID: " + l(i.value.eventId), 1)) : M("", !0)]), a("div", Js, [h(R, {
1934
1944
  variant: kt(i.value.outcome),
1935
- label: Xe(i.value.outcome),
1945
+ label: Qe(i.value.outcome),
1936
1946
  compact: ""
1937
- }, null, 8, ["variant", "label"]), u(Tt)(i.value) ? (v(), Te(Ne, {
1947
+ }, null, 8, ["variant", "label"]), u(jt)(i.value) ? (f(), Ce(tt, {
1938
1948
  key: 0,
1939
1949
  variant: "plain",
1940
1950
  placement: "top"
1941
1951
  }, {
1942
- content: B(() => [ye(l(u(o)("auditLog.operation.partialFailure")), 1)]),
1943
- default: B(() => [y(Ie, {
1952
+ content: Y(() => [ye(l(u(o)("auditLog.operation.partialFailure")), 1)]),
1953
+ default: Y(() => [h(Ke, {
1944
1954
  name: "error",
1945
1955
  size: "sm",
1946
1956
  class: "cursor-help text-fm-color-typo-error"
1947
1957
  })]),
1948
1958
  _: 1
1949
- })) : F("", !0)])]), a("div", Ws, [a("div", Gs, [a("div", null, [a("p", Xs, l(u(o)("auditLog.detail.date")), 1), a("p", Qs, l(Ge(i.value.timestamp)), 1)]), a("div", null, [a("p", Zs, l(u(o)("auditLog.detail.user")), 1), a("p", ea, l(Se(i.value)), 1)]), a("div", null, [a("p", ta, l(u(o)("auditLog.detail.email")), 1), a("p", oa, l(fo(i.value)), 1)]), i.value.field ? (v(), g("div", sa, [a("p", aa, l(u(o)("auditLog.detail.field")), 1), a("p", na, l(i.value.field), 1)])) : F("", !0), a("div", null, [a("p", la, l(u(o)("auditLog.detail.business")), 1), a("p", ra, l(i.value.businessId || "-"), 1)]), a("div", null, [a("p", ia, l(u(o)("auditLog.detail.restaurant")), 1), a("p", ua, l(i.value.restaurantId || "-"), 1)])])]), a("div", da, [a("div", ca, [a("p", fa, l(u(o)("auditLog.detail.eventDetails")), 1)]), s[13] || (s[13] = a("hr", {
1959
+ })) : M("", !0)])]), a("div", Hs, [a("div", Ws, [a("div", null, [a("p", Gs, l(u(o)("auditLog.detail.date")), 1), a("p", Xs, l(Xe(i.value.timestamp)), 1)]), a("div", null, [a("p", Qs, l(u(o)("auditLog.detail.user")), 1), a("p", Zs, l(ke(i.value)), 1)]), a("div", null, [a("p", ea, l(u(o)("auditLog.detail.email")), 1), a("p", ta, l(uo(i.value)), 1)]), i.value.field ? (f(), v("div", oa, [a("p", sa, l(u(o)("auditLog.detail.field")), 1), a("p", aa, l(i.value.field), 1)])) : M("", !0), a("div", null, [a("p", na, l(u(o)("auditLog.detail.business")), 1), a("p", la, l(i.value.businessId || "-"), 1)]), a("div", null, [a("p", ra, l(u(o)("auditLog.detail.restaurant")), 1), a("p", ia, l(i.value.restaurantId || "-"), 1)])])]), a("div", ua, [a("div", da, [a("p", ca, l(u(o)("auditLog.detail.eventDetails")), 1)]), s[13] || (s[13] = a("hr", {
1950
1960
  class: "border-fm-color-border-default"
1951
- }, null, -1)), a("div", ma, [a("div", null, [a("p", va, l(u(o)("auditLog.detail.actionDescription")), 1), a("p", pa, l(i.value.metadata.operationLabel || "-"), 1)])])]), a("div", ga, [a("div", ha, [a("p", ya, l(u(o)("auditLog.detail.metadata")), 1)]), s[14] || (s[14] = a("hr", {
1961
+ }, null, -1)), a("div", fa, [a("div", null, [a("p", ma, l(u(o)("auditLog.detail.actionDescription")), 1), a("p", va, l(i.value.metadata.operationLabel || "-"), 1)])])]), a("div", pa, [a("div", ga, [a("p", ha, l(u(o)("auditLog.detail.metadata")), 1)]), s[14] || (s[14] = a("hr", {
1952
1962
  class: "border-fm-color-border-default"
1953
- }, null, -1)), a("div", ba, [a("div", null, [a("p", _a, l(u(o)("auditLog.detail.resolvedFrom")), 1), a("p", xa, l(vo(i.value.metadata.resolvedFrom)), 1)]), (i.value.metadata.resolvedFrom === "permissionSet" || i.value.metadata.resolvedFrom === "systemPermissionSet") && (i.value.metadata.permissionSetName || i.value.metadata.permissionSetId) ? (v(), g("div", La, [a("p", ka, l(u(o)("auditLog.detail.permissionSet")), 1), i.value.metadata.permissionSetName ? (v(), g("p", Sa, l(i.value.metadata.permissionSetName), 1)) : F("", !0), i.value.metadata.permissionSetId ? (v(), g("p", wa, l(i.value.metadata.permissionSetId), 1)) : F("", !0)])) : F("", !0), i.value.metadata.reason ? (v(), g("div", Ia, [a("p", Aa, l(u(o)("auditLog.detail.reason")), 1), a("p", Fa, l(i.value.metadata.reason), 1)])) : F("", !0), a("div", null, [a("p", Ma, l(u(o)("auditLog.detail.requestMethod")), 1), a("p", Da, l(po(i.value)), 1)]), a("div", null, [a("p", Oa, l(u(o)("auditLog.detail.requestPath")), 1), a("p", Ca, l(i.value.metadata.requestPath || "-"), 1)]), i.value.metadata.pos ? (v(), g(z, {
1963
+ }, null, -1)), a("div", ya, [a("div", null, [a("p", ba, l(u(o)("auditLog.detail.resolvedFrom")), 1), a("p", _a, l(fo(i.value.metadata.resolvedFrom)), 1)]), (i.value.metadata.resolvedFrom === "permissionSet" || i.value.metadata.resolvedFrom === "systemPermissionSet") && (i.value.metadata.permissionSetName || i.value.metadata.permissionSetId) ? (f(), v("div", xa, [a("p", La, l(u(o)("auditLog.detail.permissionSet")), 1), i.value.metadata.permissionSetName ? (f(), v("p", ka, l(i.value.metadata.permissionSetName), 1)) : M("", !0), i.value.metadata.permissionSetId ? (f(), v("p", Sa, l(i.value.metadata.permissionSetId), 1)) : M("", !0)])) : M("", !0), i.value.metadata.reason ? (f(), v("div", wa, [a("p", Ia, l(u(o)("auditLog.detail.reason")), 1), a("p", Aa, l(i.value.metadata.reason), 1)])) : M("", !0), a("div", null, [a("p", Fa, l(u(o)("auditLog.detail.requestMethod")), 1), a("p", Ma, l(mo(i.value)), 1)]), a("div", null, [a("p", Da, l(u(o)("auditLog.detail.requestPath")), 1), a("p", Oa, l(i.value.metadata.requestPath || "-"), 1)]), i.value.metadata.pos ? (f(), v(z, {
1954
1964
  key: 2
1955
- }, [a("div", null, [a("p", Ta, l(u(o)("auditLog.pos.details.eventKey")), 1), a("p", ja, l(i.value.eventKey || "-"), 1)]), a("div", null, [a("p", Pa, l(u(o)("auditLog.columns.device")), 1), a("p", Va, l(u(lt)(i.value, u(o))), 1), i.value.metadata.pos.machineId ? (v(), g("p", $a, l(i.value.metadata.pos.machineId), 1)) : F("", !0)]), i.value.metadata.pos.appVersion ? (v(), g("div", Ea, [a("p", Ra, l(u(o)("auditLog.pos.details.appVersion")), 1), a("p", Ua, l(i.value.metadata.pos.appVersion), 1)])) : F("", !0), a("div", null, [a("p", Na, l(u(o)("auditLog.columns.approver")), 1), a("p", Ka, l(u(jt)(i.value, u(o))), 1)]), a("div", null, [a("p", Ya, l(u(o)("auditLog.pos.details.clock")), 1), a("p", Ba, [ye(l(Ge(new Date(i.value.metadata.pos.occurredAt))) + " · " + l(i.value.metadata.pos.clockSkewMs) + " ms", 1), i.value.metadata.pos.clockClamped ? (v(), g("span", za, " · " + l(u(o)("auditLog.pos.details.clamped")), 1)) : F("", !0)])]), i.value.params ? (v(), g("div", qa, [a("p", Ja, l(u(o)("auditLog.pos.details.params")), 1), a("pre", Ha, l(i.value.params), 1)])) : F("", !0)], 64)) : F("", !0), i.value.metadata.trace && i.value.metadata.trace.length > 0 ? (v(), g("div", Wa, [a("p", Ga, l(u(o)("auditLog.detail.permissionTrace")), 1), a("ol", Xa, [(v(!0), g(z, null, ce(i.value.metadata.trace, (h, $) => (v(), g("li", {
1956
- key: $,
1965
+ }, [a("div", null, [a("p", Ca, l(u(o)("auditLog.pos.details.eventKey")), 1), a("p", ja, l(i.value.eventKey || "-"), 1)]), a("div", null, [a("p", Ta, l(u(o)("auditLog.columns.device")), 1), a("p", Pa, l(u(lt)(i.value, u(o))), 1), i.value.metadata.pos.machineId ? (f(), v("p", Va, l(i.value.metadata.pos.machineId), 1)) : M("", !0)]), i.value.metadata.pos.appVersion ? (f(), v("div", $a, [a("p", Ea, l(u(o)("auditLog.pos.details.appVersion")), 1), a("p", Ra, l(i.value.metadata.pos.appVersion), 1)])) : M("", !0), a("div", null, [a("p", Na, l(u(o)("auditLog.columns.approver")), 1), a("p", Ua, l(u(Tt)(i.value, u(o))), 1)]), a("div", null, [a("p", Ka, l(u(o)("auditLog.pos.details.clock")), 1), a("p", Ba, [ye(l(Xe(new Date(i.value.metadata.pos.occurredAt))) + " · " + l(i.value.metadata.pos.clockSkewMs) + " ms", 1), i.value.metadata.pos.clockClamped ? (f(), v("span", Ya, " · " + l(u(o)("auditLog.pos.details.clamped")), 1)) : M("", !0)])]), i.value.params ? (f(), v("div", za, [a("p", qa, l(u(o)("auditLog.pos.details.params")), 1), a("pre", Ja, l(i.value.params), 1)])) : M("", !0)], 64)) : M("", !0), i.value.metadata.trace && i.value.metadata.trace.length > 0 ? (f(), v("div", Ha, [a("p", Wa, l(u(o)("auditLog.detail.permissionTrace")), 1), a("ol", Ga, [(f(!0), v(z, null, ce(i.value.metadata.trace, (p, V) => (f(), v("li", {
1966
+ key: V,
1957
1967
  class: "flex items-center gap-6"
1958
- }, [a("span", Qa, l($ + 1), 1), a("span", Za, l(h), 1), $ < i.value.metadata.trace.length - 1 ? (v(), g("span", en, "→")) : F("", !0)]))), 128))])])) : F("", !0), p.value ? (v(), g("div", tn, [a("p", on, l(u(o)("auditLog.detail.requestBody")), 1), a("pre", sn, l(p.value), 1)])) : F("", !0)])])])) : F("", !0)]),
1968
+ }, [a("span", Xa, l(V + 1), 1), a("span", Qa, l(p), 1), V < i.value.metadata.trace.length - 1 ? (f(), v("span", Za, "→")) : M("", !0)]))), 128))])])) : M("", !0), F.value ? (f(), v("div", en, [a("p", tn, l(u(o)("auditLog.detail.requestBody")), 1), a("pre", on, l(F.value), 1)])) : M("", !0)])])])) : M("", !0)]),
1959
1969
  _: 1
1960
- }, 8, ["header", "model-value"]), y(Ae, {
1970
+ }, 8, ["header", "model-value"]), h(Ie, {
1961
1971
  header: u(o)("auditLog.operation.sheetHeader"),
1962
- "model-value": M.value,
1972
+ "model-value": x.value,
1963
1973
  "max-width": 768,
1964
1974
  "dismiss-away": "",
1965
- "onUpdate:modelValue": s[12] || (s[12] = (h) => {
1966
- h || Mo();
1975
+ "onUpdate:modelValue": s[12] || (s[12] = (p) => {
1976
+ p || Ao();
1967
1977
  })
1968
1978
  }, {
1969
- default: B(() => [f.value ? (v(), g("div", an, [a("div", nn, [a("div", ln, [a("p", rn, l(Lt(f.value)), 1), f.value.entityId ? (v(), g("p", un, l(f.value.entityId), 1)) : F("", !0)]), y(U, {
1970
- variant: f.value.status === "failed" ? "critical" : "success",
1971
- label: f.value.status === "failed" ? u(o)("auditLog.outcome.failed") : u(o)("auditLog.outcome.success"),
1979
+ default: Y(() => [m.value ? (f(), v("div", sn, [a("div", an, [a("div", nn, [a("p", ln, l(Lt(m.value)), 1), m.value.entityId ? (f(), v("p", rn, l(m.value.entityId), 1)) : M("", !0)]), h(R, {
1980
+ variant: m.value.status === "failed" ? "critical" : "success",
1981
+ label: m.value.status === "failed" ? u(o)("auditLog.outcome.failed") : u(o)("auditLog.outcome.success"),
1972
1982
  compact: ""
1973
- }, null, 8, ["variant", "label"])]), a("div", dn, [a("div", cn, [a("div", null, [a("p", fn, l(u(o)("auditLog.detail.date")), 1), a("p", mn, l(Ge(f.value.timestamp)), 1)]), f.value.entityId ? (v(), g("div", vn, [a("p", pn, l(u(o)("auditLog.operation.entity")), 1), a("p", gn, l(f.value.entityId), 1)])) : F("", !0), f.value.durationMs !== void 0 ? (v(), g("div", hn, [a("p", yn, l(u(o)("auditLog.operation.duration")), 1), a("p", bn, l(u(o)("auditLog.operation.durationValue", {
1974
- ms: f.value.durationMs
1975
- })), 1)])) : F("", !0)])]), f.value.status === "failed" ? (v(), g("div", _n, [a("p", xn, l(u(o)("auditLog.operation.error")), 1), a("p", Ln, l(f.value.errorMessage || "-"), 1)])) : F("", !0), a("div", kn, [a("div", Sn, [a("p", wn, l(u(o)("auditLog.operation.changes")), 1)]), s[17] || (s[17] = a("hr", {
1983
+ }, null, 8, ["variant", "label"])]), a("div", un, [a("div", dn, [a("div", null, [a("p", cn, l(u(o)("auditLog.detail.date")), 1), a("p", fn, l(Xe(m.value.timestamp)), 1)]), m.value.entityId ? (f(), v("div", mn, [a("p", vn, l(u(o)("auditLog.operation.entity")), 1), a("p", pn, l(m.value.entityId), 1)])) : M("", !0), m.value.durationMs !== void 0 ? (f(), v("div", gn, [a("p", hn, l(u(o)("auditLog.operation.duration")), 1), a("p", yn, l(u(o)("auditLog.operation.durationValue", {
1984
+ ms: m.value.durationMs
1985
+ })), 1)])) : M("", !0)])]), m.value.status === "failed" ? (f(), v("div", bn, [a("p", _n, l(u(o)("auditLog.operation.error")), 1), a("p", xn, l(m.value.errorMessage || "-"), 1)])) : M("", !0), a("div", Ln, [a("div", kn, [a("p", Sn, l(u(o)("auditLog.operation.changes")), 1)]), s[17] || (s[17] = a("hr", {
1976
1986
  class: "border-fm-color-border-default"
1977
- }, null, -1)), a("div", In, [Y.value.length ? (v(), g("div", An, [(v(!0), g(z, null, ce(Y.value, (h, $) => (v(), g("div", {
1978
- key: $,
1987
+ }, null, -1)), a("div", wn, [H.value.length ? (f(), v("div", In, [(f(!0), v(z, null, ce(H.value, (p, V) => (f(), v("div", {
1988
+ key: V,
1979
1989
  class: "space-y-4 py-8 first:pt-0 last:pb-0"
1980
- }, [a("div", Fn, [y(U, {
1981
- variant: Nt(h.type),
1982
- label: Kt(h.type),
1990
+ }, [a("div", An, [h(R, {
1991
+ variant: xe(p.type),
1992
+ label: Ut(p.type),
1983
1993
  compact: ""
1984
- }, null, 8, ["variant", "label"]), a("span", Mn, l(Yt(h)), 1)]), a("p", Dn, [h.type === "add" ? (v(), g("span", On, l(h.afterDisplay), 1)) : h.type === "remove" ? (v(), g("span", Cn, l(h.beforeDisplay), 1)) : (v(), g(z, {
1994
+ }, null, 8, ["variant", "label"]), a("span", Fn, l(Kt(p)), 1)]), a("p", Mn, [p.type === "add" ? (f(), v("span", Dn, l(p.afterDisplay), 1)) : p.type === "remove" ? (f(), v("span", On, l(p.beforeDisplay), 1)) : (f(), v(z, {
1985
1995
  key: 2
1986
- }, [a("span", Tn, l(h.beforeDisplay), 1), s[15] || (s[15] = a("span", {
1996
+ }, [a("span", Cn, l(p.beforeDisplay), 1), s[15] || (s[15] = a("span", {
1987
1997
  class: "text-fm-color-typo-secondary"
1988
- }, " → ", -1)), a("span", jn, l(h.afterDisplay), 1)], 64))])]))), 128))])) : ft.value.length ? (v(), g("div", Pn, [(v(!0), g(z, null, ce(ft.value, (h) => (v(), g("div", {
1989
- key: h.groupKey,
1998
+ }, " → ", -1)), a("span", jn, l(p.afterDisplay), 1)], 64))])]))), 128))])) : ft.value.length ? (f(), v("div", Tn, [(f(!0), v(z, null, ce(ft.value, (p) => (f(), v("div", {
1999
+ key: p.groupKey,
1990
2000
  class: "space-y-4 py-8 first:pt-0 last:pb-0"
1991
- }, [a("div", Vn, [y(U, {
1992
- variant: ct(h.type),
1993
- label: W(h.type),
2001
+ }, [a("div", Pn, [h(R, {
2002
+ variant: Te(p.type),
2003
+ label: ct(p.type),
1994
2004
  compact: ""
1995
- }, null, 8, ["variant", "label"]), a("span", $n, l(h.displayKey), 1)]), a("div", En, [(v(!0), g(z, null, ce(h.rows, ($) => (v(), g("p", {
1996
- key: $.path,
2005
+ }, null, 8, ["variant", "label"]), a("span", Vn, l(p.displayKey), 1)]), a("div", $n, [(f(!0), v(z, null, ce(p.rows, (V) => (f(), v("p", {
2006
+ key: V.path,
1997
2007
  class: "break-all font-mono text-xs"
1998
- }, [$.type === "added" ? (v(), g("span", Rn, l($.after ?? "—"), 1)) : $.type === "removed" ? (v(), g("span", Un, l($.before ?? "—"), 1)) : (v(), g(z, {
2008
+ }, [V.type === "added" ? (f(), v("span", En, l(V.after ?? "—"), 1)) : V.type === "removed" ? (f(), v("span", Rn, l(V.before ?? "—"), 1)) : (f(), v(z, {
1999
2009
  key: 2
2000
- }, [a("span", Nn, l($.before ?? "—"), 1), s[16] || (s[16] = a("span", {
2010
+ }, [a("span", Nn, l(V.before ?? "—"), 1), s[16] || (s[16] = a("span", {
2001
2011
  class: "text-fm-color-typo-secondary"
2002
- }, " → ", -1)), a("span", Kn, l($.after ?? "—"), 1)], 64))]))), 128))])]))), 128))])) : (v(), g("p", Yn, l(u(o)("auditLog.operation.noChanges")), 1))])]), I.value || Q.value ? (v(), g("div", Bn, [a("button", {
2012
+ }, " → ", -1)), a("span", Un, l(V.after ?? "—"), 1)], 64))]))), 128))])]))), 128))])) : (f(), v("p", Kn, l(u(o)("auditLog.operation.noChanges")), 1))])]), U.value || I.value ? (f(), v("div", Bn, [a("button", {
2003
2013
  type: "button",
2004
2014
  class: "flex w-full items-center justify-between p-12 text-left",
2005
- onClick: s[11] || (s[11] = (h) => H.value = !H.value)
2006
- }, [a("p", zn, l(u(o)("auditLog.operation.showData")), 1), y(Ie, {
2015
+ onClick: s[11] || (s[11] = (p) => X.value = !X.value)
2016
+ }, [a("p", Yn, l(u(o)("auditLog.operation.showData")), 1), h(Ke, {
2007
2017
  name: "keyboard_arrow_down",
2008
- class: zo(["shrink-0 transition-transform", H.value ? "rotate-180" : ""])
2009
- }, null, 8, ["class"])]), H.value ? (v(), g(z, {
2018
+ class: zo(["shrink-0 transition-transform", X.value ? "rotate-180" : ""])
2019
+ }, null, 8, ["class"])]), X.value ? (f(), v(z, {
2010
2020
  key: 0
2011
2021
  }, [s[18] || (s[18] = a("hr", {
2012
2022
  class: "border-fm-color-border-default"
2013
- }, null, -1)), a("div", qn, [I.value ? (v(), g("div", Jn, [a("p", Hn, l(u(o)("auditLog.operation.before")), 1), a("pre", Wn, l(I.value), 1)])) : F("", !0), Q.value ? (v(), g("div", Gn, [a("p", Xn, l(u(o)("auditLog.operation.after")), 1), a("pre", Qn, l(Q.value), 1)])) : F("", !0)])], 64)) : F("", !0)])) : F("", !0)])) : F("", !0)]),
2023
+ }, null, -1)), a("div", zn, [U.value ? (f(), v("div", qn, [a("p", Jn, l(u(o)("auditLog.operation.before")), 1), a("pre", Hn, l(U.value), 1)])) : M("", !0), I.value ? (f(), v("div", Wn, [a("p", Gn, l(u(o)("auditLog.operation.after")), 1), a("pre", Xn, l(I.value), 1)])) : M("", !0)])], 64)) : M("", !0)])) : M("", !0)])) : M("", !0)]),
2014
2024
  _: 1
2015
2025
  }, 8, ["header", "model-value"])], 64);
2016
2026
  };
2017
2027
  }
2018
- }), bl = /* @__PURE__ */ Xo(tl, [["__scopeId", "data-v-4a88a042"]]);
2028
+ }), yl = /* @__PURE__ */ Go(el, [["__scopeId", "data-v-277a4ae7"]]);
2019
2029
  export {
2020
- bl as default
2030
+ yl as default
2021
2031
  };