@feedmepos/mf-connect 0.0.16-beta.12 → 0.0.16-beta.13

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 (71) hide show
  1. package/dist/{Analytic-DIc9BYb0.js → Analytic-B8FGU0B7.js} +32 -32
  2. package/dist/App-BXAJ1Z_T.js +6260 -0
  3. package/dist/{Broadcast-dVPgK5QV.js → Broadcast-DvmjAtxH.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-TnEPvafD.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dvp3mOEx.js} +8 -8
  5. package/dist/{Card-Bj2Yd2pr.js → Card-DblSxqRr.js} +28 -28
  6. package/dist/{Collections-Fkb_zzqZ.js → Collections-C4KRnnWW.js} +4 -4
  7. package/dist/{Credit-DHn9OkE8.js → Credit-C5MbDbWr.js} +8 -8
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C1ZXQski.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-2MKUx_As.js} +718 -718
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-D6mWny8y.js → EffectSheet.vue_vue_type_style_index_0_lang-CCsxDg45.js} +5 -5
  10. package/dist/{Experience-DX3aJihS.js → Experience-CmDLg17p.js} +8 -8
  11. package/dist/{Game-CcVQvETd.js → Game-5zvjlfuj.js} +8 -8
  12. package/dist/{Marketing-B9kykWEh.js → Marketing-BVpimsBU.js} +5 -5
  13. package/dist/Member-BkOqtn9n.js +69 -0
  14. package/dist/{MemberList-BUDxqMEK.js → MemberList-3IvxRInu.js} +105 -105
  15. package/dist/{MemberTransactions-Bh_tT1Rp.js → MemberTransactions-DRpV77Pn.js} +1 -1
  16. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Cj3-JHOX.js → MessageInput.vue_vue_type_script_setup_true_lang-CBvpHaAl.js} +2 -2
  17. package/dist/{Mission-DDvgCLy0.js → Mission-9fJLMJKS.js} +8 -8
  18. package/dist/{Point-BbPkt4kF.js → Point-7O6IdhWH.js} +8 -8
  19. package/dist/Promotion-XqpFw0IZ.js +247 -0
  20. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BGjeTeqS.js → RuleGroup.vue_vue_type_script_setup_true_lang-1Fko0V0J.js} +14 -14
  21. package/dist/{Segment-DAcpZWIN.js → Segment-DMaHcJT_.js} +8 -8
  22. package/dist/{Setting-CgXohUPt.js → Setting-DQh2aqfD.js} +8 -8
  23. package/dist/{Store-BVyHbQ8o.js → Store-WvEUlY9N.js} +393 -393
  24. package/dist/{StoreRewards-sccMDbkj.js → StoreRewards-D50uR2b9.js} +11 -11
  25. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang--sdQ_l8g.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Cm0lHUkP.js} +6 -6
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CXlkvt2u.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BnjVkkS1.js} +1 -1
  27. package/dist/{Tier--P27XXbB.js → Tier-CqNKi52t.js} +14 -14
  28. package/dist/{Title-B27S3SxD.js → Title-CzBp5ig0.js} +14 -14
  29. package/dist/{Transaction-CYTtwwHY.js → Transaction-EKIwyavj.js} +2 -2
  30. package/dist/{Voucher-BZ8PKgO5.js → Voucher-Dhpzn8gs.js} +11 -11
  31. package/dist/{app-FfENBuoE.js → app-3-6LVz11.js} +27 -24
  32. package/dist/{app-CnKzqAcN.js → app-DM-4iSsh.js} +1 -1
  33. package/dist/app.js +1 -1
  34. package/dist/{business-CXyP9G7A.js → business-Wk7ElvEz.js} +1 -1
  35. package/dist/{campaign-0aM2KYOy.js → campaign-tHUDB7cm.js} +2 -2
  36. package/dist/{collection.fn-FicQhH1t.js → collection.fn-DS11Xpbu.js} +2 -2
  37. package/dist/{dto-BiYLkVdL.js → dto-B8X9qnLh.js} +147 -147
  38. package/dist/{effect-Cg-eNEjg.js → effect-BH3AL4S6.js} +9 -9
  39. package/dist/{export-D7BuObOL.js → export-DAAmj_h9.js} +3 -3
  40. package/dist/{helper-DvD-D7c7.js → helper-BSKllptD.js} +1 -1
  41. package/dist/index-5FIs0G8O.js +29193 -0
  42. package/dist/{index-DmdKoKk_.js → index-B0Pw9YQd.js} +2 -2
  43. package/dist/{index-BRXg5Si1.js → index-BH-mOC5-.js} +5 -5
  44. package/dist/{index-B1Q0GAWp.js → index-BO94KhQO.js} +1 -1
  45. package/dist/{index-BuDwICBJ.js → index-BgIWS3vT.js} +5 -5
  46. package/dist/{index-B6c-fUij.js → index-CIBWHBM-.js} +2 -2
  47. package/dist/{index-DA-fzkRR.js → index-CPxCpRFW.js} +3 -3
  48. package/dist/{index-Dkeb_9ER.js → index-CoYSYku2.js} +1 -1
  49. package/dist/{index-G-88ujCM.js → index-DOFTUTiA.js} +1 -1
  50. package/dist/{index-BP_5cfKa.js → index-DmxAa1MA.js} +1 -1
  51. package/dist/{index-CDMC-8iO.js → index-Z7d84hDW.js} +7 -2
  52. package/dist/{index-CcZt3OrE.js → index-vIwngIP9.js} +1 -1
  53. package/dist/index.esm2017-jX1Q0DsS.js +3069 -0
  54. package/dist/{loading-uCNeZibp.js → loading-DeWfPgai.js} +10751 -13605
  55. package/dist/{membership-DFRO9TyM.js → membership-oIubaesw.js} +3 -3
  56. package/dist/money-D-3GphEZ.js +15 -0
  57. package/dist/number-D_Fi0beD.js +12 -0
  58. package/dist/{rule-Ch2HRiGw.js → rule-C37bqQrm.js} +314 -343
  59. package/dist/{rule-builder-B_M9yvEe.js → rule-builder-DPQJ8Tbv.js} +1 -1
  60. package/dist/style.css +1 -1
  61. package/dist/{template-1o0LbOoJ.js → template-CIStnXhd.js} +4 -4
  62. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  63. package/dist/{vue-i18n-AtGIa4qH.js → vue-i18n-jf-SfrQy.js} +272 -272
  64. package/dist/{xlsx-pChq0adn.js → xlsx-C91dwH9k.js} +1 -1
  65. package/package.json +11 -11
  66. package/dist/App-BzzL9_Jw.js +0 -177
  67. package/dist/Member-RoJSCSC5.js +0 -69
  68. package/dist/Promotion-DEo-lxpX.js +0 -221
  69. package/dist/index-B4UZgSB-.js +0 -28058
  70. package/dist/money-OtkT4Pzp.js +0 -15
  71. package/dist/number-Cg3NCouc.js +0 -12
@@ -1,33 +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
2
  import { _ } from "./lodash-B5I3zXaY.js";
3
- import { z } from "./app-FfENBuoE.js";
3
+ import { z } from "./app-3-6LVz11.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-BiYLkVdL.js";
6
- import { u as useMembershipStore, C as CollectibleOptions } from "./membership-DFRO9TyM.js";
7
- import { u as useBusinessStore } from "./business-CXyP9G7A.js";
8
- import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-Dkeb_9ER.js";
9
- import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-B_M9yvEe.js";
5
+ import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-B8X9qnLh.js";
6
+ import { u as useMembershipStore, C as CollectibleOptions } from "./membership-oIubaesw.js";
7
+ import { u as useBusinessStore } from "./business-Wk7ElvEz.js";
8
+ import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-CoYSYku2.js";
9
+ import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-DPQJ8Tbv.js";
10
10
  import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
11
11
  import { h as hooks } from "./moment-BWErdI6_.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-BuDwICBJ.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-BgIWS3vT.js";
13
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-D6mWny8y.js";
15
- import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CXlkvt2u.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-BGjeTeqS.js";
17
- import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-uCNeZibp.js";
18
- import { _ as _sfc_main$q, T as TEMPLATES } from "./index-BRXg5Si1.js";
19
- import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-Cj3-JHOX.js";
20
- import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-Ch2HRiGw.js";
21
- import { c as core, S as SvcConfig } from "./index-B4UZgSB-.js";
22
- import "./index-B6c-fUij.js";
23
- import "./index-DA-fzkRR.js";
24
- import "./index-DmdKoKk_.js";
25
- import "./index-BP_5cfKa.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-CCsxDg45.js";
15
+ import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-BnjVkkS1.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-1Fko0V0J.js";
17
+ import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-DeWfPgai.js";
18
+ import { _ as _sfc_main$q, T as TEMPLATES } from "./index-BH-mOC5-.js";
19
+ import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-CBvpHaAl.js";
20
+ import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-C37bqQrm.js";
21
+ import { r, S as SvcConfig } from "./index-5FIs0G8O.js";
22
+ import "./index-CIBWHBM-.js";
23
+ import "./index-CPxCpRFW.js";
24
+ import "./index-B0Pw9YQd.js";
25
+ import "./index-DmxAa1MA.js";
26
26
  import { useCoreStore } from "@feedmepos/mf-common";
27
27
  import { _ as _sfc_main$u } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js";
28
- import { u as useI18n } from "./vue-i18n-AtGIa4qH.js";
29
- import { i as initCollectibleConfig } from "./helper-DvD-D7c7.js";
30
- import { C as CollectionUtils } from "./collection.fn-FicQhH1t.js";
28
+ import { u as useI18n } from "./vue-i18n-jf-SfrQy.js";
29
+ import { i as initCollectibleConfig } from "./helper-BSKllptD.js";
30
+ import { C as CollectionUtils } from "./collection.fn-DS11Xpbu.js";
31
31
  import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
32
32
  import { useDialog } from "@feedmepos/ui-library";
33
33
  import { a as cleanPF } from "./object-qECH92oz.js";
@@ -40,16 +40,16 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
40
40
  }
41
41
  },
42
42
  emits: ["update:model-value"],
