@feedmepos/mf-connect 0.1.38-beta.2 → 0.1.38-beta.21

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 (96) hide show
  1. package/dist/{Analytic-BjSfI2Ff.js → Analytic-CEd_WApy.js} +14 -14
  2. package/dist/{App-D11A2JY1.js → App-ulCtuU5o.js} +671 -661
  3. package/dist/{AuditLogs-DWCFYoRg.js → AuditLogs-BM1Np61K.js} +11 -11
  4. package/dist/{Bin-9wV4Ah3M.js → Bin-icbjnKXw.js} +9 -9
  5. package/dist/{Broadcast-I3BtSk8V.js → Broadcast-COQ3E8vI.js} +9 -9
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-XJqTXbKr.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BbXEYOFK.js} +6 -6
  7. package/dist/{Card-CqALG5RM.js → Card-Cwh3GXi0.js} +142 -136
  8. package/dist/{Collections-rg3SzoUb.js → Collections-EuOjzpkL.js} +81 -75
  9. package/dist/{Credit-BNn1sYZv.js → Credit-BY2Fpdhh.js} +9 -9
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-PJ8q72XH.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BbsLgUMQ.js} +678 -675
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Sww7KNle.js → EffectSheet.vue_vue_type_style_index_0_lang-BLw3-hI1.js} +6 -6
  13. package/dist/{Experience-D_Qm8SUj.js → Experience-rAH7zk71.js} +9 -9
  14. package/dist/{Game-CKXgXm6Q.js → Game-DlI0yNF0.js} +10 -10
  15. package/dist/{Index-D4DGfUHd.js → Index-DemXFS3d.js} +10 -10
  16. package/dist/{Marketing-Dn9A1vgH.js → Marketing-shNBO9Rc.js} +7 -7
  17. package/dist/{Member-B55vWHDd.js → Member-C19ZgpaL.js} +10 -10
  18. package/dist/{MemberList-BWTG9Ohy.js → MemberList-B2tNB4yg.js} +27 -27
  19. package/dist/{MemberTransactions-CP5EI-W0.js → MemberTransactions-BN3qaTVY.js} +1 -1
  20. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D--_An-f.js → MessageInput.vue_vue_type_script_setup_true_lang-BY3j1h72.js} +5621 -5418
  21. package/dist/{Mission-CFvhROuB.js → Mission-j1KI0-hJ.js} +10 -10
  22. package/dist/{Overview-4273yNwL.js → Overview-BN2Vdu8Q.js} +18 -18
  23. package/dist/{Point-B_-_C919.js → Point-8zy7QcTk.js} +9 -9
  24. package/dist/{Promotion-D2S3COxk.js → Promotion-mcUcylXB.js} +10 -10
  25. package/dist/{Queue-BmS1Oi-C.js → Queue-BsNv4P8u.js} +11 -11
  26. package/dist/{Record-DRBl0M8g.js → Record-VA6Bdlnz.js} +9 -9
  27. package/dist/{Reward-8056NmfK.js → Reward-CVyO3Ga1.js} +15 -15
  28. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CJ_WC2gV.js → RewardGroup.vue_vue_type_script_setup_true_lang-BR9_a9bJ.js} +11 -11
  29. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dhs2whAH.js +1763 -0
  30. package/dist/{Segment-Bzq-pyhc.js → Segment-BMgcdIIS.js} +209 -209
  31. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-4nNkkklE.js → SelectItems.vue_vue_type_script_setup_true_lang-CKRpWcn_.js} +2 -2
  32. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dnf2oxOG.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DZCNcdVW.js} +11 -11
  33. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLYP-5U9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BESF672g.js} +3 -3
  34. package/dist/{Setting-BrJfYoru.js → Setting-BMKKkZTD.js} +457 -442
  35. package/dist/{Store-Bpl_4yZW.js → Store-DdxMDtfL.js} +466 -459
  36. package/dist/{StoreRewards-Cu7n7Pjz.js → StoreRewards-CRyeHEMF.js} +13 -13
  37. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-T3Wo2maC.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DS6-9WP9.js} +207 -221
  38. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-QucRaI08.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BTKpclKX.js} +1 -1
  39. package/dist/{Tier-_LnXg3n6.js → Tier-D5Xmp5vV.js} +229 -226
  40. package/dist/{Title-B7AGStvx.js → Title-CsK2crqD.js} +141 -138
  41. package/dist/{Transaction-Chxv6V7u.js → Transaction-Dvfc9x4f.js} +2 -2
  42. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CzXNmobp.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CqCxWltm.js} +6 -6
  43. package/dist/{Voucher-C5z2kOq9.js → Voucher-CPN7TMho.js} +13 -13
  44. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DdGMrk2C.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DMye9MS3.js} +10 -10
  45. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BlXzEWA6.js → ZodTextField.vue_vue_type_script_setup_true_lang-CnaQAEKo.js} +1 -1
  46. package/dist/{app-BVojNX0w.js → app-DRBevJsF.js} +1 -1
  47. package/dist/{app-7cvPyHJ7.js → app-DteFjR9L.js} +459 -449
  48. package/dist/app.js +1 -1
  49. package/dist/{business-CmxV69wT.js → business-BqV9jK-p.js} +1 -1
  50. package/dist/{campaign-CT_cNJEL.js → campaign-BHDq-yx-.js} +10 -10
  51. package/dist/{campaign-Dq5C_no-.js → campaign-CsWoG6e_.js} +2 -2
  52. package/dist/{campaign.enum-dp7yHKzF.js → campaign.enum-Dfa96W5V.js} +1 -1
  53. package/dist/{campaign.fn-BYZgKDN7.js → campaign.fn-pLrwyHA_.js} +37 -37
  54. package/dist/{collectible.enum-DxbB4DxT.js → collectible.enum-BYTYWPsR.js} +1 -1
  55. package/dist/{collection.fn-CNZRdUgy.js → collection.fn-CYLIQJig.js} +2 -2
  56. package/dist/{dto-CT9zZbv9.js → dto-DBfDbpyb.js} +4 -4
  57. package/dist/{effect-FIlOEC4H.js → effect-D9pD5RCk.js} +1 -1
  58. package/dist/{email-addresses-Ba7xImfX.js → email-addresses-BApvdLkQ.js} +1 -1
  59. package/dist/{export-uzjZFNF9.js → export--EfmCiw0.js} +4 -4
  60. package/dist/{helper-D4sAZde0.js → helper-BHiK3pLT.js} +1 -1
  61. package/dist/{index-B9pl4zRZ.js → index-2dknXEFJ.js} +19 -9
  62. package/dist/{index-CNJLP3D5.js → index-B9_Tn8si.js} +1 -1
  63. package/dist/{index-BjU8LVUC.js → index-BSQXDDQY.js} +6347 -6305
  64. package/dist/{index-CwsMG2cV.js → index-Bqc7PV3K.js} +1 -1
  65. package/dist/{index-CONvJfKv.js → index-C1Vrltkc.js} +1 -1
  66. package/dist/{index-D5rvMvzx.js → index-CD2bkLo_.js} +1 -1
  67. package/dist/{index-DNxa8Rqx.js → index-CDLBLuYq.js} +69 -68
  68. package/dist/{index-BXz54M1s.js → index-COiVJ9pA.js} +1 -1
  69. package/dist/{index-CH3z92VV.js → index-CVxruvVB.js} +1 -1
  70. package/dist/{index-CS3Jmojj.js → index-Cc80pBYX.js} +573 -573
  71. package/dist/{index-l2F5MnLF.js → index-DXM3o6kl.js} +11 -4
  72. package/dist/{index-BI3m1Ehv.js → index-DYgdunxw.js} +3 -3
  73. package/dist/{index-CvBcve-r.js → index-Pd9RCQxn.js} +1 -1
  74. package/dist/{index-CUfS9Kp1.js → index-qd_dvZcw.js} +2 -2
  75. package/dist/{index.esm2017-ATcsD5N4.js → index.esm2017-DAWS_ALH.js} +34 -34
  76. package/dist/{loading-BWGQSrCB.js → loading-BVUeda4s.js} +1 -1
  77. package/dist/{membership-Cc4OZ8-U.js → membership-BL_43RJR.js} +3 -3
  78. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  79. package/dist/{money-D7p8nfun.js → money-Cd8hLiNc.js} +1 -1
  80. package/dist/{number-CMJjC4qz.js → number-DVb8PSrj.js} +1 -1
  81. package/dist/objectid-D33s3gxp.js +145 -0
  82. package/dist/{plugins-eQis66QR.js → plugins-BKtBkC9Q.js} +2 -2
  83. package/dist/{reward-DrnzbG20.js → reward-f41dJcaL.js} +1 -1
  84. package/dist/{rule-CtRxkYXB.js → rule-Cbux1-fC.js} +4 -4
  85. package/dist/rule-builder-BrZeF45Z.js +91 -0
  86. package/dist/style.css +4 -1
  87. package/dist/{template-C3UfY0v5.js → template-tqhgmIdT.js} +4 -4
  88. package/dist/timezone-DaTVH4y0.js +1150 -0
  89. package/dist/{trigger-C9U7Zgad.js → trigger-C34RfwrT.js} +4 -4
  90. package/dist/{user-D7n9yYmO.js → user-DgKhDLYr.js} +1 -1
  91. package/dist/{vue-i18n-Bz45zC04.js → vue-i18n-xo56wiwi.js} +410 -410
  92. package/dist/{xlsx-D4S4qbcZ.js → xlsx-D8ZZRjtf.js} +1 -1
  93. package/package.json +3 -2
  94. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DqNQl_nz.js +0 -1728
  95. package/dist/objectid-D5T27iny.js +0 -145
  96. package/dist/rule-builder-Di9RIYHF.js +0 -89
@@ -1,41 +1,42 @@
1
1
  import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createCommentVNode, computed, createElementVNode, Fragment, renderList, normalizeClass, toDisplayString, toRefs, normalizeStyle, resolveDynamicComponent, createSlots } from "vue";
2
2
  import { _ } from "./lodash-B5I3zXaY.js";
3
- import { z } from "./app-7cvPyHJ7.js";
3
+ import { z } from "./app-DteFjR9L.js";
4
4
  import { Z as ZodHelper } from "./zod-Bg2FbC-D.js";
5
- import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-CT_cNJEL.js";
6
- import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-CT9zZbv9.js";
7
- import { u as useMembershipStore } from "./membership-Cc4OZ8-U.js";
8
- import { u as useBusinessStore } from "./business-CmxV69wT.js";
9
- import "./index-CUfS9Kp1.js";
10
- import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-Di9RIYHF.js";
5
+ import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-BHDq-yx-.js";
6
+ import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-DBfDbpyb.js";
7
+ import { u as useMembershipStore } from "./membership-BL_43RJR.js";
8
+ import { u as useBusinessStore } from "./business-BqV9jK-p.js";
9
+ import "./index-qd_dvZcw.js";
10
+ import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-BrZeF45Z.js";
11
11
  import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
12
- import { h as hooks } from "./moment-BWErdI6_.js";
13
- import { f as featureVersionMapping } from "./campaign.enum-dp7yHKzF.js";
12
+ import { h as hooks } from "./moment-D7p2TMB-.js";
13
+ import { f as featureVersionMapping } from "./campaign.enum-Dfa96W5V.js";
14
14
  import { _ as _sfc_main$o } from "./ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js";
15
- import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-Sww7KNle.js";
16
- import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-QucRaI08.js";
17
- import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-CzXNmobp.js";
18
- import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DqNQl_nz.js";
19
- import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-eQis66QR.js";
20
- import { u as useI18n } from "./vue-i18n-Bz45zC04.js";
21
- import { T as TypeToTriggerOptions, _ as _sfc_main$u, b as _sfc_main$v } from "./trigger-C9U7Zgad.js";
22
- import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-D--_An-f.js";
23
- import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-CtRxkYXB.js";
24
- import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DdGMrk2C.js";
25
- import { T as TEMPLATES } from "./index-B9pl4zRZ.js";
26
- import { t as FdoCreditLoyaltyReward, u as FdtoRandomReward, v as F_MISSION_TYPE, w as FdoThresholdCreditReward, x as FdtoThresholdReward, y as FdoMission } from "./index-DNxa8Rqx.js";
27
- import "./index-CONvJfKv.js";
28
- import "./index-BI3m1Ehv.js";
29
- import { a as F_GAME_TYPE } from "./collectible.enum-DxbB4DxT.js";
15
+ import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-BLw3-hI1.js";
16
+ import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-BTKpclKX.js";
17
+ import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-CqCxWltm.js";
18
+ import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Dhs2whAH.js";
19
+ import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-BKtBkC9Q.js";
20
+ import { u as useI18n } from "./vue-i18n-xo56wiwi.js";
21
+ import { T as TypeToTriggerOptions, _ as _sfc_main$u, b as _sfc_main$v } from "./trigger-C34RfwrT.js";
22
+ import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-BY3j1h72.js";
23
+ import { C as CountryTimezone, m as moment } from "./timezone-DaTVH4y0.js";
24
+ import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-Cbux1-fC.js";
30
25
  import { useCoreStore } from "@feedmepos/mf-common";
31
- import { u as useLoading } from "./loading-BWGQSrCB.js";
32
- import { i as initCollectibleConfig } from "./helper-D4sAZde0.js";
33
- import { C as CollectionUtils } from "./collection.fn-CNZRdUgy.js";
26
+ import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DMye9MS3.js";
27
+ import { T as TEMPLATES } from "./index-2dknXEFJ.js";
28
+ import { t as FdoCreditLoyaltyReward, u as FdtoRandomReward, v as F_MISSION_TYPE, w as FdoThresholdCreditReward, x as FdtoThresholdReward, y as FdoMission } from "./index-CDLBLuYq.js";
29
+ import "./index-C1Vrltkc.js";
30
+ import "./index-DYgdunxw.js";
31
+ import { a as F_GAME_TYPE } from "./collectible.enum-BYTYWPsR.js";
32
+ import { u as useLoading } from "./loading-BVUeda4s.js";
33
+ import { i as initCollectibleConfig } from "./helper-BHiK3pLT.js";
34
+ import { C as CollectionUtils } from "./collection.fn-CYLIQJig.js";
34
35
  import { s as sentenceCase$1 } from "./index-CsaQJMAR.js";
35
- import "./index-CS3Jmojj.js";
36
+ import "./index-Cc80pBYX.js";
36
37
  import { useDialog } from "@feedmepos/ui-library";
37
- import { u as useCampaignStore } from "./campaign-Dq5C_no-.js";
38
- import { S as SvcConfig } from "./index-BjU8LVUC.js";
38
+ import { u as useCampaignStore } from "./campaign-CsWoG6e_.js";
39
+ import { S as SvcConfig } from "./index-BSQXDDQY.js";
39
40
  import { a as cleanPF } from "./object-qECH92oz.js";
40
41
  const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
41
42
  __name: "TimeRuleGroup",
@@ -47,83 +48,83 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
47
48
  }
48
49
  },
49
50
  emits: ["update:model-value"],
