@feedmepos/mf-hrm-portal 2.0.20-dev.2 → 2.0.20-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/{AuditLogList-ChxAzO74.js → AuditLogList-7E8iWQWx.js} +4 -4
  2. package/dist/{EmployeeList-Cs-Mn6UA.js → EmployeeList-DyNW3cUo.js} +214 -206
  3. package/dist/{Main-DcvmP7s-.js → Main-BLJyOcEv.js} +4 -4
  4. package/dist/{Main-B9_TyRDo.js → Main-BZjZxFHp.js} +9 -9
  5. package/dist/{Main-CdHW4UkN.js → Main-C9lMH4EN.js} +5 -5
  6. package/dist/{PermissionSetList-VFVS0g0v.js → PermissionSetList-BuCp14Os.js} +115 -107
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dr3R9JjS.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BQSDnH-Z.js} +608 -595
  8. package/dist/{RoleList-BZ6RZvm2.js → RoleList-L8L1xmJ2.js} +201 -193
  9. package/dist/{TeamMemberList-C-zhFauD.js → TeamMemberList-DEN9rHqb.js} +421 -412
  10. package/dist/{TimesheetList-CZex54an.js → TimesheetList-D88u0GFn.js} +6 -6
  11. package/dist/{app-CLL3p27X.js → app-g_SrJtfC.js} +4 -4
  12. package/dist/app.js +1 -1
  13. package/dist/{dayjs.min-CDt1i9vl.js → dayjs.min-BGHzwXCt.js} +1 -1
  14. package/dist/{employee-BpRvjWNh.js → employee-Dep-q_aU.js} +3 -3
  15. package/dist/{iteration-BVjUzYL5.js → iteration-Dc-Bz5bA.js} +1 -1
  16. package/dist/{lodash-CrwgACp2.js → lodash-Cxw1GZ6L.js} +1 -1
  17. package/dist/{rule-BlQ5YZ9Z.js → rule-ClRtpdqO.js} +2 -2
  18. package/dist/{timesheet-jFs4GTAL.js → timesheet-CZoSvFYT.js} +2 -2
  19. package/dist/tsconfig.app.tsbuildinfo +1 -1
  20. package/dist/{useAppStore-DMAL8VFY.js → useAppStore-CTBRpqmO.js} +1 -1
  21. package/dist/{useLoading-AFTjRLyO.js → useLoading-XvrLj1VM.js} +1 -1
  22. package/dist/{useReportPermissions-hODG0Xx3.js → useReportPermissions-nivbQm9V.js} +3 -3
  23. package/package.json +1 -1
@@ -1,75 +1,75 @@
1
- import { defineComponent as Fe, resolveComponent as w, createElementBlock as O, openBlock as g, createElementVNode as i, createVNode as u, toDisplayString as $, unref as o, ref as v, computed as P, createCommentVNode as J, withCtx as pe, createBlock as H, watch as ue, Fragment as Ie, renderList as ts, withKeys as Ae, withModifiers as Se, nextTick as as, onUnmounted as ls, h as os, createTextVNode as ns } from "vue";
2
- import { useI18n as Ve, useCoreStore as ke, baseClientInstance as Be } from "@feedmepos/mf-common";
3
- import { useSnackbar as We, useDialog as rs, useBreakpoints as is, components as Me } from "@feedmepos/ui-library";
4
- import { u as us, _ as ms } from "./useDebounce-CWb5QR9G.js";
5
- import { _ as ds, S as fe } from "./SelectFilter-DUj7GBtT.js";
6
- import { b as je, m as cs, C as ps, _ as vs, a as fs } from "./app-CLL3p27X.js";
7
- import { u as bs, _ as ys } from "./useDiscardConfirm-DPhEV6v0.js";
1
+ import { defineComponent as Se, resolveComponent as S, createElementBlock as A, openBlock as h, createElementVNode as r, createVNode as u, toDisplayString as P, unref as o, ref as v, computed as w, createCommentVNode as J, withCtx as ue, createBlock as H, watch as me, Fragment as ke, renderList as as, withKeys as Be, withModifiers as Fe, nextTick as ls, onUnmounted as os, h as ns, createTextVNode as rs } from "vue";
2
+ import { useI18n as Ve, useCoreStore as $e, baseClientInstance as je } from "@feedmepos/mf-common";
3
+ import { useSnackbar as Je, useDialog as is, useBreakpoints as us, components as Ne } from "@feedmepos/ui-library";
4
+ import { u as ms, _ as ds } from "./useDebounce-CWb5QR9G.js";
5
+ import { _ as cs, S as fe } from "./SelectFilter-DUj7GBtT.js";
6
+ import { b as Ee, m as ps, C as vs, _ as fs, a as bs } from "./app-g_SrJtfC.js";
7
+ import { u as _s, _ as ys } from "./useDiscardConfirm-DPhEV6v0.js";
8
8
  import { _ as hs } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
9
- import { u as gs } from "./useLoading-AFTjRLyO.js";
10
- import { l as Ne } from "./lodash-CrwgACp2.js";
11
- import { g as Ee, d as ce, u as Je } from "./iteration-BVjUzYL5.js";
12
- import { u as Xe, c as Le, b as Te, m as Pe, d as Ze, p as qe, i as _s, j as Ke, k as ze, l as xs, n as Us, s as Ss, o as Fs, q as Vs, t as Ue } from "./rule-BlQ5YZ9Z.js";
13
- import { u as Qe } from "./useAppStore-DMAL8VFY.js";
9
+ import { u as gs } from "./useLoading-XvrLj1VM.js";
10
+ import { l as De } from "./lodash-Cxw1GZ6L.js";
11
+ import { g as Le, d as pe, u as Xe } from "./iteration-Dc-Bz5bA.js";
12
+ import { u as Ze, c as Te, b as qe, m as Ie, d as Qe, p as Ke, i as xs, j as ze, k as Ge, l as Us, n as Fs, s as Ss, o as Vs, q as ws, t as Ue } from "./rule-ClRtpdqO.js";
13
+ import { u as Ye } from "./useAppStore-CTBRpqmO.js";
14
14
  /* empty css */
