@feedmepos/mf-connect 0.1.8-prod → 0.1.10-prod

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 (94) hide show
  1. package/dist/{Analytic-C5DiiAlc.js → Analytic-CpSbitWV.js} +24 -22
  2. package/dist/{App-B3pHa-zu.js → App-BPT8XzjX.js} +56 -51
  3. package/dist/{Broadcast-BbKiYeZC.js → Broadcast-CJHpiQeN.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CusmGpDT.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DUPqWdIm.js} +7 -8
  5. package/dist/Card-Bvn36zqZ.js +895 -0
  6. package/dist/{Collections-DvZEXknp.js → Collections-Bq6OxsJC.js} +24 -29
  7. package/dist/{Credit-CqjSUWeG.js → Credit-Dno_g7dW.js} +8 -8
  8. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bzd-9d8d.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-cGbwORhw.js} +649 -1284
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C73wNCE4.js → EffectSheet.vue_vue_type_style_index_0_lang-Ho7zwlbb.js} +20 -20
  11. package/dist/{Experience-BmCrc4-K.js → Experience-BC1qSIGO.js} +8 -8
  12. package/dist/{Game-CU4AHASb.js → Game-C_CKGMBW.js} +8 -8
  13. package/dist/Index-BXFaWTfw.js +255 -0
  14. package/dist/{Marketing-PJO3M5Xy.js → Marketing-Ni0WAie5.js} +5 -5
  15. package/dist/{Member-DChbb26Z.js → Member-djnisrK1.js} +4 -4
  16. package/dist/{MemberList-Ckvxgme7.js → MemberList-CclU-3B7.js} +194 -191
  17. package/dist/{MemberTransactions-KNlKr1DE.js → MemberTransactions-DVVsv3Ux.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CDX1qdOw.js → MessageInput.vue_vue_type_script_setup_true_lang-khyDg1m4.js} +2 -2
  19. package/dist/Mission-Z5somdo_.js +273 -0
  20. package/dist/Overview-BvMVz3lQ.js +1074 -0
  21. package/dist/{Point-B-Ot-ZXU.js → Point-DdPukiTg.js} +8 -8
  22. package/dist/{Promotion-CKEfuwo0.js → Promotion-DCqdIwjG.js} +9 -9
  23. package/dist/Record-CvMxXm1B.js +337 -0
  24. package/dist/Reward-CiJHGXfQ.js +441 -0
  25. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CrGCBRmH.js +150 -0
  26. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-tnT6i0Jq.js +1638 -0
  27. package/dist/{Segment-B8JKn5_y.js → Segment-CQb3j-o0.js} +22 -21
  28. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-B7YqIU5D.js +181 -0
  29. package/dist/{Setting-BcWDJ-63.js → Setting-91cK3ssU.js} +31 -31
  30. package/dist/Store-B-uldUKt.js +1744 -0
  31. package/dist/{StoreRewards-DyfFecSH.js → StoreRewards-dDNeFlA9.js} +15 -14
  32. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BVb1X0aq.js +1132 -0
  33. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CHrZ7pit.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Ds0WxGxr.js} +1 -1
  34. package/dist/{Tier-iKOv9e2Y.js → Tier-_jMaLj3u.js} +185 -185
  35. package/dist/{Title-BRWnLlHd.js → Title-By7o67aT.js} +20 -20
  36. package/dist/{Transaction-BMnxATxc.js → Transaction-BLpEgeI2.js} +2 -2
  37. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Bf_nO9zH.js +130 -0
  38. package/dist/{Voucher-B_IwtXLW.js → Voucher-CG5tfibn.js} +11 -11
  39. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DpQUoXyQ.js +419 -0
  40. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-YwGR2En3.js +56 -0
  41. package/dist/{app-Bs8TZeMP.js → app-DDmTqTb7.js} +1 -1
  42. package/dist/{app-CLPpu6jA.js → app-vCqTQIeC.js} +430 -276
  43. package/dist/app.js +1 -1
  44. package/dist/{business-Dg5T3krT.js → business-Cz78KGF2.js} +1 -1
  45. package/dist/{campaign-BMLeXfnZ.js → campaign-BBd4o7F_.js} +2 -2
  46. package/dist/campaign.enum-CIhi0b-m.js +20 -0
  47. package/dist/campaign.fn-5silF1DK.js +758 -0
  48. package/dist/collectible.enum-cMIQ6ogq.js +19 -0
  49. package/dist/{collection.fn-D4QJRMAS.js → collection.fn-BGc7Qeli.js} +2 -2
  50. package/dist/dto-i04OPJfW.js +2018 -0
  51. package/dist/{effect-BT6zDeUe.js → effect-D8UzkYRg.js} +1 -1
  52. package/dist/{email-addresses-DeUE8GFC.js → email-addresses-u05o35hN.js} +1 -1
  53. package/dist/{export-DWzBynN8.js → export-BEXuPYEd.js} +3 -3
  54. package/dist/{helper-Cs4YpYv9.js → helper-RptRJGv6.js} +1 -1
  55. package/dist/{index-aFNPEkUz.js → index-B8s-gucK.js} +13 -1
  56. package/dist/{index-B3GqF_vh.js → index-BjHZUhiH.js} +1 -1
  57. package/dist/{index-BUXB-qmB.js → index-Bpu2DYUc.js} +1348 -1342
  58. package/dist/{index-n-_5f43h.js → index-C6-rCMhD.js} +3 -3
  59. package/dist/{index-CjF0scjl.js → index-Cq_ZIbRm.js} +174 -168
  60. package/dist/{index-CiwzD983.js → index-DFAnoAe9.js} +1 -1
  61. package/dist/index-DbyJ6Nyn.js +54 -0
  62. package/dist/{index-BXs-tqST.js → index-Dt6K2eG8.js} +1 -1
  63. package/dist/{index-xCMvgFRa.js → index-DwzoqCt8.js} +989 -783
  64. package/dist/index-UfL5qRzR.js +1049 -0
  65. package/dist/index-g8EbRVnr.js +32 -0
  66. package/dist/{index-DfhJOhMY.js → index-hEE_ntHd.js} +1 -1
  67. package/dist/index-vh86FiIQ.js +10 -0
  68. package/dist/{index.esm2017-cme_1dHU.js → index.esm2017-BSzW_yaL.js} +1 -1
  69. package/dist/{loading-zw44FQ6v.js → loading-DjEdwdnj.js} +156 -153
  70. package/dist/{membership-Bg77E5Sx.js → membership-BL9Xs8lD.js} +52 -44
  71. package/dist/{money-BepQPzrc.js → money-D7lq0cx-.js} +1 -1
  72. package/dist/{number-BJ4XIfGj.js → number-BiDabTkI.js} +1 -1
  73. package/dist/objectid-CXf0jb1W.js +145 -0
  74. package/dist/reward-Cr8rbe5R.js +36 -0
  75. package/dist/{rule-builder-C1Jwhs7N.js → rule-builder-DPKFZ5UX.js} +1 -1
  76. package/dist/{rule-oDZ1Kic9.js → rule-vkYJij4h.js} +4 -3
  77. package/dist/{template-CSeRj8B2.js → template-Bep5Y5ch.js} +4 -4
  78. package/dist/trigger-fWhQ3bqv.js +144 -0
  79. package/dist/{usePagination-DUaGlE2s.js → usePagination-DSF5b4hM.js} +1 -1
  80. package/dist/user-9UiaP0xs.js +54 -0
  81. package/dist/{vue-i18n-4eZqYBzI.js → vue-i18n-BhiDOB1j.js} +112 -112
  82. package/dist/zod-Bg2FbC-D.js +90 -0
  83. package/package.json +2 -2
  84. package/dist/Card--Q4OMSRz.js +0 -824
  85. package/dist/Mission-B215NI_F.js +0 -261
  86. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-C03bKqvg.js +0 -1804
  87. package/dist/Store-ada-EZLR.js +0 -1530
  88. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Ra4nMKvT.js +0 -890
  89. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-vsgeD3mK.js +0 -141
  90. package/dist/dto-CQy53qRe.js +0 -2770
  91. package/dist/index-CvJ_6M8U.js +0 -298
  92. package/dist/index-QAuJWbpX.js +0 -756
  93. package/dist/index-sGtk4oiO.js +0 -207
  94. package/dist/user-Bm4KttFq.js +0 -37
@@ -1,155 +1,41 @@
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";
1
+ import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createCommentVNode, computed, createElementVNode, Fragment, renderList, normalizeClass, toDisplayString, toRefs, normalizeStyle, resolveDynamicComponent, createSlots } from "vue";
2
2
  import { _ } from "./lodash-B5I3zXaY.js";
