@feedmepos/mf-connect 0.0.16-beta.1 → 0.0.16-beta.11

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 (95) hide show
  1. package/dist/{Analytic-C-zZmF5N.js → Analytic-Gq7PoNer.js} +368 -365
  2. package/dist/App-Cikl5jnp.js +177 -0
  3. package/dist/Broadcast-DU3JnBwZ.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-VWLBlxy1.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0I8IZIR.js} +20 -20
  5. package/dist/Card-hIeQ5XUH.js +825 -0
  6. package/dist/Collections-B1SC1rr7.js +453 -0
  7. package/dist/Credit-BgwI8DR3.js +216 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bz6TSmbW.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D9VR3P2d.js} +1026 -1022
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-AhWnHG02.js → EffectSheet.vue_vue_type_style_index_0_lang-DPgu45MD.js} +29 -29
  10. package/dist/Experience-C2Q-zqV6.js +221 -0
  11. package/dist/Game-DU2pZDGk.js +255 -0
  12. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  13. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  14. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DykNOOFD.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +1 -1
  15. package/dist/{MainLayout-D0AoA1tk.js → MainLayout-B1aJoR95.js} +2 -2
  16. package/dist/Marketing-DWiTQp9I.js +316 -0
  17. package/dist/Member-BEXKBFry.js +69 -0
  18. package/dist/MemberList-DzMdajIf.js +1733 -0
  19. package/dist/MemberOverview-wL_ailso.js +58 -0
  20. package/dist/{MemberTransactions-CTAx5jIV.js → MemberTransactions-Bciankuu.js} +1 -1
  21. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C-BtHxSc.js → MessageInput.vue_vue_type_script_setup_true_lang-DH25Hfk3.js} +46 -46
  22. package/dist/Mission-KzwRlaA5.js +259 -0
  23. package/dist/Point-CSKvZXHc.js +222 -0
  24. package/dist/Promotion-IiwPhx8p.js +221 -0
  25. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CrpJySSp.js → RuleGroup.vue_vue_type_script_setup_true_lang-4zIO3oCr.js} +545 -544
  26. package/dist/Segment-2Q0PonBb.js +447 -0
  27. package/dist/{Setting-Zrj5P_4m.js → Setting-Df5vVRt4.js} +600 -598
  28. package/dist/Store-C0WXCKs6.js +1503 -0
  29. package/dist/StoreRewards-eSSIO0nk.js +401 -0
  30. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DS4APaHw.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BjnCRKGX.js} +106 -108
  31. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-ZYjWlDJ1.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-b0xTcoEp.js} +1 -1
  32. package/dist/{Tier-DVWJyQ9S.js → Tier-v-1FkRU-.js} +464 -449
  33. package/dist/{Title-B5kX64vs.js → Title-CQ2JWqBW.js} +315 -299
  34. package/dist/Transaction-0OouN_6s.js +39 -0
  35. package/dist/Voucher-CL0cgogx.js +488 -0
  36. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  37. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  38. package/dist/app-Bd19eW7X.js +5381 -0
  39. package/dist/app-CfS25Z66.js +34797 -0
  40. package/dist/app-wDQR6dpb.js +39 -0
  41. package/dist/app.js +5 -3
  42. package/dist/business-dQh3AEot.js +78 -0
  43. package/dist/{campaign-BZJuknWK.js → campaign-BOl8AgKA.js} +12 -12
  44. package/dist/{collection.fn-DoCkZ6z4.js → collection.fn-B_YsXmrP.js} +2 -2
  45. package/dist/dto-B8NfyVPG.js +1169 -0
  46. package/dist/{effect-B8kmnKvY.js → effect-C2jCStXO.js} +1 -1
  47. package/dist/{export-Dm6LYnWo.js → export-BtZc3Yzh.js} +3 -3
  48. package/dist/{helper-DR4XK3nv.js → helper-8oGsrM56.js} +1 -1
  49. package/dist/{index-DcUrk07Q.js → index-6FkKY3q0.js} +3 -3
  50. package/dist/{index-Bu4_26qI.js → index-C7oeXRUl.js} +1 -1
  51. package/dist/{index-CuL5-ORK.js → index-CZKYIefW.js} +6 -7
  52. package/dist/{index-yxJMhfxj.js → index-C_0IFnwi.js} +5 -5
  53. package/dist/{index-BryrRq8O.js → index-DCixRRvz.js} +36 -30
  54. package/dist/{index-CkiYkbXb.js → index-DFgt4-VW.js} +1 -1
  55. package/dist/{index-CWf0mh3a.js → index-DYDhH9bi.js} +177 -168
  56. package/dist/{index-boor8e80.js → index-Di-kWSmf.js} +3 -3
  57. package/dist/{app-DkI7dYRN.js → index-Dn0jdj0o.js} +9665 -13024
  58. package/dist/index-DwKqFNF6.js +3 -0
  59. package/dist/{index-BobRgQrE.js → index-HoacsZDk.js} +2 -2
  60. package/dist/{index-BxkxVtgm.js → index-UTQHDUdW.js} +1 -1
  61. package/dist/{loading-BzV5acUX.js → loading-D_AN6p24.js} +6807 -6805
  62. package/dist/{lodash-mg4435Qq.js → lodash-B5I3zXaY.js} +1 -1
  63. package/dist/{membership-CqbsLHqx.js → membership-Ccrx9R6r.js} +3 -3
  64. package/dist/{money-DA_gtp3q.js → money-waD-f-Zz.js} +1 -1
  65. package/dist/{number-C388eyOu.js → number-CwTGGsh9.js} +1 -1
  66. package/dist/{rule-Clmr5y4j.js → rule-DJ07h3Gh.js} +2 -2
  67. package/dist/{rule-builder-BgqNbM-P.js → rule-builder-DJ-acvVD.js} +1 -1
  68. package/dist/style.css +1 -1
  69. package/dist/template-clxvNnbF.js +190 -0
  70. package/dist/{usePagination-o5fgsZwU.js → usePagination-BeF5K3M7.js} +86 -86
  71. package/dist/vue-i18n-BxwiXSkp.js +2365 -0
  72. package/dist/{xlsx-BRdh9e2p.js → xlsx-BB366cdN.js} +1945 -1945
  73. package/package.json +9 -5
  74. package/dist/Broadcast-X69Mtv3b.js +0 -216
  75. package/dist/Card-D0X3v1UF.js +0 -822
  76. package/dist/Collections-umR6Ehqf.js +0 -452
  77. package/dist/Credit-C1EWF7R0.js +0 -214
  78. package/dist/Experience-CqL8wyPm.js +0 -211
  79. package/dist/Game--kYe64EV.js +0 -250
  80. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BjOJ3XSL.js +0 -144
  81. package/dist/Marketing-CTCQ5ZmZ.js +0 -308
  82. package/dist/Member-DCduX7zP.js +0 -91
  83. package/dist/MemberList-B0EkXZJu.js +0 -1729
  84. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  85. package/dist/Mission-CVr9rS_D.js +0 -248
  86. package/dist/Point-BnZ6M74y.js +0 -220
  87. package/dist/Promotion-B0PUve5S.js +0 -218
  88. package/dist/Segment-B-XpkyM5.js +0 -445
  89. package/dist/Store-B2gywCt2.js +0 -1503
  90. package/dist/StoreRewards-D8410Q_-.js +0 -434
  91. package/dist/Transaction-CZBO4v4d.js +0 -36
  92. package/dist/Voucher-se-4JF9B.js +0 -481
  93. package/dist/app-B2ImSO3V.js +0 -53382
  94. package/dist/dto-BWpvRpK2.js +0 -1151
  95. package/dist/template-Dwp7heBA.js +0 -190
@@ -1,29 +1,33 @@
1
1
  import { defineComponent, computed, openBlock, createBlock, unref, ref, watch, resolveComponent, createElementBlock, createElementVNode, Fragment, renderList, createVNode, isRef, createCommentVNode, withCtx, normalizeClass, toDisplayString, renderSlot, createTextVNode, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
2
- import { _ } from "./lodash-mg4435Qq.js";
3
- import { a as useBusinessStore, c as core, J as JsonViewer, z, S as SvcConfig } from "./app-DkI7dYRN.js";
2
+ import { _ } from "./lodash-B5I3zXaY.js";
3
+ import { z } from "./app-Bd19eW7X.js";
4
4
  import { Z as ZodHelper } from "./zod-W_PvIofQ.js";
5
- import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-BWpvRpK2.js";
6
- import { u as useMembershipStore, C as CollectibleOptions } from "./membership-CqbsLHqx.js";
7
- import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-CWf0mh3a.js";
8
- import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-BgqNbM-P.js";
5
+ import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-B8NfyVPG.js";
6
+ import { u as useMembershipStore, C as CollectibleOptions } from "./membership-Ccrx9R6r.js";
7
+ import { u as useBusinessStore } from "./business-dQh3AEot.js";
8
+ import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-DYDhH9bi.js";
9
+ import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-DJ-acvVD.js";
10
+ import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
9
11
  import { h as hooks } from "./moment-BWErdI6_.js";
10
- import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-BryrRq8O.js";
11
- import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-BjOJ3XSL.js";
12
- import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-AhWnHG02.js";
13
- import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-ZYjWlDJ1.js";
14
- import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CrpJySSp.js";
15
- import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-BzV5acUX.js";
16
- import { _ as _sfc_main$q, T as TEMPLATES } from "./index-yxJMhfxj.js";
17
- import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-C-BtHxSc.js";
18
- import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-Clmr5y4j.js";
19
- import "./index-CuL5-ORK.js";
20
- import "./index-boor8e80.js";
21
- import "./index-BobRgQrE.js";
22
- import "./index-CkiYkbXb.js";
12
+ import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-DCixRRvz.js";
13
+ import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js";
14
+ import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-DPgu45MD.js";
15
+ import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-b0xTcoEp.js";
16
+ import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-4zIO3oCr.js";
17
+ import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-D_AN6p24.js";
18
+ import { _ as _sfc_main$q, T as TEMPLATES } from "./index-C_0IFnwi.js";
19
+ import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-DH25Hfk3.js";
20
+ import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-DJ07h3Gh.js";
21
+ import { c as core, S as SvcConfig } from "./index-Dn0jdj0o.js";
22
+ import "./index-CZKYIefW.js";
23
+ import "./index-Di-kWSmf.js";
24
+ import "./index-HoacsZDk.js";
25
+ import "./index-DFgt4-VW.js";
23
26
  import { useCoreStore } from "@feedmepos/mf-common";
24
27
  import { _ as _sfc_main$u } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js";
25
- import { i as initCollectibleConfig } from "./helper-DR4XK3nv.js";
26
- import { C as CollectionUtils } from "./collection.fn-DoCkZ6z4.js";
28
+ import { u as useI18n } from "./vue-i18n-BxwiXSkp.js";
29
+ import { i as initCollectibleConfig } from "./helper-8oGsrM56.js";
30
+ import { C as CollectionUtils } from "./collection.fn-B_YsXmrP.js";
27
31
  import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
28
32
  import { useDialog } from "@feedmepos/ui-library";
29
33
  import { a as cleanPF } from "./object-qECH92oz.js";
@@ -36,27 +40,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
36
40
  }
37
41
  },
38
42
  emits: ["update:model-value"],
