@feedmepos/mf-hrm-portal 1.1.3-dev.1 → 1.1.3-dev.2

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 (35) hide show
  1. package/dist/AuditLogList-kZBi77lv.js +435 -0
  2. package/dist/{EmployeeList-BWDsSFoY.js → EmployeeList-Cg-mhdLv.js} +5 -5
  3. package/dist/{Main-VjhiuuHr.js → Main-BHF7vXlD.js} +28 -27
  4. package/dist/{Main-D5YEKOpl.js → Main-CC9_bKTG.js} +7 -7
  5. package/dist/PermissionSetList-C0FOYrQ6.js +283 -0
  6. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CS4B-7AU.js +3084 -0
  7. package/dist/{RoleList-CfPD_Gk_.js → RoleList-D2NTVZa_.js} +5 -5
  8. package/dist/{TeamMemberList-DEYo6_pS.js → TeamMemberList-DC0Gxjin.js} +325 -322
  9. package/dist/{TimesheetList-BTTBjTrO.js → TimesheetList-CksRCsTc.js} +6 -6
  10. package/dist/api/index.d.ts +4 -0
  11. package/dist/api/team/index.d.ts +2 -2
  12. package/dist/{app-CfIHEA52.js → app-kKq54h9D.js} +606 -504
  13. package/dist/app.js +3 -3
  14. package/dist/{dayjs.min-C8cBXLt-.js → dayjs.min-CGTR0SS0.js} +1 -1
  15. package/dist/{employee-ChJpkvUF.js → employee-CRKx3zN0.js} +3 -3
  16. package/dist/helpers/permission-set.d.ts +15 -0
  17. package/dist/{index-CgbDOn3W.js → index-DRoNwfyW.js} +2153 -2053
  18. package/dist/index-TP4vQCyq.js +827 -0
  19. package/dist/{lodash-0EOIqOEG.js → lodash-CeWi5dyp.js} +1 -1
  20. package/dist/stores/team.d.ts +4 -1
  21. package/dist/team-CuLNHjGN.js +29 -0
  22. package/dist/{timesheet-DTI6G4DD.js → timesheet-V636ISlI.js} +2 -2
  23. package/dist/tsconfig.app.tsbuildinfo +1 -1
  24. package/dist/{useAppStore-DCpMNDxE.js → useAppStore-DoX0IUFz.js} +1 -1
  25. package/dist/{useLoading-ChLCiMQj.js → useLoading-1yy1KHsE.js} +1 -1
  26. package/dist/views/audit-log/locales/index.d.ts +40 -8
  27. package/dist/views/team/locales/index.d.ts +12 -8
  28. package/package.json +3 -2
  29. package/dist/AuditLogList-qGKeg-cd.js +0 -384
  30. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-yghfcQRF.js +0 -3050
  31. package/dist/RolePermissionList-Cu1KTuuI.js +0 -285
  32. package/dist/team-C2muObo8.js +0 -26
  33. package/dist/types/permission.d.ts +0 -1
  34. /package/dist/views/team/{role/RolePermissionForm.vue.d.ts → permission-set/PermissionSetForm.vue.d.ts} +0 -0
  35. /package/dist/views/team/{role/RolePermissionList.vue.d.ts → permission-set/PermissionSetList.vue.d.ts} +0 -0
@@ -1,53 +1,54 @@
1
- import { defineComponent as se, ref as F, resolveComponent as h, createBlock as M, openBlock as v, withCtx as z, createElementVNode as r, renderSlot as de, createCommentVNode as Q, withModifiers as $e, nextTick as Pe, createElementBlock as K, normalizeClass as Ie, createTextVNode as Me, toDisplayString as O, computed as I, Fragment as re, renderList as pe, createVNode as i, unref as n, watch as Ce, isRef as fe, createSlots as je } from "vue";
2
- import { useI18n as me, useCoreStore as ie, baseClientInstance as xe, RestaurantSelector as Fe } from "@feedmepos/mf-common";
3
- import { useBreakpoints as Ne, useSnackbar as Re, useDialog as Te, components as Ve } from "@feedmepos/ui-library";
4
- import { _ as ze, S as Se } from "./SelectFilter-NbXrJ4iH.js";
5
- import { s as Ke, o as qe, _ as Ge } from "./app-CfIHEA52.js";
6
- import { _ as We } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
1
+ import { defineComponent as te, ref as x, resolveComponent as h, createBlock as k, openBlock as f, withCtx as T, createElementVNode as r, renderSlot as pe, createCommentVNode as J, withModifiers as $e, nextTick as Pe, createElementBlock as z, normalizeClass as Ie, createTextVNode as Me, toDisplayString as O, computed as M, Fragment as ie, renderList as fe, createVNode as m, unref as n, watch as Ce, isRef as ve, createSlots as Ee } from "vue";
2
+ import { useI18n as ue, useCoreStore as me, baseClientInstance as Ve, RestaurantSelector as xe } from "@feedmepos/mf-common";
3
+ import { useBreakpoints as Ne, useSnackbar as Re, useDialog as je, components as Fe } from "@feedmepos/ui-library";
4
+ import { _ as Te, S as Se } from "./SelectFilter-NbXrJ4iH.js";
5
+ import { s as ze, o as Ke, _ as qe } from "./app-kKq54h9D.js";
6
+ import { _ as Ge } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
7
  import { u as Be } from "./useSearch-B6WK1LBB.js";
8
- import { u as Je } from "./useLoading-ChLCiMQj.js";
9
- import { g as Ue, l as De, u as Oe, m as we, n as ve, o as Qe, q as Xe, t as ue, v as Ye } from "./index-CgbDOn3W.js";
10
- import { u as Ae } from "./useAppStore-DCpMNDxE.js";
8
+ import { u as We } from "./useLoading-1yy1KHsE.js";
9
+ import { g as Ue, l as De, u as Oe, m as we, n as be, o as Je, q as Qe, v as Xe, t as ce, w as Ye } from "./index-DRoNwfyW.js";
10
+ import "./index-TP4vQCyq.js";
11
+ import { u as Ae } from "./useAppStore-DoX0IUFz.js";
11
12
  /* empty css */
