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