@feedmepos/mf-hrm-portal 2.0.15-dev.2 → 2.0.15-dev.4

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 (25) hide show
  1. package/dist/{AuditLogList-_iGkRjav.js → AuditLogList-DnmeTc37.js} +4 -4
  2. package/dist/{EmployeeList-BsauFDHA.js → EmployeeList-DxlllTty.js} +43 -43
  3. package/dist/{Main-CWSLq8gH.js → Main-COZvNyhk.js} +4 -4
  4. package/dist/{Main-DWBJw_Ta.js → Main-CeFkxIhA.js} +765 -770
  5. package/dist/{Main-D0eoxqEG.js → Main-D1yqf9Yq.js} +13 -14
  6. package/dist/{PermissionSetList-CzFf90Bv.js → PermissionSetList-Ckc-VGme.js} +5 -5
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CBcnIfck.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-n4_wNZbg.js} +747 -750
  8. package/dist/{RoleList-CsdcFHQK.js → RoleList-BDbQX9of.js} +7 -7
  9. package/dist/{TeamMemberList-CI24SCZz.js → TeamMemberList-DJYxuPyN.js} +324 -323
  10. package/dist/{TimesheetList-eD8-rA_L.js → TimesheetList-CxehedOx.js} +6 -6
  11. package/dist/{app-DnT6yzx7.js → app-DEA0Bhzy.js} +2222 -1394
  12. package/dist/app.js +1 -1
  13. package/dist/{dayjs.min-L-465Ow8.js → dayjs.min-D-rfdWhu.js} +1 -1
  14. package/dist/{employee-DGjXlPn1.js → employee-CFnP1VvM.js} +3 -3
  15. package/dist/{iteration-CAxWl04o.js → iteration-S7YxnyNB.js} +1 -1
  16. package/dist/{lodash-VfbpRiGW.js → lodash-BdeQh1LM.js} +1 -1
  17. package/dist/{rule-D6eh6FDn.js → rule-DbvJ1q_w.js} +284 -285
  18. package/dist/style.css +1 -1
  19. package/dist/{timesheet-B11NLk-Z.js → timesheet-CPZSm4Qs.js} +2 -2
  20. package/dist/tsconfig.app.tsbuildinfo +1 -1
  21. package/dist/{useAppStore-BaDI6IZu.js → useAppStore-CJ6tnELc.js} +1 -1
  22. package/dist/{useLoading-B2CoUwmJ.js → useLoading-BuN7YL-v.js} +1 -1
  23. package/dist/{useReportPermissions-BfjLdcAd.js → useReportPermissions-D-GJuNg3.js} +3 -3
  24. package/package.json +1 -1
  25. package/dist/index-DOpSY75_.js +0 -827
@@ -1,46 +1,45 @@
1
- import { defineComponent as me, ref as v, resolveComponent as x, createBlock as k, openBlock as f, withCtx as j, createElementVNode as c, renderSlot as ke, createCommentVNode as O, withModifiers as Ee, nextTick as Ae, createElementBlock as E, normalizeClass as Te, createTextVNode as Ke, toDisplayString as B, computed as I, Fragment as he, renderList as Re, createVNode as p, unref as m, watch as ye, isRef as ss, createSlots as ts, onUnmounted as as } from "vue";
1
+ import { defineComponent as ce, ref as b, resolveComponent as x, createBlock as k, openBlock as f, withCtx as E, createElementVNode as c, renderSlot as ke, createCommentVNode as O, withModifiers as je, nextTick as Ae, createElementBlock as j, normalizeClass as Te, createTextVNode as Ke, toDisplayString as B, computed as I, Fragment as _e, renderList as Re, createVNode as p, unref as m, watch as ye, isRef as ss, createSlots as ts, onUnmounted as as } from "vue";
2
2
  import { u as ls } from "./useDebounce-B8ZPVS5C.js";
3
- import { useI18n as ge, useCoreStore as _e, baseClientInstance as Ie, RestaurantSelector as Me } from "@feedmepos/mf-common";
3
+ import { useI18n as xe, useCoreStore as ge, baseClientInstance as Ie, RestaurantSelector as Me } from "@feedmepos/mf-common";
4
4
  import { useBreakpoints as qe, useSnackbar as ze, useDialog as os, components as Ce } from "@feedmepos/ui-library";
5
5
  import { _ as Ge, S as De } from "./SelectFilter-DUj7GBtT.js";
6
- import { p as Ne, f as ns, k as rs, _ as is, a as us } from "./app-DnT6yzx7.js";
6
+ import { p as Ne, b as ns, C as rs, _ as is, a as us } from "./app-DEA0Bhzy.js";
7
7
  import { _ as ms } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
8
- import { u as cs } from "./useLoading-B2CoUwmJ.js";
9
- import { g as Be, d as We } from "./iteration-CAxWl04o.js";
10
- import { u as Je, c as ds, b as we, m as ve, d as Xe, p as Oe, i as ps, j as Le, k as fs, l as vs, s as bs, n as ys, o as hs, t as be } from "./rule-D6eh6FDn.js";
11
- import "./index-DOpSY75_.js";
12
- import { u as Ze } from "./useAppStore-BaDI6IZu.js";
8
+ import { u as cs } from "./useLoading-BuN7YL-v.js";
9
+ import { g as Be, d as We } from "./iteration-S7YxnyNB.js";
10
+ import { u as Je, c as ds, b as we, m as be, d as Xe, p as Oe, i as ps, j as Le, k as fs, l as vs, s as bs, n as hs, o as ys, t as he } from "./rule-DbvJ1q_w.js";
11
+ import { u as Ze } from "./useAppStore-CJ6tnELc.js";
13
12
  /* empty css */
14
- import { _ as _s, a as gs } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CBcnIfck.js";
13
+ import { _ as _s, a as gs } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-n4_wNZbg.js";
15
14
  import { u as xs } from "./useSearch-B6WK1LBB.js";