39
- setup(e, { emit: d }) {
40
- const n = e, r = computed(() => {
41
- var t;
42
- const [s] = isRuleGroup(n.modelValue) ? Object.values(((t = n.modelValue) == null ? void 0 : t.rules) ?? {}) : [null];
43
- return (s ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
44
- }), o = d;
45
- return (s, l) => (openBlock(), createBlock(_sfc_main$q, {
43
+ setup(e, { emit: m }) {
44
+ const r = e, u = computed(() => {
45
+ var l;
46
+ const [i] = isRuleGroup(r.modelValue) ? Object.values(((l = r.modelValue) == null ? void 0 : l.rules) ?? {}) : [null];
47
+ return (i ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
48
+ }), a = m;
49
+ return (i, o) => (openBlock(), createBlock(_sfc_main$q, {
46
50
  multiselect: !0,
47
51
  items: unref(useMembershipStore)().segmentOptions,
48
- "model-value": unref(r),
49
- "onUpdate:modelValue": l[0] || (l[0] = (t) => o(
52
+ "model-value": unref(u),
53
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => a(
50
54
  "update:model-value",
51
55
  unref(RuleBuilder).setRuleToGroup(
52
56
  unref(RuleBuilder).scaffoldGroup("g_segment"),
53
- unref(RuleBuilder).constructEntry("user.segment", "_hasAny", t)
57
+ unref(RuleBuilder).constructEntry("user.segment", "_hasAny", l)
54
58
  )
55
59
  )),
56
60
  label: "Select segment(s) to match"
57
61
  }, null, 8, ["items", "model-value"]));
58
62
  }
59
- }), _hoisted_1$k = { class: "space-y-16" }, _hoisted_2$h = { key: 0 }, _sfc_main$o = /* @__PURE__ */ defineComponent({
63
+ }), _hoisted_1$k = { class: "space-y-16" }, _hoisted_2$e = { key: 0 }, _sfc_main$o = /* @__PURE__ */ defineComponent({
60
64
  __name: "UserRuleGroup",
61
65
  props: {
62
66
  modelValue: {
@@ -66,10 +70,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
66
70
  }
67
71
  },
68
72
  emits: ["update:model-value"],
69
- setup(e, { emit: d }) {
70
- const n = e, r = d, o = ref(
71
- n.modelValue ? RuleBuilder.getRules(n.modelValue.rules.g_user).length > 0 ? "custom" : RuleBuilder.getRules(n.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
72
- ), s = [
73
+ setup(e, { emit: m }) {
74
+ const r = e, u = m, a = ref(
75
+ r.modelValue ? RuleBuilder.getRules(r.modelValue.rules.g_user).length > 0 ? "custom" : RuleBuilder.getRules(r.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
76
+ ), i = [
73
77
  {
74
78
  value: "all_users",
75
79
  label: "All audience"
@@ -83,58 +87,58 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
83
87
  label: "Custom audience"
84
88
  }
85
89
  ];
86
- return watch(o, async (l, t) => {
87
- var a;
88
- if (t != "all_users" && t != l && RuleBuilder.getRules(
89
- (a = n.modelValue) == null ? void 0 : a.rules[t == "custom" ? "g_user" : "g_segment"]
90
+ return watch(a, async (o, l) => {
91
+ var n;
92
+ if (l != "all_users" && l != o && RuleBuilder.getRules(
93
+ (n = r.modelValue) == null ? void 0 : n.rules[l == "custom" ? "g_user" : "g_segment"]
90
94
  ).length > 0) {
91
- const p = await prompt.confirm(
95
+ const c = await prompt.confirm(
92
96
  "Are you sure you want to change the audience type? This will remove all the rules you have set."
93
97
  );
94
- p && r(
98
+ c && u(
95
99
  "update:model-value",
96
100
  RuleBuilder.setRuleToGroup(
97
- n.modelValue ?? RuleBuilder.scaffoldGroup(),
98
- RuleBuilder.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
101
+ r.modelValue ?? RuleBuilder.scaffoldGroup(),
102
+ RuleBuilder.scaffoldGroup(l == "custom" ? "g_user" : "g_segment")
99
103
  )
100
- ), o.value = p ? l : t;
104
+ ), a.value = c ? o : l;
101
105
  }
102
- }), (l, t) => {
103
- var p, v;
104
- const a = resolveComponent("FmRadio");
106
+ }), (o, l) => {
107
+ var c, v;
108
+ const n = resolveComponent("FmRadio");
105
109
  return openBlock(), createElementBlock("div", _hoisted_1$k, [
106
110
  createElementVNode("div", null, [
107
- (openBlock(), createElementBlock(Fragment, null, renderList(s, (m) => createVNode(a, {
108
- key: m.value,
109
- value: m.value,
110
- label: m.label,
111
- modelValue: unref(o),
112
- "onUpdate:modelValue": t[0] || (t[0] = (g) => isRef(o) ? o.value = g : null)
111
+ (openBlock(), createElementBlock(Fragment, null, renderList(i, (p) => createVNode(n, {
112
+ key: p.value,
113
+ value: p.value,
114
+ label: p.label,
115
+ modelValue: unref(a),
116
+ "onUpdate:modelValue": l[0] || (l[0] = (g) => isRef(a) ? a.value = g : null)
113
117
  }, null, 8, ["value", "label", "modelValue"])), 64))
114
118
  ]),
115
- unref(o) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
119
+ unref(a) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$e, [
116
120
  createVNode(_sfc_main$p, {
117
- modelValue: ((p = e.modelValue) == null ? void 0 : p.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
118
- "onUpdate:modelValue": t[1] || (t[1] = (m) => r(
121
+ modelValue: ((c = e.modelValue) == null ? void 0 : c.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
122
+ "onUpdate:modelValue": l[1] || (l[1] = (p) => u(
119
123
  "update:model-value",
120
124
  unref(RuleBuilder).setRuleToGroup(
121
125
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
122
- m,
126
+ p,
123
127
  "&&"
124
128
  )
125
129
  ))
126
130
  }, null, 8, ["modelValue"])
127
131
  ])) : createCommentVNode("", !0),
128
- unref(o) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
132
+ unref(a) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
129
133
  key: 1,
130
134
  "include-only": "user",
131
135
  "trigger-type": "MEMBERSHIP_JOINED",
132
136
  "model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_user) ?? unref(RuleBuilder).scaffoldGroup("g_user"),
133
- "onUpdate:modelValue": t[2] || (t[2] = (m) => r(
137
+ "onUpdate:modelValue": l[2] || (l[2] = (p) => u(
134
138
  "update:model-value",
135
139
  unref(RuleBuilder).setRuleToGroup(
136
140
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
137
- m,
141
+ p,
138
142
  "&&"
139
143
  )
140
144
  ))
@@ -152,77 +156,77 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
152
156
  }
153
157
  },
154
158
  emits: ["update:model-value"],
155
- setup(e, { emit: d }) {
156
- const n = e, r = d, o = ref(
157
- !n.modelValue || !n.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(n.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
159
+ setup(e, { emit: m }) {
160
+ const r = e, u = m, a = ref(
161
+ !r.modelValue || !r.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(r.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
158
162
  );
159
- watch(o, async (l, t) => {
160
- var a;
161
- if (t == "custom" && l == "all_time" && RuleBuilder.getRules((a = n.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
162
- const p = await prompt.confirm(
163
+ watch(a, async (o, l) => {
164
+ var n;
165
+ if (l == "custom" && o == "all_time" && RuleBuilder.getRules((n = r.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
166
+ const c = await prompt.confirm(
163
167
  "Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
164
168
  );
165
- p && r(
169
+ c && u(
166
170
  "update:model-value",
167
171
  RuleBuilder.setRuleToGroup(
168
- n.modelValue ?? RuleBuilder.scaffoldGroup(),
172
+ r.modelValue ?? RuleBuilder.scaffoldGroup(),
169
173
  RuleBuilder.scaffoldGroup("g_time")
170
174
  )
171
- ), o.value = p ? l : t;
175
+ ), a.value = c ? o : l;
172
176
  }
173
177
  });
174
- async function s(l) {
175
- var t;
176
- if (l == "custom" && RuleBuilder.getRules((t = n.modelValue) == null ? void 0 : t.rules.g_time).length > 0) {
178
+ async function i(o) {
179
+ var l;
180
+ if (o == "custom" && RuleBuilder.getRules((l = r.modelValue) == null ? void 0 : l.rules.g_time).length > 0) {
177
181
  if (!await prompt.confirm(
178
182
  "Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
179
183
  )) {
180
- o.value = "all_time";
184
+ a.value = "all_time";
181
185
  return;
182
186
  }
183
- r(
187
+ u(
184
188
  "update:model-value",
185
189
  RuleBuilder.setRuleToGroup(
186
- n.modelValue ?? RuleBuilder.scaffoldGroup(),
190
+ r.modelValue ?? RuleBuilder.scaffoldGroup(),
187
191
  RuleBuilder.scaffoldGroup("g_time")
188
192
  )
189
193
  );
190
194
  }
191
195
  }
192
- return (l, t) => {
196
+ return (o, l) => {
193
197
  var v;
194
- const a = resolveComponent("FmRadio"), p = resolveComponent("FmRadioGroup");
198
+ const n = resolveComponent("FmRadio"), c = resolveComponent("FmRadioGroup");
195
199
  return openBlock(), createElementBlock("div", _hoisted_1$j, [
196
- createVNode(p, {
197
- modelValue: unref(o),
200
+ createVNode(c, {
201
+ modelValue: unref(a),
198
202
  "onUpdate:modelValue": [
199
- t[0] || (t[0] = (m) => isRef(o) ? o.value = m : null),
200
- t[1] || (t[1] = (m) => s(m))
203
+ l[0] || (l[0] = (p) => isRef(a) ? a.value = p : null),
204
+ l[1] || (l[1] = (p) => i(p))
201
205
  ]
202
206
  }, {
203
207
  default: withCtx(() => [
204
- createVNode(a, {
208
+ createVNode(n, {
205
209
  label: "All time",
206
210
  value: "all_time"
207
211
  }),
208
- createVNode(a, {
212
+ createVNode(n, {
209
213
  label: "Custom date/time",
210
214
  value: "custom"
211
215
  })
212
216
  ]),
213
217
  _: 1
214
218
  }, 8, ["modelValue"]),
215
- unref(o) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
219
+ unref(a) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
216
220
  key: 0,
217
221
  class: "!mt-[0px]",
218
222
  "include-only": "trigger",
219
223
  "trigger-type": "SCHEDULE",
220
224
  "model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
221
- "onUpdate:modelValue": t[2] || (t[2] = (m) => r(
225
+ "onUpdate:modelValue": l[2] || (l[2] = (p) => u(
222
226
  "update:model-value",
223
227
  unref(RuleBuilder).setRuleToGroup(
224
228
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
225
- m,
229
+ p,
226
230
  "&&"
227
231
  )
228
232
  ))
@@ -240,19 +244,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
240
244
  }
241
245
  },
242
246
  emits: ["update:model-value"],
243
- setup(e, { emit: d }) {
244
- const n = d;
245
- return (r, o) => {
246
- var s;
247
+ setup(e, { emit: m }) {
248
+ const r = m;
249
+ return (u, a) => {
250
+ var i;
247
251
  return openBlock(), createBlock(_sfc_main$r, {
248
252
  "include-only": "bill",
249
253
  "trigger-type": "BILL_COMPLETED",
250
- "model-value": ((s = e.modelValue) == null ? void 0 : s.rules.g_bill) ?? unref(RuleBuilder).scaffoldGroup("g_bill"),
251
- "onUpdate:modelValue": o[0] || (o[0] = (l) => n(
254
+ "model-value": ((i = e.modelValue) == null ? void 0 : i.rules.g_bill) ?? unref(RuleBuilder).scaffoldGroup("g_bill"),
255
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => r(
252
256
  "update:model-value",
253
257
  unref(RuleBuilder).setRuleToGroup(
254
258
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
255
- l,
259
+ o,
256
260
  "&&"
257
261
  )
258
262
  ))
@@ -267,29 +271,29 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
267
271
  }
268
272
  },
269
273
  emits: ["update:model-value"],
270
- setup(e, { emit: d }) {
271
- const n = e, r = d, o = computed(() => {
272
- const { property: s, operator: l, equator: t } = RuleBuilder.simplify(
273
- n.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
274
+ setup(e, { emit: m }) {
275
+ const r = e, u = m, a = computed(() => {
276
+ const { property: i, operator: o, equator: l } = RuleBuilder.simplify(
277
+ r.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
274
278
  op: "before",
275
279
  x: 1
276
280
  })
277
281
  );
278
282
  return {
279
- property: s,
280
- operator: l,
281
- equator: t
283
+ property: i,
284
+ operator: o,
285
+ equator: l
282
286
  };
283
287
  });
284
- return (s, l) => {
285
- const t = resolveComponent("FmRadio"), a = resolveComponent("FmStepperField");
288
+ return (i, o) => {
289
+ const l = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
286
290
  return openBlock(), createElementBlock("div", null, [
287
- createVNode(t, {
291
+ createVNode(l, {
288
292
  label: "On birthday",
289
293
  value: "_isRange-day",
290
- "model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
291
- "onUpdate:modelValue": l[0] || (l[0] = () => {
292
- r(
294
+ "model-value": `${unref(a).operator}-${unref(a).equator.unit}`,
295
+ "onUpdate:modelValue": o[0] || (o[0] = () => {
296
+ u(
293
297
  "update:model-value",
294
298
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
295
299
  op: "this",
@@ -299,12 +303,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
299
303
  );
300
304
  })
301
305
  }, null, 8, ["model-value"]),
302
- createVNode(t, {
306
+ createVNode(l, {
303
307
  label: "N days before birthday",
304
308
  value: "_isDay",
305
- "model-value": unref(o).operator,
306
- "onUpdate:modelValue": l[1] || (l[1] = () => {
307
- r(
309
+ "model-value": unref(a).operator,
310
+ "onUpdate:modelValue": o[1] || (o[1] = () => {
311
+ u(
308
312
  "update:model-value",
309
313
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
310
314
  op: "after",
@@ -314,26 +318,26 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
314
318
  );
315
319
  })
316
320
  }, null, 8, ["model-value"]),
317
- unref(o).operator == "_isDay" ? (openBlock(), createBlock(a, {
321
+ unref(a).operator == "_isDay" ? (openBlock(), createBlock(n, {
318
322
  key: 0,
319
323
  label: "Days before birthday",
320
324
  "show-steppers": !1,
321
- "model-value": unref(o).equator.x,
322
- "onUpdate:modelValue": l[2] || (l[2] = (p) => r(
325
+ "model-value": unref(a).equator.x,
326
+ "onUpdate:modelValue": o[2] || (o[2] = (c) => u(
323
327
  "update:model-value",
324
328
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
325
329
  op: "after",
326
- x: p,
330
+ x: c,
327
331
  ignoreYear: !0
328
332
  })
329
333
  ))
330
334
  }, null, 8, ["model-value"])) : createCommentVNode("", !0),
331
- createVNode(t, {
335
+ createVNode(l, {
332
336
  label: "In birthday week",
333
337
  value: "_isRange-week",
334
- "model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
335
- "onUpdate:modelValue": l[3] || (l[3] = () => {
336
- r(
338
+ "model-value": `${unref(a).operator}-${unref(a).equator.unit}`,
339
+ "onUpdate:modelValue": o[3] || (o[3] = () => {
340
+ u(
337
341
  "update:model-value",
338
342
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
339
343
  op: "this",
@@ -343,12 +347,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
343
347
  );
344
348
  })
345
349
  }, null, 8, ["model-value"]),
346
- createVNode(t, {
350
+ createVNode(l, {
347
351
  label: "In birthday month",
348
352
  value: "_isRange-month",
349
- "model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
350
- "onUpdate:modelValue": l[4] || (l[4] = () => {
351
- r(
353
+ "model-value": `${unref(a).operator}-${unref(a).equator.unit}`,
354
+ "onUpdate:modelValue": o[4] || (o[4] = () => {
355
+ u(
352
356
  "update:model-value",
353
357
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
354
358
  op: "this",
@@ -371,19 +375,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
371
375
  }
372
376
  },
373
377
  emits: ["update:model-value"],
374
- setup(e, { emit: d }) {
375
- const n = d;
376
- return (r, o) => {
377
- var s;
378
+ setup(e, { emit: m }) {
379
+ const r = m;
380
+ return (u, a) => {
381
+ var i;
378
382
  return openBlock(), createBlock(_sfc_main$r, {
379
383
  "include-only": "feedback",
380
384
  "trigger-type": "FEEDBACK",
381
- "model-value": ((s = e.modelValue) == null ? void 0 : s.rules.g_feedback) ?? unref(RuleBuilder).scaffoldGroup("g_feedback"),
382
- "onUpdate:modelValue": o[0] || (o[0] = (l) => n(
385
+ "model-value": ((i = e.modelValue) == null ? void 0 : i.rules.g_feedback) ?? unref(RuleBuilder).scaffoldGroup("g_feedback"),
386
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => r(
383
387
  "update:model-value",
384
388
  unref(RuleBuilder).setRuleToGroup(
385
389
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
386
- l,
390
+ o,
387
391
  "&&"
388
392
  )
389
393
  ))
@@ -458,13 +462,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
458
462
  "GAME",
459
463
  "MISSION"
460
464
  ].map((e) => {
461
- const d = CAMPAIGN_TRIGGER[e];
465
+ const m = CAMPAIGN_TRIGGER[e];
462
466
  return [
463
467
  e,
464
- (d == null ? void 0 : d.map((n) => TriggerOptions[n]).filter((n) => !n.hidden)) ?? []
468
+ (m == null ? void 0 : m.map((r) => TriggerOptions[r]).filter((r) => !r.hidden)) ?? []
465
469
  ];
466
470
  })
467
- ), _hoisted_1$i = { class: "space-y-16" }, _hoisted_2$g = /* @__PURE__ */ 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), _hoisted_3$e = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$d = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$8 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
471
+ ), _hoisted_1$i = { class: "space-y-16" }, _hoisted_2$d = { class: "grid grid-cols-3 gap-16" }, _hoisted_3$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$8 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
468
472
  __name: "CampaignTriggerInput",
469
473
  props: {
470
474
  campaignType: {
@@ -480,31 +484,31 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
480
484
  }
481
485
  },
482
486
  emits: ["update:model-value"],
483
- setup(e, { emit: d }) {
484
- const n = e, r = d, o = computed(() => n.disabled ? TypeToTriggerOptions[n.campaignType].filter(
485
- (s) => s.value == n.modelValue
486
- ) : TypeToTriggerOptions[n.campaignType]);
487
- return (s, l) => {
488
- const t = resolveComponent("FmCard");
487
+ setup(e, { emit: m }) {
488
+ const r = e, u = m, a = computed(() => r.disabled ? TypeToTriggerOptions[r.campaignType].filter(
489
+ (i) => i.value == r.modelValue
490
+ ) : TypeToTriggerOptions[r.campaignType]);
491
+ return (i, o) => {
492
+ const l = resolveComponent("FmCard");
489
493
  return openBlock(), createElementBlock("div", _hoisted_1$i, [
490
- _hoisted_2$g,
491
- createElementVNode("div", _hoisted_3$e, [
492
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
494
+ 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)),
495
+ createElementVNode("div", _hoisted_2$d, [
496
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (n) => (openBlock(), createBlock(l, {
493
497
  variant: "outlined",
494
- disabled: n.disabled,
498
+ disabled: r.disabled,
495
499
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
496
- "col-span-3": unref(o).length == 1,
497
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
498
- "hover:bg-fm-color-opacity-sm": e.modelValue != a.value
500
+ "col-span-3": unref(a).length == 1,
501
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
502
+ "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
499
503
  }]),
500
504
  onClick: () => {
501
- n.modelValue != a.value && !n.disabled && r("update:model-value", a.value);
505
+ r.modelValue != n.value && !r.disabled && u("update:model-value", n.value);
502
506
  },
503
- key: a.name
507
+ key: n.name
504
508
  }, {
505
509
  default: withCtx(() => [
506
- createElementVNode("div", _hoisted_4$d, toDisplayString(a.name), 1),
507
- createElementVNode("div", _hoisted_5$8, toDisplayString(a.description), 1)
510
+ createElementVNode("div", _hoisted_3$b, toDisplayString(n.name), 1),
511
+ createElementVNode("div", _hoisted_4$8, toDisplayString(n.description), 1)
508
512
  ]),
509
513
  _: 2
510
514
  }, 1032, ["disabled", "class", "onClick"]))), 128))
@@ -525,27 +529,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
525
529
  }
526
530
  },
527
531
  emits: ["update:model-value"],
528
- setup(e, { emit: d }) {
529
- const n = d;
530
- return (r, o) => {
531
- const s = resolveComponent("FmButton"), l = resolveComponent("FmField"), t = resolveComponent("FmDatePicker");
532
- return openBlock(), createBlock(t, {
532
+ setup(e, { emit: m }) {
533
+ const r = m;
534
+ return (u, a) => {
535
+ const i = resolveComponent("FmButton"), o = resolveComponent("FmField"), l = resolveComponent("FmDatePicker");
536
+ return openBlock(), createBlock(l, {
533
537
  label: e.label,
534
538
  "model-value": e.modelValue || "",
535
- "onUpdate:modelValue": o[1] || (o[1] = (a) => n("update:model-value", a))
539
+ "onUpdate:modelValue": a[1] || (a[1] = (n) => r("update:model-value", n))
536
540
  }, {
537
- "trigger-button": withCtx(({ opened: a }) => [
538
- createVNode(l, {
541
+ "trigger-button": withCtx(({ opened: n }) => [
542
+ createVNode(o, {
539
543
  class: "flex items-center",
540
544
  "prepend-icon": "calendar_month",
541
- "icon-outlined": !a
545
+ "icon-outlined": !n
542
546
  }, {
543
547
  append: withCtx(() => [
544
- e.modelValue ? (openBlock(), createBlock(s, {
548
+ e.modelValue ? (openBlock(), createBlock(i, {
545
549
  key: 0,
546
550
  variant: "tertiary",
547
551
  icon: "clear",
548
- onClick: o[0] || (o[0] = (p) => (p.stopPropagation(), n("update:model-value", null)))
552
+ onClick: a[0] || (a[0] = (c) => (c.stopPropagation(), r("update:model-value", null)))
549
553
  })) : createCommentVNode("", !0)
550
554
  ]),
551
555
  default: withCtx(() => [
@@ -560,7 +564,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
560
564
  }, 8, ["label", "model-value"]);
561
565
  };
562
566
  }
563
- }), _hoisted_1$h = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$f = { class: "flex-1 xs:w-full" }, _hoisted_3$d = /* @__PURE__ */ createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1), _hoisted_4$c = { class: "flex-1 xs:w-full" }, _sfc_main$h = /* @__PURE__ */ defineComponent({
567
+ }), _hoisted_1$h = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$c = { class: "flex-1 xs:w-full" }, _hoisted_3$a = { class: "flex-1 xs:w-full" }, _sfc_main$h = /* @__PURE__ */ defineComponent({
564
568
  __name: "DateRangeInput",
565
569
  props: {
566
570
  modelValue: {
@@ -569,34 +573,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
569
573
  }
570
574
  },
571
575
  emits: ["update:model-value"],
572
- setup(e, { emit: d }) {
573
- const n = d;
574
- return (r, o) => {
575
- var s, l;
576
+ setup(e, { emit: m }) {
577
+ const r = m;
578
+ return (u, a) => {
579
+ var i, o;
576
580
  return openBlock(), createElementBlock("div", _hoisted_1$h, [
577
- createElementVNode("div", _hoisted_2$f, [
581
+ createElementVNode("div", _hoisted_2$c, [
578
582
  createVNode(_sfc_main$i, {
579
- "model-value": ((s = e.modelValue) == null ? void 0 : s.startDate) ?? null,
583
+ "model-value": ((i = e.modelValue) == null ? void 0 : i.startDate) ?? null,
580
584
  label: "Start date",
581
- "onUpdate:modelValue": o[0] || (o[0] = (t) => {
582
- var a;
583
- return n("update:model-value", {
584
- startDate: t,
585
- endDate: ((a = e.modelValue) == null ? void 0 : a.endDate) ?? null
585
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => {
586
+ var n;
587
+ return r("update:model-value", {
588
+ startDate: l,
589
+ endDate: ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null
586
590
  });
587
591
  })
588
592
  }, null, 8, ["model-value"])
589
593
  ]),
590
- _hoisted_3$d,
591
- createElementVNode("div", _hoisted_4$c, [
594
+ a[2] || (a[2] = createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1)),
595
+ createElementVNode("div", _hoisted_3$a, [
592
596
  createVNode(_sfc_main$i, {
593
- "model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
597
+ "model-value": ((o = e.modelValue) == null ? void 0 : o.endDate) ?? null,
594
598
  label: "End date",
595
- "onUpdate:modelValue": o[1] || (o[1] = (t) => {
596
- var a;
597
- return n("update:model-value", {
598
- startDate: ((a = e.modelValue) == null ? void 0 : a.startDate) ?? null,
599
- endDate: t
599
+ "onUpdate:modelValue": a[1] || (a[1] = (l) => {
600
+ var n;
601
+ return r("update:model-value", {
602
+ startDate: ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
603
+ endDate: l
600
604
  });
601
605
  })
602
606
  }, null, 8, ["model-value"])
@@ -604,10 +608,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
604
608
  ]);
605
609
  };
606
610
  }
607
- }), _hoisted_1$g = { class: "space-y-8" }, _hoisted_2$e = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$c = {
611
+ }), _hoisted_1$g = { class: "space-y-8" }, _hoisted_2$b = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$9 = {
608
612
  key: 0,
609
613
  class: "space-y-4"
610
- }, _hoisted_4$b = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$7 = /* @__PURE__ */ createElementVNode("div", null, "Notify date", -1), _hoisted_6$4 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
614
+ }, _hoisted_4$7 = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$4 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
611
615
  __name: "ScheduleRuleInput",
612
616
  props: {
613
617
  modelValue: {
@@ -622,34 +626,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
622
626
  }
623
627
  },
624
628
  emits: ["update:model-value"],
625
- setup(e, { emit: d }) {
626
- const n = e, r = d;
627
- function o() {
628
- const m = RuleBuilder.getRules(n.modelValue);
629
- return m.length == 0 ? "fixed" : m.some(
629
+ setup(e, { emit: m }) {
630
+ const r = e, u = m;
631
+ function a() {
632
+ const p = RuleBuilder.getRules(r.modelValue);
633
+ return p.length == 0 ? "fixed" : p.some(
630
634
  (g) => isRuleEntry(g) && RuleBuilder.simplify(g).operator == "_rrule"
631
635
  ) ? "repeating" : "fixed";
632
636
  }
633
- const s = ref(o()), l = ref(!1), t = computed(() => {
634
- const m = RuleBuilder.getRules(n.modelValue), g = m.find(
635
- (i) => isRuleEntry(i) && RuleBuilder.simplify(i).property == "trigger.date"
636
- ), y = m.find(
637
- (i) => isRuleEntry(i) && RuleBuilder.simplify(i).property == "trigger.time"
637
+ const i = ref(a()), o = ref(!1), l = computed(() => {
638
+ const p = RuleBuilder.getRules(r.modelValue), g = p.find(
639
+ (s) => isRuleEntry(s) && RuleBuilder.simplify(s).property == "trigger.date"
640
+ ), h = p.find(
641
+ (s) => isRuleEntry(s) && RuleBuilder.simplify(s).property == "trigger.time"
638
642
  );
639
643
  return {
640
644
  date: g ? RuleBuilder.simplify(g).equator : null,
641
- time: y ? RuleBuilder.simplify(y).equator : null
645
+ time: h ? RuleBuilder.simplify(h).equator : null
642
646
  };
643
- }), a = computed(
647
+ }), n = computed(
644
648
  () => calculateNextScheduleAt(
645
- n.modelValue,
649
+ r.modelValue,
646
650
  /* @__PURE__ */ new Date(),
647
- n.startDate ? new Date(n.startDate) : void 0,
648
- n.endDate ? new Date(n.endDate) : void 0
651
+ r.startDate ? new Date(r.startDate) : void 0,
652
+ r.endDate ? new Date(r.endDate) : void 0
649
653
  )
650
654
  );
651
- function p(m) {
652
- const g = m.label.toLowerCase(), y = g == "fixed" ? [
655
+ function c(p) {
656
+ const g = p.label.toLowerCase(), h = g == "fixed" ? [
653
657
  RuleBuilder.constructEntry(
654
658
  "trigger.date",
655
659
  "_isOnDate",
@@ -664,73 +668,73 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
664
668
  ),
665
669
  RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
666
670
  ];
667
- r(
671
+ u(
668
672
  "update:model-value",
669
673
  RuleBuilder.setRuleToGroup(
670
674
  RuleBuilder.scaffoldGroup("g_schedule"),
671
- y
675
+ h
672
676
  )
673
- ), s.value = g;
677
+ ), i.value = g;
674
678
  }
675
- function v(m) {
676
- s.value == "fixed" ? r(
679
+ function v(p) {
680
+ i.value == "fixed" ? u(
677
681
  "update:model-value",
678
682
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
679
683
  RuleBuilder.constructEntry(
680
684
  "trigger.date",
681
685
  "_isOnDate",
682
- m.date
686
+ p.date
683
687
  ),
684
688
  RuleBuilder.constructEntry(
685
689
  "trigger.time",
686
690
  "_isOnTime",
687
- m.time
691
+ p.time
688
692
  )
689
693
  ])
690
- ) : r(
694
+ ) : u(
691
695
  "update:model-value",
692
696
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
693
697
  RuleBuilder.constructEntry(
694
698
  "trigger.date",
695
699
  "_rrule",
696
- m.date
700
+ p.date
697
701
  ),
698
702
  RuleBuilder.constructEntry(
699
703
  "trigger.time",
700
704
  "_isOnTime",
701
- m.time
705
+ p.time
702
706
  )
703
707
  ])
704
708
  );
705
709
  }
706
- return (m, g) => {
707
- const y = resolveComponent("FmButtonGroup"), i = resolveComponent("FmTimePicker"), u = resolveComponent("FmIcon"), c = resolveComponent("FmTooltip"), f = resolveComponent("FmField"), k = resolveComponent("FmCard"), C = resolveComponent("FmPopover"), b = resolveComponent("FmDatePicker"), x = resolveComponent("FmHelperText");
710
+ return (p, g) => {
711
+ const h = resolveComponent("FmButtonGroup"), s = resolveComponent("FmTimePicker"), d = resolveComponent("FmIcon"), f = resolveComponent("FmTooltip"), y = resolveComponent("FmField"), C = resolveComponent("FmCard"), E = resolveComponent("FmPopover"), k = resolveComponent("FmDatePicker"), B = resolveComponent("FmHelperText");
708
712
  return openBlock(), createElementBlock(Fragment, null, [
709
- createVNode(y, {
713
+ createVNode(h, {
710
714
  items: [{ label: "Fixed" }, { label: "Repeating" }],
711
- "model-value": { label: unref(cases).title(unref(s)) },
712
- "onUpdate:modelValue": p,
715
+ "model-value": { label: unref(cases).title(unref(i)) },
716
+ "onUpdate:modelValue": c,
713
717
  class: "mb-8"
714
718
  }, null, 8, ["model-value"]),
715
719
  createElementVNode("div", _hoisted_1$g, [
716
- createElementVNode("div", _hoisted_2$e, [
717
- createVNode(i, {
720
+ createElementVNode("div", _hoisted_2$b, [
721
+ createVNode(s, {
718
722
  label: "Notify time",
719
- "model-value": unref(t).time,
720
- "onUpdate:modelValue": g[0] || (g[0] = (E) => v({ date: unref(t).date, time: E })),
721
- "helper-text": unref(t).time ? void 0 : "Time is required",
722
- "helper-state": unref(t).time ? void 0 : "error"
723
+ "model-value": unref(l).time,
724
+ "onUpdate:modelValue": g[0] || (g[0] = (x) => v({ date: unref(l).date, time: x })),
725
+ "helper-text": unref(l).time ? void 0 : "Time is required",
726
+ "helper-state": unref(l).time ? void 0 : "error"
723
727
  }, null, 8, ["model-value", "helper-text", "helper-state"]),
724
- unref(s) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
725
- createElementVNode("div", _hoisted_4$b, [
726
- _hoisted_5$7,
727
- unref(t).date ? (openBlock(), createBlock(c, {
728
+ unref(i) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
729
+ createElementVNode("div", _hoisted_4$7, [
730
+ g[5] || (g[5] = createElementVNode("div", null, "Notify date", -1)),
731
+ unref(l).date ? (openBlock(), createBlock(f, {
728
732
  key: 0,
729
733
  "z-index": 9999,
730
- content: unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options)
734
+ content: unref(SummarizeRrule)(unref(RRule).fromString(unref(l).date).options)
731
735
  }, {
732
736
  default: withCtx(() => [
733
- createVNode(u, {
737
+ createVNode(d, {
734
738
  name: "info",
735
739
  size: "sm",
736
740
  outline: !0
@@ -739,30 +743,30 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
739
743
  _: 1
740
744
  }, 8, ["content"])) : createCommentVNode("", !0)
741
745
  ]),
742
- createVNode(C, {
743
- "show-popover": unref(l),
744
- onPopoverChanged: g[3] || (g[3] = (E) => l.value = E)
746
+ createVNode(E, {
747
+ "show-popover": unref(o),
748
+ onPopoverChanged: g[3] || (g[3] = (x) => o.value = x)
745
749
  }, {
746
750
  "popover-button": withCtx(() => [
747
- createVNode(f, {
751
+ createVNode(y, {
748
752
  class: "cursor-pointer",
749
- "helper-text": unref(t).date ? void 0 : "Date is required",
750
- "helper-state": unref(t).date ? void 0 : "error"
753
+ "helper-text": unref(l).date ? void 0 : "Date is required",
754
+ "helper-state": unref(l).date ? void 0 : "error"
751
755
  }, {
752
756
  default: withCtx(() => [
753
- createElementVNode("div", _hoisted_6$4, toDisplayString(unref(t).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options) : "Set a repeating date"), 1)
757
+ createElementVNode("div", _hoisted_5$4, toDisplayString(unref(l).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(l).date).options) : "Set a repeating date"), 1)
754
758
  ]),
755
759
  _: 1
756
760
  }, 8, ["helper-text", "helper-state"])
757
761
  ]),
758
762
  default: withCtx(() => [
759
- createVNode(k, { class: "elevated p-8 w-[450px]" }, {
763
+ createVNode(C, { class: "elevated p-8 w-[450px]" }, {
760
764
  default: withCtx(() => [
761
765
  createVNode(_sfc_main$s, {
762
766
  "apply-button": !0,
763
- "model-value": unref(t).date || "",
764
- onCancel: g[1] || (g[1] = (E) => l.value = !1),
765
- "onUpdate:modelValue": g[2] || (g[2] = (E) => (v({ date: E, time: unref(t).time }), l.value = !1))
767
+ "model-value": unref(l).date || "",
768
+ onCancel: g[1] || (g[1] = (x) => o.value = !1),
769
+ "onUpdate:modelValue": g[2] || (g[2] = (x) => (v({ date: x, time: unref(l).time }), o.value = !1))
766
770
  }, null, 8, ["model-value"])
767
771
  ]),
768
772
  _: 1
@@ -770,19 +774,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
770
774
  ]),
771
775
  _: 1
772
776
  }, 8, ["show-popover"])
773
- ])) : (openBlock(), createBlock(b, {
777
+ ])) : (openBlock(), createBlock(k, {
774
778
  key: 1,
775
779
  label: "Notify date",
776
- "model-value": unref(t).date || "",
777
- "onUpdate:modelValue": g[4] || (g[4] = (E) => v({ date: E, time: unref(t).time })),
778
- "helper-text": unref(t).date ? void 0 : "Date is required",
779
- "helper-state": unref(t).date ? void 0 : "error"
780
+ "model-value": unref(l).date || "",
781
+ "onUpdate:modelValue": g[4] || (g[4] = (x) => v({ date: x, time: unref(l).time })),
782
+ "helper-text": unref(l).date ? void 0 : "Date is required",
783
+ "helper-state": unref(l).date ? void 0 : "error"
780
784
  }, null, 8, ["model-value", "helper-text", "helper-state"]))
781
785
  ]),
782
- unref(t).date && unref(t).time && unref(a) ? (openBlock(), createBlock(x, {
786
+ unref(l).date && unref(l).time && unref(n) ? (openBlock(), createBlock(B, {
783
787
  key: 0,
784
- text: `${unref(hooks)(unref(a)).isAfter(unref(hooks)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(hooks)(unref(a)).format("dddd, DD MMM YYYY")} at
785
- ${unref(hooks)(unref(a)).format("hh:mmA")} (${unref(hooks)(unref(a)).fromNow()})`
788
+ 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
789
+ ${unref(hooks)(unref(n)).format("hh:mmA")} (${unref(hooks)(unref(n)).fromNow()})`
786
790
  }, null, 8, ["text"])) : createCommentVNode("", !0)
787
791
  ])
788
792
  ], 64);
@@ -795,28 +799,28 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
795
799
  filterItems: { type: Function }
796
800
  },
797
801
  emits: ["confirm"],
798
- setup(e, { emit: d }) {
799
- const n = ref(), r = ref(!1);
800
- function o() {
801
- var l;
802
- (l = n.value) == null || l.onConfirm();
802
+ setup(e, { emit: m }) {
803
+ const r = ref(), u = ref(!1);
804
+ function a() {
805
+ var o;
806
+ (o = r.value) == null || o.onConfirm();
803
807
  }
804
- const s = d;
805
- return (l, t) => {
806
- const a = resolveComponent("FmField"), p = resolveComponent("FmButton"), v = resolveComponent("FmSideSheet");
808
+ const i = m;
809
+ return (o, l) => {
810
+ const n = resolveComponent("FmField"), c = resolveComponent("FmButton"), v = resolveComponent("FmSideSheet");
807
811
  return openBlock(), createBlock(v, {
808
- modelValue: r.value,
809
- "onUpdate:modelValue": t[1] || (t[1] = (m) => r.value = m),
812
+ modelValue: u.value,
813
+ "onUpdate:modelValue": l[1] || (l[1] = (p) => u.value = p),
810
814
  title: "Select Items",
811
815
  "close-button": !1,
812
816
  "dismiss-away": !0,
813
817
  "max-width": 560
814
818
  }, {
815
819
  "side-sheet-button": withCtx(() => [
816
- renderSlot(l.$slots, "side-sheet-button", {}, () => [
817
- createVNode(a, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
820
+ renderSlot(o.$slots, "side-sheet-button", {}, () => [
821
+ createVNode(n, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
818
822
  default: withCtx(() => [
819
- createTextVNode(toDisplayString(l.modelValue.length) + " item(s) selected ", 1)
823
+ createTextVNode(toDisplayString(o.modelValue.length) + " item(s) selected ", 1)
820
824
  ]),
821
825
  _: 1
822
826
  })
@@ -824,14 +828,14 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
824
828
  ]),
825
829
  "side-sheet-footer": withCtx(() => [
826
830
  createElementVNode("div", _hoisted_1$f, [
827
- createVNode(p, {
831
+ createVNode(c, {
828
832
  variant: "tertiary",
829
- onClick: t[0] || (t[0] = (m) => r.value = !1),
833
+ onClick: l[0] || (l[0] = (p) => u.value = !1),
830
834
  label: "Cancel"
831
835
  }),
832
- createVNode(p, {
836
+ createVNode(c, {
833
837
  variant: "primary",
834
- onClick: o,
838
+ onClick: a,
835
839
  label: "Confirm"
836
840
  })
837
841
  ])
@@ -841,11 +845,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
841
845
  class: "h-full",
842
846
  "max-height": 0,
843
847
  ref_key: "selectItemRef",
844
- ref: n,
845
- "initial-value": l.modelValue,
846
- "filter-items": l.filterItems,
847
- "on-complete": (m) => {
848
- s("confirm", m), r.value = !1;
848
+ ref: r,
849
+ "initial-value": o.modelValue,
850
+ "filter-items": o.filterItems,
851
+ "on-complete": (p) => {
852
+ i("confirm", p), u.value = !1;
849
853
  }
850
854
  }, null, 8, ["initial-value", "filter-items", "on-complete"])
851
855
  ]),
@@ -853,13 +857,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
853
857
  }, 8, ["modelValue"]);
854
858
  };
855
859
  }
856
- }), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$d = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$a = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$6 = { class: "space-y-16" }, _hoisted_6$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1), _hoisted_7$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1), _hoisted_8$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_9$3 = {
860
+ }), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$a = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$8 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$6 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$3 = { class: "space-y-16" }, _hoisted_6$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_7$2 = {
857
861
  key: 0,
858
862
  class: "xs:!block flex gap-16 items-center pt-8"
859
- }, _hoisted_10$3 = /* @__PURE__ */ createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1), _hoisted_11$1 = { class: "fm-typo-en-body-lg-400" }, _hoisted_12$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_13 = {
863
+ }, _hoisted_8$1 = { class: "fm-typo-en-body-lg-400" }, _hoisted_9$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_10$1 = {
860
864
  key: 0,
861
865
  class: "pt-8 space-y-8"
862
- }, _hoisted_14 = { class: "flex items-center gap-16 xs:block xs:space-y-8 w-fit" }, _hoisted_15 = { class: "xs:!block flex gap-16 items-center" }, _hoisted_16 = /* @__PURE__ */ createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1), _sfc_main$e = /* @__PURE__ */ defineComponent({
866
+ }, _hoisted_11$1 = { class: "flex items-center gap-16 xs:block xs:space-y-8 w-fit" }, _hoisted_12 = { class: "xs:!block flex gap-16 items-center" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
863
867
  __name: "EarningOptionInput",
864
868
  props: {
865
869
  modelValue: {
@@ -876,9 +880,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
876
880
  }
877
881
  },
878
882
  emits: ["update:model-value"],
879
- setup(e, { emit: d }) {
880
- var v, m, g;
881
- const n = useBusinessStore(), r = e, o = d, s = [
883
+ setup(e, { emit: m }) {
884
+ var v, p, g;
885
+ const r = useBusinessStore(), u = e, a = m, i = [
882
886
  {
883
887
  label: "Based on spending",
884
888
  sublabel: "Customers earn rewards based on how much they spend.",
@@ -889,22 +893,22 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
889
893
  sublabel: "Customers earn a set amount of rewards for specific actions.",
890
894
  value: "FIXED"
891
895
  }
892
- ].filter((y) => {
893
- var i, u;
894
- return r.fixedType || ((u = (i = r.extras) == null ? void 0 : i.campaign) == null ? void 0 : u.event.type) != "BILL_COMPLETED" ? y.value == "FIXED" : !0;
896
+ ].filter((h) => {
897
+ var s, d;
898
+ return u.fixedType || ((d = (s = u.extras) == null ? void 0 : s.campaign) == null ? void 0 : d.event.type) != "BILL_COMPLETED" ? h.value == "FIXED" : !0;
899
+ }), o = computed(() => {
900
+ var s, d;
901
+ const h = u.extras && "configs" in u.extras ? u.extras.configs.type : (s = u.extras) == null ? void 0 : s.campaign.type;
902
+ return (((d = CollectibleOptions[h]) == null ? void 0 : d.name) || "reward").toLowerCase();
895
903
  }), l = computed(() => {
896
- var i, u;
897
- const y = r.extras && "configs" in r.extras ? r.extras.configs.type : (i = r.extras) == null ? void 0 : i.campaign.type;
898
- return (((u = CollectibleOptions[y]) == null ? void 0 : u.name) || "reward").toLowerCase();
899
- }), t = computed(() => {
900
- const y = FdoEarningOption.safeParse(r.modelValue);
901
- return y.success ? [] : y.error.errors;
904
+ const h = FdoEarningOption.safeParse(u.modelValue);
905
+ return h.success ? [] : h.error.errors;
902
906
  });
903
- function a(y) {
904
- var i;
905
- y != ((i = r.modelValue) == null ? void 0 : i.type) && o(
907
+ function n(h) {
908
+ var s;
909
+ h != ((s = u.modelValue) == null ? void 0 : s.type) && a(
906
910
  "update:model-value",
907
- y === "FIXED" ? {
911
+ h === "FIXED" ? {
908
912
  type: "FIXED",
909
913
  amount: 1
910
914
  } : {
@@ -914,91 +918,91 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
914
918
  }
915
919
  );
916
920
  }
917
- const p = ref(
918
- ((v = r.modelValue) == null ? void 0 : v.type) === "PROPORTIONAL" && !!((g = (m = r.modelValue) == null ? void 0 : m.property) != null && g.length) || !1
921
+ const c = ref(
922
+ ((v = u.modelValue) == null ? void 0 : v.type) === "PROPORTIONAL" && !!((g = (p = u.modelValue) == null ? void 0 : p.property) != null && g.length) || !1
919
923
  );
920
- return (y, i) => {
921
- var E, V, N;
922
- const u = resolveComponent("FmCard"), c = resolveComponent("FmStepperField"), f = resolveComponent("FmRadio"), k = resolveComponent("FmPill"), C = resolveComponent("FmButton"), b = resolveComponent("FmRadioGroup"), x = resolveComponent("FmHelperText");
924
+ return (h, s) => {
925
+ var x, b, S;
926
+ const d = resolveComponent("FmCard"), f = resolveComponent("FmStepperField"), y = resolveComponent("FmRadio"), C = resolveComponent("FmPill"), E = resolveComponent("FmButton"), k = resolveComponent("FmRadioGroup"), B = resolveComponent("FmHelperText");
923
927
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
924
- createElementVNode("div", _hoisted_2$d, [
925
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (h) => {
926
- var R, B;
927
- return openBlock(), createBlock(u, {
928
+ createElementVNode("div", _hoisted_2$a, [
929
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (V) => {
930
+ var N, R;
931
+ return openBlock(), createBlock(d, {
928
932
  variant: "outlined",
929
933
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
930
- "col-span-2": unref(s).length == 1,
931
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((R = e.modelValue) == null ? void 0 : R.type) === h.value,
932
- "hover:bg-fm-color-opacity-sm": ((B = e.modelValue) == null ? void 0 : B.type) != h.value
934
+ "col-span-2": unref(i).length == 1,
935
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((N = e.modelValue) == null ? void 0 : N.type) === V.value,
936
+ "hover:bg-fm-color-opacity-sm": ((R = e.modelValue) == null ? void 0 : R.type) != V.value
933
937
  }]),
934
- onClick: ($) => a(h.value),
935
- key: h.value
938
+ onClick: (w) => n(V.value),
939
+ key: V.value
936
940
  }, {
937
941
  default: withCtx(() => [
938
- createElementVNode("div", _hoisted_3$b, toDisplayString(h.label), 1),
939
- createElementVNode("div", _hoisted_4$a, toDisplayString(h.sublabel), 1)
942
+ createElementVNode("div", _hoisted_3$8, toDisplayString(V.label), 1),
943
+ createElementVNode("div", _hoisted_4$6, toDisplayString(V.sublabel), 1)
940
944
  ]),
941
945
  _: 2
942
946
  }, 1032, ["class", "onClick"]);
943
947
  }), 128))
944
948
  ]),
945
- createElementVNode("div", _hoisted_5$6, [
946
- ((E = e.modelValue) == null ? void 0 : E.type) === "FIXED" ? (openBlock(), createBlock(c, {
949
+ createElementVNode("div", _hoisted_5$3, [
950
+ ((x = e.modelValue) == null ? void 0 : x.type) === "FIXED" ? (openBlock(), createBlock(f, {
947
951
  key: 0,
948
- label: `Receive ${unref(l)}(s)`,
952
+ label: `Receive ${unref(o)}(s)`,
949
953
  class: "flex-1",
950
- "model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
951
- "onUpdate:modelValue": i[0] || (i[0] = (h) => o("update:model-value", {
954
+ "model-value": ((b = e.modelValue) == null ? void 0 : b.amount) ?? null,
955
+ "onUpdate:modelValue": s[0] || (s[0] = (V) => a("update:model-value", {
952
956
  ...e.modelValue ?? { type: "FIXED" },
953
- amount: h
957
+ amount: V
954
958
  }))
955
- }, null, 8, ["label", "model-value"])) : ((N = e.modelValue) == null ? void 0 : N.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
956
- _hoisted_6$3,
957
- createVNode(b, {
958
- "model-value": unref(p),
959
- "onUpdate:modelValue": i[6] || (i[6] = (h) => {
960
- unref(p) != h && (o("update:model-value", {
959
+ }, null, 8, ["label", "model-value"])) : ((S = e.modelValue) == null ? void 0 : S.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
960
+ s[11] || (s[11] = createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1)),
961
+ createVNode(k, {
962
+ "model-value": unref(c),
963
+ "onUpdate:modelValue": s[6] || (s[6] = (V) => {
964
+ unref(c) != V && (a("update:model-value", {
961
965
  ...e.modelValue ?? {
962
966
  type: "PROPORTIONAL",
963
967
  amount: 1,
964
968
  every: 1
965
969
  },
966
- property: h ? [] : void 0,
970
+ property: V ? [] : void 0,
967
971
  every: 1
968
- }), p.value = h);
972
+ }), c.value = V);
969
973
  })
970
974
  }, {
971
975
  default: withCtx(() => [
972
- createVNode(f, {
976
+ createVNode(y, {
973
977
  label: "Amount spent",
974
- sublabel: `Receive ${unref(l)} by amount spent`,
978
+ sublabel: `Receive ${unref(o)} by amount spent`,
975
979
  value: !1
976
980
  }, {
977
981
  label: withCtx(() => {
978
- var h, R;
982
+ var V, N;
979
983
  return [
980
- _hoisted_7$3,
981
- createElementVNode("div", _hoisted_8$3, " Receive " + toDisplayString(unref(l)) + " by amount spent ", 1),
982
- unref(p) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_9$3, [
983
- createVNode(c, {
984
- label: `Receive ${unref(l)}(s)`,
984
+ s[8] || (s[8] = createElementVNode("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1)),
985
+ createElementVNode("div", _hoisted_6$3, " Receive " + toDisplayString(unref(o)) + " by amount spent ", 1),
986
+ unref(c) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_7$2, [
987
+ createVNode(f, {
988
+ label: `Receive ${unref(o)}(s)`,
985
989
  inputmode: "decimal",
986
990
  class: "flex-1",
987
- "model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
988
- "onUpdate:modelValue": i[1] || (i[1] = (B) => o("update:model-value", {
991
+ "model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
992
+ "onUpdate:modelValue": s[1] || (s[1] = (R) => a("update:model-value", {
989
993
  ...e.modelValue ?? { type: "FIXED" },
990
- amount: B
994
+ amount: R
991
995
  }))
992
996
  }, null, 8, ["label", "model-value"]),
993
- _hoisted_10$3,
994
- createVNode(c, {
997
+ s[7] || (s[7] = createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1)),
998
+ createVNode(f, {
995
999
  label: `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
996
1000
  class: "flex-1",
997
1001
  inputmode: "decimal",
998
- "model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
999
- "onUpdate:modelValue": i[2] || (i[2] = (B) => o("update:model-value", {
1002
+ "model-value": ((N = e.modelValue) == null ? void 0 : N.every) ?? null,
1003
+ "onUpdate:modelValue": s[2] || (s[2] = (R) => a("update:model-value", {
1000
1004
  ...e.modelValue,
1001
- every: B
1005
+ every: R
1002
1006
  }))
1003
1007
  }, {
1004
1008
  prepend: withCtx(() => [
@@ -1011,34 +1015,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1011
1015
  }),
1012
1016
  _: 1
1013
1017
  }, 8, ["sublabel"]),
1014
- createVNode(f, {
1018
+ createVNode(y, {
1015
1019
  label: "Product bought",
1016
- sublabel: `Receive ${unref(l)} by product bought`,
1020
+ sublabel: `Receive ${unref(o)} by product bought`,
1017
1021
  value: !0,
1018
- disabled: !unref(n).isPremium
1022
+ disabled: !unref(r).isPremium
1019
1023
  }, {
1020
1024
  label: withCtx(() => {
1021
- var h, R;
1025
+ var V, N;
1022
1026
  return [
1023
- createElementVNode("div", _hoisted_11$1, [
1024
- createTextVNode(" Product bought "),
1025
- createVNode(k, { variant: "premium" })
1027
+ createElementVNode("div", _hoisted_8$1, [
1028
+ s[9] || (s[9] = createTextVNode(" Product bought ")),
1029
+ createVNode(C, { variant: "premium" })
1026
1030
  ]),
1027
- createElementVNode("div", _hoisted_12$1, " Receive " + toDisplayString(unref(l)) + " by product bought ", 1),
1028
- unref(p) ? (openBlock(), createElementBlock("div", _hoisted_13, [
1029
- createElementVNode("div", _hoisted_14, [
1031
+ createElementVNode("div", _hoisted_9$1, " Receive " + toDisplayString(unref(o)) + " by product bought ", 1),
1032
+ unref(c) ? (openBlock(), createElementBlock("div", _hoisted_10$1, [
1033
+ createElementVNode("div", _hoisted_11$1, [
1030
1034
  createVNode(_sfc_main$f, {
1031
- "model-value": r.modelValue.property || [],
1032
- onConfirm: i[3] || (i[3] = (B) => o("update:model-value", {
1035
+ "model-value": u.modelValue.property || [],
1036
+ onConfirm: s[3] || (s[3] = (R) => a("update:model-value", {
1033
1037
  ...e.modelValue,
1034
- property: B
1038
+ property: R
1035
1039
  }))
1036
1040
  }, {
1037
1041
  "side-sheet-button": withCtx(() => {
1038
- var B, $;
1042
+ var R, w;
1039
1043
  return [
1040
- createVNode(C, {
1041
- label: (B = r.modelValue.property) != null && B.length ? `${($ = r.modelValue.property) == null ? void 0 : $.length} product(s) selected` : "Select product",
1044
+ createVNode(E, {
1045
+ label: (R = u.modelValue.property) != null && R.length ? `${(w = u.modelValue.property) == null ? void 0 : w.length} product(s) selected` : "Select product",
1042
1046
  icon: "link",
1043
1047
  variant: "secondary"
1044
1048
  }, null, 8, ["label"])
@@ -1047,27 +1051,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1047
1051
  _: 1
1048
1052
  }, 8, ["model-value"])
1049
1053
  ]),
1050
- createElementVNode("div", _hoisted_15, [
1051
- createVNode(c, {
1054
+ createElementVNode("div", _hoisted_12, [
1055
+ createVNode(f, {
1052
1056
  inputmode: "decimal",
1053
- label: `Receive ${unref(l)}(s)`,
1057
+ label: `Receive ${unref(o)}(s)`,
1054
1058
  class: "flex-1",
1055
- "model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
1056
- "onUpdate:modelValue": i[4] || (i[4] = (B) => o("update:model-value", {
1059
+ "model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
1060
+ "onUpdate:modelValue": s[4] || (s[4] = (R) => a("update:model-value", {
1057
1061
  ...e.modelValue ?? { type: "FIXED" },
1058
- amount: B
1062
+ amount: R
1059
1063
  }))
1060
1064
  }, null, 8, ["label", "model-value"]),
1061
- _hoisted_16,
1062
- createVNode(c, {
1065
+ s[10] || (s[10] = createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1)),
1066
+ createVNode(f, {
1063
1067
  label: "Item purchased",
1064
1068
  class: "flex-1",
1065
- "model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
1069
+ "model-value": ((N = e.modelValue) == null ? void 0 : N.every) ?? null,
1066
1070
  inputmode: "numeric",
1067
1071
  "max-fraction-digits": 0,
1068
- "onUpdate:modelValue": i[5] || (i[5] = (B) => o("update:model-value", {
1072
+ "onUpdate:modelValue": s[5] || (s[5] = (R) => a("update:model-value", {
1069
1073
  ...e.modelValue,
1070
- every: B
1074
+ every: R
1071
1075
  }))
1072
1076
  }, null, 8, ["model-value"])
1073
1077
  ])
@@ -1081,16 +1085,16 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1081
1085
  }, 8, ["model-value"])
1082
1086
  ], 64)) : createCommentVNode("", !0)
1083
1087
  ]),
1084
- e.errorText || unref(t).length > 0 ? (openBlock(), createBlock(x, {
1088
+ e.errorText || unref(l).length > 0 ? (openBlock(), createBlock(B, {
1085
1089
  key: 0,
1086
1090
  class: "!mt-4",
1087
- text: e.errorText || unref(ZodHelper).helperText(unref(t), ""),
1091
+ text: e.errorText || unref(ZodHelper).helperText(unref(l), ""),
1088
1092
  state: "error"
1089
1093
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1090
1094
  ]);
1091
1095
  };
1092
1096
  }
1093
- }), _hoisted_1$d = { class: "space-y-16" }, _hoisted_2$c = /* @__PURE__ */ 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), _hoisted_3$a = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$9 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
1097
+ }), _hoisted_1$d = { class: "space-y-16" }, _hoisted_2$9 = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$7 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
1094
1098
  __name: "GameTypeInput",
1095
1099
  props: {
1096
1100
  modelValue: {
@@ -1098,8 +1102,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1098
1102
  }
1099
1103
  },
1100
1104
  emits: ["update:model-value"],
1101
- setup(e, { emit: d }) {
1102
- const n = e, r = d, o = computed(
1105
+ setup(e, { emit: m }) {
1106
+ const r = e, u = m, a = computed(
1103
1107
  () => [
1104
1108
  {
1105
1109
  label: "Fortune Wheel",
@@ -1113,28 +1117,28 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1113
1117
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
1114
1118
  hidden: !0
1115
1119
  }
1116
- ].filter((s) => !s.hidden)
1120
+ ].filter((i) => !i.hidden)
1117
1121
  );
1118
- return (s, l) => {
1119
- const t = resolveComponent("FmCard");
1122
+ return (i, o) => {
1123
+ const l = resolveComponent("FmCard");
1120
1124
  return openBlock(), createElementBlock("div", _hoisted_1$d, [
1121
- _hoisted_2$c,
1122
- createElementVNode("div", _hoisted_3$a, [
1123
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
1125
+ 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)),
1126
+ createElementVNode("div", _hoisted_2$9, [
1127
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (n) => (openBlock(), createBlock(l, {
1124
1128
  variant: "outlined",
1125
1129
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1126
- "col-span-2": unref(o).length == 1,
1127
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
1128
- "hover:bg-fm-color-opacity-sm": e.modelValue != a.value
1130
+ "col-span-2": unref(a).length == 1,
1131
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
1132
+ "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
1129
1133
  }]),
1130
1134
  onClick: () => {
1131
- n.modelValue != a.value && r("update:model-value", a.value);
1135
+ r.modelValue != n.value && u("update:model-value", n.value);
1132
1136
  },
1133
- key: a.value
1137
+ key: n.value
1134
1138
  }, {
1135
1139
  default: withCtx(() => [
1136
- createElementVNode("div", _hoisted_4$9, toDisplayString(a.label), 1),
1137
- createElementVNode("div", _hoisted_5$5, toDisplayString(a.description), 1)
1140
+ createElementVNode("div", _hoisted_3$7, toDisplayString(n.label), 1),
1141
+ createElementVNode("div", _hoisted_4$5, toDisplayString(n.description), 1)
1138
1142
  ]),
1139
1143
  _: 2
1140
1144
  }, 1032, ["class", "onClick"]))), 128))
@@ -1142,7 +1146,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1142
1146
  ]);
1143
1147
  };
1144
1148
  }
1145
- }), _hoisted_1$c = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, _hoisted_2$b = /* @__PURE__ */ createElementVNode("div", null, "Voucher description should not exceed 200 characters.", -1), _hoisted_3$9 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), _hoisted_4$8 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Usage configuration", -1), _hoisted_5$4 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), _sfc_main$c = /* @__PURE__ */ defineComponent({
1149
+ }), _hoisted_1$c = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
1146
1150
  __name: "VoucherEditor",
1147
1151
  props: {
1148
1152
  modelValue: {
@@ -1153,33 +1157,33 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1153
1157
  }
1154
1158
  },
1155
1159
  emits: ["update:model-value", "update:reward-image"],
1156
- setup(e, { emit: d }) {
1157
- const r = ref(
1160
+ setup(e, { emit: m }) {
1161
+ const { t: r } = useI18n(), a = ref(
1158
1162
  e.modelValue ?? initCollectibleConfig("VOUCHER", {
1159
1163
  business: useCoreStore().currentBusiness.value._id,
1160
1164
  name: ""
1161
1165
  })
1162
- ), o = FdtoCollectibleConfig, s = d;
1163
- return (l, t) => {
1164
- var m, g, y;
1165
- const a = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), v = resolveComponent("FmSwitch");
1166
+ ), i = FdtoCollectibleConfig, o = m;
1167
+ return (l, n) => {
1168
+ var p, g, h;
1169
+ const c = resolveComponent("FmTextarea"), v = resolveComponent("FmHelperText");
1166
1170
  return openBlock(), createElementBlock(Fragment, null, [
1167
1171
  createVNode(_sfc_main$u, {
1168
- modelValue: unref(r).name,
1169
- "onUpdate:modelValue": t[0] || (t[0] = (i) => unref(r).name = i),
1172
+ modelValue: unref(a).name,
1173
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => unref(a).name = s),
1170
1174
  label: "Voucher name",
1171
- schema: unref(ZodHelper).typeAtPath(unref(o), "name", [unref(r).type])
1175
+ schema: unref(ZodHelper).typeAtPath(unref(i), "name", [unref(a).type])
1172
1176
  }, null, 8, ["modelValue", "schema"]),
1173
- createVNode(a, {
1177
+ createVNode(c, {
1174
1178
  class: "!mb-[-16px]",
1175
- modelValue: unref(r).description,
1176
- "onUpdate:modelValue": t[1] || (t[1] = (i) => unref(r).description = i),
1177
- rules: [unref(ZodHelper).ruleAtPath(unref(o), "description", [unref(r).type])]
1179
+ modelValue: unref(a).description,
1180
+ "onUpdate:modelValue": n[1] || (n[1] = (s) => unref(a).description = s),
1181
+ rules: [unref(ZodHelper).ruleAtPath(unref(i), "description", [unref(a).type])]
1178
1182
  }, {
1179
1183
  label: withCtx(() => [
1180
1184
  (openBlock(), createBlock(resolveDynamicComponent(
1181
1185
  unref(ZodHelper).toInputLabel(
1182
- unref(ZodHelper).typeAtPath(unref(o), "description", [unref(r).type]),
1186
+ unref(ZodHelper).typeAtPath(unref(i), "description", [unref(a).type]),
1183
1187
  "Voucher description"
1184
1188
  )
1185
1189
  )))
@@ -1187,153 +1191,146 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1187
1191
  _: 1
1188
1192
  }, 8, ["modelValue", "rules"]),
1189
1193
  createElementVNode("div", _hoisted_1$c, [
1190
- _hoisted_2$b,
1191
- createElementVNode("div", null, toDisplayString(((m = unref(r).description) == null ? void 0 : m.length) ?? 0) + "/200", 1)
1194
+ n[6] || (n[6] = createElementVNode("div", null, "Voucher description should not exceed 200 characters.", -1)),
1195
+ createElementVNode("div", null, toDisplayString(((p = unref(a).description) == null ? void 0 : p.length) ?? 0) + "/200", 1)
1192
1196
  ]),
1193
1197
  createVNode(_sfc_main$v, {
1194
1198
  class: "w-1/2 xs:w-2/3",
1195
1199
  "aspect-ratio": "16/9",
1196
1200
  file: e.rewardImage ?? void 0,
1197
- thumbnail: unref(r).image ?? void 0,
1198
- "onUpdate:file": t[2] || (t[2] = async (i) => {
1199
- s("update:reward-image", i), i || (unref(r).image = null);
1201
+ thumbnail: unref(a).image ?? void 0,
1202
+ "onUpdate:file": n[2] || (n[2] = async (s) => {
1203
+ o("update:reward-image", s), s || (unref(a).image = null);
1200
1204
  })
1201
1205
  }, {
1202
1206
  label: withCtx(() => [
1203
1207
  (openBlock(), createBlock(resolveDynamicComponent(
1204
1208
  unref(ZodHelper).toInputLabel(
1205
- unref(ZodHelper).typeAtPath(unref(o), "image", [unref(r).type]),
1209
+ unref(ZodHelper).typeAtPath(unref(i), "image", [unref(a).type]),
1206
1210
  "Voucher image"
1207
1211
  )
1208
1212
  )))
1209
1213
  ]),
1210
1214
  _: 1
1211
1215
  }, 8, ["file", "thumbnail"]),
1212
- _hoisted_3$9,
1216
+ n[7] || (n[7] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1)),
1213
1217
  createVNode(_sfc_main$w, {
1214
- "model-value": unref(r).extras.effect,
1215
- "onUpdate:modelValue": t[3] || (t[3] = (i) => unref(r).extras.effect = i)
1218
+ "model-value": unref(a).extras.effect,
1219
+ "onUpdate:modelValue": n[3] || (n[3] = (s) => unref(a).extras.effect = s)
1216
1220
  }, null, 8, ["model-value"]),
1217
- unref(r).extras.effect == null ? (openBlock(), createBlock(p, {
1221
+ unref(a).extras.effect == null ? (openBlock(), createBlock(v, {
1218
1222
  key: 0,
1219
1223
  class: "!mt-8",
1220
- text: "Effect is required",
1224
+ text: unref(r)("connect.campaign.common.effect_required"),
1221
1225
  state: "error"
1222
- })) : createCommentVNode("", !0),
1223
- _hoisted_4$8,
1226
+ }, null, 8, ["text"])) : createCommentVNode("", !0),
1227
+ n[8] || (n[8] = createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Usage configuration", -1)),
1224
1228
  createVNode(_sfc_main$x, {
1225
- "model-value": unref(r).options,
1226
- "no-campaign": unref(r).noCampaign,
1227
- "onUpdate:modelValue": t[4] || (t[4] = (i) => unref(r).options = i),
1228
- schema: unref(ZodHelper).typeAtPath(unref(o), "options", ["VOUCHER"])
1229
+ "model-value": unref(a).options,
1230
+ "no-campaign": unref(a).noCampaign,
1231
+ "onUpdate:modelValue": n[4] || (n[4] = (s) => unref(a).options = s),
1232
+ schema: unref(ZodHelper).typeAtPath(unref(i), "options", ["VOUCHER"])
1229
1233
  }, null, 8, ["model-value", "no-campaign", "schema"]),
1230
- _hoisted_5$4,
1231
- unref(r).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$y, {
1234
+ n[9] || (n[9] = createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1)),
1235
+ unref(a).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$y, {
1232
1236
  key: 1,
1233
- "model-value": ((y = (g = unref(r).extras) == null ? void 0 : g.targetLocation) == null ? void 0 : y.map(String)) ?? null,
1237
+ "model-value": ((h = (g = unref(a).extras) == null ? void 0 : g.targetLocation) == null ? void 0 : h.map(String)) ?? null,
1234
1238
  type: "select",
1235
- "onUpdate:modelValue": t[5] || (t[5] = (i) => {
1236
- unref(r).extras.targetLocation = i;
1239
+ "onUpdate:modelValue": n[5] || (n[5] = (s) => {
1240
+ unref(a).extras.targetLocation = s;
1237
1241
  }),
1238
- rules: [unref(ZodHelper).ruleAtPath(unref(o), "extras.targetLocation")]
1239
- }, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0),
1240
- createVNode(v, {
1241
- modelValue: unref(r).internal,
1242
- "onUpdate:modelValue": t[6] || (t[6] = (i) => unref(r).internal = i),
1243
- "label-placement": "right",
1244
- label: "Internal only",
1245
- sublabel: "Voucher will not be shown to customer"
1246
- }, null, 8, ["modelValue"])
1242
+ rules: [unref(ZodHelper).ruleAtPath(unref(i), "extras.targetLocation")]
1243
+ }, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0)
1247
1244
  ], 64);
1248
1245
  };
1249
1246
  }
1250
1247
  }), _hoisted_1$b = {
1251
1248
  key: 0,
1252
1249
  class: "flex flex-col gap-y-24"
1253
- }, _hoisted_2$a = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1), _hoisted_3$8 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1), _hoisted_4$7 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
1250
+ }, _hoisted_2$8 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
1254
1251
  __name: "EditRewardPoolSheet",
1255
1252
  emits: ["update:model-value"],
1256
- setup(e, { expose: d, emit: n }) {
1257
- const r = useMembershipStore(), { minor: o } = useLoading, s = ref(!1), l = ref(), t = ref(), a = ref(0), p = computed(() => {
1258
- var u;
1259
- return ((u = r.loyaltyRewards.items.find(
1260
- (c) => {
1261
- var f;
1262
- return c.value === ((f = l.value) == null ? void 0 : f.collectible);
1253
+ setup(e, { expose: m, emit: r }) {
1254
+ const u = useMembershipStore(), { minor: a } = useLoading, i = ref(!1), o = ref(), l = ref(), n = ref(0), c = computed(() => {
1255
+ var d;
1256
+ return ((d = u.loyaltyRewards.items.find(
1257
+ (f) => {
1258
+ var y;
1259
+ return f.value === ((y = o.value) == null ? void 0 : y.collectible);
1263
1260
  }
1264
- )) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
1261
+ )) == null ? void 0 : d.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
1265
1262
  }), v = computed(() => {
1266
- const i = p.value.safeParse(l.value);
1267
- return i.success ? [] : i.error.errors;
1263
+ const s = c.value.safeParse(o.value);
1264
+ return s.success ? [] : s.error.errors;
1268
1265
  });
1269
- function m(i, u, c) {
1270
- i && (l.value = u, a.value = c), s.value = i;
1266
+ function p(s, d, f) {
1267
+ s && (o.value = d, n.value = f), i.value = s;
1271
1268
  }
1272
- const g = n;
1273
- async function y() {
1274
- const i = p.value.safeParse(l.value);
1275
- i.success && (await o(
1269
+ const g = r;
1270
+ async function h() {
1271
+ const s = c.value.safeParse(o.value);
1272
+ s.success && (await a(
1276
1273
  async () => {
1277
- i.data.type === "VOUCHER" && t.value && (i.data.collectibleConfig.image = await firebaseStorage.update(
1278
- i.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, t.value),
1279
- t.value
1274
+ s.data.type === "VOUCHER" && l.value && (s.data.collectibleConfig.image = await firebaseStorage.update(
1275
+ s.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, l.value),
1276
+ l.value
1280
1277
  ));
1281
1278
  },
1282
1279
  {
1283
1280
  message: "Uploading reward image",
1284
1281
  successMessage: "Reward image updated"
1285
1282
  }
1286
- ), g("update:model-value", i.data, a.value));
1283
+ ), g("update:model-value", s.data, n.value));
1287
1284
  }
1288
- return d({
1289
- showSheet: m
1290
- }), (i, u) => {
1291
- const c = resolveComponent("FmSelect"), f = resolveComponent("FmStepperField"), k = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
1292
- return openBlock(), createBlock(C, {
1285
+ return m({
1286
+ showSheet: p
1287
+ }), (s, d) => {
1288
+ const f = resolveComponent("FmSelect"), y = resolveComponent("FmStepperField"), C = resolveComponent("FmButton"), E = resolveComponent("FmSideSheet");
1289
+ return openBlock(), createBlock(E, {
1293
1290
  "max-width": 560,
1294
- modelValue: unref(s),
1291
+ modelValue: unref(i),
1295
1292
  "onUpdate:modelValue": [
1296
- u[9] || (u[9] = (b) => isRef(s) ? s.value = b : null),
1297
- u[10] || (u[10] = (b) => s.value = b)
1293
+ d[9] || (d[9] = (k) => isRef(i) ? i.value = k : null),
1294
+ d[10] || (d[10] = (k) => i.value = k)
1298
1295
  ],
1299
1296
  header: "Edit reward",
1300
1297
  "dismiss-away": ""
1301
1298
  }, {
1302
1299
  "side-sheet-footer": withCtx(() => [
1303
- createElementVNode("div", _hoisted_4$7, [
1304
- createVNode(k, {
1300
+ createElementVNode("div", _hoisted_2$8, [
1301
+ createVNode(C, {
1305
1302
  variant: "primary",
1306
1303
  type: "button",
1307
1304
  disabled: unref(v).length > 0,
1308
1305
  label: "Confirm",
1309
- onClick: u[7] || (u[7] = (b) => y())
1306
+ onClick: d[7] || (d[7] = (k) => h())
1310
1307
  }, null, 8, ["disabled"]),
1311
- createVNode(k, {
1308
+ createVNode(C, {
1312
1309
  variant: "secondary",
1313
1310
  type: "button",
1314
1311
  label: "Cancel",
1315
- onClick: u[8] || (u[8] = (b) => s.value = !1)
1312
+ onClick: d[8] || (d[8] = (k) => i.value = !1)
1316
1313
  })
1317
1314
  ])
1318
1315
  ]),
1319
1316
  default: withCtx(() => {
1320
- var b, x, E;
1317
+ var k, B, x;
1321
1318
  return [
1322
- unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
1323
- createVNode(c, {
1319
+ unref(o) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
1320
+ createVNode(f, {
1324
1321
  label: "Reward Type",
1325
1322
  items: [
1326
1323
  { label: "No Reward", value: "NO_REWARD" },
1327
1324
  { label: "Voucher", value: "VOUCHER" },
1328
1325
  { label: "Loyalty", value: "LOYALTY" }
1329
1326
  ],
1330
- "model-value": unref(l).type,
1331
- "onUpdate:modelValue": u[0] || (u[0] = (V) => {
1332
- V == "NO_REWARD" ? l.value = {
1327
+ "model-value": unref(o).type,
1328
+ "onUpdate:modelValue": d[0] || (d[0] = (b) => {
1329
+ b == "NO_REWARD" ? o.value = {
1333
1330
  type: "NO_REWARD",
1334
1331
  collectible: null,
1335
1332
  weight: 1
1336
- } : V === "VOUCHER" ? l.value = {
1333
+ } : b === "VOUCHER" ? o.value = {
1337
1334
  collectible: null,
1338
1335
  type: "VOUCHER",
1339
1336
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1347,8 +1344,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1347
1344
  validForDay: 7
1348
1345
  },
1349
1346
  weight: 1
1350
- } : l.value = {
1351
- collectible: unref(r).loyaltyRewards.raw[0]._id,
1347
+ } : o.value = {
1348
+ collectible: unref(u).loyaltyRewards.raw[0]._id,
1352
1349
  type: "LOYALTY",
1353
1350
  earningOption: {
1354
1351
  amount: 1,
@@ -1361,72 +1358,72 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1361
1358
  };
1362
1359
  })
1363
1360
  }, null, 8, ["model-value"]),
1364
- unref(l).type == "LOYALTY" ? (openBlock(), createBlock(c, {
1361
+ unref(o).type == "LOYALTY" ? (openBlock(), createBlock(f, {
1365
1362
  key: 0,
1366
1363
  label: "Loyalty type",
1367
- rules: [unref(ZodHelper).ruleAtPath(unref(p), "collectible", [unref(l).type])],
1368
- items: unref(r).loyaltyRewards.items,
1369
- "model-value": unref(l).collectible,
1370
- "onUpdate:modelValue": u[1] || (u[1] = (V) => unref(l).collectible = V)
1364
+ rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(o).type])],
1365
+ items: unref(u).loyaltyRewards.items,
1366
+ "model-value": unref(o).collectible,
1367
+ "onUpdate:modelValue": d[1] || (d[1] = (b) => unref(o).collectible = b)
1371
1368
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1372
- createVNode(f, {
1369
+ createVNode(y, {
1373
1370
  label: "Weight",
1374
- rules: [unref(ZodHelper).ruleAtPath(unref(p), "weight", [unref(l).type])],
1375
- "model-value": unref(l).weight,
1376
- "onUpdate:modelValue": u[2] || (u[2] = (V) => l.value = {
1377
- ...unref(l),
1378
- weight: V
1371
+ rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(o).type])],
1372
+ "model-value": unref(o).weight,
1373
+ "onUpdate:modelValue": d[2] || (d[2] = (b) => o.value = {
1374
+ ...unref(o),
1375
+ weight: b
1379
1376
  })
1380
1377
  }, null, 8, ["rules", "model-value"]),
1381
- unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1382
- ((b = unref(r).loyaltyRewards.items.find(
1383
- (V) => {
1384
- var N;
1385
- return V.value === ((N = unref(l)) == null ? void 0 : N.collectible);
1378
+ unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1379
+ ((k = unref(u).loyaltyRewards.items.find(
1380
+ (b) => {
1381
+ var S;
1382
+ return b.value === ((S = unref(o)) == null ? void 0 : S.collectible);
1386
1383
  }
1387
- )) == null ? void 0 : b.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1388
- _hoisted_2$a,
1384
+ )) == null ? void 0 : k.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1385
+ d[11] || (d[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
1389
1386
  createVNode(_sfc_main$e, {
1390
1387
  class: "mt-[-8px]",
1391
1388
  rules: [
1392
- unref(ZodHelper).ruleAtPath(unref(p), "earningOption", [unref(l).type])
1389
+ unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(o).type])
1393
1390
  ],
1394
1391
  "helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
1395
1392
  "error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
1396
1393
  "fixed-type": !0,
1397
- "model-value": unref(l).earningOption,
1398
- "onUpdate:modelValue": u[3] || (u[3] = (V) => l.value = {
1399
- ...unref(l),
1400
- earningOption: V
1394
+ "model-value": unref(o).earningOption,
1395
+ "onUpdate:modelValue": d[3] || (d[3] = (b) => o.value = {
1396
+ ...unref(o),
1397
+ earningOption: b
1401
1398
  })
1402
1399
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"])
1403
1400
  ], 64)) : createCommentVNode("", !0),
1404
- _hoisted_3$8,
1401
+ d[12] || (d[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
1405
1402
  createVNode(_sfc_main$z, {
1406
- "for-credit": unref(l).type === "LOYALTY" && ((x = unref(r).loyaltyRewards.items.find(
1407
- (V) => {
1408
- var N;
1409
- return V.value === ((N = unref(l)) == null ? void 0 : N.collectible);
1403
+ "for-credit": unref(o).type === "LOYALTY" && ((B = unref(u).loyaltyRewards.items.find(
1404
+ (b) => {
1405
+ var S;
1406
+ return b.value === ((S = unref(o)) == null ? void 0 : S.collectible);
1410
1407
  }
1411
- )) == null ? void 0 : x.raw.type) === "CREDIT",
1408
+ )) == null ? void 0 : B.raw.type) === "CREDIT",
1412
1409
  class: "!gap-24",
1413
- rules: [unref(ZodHelper).ruleAtPath(unref(p), "validityOption", [unref(l).type])],
1414
- "model-value": unref(l).validityOption,
1415
- "onUpdate:modelValue": u[4] || (u[4] = (V) => l.value = {
1416
- ...unref(l),
1417
- validityOption: V
1410
+ rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(o).type])],
1411
+ "model-value": unref(o).validityOption,
1412
+ "onUpdate:modelValue": d[4] || (d[4] = (b) => o.value = {
1413
+ ...unref(o),
1414
+ validityOption: b
1418
1415
  })
1419
1416
  }, null, 8, ["for-credit", "rules", "model-value"])
1420
1417
  ], 64)) : createCommentVNode("", !0),
1421
- unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1418
+ unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1422
1419
  key: 2,
1423
- "reward-image": unref(t),
1424
- "model-value": ((E = unref(l)) == null ? void 0 : E.collectibleConfig) ?? void 0,
1425
- "onUpdate:modelValue": u[5] || (u[5] = (V) => l.value = {
1426
- ...unref(l),
1427
- collectibleConfig: V
1420
+ "reward-image": unref(l),
1421
+ "model-value": ((x = unref(o)) == null ? void 0 : x.collectibleConfig) ?? void 0,
1422
+ "onUpdate:modelValue": d[5] || (d[5] = (b) => o.value = {
1423
+ ...unref(o),
1424
+ collectibleConfig: b
1428
1425
  }),
1429
- "onUpdate:rewardImage": u[6] || (u[6] = (V) => t.value = V)
1426
+ "onUpdate:rewardImage": d[6] || (d[6] = (b) => l.value = b)
1430
1427
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1431
1428
  createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
1432
1429
  ])) : createCommentVNode("", !0)
@@ -1440,7 +1437,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1440
1437
  function isNullOrEmpty(e) {
1441
1438
  return e == null || e === "";
1442
1439
  }
1443
- const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ 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), _hoisted_3$7 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$6 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$a = /* @__PURE__ */ defineComponent({
1440
+ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-en-body-lg-400" }, _hoisted_3$6 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$a = /* @__PURE__ */ defineComponent({
1444
1441
  __name: "RewardPoolInput",
1445
1442
  props: {
1446
1443
  modelValue: {
@@ -1455,92 +1452,92 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1455
1452
  }
1456
1453
  },
1457
1454
  emits: ["update:model-value"],
1458
- setup(e, { emit: d }) {
1459
- const n = e, r = d, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => n.modelValue ?? []), t = computed(() => {
1460
- const i = s.safeParse(l.value);
1461
- return i.success ? [] : i.error.errors;
1462
- }), a = ref();
1463
- function p(i, u) {
1464
- var f;
1465
- const c = [...l.value];
1466
- c[u] = i, (f = a.value) == null || f.showSheet(!1), r("update:model-value", c);
1455
+ setup(e, { emit: m }) {
1456
+ const r = e, u = m, a = useMembershipStore(), i = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => r.modelValue ?? []), l = computed(() => {
1457
+ const s = i.safeParse(o.value);
1458
+ return s.success ? [] : s.error.errors;
1459
+ }), n = ref();
1460
+ function c(s, d) {
1461
+ var y;
1462
+ const f = [...o.value];
1463
+ f[d] = s, (y = n.value) == null || y.showSheet(!1), u("update:model-value", f);
1467
1464
  }
1468
- function v(i) {
1469
- const u = i.type == "VOUCHER" ? i.collectibleConfig : o.collectibles.find(
1470
- (k) => k._id.toString() == i.collectible
1471
- ), c = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), f = i.weight;
1465
+ function v(s) {
1466
+ const d = s.type == "VOUCHER" ? s.collectibleConfig : a.collectibles.find(
1467
+ (C) => C._id.toString() == s.collectible
1468
+ ), f = CollectionUtils.formattedType((d == null ? void 0 : d.name) || ""), y = s.weight;
1472
1469
  return {
1473
- label: isNullOrEmpty(c) ? "NO REWARD" : c,
1474
- sublabel: `${f} (${(f / l.value.reduce((k, C) => k + C.weight, 0) * 100).toFixed(2)}%)`
1470
+ label: isNullOrEmpty(f) ? "NO REWARD" : f,
1471
+ sublabel: `${y} (${(y / o.value.reduce((C, E) => C + E.weight, 0) * 100).toFixed(2)}%)`
1475
1472
  };
1476
1473
  }
1477
- function m(i) {
1478
- var c;
1479
- const u = [...l.value];
1480
- (c = a.value) == null || c.showSheet(!0, u[i], i);
1474
+ function p(s) {
1475
+ var f;
1476
+ const d = [...o.value];
1477
+ (f = n.value) == null || f.showSheet(!0, d[s], s);
1481
1478
  }
1482
- function g(i) {
1483
- const u = [...l.value];
1484
- u.splice(i, 1), r("update:model-value", u);
1479
+ function g(s) {
1480
+ const d = [...o.value];
1481
+ d.splice(s, 1), u("update:model-value", d);
1485
1482
  }
1486
- function y() {
1487
- var i;
1488
- (i = a.value) == null || i.showSheet(
1483
+ function h() {
1484
+ var s;
1485
+ (s = n.value) == null || s.showSheet(
1489
1486
  !0,
1490
1487
  {
1491
1488
  type: "NO_REWARD",
1492
1489
  collectible: null,
1493
1490
  weight: 1
1494
1491
  },
1495
- l.value.length
1492
+ o.value.length
1496
1493
  );
1497
1494
  }
1498
- return (i, u) => {
1499
- const c = resolveComponent("FmButton"), f = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
1495
+ return (s, d) => {
1496
+ const f = resolveComponent("FmButton"), y = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
1500
1497
  return openBlock(), createElementBlock("div", _hoisted_1$a, [
1501
- _hoisted_2$9,
1502
- createVNode(c, {
1498
+ d[1] || (d[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)),
1499
+ createVNode(f, {
1503
1500
  label: "Add Reward",
1504
- onClick: u[0] || (u[0] = (C) => y()),
1501
+ onClick: d[0] || (d[0] = (E) => h()),
1505
1502
  variant: "plain",
1506
1503
  icon: "add"
1507
1504
  }),
1508
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (C, b) => (openBlock(), createBlock(f, {
1509
- key: b,
1505
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (E, k) => (openBlock(), createBlock(y, {
1506
+ key: k,
1510
1507
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
1511
1508
  variant: "outlined",
1512
- onClick: (x) => m(b)
1509
+ onClick: (B) => p(k)
1513
1510
  }, {
1514
1511
  default: withCtx(() => [
1515
1512
  createElementVNode("div", null, [
1516
- createElementVNode("div", _hoisted_3$7, toDisplayString(v(C).label), 1),
1517
- createElementVNode("div", _hoisted_4$6, toDisplayString(v(C).sublabel), 1)
1513
+ createElementVNode("div", _hoisted_2$7, toDisplayString(v(E).label), 1),
1514
+ createElementVNode("div", _hoisted_3$6, toDisplayString(v(E).sublabel), 1)
1518
1515
  ]),
1519
- createVNode(c, {
1516
+ createVNode(f, {
1520
1517
  icon: "delete",
1521
1518
  variant: "tertiary",
1522
- onClick: (x) => (x.stopPropagation(), g(b))
1519
+ onClick: (B) => (B.stopPropagation(), g(k))
1523
1520
  }, null, 8, ["onClick"])
1524
1521
  ]),
1525
1522
  _: 2
1526
1523
  }, 1032, ["onClick"]))), 128)),
1527
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t).filter((C) => C.path.join(".") == ""), (C) => (openBlock(), createBlock(k, {
1528
- key: C.message,
1529
- text: C.message,
1524
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((E) => E.path.join(".") == ""), (E) => (openBlock(), createBlock(C, {
1525
+ key: E.message,
1526
+ text: E.message,
1530
1527
  state: "error"
1531
1528
  }, null, 8, ["text"]))), 128)),
1532
1529
  createVNode(_sfc_main$b, {
1533
1530
  ref_key: "sheetRef",
1534
- ref: a,
1535
- "onUpdate:modelValue": p
1531
+ ref: n,
1532
+ "onUpdate:modelValue": c
1536
1533
  }, null, 512)
1537
1534
  ]);
1538
1535
  };
1539
1536
  }
1540
- }), _hoisted_1$9 = { class: "space-y-16" }, _hoisted_2$8 = {
1537
+ }), _hoisted_1$9 = { class: "space-y-16" }, _hoisted_2$6 = {
1541
1538
  key: 0,
1542
1539
  class: "grid grid-cols-2 gap-16"
1543
- }, _hoisted_3$6 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$9 = /* @__PURE__ */ defineComponent({
1540
+ }, _hoisted_3$5 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$4 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$9 = /* @__PURE__ */ defineComponent({
1544
1541
  __name: "PromotionGameTypeInput",
1545
1542
  props: {
1546
1543
  modelValue: {
@@ -1548,48 +1545,48 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1548
1545
  }
1549
1546
  },
1550
1547
  emits: ["update:model-value"],
1551
- setup(e, { emit: d }) {
1552
- const n = e, r = d, o = computed(() => [
1548
+ setup(e, { emit: m }) {
1549
+ const r = e, u = m, a = computed(() => [
1553
1550
  {
1554
1551
  label: "Rock paper scissor",
1555
1552
  description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
1556
1553
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
1557
1554
  }
1558
1555
  ]);
1559
- return (s, l) => {
1560
- var v, m, g;
1561
- const t = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"), p = resolveComponent("FmHelperText");
1556
+ return (i, o) => {
1557
+ var v, p, g;
1558
+ const l = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), c = resolveComponent("FmHelperText");
1562
1559
  return openBlock(), createElementBlock("div", _hoisted_1$9, [
1563
- createVNode(t, {
1560
+ createVNode(l, {
1564
1561
  label: "Enable game",
1565
1562
  "model-value": !!((v = e.modelValue) != null && v.gameType),
1566
- "onUpdate:modelValue": l[0] || (l[0] = (y) => y ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
1563
+ "onUpdate:modelValue": o[0] || (o[0] = (h) => h ? u("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : u("update:model-value", null))
1567
1564
  }, null, 8, ["model-value"]),
1568
- ((m = e.modelValue) == null ? void 0 : m.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
1569
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (y) => {
1570
- var i, u;
1571
- return openBlock(), createBlock(a, {
1565
+ ((p = e.modelValue) == null ? void 0 : p.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
1566
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (h) => {
1567
+ var s, d;
1568
+ return openBlock(), createBlock(n, {
1572
1569
  variant: "outlined",
1573
1570
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1574
- "col-span-2": unref(o).length == 1,
1575
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((i = e.modelValue) == null ? void 0 : i.gameType) == y.value,
1576
- "hover:bg-fm-color-opacity-sm": ((u = e.modelValue) == null ? void 0 : u.gameType) != y.value
1571
+ "col-span-2": unref(a).length == 1,
1572
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((s = e.modelValue) == null ? void 0 : s.gameType) == h.value,
1573
+ "hover:bg-fm-color-opacity-sm": ((d = e.modelValue) == null ? void 0 : d.gameType) != h.value
1577
1574
  }]),
1578
1575
  onClick: () => {
1579
- var c;
1580
- ((c = n.modelValue) == null ? void 0 : c.gameType) != y.value && r("update:model-value", { gameType: y.value });
1576
+ var f;
1577
+ ((f = r.modelValue) == null ? void 0 : f.gameType) != h.value && u("update:model-value", { gameType: h.value });
1581
1578
  },
1582
- key: y.value
1579
+ key: h.value
1583
1580
  }, {
1584
1581
  default: withCtx(() => [
1585
- createElementVNode("div", _hoisted_3$6, toDisplayString(y.label), 1),
1586
- createElementVNode("div", _hoisted_4$5, toDisplayString(y.description), 1)
1582
+ createElementVNode("div", _hoisted_3$5, toDisplayString(h.label), 1),
1583
+ createElementVNode("div", _hoisted_4$4, toDisplayString(h.description), 1)
1587
1584
  ]),
1588
1585
  _: 2
1589
1586
  }, 1032, ["class", "onClick"]);
1590
1587
  }), 128))
1591
1588
  ])) : createCommentVNode("", !0),
1592
- ((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(p, {
1589
+ ((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(c, {
1593
1590
  key: 1,
1594
1591
  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)",
1595
1592
  state: "warning"
@@ -1597,7 +1594,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1597
1594
  ]);
1598
1595
  };
1599
1596
  }
1600
- }), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$7 = /* @__PURE__ */ 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), _hoisted_3$5 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$4 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
1597
+ }), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$5 = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$4 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
1601
1598
  __name: "MissionTypeInput",
1602
1599
  props: {
1603
1600
  modelValue: {
@@ -1605,8 +1602,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1605
1602
  }
1606
1603
  },
1607
1604
  emits: ["update:model-value"],
1608
- setup(e, { emit: d }) {
1609
- const n = e, r = d, o = computed(() => [
1605
+ setup(e, { emit: m }) {
1606
+ const r = e, u = m, a = computed(() => [
1610
1607
  {
1611
1608
  label: "Stamp",
1612
1609
  description: "Award stamps for purchases, redeemable after reaching set milestones.",
@@ -1618,26 +1615,26 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1618
1615
  value: F_MISSION_TYPE.enum.PROGRESSIVE
1619
1616
  }
1620
1617
  ]);
1621
- return (s, l) => {
1622
- const t = resolveComponent("FmCard");
1618
+ return (i, o) => {
1619
+ const l = resolveComponent("FmCard");
1623
1620
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
1624
- _hoisted_2$7,
1625
- createElementVNode("div", _hoisted_3$5, [
1626
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
1621
+ 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)),
1622
+ createElementVNode("div", _hoisted_2$5, [
1623
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (n) => (openBlock(), createBlock(l, {
1627
1624
  variant: "outlined",
1628
1625
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1629
- "col-span-2": unref(o).length == 1,
1630
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
1631
- "hover:bg-fm-color-opacity-sm": e.modelValue != a.value
1626
+ "col-span-2": unref(a).length == 1,
1627
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
1628
+ "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
1632
1629
  }]),
1633
1630
  onClick: () => {
1634
- n.modelValue != a.value && r("update:model-value", a.value);
1631
+ r.modelValue != n.value && u("update:model-value", n.value);
1635
1632
  },
1636
- key: a.value
1633
+ key: n.value
1637
1634
  }, {
1638
1635
  default: withCtx(() => [
1639
- createElementVNode("div", _hoisted_4$4, toDisplayString(a.label), 1),
1640
- createElementVNode("div", _hoisted_5$3, toDisplayString(a.description), 1)
1636
+ createElementVNode("div", _hoisted_3$4, toDisplayString(n.label), 1),
1637
+ createElementVNode("div", _hoisted_4$3, toDisplayString(n.description), 1)
1641
1638
  ]),
1642
1639
  _: 2
1643
1640
  }, 1032, ["class", "onClick"]))), 128))
@@ -1645,7 +1642,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1645
1642
  ]);
1646
1643
  };
1647
1644
  }
1648
- }), _hoisted_1$7 = { class: "space-y-16" }, _hoisted_2$6 = /* @__PURE__ */ 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), _sfc_main$7 = /* @__PURE__ */ defineComponent({
1645
+ }), _hoisted_1$7 = { class: "space-y-16" }, _sfc_main$7 = /* @__PURE__ */ defineComponent({
1649
1646
  __name: "MissionEndInput",
1650
1647
  props: {
1651
1648
  modelValue: {
@@ -1659,23 +1656,23 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1659
1656
  }
1660
1657
  },
1661
1658
  emits: ["update:model-value"],
1662
- setup(e, { emit: d }) {
1663
- const n = d;
1664
- return (r, o) => {
1665
- const s = resolveComponent("FmStepperField");
1659
+ setup(e, { emit: m }) {
1660
+ const r = m;
1661
+ return (u, a) => {
1662
+ const i = resolveComponent("FmStepperField");
1666
1663
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
1667
- _hoisted_2$6,
1668
- createVNode(s, {
1664
+ a[1] || (a[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)),
1665
+ createVNode(i, {
1669
1666
  label: "Maximum to collect",
1670
1667
  "model-value": e.modelValue || null,
1671
- "onUpdate:modelValue": o[0] || (o[0] = (l) => n("update:model-value", l)),
1668
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => r("update:model-value", o)),
1672
1669
  "helper-text": e.helperText || "Set the threshold required for reward eligibility",
1673
1670
  "helper-state": e.helperState || "none"
1674
1671
  }, null, 8, ["model-value", "helper-text", "helper-state"])
1675
1672
  ]);
1676
1673
  };
1677
1674
  }
1678
- }), _hoisted_1$6 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1), _hoisted_2$5 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$6 = /* @__PURE__ */ defineComponent({
1675
+ }), _hoisted_1$6 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$6 = /* @__PURE__ */ defineComponent({
1679
1676
  __name: "EditMissionPoolSheet",
1680
1677
  props: {
1681
1678
  maxThreshold: {
@@ -1684,103 +1681,103 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1684
1681
  }
1685
1682
  },
1686
1683
  emits: ["update:model-value"],
1687
- setup(e, { expose: d, emit: n }) {
1688
- const r = e, o = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), t = ref(), a = ref(), p = ref(0), v = FdtoThresholdReward, m = computed(() => {
1689
- const c = v.safeParse(t.value);
1690
- return c.success ? [] : c.error.errors;
1684
+ setup(e, { expose: m, emit: r }) {
1685
+ const u = e, a = useMembershipStore(), { minor: i } = useLoading, o = ref(!1), l = ref(), n = ref(), c = ref(0), v = FdtoThresholdReward, p = computed(() => {
1686
+ const f = v.safeParse(l.value);
1687
+ return f.success ? [] : f.error.errors;
1691
1688
  });
1692
- function g(c, f, k) {
1693
- c && (t.value = f, p.value = k), l.value = c;
1689
+ function g(f, y, C) {
1690
+ f && (l.value = y, c.value = C), o.value = f;
1694
1691
  }
1695
- const y = n;
1696
- async function i() {
1697
- console.log(t.value);
1698
- const c = v.safeParse(t.value);
1699
- c.success && (await s(
1692
+ const h = r;
1693
+ async function s() {
1694
+ console.log(l.value);
1695
+ const f = v.safeParse(l.value);
1696
+ f.success && (await i(
1700
1697
  async () => {
1701
- c.data.type === "VOUCHER" && a.value && (c.data.collectibleConfig.image = await firebaseStorage.update(
1702
- c.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
1703
- a.value
1698
+ f.data.type === "VOUCHER" && n.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
1699
+ f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
1700
+ n.value
1704
1701
  ));
1705
1702
  },
1706
1703
  {
1707
1704
  message: "Uploading reward image",
1708
1705
  successMessage: "Reward image updated"
1709
1706
  }
1710
- ), y("update:model-value", c.data, p.value));
1707
+ ), h("update:model-value", f.data, c.value));
1711
1708
  }
1712
- const u = ref();
1713
- return d({
1709
+ const d = ref();
1710
+ return m({
1714
1711
  showSheet: g
1715
- }), (c, f) => {
1716
- const k = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), x = resolveComponent("FmButton"), E = resolveComponent("FmSideSheet");
1717
- return openBlock(), createBlock(E, {
1712
+ }), (f, y) => {
1713
+ const C = resolveComponent("FmStepperField"), E = resolveComponent("FmSelect"), k = resolveComponent("FmForm"), B = resolveComponent("FmButton"), x = resolveComponent("FmSideSheet");
1714
+ return openBlock(), createBlock(x, {
1718
1715
  "max-width": 560,
1719
- modelValue: unref(l),
1716
+ modelValue: unref(o),
1720
1717
  "onUpdate:modelValue": [
1721
- f[10] || (f[10] = (V) => isRef(l) ? l.value = V : null),
1722
- f[11] || (f[11] = (V) => l.value = V)
1718
+ y[10] || (y[10] = (b) => isRef(o) ? o.value = b : null),
1719
+ y[11] || (y[11] = (b) => o.value = b)
1723
1720
  ],
1724
1721
  header: "Edit reward",
1725
1722
  "dismiss-away": ""
1726
1723
  }, {
1727
1724
  "side-sheet-footer": withCtx(() => [
1728
- createElementVNode("div", _hoisted_2$5, [
1729
- createVNode(x, {
1725
+ createElementVNode("div", _hoisted_1$6, [
1726
+ createVNode(B, {
1730
1727
  variant: "primary",
1731
1728
  type: "button",
1732
1729
  label: "Confirm",
1733
- onClick: f[8] || (f[8] = async () => {
1734
- var V;
1735
- return (V = unref(u)) == null ? void 0 : V.validateInputs();
1730
+ onClick: y[8] || (y[8] = async () => {
1731
+ var b;
1732
+ return (b = unref(d)) == null ? void 0 : b.validateInputs();
1736
1733
  })
1737
1734
  }),
1738
- createVNode(x, {
1735
+ createVNode(B, {
1739
1736
  variant: "secondary",
1740
1737
  type: "button",
1741
1738
  label: "Cancel",
1742
- onClick: f[9] || (f[9] = (V) => l.value = !1)
1739
+ onClick: y[9] || (y[9] = (b) => o.value = !1)
1743
1740
  })
1744
1741
  ])
1745
1742
  ]),
1746
1743
  default: withCtx(() => [
1747
- unref(t) ? (openBlock(), createBlock(b, {
1744
+ unref(l) ? (openBlock(), createBlock(k, {
1748
1745
  key: 0,
1749
1746
  class: "flex flex-col gap-y-24",
1750
1747
  ref_key: "formRef",
1751
- ref: u,
1752
- onValidationSuccess: f[7] || (f[7] = (V) => i())
1748
+ ref: d,
1749
+ onValidationSuccess: y[7] || (y[7] = (b) => s())
1753
1750
  }, {
1754
1751
  default: withCtx(() => {
1755
- var V, N;
1752
+ var b, S;
1756
1753
  return [
1757
- unref(t).type ? (openBlock(), createBlock(k, {
1754
+ unref(l).type ? (openBlock(), createBlock(C, {
1758
1755
  key: 0,
1759
1756
  label: "Threshold",
1760
1757
  rules: [
1761
1758
  unref(ZodHelper).toRule(
1762
1759
  unref(z).number().min(1).max(
1763
- r.maxThreshold,
1764
- `Number cannot be more than ${r.maxThreshold}`
1760
+ u.maxThreshold,
1761
+ `Number cannot be more than ${u.maxThreshold}`
1765
1762
  )
1766
1763
  )
1767
1764
  ],
1768
- "model-value": unref(t).threshold,
1769
- "onUpdate:modelValue": f[0] || (f[0] = (h) => t.value = {
1770
- ...unref(t),
1771
- threshold: h
1765
+ "model-value": unref(l).threshold,
1766
+ "onUpdate:modelValue": y[0] || (y[0] = (V) => l.value = {
1767
+ ...unref(l),
1768
+ threshold: V
1772
1769
  })
1773
1770
  }, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
1774
- createVNode(C, {
1771
+ createVNode(E, {
1775
1772
  label: "Reward Type",
1776
1773
  items: [
1777
1774
  { label: "Voucher", value: "VOUCHER" },
1778
1775
  { label: "Loyalty", value: "LOYALTY" }
1779
1776
  ],
1780
- "model-value": unref(t).type,
1781
- "onUpdate:modelValue": f[1] || (f[1] = (h) => {
1782
- var R, B;
1783
- h === "VOUCHER" ? t.value = {
1777
+ "model-value": unref(l).type,
1778
+ "onUpdate:modelValue": y[1] || (y[1] = (V) => {
1779
+ var N, R;
1780
+ V === "VOUCHER" ? l.value = {
1784
1781
  collectible: null,
1785
1782
  type: "VOUCHER",
1786
1783
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1793,9 +1790,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1793
1790
  validityOption: {
1794
1791
  validForDay: 7
1795
1792
  },
1796
- threshold: (R = unref(t)) == null ? void 0 : R.threshold
1797
- } : t.value = {
1798
- collectible: unref(o).loyaltyRewards.raw[0]._id,
1793
+ threshold: (N = unref(l)) == null ? void 0 : N.threshold
1794
+ } : l.value = {
1795
+ collectible: unref(a).loyaltyRewards.raw[0]._id,
1799
1796
  type: "LOYALTY",
1800
1797
  earningOption: {
1801
1798
  amount: 1,
@@ -1804,59 +1801,59 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1804
1801
  validityOption: {
1805
1802
  validForDay: 7
1806
1803
  },
1807
- threshold: (B = unref(t)) == null ? void 0 : B.threshold
1804
+ threshold: (R = unref(l)) == null ? void 0 : R.threshold
1808
1805
  };
1809
1806
  })
1810
1807
  }, null, 8, ["model-value"]),
1811
- unref(t).type == "LOYALTY" ? (openBlock(), createBlock(C, {
1808
+ unref(l).type == "LOYALTY" ? (openBlock(), createBlock(E, {
1812
1809
  key: 1,
1813
1810
  label: "Loyalty type",
1814
- rules: [unref(ZodHelper).ruleAtPath(unref(v), "collectible", [unref(t).type])],
1815
- items: unref(o).loyaltyRewards.items,
1816
- "model-value": unref(t).collectible,
1817
- "onUpdate:modelValue": f[2] || (f[2] = (h) => unref(t).collectible = h)
1811
+ rules: [unref(ZodHelper).ruleAtPath(unref(v), "collectible", [unref(l).type])],
1812
+ items: unref(a).loyaltyRewards.items,
1813
+ "model-value": unref(l).collectible,
1814
+ "onUpdate:modelValue": y[2] || (y[2] = (V) => unref(l).collectible = V)
1818
1815
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1819
- unref(t).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1820
- _hoisted_1$6,
1816
+ unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1817
+ y[12] || (y[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
1821
1818
  createVNode(_sfc_main$e, {
1822
1819
  class: "mt-[-8px]",
1823
- rules: [unref(ZodHelper).ruleAtPath(unref(v), "earningOption", [unref(t).type])],
1824
- "helper-state": unref(ZodHelper).helperState(unref(m), "earningOption"),
1825
- "error-text": unref(ZodHelper).helperText(unref(m), "earningOption"),
1820
+ rules: [unref(ZodHelper).ruleAtPath(unref(v), "earningOption", [unref(l).type])],
1821
+ "helper-state": unref(ZodHelper).helperState(unref(p), "earningOption"),
1822
+ "error-text": unref(ZodHelper).helperText(unref(p), "earningOption"),
1826
1823
  "fixed-type": !0,
1827
- "model-value": unref(t).earningOption,
1828
- "onUpdate:modelValue": f[3] || (f[3] = (h) => t.value = {
1829
- ...unref(t),
1830
- earningOption: h
1824
+ "model-value": unref(l).earningOption,
1825
+ "onUpdate:modelValue": y[3] || (y[3] = (V) => l.value = {
1826
+ ...unref(l),
1827
+ earningOption: V
1831
1828
  })
1832
1829
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
1833
1830
  createVNode(_sfc_main$z, {
1834
1831
  class: "!gap-24",
1835
- "for-credit": unref(t).type === "LOYALTY" && ((V = unref(o).loyaltyRewards.items.find(
1836
- (h) => {
1837
- var R;
1838
- return h.value === ((R = unref(t)) == null ? void 0 : R.collectible);
1832
+ "for-credit": unref(l).type === "LOYALTY" && ((b = unref(a).loyaltyRewards.items.find(
1833
+ (V) => {
1834
+ var N;
1835
+ return V.value === ((N = unref(l)) == null ? void 0 : N.collectible);
1839
1836
  }
1840
- )) == null ? void 0 : V.raw.type) === "CREDIT",
1841
- rules: [unref(ZodHelper).ruleAtPath(unref(v), "validityOption", [unref(t).type])],
1842
- "model-value": unref(t).validityOption,
1843
- "onUpdate:modelValue": f[4] || (f[4] = (h) => t.value = {
1844
- ...unref(t),
1845
- validityOption: h
1837
+ )) == null ? void 0 : b.raw.type) === "CREDIT",
1838
+ rules: [unref(ZodHelper).ruleAtPath(unref(v), "validityOption", [unref(l).type])],
1839
+ "model-value": unref(l).validityOption,
1840
+ "onUpdate:modelValue": y[4] || (y[4] = (V) => l.value = {
1841
+ ...unref(l),
1842
+ validityOption: V
1846
1843
  })
1847
1844
  }, null, 8, ["for-credit", "rules", "model-value"])
1848
1845
  ], 64)) : createCommentVNode("", !0),
1849
- unref(t).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1846
+ unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1850
1847
  key: 3,
1851
- "reward-image": unref(a),
1852
- "model-value": ((N = unref(t)) == null ? void 0 : N.collectibleConfig) ?? void 0,
1853
- "onUpdate:modelValue": f[5] || (f[5] = (h) => t.value = {
1854
- ...unref(t),
1855
- collectibleConfig: h
1848
+ "reward-image": unref(n),
1849
+ "model-value": ((S = unref(l)) == null ? void 0 : S.collectibleConfig) ?? void 0,
1850
+ "onUpdate:modelValue": y[5] || (y[5] = (V) => l.value = {
1851
+ ...unref(l),
1852
+ collectibleConfig: V
1856
1853
  }),
1857
- "onUpdate:rewardImage": f[6] || (f[6] = (h) => a.value = h)
1854
+ "onUpdate:rewardImage": y[6] || (y[6] = (V) => n.value = V)
1858
1855
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1859
- createVNode(JsonViewer, { json: unref(m) }, null, 8, ["json"])
1856
+ createVNode(JsonViewer, { json: unref(p) }, null, 8, ["json"])
1860
1857
  ];
1861
1858
  }),
1862
1859
  _: 1
@@ -1869,7 +1866,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1869
1866
  }), _hoisted_1$5 = {
1870
1867
  key: 0,
1871
1868
  class: "grid grid-cols-5 text-center gap-8 justify-between items-center w-full"
1872
- }, _hoisted_2$4 = { class: "flex flex-col gap-0 items-center justify-center" }, _hoisted_3$4 = /* @__PURE__ */ createElementVNode("div", null, "🎁", -1), _sfc_main$5 = /* @__PURE__ */ defineComponent({
1869
+ }, _hoisted_2$4 = { class: "flex flex-col gap-0 items-center justify-center" }, _sfc_main$5 = /* @__PURE__ */ defineComponent({
1873
1870
  __name: "MissionProgress",
1874
1871
  props: {
1875
1872
  type: {
@@ -1890,19 +1887,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1890
1887
  }
1891
1888
  },
1892
1889
  setup(e) {
1893
- const d = e, { maxRange: n, currentRange: r, markers: o } = toRefs(d), s = computed(
1894
- () => Math.min(r.value / n.value * 100, 100)
1895
- ), l = (t) => t / n.value * 100;
1896
- return (t, a) => {
1897
- const p = resolveComponent("FmIcon");
1890
+ const m = e, { maxRange: r, currentRange: u, markers: a } = toRefs(m), i = computed(
1891
+ () => Math.min(u.value / r.value * 100, 100)
1892
+ ), o = (l) => l / r.value * 100;
1893
+ return (l, n) => {
1894
+ const c = resolveComponent("FmIcon");
1898
1895
  return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
1899
- (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(n), 40), (v) => (openBlock(), createBlock(p, {
1896
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(r), 40), (v) => (openBlock(), createBlock(c, {
1900
1897
  class: normalizeClass(
1901
- unref(r) >= v ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1898
+ unref(u) >= v ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1902
1899
  ),
1903
- outline: unref(r) < v,
1900
+ outline: unref(u) < v,
1904
1901
  key: v,
1905
- name: unref(o).some((m) => m === v) ? "featured_seasonal_and_gifts" : "check_circle"
1902
+ name: unref(a).some((p) => p === v) ? "featured_seasonal_and_gifts" : "check_circle"
1906
1903
  }, null, 8, ["class", "outline", "name"]))), 128))
1907
1904
  ])) : (openBlock(), createElementBlock("div", {
1908
1905
  key: 1,
@@ -1910,18 +1907,18 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1910
1907
  }, [
1911
1908
  createElementVNode("div", {
1912
1909
  class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
1913
- style: normalizeStyle({ width: unref(s) + "%" })
1910
+ style: normalizeStyle({ width: unref(i) + "%" })
1914
1911
  }, null, 4),
1915
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (v, m) => (openBlock(), createElementBlock("div", {
1916
- key: m,
1912
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (v, p) => (openBlock(), createElementBlock("div", {
1913
+ key: p,
1917
1914
  class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
1918
- style: normalizeStyle({ left: l(v) + "%" })
1915
+ style: normalizeStyle({ left: o(v) + "%" })
1919
1916
  }, [
1920
1917
  createElementVNode("div", _hoisted_2$4, [
1921
1918
  createElementVNode("div", {
1922
1919
  class: normalizeClass(["h-16 w-[2px]", "bg-fm-color-system-warning-300"])
1923
1920
  }),
1924
- _hoisted_3$4
1921
+ n[0] || (n[0] = createElementVNode("div", null, "🎁", -1))
1925
1922
  ])
1926
1923
  ], 4))), 128))
1927
1924
  ]));
@@ -1929,19 +1926,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1929
1926
  }
1930
1927
  }), isObject = (e) => e !== null && typeof e == "object";
1931
1928
  function changeKeysFactory(e) {
1932
- return function d(n, r = 1, o) {
1933
- if (r === 0 || !isObject(n))
1934
- return n;
1935
- if (Array.isArray(n))
1936
- return n.map((l) => d(l, r - 1, o));
1937
- const s = Object.create(Object.getPrototypeOf(n));
1938
- return Object.keys(n).forEach((l) => {
1939
- const t = n[l], a = e(l, o), p = d(t, r - 1, o);
1940
- s[a] = p;
1941
- }), s;
1929
+ return function m(r, u = 1, a) {
1930
+ if (u === 0 || !isObject(r))
1931
+ return r;
1932
+ if (Array.isArray(r))
1933
+ return r.map((o) => m(o, u - 1, a));
1934
+ const i = Object.create(Object.getPrototypeOf(r));
1935
+ return Object.keys(r).forEach((o) => {
1936
+ const l = r[o], n = e(o, a), c = m(l, u - 1, a);
1937
+ i[n] = c;
1938
+ }), i;
1942
1939
  };
1943
1940
  }
1944
- const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1), _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1), _hoisted_6$2 = { class: "flex items-center gap-4" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1), _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
1941
+ 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({
1945
1942
  __name: "MissionPoolInput",
1946
1943
  props: {
1947
1944
  modelValue: {
@@ -1954,43 +1951,43 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1954
1951
  }
1955
1952
  },
1956
1953
  emits: ["update:model-value"],
1957
- setup(e, { emit: d }) {
1958
- const n = e, r = d, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
1959
- () => n.modelValue.sort((u, c) => u.threshold - c.threshold) ?? []
1960
- ), t = computed(() => {
1961
- const u = s.safeParse(l.value);
1962
- return u.success ? [] : u.error.errors;
1963
- }), a = ref();
1964
- function p(u, c) {
1965
- var k;
1966
- const f = [...l.value];
1967
- f[c] = u, (k = a.value) == null || k.showSheet(!1), r("update:model-value", f);
1954
+ setup(e, { emit: m }) {
1955
+ const r = e, u = m, a = useMembershipStore(), i = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
1956
+ () => r.modelValue.sort((d, f) => d.threshold - f.threshold) ?? []
1957
+ ), l = computed(() => {
1958
+ const d = i.safeParse(o.value);
1959
+ return d.success ? [] : d.error.errors;
1960
+ }), n = ref();
1961
+ function c(d, f) {
1962
+ var C;
1963
+ const y = [...o.value];
1964
+ y[f] = d, (C = n.value) == null || C.showSheet(!1), u("update:model-value", y);
1968
1965
  }
1969
- function v(u) {
1970
- const c = u.type == "VOUCHER" ? u.collectibleConfig : o.collectibles.find(
1971
- (k) => k._id.toString() == u.collectible
1972
- ), f = CollectionUtils.formattedType((c == null ? void 0 : c.name) || "");
1966
+ function v(d) {
1967
+ const f = d.type == "VOUCHER" ? d.collectibleConfig : a.collectibles.find(
1968
+ (C) => C._id.toString() == d.collectible
1969
+ ), y = CollectionUtils.formattedType((f == null ? void 0 : f.name) || "");
1973
1970
  return {
1974
- label: isNullOrEmpty(f) ? "NO REWARD" : f,
1975
- sublabel: `Reward at ${u.threshold} | Amount: ${u.earningOption.type == "FIXED" ? u.earningOption.amount : `${u.earningOption.amount} for every RM${u.earningOption.every} spent`} `
1971
+ label: isNullOrEmpty(y) ? "NO REWARD" : y,
1972
+ sublabel: `Reward at ${d.threshold} | Amount: ${d.earningOption.type == "FIXED" ? d.earningOption.amount : `${d.earningOption.amount} for every RM${d.earningOption.every} spent`} `
1976
1973
  };
1977
1974
  }
1978
- function m(u) {
1979
- var f;
1980
- const c = [...l.value];
1981
- (f = a.value) == null || f.showSheet(!0, c[u], u);
1975
+ function p(d) {
1976
+ var y;
1977
+ const f = [...o.value];
1978
+ (y = n.value) == null || y.showSheet(!0, f[d], d);
1982
1979
  }
1983
- function g(u) {
1984
- const c = [...l.value];
1985
- c.splice(u, 1), r("update:model-value", c);
1980
+ function g(d) {
1981
+ const f = [...o.value];
1982
+ f.splice(d, 1), u("update:model-value", f);
1986
1983
  }
1987
- function y() {
1988
- var u;
1989
- (u = a.value) == null || u.showSheet(
1984
+ function h() {
1985
+ var d;
1986
+ (d = n.value) == null || d.showSheet(
1990
1987
  !0,
1991
1988
  {
1992
1989
  type: "LOYALTY",
1993
- collectible: o.loyaltyRewards.items[0].value,
1990
+ collectible: a.loyaltyRewards.items[0].value,
1994
1991
  threshold: null,
1995
1992
  validityOption: {
1996
1993
  validForDay: 7
@@ -2000,95 +1997,95 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2000
1997
  amount: 1
2001
1998
  }
2002
1999
  },
2003
- l.value.length
2000
+ o.value.length
2004
2001
  );
2005
2002
  }
2006
- function i(u) {
2007
- var c, f;
2008
- return u.type == "VOUCHER" ? (c = u.collectibleConfig) == null ? void 0 : c.name : sentenceCase(
2009
- ((f = o.loyaltyRewards.items.find(
2010
- (k) => k.value == u.collectible
2011
- )) == null ? void 0 : f.label) || ""
2003
+ function s(d) {
2004
+ var f, y;
2005
+ return d.type == "VOUCHER" ? (f = d.collectibleConfig) == null ? void 0 : f.name : sentenceCase(
2006
+ ((y = a.loyaltyRewards.items.find(
2007
+ (C) => C.value == d.collectible
2008
+ )) == null ? void 0 : y.label) || ""
2012
2009
  );
2013
2010
  }
2014
- return (u, c) => {
2015
- const f = resolveComponent("FmButton"), k = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
2011
+ return (d, f) => {
2012
+ const y = resolveComponent("FmButton"), C = resolveComponent("FmCard"), E = resolveComponent("FmHelperText");
2016
2013
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
2017
- _hoisted_2$3,
2018
- createVNode(f, {
2014
+ f[2] || (f[2] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1)),
2015
+ createVNode(y, {
2019
2016
  label: "Add Reward",
2020
- onClick: c[0] || (c[0] = (b) => y()),
2017
+ onClick: f[0] || (f[0] = (k) => h()),
2021
2018
  variant: "plain",
2022
2019
  icon: "add"
2023
2020
  }),
2024
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (b, x) => (openBlock(), createBlock(k, {
2025
- key: x,
2021
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (k, B) => (openBlock(), createBlock(C, {
2022
+ key: B,
2026
2023
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
2027
2024
  variant: "outlined",
2028
- onClick: (E) => m(x)
2025
+ onClick: (x) => p(B)
2029
2026
  }, {
2030
2027
  default: withCtx(() => [
2031
2028
  createElementVNode("div", null, [
2032
- createElementVNode("div", _hoisted_3$3, toDisplayString(v(b).label), 1),
2033
- createElementVNode("div", _hoisted_4$3, toDisplayString(v(b).sublabel), 1)
2029
+ createElementVNode("div", _hoisted_2$3, toDisplayString(v(k).label), 1),
2030
+ createElementVNode("div", _hoisted_3$3, toDisplayString(v(k).sublabel), 1)
2034
2031
  ]),
2035
- createVNode(f, {
2032
+ createVNode(y, {
2036
2033
  icon: "delete",
2037
2034
  variant: "tertiary",
2038
- onClick: (E) => (E.stopPropagation(), g(x))
2035
+ onClick: (x) => (x.stopPropagation(), g(B))
2039
2036
  }, null, 8, ["onClick"])
2040
2037
  ]),
2041
2038
  _: 2
2042
2039
  }, 1032, ["onClick"]))), 128)),
2043
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t).filter((b) => b.path.join(".") == ""), (b) => (openBlock(), createBlock(C, {
2044
- key: b.message,
2045
- text: b.message,
2040
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((k) => k.path.join(".") == ""), (k) => (openBlock(), createBlock(E, {
2041
+ key: k.message,
2042
+ text: k.message,
2046
2043
  state: "error"
2047
2044
  }, null, 8, ["text"]))), 128)),
2048
- _hoisted_5$2,
2049
- createVNode(k, {
2045
+ f[3] || (f[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1)),
2046
+ createVNode(C, {
2050
2047
  variant: "outlined",
2051
2048
  class: "p-24 space-y-16 w-fit"
2052
2049
  }, {
2053
2050
  default: withCtx(() => [
2054
- createElementVNode("div", _hoisted_6$2, [
2051
+ createElementVNode("div", _hoisted_4$2, [
2055
2052
  createElementVNode("div", null, [
2056
- createElementVNode("div", _hoisted_7$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(e.modelValue[e.modelValue.length - 1].earningOption.amount > 1 ? e.modelValue[e.modelValue.length - 1].earningOption.amount : "") + " " + toDisplayString(i(e.modelValue[e.modelValue.length - 1])), 1),
2057
- _hoisted_8$2
2053
+ createElementVNode("div", _hoisted_5$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(e.modelValue[e.modelValue.length - 1].earningOption.amount > 1 ? e.modelValue[e.modelValue.length - 1].earningOption.amount : "") + " " + toDisplayString(s(e.modelValue[e.modelValue.length - 1])), 1),
2054
+ f[1] || (f[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1))
2058
2055
  ])
2059
2056
  ]),
2060
- createElementVNode("div", _hoisted_9$2, [
2057
+ createElementVNode("div", _hoisted_6$2, [
2061
2058
  createVNode(_sfc_main$5, {
2062
2059
  type: e.mission.type,
2063
2060
  "max-range": e.mission.end,
2064
2061
  currentRange: e.mission.end / 4,
2065
- markers: e.modelValue.map((b) => b.threshold)
2062
+ markers: e.modelValue.map((k) => k.threshold)
2066
2063
  }, null, 8, ["type", "max-range", "currentRange", "markers"]),
2067
- e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
2064
+ e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_7$1, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
2068
2065
  ])
2069
2066
  ]),
2070
2067
  _: 1
2071
2068
  }),
2072
2069
  createVNode(_sfc_main$6, {
2073
2070
  ref_key: "sheetRef",
2074
- ref: a,
2075
- "onUpdate:modelValue": p,
2071
+ ref: n,
2072
+ "onUpdate:modelValue": c,
2076
2073
  "max-threshold": e.mission.end
2077
2074
  }, null, 8, ["max-threshold"])
2078
2075
  ]);
2079
2076
  };
2080
2077
  }
2081
- }), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Type", -1), _hoisted_4$2 = /* @__PURE__ */ 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), _hoisted_5$1 = { class: "grid grid-cols-2 gap-16" }, _hoisted_6$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_7$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_8$1 = { class: "space-y-8" }, _hoisted_9$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Collections required", -1), _hoisted_10$1 = /* @__PURE__ */ 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), _sfc_main$3 = /* @__PURE__ */ defineComponent({
2078
+ }), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_6$1 = { class: "space-y-8" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
2082
2079
  __name: "MissionInput",
2083
2080
  props: {
2084
2081
  modelValue: Object
2085
2082
  },
2086
2083
  emits: ["update:model-value"],
2087
- setup(e, { emit: d }) {
2088
- const n = e, r = computed(() => {
2089
- const l = FdoMission.safeParse(n.modelValue);
2090
- return l.success ? [] : l.error.errors;
2091
- }), o = computed(() => [
2084
+ setup(e, { emit: m }) {
2085
+ const r = e, u = computed(() => {
2086
+ const o = FdoMission.safeParse(r.modelValue);
2087
+ return o.success ? [] : o.error.errors;
2088
+ }), a = computed(() => [
2092
2089
  {
2093
2090
  label: "Stamp",
2094
2091
  description: "Award stamps for purchases, redeemable after reaching set milestones.",
@@ -2099,59 +2096,59 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2099
2096
  description: "Reward customers when they reach a cumulative spending goal.",
2100
2097
  value: F_MISSION_TYPE.enum.PROGRESSIVE
2101
2098
  }
2102
- ]), s = d;
2103
- return (l, t) => {
2099
+ ]), i = m;
2100
+ return (o, l) => {
2104
2101
  var v;
2105
- const a = resolveComponent("FmCard"), p = resolveComponent("FmStepperField");
2102
+ const n = resolveComponent("FmCard"), c = resolveComponent("FmStepperField");
2106
2103
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
2107
2104
  createElementVNode("div", _hoisted_2$2, [
2108
- _hoisted_3$2,
2109
- _hoisted_4$2,
2110
- createElementVNode("div", _hoisted_5$1, [
2111
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (m) => {
2112
- var g, y;
2113
- return openBlock(), createBlock(a, {
2105
+ l[1] || (l[1] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Type", -1)),
2106
+ 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)),
2107
+ createElementVNode("div", _hoisted_3$2, [
2108
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (p) => {
2109
+ var g, h;
2110
+ return openBlock(), createBlock(n, {
2114
2111
  variant: "outlined",
2115
2112
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
2116
- "col-span-2": unref(o).length == 1,
2117
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((g = e.modelValue) == null ? void 0 : g.type) == m.value,
2118
- "hover:bg-fm-color-opacity-sm": ((y = e.modelValue) == null ? void 0 : y.type) != m.value
2113
+ "col-span-2": unref(a).length == 1,
2114
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((g = e.modelValue) == null ? void 0 : g.type) == p.value,
2115
+ "hover:bg-fm-color-opacity-sm": ((h = e.modelValue) == null ? void 0 : h.type) != p.value
2119
2116
  }]),
2120
2117
  onClick: () => {
2121
- var i, u;
2122
- ((i = e.modelValue) == null ? void 0 : i.type) != m.value && s("update:model-value", {
2118
+ var s, d;
2119
+ ((s = e.modelValue) == null ? void 0 : s.type) != p.value && i("update:model-value", {
2123
2120
  ...e.modelValue,
2124
- type: m.value,
2125
- end: ((u = e.modelValue) == null ? void 0 : u.end) || 1
2121
+ type: p.value,
2122
+ end: ((d = e.modelValue) == null ? void 0 : d.end) || 1
2126
2123
  });
2127
2124
  },
2128
- key: m.value
2125
+ key: p.value
2129
2126
  }, {
2130
2127
  default: withCtx(() => [
2131
- createElementVNode("div", _hoisted_6$1, toDisplayString(m.label), 1),
2132
- createElementVNode("div", _hoisted_7$1, toDisplayString(m.description), 1)
2128
+ createElementVNode("div", _hoisted_4$1, toDisplayString(p.label), 1),
2129
+ createElementVNode("div", _hoisted_5$1, toDisplayString(p.description), 1)
2133
2130
  ]),
2134
2131
  _: 2
2135
2132
  }, 1032, ["class", "onClick"]);
2136
2133
  }), 128))
2137
2134
  ])
2138
2135
  ]),
2139
- createElementVNode("div", _hoisted_8$1, [
2140
- _hoisted_9$1,
2141
- _hoisted_10$1,
2142
- createVNode(p, {
2136
+ createElementVNode("div", _hoisted_6$1, [
2137
+ l[3] || (l[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Collections required", -1)),
2138
+ 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)),
2139
+ createVNode(c, {
2143
2140
  label: "Maximum to collect",
2144
2141
  "model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
2145
- "onUpdate:modelValue": t[0] || (t[0] = (m) => {
2142
+ "onUpdate:modelValue": l[0] || (l[0] = (p) => {
2146
2143
  var g;
2147
- return s("update:model-value", {
2144
+ return i("update:model-value", {
2148
2145
  ...e.modelValue,
2149
2146
  type: ((g = e.modelValue) == null ? void 0 : g.type) || "STAMP",
2150
- end: m
2147
+ end: p
2151
2148
  });
2152
2149
  }),
2153
- "helper-text": unref(ZodHelper).helperText(unref(r), "end") || "Set the threshold required for reward eligibility",
2154
- "helper-state": unref(ZodHelper).helperState(unref(r), "end") || "none"
2150
+ "helper-text": unref(ZodHelper).helperText(unref(u), "end") || "Set the threshold required for reward eligibility",
2151
+ "helper-state": unref(ZodHelper).helperState(unref(u), "end") || "none"
2155
2152
  }, null, 8, ["model-value", "helper-text", "helper-state"])
2156
2153
  ])
2157
2154
  ]);
@@ -2179,203 +2176,203 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2179
2176
  }
2180
2177
  },
2181
2178
  emits: ["update:model-value", "update:file"],
2182
- setup(e, { emit: d }) {
2183
- const n = e, r = d;
2184
- function o(a) {
2185
- switch (n.field.type) {
2179
+ setup(e, { emit: m }) {
2180
+ const { t: r } = useI18n(), u = e, a = m;
2181
+ function i(c) {
2182
+ switch (u.field.type) {
2186
2183
  case "timeframe":
2187
- const p = a.startDate ? hooks(a.startDate).startOf("day").toISOString() : void 0, v = a.endDate ? hooks(a.endDate).endOf("day").toISOString() : void 0;
2188
- r("update:model-value", {
2184
+ const v = c.startDate ? hooks(c.startDate).startOf("day").toISOString() : void 0, p = c.endDate ? hooks(c.endDate).endOf("day").toISOString() : void 0;
2185
+ a("update:model-value", {
2189
2186
  type: "timeframe",
2190
2187
  property: "__now",
2191
- start: p,
2192
- end: v
2188
+ start: v,
2189
+ end: p
2193
2190
  });
2194
2191
  break;
2195
2192
  case "image": {
2196
- r(
2193
+ a(
2197
2194
  "update:file",
2198
- a,
2199
- s.value || firebaseStorage.collectibleImagePath(void 0, a)
2195
+ c,
2196
+ o.value || firebaseStorage.collectibleImagePath(void 0, c)
2200
2197
  );
2201
2198
  break;
2202
2199
  }
2203
2200
  default:
2204
- r("update:model-value", a);
2201
+ a("update:model-value", c);
2205
2202
  break;
2206
2203
  }
2207
2204
  }
2208
- const s = computed(() => {
2209
- switch (n.field.type) {
2205
+ const o = computed(() => {
2206
+ switch (u.field.type) {
2210
2207
  case "timeframe": {
2211
- const a = n.modelValue;
2208
+ const c = u.modelValue;
2212
2209
  return {
2213
- startDate: a != null && a.start ? hooks(a == null ? void 0 : a.start).format("YYYY-MM-DD") : null,
2214
- endDate: a != null && a.end ? hooks(a == null ? void 0 : a.end).format("YYYY-MM-DD") : null
2210
+ startDate: c != null && c.start ? hooks(c == null ? void 0 : c.start).format("YYYY-MM-DD") : null,
2211
+ endDate: c != null && c.end ? hooks(c == null ? void 0 : c.end).format("YYYY-MM-DD") : null
2215
2212
  };
2216
2213
  }
2217
2214
  default:
2218
- return n.modelValue;
2215
+ return u.modelValue;
2219
2216
  }
2220
2217
  });
2221
2218
  function l() {
2222
- if (!t.value.schema) return [];
2223
- const a = t.value.schema.safeParse(n.modelValue);
2224
- return a.success ? [] : a.error.errors;
2219
+ if (!n.value.schema) return [];
2220
+ const c = n.value.schema.safeParse(u.modelValue);
2221
+ return c.success ? [] : c.error.errors;
2225
2222
  }
2226
- const t = computed(() => ({
2227
- schema: n.schema,
2228
- unwrapped: n.schema ? ZodHelper.unwrap(n.schema) : void 0,
2229
- rules: n.schema ? [ZodHelper.ruleAtPath(n.schema, "")] : void 0,
2230
- labelMark: n.schema && ZodHelper.isRequired(n.schema) == !1 ? "optional" : void 0,
2231
- zodLabel: n.schema ? ZodHelper.toInputLabel(n.schema, n.field.label) : void 0
2223
+ const n = computed(() => ({
2224
+ schema: u.schema,
2225
+ unwrapped: u.schema ? ZodHelper.unwrap(u.schema) : void 0,
2226
+ rules: u.schema ? [ZodHelper.ruleAtPath(u.schema, "")] : void 0,
2227
+ labelMark: u.schema && ZodHelper.isRequired(u.schema) == !1 ? "optional" : void 0,
2228
+ zodLabel: u.schema ? ZodHelper.toInputLabel(u.schema, u.field.label) : void 0
2232
2229
  }));
2233
- return (a, p) => {
2234
- var u, c, f, k, C;
2235
- const v = resolveComponent("FmTextField"), m = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"), y = resolveComponent("FmHelperText"), i = resolveComponent("FmSwitch");
2236
- return e.field.type === "text" ? (openBlock(), createBlock(v, {
2230
+ return (c, v) => {
2231
+ var f, y, C, E, k;
2232
+ const p = resolveComponent("FmTextField"), g = resolveComponent("FmStepperField"), h = resolveComponent("FmTextarea"), s = resolveComponent("FmHelperText"), d = resolveComponent("FmSwitch");
2233
+ return e.field.type === "text" ? (openBlock(), createBlock(p, {
2237
2234
  key: 0,
2238
2235
  label: e.field.label,
2239
- "label-mark": unref(t).labelMark,
2240
- rules: unref(t).rules,
2241
- "model-value": unref(s),
2242
- "onUpdate:modelValue": o
2236
+ "label-mark": unref(n).labelMark,
2237
+ rules: unref(n).rules,
2238
+ "model-value": unref(o),
2239
+ "onUpdate:modelValue": i
2243
2240
  }, null, 8, ["label", "label-mark", "rules", "model-value"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2244
2241
  createVNode(JsonViewer, {
2245
- json: { schema: unref(t).unwrapped, props: n }
2242
+ json: { schema: unref(n).unwrapped, props: u }
2246
2243
  }, null, 8, ["json"]),
2247
- createVNode(m, {
2244
+ createVNode(g, {
2248
2245
  label: e.field.label,
2249
- "label-mark": e.field.isRuleChildren ? void 0 : unref(t).labelMark,
2250
- "model-value": unref(s),
2251
- rules: e.field.isRuleChildren ? [] : unref(t).rules,
2252
- "onUpdate:modelValue": o,
2246
+ "label-mark": e.field.isRuleChildren ? void 0 : unref(n).labelMark,
2247
+ "model-value": unref(o),
2248
+ rules: e.field.isRuleChildren ? [] : unref(n).rules,
2249
+ "onUpdate:modelValue": i,
2253
2250
  "helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
2254
2251
  "helper-text": e.field.isRuleChildren ? e.helperText : void 0
2255
2252
  }, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
2256
- ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(g, {
2253
+ ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(h, {
2257
2254
  key: 2,
2258
2255
  label: e.field.label,
2259
- "label-mark": unref(t).labelMark,
2260
- rules: unref(t).rules,
2261
- "model-value": unref(s),
2262
- "onUpdate:modelValue": o,
2256
+ "label-mark": unref(n).labelMark,
2257
+ rules: unref(n).rules,
2258
+ "model-value": unref(o),
2259
+ "onUpdate:modelValue": i,
2263
2260
  "show-word-count": "",
2264
- "max-length": (C = (k = (f = (c = (u = unref(t)) == null ? void 0 : u.unwrapped) == null ? void 0 : c._def) == null ? void 0 : f.checks) == null ? void 0 : k.find((b) => b.kind == "max")) == null ? void 0 : C.value
2261
+ "max-length": (k = (E = (C = (y = (f = unref(n)) == null ? void 0 : f.unwrapped) == null ? void 0 : y._def) == null ? void 0 : C.checks) == null ? void 0 : E.find((B) => B.kind == "max")) == null ? void 0 : k.value
2265
2262
  }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$j, {
2266
2263
  key: 3,
2267
2264
  "campaign-type": e.extras,
2268
- "model-value": unref(s),
2265
+ "model-value": unref(o),
2269
2266
  disabled: e.disabled,
2270
- "onUpdate:modelValue": o
2267
+ "onUpdate:modelValue": i
2271
2268
  }, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
2272
2269
  createVNode(_sfc_main$h, {
2273
- "model-value": unref(s),
2274
- "onUpdate:modelValue": o
2270
+ "model-value": unref(o),
2271
+ "onUpdate:modelValue": i
2275
2272
  }, null, 8, ["model-value"]),
2276
- createVNode(y, {
2273
+ createVNode(s, {
2277
2274
  class: "!mt-[8px]",
2278
2275
  text: unref(ZodHelper).helperText(l(), ""),
2279
2276
  state: unref(ZodHelper).helperState(l(), "")
2280
2277
  }, null, 8, ["text", "state"])
2281
2278
  ], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$v, {
2282
2279
  key: 5,
2283
- thumbnail: unref(s),
2280
+ thumbnail: unref(o),
2284
2281
  "aspect-ratio": "16 / 9",
2285
2282
  class: "w-1/2 xs:w-2/3",
2286
- "onUpdate:file": o
2283
+ "onUpdate:file": i
2287
2284
  }, {
2288
2285
  label: withCtx(() => [
2289
- (openBlock(), createBlock(resolveDynamicComponent(unref(t).zodLabel)))
2286
+ (openBlock(), createBlock(resolveDynamicComponent(unref(n).zodLabel)))
2290
2287
  ]),
2291
2288
  _: 1
2292
- }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(i, {
2289
+ }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(d, {
2293
2290
  key: 6,
2294
2291
  label: e.field.label,
2295
2292
  "label-placement": "right",
2296
2293
  sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
2297
- "label-mark": unref(t).labelMark,
2298
- rules: unref(t).rules,
2299
- "model-value": unref(s),
2300
- "onUpdate:modelValue": o
2294
+ "label-mark": unref(n).labelMark,
2295
+ rules: unref(n).rules,
2296
+ "model-value": unref(o),
2297
+ "onUpdate:modelValue": i
2301
2298
  }, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$x, {
2302
2299
  key: 7,
2303
- "model-value": unref(s),
2304
- "onUpdate:modelValue": o,
2300
+ "model-value": unref(o),
2301
+ "onUpdate:modelValue": i,
2305
2302
  "no-campaign": !1,
2306
- schema: unref(t).schema,
2303
+ schema: unref(n).schema,
2307
2304
  "is-mission": e.extras === "MISSION"
2308
2305
  }, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$y, {
2309
2306
  key: 8,
2310
- "model-value": unref(s),
2311
- "onUpdate:modelValue": o
2307
+ "model-value": unref(o),
2308
+ "onUpdate:modelValue": i
2312
2309
  }, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
2313
2310
  createVNode(_sfc_main$w, {
2314
- "model-value": unref(s),
2315
- "onUpdate:modelValue": o,
2311
+ "model-value": unref(o),
2312
+ "onUpdate:modelValue": i,
2316
2313
  "can-set-auto-apply": e.field.property == "campaign.effect"
2317
2314
  }, null, 8, ["model-value", "can-set-auto-apply"]),
2318
- unref(s) ? createCommentVNode("", !0) : (openBlock(), createBlock(y, {
2315
+ unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(s, {
2319
2316
  key: 0,
2320
2317
  class: "!mt-[8px]",
2321
- text: "Effect is required",
2318
+ text: unref(r)("connect.campaign.common.effect_required"),
2322
2319
  state: "error"
2323
- }))
2320
+ }, null, 8, ["text"]))
2324
2321
  ], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$A, {
2325
2322
  key: 10,
2326
2323
  "allow-email": !0,
2327
- "model-value": unref(s),
2328
- "onUpdate:modelValue": o,
2324
+ "model-value": unref(o),
2325
+ "onUpdate:modelValue": i,
2329
2326
  "helper-text": unref(ZodHelper).helperText(l(), ""),
2330
2327
  "trigger-type": e.field.extras,
2331
2328
  "helper-state": unref(ZodHelper).helperState(l(), "")
2332
2329
  }, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$e, {
2333
2330
  key: 11,
2334
- "model-value": unref(s),
2335
- "onUpdate:modelValue": o,
2331
+ "model-value": unref(o),
2332
+ "onUpdate:modelValue": i,
2336
2333
  extras: e.extras,
2337
2334
  "error-text": e.helperText
2338
2335
  }, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$z, {
2339
2336
  key: 12,
2340
2337
  type: "custom",
2341
- "model-value": unref(s),
2342
- "onUpdate:modelValue": o,
2338
+ "model-value": unref(o),
2339
+ "onUpdate:modelValue": i,
2343
2340
  "helper-text": e.helperText || unref(ZodHelper).helperText(l(), "")
2344
2341
  }, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$d, {
2345
2342
  key: 13,
2346
- "model-value": unref(s),
2347
- "onUpdate:modelValue": o
2343
+ "model-value": unref(o),
2344
+ "onUpdate:modelValue": i
2348
2345
  }, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
2349
2346
  key: 14,
2350
- "model-value": unref(s),
2351
- "onUpdate:modelValue": o
2347
+ "model-value": unref(o),
2348
+ "onUpdate:modelValue": i
2352
2349
  }, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
2353
2350
  key: 15,
2354
- "model-value": unref(s),
2355
- "onUpdate:modelValue": o
2351
+ "model-value": unref(o),
2352
+ "onUpdate:modelValue": i
2356
2353
  }, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
2357
2354
  key: 16,
2358
- "model-value": unref(s),
2359
- "onUpdate:modelValue": o
2355
+ "model-value": unref(o),
2356
+ "onUpdate:modelValue": i
2360
2357
  }, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
2361
2358
  key: 17,
2362
- "model-value": unref(s),
2363
- "onUpdate:modelValue": o,
2359
+ "model-value": unref(o),
2360
+ "onUpdate:modelValue": i,
2364
2361
  "helper-text": unref(ZodHelper).helperText(l(), ""),
2365
2362
  "helper-state": unref(ZodHelper).helperState(l(), "")
2366
2363
  }, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
2367
2364
  key: 18,
2368
- "model-value": unref(s),
2369
- "onUpdate:modelValue": o,
2365
+ "model-value": unref(o),
2366
+ "onUpdate:modelValue": i,
2370
2367
  mission: e.extras.mission
2371
2368
  }, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
2372
2369
  createVNode(_sfc_main$g, {
2373
- "model-value": unref(s),
2374
- "onUpdate:modelValue": o,
2370
+ "model-value": unref(o),
2371
+ "onUpdate:modelValue": i,
2375
2372
  "start-date": e.extras.start,
2376
2373
  "end-date": e.extras.end
2377
2374
  }, null, 8, ["model-value", "start-date", "end-date"]),
2378
- e.helperText ? (openBlock(), createBlock(y, {
2375
+ e.helperText ? (openBlock(), createBlock(s, {
2379
2376
  key: 0,
2380
2377
  class: "!mt-[8px]",
2381
2378
  text: e.helperText,
@@ -2383,26 +2380,26 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2383
2380
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2384
2381
  ], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
2385
2382
  createVNode(_sfc_main$o, {
2386
- "model-value": unref(s),
2387
- "onUpdate:modelValue": o
2383
+ "model-value": unref(o),
2384
+ "onUpdate:modelValue": i
2388
2385
  }, null, 8, ["model-value"]),
2389
- e.helperText ? (openBlock(), createBlock(y, {
2386
+ e.helperText ? (openBlock(), createBlock(s, {
2390
2387
  key: 0,
2391
2388
  class: "!mt-[8px]",
2392
2389
  text: e.helperText,
2393
2390
  state: "error"
2394
2391
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2395
2392
  ], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
2396
- e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(s).rules.g_time).length > 0 ? (openBlock(), createBlock(y, {
2393
+ e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(o).rules.g_time).length > 0 ? (openBlock(), createBlock(s, {
2397
2394
  key: 0,
2398
2395
  state: "warning",
2399
2396
  text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
2400
2397
  }, null, 8, ["text"])) : createCommentVNode("", !0),
2401
2398
  createVNode(_sfc_main$n, {
2402
- "model-value": unref(s),
2403
- "onUpdate:modelValue": o
2399
+ "model-value": unref(o),
2400
+ "onUpdate:modelValue": i
2404
2401
  }, null, 8, ["model-value"]),
2405
- e.helperText ? (openBlock(), createBlock(y, {
2402
+ e.helperText ? (openBlock(), createBlock(s, {
2406
2403
  key: 1,
2407
2404
  class: "!mt-[8px]",
2408
2405
  text: e.helperText,
@@ -2410,10 +2407,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2410
2407
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2411
2408
  ], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
2412
2409
  createVNode(_sfc_main$m, {
2413
- "model-value": unref(s),
2414
- "onUpdate:modelValue": o
2410
+ "model-value": unref(o),
2411
+ "onUpdate:modelValue": i
2415
2412
  }, null, 8, ["model-value"]),
2416
- e.helperText ? (openBlock(), createBlock(y, {
2413
+ e.helperText ? (openBlock(), createBlock(s, {
2417
2414
  key: 0,
2418
2415
  class: "!mt-[8px]",
2419
2416
  text: e.helperText,
@@ -2421,10 +2418,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2421
2418
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2422
2419
  ], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
2423
2420
  createVNode(_sfc_main$k, {
2424
- "model-value": unref(s),
2425
- "onUpdate:modelValue": o
2421
+ "model-value": unref(o),
2422
+ "onUpdate:modelValue": i
2426
2423
  }, null, 8, ["model-value"]),
2427
- e.helperText ? (openBlock(), createBlock(y, {
2424
+ e.helperText ? (openBlock(), createBlock(s, {
2428
2425
  key: 0,
2429
2426
  class: "!mt-[8px]",
2430
2427
  text: e.helperText,
@@ -2432,10 +2429,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2432
2429
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2433
2430
  ], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
2434
2431
  createVNode(_sfc_main$l, {
2435
- "model-value": unref(s),
2436
- "onUpdate:modelValue": o
2432
+ "model-value": unref(o),
2433
+ "onUpdate:modelValue": i
2437
2434
  }, null, 8, ["model-value"]),
2438
- e.helperText ? (openBlock(), createBlock(y, {
2435
+ e.helperText ? (openBlock(), createBlock(s, {
2439
2436
  key: 0,
2440
2437
  class: "!mt-[8px]",
2441
2438
  text: e.helperText,
@@ -2443,19 +2440,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2443
2440
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2444
2441
  ], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
2445
2442
  createVNode(_sfc_main$9, {
2446
- "model-value": unref(s),
2447
- "onUpdate:modelValue": o
2443
+ "model-value": unref(o),
2444
+ "onUpdate:modelValue": i
2448
2445
  }, null, 8, ["model-value"]),
2449
- e.helperText ? (openBlock(), createBlock(y, {
2446
+ e.helperText ? (openBlock(), createBlock(s, {
2450
2447
  key: 0,
2451
2448
  class: "!mt-[8px]",
2452
2449
  text: e.helperText,
2453
2450
  state: "error"
2454
2451
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2455
- ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(n.field), 1));
2452
+ ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(u.field), 1));
2456
2453
  };
2457
2454
  }
2458
- }), _hoisted_1$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Campaign summary", -1), _hoisted_2$1 = /* @__PURE__ */ createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1), _hoisted_3$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_4$1 = { class: "fm-typo-en-body-lg-600" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
2455
+ }), _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({
2459
2456
  __name: "CampaignSummary",
2460
2457
  props: {
2461
2458
  data: {
@@ -2464,22 +2461,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2464
2461
  }
2465
2462
  },
2466
2463
  setup(e) {
2467
- return (d, n) => {
2468
- const r = resolveComponent("FmCard");
2469
- return openBlock(), createBlock(r, {
2464
+ const { t: m, te: r } = useI18n();
2465
+ return (u, a) => {
2466
+ const i = resolveComponent("FmCard");
2467
+ return openBlock(), createBlock(i, {
2470
2468
  variant: "outlined",
2471
2469
  class: "p-16 space-y-8"
2472
2470
  }, {
2473
2471
  default: withCtx(() => [
2474
- _hoisted_1$1,
2475
- _hoisted_2$1,
2476
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (o, s) => (openBlock(), createElementBlock("div", {
2472
+ createElementVNode("div", _hoisted_1$1, toDisplayString(unref(m)("connect.campaign.common.summary")), 1),
2473
+ a[0] || (a[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
2474
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (o, l) => (openBlock(), createElementBlock("div", {
2477
2475
  class: "space-y-4",
2478
- key: s
2476
+ key: l
2479
2477
  }, [
2480
2478
  o ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2481
- createElementVNode("div", _hoisted_3$1, toDisplayString(s), 1),
2482
- createElementVNode("div", _hoisted_4$1, toDisplayString(o), 1)
2479
+ createElementVNode("div", _hoisted_2$1, toDisplayString(unref(m)(`${l}`)), 1),
2480
+ createElementVNode("div", _hoisted_3$1, toDisplayString(unref(r)(`${o}`) ? unref(m)(`${o}`) : o), 1)
2483
2481
  ], 64)) : createCommentVNode("", !0)
2484
2482
  ]))), 128))
2485
2483
  ]),
@@ -2490,54 +2488,39 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2490
2488
  }), _hoisted_1 = { class: "xs:hidden px-24 pb-[14px] pt-[22px] flex items-center justify-between w-full border-b" }, _hoisted_2 = { class: "flex items-center gap-8" }, _hoisted_3 = {
2491
2489
  key: 0,
2492
2490
  class: "max-w-6xl mx-auto"
2493
- }, _hoisted_4 = { class: "hidden xs:flex gap-8 items-center w-full px-16 py-8 border-b border-fm-color-neutral-gray-100" }, _hoisted_5 = { class: "grid grid-cols-3 gap-40" }, _hoisted_6 = { class: "col-span-2 space-y-40 xs:col-span-3 xs:px-16 xs:pt-16" }, _hoisted_7 = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, _hoisted_8 = { class: "w-full flex items-center justify-end gap-8 pb-24" }, _hoisted_9 = { class: "max-w-6xl mx-auto rounded-md p-4 w-full" }, _hoisted_10 = { class: "animate-pulse flex space-x-4 pt-16" }, _hoisted_11 = { class: "grid grid-cols-3 w-full gap-40" }, _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
2494
- /* @__PURE__ */ createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
2495
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
2496
- /* @__PURE__ */ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
2497
- /* @__PURE__ */ createElementVNode("div", { class: "space-y-3" }, [
2498
- /* @__PURE__ */ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
2499
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
2500
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2501
- ]),
2502
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2503
- ]),
2504
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
2505
- /* @__PURE__ */ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
2506
- /* @__PURE__ */ createElementVNode("div", { class: "space-y-3" }, [
2507
- /* @__PURE__ */ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
2508
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
2509
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2510
- ]),
2511
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2512
- ])
2513
- ])
2514
- ], -1), _sfc_main = /* @__PURE__ */ defineComponent({
2491
+ }, _hoisted_4 = { class: "hidden xs:flex gap-8 items-center w-full px-16 py-8 border-b border-fm-color-neutral-gray-100" }, _hoisted_5 = { class: "grid grid-cols-3 gap-40" }, _hoisted_6 = { class: "col-span-2 space-y-40 xs:col-span-3 xs:px-16 xs:pt-16" }, _hoisted_7 = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, _hoisted_8 = { class: "w-full flex items-center justify-end gap-8 pb-24" }, _hoisted_9 = { class: "max-w-6xl mx-auto rounded-md p-4 w-full" }, _hoisted_10 = { class: "animate-pulse flex space-x-4 pt-16" }, _hoisted_11 = { class: "grid grid-cols-3 w-full gap-40" }, _sfc_main = /* @__PURE__ */ defineComponent({
2515
2492
  __name: "EditCampaignSheet",
2516
2493
  emits: ["submit:model-value"],
2517
2494
  setup(__props, { expose: __expose, emit: __emit }) {
2518
- const Dialog = useDialog(), sheetVisible = ref(!1), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
2495
+ const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
2519
2496
  TEMPLATES.VOUCHER
2520
2497
  ), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
2521
2498
  async function showSheet(visible, type, campaign, selectedTemplate) {
2522
- var e, d;
2499
+ var e, m;
2523
2500
  if (sheetVisible.value = visible, visible == !0) {
2524
2501
  try {
2525
2502
  isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
2526
2503
  } catch {
2527
2504
  } finally {
2528
- await new Promise((n) => setTimeout(n, 120)), isLoading.value = !1;
2505
+ await new Promise((r) => setTimeout(r, 120)), isLoading.value = !1;
2529
2506
  }
2530
2507
  template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
2531
- ...(d = template.value) == null ? void 0 : d.defaultValue
2508
+ ...(m = template.value) == null ? void 0 : m.defaultValue
2532
2509
  }), "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`;
2533
2510
  }
2534
2511
  }
2535
2512
  async function hideSheet() {
2536
2513
  Dialog.open({
2537
- title: "Unsaved Changes",
2538
- message: "Are you sure you want to discard this changes?",
2539
- primaryActions: { text: "Discard", close: !0 },
2540
- secondaryActions: { text: "Cancel", close: !1 }
2514
+ title: t("connect.campaign.common.unsaved_changes"),
2515
+ message: t("connect.campaign.common.unsaved_changes"),
2516
+ primaryActions: {
2517
+ text: t("connect.campaign.common.unsaved_changes_confirm"),
2518
+ close: !0
2519
+ },
2520
+ secondaryActions: {
2521
+ text: t("connect.campaign.common.unsaved_changes_cancel"),
2522
+ close: !1
2523
+ }
2541
2524
  }).onPrimary(() => {
2542
2525
  sheetVisible.value = !1;
2543
2526
  }).onSecondary(() => {
@@ -2549,10 +2532,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2549
2532
  return e.success ? [] : e.error.errors;
2550
2533
  });
2551
2534
  function stepErrors(e = currentStep.value - 1) {
2552
- const d = template.value.steps[e].groups.flatMap(
2553
- (n) => n.fields.map((r) => r.property)
2535
+ const m = template.value.steps[e].groups.flatMap(
2536
+ (r) => r.fields.map((u) => u.property)
2554
2537
  );
2555
- return errors.value.filter((n) => d.includes(n.path.join(".")));
2538
+ return errors.value.filter((r) => m.includes(r.path.join(".")));
2556
2539
  }
2557
2540
  __expose({ showSheet });
2558
2541
  function showSummaryDialog() {
@@ -2564,9 +2547,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2564
2547
  }
2565
2548
  });
2566
2549
  }
2567
- function onUpdateProperty(e, d) {
2568
- if (_.set(data.value, e, d), e == "campaign.event.type") {
2569
- const n = RuleBuilder.setRuleToGroup(
2550
+ function onUpdateProperty(e, m) {
2551
+ if (_.set(data.value, e, m), e == "campaign.event.type") {
2552
+ const r = RuleBuilder.setRuleToGroup(
2570
2553
  RuleBuilder.scaffoldGroup(),
2571
2554
  [
2572
2555
  RuleBuilder.scaffoldGroup("g_schedule"),
@@ -2574,7 +2557,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2574
2557
  RuleBuilder.scaffoldGroup("g_user"),
2575
2558
  RuleBuilder.scaffoldGroup("g_bill")
2576
2559
  ]
2577
- ), r = RuleBuilder.setRuleToGroup(
2560
+ ), u = RuleBuilder.setRuleToGroup(
2578
2561
  RuleBuilder.scaffoldGroup("g_schedule"),
2579
2562
  [
2580
2563
  RuleBuilder.constructEntry(
@@ -2586,29 +2569,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2586
2569
  ],
2587
2570
  "&&"
2588
2571
  );
2589
- if (d != "SCHEDULE") {
2590
- _.set(data.value, "campaign.event.rule", n);
2572
+ if (m != "SCHEDULE") {
2573
+ _.set(data.value, "campaign.event.rule", r);
2591
2574
  return;
2592
2575
  }
2593
2576
  _.set(
2594
2577
  data.value,
2595
2578
  "campaign.event.rule",
2596
- RuleBuilder.setRuleToGroup(n, r)
2579
+ RuleBuilder.setRuleToGroup(r, u)
2597
2580
  );
2598
2581
  }
2599
- e == "campaign.notify" && d == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
2582
+ e == "campaign.notify" && m == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
2600
2583
  }
2601
- async function onUpdateFile(e, d) {
2602
- return e ? await minor(async () => firebaseStorage.update(d, e), {
2584
+ async function onUpdateFile(e, m) {
2585
+ return e ? await minor(async () => firebaseStorage.update(m, e), {
2603
2586
  message: `${e ? "Uploading" : "Removing"} file`,
2604
2587
  successMessage: `File ${e ? "uploaded" : "removed"} successfully`
2605
2588
  }) : "";
2606
2589
  }
2607
2590
  function isDisable(e) {
2608
- var d, n;
2591
+ var m, r;
2609
2592
  switch (e == null ? void 0 : e.property) {
2610
2593
  case "campaign.event.type":
2611
- return ((n = (d = data.value) == null ? void 0 : d.campaign) == null ? void 0 : n._id) || !1;
2594
+ return ((r = (m = data.value) == null ? void 0 : m.campaign) == null ? void 0 : r._id) || !1;
2612
2595
  default:
2613
2596
  return !1;
2614
2597
  }
@@ -2617,30 +2600,30 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2617
2600
  const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
2618
2601
  e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
2619
2602
  }
2620
- return (e, d) => {
2621
- const n = resolveComponent("FmButton"), r = resolveComponent("FmStep"), o = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
2622
- return openBlock(), createBlock(l, {
2603
+ return (e, m) => {
2604
+ const r = resolveComponent("FmButton"), u = resolveComponent("FmStep"), a = resolveComponent("FmStepper"), i = resolveComponent("FmCard"), o = resolveComponent("FmTopSheet");
2605
+ return openBlock(), createBlock(o, {
2623
2606
  "fullscreen-size": "lg",
2624
2607
  modelValue: unref(sheetVisible),
2625
2608
  "onUpdate:modelValue": [
2626
- d[7] || (d[7] = (t) => isRef(sheetVisible) ? sheetVisible.value = t : null),
2627
- d[8] || (d[8] = (t) => sheetVisible.value = t)
2609
+ m[7] || (m[7] = (l) => isRef(sheetVisible) ? sheetVisible.value = l : null),
2610
+ m[8] || (m[8] = (l) => sheetVisible.value = l)
2628
2611
  ]
2629
2612
  }, createSlots({
2630
2613
  "top-sheet-header": withCtx(() => [
2631
2614
  createElementVNode("div", _hoisted_1, [
2632
2615
  createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
2633
2616
  createElementVNode("div", _hoisted_2, [
2634
- createVNode(n, {
2635
- onClick: d[0] || (d[0] = (t) => hideSheet()),
2636
- label: "Cancel",
2617
+ createVNode(r, {
2618
+ onClick: m[0] || (m[0] = (l) => hideSheet()),
2619
+ label: unref(t)("connect.campaign.common.cancel"),
2637
2620
  variant: "tertiary"
2638
- }),
2639
- createVNode(n, {
2621
+ }, null, 8, ["label"]),
2622
+ createVNode(r, {
2640
2623
  onClick: onSubmit,
2641
- label: "Save",
2624
+ label: unref(t)("connect.campaign.common.save"),
2642
2625
  disabled: unref(errors).length > 0
2643
- }, null, 8, ["disabled"])
2626
+ }, null, 8, ["label", "disabled"])
2644
2627
  ])
2645
2628
  ])
2646
2629
  ]),
@@ -2652,8 +2635,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2652
2635
  createElementVNode("div", _hoisted_9, [
2653
2636
  createElementVNode("div", _hoisted_10, [
2654
2637
  createElementVNode("div", _hoisted_11, [
2655
- _hoisted_12,
2656
- createVNode(s, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2638
+ m[9] || (m[9] = createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
2639
+ createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
2640
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
2641
+ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
2642
+ createElementVNode("div", { class: "space-y-3" }, [
2643
+ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
2644
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
2645
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2646
+ ]),
2647
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2648
+ ]),
2649
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
2650
+ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
2651
+ createElementVNode("div", { class: "space-y-3" }, [
2652
+ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
2653
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
2654
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2655
+ ]),
2656
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2657
+ ])
2658
+ ])
2659
+ ], -1)),
2660
+ createVNode(i, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2657
2661
  ])
2658
2662
  ])
2659
2663
  ])
@@ -2663,51 +2667,51 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2663
2667
  name: "default",
2664
2668
  fn: withCtx(() => [
2665
2669
  unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
2666
- createVNode(o, {
2670
+ createVNode(a, {
2667
2671
  modelValue: unref(currentStep),
2668
- "onUpdate:modelValue": d[1] || (d[1] = (t) => isRef(currentStep) ? currentStep.value = t : null),
2672
+ "onUpdate:modelValue": m[1] || (m[1] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2669
2673
  orientation: "horizontal",
2670
2674
  class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
2671
2675
  }, {
2672
2676
  default: withCtx(() => [
2673
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, a) => (openBlock(), createBlock(r, {
2674
- key: t.name,
2675
- title: t.name,
2676
- value: a + 1,
2677
- error: () => stepErrors(a).length > 0,
2678
- complete: () => a + 1 <= unref(currentStep)
2677
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(u, {
2678
+ key: l.name,
2679
+ title: l.name,
2680
+ value: n + 1,
2681
+ error: () => stepErrors(n).length > 0,
2682
+ complete: () => n + 1 <= unref(currentStep)
2679
2683
  }, null, 8, ["title", "value", "error", "complete"]))), 128))
2680
2684
  ]),
2681
2685
  _: 1
2682
2686
  }, 8, ["modelValue"]),
2683
2687
  createElementVNode("div", _hoisted_4, [
2684
- createVNode(n, {
2688
+ createVNode(r, {
2685
2689
  icon: "close",
2686
2690
  variant: "tertiary",
2687
- onClick: d[2] || (d[2] = (t) => sheetVisible.value = !1)
2691
+ onClick: m[2] || (m[2] = (l) => sheetVisible.value = !1)
2688
2692
  }),
2689
- createVNode(o, {
2693
+ createVNode(a, {
2690
2694
  modelValue: unref(currentStep),
2691
- "onUpdate:modelValue": d[3] || (d[3] = (t) => isRef(currentStep) ? currentStep.value = t : null),
2695
+ "onUpdate:modelValue": m[3] || (m[3] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2692
2696
  orientation: "horizontal",
2693
2697
  class: "flex-1"
2694
2698
  }, {
2695
2699
  default: withCtx(() => [
2696
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, a) => (openBlock(), createBlock(r, {
2697
- key: t.name,
2700
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(u, {
2701
+ key: l.name,
2698
2702
  title: unref(sheetTitle),
2699
- description: t.name,
2700
- value: a + 1,
2701
- error: () => stepErrors(a).length > 0,
2702
- complete: () => a + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
2703
+ description: l.name,
2704
+ value: n + 1,
2705
+ error: () => stepErrors(n).length > 0,
2706
+ complete: () => n + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
2703
2707
  }, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
2704
2708
  ]),
2705
2709
  _: 1
2706
2710
  }, 8, ["modelValue"]),
2707
- createVNode(n, {
2711
+ createVNode(r, {
2708
2712
  icon: "info",
2709
2713
  variant: "tertiary",
2710
- onClick: d[4] || (d[4] = () => showSummaryDialog())
2714
+ onClick: m[4] || (m[4] = () => showSummaryDialog())
2711
2715
  })
2712
2716
  ]),
2713
2717
  createElementVNode("div", _hoisted_5, [
@@ -2716,53 +2720,53 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2716
2720
  json: {
2717
2721
  data: unref(data),
2718
2722
  errors: unref(errors).map(
2719
- (t) => `${t.path.join(".")} - ${t.message}`
2723
+ (l) => `${l.path.join(".")} - ${l.message}`
2720
2724
  ),
2721
2725
  stepErrors: stepErrors().map(
2722
- (t) => `${t.path.join(".")} - ${t.message}`
2726
+ (l) => `${l.path.join(".")} - ${l.message}`
2723
2727
  ),
2724
2728
  schema: unref(schema)
2725
2729
  }
2726
2730
  }, null, 8, ["json"]),
2727
2731
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
2728
- (t) => t.fields.length && (!t.condition || unref(_).get(unref(data), t.condition.property) == t.condition.value == (t.condition.not != !0))
2729
- ), (t, a) => (openBlock(), createElementBlock("div", {
2730
- key: a,
2732
+ (l) => l.fields.length && (!l.condition || unref(_).get(unref(data), l.condition.property) == l.condition.value == (l.condition.not != !0))
2733
+ ), (l, n) => (openBlock(), createElementBlock("div", {
2734
+ key: n,
2731
2735
  class: "space-y-24"
2732
2736
  }, [
2733
- createElementVNode("div", _hoisted_7, toDisplayString(t.name), 1),
2734
- (openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (p, v) => (openBlock(), createElementBlock("div", { key: v }, [
2737
+ createElementVNode("div", _hoisted_7, toDisplayString(l.name), 1),
2738
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(l.fields, (c, v) => (openBlock(), createElementBlock("div", { key: v }, [
2735
2739
  (openBlock(), createBlock(_sfc_main$2, {
2736
2740
  key: v,
2737
- field: p,
2738
- modelValue: unref(_).get(unref(data), p.property),
2739
- disabled: isDisable(p),
2740
- "onUpdate:modelValue": (m) => onUpdateProperty(p.property, m),
2741
- "onUpdate:file": async (m, g) => {
2742
- const y = await onUpdateFile(m, g);
2743
- onUpdateProperty(p.property, y || "");
2741
+ field: c,
2742
+ modelValue: unref(_).get(unref(data), c.property),
2743
+ disabled: isDisable(c),
2744
+ "onUpdate:modelValue": (p) => onUpdateProperty(c.property, p),
2745
+ "onUpdate:file": async (p, g) => {
2746
+ const h = await onUpdateFile(p, g);
2747
+ onUpdateProperty(c.property, h || "");
2744
2748
  },
2745
2749
  schema: unref(ZodHelper).typeAtPath(
2746
2750
  unref(schema),
2747
- p.property,
2751
+ c.property,
2748
2752
  unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
2749
2753
  ),
2750
- "helper-text": unref(ZodHelper).helperText(unref(errors), p.property),
2751
- extras: p.extras != null ? p.extras == "" ? unref(data) : unref(_).get(unref(data), p.extras) : void 0
2754
+ "helper-text": unref(ZodHelper).helperText(unref(errors), c.property),
2755
+ extras: c.extras != null ? c.extras == "" ? unref(data) : unref(_).get(unref(data), c.extras) : void 0
2752
2756
  }, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-text", "extras"]))
2753
2757
  ]))), 128))
2754
2758
  ]))), 128)),
2755
2759
  createElementVNode("div", _hoisted_8, [
2756
- createVNode(n, {
2760
+ createVNode(r, {
2757
2761
  label: "Back",
2758
2762
  variant: "tertiary",
2759
2763
  disabled: unref(currentStep) == 1,
2760
- onClick: d[5] || (d[5] = (t) => currentStep.value--)
2764
+ onClick: m[5] || (m[5] = (l) => currentStep.value--)
2761
2765
  }, null, 8, ["disabled"]),
2762
- createVNode(n, {
2766
+ createVNode(r, {
2763
2767
  disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
2764
2768
  label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
2765
- onClick: d[6] || (d[6] = (t) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2769
+ onClick: m[6] || (m[6] = (l) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2766
2770
  }, null, 8, ["disabled", "label"])
2767
2771
  ])
2768
2772
  ]),