15
- import { _ as ws } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dr3R9JjS.js";
16
- var ye = /* @__PURE__ */ ((m) => (m.Update = "Update", m.Remove = "Remove", m))(ye || {});
17
- const Ps = { class: "w-full flex flex-col gap-16" }, Is = { 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" }, Cs = { class: "w-full flex gap-16 items-center" }, Ms = { class: "flex-1 flex flex-col gap-4 min-w-0" }, Ns = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ds = { class: "fm-typo-en-body-lg-600 truncate" }, Os = { class: "flex-1 flex flex-col gap-4 min-w-0" }, As = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Bs = { class: "fm-typo-en-body-lg-600 truncate" }, js = /* @__PURE__ */ Fe({
15
+ import { _ as Ps } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BQSDnH-Z.js";
16
+ var _e = /* @__PURE__ */ ((m) => (m.Update = "Update", m.Remove = "Remove", m))(_e || {});
17
+ const Is = { class: "w-full flex flex-col gap-16" }, ks = { class: "flex items-center gap-16" }, $s = { class: "space-y-4 min-w-0 flex-1" }, Rs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Cs = { class: "fm-typo-en-body-lg-600 truncate" }, Ms = { class: "w-full flex gap-16 items-center" }, Ns = { class: "flex-1 flex flex-col gap-4 min-w-0" }, Ds = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, As = { class: "fm-typo-en-body-lg-600 truncate" }, Os = { class: "flex-1 flex flex-col gap-4 min-w-0" }, Bs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, js = { class: "fm-typo-en-body-lg-600 truncate" }, Es = /* @__PURE__ */ Se({
18
18
  __name: "MemberInfo",
19
19
  props: {
20
20
  data: {}
21
21
  },
22
22
  setup(m) {
23
- const { t: A } = Ve();
23
+ const { t: O } = Ve();
24
24
  return (n, a) => {
25
- const d = w("FmAvatar");
26
- return g(), O("div", Ps, [
27
- i("div", Is, [
25
+ const d = S("FmAvatar");
26
+ return h(), A("div", Is, [
27
+ r("div", ks, [
28
28
  u(d, {
29
29
  size: "xl",
30
30
  initials: m.data.name
31
31
  }, null, 8, ["initials"]),
32
- i("div", ks, [
33
- i("p", Rs, $(o(A)("team.memberForm.memberInfo.memberName")), 1),
34
- i("p", $s, $(m.data.name || "--"), 1)
32
+ r("div", $s, [
33
+ r("p", Rs, P(o(O)("team.memberForm.memberInfo.memberName")), 1),
34
+ r("p", Cs, P(m.data.name || "--"), 1)
35
35
  ])
36
36
  ]),
37
- i("div", Cs, [
38
- i("div", Ms, [
39
- i("p", Ns, $(o(A)("team.memberForm.memberInfo.mobileNumber")), 1),
40
- i("p", Ds, $(m.data.phoneNumber || "--"), 1)
37
+ r("div", Ms, [
38
+ r("div", Ns, [
39
+ r("p", Ds, P(o(O)("team.memberForm.memberInfo.mobileNumber")), 1),
40
+ r("p", As, P(m.data.phoneNumber || "--"), 1)
41
41
  ]),
42
- i("div", Os, [
43
- i("p", As, $(o(A)("team.memberForm.memberInfo.emailAddress")), 1),
44
- i("p", Bs, $(m.data.email || "--"), 1)
42
+ r("div", Os, [
43
+ r("p", Bs, P(o(O)("team.memberForm.memberInfo.emailAddress")), 1),
44
+ r("p", js, P(m.data.email || "--"), 1)
45
45
  ])
46
46
  ])
47
47
  ]);
48
48
  };
49
49
  }
50
- }), Ge = {
50
+ }), We = {
51
51
  async readPermissionUserByPhoneNo(m) {
52
52
  var n;
53
- const { currentBusiness: A } = ke();
54
- return Ee(
55
- await Be("/").get(`/user/b/${(n = A.value) == null ? void 0 : n._id}/phone/${m}`)
53
+ const { currentBusiness: O } = $e();
54
+ return Le(
55
+ await je("/").get(`/user/b/${(n = O.value) == null ? void 0 : n._id}/phone/${m}`)
56
56
  );
57
57
  },
58
58
  async readPermissionUserByEmail(m) {
59
59
  var n;
60
- const { currentBusiness: A } = ke();
61
- return Ee(
62
- await Be("/").get(`/user/b/${(n = A.value) == null ? void 0 : n._id}/email/${m}`)
60
+ const { currentBusiness: O } = $e();
61
+ return Le(
62
+ await je("/").get(`/user/b/${(n = O.value) == null ? void 0 : n._id}/email/${m}`)
63
63
  );
64
64
  }
65
- }, Es = { class: "flex flex-col gap-24 w-full" }, Ls = {
65
+ }, Ls = { class: "flex flex-col gap-24 w-full" }, Ts = {
66
66
  key: 0,
67
67
  class: "flex flex-col gap-8"
68
- }, Ts = { class: "user-info-icon user-info-icon--lg" }, qs = { class: "flex-1 overflow-hidden" }, Ks = { class: "profile-displayName" }, zs = { class: "profile-email" }, Gs = { class: "profile-phone" }, Ws = { key: 2 }, Js = /* @__PURE__ */ Fe({
68
+ }, qs = { class: "user-info-icon user-info-icon--lg" }, Ks = { class: "flex-1 overflow-hidden" }, zs = { class: "profile-displayName" }, Gs = { class: "profile-email" }, Ws = { class: "profile-phone" }, Js = { key: 2 }, Xs = /* @__PURE__ */ Se({
69
69
  __name: "PortalUserSearcher",
70
70
  emits: ["invite"],
71
- setup(m, { emit: A }) {
72
- const n = A, { t: a } = Ve(), d = We(), C = ke(), M = v("phone"), x = v(""), B = v(""), p = v();
71
+ setup(m, { emit: O }) {
72
+ const n = O, { t: a } = Ve(), d = Je(), R = $e(), C = v("phone"), x = v(""), B = v(""), p = v();
73
73
  async function b() {
74
74
  if (!x.value && !B.value) {
75
75
  d.open({
@@ -78,54 +78,54 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
78
78
  });
79
79
  return;
80
80
  }
81
- const F = M.value === "phone" ? await Ge.readPermissionUserByPhoneNo(x.value.replace(/ /g, "")) : await Ge.readPermissionUserByEmail(B.value);
82
- F || d.open({
81
+ const V = C.value === "phone" ? await We.readPermissionUserByPhoneNo(x.value.replace(/ /g, "")) : await We.readPermissionUserByEmail(B.value);
82
+ V || d.open({
83
83
  type: "error",
84
84
  title: a("team.memberForm.searchUser.userNotFound")
85
- }), p.value = F;
85
+ }), p.value = V;
86
86
  }
87
- const ee = P(() => {
88
- var K;
89
- let F = ((K = p.value) == null ? void 0 : K.displayName) ?? "";
90
- F || (F = "Feed Me");
91
- const [y, D] = F.split(" ");
92
- return D ? `${y[0]}${D[0]}` : y.slice(0, 2);
87
+ const ee = w(() => {
88
+ var q;
89
+ let V = ((q = p.value) == null ? void 0 : q.displayName) ?? "";
90
+ V || (V = "Feed Me");
91
+ const [_, D] = V.split(" ");
92
+ return D ? `${_[0]}${D[0]}` : _.slice(0, 2);
93
93
  }), E = v(!1);
94
- function le(F) {
95
- n("invite", F), E.value = !0;
94
+ function oe(V) {
95
+ n("invite", V), E.value = !0;
96
96
  }
97
- function q() {
97
+ function T() {
98
98
  E.value = !1;
99
99
  }
100
- return (F, y) => {
101
- var _, N, X;
102
- const D = w("FmRadio"), K = w("FmPhoneNumber"), ae = w("FmTextField"), r = w("FmRadioGroup"), l = w("FmButton");
103
- return g(), O("div", Es, [
104
- E.value ? J("", !0) : (g(), O("div", Ls, [
105
- u(r, {
106
- modelValue: M.value,
107
- "onUpdate:modelValue": y[2] || (y[2] = (j) => M.value = j)
100
+ return (V, _) => {
101
+ var g, M, X;
102
+ const D = S("FmRadio"), q = S("FmPhoneNumber"), ae = S("FmTextField"), i = S("FmRadioGroup"), l = S("FmButton");
103
+ return h(), A("div", Ls, [
104
+ E.value ? J("", !0) : (h(), A("div", Ts, [
105
+ u(i, {
106
+ modelValue: C.value,
107
+ "onUpdate:modelValue": _[2] || (_[2] = (j) => C.value = j)
108
108
  }, {
109
- default: pe(() => [
109
+ default: ue(() => [
110
110
  u(D, {
111
111
  value: "phone",
112
112
  label: o(a)("team.memberForm.searchUser.phoneNumber")
113
113
  }, null, 8, ["label"]),
114
- M.value === "phone" ? (g(), H(K, {
114
+ C.value === "phone" ? (h(), H(q, {
115
115
  key: 0,
116
116
  modelValue: x.value,
117
- "onUpdate:modelValue": y[0] || (y[0] = (j) => x.value = j),
118
- "extra-country-codes": o(C).enabledCountries.value,
117
+ "onUpdate:modelValue": _[0] || (_[0] = (j) => x.value = j),
118
+ "extra-country-codes": o(R).enabledCountries.value,
119
119
  class: "ml-8"
120
120
  }, null, 8, ["modelValue", "extra-country-codes"])) : J("", !0),
121
121
  u(D, {
122
122
  value: "email",
123
123
  label: o(a)("team.memberForm.searchUser.email")
124
124
  }, null, 8, ["label"]),
125
- M.value === "email" ? (g(), H(ae, {
125
+ C.value === "email" ? (h(), H(ae, {
126
126
  key: 1,
127
127
  modelValue: B.value,
128
- "onUpdate:modelValue": y[1] || (y[1] = (j) => B.value = j),
128
+ "onUpdate:modelValue": _[1] || (_[1] = (j) => B.value = j),
129
129
  placeholder: o(a)("team.memberForm.searchUser.emailPlaceholder"),
130
130
  class: "ml-8"
131
131
  }, null, 8, ["modelValue", "placeholder"])) : J("", !0)
@@ -138,29 +138,29 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
138
138
  onClick: b
139
139
  }, null, 8, ["label"])
140
140
  ])),
141
- p.value ? (g(), O("div", {
141
+ p.value ? (h(), A("div", {
142
142
  key: 1,
143
143
  class: "profile-menu--profile cursor-pointer hover:bg-fm-color-opacity-sm",
144
- onClick: y[3] || (y[3] = (j) => le(p.value))
144
+ onClick: _[3] || (_[3] = (j) => oe(p.value))
145
145
  }, [
146
- i("div", Ts, $(ee.value), 1),
147
- i("div", qs, [
148
- i("p", Ks, $((_ = p.value) == null ? void 0 : _.displayName), 1),
149
- i("p", zs, $((N = p.value) == null ? void 0 : N.email), 1),
150
- i("p", Gs, $((X = p.value) == null ? void 0 : X.phoneNumber), 1)
146
+ r("div", qs, P(ee.value), 1),
147
+ r("div", Ks, [
148
+ r("p", zs, P((g = p.value) == null ? void 0 : g.displayName), 1),
149
+ r("p", Gs, P((M = p.value) == null ? void 0 : M.email), 1),
150
+ r("p", Ws, P((X = p.value) == null ? void 0 : X.phoneNumber), 1)
151
151
  ])
152
152
  ])) : J("", !0),
153
- E.value ? (g(), O("div", Ws, [
153
+ E.value ? (h(), A("div", Js, [
154
154
  u(l, {
155
155
  label: o(a)("team.memberForm.searchUser.changeUser"),
156
156
  variant: "secondary",
157
- onClick: q
157
+ onClick: T
158
158
  }, null, 8, ["label"])
159
159
  ])) : J("", !0)
160
160
  ]);
161
161
  };
162
162
  }
163
- }), Xs = /* @__PURE__ */ ds(Js, [["__scopeId", "data-v-c2c7ed35"]]), Zs = { class: "flex flex-col gap-40" }, Qs = { class: "flex items-center" }, Ys = { class: "flex-1 flex flex-col" }, Hs = { class: "fm-typo-en-title-sm-600" }, et = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st = { class: "flex flex-row gap-16" }, tt = { class: "flex flex-col gap-8" }, at = { class: "fm-typo-en-body-lg-400" }, lt = { class: "space-y-16 rounded-lg border border-fm-color-neutral-gray-200 p-16" }, ot = { class: "fm-typo-en-title-sm-600" }, nt = { class: "space-y-16" }, rt = { class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-16" }, it = { class: "text-sm font-semibold text-fm-color-typo-primary" }, ut = { class: "text-sm font-semibold text-fm-color-typo-primary" }, mt = { class: "flex justify-self-end" }, dt = ["aria-label", "onClick", "onKeydown"], De = 4, ct = /* @__PURE__ */ Fe({
163
+ }), Zs = /* @__PURE__ */ cs(Xs, [["__scopeId", "data-v-c2c7ed35"]]), Qs = { class: "flex flex-col gap-40" }, Ys = { class: "flex items-center" }, Hs = { class: "flex-1 flex flex-col" }, et = { class: "fm-typo-en-title-sm-600" }, st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, tt = { class: "flex flex-row gap-16" }, at = { class: "flex flex-col gap-8" }, lt = { class: "fm-typo-en-body-lg-400" }, ot = { class: "space-y-16 rounded-lg border border-fm-color-neutral-gray-200 p-16" }, nt = { class: "fm-typo-en-title-sm-600" }, rt = { class: "space-y-16" }, it = { class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-16" }, ut = { class: "text-sm font-semibold text-fm-color-typo-primary" }, mt = { class: "text-sm font-semibold text-fm-color-typo-primary" }, dt = { class: "flex justify-self-end" }, ct = ["aria-label", "onClick", "onKeydown"], Ae = 4, pt = /* @__PURE__ */ Se({
164
164
  __name: "TeamMemberMasterUser",
165
165
  props: {
166
166
  modelValue: {
@@ -185,133 +185,133 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
185
185
  }
186
186
  },
187
187
  emits: ["update:model-value"],
188
- setup(m, { emit: A }) {
189
- const n = m, a = A, { t: d } = Ve(), C = v(!0), M = v([]);
188
+ setup(m, { emit: O }) {
189
+ const n = m, a = O, { t: d } = Ve(), R = v(!0), C = v([]);
190
190
  function x() {
191
191
  return { restaurantId: "", roleId: "" };
192
192
  }
193
- const B = P(
193
+ const B = w(
194
194
  () => {
195
- var r;
196
- return ((r = n.modelValue) == null ? void 0 : r.roles.map((l) => l.restaurantId).filter(Boolean)) ?? [];
195
+ var i;
196
+ return ((i = n.modelValue) == null ? void 0 : i.roles.map((l) => l.restaurantId).filter(Boolean)) ?? [];
197
197
  }
198
198
  );
199
- function p(r) {
200
- r ? n.modelValue || a("update:model-value", {
199
+ function p(i) {
200
+ i ? n.modelValue || a("update:model-value", {
201
201
  code: "",
202
202
  name: n.fallbackName,
203
203
  roles: [x()],
204
204
  passcode: n.fallbackPasscode || ""
205
205
  }) : a("update:model-value", null);
206
206
  }
207
- function b(r, l) {
208
- if (!n.modelValue || r === "passcode" && n.modelValue.passcode === l) return;
209
- const _ = ce(n.modelValue);
210
- _[r] = l, a("update:model-value", _);
207
+ function b(i, l) {
208
+ if (!n.modelValue || i === "passcode" && n.modelValue.passcode === l) return;
209
+ const g = pe(n.modelValue);
210
+ g[i] = l, a("update:model-value", g);
211
211
  }
212
- function ee(r = "") {
213
- return n.restaurants.filter((l) => l.managable || l._id === r).map((l) => ({
212
+ function ee(i = "") {
213
+ return n.restaurants.filter((l) => l.managable || l._id === i).map((l) => ({
214
214
  label: `${l.profile.code ? `${l.profile.code} - ` : ""}${l.profile.name}`,
215
215
  value: l._id,
216
- disabled: B.value.includes(l._id) && l._id !== r
216
+ disabled: B.value.includes(l._id) && l._id !== i
217
217
  }));
218
218
  }
219
- function E(r = "") {
219
+ function E(i = "") {
220
220
  return n.roles.map((l) => ({
221
221
  label: l.label,
222
222
  value: l.value,
223
- disabled: !!l.disabled && l.value !== r
223
+ disabled: !!l.disabled && l.value !== i
224
224
  }));
225
225
  }
226
- function le(r, l) {
227
- var z, L, G;
226
+ function oe(i, l) {
227
+ var K, L, z;
228
228
  if (!n.modelValue) return;
229
- const _ = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [x()], N = ((z = _[r]) == null ? void 0 : z.roleId) ?? "", X = E(N), j = ((L = X.find((c) => c.value === N && !c.disabled)) == null ? void 0 : L.value) ?? ((G = X.find((c) => !c.disabled)) == null ? void 0 : G.value) ?? "";
230
- _[r] = { restaurantId: l, roleId: j }, b("roles", _);
229
+ const g = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [x()], M = ((K = g[i]) == null ? void 0 : K.roleId) ?? "", X = E(M), j = ((L = X.find((c) => c.value === M && !c.disabled)) == null ? void 0 : L.value) ?? ((z = X.find((c) => !c.disabled)) == null ? void 0 : z.value) ?? "";
230
+ g[i] = { restaurantId: l, roleId: j }, b("roles", g);
231
231
  }
232
- function q(r, l) {
233
- var N;
232
+ function T(i, l) {
233
+ var M;
234
234
  if (!n.modelValue) return;
235
- const _ = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [x()];
236
- _[r] = {
237
- restaurantId: ((N = _[r]) == null ? void 0 : N.restaurantId) ?? "",
235
+ const g = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [x()];
236
+ g[i] = {
237
+ restaurantId: ((M = g[i]) == null ? void 0 : M.restaurantId) ?? "",
238
238
  roleId: l
239
- }, b("roles", _);
239
+ }, b("roles", g);
240
240
  }
241
- function F() {
241
+ function V() {
242
242
  n.modelValue && b("roles", [...n.modelValue.roles, x()]);
243
243
  }
244
- function y(r) {
244
+ function _(i) {
245
245
  if (!n.modelValue) return;
246
246
  const l = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [x()];
247
247
  b(
248
248
  "roles",
249
- l.length === 1 ? [x()] : l.filter((_, N) => N !== r)
249
+ l.length === 1 ? [x()] : l.filter((g, M) => M !== i)
250
250
  );
251
251
  }
252
- const D = P(() => {
252
+ const D = w(() => {
253
253
  if (!n.modelValue) return !1;
254
- const r = n.restaurants.some(
255
- (_) => _.managable && !B.value.includes(_._id)
254
+ const i = n.restaurants.some(
255
+ (g) => g.managable && !B.value.includes(g._id)
256
256
  ), l = n.modelValue.roles.every(
257
- (_) => _.restaurantId && _.roleId
257
+ (g) => g.restaurantId && g.roleId
258
258
  );
259
- return r && l;
259
+ return i && l;
260
260
  });
261
- function K() {
262
- C.value && (C.value = !1, M.value = [], b("passcode", ""));
261
+ function q() {
262
+ R.value && (R.value = !1, C.value = [], b("passcode", ""));
263
263
  }
264
- ue(
264
+ me(
265
265
  () => {
266
- var r;
267
- return (r = n.modelValue) == null ? void 0 : r.passcode;
266
+ var i;
267
+ return (i = n.modelValue) == null ? void 0 : i.passcode;
268
268
  },
269
- (r) => {
270
- r && r.length === De ? (M.value = r.split(""), C.value = !0) : (M.value = [], C.value = !1);
269
+ (i) => {
270
+ i && i.length === Ae ? (C.value = i.split(""), R.value = !0) : (C.value = [], R.value = !1);
271
271
  },
272
272
  { immediate: !0 }
273
- ), ue(
273
+ ), me(
274
274
  () => {
275
- var r;
276
- return (r = n.modelValue) == null ? void 0 : r.roles;
275
+ var i;
276
+ return (i = n.modelValue) == null ? void 0 : i.roles;
277
277
  },
278
- (r) => {
279
- n.modelValue && (!r || r.length === 0) && b("roles", [x()]);
278
+ (i) => {
279
+ n.modelValue && (!i || i.length === 0) && b("roles", [x()]);
280
280
  },
281
281
  { immediate: !0, deep: !0 }
282
282
  );
283
- const ae = P({
283
+ const ae = w({
284
284
  get: () => {
285
- var r;
286
- return ((r = n.modelValue) == null ? void 0 : r.roles) ?? [];
285
+ var i;
286
+ return ((i = n.modelValue) == null ? void 0 : i.roles) ?? [];
287
287
  },
288
288
  set: () => {
289
289
  }
290
290
  });
291
- return (r, l) => {
292
- const _ = w("FmSwitch"), N = w("FmTextField"), X = w("FmPinField"), j = w("FmFormGroup"), z = w("FmSelect"), L = w("FmIcon"), G = w("FmButton");
293
- return g(), O("div", Zs, [
294
- i("div", Qs, [
295
- i("div", Ys, [
296
- i("div", Hs, $(o(d)("team.memberForm.masterUser.title")), 1),
297
- i("div", et, $(o(d)("team.memberForm.masterUser.sublabel")), 1)
291
+ return (i, l) => {
292
+ const g = S("FmSwitch"), M = S("FmTextField"), X = S("FmPinField"), j = S("FmFormGroup"), K = S("FmSelect"), L = S("FmIcon"), z = S("FmButton");
293
+ return h(), A("div", Qs, [
294
+ r("div", Ys, [
295
+ r("div", Hs, [
296
+ r("div", et, P(o(d)("team.memberForm.masterUser.title")), 1),
297
+ r("div", st, P(o(d)("team.memberForm.masterUser.sublabel")), 1)
298
298
  ]),
299
- i("div", null, [
300
- u(_, {
299
+ r("div", null, [
300
+ u(g, {
301
301
  "model-value": !!m.modelValue,
302
302
  value: "master-user",
303
303
  "onUpdate:modelValue": p
304
304
  }, null, 8, ["model-value"])
305
305
  ])
306
306
  ]),
307
- m.modelValue ? (g(), O(Ie, { key: 0 }, [
308
- i("div", st, [
309
- u(N, {
307
+ m.modelValue ? (h(), A(ke, { key: 0 }, [
308
+ r("div", tt, [
309
+ u(M, {
310
310
  "model-value": m.modelValue.code,
311
311
  label: o(d)("team.memberForm.masterUser.code"),
312
312
  "onUpdate:modelValue": l[0] || (l[0] = (c) => b("code", c))
313
313
  }, null, 8, ["model-value", "label"]),
314
- u(N, {
314
+ u(M, {
315
315
  "model-value": m.modelValue.name,
316
316
  class: "w-full",
317
317
  label: o(d)("team.memberForm.masterUser.name"),
@@ -319,24 +319,24 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
319
319
  "onUpdate:modelValue": l[1] || (l[1] = (c) => b("name", c))
320
320
  }, null, 8, ["model-value", "label", "rules"])
321
321
  ]),
322
- i("div", tt, [
323
- i("div", at, $(o(d)("team.memberForm.masterUser.passcode")), 1),
322
+ r("div", at, [
323
+ r("div", lt, P(o(d)("team.memberForm.masterUser.passcode")), 1),
324
324
  u(j, {
325
- modelValue: M.value,
326
- "onUpdate:modelValue": l[4] || (l[4] = (c) => M.value = c),
325
+ modelValue: C.value,
326
+ "onUpdate:modelValue": l[4] || (l[4] = (c) => C.value = c),
327
327
  rules: [
328
- (c) => (c == null ? void 0 : c.filter((h) => !!h).length) !== De ? o(d)("team.memberForm.masterUser.passcodeRequired") : !0
328
+ (c) => (c == null ? void 0 : c.filter((y) => !!y).length) !== Ae ? o(d)("team.memberForm.masterUser.passcodeRequired") : !0
329
329
  ]
330
330
  }, {
331
- default: pe(() => [
332
- (g(), H(X, {
333
- key: `pin-field-${C.value}`,
334
- modelValue: M.value,
335
- "onUpdate:modelValue": l[2] || (l[2] = (c) => M.value = c),
336
- length: De,
337
- masked: C.value,
331
+ default: ue(() => [
332
+ (h(), H(X, {
333
+ key: `pin-field-${R.value}`,
334
+ modelValue: C.value,
335
+ "onUpdate:modelValue": l[2] || (l[2] = (c) => C.value = c),
336
+ length: Ae,
337
+ masked: R.value,
338
338
  onComplete: l[3] || (l[3] = (c) => b("passcode", c)),
339
- onFocus: K
339
+ onFocus: q
340
340
  }, null, 8, ["modelValue", "masked"]))
341
341
  ]),
342
342
  _: 1
@@ -347,61 +347,61 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
347
347
  modelValue: ae.value,
348
348
  "onUpdate:modelValue": l[5] || (l[5] = (c) => ae.value = c),
349
349
  rules: [
350
- (c) => !c || c.length === 0 || c.every((h) => !h.restaurantId) ? o(d)("team.memberForm.masterUser.restaurantRequired") : c.some((h) => !h.restaurantId || !h.roleId) ? o(d)("team.memberForm.masterUser.roleRequired") : !0
350
+ (c) => !c || c.length === 0 || c.every((y) => !y.restaurantId) ? o(d)("team.memberForm.masterUser.restaurantRequired") : c.some((y) => !y.restaurantId || !y.roleId) ? o(d)("team.memberForm.masterUser.roleRequired") : !0
351
351
  ]
352
352
  }, {
353
- default: pe(() => [
354
- i("div", lt, [
355
- i("div", ot, $(o(d)("team.memberForm.masterUser.assignmentSection")), 1),
356
- i("div", nt, [
357
- i("div", rt, [
358
- i("div", it, $(o(d)("team.table.columns.restaurant")), 1),
359
- i("div", ut, $(o(d)("team.memberForm.masterUser.role")), 1),
360
- l[6] || (l[6] = i("div", null, null, -1))
353
+ default: ue(() => [
354
+ r("div", ot, [
355
+ r("div", nt, P(o(d)("team.memberForm.masterUser.assignmentSection")), 1),
356
+ r("div", rt, [
357
+ r("div", it, [
358
+ r("div", ut, P(o(d)("team.table.columns.restaurant")), 1),
359
+ r("div", mt, P(o(d)("team.memberForm.masterUser.role")), 1),
360
+ l[6] || (l[6] = r("div", null, null, -1))
361
361
  ]),
362
- (g(!0), O(Ie, null, ts(m.modelValue.roles, (c, h) => (g(), O("div", {
363
- key: `${c.restaurantId || "new"}-${h}`,
362
+ (h(!0), A(ke, null, as(m.modelValue.roles, (c, y) => (h(), A("div", {
363
+ key: `${c.restaurantId || "new"}-${y}`,
364
364
  class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-16"
365
365
  }, [
366
- u(z, {
366
+ u(K, {
367
367
  class: "min-w-0",
368
368
  "model-value": c.restaurantId,
369
369
  items: ee(c.restaurantId),
370
370
  multiselect: !1,
371
371
  placeholder: o(d)("team.table.columns.restaurant"),
372
- "onUpdate:modelValue": (W) => le(h, W)
372
+ "onUpdate:modelValue": (G) => oe(y, G)
373
373
  }, null, 8, ["model-value", "items", "placeholder", "onUpdate:modelValue"]),
374
- u(z, {
374
+ u(K, {
375
375
  class: "min-w-0",
376
376
  "model-value": c.roleId,
377
377
  items: E(c.roleId),
378
378
  multiselect: !1,
379
379
  placeholder: o(d)("team.memberForm.masterUser.role"),
380
380
  disabled: !c.restaurantId,
381
- "onUpdate:modelValue": (W) => q(h, W)
381
+ "onUpdate:modelValue": (G) => T(y, G)
382
382
  }, null, 8, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"]),
383
- i("div", mt, [
384
- m.modelValue.roles.length > 1 ? (g(), O("div", {
383
+ r("div", dt, [
384
+ m.modelValue.roles.length > 1 ? (h(), A("div", {
385
385
  key: 0,
386
386
  role: "button",
387
387
  tabindex: "0",
388
388
  class: "inline-flex h-40 w-40 shrink-0 cursor-pointer items-center justify-center rounded-lg text-fm-color-neutral-gray-400 transition-colors hover:bg-fm-color-neutral-gray-100 focus:outline-none focus:ring-2 focus:ring-fm-color-primary",
389
389
  "aria-label": o(d)("common.remove"),
390
- onClick: Se((W) => y(h), ["stop"]),
390
+ onClick: Fe((G) => _(y), ["stop"]),
391
391
  onKeydown: [
392
- Ae(Se((W) => y(h), ["prevent", "stop"]), ["enter"]),
393
- Ae(Se((W) => y(h), ["prevent", "stop"]), ["space"])
392
+ Be(Fe((G) => _(y), ["prevent", "stop"]), ["enter"]),
393
+ Be(Fe((G) => _(y), ["prevent", "stop"]), ["space"])
394
394
  ]
395
395
  }, [
396
396
  u(L, {
397
397
  name: "delete",
398
398
  size: "md"
399
399
  })
400
- ], 40, dt)) : J("", !0)
400
+ ], 40, ct)) : J("", !0)
401
401
  ])
402
402
  ]))), 128))
403
403
  ]),
404
- u(G, {
404
+ u(z, {
405
405
  type: "button",
406
406
  variant: "secondary",
407
407
  "text-color": "primary",
@@ -410,7 +410,7 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
410
410
  label: o(d)("team.memberForm.masterUser.addAnother"),
411
411
  size: "md",
412
412
  disabled: !D.value,
413
- onClick: Se(F, ["stop"])
413
+ onClick: Fe(V, ["stop"])
414
414
  }, null, 8, ["label", "disabled"])
415
415
  ])
416
416
  ]),
@@ -420,13 +420,13 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
420
420
  ]);
421
421
  };
422
422
  }
423
- }), pt = { class: "flex flex-col gap-32" }, vt = { class: "flex w-full" }, ft = {
423
+ }), vt = { class: "flex flex-col gap-32" }, ft = { class: "flex w-full" }, bt = {
424
424
  key: 0,
425
425
  class: "space-y-24"
426
- }, bt = { class: "space-y-16 rounded-lg border border-fm-color-neutral-gray-200 p-16" }, yt = { class: "fm-typo-en-title-sm-600" }, ht = { class: "space-y-16" }, gt = { class: "fm-typo-en-title-sm-600" }, _t = {
426
+ }, _t = { class: "space-y-16 rounded-lg border border-fm-color-neutral-gray-200 p-16" }, yt = { class: "fm-typo-en-title-sm-600" }, ht = { class: "space-y-16" }, gt = { class: "fm-typo-en-title-sm-600" }, xt = {
427
427
  key: 1,
428
428
  class: "flex items-center justify-center py-64"
429
- }, xt = /* @__PURE__ */ Fe({
429
+ }, Ut = /* @__PURE__ */ Se({
430
430
  __name: "AddMemberForm",
431
431
  props: {
432
432
  initialValue: {
@@ -441,38 +441,38 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
441
441
  default: !1
442
442
  }
443
443
  },
444
- setup(m, { expose: A }) {
445
- var ve, ge, _e;
446
- const n = m, { t: a } = Ve(), d = v(), C = Xe(), M = P(
447
- () => C.permissionSets.value.map((t) => ({
444
+ setup(m, { expose: O }) {
445
+ var ve, he, ge;
446
+ const n = m, { t: a } = Ve(), d = v(), R = Ze(), C = w(
447
+ () => R.permissionSets.value.map((t) => ({
448
448
  label: t.name,
449
449
  value: t.id
450
450
  }))
451
- ), x = v(((ve = n.initialValue) == null ? void 0 : ve.permissionSetIds) || []), B = P(
452
- () => Le(x.value, C.permissionSets.value)
453
- ), p = v((ge = n.initialValue) == null ? void 0 : ge.posUser), b = v(
454
- Te(
455
- Pe(B.value),
456
- ((_e = n.initialValue) == null ? void 0 : _e.permissions) || []
451
+ ), x = v(((ve = n.initialValue) == null ? void 0 : ve.permissionSetIds) || []), B = w(
452
+ () => Te(x.value, R.permissionSets.value)
453
+ ), p = v((he = n.initialValue) == null ? void 0 : he.posUser), b = v(
454
+ qe(
455
+ Ie(B.value),
456
+ ((ge = n.initialValue) == null ? void 0 : ge.permissions) || []
457
457
  )
458
- ), { customReportPermissions: ee, isLoaded: E } = Ze(), le = new Set(
459
- qe.filter((t) => t.subject.startsWith(_s)).map((t) => t.subject)
460
- ), q = P(() => {
461
- const t = new Set(le);
458
+ ), { customReportPermissions: ee, isLoaded: E } = Qe(), oe = new Set(
459
+ Ke.filter((t) => t.subject.startsWith(xs)).map((t) => t.subject)
460
+ ), T = w(() => {
461
+ const t = new Set(oe);
462
462
  for (const f of ee.value) t.add(f.subject);
463
463
  return t;
464
- }), F = P(() => {
464
+ }), V = w(() => {
465
465
  const t = /* @__PURE__ */ new Set();
466
- for (const f of qe)
467
- f.category === je.reports && t.add(f.subject);
466
+ for (const f of Ke)
467
+ f.category === Ee.reports && t.add(f.subject);
468
468
  for (const f of ee.value)
469
- f.category === je.reports && t.add(f.subject);
469
+ f.category === Ee.reports && t.add(f.subject);
470
470
  return t;
471
- }), y = Je(), D = Qe().roles, K = P(() => Ke(b.value)), ae = P(() => {
472
- const t = ze(b.value);
473
- return t === null ? y.restaurants.value : y.restaurants.value.filter((f) => t.includes(f._id));
474
- }), r = P(() => {
475
- const t = K.value;
471
+ }), _ = Xe(), D = Ye().roles, q = w(() => ze(b.value)), ae = w(() => {
472
+ const t = Ge(b.value);
473
+ return t === null ? _.restaurants.value : _.restaurants.value.filter((f) => t.includes(f._id));
474
+ }), i = w(() => {
475
+ const t = q.value;
476
476
  return D.value.map(
477
477
  (f) => ({
478
478
  label: f.name,
@@ -481,130 +481,130 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
481
481
  })
482
482
  );
483
483
  }), l = v({ permissionSetIds: [], userPermissions: [], posUser: void 0 });
484
- function _(t) {
485
- d.value = void 0, x.value = [...(t == null ? void 0 : t.permissionSetIds) ?? []], b.value = Te(
486
- Pe(
487
- Le(
484
+ function g(t) {
485
+ d.value = void 0, x.value = [...(t == null ? void 0 : t.permissionSetIds) ?? []], b.value = qe(
486
+ Ie(
487
+ Te(
488
488
  x.value,
489
- C.permissionSets.value
489
+ R.permissionSets.value
490
490
  )
491
491
  ),
492
492
  (t == null ? void 0 : t.permissions) || []
493
- ), p.value = t != null && t.posUser ? h(ce(t.posUser), b.value) : void 0, W.value = !!p.value, l.value = {
493
+ ), p.value = t != null && t.posUser ? y(pe(t.posUser), b.value) : void 0, G.value = !!p.value, l.value = {
494
494
  permissionSetIds: [...x.value],
495
- userPermissions: ce(b.value),
496
- posUser: p.value ? ce(p.value) : void 0
495
+ userPermissions: pe(b.value),
496
+ posUser: p.value ? pe(p.value) : void 0
497
497
  };
498
498
  }
499
- function N() {
500
- return !n.initialValue && d.value ? !0 : !Ne.isEqual(x.value, l.value.permissionSetIds) || !Ne.isEqual(b.value, l.value.userPermissions) || !Ne.isEqual(p.value, l.value.posUser);
499
+ function M() {
500
+ return !n.initialValue && d.value ? !0 : !De.isEqual(x.value, l.value.permissionSetIds) || !De.isEqual(b.value, l.value.userPermissions) || !De.isEqual(p.value, l.value.posUser);
501
501
  }
502
502
  function X(t) {
503
503
  d.value = t;
504
504
  }
505
505
  function j(t) {
506
- p.value = h(p.value, t);
506
+ p.value = y(p.value, t);
507
507
  }
508
- function z() {
509
- const t = Pe(B.value), f = E.value ? q.value : le, I = xs(b.value, f), k = Us(I, F.value), R = Ss(k);
510
- return Fs(t, R);
508
+ function K() {
509
+ const t = Ie(B.value), f = E.value ? T.value : oe, I = Us(b.value, f), k = Fs(I, V.value), $ = Ss(k);
510
+ return Vs(t, $);
511
511
  }
512
512
  function L() {
513
- var I, k, R, Z, ne, re, me, se, Q, de;
514
- const t = z(), f = b.value.filter((Y) => !Y.inverted);
513
+ var I, k, $, Z, re, ie, de, se, Q, ce;
514
+ const t = K(), f = b.value.filter((Y) => !Y.inverted);
515
515
  return {
516
516
  email: ((I = d.value) == null ? void 0 : I.email) ?? void 0,
517
517
  phoneNumber: ((k = d.value) == null ? void 0 : k.phoneNumber) ?? void 0,
518
518
  customPermissions: t,
519
519
  permissions: f.map((Y) => ({
520
520
  ...Y,
521
- subject: cs(Y.subject)
521
+ subject: ps(Y.subject)
522
522
  })),
523
523
  permissionSetIds: x.value,
524
- name: ((R = d.value) == null ? void 0 : R.displayName) || ((Z = n.initialValue) == null ? void 0 : Z.name) || "",
524
+ name: (($ = d.value) == null ? void 0 : $.displayName) || ((Z = n.initialValue) == null ? void 0 : Z.name) || "",
525
525
  posUser: p.value ? {
526
526
  ...p.value,
527
- name: p.value.name || ((re = (ne = n.initialValue) == null ? void 0 : ne.posUser) == null ? void 0 : re.name) || ((me = n.initialValue) == null ? void 0 : me.name) || ((se = d.value) == null ? void 0 : se.displayName) || "",
528
- code: p.value.code || ((de = (Q = n.initialValue) == null ? void 0 : Q.posUser) == null ? void 0 : de.code) || "",
527
+ name: p.value.name || ((ie = (re = n.initialValue) == null ? void 0 : re.posUser) == null ? void 0 : ie.name) || ((de = n.initialValue) == null ? void 0 : de.name) || ((se = d.value) == null ? void 0 : se.displayName) || "",
528
+ code: p.value.code || ((ce = (Q = n.initialValue) == null ? void 0 : Q.posUser) == null ? void 0 : ce.code) || "",
529
529
  passcode: p.value.passcode,
530
530
  roles: p.value.roles.filter((Y) => !!Y.roleId)
531
531
  } : p.value === null ? null : void 0
532
532
  };
533
533
  }
534
- const G = v();
534
+ const z = v();
535
535
  function c() {
536
- b.value = Pe(B.value);
536
+ b.value = Ie(B.value);
537
537
  }
538
- function h(t, f) {
538
+ function y(t, f) {
539
539
  if (!t) return t;
540
- const I = Ke(f), k = ze(f);
540
+ const I = ze(f), k = Ge(f);
541
541
  if (I === null && k === null) return t;
542
- const R = ce(t);
543
- return R.roles = R.roles.filter(
542
+ const $ = pe(t);
543
+ return $.roles = $.roles.filter(
544
544
  (Z) => (I === null || I.includes(Z.roleId)) && (k === null || k.includes(Z.restaurantId))
545
- ), R;
545
+ ), $;
546
546
  }
547
- const W = v(!!p.value), he = v(!1);
547
+ const G = v(!!p.value), ye = v(!1);
548
548
  function Re(t) {
549
- p.value = t, he.value = !0;
549
+ p.value = t, ye.value = !0;
550
550
  }
551
- ue(
551
+ me(
552
552
  () => !!p.value,
553
553
  async (t) => {
554
- t && !W.value && (await as(), G.value && G.value.$el.scrollIntoView({ behavior: "smooth", block: "start" })), W.value = t;
554
+ t && !G.value && (await ls(), z.value && z.value.$el.scrollIntoView({ behavior: "smooth", block: "start" })), G.value = t;
555
555
  }
556
556
  );
557
- const oe = v();
557
+ const ne = v();
558
558
  async function we() {
559
- return (await oe.value.validateInputsWithoutSubmit()).length ? null : L();
559
+ return (await ne.value.validateInputsWithoutSubmit()).length ? null : L();
560
560
  }
561
- return ue(
561
+ return me(
562
562
  () => n.initialValue,
563
563
  (t, f) => {
564
564
  if (!f || !t) {
565
- he.value = !1, _(t);
565
+ ye.value = !1, g(t);
566
566
  return;
567
567
  }
568
- t.posUser !== void 0 && !he.value && (p.value = t.posUser ? h(ce(t.posUser), b.value) : void 0, l.value = {
568
+ t.posUser !== void 0 && !ye.value && (p.value = t.posUser ? y(pe(t.posUser), b.value) : void 0, l.value = {
569
569
  ...l.value,
570
- posUser: p.value ? ce(p.value) : void 0
570
+ posUser: p.value ? pe(p.value) : void 0
571
571
  });
572
572
  },
573
573
  { immediate: !0 }
574
- ), ue(
574
+ ), me(
575
575
  b,
576
576
  (t) => {
577
- p.value = h(p.value, t);
577
+ p.value = y(p.value, t);
578
578
  },
579
579
  { deep: !0 }
580
- ), A({
580
+ ), O({
581
581
  readFormData: L,
582
582
  validate: we,
583
- isModified: N
583
+ isModified: M
584
584
  }), (t, f) => {
585
- const I = w("FmSelect"), k = w("FmCircularProgress"), R = w("FmForm");
586
- return g(), H(R, {
585
+ const I = S("FmSelect"), k = S("FmCircularProgress"), $ = S("FmForm");
586
+ return h(), H($, {
587
587
  ref_key: "formRef",
588
- ref: oe,
588
+ ref: ne,
589
589
  class: "mx-4"
590
590
  }, {
591
- default: pe(() => {
592
- var Z, ne, re, me, se;
591
+ default: ue(() => {
592
+ var Z, re, ie, de, se;
593
593
  return [
594
- i("div", pt, [
595
- i("div", vt, [
596
- m.initialValue ? (g(), H(js, {
594
+ r("div", vt, [
595
+ r("div", ft, [
596
+ m.initialValue ? (h(), H(Es, {
597
597
  key: 1,
598
598
  data: m.initialValue
599
- }, null, 8, ["data"])) : (g(), H(Xs, {
599
+ }, null, 8, ["data"])) : (h(), H(Zs, {
600
600
  key: 0,
601
601
  onInvite: f[0] || (f[0] = (Q) => X(Q))
602
602
  }))
603
603
  ]),
604
- d.value || m.initialValue ? (g(), O(Ie, { key: 0 }, [
605
- (Z = m.initialValue) != null && Z.isOwner ? J("", !0) : (g(), O("div", ft, [
606
- i("div", bt, [
607
- i("div", yt, $(o(a)("team.memberForm.permissionSet.title")), 1),
604
+ d.value || m.initialValue ? (h(), A(ke, { key: 0 }, [
605
+ (Z = m.initialValue) != null && Z.isOwner ? J("", !0) : (h(), A("div", bt, [
606
+ r("div", _t, [
607
+ r("div", yt, P(o(a)("team.memberForm.permissionSet.title")), 1),
608
608
  u(I, {
609
609
  modelValue: x.value,
610
610
  "onUpdate:modelValue": [
@@ -614,13 +614,13 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
614
614
  multiselect: "",
615
615
  searchable: "",
616
616
  "search-debounce": 300,
617
- items: M.value,
617
+ items: C.value,
618
618
  placeholder: o(a)("team.memberForm.permissionSet.selectPlaceholder")
619
619
  }, null, 8, ["modelValue", "items", "placeholder"])
620
620
  ]),
621
- i("div", ht, [
622
- i("div", gt, $(o(a)("team.memberForm.permissions.title")), 1),
623
- u(ws, {
621
+ r("div", ht, [
622
+ r("div", gt, P(o(a)("team.memberForm.permissions.title")), 1),
623
+ u(Ps, {
624
624
  modelValue: b.value,
625
625
  "onUpdate:modelValue": f[2] || (f[2] = (Q) => b.value = Q),
626
626
  "inherit-permissions": B.value,
@@ -628,16 +628,16 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
628
628
  }, null, 8, ["modelValue", "inherit-permissions"])
629
629
  ])
630
630
  ])),
631
- m.loading ? (g(), O("div", _t, [
631
+ m.loading ? (h(), A("div", xt, [
632
632
  u(k, { size: "xl" })
633
- ])) : (g(), H(ct, {
633
+ ])) : (h(), H(pt, {
634
634
  key: 2,
635
635
  ref_key: "masterUserContentRef",
636
- ref: G,
636
+ ref: z,
637
637
  "model-value": p.value,
638
- "fallback-name": ((ne = m.initialValue) == null ? void 0 : ne.name) || ((re = d.value) == null ? void 0 : re.displayName) || "",
639
- "fallback-passcode": (se = (me = m.initialValue) == null ? void 0 : me.posUser) == null ? void 0 : se.passcode,
640
- roles: r.value,
638
+ "fallback-name": ((re = m.initialValue) == null ? void 0 : re.name) || ((ie = d.value) == null ? void 0 : ie.displayName) || "",
639
+ "fallback-passcode": (se = (de = m.initialValue) == null ? void 0 : de.posUser) == null ? void 0 : se.passcode,
640
+ roles: i.value,
641
641
  restaurants: ae.value,
642
642
  "onUpdate:modelValue": Re
643
643
  }, null, 8, ["model-value", "fallback-name", "fallback-passcode", "roles", "restaurants"]))
@@ -649,67 +649,71 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
649
649
  }, 512);
650
650
  };
651
651
  }
652
- }), Ut = {
652
+ }), Ft = {
653
653
  class: "space-y-24"
654
654
  }, St = {
655
655
  class: "space-y-8"
656
- }, Ft = {
656
+ }, Vt = {
657
657
  key: 0,
658
658
  class: "flex w-full items-start justify-between px-16"
659
- }, Vt = {
660
- class: "flex items-start gap-8"
661
659
  }, wt = {
660
+ class: "flex items-start gap-8"
661
+ }, Pt = {
662
662
  key: 1,
663
663
  class: "space-y-4 px-16"
664
- }, Pt = {
665
- class: "flex items-start gap-8"
666
664
  }, It = {
667
- class: "flex h-full flex-col"
665
+ class: "flex items-start gap-8"
668
666
  }, kt = {
667
+ class: "flex h-full flex-col"
668
+ }, $t = {
669
+ class: "flex w-full items-center justify-between"
670
+ }, Rt = {
671
+ class: "fm-typo-en-title-md-600"
672
+ }, Ct = {
669
673
  class: "flex items-center justify-start gap-8"
670
674
  }, be = 100;
671
675
  var te = /* @__PURE__ */ function(m) {
672
676
  return m[m.ADD = 0] = "ADD", m[m.UPDATE = 1] = "UPDATE", m[m.CLOSED = 2] = "CLOSED", m;
673
677
  }(te || {});
674
- const zt = /* @__PURE__ */ Fe({
678
+ const Jt = /* @__PURE__ */ Se({
675
679
  __name: "TeamMemberList",
676
680
  setup(m, {
677
- expose: A
681
+ expose: O
678
682
  }) {
679
683
  const {
680
684
  fetchCustomReportPermissions: n
681
- } = Ze(), {
685
+ } = Qe(), {
682
686
  t: a
683
- } = Ve(), d = ke(), C = Je(), M = Qe(), x = We(), B = gs(x), p = Xe(), b = Vs(), ee = v(!0), E = v(!1), le = P(() => C.isLoading.value), q = v([]), F = v(0), y = v(1), D = v(""), K = v("");
684
- ue(C.restaurants, (e) => {
685
- if (e.length > 0 && q.value.length > 0) {
686
- const s = new Map(e.map((S) => [S._id, S.profile.name])), U = e.map((S) => S.profile.name).sort();
687
- q.value = q.value.map((S) => ({
688
- ...S,
689
- restaurants: S.managableRestaurantIds === null ? U : S.managableRestaurantIds.map((T) => s.get(T) ?? "").filter(Boolean).sort()
687
+ } = Ve(), d = $e(), R = Xe(), C = Ye(), x = Je(), B = gs(x), p = Ze(), b = ws(), ee = v(!0), E = v(!1), oe = w(() => R.isLoading.value), T = v([]), V = v(0), _ = v(1), D = v(""), q = v("");
688
+ me(R.restaurants, (e) => {
689
+ if (e.length > 0 && T.value.length > 0) {
690
+ const s = new Map(e.map((F) => [F._id, F.profile.name])), U = e.map((F) => F.profile.name).sort();
691
+ T.value = T.value.map((F) => ({
692
+ ...F,
693
+ restaurants: F.managableRestaurantIds === null ? U : F.managableRestaurantIds.map((W) => s.get(W) ?? "").filter(Boolean).sort()
690
694
  }));
691
695
  }
692
696
  });
693
- const ae = P(() => C.restaurants.value.map((e) => ({
697
+ const ae = w(() => R.restaurants.value.map((e) => ({
694
698
  label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
695
699
  value: e._id
696
- }))), r = ({
700
+ }))), i = ({
697
701
  member: e,
698
702
  className: s = ""
699
703
  }) => {
700
704
  const U = {
701
705
  label: a("team.actions.updateMember"),
702
- onClick: () => G(ye.Update, e)
703
- }, S = {
706
+ onClick: () => z(_e.Update, e)
707
+ }, F = {
704
708
  label: a("team.actions.removeMember"),
705
- onClick: () => G(ye.Remove, e),
709
+ onClick: () => z(_e.Remove, e),
706
710
  itemClass: "text-fm-color-typo-error"
707
- }, T = e.doc.isOwner ? [U] : [U, S];
711
+ }, W = e.doc.isOwner ? [U] : [U, F];
708
712
  return u(ys, {
709
713
  class: s,
710
- items: T
714
+ items: W
711
715
  }, null);
712
- }, l = (e) => e.doc.isOwner ? a("team.labels.businessOwner") : e.restaurants.join(", "), _ = [{
716
+ }, l = (e) => e.doc.isOwner ? a("team.labels.businessOwner") : e.restaurants.join(", "), g = [{
713
717
  accessorKey: "name",
714
718
  header: () => a("team.table.columns.name"),
715
719
  enableSorting: !1,
@@ -717,7 +721,7 @@ const zt = /* @__PURE__ */ Fe({
717
721
  const s = e.row.original;
718
722
  return u("div", {
719
723
  class: "flex items-center gap-8"
720
- }, [u(Me.FmAvatar, {
724
+ }, [u(Ne.FmAvatar, {
721
725
  initials: s.name,
722
726
  size: "sm",
723
727
  class: "shrink-0"
@@ -734,8 +738,8 @@ const zt = /* @__PURE__ */ Fe({
734
738
  header: () => a("team.table.columns.restaurant"),
735
739
  enableSorting: !1,
736
740
  cell(e) {
737
- if (le.value)
738
- return os(ms);
741
+ if (oe.value)
742
+ return ns(ds);
739
743
  const s = e.row.original;
740
744
  return l(s);
741
745
  }
@@ -744,8 +748,8 @@ const zt = /* @__PURE__ */ Fe({
744
748
  header: () => a("team.table.columns.assignedRoles"),
745
749
  enableSorting: !1,
746
750
  cell(e) {
747
- const s = e.row.original, U = b.getPermissionAssignmentByUserId(s.id), S = (U == null ? void 0 : U.permissionSetIds) || s.doc.permissionSetIds || [];
748
- return p.permissionSets.value.filter((ie) => S.includes(ie.id)).map((ie) => ie.name).join(", ");
751
+ const s = e.row.original, U = b.getPermissionAssignmentByUserId(s.id), F = (U == null ? void 0 : U.permissionSetIds) || s.doc.permissionSetIds || [];
752
+ return p.permissionSets.value.filter((le) => F.includes(le.id)).map((le) => le.name).join(", ");
749
753
  }
750
754
  }, {
751
755
  accessorKey: "permission",
@@ -753,7 +757,7 @@ const zt = /* @__PURE__ */ Fe({
753
757
  enableSorting: !1,
754
758
  cell(e) {
755
759
  const s = e.row.original;
756
- return N(s);
760
+ return M(s);
757
761
  },
758
762
  meta: {
759
763
  width: "200px"
@@ -766,25 +770,25 @@ const zt = /* @__PURE__ */ Fe({
766
770
  },
767
771
  cell(e) {
768
772
  const s = e.row.original;
769
- return r({
773
+ return i({
770
774
  member: s,
771
775
  className: "flex justify-end w-full"
772
776
  });
773
777
  },
774
778
  enableSorting: !1
775
779
  }];
776
- function N(e) {
780
+ function M(e) {
777
781
  if (e.doc.isOwner)
778
782
  return a("team.labels.businessOwner");
779
- const s = u(Me.FmTooltip, {
783
+ const s = u(Ne.FmTooltip, {
780
784
  variant: "plain",
781
785
  placement: "top"
782
786
  }, {
783
- default: () => u(Me.FmIcon, {
787
+ default: () => u(Ne.FmIcon, {
784
788
  name: "info",
785
789
  class: "cursor-pointer text-fm-color-neutral-gray-300"
786
790
  }, null),
787
- content: () => u("div", null, [a("team.labels.permission"), e.permissionLabels.map((U) => u("div", null, [ns("- "), U]))])
791
+ content: () => u("div", null, [a("team.labels.permission"), e.permissionLabels.map((U) => u("div", null, [rs("- "), U]))])
788
792
  });
789
793
  return u("div", {
790
794
  class: "flex flex-row items-center gap-8"
@@ -793,8 +797,8 @@ const zt = /* @__PURE__ */ Fe({
793
797
  })]), e.permissionLabels.length > 0 && s]);
794
798
  }
795
799
  function X(e) {
796
- var T, ie, xe, V;
797
- const s = b.getPermissionAssignmentByUserId(e.id), U = (s == null ? void 0 : s.customPermissions) || e.permissions || [], S = (s == null ? void 0 : s.permissionSetIds) || [];
800
+ var W, le, Pe, xe;
801
+ const s = b.getPermissionAssignmentByUserId(e.id), U = (s == null ? void 0 : s.customPermissions) || e.permissions || [], F = (s == null ? void 0 : s.permissionSetIds) || [];
798
802
  return {
799
803
  id: e.id,
800
804
  isOwner: e.doc.isOwner,
@@ -802,17 +806,17 @@ const zt = /* @__PURE__ */ Fe({
802
806
  phoneNumber: e.phoneNumber,
803
807
  email: e.email,
804
808
  permissions: U,
805
- permissionSetIds: S,
809
+ permissionSetIds: F,
806
810
  posUser: e.doc.posUser ? {
807
- code: ((T = e.doc.posUser) == null ? void 0 : T.code) ?? "",
808
- name: ((ie = e.doc.posUser) == null ? void 0 : ie.name) ?? e.name,
809
- passcode: ((xe = e.doc.posUser) == null ? void 0 : xe.passcode) ?? "",
810
- roles: ((V = e.doc.posUser) == null ? void 0 : V.roles) ?? []
811
+ code: ((W = e.doc.posUser) == null ? void 0 : W.code) ?? "",
812
+ name: ((le = e.doc.posUser) == null ? void 0 : le.name) ?? e.name,
813
+ passcode: ((Pe = e.doc.posUser) == null ? void 0 : Pe.passcode) ?? "",
814
+ roles: ((xe = e.doc.posUser) == null ? void 0 : xe.roles) ?? []
811
815
  } : void 0
812
816
  };
813
817
  }
814
818
  function j(e) {
815
- const s = b.getPermissionAssignmentByUserId(e.id), U = (s == null ? void 0 : s.customPermissions) || e.permissions || [], S = (s == null ? void 0 : s.permissionSetIds) || [];
819
+ const s = b.getPermissionAssignmentByUserId(e.id), U = (s == null ? void 0 : s.customPermissions) || e.permissions || [], F = (s == null ? void 0 : s.permissionSetIds) || [];
816
820
  return {
817
821
  id: e.id,
818
822
  isOwner: e.doc.isOwner,
@@ -820,105 +824,105 @@ const zt = /* @__PURE__ */ Fe({
820
824
  phoneNumber: e.phoneNumber,
821
825
  email: e.email,
822
826
  permissions: U,
823
- permissionSetIds: S,
827
+ permissionSetIds: F,
824
828
  posUser: void 0
825
829
  };
826
830
  }
827
- const z = v(!1);
831
+ const K = v(!1);
828
832
  let L = 0;
829
- const G = async (e, s) => {
830
- if (e == ye.Update) {
833
+ const z = async (e, s) => {
834
+ if (e == _e.Update) {
831
835
  const U = ++L;
832
- oe.value = j(s), h.value = te.UPDATE, z.value = s.doc.hasPosUser === !0;
836
+ ne.value = j(s), y.value = te.UPDATE, K.value = s.doc.hasPosUser === !0;
833
837
  try {
834
- const S = await Ue.readTeamMember(s.id);
838
+ const F = await Ue.readTeamMember(s.id);
835
839
  if (U !== L) return;
836
- oe.value = X(S);
840
+ ne.value = X(F);
837
841
  } catch {
838
842
  if (U !== L) return;
839
843
  x.open({
840
844
  message: a("common.error"),
841
845
  type: "error"
842
- }), ge();
846
+ }), he();
843
847
  } finally {
844
- U === L && (z.value = !1);
848
+ U === L && (K.value = !1);
845
849
  }
846
850
  }
847
- e == ye.Remove && t(s);
848
- }, c = rs(), h = v(te.CLOSED), W = P(() => h.value !== te.CLOSED), he = P(() => h.value === te.ADD ? a("common.add") : a("common.update")), Re = P(() => h.value === te.ADD ? a("team.actions.addMember") : a("team.actions.updateMember")), oe = v();
851
+ e == _e.Remove && t(s);
852
+ }, c = is(), y = v(te.CLOSED), G = w(() => y.value !== te.CLOSED), ye = w(() => y.value === te.ADD ? a("common.add") : a("common.update")), Re = w(() => y.value === te.ADD ? a("team.actions.addMember") : a("team.actions.updateMember")), ne = v();
849
853
  function we() {
850
- L++, z.value = !1, h.value = te.CLOSED;
854
+ L++, K.value = !1, y.value = te.CLOSED;
851
855
  }
852
- const ve = bs(() => {
856
+ const ve = _s(() => {
853
857
  var e;
854
- return ((e = de.value) == null ? void 0 : e.isModified()) ?? !1;
858
+ return ((e = ce.value) == null ? void 0 : e.isModified()) ?? !1;
855
859
  }, we);
856
- function ge() {
860
+ function he() {
857
861
  ve();
858
862
  }
859
863
  const {
860
- breakpoints: _e
861
- } = is(), t = (e) => {
864
+ breakpoints: ge
865
+ } = us(), t = (e) => {
862
866
  c.open({
863
867
  title: a("team.actions.removeMember"),
864
868
  message: a("team.removeMember.confirmationMessage", {
865
869
  memberName: e.name
866
870
  }),
867
- minWidth: _e.value.lg ? 588 : 0,
871
+ minWidth: ge.value.lg ? 588 : 0,
868
872
  primaryActions: {
869
873
  text: "Remove",
870
874
  close: !1,
871
875
  variant: "destructive",
872
- isLoading: $e
876
+ isLoading: Ce
873
877
  },
874
878
  secondaryActions: {
875
879
  text: "Cancel",
876
880
  close: !0
877
881
  }
878
882
  }).onPrimary(async () => {
879
- $e.value || (await B.minor(async () => {
883
+ Ce.value || (await B.minor(async () => {
880
884
  await Ue.deleteTeamMember(e.id), await Q();
881
885
  }, {
882
- isLoading: $e,
886
+ isLoading: Ce,
883
887
  successMessage: a("team.removeMember.successMessage", {
884
888
  memberName: e.name
885
889
  })
886
890
  }), c.close());
887
891
  });
888
892
  }, f = () => {
889
- oe.value = null, h.value = te.ADD;
890
- }, I = v(), k = v(), R = v(), Z = P(() => {
893
+ ne.value = null, y.value = te.ADD;
894
+ }, I = v(), k = v(), $ = v(), Z = w(() => {
891
895
  var e;
892
896
  return JSON.stringify({
893
897
  businessId: ((e = d.currentBusiness.value) == null ? void 0 : e._id) ?? "",
894
- search: K.value.trim(),
898
+ search: q.value.trim(),
895
899
  restaurantIds: [...I.value ?? []].sort(),
896
900
  permissionSubjects: [...k.value ?? []].sort(),
897
- permissionSetIds: [...R.value ?? []].sort()
901
+ permissionSetIds: [...$.value ?? []].sort()
898
902
  });
899
- }), ne = P(() => Object.values(ps).map((e) => ({
903
+ }), re = w(() => Object.values(vs).map((e) => ({
900
904
  label: e.label,
901
905
  value: e.subject
902
- }))), re = P(() => p.permissionSets.value.map((e) => ({
906
+ }))), ie = w(() => p.permissionSets.value.map((e) => ({
903
907
  label: e.name,
904
908
  value: e.id
905
909
  })));
906
- async function me() {
907
- await M.readRoles();
910
+ async function de() {
911
+ await C.readRoles();
908
912
  }
909
- async function se(e = y.value) {
910
- var s, U, S;
913
+ async function se(e = _.value) {
914
+ var s, U, F;
911
915
  ee.value = !0;
912
916
  try {
913
- const T = await Ue.readTeamMembersPage({
917
+ const W = await Ue.readTeamMembersPage({
914
918
  limit: be,
915
919
  offset: (e - 1) * be,
916
- search: K.value.trim() || void 0,
920
+ search: q.value.trim() || void 0,
917
921
  restaurantIds: (s = I.value) != null && s.length ? I.value : void 0,
918
922
  permissionSubjects: (U = k.value) != null && U.length ? k.value : void 0,
919
- permissionSetIds: (S = R.value) != null && S.length ? R.value : void 0
923
+ permissionSetIds: (F = $.value) != null && F.length ? $.value : void 0
920
924
  });
921
- q.value = T.items, F.value = T.total;
925
+ T.value = W.items, V.value = W.total;
922
926
  } finally {
923
927
  ee.value = !1;
924
928
  }
@@ -926,18 +930,18 @@ const zt = /* @__PURE__ */ Fe({
926
930
  async function Q() {
927
931
  var s;
928
932
  if (!((s = d.currentBusiness.value) != null && s._id)) return;
929
- await se(y.value);
930
- const e = Math.max(1, Math.ceil(F.value / be));
931
- y.value > e && (y.value = e, await se(y.value));
933
+ await se(_.value);
934
+ const e = Math.max(1, Math.ceil(V.value / be));
935
+ _.value > e && (_.value = e, await se(_.value));
932
936
  }
933
- const de = v(), Y = v(!1), $e = v(!1);
934
- async function Ye() {
935
- if (!de.value) return;
936
- const e = await de.value.validate();
937
+ const ce = v(), Y = v(!1), Ce = v(!1);
938
+ async function He() {
939
+ if (!ce.value) return;
940
+ const e = await ce.value.validate();
937
941
  if (!e) return;
938
- const s = h.value === te.ADD;
942
+ const s = y.value === te.ADD;
939
943
  await B.minor(async () => {
940
- await (s ? Ue.createTeamMember(e) : Ue.updateTeamMember(oe.value.id, e)), we(), await Oe(), await Q();
944
+ await (s ? Ue.createTeamMember(e) : Ue.updateTeamMember(ne.value.id, e)), we(), await Oe(), await Q();
941
945
  }, {
942
946
  successMessage: s ? a("team.addMember.successMessage", {
943
947
  memberName: e.name
@@ -945,41 +949,41 @@ const zt = /* @__PURE__ */ Fe({
945
949
  memberName: e.name
946
950
  }),
947
951
  isLoading: Y
948
- }), h.value = te.CLOSED;
952
+ }), y.value = te.CLOSED;
949
953
  }
950
- async function He() {
954
+ async function es() {
951
955
  await p.readPermissionSets();
952
956
  }
953
957
  async function Oe() {
954
958
  await b.readPermissionAssignments();
955
959
  }
956
- let Ce = !1;
957
- async function es({
960
+ let Me = !1;
961
+ async function ss({
958
962
  pageIndex: e
959
963
  }) {
960
964
  var s;
961
- if ((s = d.currentBusiness.value) != null && s._id && !Ce && !(e === 0 && y.value === 1 && q.value.length > 0)) {
962
- Ce = !0, y.value = e + 1;
965
+ if ((s = d.currentBusiness.value) != null && s._id && !Me && !(e === 0 && _.value === 1 && T.value.length > 0)) {
966
+ Me = !0, _.value = e + 1;
963
967
  try {
964
- await se(y.value);
968
+ await se(_.value);
965
969
  } finally {
966
- Ce = !1;
970
+ Me = !1;
967
971
  }
968
972
  }
969
973
  }
970
- const ss = us(D, () => {
971
- K.value = D.value;
974
+ const ts = ms(D, () => {
975
+ q.value = D.value;
972
976
  });
973
- return ls(ss), ue(Z, async () => {
977
+ return os(ts), me(Z, async () => {
974
978
  var e;
975
- y.value = 1, E.value = !1, (e = d.currentBusiness.value) != null && e._id && (await se(1), E.value = !0);
979
+ _.value = 1, E.value = !1, (e = d.currentBusiness.value) != null && e._id && (await se(1), E.value = !0);
976
980
  }, {
977
981
  immediate: !0
978
- }), ue(d.currentBusiness, async () => {
982
+ }), me(d.currentBusiness, async () => {
979
983
  var e;
980
984
  if ((e = d.currentBusiness.value) != null && e._id)
981
985
  try {
982
- await Promise.all([C.readRestaurants(), He(), Oe(), n(), me()]);
986
+ await Promise.all([R.readRestaurants(), es(), Oe(), n(), de()]);
983
987
  } catch (s) {
984
988
  console.error("Failed to load team member dependencies:", s), x.open({
985
989
  message: s instanceof Error ? s.message : String(s),
@@ -988,19 +992,19 @@ const zt = /* @__PURE__ */ Fe({
988
992
  }
989
993
  }, {
990
994
  immediate: !0
991
- }), A({
995
+ }), O({
992
996
  create: f
993
997
  }), (e, s) => {
994
998
  var xe;
995
- const U = w("FmSearch"), S = w("FmTable"), T = w("FmButton"), ie = w("FmSideSheet");
996
- return g(), O(Ie, null, [i("div", Ut, [i("div", St, [o(_e).xs ? (g(), O("div", wt, [u(U, {
999
+ const U = S("FmSearch"), F = S("FmTable"), W = S("FmIcon"), le = S("FmButton"), Pe = S("FmSideSheet");
1000
+ return h(), A(ke, null, [r("div", Ft, [r("div", St, [o(ge).xs ? (h(), A("div", Pt, [u(U, {
997
1001
  modelValue: D.value,
998
- "onUpdate:modelValue": s[4] || (s[4] = (V) => D.value = V),
1002
+ "onUpdate:modelValue": s[4] || (s[4] = (N) => D.value = N),
999
1003
  class: "w-[320px] xs:w-full xs:mt-8",
1000
1004
  placeholder: o(a)("team.search.placeholder")
1001
- }, null, 8, ["modelValue", "placeholder"]), i("div", Pt, [u(fe, {
1005
+ }, null, 8, ["modelValue", "placeholder"]), r("div", It, [u(fe, {
1002
1006
  modelValue: I.value,
1003
- "onUpdate:modelValue": s[5] || (s[5] = (V) => I.value = V),
1007
+ "onUpdate:modelValue": s[5] || (s[5] = (N) => I.value = N),
1004
1008
  multiple: "",
1005
1009
  items: ae.value,
1006
1010
  variant: "dark",
@@ -1009,23 +1013,23 @@ const zt = /* @__PURE__ */ Fe({
1009
1013
  class: "!w-auto"
1010
1014
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(fe, {
1011
1015
  modelValue: k.value,
1012
- "onUpdate:modelValue": s[6] || (s[6] = (V) => k.value = V),
1016
+ "onUpdate:modelValue": s[6] || (s[6] = (N) => k.value = N),
1013
1017
  multiple: "",
1014
1018
  variant: "dark",
1015
- items: ne.value,
1019
+ items: re.value,
1016
1020
  "selected-prefix": o(a)("team.filter.selected_permission_prefix"),
1017
1021
  placeholder: o(a)("team.filter.permission_placeholder")
1018
1022
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(fe, {
1019
- modelValue: R.value,
1020
- "onUpdate:modelValue": s[7] || (s[7] = (V) => R.value = V),
1023
+ modelValue: $.value,
1024
+ "onUpdate:modelValue": s[7] || (s[7] = (N) => $.value = N),
1021
1025
  multiple: "",
1022
1026
  variant: "dark",
1023
- items: re.value,
1027
+ items: ie.value,
1024
1028
  "selected-prefix": o(a)("team.filter.selected_assigned_role_prefix"),
1025
1029
  placeholder: o(a)("team.filter.assigned_role_placeholder")
1026
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (g(), O("div", Ft, [i("div", Vt, [u(fe, {
1030
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (h(), A("div", Vt, [r("div", wt, [u(fe, {
1027
1031
  modelValue: I.value,
1028
- "onUpdate:modelValue": s[0] || (s[0] = (V) => I.value = V),
1032
+ "onUpdate:modelValue": s[0] || (s[0] = (N) => I.value = N),
1029
1033
  multiple: "",
1030
1034
  items: ae.value,
1031
1035
  variant: "dark",
@@ -1034,82 +1038,87 @@ const zt = /* @__PURE__ */ Fe({
1034
1038
  class: "!w-auto"
1035
1039
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(fe, {
1036
1040
  modelValue: k.value,
1037
- "onUpdate:modelValue": s[1] || (s[1] = (V) => k.value = V),
1041
+ "onUpdate:modelValue": s[1] || (s[1] = (N) => k.value = N),
1038
1042
  multiple: "",
1039
1043
  variant: "dark",
1040
- items: ne.value,
1044
+ items: re.value,
1041
1045
  "selected-prefix": o(a)("team.filter.selected_permission_prefix"),
1042
1046
  placeholder: o(a)("team.filter.permission_placeholder")
1043
1047
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(fe, {
1044
- modelValue: R.value,
1045
- "onUpdate:modelValue": s[2] || (s[2] = (V) => R.value = V),
1048
+ modelValue: $.value,
1049
+ "onUpdate:modelValue": s[2] || (s[2] = (N) => $.value = N),
1046
1050
  multiple: "",
1047
1051
  variant: "dark",
1048
- items: re.value,
1052
+ items: ie.value,
1049
1053
  "selected-prefix": o(a)("team.filter.selected_assigned_role_prefix"),
1050
1054
  placeholder: o(a)("team.filter.assigned_role_placeholder")
1051
1055
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), u(U, {
1052
1056
  modelValue: D.value,
1053
- "onUpdate:modelValue": s[3] || (s[3] = (V) => D.value = V),
1057
+ "onUpdate:modelValue": s[3] || (s[3] = (N) => D.value = N),
1054
1058
  class: "w-[320px] xs:w-full xs:mt-8",
1055
1059
  autofocus: "",
1056
1060
  placeholder: o(a)("team.search.placeholder")
1057
- }, null, 8, ["modelValue", "placeholder"])])), (xe = o(d).currentBusiness.value) != null && xe._id ? (g(), H(vs, {
1061
+ }, null, 8, ["modelValue", "placeholder"])])), (xe = o(d).currentBusiness.value) != null && xe._id ? (h(), H(fs, {
1058
1062
  key: 2
1059
1063
  }, {
1060
- default: pe(() => [i("div", It, [E.value ? F.value === 0 ? (g(), H(o(hs), {
1064
+ default: ue(() => [r("div", kt, [E.value ? V.value === 0 ? (h(), H(o(hs), {
1061
1065
  key: 1,
1062
1066
  title: o(a)("team.emptyState.title"),
1063
1067
  subtitle: o(a)("team.emptyState.description")
1064
- }, null, 8, ["title", "subtitle"])) : J("", !0) : (g(), H(fs, {
1068
+ }, null, 8, ["title", "subtitle"])) : J("", !0) : (h(), H(bs, {
1065
1069
  key: 0
1066
- })), E.value ? (g(), H(S, {
1070
+ })), E.value ? (h(), H(F, {
1067
1071
  key: Z.value,
1068
- "column-defs": _,
1069
- "row-data": q.value,
1072
+ "column-defs": g,
1073
+ "row-data": T.value,
1070
1074
  "page-size": be,
1071
- "page-count": Math.ceil(F.value / be),
1072
- "row-count": F.value,
1073
- "fetch-fn": es,
1074
- "hide-footer": F.value <= be,
1075
+ "page-count": Math.ceil(V.value / be),
1076
+ "row-count": V.value,
1077
+ "fetch-fn": ss,
1078
+ "hide-footer": V.value <= be,
1075
1079
  loading: ee.value,
1076
1080
  "pin-header-row": "",
1077
- onRowClick: s[8] || (s[8] = (V) => G(o(ye).Update, V.original))
1081
+ onRowClick: s[8] || (s[8] = (N) => z(o(_e).Update, N.original))
1078
1082
  }, null, 8, ["row-data", "page-count", "row-count", "hide-footer", "loading"])) : J("", !0)])]),
1079
1083
  _: 1
1080
- })) : J("", !0)])]), u(ie, {
1081
- header: Re.value,
1082
- "model-value": W.value,
1084
+ })) : J("", !0)])]), u(Pe, {
1085
+ "model-value": G.value,
1083
1086
  "max-width": 960,
1084
- "onOn:clickedAway": o(ve),
1085
- "onOn:close": o(ve)
1087
+ "close-button": !1,
1088
+ "onOn:clickedAway": o(ve)
1086
1089
  }, {
1087
- "side-sheet-footer": pe(() => [i("div", kt, [u(T, {
1088
- label: he.value,
1090
+ "side-sheet-header": ue(() => [r("div", $t, [r("p", Rt, P(Re.value), 1), u(W, {
1091
+ name: "close",
1092
+ size: "md",
1093
+ class: "cursor-pointer",
1094
+ onClick: o(ve)
1095
+ }, null, 8, ["onClick"])])]),
1096
+ "side-sheet-footer": ue(() => [r("div", Ct, [u(le, {
1097
+ label: ye.value,
1089
1098
  size: "md",
1090
1099
  variant: "primary",
1091
1100
  "is-loading": Y.value,
1092
1101
  disabled: Y.value,
1093
- onClick: Se(Ye, ["prevent"])
1094
- }, null, 8, ["label", "is-loading", "disabled"]), u(T, {
1102
+ onClick: Fe(He, ["prevent"])
1103
+ }, null, 8, ["label", "is-loading", "disabled"]), u(le, {
1095
1104
  label: o(a)("common.cancel"),
1096
1105
  size: "md",
1097
1106
  variant: "secondary",
1098
1107
  disabled: Y.value,
1099
- onClick: ge
1108
+ onClick: he
1100
1109
  }, null, 8, ["label", "disabled"])])]),
1101
- default: pe(() => [u(xt, {
1110
+ default: ue(() => [u(Ut, {
1102
1111
  ref_key: "memberForm",
1103
- ref: de,
1104
- initialValue: oe.value,
1105
- loading: z.value,
1112
+ ref: ce,
1113
+ initialValue: ne.value,
1114
+ loading: K.value,
1106
1115
  class: "gap-8"
1107
1116
  }, null, 8, ["initialValue", "loading"])]),
1108
1117
  _: 1
1109
- }, 8, ["header", "model-value", "onOn:clickedAway", "onOn:close"])], 64);
1118
+ }, 8, ["model-value", "onOn:clickedAway"])], 64);
1110
1119
  };
1111
1120
  }
1112
1121
  });
1113
1122
  export {
1114
- zt as default
1123
+ Jt as default
1115
1124
  };