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