43
- setup(e, { emit: m }) {
44
- const r = e, u = computed(() => {
43
+ setup(e, { emit: c }) {
44
+ const s = e, i = computed(() => {
45
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
+ const [d] = isRuleGroup(s.modelValue) ? Object.values(((l = s.modelValue) == null ? void 0 : l.rules) ?? {}) : [null];
47
+ return (d ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
48
+ }), a = c;
49
+ return (d, o) => (openBlock(), createBlock(_sfc_main$q, {
50
50
  multiselect: !0,
51
51
  items: unref(useMembershipStore)().segmentOptions,
52
- "model-value": unref(u),
52
+ "model-value": unref(i),
53
53
  "onUpdate:modelValue": o[0] || (o[0] = (l) => a(
54
54
  "update:model-value",
55
55
  unref(RuleBuilder).setRuleToGroup(
@@ -70,10 +70,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
70
70
  }
71
71
  },
72
72
  emits: ["update:model-value"],
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
+ setup(e, { emit: c }) {
74
+ const s = e, i = c, a = ref(
75
+ s.modelValue ? RuleBuilder.getRules(s.modelValue.rules.g_user).length > 0 ? "custom" : RuleBuilder.getRules(s.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
76
+ ), d = [
77
77
  {
78
78
  value: "all_users",
79
79
  label: "All audience"
@@ -90,40 +90,40 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
90
90
  return watch(a, async (o, l) => {
91
91
  var n;
92
92
  if (l != "all_users" && l != o && RuleBuilder.getRules(
93
- (n = r.modelValue) == null ? void 0 : n.rules[l == "custom" ? "g_user" : "g_segment"]
93
+ (n = s.modelValue) == null ? void 0 : n.rules[l == "custom" ? "g_user" : "g_segment"]
94
94
  ).length > 0) {
95
- const c = await prompt.confirm(
95
+ const p = await prompt.confirm(
96
96
  "Are you sure you want to change the audience type? This will remove all the rules you have set."
97
97
  );
98
- c && u(
98
+ p && i(
99
99
  "update:model-value",
100
100
  RuleBuilder.setRuleToGroup(
101
- r.modelValue ?? RuleBuilder.scaffoldGroup(),
101
+ s.modelValue ?? RuleBuilder.scaffoldGroup(),
102
102
  RuleBuilder.scaffoldGroup(l == "custom" ? "g_user" : "g_segment")
103
103
  )
104
- ), a.value = c ? o : l;
104
+ ), a.value = p ? o : l;
105
105
  }
106
106
  }), (o, l) => {
107
- var c, v;
107
+ var p, g;
108
108
  const n = resolveComponent("FmRadio");
109
109
  return openBlock(), createElementBlock("div", _hoisted_1$k, [
110
110
  createElementVNode("div", null, [
111
- (openBlock(), createElementBlock(Fragment, null, renderList(i, (p) => createVNode(n, {
112
- key: p.value,
113
- value: p.value,
114
- label: p.label,
111
+ (openBlock(), createElementBlock(Fragment, null, renderList(d, (f) => createVNode(n, {
112
+ key: f.value,
113
+ value: f.value,
114
+ label: f.label,
115
115
  modelValue: unref(a),
116
- "onUpdate:modelValue": l[0] || (l[0] = (g) => isRef(a) ? a.value = g : null)
116
+ "onUpdate:modelValue": l[0] || (l[0] = (h) => isRef(a) ? a.value = h : null)
117
117
  }, null, 8, ["value", "label", "modelValue"])), 64))
118
118
  ]),
119
119
  unref(a) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$e, [
120
120
  createVNode(_sfc_main$p, {
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(
121
+ modelValue: ((p = e.modelValue) == null ? void 0 : p.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
122
+ "onUpdate:modelValue": l[1] || (l[1] = (f) => i(
123
123
  "update:model-value",
124
124
  unref(RuleBuilder).setRuleToGroup(
125
125
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
126
- p,
126
+ f,
127
127
  "&&"
128
128
  )
129
129
  ))
@@ -133,12 +133,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
133
133
  key: 1,
134
134
  "include-only": "user",
135
135
  "trigger-type": "MEMBERSHIP_JOINED",
136
- "model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_user) ?? unref(RuleBuilder).scaffoldGroup("g_user"),
137
- "onUpdate:modelValue": l[2] || (l[2] = (p) => u(
136
+ "model-value": ((g = e.modelValue) == null ? void 0 : g.rules.g_user) ?? unref(RuleBuilder).scaffoldGroup("g_user"),
137
+ "onUpdate:modelValue": l[2] || (l[2] = (f) => i(
138
138
  "update:model-value",
139
139
  unref(RuleBuilder).setRuleToGroup(
140
140
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
141
- p,
141
+ f,
142
142
  "&&"
143
143
  )
144
144
  ))
@@ -156,52 +156,52 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
156
156
  }
157
157
  },
158
158
  emits: ["update:model-value"],
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"
159
+ setup(e, { emit: c }) {
160
+ const s = e, i = c, a = ref(
161
+ !s.modelValue || !s.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(s.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
162
162
  );
163
163
  watch(a, async (o, l) => {
164
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(
165
+ if (l == "custom" && o == "all_time" && RuleBuilder.getRules((n = s.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
166
+ const p = await prompt.confirm(
167
167
  "Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
168
168
  );
169
- c && u(
169
+ p && i(
170
170
  "update:model-value",
171
171
  RuleBuilder.setRuleToGroup(
172
- r.modelValue ?? RuleBuilder.scaffoldGroup(),
172
+ s.modelValue ?? RuleBuilder.scaffoldGroup(),
173
173
  RuleBuilder.scaffoldGroup("g_time")
174
174
  )
175
- ), a.value = c ? o : l;
175
+ ), a.value = p ? o : l;
176
176
  }
177
177
  });
178
- async function i(o) {
178
+ async function d(o) {
179
179
  var l;
180
- if (o == "custom" && RuleBuilder.getRules((l = r.modelValue) == null ? void 0 : l.rules.g_time).length > 0) {
180
+ if (o == "custom" && RuleBuilder.getRules((l = s.modelValue) == null ? void 0 : l.rules.g_time).length > 0) {
181
181
  if (!await prompt.confirm(
182
182
  "Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
183
183
  )) {
184
184
  a.value = "all_time";
185
185
  return;
186
186
  }
187
- u(
187
+ i(
188
188
  "update:model-value",
189
189
  RuleBuilder.setRuleToGroup(
190
- r.modelValue ?? RuleBuilder.scaffoldGroup(),
190
+ s.modelValue ?? RuleBuilder.scaffoldGroup(),
191
191
  RuleBuilder.scaffoldGroup("g_time")
192
192
  )
193
193
  );
194
194
  }
195
195
  }
196
196
  return (o, l) => {
197
- var v;
198
- const n = resolveComponent("FmRadio"), c = resolveComponent("FmRadioGroup");
197
+ var g;
198
+ const n = resolveComponent("FmRadio"), p = resolveComponent("FmRadioGroup");
199
199
  return openBlock(), createElementBlock("div", _hoisted_1$j, [
200
- createVNode(c, {
200
+ createVNode(p, {
201
201
  modelValue: unref(a),
202
202
  "onUpdate:modelValue": [
203
- l[0] || (l[0] = (p) => isRef(a) ? a.value = p : null),
204
- l[1] || (l[1] = (p) => i(p))
203
+ l[0] || (l[0] = (f) => isRef(a) ? a.value = f : null),
204
+ l[1] || (l[1] = (f) => d(f))
205
205
  ]
206
206
  }, {
207
207
  default: withCtx(() => [
@@ -221,12 +221,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
221
221
  class: "!mt-[0px]",
222
222
  "include-only": "trigger",
223
223
  "trigger-type": "SCHEDULE",
224
- "model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
225
- "onUpdate:modelValue": l[2] || (l[2] = (p) => u(
224
+ "model-value": ((g = e.modelValue) == null ? void 0 : g.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
225
+ "onUpdate:modelValue": l[2] || (l[2] = (f) => i(
226
226
  "update:model-value",
227
227
  unref(RuleBuilder).setRuleToGroup(
228
228
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
229
- p,
229
+ f,
230
230
  "&&"
231
231
  )
232
232
  ))
@@ -244,15 +244,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
244
244
  }
245
245
  },
246
246
  emits: ["update:model-value"],
247
- setup(e, { emit: m }) {
248
- const r = m;
249
- return (u, a) => {
250
- var i;
247
+ setup(e, { emit: c }) {
248
+ const s = c;
249
+ return (i, a) => {
250
+ var d;
251
251
  return openBlock(), createBlock(_sfc_main$r, {
252
252
  "include-only": "bill",
253
253
  "trigger-type": "BILL_COMPLETED",
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(
254
+ "model-value": ((d = e.modelValue) == null ? void 0 : d.rules.g_bill) ?? unref(RuleBuilder).scaffoldGroup("g_bill"),
255
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => s(
256
256
  "update:model-value",
257
257
  unref(RuleBuilder).setRuleToGroup(
258
258
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
@@ -271,21 +271,21 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
271
271
  }
272
272
  },
273
273
  emits: ["update:model-value"],
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
+ setup(e, { emit: c }) {
275
+ const s = e, i = c, a = computed(() => {
276
+ const { property: d, operator: o, equator: l } = RuleBuilder.simplify(
277
+ s.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
278
278
  op: "before",
279
279
  x: 1
280
280
  })
281
281
  );
282
282
  return {
283
- property: i,
283
+ property: d,
284
284
  operator: o,
285
285
  equator: l
286
286
  };
287
287
  });
288
- return (i, o) => {
288
+ return (d, o) => {
289
289
  const l = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
290
290
  return openBlock(), createElementBlock("div", null, [
291
291
  createVNode(l, {
@@ -293,7 +293,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
293
293
  value: "_isRange-day",
294
294
  "model-value": `${unref(a).operator}-${unref(a).equator.unit}`,
295
295
  "onUpdate:modelValue": o[0] || (o[0] = () => {
296
- u(
296
+ i(
297
297
  "update:model-value",
298
298
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
299
299
  op: "this",
@@ -308,7 +308,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
308
308
  value: "_isDay",
309
309
  "model-value": unref(a).operator,
310
310
  "onUpdate:modelValue": o[1] || (o[1] = () => {
311
- u(
311
+ i(
312
312
  "update:model-value",
313
313
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
314
314
  op: "after",
@@ -323,11 +323,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
323
323
  label: "Days before birthday",
324
324
  "show-steppers": !1,
325
325
  "model-value": unref(a).equator.x,
326
- "onUpdate:modelValue": o[2] || (o[2] = (c) => u(
326
+ "onUpdate:modelValue": o[2] || (o[2] = (p) => i(
327
327
  "update:model-value",
328
328
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
329
329
  op: "after",
330
- x: c,
330
+ x: p,
331
331
  ignoreYear: !0
332
332
  })
333
333
  ))
@@ -337,7 +337,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
337
337
  value: "_isRange-week",
338
338
  "model-value": `${unref(a).operator}-${unref(a).equator.unit}`,
339
339
  "onUpdate:modelValue": o[3] || (o[3] = () => {
340
- u(
340
+ i(
341
341
  "update:model-value",
342
342
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
343
343
  op: "this",
@@ -352,7 +352,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
352
352
  value: "_isRange-month",
353
353
  "model-value": `${unref(a).operator}-${unref(a).equator.unit}`,
354
354
  "onUpdate:modelValue": o[4] || (o[4] = () => {
355
- u(
355
+ i(
356
356
  "update:model-value",
357
357
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
358
358
  op: "this",
@@ -375,15 +375,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
375
375
  }
376
376
  },
377
377
  emits: ["update:model-value"],
378
- setup(e, { emit: m }) {
379
- const r = m;
380
- return (u, a) => {
381
- var i;
378
+ setup(e, { emit: c }) {
379
+ const s = c;
380
+ return (i, a) => {
381
+ var d;
382
382
  return openBlock(), createBlock(_sfc_main$r, {
383
383
  "include-only": "feedback",
384
384
  "trigger-type": "FEEDBACK",
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(
385
+ "model-value": ((d = e.modelValue) == null ? void 0 : d.rules.g_feedback) ?? unref(RuleBuilder).scaffoldGroup("g_feedback"),
386
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => s(
387
387
  "update:model-value",
388
388
  unref(RuleBuilder).setRuleToGroup(
389
389
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
@@ -462,10 +462,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
462
462
  "GAME",
463
463
  "MISSION"
464
464
  ].map((e) => {
465
- const m = CAMPAIGN_TRIGGER[e];
465
+ const c = CAMPAIGN_TRIGGER[e];
466
466
  return [
467
467
  e,
468
- (m == null ? void 0 : m.map((r) => TriggerOptions[r]).filter((r) => !r.hidden)) ?? []
468
+ (c == null ? void 0 : c.map((s) => TriggerOptions[s]).filter((s) => !s.hidden)) ?? []
469
469
  ];
470
470
  })
471
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({
@@ -484,25 +484,25 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
484
484
  }
485
485
  },
486
486
  emits: ["update:model-value"],
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) => {
487
+ setup(e, { emit: c }) {
488
+ const s = e, i = c, a = computed(() => s.disabled ? TypeToTriggerOptions[s.campaignType].filter(
489
+ (d) => d.value == s.modelValue
490
+ ) : TypeToTriggerOptions[s.campaignType]);
491
+ return (d, o) => {
492
492
  const l = resolveComponent("FmCard");
493
493
  return openBlock(), createElementBlock("div", _hoisted_1$i, [
494
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
495
  createElementVNode("div", _hoisted_2$d, [
496
496
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (n) => (openBlock(), createBlock(l, {
497
497
  variant: "outlined",
498
- disabled: r.disabled,
498
+ disabled: s.disabled,
499
499
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
500
500
  "col-span-3": unref(a).length == 1,
501
501
  "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
502
502
  "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
503
503
  }]),
504
504
  onClick: () => {
505
- r.modelValue != n.value && !r.disabled && u("update:model-value", n.value);
505
+ s.modelValue != n.value && !s.disabled && i("update:model-value", n.value);
506
506
  },
507
507
  key: n.name
508
508
  }, {
@@ -529,14 +529,14 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
529
529
  }
530
530
  },
531
531
  emits: ["update:model-value"],
532
- setup(e, { emit: m }) {
533
- const r = m;
534
- return (u, a) => {
535
- const i = resolveComponent("FmButton"), o = resolveComponent("FmField"), l = resolveComponent("FmDatePicker");
532
+ setup(e, { emit: c }) {
533
+ const s = c;
534
+ return (i, a) => {
535
+ const d = resolveComponent("FmButton"), o = resolveComponent("FmField"), l = resolveComponent("FmDatePicker");
536
536
  return openBlock(), createBlock(l, {
537
537
  label: e.label,
538
538
  "model-value": e.modelValue || "",
539
- "onUpdate:modelValue": a[1] || (a[1] = (n) => r("update:model-value", n))
539
+ "onUpdate:modelValue": a[1] || (a[1] = (n) => s("update:model-value", n))
540
540
  }, {
541
541
  "trigger-button": withCtx(({ opened: n }) => [
542
542
  createVNode(o, {
@@ -545,11 +545,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
545
545
  "icon-outlined": !n
546
546
  }, {
547
547
  append: withCtx(() => [
548
- e.modelValue ? (openBlock(), createBlock(i, {
548
+ e.modelValue ? (openBlock(), createBlock(d, {
549
549
  key: 0,
550
550
  variant: "tertiary",
551
551
  icon: "clear",
552
- onClick: a[0] || (a[0] = (c) => (c.stopPropagation(), r("update:model-value", null)))
552
+ onClick: a[0] || (a[0] = (p) => (p.stopPropagation(), s("update:model-value", null)))
553
553
  })) : createCommentVNode("", !0)
554
554
  ]),
555
555
  default: withCtx(() => [
@@ -573,18 +573,18 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
573
573
  }
574
574
  },
575
575
  emits: ["update:model-value"],
576
- setup(e, { emit: m }) {
577
- const r = m;
578
- return (u, a) => {
579
- var i, o;
576
+ setup(e, { emit: c }) {
577
+ const s = c;
578
+ return (i, a) => {
579
+ var d, o;
580
580
  return openBlock(), createElementBlock("div", _hoisted_1$h, [
581
581
  createElementVNode("div", _hoisted_2$c, [
582
582
  createVNode(_sfc_main$i, {
583
- "model-value": ((i = e.modelValue) == null ? void 0 : i.startDate) ?? null,
583
+ "model-value": ((d = e.modelValue) == null ? void 0 : d.startDate) ?? null,
584
584
  label: "Start date",
585
585
  "onUpdate:modelValue": a[0] || (a[0] = (l) => {
586
586
  var n;
587
- return r("update:model-value", {
587
+ return s("update:model-value", {
588
588
  startDate: l,
589
589
  endDate: ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null
590
590
  });
@@ -598,7 +598,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
598
598
  label: "End date",
599
599
  "onUpdate:modelValue": a[1] || (a[1] = (l) => {
600
600
  var n;
601
- return r("update:model-value", {
601
+ return s("update:model-value", {
602
602
  startDate: ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
603
603
  endDate: l
604
604
  });
@@ -626,34 +626,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
626
626
  }
627
627
  },
628
628
  emits: ["update:model-value"],
629
- setup(e, { emit: m }) {
630
- const r = e, u = m;
629
+ setup(e, { emit: c }) {
630
+ const s = e, i = c;
631
631
  function a() {
632
- const p = RuleBuilder.getRules(r.modelValue);
633
- return p.length == 0 ? "fixed" : p.some(
634
- (g) => isRuleEntry(g) && RuleBuilder.simplify(g).operator == "_rrule"
632
+ const f = RuleBuilder.getRules(s.modelValue);
633
+ return f.length == 0 ? "fixed" : f.some(
634
+ (h) => isRuleEntry(h) && RuleBuilder.simplify(h).operator == "_rrule"
635
635
  ) ? "repeating" : "fixed";
636
636
  }
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"
637
+ const d = ref(a()), o = ref(!1), l = computed(() => {
638
+ const f = RuleBuilder.getRules(s.modelValue), h = f.find(
639
+ (u) => isRuleEntry(u) && RuleBuilder.simplify(u).property == "trigger.date"
640
+ ), V = f.find(
641
+ (u) => isRuleEntry(u) && RuleBuilder.simplify(u).property == "trigger.time"
642
642
  );
643
643
  return {
644
- date: g ? RuleBuilder.simplify(g).equator : null,
645
- time: h ? RuleBuilder.simplify(h).equator : null
644
+ date: h ? RuleBuilder.simplify(h).equator : null,
645
+ time: V ? RuleBuilder.simplify(V).equator : null
646
646
  };
647
647
  }), n = computed(
648
648
  () => calculateNextScheduleAt(
649
- r.modelValue,
649
+ s.modelValue,
650
650
  /* @__PURE__ */ new Date(),
651
- r.startDate ? new Date(r.startDate) : void 0,
652
- r.endDate ? new Date(r.endDate) : void 0
651
+ s.startDate ? new Date(s.startDate) : void 0,
652
+ s.endDate ? new Date(s.endDate) : void 0
653
653
  )
654
654
  );
655
- function c(p) {
656
- const g = p.label.toLowerCase(), h = g == "fixed" ? [
655
+ function p(f) {
656
+ const h = f.label.toLowerCase(), V = h == "fixed" ? [
657
657
  RuleBuilder.constructEntry(
658
658
  "trigger.date",
659
659
  "_isOnDate",
@@ -668,73 +668,73 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
668
668
  ),
669
669
  RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
670
670
  ];
671
- u(
671
+ i(
672
672
  "update:model-value",
673
673
  RuleBuilder.setRuleToGroup(
674
674
  RuleBuilder.scaffoldGroup("g_schedule"),
675
- h
675
+ V
676
676
  )
677
- ), i.value = g;
677
+ ), d.value = h;
678
678
  }
679
- function v(p) {
680
- i.value == "fixed" ? u(
679
+ function g(f) {
680
+ d.value == "fixed" ? i(
681
681
  "update:model-value",
682
682
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
683
683
  RuleBuilder.constructEntry(
684
684
  "trigger.date",
685
685
  "_isOnDate",
686
- p.date
686
+ f.date
687
687
  ),
688
688
  RuleBuilder.constructEntry(
689
689
  "trigger.time",
690
690
  "_isOnTime",
691
- p.time
691
+ f.time
692
692
  )
693
693
  ])
694
- ) : u(
694
+ ) : i(
695
695
  "update:model-value",
696
696
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
697
697
  RuleBuilder.constructEntry(
698
698
  "trigger.date",
699
699
  "_rrule",
700
- p.date
700
+ f.date
701
701
  ),
702
702
  RuleBuilder.constructEntry(
703
703
  "trigger.time",
704
704
  "_isOnTime",
705
- p.time
705
+ f.time
706
706
  )
707
707
  ])
708
708
  );
709
709
  }
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");
710
+ return (f, h) => {
711
+ const V = resolveComponent("FmButtonGroup"), u = resolveComponent("FmTimePicker"), m = resolveComponent("FmIcon"), y = resolveComponent("FmTooltip"), v = resolveComponent("FmField"), E = resolveComponent("FmCard"), x = resolveComponent("FmPopover"), C = resolveComponent("FmDatePicker"), R = resolveComponent("FmHelperText");
712
712
  return openBlock(), createElementBlock(Fragment, null, [
713
- createVNode(h, {
713
+ createVNode(V, {
714
714
  items: [{ label: "Fixed" }, { label: "Repeating" }],
715
- "model-value": { label: unref(cases).title(unref(i)) },
716
- "onUpdate:modelValue": c,
715
+ "model-value": { label: unref(cases).title(unref(d)) },
716
+ "onUpdate:modelValue": p,
717
717
  class: "mb-8"
718
718
  }, null, 8, ["model-value"]),
719
719
  createElementVNode("div", _hoisted_1$g, [
720
720
  createElementVNode("div", _hoisted_2$b, [
721
- createVNode(s, {
721
+ createVNode(u, {
722
722
  label: "Notify time",
723
723
  "model-value": unref(l).time,
724
- "onUpdate:modelValue": g[0] || (g[0] = (x) => v({ date: unref(l).date, time: x })),
724
+ "onUpdate:modelValue": h[0] || (h[0] = (B) => g({ date: unref(l).date, time: B })),
725
725
  "helper-text": unref(l).time ? void 0 : "Time is required",
726
726
  "helper-state": unref(l).time ? void 0 : "error"
727
727
  }, null, 8, ["model-value", "helper-text", "helper-state"]),
728
- unref(i) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
728
+ unref(d) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
729
729
  createElementVNode("div", _hoisted_4$7, [
730
- g[5] || (g[5] = createElementVNode("div", null, "Notify date", -1)),
731
- unref(l).date ? (openBlock(), createBlock(f, {
730
+ h[5] || (h[5] = createElementVNode("div", null, "Notify date", -1)),
731
+ unref(l).date ? (openBlock(), createBlock(y, {
732
732
  key: 0,
733
733
  "z-index": 9999,
734
734
  content: unref(SummarizeRrule)(unref(RRule).fromString(unref(l).date).options)
735
735
  }, {
736
736
  default: withCtx(() => [
737
- createVNode(d, {
737
+ createVNode(m, {
738
738
  name: "info",
739
739
  size: "sm",
740
740
  outline: !0
@@ -743,12 +743,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
743
743
  _: 1
744
744
  }, 8, ["content"])) : createCommentVNode("", !0)
745
745
  ]),
746
- createVNode(E, {
746
+ createVNode(x, {
747
747
  "show-popover": unref(o),
748
- onPopoverChanged: g[3] || (g[3] = (x) => o.value = x)
748
+ onPopoverChanged: h[3] || (h[3] = (B) => o.value = B)
749
749
  }, {
750
750
  "popover-button": withCtx(() => [
751
- createVNode(y, {
751
+ createVNode(v, {
752
752
  class: "cursor-pointer",
753
753
  "helper-text": unref(l).date ? void 0 : "Date is required",
754
754
  "helper-state": unref(l).date ? void 0 : "error"
@@ -760,13 +760,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
760
760
  }, 8, ["helper-text", "helper-state"])
761
761
  ]),
762
762
  default: withCtx(() => [
763
- createVNode(C, { class: "elevated p-8 w-[450px]" }, {
763
+ createVNode(E, { class: "elevated p-8 w-[450px]" }, {
764
764
  default: withCtx(() => [
765
765
  createVNode(_sfc_main$s, {
766
766
  "apply-button": !0,
767
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))
768
+ onCancel: h[1] || (h[1] = (B) => o.value = !1),
769
+ "onUpdate:modelValue": h[2] || (h[2] = (B) => (g({ date: B, time: unref(l).time }), o.value = !1))
770
770
  }, null, 8, ["model-value"])
771
771
  ]),
772
772
  _: 1
@@ -774,16 +774,16 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
774
774
  ]),
775
775
  _: 1
776
776
  }, 8, ["show-popover"])
777
- ])) : (openBlock(), createBlock(k, {
777
+ ])) : (openBlock(), createBlock(C, {
778
778
  key: 1,
779
779
  label: "Notify date",
780
780
  "model-value": unref(l).date || "",
781
- "onUpdate:modelValue": g[4] || (g[4] = (x) => v({ date: x, time: unref(l).time })),
781
+ "onUpdate:modelValue": h[4] || (h[4] = (B) => g({ date: B, time: unref(l).time })),
782
782
  "helper-text": unref(l).date ? void 0 : "Date is required",
783
783
  "helper-state": unref(l).date ? void 0 : "error"
784
784
  }, null, 8, ["model-value", "helper-text", "helper-state"]))
785
785
  ]),
786
- unref(l).date && unref(l).time && unref(n) ? (openBlock(), createBlock(B, {
786
+ unref(l).date && unref(l).time && unref(n) ? (openBlock(), createBlock(R, {
787
787
  key: 0,
788
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
789
  ${unref(hooks)(unref(n)).format("hh:mmA")} (${unref(hooks)(unref(n)).fromNow()})`
@@ -799,18 +799,18 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
799
799
  filterItems: { type: Function }
800
800
  },
801
801
  emits: ["confirm"],
802
- setup(e, { emit: m }) {
803
- const r = ref(), u = ref(!1);
802
+ setup(e, { emit: c }) {
803
+ const s = ref(), i = ref(!1);
804
804
  function a() {
805
805
  var o;
806
- (o = r.value) == null || o.onConfirm();
806
+ (o = s.value) == null || o.onConfirm();
807
807
  }
808
- const i = m;
808
+ const d = c;
809
809
  return (o, l) => {
810
- const n = resolveComponent("FmField"), c = resolveComponent("FmButton"), v = resolveComponent("FmSideSheet");
811
- return openBlock(), createBlock(v, {
812
- modelValue: u.value,
813
- "onUpdate:modelValue": l[1] || (l[1] = (p) => u.value = p),
810
+ const n = resolveComponent("FmField"), p = resolveComponent("FmButton"), g = resolveComponent("FmSideSheet");
811
+ return openBlock(), createBlock(g, {
812
+ modelValue: i.value,
813
+ "onUpdate:modelValue": l[1] || (l[1] = (f) => i.value = f),
814
814
  title: "Select Items",
815
815
  "close-button": !1,
816
816
  "dismiss-away": !0,
@@ -828,12 +828,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
828
828
  ]),
829
829
  "side-sheet-footer": withCtx(() => [
830
830
  createElementVNode("div", _hoisted_1$f, [
831
- createVNode(c, {
831
+ createVNode(p, {
832
832
  variant: "tertiary",
833
- onClick: l[0] || (l[0] = (p) => u.value = !1),
833
+ onClick: l[0] || (l[0] = (f) => i.value = !1),
834
834
  label: "Cancel"
835
835
  }),
836
- createVNode(c, {
836
+ createVNode(p, {
837
837
  variant: "primary",
838
838
  onClick: a,
839
839
  label: "Confirm"
@@ -845,11 +845,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
845
845
  class: "h-full",
846
846
  "max-height": 0,
847
847
  ref_key: "selectItemRef",
848
- ref: r,
848
+ ref: s,
849
849
  "initial-value": o.modelValue,
850
850
  "filter-items": o.filterItems,
851
- "on-complete": (p) => {
852
- i("confirm", p), u.value = !1;
851
+ "on-complete": (f) => {
852
+ d("confirm", f), i.value = !1;
853
853
  }
854
854
  }, null, 8, ["initial-value", "filter-items", "on-complete"])
855
855
  ]),
@@ -880,9 +880,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
880
880
  }
881
881
  },
882
882
  emits: ["update:model-value"],
883
- setup(e, { emit: m }) {
884
- var v, p, g;
885
- const r = useBusinessStore(), u = e, a = m, i = [
883
+ setup(e, { emit: c }) {
884
+ var g, f, h;
885
+ const s = useBusinessStore(), i = e, a = c, d = [
886
886
  {
887
887
  label: "Based on spending",
888
888
  sublabel: "Customers earn rewards based on how much they spend.",
@@ -893,22 +893,22 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
893
893
  sublabel: "Customers earn a set amount of rewards for specific actions.",
894
894
  value: "FIXED"
895
895
  }
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;
896
+ ].filter((V) => {
897
+ var u, m;
898
+ return i.fixedType || ((m = (u = i.extras) == null ? void 0 : u.campaign) == null ? void 0 : m.event.type) != "BILL_COMPLETED" ? V.value == "FIXED" : !0;
899
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();
900
+ var u, m;
901
+ const V = i.extras && "configs" in i.extras ? i.extras.configs.type : (u = i.extras) == null ? void 0 : u.campaign.type;
902
+ return (((m = CollectibleOptions[V]) == null ? void 0 : m.name) || "reward").toLowerCase();
903
903
  }), l = computed(() => {
904
- const h = FdoEarningOption.safeParse(u.modelValue);
905
- return h.success ? [] : h.error.errors;
904
+ const V = FdoEarningOption.safeParse(i.modelValue);
905
+ return V.success ? [] : V.error.errors;
906
906
  });
907
- function n(h) {
908
- var s;
909
- h != ((s = u.modelValue) == null ? void 0 : s.type) && a(
907
+ function n(V) {
908
+ var u;
909
+ V != ((u = i.modelValue) == null ? void 0 : u.type) && a(
910
910
  "update:model-value",
911
- h === "FIXED" ? {
911
+ V === "FIXED" ? {
912
912
  type: "FIXED",
913
913
  amount: 1
914
914
  } : {
@@ -918,95 +918,95 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
918
918
  }
919
919
  );
920
920
  }
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
921
+ const p = ref(
922
+ ((g = i.modelValue) == null ? void 0 : g.type) === "PROPORTIONAL" && !!((h = (f = i.modelValue) == null ? void 0 : f.property) != null && h.length) || !1
923
923
  );
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");
924
+ return (V, u) => {
925
+ var B, k, w;
926
+ const m = resolveComponent("FmCard"), y = resolveComponent("FmStepperField"), v = resolveComponent("FmRadio"), E = resolveComponent("FmPill"), x = resolveComponent("FmButton"), C = resolveComponent("FmRadioGroup"), R = resolveComponent("FmHelperText");
927
927
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
928
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, {
929
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(d), (b) => {
930
+ var S, N;
931
+ return openBlock(), createBlock(m, {
932
932
  variant: "outlined",
933
933
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
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
934
+ "col-span-2": unref(d).length == 1,
935
+ "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.type) === b.value,
936
+ "hover:bg-fm-color-opacity-sm": ((N = e.modelValue) == null ? void 0 : N.type) != b.value
937
937
  }]),
938
- onClick: (w) => n(V.value),
939
- key: V.value
938
+ onClick: (F) => n(b.value),
939
+ key: b.value
940
940
  }, {
941
941
  default: withCtx(() => [
942
- createElementVNode("div", _hoisted_3$8, toDisplayString(V.label), 1),
943
- createElementVNode("div", _hoisted_4$6, toDisplayString(V.sublabel), 1)
942
+ createElementVNode("div", _hoisted_3$8, toDisplayString(b.label), 1),
943
+ createElementVNode("div", _hoisted_4$6, toDisplayString(b.sublabel), 1)
944
944
  ]),
945
945
  _: 2
946
946
  }, 1032, ["class", "onClick"]);
947
947
  }), 128))
948
948
  ]),
949
949
  createElementVNode("div", _hoisted_5$3, [
950
- ((x = e.modelValue) == null ? void 0 : x.type) === "FIXED" ? (openBlock(), createBlock(f, {
950
+ ((B = e.modelValue) == null ? void 0 : B.type) === "FIXED" ? (openBlock(), createBlock(y, {
951
951
  key: 0,
952
952
  label: `Receive ${unref(o)}(s)`,
953
953
  class: "flex-1",
954
- "model-value": ((b = e.modelValue) == null ? void 0 : b.amount) ?? null,
955
- "onUpdate:modelValue": s[0] || (s[0] = (V) => a("update:model-value", {
954
+ "model-value": ((k = e.modelValue) == null ? void 0 : k.amount) ?? null,
955
+ "onUpdate:modelValue": u[0] || (u[0] = (b) => a("update:model-value", {
956
956
  ...e.modelValue ?? { type: "FIXED" },
957
- amount: V
957
+ amount: b
958
958
  }))
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", {
959
+ }, null, 8, ["label", "model-value"])) : ((w = e.modelValue) == null ? void 0 : w.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
960
+ u[11] || (u[11] = createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1)),
961
+ createVNode(C, {
962
+ "model-value": unref(p),
963
+ "onUpdate:modelValue": u[6] || (u[6] = (b) => {
964
+ unref(p) != b && (a("update:model-value", {
965
965
  ...e.modelValue ?? {
966
966
  type: "PROPORTIONAL",
967
967
  amount: 1,
968
968
  every: 1
969
969
  },
970
- property: V ? [] : void 0,
970
+ property: b ? [] : void 0,
971
971
  every: 1
972
- }), c.value = V);
972
+ }), p.value = b);
973
973
  })
974
974
  }, {
975
975
  default: withCtx(() => [
976
- createVNode(y, {
976
+ createVNode(v, {
977
977
  label: "Amount spent",
978
978
  sublabel: `Receive ${unref(o)} by amount spent`,
979
979
  value: !1
980
980
  }, {
981
981
  label: withCtx(() => {
982
- var V, N;
982
+ var b, S;
983
983
  return [
984
- s[8] || (s[8] = createElementVNode("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1)),
984
+ u[8] || (u[8] = createElementVNode("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1)),
985
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, {
986
+ unref(p) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_7$2, [
987
+ createVNode(y, {
988
988
  label: `Receive ${unref(o)}(s)`,
989
989
  inputmode: "decimal",
990
990
  class: "flex-1",
991
- "model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
992
- "onUpdate:modelValue": s[1] || (s[1] = (R) => a("update:model-value", {
991
+ "model-value": ((b = e.modelValue) == null ? void 0 : b.amount) ?? null,
992
+ "onUpdate:modelValue": u[1] || (u[1] = (N) => a("update:model-value", {
993
993
  ...e.modelValue ?? { type: "FIXED" },
994
- amount: R
994
+ amount: N
995
995
  }))
996
996
  }, null, 8, ["label", "model-value"]),
997
- s[7] || (s[7] = createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1)),
998
- createVNode(f, {
999
- label: `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
997
+ u[7] || (u[7] = createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1)),
998
+ createVNode(y, {
999
+ label: `Amount spend (${unref(r).getCountry().currency.symbol})`,
1000
1000
  class: "flex-1",
1001
1001
  inputmode: "decimal",
1002
- "model-value": ((N = e.modelValue) == null ? void 0 : N.every) ?? null,
1003
- "onUpdate:modelValue": s[2] || (s[2] = (R) => a("update:model-value", {
1002
+ "model-value": ((S = e.modelValue) == null ? void 0 : S.every) ?? null,
1003
+ "onUpdate:modelValue": u[2] || (u[2] = (N) => a("update:model-value", {
1004
1004
  ...e.modelValue,
1005
- every: R
1005
+ every: N
1006
1006
  }))
1007
1007
  }, {
1008
1008
  prepend: withCtx(() => [
1009
- createTextVNode(toDisplayString(unref(core.Config).getCountry().currency.symbol), 1)
1009
+ createTextVNode(toDisplayString(unref(r).getCountry().currency.symbol), 1)
1010
1010
  ]),
1011
1011
  _: 1
1012
1012
  }, 8, ["label", "model-value"])
@@ -1015,34 +1015,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1015
1015
  }),
1016
1016
  _: 1
1017
1017
  }, 8, ["sublabel"]),
1018
- createVNode(y, {
1018
+ createVNode(v, {
1019
1019
  label: "Product bought",
1020
1020
  sublabel: `Receive ${unref(o)} by product bought`,
1021
1021
  value: !0,
1022
- disabled: !unref(r).isPremium
1022
+ disabled: !unref(s).isPremium
1023
1023
  }, {
1024
1024
  label: withCtx(() => {
1025
- var V, N;
1025
+ var b, S;
1026
1026
  return [
1027
1027
  createElementVNode("div", _hoisted_8$1, [
1028
- s[9] || (s[9] = createTextVNode(" Product bought ")),
1029
- createVNode(C, { variant: "premium" })
1028
+ u[9] || (u[9] = createTextVNode(" Product bought ")),
1029
+ createVNode(E, { variant: "premium" })
1030
1030
  ]),
1031
1031
  createElementVNode("div", _hoisted_9$1, " Receive " + toDisplayString(unref(o)) + " by product bought ", 1),
1032
- unref(c) ? (openBlock(), createElementBlock("div", _hoisted_10$1, [
1032
+ unref(p) ? (openBlock(), createElementBlock("div", _hoisted_10$1, [
1033
1033
  createElementVNode("div", _hoisted_11$1, [
1034
1034
  createVNode(_sfc_main$f, {
1035
- "model-value": u.modelValue.property || [],
1036
- onConfirm: s[3] || (s[3] = (R) => a("update:model-value", {
1035
+ "model-value": i.modelValue.property || [],
1036
+ onConfirm: u[3] || (u[3] = (N) => a("update:model-value", {
1037
1037
  ...e.modelValue,
1038
- property: R
1038
+ property: N
1039
1039
  }))
1040
1040
  }, {
1041
1041
  "side-sheet-button": withCtx(() => {
1042
- var R, w;
1042
+ var N, F;
1043
1043
  return [
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",
1044
+ createVNode(x, {
1045
+ label: (N = i.modelValue.property) != null && N.length ? `${(F = i.modelValue.property) == null ? void 0 : F.length} product(s) selected` : "Select product",
1046
1046
  icon: "link",
1047
1047
  variant: "secondary"
1048
1048
  }, null, 8, ["label"])
@@ -1052,26 +1052,26 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1052
1052
  }, 8, ["model-value"])
1053
1053
  ]),
1054
1054
  createElementVNode("div", _hoisted_12, [
1055
- createVNode(f, {
1055
+ createVNode(y, {
1056
1056
  inputmode: "decimal",
1057
1057
  label: `Receive ${unref(o)}(s)`,
1058
1058
  class: "flex-1",
1059
- "model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
1060
- "onUpdate:modelValue": s[4] || (s[4] = (R) => a("update:model-value", {
1059
+ "model-value": ((b = e.modelValue) == null ? void 0 : b.amount) ?? null,
1060
+ "onUpdate:modelValue": u[4] || (u[4] = (N) => a("update:model-value", {
1061
1061
  ...e.modelValue ?? { type: "FIXED" },
1062
- amount: R
1062
+ amount: N
1063
1063
  }))
1064
1064
  }, null, 8, ["label", "model-value"]),
1065
- s[10] || (s[10] = createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1)),
1066
- createVNode(f, {
1065
+ u[10] || (u[10] = createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1)),
1066
+ createVNode(y, {
1067
1067
  label: "Item purchased",
1068
1068
  class: "flex-1",
1069
- "model-value": ((N = e.modelValue) == null ? void 0 : N.every) ?? null,
1069
+ "model-value": ((S = e.modelValue) == null ? void 0 : S.every) ?? null,
1070
1070
  inputmode: "numeric",
1071
1071
  "max-fraction-digits": 0,
1072
- "onUpdate:modelValue": s[5] || (s[5] = (R) => a("update:model-value", {
1072
+ "onUpdate:modelValue": u[5] || (u[5] = (N) => a("update:model-value", {
1073
1073
  ...e.modelValue,
1074
- every: R
1074
+ every: N
1075
1075
  }))
1076
1076
  }, null, 8, ["model-value"])
1077
1077
  ])
@@ -1085,7 +1085,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1085
1085
  }, 8, ["model-value"])
1086
1086
  ], 64)) : createCommentVNode("", !0)
1087
1087
  ]),
1088
- e.errorText || unref(l).length > 0 ? (openBlock(), createBlock(B, {
1088
+ e.errorText || unref(l).length > 0 ? (openBlock(), createBlock(R, {
1089
1089
  key: 0,
1090
1090
  class: "!mt-4",
1091
1091
  text: e.errorText || unref(ZodHelper).helperText(unref(l), ""),
@@ -1102,8 +1102,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1102
1102
  }
1103
1103
  },
1104
1104
  emits: ["update:model-value"],
1105
- setup(e, { emit: m }) {
1106
- const r = e, u = m, a = computed(
1105
+ setup(e, { emit: c }) {
1106
+ const s = e, i = c, a = computed(
1107
1107
  () => [
1108
1108
  {
1109
1109
  label: "Fortune Wheel",
@@ -1117,9 +1117,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1117
1117
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
1118
1118
  hidden: !0
1119
1119
  }
1120
- ].filter((i) => !i.hidden)
1120
+ ].filter((d) => !d.hidden)
1121
1121
  );
1122
- return (i, o) => {
1122
+ return (d, o) => {
1123
1123
  const l = resolveComponent("FmCard");
1124
1124
  return openBlock(), createElementBlock("div", _hoisted_1$d, [
1125
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)),
@@ -1132,7 +1132,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1132
1132
  "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
1133
1133
  }]),
1134
1134
  onClick: () => {
1135
- r.modelValue != n.value && u("update:model-value", n.value);
1135
+ s.modelValue != n.value && i("update:model-value", n.value);
1136
1136
  },
1137
1137
  key: n.value
1138
1138
  }, {
@@ -1157,33 +1157,33 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1157
1157
  }
1158
1158
  },
1159
1159
  emits: ["update:model-value", "update:reward-image"],
1160
- setup(e, { emit: m }) {
1161
- const { t: r } = useI18n(), a = ref(
1160
+ setup(e, { emit: c }) {
1161
+ const { t: s } = useI18n(), a = ref(
1162
1162
  e.modelValue ?? initCollectibleConfig("VOUCHER", {
1163
1163
  business: useCoreStore().currentBusiness.value._id,
1164
1164
  name: ""
1165
1165
  })
1166
- ), i = FdtoCollectibleConfig, o = m;
1166
+ ), d = FdtoCollectibleConfig, o = c;
1167
1167
  return (l, n) => {
1168
- var p, g, h;
1169
- const c = resolveComponent("FmTextarea"), v = resolveComponent("FmHelperText");
1168
+ var f, h, V;
1169
+ const p = resolveComponent("FmTextarea"), g = resolveComponent("FmHelperText");
1170
1170
  return openBlock(), createElementBlock(Fragment, null, [
1171
1171
  createVNode(_sfc_main$u, {
1172
1172
  modelValue: unref(a).name,
1173
- "onUpdate:modelValue": n[0] || (n[0] = (s) => unref(a).name = s),
1173
+ "onUpdate:modelValue": n[0] || (n[0] = (u) => unref(a).name = u),
1174
1174
  label: "Voucher name",
1175
- schema: unref(ZodHelper).typeAtPath(unref(i), "name", [unref(a).type])
1175
+ schema: unref(ZodHelper).typeAtPath(unref(d), "name", [unref(a).type])
1176
1176
  }, null, 8, ["modelValue", "schema"]),
1177
- createVNode(c, {
1177
+ createVNode(p, {
1178
1178
  class: "!mb-[-16px]",
1179
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])]
1180
+ "onUpdate:modelValue": n[1] || (n[1] = (u) => unref(a).description = u),
1181
+ rules: [unref(ZodHelper).ruleAtPath(unref(d), "description", [unref(a).type])]
1182
1182
  }, {
1183
1183
  label: withCtx(() => [
1184
1184
  (openBlock(), createBlock(resolveDynamicComponent(
1185
1185
  unref(ZodHelper).toInputLabel(
1186
- unref(ZodHelper).typeAtPath(unref(i), "description", [unref(a).type]),
1186
+ unref(ZodHelper).typeAtPath(unref(d), "description", [unref(a).type]),
1187
1187
  "Voucher description"
1188
1188
  )
1189
1189
  )))
@@ -1192,21 +1192,21 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1192
1192
  }, 8, ["modelValue", "rules"]),
1193
1193
  createElementVNode("div", _hoisted_1$c, [
1194
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)
1195
+ createElementVNode("div", null, toDisplayString(((f = unref(a).description) == null ? void 0 : f.length) ?? 0) + "/200", 1)
1196
1196
  ]),
1197
1197
  createVNode(_sfc_main$v, {
1198
1198
  class: "w-1/2 xs:w-2/3",
1199
1199
  "aspect-ratio": "16/9",
1200
1200
  file: e.rewardImage ?? void 0,
1201
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);
1202
+ "onUpdate:file": n[2] || (n[2] = async (u) => {
1203
+ o("update:reward-image", u), u || (unref(a).image = null);
1204
1204
  })
1205
1205
  }, {
1206
1206
  label: withCtx(() => [
1207
1207
  (openBlock(), createBlock(resolveDynamicComponent(
1208
1208
  unref(ZodHelper).toInputLabel(
1209
- unref(ZodHelper).typeAtPath(unref(i), "image", [unref(a).type]),
1209
+ unref(ZodHelper).typeAtPath(unref(d), "image", [unref(a).type]),
1210
1210
  "Voucher image"
1211
1211
  )
1212
1212
  )))
@@ -1216,30 +1216,30 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1216
1216
  n[7] || (n[7] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1)),
1217
1217
  createVNode(_sfc_main$w, {
1218
1218
  "model-value": unref(a).extras.effect,
1219
- "onUpdate:modelValue": n[3] || (n[3] = (s) => unref(a).extras.effect = s)
1219
+ "onUpdate:modelValue": n[3] || (n[3] = (u) => unref(a).extras.effect = u)
1220
1220
  }, null, 8, ["model-value"]),
1221
- unref(a).extras.effect == null ? (openBlock(), createBlock(v, {
1221
+ unref(a).extras.effect == null ? (openBlock(), createBlock(g, {
1222
1222
  key: 0,
1223
1223
  class: "!mt-8",
1224
- text: unref(r)("connect.campaign.common.effect_required"),
1224
+ text: unref(s)("connect.campaign.common.effect_required"),
1225
1225
  state: "error"
1226
1226
  }, null, 8, ["text"])) : createCommentVNode("", !0),
1227
1227
  n[8] || (n[8] = createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Usage configuration", -1)),
1228
1228
  createVNode(_sfc_main$x, {
1229
1229
  "model-value": unref(a).options,
1230
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"])
1231
+ "onUpdate:modelValue": n[4] || (n[4] = (u) => unref(a).options = u),
1232
+ schema: unref(ZodHelper).typeAtPath(unref(d), "options", ["VOUCHER"])
1233
1233
  }, null, 8, ["model-value", "no-campaign", "schema"]),
1234
1234
  n[9] || (n[9] = createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1)),
1235
1235
  unref(a).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$y, {
1236
1236
  key: 1,
1237
- "model-value": ((h = (g = unref(a).extras) == null ? void 0 : g.targetLocation) == null ? void 0 : h.map(String)) ?? null,
1237
+ "model-value": ((V = (h = unref(a).extras) == null ? void 0 : h.targetLocation) == null ? void 0 : V.map(String)) ?? null,
1238
1238
  type: "select",
1239
- "onUpdate:modelValue": n[5] || (n[5] = (s) => {
1240
- unref(a).extras.targetLocation = s;
1239
+ "onUpdate:modelValue": n[5] || (n[5] = (u) => {
1240
+ unref(a).extras.targetLocation = u;
1241
1241
  }),
1242
- rules: [unref(ZodHelper).ruleAtPath(unref(i), "extras.targetLocation")]
1242
+ rules: [unref(ZodHelper).ruleAtPath(unref(d), "extras.targetLocation")]
1243
1243
  }, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0)
1244
1244
  ], 64);
1245
1245
  };
@@ -1250,29 +1250,29 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1250
1250
  }, _hoisted_2$8 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
1251
1251
  __name: "EditRewardPoolSheet",
1252
1252
  emits: ["update:model-value"],
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);
1253
+ setup(e, { expose: c, emit: s }) {
1254
+ const i = useMembershipStore(), { minor: a } = useLoading, d = ref(!1), o = ref(), l = ref(), n = ref(0), p = computed(() => {
1255
+ var m;
1256
+ return ((m = i.loyaltyRewards.items.find(
1257
+ (y) => {
1258
+ var v;
1259
+ return y.value === ((v = o.value) == null ? void 0 : v.collectible);
1260
1260
  }
1261
- )) == null ? void 0 : d.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
1262
- }), v = computed(() => {
1263
- const s = c.value.safeParse(o.value);
1264
- return s.success ? [] : s.error.errors;
1261
+ )) == null ? void 0 : m.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
1262
+ }), g = computed(() => {
1263
+ const u = p.value.safeParse(o.value);
1264
+ return u.success ? [] : u.error.errors;
1265
1265
  });
1266
- function p(s, d, f) {
1267
- s && (o.value = d, n.value = f), i.value = s;
1266
+ function f(u, m, y) {
1267
+ u && (o.value = m, n.value = y), d.value = u;
1268
1268
  }
1269
- const g = r;
1270
- async function h() {
1271
- const s = c.value.safeParse(o.value);
1272
- s.success && (await a(
1269
+ const h = s;
1270
+ async function V() {
1271
+ const u = p.value.safeParse(o.value);
1272
+ u.success && (await a(
1273
1273
  async () => {
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),
1274
+ u.data.type === "VOUCHER" && l.value && (u.data.collectibleConfig.image = await firebaseStorage.update(
1275
+ u.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, l.value),
1276
1276
  l.value
1277
1277
  ));
1278
1278
  },
@@ -1280,44 +1280,44 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1280
1280
  message: "Uploading reward image",
1281
1281
  successMessage: "Reward image updated"
1282
1282
  }
1283
- ), g("update:model-value", s.data, n.value));
1283
+ ), h("update:model-value", u.data, n.value));
1284
1284
  }
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, {
1285
+ return c({
1286
+ showSheet: f
1287
+ }), (u, m) => {
1288
+ const y = resolveComponent("FmSelect"), v = resolveComponent("FmStepperField"), E = resolveComponent("FmButton"), x = resolveComponent("FmSideSheet");
1289
+ return openBlock(), createBlock(x, {
1290
1290
  "max-width": 560,
1291
- modelValue: unref(i),
1291
+ modelValue: unref(d),
1292
1292
  "onUpdate:modelValue": [
1293
- d[9] || (d[9] = (k) => isRef(i) ? i.value = k : null),
1294
- d[10] || (d[10] = (k) => i.value = k)
1293
+ m[9] || (m[9] = (C) => isRef(d) ? d.value = C : null),
1294
+ m[10] || (m[10] = (C) => d.value = C)
1295
1295
  ],
1296
1296
  header: "Edit reward",
1297
1297
  "dismiss-away": ""
1298
1298
  }, {
1299
1299
  "side-sheet-footer": withCtx(() => [
1300
1300
  createElementVNode("div", _hoisted_2$8, [
1301
- createVNode(C, {
1301
+ createVNode(E, {
1302
1302
  variant: "primary",
1303
1303
  type: "button",
1304
- disabled: unref(v).length > 0,
1304
+ disabled: unref(g).length > 0,
1305
1305
  label: "Confirm",
1306
- onClick: d[7] || (d[7] = (k) => h())
1306
+ onClick: m[7] || (m[7] = (C) => V())
1307
1307
  }, null, 8, ["disabled"]),
1308
- createVNode(C, {
1308
+ createVNode(E, {
1309
1309
  variant: "secondary",
1310
1310
  type: "button",
1311
1311
  label: "Cancel",
1312
- onClick: d[8] || (d[8] = (k) => i.value = !1)
1312
+ onClick: m[8] || (m[8] = (C) => d.value = !1)
1313
1313
  })
1314
1314
  ])
1315
1315
  ]),
1316
1316
  default: withCtx(() => {
1317
- var k, B, x;
1317
+ var C, R, B;
1318
1318
  return [
1319
1319
  unref(o) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
1320
- createVNode(f, {
1320
+ createVNode(y, {
1321
1321
  label: "Reward Type",
1322
1322
  items: [
1323
1323
  { label: "No Reward", value: "NO_REWARD" },
@@ -1325,12 +1325,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1325
1325
  { label: "Loyalty", value: "LOYALTY" }
1326
1326
  ],
1327
1327
  "model-value": unref(o).type,
1328
- "onUpdate:modelValue": d[0] || (d[0] = (b) => {
1329
- b == "NO_REWARD" ? o.value = {
1328
+ "onUpdate:modelValue": m[0] || (m[0] = (k) => {
1329
+ k == "NO_REWARD" ? o.value = {
1330
1330
  type: "NO_REWARD",
1331
1331
  collectible: null,
1332
1332
  weight: 1
1333
- } : b === "VOUCHER" ? o.value = {
1333
+ } : k === "VOUCHER" ? o.value = {
1334
1334
  collectible: null,
1335
1335
  type: "VOUCHER",
1336
1336
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1345,7 +1345,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1345
1345
  },
1346
1346
  weight: 1
1347
1347
  } : o.value = {
1348
- collectible: unref(u).loyaltyRewards.raw[0]._id,
1348
+ collectible: unref(i).loyaltyRewards.raw[0]._id,
1349
1349
  type: "LOYALTY",
1350
1350
  earningOption: {
1351
1351
  amount: 1,
@@ -1358,74 +1358,74 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1358
1358
  };
1359
1359
  })
1360
1360
  }, null, 8, ["model-value"]),
1361
- unref(o).type == "LOYALTY" ? (openBlock(), createBlock(f, {
1361
+ unref(o).type == "LOYALTY" ? (openBlock(), createBlock(y, {
1362
1362
  key: 0,
1363
1363
  label: "Loyalty type",
1364
- rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(o).type])],
1365
- items: unref(u).loyaltyRewards.items,
1364
+ rules: [unref(ZodHelper).ruleAtPath(unref(p), "collectible", [unref(o).type])],
1365
+ items: unref(i).loyaltyRewards.items,
1366
1366
  "model-value": unref(o).collectible,
1367
- "onUpdate:modelValue": d[1] || (d[1] = (b) => unref(o).collectible = b)
1367
+ "onUpdate:modelValue": m[1] || (m[1] = (k) => unref(o).collectible = k)
1368
1368
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1369
- createVNode(y, {
1369
+ createVNode(v, {
1370
1370
  label: "Weight",
1371
- rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(o).type])],
1371
+ rules: [unref(ZodHelper).ruleAtPath(unref(p), "weight", [unref(o).type])],
1372
1372
  "model-value": unref(o).weight,
1373
- "onUpdate:modelValue": d[2] || (d[2] = (b) => o.value = {
1373
+ "onUpdate:modelValue": m[2] || (m[2] = (k) => o.value = {
1374
1374
  ...unref(o),
1375
- weight: b
1375
+ weight: k
1376
1376
  })
1377
1377
  }, null, 8, ["rules", "model-value"]),
1378
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);
1379
+ ((C = unref(i).loyaltyRewards.items.find(
1380
+ (k) => {
1381
+ var w;
1382
+ return k.value === ((w = unref(o)) == null ? void 0 : w.collectible);
1383
1383
  }
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)),
1384
+ )) == null ? void 0 : C.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1385
+ m[11] || (m[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
1386
1386
  createVNode(_sfc_main$e, {
1387
1387
  class: "mt-[-8px]",
1388
1388
  rules: [
1389
- unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(o).type])
1389
+ unref(ZodHelper).ruleAtPath(unref(p), "earningOption", [unref(o).type])
1390
1390
  ],
1391
- "helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
1392
- "error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
1391
+ "helper-state": unref(ZodHelper).helperState(unref(g), "earningOption"),
1392
+ "error-text": unref(ZodHelper).helperText(unref(g), "earningOption"),
1393
1393
  "fixed-type": !0,
1394
1394
  "model-value": unref(o).earningOption,
1395
- "onUpdate:modelValue": d[3] || (d[3] = (b) => o.value = {
1395
+ "onUpdate:modelValue": m[3] || (m[3] = (k) => o.value = {
1396
1396
  ...unref(o),
1397
- earningOption: b
1397
+ earningOption: k
1398
1398
  })
1399
1399
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"])
1400
1400
  ], 64)) : createCommentVNode("", !0),
1401
- d[12] || (d[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
1401
+ m[12] || (m[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
1402
1402
  createVNode(_sfc_main$z, {
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);
1403
+ "for-credit": unref(o).type === "LOYALTY" && ((R = unref(i).loyaltyRewards.items.find(
1404
+ (k) => {
1405
+ var w;
1406
+ return k.value === ((w = unref(o)) == null ? void 0 : w.collectible);
1407
1407
  }
1408
- )) == null ? void 0 : B.raw.type) === "CREDIT",
1408
+ )) == null ? void 0 : R.raw.type) === "CREDIT",
1409
1409
  class: "!gap-24",
1410
- rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(o).type])],
1410
+ rules: [unref(ZodHelper).ruleAtPath(unref(p), "validityOption", [unref(o).type])],
1411
1411
  "model-value": unref(o).validityOption,
1412
- "onUpdate:modelValue": d[4] || (d[4] = (b) => o.value = {
1412
+ "onUpdate:modelValue": m[4] || (m[4] = (k) => o.value = {
1413
1413
  ...unref(o),
1414
- validityOption: b
1414
+ validityOption: k
1415
1415
  })
1416
1416
  }, null, 8, ["for-credit", "rules", "model-value"])
1417
1417
  ], 64)) : createCommentVNode("", !0),
1418
1418
  unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1419
1419
  key: 2,
1420
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 = {
1421
+ "model-value": ((B = unref(o)) == null ? void 0 : B.collectibleConfig) ?? void 0,
1422
+ "onUpdate:modelValue": m[5] || (m[5] = (k) => o.value = {
1423
1423
  ...unref(o),
1424
- collectibleConfig: b
1424
+ collectibleConfig: k
1425
1425
  }),
1426
- "onUpdate:rewardImage": d[6] || (d[6] = (b) => l.value = b)
1426
+ "onUpdate:rewardImage": m[6] || (m[6] = (k) => l.value = k)
1427
1427
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1428
- createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
1428
+ createVNode(JsonViewer, { json: unref(g) }, null, 8, ["json"])
1429
1429
  ])) : createCommentVNode("", !0)
1430
1430
  ];
1431
1431
  }),
@@ -1452,37 +1452,37 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1452
1452
  }
1453
1453
  },
1454
1454
  emits: ["update:model-value"],
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;
1455
+ setup(e, { emit: c }) {
1456
+ const s = e, i = c, a = useMembershipStore(), d = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => s.modelValue ?? []), l = computed(() => {
1457
+ const u = d.safeParse(o.value);
1458
+ return u.success ? [] : u.error.errors;
1459
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);
1460
+ function p(u, m) {
1461
+ var v;
1462
+ const y = [...o.value];
1463
+ y[m] = u, (v = n.value) == null || v.showSheet(!1), i("update:model-value", y);
1464
1464
  }
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;
1465
+ function g(u) {
1466
+ const m = u.type == "VOUCHER" ? u.collectibleConfig : a.collectibles.find(
1467
+ (E) => E._id.toString() == u.collectible
1468
+ ), y = CollectionUtils.formattedType((m == null ? void 0 : m.name) || ""), v = u.weight;
1469
1469
  return {
1470
- label: isNullOrEmpty(f) ? "NO REWARD" : f,
1471
- sublabel: `${y} (${(y / o.value.reduce((C, E) => C + E.weight, 0) * 100).toFixed(2)}%)`
1470
+ label: isNullOrEmpty(y) ? "NO REWARD" : y,
1471
+ sublabel: `${v} (${(v / o.value.reduce((E, x) => E + x.weight, 0) * 100).toFixed(2)}%)`
1472
1472
  };
1473
1473
  }
1474
- function p(s) {
1475
- var f;
1476
- const d = [...o.value];
1477
- (f = n.value) == null || f.showSheet(!0, d[s], s);
1474
+ function f(u) {
1475
+ var y;
1476
+ const m = [...o.value];
1477
+ (y = n.value) == null || y.showSheet(!0, m[u], u);
1478
1478
  }
1479
- function g(s) {
1480
- const d = [...o.value];
1481
- d.splice(s, 1), u("update:model-value", d);
1479
+ function h(u) {
1480
+ const m = [...o.value];
1481
+ m.splice(u, 1), i("update:model-value", m);
1482
1482
  }
1483
- function h() {
1484
- var s;
1485
- (s = n.value) == null || s.showSheet(
1483
+ function V() {
1484
+ var u;
1485
+ (u = n.value) == null || u.showSheet(
1486
1486
  !0,
1487
1487
  {
1488
1488
  type: "NO_REWARD",
@@ -1492,44 +1492,44 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1492
1492
  o.value.length
1493
1493
  );
1494
1494
  }
1495
- return (s, d) => {
1496
- const f = resolveComponent("FmButton"), y = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
1495
+ return (u, m) => {
1496
+ const y = resolveComponent("FmButton"), v = resolveComponent("FmCard"), E = resolveComponent("FmHelperText");
1497
1497
  return openBlock(), createElementBlock("div", _hoisted_1$a, [
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, {
1498
+ m[1] || (m[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(y, {
1500
1500
  label: "Add Reward",
1501
- onClick: d[0] || (d[0] = (E) => h()),
1501
+ onClick: m[0] || (m[0] = (x) => V()),
1502
1502
  variant: "plain",
1503
1503
  icon: "add"
1504
1504
  }),
1505
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (E, k) => (openBlock(), createBlock(y, {
1506
- key: k,
1505
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (x, C) => (openBlock(), createBlock(v, {
1506
+ key: C,
1507
1507
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
1508
1508
  variant: "outlined",
1509
- onClick: (B) => p(k)
1509
+ onClick: (R) => f(C)
1510
1510
  }, {
1511
1511
  default: withCtx(() => [
1512
1512
  createElementVNode("div", null, [
1513
- createElementVNode("div", _hoisted_2$7, toDisplayString(v(E).label), 1),
1514
- createElementVNode("div", _hoisted_3$6, toDisplayString(v(E).sublabel), 1)
1513
+ createElementVNode("div", _hoisted_2$7, toDisplayString(g(x).label), 1),
1514
+ createElementVNode("div", _hoisted_3$6, toDisplayString(g(x).sublabel), 1)
1515
1515
  ]),
1516
- createVNode(f, {
1516
+ createVNode(y, {
1517
1517
  icon: "delete",
1518
1518
  variant: "tertiary",
1519
- onClick: (B) => (B.stopPropagation(), g(k))
1519
+ onClick: (R) => (R.stopPropagation(), h(C))
1520
1520
  }, null, 8, ["onClick"])
1521
1521
  ]),
1522
1522
  _: 2
1523
1523
  }, 1032, ["onClick"]))), 128)),
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,
1524
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((x) => x.path.join(".") == ""), (x) => (openBlock(), createBlock(E, {
1525
+ key: x.message,
1526
+ text: x.message,
1527
1527
  state: "error"
1528
1528
  }, null, 8, ["text"]))), 128)),
1529
1529
  createVNode(_sfc_main$b, {
1530
1530
  ref_key: "sheetRef",
1531
1531
  ref: n,
1532
- "onUpdate:modelValue": c
1532
+ "onUpdate:modelValue": p
1533
1533
  }, null, 512)
1534
1534
  ]);
1535
1535
  };
@@ -1545,48 +1545,48 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1545
1545
  }
1546
1546
  },
1547
1547
  emits: ["update:model-value"],
1548
- setup(e, { emit: m }) {
1549
- const r = e, u = m, a = computed(() => [
1548
+ setup(e, { emit: c }) {
1549
+ const s = e, i = c, a = computed(() => [
1550
1550
  {
1551
1551
  label: "Rock paper scissor",
1552
1552
  description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
1553
1553
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
1554
1554
  }
1555
1555
  ]);
1556
- return (i, o) => {
1557
- var v, p, g;
1558
- const l = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), c = resolveComponent("FmHelperText");
1556
+ return (d, o) => {
1557
+ var g, f, h;
1558
+ const l = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), p = resolveComponent("FmHelperText");
1559
1559
  return openBlock(), createElementBlock("div", _hoisted_1$9, [
1560
1560
  createVNode(l, {
1561
1561
  label: "Enable game",
1562
- "model-value": !!((v = e.modelValue) != null && v.gameType),
1563
- "onUpdate:modelValue": o[0] || (o[0] = (h) => h ? u("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : u("update:model-value", null))
1562
+ "model-value": !!((g = e.modelValue) != null && g.gameType),
1563
+ "onUpdate:modelValue": o[0] || (o[0] = (V) => V ? i("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : i("update:model-value", null))
1564
1564
  }, null, 8, ["model-value"]),
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;
1565
+ ((f = e.modelValue) == null ? void 0 : f.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
1566
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (V) => {
1567
+ var u, m;
1568
1568
  return openBlock(), createBlock(n, {
1569
1569
  variant: "outlined",
1570
1570
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1571
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
1572
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((u = e.modelValue) == null ? void 0 : u.gameType) == V.value,
1573
+ "hover:bg-fm-color-opacity-sm": ((m = e.modelValue) == null ? void 0 : m.gameType) != V.value
1574
1574
  }]),
1575
1575
  onClick: () => {
1576
- var f;
1577
- ((f = r.modelValue) == null ? void 0 : f.gameType) != h.value && u("update:model-value", { gameType: h.value });
1576
+ var y;
1577
+ ((y = s.modelValue) == null ? void 0 : y.gameType) != V.value && i("update:model-value", { gameType: V.value });
1578
1578
  },
1579
- key: h.value
1579
+ key: V.value
1580
1580
  }, {
1581
1581
  default: withCtx(() => [
1582
- createElementVNode("div", _hoisted_3$5, toDisplayString(h.label), 1),
1583
- createElementVNode("div", _hoisted_4$4, toDisplayString(h.description), 1)
1582
+ createElementVNode("div", _hoisted_3$5, toDisplayString(V.label), 1),
1583
+ createElementVNode("div", _hoisted_4$4, toDisplayString(V.description), 1)
1584
1584
  ]),
1585
1585
  _: 2
1586
1586
  }, 1032, ["class", "onClick"]);
1587
1587
  }), 128))
1588
1588
  ])) : createCommentVNode("", !0),
1589
- ((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(c, {
1589
+ ((h = e.modelValue) == null ? void 0 : h.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(p, {
1590
1590
  key: 1,
1591
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)",
1592
1592
  state: "warning"
@@ -1602,8 +1602,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1602
1602
  }
1603
1603
  },
1604
1604
  emits: ["update:model-value"],
1605
- setup(e, { emit: m }) {
1606
- const r = e, u = m, a = computed(() => [
1605
+ setup(e, { emit: c }) {
1606
+ const s = e, i = c, a = computed(() => [
1607
1607
  {
1608
1608
  label: "Stamp",
1609
1609
  description: "Award stamps for purchases, redeemable after reaching set milestones.",
@@ -1615,7 +1615,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1615
1615
  value: F_MISSION_TYPE.enum.PROGRESSIVE
1616
1616
  }
1617
1617
  ]);
1618
- return (i, o) => {
1618
+ return (d, o) => {
1619
1619
  const l = resolveComponent("FmCard");
1620
1620
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
1621
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)),
@@ -1628,7 +1628,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1628
1628
  "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
1629
1629
  }]),
1630
1630
  onClick: () => {
1631
- r.modelValue != n.value && u("update:model-value", n.value);
1631
+ s.modelValue != n.value && i("update:model-value", n.value);
1632
1632
  },
1633
1633
  key: n.value
1634
1634
  }, {
@@ -1656,16 +1656,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1656
1656
  }
1657
1657
  },
1658
1658
  emits: ["update:model-value"],
1659
- setup(e, { emit: m }) {
1660
- const r = m;
1661
- return (u, a) => {
1662
- const i = resolveComponent("FmStepperField");
1659
+ setup(e, { emit: c }) {
1660
+ const s = c;
1661
+ return (i, a) => {
1662
+ const d = resolveComponent("FmStepperField");
1663
1663
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
1664
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, {
1665
+ createVNode(d, {
1666
1666
  label: "Maximum to collect",
1667
1667
  "model-value": e.modelValue || null,
1668
- "onUpdate:modelValue": a[0] || (a[0] = (o) => r("update:model-value", o)),
1668
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => s("update:model-value", o)),
1669
1669
  "helper-text": e.helperText || "Set the threshold required for reward eligibility",
1670
1670
  "helper-state": e.helperState || "none"
1671
1671
  }, null, 8, ["model-value", "helper-text", "helper-state"])
@@ -1681,22 +1681,22 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1681
1681
  }
1682
1682
  },
1683
1683
  emits: ["update:model-value"],
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;
1684
+ setup(e, { expose: c, emit: s }) {
1685
+ const i = e, a = useMembershipStore(), { minor: d } = useLoading, o = ref(!1), l = ref(), n = ref(), p = ref(0), g = FdtoThresholdReward, f = computed(() => {
1686
+ const y = g.safeParse(l.value);
1687
+ return y.success ? [] : y.error.errors;
1688
1688
  });
1689
- function g(f, y, C) {
1690
- f && (l.value = y, c.value = C), o.value = f;
1689
+ function h(y, v, E) {
1690
+ y && (l.value = v, p.value = E), o.value = y;
1691
1691
  }
1692
- const h = r;
1693
- async function s() {
1692
+ const V = s;
1693
+ async function u() {
1694
1694
  console.log(l.value);
1695
- const f = v.safeParse(l.value);
1696
- f.success && (await i(
1695
+ const y = g.safeParse(l.value);
1696
+ y.success && (await d(
1697
1697
  async () => {
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),
1698
+ y.data.type === "VOUCHER" && n.value && (y.data.collectibleConfig.image = await firebaseStorage.update(
1699
+ y.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
1700
1700
  n.value
1701
1701
  ));
1702
1702
  },
@@ -1704,80 +1704,80 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1704
1704
  message: "Uploading reward image",
1705
1705
  successMessage: "Reward image updated"
1706
1706
  }
1707
- ), h("update:model-value", f.data, c.value));
1707
+ ), V("update:model-value", y.data, p.value));
1708
1708
  }
1709
- const d = ref();
1710
- return m({
1711
- showSheet: g
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, {
1709
+ const m = ref();
1710
+ return c({
1711
+ showSheet: h
1712
+ }), (y, v) => {
1713
+ const E = resolveComponent("FmStepperField"), x = resolveComponent("FmSelect"), C = resolveComponent("FmForm"), R = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
1714
+ return openBlock(), createBlock(B, {
1715
1715
  "max-width": 560,
1716
1716
  modelValue: unref(o),
1717
1717
  "onUpdate:modelValue": [
1718
- y[10] || (y[10] = (b) => isRef(o) ? o.value = b : null),
1719
- y[11] || (y[11] = (b) => o.value = b)
1718
+ v[10] || (v[10] = (k) => isRef(o) ? o.value = k : null),
1719
+ v[11] || (v[11] = (k) => o.value = k)
1720
1720
  ],
1721
1721
  header: "Edit reward",
1722
1722
  "dismiss-away": ""
1723
1723
  }, {
1724
1724
  "side-sheet-footer": withCtx(() => [
1725
1725
  createElementVNode("div", _hoisted_1$6, [
1726
- createVNode(B, {
1726
+ createVNode(R, {
1727
1727
  variant: "primary",
1728
1728
  type: "button",
1729
1729
  label: "Confirm",
1730
- onClick: y[8] || (y[8] = async () => {
1731
- var b;
1732
- return (b = unref(d)) == null ? void 0 : b.validateInputs();
1730
+ onClick: v[8] || (v[8] = async () => {
1731
+ var k;
1732
+ return (k = unref(m)) == null ? void 0 : k.validateInputs();
1733
1733
  })
1734
1734
  }),
1735
- createVNode(B, {
1735
+ createVNode(R, {
1736
1736
  variant: "secondary",
1737
1737
  type: "button",
1738
1738
  label: "Cancel",
1739
- onClick: y[9] || (y[9] = (b) => o.value = !1)
1739
+ onClick: v[9] || (v[9] = (k) => o.value = !1)
1740
1740
  })
1741
1741
  ])
1742
1742
  ]),
1743
1743
  default: withCtx(() => [
1744
- unref(l) ? (openBlock(), createBlock(k, {
1744
+ unref(l) ? (openBlock(), createBlock(C, {
1745
1745
  key: 0,
1746
1746
  class: "flex flex-col gap-y-24",
1747
1747
  ref_key: "formRef",
1748
- ref: d,
1749
- onValidationSuccess: y[7] || (y[7] = (b) => s())
1748
+ ref: m,
1749
+ onValidationSuccess: v[7] || (v[7] = (k) => u())
1750
1750
  }, {
1751
1751
  default: withCtx(() => {
1752
- var b, S;
1752
+ var k, w;
1753
1753
  return [
1754
- unref(l).type ? (openBlock(), createBlock(C, {
1754
+ unref(l).type ? (openBlock(), createBlock(E, {
1755
1755
  key: 0,
1756
1756
  label: "Threshold",
1757
1757
  rules: [
1758
1758
  unref(ZodHelper).toRule(
1759
1759
  unref(z).number().min(1).max(
1760
- u.maxThreshold,
1761
- `Number cannot be more than ${u.maxThreshold}`
1760
+ i.maxThreshold,
1761
+ `Number cannot be more than ${i.maxThreshold}`
1762
1762
  )
1763
1763
  )
1764
1764
  ],
1765
1765
  "model-value": unref(l).threshold,
1766
- "onUpdate:modelValue": y[0] || (y[0] = (V) => l.value = {
1766
+ "onUpdate:modelValue": v[0] || (v[0] = (b) => l.value = {
1767
1767
  ...unref(l),
1768
- threshold: V
1768
+ threshold: b
1769
1769
  })
1770
1770
  }, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
1771
- createVNode(E, {
1771
+ createVNode(x, {
1772
1772
  label: "Reward Type",
1773
1773
  items: [
1774
1774
  { label: "Voucher", value: "VOUCHER" },
1775
1775
  { label: "Loyalty", value: "LOYALTY" }
1776
1776
  ],
1777
1777
  "model-value": unref(l).type,
1778
- "onUpdate:modelValue": y[1] || (y[1] = (V) => {
1779
- var N, R;
1780
- V === "VOUCHER" ? l.value = {
1778
+ "onUpdate:modelValue": v[1] || (v[1] = (b) => {
1779
+ var S, N;
1780
+ b === "VOUCHER" ? l.value = {
1781
1781
  collectible: null,
1782
1782
  type: "VOUCHER",
1783
1783
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1790,7 +1790,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1790
1790
  validityOption: {
1791
1791
  validForDay: 7
1792
1792
  },
1793
- threshold: (N = unref(l)) == null ? void 0 : N.threshold
1793
+ threshold: (S = unref(l)) == null ? void 0 : S.threshold
1794
1794
  } : l.value = {
1795
1795
  collectible: unref(a).loyaltyRewards.raw[0]._id,
1796
1796
  type: "LOYALTY",
@@ -1801,59 +1801,59 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1801
1801
  validityOption: {
1802
1802
  validForDay: 7
1803
1803
  },
1804
- threshold: (R = unref(l)) == null ? void 0 : R.threshold
1804
+ threshold: (N = unref(l)) == null ? void 0 : N.threshold
1805
1805
  };
1806
1806
  })
1807
1807
  }, null, 8, ["model-value"]),
1808
- unref(l).type == "LOYALTY" ? (openBlock(), createBlock(E, {
1808
+ unref(l).type == "LOYALTY" ? (openBlock(), createBlock(x, {
1809
1809
  key: 1,
1810
1810
  label: "Loyalty type",
1811
- rules: [unref(ZodHelper).ruleAtPath(unref(v), "collectible", [unref(l).type])],
1811
+ rules: [unref(ZodHelper).ruleAtPath(unref(g), "collectible", [unref(l).type])],
1812
1812
  items: unref(a).loyaltyRewards.items,
1813
1813
  "model-value": unref(l).collectible,
1814
- "onUpdate:modelValue": y[2] || (y[2] = (V) => unref(l).collectible = V)
1814
+ "onUpdate:modelValue": v[2] || (v[2] = (b) => unref(l).collectible = b)
1815
1815
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1816
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)),
1817
+ v[12] || (v[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
1818
1818
  createVNode(_sfc_main$e, {
1819
1819
  class: "mt-[-8px]",
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"),
1820
+ rules: [unref(ZodHelper).ruleAtPath(unref(g), "earningOption", [unref(l).type])],
1821
+ "helper-state": unref(ZodHelper).helperState(unref(f), "earningOption"),
1822
+ "error-text": unref(ZodHelper).helperText(unref(f), "earningOption"),
1823
1823
  "fixed-type": !0,
1824
1824
  "model-value": unref(l).earningOption,
1825
- "onUpdate:modelValue": y[3] || (y[3] = (V) => l.value = {
1825
+ "onUpdate:modelValue": v[3] || (v[3] = (b) => l.value = {
1826
1826
  ...unref(l),
1827
- earningOption: V
1827
+ earningOption: b
1828
1828
  })
1829
1829
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
1830
1830
  createVNode(_sfc_main$z, {
1831
1831
  class: "!gap-24",
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);
1832
+ "for-credit": unref(l).type === "LOYALTY" && ((k = unref(a).loyaltyRewards.items.find(
1833
+ (b) => {
1834
+ var S;
1835
+ return b.value === ((S = unref(l)) == null ? void 0 : S.collectible);
1836
1836
  }
1837
- )) == null ? void 0 : b.raw.type) === "CREDIT",
1838
- rules: [unref(ZodHelper).ruleAtPath(unref(v), "validityOption", [unref(l).type])],
1837
+ )) == null ? void 0 : k.raw.type) === "CREDIT",
1838
+ rules: [unref(ZodHelper).ruleAtPath(unref(g), "validityOption", [unref(l).type])],
1839
1839
  "model-value": unref(l).validityOption,
1840
- "onUpdate:modelValue": y[4] || (y[4] = (V) => l.value = {
1840
+ "onUpdate:modelValue": v[4] || (v[4] = (b) => l.value = {
1841
1841
  ...unref(l),
1842
- validityOption: V
1842
+ validityOption: b
1843
1843
  })
1844
1844
  }, null, 8, ["for-credit", "rules", "model-value"])
1845
1845
  ], 64)) : createCommentVNode("", !0),
1846
1846
  unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1847
1847
  key: 3,
1848
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 = {
1849
+ "model-value": ((w = unref(l)) == null ? void 0 : w.collectibleConfig) ?? void 0,
1850
+ "onUpdate:modelValue": v[5] || (v[5] = (b) => l.value = {
1851
1851
  ...unref(l),
1852
- collectibleConfig: V
1852
+ collectibleConfig: b
1853
1853
  }),
1854
- "onUpdate:rewardImage": y[6] || (y[6] = (V) => n.value = V)
1854
+ "onUpdate:rewardImage": v[6] || (v[6] = (b) => n.value = b)
1855
1855
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1856
- createVNode(JsonViewer, { json: unref(p) }, null, 8, ["json"])
1856
+ createVNode(JsonViewer, { json: unref(f) }, null, 8, ["json"])
1857
1857
  ];
1858
1858
  }),
1859
1859
  _: 1
@@ -1887,19 +1887,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1887
1887
  }
1888
1888
  },
1889
1889
  setup(e) {
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;
1890
+ const c = e, { maxRange: s, currentRange: i, markers: a } = toRefs(c), d = computed(
1891
+ () => Math.min(i.value / s.value * 100, 100)
1892
+ ), o = (l) => l / s.value * 100;
1893
1893
  return (l, n) => {
1894
- const c = resolveComponent("FmIcon");
1894
+ const p = resolveComponent("FmIcon");
1895
1895
  return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
1896
- (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(r), 40), (v) => (openBlock(), createBlock(c, {
1896
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(s), 40), (g) => (openBlock(), createBlock(p, {
1897
1897
  class: normalizeClass(
1898
- unref(u) >= v ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1898
+ unref(i) >= g ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1899
1899
  ),
1900
- outline: unref(u) < v,
1901
- key: v,
1902
- name: unref(a).some((p) => p === v) ? "featured_seasonal_and_gifts" : "check_circle"
1900
+ outline: unref(i) < g,
1901
+ key: g,
1902
+ name: unref(a).some((f) => f === g) ? "featured_seasonal_and_gifts" : "check_circle"
1903
1903
  }, null, 8, ["class", "outline", "name"]))), 128))
1904
1904
  ])) : (openBlock(), createElementBlock("div", {
1905
1905
  key: 1,
@@ -1907,12 +1907,12 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1907
1907
  }, [
1908
1908
  createElementVNode("div", {
1909
1909
  class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
1910
- style: normalizeStyle({ width: unref(i) + "%" })
1910
+ style: normalizeStyle({ width: unref(d) + "%" })
1911
1911
  }, null, 4),
1912
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (v, p) => (openBlock(), createElementBlock("div", {
1913
- key: p,
1912
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (g, f) => (openBlock(), createElementBlock("div", {
1913
+ key: f,
1914
1914
  class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
1915
- style: normalizeStyle({ left: o(v) + "%" })
1915
+ style: normalizeStyle({ left: o(g) + "%" })
1916
1916
  }, [
1917
1917
  createElementVNode("div", _hoisted_2$4, [
1918
1918
  createElementVNode("div", {
@@ -1926,16 +1926,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1926
1926
  }
1927
1927
  }), isObject = (e) => e !== null && typeof e == "object";
1928
1928
  function changeKeysFactory(e) {
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;
1929
+ return function c(s, i = 1, a) {
1930
+ if (i === 0 || !isObject(s))
1931
+ return s;
1932
+ if (Array.isArray(s))
1933
+ return s.map((o) => c(o, i - 1, a));
1934
+ const d = Object.create(Object.getPrototypeOf(s));
1935
+ return Object.keys(s).forEach((o) => {
1936
+ const l = s[o], n = e(o, a), p = c(l, i - 1, a);
1937
+ d[n] = p;
1938
+ }), d;
1939
1939
  };
1940
1940
  }
1941
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({
@@ -1951,39 +1951,39 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1951
1951
  }
1952
1952
  },
1953
1953
  emits: ["update:model-value"],
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) ?? []
1954
+ setup(e, { emit: c }) {
1955
+ const s = e, i = c, a = useMembershipStore(), d = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
1956
+ () => s.modelValue.sort((m, y) => m.threshold - y.threshold) ?? []
1957
1957
  ), l = computed(() => {
1958
- const d = i.safeParse(o.value);
1959
- return d.success ? [] : d.error.errors;
1958
+ const m = d.safeParse(o.value);
1959
+ return m.success ? [] : m.error.errors;
1960
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);
1961
+ function p(m, y) {
1962
+ var E;
1963
+ const v = [...o.value];
1964
+ v[y] = m, (E = n.value) == null || E.showSheet(!1), i("update:model-value", v);
1965
1965
  }
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) || "");
1966
+ function g(m) {
1967
+ const y = m.type == "VOUCHER" ? m.collectibleConfig : a.collectibles.find(
1968
+ (E) => E._id.toString() == m.collectible
1969
+ ), v = CollectionUtils.formattedType((y == null ? void 0 : y.name) || "");
1970
1970
  return {
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`} `
1971
+ label: isNullOrEmpty(v) ? "NO REWARD" : v,
1972
+ sublabel: `Reward at ${m.threshold} | Amount: ${m.earningOption.type == "FIXED" ? m.earningOption.amount : `${m.earningOption.amount} for every RM${m.earningOption.every} spent`} `
1973
1973
  };
1974
1974
  }
1975
- function p(d) {
1976
- var y;
1977
- const f = [...o.value];
1978
- (y = n.value) == null || y.showSheet(!0, f[d], d);
1975
+ function f(m) {
1976
+ var v;
1977
+ const y = [...o.value];
1978
+ (v = n.value) == null || v.showSheet(!0, y[m], m);
1979
1979
  }
1980
- function g(d) {
1981
- const f = [...o.value];
1982
- f.splice(d, 1), u("update:model-value", f);
1980
+ function h(m) {
1981
+ const y = [...o.value];
1982
+ y.splice(m, 1), i("update:model-value", y);
1983
1983
  }
1984
- function h() {
1985
- var d;
1986
- (d = n.value) == null || d.showSheet(
1984
+ function V() {
1985
+ var m;
1986
+ (m = n.value) == null || m.showSheet(
1987
1987
  !0,
1988
1988
  {
1989
1989
  type: "LOYALTY",
@@ -2000,58 +2000,58 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2000
2000
  o.value.length
2001
2001
  );
2002
2002
  }
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) || ""
2003
+ function u(m) {
2004
+ var y, v;
2005
+ return m.type == "VOUCHER" ? (y = m.collectibleConfig) == null ? void 0 : y.name : sentenceCase(
2006
+ ((v = a.loyaltyRewards.items.find(
2007
+ (E) => E.value == m.collectible
2008
+ )) == null ? void 0 : v.label) || ""
2009
2009
  );
2010
2010
  }
2011
- return (d, f) => {
2012
- const y = resolveComponent("FmButton"), C = resolveComponent("FmCard"), E = resolveComponent("FmHelperText");
2011
+ return (m, y) => {
2012
+ const v = resolveComponent("FmButton"), E = resolveComponent("FmCard"), x = resolveComponent("FmHelperText");
2013
2013
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
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, {
2014
+ y[2] || (y[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(v, {
2016
2016
  label: "Add Reward",
2017
- onClick: f[0] || (f[0] = (k) => h()),
2017
+ onClick: y[0] || (y[0] = (C) => V()),
2018
2018
  variant: "plain",
2019
2019
  icon: "add"
2020
2020
  }),
2021
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (k, B) => (openBlock(), createBlock(C, {
2022
- key: B,
2021
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (C, R) => (openBlock(), createBlock(E, {
2022
+ key: R,
2023
2023
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
2024
2024
  variant: "outlined",
2025
- onClick: (x) => p(B)
2025
+ onClick: (B) => f(R)
2026
2026
  }, {
2027
2027
  default: withCtx(() => [
2028
2028
  createElementVNode("div", null, [
2029
- createElementVNode("div", _hoisted_2$3, toDisplayString(v(k).label), 1),
2030
- createElementVNode("div", _hoisted_3$3, toDisplayString(v(k).sublabel), 1)
2029
+ createElementVNode("div", _hoisted_2$3, toDisplayString(g(C).label), 1),
2030
+ createElementVNode("div", _hoisted_3$3, toDisplayString(g(C).sublabel), 1)
2031
2031
  ]),
2032
- createVNode(y, {
2032
+ createVNode(v, {
2033
2033
  icon: "delete",
2034
2034
  variant: "tertiary",
2035
- onClick: (x) => (x.stopPropagation(), g(B))
2035
+ onClick: (B) => (B.stopPropagation(), h(R))
2036
2036
  }, null, 8, ["onClick"])
2037
2037
  ]),
2038
2038
  _: 2
2039
2039
  }, 1032, ["onClick"]))), 128)),
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,
2040
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((C) => C.path.join(".") == ""), (C) => (openBlock(), createBlock(x, {
2041
+ key: C.message,
2042
+ text: C.message,
2043
2043
  state: "error"
2044
2044
  }, null, 8, ["text"]))), 128)),
2045
- f[3] || (f[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1)),
2046
- createVNode(C, {
2045
+ y[3] || (y[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1)),
2046
+ createVNode(E, {
2047
2047
  variant: "outlined",
2048
2048
  class: "p-24 space-y-16 w-fit"
2049
2049
  }, {
2050
2050
  default: withCtx(() => [
2051
2051
  createElementVNode("div", _hoisted_4$2, [
2052
2052
  createElementVNode("div", null, [
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))
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(u(e.modelValue[e.modelValue.length - 1])), 1),
2054
+ y[1] || (y[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1))
2055
2055
  ])
2056
2056
  ]),
2057
2057
  createElementVNode("div", _hoisted_6$2, [
@@ -2059,7 +2059,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2059
2059
  type: e.mission.type,
2060
2060
  "max-range": e.mission.end,
2061
2061
  currentRange: e.mission.end / 4,
2062
- markers: e.modelValue.map((k) => k.threshold)
2062
+ markers: e.modelValue.map((C) => C.threshold)
2063
2063
  }, null, 8, ["type", "max-range", "currentRange", "markers"]),
2064
2064
  e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_7$1, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
2065
2065
  ])
@@ -2069,7 +2069,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2069
2069
  createVNode(_sfc_main$6, {
2070
2070
  ref_key: "sheetRef",
2071
2071
  ref: n,
2072
- "onUpdate:modelValue": c,
2072
+ "onUpdate:modelValue": p,
2073
2073
  "max-threshold": e.mission.end
2074
2074
  }, null, 8, ["max-threshold"])
2075
2075
  ]);
@@ -2081,9 +2081,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2081
2081
  modelValue: Object
2082
2082
  },
2083
2083
  emits: ["update:model-value"],
2084
- setup(e, { emit: m }) {
2085
- const r = e, u = computed(() => {
2086
- const o = FdoMission.safeParse(r.modelValue);
2084
+ setup(e, { emit: c }) {
2085
+ const s = e, i = computed(() => {
2086
+ const o = FdoMission.safeParse(s.modelValue);
2087
2087
  return o.success ? [] : o.error.errors;
2088
2088
  }), a = computed(() => [
2089
2089
  {
@@ -2096,37 +2096,37 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2096
2096
  description: "Reward customers when they reach a cumulative spending goal.",
2097
2097
  value: F_MISSION_TYPE.enum.PROGRESSIVE
2098
2098
  }
2099
- ]), i = m;
2099
+ ]), d = c;
2100
2100
  return (o, l) => {
2101
- var v;
2102
- const n = resolveComponent("FmCard"), c = resolveComponent("FmStepperField");
2101
+ var g;
2102
+ const n = resolveComponent("FmCard"), p = resolveComponent("FmStepperField");
2103
2103
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
2104
2104
  createElementVNode("div", _hoisted_2$2, [
2105
2105
  l[1] || (l[1] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Type", -1)),
2106
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
2107
  createElementVNode("div", _hoisted_3$2, [
2108
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (p) => {
2109
- var g, h;
2108
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (f) => {
2109
+ var h, V;
2110
2110
  return openBlock(), createBlock(n, {
2111
2111
  variant: "outlined",
2112
2112
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
2113
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
2114
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((h = e.modelValue) == null ? void 0 : h.type) == f.value,
2115
+ "hover:bg-fm-color-opacity-sm": ((V = e.modelValue) == null ? void 0 : V.type) != f.value
2116
2116
  }]),
2117
2117
  onClick: () => {
2118
- var s, d;
2119
- ((s = e.modelValue) == null ? void 0 : s.type) != p.value && i("update:model-value", {
2118
+ var u, m;
2119
+ ((u = e.modelValue) == null ? void 0 : u.type) != f.value && d("update:model-value", {
2120
2120
  ...e.modelValue,
2121
- type: p.value,
2122
- end: ((d = e.modelValue) == null ? void 0 : d.end) || 1
2121
+ type: f.value,
2122
+ end: ((m = e.modelValue) == null ? void 0 : m.end) || 1
2123
2123
  });
2124
2124
  },
2125
- key: p.value
2125
+ key: f.value
2126
2126
  }, {
2127
2127
  default: withCtx(() => [
2128
- createElementVNode("div", _hoisted_4$1, toDisplayString(p.label), 1),
2129
- createElementVNode("div", _hoisted_5$1, toDisplayString(p.description), 1)
2128
+ createElementVNode("div", _hoisted_4$1, toDisplayString(f.label), 1),
2129
+ createElementVNode("div", _hoisted_5$1, toDisplayString(f.description), 1)
2130
2130
  ]),
2131
2131
  _: 2
2132
2132
  }, 1032, ["class", "onClick"]);
@@ -2136,19 +2136,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2136
2136
  createElementVNode("div", _hoisted_6$1, [
2137
2137
  l[3] || (l[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Collections required", -1)),
2138
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, {
2139
+ createVNode(p, {
2140
2140
  label: "Maximum to collect",
2141
- "model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
2142
- "onUpdate:modelValue": l[0] || (l[0] = (p) => {
2143
- var g;
2144
- return i("update:model-value", {
2141
+ "model-value": ((g = e.modelValue) == null ? void 0 : g.end) || null,
2142
+ "onUpdate:modelValue": l[0] || (l[0] = (f) => {
2143
+ var h;
2144
+ return d("update:model-value", {
2145
2145
  ...e.modelValue,
2146
- type: ((g = e.modelValue) == null ? void 0 : g.type) || "STAMP",
2147
- end: p
2146
+ type: ((h = e.modelValue) == null ? void 0 : h.type) || "STAMP",
2147
+ end: f
2148
2148
  });
2149
2149
  }),
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"
2150
+ "helper-text": unref(ZodHelper).helperText(unref(i), "end") || "Set the threshold required for reward eligibility",
2151
+ "helper-state": unref(ZodHelper).helperState(unref(i), "end") || "none"
2152
2152
  }, null, 8, ["model-value", "helper-text", "helper-state"])
2153
2153
  ])
2154
2154
  ]);
@@ -2176,101 +2176,101 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2176
2176
  }
2177
2177
  },
2178
2178
  emits: ["update:model-value", "update:file"],
2179
- setup(e, { emit: m }) {
2180
- const { t: r } = useI18n(), u = e, a = m;
2181
- function i(c) {
2182
- switch (u.field.type) {
2179
+ setup(e, { emit: c }) {
2180
+ const { t: s } = useI18n(), i = e, a = c;
2181
+ function d(p) {
2182
+ switch (i.field.type) {
2183
2183
  case "timeframe":
2184
- const v = c.startDate ? hooks(c.startDate).startOf("day").toISOString() : void 0, p = c.endDate ? hooks(c.endDate).endOf("day").toISOString() : void 0;
2184
+ const g = p.startDate ? hooks(p.startDate).startOf("day").toISOString() : void 0, f = p.endDate ? hooks(p.endDate).endOf("day").toISOString() : void 0;
2185
2185
  a("update:model-value", {
2186
2186
  type: "timeframe",
2187
2187
  property: "__now",
2188
- start: v,
2189
- end: p
2188
+ start: g,
2189
+ end: f
2190
2190
  });
2191
2191
  break;
2192
2192
  case "image": {
2193
2193
  a(
2194
2194
  "update:file",
2195
- c,
2196
- o.value || firebaseStorage.collectibleImagePath(void 0, c)
2195
+ p,
2196
+ o.value || firebaseStorage.collectibleImagePath(void 0, p)
2197
2197
  );
2198
2198
  break;
2199
2199
  }
2200
2200
  default:
2201
- a("update:model-value", c);
2201
+ a("update:model-value", p);
2202
2202
  break;
2203
2203
  }
2204
2204
  }
2205
2205
  const o = computed(() => {
2206
- switch (u.field.type) {
2206
+ switch (i.field.type) {
2207
2207
  case "timeframe": {
2208
- const c = u.modelValue;
2208
+ const p = i.modelValue;
2209
2209
  return {
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
2210
+ startDate: p != null && p.start ? hooks(p == null ? void 0 : p.start).format("YYYY-MM-DD") : null,
2211
+ endDate: p != null && p.end ? hooks(p == null ? void 0 : p.end).format("YYYY-MM-DD") : null
2212
2212
  };
2213
2213
  }
2214
2214
  default:
2215
- return u.modelValue;
2215
+ return i.modelValue;
2216
2216
  }
2217
2217
  });
2218
2218
  function l() {
2219
2219
  if (!n.value.schema) return [];
2220
- const c = n.value.schema.safeParse(u.modelValue);
2221
- return c.success ? [] : c.error.errors;
2220
+ const p = n.value.schema.safeParse(i.modelValue);
2221
+ return p.success ? [] : p.error.errors;
2222
2222
  }
2223
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
2224
+ schema: i.schema,
2225
+ unwrapped: i.schema ? ZodHelper.unwrap(i.schema) : void 0,
2226
+ rules: i.schema ? [ZodHelper.ruleAtPath(i.schema, "")] : void 0,
2227
+ labelMark: i.schema && ZodHelper.isRequired(i.schema) == !1 ? "optional" : void 0,
2228
+ zodLabel: i.schema ? ZodHelper.toInputLabel(i.schema, i.field.label) : void 0
2229
2229
  }));
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, {
2230
+ return (p, g) => {
2231
+ var y, v, E, x, C;
2232
+ const f = resolveComponent("FmTextField"), h = resolveComponent("FmStepperField"), V = resolveComponent("FmTextarea"), u = resolveComponent("FmHelperText"), m = resolveComponent("FmSwitch");
2233
+ return e.field.type === "text" ? (openBlock(), createBlock(f, {
2234
2234
  key: 0,
2235
2235
  label: e.field.label,
2236
2236
  "label-mark": unref(n).labelMark,
2237
2237
  rules: unref(n).rules,
2238
2238
  "model-value": unref(o),
2239
- "onUpdate:modelValue": i
2239
+ "onUpdate:modelValue": d
2240
2240
  }, null, 8, ["label", "label-mark", "rules", "model-value"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2241
2241
  createVNode(JsonViewer, {
2242
- json: { schema: unref(n).unwrapped, props: u }
2242
+ json: { schema: unref(n).unwrapped, props: i }
2243
2243
  }, null, 8, ["json"]),
2244
- createVNode(g, {
2244
+ createVNode(h, {
2245
2245
  label: e.field.label,
2246
2246
  "label-mark": e.field.isRuleChildren ? void 0 : unref(n).labelMark,
2247
2247
  "model-value": unref(o),
2248
2248
  rules: e.field.isRuleChildren ? [] : unref(n).rules,
2249
- "onUpdate:modelValue": i,
2249
+ "onUpdate:modelValue": d,
2250
2250
  "helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
2251
2251
  "helper-text": e.field.isRuleChildren ? e.helperText : void 0
2252
2252
  }, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
2253
- ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(h, {
2253
+ ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(V, {
2254
2254
  key: 2,
2255
2255
  label: e.field.label,
2256
2256
  "label-mark": unref(n).labelMark,
2257
2257
  rules: unref(n).rules,
2258
2258
  "model-value": unref(o),
2259
- "onUpdate:modelValue": i,
2259
+ "onUpdate:modelValue": d,
2260
2260
  "show-word-count": "",
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
2261
+ "max-length": (C = (x = (E = (v = (y = unref(n)) == null ? void 0 : y.unwrapped) == null ? void 0 : v._def) == null ? void 0 : E.checks) == null ? void 0 : x.find((R) => R.kind == "max")) == null ? void 0 : C.value
2262
2262
  }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$j, {
2263
2263
  key: 3,
2264
2264
  "campaign-type": e.extras,
2265
2265
  "model-value": unref(o),
2266
2266
  disabled: e.disabled,
2267
- "onUpdate:modelValue": i
2267
+ "onUpdate:modelValue": d
2268
2268
  }, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
2269
2269
  createVNode(_sfc_main$h, {
2270
2270
  "model-value": unref(o),
2271
- "onUpdate:modelValue": i
2271
+ "onUpdate:modelValue": d
2272
2272
  }, null, 8, ["model-value"]),
2273
- createVNode(s, {
2273
+ createVNode(u, {
2274
2274
  class: "!mt-[8px]",
2275
2275
  text: unref(ZodHelper).helperText(l(), ""),
2276
2276
  state: unref(ZodHelper).helperState(l(), "")
@@ -2280,13 +2280,13 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2280
2280
  thumbnail: unref(o),
2281
2281
  "aspect-ratio": "16 / 9",
2282
2282
  class: "w-1/2 xs:w-2/3",
2283
- "onUpdate:file": i
2283
+ "onUpdate:file": d
2284
2284
  }, {
2285
2285
  label: withCtx(() => [
2286
2286
  (openBlock(), createBlock(resolveDynamicComponent(unref(n).zodLabel)))
2287
2287
  ]),
2288
2288
  _: 1
2289
- }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(d, {
2289
+ }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(m, {
2290
2290
  key: 6,
2291
2291
  label: e.field.label,
2292
2292
  "label-placement": "right",
@@ -2294,85 +2294,85 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2294
2294
  "label-mark": unref(n).labelMark,
2295
2295
  rules: unref(n).rules,
2296
2296
  "model-value": unref(o),
2297
- "onUpdate:modelValue": i
2297
+ "onUpdate:modelValue": d
2298
2298
  }, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$x, {
2299
2299
  key: 7,
2300
2300
  "model-value": unref(o),
2301
- "onUpdate:modelValue": i,
2301
+ "onUpdate:modelValue": d,
2302
2302
  "no-campaign": !1,
2303
2303
  schema: unref(n).schema,
2304
2304
  "is-mission": e.extras === "MISSION"
2305
2305
  }, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$y, {
2306
2306
  key: 8,
2307
2307
  "model-value": unref(o),
2308
- "onUpdate:modelValue": i
2308
+ "onUpdate:modelValue": d
2309
2309
  }, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
2310
2310
  createVNode(_sfc_main$w, {
2311
2311
  "model-value": unref(o),
2312
- "onUpdate:modelValue": i,
2312
+ "onUpdate:modelValue": d,
2313
2313
  "can-set-auto-apply": e.field.property == "campaign.effect"
2314
2314
  }, null, 8, ["model-value", "can-set-auto-apply"]),
2315
- unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(s, {
2315
+ unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(u, {
2316
2316
  key: 0,
2317
2317
  class: "!mt-[8px]",
2318
- text: unref(r)("connect.campaign.common.effect_required"),
2318
+ text: unref(s)("connect.campaign.common.effect_required"),
2319
2319
  state: "error"
2320
2320
  }, null, 8, ["text"]))
2321
2321
  ], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$A, {
2322
2322
  key: 10,
2323
2323
  "allow-email": !0,
2324
2324
  "model-value": unref(o),
2325
- "onUpdate:modelValue": i,
2325
+ "onUpdate:modelValue": d,
2326
2326
  "helper-text": unref(ZodHelper).helperText(l(), ""),
2327
2327
  "trigger-type": e.field.extras,
2328
2328
  "helper-state": unref(ZodHelper).helperState(l(), "")
2329
2329
  }, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$e, {
2330
2330
  key: 11,
2331
2331
  "model-value": unref(o),
2332
- "onUpdate:modelValue": i,
2332
+ "onUpdate:modelValue": d,
2333
2333
  extras: e.extras,
2334
2334
  "error-text": e.helperText
2335
2335
  }, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$z, {
2336
2336
  key: 12,
2337
2337
  type: "custom",
2338
2338
  "model-value": unref(o),
2339
- "onUpdate:modelValue": i,
2339
+ "onUpdate:modelValue": d,
2340
2340
  "helper-text": e.helperText || unref(ZodHelper).helperText(l(), "")
2341
2341
  }, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$d, {
2342
2342
  key: 13,
2343
2343
  "model-value": unref(o),
2344
- "onUpdate:modelValue": i
2344
+ "onUpdate:modelValue": d
2345
2345
  }, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
2346
2346
  key: 14,
2347
2347
  "model-value": unref(o),
2348
- "onUpdate:modelValue": i
2348
+ "onUpdate:modelValue": d
2349
2349
  }, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
2350
2350
  key: 15,
2351
2351
  "model-value": unref(o),
2352
- "onUpdate:modelValue": i
2352
+ "onUpdate:modelValue": d
2353
2353
  }, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
2354
2354
  key: 16,
2355
2355
  "model-value": unref(o),
2356
- "onUpdate:modelValue": i
2356
+ "onUpdate:modelValue": d
2357
2357
  }, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
2358
2358
  key: 17,
2359
2359
  "model-value": unref(o),
2360
- "onUpdate:modelValue": i,
2360
+ "onUpdate:modelValue": d,
2361
2361
  "helper-text": unref(ZodHelper).helperText(l(), ""),
2362
2362
  "helper-state": unref(ZodHelper).helperState(l(), "")
2363
2363
  }, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
2364
2364
  key: 18,
2365
2365
  "model-value": unref(o),
2366
- "onUpdate:modelValue": i,
2366
+ "onUpdate:modelValue": d,
2367
2367
  mission: e.extras.mission
2368
2368
  }, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
2369
2369
  createVNode(_sfc_main$g, {
2370
2370
  "model-value": unref(o),
2371
- "onUpdate:modelValue": i,
2371
+ "onUpdate:modelValue": d,
2372
2372
  "start-date": e.extras.start,
2373
2373
  "end-date": e.extras.end
2374
2374
  }, null, 8, ["model-value", "start-date", "end-date"]),
2375
- e.helperText ? (openBlock(), createBlock(s, {
2375
+ e.helperText ? (openBlock(), createBlock(u, {
2376
2376
  key: 0,
2377
2377
  class: "!mt-[8px]",
2378
2378
  text: e.helperText,
@@ -2381,25 +2381,25 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2381
2381
  ], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
2382
2382
  createVNode(_sfc_main$o, {
2383
2383
  "model-value": unref(o),
2384
- "onUpdate:modelValue": i
2384
+ "onUpdate:modelValue": d
2385
2385
  }, null, 8, ["model-value"]),
2386
- e.helperText ? (openBlock(), createBlock(s, {
2386
+ e.helperText ? (openBlock(), createBlock(u, {
2387
2387
  key: 0,
2388
2388
  class: "!mt-[8px]",
2389
2389
  text: e.helperText,
2390
2390
  state: "error"
2391
2391
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2392
2392
  ], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
2393
- e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(o).rules.g_time).length > 0 ? (openBlock(), createBlock(s, {
2393
+ e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(o).rules.g_time).length > 0 ? (openBlock(), createBlock(u, {
2394
2394
  key: 0,
2395
2395
  state: "warning",
2396
2396
  text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
2397
2397
  }, null, 8, ["text"])) : createCommentVNode("", !0),
2398
2398
  createVNode(_sfc_main$n, {
2399
2399
  "model-value": unref(o),
2400
- "onUpdate:modelValue": i
2400
+ "onUpdate:modelValue": d
2401
2401
  }, null, 8, ["model-value"]),
2402
- e.helperText ? (openBlock(), createBlock(s, {
2402
+ e.helperText ? (openBlock(), createBlock(u, {
2403
2403
  key: 1,
2404
2404
  class: "!mt-[8px]",
2405
2405
  text: e.helperText,
@@ -2408,9 +2408,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2408
2408
  ], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
2409
2409
  createVNode(_sfc_main$m, {
2410
2410
  "model-value": unref(o),
2411
- "onUpdate:modelValue": i
2411
+ "onUpdate:modelValue": d
2412
2412
  }, null, 8, ["model-value"]),
2413
- e.helperText ? (openBlock(), createBlock(s, {
2413
+ e.helperText ? (openBlock(), createBlock(u, {
2414
2414
  key: 0,
2415
2415
  class: "!mt-[8px]",
2416
2416
  text: e.helperText,
@@ -2419,9 +2419,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2419
2419
  ], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
2420
2420
  createVNode(_sfc_main$k, {
2421
2421
  "model-value": unref(o),
2422
- "onUpdate:modelValue": i
2422
+ "onUpdate:modelValue": d
2423
2423
  }, null, 8, ["model-value"]),
2424
- e.helperText ? (openBlock(), createBlock(s, {
2424
+ e.helperText ? (openBlock(), createBlock(u, {
2425
2425
  key: 0,
2426
2426
  class: "!mt-[8px]",
2427
2427
  text: e.helperText,
@@ -2430,9 +2430,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2430
2430
  ], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
2431
2431
  createVNode(_sfc_main$l, {
2432
2432
  "model-value": unref(o),
2433
- "onUpdate:modelValue": i
2433
+ "onUpdate:modelValue": d
2434
2434
  }, null, 8, ["model-value"]),
2435
- e.helperText ? (openBlock(), createBlock(s, {
2435
+ e.helperText ? (openBlock(), createBlock(u, {
2436
2436
  key: 0,
2437
2437
  class: "!mt-[8px]",
2438
2438
  text: e.helperText,
@@ -2441,15 +2441,15 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2441
2441
  ], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
2442
2442
  createVNode(_sfc_main$9, {
2443
2443
  "model-value": unref(o),
2444
- "onUpdate:modelValue": i
2444
+ "onUpdate:modelValue": d
2445
2445
  }, null, 8, ["model-value"]),
2446
- e.helperText ? (openBlock(), createBlock(s, {
2446
+ e.helperText ? (openBlock(), createBlock(u, {
2447
2447
  key: 0,
2448
2448
  class: "!mt-[8px]",
2449
2449
  text: e.helperText,
2450
2450
  state: "error"
2451
2451
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2452
- ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(u.field), 1));
2452
+ ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(i.field), 1));
2453
2453
  };
2454
2454
  }
2455
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({
@@ -2461,23 +2461,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2461
2461
  }
2462
2462
  },
2463
2463
  setup(e) {
2464
- const { t: m, te: r } = useI18n();
2465
- return (u, a) => {
2466
- const i = resolveComponent("FmCard");
2467
- return openBlock(), createBlock(i, {
2464
+ const { t: c, te: s } = useI18n();
2465
+ return (i, a) => {
2466
+ const d = resolveComponent("FmCard");
2467
+ return openBlock(), createBlock(d, {
2468
2468
  variant: "outlined",
2469
2469
  class: "p-16 space-y-8"
2470
2470
  }, {
2471
2471
  default: withCtx(() => [
2472
- createElementVNode("div", _hoisted_1$1, toDisplayString(unref(m)("connect.campaign.common.summary")), 1),
2472
+ createElementVNode("div", _hoisted_1$1, toDisplayString(unref(c)("connect.campaign.common.summary")), 1),
2473
2473
  a[0] || (a[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
2474
2474
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (o, l) => (openBlock(), createElementBlock("div", {
2475
2475
  class: "space-y-4",
2476
2476
  key: l
2477
2477
  }, [
2478
2478
  o ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
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)
2479
+ createElementVNode("div", _hoisted_2$1, toDisplayString(unref(c)(`${l}`)), 1),
2480
+ createElementVNode("div", _hoisted_3$1, toDisplayString(unref(s)(`${o}`) ? unref(c)(`${o}`) : o), 1)
2481
2481
  ], 64)) : createCommentVNode("", !0)
2482
2482
  ]))), 128))
2483
2483
  ]),
@@ -2496,16 +2496,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2496
2496
  TEMPLATES.VOUCHER
2497
2497
  ), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
2498
2498
  async function showSheet(visible, type, campaign, selectedTemplate) {
2499
- var e, m;
2499
+ var e, c;
2500
2500
  if (sheetVisible.value = visible, visible == !0) {
2501
2501
  try {
2502
2502
  isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
2503
2503
  } catch {
2504
2504
  } finally {
2505
- await new Promise((r) => setTimeout(r, 120)), isLoading.value = !1;
2505
+ await new Promise((s) => setTimeout(s, 120)), isLoading.value = !1;
2506
2506
  }
2507
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({
2508
- ...(m = template.value) == null ? void 0 : m.defaultValue
2508
+ ...(c = template.value) == null ? void 0 : c.defaultValue
2509
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`;
2510
2510
  }
2511
2511
  }
@@ -2532,10 +2532,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2532
2532
  return e.success ? [] : e.error.errors;
2533
2533
  });
2534
2534
  function stepErrors(e = currentStep.value - 1) {
2535
- const m = template.value.steps[e].groups.flatMap(
2536
- (r) => r.fields.map((u) => u.property)
2535
+ const c = template.value.steps[e].groups.flatMap(
2536
+ (s) => s.fields.map((i) => i.property)
2537
2537
  );
2538
- return errors.value.filter((r) => m.includes(r.path.join(".")));
2538
+ return errors.value.filter((s) => c.includes(s.path.join(".")));
2539
2539
  }
2540
2540
  __expose({ showSheet });
2541
2541
  function showSummaryDialog() {
@@ -2547,9 +2547,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2547
2547
  }
2548
2548
  });
2549
2549
  }
2550
- function onUpdateProperty(e, m) {
2551
- if (_.set(data.value, e, m), e == "campaign.event.type") {
2552
- const r = RuleBuilder.setRuleToGroup(
2550
+ function onUpdateProperty(e, c) {
2551
+ if (_.set(data.value, e, c), e == "campaign.event.type") {
2552
+ const s = RuleBuilder.setRuleToGroup(
2553
2553
  RuleBuilder.scaffoldGroup(),
2554
2554
  [
2555
2555
  RuleBuilder.scaffoldGroup("g_schedule"),
@@ -2557,7 +2557,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2557
2557
  RuleBuilder.scaffoldGroup("g_user"),
2558
2558
  RuleBuilder.scaffoldGroup("g_bill")
2559
2559
  ]
2560
- ), u = RuleBuilder.setRuleToGroup(
2560
+ ), i = RuleBuilder.setRuleToGroup(
2561
2561
  RuleBuilder.scaffoldGroup("g_schedule"),
2562
2562
  [
2563
2563
  RuleBuilder.constructEntry(
@@ -2569,29 +2569,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2569
2569
  ],
2570
2570
  "&&"
2571
2571
  );
2572
- if (m != "SCHEDULE") {
2573
- _.set(data.value, "campaign.event.rule", r);
2572
+ if (c != "SCHEDULE") {
2573
+ _.set(data.value, "campaign.event.rule", s);
2574
2574
  return;
2575
2575
  }
2576
2576
  _.set(
2577
2577
  data.value,
2578
2578
  "campaign.event.rule",
2579
- RuleBuilder.setRuleToGroup(r, u)
2579
+ RuleBuilder.setRuleToGroup(s, i)
2580
2580
  );
2581
2581
  }
2582
- e == "campaign.notify" && m == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
2582
+ e == "campaign.notify" && c == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
2583
2583
  }
2584
- async function onUpdateFile(e, m) {
2585
- return e ? await minor(async () => firebaseStorage.update(m, e), {
2584
+ async function onUpdateFile(e, c) {
2585
+ return e ? await minor(async () => firebaseStorage.update(c, e), {
2586
2586
  message: `${e ? "Uploading" : "Removing"} file`,
2587
2587
  successMessage: `File ${e ? "uploaded" : "removed"} successfully`
2588
2588
  }) : "";
2589
2589
  }
2590
2590
  function isDisable(e) {
2591
- var m, r;
2591
+ var c, s;
2592
2592
  switch (e == null ? void 0 : e.property) {
2593
2593
  case "campaign.event.type":
2594
- return ((r = (m = data.value) == null ? void 0 : m.campaign) == null ? void 0 : r._id) || !1;
2594
+ return ((s = (c = data.value) == null ? void 0 : c.campaign) == null ? void 0 : s._id) || !1;
2595
2595
  default:
2596
2596
  return !1;
2597
2597
  }
@@ -2600,26 +2600,26 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2600
2600
  const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
2601
2601
  e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
2602
2602
  }
2603
- return (e, m) => {
2604
- const r = resolveComponent("FmButton"), u = resolveComponent("FmStep"), a = resolveComponent("FmStepper"), i = resolveComponent("FmCard"), o = resolveComponent("FmTopSheet");
2603
+ return (e, c) => {
2604
+ const s = resolveComponent("FmButton"), i = resolveComponent("FmStep"), a = resolveComponent("FmStepper"), d = resolveComponent("FmCard"), o = resolveComponent("FmTopSheet");
2605
2605
  return openBlock(), createBlock(o, {
2606
2606
  "fullscreen-size": "lg",
2607
2607
  modelValue: unref(sheetVisible),
2608
2608
  "onUpdate:modelValue": [
2609
- m[7] || (m[7] = (l) => isRef(sheetVisible) ? sheetVisible.value = l : null),
2610
- m[8] || (m[8] = (l) => sheetVisible.value = l)
2609
+ c[7] || (c[7] = (l) => isRef(sheetVisible) ? sheetVisible.value = l : null),
2610
+ c[8] || (c[8] = (l) => sheetVisible.value = l)
2611
2611
  ]
2612
2612
  }, createSlots({
2613
2613
  "top-sheet-header": withCtx(() => [
2614
2614
  createElementVNode("div", _hoisted_1, [
2615
2615
  createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
2616
2616
  createElementVNode("div", _hoisted_2, [
2617
- createVNode(r, {
2618
- onClick: m[0] || (m[0] = (l) => hideSheet()),
2617
+ createVNode(s, {
2618
+ onClick: c[0] || (c[0] = (l) => hideSheet()),
2619
2619
  label: unref(t)("connect.campaign.common.cancel"),
2620
2620
  variant: "tertiary"
2621
2621
  }, null, 8, ["label"]),
2622
- createVNode(r, {
2622
+ createVNode(s, {
2623
2623
  onClick: onSubmit,
2624
2624
  label: unref(t)("connect.campaign.common.save"),
2625
2625
  disabled: unref(errors).length > 0
@@ -2635,7 +2635,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2635
2635
  createElementVNode("div", _hoisted_9, [
2636
2636
  createElementVNode("div", _hoisted_10, [
2637
2637
  createElementVNode("div", _hoisted_11, [
2638
- m[9] || (m[9] = createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
2638
+ c[9] || (c[9] = createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
2639
2639
  createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
2640
2640
  createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
2641
2641
  createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
@@ -2657,7 +2657,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2657
2657
  ])
2658
2658
  ])
2659
2659
  ], -1)),
2660
- createVNode(i, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2660
+ createVNode(d, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2661
2661
  ])
2662
2662
  ])
2663
2663
  ])
@@ -2669,12 +2669,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2669
2669
  unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
2670
2670
  createVNode(a, {
2671
2671
  modelValue: unref(currentStep),
2672
- "onUpdate:modelValue": m[1] || (m[1] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2672
+ "onUpdate:modelValue": c[1] || (c[1] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2673
2673
  orientation: "horizontal",
2674
2674
  class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
2675
2675
  }, {
2676
2676
  default: withCtx(() => [
2677
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(u, {
2677
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(i, {
2678
2678
  key: l.name,
2679
2679
  title: l.name,
2680
2680
  value: n + 1,
@@ -2685,19 +2685,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2685
2685
  _: 1
2686
2686
  }, 8, ["modelValue"]),
2687
2687
  createElementVNode("div", _hoisted_4, [
2688
- createVNode(r, {
2688
+ createVNode(s, {
2689
2689
  icon: "close",
2690
2690
  variant: "tertiary",
2691
- onClick: m[2] || (m[2] = (l) => sheetVisible.value = !1)
2691
+ onClick: c[2] || (c[2] = (l) => sheetVisible.value = !1)
2692
2692
  }),
2693
2693
  createVNode(a, {
2694
2694
  modelValue: unref(currentStep),
2695
- "onUpdate:modelValue": m[3] || (m[3] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2695
+ "onUpdate:modelValue": c[3] || (c[3] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2696
2696
  orientation: "horizontal",
2697
2697
  class: "flex-1"
2698
2698
  }, {
2699
2699
  default: withCtx(() => [
2700
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(u, {
2700
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(i, {
2701
2701
  key: l.name,
2702
2702
  title: unref(sheetTitle),
2703
2703
  description: l.name,
@@ -2708,10 +2708,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2708
2708
  ]),
2709
2709
  _: 1
2710
2710
  }, 8, ["modelValue"]),
2711
- createVNode(r, {
2711
+ createVNode(s, {
2712
2712
  icon: "info",
2713
2713
  variant: "tertiary",
2714
- onClick: m[4] || (m[4] = () => showSummaryDialog())
2714
+ onClick: c[4] || (c[4] = () => showSummaryDialog())
2715
2715
  })
2716
2716
  ]),
2717
2717
  createElementVNode("div", _hoisted_5, [
@@ -2735,38 +2735,38 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2735
2735
  class: "space-y-24"
2736
2736
  }, [
2737
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 }, [
2738
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(l.fields, (p, g) => (openBlock(), createElementBlock("div", { key: g }, [
2739
2739
  (openBlock(), createBlock(_sfc_main$2, {
2740
- key: v,
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 || "");
2740
+ key: g,
2741
+ field: p,
2742
+ modelValue: unref(_).get(unref(data), p.property),
2743
+ disabled: isDisable(p),
2744
+ "onUpdate:modelValue": (f) => onUpdateProperty(p.property, f),
2745
+ "onUpdate:file": async (f, h) => {
2746
+ const V = await onUpdateFile(f, h);
2747
+ onUpdateProperty(p.property, V || "");
2748
2748
  },
2749
2749
  schema: unref(ZodHelper).typeAtPath(
2750
2750
  unref(schema),
2751
- c.property,
2751
+ p.property,
2752
2752
  unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
2753
2753
  ),
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
2754
+ "helper-text": unref(ZodHelper).helperText(unref(errors), p.property),
2755
+ extras: p.extras != null ? p.extras == "" ? unref(data) : unref(_).get(unref(data), p.extras) : void 0
2756
2756
  }, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-text", "extras"]))
2757
2757
  ]))), 128))
2758
2758
  ]))), 128)),
2759
2759
  createElementVNode("div", _hoisted_8, [
2760
- createVNode(r, {
2760
+ createVNode(s, {
2761
2761
  label: "Back",
2762
2762
  variant: "tertiary",
2763
2763
  disabled: unref(currentStep) == 1,
2764
- onClick: m[5] || (m[5] = (l) => currentStep.value--)
2764
+ onClick: c[5] || (c[5] = (l) => currentStep.value--)
2765
2765
  }, null, 8, ["disabled"]),
2766
- createVNode(r, {
2766
+ createVNode(s, {
2767
2767
  disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
2768
2768
  label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
2769
- onClick: m[6] || (m[6] = (l) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2769
+ onClick: c[6] || (c[6] = (l) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2770
2770
  }, null, 8, ["disabled", "label"])
2771
2771
  ])
2772
2772
  ]),