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