3
- import { z } from "./app-CLPpu6jA.js";
4
- import { Z as ZodHelper, _ as _sfc_main$u } from "./ZodTextField.vue_vue_type_script_setup_true_lang-vsgeD3mK.js";
5
- import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, b as CampaignOptions, f as campaignTransform } from "./dto-CQy53qRe.js";
6
- import { u as useMembershipStore, C as CollectibleOptions } from "./membership-Bg77E5Sx.js";
7
- import { u as useBusinessStore } from "./business-Dg5T3krT.js";
8
- import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-BUXB-qmB.js";
9
- import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-C1Jwhs7N.js";
3
+ import { z } from "./app-vCqTQIeC.js";
4
+ import { Z as ZodHelper } from "./zod-Bg2FbC-D.js";
5
+ import { b as getCampaignSummaryObject, c as campaignRefinement, d as CampaignDtos, C as CampaignOptions, e as campaignTransform } from "./dto-i04OPJfW.js";
6
+ import { u as useMembershipStore } from "./membership-BL9Xs8lD.js";
7
+ import { u as useBusinessStore } from "./business-Cz78KGF2.js";
8
+ import "./index-Bpu2DYUc.js";
9
+ import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-DPKFZ5UX.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-QAuJWbpX.js";
13
- import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.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-C73wNCE4.js";
15
- import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CHrZ7pit.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-C03bKqvg.js";
17
- import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-zw44FQ6v.js";
18
- import { _ as _sfc_main$q, T as TEMPLATES } from "./index-CjF0scjl.js";
19
- import { u as useI18n } from "./vue-i18n-4eZqYBzI.js";
20
- import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-CDX1qdOw.js";
21
- import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-oDZ1Kic9.js";
22
- import { c as core, S as SvcConfig } from "./index-n-_5f43h.js";
23
- import "./index-sGtk4oiO.js";
24
- import "./index-xCMvgFRa.js";
25
- import "./index-CvJ_6M8U.js";
26
- import "./index-DfhJOhMY.js";
12
+ import { f as featureVersionMapping } from "./campaign.enum-CIhi0b-m.js";
13
+ import { _ as _sfc_main$o } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
14
+ import { _ as _sfc_main$m, a as _sfc_main$p, b as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-Ho7zwlbb.js";
15
+ import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-Ds0WxGxr.js";
16
+ import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-Bf_nO9zH.js";
17
+ import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-tnT6i0Jq.js";
18
+ import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-DjEdwdnj.js";
19
+ import { u as useI18n } from "./vue-i18n-BhiDOB1j.js";
20
+ import { T as TypeToTriggerOptions, _ as _sfc_main$u, a as _sfc_main$v } from "./trigger-fWhQ3bqv.js";
21
+ import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-khyDg1m4.js";
22
+ import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-vkYJij4h.js";
23
+ import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DpQUoXyQ.js";
24
+ import "./index-DwzoqCt8.js";
25
+ import { b as FdoCreditLoyaltyReward, c as FdtoRandomReward, d as F_MISSION_TYPE, e as FdoThresholdCreditReward, f as FdtoThresholdReward, g as FdoMission } from "./index-UfL5qRzR.js";
26
+ import { T as TEMPLATES } from "./index-Cq_ZIbRm.js";
27
+ import "./index-hEE_ntHd.js";
28
+ import "./index-DbyJ6Nyn.js";
29
+ import { F as F_GAME_TYPE } from "./collectible.enum-cMIQ6ogq.js";
27
30
  import { useCoreStore } from "@feedmepos/mf-common";
28
- import { i as initCollectibleConfig } from "./helper-Cs4YpYv9.js";
29
- import { C as CollectionUtils } from "./collection.fn-D4QJRMAS.js";
31
+ import { i as initCollectibleConfig } from "./helper-RptRJGv6.js";
32
+ import { C as CollectionUtils } from "./collection.fn-BGc7Qeli.js";
30
33
  import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
31
34
  import { useDialog } from "@feedmepos/ui-library";
32
- import { u as useCampaignStore } from "./campaign-BMLeXfnZ.js";
35
+ import { u as useCampaignStore } from "./campaign-BBd4o7F_.js";
36
+ import { S as SvcConfig } from "./index-C6-rCMhD.js";
33
37
  import { a as cleanPF } from "./object-qECH92oz.js";
34
- const _sfc_main$p = /* @__PURE__ */ defineComponent({
35
- __name: "SegmentConfigurator",
36
- props: {
37
- modelValue: {
38
- type: Object,
39
- required: !0
40
- }
41
- },
42
- emits: ["update:model-value"],
43
- setup(e, { emit: d }) {
44
- const a = e, s = computed(() => {
45
- var l;
46
- const [u] = isRuleGroup(a.modelValue) ? Object.values(((l = a.modelValue) == null ? void 0 : l.rules) ?? {}) : [null];
47
- return (u ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
48
- }), r = d;
49
- return (u, o) => (openBlock(), createBlock(_sfc_main$q, {
50
- multiselect: !0,
51
- items: unref(useMembershipStore)().segmentOptions,
52
- "model-value": unref(s),
53
- "onUpdate:modelValue": o[0] || (o[0] = (l) => r(
54
- "update:model-value",
55
- unref(RuleBuilder).setRuleToGroup(
56
- unref(RuleBuilder).scaffoldGroup("g_segment"),
57
- unref(RuleBuilder).constructEntry("user.segment", "_hasAny", l)
58
- )
59
- )),
60
- label: "Select segment(s) to match"
61
- }, null, 8, ["items", "model-value"]));
62
- }
63
- }), _hoisted_1$k = { class: "space-y-16" }, _hoisted_2$h = { key: 0 }, _sfc_main$o = /* @__PURE__ */ defineComponent({
64
- __name: "UserRuleGroup",
65
- props: {
66
- modelValue: {
67
- type: Object,
68
- default: () => {
69
- }
70
- }
71
- },
72
- emits: ["update:model-value"],
73
- setup(e, { emit: d }) {
74
- const { t: a } = useI18n(), s = e, r = d, u = 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
- ), o = [
77
- {
78
- value: "all_users",
79
- label: a("connect.template.rule.audience.all")
80
- },
81
- {
82
- value: "segment",
83
- label: a("connect.template.rule.audience.member_segment")
84
- },
85
- {
86
- value: "custom",
87
- label: a("connect.template.rule.audience.custom_audience")
88
- }
89
- ];
90
- return watch(u, async (l, n) => {
91
- var c;
92
- if (n != "all_users" && n != l && RuleBuilder.getRules(
93
- (c = s.modelValue) == null ? void 0 : c.rules[n == "custom" ? "g_user" : "g_segment"]
94
- ).length > 0) {
95
- const g = await prompt.confirm(
96
- a("connect.template.rule.audience.confirm_remove"),
97
- a("connect.common.confirm"),
98
- a("connect.common.confirm"),
99
- a("connect.common.cancel")
100
- );
101
- g && r(
102
- "update:model-value",
103
- RuleBuilder.setRuleToGroup(
104
- s.modelValue ?? RuleBuilder.scaffoldGroup(),
105
- RuleBuilder.scaffoldGroup(n == "custom" ? "g_user" : "g_segment")
106
- )
107
- ), u.value = g ? l : n;
108
- }
109
- }), (l, n) => {
110
- var g, p;
111
- const c = resolveComponent("FmRadio");
112
- return openBlock(), createElementBlock("div", _hoisted_1$k, [
113
- createElementVNode("div", null, [
114
- (openBlock(), createElementBlock(Fragment, null, renderList(o, (v) => createVNode(c, {
115
- key: v.value,
116
- value: v.value,
117
- label: v.label,
118
- modelValue: unref(u),
119
- "onUpdate:modelValue": n[0] || (n[0] = (h) => isRef(u) ? u.value = h : null)
120
- }, null, 8, ["value", "label", "modelValue"])), 64))
121
- ]),
122
- unref(u) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
123
- createVNode(_sfc_main$p, {
124
- modelValue: ((g = e.modelValue) == null ? void 0 : g.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
125
- "onUpdate:modelValue": n[1] || (n[1] = (v) => r(
126
- "update:model-value",
127
- unref(RuleBuilder).setRuleToGroup(
128
- e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
129
- v,
130
- "&&"
131
- )
132
- ))
133
- }, null, 8, ["modelValue"])
134
- ])) : createCommentVNode("", !0),
135
- unref(u) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
136
- key: 1,
137
- "include-only": "user",
138
- "trigger-type": "MEMBERSHIP_JOINED",
139
- "model-value": ((p = e.modelValue) == null ? void 0 : p.rules.g_user) ?? unref(RuleBuilder).scaffoldGroup("g_user"),
140
- "onUpdate:modelValue": n[2] || (n[2] = (v) => r(
141
- "update:model-value",
142
- unref(RuleBuilder).setRuleToGroup(
143
- e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
144
- v,
145
- "&&"
146
- )
147
- ))
148
- }, null, 8, ["model-value"])) : createCommentVNode("", !0)
149
- ]);
150
- };
151
- }
152
- }), _hoisted_1$j = { class: "space-y-24" }, _sfc_main$n = /* @__PURE__ */ defineComponent({
38
+ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
153
39
  __name: "TimeRuleGroup",
154
40
  props: {
155
41
  modelValue: {
@@ -160,57 +46,57 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
160
46
  },
161
47
  emits: ["update:model-value"],
162
48
  setup(e, { emit: d }) {
163
- const { t: a } = useI18n(), s = e, r = d, u = ref(
164
- !s.modelValue || !s.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(s.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
49
+ const { t: a } = useI18n(), r = e, u = d, i = ref(
50
+ !r.modelValue || !r.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(r.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
165
51
  );
166
- watch(u, async (l, n) => {
52
+ watch(i, async (o, n) => {
167
53
  var c;
168
- if (n == "custom" && l == "all_time" && RuleBuilder.getRules((c = s.modelValue) == null ? void 0 : c.rules.g_time).length > 0) {
54
+ if (n == "custom" && o == "all_time" && RuleBuilder.getRules((c = r.modelValue) == null ? void 0 : c.rules.g_time).length > 0) {
169
55
  const g = await prompt.confirm(
170
56
  a("connect.template.rule.time.confirm_remove"),
171
57
  a("connect.common.confirm"),
172
58
  a("connect.common.confirm"),
173
59
  a("connect.common.cancel")
174
60
  );
175
- g && r(
61
+ g && u(
176
62
  "update:model-value",
177
63
  RuleBuilder.setRuleToGroup(
178
- s.modelValue ?? RuleBuilder.scaffoldGroup(),
64
+ r.modelValue ?? RuleBuilder.scaffoldGroup(),
179
65
  RuleBuilder.scaffoldGroup("g_time")
180
66
  )
181
- ), u.value = g ? l : n;
67
+ ), i.value = g ? o : n;
182
68
  }
183
69
  });
184
- async function o(l) {
70
+ async function l(o) {
185
71
  var n;
186
- if (l == "custom" && RuleBuilder.getRules((n = s.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
72
+ if (o == "custom" && RuleBuilder.getRules((n = r.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
187
73
  if (!await prompt.confirm(
188
74
  a("connect.template.rule.time.confirm_remove"),
189
75
  a("connect.common.confirm"),
190
76
  a("connect.common.confirm"),
191
77
  a("connect.common.cancel")
192
78
  )) {
193
- u.value = "all_time";
79
+ i.value = "all_time";
194
80
  return;
195
81
  }
196
- r(
82
+ u(
197
83
  "update:model-value",
198
84
  RuleBuilder.setRuleToGroup(
199
- s.modelValue ?? RuleBuilder.scaffoldGroup(),
85
+ r.modelValue ?? RuleBuilder.scaffoldGroup(),
200
86
  RuleBuilder.scaffoldGroup("g_time")
201
87
  )
202
88
  );
203
89
  }
204
90
  }
205
- return (l, n) => {
206
- var p;
91
+ return (o, n) => {
92
+ var y;
207
93
  const c = resolveComponent("FmRadio"), g = resolveComponent("FmRadioGroup");
208
- return openBlock(), createElementBlock("div", _hoisted_1$j, [
94
+ return openBlock(), createElementBlock("div", _hoisted_1$g, [
209
95
  createVNode(g, {
210
- modelValue: unref(u),
96
+ modelValue: unref(i),
211
97
  "onUpdate:modelValue": [
212
- n[0] || (n[0] = (v) => isRef(u) ? u.value = v : null),
213
- n[1] || (n[1] = (v) => o(v))
98
+ n[0] || (n[0] = (v) => isRef(i) ? i.value = v : null),
99
+ n[1] || (n[1] = (v) => l(v))
214
100
  ]
215
101
  }, {
216
102
  default: withCtx(() => [
@@ -225,13 +111,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
225
111
  ]),
226
112
  _: 1
227
113
  }, 8, ["modelValue"]),
228
- unref(u) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
114
+ unref(i) == "custom" ? (openBlock(), createBlock(_sfc_main$j, {
229
115
  key: 0,
230
116
  class: "!mt-[0px]",
231
117
  "include-only": "trigger",
232
118
  "trigger-type": "SCHEDULE",
233
- "model-value": ((p = e.modelValue) == null ? void 0 : p.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
234
- "onUpdate:modelValue": n[2] || (n[2] = (v) => r(
119
+ "model-value": ((y = e.modelValue) == null ? void 0 : y.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
120
+ "onUpdate:modelValue": n[2] || (n[2] = (v) => u(
235
121
  "update:model-value",
236
122
  unref(RuleBuilder).setRuleToGroup(
237
123
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
@@ -243,36 +129,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
243
129
  ]);
244
130
  };
245
131
  }
246
- }), _sfc_main$m = /* @__PURE__ */ defineComponent({
247
- __name: "BillRuleGroup",
248
- props: {
249
- modelValue: {
250
- type: Object,
251
- default: () => {
252
- }
253
- }
254
- },
255
- emits: ["update:model-value"],
256
- setup(e, { emit: d }) {
257
- const a = d;
258
- return (s, r) => {
259
- var u;
260
- return openBlock(), createBlock(_sfc_main$r, {
261
- "include-only": "bill",
262
- "trigger-type": "BILL_COMPLETED",
263
- "model-value": ((u = e.modelValue) == null ? void 0 : u.rules.g_bill) ?? unref(RuleBuilder).scaffoldGroup("g_bill"),
264
- "onUpdate:modelValue": r[0] || (r[0] = (o) => a(
265
- "update:model-value",
266
- unref(RuleBuilder).setRuleToGroup(
267
- e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
268
- o,
269
- "&&"
270
- )
271
- ))
272
- }, null, 8, ["model-value"]);
273
- };
274
- }
275
- }), _sfc_main$l = /* @__PURE__ */ defineComponent({
132
+ }), _sfc_main$h = /* @__PURE__ */ defineComponent({
276
133
  __name: "BirthdayInput",
277
134
  props: {
278
135
  modelValue: {
@@ -281,28 +138,28 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
281
138
  },
282
139
  emits: ["update:model-value"],
283
140
  setup(e, { emit: d }) {
284
- const a = e, s = d, r = computed(() => {
285
- const { property: u, operator: o, equator: l } = RuleBuilder.simplify(
141
+ const a = e, r = d, u = computed(() => {
142
+ const { property: i, operator: l, equator: o } = RuleBuilder.simplify(
286
143
  a.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
287
144
  op: "before",
288
145
  x: 1
289
146
  })
290
147
  );
291
148
  return {
292
- property: u,
293
- operator: o,
294
- equator: l
149
+ property: i,
150
+ operator: l,
151
+ equator: o
295
152
  };
296
153
  });
297
- return (u, o) => {
298
- const l = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
154
+ return (i, l) => {
155
+ const o = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
299
156
  return openBlock(), createElementBlock("div", null, [
300
- createVNode(l, {
157
+ createVNode(o, {
301
158
  label: "On birthday",
302
159
  value: "_isRange-day",
303
- "model-value": `${unref(r).operator}-${unref(r).equator.unit}`,
304
- "onUpdate:modelValue": o[0] || (o[0] = () => {
305
- s(
160
+ "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
161
+ "onUpdate:modelValue": l[0] || (l[0] = () => {
162
+ r(
306
163
  "update:model-value",
307
164
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
308
165
  op: "this",
@@ -312,12 +169,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
312
169
  );
313
170
  })
314
171
  }, null, 8, ["model-value"]),
315
- createVNode(l, {
172
+ createVNode(o, {
316
173
  label: "N days before birthday",
317
174
  value: "_isDay",
318
- "model-value": unref(r).operator,
319
- "onUpdate:modelValue": o[1] || (o[1] = () => {
320
- s(
175
+ "model-value": unref(u).operator,
176
+ "onUpdate:modelValue": l[1] || (l[1] = () => {
177
+ r(
321
178
  "update:model-value",
322
179
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
323
180
  op: "after",
@@ -327,12 +184,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
327
184
  );
328
185
  })
329
186
  }, null, 8, ["model-value"]),
330
- unref(r).operator == "_isDay" ? (openBlock(), createBlock(n, {
187
+ unref(u).operator == "_isDay" ? (openBlock(), createBlock(n, {
331
188
  key: 0,
332
189
  label: "Days before birthday",
333
190
  "show-steppers": !1,
334
- "model-value": unref(r).equator.x,
335
- "onUpdate:modelValue": o[2] || (o[2] = (c) => s(
191
+ "model-value": unref(u).equator.x,
192
+ "onUpdate:modelValue": l[2] || (l[2] = (c) => r(
336
193
  "update:model-value",
337
194
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
338
195
  op: "after",
@@ -341,12 +198,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
341
198
  })
342
199
  ))
343
200
  }, null, 8, ["model-value"])) : createCommentVNode("", !0),
344
- createVNode(l, {
201
+ createVNode(o, {
345
202
  label: "In birthday week",
346
203
  value: "_isRange-week",
347
- "model-value": `${unref(r).operator}-${unref(r).equator.unit}`,
348
- "onUpdate:modelValue": o[3] || (o[3] = () => {
349
- s(
204
+ "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
205
+ "onUpdate:modelValue": l[3] || (l[3] = () => {
206
+ r(
350
207
  "update:model-value",
351
208
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
352
209
  op: "this",
@@ -356,12 +213,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
356
213
  );
357
214
  })
358
215
  }, null, 8, ["model-value"]),
359
- createVNode(l, {
216
+ createVNode(o, {
360
217
  label: "In birthday month",
361
218
  value: "_isRange-month",
362
- "model-value": `${unref(r).operator}-${unref(r).equator.unit}`,
363
- "onUpdate:modelValue": o[4] || (o[4] = () => {
364
- s(
219
+ "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
220
+ "onUpdate:modelValue": l[4] || (l[4] = () => {
221
+ r(
365
222
  "update:model-value",
366
223
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
367
224
  op: "this",
@@ -374,110 +231,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
374
231
  ]);
375
232
  };
376
233
  }
377
- }), _sfc_main$k = /* @__PURE__ */ defineComponent({
378
- __name: "FeedbackRuleGroup",
379
- props: {
380
- modelValue: {
381
- type: Object,
382
- default: () => {
383
- }
384
- }
385
- },
386
- emits: ["update:model-value"],
387
- setup(e, { emit: d }) {
388
- const a = d;
389
- return (s, r) => {
390
- var u;
391
- return openBlock(), createBlock(_sfc_main$r, {
392
- "include-only": "feedback",
393
- "trigger-type": "FEEDBACK",
394
- "model-value": ((u = e.modelValue) == null ? void 0 : u.rules.g_feedback) ?? unref(RuleBuilder).scaffoldGroup("g_feedback"),
395
- "onUpdate:modelValue": r[0] || (r[0] = (o) => a(
396
- "update:model-value",
397
- unref(RuleBuilder).setRuleToGroup(
398
- e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
399
- o,
400
- "&&"
401
- )
402
- ))
403
- }, null, 8, ["model-value"]);
404
- };
405
- }
406
- }), TriggerOptions = {
407
- [F_CAMPAIGN_TRIGGER_TYPE.enum.BILL_COMPLETED]: {
408
- name: "Bill complete",
409
- description: "Reward customers upon the completion of their bill.",
410
- value: F_CAMPAIGN_TRIGGER_TYPE.enum.BILL_COMPLETED,
411
- hidden: !1
412
- },
413
- [F_CAMPAIGN_TRIGGER_TYPE.enum.FEEDBACK]: {
414
- name: "Feedback",
415
- description: "Reward customers for providing feedback.",
416
- value: F_CAMPAIGN_TRIGGER_TYPE.enum.FEEDBACK,
417
- hidden: !1
418
- },
419
- [F_CAMPAIGN_TRIGGER_TYPE.enum.GAME_COMPLETED]: {
420
- name: "Game complete",
421
- description: "Reward customers upon the completion of a game.",
422
- value: F_CAMPAIGN_TRIGGER_TYPE.enum.GAME_COMPLETED,
423
- hidden: !1
424
- },
425
- [F_CAMPAIGN_TRIGGER_TYPE.enum.MAKING_ORDER]: {
426
- name: "Making order",
427
- description: "Reward customers upon the creation of their order.",
428
- value: F_CAMPAIGN_TRIGGER_TYPE.enum.MAKING_ORDER,
429
- hidden: !1
430
- },
431
- [F_CAMPAIGN_TRIGGER_TYPE.enum.MEMBERSHIP_JOINED]: {
432
- name: "Member joined ",
433
- description: "Trigger rewards when customers join your membership program.",
434
- value: F_CAMPAIGN_TRIGGER_TYPE.enum.MEMBERSHIP_JOINED,
435
- hidden: !1
436
- },
437
- [F_CAMPAIGN_TRIGGER_TYPE.enum.SCHEDULE]: {
438
- name: "Schedule",
439
- description: "Set rewards to be triggered at specific times or dates.",
440
- value: F_CAMPAIGN_TRIGGER_TYPE.enum.SCHEDULE,
441
- hidden: !1
442
- },
443
- [F_CAMPAIGN_TRIGGER_TYPE.enum.SIMPLE_CLAIM]: {
444
- name: "Simple claim",
445
- description: "Activate rewards when customers claim an offer",
446
- value: F_CAMPAIGN_TRIGGER_TYPE.enum.SIMPLE_CLAIM,
447
- hidden: !1
448
- },
449
- [F_CAMPAIGN_TRIGGER_TYPE.enum.TIER_UPGRADED]: {
450
- name: "Tier upgrade",
451
- description: "Activate rewards when their membership tier gets upgraded.",
452
- value: F_CAMPAIGN_TRIGGER_TYPE.enum.TIER_UPGRADED,
453
- hidden: !1
454
- },
455
- [F_CAMPAIGN_TRIGGER_TYPE.enum.ISSUE_REWARD]: {
456
- name: "Issue reward",
457
- description: "Triggers whenever customer receives a reward in any kind.",
458
- value: F_CAMPAIGN_TRIGGER_TYPE.enum.ISSUE_REWARD,
459
- hidden: !0
460
- }
461
- }, TypeToTriggerOptions = Object.fromEntries(
462
- [
463
- "VOUCHER",
464
- "PROMOTION",
465
- "POINT",
466
- "CREDIT",
467
- "MEMBERSHIP",
468
- "BROADCAST",
469
- "COIN",
470
- "REWARD_POOL",
471
- "GAME",
472
- "MISSION"
473
- ].map((e) => {
474
- const d = CAMPAIGN_TRIGGER[e];
475
- return [
476
- e,
477
- (d == null ? void 0 : d.map((a) => TriggerOptions[a]).filter((a) => !a.hidden)) ?? []
478
- ];
479
- })
480
- ), _hoisted_1$i = { class: "space-y-16" }, _hoisted_2$g = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1), _hoisted_3$e = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$d = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$8 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
234
+ }), _hoisted_1$f = { class: "space-y-16" }, _hoisted_2$e = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1), _hoisted_3$c = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$6 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
481
235
  __name: "CampaignTriggerInput",
482
236
  props: {
483
237
  campaignType: {
@@ -494,30 +248,30 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
494
248
  },
495
249
  emits: ["update:model-value"],
496
250
  setup(e, { emit: d }) {
497
- const a = e, s = d, r = computed(() => a.disabled ? TypeToTriggerOptions[a.campaignType].filter(
498
- (u) => u.value == a.modelValue
251
+ const a = e, r = d, u = computed(() => a.disabled ? TypeToTriggerOptions[a.campaignType].filter(
252
+ (i) => i.value == a.modelValue
499
253
  ) : TypeToTriggerOptions[a.campaignType]);
500
- return (u, o) => {
501
- const l = resolveComponent("FmCard");
502
- return openBlock(), createElementBlock("div", _hoisted_1$i, [
503
- _hoisted_2$g,
504
- createElementVNode("div", _hoisted_3$e, [
505
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (n) => (openBlock(), createBlock(l, {
254
+ return (i, l) => {
255
+ const o = resolveComponent("FmCard");
256
+ return openBlock(), createElementBlock("div", _hoisted_1$f, [
257
+ _hoisted_2$e,
258
+ createElementVNode("div", _hoisted_3$c, [
259
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
506
260
  variant: "outlined",
507
261
  disabled: a.disabled,
508
262
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
509
- "col-span-3": unref(r).length == 1,
263
+ "col-span-3": unref(u).length == 1,
510
264
  "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
511
265
  "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
512
266
  }]),
513
267
  onClick: () => {
514
- a.modelValue != n.value && !a.disabled && s("update:model-value", n.value);
268
+ a.modelValue != n.value && !a.disabled && r("update:model-value", n.value);
515
269
  },
516
270
  key: n.name
517
271
  }, {
518
272
  default: withCtx(() => [
519
- createElementVNode("div", _hoisted_4$d, toDisplayString(n.name), 1),
520
- createElementVNode("div", _hoisted_5$8, toDisplayString(n.description), 1)
273
+ createElementVNode("div", _hoisted_4$b, toDisplayString(n.name), 1),
274
+ createElementVNode("div", _hoisted_5$6, toDisplayString(n.description), 1)
521
275
  ]),
522
276
  _: 2
523
277
  }, 1032, ["disabled", "class", "onClick"]))), 128))
@@ -525,7 +279,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
525
279
  ]);
526
280
  };
527
281
  }
528
- }), _sfc_main$i = /* @__PURE__ */ defineComponent({
282
+ }), _sfc_main$f = /* @__PURE__ */ defineComponent({
529
283
  __name: "DateInput",
530
284
  props: {
531
285
  label: {
@@ -540,25 +294,25 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
540
294
  emits: ["update:model-value"],
541
295
  setup(e, { emit: d }) {
542
296
  const a = d;
543
- return (s, r) => {
544
- const u = resolveComponent("FmButton"), o = resolveComponent("FmField"), l = resolveComponent("FmDatePicker");
545
- return openBlock(), createBlock(l, {
297
+ return (r, u) => {
298
+ const i = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
299
+ return openBlock(), createBlock(o, {
546
300
  label: e.label,
547
301
  "model-value": e.modelValue || "",
548
- "onUpdate:modelValue": r[1] || (r[1] = (n) => a("update:model-value", n))
302
+ "onUpdate:modelValue": u[1] || (u[1] = (n) => a("update:model-value", n))
549
303
  }, {
550
304
  "trigger-button": withCtx(({ opened: n }) => [
551
- createVNode(o, {
305
+ createVNode(l, {
552
306
  class: "flex items-center",
553
307
  "prepend-icon": "calendar_month",
554
308
  "icon-outlined": !n
555
309
  }, {
556
310
  append: withCtx(() => [
557
- e.modelValue ? (openBlock(), createBlock(u, {
311
+ e.modelValue ? (openBlock(), createBlock(i, {
558
312
  key: 0,
559
313
  variant: "tertiary",
560
314
  icon: "clear",
561
- onClick: r[0] || (r[0] = (c) => (c.stopPropagation(), a("update:model-value", null)))
315
+ onClick: u[0] || (u[0] = (c) => (c.stopPropagation(), a("update:model-value", null)))
562
316
  })) : createCommentVNode("", !0)
563
317
  ]),
564
318
  default: withCtx(() => [
@@ -573,7 +327,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
573
327
  }, 8, ["label", "model-value"]);
574
328
  };
575
329
  }
576
- }), _hoisted_1$h = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$f = { class: "flex-1 xs:w-full" }, _hoisted_3$d = /* @__PURE__ */ createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1), _hoisted_4$c = { class: "flex-1 xs:w-full" }, _sfc_main$h = /* @__PURE__ */ defineComponent({
330
+ }), _hoisted_1$e = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$d = { class: "flex-1 xs:w-full" }, _hoisted_3$b = /* @__PURE__ */ createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1), _hoisted_4$a = { class: "flex-1 xs:w-full" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
577
331
  __name: "DateRangeInput",
578
332
  props: {
579
333
  modelValue: {
@@ -584,32 +338,32 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
584
338
  emits: ["update:model-value"],
585
339
  setup(e, { emit: d }) {
586
340
  const a = d;
587
- return (s, r) => {
588
- var u, o;
589
- return openBlock(), createElementBlock("div", _hoisted_1$h, [
590
- createElementVNode("div", _hoisted_2$f, [
591
- createVNode(_sfc_main$i, {
592
- "model-value": ((u = e.modelValue) == null ? void 0 : u.startDate) ?? null,
341
+ return (r, u) => {
342
+ var i, l;
343
+ return openBlock(), createElementBlock("div", _hoisted_1$e, [
344
+ createElementVNode("div", _hoisted_2$d, [
345
+ createVNode(_sfc_main$f, {
346
+ "model-value": ((i = e.modelValue) == null ? void 0 : i.startDate) ?? null,
593
347
  label: "Start date",
594
- "onUpdate:modelValue": r[0] || (r[0] = (l) => {
348
+ "onUpdate:modelValue": u[0] || (u[0] = (o) => {
595
349
  var n;
596
350
  return a("update:model-value", {
597
- startDate: l,
351
+ startDate: o,
598
352
  endDate: ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null
599
353
  });
600
354
  })
601
355
  }, null, 8, ["model-value"])
602
356
  ]),
603
- _hoisted_3$d,
604
- createElementVNode("div", _hoisted_4$c, [
605
- createVNode(_sfc_main$i, {
606
- "model-value": ((o = e.modelValue) == null ? void 0 : o.endDate) ?? null,
357
+ _hoisted_3$b,
358
+ createElementVNode("div", _hoisted_4$a, [
359
+ createVNode(_sfc_main$f, {
360
+ "model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
607
361
  label: "End date",
608
- "onUpdate:modelValue": r[1] || (r[1] = (l) => {
362
+ "onUpdate:modelValue": u[1] || (u[1] = (o) => {
609
363
  var n;
610
364
  return a("update:model-value", {
611
365
  startDate: ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
612
- endDate: l
366
+ endDate: o
613
367
  });
614
368
  })
615
369
  }, null, 8, ["model-value"])
@@ -617,10 +371,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
617
371
  ]);
618
372
  };
619
373
  }
620
- }), _hoisted_1$g = { class: "space-y-8" }, _hoisted_2$e = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$c = {
374
+ }), _hoisted_1$d = { class: "space-y-8" }, _hoisted_2$c = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$a = {
621
375
  key: 0,
622
376
  class: "space-y-4"
623
- }, _hoisted_4$b = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$7 = /* @__PURE__ */ createElementVNode("div", null, "Notify date", -1), _hoisted_6$4 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
377
+ }, _hoisted_4$9 = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$5 = /* @__PURE__ */ createElementVNode("div", null, "Notify date", -1), _hoisted_6$3 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
624
378
  __name: "ScheduleRuleInput",
625
379
  props: {
626
380
  modelValue: {
@@ -636,18 +390,18 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
636
390
  },
637
391
  emits: ["update:model-value"],
638
392
  setup(e, { emit: d }) {
639
- const a = e, s = d;
640
- function r() {
641
- const p = RuleBuilder.getRules(a.modelValue);
642
- return p.length == 0 ? "fixed" : p.some(
393
+ const a = e, r = d;
394
+ function u() {
395
+ const y = RuleBuilder.getRules(a.modelValue);
396
+ return y.length == 0 ? "fixed" : y.some(
643
397
  (v) => isRuleEntry(v) && RuleBuilder.simplify(v).operator == "_rrule"
644
398
  ) ? "repeating" : "fixed";
645
399
  }
646
- const u = ref(r()), o = ref(!1), l = computed(() => {
647
- const p = RuleBuilder.getRules(a.modelValue), v = p.find(
648
- (i) => isRuleEntry(i) && RuleBuilder.simplify(i).property == "trigger.date"
649
- ), h = p.find(
650
- (i) => isRuleEntry(i) && RuleBuilder.simplify(i).property == "trigger.time"
400
+ const i = ref(u()), l = ref(!1), o = computed(() => {
401
+ const y = RuleBuilder.getRules(a.modelValue), v = y.find(
402
+ (p) => isRuleEntry(p) && RuleBuilder.simplify(p).property == "trigger.date"
403
+ ), h = y.find(
404
+ (p) => isRuleEntry(p) && RuleBuilder.simplify(p).property == "trigger.time"
651
405
  );
652
406
  return {
653
407
  date: v ? RuleBuilder.simplify(v).equator : null,
@@ -661,8 +415,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
661
415
  a.endDate ? new Date(a.endDate) : void 0
662
416
  )
663
417
  );
664
- function c(p) {
665
- const v = p.label.toLowerCase(), h = v == "fixed" ? [
418
+ function c(y) {
419
+ const v = y.label.toLowerCase(), h = v == "fixed" ? [
666
420
  RuleBuilder.constructEntry(
667
421
  "trigger.date",
668
422
  "_isOnDate",
@@ -677,73 +431,73 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
677
431
  ),
678
432
  RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
679
433
  ];
680
- s(
434
+ r(
681
435
  "update:model-value",
682
436
  RuleBuilder.setRuleToGroup(
683
437
  RuleBuilder.scaffoldGroup("g_schedule"),
684
438
  h
685
439
  )
686
- ), u.value = v;
440
+ ), i.value = v;
687
441
  }
688
- function g(p) {
689
- u.value == "fixed" ? s(
442
+ function g(y) {
443
+ i.value == "fixed" ? r(
690
444
  "update:model-value",
691
445
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
692
446
  RuleBuilder.constructEntry(
693
447
  "trigger.date",
694
448
  "_isOnDate",
695
- p.date
449
+ y.date
696
450
  ),
697
451
  RuleBuilder.constructEntry(
698
452
  "trigger.time",
699
453
  "_isOnTime",
700
- p.time
454
+ y.time
701
455
  )
702
456
  ])
703
- ) : s(
457
+ ) : r(
704
458
  "update:model-value",
705
459
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
706
460
  RuleBuilder.constructEntry(
707
461
  "trigger.date",
708
462
  "_rrule",
709
- p.date
463
+ y.date
710
464
  ),
711
465
  RuleBuilder.constructEntry(
712
466
  "trigger.time",
713
467
  "_isOnTime",
714
- p.time
468
+ y.time
715
469
  )
716
470
  ])
717
471
  );
718
472
  }
719
- return (p, v) => {
720
- const h = resolveComponent("FmButtonGroup"), i = resolveComponent("FmTimePicker"), m = resolveComponent("FmIcon"), f = resolveComponent("FmTooltip"), y = resolveComponent("FmField"), C = resolveComponent("FmCard"), E = resolveComponent("FmPopover"), b = resolveComponent("FmDatePicker"), B = resolveComponent("FmHelperText");
473
+ return (y, v) => {
474
+ const h = resolveComponent("FmButtonGroup"), p = resolveComponent("FmTimePicker"), s = resolveComponent("FmIcon"), f = resolveComponent("FmTooltip"), m = resolveComponent("FmField"), b = resolveComponent("FmCard"), x = resolveComponent("FmPopover"), k = resolveComponent("FmDatePicker"), C = resolveComponent("FmHelperText");
721
475
  return openBlock(), createElementBlock(Fragment, null, [
722
476
  createVNode(h, {
723
477
  items: [{ label: "Fixed" }, { label: "Repeating" }],
724
- "model-value": { label: unref(cases).title(unref(u)) },
478
+ "model-value": { label: unref(cases).title(unref(i)) },
725
479
  "onUpdate:modelValue": c,
726
480
  class: "mb-8"
727
481
  }, null, 8, ["model-value"]),
728
- createElementVNode("div", _hoisted_1$g, [
729
- createElementVNode("div", _hoisted_2$e, [
730
- createVNode(i, {
482
+ createElementVNode("div", _hoisted_1$d, [
483
+ createElementVNode("div", _hoisted_2$c, [
484
+ createVNode(p, {
731
485
  label: "Notify time",
732
- "model-value": unref(l).time,
733
- "onUpdate:modelValue": v[0] || (v[0] = (x) => g({ date: unref(l).date, time: x })),
734
- "helper-text": unref(l).time ? void 0 : "Time is required",
735
- "helper-state": unref(l).time ? void 0 : "error"
486
+ "model-value": unref(o).time,
487
+ "onUpdate:modelValue": v[0] || (v[0] = (B) => g({ date: unref(o).date, time: B })),
488
+ "helper-text": unref(o).time ? void 0 : "Time is required",
489
+ "helper-state": unref(o).time ? void 0 : "error"
736
490
  }, null, 8, ["model-value", "helper-text", "helper-state"]),
737
- unref(u) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
738
- createElementVNode("div", _hoisted_4$b, [
739
- _hoisted_5$7,
740
- unref(l).date ? (openBlock(), createBlock(f, {
491
+ unref(i) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$a, [
492
+ createElementVNode("div", _hoisted_4$9, [
493
+ _hoisted_5$5,
494
+ unref(o).date ? (openBlock(), createBlock(f, {
741
495
  key: 0,
742
496
  "z-index": 9999,
743
- content: unref(SummarizeRrule)(unref(RRule).fromString(unref(l).date).options)
497
+ content: unref(SummarizeRrule)(unref(RRule).fromString(unref(o).date).options)
744
498
  }, {
745
499
  default: withCtx(() => [
746
- createVNode(m, {
500
+ createVNode(s, {
747
501
  name: "info",
748
502
  size: "sm",
749
503
  outline: !0
@@ -752,30 +506,30 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
752
506
  _: 1
753
507
  }, 8, ["content"])) : createCommentVNode("", !0)
754
508
  ]),
755
- createVNode(E, {
756
- "show-popover": unref(o),
757
- onPopoverChanged: v[3] || (v[3] = (x) => o.value = x)
509
+ createVNode(x, {
510
+ "show-popover": unref(l),
511
+ onPopoverChanged: v[3] || (v[3] = (B) => l.value = B)
758
512
  }, {
759
513
  "popover-button": withCtx(() => [
760
- createVNode(y, {
514
+ createVNode(m, {
761
515
  class: "cursor-pointer",
762
- "helper-text": unref(l).date ? void 0 : "Date is required",
763
- "helper-state": unref(l).date ? void 0 : "error"
516
+ "helper-text": unref(o).date ? void 0 : "Date is required",
517
+ "helper-state": unref(o).date ? void 0 : "error"
764
518
  }, {
765
519
  default: withCtx(() => [
766
- createElementVNode("div", _hoisted_6$4, toDisplayString(unref(l).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(l).date).options) : "Set a repeating date"), 1)
520
+ createElementVNode("div", _hoisted_6$3, toDisplayString(unref(o).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(o).date).options) : "Set a repeating date"), 1)
767
521
  ]),
768
522
  _: 1
769
523
  }, 8, ["helper-text", "helper-state"])
770
524
  ]),
771
525
  default: withCtx(() => [
772
- createVNode(C, { class: "elevated p-8 w-[450px]" }, {
526
+ createVNode(b, { class: "elevated p-8 w-[450px]" }, {
773
527
  default: withCtx(() => [
774
- createVNode(_sfc_main$s, {
528
+ createVNode(_sfc_main$k, {
775
529
  "apply-button": !0,
776
- "model-value": unref(l).date || "",
777
- onCancel: v[1] || (v[1] = (x) => o.value = !1),
778
- "onUpdate:modelValue": v[2] || (v[2] = (x) => (g({ date: x, time: unref(l).time }), o.value = !1))
530
+ "model-value": unref(o).date || "",
531
+ onCancel: v[1] || (v[1] = (B) => l.value = !1),
532
+ "onUpdate:modelValue": v[2] || (v[2] = (B) => (g({ date: B, time: unref(o).time }), l.value = !1))
779
533
  }, null, 8, ["model-value"])
780
534
  ]),
781
535
  _: 1
@@ -783,16 +537,16 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
783
537
  ]),
784
538
  _: 1
785
539
  }, 8, ["show-popover"])
786
- ])) : (openBlock(), createBlock(b, {
540
+ ])) : (openBlock(), createBlock(k, {
787
541
  key: 1,
788
542
  label: "Notify date",
789
- "model-value": unref(l).date || "",
790
- "onUpdate:modelValue": v[4] || (v[4] = (x) => g({ date: x, time: unref(l).time })),
791
- "helper-text": unref(l).date ? void 0 : "Date is required",
792
- "helper-state": unref(l).date ? void 0 : "error"
543
+ "model-value": unref(o).date || "",
544
+ "onUpdate:modelValue": v[4] || (v[4] = (B) => g({ date: B, time: unref(o).time })),
545
+ "helper-text": unref(o).date ? void 0 : "Date is required",
546
+ "helper-state": unref(o).date ? void 0 : "error"
793
547
  }, null, 8, ["model-value", "helper-text", "helper-state"]))
794
548
  ]),
795
- unref(l).date && unref(l).time && unref(n) ? (openBlock(), createBlock(B, {
549
+ unref(o).date && unref(o).time && unref(n) ? (openBlock(), createBlock(C, {
796
550
  key: 0,
797
551
  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
798
552
  ${unref(hooks)(unref(n)).format("hh:mmA")} (${unref(hooks)(unref(n)).fromNow()})`
@@ -801,309 +555,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
801
555
  ], 64);
802
556
  };
803
557
  }
804
- }), _hoisted_1$f = { class: "flex justify-end gap-8 w-full" }, _sfc_main$f = /* @__PURE__ */ defineComponent({
805
- __name: "MenuSheet",
806
- props: {
807
- modelValue: {},
808
- filterItems: { type: Function }
809
- },
810
- emits: ["confirm"],
811
- setup(e, { emit: d }) {
812
- const a = ref(), s = ref(!1);
813
- function r() {
814
- var o;
815
- (o = a.value) == null || o.onConfirm();
816
- }
817
- const u = d;
818
- return (o, l) => {
819
- const n = resolveComponent("FmField"), c = resolveComponent("FmButton"), g = resolveComponent("FmSideSheet");
820
- return openBlock(), createBlock(g, {
821
- modelValue: s.value,
822
- "onUpdate:modelValue": l[1] || (l[1] = (p) => s.value = p),
823
- title: "Select Items",
824
- "close-button": !1,
825
- "dismiss-away": !0,
826
- "max-width": 560
827
- }, {
828
- "side-sheet-button": withCtx(() => [
829
- renderSlot(o.$slots, "side-sheet-button", {}, () => [
830
- createVNode(n, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
831
- default: withCtx(() => [
832
- createTextVNode(toDisplayString(o.modelValue.length) + " item(s) selected ", 1)
833
- ]),
834
- _: 1
835
- })
836
- ])
837
- ]),
838
- "side-sheet-footer": withCtx(() => [
839
- createElementVNode("div", _hoisted_1$f, [
840
- createVNode(c, {
841
- variant: "tertiary",
842
- onClick: l[0] || (l[0] = (p) => s.value = !1),
843
- label: "Cancel"
844
- }),
845
- createVNode(c, {
846
- variant: "primary",
847
- onClick: r,
848
- label: "Confirm"
849
- })
850
- ])
851
- ]),
852
- default: withCtx(() => [
853
- createVNode(_sfc_main$t, {
854
- class: "h-full",
855
- "max-height": 0,
856
- ref_key: "selectItemRef",
857
- ref: a,
858
- "initial-value": o.modelValue,
859
- "filter-items": o.filterItems,
860
- "on-complete": (p) => {
861
- u("confirm", p), s.value = !1;
862
- }
863
- }, null, 8, ["initial-value", "filter-items", "on-complete"])
864
- ]),
865
- _: 3
866
- }, 8, ["modelValue"]);
867
- };
868
- }
869
- }), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$d = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$a = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$6 = { class: "space-y-16" }, _hoisted_6$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1), _hoisted_7$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1), _hoisted_8$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_9$3 = {
870
- key: 0,
871
- class: "xs:!block flex gap-16 items-center pt-8"
872
- }, _hoisted_10$3 = /* @__PURE__ */ createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1), _hoisted_11$1 = { class: "fm-typo-en-body-lg-400" }, _hoisted_12$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_13 = {
873
- key: 0,
874
- class: "pt-8 space-y-8"
875
- }, _hoisted_14 = { class: "flex items-center gap-16 xs:block xs:space-y-8 w-fit" }, _hoisted_15 = { class: "xs:!block flex gap-16 items-center" }, _hoisted_16 = /* @__PURE__ */ createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1), _sfc_main$e = /* @__PURE__ */ defineComponent({
876
- __name: "EarningOptionInput",
877
- props: {
878
- modelValue: {
879
- type: Object
880
- },
881
- extras: {
882
- type: Object
883
- },
884
- fixedType: {
885
- type: Boolean
886
- },
887
- errorText: {
888
- type: String
889
- }
890
- },
891
- emits: ["update:model-value"],
892
- setup(e, { emit: d }) {
893
- var g, p, v;
894
- const a = useBusinessStore(), s = e, r = d, u = [
895
- {
896
- label: "Based on spending",
897
- sublabel: "Customers earn rewards based on how much they spend.",
898
- value: "PROPORTIONAL"
899
- },
900
- {
901
- label: "Fixed amount",
902
- sublabel: "Customers earn a set amount of rewards for specific actions.",
903
- value: "FIXED"
904
- }
905
- ].filter((h) => {
906
- var i, m;
907
- return s.fixedType || ((m = (i = s.extras) == null ? void 0 : i.campaign) == null ? void 0 : m.event.type) != "BILL_COMPLETED" ? h.value == "FIXED" : !0;
908
- }), o = computed(() => {
909
- var i, m;
910
- const h = s.extras && "configs" in s.extras ? s.extras.configs.type : (i = s.extras) == null ? void 0 : i.campaign.type;
911
- return (((m = CollectibleOptions[h]) == null ? void 0 : m.name) || "reward").toLowerCase();
912
- }), l = computed(() => {
913
- const h = FdoEarningOption.safeParse(s.modelValue);
914
- return h.success ? [] : h.error.errors;
915
- });
916
- function n(h) {
917
- var i;
918
- h != ((i = s.modelValue) == null ? void 0 : i.type) && r(
919
- "update:model-value",
920
- h === "FIXED" ? {
921
- type: "FIXED",
922
- amount: 1
923
- } : {
924
- type: "PROPORTIONAL",
925
- amount: 1,
926
- every: 1
927
- }
928
- );
929
- }
930
- const c = ref(
931
- ((g = s.modelValue) == null ? void 0 : g.type) === "PROPORTIONAL" && !!((v = (p = s.modelValue) == null ? void 0 : p.property) != null && v.length) || !1
932
- );
933
- return (h, i) => {
934
- var x, k, N;
935
- const m = resolveComponent("FmCard"), f = resolveComponent("FmStepperField"), y = resolveComponent("FmRadio"), C = resolveComponent("FmPill"), E = resolveComponent("FmButton"), b = resolveComponent("FmRadioGroup"), B = resolveComponent("FmHelperText");
936
- return openBlock(), createElementBlock("div", _hoisted_1$e, [
937
- createElementVNode("div", _hoisted_2$d, [
938
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (V) => {
939
- var $, R;
940
- return openBlock(), createBlock(m, {
941
- variant: "outlined",
942
- class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
943
- "col-span-2": unref(u).length == 1,
944
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": (($ = e.modelValue) == null ? void 0 : $.type) === V.value,
945
- "hover:bg-fm-color-opacity-sm": ((R = e.modelValue) == null ? void 0 : R.type) != V.value
946
- }]),
947
- onClick: (S) => n(V.value),
948
- key: V.value
949
- }, {
950
- default: withCtx(() => [
951
- createElementVNode("div", _hoisted_3$b, toDisplayString(V.label), 1),
952
- createElementVNode("div", _hoisted_4$a, toDisplayString(V.sublabel), 1)
953
- ]),
954
- _: 2
955
- }, 1032, ["class", "onClick"]);
956
- }), 128))
957
- ]),
958
- createElementVNode("div", _hoisted_5$6, [
959
- ((x = e.modelValue) == null ? void 0 : x.type) === "FIXED" ? (openBlock(), createBlock(f, {
960
- key: 0,
961
- label: `Receive ${unref(o)}(s)`,
962
- class: "flex-1",
963
- "model-value": ((k = e.modelValue) == null ? void 0 : k.amount) ?? null,
964
- "onUpdate:modelValue": i[0] || (i[0] = (V) => r("update:model-value", {
965
- ...e.modelValue ?? { type: "FIXED" },
966
- amount: V
967
- }))
968
- }, null, 8, ["label", "model-value"])) : ((N = e.modelValue) == null ? void 0 : N.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
969
- _hoisted_6$3,
970
- createVNode(b, {
971
- "model-value": unref(c),
972
- "onUpdate:modelValue": i[6] || (i[6] = (V) => {
973
- unref(c) != V && (r("update:model-value", {
974
- ...e.modelValue ?? {
975
- type: "PROPORTIONAL",
976
- amount: 1,
977
- every: 1
978
- },
979
- property: V ? [] : void 0,
980
- every: 1
981
- }), c.value = V);
982
- })
983
- }, {
984
- default: withCtx(() => [
985
- createVNode(y, {
986
- label: "Amount spent",
987
- sublabel: `Receive ${unref(o)} by amount spent`,
988
- value: !1
989
- }, {
990
- label: withCtx(() => {
991
- var V, $;
992
- return [
993
- _hoisted_7$3,
994
- createElementVNode("div", _hoisted_8$3, " Receive " + toDisplayString(unref(o)) + " by amount spent ", 1),
995
- unref(c) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_9$3, [
996
- createVNode(f, {
997
- label: `Receive ${unref(o)}(s)`,
998
- inputmode: "decimal",
999
- class: "flex-1",
1000
- "model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
1001
- "onUpdate:modelValue": i[1] || (i[1] = (R) => r("update:model-value", {
1002
- ...e.modelValue ?? { type: "FIXED" },
1003
- amount: R
1004
- }))
1005
- }, null, 8, ["label", "model-value"]),
1006
- _hoisted_10$3,
1007
- createVNode(f, {
1008
- label: `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
1009
- class: "flex-1",
1010
- inputmode: "decimal",
1011
- "model-value": (($ = e.modelValue) == null ? void 0 : $.every) ?? null,
1012
- "onUpdate:modelValue": i[2] || (i[2] = (R) => r("update:model-value", {
1013
- ...e.modelValue,
1014
- every: R
1015
- }))
1016
- }, {
1017
- prepend: withCtx(() => [
1018
- createTextVNode(toDisplayString(unref(core.Config).getCountry().currency.symbol), 1)
1019
- ]),
1020
- _: 1
1021
- }, 8, ["label", "model-value"])
1022
- ]))
1023
- ];
1024
- }),
1025
- _: 1
1026
- }, 8, ["sublabel"]),
1027
- createVNode(y, {
1028
- label: "Product bought",
1029
- sublabel: `Receive ${unref(o)} by product bought`,
1030
- value: !0,
1031
- disabled: !unref(a).isPremium
1032
- }, {
1033
- label: withCtx(() => {
1034
- var V, $;
1035
- return [
1036
- createElementVNode("div", _hoisted_11$1, [
1037
- createTextVNode(" Product bought "),
1038
- createVNode(C, { variant: "premium" })
1039
- ]),
1040
- createElementVNode("div", _hoisted_12$1, " Receive " + toDisplayString(unref(o)) + " by product bought ", 1),
1041
- unref(c) ? (openBlock(), createElementBlock("div", _hoisted_13, [
1042
- createElementVNode("div", _hoisted_14, [
1043
- createVNode(_sfc_main$f, {
1044
- "model-value": s.modelValue.property || [],
1045
- onConfirm: i[3] || (i[3] = (R) => r("update:model-value", {
1046
- ...e.modelValue,
1047
- property: R
1048
- }))
1049
- }, {
1050
- "side-sheet-button": withCtx(() => {
1051
- var R, S;
1052
- return [
1053
- createVNode(E, {
1054
- label: (R = s.modelValue.property) != null && R.length ? `${(S = s.modelValue.property) == null ? void 0 : S.length} product(s) selected` : "Select product",
1055
- icon: "link",
1056
- variant: "secondary"
1057
- }, null, 8, ["label"])
1058
- ];
1059
- }),
1060
- _: 1
1061
- }, 8, ["model-value"])
1062
- ]),
1063
- createElementVNode("div", _hoisted_15, [
1064
- createVNode(f, {
1065
- inputmode: "decimal",
1066
- label: `Receive ${unref(o)}(s)`,
1067
- class: "flex-1",
1068
- "model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
1069
- "onUpdate:modelValue": i[4] || (i[4] = (R) => r("update:model-value", {
1070
- ...e.modelValue ?? { type: "FIXED" },
1071
- amount: R
1072
- }))
1073
- }, null, 8, ["label", "model-value"]),
1074
- _hoisted_16,
1075
- createVNode(f, {
1076
- label: "Item purchased",
1077
- class: "flex-1",
1078
- "model-value": (($ = e.modelValue) == null ? void 0 : $.every) ?? null,
1079
- inputmode: "numeric",
1080
- "max-fraction-digits": 0,
1081
- "onUpdate:modelValue": i[5] || (i[5] = (R) => r("update:model-value", {
1082
- ...e.modelValue,
1083
- every: R
1084
- }))
1085
- }, null, 8, ["model-value"])
1086
- ])
1087
- ])) : createCommentVNode("", !0)
1088
- ];
1089
- }),
1090
- _: 1
1091
- }, 8, ["sublabel", "disabled"])
1092
- ]),
1093
- _: 1
1094
- }, 8, ["model-value"])
1095
- ], 64)) : createCommentVNode("", !0)
1096
- ]),
1097
- e.errorText || unref(l).length > 0 ? (openBlock(), createBlock(B, {
1098
- key: 0,
1099
- class: "!mt-4",
1100
- text: e.errorText || unref(ZodHelper).helperText(unref(l), ""),
1101
- state: "error"
1102
- }, null, 8, ["text"])) : createCommentVNode("", !0)
1103
- ]);
1104
- };
1105
- }
1106
- }), _hoisted_1$d = { class: "space-y-16" }, _hoisted_2$c = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_3$a = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$9 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
558
+ }), _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$b = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_3$9 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$8 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$4 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
1107
559
  __name: "GameTypeInput",
1108
560
  props: {
1109
561
  modelValue: {
@@ -1112,7 +564,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1112
564
  },
1113
565
  emits: ["update:model-value"],
1114
566
  setup(e, { emit: d }) {
1115
- const a = e, s = d, r = computed(
567
+ const a = e, r = d, u = computed(
1116
568
  () => [
1117
569
  {
1118
570
  label: "Fortune Wheel",
@@ -1126,28 +578,28 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1126
578
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
1127
579
  hidden: !0
1128
580
  }
1129
- ].filter((u) => !u.hidden)
581
+ ].filter((i) => !i.hidden)
1130
582
  );
1131
- return (u, o) => {
1132
- const l = resolveComponent("FmCard");
1133
- return openBlock(), createElementBlock("div", _hoisted_1$d, [
1134
- _hoisted_2$c,
1135
- createElementVNode("div", _hoisted_3$a, [
1136
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (n) => (openBlock(), createBlock(l, {
583
+ return (i, l) => {
584
+ const o = resolveComponent("FmCard");
585
+ return openBlock(), createElementBlock("div", _hoisted_1$c, [
586
+ _hoisted_2$b,
587
+ createElementVNode("div", _hoisted_3$9, [
588
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
1137
589
  variant: "outlined",
1138
590
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1139
- "col-span-2": unref(r).length == 1,
591
+ "col-span-2": unref(u).length == 1,
1140
592
  "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
1141
593
  "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
1142
594
  }]),
1143
595
  onClick: () => {
1144
- a.modelValue != n.value && s("update:model-value", n.value);
596
+ a.modelValue != n.value && r("update:model-value", n.value);
1145
597
  },
1146
598
  key: n.value
1147
599
  }, {
1148
600
  default: withCtx(() => [
1149
- createElementVNode("div", _hoisted_4$9, toDisplayString(n.label), 1),
1150
- createElementVNode("div", _hoisted_5$5, toDisplayString(n.description), 1)
601
+ createElementVNode("div", _hoisted_4$8, toDisplayString(n.label), 1),
602
+ createElementVNode("div", _hoisted_5$4, toDisplayString(n.description), 1)
1151
603
  ]),
1152
604
  _: 2
1153
605
  }, 1032, ["class", "onClick"]))), 128))
@@ -1155,104 +607,6 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1155
607
  ]);
1156
608
  };
1157
609
  }
1158
- }), _hoisted_1$c = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, _hoisted_2$b = /* @__PURE__ */ createElementVNode("div", null, "Voucher description should not exceed 200 characters.", -1), _hoisted_3$9 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), _hoisted_4$8 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Usage configuration", -1), _hoisted_5$4 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), _sfc_main$c = /* @__PURE__ */ defineComponent({
1159
- __name: "VoucherEditor",
1160
- props: {
1161
- modelValue: {
1162
- type: Object
1163
- },
1164
- rewardImage: {
1165
- type: Object
1166
- }
1167
- },
1168
- emits: ["update:model-value", "update:reward-image"],
1169
- setup(e, { emit: d }) {
1170
- const { t: a } = useI18n(), r = ref(
1171
- e.modelValue ?? initCollectibleConfig("VOUCHER", {
1172
- business: useCoreStore().currentBusiness.value._id,
1173
- name: ""
1174
- })
1175
- ), u = FdtoCollectibleConfig, o = d;
1176
- return (l, n) => {
1177
- var p, v, h;
1178
- const c = resolveComponent("FmTextarea"), g = resolveComponent("FmHelperText");
1179
- return openBlock(), createElementBlock(Fragment, null, [
1180
- createVNode(_sfc_main$u, {
1181
- modelValue: unref(r).name,
1182
- "onUpdate:modelValue": n[0] || (n[0] = (i) => unref(r).name = i),
1183
- label: "Voucher name",
1184
- schema: unref(ZodHelper).typeAtPath(unref(u), "name", [unref(r).type])
1185
- }, null, 8, ["modelValue", "schema"]),
1186
- createVNode(c, {
1187
- class: "!mb-[-16px]",
1188
- modelValue: unref(r).description,
1189
- "onUpdate:modelValue": n[1] || (n[1] = (i) => unref(r).description = i),
1190
- rules: [unref(ZodHelper).ruleAtPath(unref(u), "description", [unref(r).type])]
1191
- }, {
1192
- label: withCtx(() => [
1193
- (openBlock(), createBlock(resolveDynamicComponent(
1194
- unref(ZodHelper).toInputLabel(
1195
- unref(ZodHelper).typeAtPath(unref(u), "description", [unref(r).type]),
1196
- "Voucher description"
1197
- )
1198
- )))
1199
- ]),
1200
- _: 1
1201
- }, 8, ["modelValue", "rules"]),
1202
- createElementVNode("div", _hoisted_1$c, [
1203
- _hoisted_2$b,
1204
- createElementVNode("div", null, toDisplayString(((p = unref(r).description) == null ? void 0 : p.length) ?? 0) + "/200", 1)
1205
- ]),
1206
- createVNode(_sfc_main$v, {
1207
- class: "w-1/2 xs:w-2/3",
1208
- "aspect-ratio": "16/9",
1209
- file: e.rewardImage ?? void 0,
1210
- thumbnail: unref(r).image ?? void 0,
1211
- "onUpdate:file": n[2] || (n[2] = async (i) => {
1212
- o("update:reward-image", i), i || (unref(r).image = null);
1213
- })
1214
- }, {
1215
- label: withCtx(() => [
1216
- (openBlock(), createBlock(resolveDynamicComponent(
1217
- unref(ZodHelper).toInputLabel(
1218
- unref(ZodHelper).typeAtPath(unref(u), "image", [unref(r).type]),
1219
- "Voucher image"
1220
- )
1221
- )))
1222
- ]),
1223
- _: 1
1224
- }, 8, ["file", "thumbnail"]),
1225
- _hoisted_3$9,
1226
- createVNode(_sfc_main$w, {
1227
- "model-value": unref(r).extras.effect,
1228
- "onUpdate:modelValue": n[3] || (n[3] = (i) => unref(r).extras.effect = i)
1229
- }, null, 8, ["model-value"]),
1230
- unref(r).extras.effect == null ? (openBlock(), createBlock(g, {
1231
- key: 0,
1232
- class: "!mt-8",
1233
- text: unref(a)("connect.campaign.common.effect_required"),
1234
- state: "error"
1235
- }, null, 8, ["text"])) : createCommentVNode("", !0),
1236
- _hoisted_4$8,
1237
- createVNode(_sfc_main$x, {
1238
- "model-value": unref(r).options,
1239
- "no-campaign": unref(r).noCampaign,
1240
- "onUpdate:modelValue": n[4] || (n[4] = (i) => unref(r).options = i),
1241
- schema: unref(ZodHelper).typeAtPath(unref(u), "options", ["VOUCHER"])
1242
- }, null, 8, ["model-value", "no-campaign", "schema"]),
1243
- _hoisted_5$4,
1244
- unref(r).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$y, {
1245
- key: 1,
1246
- "model-value": ((h = (v = unref(r).extras) == null ? void 0 : v.targetLocation) == null ? void 0 : h.map(String)) ?? null,
1247
- type: "select",
1248
- "onUpdate:modelValue": n[5] || (n[5] = (i) => {
1249
- unref(r).extras.targetLocation = i;
1250
- }),
1251
- rules: [unref(ZodHelper).ruleAtPath(unref(u), "extras.targetLocation")]
1252
- }, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0)
1253
- ], 64);
1254
- };
1255
- }
1256
610
  }), _hoisted_1$b = {
1257
611
  key: 0,
1258
612
  class: "flex flex-col gap-y-24"
@@ -1260,72 +614,72 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1260
614
  __name: "EditRewardPoolSheet",
1261
615
  emits: ["update:model-value"],
1262
616
  setup(e, { expose: d, emit: a }) {
1263
- const s = useMembershipStore(), { minor: r } = useLoading, u = ref(!1), o = ref(), l = ref(), n = ref(0), c = computed(() => {
1264
- var m;
1265
- return ((m = s.loyaltyRewards.items.find(
617
+ const r = useMembershipStore(), { minor: u } = useLoading, i = ref(!1), l = ref(), o = ref(), n = ref(0), c = computed(() => {
618
+ var s;
619
+ return ((s = r.loyaltyRewards.items.find(
1266
620
  (f) => {
1267
- var y;
1268
- return f.value === ((y = o.value) == null ? void 0 : y.collectible);
621
+ var m;
622
+ return f.value === ((m = l.value) == null ? void 0 : m.collectible);
1269
623
  }
1270
- )) == null ? void 0 : m.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
624
+ )) == null ? void 0 : s.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
1271
625
  }), g = computed(() => {
1272
- const i = c.value.safeParse(o.value);
1273
- return i.success ? [] : i.error.errors;
626
+ const p = c.value.safeParse(l.value);
627
+ return p.success ? [] : p.error.errors;
1274
628
  });
1275
- function p(i, m, f) {
1276
- i && (o.value = m, n.value = f), u.value = i;
629
+ function y(p, s, f) {
630
+ p && (l.value = s, n.value = f), i.value = p;
1277
631
  }
1278
632
  const v = a;
1279
633
  async function h() {
1280
- const i = c.value.safeParse(o.value);
1281
- i.success && (await r(
634
+ const p = c.value.safeParse(l.value);
635
+ p.success && (await u(
1282
636
  async () => {
1283
- i.data.type === "VOUCHER" && l.value && (i.data.collectibleConfig.image = await firebaseStorage.update(
1284
- i.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, l.value),
1285
- l.value
637
+ p.data.type === "VOUCHER" && o.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
638
+ p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, o.value),
639
+ o.value
1286
640
  ));
1287
641
  },
1288
642
  {
1289
643
  message: "Uploading reward image",
1290
644
  successMessage: "Reward image updated"
1291
645
  }
1292
- ), v("update:model-value", i.data, n.value));
646
+ ), v("update:model-value", p.data, n.value));
1293
647
  }
1294
648
  return d({
1295
- showSheet: p
1296
- }), (i, m) => {
1297
- const f = resolveComponent("FmSelect"), y = resolveComponent("FmStepperField"), C = resolveComponent("FmButton"), E = resolveComponent("FmSideSheet");
1298
- return openBlock(), createBlock(E, {
649
+ showSheet: y
650
+ }), (p, s) => {
651
+ const f = resolveComponent("FmSelect"), m = resolveComponent("FmStepperField"), b = resolveComponent("FmButton"), x = resolveComponent("FmSideSheet");
652
+ return openBlock(), createBlock(x, {
1299
653
  "max-width": 560,
1300
- modelValue: unref(u),
654
+ modelValue: unref(i),
1301
655
  "onUpdate:modelValue": [
1302
- m[9] || (m[9] = (b) => isRef(u) ? u.value = b : null),
1303
- m[10] || (m[10] = (b) => u.value = b)
656
+ s[9] || (s[9] = (k) => isRef(i) ? i.value = k : null),
657
+ s[10] || (s[10] = (k) => i.value = k)
1304
658
  ],
1305
659
  header: "Edit reward",
1306
660
  "dismiss-away": ""
1307
661
  }, {
1308
662
  "side-sheet-footer": withCtx(() => [
1309
663
  createElementVNode("div", _hoisted_4$7, [
1310
- createVNode(C, {
664
+ createVNode(b, {
1311
665
  variant: "primary",
1312
666
  type: "button",
1313
667
  disabled: unref(g).length > 0,
1314
668
  label: "Confirm",
1315
- onClick: m[7] || (m[7] = (b) => h())
669
+ onClick: s[7] || (s[7] = (k) => h())
1316
670
  }, null, 8, ["disabled"]),
1317
- createVNode(C, {
671
+ createVNode(b, {
1318
672
  variant: "secondary",
1319
673
  type: "button",
1320
674
  label: "Cancel",
1321
- onClick: m[8] || (m[8] = (b) => u.value = !1)
675
+ onClick: s[8] || (s[8] = (k) => i.value = !1)
1322
676
  })
1323
677
  ])
1324
678
  ]),
1325
679
  default: withCtx(() => {
1326
- var b, B, x;
680
+ var k, C, B;
1327
681
  return [
1328
- unref(o) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
682
+ unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
1329
683
  createVNode(f, {
1330
684
  label: "Reward Type",
1331
685
  items: [
@@ -1333,13 +687,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1333
687
  { label: "Voucher", value: "VOUCHER" },
1334
688
  { label: "Loyalty", value: "LOYALTY" }
1335
689
  ],
1336
- "model-value": unref(o).type,
1337
- "onUpdate:modelValue": m[0] || (m[0] = (k) => {
1338
- k == "NO_REWARD" ? o.value = {
690
+ "model-value": unref(l).type,
691
+ "onUpdate:modelValue": s[0] || (s[0] = (V) => {
692
+ V == "NO_REWARD" ? l.value = {
1339
693
  type: "NO_REWARD",
1340
694
  collectible: null,
1341
695
  weight: 1
1342
- } : k === "VOUCHER" ? o.value = {
696
+ } : V === "VOUCHER" ? l.value = {
1343
697
  collectible: null,
1344
698
  type: "VOUCHER",
1345
699
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1353,8 +707,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1353
707
  validForDay: 7
1354
708
  },
1355
709
  weight: 1
1356
- } : o.value = {
1357
- collectible: unref(s).loyaltyRewards.raw[0]._id,
710
+ } : l.value = {
711
+ collectible: unref(r).loyaltyRewards.raw[0]._id,
1358
712
  type: "LOYALTY",
1359
713
  earningOption: {
1360
714
  amount: 1,
@@ -1367,72 +721,73 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1367
721
  };
1368
722
  })
1369
723
  }, null, 8, ["model-value"]),
1370
- unref(o).type == "LOYALTY" ? (openBlock(), createBlock(f, {
724
+ unref(l).type == "LOYALTY" ? (openBlock(), createBlock(f, {
1371
725
  key: 0,
1372
726
  label: "Loyalty type",
1373
- rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(o).type])],
1374
- items: unref(s).loyaltyRewards.items,
1375
- "model-value": unref(o).collectible,
1376
- "onUpdate:modelValue": m[1] || (m[1] = (k) => unref(o).collectible = k)
727
+ rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(l).type])],
728
+ items: unref(r).loyaltyRewards.items,
729
+ "model-value": unref(l).collectible,
730
+ "onUpdate:modelValue": s[1] || (s[1] = (V) => unref(l).collectible = V)
1377
731
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1378
- createVNode(y, {
732
+ createVNode(m, {
1379
733
  label: "Weight",
1380
- rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(o).type])],
1381
- "model-value": unref(o).weight,
1382
- "onUpdate:modelValue": m[2] || (m[2] = (k) => o.value = {
1383
- ...unref(o),
1384
- weight: k
734
+ rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(l).type])],
735
+ "model-value": unref(l).weight,
736
+ "onUpdate:modelValue": s[2] || (s[2] = (V) => l.value = {
737
+ ...unref(l),
738
+ weight: V
1385
739
  })
1386
740
  }, null, 8, ["rules", "model-value"]),
1387
- unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1388
- ((b = unref(s).loyaltyRewards.items.find(
1389
- (k) => {
1390
- var N;
1391
- return k.value === ((N = unref(o)) == null ? void 0 : N.collectible);
741
+ unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
742
+ ((k = unref(r).loyaltyRewards.items.find(
743
+ (V) => {
744
+ var R;
745
+ return V.value === ((R = unref(l)) == null ? void 0 : R.collectible);
1392
746
  }
1393
- )) == null ? void 0 : b.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
747
+ )) == null ? void 0 : k.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1394
748
  _hoisted_2$a,
1395
- createVNode(_sfc_main$e, {
749
+ createVNode(_sfc_main$l, {
1396
750
  class: "mt-[-8px]",
1397
751
  rules: [
1398
- unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(o).type])
752
+ unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(l).type])
1399
753
  ],
1400
754
  "helper-state": unref(ZodHelper).helperState(unref(g), "earningOption"),
1401
755
  "error-text": unref(ZodHelper).helperText(unref(g), "earningOption"),
1402
756
  "fixed-type": !0,
1403
- "model-value": unref(o).earningOption,
1404
- "onUpdate:modelValue": m[3] || (m[3] = (k) => o.value = {
1405
- ...unref(o),
1406
- earningOption: k
757
+ "model-value": unref(l).earningOption,
758
+ "onUpdate:modelValue": s[3] || (s[3] = (V) => l.value = {
759
+ ...unref(l),
760
+ earningOption: V
1407
761
  })
1408
762
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"])
1409
763
  ], 64)) : createCommentVNode("", !0),
1410
764
  _hoisted_3$8,
1411
- createVNode(_sfc_main$z, {
1412
- "for-credit": unref(o).type === "LOYALTY" && ((B = unref(s).loyaltyRewards.items.find(
1413
- (k) => {
1414
- var N;
1415
- return k.value === ((N = unref(o)) == null ? void 0 : N.collectible);
765
+ createVNode(_sfc_main$m, {
766
+ type: unref(l).type === "LOYALTY" ? "custom" : "range",
767
+ "for-credit": unref(l).type === "LOYALTY" && ((C = unref(r).loyaltyRewards.items.find(
768
+ (V) => {
769
+ var R;
770
+ return V.value === ((R = unref(l)) == null ? void 0 : R.collectible);
1416
771
  }
1417
- )) == null ? void 0 : B.raw.type) === "CREDIT",
772
+ )) == null ? void 0 : C.raw.type) === "CREDIT",
1418
773
  class: "!gap-24",
1419
- rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(o).type])],
1420
- "model-value": unref(o).validityOption,
1421
- "onUpdate:modelValue": m[4] || (m[4] = (k) => o.value = {
1422
- ...unref(o),
1423
- validityOption: k
774
+ rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(l).type])],
775
+ "model-value": unref(l).validityOption,
776
+ "onUpdate:modelValue": s[4] || (s[4] = (V) => l.value = {
777
+ ...unref(l),
778
+ validityOption: V
1424
779
  })
1425
- }, null, 8, ["for-credit", "rules", "model-value"])
780
+ }, null, 8, ["type", "for-credit", "rules", "model-value"])
1426
781
  ], 64)) : createCommentVNode("", !0),
1427
- unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
782
+ unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
1428
783
  key: 2,
1429
- "reward-image": unref(l),
1430
- "model-value": ((x = unref(o)) == null ? void 0 : x.collectibleConfig) ?? void 0,
1431
- "onUpdate:modelValue": m[5] || (m[5] = (k) => o.value = {
1432
- ...unref(o),
1433
- collectibleConfig: k
784
+ "reward-image": unref(o),
785
+ "model-value": ((B = unref(l)) == null ? void 0 : B.collectibleConfig) ?? void 0,
786
+ "onUpdate:modelValue": s[5] || (s[5] = (V) => l.value = {
787
+ ...unref(l),
788
+ collectibleConfig: V
1434
789
  }),
1435
- "onUpdate:rewardImage": m[6] || (m[6] = (k) => l.value = k)
790
+ "onUpdate:rewardImage": s[6] || (s[6] = (V) => o.value = V)
1436
791
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1437
792
  createVNode(JsonViewer, { json: unref(g) }, null, 8, ["json"])
1438
793
  ])) : createCommentVNode("", !0)
@@ -1462,80 +817,80 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1462
817
  },
1463
818
  emits: ["update:model-value"],
1464
819
  setup(e, { emit: d }) {
1465
- const a = e, s = d, r = useMembershipStore(), u = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => a.modelValue ?? []), l = computed(() => {
1466
- const i = u.safeParse(o.value);
1467
- return i.success ? [] : i.error.errors;
820
+ const a = e, r = d, u = useMembershipStore(), i = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => a.modelValue ?? []), o = computed(() => {
821
+ const p = i.safeParse(l.value);
822
+ return p.success ? [] : p.error.errors;
1468
823
  }), n = ref();
1469
- function c(i, m) {
1470
- var y;
1471
- const f = [...o.value];
1472
- f[m] = i, (y = n.value) == null || y.showSheet(!1), s("update:model-value", f);
824
+ function c(p, s) {
825
+ var m;
826
+ const f = [...l.value];
827
+ f[s] = p, (m = n.value) == null || m.showSheet(!1), r("update:model-value", f);
1473
828
  }
1474
- function g(i) {
1475
- const m = i.type == "VOUCHER" ? i.collectibleConfig : r.collectibles.find(
1476
- (C) => C._id.toString() == i.collectible
1477
- ), f = CollectionUtils.formattedType((m == null ? void 0 : m.name) || ""), y = i.weight;
829
+ function g(p) {
830
+ const s = p.type == "VOUCHER" ? p.collectibleConfig : u.collectibles.find(
831
+ (b) => b._id.toString() == p.collectible
832
+ ), f = CollectionUtils.formattedType((s == null ? void 0 : s.name) || ""), m = p.weight;
1478
833
  return {
1479
834
  label: isNullOrEmpty(f) ? "NO REWARD" : f,
1480
- sublabel: `${y} (${(y / o.value.reduce((C, E) => C + E.weight, 0) * 100).toFixed(2)}%)`
835
+ sublabel: `${m} (${(m / l.value.reduce((b, x) => b + x.weight, 0) * 100).toFixed(2)}%)`
1481
836
  };
1482
837
  }
1483
- function p(i) {
838
+ function y(p) {
1484
839
  var f;
1485
- const m = [...o.value];
1486
- (f = n.value) == null || f.showSheet(!0, m[i], i);
840
+ const s = [...l.value];
841
+ (f = n.value) == null || f.showSheet(!0, s[p], p);
1487
842
  }
1488
- function v(i) {
1489
- const m = [...o.value];
1490
- m.splice(i, 1), s("update:model-value", m);
843
+ function v(p) {
844
+ const s = [...l.value];
845
+ s.splice(p, 1), r("update:model-value", s);
1491
846
  }
1492
847
  function h() {
1493
- var i;
1494
- (i = n.value) == null || i.showSheet(
848
+ var p;
849
+ (p = n.value) == null || p.showSheet(
1495
850
  !0,
1496
851
  {
1497
852
  type: "NO_REWARD",
1498
853
  collectible: null,
1499
854
  weight: 1
1500
855
  },
1501
- o.value.length
856
+ l.value.length
1502
857
  );
1503
858
  }
1504
- return (i, m) => {
1505
- const f = resolveComponent("FmButton"), y = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
859
+ return (p, s) => {
860
+ const f = resolveComponent("FmButton"), m = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
1506
861
  return openBlock(), createElementBlock("div", _hoisted_1$a, [
1507
862
  _hoisted_2$9,
1508
863
  createVNode(f, {
1509
864
  label: "Add Reward",
1510
- onClick: m[0] || (m[0] = (E) => h()),
865
+ onClick: s[0] || (s[0] = (x) => h()),
1511
866
  variant: "plain",
1512
867
  icon: "add"
1513
868
  }),
1514
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (E, b) => (openBlock(), createBlock(y, {
1515
- key: b,
869
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (x, k) => (openBlock(), createBlock(m, {
870
+ key: k,
1516
871
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
1517
872
  variant: "outlined",
1518
- onClick: (B) => p(b)
873
+ onClick: (C) => y(k)
1519
874
  }, {
1520
875
  default: withCtx(() => {
1521
- var B;
876
+ var C;
1522
877
  return [
1523
878
  createElementVNode("div", null, [
1524
- createElementVNode("div", _hoisted_3$7, toDisplayString(E.type == "LOYALTY" ? (B = E == null ? void 0 : E.earningOption) == null ? void 0 : B.amount : "") + " " + toDisplayString(g(E).label), 1),
1525
- createElementVNode("div", _hoisted_4$6, toDisplayString(g(E).sublabel), 1)
879
+ createElementVNode("div", _hoisted_3$7, toDisplayString(x.type == "LOYALTY" ? (C = x == null ? void 0 : x.earningOption) == null ? void 0 : C.amount : "") + " " + toDisplayString(g(x).label), 1),
880
+ createElementVNode("div", _hoisted_4$6, toDisplayString(g(x).sublabel), 1)
1526
881
  ]),
1527
882
  createVNode(f, {
1528
883
  icon: "delete",
1529
884
  variant: "tertiary",
1530
- onClick: (x) => (x.stopPropagation(), v(b))
885
+ onClick: (B) => (B.stopPropagation(), v(k))
1531
886
  }, null, 8, ["onClick"])
1532
887
  ];
1533
888
  }),
1534
889
  _: 2
1535
890
  }, 1032, ["onClick"]))), 128)),
1536
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((E) => E.path.join(".") == ""), (E) => (openBlock(), createBlock(C, {
1537
- key: E.message,
1538
- text: E.message,
891
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((x) => x.path.join(".") == ""), (x) => (openBlock(), createBlock(b, {
892
+ key: x.message,
893
+ text: x.message,
1539
894
  state: "error"
1540
895
  }, null, 8, ["text"]))), 128)),
1541
896
  createVNode(_sfc_main$b, {
@@ -1558,35 +913,35 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1558
913
  },
1559
914
  emits: ["update:model-value"],
1560
915
  setup(e, { emit: d }) {
1561
- const a = e, s = d, r = computed(() => [
916
+ const a = e, r = d, u = computed(() => [
1562
917
  {
1563
918
  label: "Rock paper scissor",
1564
919
  description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
1565
920
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
1566
921
  }
1567
922
  ]);
1568
- return (u, o) => {
1569
- var g, p, v;
1570
- const l = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), c = resolveComponent("FmHelperText");
923
+ return (i, l) => {
924
+ var g, y, v;
925
+ const o = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), c = resolveComponent("FmHelperText");
1571
926
  return openBlock(), createElementBlock("div", _hoisted_1$9, [
1572
- createVNode(l, {
927
+ createVNode(o, {
1573
928
  label: "Enable game",
1574
929
  "model-value": !!((g = e.modelValue) != null && g.gameType),
1575
- "onUpdate:modelValue": o[0] || (o[0] = (h) => h ? s("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : s("update:model-value", null))
930
+ "onUpdate:modelValue": l[0] || (l[0] = (h) => h ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
1576
931
  }, null, 8, ["model-value"]),
1577
- ((p = e.modelValue) == null ? void 0 : p.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
1578
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (h) => {
1579
- var i, m;
932
+ ((y = e.modelValue) == null ? void 0 : y.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
933
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (h) => {
934
+ var p, s;
1580
935
  return openBlock(), createBlock(n, {
1581
936
  variant: "outlined",
1582
937
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1583
- "col-span-2": unref(r).length == 1,
1584
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((i = e.modelValue) == null ? void 0 : i.gameType) == h.value,
1585
- "hover:bg-fm-color-opacity-sm": ((m = e.modelValue) == null ? void 0 : m.gameType) != h.value
938
+ "col-span-2": unref(u).length == 1,
939
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((p = e.modelValue) == null ? void 0 : p.gameType) == h.value,
940
+ "hover:bg-fm-color-opacity-sm": ((s = e.modelValue) == null ? void 0 : s.gameType) != h.value
1586
941
  }]),
1587
942
  onClick: () => {
1588
943
  var f;
1589
- ((f = a.modelValue) == null ? void 0 : f.gameType) != h.value && s("update:model-value", { gameType: h.value });
944
+ ((f = a.modelValue) == null ? void 0 : f.gameType) != h.value && r("update:model-value", { gameType: h.value });
1590
945
  },
1591
946
  key: h.value
1592
947
  }, {
@@ -1615,7 +970,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1615
970
  },
1616
971
  emits: ["update:model-value"],
1617
972
  setup(e, { emit: d }) {
1618
- const a = e, s = d, r = computed(() => [
973
+ const a = e, r = d, u = computed(() => [
1619
974
  {
1620
975
  label: "Stamp",
1621
976
  description: "Award stamps for purchases, redeemable after reaching set milestones.",
@@ -1627,20 +982,20 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1627
982
  value: F_MISSION_TYPE.enum.PROGRESSIVE
1628
983
  }
1629
984
  ]);
1630
- return (u, o) => {
1631
- const l = resolveComponent("FmCard");
985
+ return (i, l) => {
986
+ const o = resolveComponent("FmCard");
1632
987
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
1633
988
  _hoisted_2$7,
1634
989
  createElementVNode("div", _hoisted_3$5, [
1635
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (n) => (openBlock(), createBlock(l, {
990
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
1636
991
  variant: "outlined",
1637
992
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1638
- "col-span-2": unref(r).length == 1,
993
+ "col-span-2": unref(u).length == 1,
1639
994
  "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
1640
995
  "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
1641
996
  }]),
1642
997
  onClick: () => {
1643
- a.modelValue != n.value && s("update:model-value", n.value);
998
+ a.modelValue != n.value && r("update:model-value", n.value);
1644
999
  },
1645
1000
  key: n.value
1646
1001
  }, {
@@ -1670,14 +1025,14 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1670
1025
  emits: ["update:model-value"],
1671
1026
  setup(e, { emit: d }) {
1672
1027
  const a = d;
1673
- return (s, r) => {
1674
- const u = resolveComponent("FmStepperField");
1028
+ return (r, u) => {
1029
+ const i = resolveComponent("FmStepperField");
1675
1030
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
1676
1031
  _hoisted_2$6,
1677
- createVNode(u, {
1032
+ createVNode(i, {
1678
1033
  label: "Maximum to collect",
1679
1034
  "model-value": e.modelValue || null,
1680
- "onUpdate:modelValue": r[0] || (r[0] = (o) => a("update:model-value", o)),
1035
+ "onUpdate:modelValue": u[0] || (u[0] = (l) => a("update:model-value", l)),
1681
1036
  "helper-text": e.helperText || "Set the threshold required for reward eligibility",
1682
1037
  "helper-state": e.helperState || "none"
1683
1038
  }, null, 8, ["model-value", "helper-text", "helper-state"])
@@ -1694,18 +1049,25 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1694
1049
  },
1695
1050
  emits: ["update:model-value"],
1696
1051
  setup(e, { expose: d, emit: a }) {
1697
- const s = e, r = useMembershipStore(), { minor: u } = useLoading, o = ref(!1), l = ref(), n = ref(), c = ref(0), g = FdtoThresholdReward, p = computed(() => {
1698
- const f = g.safeParse(l.value);
1052
+ const r = e, u = useMembershipStore(), { minor: i } = useLoading, l = ref(!1), o = ref(), n = ref(), c = ref(0), g = computed(() => {
1053
+ var m;
1054
+ return ((m = u.loyaltyRewards.items.find(
1055
+ (b) => {
1056
+ var x;
1057
+ return b.value === ((x = o.value) == null ? void 0 : x.collectible);
1058
+ }
1059
+ )) == null ? void 0 : m.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
1060
+ }), y = computed(() => {
1061
+ const f = g.value.safeParse(o.value);
1699
1062
  return f.success ? [] : f.error.errors;
1700
1063
  });
1701
- function v(f, y, C) {
1702
- f && (l.value = y, c.value = C), o.value = f;
1064
+ function v(f, m, b) {
1065
+ f && (o.value = m, c.value = b), l.value = f;
1703
1066
  }
1704
1067
  const h = a;
1705
- async function i() {
1706
- console.log(l.value);
1707
- const f = g.safeParse(l.value);
1708
- f.success && (await u(
1068
+ async function p() {
1069
+ const f = g.value.safeParse(o.value);
1070
+ f.success && (await i(
1709
1071
  async () => {
1710
1072
  f.data.type === "VOUCHER" && n.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
1711
1073
  f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
@@ -1718,78 +1080,80 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1718
1080
  }
1719
1081
  ), h("update:model-value", f.data, c.value));
1720
1082
  }
1721
- const m = ref();
1083
+ const s = ref();
1722
1084
  return d({
1723
1085
  showSheet: v
1724
- }), (f, y) => {
1725
- const C = resolveComponent("FmStepperField"), E = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), B = resolveComponent("FmButton"), x = resolveComponent("FmSideSheet");
1726
- return openBlock(), createBlock(x, {
1086
+ }), (f, m) => {
1087
+ const b = resolveComponent("FmStepperField"), x = resolveComponent("FmSelect"), k = resolveComponent("FmForm"), C = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
1088
+ return openBlock(), createBlock(B, {
1727
1089
  "max-width": 560,
1728
- modelValue: unref(o),
1090
+ modelValue: unref(l),
1729
1091
  "onUpdate:modelValue": [
1730
- y[10] || (y[10] = (k) => isRef(o) ? o.value = k : null),
1731
- y[11] || (y[11] = (k) => o.value = k)
1092
+ m[10] || (m[10] = (V) => isRef(l) ? l.value = V : null),
1093
+ m[11] || (m[11] = (V) => l.value = V)
1732
1094
  ],
1733
1095
  header: "Edit reward",
1734
1096
  "dismiss-away": ""
1735
1097
  }, {
1736
1098
  "side-sheet-footer": withCtx(() => [
1737
1099
  createElementVNode("div", _hoisted_2$5, [
1738
- createVNode(B, {
1100
+ createVNode(C, {
1739
1101
  variant: "primary",
1740
1102
  type: "button",
1741
1103
  label: "Confirm",
1742
- onClick: y[8] || (y[8] = async () => {
1743
- var k;
1744
- return (k = unref(m)) == null ? void 0 : k.validateInputs();
1104
+ disabled: unref(y).length > 0,
1105
+ onClick: m[8] || (m[8] = async () => {
1106
+ var V;
1107
+ return (V = unref(s)) == null ? void 0 : V.validateInputs();
1745
1108
  })
1746
- }),
1747
- createVNode(B, {
1109
+ }, null, 8, ["disabled"]),
1110
+ createVNode(C, {
1748
1111
  variant: "secondary",
1749
1112
  type: "button",
1750
1113
  label: "Cancel",
1751
- onClick: y[9] || (y[9] = (k) => o.value = !1)
1114
+ onClick: m[9] || (m[9] = (V) => l.value = !1)
1752
1115
  })
1753
1116
  ])
1754
1117
  ]),
1755
1118
  default: withCtx(() => [
1756
- unref(l) ? (openBlock(), createBlock(b, {
1119
+ createVNode(JsonViewer, { json: unref(o) }, null, 8, ["json"]),
1120
+ unref(o) ? (openBlock(), createBlock(k, {
1757
1121
  key: 0,
1758
1122
  class: "flex flex-col gap-y-24",
1759
1123
  ref_key: "formRef",
1760
- ref: m,
1761
- onValidationSuccess: y[7] || (y[7] = (k) => i())
1124
+ ref: s,
1125
+ onValidationSuccess: m[7] || (m[7] = (V) => p())
1762
1126
  }, {
1763
1127
  default: withCtx(() => {
1764
- var k, N;
1128
+ var V, R;
1765
1129
  return [
1766
- unref(l).type ? (openBlock(), createBlock(C, {
1130
+ unref(o).type ? (openBlock(), createBlock(b, {
1767
1131
  key: 0,
1768
1132
  label: "Threshold",
1769
1133
  rules: [
1770
1134
  unref(ZodHelper).toRule(
1771
1135
  unref(z).number().min(1).max(
1772
- s.maxThreshold,
1773
- `Number cannot be more than ${s.maxThreshold}`
1136
+ r.maxThreshold,
1137
+ `Number cannot be more than ${r.maxThreshold}`
1774
1138
  )
1775
1139
  )
1776
1140
  ],
1777
- "model-value": unref(l).threshold,
1778
- "onUpdate:modelValue": y[0] || (y[0] = (V) => l.value = {
1779
- ...unref(l),
1780
- threshold: V
1141
+ "model-value": unref(o).threshold,
1142
+ "onUpdate:modelValue": m[0] || (m[0] = (E) => o.value = {
1143
+ ...unref(o),
1144
+ threshold: E
1781
1145
  })
1782
1146
  }, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
1783
- createVNode(E, {
1147
+ createVNode(x, {
1784
1148
  label: "Reward Type",
1785
1149
  items: [
1786
1150
  { label: "Voucher", value: "VOUCHER" },
1787
1151
  { label: "Loyalty", value: "LOYALTY" }
1788
1152
  ],
1789
- "model-value": unref(l).type,
1790
- "onUpdate:modelValue": y[1] || (y[1] = (V) => {
1791
- var $, R;
1792
- V === "VOUCHER" ? l.value = {
1153
+ "model-value": unref(o).type,
1154
+ "onUpdate:modelValue": m[1] || (m[1] = (E) => {
1155
+ var S, $;
1156
+ E === "VOUCHER" ? o.value = {
1793
1157
  collectible: null,
1794
1158
  type: "VOUCHER",
1795
1159
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1802,9 +1166,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1802
1166
  validityOption: {
1803
1167
  validForDay: 7
1804
1168
  },
1805
- threshold: ($ = unref(l)) == null ? void 0 : $.threshold
1806
- } : l.value = {
1807
- collectible: unref(r).loyaltyRewards.raw[0]._id,
1169
+ threshold: (S = unref(o)) == null ? void 0 : S.threshold
1170
+ } : o.value = {
1171
+ collectible: unref(u).loyaltyRewards.raw[0]._id,
1808
1172
  type: "LOYALTY",
1809
1173
  earningOption: {
1810
1174
  amount: 1,
@@ -1813,59 +1177,60 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1813
1177
  validityOption: {
1814
1178
  validForDay: 7
1815
1179
  },
1816
- threshold: (R = unref(l)) == null ? void 0 : R.threshold
1180
+ threshold: ($ = unref(o)) == null ? void 0 : $.threshold
1817
1181
  };
1818
1182
  })
1819
1183
  }, null, 8, ["model-value"]),
1820
- unref(l).type == "LOYALTY" ? (openBlock(), createBlock(E, {
1184
+ unref(o).type == "LOYALTY" ? (openBlock(), createBlock(x, {
1821
1185
  key: 1,
1822
1186
  label: "Loyalty type",
1823
- rules: [unref(ZodHelper).ruleAtPath(unref(g), "collectible", [unref(l).type])],
1824
- items: unref(r).loyaltyRewards.items,
1825
- "model-value": unref(l).collectible,
1826
- "onUpdate:modelValue": y[2] || (y[2] = (V) => unref(l).collectible = V)
1187
+ rules: [unref(ZodHelper).ruleAtPath(unref(g), "collectible", [unref(o).type])],
1188
+ items: unref(u).loyaltyRewards.items,
1189
+ "model-value": unref(o).collectible,
1190
+ "onUpdate:modelValue": m[2] || (m[2] = (E) => unref(o).collectible = E)
1827
1191
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1828
- unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1192
+ unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1829
1193
  _hoisted_1$6,
1830
- createVNode(_sfc_main$e, {
1194
+ createVNode(_sfc_main$l, {
1831
1195
  class: "mt-[-8px]",
1832
- rules: [unref(ZodHelper).ruleAtPath(unref(g), "earningOption", [unref(l).type])],
1833
- "helper-state": unref(ZodHelper).helperState(unref(p), "earningOption"),
1834
- "error-text": unref(ZodHelper).helperText(unref(p), "earningOption"),
1196
+ rules: [unref(ZodHelper).ruleAtPath(unref(g), "earningOption", [unref(o).type])],
1197
+ "helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
1198
+ "error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
1835
1199
  "fixed-type": !0,
1836
- "model-value": unref(l).earningOption,
1837
- "onUpdate:modelValue": y[3] || (y[3] = (V) => l.value = {
1838
- ...unref(l),
1839
- earningOption: V
1200
+ "model-value": unref(o).earningOption,
1201
+ "onUpdate:modelValue": m[3] || (m[3] = (E) => o.value = {
1202
+ ...unref(o),
1203
+ earningOption: E
1840
1204
  })
1841
1205
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
1842
- createVNode(_sfc_main$z, {
1206
+ createVNode(_sfc_main$m, {
1843
1207
  class: "!gap-24",
1844
- "for-credit": unref(l).type === "LOYALTY" && ((k = unref(r).loyaltyRewards.items.find(
1845
- (V) => {
1846
- var $;
1847
- return V.value === (($ = unref(l)) == null ? void 0 : $.collectible);
1208
+ type: unref(o).type === "LOYALTY" ? "custom" : "range",
1209
+ "for-credit": unref(o).type === "LOYALTY" && ((V = unref(u).loyaltyRewards.items.find(
1210
+ (E) => {
1211
+ var S;
1212
+ return E.value === ((S = unref(o)) == null ? void 0 : S.collectible);
1848
1213
  }
1849
- )) == null ? void 0 : k.raw.type) === "CREDIT",
1850
- rules: [unref(ZodHelper).ruleAtPath(unref(g), "validityOption", [unref(l).type])],
1851
- "model-value": unref(l).validityOption,
1852
- "onUpdate:modelValue": y[4] || (y[4] = (V) => l.value = {
1853
- ...unref(l),
1854
- validityOption: V
1214
+ )) == null ? void 0 : V.raw.type) === "CREDIT",
1215
+ rules: [unref(ZodHelper).ruleAtPath(unref(g), "validityOption", [unref(o).type])],
1216
+ "model-value": unref(o).validityOption,
1217
+ "onUpdate:modelValue": m[4] || (m[4] = (E) => o.value = {
1218
+ ...unref(o),
1219
+ validityOption: E
1855
1220
  })
1856
- }, null, 8, ["for-credit", "rules", "model-value"])
1221
+ }, null, 8, ["type", "for-credit", "rules", "model-value"])
1857
1222
  ], 64)) : createCommentVNode("", !0),
1858
- unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1223
+ unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
1859
1224
  key: 3,
1860
1225
  "reward-image": unref(n),
1861
- "model-value": ((N = unref(l)) == null ? void 0 : N.collectibleConfig) ?? void 0,
1862
- "onUpdate:modelValue": y[5] || (y[5] = (V) => l.value = {
1863
- ...unref(l),
1864
- collectibleConfig: V
1226
+ "model-value": ((R = unref(o)) == null ? void 0 : R.collectibleConfig) ?? void 0,
1227
+ "onUpdate:modelValue": m[5] || (m[5] = (E) => o.value = {
1228
+ ...unref(o),
1229
+ collectibleConfig: E
1865
1230
  }),
1866
- "onUpdate:rewardImage": y[6] || (y[6] = (V) => n.value = V)
1231
+ "onUpdate:rewardImage": m[6] || (m[6] = (E) => n.value = E)
1867
1232
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1868
- createVNode(JsonViewer, { json: unref(p) }, null, 8, ["json"])
1233
+ createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
1869
1234
  ];
1870
1235
  }),
1871
1236
  _: 1
@@ -1899,19 +1264,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1899
1264
  }
1900
1265
  },
1901
1266
  setup(e) {
1902
- const d = e, { maxRange: a, currentRange: s, markers: r } = toRefs(d), u = computed(
1903
- () => Math.min(s.value / a.value * 100, 100)
1904
- ), o = (l) => l / a.value * 100;
1905
- return (l, n) => {
1267
+ const d = e, { maxRange: a, currentRange: r, markers: u } = toRefs(d), i = computed(
1268
+ () => Math.min(r.value / a.value * 100, 100)
1269
+ ), l = (o) => o / a.value * 100;
1270
+ return (o, n) => {
1906
1271
  const c = resolveComponent("FmIcon");
1907
1272
  return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
1908
1273
  (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (g) => (openBlock(), createBlock(c, {
1909
1274
  class: normalizeClass(
1910
- unref(s) >= g ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1275
+ unref(r) >= g ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1911
1276
  ),
1912
- outline: unref(s) < g,
1277
+ outline: unref(r) < g,
1913
1278
  key: g,
1914
- name: unref(r).some((p) => p === g) ? "featured_seasonal_and_gifts" : "check_circle"
1279
+ name: unref(u).some((y) => y === g) ? "featured_seasonal_and_gifts" : "check_circle"
1915
1280
  }, null, 8, ["class", "outline", "name"]))), 128))
1916
1281
  ])) : (openBlock(), createElementBlock("div", {
1917
1282
  key: 1,
@@ -1919,12 +1284,12 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1919
1284
  }, [
1920
1285
  createElementVNode("div", {
1921
1286
  class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
1922
- style: normalizeStyle({ width: unref(u) + "%" })
1287
+ style: normalizeStyle({ width: unref(i) + "%" })
1923
1288
  }, null, 4),
1924
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (g, p) => (openBlock(), createElementBlock("div", {
1925
- key: p,
1289
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (g, y) => (openBlock(), createElementBlock("div", {
1290
+ key: y,
1926
1291
  class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
1927
- style: normalizeStyle({ left: o(g) + "%" })
1292
+ style: normalizeStyle({ left: l(g) + "%" })
1928
1293
  }, [
1929
1294
  createElementVNode("div", _hoisted_2$4, [
1930
1295
  createElementVNode("div", {
@@ -1938,16 +1303,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1938
1303
  }
1939
1304
  }), isObject = (e) => e !== null && typeof e == "object";
1940
1305
  function changeKeysFactory(e) {
1941
- return function d(a, s = 1, r) {
1942
- if (s === 0 || !isObject(a))
1306
+ return function d(a, r = 1, u) {
1307
+ if (r === 0 || !isObject(a))
1943
1308
  return a;
1944
1309
  if (Array.isArray(a))
1945
- return a.map((o) => d(o, s - 1, r));
1946
- const u = Object.create(Object.getPrototypeOf(a));
1947
- return Object.keys(a).forEach((o) => {
1948
- const l = a[o], n = e(o, r), c = d(l, s - 1, r);
1949
- u[n] = c;
1950
- }), u;
1310
+ return a.map((l) => d(l, r - 1, u));
1311
+ const i = Object.create(Object.getPrototypeOf(a));
1312
+ return Object.keys(a).forEach((l) => {
1313
+ const o = a[l], n = e(l, u), c = d(o, r - 1, u);
1314
+ i[n] = c;
1315
+ }), i;
1951
1316
  };
1952
1317
  }
1953
1318
  const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1), _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1), _hoisted_6$2 = { class: "flex items-center gap-4" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1), _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
@@ -1964,42 +1329,42 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1964
1329
  },
1965
1330
  emits: ["update:model-value"],
1966
1331
  setup(e, { emit: d }) {
1967
- const a = e, s = d, r = useMembershipStore(), u = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
1968
- () => a.modelValue.sort((m, f) => m.threshold - f.threshold) ?? []
1969
- ), l = computed(() => {
1970
- const m = u.safeParse(o.value);
1971
- return m.success ? [] : m.error.errors;
1332
+ const a = e, r = d, u = useMembershipStore(), i = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
1333
+ () => a.modelValue.sort((s, f) => s.threshold - f.threshold) ?? []
1334
+ ), o = computed(() => {
1335
+ const s = i.safeParse(l.value);
1336
+ return s.success ? [] : s.error.errors;
1972
1337
  }), n = ref();
1973
- function c(m, f) {
1974
- var C;
1975
- const y = [...o.value];
1976
- y[f] = m, (C = n.value) == null || C.showSheet(!1), s("update:model-value", y);
1338
+ function c(s, f) {
1339
+ var b;
1340
+ const m = [...l.value];
1341
+ m[f] = s, (b = n.value) == null || b.showSheet(!1), r("update:model-value", m);
1977
1342
  }
1978
- function g(m) {
1979
- const f = m.type == "VOUCHER" ? m.collectibleConfig : r.collectibles.find(
1980
- (C) => C._id.toString() == m.collectible
1981
- ), y = CollectionUtils.formattedType((f == null ? void 0 : f.name) || "");
1343
+ function g(s) {
1344
+ const f = s.type == "VOUCHER" ? s.collectibleConfig : u.collectibles.find(
1345
+ (b) => b._id.toString() == s.collectible
1346
+ ), m = CollectionUtils.formattedType((f == null ? void 0 : f.name) || "");
1982
1347
  return {
1983
- label: isNullOrEmpty(y) ? "NO REWARD" : y,
1984
- sublabel: `Reward at ${m.threshold} | Amount: ${m.earningOption.type == "FIXED" ? m.earningOption.amount : `${m.earningOption.amount} for every RM${m.earningOption.every} spent`} `
1348
+ label: isNullOrEmpty(m) ? "NO REWARD" : m,
1349
+ sublabel: `Reward at ${s.threshold} | Amount: ${s.earningOption.type == "FIXED" ? s.earningOption.amount : `${s.earningOption.amount} for every RM${s.earningOption.every} spent`} `
1985
1350
  };
1986
1351
  }
1987
- function p(m) {
1988
- var y;
1989
- const f = [...o.value];
1990
- (y = n.value) == null || y.showSheet(!0, f[m], m);
1352
+ function y(s) {
1353
+ var m;
1354
+ const f = [...l.value];
1355
+ (m = n.value) == null || m.showSheet(!0, f[s], s);
1991
1356
  }
1992
- function v(m) {
1993
- const f = [...o.value];
1994
- f.splice(m, 1), s("update:model-value", f);
1357
+ function v(s) {
1358
+ const f = [...l.value];
1359
+ f.splice(s, 1), r("update:model-value", f);
1995
1360
  }
1996
1361
  function h() {
1997
- var m;
1998
- (m = n.value) == null || m.showSheet(
1362
+ var s;
1363
+ (s = n.value) == null || s.showSheet(
1999
1364
  !0,
2000
1365
  {
2001
1366
  type: "LOYALTY",
2002
- collectible: r.loyaltyRewards.items[0].value,
1367
+ collectible: u.loyaltyRewards.items[0].value,
2003
1368
  threshold: null,
2004
1369
  validityOption: {
2005
1370
  validForDay: 7
@@ -2009,63 +1374,63 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2009
1374
  amount: 1
2010
1375
  }
2011
1376
  },
2012
- o.value.length
1377
+ l.value.length
2013
1378
  );
2014
1379
  }
2015
- function i(m) {
2016
- var f, y;
2017
- return m.type == "VOUCHER" ? (f = m.collectibleConfig) == null ? void 0 : f.name : sentenceCase(
2018
- ((y = r.loyaltyRewards.items.find(
2019
- (C) => C.value == m.collectible
2020
- )) == null ? void 0 : y.label) || ""
1380
+ function p(s) {
1381
+ var f, m;
1382
+ return s.type == "VOUCHER" ? (f = s.collectibleConfig) == null ? void 0 : f.name : sentenceCase(
1383
+ ((m = u.loyaltyRewards.items.find(
1384
+ (b) => b.value == s.collectible
1385
+ )) == null ? void 0 : m.label) || ""
2021
1386
  );
2022
1387
  }
2023
- return (m, f) => {
2024
- const y = resolveComponent("FmButton"), C = resolveComponent("FmCard"), E = resolveComponent("FmHelperText");
1388
+ return (s, f) => {
1389
+ const m = resolveComponent("FmButton"), b = resolveComponent("FmCard"), x = resolveComponent("FmHelperText");
2025
1390
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
2026
1391
  _hoisted_2$3,
2027
- createVNode(y, {
1392
+ createVNode(m, {
2028
1393
  label: "Add Reward",
2029
- onClick: f[0] || (f[0] = (b) => h()),
1394
+ onClick: f[0] || (f[0] = (k) => h()),
2030
1395
  variant: "plain",
2031
1396
  icon: "add"
2032
1397
  }),
2033
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (b, B) => (openBlock(), createBlock(C, {
2034
- key: B,
1398
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (k, C) => (openBlock(), createBlock(b, {
1399
+ key: C,
2035
1400
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
2036
1401
  variant: "outlined",
2037
- onClick: (x) => p(B)
1402
+ onClick: (B) => y(C)
2038
1403
  }, {
2039
1404
  default: withCtx(() => [
2040
1405
  createElementVNode("div", null, [
2041
- createElementVNode("div", _hoisted_3$3, toDisplayString(g(b).label), 1),
2042
- createElementVNode("div", _hoisted_4$3, toDisplayString(g(b).sublabel), 1)
1406
+ createElementVNode("div", _hoisted_3$3, toDisplayString(g(k).label), 1),
1407
+ createElementVNode("div", _hoisted_4$3, toDisplayString(g(k).sublabel), 1)
2043
1408
  ]),
2044
- createVNode(y, {
1409
+ createVNode(m, {
2045
1410
  icon: "delete",
2046
1411
  variant: "tertiary",
2047
- onClick: (x) => (x.stopPropagation(), v(B))
1412
+ onClick: (B) => (B.stopPropagation(), v(C))
2048
1413
  }, null, 8, ["onClick"])
2049
1414
  ]),
2050
1415
  _: 2
2051
1416
  }, 1032, ["onClick"]))), 128)),
2052
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((b) => b.path.join(".") == ""), (b) => (openBlock(), createBlock(E, {
2053
- key: b.message,
2054
- text: b.message,
1417
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((k) => k.path.join(".") == ""), (k) => (openBlock(), createBlock(x, {
1418
+ key: k.message,
1419
+ text: k.message,
2055
1420
  state: "error"
2056
1421
  }, null, 8, ["text"]))), 128)),
2057
1422
  _hoisted_5$2,
2058
- (openBlock(), createBlock(C, {
1423
+ (openBlock(), createBlock(b, {
2059
1424
  key: 0,
2060
1425
  variant: "outlined",
2061
1426
  class: "p-24 space-y-16 w-fit"
2062
1427
  }, {
2063
1428
  default: withCtx(() => {
2064
- var b, B;
1429
+ var k, C;
2065
1430
  return [
2066
1431
  createElementVNode("div", _hoisted_6$2, [
2067
1432
  createElementVNode("div", null, [
2068
- createElementVNode("div", _hoisted_7$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((b = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : b.earningOption.amount) > 1 ? (B = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : B.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? i(e.modelValue[e.modelValue.length - 1]) : ""), 1),
1433
+ createElementVNode("div", _hoisted_7$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((k = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : k.earningOption.amount) > 1 ? (C = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : C.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? p(e.modelValue[e.modelValue.length - 1]) : ""), 1),
2069
1434
  _hoisted_8$2
2070
1435
  ])
2071
1436
  ]),
@@ -2074,7 +1439,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2074
1439
  type: e.mission.type,
2075
1440
  "max-range": e.mission.end,
2076
1441
  currentRange: e.mission.end / 4,
2077
- markers: e.modelValue.map((x) => x.threshold)
1442
+ markers: e.modelValue.map((B) => B.threshold)
2078
1443
  }, null, 8, ["type", "max-range", "currentRange", "markers"]),
2079
1444
  e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
2080
1445
  ])
@@ -2098,10 +1463,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2098
1463
  },
2099
1464
  emits: ["update:model-value"],
2100
1465
  setup(e, { emit: d }) {
2101
- const a = e, s = computed(() => {
2102
- const o = FdoMission.safeParse(a.modelValue);
2103
- return o.success ? [] : o.error.errors;
2104
- }), r = computed(() => [
1466
+ const a = e, r = computed(() => {
1467
+ const l = FdoMission.safeParse(a.modelValue);
1468
+ return l.success ? [] : l.error.errors;
1469
+ }), u = computed(() => [
2105
1470
  {
2106
1471
  label: "Stamp",
2107
1472
  description: "Award stamps for purchases, redeemable after reaching set milestones.",
@@ -2112,8 +1477,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2112
1477
  description: "Reward customers when they reach a cumulative spending goal.",
2113
1478
  value: F_MISSION_TYPE.enum.PROGRESSIVE
2114
1479
  }
2115
- ]), u = d;
2116
- return (o, l) => {
1480
+ ]), i = d;
1481
+ return (l, o) => {
2117
1482
  var g;
2118
1483
  const n = resolveComponent("FmCard"), c = resolveComponent("FmStepperField");
2119
1484
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
@@ -2121,28 +1486,28 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2121
1486
  _hoisted_3$2,
2122
1487
  _hoisted_4$2,
2123
1488
  createElementVNode("div", _hoisted_5$1, [
2124
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (p) => {
1489
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (y) => {
2125
1490
  var v, h;
2126
1491
  return openBlock(), createBlock(n, {
2127
1492
  variant: "outlined",
2128
1493
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
2129
- "col-span-2": unref(r).length == 1,
2130
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((v = e.modelValue) == null ? void 0 : v.type) == p.value,
2131
- "hover:bg-fm-color-opacity-sm": ((h = e.modelValue) == null ? void 0 : h.type) != p.value
1494
+ "col-span-2": unref(u).length == 1,
1495
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((v = e.modelValue) == null ? void 0 : v.type) == y.value,
1496
+ "hover:bg-fm-color-opacity-sm": ((h = e.modelValue) == null ? void 0 : h.type) != y.value
2132
1497
  }]),
2133
1498
  onClick: () => {
2134
- var i, m;
2135
- ((i = e.modelValue) == null ? void 0 : i.type) != p.value && u("update:model-value", {
1499
+ var p, s;
1500
+ ((p = e.modelValue) == null ? void 0 : p.type) != y.value && i("update:model-value", {
2136
1501
  ...e.modelValue,
2137
- type: p.value,
2138
- end: ((m = e.modelValue) == null ? void 0 : m.end) || 1
1502
+ type: y.value,
1503
+ end: ((s = e.modelValue) == null ? void 0 : s.end) || 1
2139
1504
  });
2140
1505
  },
2141
- key: p.value
1506
+ key: y.value
2142
1507
  }, {
2143
1508
  default: withCtx(() => [
2144
- createElementVNode("div", _hoisted_6$1, toDisplayString(p.label), 1),
2145
- createElementVNode("div", _hoisted_7$1, toDisplayString(p.description), 1)
1509
+ createElementVNode("div", _hoisted_6$1, toDisplayString(y.label), 1),
1510
+ createElementVNode("div", _hoisted_7$1, toDisplayString(y.description), 1)
2146
1511
  ]),
2147
1512
  _: 2
2148
1513
  }, 1032, ["class", "onClick"]);
@@ -2155,16 +1520,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2155
1520
  createVNode(c, {
2156
1521
  label: "Maximum to collect",
2157
1522
  "model-value": ((g = e.modelValue) == null ? void 0 : g.end) || null,
2158
- "onUpdate:modelValue": l[0] || (l[0] = (p) => {
1523
+ "onUpdate:modelValue": o[0] || (o[0] = (y) => {
2159
1524
  var v;
2160
- return u("update:model-value", {
1525
+ return i("update:model-value", {
2161
1526
  ...e.modelValue,
2162
1527
  type: ((v = e.modelValue) == null ? void 0 : v.type) || "STAMP",
2163
- end: p
1528
+ end: y
2164
1529
  });
2165
1530
  }),
2166
- "helper-text": unref(ZodHelper).helperText(unref(s), "end") || "Set the threshold required for reward eligibility",
2167
- "helper-state": unref(ZodHelper).helperState(unref(s), "end") || "none"
1531
+ "helper-text": unref(ZodHelper).helperText(unref(r), "end") || "Set the threshold required for reward eligibility",
1532
+ "helper-state": unref(ZodHelper).helperState(unref(r), "end") || "none"
2168
1533
  }, null, 8, ["model-value", "helper-text", "helper-state"])
2169
1534
  ])
2170
1535
  ]);
@@ -2193,78 +1558,78 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2193
1558
  },
2194
1559
  emits: ["update:model-value", "update:file"],
2195
1560
  setup(e, { emit: d }) {
2196
- const { t: a } = useI18n(), s = e, r = d;
2197
- function u(c) {
2198
- switch (s.field.type) {
1561
+ const { t: a } = useI18n(), r = e, u = d;
1562
+ function i(c) {
1563
+ switch (r.field.type) {
2199
1564
  case "timeframe":
2200
- const g = c.startDate ? hooks(c.startDate).startOf("day").toISOString() : void 0, p = c.endDate ? hooks(c.endDate).endOf("day").toISOString() : void 0;
2201
- r("update:model-value", {
1565
+ const g = c.startDate ? hooks(c.startDate).startOf("day").toISOString() : void 0, y = c.endDate ? hooks(c.endDate).endOf("day").toISOString() : void 0;
1566
+ u("update:model-value", {
2202
1567
  type: "timeframe",
2203
1568
  property: "__now",
2204
1569
  start: g,
2205
- end: p
1570
+ end: y
2206
1571
  });
2207
1572
  break;
2208
1573
  case "image": {
2209
- r(
1574
+ u(
2210
1575
  "update:file",
2211
1576
  c,
2212
- o.value || firebaseStorage.collectibleImagePath(void 0, c)
1577
+ l.value || firebaseStorage.collectibleImagePath(void 0, c)
2213
1578
  );
2214
1579
  break;
2215
1580
  }
2216
1581
  default:
2217
- r("update:model-value", c);
1582
+ u("update:model-value", c);
2218
1583
  break;
2219
1584
  }
2220
1585
  }
2221
- const o = computed(() => {
2222
- switch (s.field.type) {
1586
+ const l = computed(() => {
1587
+ switch (r.field.type) {
2223
1588
  case "timeframe": {
2224
- const c = s.modelValue;
1589
+ const c = r.modelValue;
2225
1590
  return {
2226
1591
  startDate: c != null && c.start ? hooks(c == null ? void 0 : c.start).format("YYYY-MM-DD") : null,
2227
1592
  endDate: c != null && c.end ? hooks(c == null ? void 0 : c.end).format("YYYY-MM-DD") : null
2228
1593
  };
2229
1594
  }
2230
1595
  default:
2231
- return s.modelValue;
1596
+ return r.modelValue;
2232
1597
  }
2233
1598
  });
2234
- function l() {
1599
+ function o() {
2235
1600
  if (!n.value.schema) return [];
2236
- const c = n.value.schema.safeParse(s.modelValue);
1601
+ const c = n.value.schema.safeParse(r.modelValue);
2237
1602
  return c.success ? [] : c.error.errors;
2238
1603
  }
2239
1604
  const n = computed(() => ({
2240
- schema: s.schema,
2241
- unwrapped: s.schema ? ZodHelper.unwrap(s.schema) : void 0,
2242
- rules: s.schema ? [ZodHelper.ruleAtPath(s.schema, "")] : void 0,
2243
- labelMark: s.schema && ZodHelper.isRequired(s.schema) == !1 ? "optional" : void 0,
2244
- zodLabel: s.schema ? ZodHelper.toInputLabel(s.schema, s.field.label) : void 0
1605
+ schema: r.schema,
1606
+ unwrapped: r.schema ? ZodHelper.unwrap(r.schema) : void 0,
1607
+ rules: r.schema ? [ZodHelper.ruleAtPath(r.schema, "")] : void 0,
1608
+ labelMark: r.schema && ZodHelper.isRequired(r.schema) == !1 ? "optional" : void 0,
1609
+ zodLabel: r.schema ? ZodHelper.toInputLabel(r.schema, r.field.label) : void 0
2245
1610
  }));
2246
1611
  return (c, g) => {
2247
- var f, y, C, E, b;
2248
- const p = resolveComponent("FmTextField"), v = resolveComponent("FmStepperField"), h = resolveComponent("FmTextarea"), i = resolveComponent("FmHelperText"), m = resolveComponent("FmSwitch");
2249
- return e.field.type === "text" ? (openBlock(), createBlock(p, {
1612
+ var f, m, b, x, k;
1613
+ const y = resolveComponent("FmTextField"), v = resolveComponent("FmStepperField"), h = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), s = resolveComponent("FmSwitch");
1614
+ return e.field.type === "text" ? (openBlock(), createBlock(y, {
2250
1615
  key: 0,
2251
1616
  label: unref(a)(e.field.label),
2252
1617
  "label-mark": unref(n).labelMark,
2253
1618
  rules: unref(n).rules,
2254
- "model-value": unref(o),
2255
- "onUpdate:modelValue": u,
1619
+ "model-value": unref(l),
1620
+ "onUpdate:modelValue": i,
2256
1621
  "helper-state": e.helperText ? "error" : void 0,
2257
1622
  "helper-text": e.helperText
2258
1623
  }, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2259
1624
  createVNode(JsonViewer, {
2260
- json: { schema: unref(n).unwrapped, props: s }
1625
+ json: { schema: unref(n).unwrapped, props: r }
2261
1626
  }, null, 8, ["json"]),
2262
1627
  createVNode(v, {
2263
1628
  label: unref(a)(e.field.label),
2264
1629
  "label-mark": e.field.isRuleChildren ? void 0 : unref(n).labelMark,
2265
- "model-value": unref(o),
1630
+ "model-value": unref(l),
2266
1631
  rules: e.field.isRuleChildren ? [] : unref(n).rules,
2267
- "onUpdate:modelValue": u,
1632
+ "onUpdate:modelValue": i,
2268
1633
  "helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
2269
1634
  "helper-text": e.field.isRuleChildren ? e.helperText : void 0
2270
1635
  }, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
@@ -2273,183 +1638,183 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2273
1638
  label: unref(a)(e.field.label),
2274
1639
  "label-mark": unref(n).labelMark,
2275
1640
  rules: unref(n).rules,
2276
- "model-value": unref(o),
2277
- "onUpdate:modelValue": u,
1641
+ "model-value": unref(l),
1642
+ "onUpdate:modelValue": i,
2278
1643
  "show-word-count": "",
2279
- "max-length": (b = (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 : b.value
2280
- }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$j, {
1644
+ "max-length": (k = (x = (b = (m = (f = unref(n)) == null ? void 0 : f.unwrapped) == null ? void 0 : m._def) == null ? void 0 : b.checks) == null ? void 0 : x.find((C) => C.kind == "max")) == null ? void 0 : k.value
1645
+ }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$g, {
2281
1646
  key: 3,
2282
1647
  "campaign-type": e.extras,
2283
- "model-value": unref(o),
1648
+ "model-value": unref(l),
2284
1649
  disabled: e.disabled,
2285
- "onUpdate:modelValue": u
1650
+ "onUpdate:modelValue": i
2286
1651
  }, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
2287
- createVNode(_sfc_main$h, {
2288
- "model-value": unref(o),
2289
- "onUpdate:modelValue": u
1652
+ createVNode(_sfc_main$e, {
1653
+ "model-value": unref(l),
1654
+ "onUpdate:modelValue": i
2290
1655
  }, null, 8, ["model-value"]),
2291
- createVNode(i, {
1656
+ createVNode(p, {
2292
1657
  class: "!mt-[8px]",
2293
- text: unref(ZodHelper).helperText(l(), ""),
2294
- state: unref(ZodHelper).helperState(l(), "")
1658
+ text: unref(ZodHelper).helperText(o(), ""),
1659
+ state: unref(ZodHelper).helperState(o(), "")
2295
1660
  }, null, 8, ["text", "state"])
2296
- ], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$v, {
1661
+ ], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$o, {
2297
1662
  key: 5,
2298
- thumbnail: unref(o),
1663
+ thumbnail: unref(l),
2299
1664
  "aspect-ratio": "16 / 9",
2300
1665
  class: "w-1/2 xs:w-2/3",
2301
- "onUpdate:file": u
1666
+ "onUpdate:file": i
2302
1667
  }, {
2303
1668
  label: withCtx(() => [
2304
1669
  (openBlock(), createBlock(resolveDynamicComponent(unref(n).zodLabel)))
2305
1670
  ]),
2306
1671
  _: 1
2307
- }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(m, {
1672
+ }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(s, {
2308
1673
  key: 6,
2309
1674
  label: unref(a)(e.field.label),
2310
1675
  "label-placement": "right",
2311
1676
  sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
2312
1677
  "label-mark": unref(n).labelMark,
2313
1678
  rules: unref(n).rules,
2314
- "model-value": unref(o),
2315
- "onUpdate:modelValue": u
2316
- }, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$x, {
1679
+ "model-value": unref(l),
1680
+ "onUpdate:modelValue": i
1681
+ }, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$p, {
2317
1682
  key: 7,
2318
- "model-value": unref(o),
2319
- "onUpdate:modelValue": u,
1683
+ "model-value": unref(l),
1684
+ "onUpdate:modelValue": i,
2320
1685
  "no-campaign": !1,
2321
1686
  schema: unref(n).schema,
2322
1687
  "is-mission": e.extras === "MISSION"
2323
- }, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$y, {
1688
+ }, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$q, {
2324
1689
  key: 8,
2325
- "model-value": unref(o),
2326
- "onUpdate:modelValue": u
1690
+ "model-value": unref(l),
1691
+ "onUpdate:modelValue": i
2327
1692
  }, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
2328
- createVNode(_sfc_main$w, {
2329
- "model-value": unref(o),
2330
- "onUpdate:modelValue": u,
1693
+ createVNode(_sfc_main$r, {
1694
+ "model-value": unref(l),
1695
+ "onUpdate:modelValue": i,
2331
1696
  "can-set-auto-apply": e.field.property == "campaign.effect"
2332
1697
  }, null, 8, ["model-value", "can-set-auto-apply"]),
2333
- unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(i, {
1698
+ unref(l) ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
2334
1699
  key: 0,
2335
1700
  class: "!mt-[8px]",
2336
1701
  text: unref(a)("connect.campaign.common.effect_required"),
2337
1702
  state: "error"
2338
1703
  }, null, 8, ["text"]))
2339
- ], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$A, {
1704
+ ], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$s, {
2340
1705
  key: 10,
2341
- "model-value": unref(o),
2342
- "onUpdate:modelValue": u,
2343
- "helper-text": unref(ZodHelper).helperText(l(), ""),
1706
+ "model-value": unref(l),
1707
+ "onUpdate:modelValue": i,
1708
+ "helper-text": unref(ZodHelper).helperText(o(), ""),
2344
1709
  "trigger-type": e.field.extras,
2345
- "helper-state": unref(ZodHelper).helperState(l(), "")
2346
- }, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$e, {
1710
+ "helper-state": unref(ZodHelper).helperState(o(), "")
1711
+ }, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$l, {
2347
1712
  key: 11,
2348
- "model-value": unref(o),
2349
- "onUpdate:modelValue": u,
1713
+ "model-value": unref(l),
1714
+ "onUpdate:modelValue": i,
2350
1715
  extras: e.extras,
2351
1716
  "error-text": e.helperText
2352
- }, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$z, {
1717
+ }, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$m, {
2353
1718
  key: 12,
2354
1719
  type: "custom",
2355
- "model-value": unref(o),
2356
- "onUpdate:modelValue": u,
2357
- "helper-text": e.helperText || unref(ZodHelper).helperText(l(), "")
2358
- }, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$d, {
1720
+ "model-value": unref(l),
1721
+ "onUpdate:modelValue": i,
1722
+ "helper-text": e.helperText || unref(ZodHelper).helperText(o(), "")
1723
+ }, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$c, {
2359
1724
  key: 13,
2360
- "model-value": unref(o),
2361
- "onUpdate:modelValue": u
1725
+ "model-value": unref(l),
1726
+ "onUpdate:modelValue": i
2362
1727
  }, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
2363
1728
  key: 14,
2364
- "model-value": unref(o),
2365
- "onUpdate:modelValue": u
1729
+ "model-value": unref(l),
1730
+ "onUpdate:modelValue": i
2366
1731
  }, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
2367
1732
  key: 15,
2368
- "model-value": unref(o),
2369
- "onUpdate:modelValue": u
1733
+ "model-value": unref(l),
1734
+ "onUpdate:modelValue": i
2370
1735
  }, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
2371
1736
  key: 16,
2372
- "model-value": unref(o),
2373
- "onUpdate:modelValue": u
1737
+ "model-value": unref(l),
1738
+ "onUpdate:modelValue": i
2374
1739
  }, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
2375
1740
  key: 17,
2376
- "model-value": unref(o),
2377
- "onUpdate:modelValue": u,
2378
- "helper-text": unref(ZodHelper).helperText(l(), ""),
2379
- "helper-state": unref(ZodHelper).helperState(l(), "")
1741
+ "model-value": unref(l),
1742
+ "onUpdate:modelValue": i,
1743
+ "helper-text": unref(ZodHelper).helperText(o(), ""),
1744
+ "helper-state": unref(ZodHelper).helperState(o(), "")
2380
1745
  }, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
2381
1746
  key: 18,
2382
- "model-value": unref(o),
2383
- "onUpdate:modelValue": u,
1747
+ "model-value": unref(l),
1748
+ "onUpdate:modelValue": i,
2384
1749
  mission: e.extras.mission
2385
1750
  }, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
2386
- createVNode(_sfc_main$g, {
2387
- "model-value": unref(o),
2388
- "onUpdate:modelValue": u,
1751
+ createVNode(_sfc_main$d, {
1752
+ "model-value": unref(l),
1753
+ "onUpdate:modelValue": i,
2389
1754
  "start-date": e.extras.start,
2390
1755
  "end-date": e.extras.end
2391
1756
  }, null, 8, ["model-value", "start-date", "end-date"]),
2392
- e.helperText ? (openBlock(), createBlock(i, {
1757
+ e.helperText ? (openBlock(), createBlock(p, {
2393
1758
  key: 0,
2394
1759
  class: "!mt-[8px]",
2395
1760
  text: e.helperText,
2396
1761
  state: "error"
2397
1762
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2398
1763
  ], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
2399
- createVNode(_sfc_main$o, {
2400
- "model-value": unref(o),
2401
- "onUpdate:modelValue": u
1764
+ createVNode(_sfc_main$t, {
1765
+ "model-value": unref(l),
1766
+ "onUpdate:modelValue": i
2402
1767
  }, null, 8, ["model-value"]),
2403
- e.helperText ? (openBlock(), createBlock(i, {
1768
+ e.helperText ? (openBlock(), createBlock(p, {
2404
1769
  key: 0,
2405
1770
  class: "!mt-[8px]",
2406
1771
  text: e.helperText,
2407
1772
  state: "error"
2408
1773
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2409
1774
  ], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
2410
- e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(o).rules.g_time).length > 0 ? (openBlock(), createBlock(i, {
1775
+ e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(l).rules.g_time).length > 0 ? (openBlock(), createBlock(p, {
2411
1776
  key: 0,
2412
1777
  state: "warning",
2413
1778
  text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
2414
1779
  }, null, 8, ["text"])) : createCommentVNode("", !0),
2415
- createVNode(_sfc_main$n, {
2416
- "model-value": unref(o),
2417
- "onUpdate:modelValue": u
1780
+ createVNode(_sfc_main$i, {
1781
+ "model-value": unref(l),
1782
+ "onUpdate:modelValue": i
2418
1783
  }, null, 8, ["model-value"]),
2419
- e.helperText ? (openBlock(), createBlock(i, {
1784
+ e.helperText ? (openBlock(), createBlock(p, {
2420
1785
  key: 1,
2421
1786
  class: "!mt-[8px]",
2422
1787
  text: e.helperText,
2423
1788
  state: "error"
2424
1789
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2425
1790
  ], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
2426
- createVNode(_sfc_main$m, {
2427
- "model-value": unref(o),
2428
- "onUpdate:modelValue": u
1791
+ createVNode(_sfc_main$u, {
1792
+ "model-value": unref(l),
1793
+ "onUpdate:modelValue": i
2429
1794
  }, null, 8, ["model-value"]),
2430
- e.helperText ? (openBlock(), createBlock(i, {
1795
+ e.helperText ? (openBlock(), createBlock(p, {
2431
1796
  key: 0,
2432
1797
  class: "!mt-[8px]",
2433
1798
  text: e.helperText,
2434
1799
  state: "error"
2435
1800
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2436
1801
  ], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
2437
- createVNode(_sfc_main$k, {
2438
- "model-value": unref(o),
2439
- "onUpdate:modelValue": u
1802
+ createVNode(_sfc_main$v, {
1803
+ "model-value": unref(l),
1804
+ "onUpdate:modelValue": i
2440
1805
  }, null, 8, ["model-value"]),
2441
- e.helperText ? (openBlock(), createBlock(i, {
1806
+ e.helperText ? (openBlock(), createBlock(p, {
2442
1807
  key: 0,
2443
1808
  class: "!mt-[8px]",
2444
1809
  text: e.helperText,
2445
1810
  state: "error"
2446
1811
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2447
1812
  ], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
2448
- createVNode(_sfc_main$l, {
2449
- "model-value": unref(o),
2450
- "onUpdate:modelValue": u
1813
+ createVNode(_sfc_main$h, {
1814
+ "model-value": unref(l),
1815
+ "onUpdate:modelValue": i
2451
1816
  }, null, 8, ["model-value"]),
2452
- e.helperText ? (openBlock(), createBlock(i, {
1817
+ e.helperText ? (openBlock(), createBlock(p, {
2453
1818
  key: 0,
2454
1819
  class: "!mt-[8px]",
2455
1820
  text: e.helperText,
@@ -2457,16 +1822,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2457
1822
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2458
1823
  ], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
2459
1824
  createVNode(_sfc_main$9, {
2460
- "model-value": unref(o),
2461
- "onUpdate:modelValue": u
1825
+ "model-value": unref(l),
1826
+ "onUpdate:modelValue": i
2462
1827
  }, null, 8, ["model-value"]),
2463
- e.helperText ? (openBlock(), createBlock(i, {
1828
+ e.helperText ? (openBlock(), createBlock(p, {
2464
1829
  key: 0,
2465
1830
  class: "!mt-[8px]",
2466
1831
  text: e.helperText,
2467
1832
  state: "error"
2468
1833
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2469
- ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(s.field), 1));
1834
+ ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(r.field), 1));
2470
1835
  };
2471
1836
  }
2472
1837
  }), _hoisted_1$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_2$1 = /* @__PURE__ */ createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1), _hoisted_3$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_4$1 = { class: "fm-typo-en-body-lg-600" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
@@ -2479,22 +1844,22 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2479
1844
  },
2480
1845
  setup(e) {
2481
1846
  const { t: d, te: a } = useI18n();
2482
- return (s, r) => {
2483
- const u = resolveComponent("FmCard");
2484
- return openBlock(), createBlock(u, {
1847
+ return (r, u) => {
1848
+ const i = resolveComponent("FmCard");
1849
+ return openBlock(), createBlock(i, {
2485
1850
  variant: "outlined",
2486
1851
  class: "p-16 space-y-8"
2487
1852
  }, {
2488
1853
  default: withCtx(() => [
2489
1854
  createElementVNode("div", _hoisted_1$1, toDisplayString(unref(d)("connect.campaign.common.summary")), 1),
2490
1855
  _hoisted_2$1,
2491
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (o, l) => (openBlock(), createElementBlock("div", {
1856
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (l, o) => (openBlock(), createElementBlock("div", {
2492
1857
  class: "space-y-4",
2493
- key: l
1858
+ key: o
2494
1859
  }, [
2495
- o ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2496
- createElementVNode("div", _hoisted_3$1, toDisplayString(unref(d)(`${l}`)), 1),
2497
- createElementVNode("div", _hoisted_4$1, toDisplayString(unref(a)(`${o}`) ? unref(d)(`${o}`) : o), 1)
1860
+ l ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1861
+ createElementVNode("div", _hoisted_3$1, toDisplayString(unref(d)(`${o}`)), 1),
1862
+ createElementVNode("div", _hoisted_4$1, toDisplayString(unref(a)(`${l}`) ? unref(d)(`${l}`) : l), 1)
2498
1863
  ], 64)) : createCommentVNode("", !0)
2499
1864
  ]))), 128))
2500
1865
  ]),
@@ -2542,10 +1907,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2542
1907
  } finally {
2543
1908
  await new Promise((a) => setTimeout(a, 120)), isLoading.value = !1;
2544
1909
  }
2545
- template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a, s) => {
1910
+ template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a, r) => {
2546
1911
  a.campaign.type === "VOUCHER" && a.campaign.code && useCampaignStore().campaigns.voucher.some(
2547
- (r) => r.code === a.campaign.code && r._id.toString() !== a.campaign._id.toString()
2548
- ) && s.addIssue({
1912
+ (u) => u.code === a.campaign.code && u._id.toString() !== a.campaign._id.toString()
1913
+ ) && r.addIssue({
2549
1914
  code: "custom",
2550
1915
  message: "Code already exists, please use another code",
2551
1916
  path: ["campaign", "code"]
@@ -2579,7 +1944,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2579
1944
  });
2580
1945
  function stepErrors(e = currentStep.value - 1) {
2581
1946
  const d = template.value.steps[e].groups.flatMap(
2582
- (a) => a.fields.map((s) => s.property)
1947
+ (a) => a.fields.map((r) => r.property)
2583
1948
  );
2584
1949
  return errors.value.filter((a) => d.includes(a.path.join(".")));
2585
1950
  }
@@ -2603,7 +1968,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2603
1968
  RuleBuilder.scaffoldGroup("g_user"),
2604
1969
  RuleBuilder.scaffoldGroup("g_bill")
2605
1970
  ]
2606
- ), s = RuleBuilder.setRuleToGroup(
1971
+ ), r = RuleBuilder.setRuleToGroup(
2607
1972
  RuleBuilder.scaffoldGroup("g_schedule"),
2608
1973
  [
2609
1974
  RuleBuilder.constructEntry(
@@ -2622,7 +1987,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2622
1987
  _.set(
2623
1988
  data.value,
2624
1989
  "campaign.event.rule",
2625
- RuleBuilder.setRuleToGroup(a, s)
1990
+ RuleBuilder.setRuleToGroup(a, r)
2626
1991
  );
2627
1992
  }
2628
1993
  e == "campaign.notify" && d == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
@@ -2647,13 +2012,13 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2647
2012
  e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
2648
2013
  }
2649
2014
  return (e, d) => {
2650
- const a = resolveComponent("FmButton"), s = resolveComponent("FmStep"), r = resolveComponent("FmStepper"), u = resolveComponent("FmCard"), o = resolveComponent("FmTopSheet");
2651
- return openBlock(), createBlock(o, {
2015
+ const a = resolveComponent("FmButton"), r = resolveComponent("FmStep"), u = resolveComponent("FmStepper"), i = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
2016
+ return openBlock(), createBlock(l, {
2652
2017
  "fullscreen-size": "lg",
2653
2018
  modelValue: unref(sheetVisible),
2654
2019
  "onUpdate:modelValue": [
2655
- d[7] || (d[7] = (l) => isRef(sheetVisible) ? sheetVisible.value = l : null),
2656
- d[8] || (d[8] = (l) => sheetVisible.value = l)
2020
+ d[7] || (d[7] = (o) => isRef(sheetVisible) ? sheetVisible.value = o : null),
2021
+ d[8] || (d[8] = (o) => sheetVisible.value = o)
2657
2022
  ]
2658
2023
  }, createSlots({
2659
2024
  "top-sheet-header": withCtx(() => [
@@ -2661,7 +2026,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2661
2026
  createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
2662
2027
  createElementVNode("div", _hoisted_2, [
2663
2028
  createVNode(a, {
2664
- onClick: d[0] || (d[0] = (l) => hideSheet()),
2029
+ onClick: d[0] || (d[0] = (o) => hideSheet()),
2665
2030
  label: unref(t)("connect.campaign.common.cancel"),
2666
2031
  variant: "tertiary"
2667
2032
  }, null, 8, ["label"]),
@@ -2682,7 +2047,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2682
2047
  createElementVNode("div", _hoisted_10, [
2683
2048
  createElementVNode("div", _hoisted_11, [
2684
2049
  _hoisted_12,
2685
- createVNode(u, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2050
+ createVNode(i, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2686
2051
  ])
2687
2052
  ])
2688
2053
  ])
@@ -2692,16 +2057,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2692
2057
  name: "default",
2693
2058
  fn: withCtx(() => [
2694
2059
  unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
2695
- createVNode(r, {
2060
+ createVNode(u, {
2696
2061
  modelValue: unref(currentStep),
2697
- "onUpdate:modelValue": d[1] || (d[1] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2062
+ "onUpdate:modelValue": d[1] || (d[1] = (o) => isRef(currentStep) ? currentStep.value = o : null),
2698
2063
  orientation: "horizontal",
2699
2064
  class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
2700
2065
  }, {
2701
2066
  default: withCtx(() => [
2702
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(s, {
2703
- key: l.name,
2704
- title: unref(t)(l.name),
2067
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(r, {
2068
+ key: o.name,
2069
+ title: unref(t)(o.name),
2705
2070
  value: n + 1,
2706
2071
  error: () => stepErrors(n).length > 0,
2707
2072
  complete: () => n + 1 <= unref(currentStep)
@@ -2713,19 +2078,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2713
2078
  createVNode(a, {
2714
2079
  icon: "close",
2715
2080
  variant: "tertiary",
2716
- onClick: d[2] || (d[2] = (l) => sheetVisible.value = !1)
2081
+ onClick: d[2] || (d[2] = (o) => sheetVisible.value = !1)
2717
2082
  }),
2718
- createVNode(r, {
2083
+ createVNode(u, {
2719
2084
  modelValue: unref(currentStep),
2720
- "onUpdate:modelValue": d[3] || (d[3] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2085
+ "onUpdate:modelValue": d[3] || (d[3] = (o) => isRef(currentStep) ? currentStep.value = o : null),
2721
2086
  orientation: "horizontal",
2722
2087
  class: "flex-1"
2723
2088
  }, {
2724
2089
  default: withCtx(() => [
2725
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(s, {
2726
- key: l.name,
2090
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(r, {
2091
+ key: o.name,
2727
2092
  title: unref(sheetTitle),
2728
- description: l.name,
2093
+ description: o.name,
2729
2094
  value: n + 1,
2730
2095
  error: () => stepErrors(n).length > 0,
2731
2096
  complete: () => n + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
@@ -2745,30 +2110,30 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2745
2110
  json: {
2746
2111
  data: unref(data),
2747
2112
  errors: unref(errors).map(
2748
- (l) => `${l.path.join(".")} - ${l.message}`
2113
+ (o) => `${o.path.join(".")} - ${o.message}`
2749
2114
  ),
2750
2115
  stepErrors: stepErrors().map(
2751
- (l) => `${l.path.join(".")} - ${l.message}`
2116
+ (o) => `${o.path.join(".")} - ${o.message}`
2752
2117
  ),
2753
2118
  schema: unref(schema)
2754
2119
  }
2755
2120
  }, null, 8, ["json"]),
2756
2121
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
2757
- (l) => l.fields.length && (!l.condition || unref(_).get(unref(data), l.condition.property) == l.condition.value == (l.condition.not != !0))
2758
- ), (l, n) => (openBlock(), createElementBlock("div", {
2122
+ (o) => o.fields.length && (!o.condition || unref(_).get(unref(data), o.condition.property) == o.condition.value == (o.condition.not != !0))
2123
+ ), (o, n) => (openBlock(), createElementBlock("div", {
2759
2124
  key: n,
2760
2125
  class: "space-y-24"
2761
2126
  }, [
2762
- createElementVNode("div", _hoisted_7, toDisplayString(l.name ? unref(t)(l.name) : ""), 1),
2763
- (openBlock(!0), createElementBlock(Fragment, null, renderList(l.fields, (c, g) => (openBlock(), createElementBlock("div", { key: g }, [
2127
+ createElementVNode("div", _hoisted_7, toDisplayString(o.name ? unref(t)(o.name) : ""), 1),
2128
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(o.fields, (c, g) => (openBlock(), createElementBlock("div", { key: g }, [
2764
2129
  (openBlock(), createBlock(_sfc_main$2, {
2765
2130
  key: g,
2766
2131
  field: c,
2767
2132
  modelValue: unref(_).get(unref(data), c.property),
2768
2133
  disabled: isDisable(c),
2769
- "onUpdate:modelValue": (p) => onUpdateProperty(c.property, p),
2770
- "onUpdate:file": async (p, v) => {
2771
- const h = await onUpdateFile(p, v);
2134
+ "onUpdate:modelValue": (y) => onUpdateProperty(c.property, y),
2135
+ "onUpdate:file": async (y, v) => {
2136
+ const h = await onUpdateFile(y, v);
2772
2137
  onUpdateProperty(c.property, h || "");
2773
2138
  },
2774
2139
  schema: unref(ZodHelper).typeAtPath(
@@ -2787,12 +2152,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2787
2152
  label: "Back",
2788
2153
  variant: "tertiary",
2789
2154
  disabled: unref(currentStep) == 1,
2790
- onClick: d[5] || (d[5] = (l) => currentStep.value--)
2155
+ onClick: d[5] || (d[5] = (o) => currentStep.value--)
2791
2156
  }, null, 8, ["disabled"]),
2792
2157
  createVNode(a, {
2793
2158
  disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
2794
2159
  label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
2795
- onClick: d[6] || (d[6] = (l) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2160
+ onClick: d[6] || (d[6] = (o) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2796
2161
  }, null, 8, ["disabled", "label"])
2797
2162
  ])
2798
2163
  ]),