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