@feedmepos/mf-connect 0.1.28-prod → 0.1.30-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Analytic-2fPCInDE.js → Analytic-C_uRY3I5.js} +11 -11
- package/dist/{App-BJlRD4KH.js → App-zOAwWGz6.js} +6 -6
- package/dist/{Bin-DWd2_II3.js → Bin-CePm_uVx.js} +8 -8
- package/dist/{Broadcast-DTbF5YQn.js → Broadcast-BcRSoknR.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-TIRZoc43.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-5StwY5c9.js} +6 -6
- package/dist/{Card-BUGQEdCK.js → Card-Dmyxmub5.js} +207 -199
- package/dist/{Collections-BjomDHYg.js → Collections-DiV_e9h-.js} +6 -6
- package/dist/{Credit-BUK4Aw0m.js → Credit-CkGdHhn2.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-gWvjwFiR.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-SulDMna0.js} +458 -458
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DvTrxSnL.js → EffectSheet.vue_vue_type_style_index_0_lang-CSY1HXaL.js} +6 -6
- package/dist/{Experience-DsQIdK9t.js → Experience-DjsOWpa9.js} +9 -9
- package/dist/{Game-BLbN3Z6v.js → Game-2_J99uIX.js} +10 -10
- package/dist/{Index-CzIILYvi.js → Index-a1eFJ8i1.js} +10 -10
- package/dist/{Marketing-xoRpWZfv.js → Marketing-Clz0CYrY.js} +6 -6
- package/dist/{Member-DInHHwad.js → Member-TNxdgh6i.js} +5 -5
- package/dist/{MemberList-DF8tkFDT.js → MemberList-D-5IP783.js} +28 -25
- package/dist/{MemberTransactions-C-pbBsve.js → MemberTransactions-B7D_qrLX.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CHq9xXiP.js → MessageInput.vue_vue_type_script_setup_true_lang-XhbiT524.js} +3 -3
- package/dist/{Mission-BAxHgOAl.js → Mission-B7UVVT1j.js} +10 -10
- package/dist/{Overview-BWyUMlCT.js → Overview-BfZuRgE-.js} +17 -17
- package/dist/{Point-CGzCftO5.js → Point-MGLwWD4B.js} +9 -9
- package/dist/{Promotion-BHB6CTXq.js → Promotion-BrhYslNt.js} +10 -10
- package/dist/{Queue-BMqt4siy.js → Queue-Bz160bZx.js} +9 -9
- package/dist/{Record-DisW68Yh.js → Record-DrpOYO01.js} +7 -7
- package/dist/{Reward-C7XavzIk.js → Reward-ClX3C1Sp.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BYknroSK.js → RewardGroup.vue_vue_type_script_setup_true_lang-0L9iBoC4.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-D_-qtGyk.js → RuleGroup.vue_vue_type_script_setup_true_lang-BlCyumkR.js} +12 -12
- package/dist/{Segment-Cam05pCr.js → Segment-OY9qUZnY.js} +14 -14
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-b4AoknE_.js → SelectItems.vue_vue_type_script_setup_true_lang-D5eLqSso.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BqssLYLl.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cb3yPiSc.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Evq0vBoE.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B_RBF59b.js} +3 -3
- package/dist/{Setting-DliMpeMz.js → Setting-CgRON4iT.js} +10 -10
- package/dist/{Store-Cgkw-xg6.js → Store-BGbO2NeC.js} +18 -18
- package/dist/{StoreRewards-Dfo00Fc6.js → StoreRewards-DyCWcVsT.js} +14 -14
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DK4q2v-U.js → StoreTransactions.vue_vue_type_script_setup_true_lang-ePVWe6Kb.js} +17 -17
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CiApy4Rx.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DLQOZH-k.js} +1 -1
- package/dist/{Tier-CkZhMC3f.js → Tier-B7LRmyHJ.js} +19 -19
- package/dist/{Title-DXtRRsGh.js → Title-DrQaQ7ew.js} +19 -19
- package/dist/{Transaction-BALNjNz6.js → Transaction-B2M_gPhT.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DhTilYic.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Bc8cnLBQ.js} +6 -6
- package/dist/{Voucher-C4AN27lq.js → Voucher-BcVMrpOm.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DT-iQjFb.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DIfHJ6Sw.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BmtZwFSs.js → ZodTextField.vue_vue_type_script_setup_true_lang-DfinebCV.js} +1 -1
- package/dist/{app-CrWyzn6D.js → app-BXGrI0oQ.js} +1 -1
- package/dist/{app-Cex8lJkz.js → app-Sjl26OK7.js} +30 -30
- package/dist/app.js +1 -1
- package/dist/{business-B41gNDWn.js → business-ICKi8JNz.js} +1 -1
- package/dist/{campaign-DyRorn8y.js → campaign-AiWYrbax.js} +9 -9
- package/dist/{campaign-D8Jb8Mcs.js → campaign-BExdhFR9.js} +2 -2
- package/dist/{campaign.enum-D1WvicXa.js → campaign.enum-WEt42FO9.js} +1 -1
- package/dist/{campaign.fn-WZL8m77q.js → campaign.fn-CHQ63XNa.js} +135 -135
- package/dist/{collectible.enum-2SqtWORg.js → collectible.enum-DFaOnC3D.js} +1 -1
- package/dist/{collection.fn-BGBiIa3-.js → collection.fn-B3XEjDdU.js} +2 -2
- package/dist/{dto-CziQ3YR8.js → dto-B09V82Pa.js} +4 -4
- package/dist/{effect-DOhxTMbD.js → effect-CUcku1wp.js} +1 -1
- package/dist/{email-addresses-B2-IyW9d.js → email-addresses-CSpdONTz.js} +1 -1
- package/dist/{export-DijV-thU.js → export-DJfDtT62.js} +3 -3
- package/dist/{helper-DZ475418.js → helper-CbSsYPpI.js} +1 -1
- package/dist/{index-JaOBn64e.js → index-B3HoKsL8.js} +1 -1
- package/dist/{index-DqsQDq21.js → index-BSTUrmqB.js} +6 -6
- package/dist/{index-DgyH5BiA.js → index-BaR_Lcm6.js} +1 -1
- package/dist/{index-BhF5Q6I1.js → index-C1wvmxnj.js} +1 -1
- package/dist/{index-D2q6nQsP.js → index-C_bBUep_.js} +5 -5
- package/dist/{index-gfPyiFc5.js → index-Clj1WSBs.js} +3 -3
- package/dist/{index-CDc5NEE9.js → index-D98bOypJ.js} +1 -1
- package/dist/{index-vy13Kvq1.js → index-DLsHC8RI.js} +1 -1
- package/dist/{index-mHvARg87.js → index-DeYzI7Ad.js} +2 -2
- package/dist/{index-vThFTWos.js → index-DsmYdmgu.js} +1 -1
- package/dist/{index-BjzAAlhX.js → index-QyxsXvZB.js} +3 -3
- package/dist/{index-BHnFFWRj.js → index-ZQcFToUw.js} +1 -1
- package/dist/{index.esm2017-DrOnmEcN.js → index.esm2017-D0ExClUr.js} +1 -1
- package/dist/{loading-B090b_ce.js → loading-BPPrnQNO.js} +1 -1
- package/dist/{membership-BnjHoHZJ.js → membership-XRsihZq0.js} +3 -3
- package/dist/{money-D-ZRd8_2.js → money-hdSAgWNM.js} +1 -1
- package/dist/{number-cKAn8ky6.js → number-DYeV4NB_.js} +1 -1
- package/dist/{objectid-C5bLDGr_.js → objectid-CC8rUDIT.js} +5 -5
- package/dist/{plugins-CyX08GLM.js → plugins-BZn2aS9v.js} +4 -4
- package/dist/{reward-Dg-9sn2_.js → reward-6Gs4Tj0g.js} +1 -1
- package/dist/{rule-Bnl3DQZ7.js → rule-BRP3Seyh.js} +3 -3
- package/dist/{rule-builder-B75aU3HN.js → rule-builder-C7d79jSS.js} +1 -1
- package/dist/{template-CMSQsYm3.js → template-B0NSZx7m.js} +4 -4
- package/dist/{trigger-BkZU9Cr9.js → trigger-B5-fD0op.js} +4 -4
- package/dist/{user-DR35Lmlo.js → user-t4f-8zfV.js} +1 -1
- package/dist/{vue-i18n-B4XGvfnw.js → vue-i18n-Byc8euZx.js} +232 -232
- package/dist/{xlsx-C15yLkMd.js → xlsx-C_z356In.js} +1 -1
- package/package.json +1 -1
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createCommentVNode, computed, createElementVNode, Fragment, renderList, normalizeClass, toDisplayString, toRefs, normalizeStyle, resolveDynamicComponent, createSlots } from "vue";
|
|
2
2
|
import { _ } from "./lodash-B5I3zXaY.js";
|
|
3
|
-
import { z } from "./app-
|
|
3
|
+
import { z } from "./app-Sjl26OK7.js";
|
|
4
4
|
import { Z as ZodHelper } from "./zod-Bg2FbC-D.js";
|
|
5
|
-
import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-
|
|
6
|
-
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-
|
|
7
|
-
import { u as useMembershipStore } from "./membership-
|
|
8
|
-
import { u as useBusinessStore } from "./business-
|
|
9
|
-
import "./index-
|
|
10
|
-
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-
|
|
5
|
+
import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-AiWYrbax.js";
|
|
6
|
+
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-B09V82Pa.js";
|
|
7
|
+
import { u as useMembershipStore } from "./membership-XRsihZq0.js";
|
|
8
|
+
import { u as useBusinessStore } from "./business-ICKi8JNz.js";
|
|
9
|
+
import "./index-DeYzI7Ad.js";
|
|
10
|
+
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-C7d79jSS.js";
|
|
11
11
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
12
12
|
import { h as hooks } from "./moment-BWErdI6_.js";
|
|
13
|
-
import { f as featureVersionMapping } from "./campaign.enum-
|
|
13
|
+
import { f as featureVersionMapping } from "./campaign.enum-WEt42FO9.js";
|
|
14
14
|
import { _ as _sfc_main$o } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
15
|
-
import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
16
|
-
import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
19
|
-
import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-
|
|
20
|
-
import { u as useI18n } from "./vue-i18n-
|
|
21
|
-
import { b as TypeToTriggerOptions, _ as _sfc_main$u, a as _sfc_main$v } from "./trigger-
|
|
22
|
-
import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
23
|
-
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-
|
|
24
|
-
import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-
|
|
25
|
-
import { s as FdoCreditLoyaltyReward, t as FdtoRandomReward, u as F_MISSION_TYPE, v as FdoThresholdCreditReward, w as FdtoThresholdReward, x as FdoMission } from "./index-
|
|
26
|
-
import { T as TEMPLATES } from "./index-
|
|
27
|
-
import "./index-
|
|
28
|
-
import "./index-
|
|
29
|
-
import { a as F_GAME_TYPE } from "./collectible.enum-
|
|
15
|
+
import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-CSY1HXaL.js";
|
|
16
|
+
import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DLQOZH-k.js";
|
|
17
|
+
import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-Bc8cnLBQ.js";
|
|
18
|
+
import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BlCyumkR.js";
|
|
19
|
+
import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-BZn2aS9v.js";
|
|
20
|
+
import { u as useI18n } from "./vue-i18n-Byc8euZx.js";
|
|
21
|
+
import { b as TypeToTriggerOptions, _ as _sfc_main$u, a as _sfc_main$v } from "./trigger-B5-fD0op.js";
|
|
22
|
+
import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-XhbiT524.js";
|
|
23
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-BRP3Seyh.js";
|
|
24
|
+
import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DIfHJ6Sw.js";
|
|
25
|
+
import { s as FdoCreditLoyaltyReward, t as FdtoRandomReward, u as F_MISSION_TYPE, v as FdoThresholdCreditReward, w as FdtoThresholdReward, x as FdoMission } from "./index-C_bBUep_.js";
|
|
26
|
+
import { T as TEMPLATES } from "./index-BSTUrmqB.js";
|
|
27
|
+
import "./index-DLsHC8RI.js";
|
|
28
|
+
import "./index-QyxsXvZB.js";
|
|
29
|
+
import { a as F_GAME_TYPE } from "./collectible.enum-DFaOnC3D.js";
|
|
30
30
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
31
|
-
import { u as useLoading } from "./loading-
|
|
32
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
33
|
-
import { C as CollectionUtils } from "./collection.fn-
|
|
31
|
+
import { u as useLoading } from "./loading-BPPrnQNO.js";
|
|
32
|
+
import { i as initCollectibleConfig } from "./helper-CbSsYPpI.js";
|
|
33
|
+
import { C as CollectionUtils } from "./collection.fn-B3XEjDdU.js";
|
|
34
34
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
35
35
|
import { useDialog } from "@feedmepos/ui-library";
|
|
36
|
-
import { u as useCampaignStore } from "./campaign-
|
|
37
|
-
import { S as SvcConfig } from "./index-
|
|
36
|
+
import { u as useCampaignStore } from "./campaign-BExdhFR9.js";
|
|
37
|
+
import { S as SvcConfig } from "./index-Clj1WSBs.js";
|
|
38
38
|
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
39
39
|
const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
40
40
|
__name: "TimeRuleGroup",
|
|
@@ -46,13 +46,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
emits: ["update:model-value"],
|
|
49
|
-
setup(e, { emit:
|
|
50
|
-
const { t: a } = useI18n(), r = e, u =
|
|
49
|
+
setup(e, { emit: c }) {
|
|
50
|
+
const { t: a } = useI18n(), r = e, u = c, s = ref(
|
|
51
51
|
!r.modelValue || !r.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(r.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
52
52
|
);
|
|
53
|
-
watch(
|
|
54
|
-
var
|
|
55
|
-
if (n == "custom" &&
|
|
53
|
+
watch(s, async (l, n) => {
|
|
54
|
+
var d;
|
|
55
|
+
if (n == "custom" && l == "all_time" && RuleBuilder.getRules((d = r.modelValue) == null ? void 0 : d.rules.g_time).length > 0) {
|
|
56
56
|
const g = await prompt.confirm(
|
|
57
57
|
a("connect.template.rule.time.confirm_remove"),
|
|
58
58
|
a("connect.common.confirm"),
|
|
@@ -65,19 +65,19 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
65
65
|
r.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
66
66
|
RuleBuilder.scaffoldGroup("g_time")
|
|
67
67
|
)
|
|
68
|
-
),
|
|
68
|
+
), s.value = g ? l : n;
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
|
-
async function l
|
|
71
|
+
async function o(l) {
|
|
72
72
|
var n;
|
|
73
|
-
if (
|
|
73
|
+
if (l == "custom" && RuleBuilder.getRules((n = r.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
|
|
74
74
|
if (!await prompt.confirm(
|
|
75
75
|
a("connect.template.rule.time.confirm_remove"),
|
|
76
76
|
a("connect.common.confirm"),
|
|
77
77
|
a("connect.common.confirm"),
|
|
78
78
|
a("connect.common.cancel")
|
|
79
79
|
)) {
|
|
80
|
-
|
|
80
|
+
s.value = "all_time";
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
83
|
u(
|
|
@@ -89,30 +89,30 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
return (
|
|
92
|
+
return (l, n) => {
|
|
93
93
|
var y;
|
|
94
|
-
const
|
|
94
|
+
const d = resolveComponent("FmRadio"), g = resolveComponent("FmRadioGroup");
|
|
95
95
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
96
96
|
createVNode(g, {
|
|
97
|
-
modelValue: unref(
|
|
97
|
+
modelValue: unref(s),
|
|
98
98
|
"onUpdate:modelValue": [
|
|
99
|
-
n[0] || (n[0] = (v) => isRef(
|
|
100
|
-
n[1] || (n[1] = (v) =>
|
|
99
|
+
n[0] || (n[0] = (v) => isRef(s) ? s.value = v : null),
|
|
100
|
+
n[1] || (n[1] = (v) => o(v))
|
|
101
101
|
]
|
|
102
102
|
}, {
|
|
103
103
|
default: withCtx(() => [
|
|
104
|
-
createVNode(
|
|
104
|
+
createVNode(d, {
|
|
105
105
|
label: unref(a)("connect.template.rule.time.all_time"),
|
|
106
106
|
value: "all_time"
|
|
107
107
|
}, null, 8, ["label"]),
|
|
108
|
-
createVNode(
|
|
108
|
+
createVNode(d, {
|
|
109
109
|
label: unref(a)("connect.template.rule.time.custom"),
|
|
110
110
|
value: "custom"
|
|
111
111
|
}, null, 8, ["label"])
|
|
112
112
|
]),
|
|
113
113
|
_: 1
|
|
114
114
|
}, 8, ["modelValue"]),
|
|
115
|
-
unref(
|
|
115
|
+
unref(s) == "custom" ? (openBlock(), createBlock(_sfc_main$j, {
|
|
116
116
|
key: 0,
|
|
117
117
|
class: "!mt-[0px]",
|
|
118
118
|
"include-only": "trigger",
|
|
@@ -138,28 +138,28 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
140
|
emits: ["update:model-value"],
|
|
141
|
-
setup(e, { emit:
|
|
142
|
-
const a = e, r =
|
|
143
|
-
const { property:
|
|
141
|
+
setup(e, { emit: c }) {
|
|
142
|
+
const a = e, r = c, u = computed(() => {
|
|
143
|
+
const { property: s, operator: o, equator: l } = RuleBuilder.simplify(
|
|
144
144
|
a.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
145
145
|
op: "before",
|
|
146
146
|
x: 1
|
|
147
147
|
})
|
|
148
148
|
);
|
|
149
149
|
return {
|
|
150
|
-
property:
|
|
151
|
-
operator:
|
|
152
|
-
equator:
|
|
150
|
+
property: s,
|
|
151
|
+
operator: o,
|
|
152
|
+
equator: l
|
|
153
153
|
};
|
|
154
154
|
});
|
|
155
|
-
return (
|
|
156
|
-
const
|
|
155
|
+
return (s, o) => {
|
|
156
|
+
const l = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
|
|
157
157
|
return openBlock(), createElementBlock("div", null, [
|
|
158
|
-
createVNode(
|
|
158
|
+
createVNode(l, {
|
|
159
159
|
label: "On birthday",
|
|
160
160
|
value: "_isRange-day",
|
|
161
161
|
"model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
|
|
162
|
-
"onUpdate:modelValue":
|
|
162
|
+
"onUpdate:modelValue": o[0] || (o[0] = () => {
|
|
163
163
|
r(
|
|
164
164
|
"update:model-value",
|
|
165
165
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
@@ -170,11 +170,11 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
170
170
|
);
|
|
171
171
|
})
|
|
172
172
|
}, null, 8, ["model-value"]),
|
|
173
|
-
createVNode(
|
|
173
|
+
createVNode(l, {
|
|
174
174
|
label: "N days before birthday",
|
|
175
175
|
value: "_isDay",
|
|
176
176
|
"model-value": unref(u).operator,
|
|
177
|
-
"onUpdate:modelValue":
|
|
177
|
+
"onUpdate:modelValue": o[1] || (o[1] = () => {
|
|
178
178
|
r(
|
|
179
179
|
"update:model-value",
|
|
180
180
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
@@ -190,20 +190,20 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
190
190
|
label: "Days before birthday",
|
|
191
191
|
"show-steppers": !1,
|
|
192
192
|
"model-value": unref(u).equator.x,
|
|
193
|
-
"onUpdate:modelValue":
|
|
193
|
+
"onUpdate:modelValue": o[2] || (o[2] = (d) => r(
|
|
194
194
|
"update:model-value",
|
|
195
195
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
196
196
|
op: "after",
|
|
197
|
-
x:
|
|
197
|
+
x: d,
|
|
198
198
|
ignoreYear: !0
|
|
199
199
|
})
|
|
200
200
|
))
|
|
201
201
|
}, null, 8, ["model-value"])) : createCommentVNode("", !0),
|
|
202
|
-
createVNode(
|
|
202
|
+
createVNode(l, {
|
|
203
203
|
label: "In birthday week",
|
|
204
204
|
value: "_isRange-week",
|
|
205
205
|
"model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
|
|
206
|
-
"onUpdate:modelValue":
|
|
206
|
+
"onUpdate:modelValue": o[3] || (o[3] = () => {
|
|
207
207
|
r(
|
|
208
208
|
"update:model-value",
|
|
209
209
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
@@ -214,11 +214,11 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
214
214
|
);
|
|
215
215
|
})
|
|
216
216
|
}, null, 8, ["model-value"]),
|
|
217
|
-
createVNode(
|
|
217
|
+
createVNode(l, {
|
|
218
218
|
label: "In birthday month",
|
|
219
219
|
value: "_isRange-month",
|
|
220
220
|
"model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
|
|
221
|
-
"onUpdate:modelValue":
|
|
221
|
+
"onUpdate:modelValue": o[4] || (o[4] = () => {
|
|
222
222
|
r(
|
|
223
223
|
"update:model-value",
|
|
224
224
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
@@ -248,16 +248,16 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
248
248
|
}
|
|
249
249
|
},
|
|
250
250
|
emits: ["update:model-value"],
|
|
251
|
-
setup(e, { emit:
|
|
252
|
-
const a = e, r =
|
|
253
|
-
(
|
|
251
|
+
setup(e, { emit: c }) {
|
|
252
|
+
const a = e, r = c, u = computed(() => a.disabled ? TypeToTriggerOptions[a.campaignType].filter(
|
|
253
|
+
(s) => s.value == a.modelValue
|
|
254
254
|
) : TypeToTriggerOptions[a.campaignType]);
|
|
255
|
-
return (
|
|
256
|
-
const
|
|
255
|
+
return (s, o) => {
|
|
256
|
+
const l = resolveComponent("FmCard");
|
|
257
257
|
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
258
258
|
_hoisted_2$e,
|
|
259
259
|
createElementVNode("div", _hoisted_3$c, [
|
|
260
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(
|
|
260
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(l, {
|
|
261
261
|
variant: "outlined",
|
|
262
262
|
disabled: a.disabled,
|
|
263
263
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
@@ -293,27 +293,27 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
293
293
|
}
|
|
294
294
|
},
|
|
295
295
|
emits: ["update:model-value"],
|
|
296
|
-
setup(e, { emit:
|
|
297
|
-
const a =
|
|
296
|
+
setup(e, { emit: c }) {
|
|
297
|
+
const a = c;
|
|
298
298
|
return (r, u) => {
|
|
299
|
-
const
|
|
300
|
-
return openBlock(), createBlock(
|
|
299
|
+
const s = resolveComponent("FmButton"), o = resolveComponent("FmField"), l = resolveComponent("FmDatePicker");
|
|
300
|
+
return openBlock(), createBlock(l, {
|
|
301
301
|
label: e.label,
|
|
302
302
|
"model-value": e.modelValue || "",
|
|
303
303
|
"onUpdate:modelValue": u[1] || (u[1] = (n) => a("update:model-value", n))
|
|
304
304
|
}, {
|
|
305
305
|
"trigger-button": withCtx(({ opened: n }) => [
|
|
306
|
-
createVNode(
|
|
306
|
+
createVNode(o, {
|
|
307
307
|
class: "flex items-center",
|
|
308
308
|
"prepend-icon": "calendar_month",
|
|
309
309
|
"icon-outlined": !n
|
|
310
310
|
}, {
|
|
311
311
|
append: withCtx(() => [
|
|
312
|
-
e.modelValue ? (openBlock(), createBlock(
|
|
312
|
+
e.modelValue ? (openBlock(), createBlock(s, {
|
|
313
313
|
key: 0,
|
|
314
314
|
variant: "tertiary",
|
|
315
315
|
icon: "clear",
|
|
316
|
-
onClick: u[0] || (u[0] = (
|
|
316
|
+
onClick: u[0] || (u[0] = (d) => (d.stopPropagation(), a("update:model-value", null)))
|
|
317
317
|
})) : createCommentVNode("", !0)
|
|
318
318
|
]),
|
|
319
319
|
default: withCtx(() => [
|
|
@@ -337,19 +337,19 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
337
337
|
}
|
|
338
338
|
},
|
|
339
339
|
emits: ["update:model-value"],
|
|
340
|
-
setup(e, { emit:
|
|
341
|
-
const a =
|
|
340
|
+
setup(e, { emit: c }) {
|
|
341
|
+
const a = c;
|
|
342
342
|
return (r, u) => {
|
|
343
|
-
var
|
|
343
|
+
var s, o;
|
|
344
344
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
345
345
|
createElementVNode("div", _hoisted_2$d, [
|
|
346
346
|
createVNode(_sfc_main$f, {
|
|
347
|
-
"model-value": ((
|
|
347
|
+
"model-value": ((s = e.modelValue) == null ? void 0 : s.startDate) ?? null,
|
|
348
348
|
label: "Start date",
|
|
349
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
349
|
+
"onUpdate:modelValue": u[0] || (u[0] = (l) => {
|
|
350
350
|
var n;
|
|
351
351
|
return a("update:model-value", {
|
|
352
|
-
startDate:
|
|
352
|
+
startDate: l,
|
|
353
353
|
endDate: ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null
|
|
354
354
|
});
|
|
355
355
|
})
|
|
@@ -358,13 +358,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
358
358
|
_hoisted_3$b,
|
|
359
359
|
createElementVNode("div", _hoisted_4$a, [
|
|
360
360
|
createVNode(_sfc_main$f, {
|
|
361
|
-
"model-value": ((
|
|
361
|
+
"model-value": ((o = e.modelValue) == null ? void 0 : o.endDate) ?? null,
|
|
362
362
|
label: "End date",
|
|
363
|
-
"onUpdate:modelValue": u[1] || (u[1] = (
|
|
363
|
+
"onUpdate:modelValue": u[1] || (u[1] = (l) => {
|
|
364
364
|
var n;
|
|
365
365
|
return a("update:model-value", {
|
|
366
366
|
startDate: ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
|
|
367
|
-
endDate:
|
|
367
|
+
endDate: l
|
|
368
368
|
});
|
|
369
369
|
})
|
|
370
370
|
}, null, 8, ["model-value"])
|
|
@@ -390,15 +390,15 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
390
390
|
}
|
|
391
391
|
},
|
|
392
392
|
emits: ["update:model-value"],
|
|
393
|
-
setup(e, { emit:
|
|
394
|
-
const a = e, r =
|
|
393
|
+
setup(e, { emit: c }) {
|
|
394
|
+
const a = e, r = c;
|
|
395
395
|
function u() {
|
|
396
396
|
const y = RuleBuilder.getRules(a.modelValue);
|
|
397
397
|
return y.length == 0 ? "fixed" : y.some(
|
|
398
398
|
(v) => isRuleEntry(v) && RuleBuilder.simplify(v).operator == "_rrule"
|
|
399
399
|
) ? "repeating" : "fixed";
|
|
400
400
|
}
|
|
401
|
-
const
|
|
401
|
+
const s = ref(u()), o = ref(!1), l = computed(() => {
|
|
402
402
|
const y = RuleBuilder.getRules(a.modelValue), v = y.find(
|
|
403
403
|
(p) => isRuleEntry(p) && RuleBuilder.simplify(p).property == "trigger.date"
|
|
404
404
|
), h = y.find(
|
|
@@ -416,7 +416,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
416
416
|
a.endDate ? new Date(a.endDate) : void 0
|
|
417
417
|
)
|
|
418
418
|
);
|
|
419
|
-
function
|
|
419
|
+
function d(y) {
|
|
420
420
|
const v = y.label.toLowerCase(), h = v == "fixed" ? [
|
|
421
421
|
RuleBuilder.constructEntry(
|
|
422
422
|
"trigger.date",
|
|
@@ -438,10 +438,10 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
438
438
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
439
439
|
h
|
|
440
440
|
)
|
|
441
|
-
),
|
|
441
|
+
), s.value = v;
|
|
442
442
|
}
|
|
443
443
|
function g(y) {
|
|
444
|
-
|
|
444
|
+
s.value == "fixed" ? r(
|
|
445
445
|
"update:model-value",
|
|
446
446
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
447
447
|
RuleBuilder.constructEntry(
|
|
@@ -472,33 +472,33 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
472
472
|
);
|
|
473
473
|
}
|
|
474
474
|
return (y, v) => {
|
|
475
|
-
const h = resolveComponent("FmButtonGroup"), p = resolveComponent("FmTimePicker"),
|
|
475
|
+
const h = resolveComponent("FmButtonGroup"), p = resolveComponent("FmTimePicker"), i = resolveComponent("FmIcon"), f = resolveComponent("FmTooltip"), m = resolveComponent("FmField"), b = resolveComponent("FmCard"), x = resolveComponent("FmPopover"), k = resolveComponent("FmDatePicker"), C = resolveComponent("FmHelperText");
|
|
476
476
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
477
477
|
createVNode(h, {
|
|
478
478
|
items: [{ label: "Fixed" }, { label: "Repeating" }],
|
|
479
|
-
"model-value": { label: unref(cases).title(unref(
|
|
480
|
-
"onUpdate:modelValue":
|
|
479
|
+
"model-value": { label: unref(cases).title(unref(s)) },
|
|
480
|
+
"onUpdate:modelValue": d,
|
|
481
481
|
class: "mb-8"
|
|
482
482
|
}, null, 8, ["model-value"]),
|
|
483
483
|
createElementVNode("div", _hoisted_1$d, [
|
|
484
484
|
createElementVNode("div", _hoisted_2$c, [
|
|
485
485
|
createVNode(p, {
|
|
486
486
|
label: "Notify time",
|
|
487
|
-
"model-value": unref(
|
|
488
|
-
"onUpdate:modelValue": v[0] || (v[0] = (B) => g({ date: unref(
|
|
489
|
-
"helper-text": unref(
|
|
490
|
-
"helper-state": unref(
|
|
487
|
+
"model-value": unref(l).time,
|
|
488
|
+
"onUpdate:modelValue": v[0] || (v[0] = (B) => g({ date: unref(l).date, time: B })),
|
|
489
|
+
"helper-text": unref(l).time ? void 0 : "Time is required",
|
|
490
|
+
"helper-state": unref(l).time ? void 0 : "error"
|
|
491
491
|
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
492
|
-
unref(
|
|
492
|
+
unref(s) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$a, [
|
|
493
493
|
createElementVNode("div", _hoisted_4$9, [
|
|
494
494
|
_hoisted_5$5,
|
|
495
|
-
unref(
|
|
495
|
+
unref(l).date ? (openBlock(), createBlock(f, {
|
|
496
496
|
key: 0,
|
|
497
497
|
"z-index": 9999,
|
|
498
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(
|
|
498
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(l).date).options)
|
|
499
499
|
}, {
|
|
500
500
|
default: withCtx(() => [
|
|
501
|
-
createVNode(
|
|
501
|
+
createVNode(i, {
|
|
502
502
|
name: "info",
|
|
503
503
|
size: "sm",
|
|
504
504
|
outline: !0
|
|
@@ -508,17 +508,17 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
508
508
|
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
509
509
|
]),
|
|
510
510
|
createVNode(x, {
|
|
511
|
-
"show-popover": unref(
|
|
512
|
-
onPopoverChanged: v[3] || (v[3] = (B) =>
|
|
511
|
+
"show-popover": unref(o),
|
|
512
|
+
onPopoverChanged: v[3] || (v[3] = (B) => o.value = B)
|
|
513
513
|
}, {
|
|
514
514
|
"popover-button": withCtx(() => [
|
|
515
515
|
createVNode(m, {
|
|
516
516
|
class: "cursor-pointer",
|
|
517
|
-
"helper-text": unref(
|
|
518
|
-
"helper-state": unref(
|
|
517
|
+
"helper-text": unref(l).date ? void 0 : "Date is required",
|
|
518
|
+
"helper-state": unref(l).date ? void 0 : "error"
|
|
519
519
|
}, {
|
|
520
520
|
default: withCtx(() => [
|
|
521
|
-
createElementVNode("div", _hoisted_6$3, toDisplayString(unref(
|
|
521
|
+
createElementVNode("div", _hoisted_6$3, toDisplayString(unref(l).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(l).date).options) : "Set a repeating date"), 1)
|
|
522
522
|
]),
|
|
523
523
|
_: 1
|
|
524
524
|
}, 8, ["helper-text", "helper-state"])
|
|
@@ -528,9 +528,9 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
528
528
|
default: withCtx(() => [
|
|
529
529
|
createVNode(_sfc_main$k, {
|
|
530
530
|
"apply-button": !0,
|
|
531
|
-
"model-value": unref(
|
|
532
|
-
onCancel: v[1] || (v[1] = (B) =>
|
|
533
|
-
"onUpdate:modelValue": v[2] || (v[2] = (B) => (g({ date: B, time: unref(
|
|
531
|
+
"model-value": unref(l).date || "",
|
|
532
|
+
onCancel: v[1] || (v[1] = (B) => o.value = !1),
|
|
533
|
+
"onUpdate:modelValue": v[2] || (v[2] = (B) => (g({ date: B, time: unref(l).time }), o.value = !1))
|
|
534
534
|
}, null, 8, ["model-value"])
|
|
535
535
|
]),
|
|
536
536
|
_: 1
|
|
@@ -541,13 +541,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
541
541
|
])) : (openBlock(), createBlock(k, {
|
|
542
542
|
key: 1,
|
|
543
543
|
label: "Notify date",
|
|
544
|
-
"model-value": unref(
|
|
545
|
-
"onUpdate:modelValue": v[4] || (v[4] = (B) => g({ date: B, time: unref(
|
|
546
|
-
"helper-text": unref(
|
|
547
|
-
"helper-state": unref(
|
|
544
|
+
"model-value": unref(l).date || "",
|
|
545
|
+
"onUpdate:modelValue": v[4] || (v[4] = (B) => g({ date: B, time: unref(l).time })),
|
|
546
|
+
"helper-text": unref(l).date ? void 0 : "Date is required",
|
|
547
|
+
"helper-state": unref(l).date ? void 0 : "error"
|
|
548
548
|
}, null, 8, ["model-value", "helper-text", "helper-state"]))
|
|
549
549
|
]),
|
|
550
|
-
unref(
|
|
550
|
+
unref(l).date && unref(l).time && unref(n) ? (openBlock(), createBlock(C, {
|
|
551
551
|
key: 0,
|
|
552
552
|
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
|
|
553
553
|
${unref(hooks)(unref(n)).format("hh:mmA")} (${unref(hooks)(unref(n)).fromNow()})`
|
|
@@ -564,8 +564,8 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
564
564
|
}
|
|
565
565
|
},
|
|
566
566
|
emits: ["update:model-value"],
|
|
567
|
-
setup(e, { emit:
|
|
568
|
-
const a = e, r =
|
|
567
|
+
setup(e, { emit: c }) {
|
|
568
|
+
const a = e, r = c, u = computed(
|
|
569
569
|
() => [
|
|
570
570
|
{
|
|
571
571
|
label: "Fortune Wheel",
|
|
@@ -579,14 +579,14 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
579
579
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
|
|
580
580
|
hidden: !0
|
|
581
581
|
}
|
|
582
|
-
].filter((
|
|
582
|
+
].filter((s) => !s.hidden)
|
|
583
583
|
);
|
|
584
|
-
return (
|
|
585
|
-
const
|
|
584
|
+
return (s, o) => {
|
|
585
|
+
const l = resolveComponent("FmCard");
|
|
586
586
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
587
587
|
_hoisted_2$b,
|
|
588
588
|
createElementVNode("div", _hoisted_3$9, [
|
|
589
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(
|
|
589
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(l, {
|
|
590
590
|
variant: "outlined",
|
|
591
591
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
592
592
|
"col-span-2": unref(u).length == 1,
|
|
@@ -614,30 +614,30 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
614
614
|
}, _hoisted_2$a = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1), _hoisted_3$8 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1), _hoisted_4$7 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
615
615
|
__name: "EditRewardPoolSheet",
|
|
616
616
|
emits: ["update:model-value"],
|
|
617
|
-
setup(e, { expose:
|
|
618
|
-
const r = useMembershipStore(), { minor: u } = useLoading,
|
|
619
|
-
var
|
|
620
|
-
return ((
|
|
617
|
+
setup(e, { expose: c, emit: a }) {
|
|
618
|
+
const r = useMembershipStore(), { minor: u } = useLoading, s = ref(!1), o = ref(), l = ref(), n = ref(0), d = computed(() => {
|
|
619
|
+
var i;
|
|
620
|
+
return ((i = r.loyaltyRewards.items.find(
|
|
621
621
|
(f) => {
|
|
622
622
|
var m;
|
|
623
|
-
return f.value === ((m =
|
|
623
|
+
return f.value === ((m = o.value) == null ? void 0 : m.collectible);
|
|
624
624
|
}
|
|
625
|
-
)) == null ? void 0 :
|
|
625
|
+
)) == null ? void 0 : i.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
626
626
|
}), g = computed(() => {
|
|
627
|
-
const p =
|
|
627
|
+
const p = d.value.safeParse(o.value);
|
|
628
628
|
return p.success ? [] : p.error.errors;
|
|
629
629
|
});
|
|
630
|
-
function y(p,
|
|
631
|
-
p && (
|
|
630
|
+
function y(p, i, f) {
|
|
631
|
+
p && (o.value = i, n.value = f), s.value = p;
|
|
632
632
|
}
|
|
633
633
|
const v = a;
|
|
634
634
|
async function h() {
|
|
635
|
-
const p =
|
|
635
|
+
const p = d.value.safeParse(o.value);
|
|
636
636
|
p.success && (await u(
|
|
637
637
|
async () => {
|
|
638
|
-
p.data.type === "VOUCHER" &&
|
|
639
|
-
p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0,
|
|
640
|
-
|
|
638
|
+
p.data.type === "VOUCHER" && l.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
|
|
639
|
+
p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, l.value),
|
|
640
|
+
l.value
|
|
641
641
|
));
|
|
642
642
|
},
|
|
643
643
|
{
|
|
@@ -646,16 +646,16 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
646
646
|
}
|
|
647
647
|
), v("update:model-value", p.data, n.value));
|
|
648
648
|
}
|
|
649
|
-
return
|
|
649
|
+
return c({
|
|
650
650
|
showSheet: y
|
|
651
|
-
}), (p,
|
|
651
|
+
}), (p, i) => {
|
|
652
652
|
const f = resolveComponent("FmSelect"), m = resolveComponent("FmStepperField"), b = resolveComponent("FmButton"), x = resolveComponent("FmSideSheet");
|
|
653
653
|
return openBlock(), createBlock(x, {
|
|
654
654
|
"max-width": 560,
|
|
655
|
-
modelValue: unref(
|
|
655
|
+
modelValue: unref(s),
|
|
656
656
|
"onUpdate:modelValue": [
|
|
657
|
-
|
|
658
|
-
|
|
657
|
+
i[9] || (i[9] = (k) => isRef(s) ? s.value = k : null),
|
|
658
|
+
i[10] || (i[10] = (k) => s.value = k)
|
|
659
659
|
],
|
|
660
660
|
header: "Edit reward",
|
|
661
661
|
"dismiss-away": ""
|
|
@@ -667,20 +667,20 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
667
667
|
type: "button",
|
|
668
668
|
disabled: unref(g).length > 0,
|
|
669
669
|
label: "Confirm",
|
|
670
|
-
onClick:
|
|
670
|
+
onClick: i[7] || (i[7] = (k) => h())
|
|
671
671
|
}, null, 8, ["disabled"]),
|
|
672
672
|
createVNode(b, {
|
|
673
673
|
variant: "secondary",
|
|
674
674
|
type: "button",
|
|
675
675
|
label: "Cancel",
|
|
676
|
-
onClick:
|
|
676
|
+
onClick: i[8] || (i[8] = (k) => s.value = !1)
|
|
677
677
|
})
|
|
678
678
|
])
|
|
679
679
|
]),
|
|
680
680
|
default: withCtx(() => {
|
|
681
681
|
var k, C, B;
|
|
682
682
|
return [
|
|
683
|
-
unref(
|
|
683
|
+
unref(o) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
684
684
|
createVNode(f, {
|
|
685
685
|
label: "Reward Type",
|
|
686
686
|
items: [
|
|
@@ -688,13 +688,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
688
688
|
{ label: "Voucher", value: "VOUCHER" },
|
|
689
689
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
690
690
|
],
|
|
691
|
-
"model-value": unref(
|
|
692
|
-
"onUpdate:modelValue":
|
|
693
|
-
V == "NO_REWARD" ?
|
|
691
|
+
"model-value": unref(o).type,
|
|
692
|
+
"onUpdate:modelValue": i[0] || (i[0] = (V) => {
|
|
693
|
+
V == "NO_REWARD" ? o.value = {
|
|
694
694
|
type: "NO_REWARD",
|
|
695
695
|
collectible: null,
|
|
696
696
|
weight: 1
|
|
697
|
-
} : V === "VOUCHER" ?
|
|
697
|
+
} : V === "VOUCHER" ? o.value = {
|
|
698
698
|
collectible: null,
|
|
699
699
|
type: "VOUCHER",
|
|
700
700
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -708,7 +708,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
708
708
|
validForDay: 7
|
|
709
709
|
},
|
|
710
710
|
weight: 1
|
|
711
|
-
} :
|
|
711
|
+
} : o.value = {
|
|
712
712
|
collectible: unref(r).loyaltyRewards.raw[0]._id,
|
|
713
713
|
type: "LOYALTY",
|
|
714
714
|
earningOption: {
|
|
@@ -722,73 +722,73 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
722
722
|
};
|
|
723
723
|
})
|
|
724
724
|
}, null, 8, ["model-value"]),
|
|
725
|
-
unref(
|
|
725
|
+
unref(o).type == "LOYALTY" ? (openBlock(), createBlock(f, {
|
|
726
726
|
key: 0,
|
|
727
727
|
label: "Loyalty type",
|
|
728
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
728
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(d), "collectible", [unref(o).type])],
|
|
729
729
|
items: unref(r).loyaltyRewards.items,
|
|
730
|
-
"model-value": unref(
|
|
731
|
-
"onUpdate:modelValue":
|
|
730
|
+
"model-value": unref(o).collectible,
|
|
731
|
+
"onUpdate:modelValue": i[1] || (i[1] = (V) => unref(o).collectible = V)
|
|
732
732
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
733
733
|
createVNode(m, {
|
|
734
734
|
label: "Weight",
|
|
735
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
736
|
-
"model-value": unref(
|
|
737
|
-
"onUpdate:modelValue":
|
|
738
|
-
...unref(
|
|
735
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(d), "weight", [unref(o).type])],
|
|
736
|
+
"model-value": unref(o).weight,
|
|
737
|
+
"onUpdate:modelValue": i[2] || (i[2] = (V) => o.value = {
|
|
738
|
+
...unref(o),
|
|
739
739
|
weight: V
|
|
740
740
|
})
|
|
741
741
|
}, null, 8, ["rules", "model-value"]),
|
|
742
|
-
unref(
|
|
742
|
+
unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
743
743
|
((k = unref(r).loyaltyRewards.items.find(
|
|
744
744
|
(V) => {
|
|
745
745
|
var R;
|
|
746
|
-
return V.value === ((R = unref(
|
|
746
|
+
return V.value === ((R = unref(o)) == null ? void 0 : R.collectible);
|
|
747
747
|
}
|
|
748
748
|
)) == null ? void 0 : k.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
749
749
|
_hoisted_2$a,
|
|
750
750
|
createVNode(_sfc_main$l, {
|
|
751
751
|
class: "mt-[-8px]",
|
|
752
752
|
rules: [
|
|
753
|
-
unref(ZodHelper).ruleAtPath(unref(
|
|
753
|
+
unref(ZodHelper).ruleAtPath(unref(d), "earningOption", [unref(o).type])
|
|
754
754
|
],
|
|
755
755
|
"helper-state": unref(ZodHelper).helperState(unref(g), "earningOption"),
|
|
756
756
|
"error-text": unref(ZodHelper).helperText(unref(g), "earningOption"),
|
|
757
757
|
"fixed-type": !0,
|
|
758
|
-
"model-value": unref(
|
|
759
|
-
"onUpdate:modelValue":
|
|
760
|
-
...unref(
|
|
758
|
+
"model-value": unref(o).earningOption,
|
|
759
|
+
"onUpdate:modelValue": i[3] || (i[3] = (V) => o.value = {
|
|
760
|
+
...unref(o),
|
|
761
761
|
earningOption: V
|
|
762
762
|
})
|
|
763
763
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
764
764
|
], 64)) : createCommentVNode("", !0),
|
|
765
765
|
_hoisted_3$8,
|
|
766
766
|
createVNode(_sfc_main$m, {
|
|
767
|
-
type: unref(
|
|
768
|
-
"for-credit": unref(
|
|
767
|
+
type: unref(o).type === "LOYALTY" ? "custom" : "range",
|
|
768
|
+
"for-credit": unref(o).type === "LOYALTY" && ((C = unref(r).loyaltyRewards.items.find(
|
|
769
769
|
(V) => {
|
|
770
770
|
var R;
|
|
771
|
-
return V.value === ((R = unref(
|
|
771
|
+
return V.value === ((R = unref(o)) == null ? void 0 : R.collectible);
|
|
772
772
|
}
|
|
773
773
|
)) == null ? void 0 : C.raw.type) === "CREDIT",
|
|
774
774
|
class: "!gap-24",
|
|
775
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
776
|
-
"model-value": unref(
|
|
777
|
-
"onUpdate:modelValue":
|
|
778
|
-
...unref(
|
|
775
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(d), "validityOption", [unref(o).type])],
|
|
776
|
+
"model-value": unref(o).validityOption,
|
|
777
|
+
"onUpdate:modelValue": i[4] || (i[4] = (V) => o.value = {
|
|
778
|
+
...unref(o),
|
|
779
779
|
validityOption: V
|
|
780
780
|
})
|
|
781
781
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
782
782
|
], 64)) : createCommentVNode("", !0),
|
|
783
|
-
unref(
|
|
783
|
+
unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
|
|
784
784
|
key: 2,
|
|
785
|
-
"reward-image": unref(
|
|
786
|
-
"model-value": ((B = unref(
|
|
787
|
-
"onUpdate:modelValue":
|
|
788
|
-
...unref(
|
|
785
|
+
"reward-image": unref(l),
|
|
786
|
+
"model-value": ((B = unref(o)) == null ? void 0 : B.collectibleConfig) ?? void 0,
|
|
787
|
+
"onUpdate:modelValue": i[5] || (i[5] = (V) => o.value = {
|
|
788
|
+
...unref(o),
|
|
789
789
|
collectibleConfig: V
|
|
790
790
|
}),
|
|
791
|
-
"onUpdate:rewardImage":
|
|
791
|
+
"onUpdate:rewardImage": i[6] || (i[6] = (V) => l.value = V)
|
|
792
792
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
793
793
|
createVNode(JsonViewer, { json: unref(g) }, null, 8, ["json"])
|
|
794
794
|
])) : createCommentVNode("", !0)
|
|
@@ -817,33 +817,33 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
817
817
|
}
|
|
818
818
|
},
|
|
819
819
|
emits: ["update:model-value"],
|
|
820
|
-
setup(e, { emit:
|
|
821
|
-
const a = e, r =
|
|
822
|
-
const p =
|
|
820
|
+
setup(e, { emit: c }) {
|
|
821
|
+
const a = e, r = c, u = useMembershipStore(), s = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => a.modelValue ?? []), l = computed(() => {
|
|
822
|
+
const p = s.safeParse(o.value);
|
|
823
823
|
return p.success ? [] : p.error.errors;
|
|
824
824
|
}), n = ref();
|
|
825
|
-
function
|
|
825
|
+
function d(p, i) {
|
|
826
826
|
var m;
|
|
827
|
-
const f = [...
|
|
828
|
-
f[
|
|
827
|
+
const f = [...o.value];
|
|
828
|
+
f[i] = p, (m = n.value) == null || m.showSheet(!1), r("update:model-value", f);
|
|
829
829
|
}
|
|
830
830
|
function g(p) {
|
|
831
|
-
const
|
|
831
|
+
const i = p.type == "VOUCHER" ? p.collectibleConfig : u.collectibles.find(
|
|
832
832
|
(b) => b._id.toString() == p.collectible
|
|
833
|
-
), f = CollectionUtils.formattedType((
|
|
833
|
+
), f = CollectionUtils.formattedType((i == null ? void 0 : i.name) || ""), m = p.weight;
|
|
834
834
|
return {
|
|
835
835
|
label: isNullOrEmpty(f) ? "NO REWARD" : f,
|
|
836
|
-
sublabel: `${m} (${(m /
|
|
836
|
+
sublabel: `${m} (${(m / o.value.reduce((b, x) => b + x.weight, 0) * 100).toFixed(2)}%)`
|
|
837
837
|
};
|
|
838
838
|
}
|
|
839
839
|
function y(p) {
|
|
840
840
|
var f;
|
|
841
|
-
const
|
|
842
|
-
(f = n.value) == null || f.showSheet(!0,
|
|
841
|
+
const i = [...o.value];
|
|
842
|
+
(f = n.value) == null || f.showSheet(!0, i[p], p);
|
|
843
843
|
}
|
|
844
844
|
function v(p) {
|
|
845
|
-
const
|
|
846
|
-
|
|
845
|
+
const i = [...o.value];
|
|
846
|
+
i.splice(p, 1), r("update:model-value", i);
|
|
847
847
|
}
|
|
848
848
|
function h() {
|
|
849
849
|
var p;
|
|
@@ -854,20 +854,20 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
854
854
|
collectible: null,
|
|
855
855
|
weight: 1
|
|
856
856
|
},
|
|
857
|
-
|
|
857
|
+
o.value.length
|
|
858
858
|
);
|
|
859
859
|
}
|
|
860
|
-
return (p,
|
|
860
|
+
return (p, i) => {
|
|
861
861
|
const f = resolveComponent("FmButton"), m = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
|
|
862
862
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
863
863
|
_hoisted_2$9,
|
|
864
864
|
createVNode(f, {
|
|
865
865
|
label: "Add Reward",
|
|
866
|
-
onClick:
|
|
866
|
+
onClick: i[0] || (i[0] = (x) => h()),
|
|
867
867
|
variant: "plain",
|
|
868
868
|
icon: "add"
|
|
869
869
|
}),
|
|
870
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
870
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (x, k) => (openBlock(), createBlock(m, {
|
|
871
871
|
key: k,
|
|
872
872
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
873
873
|
variant: "outlined",
|
|
@@ -889,7 +889,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
889
889
|
}),
|
|
890
890
|
_: 2
|
|
891
891
|
}, 1032, ["onClick"]))), 128)),
|
|
892
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
892
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((x) => x.path.join(".") == ""), (x) => (openBlock(), createBlock(b, {
|
|
893
893
|
key: x.message,
|
|
894
894
|
text: x.message,
|
|
895
895
|
state: "error"
|
|
@@ -897,7 +897,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
897
897
|
createVNode(_sfc_main$b, {
|
|
898
898
|
ref_key: "sheetRef",
|
|
899
899
|
ref: n,
|
|
900
|
-
"onUpdate:modelValue":
|
|
900
|
+
"onUpdate:modelValue": d
|
|
901
901
|
}, null, 512)
|
|
902
902
|
]);
|
|
903
903
|
};
|
|
@@ -913,32 +913,32 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
913
913
|
}
|
|
914
914
|
},
|
|
915
915
|
emits: ["update:model-value"],
|
|
916
|
-
setup(e, { emit:
|
|
917
|
-
const a = e, r =
|
|
916
|
+
setup(e, { emit: c }) {
|
|
917
|
+
const a = e, r = c, u = computed(() => [
|
|
918
918
|
{
|
|
919
919
|
label: "Rock paper scissor",
|
|
920
920
|
description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
|
|
921
921
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
|
|
922
922
|
}
|
|
923
923
|
]);
|
|
924
|
-
return (
|
|
924
|
+
return (s, o) => {
|
|
925
925
|
var g, y, v;
|
|
926
|
-
const
|
|
926
|
+
const l = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), d = resolveComponent("FmHelperText");
|
|
927
927
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
928
|
-
createVNode(
|
|
928
|
+
createVNode(l, {
|
|
929
929
|
label: "Enable game",
|
|
930
930
|
"model-value": !!((g = e.modelValue) != null && g.gameType),
|
|
931
|
-
"onUpdate:modelValue":
|
|
931
|
+
"onUpdate:modelValue": o[0] || (o[0] = (h) => h ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
|
|
932
932
|
}, null, 8, ["model-value"]),
|
|
933
933
|
((y = e.modelValue) == null ? void 0 : y.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
934
934
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (h) => {
|
|
935
|
-
var p,
|
|
935
|
+
var p, i;
|
|
936
936
|
return openBlock(), createBlock(n, {
|
|
937
937
|
variant: "outlined",
|
|
938
938
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
939
939
|
"col-span-2": unref(u).length == 1,
|
|
940
940
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((p = e.modelValue) == null ? void 0 : p.gameType) == h.value,
|
|
941
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
941
|
+
"hover:bg-fm-color-opacity-sm": ((i = e.modelValue) == null ? void 0 : i.gameType) != h.value
|
|
942
942
|
}]),
|
|
943
943
|
onClick: () => {
|
|
944
944
|
var f;
|
|
@@ -954,7 +954,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
954
954
|
}, 1032, ["class", "onClick"]);
|
|
955
955
|
}), 128))
|
|
956
956
|
])) : createCommentVNode("", !0),
|
|
957
|
-
((v = e.modelValue) == null ? void 0 : v.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(
|
|
957
|
+
((v = e.modelValue) == null ? void 0 : v.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(d, {
|
|
958
958
|
key: 1,
|
|
959
959
|
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)",
|
|
960
960
|
state: "warning"
|
|
@@ -970,8 +970,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
970
970
|
}
|
|
971
971
|
},
|
|
972
972
|
emits: ["update:model-value"],
|
|
973
|
-
setup(e, { emit:
|
|
974
|
-
const a = e, r =
|
|
973
|
+
setup(e, { emit: c }) {
|
|
974
|
+
const a = e, r = c, u = computed(() => [
|
|
975
975
|
{
|
|
976
976
|
label: "Stamp",
|
|
977
977
|
description: "Award stamps for purchases, redeemable after reaching set milestones.",
|
|
@@ -983,12 +983,12 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
983
983
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
984
984
|
}
|
|
985
985
|
]);
|
|
986
|
-
return (
|
|
987
|
-
const
|
|
986
|
+
return (s, o) => {
|
|
987
|
+
const l = resolveComponent("FmCard");
|
|
988
988
|
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
989
989
|
_hoisted_2$7,
|
|
990
990
|
createElementVNode("div", _hoisted_3$5, [
|
|
991
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(
|
|
991
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(l, {
|
|
992
992
|
variant: "outlined",
|
|
993
993
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
994
994
|
"col-span-2": unref(u).length == 1,
|
|
@@ -1024,16 +1024,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1024
1024
|
}
|
|
1025
1025
|
},
|
|
1026
1026
|
emits: ["update:model-value"],
|
|
1027
|
-
setup(e, { emit:
|
|
1028
|
-
const a =
|
|
1027
|
+
setup(e, { emit: c }) {
|
|
1028
|
+
const a = c;
|
|
1029
1029
|
return (r, u) => {
|
|
1030
|
-
const
|
|
1030
|
+
const s = resolveComponent("FmStepperField");
|
|
1031
1031
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1032
1032
|
_hoisted_2$6,
|
|
1033
|
-
createVNode(
|
|
1033
|
+
createVNode(s, {
|
|
1034
1034
|
label: "Maximum to collect",
|
|
1035
1035
|
"model-value": e.modelValue || null,
|
|
1036
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
1036
|
+
"onUpdate:modelValue": u[0] || (u[0] = (o) => a("update:model-value", o)),
|
|
1037
1037
|
"helper-text": e.helperText || "Set the threshold required for reward eligibility",
|
|
1038
1038
|
"helper-state": e.helperState || "none"
|
|
1039
1039
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
@@ -1049,26 +1049,26 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1049
1049
|
}
|
|
1050
1050
|
},
|
|
1051
1051
|
emits: ["update:model-value"],
|
|
1052
|
-
setup(e, { expose:
|
|
1053
|
-
const r = e, u = useMembershipStore(), { minor:
|
|
1052
|
+
setup(e, { expose: c, emit: a }) {
|
|
1053
|
+
const r = e, u = useMembershipStore(), { minor: s } = useLoading, o = ref(!1), l = ref(), n = ref(), d = ref(0), g = computed(() => {
|
|
1054
1054
|
var m;
|
|
1055
1055
|
return ((m = u.loyaltyRewards.items.find(
|
|
1056
1056
|
(b) => {
|
|
1057
1057
|
var x;
|
|
1058
|
-
return b.value === ((x =
|
|
1058
|
+
return b.value === ((x = l.value) == null ? void 0 : x.collectible);
|
|
1059
1059
|
}
|
|
1060
1060
|
)) == null ? void 0 : m.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
|
|
1061
1061
|
}), y = computed(() => {
|
|
1062
|
-
const f = g.value.safeParse(
|
|
1062
|
+
const f = g.value.safeParse(l.value);
|
|
1063
1063
|
return f.success ? [] : f.error.errors;
|
|
1064
1064
|
});
|
|
1065
1065
|
function v(f, m, b) {
|
|
1066
|
-
f && (
|
|
1066
|
+
f && (l.value = m, d.value = b), o.value = f;
|
|
1067
1067
|
}
|
|
1068
1068
|
const h = a;
|
|
1069
1069
|
async function p() {
|
|
1070
|
-
const f = g.value.safeParse(
|
|
1071
|
-
f.success && (await
|
|
1070
|
+
const f = g.value.safeParse(l.value);
|
|
1071
|
+
f.success && (await s(
|
|
1072
1072
|
async () => {
|
|
1073
1073
|
f.data.type === "VOUCHER" && n.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1074
1074
|
f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
|
|
@@ -1079,19 +1079,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1079
1079
|
message: "Uploading reward image",
|
|
1080
1080
|
successMessage: "Reward image updated"
|
|
1081
1081
|
}
|
|
1082
|
-
), h("update:model-value", f.data,
|
|
1082
|
+
), h("update:model-value", f.data, d.value));
|
|
1083
1083
|
}
|
|
1084
|
-
const
|
|
1085
|
-
return
|
|
1084
|
+
const i = ref();
|
|
1085
|
+
return c({
|
|
1086
1086
|
showSheet: v
|
|
1087
1087
|
}), (f, m) => {
|
|
1088
1088
|
const b = resolveComponent("FmStepperField"), x = resolveComponent("FmSelect"), k = resolveComponent("FmForm"), C = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
|
|
1089
1089
|
return openBlock(), createBlock(B, {
|
|
1090
1090
|
"max-width": 560,
|
|
1091
|
-
modelValue: unref(
|
|
1091
|
+
modelValue: unref(o),
|
|
1092
1092
|
"onUpdate:modelValue": [
|
|
1093
|
-
m[10] || (m[10] = (V) => isRef(
|
|
1094
|
-
m[11] || (m[11] = (V) =>
|
|
1093
|
+
m[10] || (m[10] = (V) => isRef(o) ? o.value = V : null),
|
|
1094
|
+
m[11] || (m[11] = (V) => o.value = V)
|
|
1095
1095
|
],
|
|
1096
1096
|
header: "Edit reward",
|
|
1097
1097
|
"dismiss-away": ""
|
|
@@ -1105,30 +1105,30 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1105
1105
|
disabled: unref(y).length > 0,
|
|
1106
1106
|
onClick: m[8] || (m[8] = async () => {
|
|
1107
1107
|
var V;
|
|
1108
|
-
return (V = unref(
|
|
1108
|
+
return (V = unref(i)) == null ? void 0 : V.validateInputs();
|
|
1109
1109
|
})
|
|
1110
1110
|
}, null, 8, ["disabled"]),
|
|
1111
1111
|
createVNode(C, {
|
|
1112
1112
|
variant: "secondary",
|
|
1113
1113
|
type: "button",
|
|
1114
1114
|
label: "Cancel",
|
|
1115
|
-
onClick: m[9] || (m[9] = (V) =>
|
|
1115
|
+
onClick: m[9] || (m[9] = (V) => o.value = !1)
|
|
1116
1116
|
})
|
|
1117
1117
|
])
|
|
1118
1118
|
]),
|
|
1119
1119
|
default: withCtx(() => [
|
|
1120
|
-
createVNode(JsonViewer, { json: unref(
|
|
1121
|
-
unref(
|
|
1120
|
+
createVNode(JsonViewer, { json: unref(l) }, null, 8, ["json"]),
|
|
1121
|
+
unref(l) ? (openBlock(), createBlock(k, {
|
|
1122
1122
|
key: 0,
|
|
1123
1123
|
class: "flex flex-col gap-y-24",
|
|
1124
1124
|
ref_key: "formRef",
|
|
1125
|
-
ref:
|
|
1125
|
+
ref: i,
|
|
1126
1126
|
onValidationSuccess: m[7] || (m[7] = (V) => p())
|
|
1127
1127
|
}, {
|
|
1128
1128
|
default: withCtx(() => {
|
|
1129
1129
|
var V, R;
|
|
1130
1130
|
return [
|
|
1131
|
-
unref(
|
|
1131
|
+
unref(l).type ? (openBlock(), createBlock(b, {
|
|
1132
1132
|
key: 0,
|
|
1133
1133
|
label: "Threshold",
|
|
1134
1134
|
rules: [
|
|
@@ -1139,9 +1139,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1139
1139
|
)
|
|
1140
1140
|
)
|
|
1141
1141
|
],
|
|
1142
|
-
"model-value": unref(
|
|
1143
|
-
"onUpdate:modelValue": m[0] || (m[0] = (E) =>
|
|
1144
|
-
...unref(
|
|
1142
|
+
"model-value": unref(l).threshold,
|
|
1143
|
+
"onUpdate:modelValue": m[0] || (m[0] = (E) => l.value = {
|
|
1144
|
+
...unref(l),
|
|
1145
1145
|
threshold: E
|
|
1146
1146
|
})
|
|
1147
1147
|
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
@@ -1151,10 +1151,10 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1151
1151
|
{ label: "Voucher", value: "VOUCHER" },
|
|
1152
1152
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1153
1153
|
],
|
|
1154
|
-
"model-value": unref(
|
|
1154
|
+
"model-value": unref(l).type,
|
|
1155
1155
|
"onUpdate:modelValue": m[1] || (m[1] = (E) => {
|
|
1156
1156
|
var S, $;
|
|
1157
|
-
E === "VOUCHER" ?
|
|
1157
|
+
E === "VOUCHER" ? l.value = {
|
|
1158
1158
|
collectible: null,
|
|
1159
1159
|
type: "VOUCHER",
|
|
1160
1160
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1167,8 +1167,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1167
1167
|
validityOption: {
|
|
1168
1168
|
validForDay: 7
|
|
1169
1169
|
},
|
|
1170
|
-
threshold: (S = unref(
|
|
1171
|
-
} :
|
|
1170
|
+
threshold: (S = unref(l)) == null ? void 0 : S.threshold
|
|
1171
|
+
} : l.value = {
|
|
1172
1172
|
collectible: unref(u).loyaltyRewards.raw[0]._id,
|
|
1173
1173
|
type: "LOYALTY",
|
|
1174
1174
|
earningOption: {
|
|
@@ -1178,55 +1178,55 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1178
1178
|
validityOption: {
|
|
1179
1179
|
validForDay: 7
|
|
1180
1180
|
},
|
|
1181
|
-
threshold: ($ = unref(
|
|
1181
|
+
threshold: ($ = unref(l)) == null ? void 0 : $.threshold
|
|
1182
1182
|
};
|
|
1183
1183
|
})
|
|
1184
1184
|
}, null, 8, ["model-value"]),
|
|
1185
|
-
unref(
|
|
1185
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(x, {
|
|
1186
1186
|
key: 1,
|
|
1187
1187
|
label: "Loyalty type",
|
|
1188
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(g), "collectible", [unref(
|
|
1188
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(g), "collectible", [unref(l).type])],
|
|
1189
1189
|
items: unref(u).loyaltyRewards.items,
|
|
1190
|
-
"model-value": unref(
|
|
1191
|
-
"onUpdate:modelValue": m[2] || (m[2] = (E) => unref(
|
|
1190
|
+
"model-value": unref(l).collectible,
|
|
1191
|
+
"onUpdate:modelValue": m[2] || (m[2] = (E) => unref(l).collectible = E)
|
|
1192
1192
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1193
|
-
unref(
|
|
1193
|
+
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
1194
1194
|
_hoisted_1$6,
|
|
1195
1195
|
createVNode(_sfc_main$l, {
|
|
1196
1196
|
class: "mt-[-8px]",
|
|
1197
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(g), "earningOption", [unref(
|
|
1197
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(g), "earningOption", [unref(l).type])],
|
|
1198
1198
|
"helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
|
|
1199
1199
|
"error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
|
|
1200
1200
|
"fixed-type": !0,
|
|
1201
|
-
"model-value": unref(
|
|
1202
|
-
"onUpdate:modelValue": m[3] || (m[3] = (E) =>
|
|
1203
|
-
...unref(
|
|
1201
|
+
"model-value": unref(l).earningOption,
|
|
1202
|
+
"onUpdate:modelValue": m[3] || (m[3] = (E) => l.value = {
|
|
1203
|
+
...unref(l),
|
|
1204
1204
|
earningOption: E
|
|
1205
1205
|
})
|
|
1206
1206
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
1207
1207
|
createVNode(_sfc_main$m, {
|
|
1208
1208
|
class: "!gap-24",
|
|
1209
|
-
type: unref(
|
|
1210
|
-
"for-credit": unref(
|
|
1209
|
+
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
1210
|
+
"for-credit": unref(l).type === "LOYALTY" && ((V = unref(u).loyaltyRewards.items.find(
|
|
1211
1211
|
(E) => {
|
|
1212
1212
|
var S;
|
|
1213
|
-
return E.value === ((S = unref(
|
|
1213
|
+
return E.value === ((S = unref(l)) == null ? void 0 : S.collectible);
|
|
1214
1214
|
}
|
|
1215
1215
|
)) == null ? void 0 : V.raw.type) === "CREDIT",
|
|
1216
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(g), "validityOption", [unref(
|
|
1217
|
-
"model-value": unref(
|
|
1218
|
-
"onUpdate:modelValue": m[4] || (m[4] = (E) =>
|
|
1219
|
-
...unref(
|
|
1216
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(g), "validityOption", [unref(l).type])],
|
|
1217
|
+
"model-value": unref(l).validityOption,
|
|
1218
|
+
"onUpdate:modelValue": m[4] || (m[4] = (E) => l.value = {
|
|
1219
|
+
...unref(l),
|
|
1220
1220
|
validityOption: E
|
|
1221
1221
|
})
|
|
1222
1222
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
1223
1223
|
], 64)) : createCommentVNode("", !0),
|
|
1224
|
-
unref(
|
|
1224
|
+
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
|
|
1225
1225
|
key: 3,
|
|
1226
1226
|
"reward-image": unref(n),
|
|
1227
|
-
"model-value": ((R = unref(
|
|
1228
|
-
"onUpdate:modelValue": m[5] || (m[5] = (E) =>
|
|
1229
|
-
...unref(
|
|
1227
|
+
"model-value": ((R = unref(l)) == null ? void 0 : R.collectibleConfig) ?? void 0,
|
|
1228
|
+
"onUpdate:modelValue": m[5] || (m[5] = (E) => l.value = {
|
|
1229
|
+
...unref(l),
|
|
1230
1230
|
collectibleConfig: E
|
|
1231
1231
|
}),
|
|
1232
1232
|
"onUpdate:rewardImage": m[6] || (m[6] = (E) => n.value = E)
|
|
@@ -1265,13 +1265,13 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1265
1265
|
}
|
|
1266
1266
|
},
|
|
1267
1267
|
setup(e) {
|
|
1268
|
-
const
|
|
1268
|
+
const c = e, { maxRange: a, currentRange: r, markers: u } = toRefs(c), s = computed(
|
|
1269
1269
|
() => Math.min(r.value / a.value * 100, 100)
|
|
1270
|
-
),
|
|
1271
|
-
return (
|
|
1272
|
-
const
|
|
1270
|
+
), o = (l) => l / a.value * 100;
|
|
1271
|
+
return (l, n) => {
|
|
1272
|
+
const d = resolveComponent("FmIcon");
|
|
1273
1273
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1274
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (g) => (openBlock(), createBlock(
|
|
1274
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (g) => (openBlock(), createBlock(d, {
|
|
1275
1275
|
class: normalizeClass(
|
|
1276
1276
|
unref(r) >= g ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
1277
1277
|
),
|
|
@@ -1285,12 +1285,12 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1285
1285
|
}, [
|
|
1286
1286
|
createElementVNode("div", {
|
|
1287
1287
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
1288
|
-
style: normalizeStyle({ width: unref(
|
|
1288
|
+
style: normalizeStyle({ width: unref(s) + "%" })
|
|
1289
1289
|
}, null, 4),
|
|
1290
1290
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (g, y) => (openBlock(), createElementBlock("div", {
|
|
1291
1291
|
key: y,
|
|
1292
1292
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
1293
|
-
style: normalizeStyle({ left:
|
|
1293
|
+
style: normalizeStyle({ left: o(g) + "%" })
|
|
1294
1294
|
}, [
|
|
1295
1295
|
createElementVNode("div", _hoisted_2$4, [
|
|
1296
1296
|
createElementVNode("div", {
|
|
@@ -1304,16 +1304,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1304
1304
|
}
|
|
1305
1305
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
1306
1306
|
function changeKeysFactory(e) {
|
|
1307
|
-
return function
|
|
1307
|
+
return function c(a, r = 1, u) {
|
|
1308
1308
|
if (r === 0 || !isObject(a))
|
|
1309
1309
|
return a;
|
|
1310
1310
|
if (Array.isArray(a))
|
|
1311
|
-
return a.map((
|
|
1312
|
-
const
|
|
1313
|
-
return Object.keys(a).forEach((
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1316
|
-
}),
|
|
1311
|
+
return a.map((o) => c(o, r - 1, u));
|
|
1312
|
+
const s = Object.create(Object.getPrototypeOf(a));
|
|
1313
|
+
return Object.keys(a).forEach((o) => {
|
|
1314
|
+
const l = a[o], n = e(o, u), d = c(l, r - 1, u);
|
|
1315
|
+
s[n] = d;
|
|
1316
|
+
}), s;
|
|
1317
1317
|
};
|
|
1318
1318
|
}
|
|
1319
1319
|
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1), _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1), _hoisted_6$2 = { class: "flex items-center gap-4" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1), _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
@@ -1329,39 +1329,39 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1329
1329
|
}
|
|
1330
1330
|
},
|
|
1331
1331
|
emits: ["update:model-value"],
|
|
1332
|
-
setup(e, { emit:
|
|
1333
|
-
const a = e, r =
|
|
1334
|
-
() => a.modelValue.sort((
|
|
1335
|
-
),
|
|
1336
|
-
const
|
|
1337
|
-
return
|
|
1332
|
+
setup(e, { emit: c }) {
|
|
1333
|
+
const a = e, r = c, u = useMembershipStore(), s = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
|
|
1334
|
+
() => a.modelValue.sort((i, f) => i.threshold - f.threshold) ?? []
|
|
1335
|
+
), l = computed(() => {
|
|
1336
|
+
const i = s.safeParse(o.value);
|
|
1337
|
+
return i.success ? [] : i.error.errors;
|
|
1338
1338
|
}), n = ref();
|
|
1339
|
-
function
|
|
1339
|
+
function d(i, f) {
|
|
1340
1340
|
var b;
|
|
1341
|
-
const m = [...
|
|
1342
|
-
m[f] =
|
|
1341
|
+
const m = [...o.value];
|
|
1342
|
+
m[f] = i, (b = n.value) == null || b.showSheet(!1), r("update:model-value", m);
|
|
1343
1343
|
}
|
|
1344
|
-
function g(
|
|
1345
|
-
const f =
|
|
1346
|
-
(b) => b._id.toString() ==
|
|
1344
|
+
function g(i) {
|
|
1345
|
+
const f = i.type == "VOUCHER" ? i.collectibleConfig : u.collectibles.find(
|
|
1346
|
+
(b) => b._id.toString() == i.collectible
|
|
1347
1347
|
), m = CollectionUtils.formattedType((f == null ? void 0 : f.name) || "");
|
|
1348
1348
|
return {
|
|
1349
1349
|
label: isNullOrEmpty(m) ? "NO REWARD" : m,
|
|
1350
|
-
sublabel: `Reward at ${
|
|
1350
|
+
sublabel: `Reward at ${i.threshold} | Amount: ${i.earningOption.type == "FIXED" ? i.earningOption.amount : `${i.earningOption.amount} for every RM${i.earningOption.every} spent`} `
|
|
1351
1351
|
};
|
|
1352
1352
|
}
|
|
1353
|
-
function y(
|
|
1353
|
+
function y(i) {
|
|
1354
1354
|
var m;
|
|
1355
|
-
const f = [...
|
|
1356
|
-
(m = n.value) == null || m.showSheet(!0, f[
|
|
1355
|
+
const f = [...o.value];
|
|
1356
|
+
(m = n.value) == null || m.showSheet(!0, f[i], i);
|
|
1357
1357
|
}
|
|
1358
|
-
function v(
|
|
1359
|
-
const f = [...
|
|
1360
|
-
f.splice(
|
|
1358
|
+
function v(i) {
|
|
1359
|
+
const f = [...o.value];
|
|
1360
|
+
f.splice(i, 1), r("update:model-value", f);
|
|
1361
1361
|
}
|
|
1362
1362
|
function h() {
|
|
1363
|
-
var
|
|
1364
|
-
(
|
|
1363
|
+
var i;
|
|
1364
|
+
(i = n.value) == null || i.showSheet(
|
|
1365
1365
|
!0,
|
|
1366
1366
|
{
|
|
1367
1367
|
type: "LOYALTY",
|
|
@@ -1375,18 +1375,18 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1375
1375
|
amount: 1
|
|
1376
1376
|
}
|
|
1377
1377
|
},
|
|
1378
|
-
|
|
1378
|
+
o.value.length
|
|
1379
1379
|
);
|
|
1380
1380
|
}
|
|
1381
|
-
function p(
|
|
1381
|
+
function p(i) {
|
|
1382
1382
|
var f, m;
|
|
1383
|
-
return
|
|
1383
|
+
return i.type == "VOUCHER" ? (f = i.collectibleConfig) == null ? void 0 : f.name : sentenceCase(
|
|
1384
1384
|
((m = u.loyaltyRewards.items.find(
|
|
1385
|
-
(b) => b.value ==
|
|
1385
|
+
(b) => b.value == i.collectible
|
|
1386
1386
|
)) == null ? void 0 : m.label) || ""
|
|
1387
1387
|
);
|
|
1388
1388
|
}
|
|
1389
|
-
return (
|
|
1389
|
+
return (i, f) => {
|
|
1390
1390
|
const m = resolveComponent("FmButton"), b = resolveComponent("FmCard"), x = resolveComponent("FmHelperText");
|
|
1391
1391
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
1392
1392
|
_hoisted_2$3,
|
|
@@ -1396,7 +1396,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1396
1396
|
variant: "plain",
|
|
1397
1397
|
icon: "add"
|
|
1398
1398
|
}),
|
|
1399
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1399
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (k, C) => (openBlock(), createBlock(b, {
|
|
1400
1400
|
key: C,
|
|
1401
1401
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1402
1402
|
variant: "outlined",
|
|
@@ -1415,7 +1415,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1415
1415
|
]),
|
|
1416
1416
|
_: 2
|
|
1417
1417
|
}, 1032, ["onClick"]))), 128)),
|
|
1418
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1418
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((k) => k.path.join(".") == ""), (k) => (openBlock(), createBlock(x, {
|
|
1419
1419
|
key: k.message,
|
|
1420
1420
|
text: k.message,
|
|
1421
1421
|
state: "error"
|
|
@@ -1451,7 +1451,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1451
1451
|
createVNode(_sfc_main$6, {
|
|
1452
1452
|
ref_key: "sheetRef",
|
|
1453
1453
|
ref: n,
|
|
1454
|
-
"onUpdate:modelValue":
|
|
1454
|
+
"onUpdate:modelValue": d,
|
|
1455
1455
|
"max-threshold": e.mission.end
|
|
1456
1456
|
}, null, 8, ["max-threshold"])
|
|
1457
1457
|
]);
|
|
@@ -1463,10 +1463,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1463
1463
|
modelValue: Object
|
|
1464
1464
|
},
|
|
1465
1465
|
emits: ["update:model-value"],
|
|
1466
|
-
setup(e, { emit:
|
|
1466
|
+
setup(e, { emit: c }) {
|
|
1467
1467
|
const a = e, r = computed(() => {
|
|
1468
|
-
const
|
|
1469
|
-
return
|
|
1468
|
+
const o = FdoMission.safeParse(a.modelValue);
|
|
1469
|
+
return o.success ? [] : o.error.errors;
|
|
1470
1470
|
}), u = computed(() => [
|
|
1471
1471
|
{
|
|
1472
1472
|
label: "Stamp",
|
|
@@ -1478,10 +1478,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1478
1478
|
description: "Reward customers when they reach a cumulative spending goal.",
|
|
1479
1479
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
1480
1480
|
}
|
|
1481
|
-
]),
|
|
1482
|
-
return (
|
|
1481
|
+
]), s = c;
|
|
1482
|
+
return (o, l) => {
|
|
1483
1483
|
var g;
|
|
1484
|
-
const n = resolveComponent("FmCard"),
|
|
1484
|
+
const n = resolveComponent("FmCard"), d = resolveComponent("FmStepperField");
|
|
1485
1485
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
1486
1486
|
createElementVNode("div", _hoisted_2$2, [
|
|
1487
1487
|
_hoisted_3$2,
|
|
@@ -1497,11 +1497,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1497
1497
|
"hover:bg-fm-color-opacity-sm": ((h = e.modelValue) == null ? void 0 : h.type) != y.value
|
|
1498
1498
|
}]),
|
|
1499
1499
|
onClick: () => {
|
|
1500
|
-
var p,
|
|
1501
|
-
((p = e.modelValue) == null ? void 0 : p.type) != y.value &&
|
|
1500
|
+
var p, i;
|
|
1501
|
+
((p = e.modelValue) == null ? void 0 : p.type) != y.value && s("update:model-value", {
|
|
1502
1502
|
...e.modelValue,
|
|
1503
1503
|
type: y.value,
|
|
1504
|
-
end: ((
|
|
1504
|
+
end: ((i = e.modelValue) == null ? void 0 : i.end) || 1
|
|
1505
1505
|
});
|
|
1506
1506
|
},
|
|
1507
1507
|
key: y.value
|
|
@@ -1518,12 +1518,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1518
1518
|
createElementVNode("div", _hoisted_8$1, [
|
|
1519
1519
|
_hoisted_9$1,
|
|
1520
1520
|
_hoisted_10$1,
|
|
1521
|
-
createVNode(
|
|
1521
|
+
createVNode(d, {
|
|
1522
1522
|
label: "Maximum to collect",
|
|
1523
1523
|
"model-value": ((g = e.modelValue) == null ? void 0 : g.end) || null,
|
|
1524
|
-
"onUpdate:modelValue":
|
|
1524
|
+
"onUpdate:modelValue": l[0] || (l[0] = (y) => {
|
|
1525
1525
|
var v;
|
|
1526
|
-
return
|
|
1526
|
+
return s("update:model-value", {
|
|
1527
1527
|
...e.modelValue,
|
|
1528
1528
|
type: ((v = e.modelValue) == null ? void 0 : v.type) || "STAMP",
|
|
1529
1529
|
end: y
|
|
@@ -1558,12 +1558,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1558
1558
|
}
|
|
1559
1559
|
},
|
|
1560
1560
|
emits: ["update:model-value", "update:file"],
|
|
1561
|
-
setup(e, { emit:
|
|
1562
|
-
const { t: a } = useI18n(), r = e, u =
|
|
1563
|
-
function
|
|
1561
|
+
setup(e, { emit: c }) {
|
|
1562
|
+
const { t: a } = useI18n(), r = e, u = c;
|
|
1563
|
+
function s(d) {
|
|
1564
1564
|
switch (r.field.type) {
|
|
1565
1565
|
case "timeframe":
|
|
1566
|
-
const g =
|
|
1566
|
+
const g = d.startDate ? hooks(d.startDate).startOf("day").toISOString() : void 0, y = d.endDate ? hooks(d.endDate).endOf("day").toISOString() : void 0;
|
|
1567
1567
|
u("update:model-value", {
|
|
1568
1568
|
type: "timeframe",
|
|
1569
1569
|
property: "__now",
|
|
@@ -1574,33 +1574,33 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1574
1574
|
case "image": {
|
|
1575
1575
|
u(
|
|
1576
1576
|
"update:file",
|
|
1577
|
-
|
|
1578
|
-
|
|
1577
|
+
d,
|
|
1578
|
+
o.value || firebaseStorage.collectibleImagePath(void 0, d)
|
|
1579
1579
|
);
|
|
1580
1580
|
break;
|
|
1581
1581
|
}
|
|
1582
1582
|
default:
|
|
1583
|
-
u("update:model-value",
|
|
1583
|
+
u("update:model-value", d);
|
|
1584
1584
|
break;
|
|
1585
1585
|
}
|
|
1586
1586
|
}
|
|
1587
|
-
const
|
|
1587
|
+
const o = computed(() => {
|
|
1588
1588
|
switch (r.field.type) {
|
|
1589
1589
|
case "timeframe": {
|
|
1590
|
-
const
|
|
1590
|
+
const d = r.modelValue;
|
|
1591
1591
|
return {
|
|
1592
|
-
startDate:
|
|
1593
|
-
endDate:
|
|
1592
|
+
startDate: d != null && d.start ? hooks(d == null ? void 0 : d.start).format("YYYY-MM-DD") : null,
|
|
1593
|
+
endDate: d != null && d.end ? hooks(d == null ? void 0 : d.end).format("YYYY-MM-DD") : null
|
|
1594
1594
|
};
|
|
1595
1595
|
}
|
|
1596
1596
|
default:
|
|
1597
1597
|
return r.modelValue;
|
|
1598
1598
|
}
|
|
1599
1599
|
});
|
|
1600
|
-
function
|
|
1600
|
+
function l() {
|
|
1601
1601
|
if (!n.value.schema) return [];
|
|
1602
|
-
const
|
|
1603
|
-
return
|
|
1602
|
+
const d = n.value.schema.safeParse(r.modelValue);
|
|
1603
|
+
return d.success ? [] : d.error.errors;
|
|
1604
1604
|
}
|
|
1605
1605
|
const n = computed(() => ({
|
|
1606
1606
|
schema: r.schema,
|
|
@@ -1609,16 +1609,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1609
1609
|
labelMark: r.schema && ZodHelper.isRequired(r.schema) == !1 ? "optional" : void 0,
|
|
1610
1610
|
zodLabel: r.schema ? ZodHelper.toInputLabel(r.schema, r.field.label) : void 0
|
|
1611
1611
|
}));
|
|
1612
|
-
return (
|
|
1612
|
+
return (d, g) => {
|
|
1613
1613
|
var f, m, b, x, k;
|
|
1614
|
-
const y = resolveComponent("FmTextField"), v = resolveComponent("FmStepperField"), h = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"),
|
|
1614
|
+
const y = resolveComponent("FmTextField"), v = resolveComponent("FmStepperField"), h = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), i = resolveComponent("FmSwitch");
|
|
1615
1615
|
return e.field.type === "text" ? (openBlock(), createBlock(y, {
|
|
1616
1616
|
key: 0,
|
|
1617
1617
|
label: unref(a)(e.field.label),
|
|
1618
1618
|
"label-mark": unref(n).labelMark,
|
|
1619
1619
|
rules: unref(n).rules,
|
|
1620
|
-
"model-value": unref(
|
|
1621
|
-
"onUpdate:modelValue":
|
|
1620
|
+
"model-value": unref(o),
|
|
1621
|
+
"onUpdate:modelValue": s,
|
|
1622
1622
|
"helper-state": e.helperText ? "error" : void 0,
|
|
1623
1623
|
"helper-text": e.helperText
|
|
1624
1624
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
@@ -1628,9 +1628,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1628
1628
|
createVNode(v, {
|
|
1629
1629
|
label: unref(a)(e.field.label),
|
|
1630
1630
|
"label-mark": e.field.isRuleChildren ? void 0 : unref(n).labelMark,
|
|
1631
|
-
"model-value": unref(
|
|
1631
|
+
"model-value": unref(o),
|
|
1632
1632
|
rules: e.field.isRuleChildren ? [] : unref(n).rules,
|
|
1633
|
-
"onUpdate:modelValue":
|
|
1633
|
+
"onUpdate:modelValue": s,
|
|
1634
1634
|
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
1635
1635
|
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
1636
1636
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
@@ -1639,64 +1639,64 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1639
1639
|
label: unref(a)(e.field.label),
|
|
1640
1640
|
"label-mark": unref(n).labelMark,
|
|
1641
1641
|
rules: unref(n).rules,
|
|
1642
|
-
"model-value": unref(
|
|
1643
|
-
"onUpdate:modelValue":
|
|
1642
|
+
"model-value": unref(o),
|
|
1643
|
+
"onUpdate:modelValue": s,
|
|
1644
1644
|
"show-word-count": "",
|
|
1645
1645
|
"max-length": (k = (x = (b = (m = (f = unref(n)) == null ? void 0 : f.unwrapped) == null ? void 0 : m._def) == null ? void 0 : b.checks) == null ? void 0 : x.find((C) => C.kind == "max")) == null ? void 0 : k.value
|
|
1646
1646
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$g, {
|
|
1647
1647
|
key: 3,
|
|
1648
1648
|
"campaign-type": e.extras,
|
|
1649
|
-
"model-value": unref(
|
|
1649
|
+
"model-value": unref(o),
|
|
1650
1650
|
disabled: e.disabled,
|
|
1651
|
-
"onUpdate:modelValue":
|
|
1651
|
+
"onUpdate:modelValue": s
|
|
1652
1652
|
}, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
1653
1653
|
createVNode(_sfc_main$e, {
|
|
1654
|
-
"model-value": unref(
|
|
1655
|
-
"onUpdate:modelValue":
|
|
1654
|
+
"model-value": unref(o),
|
|
1655
|
+
"onUpdate:modelValue": s
|
|
1656
1656
|
}, null, 8, ["model-value"]),
|
|
1657
1657
|
createVNode(p, {
|
|
1658
1658
|
class: "!mt-[8px]",
|
|
1659
|
-
text: unref(ZodHelper).helperText(
|
|
1660
|
-
state: unref(ZodHelper).helperState(
|
|
1659
|
+
text: unref(ZodHelper).helperText(l(), ""),
|
|
1660
|
+
state: unref(ZodHelper).helperState(l(), "")
|
|
1661
1661
|
}, null, 8, ["text", "state"])
|
|
1662
1662
|
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
1663
1663
|
key: 5,
|
|
1664
|
-
thumbnail: unref(
|
|
1664
|
+
thumbnail: unref(o),
|
|
1665
1665
|
"aspect-ratio": "16 / 9",
|
|
1666
1666
|
class: "w-1/2 xs:w-2/3",
|
|
1667
|
-
"onUpdate:file":
|
|
1667
|
+
"onUpdate:file": s
|
|
1668
1668
|
}, {
|
|
1669
1669
|
label: withCtx(() => [
|
|
1670
1670
|
(openBlock(), createBlock(resolveDynamicComponent(unref(n).zodLabel)))
|
|
1671
1671
|
]),
|
|
1672
1672
|
_: 1
|
|
1673
|
-
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(
|
|
1673
|
+
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(i, {
|
|
1674
1674
|
key: 6,
|
|
1675
1675
|
label: unref(a)(e.field.label),
|
|
1676
1676
|
"label-placement": "right",
|
|
1677
1677
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
1678
1678
|
"label-mark": unref(n).labelMark,
|
|
1679
1679
|
rules: unref(n).rules,
|
|
1680
|
-
"model-value": unref(
|
|
1681
|
-
"onUpdate:modelValue":
|
|
1680
|
+
"model-value": unref(o),
|
|
1681
|
+
"onUpdate:modelValue": s
|
|
1682
1682
|
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$p, {
|
|
1683
1683
|
key: 7,
|
|
1684
|
-
"model-value": unref(
|
|
1685
|
-
"onUpdate:modelValue":
|
|
1684
|
+
"model-value": unref(o),
|
|
1685
|
+
"onUpdate:modelValue": s,
|
|
1686
1686
|
"no-campaign": !1,
|
|
1687
1687
|
schema: unref(n).schema,
|
|
1688
1688
|
"is-mission": e.extras === "MISSION"
|
|
1689
1689
|
}, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$q, {
|
|
1690
1690
|
key: 8,
|
|
1691
|
-
"model-value": unref(
|
|
1692
|
-
"onUpdate:modelValue":
|
|
1691
|
+
"model-value": unref(o),
|
|
1692
|
+
"onUpdate:modelValue": s
|
|
1693
1693
|
}, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
|
|
1694
1694
|
createVNode(_sfc_main$r, {
|
|
1695
|
-
"model-value": unref(
|
|
1696
|
-
"onUpdate:modelValue":
|
|
1695
|
+
"model-value": unref(o),
|
|
1696
|
+
"onUpdate:modelValue": s,
|
|
1697
1697
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
1698
1698
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
1699
|
-
unref(
|
|
1699
|
+
unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
|
|
1700
1700
|
key: 0,
|
|
1701
1701
|
class: "!mt-[8px]",
|
|
1702
1702
|
text: unref(a)("connect.campaign.common.effect_required"),
|
|
@@ -1705,54 +1705,54 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1705
1705
|
], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$s, {
|
|
1706
1706
|
key: 10,
|
|
1707
1707
|
"allow-email": !0,
|
|
1708
|
-
"model-value": unref(
|
|
1709
|
-
"onUpdate:modelValue":
|
|
1710
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
1708
|
+
"model-value": unref(o),
|
|
1709
|
+
"onUpdate:modelValue": s,
|
|
1710
|
+
"helper-text": unref(ZodHelper).helperText(l(), ""),
|
|
1711
1711
|
"trigger-type": e.field.extras,
|
|
1712
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
1712
|
+
"helper-state": unref(ZodHelper).helperState(l(), "")
|
|
1713
1713
|
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$l, {
|
|
1714
1714
|
key: 11,
|
|
1715
|
-
"model-value": unref(
|
|
1716
|
-
"onUpdate:modelValue":
|
|
1715
|
+
"model-value": unref(o),
|
|
1716
|
+
"onUpdate:modelValue": s,
|
|
1717
1717
|
extras: e.extras,
|
|
1718
1718
|
"error-text": e.helperText
|
|
1719
1719
|
}, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$m, {
|
|
1720
1720
|
key: 12,
|
|
1721
1721
|
type: "custom",
|
|
1722
|
-
"model-value": unref(
|
|
1723
|
-
"onUpdate:modelValue":
|
|
1724
|
-
"helper-text": e.helperText || unref(ZodHelper).helperText(
|
|
1722
|
+
"model-value": unref(o),
|
|
1723
|
+
"onUpdate:modelValue": s,
|
|
1724
|
+
"helper-text": e.helperText || unref(ZodHelper).helperText(l(), "")
|
|
1725
1725
|
}, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$c, {
|
|
1726
1726
|
key: 13,
|
|
1727
|
-
"model-value": unref(
|
|
1728
|
-
"onUpdate:modelValue":
|
|
1727
|
+
"model-value": unref(o),
|
|
1728
|
+
"onUpdate:modelValue": s
|
|
1729
1729
|
}, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
|
|
1730
1730
|
key: 14,
|
|
1731
|
-
"model-value": unref(
|
|
1732
|
-
"onUpdate:modelValue":
|
|
1731
|
+
"model-value": unref(o),
|
|
1732
|
+
"onUpdate:modelValue": s
|
|
1733
1733
|
}, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
|
|
1734
1734
|
key: 15,
|
|
1735
|
-
"model-value": unref(
|
|
1736
|
-
"onUpdate:modelValue":
|
|
1735
|
+
"model-value": unref(o),
|
|
1736
|
+
"onUpdate:modelValue": s
|
|
1737
1737
|
}, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
1738
1738
|
key: 16,
|
|
1739
|
-
"model-value": unref(
|
|
1740
|
-
"onUpdate:modelValue":
|
|
1739
|
+
"model-value": unref(o),
|
|
1740
|
+
"onUpdate:modelValue": s
|
|
1741
1741
|
}, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
|
|
1742
1742
|
key: 17,
|
|
1743
|
-
"model-value": unref(
|
|
1744
|
-
"onUpdate:modelValue":
|
|
1745
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
1746
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
1743
|
+
"model-value": unref(o),
|
|
1744
|
+
"onUpdate:modelValue": s,
|
|
1745
|
+
"helper-text": unref(ZodHelper).helperText(l(), ""),
|
|
1746
|
+
"helper-state": unref(ZodHelper).helperState(l(), "")
|
|
1747
1747
|
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
1748
1748
|
key: 18,
|
|
1749
|
-
"model-value": unref(
|
|
1750
|
-
"onUpdate:modelValue":
|
|
1749
|
+
"model-value": unref(o),
|
|
1750
|
+
"onUpdate:modelValue": s,
|
|
1751
1751
|
mission: e.extras.mission
|
|
1752
1752
|
}, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
|
|
1753
1753
|
createVNode(_sfc_main$d, {
|
|
1754
|
-
"model-value": unref(
|
|
1755
|
-
"onUpdate:modelValue":
|
|
1754
|
+
"model-value": unref(o),
|
|
1755
|
+
"onUpdate:modelValue": s,
|
|
1756
1756
|
"start-date": e.extras.start,
|
|
1757
1757
|
"end-date": e.extras.end
|
|
1758
1758
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
@@ -1764,8 +1764,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1764
1764
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1765
1765
|
], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
|
|
1766
1766
|
createVNode(_sfc_main$t, {
|
|
1767
|
-
"model-value": unref(
|
|
1768
|
-
"onUpdate:modelValue":
|
|
1767
|
+
"model-value": unref(o),
|
|
1768
|
+
"onUpdate:modelValue": s
|
|
1769
1769
|
}, null, 8, ["model-value"]),
|
|
1770
1770
|
e.helperText ? (openBlock(), createBlock(p, {
|
|
1771
1771
|
key: 0,
|
|
@@ -1774,14 +1774,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1774
1774
|
state: "error"
|
|
1775
1775
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1776
1776
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
|
|
1777
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(
|
|
1777
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(o).rules.g_time).length > 0 ? (openBlock(), createBlock(p, {
|
|
1778
1778
|
key: 0,
|
|
1779
1779
|
state: "warning",
|
|
1780
1780
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
1781
1781
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
1782
1782
|
createVNode(_sfc_main$i, {
|
|
1783
|
-
"model-value": unref(
|
|
1784
|
-
"onUpdate:modelValue":
|
|
1783
|
+
"model-value": unref(o),
|
|
1784
|
+
"onUpdate:modelValue": s
|
|
1785
1785
|
}, null, 8, ["model-value"]),
|
|
1786
1786
|
e.helperText ? (openBlock(), createBlock(p, {
|
|
1787
1787
|
key: 1,
|
|
@@ -1791,8 +1791,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1791
1791
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1792
1792
|
], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
|
|
1793
1793
|
createVNode(_sfc_main$u, {
|
|
1794
|
-
"model-value": unref(
|
|
1795
|
-
"onUpdate:modelValue":
|
|
1794
|
+
"model-value": unref(o),
|
|
1795
|
+
"onUpdate:modelValue": s
|
|
1796
1796
|
}, null, 8, ["model-value"]),
|
|
1797
1797
|
e.helperText ? (openBlock(), createBlock(p, {
|
|
1798
1798
|
key: 0,
|
|
@@ -1802,8 +1802,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1802
1802
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1803
1803
|
], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
|
|
1804
1804
|
createVNode(_sfc_main$v, {
|
|
1805
|
-
"model-value": unref(
|
|
1806
|
-
"onUpdate:modelValue":
|
|
1805
|
+
"model-value": unref(o),
|
|
1806
|
+
"onUpdate:modelValue": s
|
|
1807
1807
|
}, null, 8, ["model-value"]),
|
|
1808
1808
|
e.helperText ? (openBlock(), createBlock(p, {
|
|
1809
1809
|
key: 0,
|
|
@@ -1813,8 +1813,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1813
1813
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1814
1814
|
], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
|
|
1815
1815
|
createVNode(_sfc_main$h, {
|
|
1816
|
-
"model-value": unref(
|
|
1817
|
-
"onUpdate:modelValue":
|
|
1816
|
+
"model-value": unref(o),
|
|
1817
|
+
"onUpdate:modelValue": s
|
|
1818
1818
|
}, null, 8, ["model-value"]),
|
|
1819
1819
|
e.helperText ? (openBlock(), createBlock(p, {
|
|
1820
1820
|
key: 0,
|
|
@@ -1824,8 +1824,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1824
1824
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1825
1825
|
], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
|
|
1826
1826
|
createVNode(_sfc_main$9, {
|
|
1827
|
-
"model-value": unref(
|
|
1828
|
-
"onUpdate:modelValue":
|
|
1827
|
+
"model-value": unref(o),
|
|
1828
|
+
"onUpdate:modelValue": s
|
|
1829
1829
|
}, null, 8, ["model-value"]),
|
|
1830
1830
|
e.helperText ? (openBlock(), createBlock(p, {
|
|
1831
1831
|
key: 0,
|
|
@@ -1845,23 +1845,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1845
1845
|
}
|
|
1846
1846
|
},
|
|
1847
1847
|
setup(e) {
|
|
1848
|
-
const { t:
|
|
1848
|
+
const { t: c, te: a } = useI18n();
|
|
1849
1849
|
return (r, u) => {
|
|
1850
|
-
const
|
|
1851
|
-
return openBlock(), createBlock(
|
|
1850
|
+
const s = resolveComponent("FmCard");
|
|
1851
|
+
return openBlock(), createBlock(s, {
|
|
1852
1852
|
variant: "outlined",
|
|
1853
1853
|
class: "p-16 space-y-8"
|
|
1854
1854
|
}, {
|
|
1855
1855
|
default: withCtx(() => [
|
|
1856
|
-
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(
|
|
1856
|
+
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(c)("connect.campaign.common.summary")), 1),
|
|
1857
1857
|
_hoisted_2$1,
|
|
1858
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (
|
|
1858
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (o, l) => (openBlock(), createElementBlock("div", {
|
|
1859
1859
|
class: "space-y-4",
|
|
1860
|
-
key:
|
|
1860
|
+
key: l
|
|
1861
1861
|
}, [
|
|
1862
|
-
|
|
1863
|
-
createElementVNode("div", _hoisted_3$1, toDisplayString(unref(
|
|
1864
|
-
createElementVNode("div", _hoisted_4$1, toDisplayString(unref(a)(`${
|
|
1862
|
+
o ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1863
|
+
createElementVNode("div", _hoisted_3$1, toDisplayString(unref(c)(`${l}`)), 1),
|
|
1864
|
+
createElementVNode("div", _hoisted_4$1, toDisplayString(unref(a)(`${o}`) ? unref(c)(`${o}`) : o), 1)
|
|
1865
1865
|
], 64)) : createCommentVNode("", !0)
|
|
1866
1866
|
]))), 128))
|
|
1867
1867
|
]),
|
|
@@ -1901,7 +1901,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1901
1901
|
TEMPLATES.VOUCHER
|
|
1902
1902
|
), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
|
|
1903
1903
|
async function showSheet(visible, type, campaign, selectedTemplate) {
|
|
1904
|
-
var e,
|
|
1904
|
+
var e, c;
|
|
1905
1905
|
if (sheetVisible.value = visible, visible == !0) {
|
|
1906
1906
|
try {
|
|
1907
1907
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
@@ -1918,7 +1918,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1918
1918
|
path: ["campaign", "code"]
|
|
1919
1919
|
});
|
|
1920
1920
|
})), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
1921
|
-
...(
|
|
1921
|
+
...(c = template.value) == null ? void 0 : c.defaultValue
|
|
1922
1922
|
}), "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`;
|
|
1923
1923
|
}
|
|
1924
1924
|
}
|
|
@@ -1945,10 +1945,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1945
1945
|
return e.success ? [] : e.error.errors;
|
|
1946
1946
|
});
|
|
1947
1947
|
function stepErrors(e = currentStep.value - 1) {
|
|
1948
|
-
const
|
|
1948
|
+
const c = template.value.steps[e].groups.flatMap(
|
|
1949
1949
|
(a) => a.fields.map((r) => r.property)
|
|
1950
1950
|
);
|
|
1951
|
-
return errors.value.filter((a) =>
|
|
1951
|
+
return errors.value.filter((a) => c.includes(a.path.join(".")));
|
|
1952
1952
|
}
|
|
1953
1953
|
__expose({ showSheet });
|
|
1954
1954
|
function showSummaryDialog() {
|
|
@@ -1960,17 +1960,17 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1960
1960
|
}
|
|
1961
1961
|
});
|
|
1962
1962
|
}
|
|
1963
|
-
function onUpdateProperty(e,
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
),
|
|
1963
|
+
function onUpdateProperty(e, c) {
|
|
1964
|
+
var a, r, u, s, o, l, n, d;
|
|
1965
|
+
if (_.set(data.value, e, c), e == "campaign.event.type") {
|
|
1966
|
+
const y = ((s = (u = (r = (a = template.value) == null ? void 0 : a.defaultValue) == null ? void 0 : r.campaign) == null ? void 0 : u.event) == null ? void 0 : s.rule) ? _.cloneDeep({
|
|
1967
|
+
...(d = (n = (l = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : l.campaign) == null ? void 0 : n.event) == null ? void 0 : d.rule
|
|
1968
|
+
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
1969
|
+
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1970
|
+
RuleBuilder.scaffoldGroup("g_time"),
|
|
1971
|
+
RuleBuilder.scaffoldGroup("g_user"),
|
|
1972
|
+
RuleBuilder.scaffoldGroup("g_bill")
|
|
1973
|
+
]), v = RuleBuilder.setRuleToGroup(
|
|
1974
1974
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1975
1975
|
[
|
|
1976
1976
|
RuleBuilder.constructEntry(
|
|
@@ -1982,29 +1982,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1982
1982
|
],
|
|
1983
1983
|
"&&"
|
|
1984
1984
|
);
|
|
1985
|
-
if (
|
|
1986
|
-
_.set(data.value, "campaign.event.rule",
|
|
1985
|
+
if (c != "SCHEDULE") {
|
|
1986
|
+
_.set(data.value, "campaign.event.rule", y);
|
|
1987
1987
|
return;
|
|
1988
1988
|
}
|
|
1989
1989
|
_.set(
|
|
1990
1990
|
data.value,
|
|
1991
1991
|
"campaign.event.rule",
|
|
1992
|
-
RuleBuilder.setRuleToGroup(
|
|
1992
|
+
RuleBuilder.setRuleToGroup(y, v)
|
|
1993
1993
|
);
|
|
1994
1994
|
}
|
|
1995
|
-
e == "campaign.notify" &&
|
|
1995
|
+
e == "campaign.notify" && c == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
1996
1996
|
}
|
|
1997
|
-
async function onUpdateFile(e,
|
|
1998
|
-
return e ? await minor(async () => firebaseStorage.update(
|
|
1997
|
+
async function onUpdateFile(e, c) {
|
|
1998
|
+
return e ? await minor(async () => firebaseStorage.update(c, e), {
|
|
1999
1999
|
message: `${e ? "Uploading" : "Removing"} file`,
|
|
2000
2000
|
successMessage: `File ${e ? "uploaded" : "removed"} successfully`
|
|
2001
2001
|
}) : "";
|
|
2002
2002
|
}
|
|
2003
2003
|
function isDisable(e) {
|
|
2004
|
-
var
|
|
2004
|
+
var c, a;
|
|
2005
2005
|
switch (e == null ? void 0 : e.property) {
|
|
2006
2006
|
case "campaign.event.type":
|
|
2007
|
-
return ((a = (
|
|
2007
|
+
return ((a = (c = data.value) == null ? void 0 : c.campaign) == null ? void 0 : a._id) || !1;
|
|
2008
2008
|
default:
|
|
2009
2009
|
return !1;
|
|
2010
2010
|
}
|
|
@@ -2013,14 +2013,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2013
2013
|
const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
|
|
2014
2014
|
e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
|
|
2015
2015
|
}
|
|
2016
|
-
return (e,
|
|
2017
|
-
const a = resolveComponent("FmButton"), r = resolveComponent("FmStep"), u = resolveComponent("FmStepper"),
|
|
2018
|
-
return openBlock(), createBlock(
|
|
2016
|
+
return (e, c) => {
|
|
2017
|
+
const a = resolveComponent("FmButton"), r = resolveComponent("FmStep"), u = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), o = resolveComponent("FmTopSheet");
|
|
2018
|
+
return openBlock(), createBlock(o, {
|
|
2019
2019
|
"fullscreen-size": "lg",
|
|
2020
2020
|
modelValue: unref(sheetVisible),
|
|
2021
2021
|
"onUpdate:modelValue": [
|
|
2022
|
-
|
|
2023
|
-
|
|
2022
|
+
c[7] || (c[7] = (l) => isRef(sheetVisible) ? sheetVisible.value = l : null),
|
|
2023
|
+
c[8] || (c[8] = (l) => sheetVisible.value = l)
|
|
2024
2024
|
]
|
|
2025
2025
|
}, createSlots({
|
|
2026
2026
|
"top-sheet-header": withCtx(() => [
|
|
@@ -2028,7 +2028,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2028
2028
|
createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
|
|
2029
2029
|
createElementVNode("div", _hoisted_2, [
|
|
2030
2030
|
createVNode(a, {
|
|
2031
|
-
onClick:
|
|
2031
|
+
onClick: c[0] || (c[0] = (l) => hideSheet()),
|
|
2032
2032
|
label: unref(t)("connect.campaign.common.cancel"),
|
|
2033
2033
|
variant: "tertiary"
|
|
2034
2034
|
}, null, 8, ["label"]),
|
|
@@ -2049,7 +2049,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2049
2049
|
createElementVNode("div", _hoisted_10, [
|
|
2050
2050
|
createElementVNode("div", _hoisted_11, [
|
|
2051
2051
|
_hoisted_12,
|
|
2052
|
-
createVNode(
|
|
2052
|
+
createVNode(s, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
2053
2053
|
])
|
|
2054
2054
|
])
|
|
2055
2055
|
])
|
|
@@ -2061,14 +2061,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2061
2061
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
2062
2062
|
createVNode(u, {
|
|
2063
2063
|
modelValue: unref(currentStep),
|
|
2064
|
-
"onUpdate:modelValue":
|
|
2064
|
+
"onUpdate:modelValue": c[1] || (c[1] = (l) => isRef(currentStep) ? currentStep.value = l : null),
|
|
2065
2065
|
orientation: "horizontal",
|
|
2066
2066
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
2067
2067
|
}, {
|
|
2068
2068
|
default: withCtx(() => [
|
|
2069
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
2070
|
-
key:
|
|
2071
|
-
title: unref(t)(
|
|
2069
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(r, {
|
|
2070
|
+
key: l.name,
|
|
2071
|
+
title: unref(t)(l.name),
|
|
2072
2072
|
value: n + 1,
|
|
2073
2073
|
error: () => stepErrors(n).length > 0,
|
|
2074
2074
|
complete: () => n + 1 <= unref(currentStep)
|
|
@@ -2080,19 +2080,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2080
2080
|
createVNode(a, {
|
|
2081
2081
|
icon: "close",
|
|
2082
2082
|
variant: "tertiary",
|
|
2083
|
-
onClick:
|
|
2083
|
+
onClick: c[2] || (c[2] = (l) => sheetVisible.value = !1)
|
|
2084
2084
|
}),
|
|
2085
2085
|
createVNode(u, {
|
|
2086
2086
|
modelValue: unref(currentStep),
|
|
2087
|
-
"onUpdate:modelValue":
|
|
2087
|
+
"onUpdate:modelValue": c[3] || (c[3] = (l) => isRef(currentStep) ? currentStep.value = l : null),
|
|
2088
2088
|
orientation: "horizontal",
|
|
2089
2089
|
class: "flex-1"
|
|
2090
2090
|
}, {
|
|
2091
2091
|
default: withCtx(() => [
|
|
2092
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
2093
|
-
key:
|
|
2092
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(r, {
|
|
2093
|
+
key: l.name,
|
|
2094
2094
|
title: unref(sheetTitle),
|
|
2095
|
-
description: unref(t)(
|
|
2095
|
+
description: unref(t)(l.name),
|
|
2096
2096
|
value: n + 1,
|
|
2097
2097
|
error: () => stepErrors(n).length > 0,
|
|
2098
2098
|
complete: () => n + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
@@ -2103,7 +2103,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2103
2103
|
createVNode(a, {
|
|
2104
2104
|
icon: "info",
|
|
2105
2105
|
variant: "tertiary",
|
|
2106
|
-
onClick:
|
|
2106
|
+
onClick: c[4] || (c[4] = () => showSummaryDialog())
|
|
2107
2107
|
})
|
|
2108
2108
|
]),
|
|
2109
2109
|
createElementVNode("div", _hoisted_5, [
|
|
@@ -2112,40 +2112,40 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2112
2112
|
json: {
|
|
2113
2113
|
data: unref(data),
|
|
2114
2114
|
errors: unref(errors).map(
|
|
2115
|
-
(
|
|
2115
|
+
(l) => `${l.path.join(".")} - ${l.message}`
|
|
2116
2116
|
),
|
|
2117
2117
|
stepErrors: stepErrors().map(
|
|
2118
|
-
(
|
|
2118
|
+
(l) => `${l.path.join(".")} - ${l.message}`
|
|
2119
2119
|
),
|
|
2120
2120
|
schema: unref(schema)
|
|
2121
2121
|
}
|
|
2122
2122
|
}, null, 8, ["json"]),
|
|
2123
2123
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
|
|
2124
|
-
(
|
|
2125
|
-
), (
|
|
2124
|
+
(l) => l.fields.length && (!l.condition || unref(_).get(unref(data), l.condition.property) == l.condition.value == (l.condition.not != !0))
|
|
2125
|
+
), (l, n) => (openBlock(), createElementBlock("div", {
|
|
2126
2126
|
key: n,
|
|
2127
2127
|
class: "space-y-24"
|
|
2128
2128
|
}, [
|
|
2129
|
-
createElementVNode("div", _hoisted_7, toDisplayString(
|
|
2130
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
2129
|
+
createElementVNode("div", _hoisted_7, toDisplayString(l.name ? unref(t)(l.name) : ""), 1),
|
|
2130
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(l.fields, (d, g) => (openBlock(), createElementBlock("div", { key: g }, [
|
|
2131
2131
|
(openBlock(), createBlock(_sfc_main$2, {
|
|
2132
2132
|
key: g,
|
|
2133
|
-
field:
|
|
2134
|
-
modelValue: unref(_).get(unref(data),
|
|
2135
|
-
disabled: isDisable(
|
|
2136
|
-
"onUpdate:modelValue": (y) => onUpdateProperty(
|
|
2133
|
+
field: d,
|
|
2134
|
+
modelValue: unref(_).get(unref(data), d.property),
|
|
2135
|
+
disabled: isDisable(d),
|
|
2136
|
+
"onUpdate:modelValue": (y) => onUpdateProperty(d.property, y),
|
|
2137
2137
|
"onUpdate:file": async (y, v) => {
|
|
2138
2138
|
const h = await onUpdateFile(y, v);
|
|
2139
|
-
onUpdateProperty(
|
|
2139
|
+
onUpdateProperty(d.property, h || "");
|
|
2140
2140
|
},
|
|
2141
2141
|
schema: unref(ZodHelper).typeAtPath(
|
|
2142
2142
|
unref(schema),
|
|
2143
|
-
|
|
2143
|
+
d.property,
|
|
2144
2144
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
2145
2145
|
),
|
|
2146
|
-
"helper-state": unref(ZodHelper).helperState(unref(errors),
|
|
2147
|
-
"helper-text": unref(ZodHelper).helperText(unref(errors),
|
|
2148
|
-
extras:
|
|
2146
|
+
"helper-state": unref(ZodHelper).helperState(unref(errors), d.property),
|
|
2147
|
+
"helper-text": unref(ZodHelper).helperText(unref(errors), d.property),
|
|
2148
|
+
extras: d.extras != null ? d.extras == "" ? unref(data) : unref(_).get(unref(data), d.extras) : void 0
|
|
2149
2149
|
}, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
|
|
2150
2150
|
]))), 128))
|
|
2151
2151
|
]))), 128)),
|
|
@@ -2154,12 +2154,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2154
2154
|
label: "Back",
|
|
2155
2155
|
variant: "tertiary",
|
|
2156
2156
|
disabled: unref(currentStep) == 1,
|
|
2157
|
-
onClick:
|
|
2157
|
+
onClick: c[5] || (c[5] = (l) => currentStep.value--)
|
|
2158
2158
|
}, null, 8, ["disabled"]),
|
|
2159
2159
|
createVNode(a, {
|
|
2160
2160
|
disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
|
|
2161
2161
|
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
|
|
2162
|
-
onClick:
|
|
2162
|
+
onClick: c[6] || (c[6] = (l) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
|
|
2163
2163
|
}, null, 8, ["disabled", "label"])
|
|
2164
2164
|
])
|
|
2165
2165
|
]),
|