@feedmepos/mf-hrm-portal 2.4.1 → 2.4.2-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/{ApprovalCodeList-BgnhS8P1.js → ApprovalCodeList-b8usXKo8.js} +14 -15
  2. package/dist/{AuditLogList-BMEw3z3C.js → AuditLogList-DqbgzFAs.js} +12 -12
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-WeFI9muF.js +459 -0
  4. package/dist/EmployeeList-NM0guUbU.js +896 -0
  5. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BCNKeDZY.js +90 -0
  6. package/dist/{GrantUserList-DePGsJq1.js → GrantUserList-B-p8Qghu.js} +15 -16
  7. package/dist/Main-BrhCJsik.js +101 -0
  8. package/dist/{Main-hUOeiddV.js → Main-D_EXStcl.js} +2274 -2280
  9. package/dist/{Main-BX2dD-ti.js → Main-x6An4Vlq.js} +5 -5
  10. package/dist/MyPosProfile-CG1PZ5p4.js +360 -0
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +126 -0
  12. package/dist/{PermissionSetList-BHOjAjHj.js → PermissionSetList-D4Vdbk10.js} +107 -108
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CFyGZpKr.js +4212 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CTxqUf16.js +1797 -0
  15. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-DUhqZaQv.js +547 -0
  16. package/dist/RoleList-DFcy90mE.js +274 -0
  17. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-B8dH021B.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-DiWJzXvb.js} +1 -1
  18. package/dist/{ScheduleGeneralPage-WJu4dwH_.js → ScheduleGeneralPage-O7ohVH-K.js} +2 -2
  19. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-DvcZjDJA.js → ScheduleModal.vue_vue_type_script_setup_true_lang-DOkdX3vt.js} +187 -186
  20. package/dist/{SchedulePage-BOiSyw9s.js → SchedulePage-WT_Ttars.js} +16 -16
  21. package/dist/{SchedulePositionPage-NR8GaPxx.js → SchedulePositionPage-13qwxMn2.js} +3 -3
  22. package/dist/{SelectFilter-xIFxmOuf.js → SelectFilter-DbE6YV-6.js} +1 -1
  23. package/dist/TeamMemberList-CWfXQcO3.js +2082 -0
  24. package/dist/TimesheetList-Bp2hRf7V.js +408 -0
  25. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-fDOF4GYa.js → TimesheetList.vue_vue_type_style_index_0_scoped_ffd7f807_lang-_tXql6vR.js} +7 -7
  26. package/dist/{app-DJOt_dse.js → app-D-6Rxcbg.js} +7690 -3886
  27. package/dist/app.js +3 -3
  28. package/dist/{approval-code-D3J-F40I.js → approval-code-Ba9JpPf4.js} +1 -1
  29. package/dist/{dayjs.min-YpmHqmB1.js → dayjs.min-dCnie4oC.js} +24 -24
  30. package/dist/employee-B5qCkaCi.js +237 -0
  31. package/dist/{grant-user-kU9gjiVw.js → grant-user-Dpla60s_.js} +1 -1
  32. package/dist/{iteration-RLqokZ_t.js → index-D8G0ElDc.js} +573 -558
  33. package/dist/{lodash-C6YpC6VN.js → lodash-CucBZWOa.js} +1 -1
  34. package/dist/member-grant-CZILo1nC.js +54 -0
  35. package/dist/restaurant-CD6RZ8XG.js +49 -0
  36. package/dist/role-54DbS-Cy.js +91 -0
  37. package/dist/rule-DzTp1Kjh.js +845 -0
  38. package/dist/src/api/my-pos-profile/index.d.ts +3 -0
  39. package/dist/src/api/sso-provider/index.d.ts +5 -0
  40. package/dist/src/api/staff-invite/index.d.ts +16 -0
  41. package/dist/src/components/CollapsibleWrapper.vue.d.ts +11 -3
  42. package/dist/src/components/form/SegmentedTabs.vue.d.ts +23 -0
  43. package/dist/src/composables/useMenuAccess.d.ts +56 -0
  44. package/dist/src/composables/useSsoProviders.d.ts +19 -0
  45. package/dist/src/composables/useStaffInviteProviders.d.ts +8 -0
  46. package/dist/src/helpers/employee-merge.d.ts +33 -0
  47. package/dist/src/helpers/iteration.d.ts +9 -2
  48. package/dist/src/helpers/member-grant.d.ts +36 -0
  49. package/dist/src/helpers/my-pos-profile.d.ts +37 -0
  50. package/dist/src/helpers/permission-set.d.ts +1 -102
  51. package/dist/src/helpers/pos-assignment-rows.d.ts +28 -0
  52. package/dist/src/helpers/restaurant-lookup.d.ts +19 -0
  53. package/dist/src/helpers/role-merge.d.ts +11 -0
  54. package/dist/src/helpers/rule.d.ts +2 -2
  55. package/dist/src/helpers/staff-invite.d.ts +54 -0
  56. package/dist/src/helpers/string.d.ts +10 -1
  57. package/dist/src/router/menu-access-guard.d.ts +17 -0
  58. package/dist/src/router/shared.d.ts +3 -1
  59. package/dist/src/stores/restaurant.d.ts +7 -7
  60. package/dist/src/stores/team.d.ts +30 -0
  61. package/dist/src/types/my-pos-profile.d.ts +24 -0
  62. package/dist/src/types/sso-provider.d.ts +10 -0
  63. package/dist/src/types/staff-invite.d.ts +100 -0
  64. package/dist/src/types/team.d.ts +17 -1
  65. package/dist/src/views/audit-log/locales/index.d.ts +12 -0
  66. package/dist/src/views/hr/locales/index.d.ts +20 -0
  67. package/dist/src/views/hr/role/RoleForm.vue.d.ts +29 -2
  68. package/dist/src/views/hr/timesheet/timesheet-view.d.ts +29 -0
  69. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +2 -0
  70. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +4 -0
  71. package/dist/src/views/my-pos-profile/locales/index.d.ts +236 -0
  72. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  73. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  74. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  75. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  76. package/dist/src/views/team/components/BasePermission.vue.d.ts +11 -0
  77. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +11 -0
  78. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +51 -0
  79. package/dist/src/views/team/{member/MemberInfo.vue.d.ts → components/MemberStatusBadge.vue.d.ts} +2 -2
  80. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +21 -0
  81. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +44 -0
  82. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +11 -0
  83. package/dist/src/views/team/locales/index.d.ts +720 -0
  84. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +48 -3
  85. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +11 -0
  86. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +35 -0
  87. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +19 -0
  88. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +1 -0
  89. package/dist/string-DZQ1uNjn.js +22 -0
  90. package/dist/style.css +1 -1
  91. package/dist/tsconfig.app.tsbuildinfo +1 -1
  92. package/dist/{useAppStore-HpBmohxh.js → useAppStore-C_LStOtj.js} +1 -1
  93. package/dist/{useLoading-WAX5d520.js → useLoading-CJ-DUrnR.js} +1 -1
  94. package/dist/{useReportPermissions-C2eS3P4D.js → useReportPermissions-C7TLMKuR.js} +22 -22
  95. package/dist/useSsoProviders-DhmUc7LW.js +41 -0
  96. package/package.json +2 -2
  97. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DNA8eHc4.js +0 -438
  98. package/dist/EmployeeList-BXO4vI9g.js +0 -776
  99. package/dist/FormItem.vue_vue_type_script_setup_true_lang-D69N78Sp.js +0 -45
  100. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
  101. package/dist/Main-DNViVR_m.js +0 -96
  102. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +0 -243
  103. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bu7YDHSf.js +0 -4181
  104. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-e6wGaXo3.js +0 -35
  105. package/dist/RoleList-Dx7Bstb_.js +0 -740
  106. package/dist/TeamMemberList-Dro66DME.js +0 -1150
  107. package/dist/TimesheetList-DO3uT60w.js +0 -402
  108. package/dist/employee-DfoS6h1_.js +0 -209
  109. package/dist/restaurant-D30tjUi3.js +0 -2685
  110. package/dist/role-DzH4jGCM.js +0 -91
  111. package/dist/rule-8KZ8d8qL.js +0 -780
  112. package/dist/string-VNuQNweN.js +0 -15
