@feedmepos/mf-hrm-portal 2.4.2-dev → 2.4.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 (112) hide show
  1. package/dist/{ApprovalCodeList-DpNF0wL7.js → ApprovalCodeList-DGLPcQcv.js} +15 -14
  2. package/dist/{AuditLogList-D2bUFsuK.js → AuditLogList-ahJwTF7N.js} +12 -12
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-IPkyxwIF.js +438 -0
  4. package/dist/EmployeeList-B18mlY4V.js +776 -0
  5. package/dist/FormItem.vue_vue_type_script_setup_true_lang-Dvo9AiKf.js +45 -0
  6. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  7. package/dist/{GrantUserList-ClliuQ8h.js → GrantUserList-C8BbP99C.js} +16 -15
  8. package/dist/{Main-CBuOW87D.js → Main-BA29_N_p.js} +2280 -2274
  9. package/dist/{Main-DlPdGefL.js → Main-BN3b_yie.js} +5 -5
  10. package/dist/Main-Clux_qKN.js +96 -0
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  12. package/dist/{PermissionSetList-Dd0fkW0L.js → PermissionSetList-BSOJ8ftd.js} +108 -107
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Hz_rFmbH.js +4181 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-BwuBk683.js +35 -0
  15. package/dist/RoleList-EnfxydGa.js +740 -0
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-yJwTtFyF.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-yIdd8r7y.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-_cqIJY8R.js → ScheduleGeneralPage-CFUqm5-r.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-C6M76KUA.js → ScheduleModal.vue_vue_type_script_setup_true_lang-BmPrGRG2.js} +186 -187
  19. package/dist/{SchedulePage-DHkWe1KO.js → SchedulePage-DEFQwipO.js} +16 -16
  20. package/dist/{SchedulePositionPage-5JUJwlJc.js → SchedulePositionPage-CM5NS5-F.js} +3 -3
  21. package/dist/{SelectFilter-DWRvb1Yl.js → SelectFilter-DgjR5o5E.js} +1 -1
  22. package/dist/TeamMemberList-BKvhHLNG.js +1150 -0
  23. package/dist/TimesheetList-EQRMimP7.js +402 -0
  24. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_ffd7f807_lang-Co2GtU1N.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-BumkwWvb.js} +7 -7
  25. package/dist/{app-BA3UHSk0.js → app-Bkc0pF3P.js} +3935 -7718
  26. package/dist/app.js +3 -3
  27. package/dist/{approval-code-BR4FD3sx.js → approval-code-BKMu1GDn.js} +1 -1
  28. package/dist/{dayjs.min-JyaQ6PUU.js → dayjs.min-CkI2q2aC.js} +34 -34
  29. package/dist/employee-BfkxCdPL.js +209 -0
  30. package/dist/{grant-user-DKUZdzrY.js → grant-user-ClN_vTOv.js} +1 -1
  31. package/dist/{index-CkC2sfPK.js → iteration-CsNIceUp.js} +558 -573
  32. package/dist/{lodash-BJMVlo9i.js → lodash-BgraJgCc.js} +1 -1
  33. package/dist/restaurant-CRNgiIa4.js +2685 -0
  34. package/dist/role-CZYSdVn2.js +91 -0
  35. package/dist/rule-_4roLZrG.js +780 -0
  36. package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
  37. package/dist/src/helpers/iteration.d.ts +2 -9
  38. package/dist/src/helpers/permission-set.d.ts +102 -1
  39. package/dist/src/helpers/rule.d.ts +2 -2
  40. package/dist/src/helpers/string.d.ts +1 -10
  41. package/dist/src/router/shared.d.ts +1 -3
  42. package/dist/src/stores/restaurant.d.ts +7 -7
  43. package/dist/src/stores/team.d.ts +0 -30
  44. package/dist/src/types/team.d.ts +1 -17
  45. package/dist/src/views/audit-log/locales/index.d.ts +0 -12
  46. package/dist/src/views/hr/locales/index.d.ts +0 -20
  47. package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
  48. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  49. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  50. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  51. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  52. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
  53. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
  54. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
  55. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
  56. package/dist/src/views/team/locales/index.d.ts +4 -716
  57. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
  58. package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
  59. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
  60. package/dist/string-VNuQNweN.js +15 -0
  61. package/dist/style.css +1 -1
  62. package/dist/tsconfig.app.tsbuildinfo +1 -1
  63. package/dist/{useAppStore-DiGaOhje.js → useAppStore-DYmF1kgk.js} +1 -1
  64. package/dist/{useLoading-DOcoObCD.js → useLoading-C2UKuAxD.js} +1 -1
  65. package/dist/{useReportPermissions-c9KGuXQq.js → useReportPermissions-BiaXRc0p.js} +22 -22
  66. package/package.json +2 -2
  67. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BjEJErcL.js +0 -459
  68. package/dist/EmployeeList-CBYU0R2j.js +0 -896
  69. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DsPLbLwQ.js +0 -90
  70. package/dist/Main-D9MQo2l1.js +0 -101
  71. package/dist/MyPosProfile-IAPSqlBP.js +0 -360
  72. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
  73. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CjQCbJRu.js +0 -4212
  74. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DJnIFlKq.js +0 -1797
  75. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-hE2OZwfO.js +0 -547
  76. package/dist/RoleList-zZHpt079.js +0 -274
  77. package/dist/TeamMemberList-C_4f5Djs.js +0 -2082
  78. package/dist/TimesheetList-B3Yx8cwt.js +0 -408
  79. package/dist/employee-n31b7QEp.js +0 -237
  80. package/dist/member-grant-B1V9g0Sb.js +0 -54
  81. package/dist/restaurant-BbSg6yOm.js +0 -49
  82. package/dist/role-iTqgtFqf.js +0 -91
  83. package/dist/rule-BJhti6BZ.js +0 -845
  84. package/dist/src/api/my-pos-profile/index.d.ts +0 -3
  85. package/dist/src/api/sso-provider/index.d.ts +0 -5
  86. package/dist/src/api/staff-invite/index.d.ts +0 -16
  87. package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
  88. package/dist/src/composables/useMenuAccess.d.ts +0 -56
  89. package/dist/src/composables/useSsoProviders.d.ts +0 -19
  90. package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
  91. package/dist/src/helpers/employee-merge.d.ts +0 -33
  92. package/dist/src/helpers/member-grant.d.ts +0 -36
  93. package/dist/src/helpers/my-pos-profile.d.ts +0 -37
  94. package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
  95. package/dist/src/helpers/restaurant-lookup.d.ts +0 -19
  96. package/dist/src/helpers/role-merge.d.ts +0 -11
  97. package/dist/src/helpers/staff-invite.d.ts +0 -54
  98. package/dist/src/router/menu-access-guard.d.ts +0 -17
  99. package/dist/src/types/my-pos-profile.d.ts +0 -24
  100. package/dist/src/types/sso-provider.d.ts +0 -10
  101. package/dist/src/types/staff-invite.d.ts +0 -100
  102. package/dist/src/views/hr/timesheet/timesheet-view.d.ts +0 -29
  103. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
  104. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
  105. package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -236
  106. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
  107. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
  108. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
  109. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
  110. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
  111. package/dist/string-DZQ1uNjn.js +0 -22
  112. package/dist/useSsoProviders-CkhHtzRQ.js +0 -41