12
- import { _ as Ze, a as He } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-yghfcQRF.js";
13
- import { u as es } from "./team-C2muObo8.js";
14
- const ss = /* @__PURE__ */ se({
13
+ import { _ as Ze, a as He } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CS4B-7AU.js";
14
+ import { u as es } from "./team-CuLNHjGN.js";
15
+ const ss = /* @__PURE__ */ te({
15
16
  __name: "BottomSheetMenu",
16
17
  setup(t) {
17
- const p = F(!1);
18
+ const p = x(!1);
18
19
  async function e() {
19
20
  await Pe(), p.value = !p.value;
20
21
  }
21
22
  return (_, u) => {
22
- const A = h("FmButton"), k = h("FmBottomSheet");
23
- return v(), M(k, {
23
+ const A = h("FmButton"), $ = h("FmBottomSheet");
24
+ return f(), k($, {
24
25
  modelValue: p.value,
25
- "onUpdate:modelValue": u[1] || (u[1] = (y) => p.value = y),
26
+ "onUpdate:modelValue": u[1] || (u[1] = (b) => p.value = b),
26
27
  "dismiss-away": "",
27
28
  "no-header": "",
28
29
  "z-index": 110
29
30
  }, {
30
- "bottom-sheet-button": z(() => [
31
- _.$slots.button ? Q("", !0) : (v(), M(A, {
31
+ "bottom-sheet-button": T(() => [
32
+ _.$slots.button ? J("", !0) : (f(), k(A, {
32
33
  key: 0,
33
34
  icon: "more_vert",
34
35
  variant: "tertiary",
35
36
  onClick: $e(e, ["stop"])
36
37
  })),
37
- de(_.$slots, "button")
38
+ pe(_.$slots, "button")
38
39
  ]),
39
- default: z(() => [
40
+ default: T(() => [
40
41
  r("div", {
41
- onClick: u[0] || (u[0] = (y) => p.value = !1)
42
+ onClick: u[0] || (u[0] = (b) => p.value = !1)
42
43
  }, [
43
- de(_.$slots, "default")
44
+ pe(_.$slots, "default")
44
45
  ])
45
46
  ]),
46
47
  _: 3
47
48
  }, 8, ["modelValue"]);
48
49
  };
49
50
  }
50
- }), ts = { class: "py-8 px-12 hover:bg-fm-color-neutral-gray-100" }, as = /* @__PURE__ */ se({
51
+ }), ts = { class: "py-8 px-12 hover:bg-fm-color-neutral-gray-100" }, as = /* @__PURE__ */ te({
51
52
  __name: "BottomSheetMenuItem",
52
53
  props: {
53
54
  label: {},
@@ -59,8 +60,8 @@ const ss = /* @__PURE__ */ se({
59
60
  const p = t;
60
61
  return (e, _) => {
61
62
  const u = h("FmIcon");
62
- return v(), K("div", ts, [
63
- e.$slots.content ? Q("", !0) : (v(), K("div", {
63
+ return f(), z("div", ts, [
64
+ e.$slots.content ? J("", !0) : (f(), z("div", {
64
65
  key: 0,
65
66
  class: Ie(["flex items-center", {
66
67
  "text-fm-color-typo-disabled": p.disabled,
@@ -69,31 +70,31 @@ const ss = /* @__PURE__ */ se({
69
70
  [p.itemClass || ""]: p.itemClass && !p.disabled
70
71
  }])
71
72
  }, [
72
- t.icon ? (v(), M(u, {
73
+ t.icon ? (f(), k(u, {
73
74
  key: 0,
74
75
  name: t.icon
75
- }, null, 8, ["name"])) : Q("", !0),
76
+ }, null, 8, ["name"])) : J("", !0),
76
77
  Me(" " + O(t.label), 1)
77
78
  ], 2)),
78
- de(e.$slots, "content")
79
+ pe(e.$slots, "content")
79
80
  ]);
80
81
  };
81
82
  }
82
- }), ls = /* @__PURE__ */ se({
83
+ }), ls = /* @__PURE__ */ te({
83
84
  __name: "ResponsiveContextMenu",
84
85
  props: {
85
86
  items: {}
86
87
  },
87
88
  setup(t) {
88
- const p = Ne(), e = I(() => p.breakpoints.value.xs);
89
+ const p = Ne(), e = M(() => p.breakpoints.value.xs);
89
90
  return (_, u) => {
90
- const A = h("FmButton"), k = h("FmMenuItem"), y = h("FmMenu");
91
- return e.value ? (v(), M(ss, { key: 0 }, {
92
- default: z(() => [
93
- (v(!0), K(re, null, pe(t.items, ({ icon: m, label: b, disabled: C, itemClass: N, onClick: R }) => (v(), M(as, {
94
- key: b,
95
- icon: m,
96
- label: b,
91
+ const A = h("FmButton"), $ = h("FmMenuItem"), b = h("FmMenu");
92
+ return e.value ? (f(), k(ss, { key: 0 }, {
93
+ default: T(() => [
94
+ (f(!0), z(ie, null, fe(t.items, ({ icon: i, label: y, disabled: C, itemClass: N, onClick: R }) => (f(), k(as, {
95
+ key: y,
96
+ icon: i,
97
+ label: y,
97
98
  disabled: C,
98
99
  itemClass: N,
99
100
  onClick: () => {
@@ -102,13 +103,13 @@ const ss = /* @__PURE__ */ se({
102
103
  }, null, 8, ["icon", "label", "disabled", "itemClass", "onClick"]))), 128))
103
104
  ]),
104
105
  _: 1
105
- })) : (v(), M(y, {
106
+ })) : (f(), k(b, {
106
107
  key: 1,
107
108
  "stop-click-propagation": "",
108
109
  shift: !0
109
110
  }, {
110
- "menu-button": z(() => [
111
- i(A, {
111
+ "menu-button": T(() => [
112
+ m(A, {
112
113
  type: "button",
113
114
  variant: "tertiary",
114
115
  icon: "more_vert",
@@ -116,19 +117,19 @@ const ss = /* @__PURE__ */ se({
116
117
  size: "md"
117
118
  })
118
119
  ]),
119
- default: z(() => [
120
- (v(!0), K(re, null, pe(t.items, ({ label: m, disabled: b, itemClass: C, onClick: N }) => (v(), M(k, {
121
- key: m,
122
- disabled: b,
123
- label: m,
120
+ default: T(() => [
121
+ (f(!0), z(ie, null, fe(t.items, ({ label: i, disabled: y, itemClass: C, onClick: N }) => (f(), k($, {
122
+ key: i,
123
+ disabled: y,
124
+ label: i,
124
125
  onClick: () => {
125
- !b && (N == null || N());
126
+ !y && (N == null || N());
126
127
  }
127
128
  }, {
128
- label: z(() => [
129
+ label: T(() => [
129
130
  r("span", {
130
- class: Ie(b ? "text-fm-color-typo-disabled" : C)
131
- }, O(m), 3)
131
+ class: Ie(y ? "text-fm-color-typo-disabled" : C)
132
+ }, O(i), 3)
132
133
  ]),
133
134
  _: 2
134
135
  }, 1032, ["disabled", "label", "onClick"]))), 128))
@@ -138,19 +139,19 @@ const ss = /* @__PURE__ */ se({
138
139
  };
139
140
  }
140
141
  });
141
- var ne = /* @__PURE__ */ ((t) => (t.Update = "Update", t.Remove = "Remove", t))(ne || {});
142
- const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-center gap-16" }, rs = { class: "space-y-4 min-w-0 flex-1" }, is = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, ms = { class: "fm-typo-en-body-lg-600 truncate" }, us = { class: "w-full flex gap-16 items-center" }, cs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, ds = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, ps = { class: "fm-typo-en-body-lg-600 truncate" }, fs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, vs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, bs = { class: "fm-typo-en-body-lg-600 truncate" }, ys = /* @__PURE__ */ se({
142
+ var re = /* @__PURE__ */ ((t) => (t.Update = "Update", t.Remove = "Remove", t))(re || {});
143
+ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-center gap-16" }, rs = { class: "space-y-4 min-w-0 flex-1" }, is = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, ms = { class: "fm-typo-en-body-lg-600 truncate" }, us = { class: "w-full flex gap-16 items-center" }, cs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, ds = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, ps = { class: "fm-typo-en-body-lg-600 truncate" }, fs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, vs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, bs = { class: "fm-typo-en-body-lg-600 truncate" }, ys = /* @__PURE__ */ te({
143
144
  __name: "MemberInfo",
144
145
  props: {
145
146
  data: {}
146
147
  },
147
148
  setup(t) {
148
- const { t: p } = me();
149
+ const { t: p } = ue();
149
150
  return (e, _) => {
150
151
  const u = h("FmAvatar");
151
- return v(), K("div", os, [
152
+ return f(), z("div", os, [
152
153
  r("div", ns, [
153
- i(u, {
154
+ m(u, {
154
155
  size: "xl",
155
156
  initials: t.data.name
156
157
  }, null, 8, ["initials"]),
@@ -175,117 +176,117 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
175
176
  }), ke = {
176
177
  async readPermissionUserByPhoneNo(t) {
177
178
  var e;
178
- const { currentBusiness: p } = ie();
179
+ const { currentBusiness: p } = me();
179
180
  return Ue(
180
- await xe("/").get(`/user/b/${(e = p.value) == null ? void 0 : e._id}/phone/${t}`)
181
+ await Ve("/").get(`/user/b/${(e = p.value) == null ? void 0 : e._id}/phone/${t}`)
181
182
  );
182
183
  },
183
184
  async readPermissionUserByEmail(t) {
184
185
  var e;
185
- const { currentBusiness: p } = ie();
186
+ const { currentBusiness: p } = me();
186
187
  return Ue(
187
- await xe("/").get(`/user/b/${(e = p.value) == null ? void 0 : e._id}/email/${t}`)
188
+ await Ve("/").get(`/user/b/${(e = p.value) == null ? void 0 : e._id}/email/${t}`)
188
189
  );
189
190
  }
190
191
  }, _s = { class: "flex flex-col gap-24 w-full" }, hs = {
191
192
  key: 0,
192
193
  class: "flex flex-col gap-8"
193
- }, gs = { class: "user-info-icon user-info-icon--lg" }, xs = { class: "flex-1 overflow-hidden" }, Fs = { class: "profile-displayName" }, Vs = { class: "profile-email" }, Ss = { class: "profile-phone" }, Us = { key: 2 }, ws = /* @__PURE__ */ se({
194
+ }, gs = { class: "user-info-icon user-info-icon--lg" }, Vs = { class: "flex-1 overflow-hidden" }, xs = { class: "profile-displayName" }, Fs = { class: "profile-email" }, Ss = { class: "profile-phone" }, Us = { key: 2 }, ws = /* @__PURE__ */ te({
194
195
  __name: "PortalUserSearcher",
195
196
  emits: ["invite"],
196
197
  setup(t, { emit: p }) {
197
- const e = p, { t: _ } = me(), u = Re(), A = ie(), k = F("phone"), y = F(""), m = F(""), b = F();
198
+ const e = p, { t: _ } = ue(), u = Re(), A = me(), $ = x("phone"), b = x(""), i = x(""), y = x();
198
199
  async function C() {
199
- if (!y.value && !m.value) {
200
+ if (!b.value && !i.value) {
200
201
  u.open({
201
202
  type: "error",
202
203
  title: _("team.memberForm.searchUser.emptyError")
203
204
  });
204
205
  return;
205
206
  }
206
- const g = k.value === "phone" ? await ke.readPermissionUserByPhoneNo(y.value.replace(/ /g, "")) : await ke.readPermissionUserByEmail(m.value);
207
+ const g = $.value === "phone" ? await ke.readPermissionUserByPhoneNo(b.value.replace(/ /g, "")) : await ke.readPermissionUserByEmail(i.value);
207
208
  g || u.open({
208
209
  type: "error",
209
210
  title: _("team.memberForm.searchUser.userNotFound")
210
- }), b.value = g;
211
+ }), y.value = g;
211
212
  }
212
- const N = I(() => {
213
- var x;
214
- let g = ((x = b.value) == null ? void 0 : x.displayName) ?? "";
213
+ const N = M(() => {
214
+ var V;
215
+ let g = ((V = y.value) == null ? void 0 : V.displayName) ?? "";
215
216
  g || (g = "Feed Me");
216
- const [V, E] = g.split(" ");
217
- return E ? `${V[0]}${E[0]}` : V.slice(0, 2);
218
- }), R = F(!1);
219
- function te(g) {
217
+ const [F, E] = g.split(" ");
218
+ return E ? `${F[0]}${E[0]}` : F.slice(0, 2);
219
+ }), R = x(!1);
220
+ function ae(g) {
220
221
  e("invite", g), R.value = !0;
221
222
  }
222
- function ae() {
223
+ function le() {
223
224
  R.value = !1;
224
225
  }
225
- return (g, V) => {
226
- var $, q, G;
227
- const E = h("FmRadio"), x = h("FmPhoneNumber"), a = h("FmTextField"), o = h("FmRadioGroup"), S = h("FmButton");
228
- return v(), K("div", _s, [
229
- R.value ? Q("", !0) : (v(), K("div", hs, [
230
- i(o, {
231
- modelValue: k.value,
232
- "onUpdate:modelValue": V[2] || (V[2] = (P) => k.value = P)
226
+ return (g, F) => {
227
+ var P, K, q;
228
+ const E = h("FmRadio"), V = h("FmPhoneNumber"), a = h("FmTextField"), o = h("FmRadioGroup"), S = h("FmButton");
229
+ return f(), z("div", _s, [
230
+ R.value ? J("", !0) : (f(), z("div", hs, [
231
+ m(o, {
232
+ modelValue: $.value,
233
+ "onUpdate:modelValue": F[2] || (F[2] = (I) => $.value = I)
233
234
  }, {
234
- default: z(() => [
235
- i(E, {
235
+ default: T(() => [
236
+ m(E, {
236
237
  value: "phone",
237
238
  label: n(_)("team.memberForm.searchUser.phoneNumber")
238
239
  }, null, 8, ["label"]),
239
- k.value === "phone" ? (v(), M(x, {
240
+ $.value === "phone" ? (f(), k(V, {
240
241
  key: 0,
241
- modelValue: y.value,
242
- "onUpdate:modelValue": V[0] || (V[0] = (P) => y.value = P),
242
+ modelValue: b.value,
243
+ "onUpdate:modelValue": F[0] || (F[0] = (I) => b.value = I),
243
244
  "extra-country-codes": n(A).enabledCountries.value,
244
245
  class: "ml-8"
245
- }, null, 8, ["modelValue", "extra-country-codes"])) : Q("", !0),
246
- i(E, {
246
+ }, null, 8, ["modelValue", "extra-country-codes"])) : J("", !0),
247
+ m(E, {
247
248
  value: "email",
248
249
  label: n(_)("team.memberForm.searchUser.email")
249
250
  }, null, 8, ["label"]),
250
- k.value === "email" ? (v(), M(a, {
251
+ $.value === "email" ? (f(), k(a, {
251
252
  key: 1,
252
- modelValue: m.value,
253
- "onUpdate:modelValue": V[1] || (V[1] = (P) => m.value = P),
253
+ modelValue: i.value,
254
+ "onUpdate:modelValue": F[1] || (F[1] = (I) => i.value = I),
254
255
  placeholder: n(_)("team.memberForm.searchUser.emailPlaceholder"),
255
256
  class: "ml-8"
256
- }, null, 8, ["modelValue", "placeholder"])) : Q("", !0)
257
+ }, null, 8, ["modelValue", "placeholder"])) : J("", !0)
257
258
  ]),
258
259
  _: 1
259
260
  }, 8, ["modelValue"]),
260
- i(S, {
261
+ m(S, {
261
262
  label: n(_)("team.memberForm.searchUser.search"),
262
263
  variant: "secondary",
263
264
  onClick: C
264
265
  }, null, 8, ["label"])
265
266
  ])),
266
- b.value ? (v(), K("div", {
267
+ y.value ? (f(), z("div", {
267
268
  key: 1,
268
269
  class: "profile-menu--profile cursor-pointer hover:bg-fm-color-opacity-sm",
269
- onClick: V[3] || (V[3] = (P) => te(b.value))
270
+ onClick: F[3] || (F[3] = (I) => ae(y.value))
270
271
  }, [
271
272
  r("div", gs, O(N.value), 1),
272
- r("div", xs, [
273
- r("p", Fs, O(($ = b.value) == null ? void 0 : $.displayName), 1),
274
- r("p", Vs, O((q = b.value) == null ? void 0 : q.email), 1),
275
- r("p", Ss, O((G = b.value) == null ? void 0 : G.phoneNumber), 1)
273
+ r("div", Vs, [
274
+ r("p", xs, O((P = y.value) == null ? void 0 : P.displayName), 1),
275
+ r("p", Fs, O((K = y.value) == null ? void 0 : K.email), 1),
276
+ r("p", Ss, O((q = y.value) == null ? void 0 : q.phoneNumber), 1)
276
277
  ])
277
- ])) : Q("", !0),
278
- R.value ? (v(), K("div", Us, [
279
- i(S, {
278
+ ])) : J("", !0),
279
+ R.value ? (f(), z("div", Us, [
280
+ m(S, {
280
281
  label: n(_)("team.memberForm.searchUser.changeUser"),
281
282
  variant: "secondary",
282
- onClick: ae
283
+ onClick: le
283
284
  }, null, 8, ["label"])
284
- ])) : Q("", !0)
285
+ ])) : J("", !0)
285
286
  ]);
286
287
  };
287
288
  }
288
- }), ks = /* @__PURE__ */ ze(ws, [["__scopeId", "data-v-c2c7ed35"]]), $s = { class: "flex flex-col gap-40" }, Ps = { class: "flex items-center" }, Is = { class: "flex-1 flex flex-col" }, Ms = { class: "fm-typo-en-title-sm-600" }, Cs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ns = { class: "flex flex-row gap-16" }, Rs = { class: "flex flex-col gap-8" }, Bs = { class: "fm-typo-en-body-lg-400" }, Ds = { class: "p-16 fm-corner-radius-lg border border-fm-color-neutral-gray-200" }, ce = 4, Os = /* @__PURE__ */ se({
289
+ }), ks = /* @__PURE__ */ Te(ws, [["__scopeId", "data-v-c2c7ed35"]]), $s = { class: "flex flex-col gap-40" }, Ps = { class: "flex items-center" }, Is = { class: "flex-1 flex flex-col" }, Ms = { class: "fm-typo-en-title-sm-600" }, Cs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ns = { class: "flex flex-row gap-16" }, Rs = { class: "flex flex-col gap-8" }, Bs = { class: "fm-typo-en-body-lg-400" }, Ds = { class: "p-16 fm-corner-radius-lg border border-fm-color-neutral-gray-200" }, de = 4, Os = /* @__PURE__ */ te({
289
290
  __name: "TeamMemberMasterUser",
290
291
  props: {
291
292
  modelValue: {
@@ -311,32 +312,32 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
311
312
  },
312
313
  emits: ["update:model-value"],
313
314
  setup(t, { emit: p }) {
314
- const e = t, _ = p, { t: u } = me(), { searchKey: A, filter: k } = Be(""), y = F(!0), m = F([]), b = I(() => {
315
+ const e = t, _ = p, { t: u } = ue(), { searchKey: A, filter: $ } = Be(""), b = x(!0), i = x([]), y = M(() => {
315
316
  const a = {};
316
317
  return e.roles.forEach((o) => {
317
318
  a[o.value] = o.label;
318
319
  }), a;
319
- }), C = I(() => {
320
+ }), C = M(() => {
320
321
  var o;
321
322
  const a = {};
322
323
  return (o = e.modelValue) == null || o.roles.forEach((S) => {
323
324
  a[S.restaurantId] = S.roleId;
324
325
  }), a;
325
- }), N = I(() => e.restaurants.filter((a) => k([a.profile.name, a.profile.code, te(a._id)])).map((a) => ({
326
+ }), N = M(() => e.restaurants.filter((a) => $([a.profile.name, a.profile.code, ae(a._id)])).map((a) => ({
326
327
  label: `${a.profile.code ? a.profile.code + "-" : ""}${a.profile.name}`,
327
328
  value: a._id,
328
329
  slot: `checkbox-${a._id}-bottom`,
329
330
  disable: e.roles.filter((o) => !o.disabled).length === 0,
330
331
  roleOptions: e.roles
331
- }))), R = I(() => {
332
+ }))), R = M(() => {
332
333
  const a = e.roles.find((o) => !o.disabled);
333
334
  return a ? a.value : null;
334
335
  });
335
- function te(a) {
336
+ function ae(a) {
336
337
  const o = C.value[a] ?? "";
337
- return b.value[o] || "";
338
+ return y.value[o] || "";
338
339
  }
339
- function ae(a) {
340
+ function le(a) {
340
341
  a ? e.modelValue || _("update:model-value", {
341
342
  code: "",
342
343
  name: e.fallbackName,
@@ -350,15 +351,15 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
350
351
  const S = De(e.modelValue);
351
352
  S[a] = o, _("update:model-value", S);
352
353
  }
353
- function V(a) {
354
+ function F(a) {
354
355
  g(
355
356
  "roles",
356
357
  a.map((o) => {
357
- var q, G, P;
358
- const S = (G = (q = N.value.find((W) => W.value === o)) == null ? void 0 : q.roleOptions.find((W) => !W.disabled)) == null ? void 0 : G.value, $ = (P = e.modelValue) == null ? void 0 : P.roles.find((W) => W.restaurantId === o);
358
+ var K, q, I;
359
+ const S = (q = (K = N.value.find((G) => G.value === o)) == null ? void 0 : K.roleOptions.find((G) => !G.disabled)) == null ? void 0 : q.value, P = (I = e.modelValue) == null ? void 0 : I.roles.find((G) => G.restaurantId === o);
359
360
  return {
360
361
  restaurantId: o,
361
- roleId: ($ == null ? void 0 : $.roleId) || S
362
+ roleId: (P == null ? void 0 : P.roleId) || S
362
363
  };
363
364
  })
364
365
  );
@@ -374,8 +375,8 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
374
375
  }
375
376
  ]);
376
377
  }
377
- function x() {
378
- y.value && (y.value = !1, m.value = [], g("passcode", ""));
378
+ function V() {
379
+ b.value && (b.value = !1, i.value = [], g("passcode", ""));
379
380
  }
380
381
  return Ce(
381
382
  () => {
@@ -383,87 +384,87 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
383
384
  return (a = e.modelValue) == null ? void 0 : a.passcode;
384
385
  },
385
386
  (a) => {
386
- a && a.length === ce ? (m.value = a.split(""), y.value = !0) : (m.value = [], y.value = !1);
387
+ a && a.length === de ? (i.value = a.split(""), b.value = !0) : (i.value = [], b.value = !1);
387
388
  },
388
389
  { immediate: !0 }
389
390
  ), (a, o) => {
390
- const S = h("FmSwitch"), $ = h("FmTextField"), q = h("FmPinField"), G = h("FmFormGroup"), P = h("FmSearch"), W = h("FmSelect");
391
- return v(), K("div", $s, [
391
+ const S = h("FmSwitch"), P = h("FmTextField"), K = h("FmPinField"), q = h("FmFormGroup"), I = h("FmSearch"), G = h("FmSelect");
392
+ return f(), z("div", $s, [
392
393
  r("div", Ps, [
393
394
  r("div", Is, [
394
395
  r("div", Ms, O(n(u)("team.memberForm.masterUser.title")), 1),
395
396
  r("div", Cs, O(n(u)("team.memberForm.masterUser.sublabel")), 1)
396
397
  ]),
397
398
  r("div", null, [
398
- i(S, {
399
+ m(S, {
399
400
  "model-value": !!t.modelValue,
400
401
  value: "master-user",
401
- "onUpdate:modelValue": ae
402
+ "onUpdate:modelValue": le
402
403
  }, null, 8, ["model-value"])
403
404
  ])
404
405
  ]),
405
- t.modelValue ? (v(), K(re, { key: 0 }, [
406
+ t.modelValue ? (f(), z(ie, { key: 0 }, [
406
407
  r("div", Ns, [
407
- i($, {
408
+ m(P, {
408
409
  "model-value": t.modelValue.code,
409
410
  label: n(u)("team.memberForm.masterUser.code"),
410
- "onUpdate:modelValue": o[0] || (o[0] = (f) => g("code", f))
411
+ "onUpdate:modelValue": o[0] || (o[0] = (v) => g("code", v))
411
412
  }, null, 8, ["model-value", "label"]),
412
- i($, {
413
+ m(P, {
413
414
  "model-value": t.modelValue.name,
414
415
  class: "w-full",
415
416
  label: n(u)("team.memberForm.masterUser.name"),
416
- rules: [(f) => !!f || n(u)("team.memberForm.masterUser.nameEmptyError")],
417
- "onUpdate:modelValue": o[1] || (o[1] = (f) => g("name", f))
417
+ rules: [(v) => !!v || n(u)("team.memberForm.masterUser.nameEmptyError")],
418
+ "onUpdate:modelValue": o[1] || (o[1] = (v) => g("name", v))
418
419
  }, null, 8, ["model-value", "label", "rules"])
419
420
  ]),
420
421
  r("div", Rs, [
421
422
  r("div", Bs, O(n(u)("team.memberForm.masterUser.passcode")), 1),
422
- i(G, {
423
- modelValue: m.value,
424
- "onUpdate:modelValue": o[4] || (o[4] = (f) => m.value = f),
423
+ m(q, {
424
+ modelValue: i.value,
425
+ "onUpdate:modelValue": o[4] || (o[4] = (v) => i.value = v),
425
426
  rules: [
426
- (f) => (f == null ? void 0 : f.filter((c) => !!c).length) !== ce ? n(u)("team.memberForm.masterUser.passcodeRequired") : !0
427
+ (v) => (v == null ? void 0 : v.filter((d) => !!d).length) !== de ? n(u)("team.memberForm.masterUser.passcodeRequired") : !0
427
428
  ]
428
429
  }, {
429
- default: z(() => [
430
- (v(), M(q, {
431
- key: `pin-field-${y.value}`,
432
- modelValue: m.value,
433
- "onUpdate:modelValue": o[2] || (o[2] = (f) => m.value = f),
434
- length: ce,
435
- masked: y.value,
436
- onComplete: o[3] || (o[3] = (f) => g("passcode", f)),
437
- onFocus: x
430
+ default: T(() => [
431
+ (f(), k(K, {
432
+ key: `pin-field-${b.value}`,
433
+ modelValue: i.value,
434
+ "onUpdate:modelValue": o[2] || (o[2] = (v) => i.value = v),
435
+ length: de,
436
+ masked: b.value,
437
+ onComplete: o[3] || (o[3] = (v) => g("passcode", v)),
438
+ onFocus: V
438
439
  }, null, 8, ["modelValue", "masked"]))
439
440
  ]),
440
441
  _: 1
441
442
  }, 8, ["modelValue", "rules"])
442
443
  ]),
443
444
  r("div", Ds, [
444
- i(P, {
445
+ m(I, {
445
446
  modelValue: n(A),
446
- "onUpdate:modelValue": o[5] || (o[5] = (f) => fe(A) ? A.value = f : null),
447
+ "onUpdate:modelValue": o[5] || (o[5] = (v) => ve(A) ? A.value = v : null),
447
448
  placeholder: n(u)("team.memberForm.posRole.placeholder"),
448
449
  class: "mb-16"
449
450
  }, null, 8, ["modelValue", "placeholder"]),
450
- i(Ze, {
451
- "model-value": t.modelValue.roles.map((f) => f.restaurantId),
451
+ m(Ze, {
452
+ "model-value": t.modelValue.roles.map((v) => v.restaurantId),
452
453
  options: N.value,
453
454
  min: 1,
454
455
  title: n(u)("team.memberForm.masterUser.role"),
455
- "onUpdate:modelValue": V
456
- }, je({ _: 2 }, [
457
- pe(N.value, (f) => ({
458
- name: f.slot,
459
- fn: z(() => {
460
- var c;
456
+ "onUpdate:modelValue": F
457
+ }, Ee({ _: 2 }, [
458
+ fe(N.value, (v) => ({
459
+ name: v.slot,
460
+ fn: T(() => {
461
+ var d;
461
462
  return [
462
463
  r("div", null, [
463
- i(W, {
464
- "model-value": ((c = t.modelValue.roles.find((d) => d.restaurantId === f.value)) == null ? void 0 : c.roleId) || R.value,
465
- items: f.roleOptions,
466
- "onUpdate:modelValue": (d) => E(f.value, d)
464
+ m(G, {
465
+ "model-value": ((d = t.modelValue.roles.find((c) => c.restaurantId === v.value)) == null ? void 0 : d.roleId) || R.value,
466
+ items: v.roleOptions,
467
+ "onUpdate:modelValue": (c) => E(v.value, c)
467
468
  }, null, 8, ["model-value", "items", "onUpdate:modelValue"])
468
469
  ])
469
470
  ];
@@ -471,11 +472,11 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
471
472
  }))
472
473
  ]), 1032, ["model-value", "options", "title"])
473
474
  ])
474
- ], 64)) : Q("", !0)
475
+ ], 64)) : J("", !0)
475
476
  ]);
476
477
  };
477
478
  }
478
- }), As = { class: "flex flex-col gap-32" }, Ls = { class: "flex w-full" }, Es = /* @__PURE__ */ se({
479
+ }), As = { class: "flex flex-col gap-32" }, Ls = { class: "flex w-full" }, Es = /* @__PURE__ */ te({
479
480
  __name: "AddMemberForm",
480
481
  props: {
481
482
  initialValue: {
@@ -487,140 +488,142 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
487
488
  }
488
489
  },
489
490
  setup(t, { expose: p }) {
490
- var P, W, f;
491
- const e = t, { t: _ } = me(), u = F(), A = Oe(), k = I(
492
- () => A.permissionSets.value.map((c) => ({
493
- label: c.name,
494
- value: c.id
491
+ var I, G, v;
492
+ const e = t, { t: _ } = ue(), u = x(), A = Oe(), $ = M(
493
+ () => A.permissionSets.value.map((d) => ({
494
+ label: d.name,
495
+ value: d.id
495
496
  }))
496
- ), y = F(((P = e.initialValue) == null ? void 0 : P.permissionSetIds) || []), m = F((W = e.initialValue) == null ? void 0 : W.posUser), b = F(
497
- ((f = e.initialValue) == null ? void 0 : f.permissions) || []
498
- ), { restaurants: C } = ie(), N = Ae().roles, R = I(() => we(b.value)), te = I(() => {
499
- const c = R.value;
497
+ ), b = x(((I = e.initialValue) == null ? void 0 : I.permissionSetIds) || []), i = x((G = e.initialValue) == null ? void 0 : G.posUser), y = x(
498
+ ((v = e.initialValue) == null ? void 0 : v.permissions) || []
499
+ ), { restaurants: C } = me(), N = Ae().roles, R = M(() => we(y.value)), ae = M(() => {
500
+ const d = R.value;
500
501
  return N.value.map(
501
- (d) => ({
502
- label: d.name,
503
- value: d._id,
504
- disabled: !!c && !c.includes(d._id)
502
+ (c) => ({
503
+ label: c.name,
504
+ value: c._id,
505
+ disabled: !!d && !d.includes(c._id)
505
506
  })
506
507
  );
507
508
  });
508
- function ae(c) {
509
- u.value = c;
509
+ function le(d) {
510
+ u.value = d;
510
511
  }
511
- function g(c) {
512
- m.value = S(m.value, c);
512
+ function g(d) {
513
+ i.value = S(i.value, d);
513
514
  }
514
- function V() {
515
- const c = ve(x.value).map(
515
+ function F() {
516
+ const d = be(V.value).map(
516
517
  ({ setNames: B, ...j }) => j
517
- );
518
- return Qe(c, b.value);
518
+ ), c = Je(d, y.value);
519
+ return Qe(c);
519
520
  }
520
521
  function E() {
521
- var c, d, B, j, D, X, ee, le, H, L;
522
+ var c, B, j, D, X, se, oe, H, ee, W;
523
+ const d = F();
522
524
  return {
523
525
  email: ((c = u.value) == null ? void 0 : c.email) ?? void 0,
524
- phoneNumber: ((d = u.value) == null ? void 0 : d.phoneNumber) ?? void 0,
525
- customPermissions: V(),
526
+ phoneNumber: ((B = u.value) == null ? void 0 : B.phoneNumber) ?? void 0,
527
+ customPermissions: d,
526
528
  // Deprecated: keep for backward compatibility, will be removed in the future
527
- permissions: b.value.map((oe) => ({
528
- ...oe,
529
- subject: Ke(oe.subject)
529
+ permissions: d.map((ne) => ({
530
+ ...ne,
531
+ subject: ze(ne.subject)
530
532
  })),
531
- permissionSetIds: y.value,
532
- name: ((B = u.value) == null ? void 0 : B.displayName) || ((j = e.initialValue) == null ? void 0 : j.name) || "",
533
- posUser: m.value ? {
534
- ...m.value,
535
- name: m.value.name || ((X = (D = e.initialValue) == null ? void 0 : D.posUser) == null ? void 0 : X.name) || ((ee = e.initialValue) == null ? void 0 : ee.name) || ((le = u.value) == null ? void 0 : le.displayName) || "",
536
- code: m.value.code || ((L = (H = e.initialValue) == null ? void 0 : H.posUser) == null ? void 0 : L.code) || "",
537
- passcode: m.value.passcode,
538
- roles: m.value.roles.filter((oe) => !!oe.roleId)
533
+ permissionSetIds: b.value,
534
+ name: ((j = u.value) == null ? void 0 : j.displayName) || ((D = e.initialValue) == null ? void 0 : D.name) || "",
535
+ posUser: i.value ? {
536
+ ...i.value,
537
+ name: i.value.name || ((se = (X = e.initialValue) == null ? void 0 : X.posUser) == null ? void 0 : se.name) || ((oe = e.initialValue) == null ? void 0 : oe.name) || ((H = u.value) == null ? void 0 : H.displayName) || "",
538
+ code: i.value.code || ((W = (ee = e.initialValue) == null ? void 0 : ee.posUser) == null ? void 0 : W.code) || "",
539
+ passcode: i.value.passcode,
540
+ roles: i.value.roles.filter((ne) => !!ne.roleId)
539
541
  } : void 0
540
542
  };
541
543
  }
542
- const x = I(
544
+ const V = M(
543
545
  () => A.permissionSets.value.filter(
544
- (c) => y.value.includes(c.id)
546
+ (d) => b.value.includes(d.id)
545
547
  )
546
- ), a = F();
548
+ ), a = x();
547
549
  function o() {
548
- b.value = ve(x.value).map(
549
- ({ setNames: c, ...d }) => d
550
+ y.value = be(V.value).map(
551
+ ({ setNames: d, ...c }) => c
550
552
  );
551
553
  }
552
- function S(c, d) {
553
- if (!c) return;
554
- const B = we(d);
555
- if (!B) return c;
556
- const j = De(c);
554
+ function S(d, c) {
555
+ if (!d) return;
556
+ const B = we(c);
557
+ if (!B) return d;
558
+ const j = De(d);
557
559
  return j.roles = j.roles.reduce((D, X) => (B.includes(X.roleId) && D.push(X), D), []), j;
558
560
  }
559
- async function $() {
561
+ async function P() {
560
562
  await Pe(), a.value && a.value.$el.scrollIntoView({ behavior: "smooth", block: "start" });
561
563
  }
562
- const q = F();
563
- async function G() {
564
- return (await q.value.validateInputsWithoutSubmit()).length ? null : E();
564
+ const K = x();
565
+ async function q() {
566
+ return (await K.value.validateInputsWithoutSubmit()).length ? null : E();
565
567
  }
566
568
  return p({
567
569
  readFormData: E,
568
- validate: G
569
- }), (c, d) => {
570
+ validate: q
571
+ }), (d, c) => {
570
572
  const B = h("FmSelect"), j = h("FmForm");
571
- return v(), M(j, {
573
+ return f(), k(j, {
572
574
  ref_key: "formRef",
573
- ref: q,
575
+ ref: K,
574
576
  class: "mx-4"
575
577
  }, {
576
- default: z(() => {
577
- var D, X, ee, le, H;
578
+ default: T(() => {
579
+ var D, X, se, oe, H, ee;
578
580
  return [
579
581
  r("div", As, [
580
582
  r("div", Ls, [
581
- t.initialValue ? (v(), M(ys, {
583
+ t.initialValue ? (f(), k(ys, {
582
584
  key: 1,
583
585
  data: t.initialValue
584
- }, null, 8, ["data"])) : (v(), M(ks, {
586
+ }, null, 8, ["data"])) : (f(), k(ks, {
585
587
  key: 0,
586
- onInvite: d[0] || (d[0] = (L) => ae(L))
588
+ onInvite: c[0] || (c[0] = (W) => le(W))
587
589
  }))
588
590
  ]),
589
- u.value || t.initialValue ? (v(), K(re, { key: 0 }, [
590
- i(B, {
591
- modelValue: y.value,
591
+ u.value || t.initialValue ? (f(), z(ie, { key: 0 }, [
592
+ (D = t.initialValue) != null && D.isOwner ? J("", !0) : (f(), k(B, {
593
+ key: 0,
594
+ modelValue: b.value,
592
595
  "onUpdate:modelValue": [
593
- d[1] || (d[1] = (L) => y.value = L),
596
+ c[1] || (c[1] = (W) => b.value = W),
594
597
  o
595
598
  ],
596
599
  multiselect: "",
597
600
  searchable: "",
598
601
  "search-debounce": 300,
599
- items: k.value,
602
+ items: $.value,
600
603
  label: n(_)("team.memberForm.permissionSet.title"),
601
604
  placeholder: n(_)("team.memberForm.permissionSet.selectPlaceholder")
602
- }, null, 8, ["modelValue", "items", "label", "placeholder"]),
603
- (D = t.initialValue) != null && D.isOwner ? Q("", !0) : (v(), M(He, {
604
- key: 0,
605
- modelValue: b.value,
606
- "onUpdate:modelValue": d[2] || (d[2] = (L) => b.value = L),
607
- "inherit-permissions": x.value,
605
+ }, null, 8, ["modelValue", "items", "label", "placeholder"])),
606
+ (X = t.initialValue) != null && X.isOwner ? J("", !0) : (f(), k(He, {
607
+ key: 1,
608
+ modelValue: y.value,
609
+ "onUpdate:modelValue": c[2] || (c[2] = (W) => y.value = W),
610
+ "inherit-permissions": V.value,
608
611
  onPermissionChanged: g
609
612
  }, null, 8, ["modelValue", "inherit-permissions"])),
610
- i(Os, {
613
+ m(Os, {
611
614
  ref_key: "masterUserContentRef",
612
615
  ref: a,
613
- modelValue: m.value,
616
+ modelValue: i.value,
614
617
  "onUpdate:modelValue": [
615
- d[3] || (d[3] = (L) => m.value = L),
616
- $
618
+ c[3] || (c[3] = (W) => i.value = W),
619
+ P
617
620
  ],
618
- "fallback-name": ((X = t.initialValue) == null ? void 0 : X.name) || ((ee = u.value) == null ? void 0 : ee.displayName) || "",
619
- "fallback-passcode": (H = (le = t.initialValue) == null ? void 0 : le.posUser) == null ? void 0 : H.passcode,
620
- roles: te.value,
621
+ "fallback-name": ((se = t.initialValue) == null ? void 0 : se.name) || ((oe = u.value) == null ? void 0 : oe.displayName) || "",
622
+ "fallback-passcode": (ee = (H = t.initialValue) == null ? void 0 : H.posUser) == null ? void 0 : ee.passcode,
623
+ roles: ae.value,
621
624
  restaurants: n(C)
622
625
  }, null, 8, ["modelValue", "fallback-name", "fallback-passcode", "roles", "restaurants"])
623
- ], 64)) : Q("", !0)
626
+ ], 64)) : J("", !0)
624
627
  ])
625
628
  ];
626
629
  }),
@@ -643,33 +646,33 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
643
646
  }, Ws = {
644
647
  class: "flex items-center justify-start gap-8"
645
648
  };
646
- var J = /* @__PURE__ */ function(t) {
649
+ var Q = /* @__PURE__ */ function(t) {
647
650
  return t[t.ADD = 0] = "ADD", t[t.UPDATE = 1] = "UPDATE", t[t.CLOSED = 2] = "CLOSED", t;
648
- }(J || {});
649
- const it = /* @__PURE__ */ se({
651
+ }(Q || {});
652
+ const mt = /* @__PURE__ */ te({
650
653
  __name: "TeamMemberList",
651
654
  setup(t, {
652
655
  expose: p
653
656
  }) {
654
657
  const {
655
658
  t: e
656
- } = me(), _ = ie(), u = Ae(), A = Re(), k = Je(A), y = Oe(), m = Xe(), b = es(), C = F(!0), N = ({
659
+ } = ue(), _ = me(), u = Ae(), A = Re(), $ = We(A), b = Oe(), i = Xe(), y = es(), C = x(!0), N = ({
657
660
  member: s,
658
661
  className: l = ""
659
662
  }) => {
660
663
  const w = {
661
664
  label: e("common.update"),
662
- onClick: () => V(ne.Update, s)
665
+ onClick: () => F(re.Update, s)
663
666
  }, Y = {
664
667
  label: e("common.remove"),
665
- onClick: () => V(ne.Remove, s),
668
+ onClick: () => F(re.Remove, s),
666
669
  itemClass: "text-fm-color-typo-error"
667
670
  }, Z = s.doc.isOwner ? [w] : [w, Y];
668
- return i(ls, {
671
+ return m(ls, {
669
672
  class: l,
670
673
  items: Z
671
674
  }, null);
672
- }, R = (s) => s.doc.isOwner ? e("team.labels.businessOwner") : s.restaurants.join(", "), te = [{
675
+ }, R = (s) => s.doc.isOwner ? e("team.labels.businessOwner") : s.restaurants.join(", "), ae = [{
673
676
  accessorKey: "name",
674
677
  header: () => e("team.table.columns.name"),
675
678
  enableSorting: !1
@@ -690,8 +693,8 @@ const it = /* @__PURE__ */ se({
690
693
  header: () => e("team.table.columns.assignedRoles"),
691
694
  enableSorting: !1,
692
695
  cell(s) {
693
- const l = s.row.original, w = m.getPermissionAssignmentByUserId(l.id), Y = (w == null ? void 0 : w.permissionSetIds) || l.doc.permissionSetIds || [];
694
- return y.permissionSets.value.filter((T) => Y.includes(T.id)).map((T) => T.name).join(", ");
696
+ const l = s.row.original, w = i.getPermissionAssignmentByUserId(l.id), Y = (w == null ? void 0 : w.permissionSetIds) || l.doc.permissionSetIds || [];
697
+ return b.permissionSets.value.filter((L) => Y.includes(L.id)).map((L) => L.name).join(", ");
695
698
  }
696
699
  }, {
697
700
  accessorKey: "permission",
@@ -699,7 +702,7 @@ const it = /* @__PURE__ */ se({
699
702
  enableSorting: !1,
700
703
  cell(s) {
701
704
  const l = s.row.original;
702
- return ae(l);
705
+ return le(l);
703
706
  },
704
707
  meta: {
705
708
  width: "200px"
@@ -719,70 +722,70 @@ const it = /* @__PURE__ */ se({
719
722
  },
720
723
  enableSorting: !1
721
724
  }];
722
- function ae(s) {
725
+ function le(s) {
723
726
  if (s.doc.isOwner)
724
727
  return e("team.labels.businessOwner");
725
- const l = i(Ve.FmTooltip, {
728
+ const l = m(Fe.FmTooltip, {
726
729
  variant: "plain",
727
730
  placement: "top"
728
731
  }, {
729
- default: () => i(Ve.FmIcon, {
732
+ default: () => m(Fe.FmIcon, {
730
733
  name: "info",
731
734
  class: "cursor-pointer text-fm-color-neutral-gray-300"
732
735
  }, null),
733
- content: () => i("div", null, [e("team.labels.permission"), s.permissionLabels.map((w) => i("div", null, [Me("- "), w]))])
736
+ content: () => m("div", null, [e("team.labels.permission"), s.permissionLabels.map((w) => m("div", null, [Me("- "), w]))])
734
737
  });
735
- return i("div", {
738
+ return m("div", {
736
739
  class: "flex flex-row items-center gap-8"
737
- }, [i("span", null, [e("team.labels.allowed", {
740
+ }, [m("span", null, [e("team.labels.allowed", {
738
741
  count: s.permissionLabels.length
739
742
  })]), s.permissionLabels.length > 0 && l]);
740
743
  }
741
744
  function g(s) {
742
- var U, ye, _e, he;
743
- const l = m.getPermissionAssignmentByUserId(s.id), w = (l == null ? void 0 : l.customPermissions) || s.permissions || [], Y = (l == null ? void 0 : l.permissionSetIds) || [], Z = y.permissionSets.value.filter((ge) => Y.includes(ge.id)), T = Ye(ve(Z).map(({
745
+ var L, U, _e, he;
746
+ const l = i.getPermissionAssignmentByUserId(s.id), w = (l == null ? void 0 : l.customPermissions) || s.permissions || [], Y = (l == null ? void 0 : l.permissionSetIds) || [], Z = be(b.permissionSets.value.filter((ge) => Y.includes(ge.id))).map(({
744
747
  setNames: ge,
745
748
  setId: Js,
746
- ...Ee
747
- }) => Ee), w);
749
+ ...Le
750
+ }) => Le);
748
751
  return {
749
752
  id: s.id,
750
753
  isOwner: s.doc.isOwner,
751
754
  name: s.name,
752
755
  phoneNumber: s.phoneNumber,
753
756
  email: s.email,
754
- permissions: T,
757
+ permissions: Ye(Z, w),
755
758
  permissionSetIds: Y,
756
759
  posUser: s.doc.posUser ? {
757
- code: ((U = s.doc.posUser) == null ? void 0 : U.code) ?? "",
758
- name: ((ye = s.doc.posUser) == null ? void 0 : ye.name) ?? s.name,
760
+ code: ((L = s.doc.posUser) == null ? void 0 : L.code) ?? "",
761
+ name: ((U = s.doc.posUser) == null ? void 0 : U.name) ?? s.name,
759
762
  passcode: ((_e = s.doc.posUser) == null ? void 0 : _e.passcode) ?? "",
760
763
  roles: ((he = s.doc.posUser) == null ? void 0 : he.roles) ?? []
761
764
  } : void 0
762
765
  };
763
766
  }
764
- const V = (s, l) => {
765
- if (s == ne.Update) {
767
+ const F = (s, l) => {
768
+ if (s == re.Update) {
766
769
  const w = g(l);
767
- $.value = w, x.value = J.UPDATE;
770
+ P.value = w, V.value = Q.UPDATE;
768
771
  }
769
- s == ne.Remove && W(l);
770
- }, E = Te(), x = F(J.CLOSED), a = I(() => x.value !== J.CLOSED), o = I(() => x.value === J.ADD ? e("common.add") : e("common.update")), S = I(() => x.value === J.ADD ? e("team.actions.addMember") : e("team.actions.updateMember")), $ = F();
771
- function q(s) {
772
- s || (x.value = J.CLOSED);
772
+ s == re.Remove && G(l);
773
+ }, E = je(), V = x(Q.CLOSED), a = M(() => V.value !== Q.CLOSED), o = M(() => V.value === Q.ADD ? e("common.add") : e("common.update")), S = M(() => V.value === Q.ADD ? e("team.actions.addMember") : e("team.actions.updateMember")), P = x();
774
+ function K(s) {
775
+ s || (V.value = Q.CLOSED);
773
776
  }
774
- function G() {
775
- x.value = J.CLOSED;
777
+ function q() {
778
+ V.value = Q.CLOSED;
776
779
  }
777
780
  const {
778
- breakpoints: P
779
- } = Ne(), W = (s) => {
781
+ breakpoints: I
782
+ } = Ne(), G = (s) => {
780
783
  E.open({
781
784
  title: e("team.actions.removeMember"),
782
785
  message: e("team.removeMember.confirmationMessage", {
783
786
  memberName: s.name
784
787
  }),
785
- minWidth: P.value.lg ? 588 : 0,
788
+ minWidth: I.value.lg ? 588 : 0,
786
789
  primaryActions: {
787
790
  text: "Remove",
788
791
  close: !1,
@@ -793,77 +796,77 @@ const it = /* @__PURE__ */ se({
793
796
  close: !0
794
797
  }
795
798
  }).onPrimary(async () => {
796
- await k.minor(async () => {
797
- await ue.deleteTeamMember(s.id), await H();
799
+ await $.minor(async () => {
800
+ await ce.deleteTeamMember(s.id), await H();
798
801
  }, {
799
802
  successMessage: e("team.removeMember.successMessage", {
800
803
  memberName: s.name
801
804
  })
802
805
  }), E.close();
803
806
  });
804
- }, f = () => {
805
- $.value = null, x.value = J.ADD;
806
- }, c = I(() => b.members), d = F(), B = F(), j = I(() => Object.values(qe).map((s) => ({
807
+ }, v = () => {
808
+ P.value = null, V.value = Q.ADD;
809
+ }, d = M(() => y.members), c = x(), B = x(), j = M(() => Object.values(Ke).map((s) => ({
807
810
  label: s.label,
808
811
  value: s.subject
809
812
  }))), {
810
813
  searchKey: D,
811
814
  filter: X
812
- } = Be(""), ee = I(() => c.value.filter((s) => {
815
+ } = Be(""), se = M(() => d.value.filter((s) => {
813
816
  var Z;
814
- const l = !d.value || s.managableRestaurantIds.some((T) => d.value.includes(T)), w = ((Z = s.permissions) == null ? void 0 : Z.map((T) => T.subject).flat().filter(Boolean)) || [], Y = !B.value || w.some((T) => B.value.includes(T));
817
+ const l = !c.value || s.managableRestaurantIds.some((L) => c.value.includes(L)), w = ((Z = s.permissions) == null ? void 0 : Z.map((L) => L.subject).flat().filter(Boolean)) || [], Y = !B.value || w.some((L) => B.value.includes(L));
815
818
  return l && Y && X([s.name, s.phoneNumber, R(s)]);
816
819
  }));
817
- async function le() {
820
+ async function oe() {
818
821
  await u.readRoles();
819
822
  }
820
823
  async function H() {
821
824
  C.value = !0;
822
825
  try {
823
- await b.readTeamMembers();
826
+ await y.readTeamMembers();
824
827
  } finally {
825
828
  C.value = !1;
826
829
  }
827
830
  }
828
- const L = F();
829
- async function oe() {
830
- if (!L.value) return;
831
- const s = await L.value.validate();
831
+ const ee = x();
832
+ async function W() {
833
+ if (!ee.value) return;
834
+ const s = await ee.value.validate();
832
835
  if (!s) return;
833
- const l = x.value === J.ADD;
834
- await k.minor(async () => {
835
- await (l ? ue.createTeamMember(s) : ue.updateTeamMember($.value.id, s)), G(), await be(), await H();
836
+ const l = V.value === Q.ADD;
837
+ await $.minor(async () => {
838
+ await (l ? ce.createTeamMember(s) : ce.updateTeamMember(P.value.id, s)), q(), await ye(), await H();
836
839
  }, {
837
840
  successMessage: l ? e("team.addMember.successMessage", {
838
841
  memberName: s.name
839
842
  }) : e("team.updateMember.successMessage", {
840
843
  memberName: s.name
841
844
  })
842
- }), x.value = J.CLOSED;
845
+ }), V.value = Q.CLOSED;
843
846
  }
844
- async function Le() {
845
- await y.readPermissionSets();
847
+ async function ne() {
848
+ await b.readPermissionSets();
846
849
  }
847
- async function be() {
848
- await m.readPermissionAssignments();
850
+ async function ye() {
851
+ await i.readPermissionAssignments();
849
852
  }
850
853
  return Ce(_.currentBusiness, async () => {
851
854
  var s;
852
- (s = _.currentBusiness.value) != null && s._id && (await Le(), await be(), H(), le());
855
+ (s = _.currentBusiness.value) != null && s._id && (await ne(), await ye(), H(), oe());
853
856
  }, {
854
857
  immediate: !0
855
858
  }), p({
856
- create: f
859
+ create: v
857
860
  }), (s, l) => {
858
- const w = h("FmSearch"), Y = h("FmTable"), Z = h("FmButton"), T = h("FmSideSheet");
859
- return v(), K(re, null, [r("div", js, [r("div", Ts, [r("div", zs, [r("div", Ks, [i(n(Fe), {
860
- modelValue: d.value,
861
- "onUpdate:modelValue": l[0] || (l[0] = (U) => d.value = U),
861
+ const w = h("FmSearch"), Y = h("FmTable"), Z = h("FmButton"), L = h("FmSideSheet");
862
+ return f(), z(ie, null, [r("div", js, [r("div", Ts, [r("div", zs, [r("div", Ks, [m(n(xe), {
863
+ modelValue: c.value,
864
+ "onUpdate:modelValue": l[0] || (l[0] = (U) => c.value = U),
862
865
  "managable-only": !1,
863
866
  multiple: "",
864
867
  variant: "dark",
865
868
  class: "!w-auto"
866
- }, null, 8, ["modelValue"]), i(Se, {
869
+ }, null, 8, ["modelValue"]), m(Se, {
867
870
  modelValue: B.value,
868
871
  "onUpdate:modelValue": l[1] || (l[1] = (U) => B.value = U),
869
872
  multiple: "",
@@ -871,26 +874,26 @@ const it = /* @__PURE__ */ se({
871
874
  items: j.value,
872
875
  "selected-prefix": n(e)("team.filter.selected_permission_prefix"),
873
876
  placeholder: n(e)("team.filter.permission_placeholder")
874
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), i(w, {
877
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), m(w, {
875
878
  modelValue: n(D),
876
- "onUpdate:modelValue": l[2] || (l[2] = (U) => fe(D) ? D.value = U : null),
879
+ "onUpdate:modelValue": l[2] || (l[2] = (U) => ve(D) ? D.value = U : null),
877
880
  class: "w-[320px] xs:w-full xs:mt-8",
878
881
  autofocus: "",
879
882
  placeholder: n(e)("team.search.placeholder")
880
- }, null, 8, ["modelValue", "placeholder"])]), r("div", qs, [i(w, {
883
+ }, null, 8, ["modelValue", "placeholder"])]), r("div", qs, [m(w, {
881
884
  modelValue: n(D),
882
- "onUpdate:modelValue": l[3] || (l[3] = (U) => fe(D) ? D.value = U : null),
885
+ "onUpdate:modelValue": l[3] || (l[3] = (U) => ve(D) ? D.value = U : null),
883
886
  class: "w-[320px] xs:w-full xs:mt-8",
884
887
  autofocus: "",
885
888
  placeholder: n(e)("team.search.placeholder")
886
- }, null, 8, ["modelValue", "placeholder"]), r("div", Gs, [i(n(Fe), {
887
- modelValue: d.value,
888
- "onUpdate:modelValue": l[4] || (l[4] = (U) => d.value = U),
889
+ }, null, 8, ["modelValue", "placeholder"]), r("div", Gs, [m(n(xe), {
890
+ modelValue: c.value,
891
+ "onUpdate:modelValue": l[4] || (l[4] = (U) => c.value = U),
889
892
  "managable-only": !1,
890
893
  multiple: "",
891
894
  variant: "dark",
892
895
  class: "!w-auto"
893
- }, null, 8, ["modelValue"]), i(Se, {
896
+ }, null, 8, ["modelValue"]), m(Se, {
894
897
  modelValue: B.value,
895
898
  "onUpdate:modelValue": l[5] || (l[5] = (U) => B.value = U),
896
899
  multiple: "",
@@ -898,45 +901,45 @@ const it = /* @__PURE__ */ se({
898
901
  items: j.value,
899
902
  "selected-prefix": n(e)("team.filter.selected_permission_prefix"),
900
903
  placeholder: n(e)("team.filter.permission_placeholder")
901
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), c.value.length === 0 && !C.value ? (v(), M(n(We), {
904
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), d.value.length === 0 && !C.value ? (f(), k(n(Ge), {
902
905
  key: 0,
903
906
  title: n(e)("team.emptyState.title"),
904
907
  subtitle: n(e)("team.emptyState.description")
905
- }, null, 8, ["title", "subtitle"])) : (v(), M(Ge, {
908
+ }, null, 8, ["title", "subtitle"])) : (f(), k(qe, {
906
909
  key: 1
907
910
  }, {
908
- default: z(() => [i(Y, {
909
- "column-defs": te,
910
- "row-data": ee.value,
911
- "page-size": ee.value.length,
911
+ default: T(() => [m(Y, {
912
+ "column-defs": ae,
913
+ "row-data": se.value,
914
+ "page-size": se.value.length,
912
915
  loading: C.value,
913
916
  "pin-header-row": "",
914
917
  "hide-footer": "",
915
- onRowClick: l[6] || (l[6] = (U) => V(n(ne).Update, U.original))
918
+ onRowClick: l[6] || (l[6] = (U) => F(n(re).Update, U.original))
916
919
  }, null, 8, ["row-data", "page-size", "loading"])]),
917
920
  _: 1
918
- }))])]), i(T, {
921
+ }))])]), m(L, {
919
922
  header: S.value,
920
923
  "model-value": a.value,
921
924
  "max-width": 560,
922
925
  "dismiss-away": "",
923
- "onUpdate:modelValue": l[7] || (l[7] = (U) => q(U))
926
+ "onUpdate:modelValue": l[7] || (l[7] = (U) => K(U))
924
927
  }, {
925
- "side-sheet-footer": z(() => [r("div", Ws, [i(Z, {
928
+ "side-sheet-footer": T(() => [r("div", Ws, [m(Z, {
926
929
  label: o.value,
927
930
  size: "md",
928
931
  variant: "primary",
929
- onClick: $e(oe, ["prevent"])
930
- }, null, 8, ["label"]), i(Z, {
932
+ onClick: $e(W, ["prevent"])
933
+ }, null, 8, ["label"]), m(Z, {
931
934
  label: n(e)("common.cancel"),
932
935
  size: "md",
933
936
  variant: "secondary",
934
- onClick: G
937
+ onClick: q
935
938
  }, null, 8, ["label"])])]),
936
- default: z(() => [i(Es, {
939
+ default: T(() => [m(Es, {
937
940
  ref_key: "memberForm",
938
- ref: L,
939
- initialValue: $.value,
941
+ ref: ee,
942
+ initialValue: P.value,
940
943
  class: "gap-8"
941
944
  }, null, 8, ["initialValue"])]),
942
945
  _: 1
@@ -945,5 +948,5 @@ const it = /* @__PURE__ */ se({
945
948
  }
946
949
  });
947
950
  export {
948
- it as default
951
+ mt as default
949
952
  };