@@ -1,15 +1,14 @@
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-YpmHqmB1.js";
2
+ import { d as Ve } from "./dayjs.min-dCnie4oC.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-xIFxmOuf.js";
6
- import { _ as $e } from "./app-DJOt_dse.js";
7
- import { _ as pe, u as Se, H as Ae } from "./FormItem.vue_vue_type_script_setup_true_lang-D69N78Sp.js";
8
- import { _ as Pe } from "./index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js";
9
- import { u as ve } from "./useLoading-WAX5d520.js";
10
- import { u as fe } from "./approval-code-D3J-F40I.js";
11
- import { u as ce } from "./restaurant-D30tjUi3.js";
12
- import { _ as Be } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
5
+ import { S as q } from "./SelectFilter-DbE6YV-6.js";
6
+ import { _ as $e } from "./app-D-6Rxcbg.js";
7
+ import { _ as Se, a as pe, u as Ae, H as Pe } from "./FormSection.vue_vue_type_script_setup_true_lang-BCNKeDZY.js";
8
+ import { _ as Be } from "./index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js";
9
+ import { u as ve } from "./useLoading-CJ-DUrnR.js";
10
+ import { u as fe } from "./approval-code-Ba9JpPf4.js";
11
+ import { u as ce } from "./restaurant-CD6RZ8XG.js";
13
12
  function Ie(d) {
14
13
  var e;
15
14
  const r = (e = d.conditions) == null ? void 0 : e.adjustment;
@@ -264,7 +263,7 @@ const je = { class: "pr-24" }, De = { class: "fm-typo-en-title-md-600" }, Re = {
264
263
  ]),