16
- const Fs = /* @__PURE__ */ me({
15
+ const Fs = /* @__PURE__ */ ce({
17
16
  __name: "BottomSheetMenu",
18
17
  setup(a) {
19
- const y = v(!1);
18
+ const h = b(!1);
20
19
  async function n() {
21
- await Ae(), y.value = !y.value;
20
+ await Ae(), h.value = !h.value;
22
21
  }
23
22
  return (t, r) => {
24
23
  const L = x("FmButton"), C = x("FmBottomSheet");
25
24
  return f(), k(C, {
26
- modelValue: y.value,
27
- "onUpdate:modelValue": r[1] || (r[1] = (g) => y.value = g),
25
+ modelValue: h.value,
26
+ "onUpdate:modelValue": r[1] || (r[1] = (g) => h.value = g),
28
27
  "dismiss-away": "",
29
28
  "no-header": "",
30
29
  "z-index": 110
31
30
  }, {
32
- "bottom-sheet-button": j(() => [
31
+ "bottom-sheet-button": E(() => [
33
32
  t.$slots.button ? O("", !0) : (f(), k(L, {
34
33
  key: 0,
35
34
  icon: "more_vert",
36
35
  variant: "tertiary",
37
- onClick: Ee(n, ["stop"])
36
+ onClick: je(n, ["stop"])
38
37
  })),
39
38
  ke(t.$slots, "button")
40
39
  ]),
41
- default: j(() => [
40
+ default: E(() => [
42
41
  c("div", {
43
- onClick: r[0] || (r[0] = (g) => y.value = !1)
42
+ onClick: r[0] || (r[0] = (g) => h.value = !1)
44
43
  }, [
45
44
  ke(t.$slots, "default")
46
45
  ])
@@ -49,7 +48,7 @@ const Fs = /* @__PURE__ */ me({
49
48
  }, 8, ["modelValue"]);
50
49
  };
51
50
  }
52
- }), Us = { class: "py-8 px-12 hover:bg-fm-color-neutral-gray-100" }, Ss = /* @__PURE__ */ me({
51
+ }), Us = { class: "py-8 px-12 hover:bg-fm-color-neutral-gray-100" }, Ss = /* @__PURE__ */ ce({
53
52
  __name: "BottomSheetMenuItem",
54
53
  props: {
55
54
  label: {},
@@ -58,17 +57,17 @@ const Fs = /* @__PURE__ */ me({
58
57
  itemClass: {}
59
58
  },
60
59
  setup(a) {
61
- const y = a;
60
+ const h = a;
62
61
  return (n, t) => {
63
62
  const r = x("FmIcon");
64
- return f(), E("div", Us, [
65
- n.$slots.content ? O("", !0) : (f(), E("div", {
63
+ return f(), j("div", Us, [
64
+ n.$slots.content ? O("", !0) : (f(), j("div", {
66
65
  key: 0,
67
66
  class: Te(["flex items-center", {
68
- "text-fm-color-typo-disabled": y.disabled,
69
- "cursor-pointer": !y.disabled,
70
- "cursor-not-allowed": y.disabled,
71
- [y.itemClass || ""]: y.itemClass && !y.disabled
67
+ "text-fm-color-typo-disabled": h.disabled,
68
+ "cursor-pointer": !h.disabled,
69
+ "cursor-not-allowed": h.disabled,
70
+ [h.itemClass || ""]: h.itemClass && !h.disabled
72
71
  }])
73
72
  }, [
74
73
  a.icon ? (f(), k(r, {
@@ -81,18 +80,18 @@ const Fs = /* @__PURE__ */ me({
81
80
  ]);
82
81
  };
83
82
  }
84
- }), Vs = /* @__PURE__ */ me({
83
+ }), Vs = /* @__PURE__ */ ce({
85
84
  __name: "ResponsiveContextMenu",
86
85
  props: {
87
86
  items: {}
88
87
  },
89
88
  setup(a) {
90
- const y = qe(), n = I(() => y.breakpoints.value.xs);
89
+ const h = qe(), n = I(() => h.breakpoints.value.xs);
91
90
  return (t, r) => {
92
91
  const L = x("FmButton"), C = x("FmMenuItem"), g = x("FmMenu");
93
92
  return n.value ? (f(), k(Fs, { key: 0 }, {
94
- default: j(() => [
95
- (f(!0), E(he, null, Re(a.items, ({ icon: _, label: u, disabled: P, itemClass: S, onClick: U }) => (f(), k(Ss, {
93
+ default: E(() => [
94
+ (f(!0), j(_e, null, Re(a.items, ({ icon: _, label: u, disabled: P, itemClass: S, onClick: U }) => (f(), k(Ss, {
96
95
  key: u,
97
96
  icon: _,
98
97
  label: u,
@@ -109,7 +108,7 @@ const Fs = /* @__PURE__ */ me({
109
108
  "stop-click-propagation": "",
110
109
  shift: !0
111
110
  }, {
112
- "menu-button": j(() => [
111
+ "menu-button": E(() => [
113
112
  p(L, {
114
113
  type: "button",
115
114
  variant: "tertiary",
@@ -118,8 +117,8 @@ const Fs = /* @__PURE__ */ me({
118
117
  size: "md"
119
118
  })
120
119
  ]),
121
- default: j(() => [
122
- (f(!0), E(he, null, Re(a.items, ({ label: _, disabled: u, itemClass: P, onClick: S }) => (f(), k(C, {
120
+ default: E(() => [
121
+ (f(!0), j(_e, null, Re(a.items, ({ label: _, disabled: u, itemClass: P, onClick: S }) => (f(), k(C, {
123
122
  key: _,
124
123
  disabled: u,
125
124
  label: _,
@@ -127,7 +126,7 @@ const Fs = /* @__PURE__ */ me({
127
126
  !u && (S == null || S());
128
127
  }
129
128
  }, {
130
- label: j(() => [
129
+ label: E(() => [
131
130
  c("span", {
132
131
  class: Te(u ? "text-fm-color-typo-disabled" : P)
133
132
  }, B(_), 3)
@@ -140,63 +139,63 @@ const Fs = /* @__PURE__ */ me({
140
139
  };
141
140
  }
142
141
  });
143
- var pe = /* @__PURE__ */ ((a) => (a.Update = "Update", a.Remove = "Remove", a))(pe || {});
144
- const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-center gap-16" }, ks = { class: "space-y-4 min-w-0 flex-1" }, Rs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, $s = { class: "fm-typo-en-body-lg-600 truncate" }, Is = { class: "w-full flex gap-16 items-center" }, Ms = { class: "flex-1 flex flex-col gap-4 min-w-0" }, Cs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ds = { class: "fm-typo-en-body-lg-600 truncate" }, Ns = { class: "flex-1 flex flex-col gap-4 min-w-0" }, Bs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Os = { class: "fm-typo-en-body-lg-600 truncate" }, Ls = /* @__PURE__ */ me({
142
+ var fe = /* @__PURE__ */ ((a) => (a.Update = "Update", a.Remove = "Remove", a))(fe || {});
143
+ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-center gap-16" }, ks = { class: "space-y-4 min-w-0 flex-1" }, Rs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, $s = { class: "fm-typo-en-body-lg-600 truncate" }, Is = { class: "w-full flex gap-16 items-center" }, Ms = { class: "flex-1 flex flex-col gap-4 min-w-0" }, Cs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ds = { class: "fm-typo-en-body-lg-600 truncate" }, Ns = { class: "flex-1 flex flex-col gap-4 min-w-0" }, Bs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Os = { class: "fm-typo-en-body-lg-600 truncate" }, Ls = /* @__PURE__ */ ce({
145
144
  __name: "MemberInfo",
146
145
  props: {
147
146
  data: {}
148
147
  },
149
148
  setup(a) {
150
- const { t: y } = ge();
149
+ const { t: h } = xe();
151
150
  return (n, t) => {
152
151
  const r = x("FmAvatar");
153
- return f(), E("div", ws, [
152
+ return f(), j("div", ws, [
154
153
  c("div", Ps, [
155
154
  p(r, {
156
155
  size: "xl",
157
156
  initials: a.data.name
158
157
  }, null, 8, ["initials"]),
159
158
  c("div", ks, [
160
- c("p", Rs, B(m(y)("team.memberForm.memberInfo.memberName")), 1),
159
+ c("p", Rs, B(m(h)("team.memberForm.memberInfo.memberName")), 1),
161
160
  c("p", $s, B(a.data.name || "--"), 1)
162
161
  ])
163
162
  ]),
164
163
  c("div", Is, [
165
164
  c("div", Ms, [
166
- c("p", Cs, B(m(y)("team.memberForm.memberInfo.mobileNumber")), 1),
165
+ c("p", Cs, B(m(h)("team.memberForm.memberInfo.mobileNumber")), 1),
167
166
  c("p", Ds, B(a.data.phoneNumber || "--"), 1)
168
167
  ]),
169
168
  c("div", Ns, [
170
- c("p", Bs, B(m(y)("team.memberForm.memberInfo.emailAddress")), 1),
169
+ c("p", Bs, B(m(h)("team.memberForm.memberInfo.emailAddress")), 1),
171
170
  c("p", Os, B(a.data.email || "--"), 1)
172
171
  ])
173
172
  ])
174
173
  ]);
175
174
  };
176
175
  }
177
- }), je = {
176
+ }), Ee = {
178
177
  async readPermissionUserByPhoneNo(a) {
179
178
  var n;
180
- const { currentBusiness: y } = _e();
179
+ const { currentBusiness: h } = ge();
181
180
  return Be(
182
- await Ie("/").get(`/user/b/${(n = y.value) == null ? void 0 : n._id}/phone/${a}`)
181
+ await Ie("/").get(`/user/b/${(n = h.value) == null ? void 0 : n._id}/phone/${a}`)
183
182
  );
184
183
  },
185
184
  async readPermissionUserByEmail(a) {
186
185
  var n;
187
- const { currentBusiness: y } = _e();
186
+ const { currentBusiness: h } = ge();
188
187
  return Be(
189
- await Ie("/").get(`/user/b/${(n = y.value) == null ? void 0 : n._id}/email/${a}`)
188
+ await Ie("/").get(`/user/b/${(n = h.value) == null ? void 0 : n._id}/email/${a}`)
190
189
  );
191
190
  }
192
- }, js = { class: "flex flex-col gap-24 w-full" }, Es = {
191
+ }, Es = { class: "flex flex-col gap-24 w-full" }, js = {
193
192
  key: 0,
194
193
  class: "flex flex-col gap-8"
195
- }, As = { class: "user-info-icon user-info-icon--lg" }, Ts = { class: "flex-1 overflow-hidden" }, Ks = { class: "profile-displayName" }, qs = { class: "profile-email" }, zs = { class: "profile-phone" }, Gs = { key: 2 }, Ws = /* @__PURE__ */ me({
194
+ }, As = { class: "user-info-icon user-info-icon--lg" }, Ts = { class: "flex-1 overflow-hidden" }, Ks = { class: "profile-displayName" }, qs = { class: "profile-email" }, zs = { class: "profile-phone" }, Gs = { key: 2 }, Ws = /* @__PURE__ */ ce({
196
195
  __name: "PortalUserSearcher",
197
196
  emits: ["invite"],
198
- setup(a, { emit: y }) {
199
- const n = y, { t } = ge(), r = ze(), L = _e(), C = v("phone"), g = v(""), _ = v(""), u = v();
197
+ setup(a, { emit: h }) {
198
+ const n = h, { t } = xe(), r = ze(), L = ge(), C = b("phone"), g = b(""), _ = b(""), u = b();
200
199
  async function P() {
201
200
  if (!g.value && !_.value) {
202
201
  r.open({
@@ -205,35 +204,35 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
205
204
  });
206
205
  return;
207
206
  }
208
- const h = C.value === "phone" ? await je.readPermissionUserByPhoneNo(g.value.replace(/ /g, "")) : await je.readPermissionUserByEmail(_.value);
209
- h || r.open({
207
+ const y = C.value === "phone" ? await Ee.readPermissionUserByPhoneNo(g.value.replace(/ /g, "")) : await Ee.readPermissionUserByEmail(_.value);
208
+ y || r.open({
210
209
  type: "error",
211
210
  title: t("team.memberForm.searchUser.userNotFound")
212
- }), u.value = h;
211
+ }), u.value = y;
213
212
  }
214
213
  const S = I(() => {
215
214
  var se;
216
- let h = ((se = u.value) == null ? void 0 : se.displayName) ?? "";
217
- h || (h = "Feed Me");
218
- const [V, T] = h.split(" ");
215
+ let y = ((se = u.value) == null ? void 0 : se.displayName) ?? "";
216
+ y || (y = "Feed Me");
217
+ const [V, T] = y.split(" ");
219
218
  return T ? `${V[0]}${T[0]}` : V.slice(0, 2);
220
- }), U = v(!1);
221
- function A(h) {
222
- n("invite", h), U.value = !0;
219
+ }), U = b(!1);
220
+ function A(y) {
221
+ n("invite", y), U.value = !0;
223
222
  }
224
- function J() {
223
+ function G() {
225
224
  U.value = !1;
226
225
  }
227
- return (h, V) => {
228
- var R, K, Q;
229
- const T = x("FmRadio"), se = x("FmPhoneNumber"), ne = x("FmTextField"), o = x("FmRadioGroup"), i = x("FmButton");
230
- return f(), E("div", js, [
231
- U.value ? O("", !0) : (f(), E("div", Es, [
232
- p(o, {
226
+ return (y, V) => {
227
+ var R, K, Z;
228
+ const T = x("FmRadio"), se = x("FmPhoneNumber"), ne = x("FmTextField"), l = x("FmRadioGroup"), i = x("FmButton");
229
+ return f(), j("div", Es, [
230
+ U.value ? O("", !0) : (f(), j("div", js, [
231
+ p(l, {
233
232
  modelValue: C.value,
234
233
  "onUpdate:modelValue": V[2] || (V[2] = (w) => C.value = w)
235
234
  }, {
236
- default: j(() => [
235
+ default: E(() => [
237
236
  p(T, {
238
237
  value: "phone",
239
238
  label: m(t)("team.memberForm.searchUser.phoneNumber")
@@ -265,7 +264,7 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
265
264
  onClick: P
266
265
  }, null, 8, ["label"])
267
266
  ])),
268
- u.value ? (f(), E("div", {
267
+ u.value ? (f(), j("div", {
269
268
  key: 1,
270
269
  class: "profile-menu--profile cursor-pointer hover:bg-fm-color-opacity-sm",
271
270
  onClick: V[3] || (V[3] = (w) => A(u.value))
@@ -274,20 +273,20 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
274
273
  c("div", Ts, [
275
274
  c("p", Ks, B((R = u.value) == null ? void 0 : R.displayName), 1),
276
275
  c("p", qs, B((K = u.value) == null ? void 0 : K.email), 1),
277
- c("p", zs, B((Q = u.value) == null ? void 0 : Q.phoneNumber), 1)
276
+ c("p", zs, B((Z = u.value) == null ? void 0 : Z.phoneNumber), 1)
278
277
  ])
279
278
  ])) : O("", !0),
280
- U.value ? (f(), E("div", Gs, [
279
+ U.value ? (f(), j("div", Gs, [
281
280
  p(i, {
282
281
  label: m(t)("team.memberForm.searchUser.changeUser"),
283
282
  variant: "secondary",
284
- onClick: J
283
+ onClick: G
285
284
  }, null, 8, ["label"])
286
285
  ])) : O("", !0)
287
286
  ]);
288
287
  };
289
288
  }
290
- }), Js = /* @__PURE__ */ Ge(Ws, [["__scopeId", "data-v-c2c7ed35"]]), Xs = { class: "flex flex-col gap-40" }, Zs = { class: "flex items-center" }, Qs = { class: "flex-1 flex flex-col" }, Ys = { class: "fm-typo-en-title-sm-600" }, Hs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, et = { class: "flex flex-row gap-16" }, st = { class: "flex flex-col gap-8" }, tt = { class: "fm-typo-en-body-lg-400" }, at = { class: "p-16 fm-corner-radius-lg border border-fm-color-neutral-gray-200" }, Pe = 4, lt = /* @__PURE__ */ me({
289
+ }), Js = /* @__PURE__ */ Ge(Ws, [["__scopeId", "data-v-c2c7ed35"]]), Xs = { class: "flex flex-col gap-40" }, Zs = { class: "flex items-center" }, Qs = { class: "flex-1 flex flex-col" }, Ys = { class: "fm-typo-en-title-sm-600" }, Hs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, et = { class: "flex flex-row gap-16" }, st = { class: "flex flex-col gap-8" }, tt = { class: "fm-typo-en-body-lg-400" }, at = { class: "p-16 fm-corner-radius-lg border border-fm-color-neutral-gray-200" }, Pe = 4, lt = /* @__PURE__ */ ce({
291
290
  __name: "TeamMemberMasterUser",
292
291
  props: {
293
292
  modelValue: {
@@ -312,52 +311,52 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
312
311
  }
313
312
  },
314
313
  emits: ["update:model-value"],
315
- setup(a, { emit: y }) {
316
- const n = a, t = y, { t: r } = ge(), { searchKey: L, filter: C } = xs(""), g = v(!0), _ = v([]), u = I(() => {
317
- const o = {};
314
+ setup(a, { emit: h }) {
315
+ const n = a, t = h, { t: r } = xe(), { searchKey: L, filter: C } = xs(""), g = b(!0), _ = b([]), u = I(() => {
316
+ const l = {};
318
317
  return n.roles.forEach((i) => {
319
- o[i.value] = i.label;
320
- }), o;
318
+ l[i.value] = i.label;
319
+ }), l;
321
320
  }), P = I(() => {
322
321
  var i;
323
- const o = {};
322
+ const l = {};
324
323
  return (i = n.modelValue) == null || i.roles.forEach((R) => {
325
- o[R.restaurantId] = R.roleId;
326
- }), o;
327
- }), S = I(() => n.restaurants.filter((o) => C([o.profile.name, o.profile.code, A(o._id)])).map((o) => ({
328
- label: `${o.profile.code ? o.profile.code + "-" : ""}${o.profile.name}`,
329
- value: o._id,
330
- slot: `checkbox-${o._id}-bottom`,
324
+ l[R.restaurantId] = R.roleId;
325
+ }), l;
326
+ }), S = I(() => n.restaurants.filter((l) => C([l.profile.name, l.profile.code, A(l._id)])).map((l) => ({
327
+ label: `${l.profile.code ? l.profile.code + "-" : ""}${l.profile.name}`,
328
+ value: l._id,
329
+ slot: `checkbox-${l._id}-bottom`,
331
330
  disable: n.roles.filter((i) => !i.disabled).length === 0,
332
331
  roleOptions: n.roles
333
332
  }))), U = I(() => {
334
- const o = n.roles.find((i) => !i.disabled);
335
- return o ? o.value : null;
333
+ const l = n.roles.find((i) => !i.disabled);
334
+ return l ? l.value : null;
336
335
  });
337
- function A(o) {
338
- const i = P.value[o] ?? "";
336
+ function A(l) {
337
+ const i = P.value[l] ?? "";
339
338
  return u.value[i] || "";
340
339
  }
341
- function J(o) {
342
- o ? n.modelValue || t("update:model-value", {
340
+ function G(l) {
341
+ l ? n.modelValue || t("update:model-value", {
343
342
  code: "",
344
343
  name: n.fallbackName,
345
344
  roles: [],
346
345
  passcode: n.fallbackPasscode || ""
347
346
  }) : t("update:model-value", null);
348
347
  }
349
- function h(o, i) {
350
- if (!n.modelValue || o === "passcode" && n.modelValue.passcode === i)
348
+ function y(l, i) {
349
+ if (!n.modelValue || l === "passcode" && n.modelValue.passcode === i)
351
350
  return;
352
351
  const R = We(n.modelValue);
353
- R[o] = i, t("update:model-value", R);
352
+ R[l] = i, t("update:model-value", R);
354
353
  }
355
- function V(o) {
356
- h(
354
+ function V(l) {
355
+ y(
357
356
  "roles",
358
- o.map((i) => {
359
- var Q, w, D;
360
- const R = (w = (Q = S.value.find((q) => q.value === i)) == null ? void 0 : Q.roleOptions.find((q) => !q.disabled)) == null ? void 0 : w.value, K = (D = n.modelValue) == null ? void 0 : D.roles.find((q) => q.restaurantId === i);
357
+ l.map((i) => {
358
+ var Z, w, N;
359
+ const R = (w = (Z = S.value.find((q) => q.value === i)) == null ? void 0 : Z.roleOptions.find((q) => !q.disabled)) == null ? void 0 : w.value, K = (N = n.modelValue) == null ? void 0 : N.roles.find((q) => q.restaurantId === i);
361
360
  return {
362
361
  restaurantId: i,
363
362
  roleId: (K == null ? void 0 : K.roleId) || R
@@ -365,41 +364,41 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
365
364
  })
366
365
  );
367
366
  }
368
- function T(o, i) {
369
- h("roles", [
367
+ function T(l, i) {
368
+ y("roles", [
370
369
  ...n.modelValue.roles.filter(
371
- (R) => R.restaurantId !== o
370
+ (R) => R.restaurantId !== l
372
371
  ),
373
372
  {
374
- restaurantId: o,
373
+ restaurantId: l,
375
374
  roleId: i
376
375
  }
377
376
  ]);
378
377
  }
379
378
  function se() {
380
- g.value && (g.value = !1, _.value = [], h("passcode", ""));
379
+ g.value && (g.value = !1, _.value = [], y("passcode", ""));
381
380
  }
382
381
  ye(
383
382
  () => {
384
- var o;
385
- return (o = n.modelValue) == null ? void 0 : o.passcode;
383
+ var l;
384
+ return (l = n.modelValue) == null ? void 0 : l.passcode;
386
385
  },
387
- (o) => {
388
- o && o.length === Pe ? (_.value = o.split(""), g.value = !0) : (_.value = [], g.value = !1);
386
+ (l) => {
387
+ l && l.length === Pe ? (_.value = l.split(""), g.value = !0) : (_.value = [], g.value = !1);
389
388
  },
390
389
  { immediate: !0 }
391
390
  );
392
391
  const ne = I({
393
392
  get: () => {
394
- var o;
395
- return ((o = n.modelValue) == null ? void 0 : o.roles) ?? [];
393
+ var l;
394
+ return ((l = n.modelValue) == null ? void 0 : l.roles) ?? [];
396
395
  },
397
396
  set: () => {
398
397
  }
399
398
  });
400
- return (o, i) => {
401
- const R = x("FmSwitch"), K = x("FmTextField"), Q = x("FmPinField"), w = x("FmFormGroup"), D = x("FmSearch"), q = x("FmSelect");
402
- return f(), E("div", Xs, [
399
+ return (l, i) => {
400
+ const R = x("FmSwitch"), K = x("FmTextField"), Z = x("FmPinField"), w = x("FmFormGroup"), N = x("FmSearch"), q = x("FmSelect");
401
+ return f(), j("div", Xs, [
403
402
  c("div", Zs, [
404
403
  c("div", Qs, [
405
404
  c("div", Ys, B(m(r)("team.memberForm.masterUser.title")), 1),
@@ -409,23 +408,23 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
409
408
  p(R, {
410
409
  "model-value": !!a.modelValue,
411
410
  value: "master-user",
412
- "onUpdate:modelValue": J
411
+ "onUpdate:modelValue": G
413
412
  }, null, 8, ["model-value"])
414
413
  ])
415
414
  ]),
416
- a.modelValue ? (f(), E(he, { key: 0 }, [
415
+ a.modelValue ? (f(), j(_e, { key: 0 }, [
417
416
  c("div", et, [
418
417
  p(K, {
419
418
  "model-value": a.modelValue.code,
420
419
  label: m(r)("team.memberForm.masterUser.code"),
421
- "onUpdate:modelValue": i[0] || (i[0] = (d) => h("code", d))
420
+ "onUpdate:modelValue": i[0] || (i[0] = (d) => y("code", d))
422
421
  }, null, 8, ["model-value", "label"]),
423
422
  p(K, {
424
423
  "model-value": a.modelValue.name,
425
424
  class: "w-full",
426
425
  label: m(r)("team.memberForm.masterUser.name"),
427
426
  rules: [(d) => !!d || m(r)("team.memberForm.masterUser.nameEmptyError")],
428
- "onUpdate:modelValue": i[1] || (i[1] = (d) => h("name", d))
427
+ "onUpdate:modelValue": i[1] || (i[1] = (d) => y("name", d))
429
428
  }, null, 8, ["model-value", "label", "rules"])
430
429
  ]),
431
430
  c("div", st, [
@@ -434,17 +433,17 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
434
433
  modelValue: _.value,
435
434
  "onUpdate:modelValue": i[4] || (i[4] = (d) => _.value = d),
436
435
  rules: [
437
- (d) => (d == null ? void 0 : d.filter((X) => !!X).length) !== Pe ? m(r)("team.memberForm.masterUser.passcodeRequired") : !0
436
+ (d) => (d == null ? void 0 : d.filter((W) => !!W).length) !== Pe ? m(r)("team.memberForm.masterUser.passcodeRequired") : !0
438
437
  ]
439
438
  }, {
440
- default: j(() => [
441
- (f(), k(Q, {
439
+ default: E(() => [
440
+ (f(), k(Z, {
442
441
  key: `pin-field-${g.value}`,
443
442
  modelValue: _.value,
444
443
  "onUpdate:modelValue": i[2] || (i[2] = (d) => _.value = d),
445
444
  length: Pe,
446
445
  masked: g.value,
447
- onComplete: i[3] || (i[3] = (d) => h("passcode", d)),
446
+ onComplete: i[3] || (i[3] = (d) => y("passcode", d)),
448
447
  onFocus: se
449
448
  }, null, 8, ["modelValue", "masked"]))
450
449
  ]),
@@ -455,12 +454,12 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
455
454
  modelValue: ne.value,
456
455
  "onUpdate:modelValue": i[6] || (i[6] = (d) => ne.value = d),
457
456
  rules: [
458
- (d) => !d || d.length === 0 ? m(r)("team.memberForm.masterUser.restaurantRequired") : d.some((X) => !X.roleId) ? m(r)("team.memberForm.masterUser.roleRequired") : !0
457
+ (d) => !d || d.length === 0 ? m(r)("team.memberForm.masterUser.restaurantRequired") : d.some((W) => !W.roleId) ? m(r)("team.memberForm.masterUser.roleRequired") : !0
459
458
  ]
460
459
  }, {
461
- default: j(() => [
460
+ default: E(() => [
462
461
  c("div", at, [
463
- p(D, {
462
+ p(N, {
464
463
  modelValue: m(L),
465
464
  "onUpdate:modelValue": i[5] || (i[5] = (d) => ss(L) ? L.value = d : null),
466
465
  placeholder: m(r)("team.memberForm.posRole.placeholder"),
@@ -475,14 +474,14 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
475
474
  }, ts({ _: 2 }, [
476
475
  Re(S.value, (d) => ({
477
476
  name: d.slot,
478
- fn: j(() => {
479
- var X;
477
+ fn: E(() => {
478
+ var W;
480
479
  return [
481
480
  c("div", null, [
482
481
  p(q, {
483
- "model-value": ((X = a.modelValue.roles.find((te) => te.restaurantId === d.value)) == null ? void 0 : X.roleId) || U.value,
482
+ "model-value": ((W = a.modelValue.roles.find((oe) => oe.restaurantId === d.value)) == null ? void 0 : W.roleId) || U.value,
484
483
  items: d.roleOptions,
485
- "onUpdate:modelValue": (te) => T(d.value, te)
484
+ "onUpdate:modelValue": (oe) => T(d.value, oe)
486
485
  }, null, 8, ["model-value", "items", "onUpdate:modelValue"])
487
486
  ])
488
487
  ];
@@ -500,7 +499,7 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
500
499
  }), ot = { class: "flex flex-col gap-32" }, nt = { class: "flex w-full" }, rt = {
501
500
  key: 2,
502
501
  class: "flex items-center justify-center py-24"
503
- }, it = /* @__PURE__ */ me({
502
+ }, it = /* @__PURE__ */ ce({
504
503
  __name: "AddMemberForm",
505
504
  props: {
506
505
  initialValue: {
@@ -515,129 +514,133 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
515
514
  default: !1
516
515
  }
517
516
  },
518
- setup(a, { expose: y }) {
519
- var xe, Fe, Ue;
520
- const n = a, { t } = ge(), r = v(), L = Je(), C = I(
521
- () => L.permissionSets.value.map((l) => ({
522
- label: l.name,
523
- value: l.id
517
+ setup(a, { expose: h }) {
518
+ var Fe, Ue, re;
519
+ const n = a, { t } = xe(), r = b(), L = Je(), C = I(
520
+ () => L.permissionSets.value.map((o) => ({
521
+ label: o.name,
522
+ value: o.id
524
523
  }))
525
- ), g = v(((xe = n.initialValue) == null ? void 0 : xe.permissionSetIds) || []), _ = I(
524
+ ), g = b(((Fe = n.initialValue) == null ? void 0 : Fe.permissionSetIds) || []), _ = I(
526
525
  () => ds(g.value, L.permissionSets.value)
527
- ), u = v((Fe = n.initialValue) == null ? void 0 : Fe.posUser), P = v(!1), S = v(!1), U = v(
526
+ ), u = b((Ue = n.initialValue) == null ? void 0 : Ue.posUser), P = b(!1), S = b(!1), U = b(
528
527
  we(
529
- ve(_.value),
530
- ((Ue = n.initialValue) == null ? void 0 : Ue.permissions) || []
528
+ be(_.value),
529
+ ((re = n.initialValue) == null ? void 0 : re.permissions) || []
531
530
  )
532
- ), { customReportPermissions: A, isLoaded: J } = Xe(), h = new Set(
533
- Oe.filter((l) => l.subject.startsWith(ps)).map((l) => l.subject)
531
+ ), { customReportPermissions: A, isLoaded: G } = Xe(), y = new Set(
532
+ Oe.filter((o) => o.subject.startsWith(ps)).map((o) => o.subject)
534
533
  ), V = I(() => {
535
- const l = new Set(h);
536
- for (const b of A.value) l.add(b.subject);
537
- return l;
534
+ const o = new Set(y);
535
+ for (const v of A.value) o.add(v.subject);
536
+ return o;
538
537
  }), T = I(() => {
539
- const l = /* @__PURE__ */ new Set();
540
- for (const b of Oe)
541
- b.category === Ne.reports && l.add(b.subject);
542
- for (const b of A.value)
543
- b.category === Ne.reports && l.add(b.subject);
544
- return l;
545
- }), { restaurants: se } = _e(), ne = Ze().roles, o = I(() => Le(U.value)), i = I(() => {
546
- const l = o.value;
538
+ const o = /* @__PURE__ */ new Set();
539
+ for (const v of Oe)
540
+ v.category === Ne.reports && o.add(v.subject);
541
+ for (const v of A.value)
542
+ v.category === Ne.reports && o.add(v.subject);
543
+ return o;
544
+ }), { restaurants: se } = ge(), ne = Ze().roles, l = I(() => Le(U.value)), i = I(() => {
545
+ const o = l.value;
547
546
  return ne.value.map(
548
- (b) => ({
549
- label: b.name,
550
- value: b._id,
551
- disabled: !!l && !l.includes(b._id)
547
+ (v) => ({
548
+ label: v.name,
549
+ value: v._id,
550
+ disabled: !!o && !o.includes(v._id)
552
551
  })
553
552
  );
554
553
  });
555
- function R(l) {
556
- r.value = l;
554
+ function R(o) {
555
+ r.value = o;
557
556
  }
558
- function K(l) {
557
+ function K(o) {
559
558
  S.value = !0;
560
- const b = d(u.value, l);
561
- b !== u.value && (P.value = !0), u.value = b;
559
+ const v = d(u.value, o);
560
+ v !== u.value && (P.value = !0), u.value = v;
562
561
  }
563
- function Q() {
564
- const l = ve(_.value), b = J.value ? V.value : h, z = fs(U.value, b), Z = vs(z, T.value), H = bs(Z);
565
- return ys(l, H);
562
+ function Z() {
563
+ const o = be(_.value), v = G.value ? V.value : y, Q = fs(U.value, v), X = vs(Q, T.value), Y = bs(X);
564
+ return hs(o, Y);
566
565
  }
567
566
  function w() {
568
- var z, Z, H, ae, G, W, re, ie, ce, N;
569
- const l = Q(), b = U.value.filter((oe) => !oe.inverted);
567
+ var Q, X, Y, D, z, ie, ue, de, te, H;
568
+ const o = Z(), v = U.value.filter((ae) => !ae.inverted);
570
569
  return {
571
- email: ((z = r.value) == null ? void 0 : z.email) ?? void 0,
572
- phoneNumber: ((Z = r.value) == null ? void 0 : Z.phoneNumber) ?? void 0,
573
- customPermissions: l,
570
+ email: ((Q = r.value) == null ? void 0 : Q.email) ?? void 0,
571
+ phoneNumber: ((X = r.value) == null ? void 0 : X.phoneNumber) ?? void 0,
572
+ customPermissions: o,
574
573
  // Deprecated: keep for backward compatibility, will be removed in the future
575
- permissions: b.map((oe) => ({
576
- ...oe,
577
- subject: ns(oe.subject)
574
+ permissions: v.map((ae) => ({
575
+ ...ae,
576
+ subject: ns(ae.subject)
578
577
  })),
579
578
  permissionSetIds: g.value,
580
- name: ((H = r.value) == null ? void 0 : H.displayName) || ((ae = n.initialValue) == null ? void 0 : ae.name) || "",
579
+ name: ((Y = r.value) == null ? void 0 : Y.displayName) || ((D = n.initialValue) == null ? void 0 : D.name) || "",
581
580
  posUser: !n.initialValue || P.value ? u.value != null ? {
582
581
  ...u.value,
583
- name: u.value.name || ((W = (G = n.initialValue) == null ? void 0 : G.posUser) == null ? void 0 : W.name) || ((re = n.initialValue) == null ? void 0 : re.name) || ((ie = r.value) == null ? void 0 : ie.displayName) || "",
584
- code: u.value.code || ((N = (ce = n.initialValue) == null ? void 0 : ce.posUser) == null ? void 0 : N.code) || "",
582
+ name: u.value.name || ((ie = (z = n.initialValue) == null ? void 0 : z.posUser) == null ? void 0 : ie.name) || ((ue = n.initialValue) == null ? void 0 : ue.name) || ((de = r.value) == null ? void 0 : de.displayName) || "",
583
+ code: u.value.code || ((H = (te = n.initialValue) == null ? void 0 : te.posUser) == null ? void 0 : H.code) || "",
585
584
  passcode: u.value.passcode,
586
- roles: u.value.roles.filter((oe) => !!oe.roleId)
585
+ roles: u.value.roles.filter((ae) => !!ae.roleId)
587
586
  } : u.value : void 0
588
587
  // update mode, POS not touched → signal no change to backend
589
588
  };
590
589
  }
591
- const D = v();
590
+ const N = b();
592
591
  ye(
593
592
  () => n.initialValue,
594
- (l) => {
595
- if (!l) {
596
- g.value = [], u.value = void 0, P.value = !1, S.value = !1, U.value = we(ve([]), []);
593
+ (o) => {
594
+ if (!o) {
595
+ g.value = [], u.value = void 0, P.value = !1, S.value = !1, U.value = we(be([]), []);
597
596
  return;
598
597
  }
599
598
  if (S.value) {
600
- !P.value && l.posUser !== void 0 && (u.value = l.posUser);
599
+ !P.value && o.posUser !== void 0 && (u.value = o.posUser);
601
600
  return;
602
601
  }
603
- g.value = l.permissionSetIds || [], (!P.value || l.posUser !== void 0) && (u.value = l.posUser), U.value = we(
604
- ve(_.value),
605
- l.permissions || []
602
+ g.value = o.permissionSetIds || [], (!P.value || o.posUser !== void 0) && (u.value = o.posUser), U.value = we(
603
+ be(_.value),
604
+ o.permissions || []
606
605
  ), P.value = !1;
607
606
  },
608
607
  { immediate: !0 }
609
608
  );
610
609
  function q() {
611
- U.value = ve(_.value), S.value = !0;
612
- const l = d(u.value, U.value);
613
- l !== u.value && (P.value = !0), u.value = l;
610
+ U.value = be(_.value), S.value = !0;
611
+ const o = d(u.value, U.value);
612
+ o !== u.value && (P.value = !0), u.value = o;
613
+ }
614
+ function d(o, v) {
615
+ if (!o) return o;
616
+ const Q = Le(v);
617
+ if (!Q) return o;
618
+ const X = We(o);
619
+ return X.roles = X.roles.reduce((Y, D) => (Q.includes(D.roleId) && Y.push(D), Y), []), X;
614
620
  }
615
- function d(l, b) {
616
- if (!l) return l;
617
- const z = Le(b);
618
- if (!z) return l;
619
- const Z = We(l);
620
- return Z.roles = Z.roles.reduce((H, ae) => (z.includes(ae.roleId) && H.push(ae), H), []), Z;
621
+ async function W() {
622
+ await Ae(), N.value && N.value.$el.scrollIntoView({ behavior: "smooth", block: "start" });
621
623
  }
622
- async function X() {
623
- await Ae(), D.value && D.value.$el.scrollIntoView({ behavior: "smooth", block: "start" });
624
+ function oe(o) {
625
+ const v = !!u.value;
626
+ u.value = o, P.value = !0, S.value = !0, !v && o && W();
624
627
  }
625
- const te = v();
626
- async function Y() {
627
- return (await te.value.validateInputsWithoutSubmit()).length ? null : w();
628
+ const J = b();
629
+ async function Se() {
630
+ return (await J.value.validateInputsWithoutSubmit()).length ? null : w();
628
631
  }
629
- return y({
632
+ return h({
630
633
  readFormData: w,
631
- validate: Y
632
- }), (l, b) => {
633
- const z = x("FmSelect"), Z = x("FmCircularProgress"), H = x("FmForm");
634
- return f(), k(H, {
634
+ validate: Se
635
+ }), (o, v) => {
636
+ const Q = x("FmSelect"), X = x("FmCircularProgress"), Y = x("FmForm");
637
+ return f(), k(Y, {
635
638
  ref_key: "formRef",
636
- ref: te,
639
+ ref: J,
637
640
  class: "mx-4"
638
641
  }, {
639
- default: j(() => {
640
- var ae, G, W, re, ie, ce;
642
+ default: E(() => {
643
+ var D, z, ie, ue, de, te;
641
644
  return [
642
645
  c("div", ot, [
643
646
  c("div", nt, [
@@ -646,15 +649,15 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
646
649
  data: a.initialValue
647
650
  }, null, 8, ["data"])) : (f(), k(Js, {
648
651
  key: 0,
649
- onInvite: b[0] || (b[0] = (N) => R(N))
652
+ onInvite: v[0] || (v[0] = (H) => R(H))
650
653
  }))
651
654
  ]),
652
- r.value || a.initialValue ? (f(), E(he, { key: 0 }, [
653
- (ae = a.initialValue) != null && ae.isOwner ? O("", !0) : (f(), k(z, {
655
+ r.value || a.initialValue ? (f(), j(_e, { key: 0 }, [
656
+ (D = a.initialValue) != null && D.isOwner ? O("", !0) : (f(), k(Q, {
654
657
  key: 0,
655
658
  modelValue: g.value,
656
659
  "onUpdate:modelValue": [
657
- b[1] || (b[1] = (N) => g.value = N),
660
+ v[1] || (v[1] = (H) => g.value = H),
658
661
  q
659
662
  ],
660
663
  multiselect: "",
@@ -664,27 +667,25 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
664
667
  label: m(t)("team.memberForm.permissionSet.title"),
665
668
  placeholder: m(t)("team.memberForm.permissionSet.selectPlaceholder")
666
669
  }, null, 8, ["modelValue", "items", "label", "placeholder"])),
667
- (G = a.initialValue) != null && G.isOwner ? O("", !0) : (f(), k(gs, {
670
+ (z = a.initialValue) != null && z.isOwner ? O("", !0) : (f(), k(gs, {
668
671
  key: 1,
669
672
  modelValue: U.value,
670
- "onUpdate:modelValue": b[2] || (b[2] = (N) => U.value = N),
673
+ "onUpdate:modelValue": v[2] || (v[2] = (H) => U.value = H),
671
674
  "inherit-permissions": _.value,
672
675
  onPermissionChanged: K
673
676
  }, null, 8, ["modelValue", "inherit-permissions"])),
674
- a.isLoadingMasterUser ? (f(), E("div", rt, [
675
- p(Z)
677
+ a.isLoadingMasterUser ? (f(), j("div", rt, [
678
+ p(X)
676
679
  ])) : (f(), k(lt, {
677
680
  key: 3,
678
681
  ref_key: "masterUserContentRef",
679
- ref: D,
682
+ ref: N,
680
683
  "model-value": u.value,
681
- "fallback-name": ((W = a.initialValue) == null ? void 0 : W.name) || ((re = r.value) == null ? void 0 : re.displayName) || "",
682
- "fallback-passcode": (ce = (ie = a.initialValue) == null ? void 0 : ie.posUser) == null ? void 0 : ce.passcode,
684
+ "fallback-name": ((ie = a.initialValue) == null ? void 0 : ie.name) || ((ue = r.value) == null ? void 0 : ue.displayName) || "",
685
+ "fallback-passcode": (te = (de = a.initialValue) == null ? void 0 : de.posUser) == null ? void 0 : te.passcode,
683
686
  roles: i.value,
684
687
  restaurants: m(se),
685
- "onUpdate:modelValue": b[3] || (b[3] = (N) => {
686
- u.value = N, P.value = !0, S.value = !0, X();
687
- })
688
+ "onUpdate:modelValue": oe
688
689
  }, null, 8, ["model-value", "fallback-name", "fallback-passcode", "roles", "restaurants"]))
689
690
  ], 64)) : O("", !0)
690
691
  ])
@@ -710,20 +711,20 @@ const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-c
710
711
  class: "flex h-full flex-col"
711
712
  }, bt = {
712
713
  class: "flex items-center justify-start gap-8"
713
- }, de = 100;
714
+ }, pe = 100;
714
715
  var ee = /* @__PURE__ */ function(a) {
715
716
  return a[a.ADD = 0] = "ADD", a[a.UPDATE = 1] = "UPDATE", a[a.CLOSED = 2] = "CLOSED", a;
716
717
  }(ee || {});
717
- const yt = /* @__PURE__ */ me({
718
+ const ht = /* @__PURE__ */ ce({
718
719
  __name: "TeamMemberList",
719
720
  setup(a, {
720
- expose: y
721
+ expose: h
721
722
  }) {
722
723
  const {
723
724
  fetchCustomReportPermissions: n
724
725
  } = Xe(), {
725
726
  t
726
- } = ge(), r = _e(), L = Ze(), C = ze(), g = cs(C), _ = Je(), u = hs(), P = v(!0), S = v(!1), U = v(r.restaurants.value.length === 0), A = v([]), J = v(0), h = v(1), V = v(""), T = v(""), se = ye(r.restaurants, (e) => {
727
+ } = xe(), r = ge(), L = Ze(), C = ze(), g = cs(C), _ = Je(), u = ys(), P = b(!0), S = b(!1), U = b(r.restaurants.value.length === 0), A = b([]), G = b(0), y = b(1), V = b(""), T = b(""), se = ye(r.restaurants, (e) => {
727
728
  e.length > 0 && (U.value = !1, A.value.length > 0 && (A.value = A.value.map((s) => ({
728
729
  ...s,
729
730
  restaurants: s.doc.isOwner ? s.restaurants : s.managableRestaurantIds.map((F) => {
@@ -737,17 +738,17 @@ const yt = /* @__PURE__ */ me({
737
738
  }) => {
738
739
  const F = {
739
740
  label: t("common.update"),
740
- onClick: () => q(pe.Update, e)
741
+ onClick: () => q(fe.Update, e)
741
742
  }, M = {
742
743
  label: t("common.remove"),
743
- onClick: () => q(pe.Remove, e),
744
+ onClick: () => q(fe.Remove, e),
744
745
  itemClass: "text-fm-color-typo-error"
745
746
  }, le = e.doc.isOwner ? [F] : [F, M];
746
747
  return p(Vs, {
747
748
  class: s,
748
749
  items: le
749
750
  }, null);
750
- }, o = (e) => e.doc.isOwner ? t("team.labels.businessOwner") : e.restaurants.join(", "), i = [{
751
+ }, l = (e) => e.doc.isOwner ? t("team.labels.businessOwner") : e.restaurants.join(", "), i = [{
751
752
  accessorKey: "name",
752
753
  header: () => t("team.table.columns.name"),
753
754
  enableSorting: !1
@@ -763,7 +764,7 @@ const yt = /* @__PURE__ */ me({
763
764
  const s = e.row.original;
764
765
  return U.value && !s.doc.isOwner ? p("div", {
765
766
  class: "h-16 w-[120px] animate-pulse rounded bg-fm-color-neutral-gray-200"
766
- }, null) : o(s);
767
+ }, null) : l(s);
767
768
  }
768
769
  }, {
769
770
  accessorKey: "assignedRoles",
@@ -771,7 +772,7 @@ const yt = /* @__PURE__ */ me({
771
772
  enableSorting: !1,
772
773
  cell(e) {
773
774
  const s = e.row.original, F = u.getPermissionAssignmentByUserId(s.id), M = (F == null ? void 0 : F.permissionSetIds) || s.doc.permissionSetIds || [];
774
- return _.permissionSets.value.filter((ue) => M.includes(ue.id)).map((ue) => ue.name).join(", ");
775
+ return _.permissionSets.value.filter((me) => M.includes(me.id)).map((me) => me.name).join(", ");
775
776
  }
776
777
  }, {
777
778
  accessorKey: "permission",
@@ -819,7 +820,7 @@ const yt = /* @__PURE__ */ me({
819
820
  })]), e.permissionLabels.length > 0 && s]);
820
821
  }
821
822
  function K(e) {
822
- var le, ue, fe, $;
823
+ var le, me, ve, $;
823
824
  const s = u.getPermissionAssignmentByUserId(e.id), F = (s == null ? void 0 : s.customPermissions) || e.permissions || [], M = (s == null ? void 0 : s.permissionSetIds) || [];
824
825
  return {
825
826
  id: e.id,
@@ -831,13 +832,13 @@ const yt = /* @__PURE__ */ me({
831
832
  permissionSetIds: M,
832
833
  posUser: e.doc.posUser ? {
833
834
  code: ((le = e.doc.posUser) == null ? void 0 : le.code) ?? "",
834
- name: ((ue = e.doc.posUser) == null ? void 0 : ue.name) ?? e.name,
835
- passcode: ((fe = e.doc.posUser) == null ? void 0 : fe.passcode) ?? "",
835
+ name: ((me = e.doc.posUser) == null ? void 0 : me.name) ?? e.name,
836
+ passcode: ((ve = e.doc.posUser) == null ? void 0 : ve.passcode) ?? "",
836
837
  roles: (($ = e.doc.posUser) == null ? void 0 : $.roles) ?? []
837
838
  } : void 0
838
839
  };
839
840
  }
840
- function Q(e) {
841
+ function Z(e) {
841
842
  const s = u.getPermissionAssignmentByUserId(e.id), F = (s == null ? void 0 : s.customPermissions) || e.permissions || [], M = (s == null ? void 0 : s.permissionSetIds) || [];
842
843
  return {
843
844
  id: e.id,
@@ -850,120 +851,120 @@ const yt = /* @__PURE__ */ me({
850
851
  posUser: void 0
851
852
  };
852
853
  }
853
- const w = v(!1);
854
- let D = 0;
854
+ const w = b(!1);
855
+ let N = 0;
855
856
  const q = async (e, s) => {
856
- if (e == pe.Update) {
857
- const F = ++D;
858
- l.value = Q(s), Y.value = ee.UPDATE, w.value = s.doc.hasPosUser === !0;
857
+ if (e == fe.Update) {
858
+ const F = ++N;
859
+ re.value = Z(s), J.value = ee.UPDATE, w.value = s.doc.hasPosUser === !0;
859
860
  try {
860
- const M = await be.readTeamMember(s.id);
861
- if (F !== D) return;
862
- l.value = K(M);
861
+ const M = await he.readTeamMember(s.id);
862
+ if (F !== N) return;
863
+ re.value = K(M);
863
864
  } catch {
864
- if (F !== D) return;
865
+ if (F !== N) return;
865
866
  C.open({
866
867
  message: t("common.error"),
867
868
  type: "error"
868
- }), z();
869
+ }), v();
869
870
  } finally {
870
- F === D && (w.value = !1);
871
+ F === N && (w.value = !1);
871
872
  }
872
873
  }
873
- e == pe.Remove && H(s);
874
- }, d = os(), X = v(!1), te = v(!1), Y = v(ee.CLOSED), xe = I(() => Y.value !== ee.CLOSED), Fe = I(() => Y.value === ee.ADD ? t("common.add") : t("common.update")), Ue = I(() => Y.value === ee.ADD ? t("team.actions.addMember") : t("team.actions.updateMember")), l = v();
875
- function b(e) {
876
- e || (D++, w.value = !1, Y.value = ee.CLOSED);
874
+ e == fe.Remove && X(s);
875
+ }, d = os(), W = b(!1), oe = b(!1), J = b(ee.CLOSED), Se = I(() => J.value !== ee.CLOSED), Fe = I(() => J.value === ee.ADD ? t("common.add") : t("common.update")), Ue = I(() => J.value === ee.ADD ? t("team.actions.addMember") : t("team.actions.updateMember")), re = b();
876
+ function o(e) {
877
+ e || (N++, w.value = !1, J.value = ee.CLOSED);
877
878
  }
878
- function z() {
879
- D++, w.value = !1, Y.value = ee.CLOSED;
879
+ function v() {
880
+ N++, w.value = !1, J.value = ee.CLOSED;
880
881
  }
881
882
  const {
882
- breakpoints: Z
883
- } = qe(), H = (e) => {
883
+ breakpoints: Q
884
+ } = qe(), X = (e) => {
884
885
  d.open({
885
886
  title: t("team.actions.removeMember"),
886
887
  message: t("team.removeMember.confirmationMessage", {
887
888
  memberName: e.name
888
889
  }),
889
- minWidth: Z.value.lg ? 588 : 0,
890
+ minWidth: Q.value.lg ? 588 : 0,
890
891
  primaryActions: {
891
892
  text: "Remove",
892
893
  close: !1,
893
894
  variant: "destructive",
894
- isLoading: te
895
+ isLoading: oe
895
896
  },
896
897
  secondaryActions: {
897
898
  text: "Cancel",
898
899
  close: !0
899
900
  }
900
901
  }).onPrimary(async () => {
901
- te.value || (await g.minor(async () => {
902
- await be.deleteTeamMember(e.id), await oe();
902
+ oe.value || (await g.minor(async () => {
903
+ await he.deleteTeamMember(e.id), await H();
903
904
  }, {
904
- isLoading: te,
905
+ isLoading: oe,
905
906
  successMessage: t("team.removeMember.successMessage", {
906
907
  memberName: e.name
907
908
  })
908
909
  }).catch(() => {
909
910
  }), d.close());
910
911
  });
911
- }, ae = () => {
912
- l.value = null, Y.value = ee.ADD;
913
- }, G = v(), W = v(), re = I(() => {
912
+ }, Y = () => {
913
+ re.value = null, J.value = ee.ADD;
914
+ }, D = b(), z = b(), ie = I(() => {
914
915
  var e;
915
916
  return JSON.stringify({
916
917
  businessId: ((e = r.currentBusiness.value) == null ? void 0 : e._id) ?? "",
917
918
  search: T.value.trim(),
918
- restaurantIds: [...G.value ?? []].sort(),
919
- permissionSubjects: [...W.value ?? []].sort()
919
+ restaurantIds: [...D.value ?? []].sort(),
920
+ permissionSubjects: [...z.value ?? []].sort()
920
921
  });
921
- }), ie = I(() => Object.values(rs).map((e) => ({
922
+ }), ue = I(() => Object.values(rs).map((e) => ({
922
923
  label: e.label,
923
924
  value: e.subject
924
925
  })));
925
- async function ce() {
926
+ async function de() {
926
927
  await L.readRoles();
927
928
  }
928
- async function N(e = h.value) {
929
+ async function te(e = y.value) {
929
930
  var s, F;
930
931
  P.value = !0;
931
932
  try {
932
- const M = await be.readTeamMembersPage({
933
- limit: de,
934
- offset: (e - 1) * de,
933
+ const M = await he.readTeamMembersPage({
934
+ limit: pe,
935
+ offset: (e - 1) * pe,
935
936
  search: T.value.trim() || void 0,
936
- restaurantIds: (s = G.value) != null && s.length ? G.value : void 0,
937
- permissionSubjects: (F = W.value) != null && F.length ? W.value : void 0
937
+ restaurantIds: (s = D.value) != null && s.length ? D.value : void 0,
938
+ permissionSubjects: (F = z.value) != null && F.length ? z.value : void 0
938
939
  });
939
- A.value = M.items, J.value = M.total;
940
+ A.value = M.items, G.value = M.total;
940
941
  } finally {
941
942
  P.value = !1;
942
943
  }
943
944
  }
944
- async function oe() {
945
+ async function H() {
945
946
  var s;
946
947
  if (!((s = r.currentBusiness.value) != null && s._id)) return;
947
- await N(h.value);
948
- const e = Math.max(1, Math.ceil(J.value / de));
949
- h.value > e && (h.value = e, await N(h.value));
948
+ await te(y.value);
949
+ const e = Math.max(1, Math.ceil(G.value / pe));
950
+ y.value > e && (y.value = e, await te(y.value));
950
951
  }
951
- const Se = v();
952
+ const ae = b();
952
953
  async function Qe() {
953
- if (!Se.value) return;
954
- const e = await Se.value.validate();
954
+ if (!ae.value) return;
955
+ const e = await ae.value.validate();
955
956
  if (!e) return;
956
- const s = Y.value === ee.ADD;
957
+ const s = J.value === ee.ADD;
957
958
  await g.minor(async () => {
958
- await (s ? be.createTeamMember(e) : be.updateTeamMember(l.value.id, e)), z(), await $e(), await oe();
959
+ await (s ? he.createTeamMember(e) : he.updateTeamMember(re.value.id, e)), v(), await $e(), await H();
959
960
  }, {
960
- isLoading: X,
961
+ isLoading: W,
961
962
  successMessage: s ? t("team.addMember.successMessage", {
962
963
  memberName: e.name
963
964
  }) : t("team.updateMember.successMessage", {
964
965
  memberName: e.name
965
966
  })
966
- }), Y.value = ee.CLOSED;
967
+ }), J.value = ee.CLOSED;
967
968
  }
968
969
  async function Ye() {
969
970
  await _.readPermissionSets();
@@ -976,10 +977,10 @@ const yt = /* @__PURE__ */ me({
976
977
  pageIndex: e
977
978
  }) {
978
979
  var s;
979
- if ((s = r.currentBusiness.value) != null && s._id && !Ve && !(e === 0 && h.value === 1 && A.value.length > 0)) {
980
- Ve = !0, h.value = e + 1;
980
+ if ((s = r.currentBusiness.value) != null && s._id && !Ve && !(e === 0 && y.value === 1 && A.value.length > 0)) {
981
+ Ve = !0, y.value = e + 1;
981
982
  try {
982
- await N(h.value);
983
+ await te(y.value);
983
984
  } finally {
984
985
  Ve = !1;
985
986
  }
@@ -988,34 +989,34 @@ const yt = /* @__PURE__ */ me({
988
989
  const es = ls(V, () => {
989
990
  T.value = V.value;
990
991
  });
991
- return as(es), ye(re, async () => {
992
+ return as(es), ye(ie, async () => {
992
993
  var e;
993
- h.value = 1, S.value = !1, (e = r.currentBusiness.value) != null && e._id && (await N(1), S.value = !0);
994
+ y.value = 1, S.value = !1, (e = r.currentBusiness.value) != null && e._id && (await te(1), S.value = !0);
994
995
  }, {
995
996
  immediate: !0
996
997
  }), ye(r.currentBusiness, async () => {
997
998
  var e;
998
- (e = r.currentBusiness.value) != null && e._id && (await Promise.all([Ye(), $e(), n(), r.restaurants.value.length === 0 ? r.readRestaurants() : Promise.resolve()]), ce());
999
+ (e = r.currentBusiness.value) != null && e._id && (await Promise.all([Ye(), $e(), n(), r.restaurants.value.length === 0 ? r.readRestaurants() : Promise.resolve()]), de());
999
1000
  }, {
1000
1001
  immediate: !0
1001
- }), y({
1002
- create: ae
1002
+ }), h({
1003
+ create: Y
1003
1004
  }), (e, s) => {
1004
- var fe;
1005
- const F = x("FmSearch"), M = x("FmTable"), le = x("FmButton"), ue = x("FmSideSheet");
1006
- return f(), E(he, null, [c("div", ut, [c("div", mt, [c("div", ct, [c("div", dt, [p(m(Me), {
1007
- modelValue: G.value,
1008
- "onUpdate:modelValue": s[0] || (s[0] = ($) => G.value = $),
1005
+ var ve;
1006
+ const F = x("FmSearch"), M = x("FmTable"), le = x("FmButton"), me = x("FmSideSheet");
1007
+ return f(), j(_e, null, [c("div", ut, [c("div", mt, [c("div", ct, [c("div", dt, [p(m(Me), {
1008
+ modelValue: D.value,
1009
+ "onUpdate:modelValue": s[0] || (s[0] = ($) => D.value = $),
1009
1010
  "managable-only": !1,
1010
1011
  multiple: "",
1011
1012
  variant: "dark",
1012
1013
  class: "!w-auto"
1013
1014
  }, null, 8, ["modelValue"]), p(De, {
1014
- modelValue: W.value,
1015
- "onUpdate:modelValue": s[1] || (s[1] = ($) => W.value = $),
1015
+ modelValue: z.value,
1016
+ "onUpdate:modelValue": s[1] || (s[1] = ($) => z.value = $),
1016
1017
  multiple: "",
1017
1018
  variant: "dark",
1018
- items: ie.value,
1019
+ items: ue.value,
1019
1020
  "selected-prefix": m(t)("team.filter.selected_permission_prefix"),
1020
1021
  placeholder: m(t)("team.filter.permission_placeholder")
1021
1022
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), p(F, {
@@ -1031,77 +1032,77 @@ const yt = /* @__PURE__ */ me({
1031
1032
  autofocus: "",
1032
1033
  placeholder: m(t)("team.search.placeholder")
1033
1034
  }, null, 8, ["modelValue", "placeholder"]), c("div", ft, [p(m(Me), {
1034
- modelValue: G.value,
1035
- "onUpdate:modelValue": s[4] || (s[4] = ($) => G.value = $),
1035
+ modelValue: D.value,
1036
+ "onUpdate:modelValue": s[4] || (s[4] = ($) => D.value = $),
1036
1037
  "managable-only": !1,
1037
1038
  multiple: "",
1038
1039
  variant: "dark",
1039
1040
  class: "!w-auto"
1040
1041
  }, null, 8, ["modelValue"]), p(De, {
1041
- modelValue: W.value,
1042
- "onUpdate:modelValue": s[5] || (s[5] = ($) => W.value = $),
1042
+ modelValue: z.value,
1043
+ "onUpdate:modelValue": s[5] || (s[5] = ($) => z.value = $),
1043
1044
  multiple: "",
1044
1045
  variant: "dark",
1045
- items: ie.value,
1046
+ items: ue.value,
1046
1047
  "selected-prefix": m(t)("team.filter.selected_permission_prefix"),
1047
1048
  placeholder: m(t)("team.filter.permission_placeholder")
1048
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), (fe = m(r).currentBusiness.value) != null && fe._id ? (f(), k(is, {
1049
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), (ve = m(r).currentBusiness.value) != null && ve._id ? (f(), k(is, {
1049
1050
  key: 0
1050
1051
  }, {
1051
- default: j(() => [c("div", vt, [S.value ? J.value === 0 ? (f(), k(m(ms), {
1052
+ default: E(() => [c("div", vt, [S.value ? G.value === 0 ? (f(), k(m(ms), {
1052
1053
  key: 1,
1053
1054
  title: m(t)("team.emptyState.title"),
1054
1055
  subtitle: m(t)("team.emptyState.description")
1055
1056
  }, null, 8, ["title", "subtitle"])) : O("", !0) : (f(), k(us, {
1056
1057
  key: 0
1057
1058
  })), S.value ? (f(), k(M, {
1058
- key: re.value,
1059
+ key: ie.value,
1059
1060
  "column-defs": i,
1060
1061
  "row-data": A.value,
1061
- "page-size": de,
1062
- "page-count": Math.ceil(J.value / de),
1063
- "row-count": J.value,
1062
+ "page-size": pe,
1063
+ "page-count": Math.ceil(G.value / pe),
1064
+ "row-count": G.value,
1064
1065
  "fetch-fn": He,
1065
- "hide-footer": J.value <= de,
1066
+ "hide-footer": G.value <= pe,
1066
1067
  virtual: !1,
1067
1068
  loading: P.value,
1068
1069
  class: "team-member-list-table min-h-0 flex-1",
1069
1070
  "pin-header-row": "",
1070
- onRowClick: s[6] || (s[6] = ($) => q(m(pe).Update, $.original))
1071
+ onRowClick: s[6] || (s[6] = ($) => q(m(fe).Update, $.original))
1071
1072
  }, null, 8, ["row-data", "page-count", "row-count", "hide-footer", "loading"])) : O("", !0)])]),
1072
1073
  _: 1
1073
- })) : O("", !0)])]), p(ue, {
1074
+ })) : O("", !0)])]), p(me, {
1074
1075
  header: Ue.value,
1075
- "model-value": xe.value,
1076
+ "model-value": Se.value,
1076
1077
  "max-width": 560,
1077
1078
  "dismiss-away": "",
1078
1079
  class: "absolute",
1079
- "onUpdate:modelValue": s[7] || (s[7] = ($) => b($))
1080
+ "onUpdate:modelValue": s[7] || (s[7] = ($) => o($))
1080
1081
  }, {
1081
- "side-sheet-footer": j(() => [c("div", bt, [p(le, {
1082
+ "side-sheet-footer": E(() => [c("div", bt, [p(le, {
1082
1083
  label: Fe.value,
1083
1084
  size: "md",
1084
1085
  variant: "primary",
1085
- disabled: X.value || w.value,
1086
- onClick: Ee(Qe, ["prevent"])
1086
+ disabled: W.value || w.value,
1087
+ onClick: je(Qe, ["prevent"])
1087
1088
  }, null, 8, ["label", "disabled"]), p(le, {
1088
1089
  label: m(t)("common.cancel"),
1089
1090
  size: "md",
1090
1091
  variant: "secondary",
1091
- disabled: X.value,
1092
- onClick: z
1092
+ disabled: W.value,
1093
+ onClick: v
1093
1094
  }, null, 8, ["label", "disabled"])])]),
1094
- default: j(() => [p(it, {
1095
+ default: E(() => [p(it, {
1095
1096
  ref_key: "memberForm",
1096
- ref: Se,
1097
- initialValue: l.value,
1097
+ ref: ae,
1098
+ initialValue: re.value,
1098
1099
  "is-loading-master-user": w.value
1099
1100
  }, null, 8, ["initialValue", "is-loading-master-user"])]),
1100
1101
  _: 1
1101
1102
  }, 8, ["header", "model-value"])], 64);
1102
1103
  };
1103
1104
  }
1104
- }), Ct = /* @__PURE__ */ Ge(yt, [["__scopeId", "data-v-d77998ca"]]);
1105
+ }), Mt = /* @__PURE__ */ Ge(ht, [["__scopeId", "data-v-d77998ca"]]);
1105
1106
  export {
1106
- Ct as default
1107
+ Mt as default
1107
1108
  };