@@ -1,14 +1,15 @@
1
1
  import { defineComponent as re, ref as K, computed as g, resolveComponent as b, createBlock as O, openBlock as _, withCtx as $, createElementVNode as s, createElementBlock as S, createCommentVNode as Y, toDisplayString as C, unref as a, Fragment as H, renderList as te, createVNode as c, renderSlot as xe, isRef as ue, withModifiers as de, createTextVNode as be, normalizeClass as ke, h as x } from "vue";
2
- import { d as Ve } from "./dayjs.min-JyaQ6PUU.js";
2
+ import { d as Ve } from "./dayjs.min-CkI2q2aC.js";
3
3
  import { useI18n as ne } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as ie, components as z, useDialog as we, useBreakpoints as Fe, FmButtonVariant as se } from "@feedmepos/ui-library";
5
- import { S as q } from "./SelectFilter-DWRvb1Yl.js";
6
- import { _ as $e } from "./app-BA3UHSk0.js";
7
- import { _ as Se, a as pe, u as Ae, H as Pe } from "./FormSection.vue_vue_type_script_setup_true_lang-DsPLbLwQ.js";
8
- import { _ as Be } from "./index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js";
9
- import { u as ve } from "./useLoading-DOcoObCD.js";
10
- import { u as fe } from "./approval-code-BR4FD3sx.js";
11
- import { u as ce } from "./restaurant-BbSg6yOm.js";
5
+ import { S as q } from "./SelectFilter-DgjR5o5E.js";
6
+ import { _ as $e } from "./app-Bkc0pF3P.js";
7
+ import { _ as pe, u as Se, H as Ae } from "./FormItem.vue_vue_type_script_setup_true_lang-Dvo9AiKf.js";
8
+ import { _ as Pe } from "./index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js";
9
+ import { u as ve } from "./useLoading-C2UKuAxD.js";
10
+ import { u as fe } from "./approval-code-BKMu1GDn.js";
11
+ import { u as ce } from "./restaurant-CRNgiIa4.js";
12
+ import { _ as Be } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
12
13
  function Ie(d) {
13
14
  var e;
14
15
  const r = (e = d.conditions) == null ? void 0 : e.adjustment;
@@ -263,7 +264,7 @@ const je = { class: "pr-24" }, De = { class: "fm-typo-en-title-md-600" }, Re = {
263
264
  ]),