265
264
  default: $(() => [
266
265
  s("div", He, [
267
- c(Be, {
266
+ c(Se, {
268
267
  title: a(i)("approvalCode.form.section")
269
268
  }, {
270
269
  default: $(() => [
@@ -382,7 +381,7 @@ const je = { class: "pr-24" }, De = { class: "fm-typo-en-title-md-600" }, Re = {
382
381
  class: "text-xs"
383
382
  }, Ct = {
384
383
  class: "flex flex-col gap-4"
385
- }, me = 10, gt = 2, It = /* @__PURE__ */ re({
384
+ }, me = 10, gt = 2, Bt = /* @__PURE__ */ re({
386
385
  __name: "ApprovalCodeList",
387
386
  setup(d, {
388
387
  expose: r
@@ -397,7 +396,7 @@ const je = { class: "pr-24" }, De = { class: "fm-typo-en-title-md-600" }, Re = {
397
396
  }))), M = g(() => w.approvalCodes), {
398
397
  searchKey: p,
399
398
  filter: B
400
- } = Se(), I = g(() => {
399
+ } = Ae(), I = g(() => {
401
400
  const t = {};
402
401
  return i.value.forEach((o) => {
403
402
  t[o._id] = o.profile.name;
@@ -647,7 +646,7 @@ const je = { class: "pr-24" }, De = { class: "fm-typo-en-title-md-600" }, Re = {
647
646
  "onUpdate:modelValue": o[5] || (o[5] = (l) => ue(p) ? p.value = l : null),
648
647
  autofocus: "",
649
648
  placeholder: a(e)("approvalCode.search.placeholder")
650
- }, null, 8, ["modelValue", "placeholder"])]), c(Ae), s("div", rt, [c(q, {
649
+ }, null, 8, ["modelValue", "placeholder"])]), c(Pe), s("div", rt, [c(q, {
651
650
  modelValue: V.value,
652
651
  "onUpdate:modelValue": o[6] || (o[6] = (l) => V.value = l),
653
652
  multiple: "",
@@ -715,7 +714,7 @@ const je = { class: "pr-24" }, De = { class: "fm-typo-en-title-md-600" }, Re = {
715
714
  _: 1
716
715
  })])]),
717
716
  _: 1
718
- })) : (_(), O(a(Pe), {
717
+ })) : (_(), O(a(Be), {
719
718
  key: 1,
720
719
  title: a(e)("approvalCode.noData.title"),
721
720
  subtitle: a(e)("approvalCode.noData.subtitle")
@@ -724,5 +723,5 @@ const je = { class: "pr-24" }, De = { class: "fm-typo-en-title-md-600" }, Re = {
724
723
  }
725
724
  });
726
725
  export {
727
- It as default
726
+ Bt as default
728
727
  };
@@ -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-YpmHqmB1.js";
2
+ import { d as P } from "./dayjs.min-dCnie4oC.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 { u as Wo, Y as Mt, _ as Go, a as Xo } from "./app-DJOt_dse.js";
5
+ import { g as st, b as at, u as Wo, G as Mt, _ as Go, a as Xo } from "./app-D-6Rxcbg.js";
6
6
  import { components as ve } from "@feedmepos/ui-library";
7
- import { g as st, b as at, u as Qo } from "./restaurant-D30tjUi3.js";
8
- import { S as Me } from "./SelectFilter-xIFxmOuf.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-8KZ8d8qL.js";
7
+ import { S as Me } from "./SelectFilter-DbE6YV-6.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-DzTp1Kjh.js";
11
+ import { u as ts } from "./restaurant-CD6RZ8XG.js";
12
12
  import { u as os } from "./useDebounce-B8ZPVS5C.js";
13
- import { n as ss } from "./string-VNuQNweN.js";
13
+ import { n as ss } from "./string-DZQ1uNjn.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 ts.readTeamMembers();
273
+ const w = await es.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 = Qo(), {
867
+ } = dt(), r = Ho(), c = Wo(), d = ms(), b = ts(), {
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(Zo, {
1790
+ return v(), g(z, null, [y(Qo, {
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(es, {
1889
+ default: B(() => [a("div", Ns, [y(Zo, {
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,459 @@
1
+ import { defineComponent as B, ref as S, onMounted as le, nextTick as ue, onUnmounted as re, resolveComponent as g, createElementBlock as b, openBlock as u, Fragment as C, createElementVNode as U, createVNode as A, renderSlot as T, createCommentVNode as w, toDisplayString as E, normalizeStyle as se, normalizeClass as X, watch as q, defineAsyncComponent as ie, computed as K, renderList as M, createBlock as h, withCtx as j, unref as D, resolveDynamicComponent as de } from "vue";
2
+ import { useI18n as Y, useCoreStore as me } from "@feedmepos/mf-common";
3
+ import { O as L, y as ce, U as W } from "./app-D-6Rxcbg.js";
4
+ import { l as fe } from "./lodash-CucBZWOa.js";
5
+ const ye = { class: "flex min-w-0 flex-col gap-4" }, be = {
6
+ key: 0,
7
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
8
+ }, ve = { class: "flex items-center" }, pe = {
9
+ key: 0,
10
+ class: "ml-8 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
11
+ }, ke = { class: "ml-auto" }, Ie = /* @__PURE__ */ B({
12
+ __name: "CollapsibleWrapper",
13
+ props: {
14
+ title: { default: "" },
15
+ subtitle: { default: "" },
16
+ initiallyCollapsed: { type: Boolean, default: !1 },
17
+ layout: { default: "trailing" }
18
+ },
19
+ setup(e) {
20
+ const o = S(e.initiallyCollapsed), c = S(), f = S(0);
21
+ let m;
22
+ function V() {
23
+ o.value = !o.value;
24
+ }
25
+ function d() {
26
+ c.value && (f.value = c.value.scrollHeight);
27
+ }
28
+ return le(async () => {
29
+ await ue(), c.value && (m = new ResizeObserver(() => {
30
+ d();
31
+ }), m.observe(c.value));
32
+ }), re(() => {
33
+ m == null || m.disconnect();
34
+ }), (v, s) => {
35
+ const y = g("FmIcon"), p = g("FmButton");
36
+ return u(), b(C, null, [
37
+ e.layout === "leading" ? (u(), b("div", {
38
+ key: 0,
39
+ class: "flex cursor-pointer items-start gap-8 py-4",
40
+ onClick: V
41
+ }, [
42
+ A(y, {
43
+ name: o.value ? "chevron_right" : "expand_more",
44
+ size: "md",
45
+ class: "shrink-0 text-fm-color-typo-primary"
46
+ }, null, 8, ["name"]),
47
+ U("div", ye, [
48
+ T(v.$slots, "title"),
49
+ e.subtitle ? (u(), b("span", be, E(e.subtitle), 1)) : w("", !0)
50
+ ])
51
+ ])) : (u(), b("div", {
52
+ key: 1,
53
+ onClick: V
54
+ }, [
55
+ U("div", ve, [
56
+ T(v.$slots, "title"),
57
+ o.value && e.subtitle ? (u(), b("span", pe, E(e.subtitle), 1)) : w("", !0),
58
+ U("div", ke, [
59
+ A(p, {
60
+ icon: o.value ? "keyboard_arrow_down" : "keyboard_arrow_up",
61
+ "text-color": "neutral-gray-400",
62
+ variant: "tertiary",
63
+ size: "md"
64
+ }, null, 8, ["icon"])
65
+ ])
66
+ ])
67
+ ])),
68
+ U("div", {
69
+ ref_key: "contentRef",
70
+ ref: c,
71
+ class: X(["transition-all duration-300 ease-in-out overflow-hidden", { "pl-32": e.layout === "leading" }]),
72
+ style: se({ maxHeight: o.value ? "0" : f.value + "px" })
73
+ }, [
74
+ T(v.$slots, "default")
75
+ ], 6)
76
+ ], 64);
77
+ };
78
+ }
79
+ });
80
+ function z(e) {
81
+ return `${e.subject}::${e.builderKey}`;
82
+ }
83
+ function $e(e) {
84
+ const r = S(/* @__PURE__ */ new Map());
85
+ function o(s, y) {
86
+ const p = new Map(r.value);
87
+ p.set(z(s), y), r.value = p;
88
+ }
89
+ function c(s) {
90
+ return r.value.get(z(s));
91
+ }
92
+ function f(s) {
93
+ for (const y of r.value.keys())
94
+ if (y.startsWith(`${s}::`)) return !0;
95
+ return !1;
96
+ }
97
+ function m(s) {
98
+ const y = /* @__PURE__ */ new Map();
99
+ for (const [p, O] of r.value.entries())
100
+ p.startsWith(`${s}::`) && y.set(p, O);
101
+ return y;
102
+ }
103
+ function V(s) {
104
+ const y = new Map(r.value);
105
+ for (const p of Array.from(y.keys()))
106
+ p.startsWith(`${s}::`) && y.delete(p);
107
+ r.value = y;
108
+ }
109
+ function d() {
110
+ r.value = /* @__PURE__ */ new Map();
111
+ }
112
+ function v(s) {
113
+ const y = new Map(r.value);
114
+ y.delete(z(s)), r.value = y;
115
+ }
116
+ return e && q(
117
+ e,
118
+ () => {
119
+ d();
120
+ },
121
+ { deep: !0 }
122
+ ), {
123
+ drafts: r,
124
+ setDraft: o,
125
+ getDraft: c,
126
+ hasDraftsForSubject: f,
127
+ getDraftsForSubject: m,
128
+ clearDraftsForSubject: V,
129
+ clearAllDrafts: d,
130
+ clearDraft: v
131
+ };
132
+ }
133
+ const he = {}, Z = /* @__PURE__ */ new Map();
134
+ function ge(e) {
135
+ const r = Z.get(e);
136
+ if (r) return r;
137
+ const o = he[e];
138
+ if (!o) return;
139
+ const c = ie(o);
140
+ return Z.set(e, c), c;
141
+ }
142
+ function Ve(e, r) {
143
+ return !fe.isEqual(e, r);
144
+ }
145
+ const Fe = { class: "flex flex-col gap-8" }, Ce = { class: "flex flex-col gap-4" }, xe = "condition-form-select-menu", J = 120, De = 220, Ue = /* @__PURE__ */ B({
146
+ __name: "ConditionFormRenderer",
147
+ props: {
148
+ config: {},
149
+ modelValue: {},
150
+ disabled: { type: Boolean, default: !1 },
151
+ optionProviders: { default: () => ({}) }
152
+ },
153
+ emits: ["update:modelValue"],
154
+ setup(e, { emit: r }) {
155
+ const o = e, c = r, { t: f } = Y(), m = me(), V = K(() => L(o.config, o.modelValue));
156
+ let d = o.modelValue;
157
+ q(
158
+ () => o.modelValue,
159
+ (t) => {
160
+ d = t;
161
+ }
162
+ );
163
+ function v(t) {
164
+ return "static" in t ? t.static.map((n) => ({ value: n.value, label: f(n.labelKey) })) : o.optionProviders[t.provider] ?? [];
165
+ }
166
+ function s(t, n) {
167
+ const l = y(
168
+ ce(o.config, { ...o.modelValue, [t]: n })
169
+ );
170
+ Ve(l, d) && (d = l, c("update:modelValue", l));
171
+ }
172
+ function y(t) {
173
+ const n = { ...t };
174
+ for (const l of L(o.config, n))
175
+ l.kind === "date" && !n[l.key] && (n[l.key] = G(Q()));
176
+ return n;
177
+ }
178
+ function p() {
179
+ const t = m.currentBusiness.value;
180
+ if (t != null && t.timezone) return t.timezone;
181
+ if (t != null && t.timeZone) return t.timeZone;
182
+ const n = (t == null ? void 0 : t.country) ?? (m.currentCountry.value instanceof Object ? m.currentCountry.value.code : m.currentCountry.value);
183
+ return O(n);
184
+ }
185
+ function O(t) {
186
+ switch ((t || "").toUpperCase()) {
187
+ case "MY":
188
+ return "Asia/Kuala_Lumpur";
189
+ case "SG":
190
+ return "Asia/Singapore";
191
+ case "TH":
192
+ return "Asia/Bangkok";
193
+ case "ID":
194
+ return "Asia/Jakarta";
195
+ case "MO":
196
+ return "Asia/Macau";
197
+ case "BN":
198
+ return "Asia/Brunei";
199
+ case "PK":
200
+ return "Asia/Karachi";
201
+ case "MV":
202
+ return "Indian/Maldives";
203
+ case "VN":
204
+ return "Asia/Ho_Chi_Minh";
205
+ case "JP":
206
+ return "Asia/Tokyo";
207
+ case "AU":
208
+ return "Australia/Sydney";
209
+ case "AE":
210
+ return "Asia/Dubai";
211
+ case "UK":
212
+ return "Europe/London";
213
+ default:
214
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
215
+ }
216
+ }
217
+ function R(t, n) {
218
+ const l = new Intl.DateTimeFormat("en-CA", {
219
+ timeZone: n,
220
+ year: "numeric",
221
+ month: "2-digit",
222
+ day: "2-digit",
223
+ hour: "2-digit",
224
+ minute: "2-digit",
225
+ second: "2-digit",
226
+ hourCycle: "h23"
227
+ }).formatToParts(t), k = Object.fromEntries(
228
+ l.filter((F) => F.type !== "literal").map((F) => [F.type, F.value])
229
+ );
230
+ return {
231
+ year: Number(k.year),
232
+ month: Number(k.month),
233
+ day: Number(k.day),
234
+ hour: Number(k.hour),
235
+ minute: Number(k.minute),
236
+ second: Number(k.second)
237
+ };
238
+ }
239
+ function P(t, n) {
240
+ try {
241
+ const l = R(n, t);
242
+ return (Date.UTC(
243
+ l.year,
244
+ l.month - 1,
245
+ l.day,
246
+ l.hour,
247
+ l.minute,
248
+ l.second
249
+ ) - n.getTime()) / 6e4;
250
+ } catch {
251
+ return 0;
252
+ }
253
+ }
254
+ function G(t) {
255
+ const [n, l, k] = t.split("-").map(Number);
256
+ if (!n || !l || !k) return "";
257
+ const F = p(), x = new Date(Date.UTC(n, l - 1, k, 0, 0, 0, 0)), $ = P(F, x), N = new Date(x.getTime() - $ * 6e4), _ = P(F, N);
258
+ return new Date(x.getTime() - _ * 6e4).toISOString();
259
+ }
260
+ function H(t) {
261
+ const n = new Date(t);
262
+ if (Number.isNaN(n.getTime())) return "";
263
+ try {
264
+ const l = R(n, p());
265
+ return `${String(l.year).padStart(4, "0")}-${String(l.month).padStart(2, "0")}-${String(l.day).padStart(2, "0")}`;
266
+ } catch {
267
+ return t.slice(0, 10);
268
+ }
269
+ }
270
+ function Q() {
271
+ return H((/* @__PURE__ */ new Date()).toISOString());
272
+ }
273
+ function I(t) {
274
+ return "options" in t ? v(t.options) : [];
275
+ }
276
+ function ee(t) {
277
+ const n = o.modelValue[t];
278
+ return n == null ? "" : String(n);
279
+ }
280
+ function te(t) {
281
+ const n = o.modelValue[t];
282
+ return typeof n != "string" || !n ? "" : H(n);
283
+ }
284
+ function ne(t, n) {
285
+ s(t, n ? G(n) : "");
286
+ }
287
+ function oe(t, n) {
288
+ let l = Math.floor(Number(n) || (t.min ?? 0));
289
+ t.min !== void 0 && (l = Math.max(t.min, l)), t.max !== void 0 && (l = Math.min(t.max, l)), s(t.key, l);
290
+ }
291
+ return (t, n) => {
292
+ const l = g("FmRadio"), k = g("FmRadioGroup"), F = g("FmSelect"), x = g("FmTextField"), $ = g("FmDatePicker"), N = g("FmCheckbox"), _ = g("FmFormGroup");
293
+ return u(), b("div", Fe, [
294
+ (u(!0), b(C, null, M(V.value, (a) => (u(), b(C, {
295
+ key: a.key
296
+ }, [
297
+ a.kind === "radio" ? (u(), h(k, {
298
+ key: 0,
299
+ "model-value": e.modelValue[a.key],
300
+ disabled: e.disabled,
301
+ "onUpdate:modelValue": (i) => s(a.key, i)
302
+ }, {
303
+ default: j(() => [
304
+ (u(!0), b(C, null, M(I(a), (i) => (u(), h(l, {
305
+ key: i.value,
306
+ value: i.value,
307
+ label: i.label
308
+ }, null, 8, ["value", "label"]))), 128))
309
+ ]),
310
+ _: 2
311
+ }, 1032, ["model-value", "disabled", "onUpdate:modelValue"])) : a.kind === "select" ? (u(), h(F, {
312
+ key: 1,
313
+ "model-value": e.modelValue[a.key],
314
+ label: D(f)(a.labelKey),
315
+ items: I(a),
316
+ "menu-id": xe,
317
+ "menu-z-index": J,
318
+ "max-height": De,
319
+ "shift-menu": "",
320
+ placement: "bottom-start",
321
+ disabled: e.disabled,
322
+ "onUpdate:modelValue": (i) => s(a.key, i)
323
+ }, null, 8, ["model-value", "label", "items", "disabled", "onUpdate:modelValue"])) : a.kind === "number" ? (u(), h(x, {
324
+ key: 2,
325
+ "model-value": ee(a.key),
326
+ type: "number",
327
+ class: "!w-[120px] ml-32",
328
+ label: D(f)(a.labelKey),
329
+ disabled: e.disabled,
330
+ "onUpdate:modelValue": (i) => oe(a, i)
331
+ }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : a.kind === "text" ? (u(), h(x, {
332
+ key: 3,
333
+ "model-value": e.modelValue[a.key] ?? "",
334
+ label: D(f)(a.labelKey),
335
+ disabled: e.disabled,
336
+ "onUpdate:modelValue": (i) => s(a.key, i)
337
+ }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : a.kind === "date" ? (u(), h($, {
338
+ key: 4,
339
+ "model-value": te(a.key),
340
+ label: D(f)(a.labelKey),
341
+ "z-index": J,
342
+ disabled: e.disabled,
343
+ "onUpdate:modelValue": (i) => ne(a.key, i)
344
+ }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : a.kind === "switch" ? (u(), h(N, {
345
+ key: 5,
346
+ "model-value": !!e.modelValue[a.key],
347
+ value: !0,
348
+ label: D(f)(a.labelKey),
349
+ disabled: e.disabled,
350
+ "onUpdate:modelValue": (i) => s(a.key, i)
351
+ }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : a.kind === "multiselect" ? (u(), h(_, {
352
+ key: 6,
353
+ "model-value": e.modelValue[a.key] ?? [],
354
+ "onUpdate:modelValue": (i) => s(a.key, i)
355
+ }, {
356
+ default: j(() => [
357
+ U("div", Ce, [
358
+ (u(!0), b(C, null, M(I(a), (i) => (u(), h(N, {
359
+ key: i.value,
360
+ "model-value": e.modelValue[a.key] ?? [],
361
+ value: i.value,
362
+ label: i.label,
363
+ disabled: e.disabled,
364
+ "onUpdate:modelValue": (ae) => s(a.key, ae)
365
+ }, null, 8, ["model-value", "value", "label", "disabled", "onUpdate:modelValue"]))), 128))
366
+ ])
367
+ ]),
368
+ _: 2
369
+ }, 1032, ["model-value", "onUpdate:modelValue"])) : w("", !0)
370
+ ], 64))), 128))
371
+ ]);
372
+ };
373
+ }
374
+ }), we = /* @__PURE__ */ B({
375
+ __name: "ConditionFormHost",
376
+ props: {
377
+ builder: {},
378
+ modelValue: {},
379
+ disable: { type: Boolean, default: !1 },
380
+ optionProviders: { default: () => ({}) }
381
+ },
382
+ emits: ["update:modelValue"],
383
+ setup(e, { emit: r }) {
384
+ const o = e, c = r, f = K(
385
+ () => o.builder.form && W(o.builder.form) ? o.builder.form : void 0
386
+ ), m = K(
387
+ () => o.builder.form && !W(o.builder.form) ? ge(o.builder.form.component) : void 0
388
+ );
389
+ return (V, d) => f.value ? (u(), h(Ue, {
390
+ key: 0,
391
+ config: f.value,
392
+ "model-value": e.modelValue ?? f.value.defaults,
393
+ disabled: e.disable,
394
+ "option-providers": e.optionProviders,
395
+ "onUpdate:modelValue": d[0] || (d[0] = (v) => c("update:modelValue", v))
396
+ }, null, 8, ["config", "model-value", "disabled", "option-providers"])) : m.value ? (u(), h(de(m.value), {
397
+ key: 1,
398
+ "model-value": e.modelValue,
399
+ disable: e.disable,
400
+ "onUpdate:modelValue": d[1] || (d[1] = (v) => c("update:modelValue", v))
401
+ }, null, 8, ["model-value", "disable"])) : w("", !0);
402
+ }
403
+ }), Ne = {
404
+ key: 0,
405
+ class: "fm-typo-en-title-sm-600"
406
+ }, Se = {
407
+ key: 0,
408
+ class: "h-px w-full bg-fm-color-neutral-gray-200"
409
+ }, Te = { class: "flex justify-end pt-8" }, _e = /* @__PURE__ */ B({
410
+ __name: "ConditionBuilderForm",
411
+ props: {
412
+ builders: {},
413
+ formValueFor: {},
414
+ hasChanges: { type: Boolean },
415
+ title: { default: "" },
416
+ disable: { type: Boolean, default: !1 },
417
+ fullWidth: { type: Boolean, default: !1 }
418
+ },
419
+ emits: ["update-form", "apply"],
420
+ setup(e, { emit: r }) {
421
+ const o = r, { t: c } = Y();
422
+ return (f, m) => {
423
+ const V = g("FmButton");
424
+ return u(), b("div", {
425
+ class: X(["flex flex-col gap-12 p-16", e.fullWidth ? "w-full" : "w-[320px]"])
426
+ }, [
427
+ e.title ? (u(), b("p", Ne, E(e.title), 1)) : w("", !0),
428
+ (u(!0), b(C, null, M(e.builders, (d, v) => (u(), b(C, {
429
+ key: d.builderKey
430
+ }, [
431
+ v > 0 ? (u(), b("div", Se)) : w("", !0),
432
+ T(f.$slots, "section", { builder: d }, () => [
433
+ A(we, {
434
+ builder: d,
435
+ "model-value": e.formValueFor(d),
436
+ disable: e.disable,
437
+ "onUpdate:modelValue": (s) => o("update-form", { builder: d, form: s })
438
+ }, null, 8, ["builder", "model-value", "disable", "onUpdate:modelValue"])
439
+ ])
440
+ ], 64))), 128)),
441
+ U("div", Te, [
442
+ A(V, {
443
+ label: D(c)("team.memberForm.permissions.conditionApply"),
444
+ size: "md",
445
+ variant: "primary",
446
+ disabled: e.disable || !e.hasChanges,
447
+ onClick: m[0] || (m[0] = (d) => o("apply"))
448
+ }, null, 8, ["label", "disabled"])
449
+ ])
450
+ ], 2);
451
+ };
452
+ }
453
+ });
454
+ export {
455
+ Ie as _,
456
+ _e as a,
457
+ we as b,
458
+ $e as u
459
+ };