50
- setup(e, { emit: d }) {
51
- const { t: a } = useI18n(), s = e, u = d, i = ref(
52
- !s.modelValue || !s.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(s.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
51
+ setup(e, { emit: m }) {
52
+ const { t: a } = useI18n(), i = e, u = m, d = ref(
53
+ !i.modelValue || !i.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(i.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
53
54
  );
54
- watch(i, async (l, n) => {
55
- var m;
56
- if (n == "custom" && l == "all_time" && RuleBuilder.getRules((m = s.modelValue) == null ? void 0 : m.rules.g_time).length > 0) {
57
- const g = await prompt.confirm(
55
+ watch(d, async (o, n) => {
56
+ var s;
57
+ if (n == "custom" && o == "all_time" && RuleBuilder.getRules((s = i.modelValue) == null ? void 0 : s.rules.g_time).length > 0) {
58
+ const y = await prompt.confirm(
58
59
  a("connect.template.rule.time.confirm_remove"),
59
60
  a("connect.common.confirm"),
60
61
  a("connect.common.confirm"),
61
62
  a("connect.common.cancel")
62
63
  );
63
- g && u(
64
+ y && u(
64
65
  "update:model-value",
65
66
  RuleBuilder.setRuleToGroup(
66
- s.modelValue ?? RuleBuilder.scaffoldGroup(),
67
+ i.modelValue ?? RuleBuilder.scaffoldGroup(),
67
68
  RuleBuilder.scaffoldGroup("g_time")
68
69
  )
69
- ), i.value = g ? l : n;
70
+ ), d.value = y ? o : n;
70
71
  }
71
72
  });
72
- async function o(l) {
73
+ async function l(o) {
73
74
  var n;
74
- if (l == "custom" && RuleBuilder.getRules((n = s.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
75
+ if (o == "custom" && RuleBuilder.getRules((n = i.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
75
76
  if (!await prompt.confirm(
76
77
  a("connect.template.rule.time.confirm_remove"),
77
78
  a("connect.common.confirm"),
78
79
  a("connect.common.confirm"),
79
80
  a("connect.common.cancel")
80
81
  )) {
81
- i.value = "all_time";
82
+ d.value = "all_time";
82
83
  return;
83
84
  }
84
85
  u(
85
86
  "update:model-value",
86
87
  RuleBuilder.setRuleToGroup(
87
- s.modelValue ?? RuleBuilder.scaffoldGroup(),
88
+ i.modelValue ?? RuleBuilder.scaffoldGroup(),
88
89
  RuleBuilder.scaffoldGroup("g_time")
89
90
  )
90
91
  );
91
92
  }
92
93
  }
93
- return (l, n) => {
94
- var y;
95
- const m = resolveComponent("FmRadio"), g = resolveComponent("FmRadioGroup");
94
+ return (o, n) => {
95
+ var v;
96
+ const s = resolveComponent("FmRadio"), y = resolveComponent("FmRadioGroup");
96
97
  return openBlock(), createElementBlock("div", _hoisted_1$g, [
97
- createVNode(g, {
98
- modelValue: unref(i),
98
+ createVNode(y, {
99
+ modelValue: unref(d),
99
100
  "onUpdate:modelValue": [
100
- n[0] || (n[0] = (v) => isRef(i) ? i.value = v : null),
101
- n[1] || (n[1] = (v) => o(v))
101
+ n[0] || (n[0] = (h) => isRef(d) ? d.value = h : null),
102
+ n[1] || (n[1] = (h) => l(h))
102
103
  ]
103
104
  }, {
104
105
  default: withCtx(() => [
105
- createVNode(m, {
106
+ createVNode(s, {
106
107
  label: unref(a)("connect.template.rule.time.all_time"),
107
108
  value: "all_time"
108
109
  }, null, 8, ["label"]),
109
- createVNode(m, {
110
+ createVNode(s, {
110
111
  label: unref(a)("connect.template.rule.time.custom"),
111
112
  value: "custom"
112
113
  }, null, 8, ["label"])
113
114
  ]),
114
115
  _: 1
115
116
  }, 8, ["modelValue"]),
116
- unref(i) == "custom" ? (openBlock(), createBlock(_sfc_main$j, {
117
+ unref(d) == "custom" ? (openBlock(), createBlock(_sfc_main$j, {
117
118
  key: 0,
118
119
  class: "!mt-[0px]",
119
120
  "include-only": "trigger",
120
121
  "trigger-type": "SCHEDULE",
121
- "model-value": ((y = e.modelValue) == null ? void 0 : y.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
122
- "onUpdate:modelValue": n[2] || (n[2] = (v) => u(
122
+ "model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
123
+ "onUpdate:modelValue": n[2] || (n[2] = (h) => u(
123
124
  "update:model-value",
124
125
  unref(RuleBuilder).setRuleToGroup(
125
126
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
126
- v,
127
+ h,
127
128
  "&&"
128
129
  )
129
130
  ))
@@ -139,29 +140,29 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
139
140
  }
140
141
  },
141
142
  emits: ["update:model-value"],
142
- setup(e, { emit: d }) {
143
- const a = e, s = d, u = computed(() => {
144
- const { property: i, operator: o, equator: l } = RuleBuilder.simplify(
143
+ setup(e, { emit: m }) {
144
+ const a = e, i = m, u = computed(() => {
145
+ const { property: d, operator: l, equator: o } = RuleBuilder.simplify(
145
146
  a.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
146
147
  op: "before",
147
148
  x: 1
148
149
  })
149
150
  );
150
151
  return {
151
- property: i,
152
- operator: o,
153
- equator: l
152
+ property: d,
153
+ operator: l,
154
+ equator: o
154
155
  };
155
156
  });
156
- return (i, o) => {
157
- const l = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
157
+ return (d, l) => {
158
+ const o = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
158
159
  return openBlock(), createElementBlock("div", null, [
159
- createVNode(l, {
160
+ createVNode(o, {
160
161
  label: "On birthday",
161
162
  value: "_isRange-day",
162
163
  "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
163
- "onUpdate:modelValue": o[0] || (o[0] = () => {
164
- s(
164
+ "onUpdate:modelValue": l[0] || (l[0] = () => {
165
+ i(
165
166
  "update:model-value",
166
167
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
167
168
  op: "this",
@@ -171,12 +172,12 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
171
172
  );
172
173
  })
173
174
  }, null, 8, ["model-value"]),
174
- createVNode(l, {
175
+ createVNode(o, {
175
176
  label: "N days before birthday",
176
177
  value: "_isDay",
177
178
  "model-value": unref(u).operator,
178
- "onUpdate:modelValue": o[1] || (o[1] = () => {
179
- s(
179
+ "onUpdate:modelValue": l[1] || (l[1] = () => {
180
+ i(
180
181
  "update:model-value",
181
182
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
182
183
  op: "after",
@@ -191,21 +192,21 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
191
192
  label: "Days before birthday",
192
193
  "show-steppers": !1,
193
194
  "model-value": unref(u).equator.x,
194
- "onUpdate:modelValue": o[2] || (o[2] = (m) => s(
195
+ "onUpdate:modelValue": l[2] || (l[2] = (s) => i(
195
196
  "update:model-value",
196
197
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
197
198
  op: "after",
198
- x: m,
199
+ x: s,
199
200
  ignoreYear: !0
200
201
  })
201
202
  ))
202
203
  }, null, 8, ["model-value"])) : createCommentVNode("", !0),
203
- createVNode(l, {
204
+ createVNode(o, {
204
205
  label: "In birthday week",
205
206
  value: "_isRange-week",
206
207
  "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
207
- "onUpdate:modelValue": o[3] || (o[3] = () => {
208
- s(
208
+ "onUpdate:modelValue": l[3] || (l[3] = () => {
209
+ i(
209
210
  "update:model-value",
210
211
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
211
212
  op: "this",
@@ -215,12 +216,12 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
215
216
  );
216
217
  })
217
218
  }, null, 8, ["model-value"]),
218
- createVNode(l, {
219
+ createVNode(o, {
219
220
  label: "In birthday month",
220
221
  value: "_isRange-month",
221
222
  "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
222
- "onUpdate:modelValue": o[4] || (o[4] = () => {
223
- s(
223
+ "onUpdate:modelValue": l[4] || (l[4] = () => {
224
+ i(
224
225
  "update:model-value",
225
226
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
226
227
  op: "this",
@@ -249,16 +250,16 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
249
250
  }
250
251
  },
251
252
  emits: ["update:model-value"],
252
- setup(e, { emit: d }) {
253
- const a = e, s = d, u = computed(() => a.disabled ? TypeToTriggerOptions[a.campaignType].filter(
254
- (i) => i.value == a.modelValue
253
+ setup(e, { emit: m }) {
254
+ const a = e, i = m, u = computed(() => a.disabled ? TypeToTriggerOptions[a.campaignType].filter(
255
+ (d) => d.value == a.modelValue
255
256
  ) : TypeToTriggerOptions[a.campaignType]);
256
- return (i, o) => {
257
- const l = resolveComponent("FmCard");
257
+ return (d, l) => {
258
+ const o = resolveComponent("FmCard");
258
259
  return openBlock(), createElementBlock("div", _hoisted_1$f, [
259
- o[0] || (o[0] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1)),
260
+ l[0] || (l[0] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1)),
260
261
  createElementVNode("div", _hoisted_2$c, [
261
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(l, {
262
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
262
263
  variant: "outlined",
263
264
  disabled: a.disabled,
264
265
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
@@ -267,7 +268,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
267
268
  "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
268
269
  }]),
269
270
  onClick: () => {
270
- a.modelValue != n.value && !a.disabled && s("update:model-value", n.value);
271
+ a.modelValue != n.value && !a.disabled && i("update:model-value", n.value);
271
272
  },
272
273
  key: n.name
273
274
  }, {
@@ -294,27 +295,27 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
294
295
  }
295
296
  },
296
297
  emits: ["update:model-value"],
297
- setup(e, { emit: d }) {
298
- const a = d;
299
- return (s, u) => {
300
- const i = resolveComponent("FmButton"), o = resolveComponent("FmField"), l = resolveComponent("FmDatePicker");
301
- return openBlock(), createBlock(l, {
298
+ setup(e, { emit: m }) {
299
+ const a = m;
300
+ return (i, u) => {
301
+ const d = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
302
+ return openBlock(), createBlock(o, {
302
303
  label: e.label,
303
304
  "model-value": e.modelValue || "",
304
305
  "onUpdate:modelValue": u[1] || (u[1] = (n) => a("update:model-value", n))
305
306
  }, {
306
307
  "trigger-button": withCtx(({ opened: n }) => [
307
- createVNode(o, {
308
+ createVNode(l, {
308
309
  class: "flex items-center",
309
310
  "prepend-icon": "calendar_month",
310
311
  "icon-outlined": !n
311
312
  }, {
312
313
  append: withCtx(() => [
313
- e.modelValue ? (openBlock(), createBlock(i, {
314
+ e.modelValue ? (openBlock(), createBlock(d, {
314
315
  key: 0,
315
316
  variant: "tertiary",
316
317
  icon: "clear",
317
- onClick: u[0] || (u[0] = (m) => (m.stopPropagation(), a("update:model-value", null)))
318
+ onClick: u[0] || (u[0] = (s) => (s.stopPropagation(), a("update:model-value", null)))
318
319
  })) : createCommentVNode("", !0)
319
320
  ]),
320
321
  default: withCtx(() => [
@@ -338,19 +339,19 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
338
339
  }
339
340
  },
340
341
  emits: ["update:model-value"],
341
- setup(e, { emit: d }) {
342
- const a = d;
343
- return (s, u) => {
344
- var i, o;
342
+ setup(e, { emit: m }) {
343
+ const a = m;
344
+ return (i, u) => {
345
+ var d, l;
345
346
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
346
347
  createElementVNode("div", _hoisted_2$b, [
347
348
  createVNode(_sfc_main$f, {
348
- "model-value": ((i = e.modelValue) == null ? void 0 : i.startDate) ?? null,
349
+ "model-value": ((d = e.modelValue) == null ? void 0 : d.startDate) ?? null,
349
350
  label: "Start date",
350
- "onUpdate:modelValue": u[0] || (u[0] = (l) => {
351
+ "onUpdate:modelValue": u[0] || (u[0] = (o) => {
351
352
  var n;
352
353
  return a("update:model-value", {
353
- startDate: l,
354
+ startDate: o,
354
355
  endDate: ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null
355
356
  });
356
357
  })
@@ -359,13 +360,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
359
360
  u[2] || (u[2] = createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1)),
360
361
  createElementVNode("div", _hoisted_3$9, [
361
362
  createVNode(_sfc_main$f, {
362
- "model-value": ((o = e.modelValue) == null ? void 0 : o.endDate) ?? null,
363
+ "model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
363
364
  label: "End date",
364
- "onUpdate:modelValue": u[1] || (u[1] = (l) => {
365
+ "onUpdate:modelValue": u[1] || (u[1] = (o) => {
365
366
  var n;
366
367
  return a("update:model-value", {
367
368
  startDate: ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
368
- endDate: l
369
+ endDate: o
369
370
  });
370
371
  })
371
372
  }, null, 8, ["model-value"])
@@ -391,25 +392,27 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
391
392
  }
392
393
  },
393
394
  emits: ["update:model-value"],
394
- setup(e, { emit: d }) {
395
- const a = e, s = d;
396
- function u() {
397
- const y = RuleBuilder.getRules(a.modelValue);
398
- return y.length == 0 ? "fixed" : y.some(
399
- (v) => isRuleEntry(v) && RuleBuilder.simplify(v).operator == "_rrule"
395
+ setup(e, { emit: m }) {
396
+ const a = e, i = m, u = useCoreStore(), d = computed(
397
+ () => CountryTimezone[u.currentCountry.value || "MY"]
398
+ );
399
+ function l() {
400
+ const g = RuleBuilder.getRules(a.modelValue);
401
+ return g.length == 0 ? "fixed" : g.some(
402
+ (c) => isRuleEntry(c) && RuleBuilder.simplify(c).operator == "_rrule"
400
403
  ) ? "repeating" : "fixed";
401
404
  }
402
- const i = ref(u()), o = ref(!1), l = computed(() => {
403
- const y = RuleBuilder.getRules(a.modelValue), v = y.find(
404
- (f) => isRuleEntry(f) && RuleBuilder.simplify(f).property == "trigger.date"
405
- ), h = y.find(
406
- (f) => isRuleEntry(f) && RuleBuilder.simplify(f).property == "trigger.time"
405
+ const o = ref(l()), n = ref(!1), s = computed(() => {
406
+ const g = RuleBuilder.getRules(a.modelValue), c = g.find(
407
+ (p) => isRuleEntry(p) && RuleBuilder.simplify(p).property == "trigger.date"
408
+ ), r = g.find(
409
+ (p) => isRuleEntry(p) && RuleBuilder.simplify(p).property == "trigger.time"
407
410
  );
408
411
  return {
409
- date: v ? RuleBuilder.simplify(v).equator : null,
410
- time: h ? RuleBuilder.simplify(h).equator : null
412
+ date: c ? RuleBuilder.simplify(c).equator : null,
413
+ time: r ? RuleBuilder.simplify(r).equator : null
411
414
  };
412
- }), n = computed(
415
+ }), y = computed(
413
416
  () => calculateNextScheduleAt(
414
417
  a.modelValue,
415
418
  /* @__PURE__ */ new Date(),
@@ -417,8 +420,8 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
417
420
  a.endDate ? new Date(a.endDate) : void 0
418
421
  )
419
422
  );
420
- function m(y) {
421
- const v = y.label.toLowerCase(), h = v == "fixed" ? [
423
+ function v(g) {
424
+ const c = g.label.toLowerCase(), r = c == "fixed" ? [
422
425
  RuleBuilder.constructEntry(
423
426
  "trigger.date",
424
427
  "_isOnDate",
@@ -433,73 +436,73 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
433
436
  ),
434
437
  RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
435
438
  ];
436
- s(
439
+ i(
437
440
  "update:model-value",
438
441
  RuleBuilder.setRuleToGroup(
439
442
  RuleBuilder.scaffoldGroup("g_schedule"),
440
- h
443
+ r
441
444
  )
442
- ), i.value = v;
445
+ ), o.value = c;
443
446
  }
444
- function g(y) {
445
- i.value == "fixed" ? s(
447
+ function h(g) {
448
+ o.value == "fixed" ? i(
446
449
  "update:model-value",
447
450
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
448
451
  RuleBuilder.constructEntry(
449
452
  "trigger.date",
450
453
  "_isOnDate",
451
- y.date
454
+ g.date
452
455
  ),
453
456
  RuleBuilder.constructEntry(
454
457
  "trigger.time",
455
458
  "_isOnTime",
456
- y.time
459
+ g.time
457
460
  )
458
461
  ])
459
- ) : s(
462
+ ) : i(
460
463
  "update:model-value",
461
464
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
462
465
  RuleBuilder.constructEntry(
463
466
  "trigger.date",
464
467
  "_rrule",
465
- y.date
468
+ g.date
466
469
  ),
467
470
  RuleBuilder.constructEntry(
468
471
  "trigger.time",
469
472
  "_isOnTime",
470
- y.time
473
+ g.time
471
474
  )
472
475
  ])
473
476
  );
474
477
  }
475
- return (y, v) => {
476
- const h = resolveComponent("FmButtonGroup"), f = resolveComponent("FmTimePicker"), r = resolveComponent("FmIcon"), c = resolveComponent("FmTooltip"), p = resolveComponent("FmField"), b = resolveComponent("FmCard"), x = resolveComponent("FmPopover"), k = resolveComponent("FmDatePicker"), C = resolveComponent("FmHelperText");
478
+ return (g, c) => {
479
+ const r = resolveComponent("FmButtonGroup"), p = resolveComponent("FmTimePicker"), f = resolveComponent("FmIcon"), b = resolveComponent("FmTooltip"), C = resolveComponent("FmField"), V = resolveComponent("FmCard"), x = resolveComponent("FmPopover"), R = resolveComponent("FmDatePicker"), k = resolveComponent("FmHelperText");
477
480
  return openBlock(), createElementBlock(Fragment, null, [
478
- createVNode(h, {
481
+ createVNode(r, {
479
482
  items: [{ label: "Fixed" }, { label: "Repeating" }],
480
- "model-value": { label: unref(cases).title(unref(i)) },
481
- "onUpdate:modelValue": m,
483
+ "model-value": { label: unref(cases).title(unref(o)) },
484
+ "onUpdate:modelValue": v,
482
485
  class: "mb-8"
483
486
  }, null, 8, ["model-value"]),
484
487
  createElementVNode("div", _hoisted_1$d, [
485
488
  createElementVNode("div", _hoisted_2$a, [
486
- createVNode(f, {
489
+ createVNode(p, {
487
490
  label: "Notify time",
488
- "model-value": unref(l).time,
489
- "onUpdate:modelValue": v[0] || (v[0] = (B) => g({ date: unref(l).date, time: B })),
490
- "helper-text": unref(l).time ? void 0 : "Time is required",
491
- "helper-state": unref(l).time ? void 0 : "error"
491
+ "model-value": unref(s).time,
492
+ "onUpdate:modelValue": c[0] || (c[0] = (B) => h({ date: unref(s).date, time: B })),
493
+ "helper-text": unref(s).time ? void 0 : "Time is required",
494
+ "helper-state": unref(s).time ? void 0 : "error"
492
495
  }, null, 8, ["model-value", "helper-text", "helper-state"]),
493
- unref(i) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$8, [
496
+ unref(o) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$8, [
494
497
  createElementVNode("div", _hoisted_4$6, [
495
- v[5] || (v[5] = createElementVNode("div", null, "Notify date", -1)),
496
- unref(l).date ? (openBlock(), createBlock(c, {
498
+ c[5] || (c[5] = createElementVNode("div", null, "Notify date", -1)),
499
+ unref(s).date ? (openBlock(), createBlock(b, {
497
500
  key: 0,
498
501
  "z-index": 9999,
499
- content: unref(SummarizeRrule)(unref(RRule).fromString(unref(l).date).options)
502
+ content: unref(SummarizeRrule)(unref(RRule).fromString(unref(s).date).options)
500
503
  }, {
501
504
  default: withCtx(() => [
502
- createVNode(r, {
505
+ createVNode(f, {
503
506
  name: "info",
504
507
  size: "sm",
505
508
  outline: !0
@@ -509,29 +512,29 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
509
512
  }, 8, ["content"])) : createCommentVNode("", !0)
510
513
  ]),
511
514
  createVNode(x, {
512
- "show-popover": unref(o),
513
- onPopoverChanged: v[3] || (v[3] = (B) => o.value = B)
515
+ "show-popover": unref(n),
516
+ onPopoverChanged: c[3] || (c[3] = (B) => n.value = B)
514
517
  }, {
515
518
  "popover-button": withCtx(() => [
516
- createVNode(p, {
519
+ createVNode(C, {
517
520
  class: "cursor-pointer",
518
- "helper-text": unref(l).date ? void 0 : "Date is required",
519
- "helper-state": unref(l).date ? void 0 : "error"
521
+ "helper-text": unref(s).date ? void 0 : "Date is required",
522
+ "helper-state": unref(s).date ? void 0 : "error"
520
523
  }, {
521
524
  default: withCtx(() => [
522
- createElementVNode("div", _hoisted_5$3, toDisplayString(unref(l).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(l).date).options) : "Set a repeating date"), 1)
525
+ createElementVNode("div", _hoisted_5$3, toDisplayString(unref(s).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(s).date).options) : "Set a repeating date"), 1)
523
526
  ]),
524
527
  _: 1
525
528
  }, 8, ["helper-text", "helper-state"])
526
529
  ]),
527
530
  default: withCtx(() => [
528
- createVNode(b, { class: "elevated p-8 w-[450px]" }, {
531
+ createVNode(V, { class: "elevated p-8 w-[450px]" }, {
529
532
  default: withCtx(() => [
530
533
  createVNode(_sfc_main$k, {
531
534
  "apply-button": !0,
532
- "model-value": unref(l).date || "",
533
- onCancel: v[1] || (v[1] = (B) => o.value = !1),
534
- "onUpdate:modelValue": v[2] || (v[2] = (B) => (g({ date: B, time: unref(l).time }), o.value = !1))
535
+ "model-value": unref(s).date || "",
536
+ onCancel: c[1] || (c[1] = (B) => n.value = !1),
537
+ "onUpdate:modelValue": c[2] || (c[2] = (B) => (h({ date: B, time: unref(s).time }), n.value = !1))
535
538
  }, null, 8, ["model-value"])
536
539
  ]),
537
540
  _: 1
@@ -539,19 +542,19 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
539
542
  ]),
540
543
  _: 1
541
544
  }, 8, ["show-popover"])
542
- ])) : (openBlock(), createBlock(k, {
545
+ ])) : (openBlock(), createBlock(R, {
543
546
  key: 1,
544
547
  label: "Notify date",
545
- "model-value": unref(l).date || "",
546
- "onUpdate:modelValue": v[4] || (v[4] = (B) => g({ date: B, time: unref(l).time })),
547
- "helper-text": unref(l).date ? void 0 : "Date is required",
548
- "helper-state": unref(l).date ? void 0 : "error"
548
+ "model-value": unref(s).date || "",
549
+ "onUpdate:modelValue": c[4] || (c[4] = (B) => h({ date: B, time: unref(s).time })),
550
+ "helper-text": unref(s).date ? void 0 : "Date is required",
551
+ "helper-state": unref(s).date ? void 0 : "error"
549
552
  }, null, 8, ["model-value", "helper-text", "helper-state"]))
550
553
  ]),
551
- unref(l).date && unref(l).time && unref(n) ? (openBlock(), createBlock(C, {
554
+ unref(s).date && unref(s).time && unref(y) ? (openBlock(), createBlock(k, {
552
555
  key: 0,
553
- text: `${unref(hooks)(unref(n)).isAfter(unref(hooks)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(hooks)(unref(n)).format("dddd, DD MMM YYYY")} at
554
- ${unref(hooks)(unref(n)).format("hh:mmA")} (${unref(hooks)(unref(n)).fromNow()})`
556
+ text: `${unref(moment)(unref(y)).isAfter(unref(moment)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(moment)(unref(y)).format("dddd, DD MMM YYYY")} at
557
+ ${unref(moment)(unref(y)).format("hh:mmA")}(UTC${unref(moment).tz(unref(d)).format("Z")}) (${unref(moment)(unref(y)).fromNow()})`
555
558
  }, null, 8, ["text"])) : createCommentVNode("", !0)
556
559
  ])
557
560
  ], 64);
@@ -565,8 +568,8 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
565
568
  }
566
569
  },
567
570
  emits: ["update:model-value"],
568
- setup(e, { emit: d }) {
569
- const a = e, s = d, u = computed(
571
+ setup(e, { emit: m }) {
572
+ const a = e, i = m, u = computed(
570
573
  () => [
571
574
  {
572
575
  label: "Fortune Wheel",
@@ -580,14 +583,14 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
580
583
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
581
584
  hidden: !0
582
585
  }
583
- ].filter((i) => !i.hidden)
586
+ ].filter((d) => !d.hidden)
584
587
  );
585
- return (i, o) => {
586
- const l = resolveComponent("FmCard");
588
+ return (d, l) => {
589
+ const o = resolveComponent("FmCard");
587
590
  return openBlock(), createElementBlock("div", _hoisted_1$c, [
588
- o[0] || (o[0] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1)),
591
+ l[0] || (l[0] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1)),
589
592
  createElementVNode("div", _hoisted_2$9, [
590
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(l, {
593
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
591
594
  variant: "outlined",
592
595
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
593
596
  "col-span-2": unref(u).length == 1,
@@ -595,7 +598,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
595
598
  "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
596
599
  }]),
597
600
  onClick: () => {
598
- a.modelValue != n.value && s("update:model-value", n.value);
601
+ a.modelValue != n.value && i("update:model-value", n.value);
599
602
  },
600
603
  key: n.value
601
604
  }, {
@@ -615,48 +618,48 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
615
618
  }, _hoisted_2$8 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
616
619
  __name: "EditRewardPoolSheet",
617
620
  emits: ["update:model-value"],
618
- setup(e, { expose: d, emit: a }) {
619
- const s = useMembershipStore(), { minor: u } = useLoading, i = ref(!1), o = ref(), l = ref(), n = ref(0), m = computed(() => {
621
+ setup(e, { expose: m, emit: a }) {
622
+ const i = useMembershipStore(), { minor: u } = useLoading, d = ref(!1), l = ref(), o = ref(), n = ref(0), s = computed(() => {
620
623
  var r;
621
- return ((r = s.loyaltyRewards.items.find(
622
- (c) => {
623
- var p;
624
- return c.value === ((p = o.value) == null ? void 0 : p.collectible);
624
+ return ((r = i.loyaltyRewards.items.find(
625
+ (p) => {
626
+ var f;
627
+ return p.value === ((f = l.value) == null ? void 0 : f.collectible);
625
628
  }
626
629
  )) == null ? void 0 : r.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
627
- }), g = computed(() => {
628
- const f = m.value.safeParse(o.value);
629
- return f.success ? [] : f.error.errors;
630
+ }), y = computed(() => {
631
+ const c = s.value.safeParse(l.value);
632
+ return c.success ? [] : c.error.errors;
630
633
  });
631
- function y(f, r, c) {
632
- f && (o.value = r, n.value = c), i.value = f;
634
+ function v(c, r, p) {
635
+ c && (l.value = r, n.value = p), d.value = c;
633
636
  }
634
- const v = a;
635
- async function h() {
636
- const f = m.value.safeParse(o.value);
637
- f.success && (await u(
637
+ const h = a;
638
+ async function g() {
639
+ const c = s.value.safeParse(l.value);
640
+ c.success && (await u(
638
641
  async () => {
639
- f.data.type === "VOUCHER" && l.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
640
- f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, l.value),
641
- l.value
642
+ c.data.type === "VOUCHER" && o.value && (c.data.collectibleConfig.image = await firebaseStorage.update(
643
+ c.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, o.value),
644
+ o.value
642
645
  ));
643
646
  },
644
647
  {
645
648
  message: "Uploading reward image",
646
649
  successMessage: "Reward image updated"
647
650
  }
648
- ), v("update:model-value", f.data, n.value));
651
+ ), h("update:model-value", c.data, n.value));
649
652
  }
650
- return d({
651
- showSheet: y
652
- }), (f, r) => {
653
- const c = resolveComponent("FmSelect"), p = resolveComponent("FmStepperField"), b = resolveComponent("FmButton"), x = resolveComponent("FmSideSheet");
654
- return openBlock(), createBlock(x, {
653
+ return m({
654
+ showSheet: v
655
+ }), (c, r) => {
656
+ const p = resolveComponent("FmSelect"), f = resolveComponent("FmStepperField"), b = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
657
+ return openBlock(), createBlock(C, {
655
658
  "max-width": 560,
656
- modelValue: unref(i),
659
+ modelValue: unref(d),
657
660
  "onUpdate:modelValue": [
658
- r[9] || (r[9] = (k) => isRef(i) ? i.value = k : null),
659
- r[10] || (r[10] = (k) => i.value = k)
661
+ r[9] || (r[9] = (V) => isRef(d) ? d.value = V : null),
662
+ r[10] || (r[10] = (V) => d.value = V)
660
663
  ],
661
664
  header: "Edit reward",
662
665
  "dismiss-away": ""
@@ -666,36 +669,36 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
666
669
  createVNode(b, {
667
670
  variant: "primary",
668
671
  type: "button",
669
- disabled: unref(g).length > 0,
672
+ disabled: unref(y).length > 0,
670
673
  label: "Confirm",
671
- onClick: r[7] || (r[7] = (k) => h())
674
+ onClick: r[7] || (r[7] = (V) => g())
672
675
  }, null, 8, ["disabled"]),
673
676
  createVNode(b, {
674
677
  variant: "secondary",
675
678
  type: "button",
676
679
  label: "Cancel",
677
- onClick: r[8] || (r[8] = (k) => i.value = !1)
680
+ onClick: r[8] || (r[8] = (V) => d.value = !1)
678
681
  })
679
682
  ])
680
683
  ]),
681
684
  default: withCtx(() => {
682
- var k, C, B;
685
+ var V, x, R;
683
686
  return [
684
- unref(o) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
685
- createVNode(c, {
687
+ unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
688
+ createVNode(p, {
686
689
  label: "Reward Type",
687
690
  items: [
688
691
  { label: "No Reward", value: "NO_REWARD" },
689
692
  { label: "Voucher", value: "VOUCHER" },
690
693
  { label: "Loyalty", value: "LOYALTY" }
691
694
  ],
692
- "model-value": unref(o).type,
693
- "onUpdate:modelValue": r[0] || (r[0] = (V) => {
694
- V == "NO_REWARD" ? o.value = {
695
+ "model-value": unref(l).type,
696
+ "onUpdate:modelValue": r[0] || (r[0] = (k) => {
697
+ k == "NO_REWARD" ? l.value = {
695
698
  type: "NO_REWARD",
696
699
  collectible: null,
697
700
  weight: 1
698
- } : V === "VOUCHER" ? o.value = {
701
+ } : k === "VOUCHER" ? l.value = {
699
702
  collectible: null,
700
703
  type: "VOUCHER",
701
704
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -709,8 +712,8 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
709
712
  validForDay: 7
710
713
  },
711
714
  weight: 1
712
- } : o.value = {
713
- collectible: unref(s).loyaltyRewards.raw[0]._id,
715
+ } : l.value = {
716
+ collectible: unref(i).loyaltyRewards.raw[0]._id,
714
717
  type: "LOYALTY",
715
718
  earningOption: {
716
719
  amount: 1,
@@ -723,75 +726,75 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
723
726
  };
724
727
  })
725
728
  }, null, 8, ["model-value"]),
726
- unref(o).type == "LOYALTY" ? (openBlock(), createBlock(c, {
729
+ unref(l).type == "LOYALTY" ? (openBlock(), createBlock(p, {
727
730
  key: 0,
728
731
  label: "Loyalty type",
729
- rules: [unref(ZodHelper).ruleAtPath(unref(m), "collectible", [unref(o).type])],
730
- items: unref(s).loyaltyRewards.items,
731
- "model-value": unref(o).collectible,
732
- "onUpdate:modelValue": r[1] || (r[1] = (V) => unref(o).collectible = V)
732
+ rules: [unref(ZodHelper).ruleAtPath(unref(s), "collectible", [unref(l).type])],
733
+ items: unref(i).loyaltyRewards.items,
734
+ "model-value": unref(l).collectible,
735
+ "onUpdate:modelValue": r[1] || (r[1] = (k) => unref(l).collectible = k)
733
736
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
734
- createVNode(p, {
737
+ createVNode(f, {
735
738
  label: "Weight",
736
- rules: [unref(ZodHelper).ruleAtPath(unref(m), "weight", [unref(o).type])],
737
- "model-value": unref(o).weight,
738
- "onUpdate:modelValue": r[2] || (r[2] = (V) => o.value = {
739
- ...unref(o),
740
- weight: V
739
+ rules: [unref(ZodHelper).ruleAtPath(unref(s), "weight", [unref(l).type])],
740
+ "model-value": unref(l).weight,
741
+ "onUpdate:modelValue": r[2] || (r[2] = (k) => l.value = {
742
+ ...unref(l),
743
+ weight: k
741
744
  })
742
745
  }, null, 8, ["rules", "model-value"]),
743
- unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
744
- ((k = unref(s).loyaltyRewards.items.find(
745
- (V) => {
746
- var R;
747
- return V.value === ((R = unref(o)) == null ? void 0 : R.collectible);
746
+ unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
747
+ ((V = unref(i).loyaltyRewards.items.find(
748
+ (k) => {
749
+ var B;
750
+ return k.value === ((B = unref(l)) == null ? void 0 : B.collectible);
748
751
  }
749
- )) == null ? void 0 : k.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
752
+ )) == null ? void 0 : V.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
750
753
  r[11] || (r[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
751
754
  createVNode(_sfc_main$l, {
752
755
  class: "mt-[-8px]",
753
756
  rules: [
754
- unref(ZodHelper).ruleAtPath(unref(m), "earningOption", [unref(o).type])
757
+ unref(ZodHelper).ruleAtPath(unref(s), "earningOption", [unref(l).type])
755
758
  ],
756
- "helper-state": unref(ZodHelper).helperState(unref(g), "earningOption"),
757
- "error-text": unref(ZodHelper).helperText(unref(g), "earningOption"),
759
+ "helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
760
+ "error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
758
761
  "fixed-type": !0,
759
- "model-value": unref(o).earningOption,
760
- "onUpdate:modelValue": r[3] || (r[3] = (V) => o.value = {
761
- ...unref(o),
762
- earningOption: V
762
+ "model-value": unref(l).earningOption,
763
+ "onUpdate:modelValue": r[3] || (r[3] = (k) => l.value = {
764
+ ...unref(l),
765
+ earningOption: k
763
766
  })
764
767
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"])
765
768
  ], 64)) : createCommentVNode("", !0),
766
769
  r[12] || (r[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
767
770
  createVNode(_sfc_main$m, {
768
- type: unref(o).type === "LOYALTY" ? "custom" : "range",
769
- "for-credit": unref(o).type === "LOYALTY" && ((C = unref(s).loyaltyRewards.items.find(
770
- (V) => {
771
- var R;
772
- return V.value === ((R = unref(o)) == null ? void 0 : R.collectible);
771
+ type: unref(l).type === "LOYALTY" ? "custom" : "range",
772
+ "for-credit": unref(l).type === "LOYALTY" && ((x = unref(i).loyaltyRewards.items.find(
773
+ (k) => {
774
+ var B;
775
+ return k.value === ((B = unref(l)) == null ? void 0 : B.collectible);
773
776
  }
774
- )) == null ? void 0 : C.raw.type) === "CREDIT",
777
+ )) == null ? void 0 : x.raw.type) === "CREDIT",
775
778
  class: "!gap-24",
776
- rules: [unref(ZodHelper).ruleAtPath(unref(m), "validityOption", [unref(o).type])],
777
- "model-value": unref(o).validityOption,
778
- "onUpdate:modelValue": r[4] || (r[4] = (V) => o.value = {
779
- ...unref(o),
780
- validityOption: V
779
+ rules: [unref(ZodHelper).ruleAtPath(unref(s), "validityOption", [unref(l).type])],
780
+ "model-value": unref(l).validityOption,
781
+ "onUpdate:modelValue": r[4] || (r[4] = (k) => l.value = {
782
+ ...unref(l),
783
+ validityOption: k
781
784
  })
782
785
  }, null, 8, ["type", "for-credit", "rules", "model-value"])
783
786
  ], 64)) : createCommentVNode("", !0),
784
- unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
787
+ unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
785
788
  key: 2,
786
- "reward-image": unref(l),
787
- "model-value": ((B = unref(o)) == null ? void 0 : B.collectibleConfig) ?? void 0,
788
- "onUpdate:modelValue": r[5] || (r[5] = (V) => o.value = {
789
- ...unref(o),
790
- collectibleConfig: V
789
+ "reward-image": unref(o),
790
+ "model-value": ((R = unref(l)) == null ? void 0 : R.collectibleConfig) ?? void 0,
791
+ "onUpdate:modelValue": r[5] || (r[5] = (k) => l.value = {
792
+ ...unref(l),
793
+ collectibleConfig: k
791
794
  }),
792
- "onUpdate:rewardImage": r[6] || (r[6] = (V) => l.value = V)
795
+ "onUpdate:rewardImage": r[6] || (r[6] = (k) => o.value = k)
793
796
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
794
- createVNode(JsonViewer, { json: unref(g) }, null, 8, ["json"])
797
+ createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
795
798
  ])) : createCommentVNode("", !0)
796
799
  ];
797
800
  }),
@@ -818,87 +821,87 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
818
821
  }
819
822
  },
820
823
  emits: ["update:model-value"],
821
- setup(e, { emit: d }) {
822
- const a = e, s = d, u = useMembershipStore(), i = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => a.modelValue ?? []), l = computed(() => {
823
- const f = i.safeParse(o.value);
824
- return f.success ? [] : f.error.errors;
824
+ setup(e, { emit: m }) {
825
+ const a = e, i = m, u = useMembershipStore(), d = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => a.modelValue ?? []), o = computed(() => {
826
+ const c = d.safeParse(l.value);
827
+ return c.success ? [] : c.error.errors;
825
828
  }), n = ref();
826
- function m(f, r) {
827
- var p;
828
- const c = [...o.value];
829
- c[r] = f, (p = n.value) == null || p.showSheet(!1), s("update:model-value", c);
829
+ function s(c, r) {
830
+ var f;
831
+ const p = [...l.value];
832
+ p[r] = c, (f = n.value) == null || f.showSheet(!1), i("update:model-value", p);
830
833
  }
831
- function g(f) {
832
- const r = f.type == "VOUCHER" ? f.collectibleConfig : u.collectibles.find(
833
- (b) => b._id.toString() == f.collectible
834
- ), c = CollectionUtils.formattedType((r == null ? void 0 : r.name) || ""), p = f.weight;
834
+ function y(c) {
835
+ const r = c.type == "VOUCHER" ? c.collectibleConfig : u.collectibles.find(
836
+ (b) => b._id.toString() == c.collectible
837
+ ), p = CollectionUtils.formattedType((r == null ? void 0 : r.name) || ""), f = c.weight;
835
838
  return {
836
- label: isNullOrEmpty(c) ? "NO REWARD" : c,
837
- sublabel: `${p} (${(p / o.value.reduce((b, x) => b + x.weight, 0) * 100).toFixed(2)}%)`
839
+ label: isNullOrEmpty(p) ? "NO REWARD" : p,
840
+ sublabel: `${f} (${(f / l.value.reduce((b, C) => b + C.weight, 0) * 100).toFixed(2)}%)`
838
841
  };
839
842
  }
840
- function y(f) {
841
- var c;
842
- const r = [...o.value];
843
- (c = n.value) == null || c.showSheet(!0, r[f], f);
843
+ function v(c) {
844
+ var p;
845
+ const r = [...l.value];
846
+ (p = n.value) == null || p.showSheet(!0, r[c], c);
844
847
  }
845
- function v(f) {
846
- const r = [...o.value];
847
- r.splice(f, 1), s("update:model-value", r);
848
+ function h(c) {
849
+ const r = [...l.value];
850
+ r.splice(c, 1), i("update:model-value", r);
848
851
  }
849
- function h() {
850
- var f;
851
- (f = n.value) == null || f.showSheet(
852
+ function g() {
853
+ var c;
854
+ (c = n.value) == null || c.showSheet(
852
855
  !0,
853
856
  {
854
857
  type: "NO_REWARD",
855
858
  collectible: null,
856
859
  weight: 1
857
860
  },
858
- o.value.length
861
+ l.value.length
859
862
  );
860
863
  }
861
- return (f, r) => {
862
- const c = resolveComponent("FmButton"), p = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
864
+ return (c, r) => {
865
+ const p = resolveComponent("FmButton"), f = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
863
866
  return openBlock(), createElementBlock("div", _hoisted_1$a, [
864
867
  r[1] || (r[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type and weightage given to your customer. ", -1)),
865
- createVNode(c, {
868
+ createVNode(p, {
866
869
  label: "Add Reward",
867
- onClick: r[0] || (r[0] = (x) => h()),
870
+ onClick: r[0] || (r[0] = (C) => g()),
868
871
  variant: "plain",
869
872
  icon: "add"
870
873
  }),
871
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (x, k) => (openBlock(), createBlock(p, {
872
- key: k,
874
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (C, V) => (openBlock(), createBlock(f, {
875
+ key: V,
873
876
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
874
877
  variant: "outlined",
875
- onClick: (C) => y(k)
878
+ onClick: (x) => v(V)
876
879
  }, {
877
880
  default: withCtx(() => {
878
- var C;
881
+ var x;
879
882
  return [
880
883
  createElementVNode("div", null, [
881
- createElementVNode("div", _hoisted_2$7, toDisplayString(x.type == "LOYALTY" ? (C = x == null ? void 0 : x.earningOption) == null ? void 0 : C.amount : "") + " " + toDisplayString(g(x).label), 1),
882
- createElementVNode("div", _hoisted_3$6, toDisplayString(g(x).sublabel), 1)
884
+ createElementVNode("div", _hoisted_2$7, toDisplayString(C.type == "LOYALTY" ? (x = C == null ? void 0 : C.earningOption) == null ? void 0 : x.amount : "") + " " + toDisplayString(y(C).label), 1),
885
+ createElementVNode("div", _hoisted_3$6, toDisplayString(y(C).sublabel), 1)
883
886
  ]),
884
- createVNode(c, {
887
+ createVNode(p, {
885
888
  icon: "delete",
886
889
  variant: "tertiary",
887
- onClick: (B) => (B.stopPropagation(), v(k))
890
+ onClick: (R) => (R.stopPropagation(), h(V))
888
891
  }, null, 8, ["onClick"])
889
892
  ];
890
893
  }),
891
894
  _: 2
892
895
  }, 1032, ["onClick"]))), 128)),
893
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((x) => x.path.join(".") == ""), (x) => (openBlock(), createBlock(b, {
894
- key: x.message,
895
- text: x.message,
896
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((C) => C.path.join(".") == ""), (C) => (openBlock(), createBlock(b, {
897
+ key: C.message,
898
+ text: C.message,
896
899
  state: "error"
897
900
  }, null, 8, ["text"]))), 128)),
898
901
  createVNode(_sfc_main$b, {
899
902
  ref_key: "sheetRef",
900
903
  ref: n,
901
- "onUpdate:modelValue": m
904
+ "onUpdate:modelValue": s
902
905
  }, null, 512)
903
906
  ]);
904
907
  };
@@ -914,48 +917,48 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
914
917
  }
915
918
  },
916
919
  emits: ["update:model-value"],
917
- setup(e, { emit: d }) {
918
- const a = e, s = d, u = computed(() => [
920
+ setup(e, { emit: m }) {
921
+ const a = e, i = m, u = computed(() => [
919
922
  {
920
923
  label: "Rock paper scissor",
921
924
  description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
922
925
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
923
926
  }
924
927
  ]);
925
- return (i, o) => {
926
- var g, y, v;
927
- const l = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), m = resolveComponent("FmHelperText");
928
+ return (d, l) => {
929
+ var y, v, h;
930
+ const o = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), s = resolveComponent("FmHelperText");
928
931
  return openBlock(), createElementBlock("div", _hoisted_1$9, [
929
- createVNode(l, {
932
+ createVNode(o, {
930
933
  label: "Enable game",
931
- "model-value": !!((g = e.modelValue) != null && g.gameType),
932
- "onUpdate:modelValue": o[0] || (o[0] = (h) => h ? s("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : s("update:model-value", null))
934
+ "model-value": !!((y = e.modelValue) != null && y.gameType),
935
+ "onUpdate:modelValue": l[0] || (l[0] = (g) => g ? i("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : i("update:model-value", null))
933
936
  }, null, 8, ["model-value"]),
934
- ((y = e.modelValue) == null ? void 0 : y.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
935
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (h) => {
936
- var f, r;
937
+ ((v = e.modelValue) == null ? void 0 : v.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
938
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (g) => {
939
+ var c, r;
937
940
  return openBlock(), createBlock(n, {
938
941
  variant: "outlined",
939
942
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
940
943
  "col-span-2": unref(u).length == 1,
941
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((f = e.modelValue) == null ? void 0 : f.gameType) == h.value,
942
- "hover:bg-fm-color-opacity-sm": ((r = e.modelValue) == null ? void 0 : r.gameType) != h.value
944
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((c = e.modelValue) == null ? void 0 : c.gameType) == g.value,
945
+ "hover:bg-fm-color-opacity-sm": ((r = e.modelValue) == null ? void 0 : r.gameType) != g.value
943
946
  }]),
944
947
  onClick: () => {
945
- var c;
946
- ((c = a.modelValue) == null ? void 0 : c.gameType) != h.value && s("update:model-value", { gameType: h.value });
948
+ var p;
949
+ ((p = a.modelValue) == null ? void 0 : p.gameType) != g.value && i("update:model-value", { gameType: g.value });
947
950
  },
948
- key: h.value
951
+ key: g.value
949
952
  }, {
950
953
  default: withCtx(() => [
951
- createElementVNode("div", _hoisted_3$5, toDisplayString(h.label), 1),
952
- createElementVNode("div", _hoisted_4$4, toDisplayString(h.description), 1)
954
+ createElementVNode("div", _hoisted_3$5, toDisplayString(g.label), 1),
955
+ createElementVNode("div", _hoisted_4$4, toDisplayString(g.description), 1)
953
956
  ]),
954
957
  _: 2
955
958
  }, 1032, ["class", "onClick"]);
956
959
  }), 128))
957
960
  ])) : createCommentVNode("", !0),
958
- ((v = e.modelValue) == null ? void 0 : v.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(m, {
961
+ ((h = e.modelValue) == null ? void 0 : h.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(s, {
959
962
  key: 1,
960
963
  text: "Rock paper scissors is only available for POS >= 7.7.4 with dual screen on android devices (Sunmi D3 Pro and Sunmi T3 Pro)",
961
964
  state: "warning"
@@ -971,8 +974,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
971
974
  }
972
975
  },
973
976
  emits: ["update:model-value"],
974
- setup(e, { emit: d }) {
975
- const a = e, s = d, u = computed(() => [
977
+ setup(e, { emit: m }) {
978
+ const a = e, i = m, u = computed(() => [
976
979
  {
977
980
  label: "Stamp",
978
981
  description: "Award stamps for purchases, redeemable after reaching set milestones.",
@@ -984,12 +987,12 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
984
987
  value: F_MISSION_TYPE.enum.PROGRESSIVE
985
988
  }
986
989
  ]);
987
- return (i, o) => {
988
- const l = resolveComponent("FmCard");
990
+ return (d, l) => {
991
+ const o = resolveComponent("FmCard");
989
992
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
990
- o[0] || (o[0] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1)),
993
+ l[0] || (l[0] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1)),
991
994
  createElementVNode("div", _hoisted_2$5, [
992
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(l, {
995
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
993
996
  variant: "outlined",
994
997
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
995
998
  "col-span-2": unref(u).length == 1,
@@ -997,7 +1000,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
997
1000
  "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
998
1001
  }]),
999
1002
  onClick: () => {
1000
- a.modelValue != n.value && s("update:model-value", n.value);
1003
+ a.modelValue != n.value && i("update:model-value", n.value);
1001
1004
  },
1002
1005
  key: n.value
1003
1006
  }, {
@@ -1025,16 +1028,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1025
1028
  }
1026
1029
  },
1027
1030
  emits: ["update:model-value"],
1028
- setup(e, { emit: d }) {
1029
- const a = d;
1030
- return (s, u) => {
1031
- const i = resolveComponent("FmStepperField");
1031
+ setup(e, { emit: m }) {
1032
+ const a = m;
1033
+ return (i, u) => {
1034
+ const d = resolveComponent("FmStepperField");
1032
1035
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
1033
1036
  u[1] || (u[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1)),
1034
- createVNode(i, {
1037
+ createVNode(d, {
1035
1038
  label: "Maximum to collect",
1036
1039
  "model-value": e.modelValue || null,
1037
- "onUpdate:modelValue": u[0] || (u[0] = (o) => a("update:model-value", o)),
1040
+ "onUpdate:modelValue": u[0] || (u[0] = (l) => a("update:model-value", l)),
1038
1041
  "helper-text": e.helperText || "Set the threshold required for reward eligibility",
1039
1042
  "helper-state": e.helperState || "none"
1040
1043
  }, null, 8, ["model-value", "helper-text", "helper-state"])
@@ -1050,29 +1053,29 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1050
1053
  }
1051
1054
  },
1052
1055
  emits: ["update:model-value"],
1053
- setup(e, { expose: d, emit: a }) {
1054
- const s = e, u = useMembershipStore(), { minor: i } = useLoading, o = ref(!1), l = ref(), n = ref(), m = ref(0), g = computed(() => {
1055
- var p;
1056
- return ((p = u.loyaltyRewards.items.find(
1056
+ setup(e, { expose: m, emit: a }) {
1057
+ const i = e, u = useMembershipStore(), { minor: d } = useLoading, l = ref(!1), o = ref(), n = ref(), s = ref(0), y = computed(() => {
1058
+ var f;
1059
+ return ((f = u.loyaltyRewards.items.find(
1057
1060
  (b) => {
1058
- var x;
1059
- return b.value === ((x = l.value) == null ? void 0 : x.collectible);
1061
+ var C;
1062
+ return b.value === ((C = o.value) == null ? void 0 : C.collectible);
1060
1063
  }
1061
- )) == null ? void 0 : p.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
1062
- }), y = computed(() => {
1063
- const c = g.value.safeParse(l.value);
1064
- return c.success ? [] : c.error.errors;
1064
+ )) == null ? void 0 : f.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
1065
+ }), v = computed(() => {
1066
+ const p = y.value.safeParse(o.value);
1067
+ return p.success ? [] : p.error.errors;
1065
1068
  });
1066
- function v(c, p, b) {
1067
- c && (l.value = p, m.value = b), o.value = c;
1069
+ function h(p, f, b) {
1070
+ p && (o.value = f, s.value = b), l.value = p;
1068
1071
  }
1069
- const h = a;
1070
- async function f() {
1071
- const c = g.value.safeParse(l.value);
1072
- c.success && (await i(
1072
+ const g = a;
1073
+ async function c() {
1074
+ const p = y.value.safeParse(o.value);
1075
+ p.success && (await d(
1073
1076
  async () => {
1074
- c.data.type === "VOUCHER" && n.value && (c.data.collectibleConfig.image = await firebaseStorage.update(
1075
- c.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
1077
+ p.data.type === "VOUCHER" && n.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
1078
+ p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
1076
1079
  n.value
1077
1080
  ));
1078
1081
  },
@@ -1080,82 +1083,82 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1080
1083
  message: "Uploading reward image",
1081
1084
  successMessage: "Reward image updated"
1082
1085
  }
1083
- ), h("update:model-value", c.data, m.value));
1086
+ ), g("update:model-value", p.data, s.value));
1084
1087
  }
1085
1088
  const r = ref();
1086
- return d({
1087
- showSheet: v
1088
- }), (c, p) => {
1089
- const b = resolveComponent("FmStepperField"), x = resolveComponent("FmSelect"), k = resolveComponent("FmForm"), C = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
1090
- return openBlock(), createBlock(B, {
1089
+ return m({
1090
+ showSheet: h
1091
+ }), (p, f) => {
1092
+ const b = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), V = resolveComponent("FmForm"), x = resolveComponent("FmButton"), R = resolveComponent("FmSideSheet");
1093
+ return openBlock(), createBlock(R, {
1091
1094
  "max-width": 560,
1092
- modelValue: unref(o),
1095
+ modelValue: unref(l),
1093
1096
  "onUpdate:modelValue": [
1094
- p[10] || (p[10] = (V) => isRef(o) ? o.value = V : null),
1095
- p[11] || (p[11] = (V) => o.value = V)
1097
+ f[10] || (f[10] = (k) => isRef(l) ? l.value = k : null),
1098
+ f[11] || (f[11] = (k) => l.value = k)
1096
1099
  ],
1097
1100
  header: "Edit reward",
1098
1101
  "dismiss-away": ""
1099
1102
  }, {
1100
1103
  "side-sheet-footer": withCtx(() => [
1101
1104
  createElementVNode("div", _hoisted_1$6, [
1102
- createVNode(C, {
1105
+ createVNode(x, {
1103
1106
  variant: "primary",
1104
1107
  type: "button",
1105
1108
  label: "Confirm",
1106
- disabled: unref(y).length > 0,
1107
- onClick: p[8] || (p[8] = async () => {
1108
- var V;
1109
- return (V = unref(r)) == null ? void 0 : V.validateInputs();
1109
+ disabled: unref(v).length > 0,
1110
+ onClick: f[8] || (f[8] = async () => {
1111
+ var k;
1112
+ return (k = unref(r)) == null ? void 0 : k.validateInputs();
1110
1113
  })
1111
1114
  }, null, 8, ["disabled"]),
1112
- createVNode(C, {
1115
+ createVNode(x, {
1113
1116
  variant: "secondary",
1114
1117
  type: "button",
1115
1118
  label: "Cancel",
1116
- onClick: p[9] || (p[9] = (V) => o.value = !1)
1119
+ onClick: f[9] || (f[9] = (k) => l.value = !1)
1117
1120
  })
1118
1121
  ])
1119
1122
  ]),
1120
1123
  default: withCtx(() => [
1121
- createVNode(JsonViewer, { json: unref(l) }, null, 8, ["json"]),
1122
- unref(l) ? (openBlock(), createBlock(k, {
1124
+ createVNode(JsonViewer, { json: unref(o) }, null, 8, ["json"]),
1125
+ unref(o) ? (openBlock(), createBlock(V, {
1123
1126
  key: 0,
1124
1127
  class: "flex flex-col gap-y-24",
1125
1128
  ref_key: "formRef",
1126
1129
  ref: r,
1127
- onValidationSuccess: p[7] || (p[7] = (V) => f())
1130
+ onValidationSuccess: f[7] || (f[7] = (k) => c())
1128
1131
  }, {
1129
1132
  default: withCtx(() => {
1130
- var V, R;
1133
+ var k, B;
1131
1134
  return [
1132
- unref(l).type ? (openBlock(), createBlock(b, {
1135
+ unref(o).type ? (openBlock(), createBlock(b, {
1133
1136
  key: 0,
1134
1137
  label: "Threshold",
1135
1138
  rules: [
1136
1139
  unref(ZodHelper).toRule(
1137
1140
  unref(z).number().min(1).max(
1138
- s.maxThreshold,
1139
- `Number cannot be more than ${s.maxThreshold}`
1141
+ i.maxThreshold,
1142
+ `Number cannot be more than ${i.maxThreshold}`
1140
1143
  )
1141
1144
  )
1142
1145
  ],
1143
- "model-value": unref(l).threshold,
1144
- "onUpdate:modelValue": p[0] || (p[0] = (E) => l.value = {
1145
- ...unref(l),
1146
+ "model-value": unref(o).threshold,
1147
+ "onUpdate:modelValue": f[0] || (f[0] = (E) => o.value = {
1148
+ ...unref(o),
1146
1149
  threshold: E
1147
1150
  })
1148
1151
  }, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
1149
- createVNode(x, {
1152
+ createVNode(C, {
1150
1153
  label: "Reward Type",
1151
1154
  items: [
1152
1155
  { label: "Voucher", value: "VOUCHER" },
1153
1156
  { label: "Loyalty", value: "LOYALTY" }
1154
1157
  ],
1155
- "model-value": unref(l).type,
1156
- "onUpdate:modelValue": p[1] || (p[1] = (E) => {
1158
+ "model-value": unref(o).type,
1159
+ "onUpdate:modelValue": f[1] || (f[1] = (E) => {
1157
1160
  var S, w;
1158
- E === "VOUCHER" ? l.value = {
1161
+ E === "VOUCHER" ? o.value = {
1159
1162
  collectible: null,
1160
1163
  type: "VOUCHER",
1161
1164
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1168,8 +1171,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1168
1171
  validityOption: {
1169
1172
  validForDay: 7
1170
1173
  },
1171
- threshold: (S = unref(l)) == null ? void 0 : S.threshold
1172
- } : l.value = {
1174
+ threshold: (S = unref(o)) == null ? void 0 : S.threshold
1175
+ } : o.value = {
1173
1176
  collectible: unref(u).loyaltyRewards.raw[0]._id,
1174
1177
  type: "LOYALTY",
1175
1178
  earningOption: {
@@ -1179,60 +1182,60 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1179
1182
  validityOption: {
1180
1183
  validForDay: 7
1181
1184
  },
1182
- threshold: (w = unref(l)) == null ? void 0 : w.threshold
1185
+ threshold: (w = unref(o)) == null ? void 0 : w.threshold
1183
1186
  };
1184
1187
  })
1185
1188
  }, null, 8, ["model-value"]),
1186
- unref(l).type == "LOYALTY" ? (openBlock(), createBlock(x, {
1189
+ unref(o).type == "LOYALTY" ? (openBlock(), createBlock(C, {
1187
1190
  key: 1,
1188
1191
  label: "Loyalty type",
1189
- rules: [unref(ZodHelper).ruleAtPath(unref(g), "collectible", [unref(l).type])],
1192
+ rules: [unref(ZodHelper).ruleAtPath(unref(y), "collectible", [unref(o).type])],
1190
1193
  items: unref(u).loyaltyRewards.items,
1191
- "model-value": unref(l).collectible,
1192
- "onUpdate:modelValue": p[2] || (p[2] = (E) => unref(l).collectible = E)
1194
+ "model-value": unref(o).collectible,
1195
+ "onUpdate:modelValue": f[2] || (f[2] = (E) => unref(o).collectible = E)
1193
1196
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1194
- unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1195
- p[12] || (p[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
1197
+ unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1198
+ f[12] || (f[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
1196
1199
  createVNode(_sfc_main$l, {
1197
1200
  class: "mt-[-8px]",
1198
- rules: [unref(ZodHelper).ruleAtPath(unref(g), "earningOption", [unref(l).type])],
1199
- "helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
1200
- "error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
1201
+ rules: [unref(ZodHelper).ruleAtPath(unref(y), "earningOption", [unref(o).type])],
1202
+ "helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
1203
+ "error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
1201
1204
  "fixed-type": !0,
1202
- "model-value": unref(l).earningOption,
1203
- "onUpdate:modelValue": p[3] || (p[3] = (E) => l.value = {
1204
- ...unref(l),
1205
+ "model-value": unref(o).earningOption,
1206
+ "onUpdate:modelValue": f[3] || (f[3] = (E) => o.value = {
1207
+ ...unref(o),
1205
1208
  earningOption: E
1206
1209
  })
1207
1210
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
1208
1211
  createVNode(_sfc_main$m, {
1209
1212
  class: "!gap-24",
1210
- type: unref(l).type === "LOYALTY" ? "custom" : "range",
1211
- "for-credit": unref(l).type === "LOYALTY" && ((V = unref(u).loyaltyRewards.items.find(
1213
+ type: unref(o).type === "LOYALTY" ? "custom" : "range",
1214
+ "for-credit": unref(o).type === "LOYALTY" && ((k = unref(u).loyaltyRewards.items.find(
1212
1215
  (E) => {
1213
1216
  var S;
1214
- return E.value === ((S = unref(l)) == null ? void 0 : S.collectible);
1217
+ return E.value === ((S = unref(o)) == null ? void 0 : S.collectible);
1215
1218
  }
1216
- )) == null ? void 0 : V.raw.type) === "CREDIT",
1217
- rules: [unref(ZodHelper).ruleAtPath(unref(g), "validityOption", [unref(l).type])],
1218
- "model-value": unref(l).validityOption,
1219
- "onUpdate:modelValue": p[4] || (p[4] = (E) => l.value = {
1220
- ...unref(l),
1219
+ )) == null ? void 0 : k.raw.type) === "CREDIT",
1220
+ rules: [unref(ZodHelper).ruleAtPath(unref(y), "validityOption", [unref(o).type])],
1221
+ "model-value": unref(o).validityOption,
1222
+ "onUpdate:modelValue": f[4] || (f[4] = (E) => o.value = {
1223
+ ...unref(o),
1221
1224
  validityOption: E
1222
1225
  })
1223
1226
  }, null, 8, ["type", "for-credit", "rules", "model-value"])
1224
1227
  ], 64)) : createCommentVNode("", !0),
1225
- unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
1228
+ unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
1226
1229
  key: 3,
1227
1230
  "reward-image": unref(n),
1228
- "model-value": ((R = unref(l)) == null ? void 0 : R.collectibleConfig) ?? void 0,
1229
- "onUpdate:modelValue": p[5] || (p[5] = (E) => l.value = {
1230
- ...unref(l),
1231
+ "model-value": ((B = unref(o)) == null ? void 0 : B.collectibleConfig) ?? void 0,
1232
+ "onUpdate:modelValue": f[5] || (f[5] = (E) => o.value = {
1233
+ ...unref(o),
1231
1234
  collectibleConfig: E
1232
1235
  }),
1233
- "onUpdate:rewardImage": p[6] || (p[6] = (E) => n.value = E)
1236
+ "onUpdate:rewardImage": f[6] || (f[6] = (E) => n.value = E)
1234
1237
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1235
- createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
1238
+ createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
1236
1239
  ];
1237
1240
  }),
1238
1241
  _: 1
@@ -1266,19 +1269,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1266
1269
  }
1267
1270
  },
1268
1271
  setup(e) {
1269
- const d = e, { maxRange: a, currentRange: s, markers: u } = toRefs(d), i = computed(
1270
- () => Math.min(s.value / a.value * 100, 100)
1271
- ), o = (l) => l / a.value * 100;
1272
- return (l, n) => {
1273
- const m = resolveComponent("FmIcon");
1272
+ const m = e, { maxRange: a, currentRange: i, markers: u } = toRefs(m), d = computed(
1273
+ () => Math.min(i.value / a.value * 100, 100)
1274
+ ), l = (o) => o / a.value * 100;
1275
+ return (o, n) => {
1276
+ const s = resolveComponent("FmIcon");
1274
1277
  return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
1275
- (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (g) => (openBlock(), createBlock(m, {
1278
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (y) => (openBlock(), createBlock(s, {
1276
1279
  class: normalizeClass(
1277
- unref(s) >= g ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1280
+ unref(i) >= y ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1278
1281
  ),
1279
- outline: unref(s) < g,
1280
- key: g,
1281
- name: unref(u).some((y) => y === g) ? "featured_seasonal_and_gifts" : "check_circle"
1282
+ outline: unref(i) < y,
1283
+ key: y,
1284
+ name: unref(u).some((v) => v === y) ? "featured_seasonal_and_gifts" : "check_circle"
1282
1285
  }, null, 8, ["class", "outline", "name"]))), 128))
1283
1286
  ])) : (openBlock(), createElementBlock("div", {
1284
1287
  key: 1,
@@ -1286,12 +1289,12 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1286
1289
  }, [
1287
1290
  createElementVNode("div", {
1288
1291
  class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
1289
- style: normalizeStyle({ width: unref(i) + "%" })
1292
+ style: normalizeStyle({ width: unref(d) + "%" })
1290
1293
  }, null, 4),
1291
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (g, y) => (openBlock(), createElementBlock("div", {
1292
- key: y,
1294
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (y, v) => (openBlock(), createElementBlock("div", {
1295
+ key: v,
1293
1296
  class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
1294
- style: normalizeStyle({ left: o(g) + "%" })
1297
+ style: normalizeStyle({ left: l(y) + "%" })
1295
1298
  }, [
1296
1299
  createElementVNode("div", _hoisted_2$4, [
1297
1300
  createElementVNode("div", {
@@ -1305,16 +1308,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1305
1308
  }
1306
1309
  }), isObject = (e) => e !== null && typeof e == "object";
1307
1310
  function changeKeysFactory(e) {
1308
- return function d(a, s = 1, u) {
1309
- if (s === 0 || !isObject(a))
1311
+ return function m(a, i = 1, u) {
1312
+ if (i === 0 || !isObject(a))
1310
1313
  return a;
1311
1314
  if (Array.isArray(a))
1312
- return a.map((o) => d(o, s - 1, u));
1313
- const i = Object.create(Object.getPrototypeOf(a));
1314
- return Object.keys(a).forEach((o) => {
1315
- const l = a[o], n = e(o, u), m = d(l, s - 1, u);
1316
- i[n] = m;
1317
- }), i;
1315
+ return a.map((l) => m(l, i - 1, u));
1316
+ const d = Object.create(Object.getPrototypeOf(a));
1317
+ return Object.keys(a).forEach((l) => {
1318
+ const o = a[l], n = e(l, u), s = m(o, i - 1, u);
1319
+ d[n] = s;
1320
+ }), d;
1318
1321
  };
1319
1322
  }
1320
1323
  const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_3$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_4$2 = { class: "flex items-center gap-4" }, _hoisted_5$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_6$2 = { class: "flex items-center gap-16" }, _hoisted_7$1 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
@@ -1330,37 +1333,37 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1330
1333
  }
1331
1334
  },
1332
1335
  emits: ["update:model-value"],
1333
- setup(e, { emit: d }) {
1334
- const a = e, s = d, u = useMembershipStore(), i = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
1335
- () => a.modelValue.sort((r, c) => r.threshold - c.threshold) ?? []
1336
- ), l = computed(() => {
1337
- const r = i.safeParse(o.value);
1336
+ setup(e, { emit: m }) {
1337
+ const a = e, i = m, u = useMembershipStore(), d = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
1338
+ () => a.modelValue.sort((r, p) => r.threshold - p.threshold) ?? []
1339
+ ), o = computed(() => {
1340
+ const r = d.safeParse(l.value);
1338
1341
  return r.success ? [] : r.error.errors;
1339
1342
  }), n = ref();
1340
- function m(r, c) {
1343
+ function s(r, p) {
1341
1344
  var b;
1342
- const p = [...o.value];
1343
- p[c] = r, (b = n.value) == null || b.showSheet(!1), s("update:model-value", p);
1345
+ const f = [...l.value];
1346
+ f[p] = r, (b = n.value) == null || b.showSheet(!1), i("update:model-value", f);
1344
1347
  }
1345
- function g(r) {
1346
- const c = r.type == "VOUCHER" ? r.collectibleConfig : u.collectibles.find(
1348
+ function y(r) {
1349
+ const p = r.type == "VOUCHER" ? r.collectibleConfig : u.collectibles.find(
1347
1350
  (b) => b._id.toString() == r.collectible
1348
- ), p = CollectionUtils.formattedType((c == null ? void 0 : c.name) || "");
1351
+ ), f = CollectionUtils.formattedType((p == null ? void 0 : p.name) || "");
1349
1352
  return {
1350
- label: isNullOrEmpty(p) ? "NO REWARD" : p,
1353
+ label: isNullOrEmpty(f) ? "NO REWARD" : f,
1351
1354
  sublabel: `Reward at ${r.threshold} | Amount: ${r.earningOption.type == "FIXED" ? r.earningOption.amount : `${r.earningOption.amount} for every RM${r.earningOption.every} spent`} `
1352
1355
  };
1353
1356
  }
1354
- function y(r) {
1355
- var p;
1356
- const c = [...o.value];
1357
- (p = n.value) == null || p.showSheet(!0, c[r], r);
1358
- }
1359
1357
  function v(r) {
1360
- const c = [...o.value];
1361
- c.splice(r, 1), s("update:model-value", c);
1358
+ var f;
1359
+ const p = [...l.value];
1360
+ (f = n.value) == null || f.showSheet(!0, p[r], r);
1361
+ }
1362
+ function h(r) {
1363
+ const p = [...l.value];
1364
+ p.splice(r, 1), i("update:model-value", p);
1362
1365
  }
1363
- function h() {
1366
+ function g() {
1364
1367
  var r;
1365
1368
  (r = n.value) == null || r.showSheet(
1366
1369
  !0,
@@ -1376,64 +1379,64 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1376
1379
  amount: 1
1377
1380
  }
1378
1381
  },
1379
- o.value.length
1382
+ l.value.length
1380
1383
  );
1381
1384
  }
1382
- function f(r) {
1383
- var c, p;
1384
- return r.type == "VOUCHER" ? (c = r.collectibleConfig) == null ? void 0 : c.name : sentenceCase(
1385
- ((p = u.loyaltyRewards.items.find(
1385
+ function c(r) {
1386
+ var p, f;
1387
+ return r.type == "VOUCHER" ? (p = r.collectibleConfig) == null ? void 0 : p.name : sentenceCase(
1388
+ ((f = u.loyaltyRewards.items.find(
1386
1389
  (b) => b.value == r.collectible
1387
- )) == null ? void 0 : p.label) || ""
1390
+ )) == null ? void 0 : f.label) || ""
1388
1391
  );
1389
1392
  }
1390
- return (r, c) => {
1391
- const p = resolveComponent("FmButton"), b = resolveComponent("FmCard"), x = resolveComponent("FmHelperText");
1393
+ return (r, p) => {
1394
+ const f = resolveComponent("FmButton"), b = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
1392
1395
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
1393
- c[2] || (c[2] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1)),
1394
- createVNode(p, {
1396
+ p[2] || (p[2] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1)),
1397
+ createVNode(f, {
1395
1398
  label: "Add Reward",
1396
- onClick: c[0] || (c[0] = (k) => h()),
1399
+ onClick: p[0] || (p[0] = (V) => g()),
1397
1400
  variant: "plain",
1398
1401
  icon: "add"
1399
1402
  }),
1400
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (k, C) => (openBlock(), createBlock(b, {
1401
- key: C,
1403
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (V, x) => (openBlock(), createBlock(b, {
1404
+ key: x,
1402
1405
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
1403
1406
  variant: "outlined",
1404
- onClick: (B) => y(C)
1407
+ onClick: (R) => v(x)
1405
1408
  }, {
1406
1409
  default: withCtx(() => [
1407
1410
  createElementVNode("div", null, [
1408
- createElementVNode("div", _hoisted_2$3, toDisplayString(g(k).label), 1),
1409
- createElementVNode("div", _hoisted_3$3, toDisplayString(g(k).sublabel), 1)
1411
+ createElementVNode("div", _hoisted_2$3, toDisplayString(y(V).label), 1),
1412
+ createElementVNode("div", _hoisted_3$3, toDisplayString(y(V).sublabel), 1)
1410
1413
  ]),
1411
- createVNode(p, {
1414
+ createVNode(f, {
1412
1415
  icon: "delete",
1413
1416
  variant: "tertiary",
1414
- onClick: (B) => (B.stopPropagation(), v(C))
1417
+ onClick: (R) => (R.stopPropagation(), h(x))
1415
1418
  }, null, 8, ["onClick"])
1416
1419
  ]),
1417
1420
  _: 2
1418
1421
  }, 1032, ["onClick"]))), 128)),
1419
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((k) => k.path.join(".") == ""), (k) => (openBlock(), createBlock(x, {
1420
- key: k.message,
1421
- text: k.message,
1422
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((V) => V.path.join(".") == ""), (V) => (openBlock(), createBlock(C, {
1423
+ key: V.message,
1424
+ text: V.message,
1422
1425
  state: "error"
1423
1426
  }, null, 8, ["text"]))), 128)),
1424
- c[3] || (c[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1)),
1427
+ p[3] || (p[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1)),
1425
1428
  (openBlock(), createBlock(b, {
1426
1429
  key: 0,
1427
1430
  variant: "outlined",
1428
1431
  class: "p-24 space-y-16 w-fit"
1429
1432
  }, {
1430
1433
  default: withCtx(() => {
1431
- var k, C;
1434
+ var V, x;
1432
1435
  return [
1433
1436
  createElementVNode("div", _hoisted_4$2, [
1434
1437
  createElementVNode("div", null, [
1435
- createElementVNode("div", _hoisted_5$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((k = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : k.earningOption.amount) > 1 ? (C = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : C.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? f(e.modelValue[e.modelValue.length - 1]) : ""), 1),
1436
- c[1] || (c[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1))
1438
+ createElementVNode("div", _hoisted_5$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((V = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : V.earningOption.amount) > 1 ? (x = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : x.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? c(e.modelValue[e.modelValue.length - 1]) : ""), 1),
1439
+ p[1] || (p[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1))
1437
1440
  ])
1438
1441
  ]),
1439
1442
  createElementVNode("div", _hoisted_6$2, [
@@ -1441,7 +1444,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1441
1444
  type: e.mission.type,
1442
1445
  "max-range": e.mission.end,
1443
1446
  currentRange: e.mission.end / 4,
1444
- markers: e.modelValue.map((B) => B.threshold)
1447
+ markers: e.modelValue.map((R) => R.threshold)
1445
1448
  }, null, 8, ["type", "max-range", "currentRange", "markers"]),
1446
1449
  e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_7$1, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
1447
1450
  ])
@@ -1452,7 +1455,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1452
1455
  createVNode(_sfc_main$6, {
1453
1456
  ref_key: "sheetRef",
1454
1457
  ref: n,
1455
- "onUpdate:modelValue": m,
1458
+ "onUpdate:modelValue": s,
1456
1459
  "max-threshold": e.mission.end
1457
1460
  }, null, 8, ["max-threshold"])
1458
1461
  ]);
@@ -1464,10 +1467,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1464
1467
  modelValue: Object
1465
1468
  },
1466
1469
  emits: ["update:model-value"],
1467
- setup(e, { emit: d }) {
1468
- const a = e, s = computed(() => {
1469
- const o = FdoMission.safeParse(a.modelValue);
1470
- return o.success ? [] : o.error.errors;
1470
+ setup(e, { emit: m }) {
1471
+ const a = e, i = computed(() => {
1472
+ const l = FdoMission.safeParse(a.modelValue);
1473
+ return l.success ? [] : l.error.errors;
1471
1474
  }), u = computed(() => [
1472
1475
  {
1473
1476
  label: "Stamp",
@@ -1479,37 +1482,37 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1479
1482
  description: "Reward customers when they reach a cumulative spending goal.",
1480
1483
  value: F_MISSION_TYPE.enum.PROGRESSIVE
1481
1484
  }
1482
- ]), i = d;
1483
- return (o, l) => {
1484
- var g;
1485
- const n = resolveComponent("FmCard"), m = resolveComponent("FmStepperField");
1485
+ ]), d = m;
1486
+ return (l, o) => {
1487
+ var y;
1488
+ const n = resolveComponent("FmCard"), s = resolveComponent("FmStepperField");
1486
1489
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
1487
1490
  createElementVNode("div", _hoisted_2$2, [
1488
- l[1] || (l[1] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Type", -1)),
1489
- l[2] || (l[2] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1)),
1491
+ o[1] || (o[1] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Type", -1)),
1492
+ o[2] || (o[2] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1)),
1490
1493
  createElementVNode("div", _hoisted_3$2, [
1491
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (y) => {
1492
- var v, h;
1494
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (v) => {
1495
+ var h, g;
1493
1496
  return openBlock(), createBlock(n, {
1494
1497
  variant: "outlined",
1495
1498
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1496
1499
  "col-span-2": unref(u).length == 1,
1497
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((v = e.modelValue) == null ? void 0 : v.type) == y.value,
1498
- "hover:bg-fm-color-opacity-sm": ((h = e.modelValue) == null ? void 0 : h.type) != y.value
1500
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((h = e.modelValue) == null ? void 0 : h.type) == v.value,
1501
+ "hover:bg-fm-color-opacity-sm": ((g = e.modelValue) == null ? void 0 : g.type) != v.value
1499
1502
  }]),
1500
1503
  onClick: () => {
1501
- var f, r;
1502
- ((f = e.modelValue) == null ? void 0 : f.type) != y.value && i("update:model-value", {
1504
+ var c, r;
1505
+ ((c = e.modelValue) == null ? void 0 : c.type) != v.value && d("update:model-value", {
1503
1506
  ...e.modelValue,
1504
- type: y.value,
1507
+ type: v.value,
1505
1508
  end: ((r = e.modelValue) == null ? void 0 : r.end) || 1
1506
1509
  });
1507
1510
  },
1508
- key: y.value
1511
+ key: v.value
1509
1512
  }, {
1510
1513
  default: withCtx(() => [
1511
- createElementVNode("div", _hoisted_4$1, toDisplayString(y.label), 1),
1512
- createElementVNode("div", _hoisted_5$1, toDisplayString(y.description), 1)
1514
+ createElementVNode("div", _hoisted_4$1, toDisplayString(v.label), 1),
1515
+ createElementVNode("div", _hoisted_5$1, toDisplayString(v.description), 1)
1513
1516
  ]),
1514
1517
  _: 2
1515
1518
  }, 1032, ["class", "onClick"]);
@@ -1517,21 +1520,21 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1517
1520
  ])
1518
1521
  ]),
1519
1522
  createElementVNode("div", _hoisted_6$1, [
1520
- l[3] || (l[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Collections required", -1)),
1521
- l[4] || (l[4] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1)),
1522
- createVNode(m, {
1523
+ o[3] || (o[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Collections required", -1)),
1524
+ o[4] || (o[4] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1)),
1525
+ createVNode(s, {
1523
1526
  label: "Maximum to collect",
1524
- "model-value": ((g = e.modelValue) == null ? void 0 : g.end) || null,
1525
- "onUpdate:modelValue": l[0] || (l[0] = (y) => {
1526
- var v;
1527
- return i("update:model-value", {
1527
+ "model-value": ((y = e.modelValue) == null ? void 0 : y.end) || null,
1528
+ "onUpdate:modelValue": o[0] || (o[0] = (v) => {
1529
+ var h;
1530
+ return d("update:model-value", {
1528
1531
  ...e.modelValue,
1529
- type: ((v = e.modelValue) == null ? void 0 : v.type) || "STAMP",
1530
- end: y
1532
+ type: ((h = e.modelValue) == null ? void 0 : h.type) || "STAMP",
1533
+ end: v
1531
1534
  });
1532
1535
  }),
1533
- "helper-text": unref(ZodHelper).helperText(unref(s), "end") || "Set the threshold required for reward eligibility",
1534
- "helper-state": unref(ZodHelper).helperState(unref(s), "end") || "none"
1536
+ "helper-text": unref(ZodHelper).helperText(unref(i), "end") || "Set the threshold required for reward eligibility",
1537
+ "helper-state": unref(ZodHelper).helperState(unref(i), "end") || "none"
1535
1538
  }, null, 8, ["model-value", "helper-text", "helper-state"])
1536
1539
  ])
1537
1540
  ]);
@@ -1559,113 +1562,113 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1559
1562
  }
1560
1563
  },
1561
1564
  emits: ["update:model-value", "update:file"],
1562
- setup(e, { emit: d }) {
1563
- const { t: a } = useI18n(), s = e, u = d;
1564
- function i(m) {
1565
- switch (s.field.type) {
1565
+ setup(e, { emit: m }) {
1566
+ const { t: a } = useI18n(), i = e, u = m;
1567
+ function d(s) {
1568
+ switch (i.field.type) {
1566
1569
  case "timeframe":
1567
- const g = m.startDate ? hooks(m.startDate).startOf("day").toISOString() : void 0, y = m.endDate ? hooks(m.endDate).endOf("day").toISOString() : void 0;
1570
+ const y = s.startDate ? hooks(s.startDate).startOf("day").toISOString() : void 0, v = s.endDate ? hooks(s.endDate).endOf("day").toISOString() : void 0;
1568
1571
  u("update:model-value", {
1569
1572
  type: "timeframe",
1570
1573
  property: "__now",
1571
- start: g,
1572
- end: y
1574
+ start: y,
1575
+ end: v
1573
1576
  });
1574
1577
  break;
1575
1578
  case "image": {
1576
1579
  u(
1577
1580
  "update:file",
1578
- m,
1579
- o.value || firebaseStorage.collectibleImagePath(void 0, m)
1581
+ s,
1582
+ l.value || firebaseStorage.collectibleImagePath(void 0, s)
1580
1583
  );
1581
1584
  break;
1582
1585
  }
1583
1586
  default:
1584
- u("update:model-value", m);
1587
+ u("update:model-value", s);
1585
1588
  break;
1586
1589
  }
1587
1590
  }
1588
- const o = computed(() => {
1589
- switch (s.field.type) {
1591
+ const l = computed(() => {
1592
+ switch (i.field.type) {
1590
1593
  case "timeframe": {
1591
- const m = s.modelValue;
1594
+ const s = i.modelValue;
1592
1595
  return {
1593
- startDate: m != null && m.start ? hooks(m == null ? void 0 : m.start).format("YYYY-MM-DD") : null,
1594
- endDate: m != null && m.end ? hooks(m == null ? void 0 : m.end).format("YYYY-MM-DD") : null
1596
+ startDate: s != null && s.start ? hooks(s == null ? void 0 : s.start).format("YYYY-MM-DD") : null,
1597
+ endDate: s != null && s.end ? hooks(s == null ? void 0 : s.end).format("YYYY-MM-DD") : null
1595
1598
  };
1596
1599
  }
1597
1600
  default:
1598
- return s.modelValue;
1601
+ return i.modelValue;
1599
1602
  }
1600
1603
  });
1601
- function l() {
1604
+ function o() {
1602
1605
  if (!n.value.schema) return [];
1603
- const m = n.value.schema.safeParse(s.modelValue);
1604
- return m.success ? [] : m.error.errors;
1606
+ const s = n.value.schema.safeParse(i.modelValue);
1607
+ return s.success ? [] : s.error.errors;
1605
1608
  }
1606
1609
  const n = computed(() => ({
1607
- schema: s.schema,
1608
- unwrapped: s.schema ? ZodHelper.unwrap(s.schema) : void 0,
1609
- rules: s.schema ? [ZodHelper.ruleAtPath(s.schema, "")] : void 0,
1610
- labelMark: s.schema && ZodHelper.isRequired(s.schema) == !1 ? "optional" : void 0,
1611
- zodLabel: s.schema ? ZodHelper.toInputLabel(s.schema, s.field.label) : void 0
1610
+ schema: i.schema,
1611
+ unwrapped: i.schema ? ZodHelper.unwrap(i.schema) : void 0,
1612
+ rules: i.schema ? [ZodHelper.ruleAtPath(i.schema, "")] : void 0,
1613
+ labelMark: i.schema && ZodHelper.isRequired(i.schema) == !1 ? "optional" : void 0,
1614
+ zodLabel: i.schema ? ZodHelper.toInputLabel(i.schema, i.field.label) : void 0
1612
1615
  }));
1613
- return (m, g) => {
1614
- var c, p, b, x, k;
1615
- const y = resolveComponent("FmTextField"), v = resolveComponent("FmStepperField"), h = resolveComponent("FmTextarea"), f = resolveComponent("FmHelperText"), r = resolveComponent("FmSwitch");
1616
- return e.field.type === "text" ? (openBlock(), createBlock(y, {
1616
+ return (s, y) => {
1617
+ var p, f, b, C, V;
1618
+ const v = resolveComponent("FmTextField"), h = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"), c = resolveComponent("FmHelperText"), r = resolveComponent("FmSwitch");
1619
+ return e.field.type === "text" ? (openBlock(), createBlock(v, {
1617
1620
  key: 0,
1618
1621
  label: unref(a)(e.field.label),
1619
1622
  "label-mark": unref(n).labelMark,
1620
1623
  rules: unref(n).rules,
1621
- "model-value": unref(o),
1622
- "onUpdate:modelValue": i,
1624
+ "model-value": unref(l),
1625
+ "onUpdate:modelValue": d,
1623
1626
  "helper-state": e.helperText ? "error" : void 0,
1624
1627
  "helper-text": e.helperText
1625
1628
  }, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1626
1629
  createVNode(JsonViewer, {
1627
- json: { schema: unref(n).unwrapped, props: s }
1630
+ json: { schema: unref(n).unwrapped, props: i }
1628
1631
  }, null, 8, ["json"]),
1629
- createVNode(v, {
1632
+ createVNode(h, {
1630
1633
  label: unref(a)(e.field.label),
1631
1634
  "label-mark": e.field.isRuleChildren ? void 0 : unref(n).labelMark,
1632
- "model-value": unref(o),
1635
+ "model-value": unref(l),
1633
1636
  rules: e.field.isRuleChildren ? [] : unref(n).rules,
1634
- "onUpdate:modelValue": i,
1637
+ "onUpdate:modelValue": d,
1635
1638
  "helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
1636
1639
  "helper-text": e.field.isRuleChildren ? e.helperText : void 0
1637
1640
  }, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
1638
- ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(h, {
1641
+ ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(g, {
1639
1642
  key: 2,
1640
1643
  label: unref(a)(e.field.label),
1641
1644
  "label-mark": unref(n).labelMark,
1642
1645
  rules: unref(n).rules,
1643
- "model-value": unref(o),
1644
- "onUpdate:modelValue": i,
1646
+ "model-value": unref(l),
1647
+ "onUpdate:modelValue": d,
1645
1648
  "show-word-count": "",
1646
- "max-length": (k = (x = (b = (p = (c = unref(n)) == null ? void 0 : c.unwrapped) == null ? void 0 : p._def) == null ? void 0 : b.checks) == null ? void 0 : x.find((C) => C.kind == "max")) == null ? void 0 : k.value
1649
+ "max-length": (V = (C = (b = (f = (p = unref(n)) == null ? void 0 : p.unwrapped) == null ? void 0 : f._def) == null ? void 0 : b.checks) == null ? void 0 : C.find((x) => x.kind == "max")) == null ? void 0 : V.value
1647
1650
  }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$g, {
1648
1651
  key: 3,
1649
1652
  "campaign-type": e.extras,
1650
- "model-value": unref(o),
1653
+ "model-value": unref(l),
1651
1654
  disabled: e.disabled,
1652
- "onUpdate:modelValue": i
1655
+ "onUpdate:modelValue": d
1653
1656
  }, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
1654
1657
  createVNode(_sfc_main$e, {
1655
- "model-value": unref(o),
1656
- "onUpdate:modelValue": i
1658
+ "model-value": unref(l),
1659
+ "onUpdate:modelValue": d
1657
1660
  }, null, 8, ["model-value"]),
1658
- createVNode(f, {
1661
+ createVNode(c, {
1659
1662
  class: "!mt-[8px]",
1660
- text: unref(ZodHelper).helperText(l(), ""),
1661
- state: unref(ZodHelper).helperState(l(), "")
1663
+ text: unref(ZodHelper).helperText(o(), ""),
1664
+ state: unref(ZodHelper).helperState(o(), "")
1662
1665
  }, null, 8, ["text", "state"])
1663
1666
  ], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$o, {
1664
1667
  key: 5,
1665
- thumbnail: unref(o),
1668
+ thumbnail: unref(l),
1666
1669
  "aspect-ratio": "16 / 9",
1667
1670
  class: "w-1/2 xs:w-2/3",
1668
- "onUpdate:file": i
1671
+ "onUpdate:file": d
1669
1672
  }, {
1670
1673
  label: withCtx(() => [
1671
1674
  (openBlock(), createBlock(resolveDynamicComponent(unref(n).zodLabel)))
@@ -1678,26 +1681,26 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1678
1681
  sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
1679
1682
  "label-mark": unref(n).labelMark,
1680
1683
  rules: unref(n).rules,
1681
- "model-value": unref(o),
1682
- "onUpdate:modelValue": i
1684
+ "model-value": unref(l),
1685
+ "onUpdate:modelValue": d
1683
1686
  }, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$p, {
1684
1687
  key: 7,
1685
- "model-value": unref(o),
1686
- "onUpdate:modelValue": i,
1688
+ "model-value": unref(l),
1689
+ "onUpdate:modelValue": d,
1687
1690
  "no-campaign": !1,
1688
1691
  schema: unref(n).schema,
1689
1692
  "is-mission": e.extras === "MISSION"
1690
1693
  }, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$q, {
1691
1694
  key: 8,
1692
- "model-value": unref(o),
1693
- "onUpdate:modelValue": i
1695
+ "model-value": unref(l),
1696
+ "onUpdate:modelValue": d
1694
1697
  }, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
1695
1698
  createVNode(_sfc_main$r, {
1696
- "model-value": unref(o),
1697
- "onUpdate:modelValue": i,
1699
+ "model-value": unref(l),
1700
+ "onUpdate:modelValue": d,
1698
1701
  "can-set-auto-apply": e.field.property == "campaign.effect"
1699
1702
  }, null, 8, ["model-value", "can-set-auto-apply"]),
1700
- unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(f, {
1703
+ unref(l) ? createCommentVNode("", !0) : (openBlock(), createBlock(c, {
1701
1704
  key: 0,
1702
1705
  class: "!mt-[8px]",
1703
1706
  text: unref(a)("connect.campaign.common.effect_required"),
@@ -1707,58 +1710,58 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1707
1710
  key: 10,
1708
1711
  "allow-email": !0,
1709
1712
  "allow-whatsapp": !0,
1710
- "model-value": unref(o),
1711
- "onUpdate:modelValue": i,
1712
- "helper-text": unref(ZodHelper).helperText(l(), ""),
1713
+ "model-value": unref(l),
1714
+ "onUpdate:modelValue": d,
1715
+ "helper-text": unref(ZodHelper).helperText(o(), ""),
1713
1716
  "trigger-type": e.field.extras,
1714
- "helper-state": unref(ZodHelper).helperState(l(), "")
1717
+ "helper-state": unref(ZodHelper).helperState(o(), "")
1715
1718
  }, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$l, {
1716
1719
  key: 11,
1717
- "model-value": unref(o),
1718
- "onUpdate:modelValue": i,
1720
+ "model-value": unref(l),
1721
+ "onUpdate:modelValue": d,
1719
1722
  extras: e.extras,
1720
1723
  "error-text": e.helperText
1721
1724
  }, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$m, {
1722
1725
  key: 12,
1723
1726
  type: "custom",
1724
- "model-value": unref(o),
1725
- "onUpdate:modelValue": i,
1726
- "helper-text": e.helperText || unref(ZodHelper).helperText(l(), "")
1727
+ "model-value": unref(l),
1728
+ "onUpdate:modelValue": d,
1729
+ "helper-text": e.helperText || unref(ZodHelper).helperText(o(), "")
1727
1730
  }, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$c, {
1728
1731
  key: 13,
1729
- "model-value": unref(o),
1730
- "onUpdate:modelValue": i
1732
+ "model-value": unref(l),
1733
+ "onUpdate:modelValue": d
1731
1734
  }, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
1732
1735
  key: 14,
1733
- "model-value": unref(o),
1734
- "onUpdate:modelValue": i
1736
+ "model-value": unref(l),
1737
+ "onUpdate:modelValue": d
1735
1738
  }, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
1736
1739
  key: 15,
1737
- "model-value": unref(o),
1738
- "onUpdate:modelValue": i
1740
+ "model-value": unref(l),
1741
+ "onUpdate:modelValue": d
1739
1742
  }, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
1740
1743
  key: 16,
1741
- "model-value": unref(o),
1742
- "onUpdate:modelValue": i
1744
+ "model-value": unref(l),
1745
+ "onUpdate:modelValue": d
1743
1746
  }, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
1744
1747
  key: 17,
1745
- "model-value": unref(o),
1746
- "onUpdate:modelValue": i,
1747
- "helper-text": unref(ZodHelper).helperText(l(), ""),
1748
- "helper-state": unref(ZodHelper).helperState(l(), "")
1748
+ "model-value": unref(l),
1749
+ "onUpdate:modelValue": d,
1750
+ "helper-text": unref(ZodHelper).helperText(o(), ""),
1751
+ "helper-state": unref(ZodHelper).helperState(o(), "")
1749
1752
  }, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
1750
1753
  key: 18,
1751
- "model-value": unref(o),
1752
- "onUpdate:modelValue": i,
1754
+ "model-value": unref(l),
1755
+ "onUpdate:modelValue": d,
1753
1756
  mission: e.extras.mission
1754
1757
  }, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
1755
1758
  createVNode(_sfc_main$d, {
1756
- "model-value": unref(o),
1757
- "onUpdate:modelValue": i,
1759
+ "model-value": unref(l),
1760
+ "onUpdate:modelValue": d,
1758
1761
  "start-date": e.extras.start,
1759
1762
  "end-date": e.extras.end
1760
1763
  }, null, 8, ["model-value", "start-date", "end-date"]),
1761
- e.helperText ? (openBlock(), createBlock(f, {
1764
+ e.helperText ? (openBlock(), createBlock(c, {
1762
1765
  key: 0,
1763
1766
  class: "!mt-[8px]",
1764
1767
  text: e.helperText,
@@ -1766,26 +1769,26 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1766
1769
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1767
1770
  ], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
1768
1771
  createVNode(_sfc_main$t, {
1769
- "model-value": unref(o),
1770
- "onUpdate:modelValue": i
1772
+ "model-value": unref(l),
1773
+ "onUpdate:modelValue": d
1771
1774
  }, null, 8, ["model-value"]),
1772
- e.helperText ? (openBlock(), createBlock(f, {
1775
+ e.helperText ? (openBlock(), createBlock(c, {
1773
1776
  key: 0,
1774
1777
  class: "!mt-[8px]",
1775
1778
  text: e.helperText,
1776
1779
  state: "error"
1777
1780
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1778
1781
  ], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
1779
- e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(o).rules.g_time).length > 0 ? (openBlock(), createBlock(f, {
1782
+ e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(l).rules.g_time).length > 0 ? (openBlock(), createBlock(c, {
1780
1783
  key: 0,
1781
1784
  state: "warning",
1782
1785
  text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
1783
1786
  }, null, 8, ["text"])) : createCommentVNode("", !0),
1784
1787
  createVNode(_sfc_main$i, {
1785
- "model-value": unref(o),
1786
- "onUpdate:modelValue": i
1788
+ "model-value": unref(l),
1789
+ "onUpdate:modelValue": d
1787
1790
  }, null, 8, ["model-value"]),
1788
- e.helperText ? (openBlock(), createBlock(f, {
1791
+ e.helperText ? (openBlock(), createBlock(c, {
1789
1792
  key: 1,
1790
1793
  class: "!mt-[8px]",
1791
1794
  text: e.helperText,
@@ -1793,10 +1796,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1793
1796
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1794
1797
  ], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
1795
1798
  createVNode(_sfc_main$u, {
1796
- "model-value": unref(o),
1797
- "onUpdate:modelValue": i
1799
+ "model-value": unref(l),
1800
+ "onUpdate:modelValue": d
1798
1801
  }, null, 8, ["model-value"]),
1799
- e.helperText ? (openBlock(), createBlock(f, {
1802
+ e.helperText ? (openBlock(), createBlock(c, {
1800
1803
  key: 0,
1801
1804
  class: "!mt-[8px]",
1802
1805
  text: e.helperText,
@@ -1804,10 +1807,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1804
1807
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1805
1808
  ], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
1806
1809
  createVNode(_sfc_main$v, {
1807
- "model-value": unref(o),
1808
- "onUpdate:modelValue": i
1810
+ "model-value": unref(l),
1811
+ "onUpdate:modelValue": d
1809
1812
  }, null, 8, ["model-value"]),
1810
- e.helperText ? (openBlock(), createBlock(f, {
1813
+ e.helperText ? (openBlock(), createBlock(c, {
1811
1814
  key: 0,
1812
1815
  class: "!mt-[8px]",
1813
1816
  text: e.helperText,
@@ -1815,10 +1818,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1815
1818
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1816
1819
  ], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
1817
1820
  createVNode(_sfc_main$h, {
1818
- "model-value": unref(o),
1819
- "onUpdate:modelValue": i
1821
+ "model-value": unref(l),
1822
+ "onUpdate:modelValue": d
1820
1823
  }, null, 8, ["model-value"]),
1821
- e.helperText ? (openBlock(), createBlock(f, {
1824
+ e.helperText ? (openBlock(), createBlock(c, {
1822
1825
  key: 0,
1823
1826
  class: "!mt-[8px]",
1824
1827
  text: e.helperText,
@@ -1826,16 +1829,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1826
1829
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1827
1830
  ], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
1828
1831
  createVNode(_sfc_main$9, {
1829
- "model-value": unref(o),
1830
- "onUpdate:modelValue": i
1832
+ "model-value": unref(l),
1833
+ "onUpdate:modelValue": d
1831
1834
  }, null, 8, ["model-value"]),
1832
- e.helperText ? (openBlock(), createBlock(f, {
1835
+ e.helperText ? (openBlock(), createBlock(c, {
1833
1836
  key: 0,
1834
1837
  class: "!mt-[8px]",
1835
1838
  text: e.helperText,
1836
1839
  state: "error"
1837
1840
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1838
- ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(s.field), 1));
1841
+ ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(i.field), 1));
1839
1842
  };
1840
1843
  }
1841
1844
  }), _hoisted_1$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_2$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$1 = { class: "fm-typo-en-body-lg-600" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
@@ -1847,23 +1850,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1847
1850
  }
1848
1851
  },
1849
1852
  setup(e) {
1850
- const { t: d, te: a } = useI18n();
1851
- return (s, u) => {
1852
- const i = resolveComponent("FmCard");
1853
- return openBlock(), createBlock(i, {
1853
+ const { t: m, te: a } = useI18n();
1854
+ return (i, u) => {
1855
+ const d = resolveComponent("FmCard");
1856
+ return openBlock(), createBlock(d, {
1854
1857
  variant: "outlined",
1855
1858
  class: "p-16 space-y-8"
1856
1859
  }, {
1857
1860
  default: withCtx(() => [
1858
- createElementVNode("div", _hoisted_1$1, toDisplayString(unref(d)("connect.campaign.common.summary")), 1),
1861
+ createElementVNode("div", _hoisted_1$1, toDisplayString(unref(m)("connect.campaign.common.summary")), 1),
1859
1862
  u[0] || (u[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
1860
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (o, l) => (openBlock(), createElementBlock("div", {
1863
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (l, o) => (openBlock(), createElementBlock("div", {
1861
1864
  class: "space-y-4",
1862
- key: l
1865
+ key: o
1863
1866
  }, [
1864
- o ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1865
- createElementVNode("div", _hoisted_2$1, toDisplayString(unref(d)(`${l}`)), 1),
1866
- createElementVNode("div", _hoisted_3$1, toDisplayString(unref(a)(`${o}`) ? unref(d)(`${o}`) : o), 1)
1867
+ l ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1868
+ createElementVNode("div", _hoisted_2$1, toDisplayString(unref(m)(`${o}`)), 1),
1869
+ createElementVNode("div", _hoisted_3$1, toDisplayString(unref(a)(`${l}`) ? unref(m)(`${l}`) : l), 1)
1867
1870
  ], 64)) : createCommentVNode("", !0)
1868
1871
  ]))), 128))
1869
1872
  ]),
@@ -1882,7 +1885,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1882
1885
  TEMPLATES.VOUCHER
1883
1886
  ), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
1884
1887
  async function showSheet(visible, type, campaign, selectedTemplate) {
1885
- var e, d;
1888
+ var e, m;
1886
1889
  if (sheetVisible.value = visible, visible == !0) {
1887
1890
  try {
1888
1891
  isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
@@ -1890,16 +1893,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1890
1893
  } finally {
1891
1894
  await new Promise((a) => setTimeout(a, 120)), isLoading.value = !1;
1892
1895
  }
1893
- template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a, s) => {
1896
+ template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a, i) => {
1894
1897
  a.campaign.type === "VOUCHER" && a.campaign.code && useCampaignStore().campaigns.voucher.some(
1895
1898
  (u) => u.code === a.campaign.code && u._id.toString() !== a.campaign._id.toString()
1896
- ) && s.addIssue({
1899
+ ) && i.addIssue({
1897
1900
  code: "custom",
1898
1901
  message: "Code already exists, please use another code",
1899
1902
  path: ["campaign", "code"]
1900
1903
  });
1901
1904
  })), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
1902
- ...(d = template.value) == null ? void 0 : d.defaultValue
1905
+ ...(m = template.value) == null ? void 0 : m.defaultValue
1903
1906
  }), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), data.value.templateId = SvcConfig.getBusinessId(), data.value.campaign.business = SvcConfig.getBusinessId(), data.value.campaign.templateId = SvcConfig.getBusinessId(), "configs" in data.value && (data.value.configs.business = SvcConfig.getBusinessId()), currentStep.value = 1, sheetTitle.value = campaign ? `Edit ${CampaignOptions[type].name} Campaign` : `Create ${CampaignOptions[type].name} Campaign`;
1904
1907
  }
1905
1908
  }
@@ -1926,11 +1929,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1926
1929
  return e.success ? [] : e.error.errors;
1927
1930
  });
1928
1931
  function stepErrors(e = currentStep.value - 1) {
1929
- const d = template.value.steps[e].groups.flatMap(
1930
- (a) => a.fields.map((s) => s.property)
1932
+ const m = template.value.steps[e].groups.flatMap(
1933
+ (a) => a.fields.map((i) => i.property)
1931
1934
  );
1932
1935
  return errors.value.filter(
1933
- (a) => d.some((s) => a.path.join(".").includes(s))
1936
+ (a) => m.some((i) => a.path.join(".").includes(i))
1934
1937
  );
1935
1938
  }
1936
1939
  __expose({ showSheet });
@@ -1943,17 +1946,17 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1943
1946
  }
1944
1947
  });
1945
1948
  }
1946
- function onUpdateProperty(e, d) {
1947
- var a, s, u, i, o, l, n, m;
1948
- if (_.set(data.value, e, d), e == "campaign.event.type") {
1949
- const y = ((i = (u = (s = (a = template.value) == null ? void 0 : a.defaultValue) == null ? void 0 : s.campaign) == null ? void 0 : u.event) == null ? void 0 : i.rule) ? _.cloneDeep({
1950
- ...(m = (n = (l = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : l.campaign) == null ? void 0 : n.event) == null ? void 0 : m.rule
1949
+ function onUpdateProperty(e, m) {
1950
+ var a, i, u, d, l, o, n, s;
1951
+ if (_.set(data.value, e, m), e == "campaign.event.type") {
1952
+ const v = ((d = (u = (i = (a = template.value) == null ? void 0 : a.defaultValue) == null ? void 0 : i.campaign) == null ? void 0 : u.event) == null ? void 0 : d.rule) ? _.cloneDeep({
1953
+ ...(s = (n = (o = (l = template.value) == null ? void 0 : l.defaultValue) == null ? void 0 : o.campaign) == null ? void 0 : n.event) == null ? void 0 : s.rule
1951
1954
  }) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
1952
1955
  RuleBuilder.scaffoldGroup("g_schedule"),
1953
1956
  RuleBuilder.scaffoldGroup("g_time"),
1954
1957
  RuleBuilder.scaffoldGroup("g_user"),
1955
1958
  RuleBuilder.scaffoldGroup("g_bill")
1956
- ]), v = RuleBuilder.setRuleToGroup(
1959
+ ]), h = RuleBuilder.setRuleToGroup(
1957
1960
  RuleBuilder.scaffoldGroup("g_schedule"),
1958
1961
  [
1959
1962
  RuleBuilder.constructEntry(
@@ -1965,29 +1968,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1965
1968
  ],
1966
1969
  "&&"
1967
1970
  );
1968
- if (d != "SCHEDULE") {
1969
- _.set(data.value, "campaign.event.rule", y);
1971
+ if (m != "SCHEDULE") {
1972
+ _.set(data.value, "campaign.event.rule", v);
1970
1973
  return;
1971
1974
  }
1972
1975
  _.set(
1973
1976
  data.value,
1974
1977
  "campaign.event.rule",
1975
- RuleBuilder.setRuleToGroup(y, v)
1978
+ RuleBuilder.setRuleToGroup(v, h)
1976
1979
  );
1977
1980
  }
1978
- e == "campaign.notify" && d == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
1981
+ e == "campaign.notify" && m == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
1979
1982
  }
1980
- async function onUpdateFile(e, d) {
1981
- return e ? await minor(async () => firebaseStorage.update(d, e), {
1983
+ async function onUpdateFile(e, m) {
1984
+ return e ? await minor(async () => firebaseStorage.update(m, e), {
1982
1985
  message: `${e ? "Uploading" : "Removing"} file`,
1983
1986
  successMessage: `File ${e ? "uploaded" : "removed"} successfully`
1984
1987
  }) : "";
1985
1988
  }
1986
1989
  function isDisable(e) {
1987
- var d, a;
1990
+ var m, a;
1988
1991
  switch (e == null ? void 0 : e.property) {
1989
1992
  case "campaign.event.type":
1990
- return ((a = (d = data.value) == null ? void 0 : d.campaign) == null ? void 0 : a._id) || !1;
1993
+ return ((a = (m = data.value) == null ? void 0 : m.campaign) == null ? void 0 : a._id) || !1;
1991
1994
  default:
1992
1995
  return !1;
1993
1996
  }
@@ -1996,14 +1999,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1996
1999
  const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
1997
2000
  e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
1998
2001
  }
1999
- return (e, d) => {
2000
- const a = resolveComponent("FmButton"), s = resolveComponent("FmStep"), u = resolveComponent("FmStepper"), i = resolveComponent("FmCard"), o = resolveComponent("FmTopSheet");
2001
- return openBlock(), createBlock(o, {
2002
+ return (e, m) => {
2003
+ const a = resolveComponent("FmButton"), i = resolveComponent("FmStep"), u = resolveComponent("FmStepper"), d = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
2004
+ return openBlock(), createBlock(l, {
2002
2005
  "fullscreen-size": "lg",
2003
2006
  modelValue: unref(sheetVisible),
2004
2007
  "onUpdate:modelValue": [
2005
- d[7] || (d[7] = (l) => isRef(sheetVisible) ? sheetVisible.value = l : null),
2006
- d[8] || (d[8] = (l) => sheetVisible.value = l)
2008
+ m[7] || (m[7] = (o) => isRef(sheetVisible) ? sheetVisible.value = o : null),
2009
+ m[8] || (m[8] = (o) => sheetVisible.value = o)
2007
2010
  ]
2008
2011
  }, createSlots({
2009
2012
  "top-sheet-header": withCtx(() => [
@@ -2011,7 +2014,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2011
2014
  createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
2012
2015
  createElementVNode("div", _hoisted_2, [
2013
2016
  createVNode(a, {
2014
- onClick: d[0] || (d[0] = (l) => hideSheet()),
2017
+ onClick: m[0] || (m[0] = (o) => hideSheet()),
2015
2018
  label: unref(t)("connect.campaign.common.cancel"),
2016
2019
  variant: "tertiary"
2017
2020
  }, null, 8, ["label"]),
@@ -2031,7 +2034,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2031
2034
  createElementVNode("div", _hoisted_9, [
2032
2035
  createElementVNode("div", _hoisted_10, [
2033
2036
  createElementVNode("div", _hoisted_11, [
2034
- d[9] || (d[9] = createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
2037
+ m[9] || (m[9] = createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
2035
2038
  createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
2036
2039
  createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
2037
2040
  createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
@@ -2053,7 +2056,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2053
2056
  ])
2054
2057
  ])
2055
2058
  ], -1)),
2056
- createVNode(i, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2059
+ createVNode(d, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2057
2060
  ])
2058
2061
  ])
2059
2062
  ])
@@ -2065,14 +2068,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2065
2068
  unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
2066
2069
  createVNode(u, {
2067
2070
  modelValue: unref(currentStep),
2068
- "onUpdate:modelValue": d[1] || (d[1] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2071
+ "onUpdate:modelValue": m[1] || (m[1] = (o) => isRef(currentStep) ? currentStep.value = o : null),
2069
2072
  orientation: "horizontal",
2070
2073
  class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
2071
2074
  }, {
2072
2075
  default: withCtx(() => [
2073
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(s, {
2074
- key: l.name,
2075
- title: unref(t)(l.name),
2076
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(i, {
2077
+ key: o.name,
2078
+ title: unref(t)(o.name),
2076
2079
  value: n + 1,
2077
2080
  error: () => stepErrors(n).length > 0,
2078
2081
  complete: () => n + 1 <= unref(currentStep)
@@ -2084,19 +2087,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2084
2087
  createVNode(a, {
2085
2088
  icon: "close",
2086
2089
  variant: "tertiary",
2087
- onClick: d[2] || (d[2] = (l) => sheetVisible.value = !1)
2090
+ onClick: m[2] || (m[2] = (o) => sheetVisible.value = !1)
2088
2091
  }),
2089
2092
  createVNode(u, {
2090
2093
  modelValue: unref(currentStep),
2091
- "onUpdate:modelValue": d[3] || (d[3] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2094
+ "onUpdate:modelValue": m[3] || (m[3] = (o) => isRef(currentStep) ? currentStep.value = o : null),
2092
2095
  orientation: "horizontal",
2093
2096
  class: "flex-1"
2094
2097
  }, {
2095
2098
  default: withCtx(() => [
2096
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(s, {
2097
- key: l.name,
2099
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(i, {
2100
+ key: o.name,
2098
2101
  title: unref(sheetTitle),
2099
- description: unref(t)(l.name),
2102
+ description: unref(t)(o.name),
2100
2103
  value: n + 1,
2101
2104
  error: () => stepErrors(n).length > 0,
2102
2105
  complete: () => n + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
@@ -2107,7 +2110,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2107
2110
  createVNode(a, {
2108
2111
  icon: "info",
2109
2112
  variant: "tertiary",
2110
- onClick: d[4] || (d[4] = () => showSummaryDialog())
2113
+ onClick: m[4] || (m[4] = () => showSummaryDialog())
2111
2114
  })
2112
2115
  ]),
2113
2116
  createElementVNode("div", _hoisted_5, [
@@ -2116,40 +2119,40 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2116
2119
  json: {
2117
2120
  data: unref(data),
2118
2121
  errors: unref(errors).map(
2119
- (l) => `${l.path.join(".")} - ${l.message}`
2122
+ (o) => `${o.path.join(".")} - ${o.message}`
2120
2123
  ),
2121
2124
  stepErrors: stepErrors().map(
2122
- (l) => `${l.path.join(".")} - ${l.message}`
2125
+ (o) => `${o.path.join(".")} - ${o.message}`
2123
2126
  ),
2124
2127
  schema: unref(schema)
2125
2128
  }
2126
2129
  }, null, 8, ["json"]),
2127
2130
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
2128
- (l) => l.fields.length && (!l.condition || unref(_).get(unref(data), l.condition.property) == l.condition.value == (l.condition.not != !0))
2129
- ), (l, n) => (openBlock(), createElementBlock("div", {
2131
+ (o) => o.fields.length && (!o.condition || unref(_).get(unref(data), o.condition.property) == o.condition.value == (o.condition.not != !0))
2132
+ ), (o, n) => (openBlock(), createElementBlock("div", {
2130
2133
  key: n,
2131
2134
  class: "space-y-24"
2132
2135
  }, [
2133
- createElementVNode("div", _hoisted_7, toDisplayString(l.name ? unref(t)(l.name) : ""), 1),
2134
- (openBlock(!0), createElementBlock(Fragment, null, renderList(l.fields, (m, g) => (openBlock(), createElementBlock("div", { key: g }, [
2136
+ createElementVNode("div", _hoisted_7, toDisplayString(o.name ? unref(t)(o.name) : ""), 1),
2137
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(o.fields, (s, y) => (openBlock(), createElementBlock("div", { key: y }, [
2135
2138
  (openBlock(), createBlock(_sfc_main$2, {
2136
- key: g,
2137
- field: m,
2138
- modelValue: unref(_).get(unref(data), m.property),
2139
- disabled: isDisable(m),
2140
- "onUpdate:modelValue": (y) => onUpdateProperty(m.property, y),
2141
- "onUpdate:file": async (y, v) => {
2142
- const h = await onUpdateFile(y, v);
2143
- onUpdateProperty(m.property, h || "");
2139
+ key: y,
2140
+ field: s,
2141
+ modelValue: unref(_).get(unref(data), s.property),
2142
+ disabled: isDisable(s),
2143
+ "onUpdate:modelValue": (v) => onUpdateProperty(s.property, v),
2144
+ "onUpdate:file": async (v, h) => {
2145
+ const g = await onUpdateFile(v, h);
2146
+ onUpdateProperty(s.property, g || "");
2144
2147
  },
2145
2148
  schema: unref(ZodHelper).typeAtPath(
2146
2149
  unref(schema),
2147
- m.property,
2150
+ s.property,
2148
2151
  unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
2149
2152
  ),
2150
- "helper-state": unref(ZodHelper).helperState(unref(errors), m.property),
2151
- "helper-text": unref(ZodHelper).helperText(unref(errors), m.property),
2152
- extras: m.extras != null ? m.extras == "" ? unref(data) : unref(_).get(unref(data), m.extras) : void 0
2153
+ "helper-state": unref(ZodHelper).helperState(unref(errors), s.property),
2154
+ "helper-text": unref(ZodHelper).helperText(unref(errors), s.property),
2155
+ extras: s.extras != null ? s.extras == "" ? unref(data) : unref(_).get(unref(data), s.extras) : void 0
2153
2156
  }, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
2154
2157
  ]))), 128))
2155
2158
  ]))), 128)),
@@ -2158,12 +2161,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2158
2161
  label: "Back",
2159
2162
  variant: "tertiary",
2160
2163
  disabled: unref(currentStep) == 1,
2161
- onClick: d[5] || (d[5] = (l) => currentStep.value--)
2164
+ onClick: m[5] || (m[5] = (o) => currentStep.value--)
2162
2165
  }, null, 8, ["disabled"]),
2163
2166
  createVNode(a, {
2164
2167
  disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
2165
2168
  label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
2166
- onClick: d[6] || (d[6] = (l) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2169
+ onClick: m[6] || (m[6] = (o) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2167
2170
  }, null, 8, ["disabled", "label"])
2168
2171
  ])
2169
2172
  ]),