264
265
  default: $(() => [
265
266
  s("div", He, [
266
- c(Se, {
267
+ c(Be, {
267
268
  title: a(i)("approvalCode.form.section")
268
269
  }, {
269
270
  default: $(() => [
@@ -381,7 +382,7 @@ const je = { class: "pr-24" }, De = { class: "fm-typo-en-title-md-600" }, Re = {
381
382
  class: "text-xs"
382
383
  }, Ct = {
383
384
  class: "flex flex-col gap-4"
384
- }, me = 10, gt = 2, Bt = /* @__PURE__ */ re({
385
+ }, me = 10, gt = 2, It = /* @__PURE__ */ re({
385
386
  __name: "ApprovalCodeList",
386
387
  setup(d, {
387
388
  expose: r
@@ -396,7 +397,7 @@ const je = { class: "pr-24" }, De = { class: "fm-typo-en-title-md-600" }, Re = {
396
397
  }))), M = g(() => w.approvalCodes), {
397
398
  searchKey: p,
398
399
  filter: B
399
- } = Ae(), I = g(() => {
400
+ } = Se(), I = g(() => {
400
401
  const t = {};
401
402
  return i.value.forEach((o) => {
402
403
  t[o._id] = o.profile.name;
@@ -646,7 +647,7 @@ const je = { class: "pr-24" }, De = { class: "fm-typo-en-title-md-600" }, Re = {
646
647
  "onUpdate:modelValue": o[5] || (o[5] = (l) => ue(p) ? p.value = l : null),
647
648
  autofocus: "",
648
649
  placeholder: a(e)("approvalCode.search.placeholder")
649
- }, null, 8, ["modelValue", "placeholder"])]), c(Pe), s("div", rt, [c(q, {
650
+ }, null, 8, ["modelValue", "placeholder"])]), c(Ae), s("div", rt, [c(q, {
650
651
  modelValue: V.value,
651
652
  "onUpdate:modelValue": o[6] || (o[6] = (l) => V.value = l),
652
653
  multiple: "",
@@ -714,7 +715,7 @@ const je = { class: "pr-24" }, De = { class: "fm-typo-en-title-md-600" }, Re = {
714
715
  _: 1
715
716
  })])]),
716
717
  _: 1
717
- })) : (_(), O(a(Be), {
718
+ })) : (_(), O(a(Pe), {
718
719
  key: 1,
719
720
  title: a(e)("approvalCode.noData.title"),
720
721
  subtitle: a(e)("approvalCode.noData.subtitle")
@@ -723,5 +724,5 @@ const je = { class: "pr-24" }, De = { class: "fm-typo-en-title-md-600" }, Re = {
723
724
  }
724
725
  });
725
726
  export {
726
- Bt as default
727
+ It as default
727
728
  };
@@ -1,16 +1,16 @@
1
1
  import { defineComponent as Vt, ref as S, computed as A, onMounted as No, onBeforeUnmount as Ko, watch as ae, resolveComponent as R, createElementBlock as g, openBlock as v, createBlock as Te, createCommentVNode as F, createElementVNode as a, Fragment as z, renderList as ce, withCtx as B, createVNode as y, toDisplayString as l, unref as u, nextTick as Yo, onUnmounted as Bo, createTextVNode as ye, normalizeClass as zo } from "vue";
2
- import { d as P } from "./dayjs.min-JyaQ6PUU.js";
2
+ import { d as P } from "./dayjs.min-CkI2q2aC.js";
3
3
  import { defineStore as qo, storeToRefs as Jo } from "pinia";
4
4
  import { useI18n as dt, useCoreStore as Ho } from "@feedmepos/mf-common";
5
- import { g as st, b as at, u as Wo, B as Mt, _ as Go, a as Xo } from "./app-BA3UHSk0.js";
5
+ import { u as Wo, Y as Mt, _ as Go, a as Xo } from "./app-Bkc0pF3P.js";
6
6
  import { components as ve } from "@feedmepos/ui-library";
7
- import { S as Me } from "./SelectFilter-DWRvb1Yl.js";
8
- import { _ as Qo } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
9
- import { _ as Zo } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
10
- import { t as es, p as Dt } from "./rule-BJhti6BZ.js";
11
- import { u as ts } from "./restaurant-BbSg6yOm.js";
7
+ import { g as st, b as at, u as Qo } from "./restaurant-CRNgiIa4.js";
8
+ import { S as Me } from "./SelectFilter-DgjR5o5E.js";
9
+ import { _ as Zo } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
10
+ import { _ as es } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
11
+ import { t as ts, p as Dt } from "./rule-_4roLZrG.js";
12
12
  import { u as os } from "./useDebounce-B8ZPVS5C.js";
13
- import { n as ss } from "./string-DZQ1uNjn.js";
13
+ import { n as ss } from "./string-VNuQNweN.js";
14
14
  import { useRoute as as, useRouter as ns } from "vue-router";
15
15
  import { u as ls } from "./useMessage-_ywT_N9X.js";
16
16
  const rs = {
@@ -270,7 +270,7 @@ const rs = {
270
270
  if (!(!_ && t.value.length > 0))
271
271
  try {
272
272
  o.value = !0;
273
- const w = await es.readTeamMembers();
273
+ const w = await ts.readTeamMembers();
274
274
  t.value = w.sort((D, O) => D.doc.isOwner ? -1 : D.name.localeCompare(O.name)), n.value = !0;
275
275
  } finally {
276
276
  o.value = !1;
@@ -864,7 +864,7 @@ const Os = {
864
864
  const {
865
865
  t: o,
866
866
  te: n
867
- } = dt(), r = Ho(), c = Wo(), d = ms(), b = ts(), {
867
+ } = dt(), r = Ho(), c = Wo(), d = ms(), b = Qo(), {
868
868
  restaurants: _
869
869
  } = Jo(b), w = S(!1), D = S(!1), O = S([]), i = S(null), V = S(!1), L = S({}), f = S(null), M = S(!1);
870
870
  async function C(e) {
@@ -1787,7 +1787,7 @@ const Os = {
1787
1787
  deep: !0
1788
1788
  }), (e, s) => {
1789
1789
  const m = R("FmSpacer"), x = R("FmButton"), k = R("FmMenuItem"), T = R("FmMenu"), U = R("FmChip"), se = R("FmDateRangePicker"), et = R("FmSearch"), tt = R("FmTable"), Ie = R("FmIcon"), Ne = R("FmTooltip"), Ae = R("FmSideSheet");
1790
- return v(), g(z, null, [y(Qo, {
1790
+ return v(), g(z, null, [y(Zo, {
1791
1791
  heading: u(o)("auditLog.title")
1792
1792
  }, {
1793
1793
  "append-heading": B(() => [y(m), y(x, {
@@ -1886,7 +1886,7 @@ const Os = {
1886
1886
  class: "ml-auto w-[280px]",
1887
1887
  placeholder: u(o)("auditLog.search.placeholder")
1888
1888
  }, null, 8, ["modelValue", "placeholder"])])]), y(Go, null, {
1889
- default: B(() => [a("div", Ns, [y(Zo, {
1889
+ default: B(() => [a("div", Ns, [y(es, {
1890
1890
  "is-loading": w.value,
1891
1891
  "is-empty": O.value.length === 0,
1892
1892
  title: u(o)("auditLog.noData.title"),
@@ -0,0 +1,438 @@
1
+ import { defineComponent as M, ref as S, onMounted as ae, nextTick as le, onUnmounted as ue, resolveComponent as F, createElementBlock as p, openBlock as s, Fragment as C, createElementVNode as U, renderSlot as _, createCommentVNode as w, toDisplayString as J, createVNode as E, normalizeStyle as re, watch as X, defineAsyncComponent as se, computed as z, renderList as T, createBlock as h, withCtx as H, unref as x, resolveDynamicComponent as ie, normalizeClass as de } from "vue";
2
+ import { useI18n as q, useCoreStore as me } from "@feedmepos/mf-common";
3
+ import { O as j, e as ce, U as L } from "./app-Bkc0pF3P.js";
4
+ import { l as fe } from "./lodash-BgraJgCc.js";
5
+ const ye = { class: "flex items-center" }, be = {
6
+ key: 0,
7
+ class: "ml-8 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
8
+ }, ve = { class: "ml-auto" }, Be = /* @__PURE__ */ M({
9
+ __name: "CollapsibleWrapper",
10
+ props: {
11
+ title: { default: "" },
12
+ subtitle: { default: "" },
13
+ initiallyCollapsed: { type: Boolean, default: !1 }
14
+ },
15
+ setup(t) {
16
+ const a = S(t.initiallyCollapsed), c = S(), f = S(0);
17
+ let m;
18
+ function g() {
19
+ a.value = !a.value;
20
+ }
21
+ function d() {
22
+ c.value && (f.value = c.value.scrollHeight);
23
+ }
24
+ return ae(async () => {
25
+ await le(), c.value && (m = new ResizeObserver(() => {
26
+ d();
27
+ }), m.observe(c.value));
28
+ }), ue(() => {
29
+ m == null || m.disconnect();
30
+ }), (b, r) => {
31
+ const y = F("FmButton");
32
+ return s(), p(C, null, [
33
+ U("div", { onClick: g }, [
34
+ U("div", ye, [
35
+ _(b.$slots, "title"),
36
+ a.value && t.subtitle ? (s(), p("span", be, J(t.subtitle), 1)) : w("", !0),
37
+ U("div", ve, [
38
+ E(y, {
39
+ icon: a.value ? "keyboard_arrow_down" : "keyboard_arrow_up",
40
+ "text-color": "neutral-gray-400",
41
+ variant: "tertiary",
42
+ size: "md"
43
+ }, null, 8, ["icon"])
44
+ ])
45
+ ])
46
+ ]),
47
+ U("div", {
48
+ ref_key: "contentRef",
49
+ ref: c,
50
+ class: "transition-all duration-300 ease-in-out overflow-hidden",
51
+ style: re({ maxHeight: a.value ? "0" : f.value + "px" })
52
+ }, [
53
+ _(b.$slots, "default")
54
+ ], 4)
55
+ ], 64);
56
+ };
57
+ }
58
+ });
59
+ function I(t) {
60
+ return `${t.subject}::${t.builderKey}`;
61
+ }
62
+ function Oe(t) {
63
+ const u = S(/* @__PURE__ */ new Map());
64
+ function a(r, y) {
65
+ const k = new Map(u.value);
66
+ k.set(I(r), y), u.value = k;
67
+ }
68
+ function c(r) {
69
+ return u.value.get(I(r));
70
+ }
71
+ function f(r) {
72
+ for (const y of u.value.keys())
73
+ if (y.startsWith(`${r}::`)) return !0;
74
+ return !1;
75
+ }
76
+ function m(r) {
77
+ const y = /* @__PURE__ */ new Map();
78
+ for (const [k, A] of u.value.entries())
79
+ k.startsWith(`${r}::`) && y.set(k, A);
80
+ return y;
81
+ }
82
+ function g(r) {
83
+ const y = new Map(u.value);
84
+ for (const k of Array.from(y.keys()))
85
+ k.startsWith(`${r}::`) && y.delete(k);
86
+ u.value = y;
87
+ }
88
+ function d() {
89
+ u.value = /* @__PURE__ */ new Map();
90
+ }
91
+ function b(r) {
92
+ const y = new Map(u.value);
93
+ y.delete(I(r)), u.value = y;
94
+ }
95
+ return t && X(
96
+ t,
97
+ () => {
98
+ d();
99
+ },
100
+ { deep: !0 }
101
+ ), {
102
+ drafts: u,
103
+ setDraft: a,
104
+ getDraft: c,
105
+ hasDraftsForSubject: f,
106
+ getDraftsForSubject: m,
107
+ clearDraftsForSubject: g,
108
+ clearAllDrafts: d,
109
+ clearDraft: b
110
+ };
111
+ }
112
+ const pe = {}, W = /* @__PURE__ */ new Map();
113
+ function ke(t) {
114
+ const u = W.get(t);
115
+ if (u) return u;
116
+ const a = pe[t];
117
+ if (!a) return;
118
+ const c = se(a);
119
+ return W.set(t, c), c;
120
+ }
121
+ function he(t, u) {
122
+ return !fe.isEqual(t, u);
123
+ }
124
+ const Ve = { class: "flex flex-col gap-8" }, Fe = { class: "flex flex-col gap-4" }, ge = "condition-form-select-menu", Z = 120, Ce = 220, De = /* @__PURE__ */ M({
125
+ __name: "ConditionFormRenderer",
126
+ props: {
127
+ config: {},
128
+ modelValue: {},
129
+ disabled: { type: Boolean, default: !1 },
130
+ optionProviders: { default: () => ({}) }
131
+ },
132
+ emits: ["update:modelValue"],
133
+ setup(t, { emit: u }) {
134
+ const a = t, c = u, { t: f } = q(), m = me(), g = z(() => j(a.config, a.modelValue));
135
+ let d = a.modelValue;
136
+ X(
137
+ () => a.modelValue,
138
+ (e) => {
139
+ d = e;
140
+ }
141
+ );
142
+ function b(e) {
143
+ return "static" in e ? e.static.map((n) => ({ value: n.value, label: f(n.labelKey) })) : a.optionProviders[e.provider] ?? [];
144
+ }
145
+ function r(e, n) {
146
+ const l = y(
147
+ ce(a.config, { ...a.modelValue, [e]: n })
148
+ );
149
+ he(l, d) && (d = l, c("update:modelValue", l));
150
+ }
151
+ function y(e) {
152
+ const n = { ...e };
153
+ for (const l of j(a.config, n))
154
+ l.kind === "date" && !n[l.key] && (n[l.key] = P(Y()));
155
+ return n;
156
+ }
157
+ function k() {
158
+ const e = m.currentBusiness.value;
159
+ if (e != null && e.timezone) return e.timezone;
160
+ if (e != null && e.timeZone) return e.timeZone;
161
+ const n = (e == null ? void 0 : e.country) ?? (m.currentCountry.value instanceof Object ? m.currentCountry.value.code : m.currentCountry.value);
162
+ return A(n);
163
+ }
164
+ function A(e) {
165
+ switch ((e || "").toUpperCase()) {
166
+ case "MY":
167
+ return "Asia/Kuala_Lumpur";
168
+ case "SG":
169
+ return "Asia/Singapore";
170
+ case "TH":
171
+ return "Asia/Bangkok";
172
+ case "ID":
173
+ return "Asia/Jakarta";
174
+ case "MO":
175
+ return "Asia/Macau";
176
+ case "BN":
177
+ return "Asia/Brunei";
178
+ case "PK":
179
+ return "Asia/Karachi";
180
+ case "MV":
181
+ return "Indian/Maldives";
182
+ case "VN":
183
+ return "Asia/Ho_Chi_Minh";
184
+ case "JP":
185
+ return "Asia/Tokyo";
186
+ case "AU":
187
+ return "Australia/Sydney";
188
+ case "AE":
189
+ return "Asia/Dubai";
190
+ case "UK":
191
+ return "Europe/London";
192
+ default:
193
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
194
+ }
195
+ }
196
+ function K(e, n) {
197
+ const l = new Intl.DateTimeFormat("en-CA", {
198
+ timeZone: n,
199
+ year: "numeric",
200
+ month: "2-digit",
201
+ day: "2-digit",
202
+ hour: "2-digit",
203
+ minute: "2-digit",
204
+ second: "2-digit",
205
+ hourCycle: "h23"
206
+ }).formatToParts(e), v = Object.fromEntries(
207
+ l.filter((V) => V.type !== "literal").map((V) => [V.type, V.value])
208
+ );
209
+ return {
210
+ year: Number(v.year),
211
+ month: Number(v.month),
212
+ day: Number(v.day),
213
+ hour: Number(v.hour),
214
+ minute: Number(v.minute),
215
+ second: Number(v.second)
216
+ };
217
+ }
218
+ function R(e, n) {
219
+ try {
220
+ const l = K(n, e);
221
+ return (Date.UTC(
222
+ l.year,
223
+ l.month - 1,
224
+ l.day,
225
+ l.hour,
226
+ l.minute,
227
+ l.second
228
+ ) - n.getTime()) / 6e4;
229
+ } catch {
230
+ return 0;
231
+ }
232
+ }
233
+ function P(e) {
234
+ const [n, l, v] = e.split("-").map(Number);
235
+ if (!n || !l || !v) return "";
236
+ const V = k(), D = new Date(Date.UTC(n, l - 1, v, 0, 0, 0, 0)), O = R(V, D), N = new Date(D.getTime() - O * 6e4), $ = R(V, N);
237
+ return new Date(D.getTime() - $ * 6e4).toISOString();
238
+ }
239
+ function G(e) {
240
+ const n = new Date(e);
241
+ if (Number.isNaN(n.getTime())) return "";
242
+ try {
243
+ const l = K(n, k());
244
+ return `${String(l.year).padStart(4, "0")}-${String(l.month).padStart(2, "0")}-${String(l.day).padStart(2, "0")}`;
245
+ } catch {
246
+ return e.slice(0, 10);
247
+ }
248
+ }
249
+ function Y() {
250
+ return G((/* @__PURE__ */ new Date()).toISOString());
251
+ }
252
+ function B(e) {
253
+ return "options" in e ? b(e.options) : [];
254
+ }
255
+ function Q(e) {
256
+ const n = a.modelValue[e];
257
+ return n == null ? "" : String(n);
258
+ }
259
+ function ee(e) {
260
+ const n = a.modelValue[e];
261
+ return typeof n != "string" || !n ? "" : G(n);
262
+ }
263
+ function te(e, n) {
264
+ r(e, n ? P(n) : "");
265
+ }
266
+ function ne(e, n) {
267
+ let l = Math.floor(Number(n) || (e.min ?? 0));
268
+ e.min !== void 0 && (l = Math.max(e.min, l)), e.max !== void 0 && (l = Math.min(e.max, l)), r(e.key, l);
269
+ }
270
+ return (e, n) => {
271
+ const l = F("FmRadio"), v = F("FmRadioGroup"), V = F("FmSelect"), D = F("FmTextField"), O = F("FmDatePicker"), N = F("FmCheckbox"), $ = F("FmFormGroup");
272
+ return s(), p("div", Ve, [
273
+ (s(!0), p(C, null, T(g.value, (o) => (s(), p(C, {
274
+ key: o.key
275
+ }, [
276
+ o.kind === "radio" ? (s(), h(v, {
277
+ key: 0,
278
+ "model-value": t.modelValue[o.key],
279
+ disabled: t.disabled,
280
+ "onUpdate:modelValue": (i) => r(o.key, i)
281
+ }, {
282
+ default: H(() => [
283
+ (s(!0), p(C, null, T(B(o), (i) => (s(), h(l, {
284
+ key: i.value,
285
+ value: i.value,
286
+ label: i.label
287
+ }, null, 8, ["value", "label"]))), 128))
288
+ ]),
289
+ _: 2
290
+ }, 1032, ["model-value", "disabled", "onUpdate:modelValue"])) : o.kind === "select" ? (s(), h(V, {
291
+ key: 1,
292
+ "model-value": t.modelValue[o.key],
293
+ label: x(f)(o.labelKey),
294
+ items: B(o),
295
+ "menu-id": ge,
296
+ "menu-z-index": Z,
297
+ "max-height": Ce,
298
+ "shift-menu": "",
299
+ placement: "bottom-start",
300
+ disabled: t.disabled,
301
+ "onUpdate:modelValue": (i) => r(o.key, i)
302
+ }, null, 8, ["model-value", "label", "items", "disabled", "onUpdate:modelValue"])) : o.kind === "number" ? (s(), h(D, {
303
+ key: 2,
304
+ "model-value": Q(o.key),
305
+ type: "number",
306
+ class: "!w-[120px] ml-32",
307
+ label: x(f)(o.labelKey),
308
+ disabled: t.disabled,
309
+ "onUpdate:modelValue": (i) => ne(o, i)
310
+ }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : o.kind === "text" ? (s(), h(D, {
311
+ key: 3,
312
+ "model-value": t.modelValue[o.key] ?? "",
313
+ label: x(f)(o.labelKey),
314
+ disabled: t.disabled,
315
+ "onUpdate:modelValue": (i) => r(o.key, i)
316
+ }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : o.kind === "date" ? (s(), h(O, {
317
+ key: 4,
318
+ "model-value": ee(o.key),
319
+ label: x(f)(o.labelKey),
320
+ "z-index": Z,
321
+ disabled: t.disabled,
322
+ "onUpdate:modelValue": (i) => te(o.key, i)
323
+ }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : o.kind === "switch" ? (s(), h(N, {
324
+ key: 5,
325
+ "model-value": !!t.modelValue[o.key],
326
+ value: !0,
327
+ label: x(f)(o.labelKey),
328
+ disabled: t.disabled,
329
+ "onUpdate:modelValue": (i) => r(o.key, i)
330
+ }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : o.kind === "multiselect" ? (s(), h($, {
331
+ key: 6,
332
+ "model-value": t.modelValue[o.key] ?? [],
333
+ "onUpdate:modelValue": (i) => r(o.key, i)
334
+ }, {
335
+ default: H(() => [
336
+ U("div", Fe, [
337
+ (s(!0), p(C, null, T(B(o), (i) => (s(), h(N, {
338
+ key: i.value,
339
+ "model-value": t.modelValue[o.key] ?? [],
340
+ value: i.value,
341
+ label: i.label,
342
+ disabled: t.disabled,
343
+ "onUpdate:modelValue": (oe) => r(o.key, oe)
344
+ }, null, 8, ["model-value", "value", "label", "disabled", "onUpdate:modelValue"]))), 128))
345
+ ])
346
+ ]),
347
+ _: 2
348
+ }, 1032, ["model-value", "onUpdate:modelValue"])) : w("", !0)
349
+ ], 64))), 128))
350
+ ]);
351
+ };
352
+ }
353
+ }), xe = /* @__PURE__ */ M({
354
+ __name: "ConditionFormHost",
355
+ props: {
356
+ builder: {},
357
+ modelValue: {},
358
+ disable: { type: Boolean, default: !1 },
359
+ optionProviders: { default: () => ({}) }
360
+ },
361
+ emits: ["update:modelValue"],
362
+ setup(t, { emit: u }) {
363
+ const a = t, c = u, f = z(
364
+ () => a.builder.form && L(a.builder.form) ? a.builder.form : void 0
365
+ ), m = z(
366
+ () => a.builder.form && !L(a.builder.form) ? ke(a.builder.form.component) : void 0
367
+ );
368
+ return (g, d) => f.value ? (s(), h(De, {
369
+ key: 0,
370
+ config: f.value,
371
+ "model-value": t.modelValue ?? f.value.defaults,
372
+ disabled: t.disable,
373
+ "option-providers": t.optionProviders,
374
+ "onUpdate:modelValue": d[0] || (d[0] = (b) => c("update:modelValue", b))
375
+ }, null, 8, ["config", "model-value", "disabled", "option-providers"])) : m.value ? (s(), h(ie(m.value), {
376
+ key: 1,
377
+ "model-value": t.modelValue,
378
+ disable: t.disable,
379
+ "onUpdate:modelValue": d[1] || (d[1] = (b) => c("update:modelValue", b))
380
+ }, null, 8, ["model-value", "disable"])) : w("", !0);
381
+ }
382
+ }), Ue = {
383
+ key: 0,
384
+ class: "fm-typo-en-title-sm-600"
385
+ }, we = {
386
+ key: 0,
387
+ class: "h-px w-full bg-fm-color-neutral-gray-200"
388
+ }, Ne = { class: "flex justify-end pt-8" }, $e = /* @__PURE__ */ M({
389
+ __name: "ConditionBuilderForm",
390
+ props: {
391
+ builders: {},
392
+ formValueFor: {},
393
+ hasChanges: { type: Boolean },
394
+ title: { default: "" },
395
+ disable: { type: Boolean, default: !1 },
396
+ fullWidth: { type: Boolean, default: !1 }
397
+ },
398
+ emits: ["update-form", "apply"],
399
+ setup(t, { emit: u }) {
400
+ const a = u, { t: c } = q();
401
+ return (f, m) => {
402
+ const g = F("FmButton");
403
+ return s(), p("div", {
404
+ class: de(["flex flex-col gap-12 p-16", t.fullWidth ? "w-full" : "w-[320px]"])
405
+ }, [
406
+ t.title ? (s(), p("p", Ue, J(t.title), 1)) : w("", !0),
407
+ (s(!0), p(C, null, T(t.builders, (d, b) => (s(), p(C, {
408
+ key: d.builderKey
409
+ }, [
410
+ b > 0 ? (s(), p("div", we)) : w("", !0),
411
+ _(f.$slots, "section", { builder: d }, () => [
412
+ E(xe, {
413
+ builder: d,
414
+ "model-value": t.formValueFor(d),
415
+ disable: t.disable,
416
+ "onUpdate:modelValue": (r) => a("update-form", { builder: d, form: r })
417
+ }, null, 8, ["builder", "model-value", "disable", "onUpdate:modelValue"])
418
+ ])
419
+ ], 64))), 128)),
420
+ U("div", Ne, [
421
+ E(g, {
422
+ label: x(c)("team.memberForm.permissions.conditionApply"),
423
+ size: "md",
424
+ variant: "primary",
425
+ disabled: t.disable || !t.hasChanges,
426
+ onClick: m[0] || (m[0] = (d) => a("apply"))
427
+ }, null, 8, ["label", "disabled"])
428
+ ])
429
+ ], 2);
430
+ };
431
+ }
432
+ });
433
+ export {
434
+ Be as _,
435
+ $e as a,
436
+ xe as b,
437
+ Oe as u
438
+ };