@feedmepos/mf-connect 0.1.38-beta.61 → 0.1.38-beta.62
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-CM7mh-iO.js → Analytic-Ktq94hC8.js} +14 -14
- package/dist/{App-CeCzzsDu.js → App-Daubz7oj.js} +7 -7
- package/dist/{AuditLogs-VWx8DFKA.js → AuditLogs-Bwoks-rM.js} +9 -9
- package/dist/{Bin-vUuol_I9.js → Bin-asHUb1BJ.js} +8 -8
- package/dist/Broadcast-BVB-Mjqq.js +267 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CV-zhJ15.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CczwlN2n.js} +6 -6
- package/dist/{Card-CeIeGET1.js → Card-Bp4EJbgK.js} +17 -17
- package/dist/{Collections-CF_OcAL3.js → Collections-CyDN3QhT.js} +7 -7
- package/dist/Credit-DrwSgNh7.js +261 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-0DMFuBoG.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-n8_AVbJA.js} +203 -199
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BZfchHlT.js → EffectSheet.vue_vue_type_style_index_0_lang-DnAOFGed.js} +6 -6
- package/dist/Experience-BBrZLaRM.js +260 -0
- package/dist/{FileSaver.min-lgg_oBvT.js → FileSaver.min-o8dgYPp0.js} +1 -1
- package/dist/Game-AxwzBRrJ.js +331 -0
- package/dist/{GenerateMaterial-B5A7mx2y.js → GenerateMaterial-BObD7Yrf.js} +6 -6
- package/dist/{Grab-BgiMqwvj.js → Grab-CiN-phhI.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DZ8DHrQ_.js → ImageInput.vue_vue_type_script_setup_true_lang-CgdcGP3N.js} +1 -1
- package/dist/{Index-B85ops8K.js → Index-CQXbQ7vK.js} +10 -10
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-B5rIjxYd.js → LottieAnimation.vue_vue_type_script_setup_true_lang-D53NnPhs.js} +1 -1
- package/dist/{MainLayout-CXGVkD-W.js → MainLayout-COA3zuDN.js} +1 -1
- package/dist/{Marketing-Bnijl7lA.js → Marketing-_0bICW80.js} +4 -4
- package/dist/{MarketingMaterialEdit-BlUKwSoP.js → MarketingMaterialEdit-L1ab7aJG.js} +4 -4
- package/dist/{Member-sT853g51.js → Member-C9RRcxUA.js} +11 -11
- package/dist/{MemberList-DYT5_fSP.js → MemberList-CSe2F9QS.js} +25 -25
- package/dist/{MemberTransactions-Cqce5ebe.js → MemberTransactions-Da1Nfbi4.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Dq0Hswj8.js → MessageInput.vue_vue_type_script_setup_true_lang-DjYaXNTE.js} +8 -8
- package/dist/Mission-CTJANu6a.js +335 -0
- package/dist/{Overview-B0rwrHR1.js → Overview-CgrXFJ5H.js} +18 -18
- package/dist/Point-B4g37KPT.js +263 -0
- package/dist/Promotion-V0MoAX2t.js +397 -0
- package/dist/{Queue-SVqRUlD_.js → Queue-uUrzJCdY.js} +10 -10
- package/dist/{Record-BTjg4ihy.js → Record-BT-4kOS8.js} +9 -9
- package/dist/{Reward-DW58VMRO.js → Reward-Cqfur_b7.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-s1RI55Rc.js → RewardGroup.vue_vue_type_script_setup_true_lang-CWFxdopa.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Os17lXBX.js → RuleGroup.vue_vue_type_script_setup_true_lang-C5BATPr7.js} +14 -14
- package/dist/{Segment-Dny8pxP1.js → Segment-DlzmOheV.js} +24 -24
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Czx7rqiq.js → SelectItems.vue_vue_type_script_setup_true_lang-Bur2bSCd.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-EgVxUG_N.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BqYZehIO.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CO0fgI3K.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CXot-RF0.js} +4 -4
- package/dist/{Setting-CjcnxK34.js → Setting-CtIHp56x.js} +13 -13
- package/dist/{SettingAdvertisements-CIyDF4C8.js → SettingAdvertisements-nT78blMx.js} +11 -11
- package/dist/{Store-B8k5YVqU.js → Store-DA54GAU7.js} +20 -20
- package/dist/{StoreRewards-BW08rwpL.js → StoreRewards-BH_CG0_m.js} +14 -14
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BfFSfE2H.js → StoreTransactions.vue_vue_type_script_setup_true_lang-yX42EwdC.js} +19 -19
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CZkKjUNQ.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CJSNkho6.js} +1 -1
- package/dist/{Tier-DKzu4tYw.js → Tier-Bv9Jc58B.js} +23 -23
- package/dist/{Title-BK-TXatJ.js → Title-BzhaAeWE.js} +20 -20
- package/dist/{Transaction-Duayg1jd.js → Transaction-D6l7eUto.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BAR9h1TV.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BOlKr1u5.js} +6 -6
- package/dist/{Voucher-BEVAkNeJ.js → Voucher-c9rOPty1.js} +164 -142
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DvFy9Z6X.js → VoucherEditor.vue_vue_type_script_setup_true_lang-gM2Q2SZj.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CU_Sx2PM.js → ZodTextField.vue_vue_type_script_setup_true_lang--cPeKAQK.js} +2 -2
- package/dist/{app-IvbII0ql.js → app-rrEjDuDH.js} +78 -48
- package/dist/app.js +1 -1
- package/dist/{business-BFIwFfkq.js → business-BtKxs_y6.js} +1 -1
- package/dist/{campaign-w9j4I4jn.js → campaign-Dp6iTHEz.js} +2 -2
- package/dist/{campaign-RuIwxc4y.js → campaign-rXQhZIDH.js} +8 -8
- package/dist/{campaign.enum-IHLsfdik.js → campaign.enum-Deak-UID.js} +1 -1
- package/dist/{campaign.fn-B_P1MkRV.js → campaign.fn-At50e4px.js} +32 -32
- package/dist/{collectible.enum-CUgSjO08.js → collectible.enum-BKAKCyYj.js} +1 -1
- package/dist/{collection.fn-CrfnNb41.js → collection.fn-DPhZ4J5s.js} +2 -2
- package/dist/{dto-jwO_sX9I.js → dto-Dr0nOU62.js} +4 -4
- package/dist/duplicateCampaign-5fhHX37P.js +35 -0
- package/dist/{effect--0g8PNyt.js → effect-CFMQ5REv.js} +1 -1
- package/dist/{email-addresses-HtsxvXw9.js → email-addresses-RpPqY7Ns.js} +2 -2
- package/dist/{export-CFEwMRmd.js → export-CYQVBcQQ.js} +2 -2
- package/dist/{helper-CCfb24PO.js → helper-NA1sBf5O.js} +1 -1
- package/dist/{index-CR3f3BXQ.js → index-B5ZaTTfd.js} +4 -4
- package/dist/{index-CppLPpqB.js → index-B7JPvTGD.js} +3 -3
- package/dist/{index-CkuPY85X.js → index-CA1VTtfl.js} +1 -1
- package/dist/{index-wzSeRJAd.js → index-CXj0NuF-.js} +1 -1
- package/dist/{index-Bflu4Rft.js → index-CfdrsgL1.js} +3 -3
- package/dist/{index-BR3UbZ0F.js → index-Cjz7ja8g.js} +1 -1
- package/dist/{index-DDYH-IEX.js → index-DQBsBSAl.js} +1 -1
- package/dist/{index-B-AMMFfT.js → index-De8KJ5ee.js} +4 -4
- package/dist/{index-DdZdHioZ.js → index-DgbKnxUQ.js} +6 -6
- package/dist/{index-BZEM0T2A.js → index-DoQbrp4H.js} +1 -1
- package/dist/{index-Dic_WcAL.js → index-Du1J2M6c.js} +1 -1
- package/dist/{index-CZPcwcUo.js → index-FB5JDcqo.js} +3 -3
- package/dist/{index-DpjYgKTN.js → index-ZDRZDJJ-.js} +1 -1
- package/dist/{index.esm2017-CUnjzfU-.js → index.esm2017-DWyiVIYc.js} +1 -1
- package/dist/{loading-CivgDw5C.js → loading-BsFOHhQ7.js} +2 -2
- package/dist/{lodash-BSbv_9TG.js → lodash-DYYviyoC.js} +1 -1
- package/dist/{membership-j2w1YUO-.js → membership-UU6e1zGd.js} +3 -3
- package/dist/{money-DL-x8hiT.js → money-CreQ4gmS.js} +1 -1
- package/dist/{number-D1yoFGEr.js → number-CVU6hHec.js} +1 -1
- package/dist/{objectid-CHab6j3r.js → objectid-C23E4-r1.js} +13 -13
- package/dist/{plugins-P-V4XWmW.js → plugins-DhptoQqr.js} +3 -3
- package/dist/{reward-BqMlBQRu.js → reward-CawSKEN7.js} +1 -1
- package/dist/{rule-CztsLdki.js → rule-DfoqRN4t.js} +3 -3
- package/dist/{rule-builder-DANv7Rmz.js → rule-builder-TeN72YwV.js} +1 -1
- package/dist/{template-Dbz3FhHK.js → template-CFKkBFuQ.js} +6 -6
- package/dist/{timezone-BgVqObBq.js → timezone-aMH10XL_.js} +2 -2
- package/dist/{trigger-CbriUibd.js → trigger-wauWh36i.js} +5 -5
- package/dist/{usePagination-DtNK7W0U.js → usePagination-CMQVYF13.js} +1 -1
- package/dist/{user-CVapqHfr.js → user-DaUp8rok.js} +1 -1
- package/dist/{vue-i18n-tpDAnnmD.js → vue-i18n-gi9JUtvo.js} +157 -157
- package/dist/{xlsx-EewcN2uY.js → xlsx-BNx9zr-c.js} +1 -1
- package/dist/{zod-D-wiCQRJ.js → zod-_ZFtblDD.js} +1 -1
- package/package.json +1 -1
- package/dist/Broadcast-6VXz4-IG.js +0 -233
- package/dist/Credit-BUqGOyp_.js +0 -226
- package/dist/Experience-BxiFH_uV.js +0 -225
- package/dist/Game-BzYW0LfY.js +0 -300
- package/dist/Mission-Q5_sGgrm.js +0 -304
- package/dist/Point-BGYFMvev.js +0 -228
- package/dist/Promotion-0acd63nA.js +0 -364
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, createCommentVNode, computed, onMounted, toDisplayString, createBlock, withCtx, Fragment, renderList, withModifiers, unref, isRef, createTextVNode, normalizeClass, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
|
|
2
|
-
import { _ } from "./lodash-
|
|
3
|
-
import { U as Ud, z } from "./app-
|
|
4
|
-
import { Z as ZodHelper } from "./zod-
|
|
5
|
-
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-
|
|
6
|
-
import { u as useMembershipStore } from "./membership-
|
|
7
|
-
import { u as useBusinessStore } from "./business-
|
|
8
|
-
import "./index-
|
|
9
|
-
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-
|
|
2
|
+
import { _ } from "./lodash-DYYviyoC.js";
|
|
3
|
+
import { U as Ud, z } from "./app-rrEjDuDH.js";
|
|
4
|
+
import { Z as ZodHelper } from "./zod-_ZFtblDD.js";
|
|
5
|
+
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-Dr0nOU62.js";
|
|
6
|
+
import { u as useMembershipStore } from "./membership-UU6e1zGd.js";
|
|
7
|
+
import { u as useBusinessStore } from "./business-BtKxs_y6.js";
|
|
8
|
+
import "./index-CfdrsgL1.js";
|
|
9
|
+
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-TeN72YwV.js";
|
|
10
10
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
11
11
|
import { h as hooks } from "./moment-D7p2TMB-.js";
|
|
12
|
-
import { f as featureVersionMapping } from "./campaign.enum-
|
|
13
|
-
import { _ as _sfc_main$u } from "./ImageInput.vue_vue_type_script_setup_true_lang-
|
|
14
|
-
import { b as _sfc_main$s, a as _sfc_main$v, _ as _sfc_main$x } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
15
|
-
import { _ as _sfc_main$w } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { c as core, S as SvcConfig } from "./index-
|
|
17
|
-
import { p as prompt, f as firebaseStorage } from "./plugins-
|
|
18
|
-
import { _ as _sfc_main$o } from "./SelectItems.vue_vue_type_script_setup_true_lang-
|
|
12
|
+
import { f as featureVersionMapping } from "./campaign.enum-Deak-UID.js";
|
|
13
|
+
import { _ as _sfc_main$u } from "./ImageInput.vue_vue_type_script_setup_true_lang-CgdcGP3N.js";
|
|
14
|
+
import { b as _sfc_main$s, a as _sfc_main$v, _ as _sfc_main$x } from "./EffectSheet.vue_vue_type_style_index_0_lang-DnAOFGed.js";
|
|
15
|
+
import { _ as _sfc_main$w } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CJSNkho6.js";
|
|
16
|
+
import { c as core, S as SvcConfig } from "./index-B7JPvTGD.js";
|
|
17
|
+
import { p as prompt, f as firebaseStorage } from "./plugins-DhptoQqr.js";
|
|
18
|
+
import { _ as _sfc_main$o } from "./SelectItems.vue_vue_type_script_setup_true_lang-Bur2bSCd.js";
|
|
19
19
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
20
|
-
import { _ as _sfc_main$z } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-
|
|
21
|
-
import { _ as _sfc_main$p, a as _sfc_main$q } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
22
|
-
import { u as useI18n } from "./vue-i18n-
|
|
23
|
-
import { T as TypeToTriggerOptions, _ as _sfc_main$A, b as _sfc_main$B } from "./trigger-
|
|
24
|
-
import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
25
|
-
import { C as CountryTimezone, m as moment } from "./timezone-
|
|
26
|
-
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-
|
|
20
|
+
import { _ as _sfc_main$z } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-BOlKr1u5.js";
|
|
21
|
+
import { _ as _sfc_main$p, a as _sfc_main$q } from "./RuleGroup.vue_vue_type_script_setup_true_lang-C5BATPr7.js";
|
|
22
|
+
import { u as useI18n } from "./vue-i18n-gi9JUtvo.js";
|
|
23
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$A, b as _sfc_main$B } from "./trigger-wauWh36i.js";
|
|
24
|
+
import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-DjYaXNTE.js";
|
|
25
|
+
import { C as CountryTimezone, m as moment } from "./timezone-aMH10XL_.js";
|
|
26
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-DfoqRN4t.js";
|
|
27
27
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
28
|
-
import { _ as _sfc_main$r, a as _sfc_main$t } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-
|
|
29
|
-
import { T as TEMPLATES } from "./index-
|
|
30
|
-
import { u as FdoCreditLoyaltyReward, v as FdtoRandomReward, w as F_MISSION_TYPE, x as FdoThresholdCreditReward, y as FdtoThresholdReward, z as FdoMission } from "./index-
|
|
31
|
-
import "./index-
|
|
32
|
-
import "./index-
|
|
33
|
-
import { a as F_GAME_TYPE } from "./collectible.enum-
|
|
34
|
-
import { u as useLoading } from "./loading-
|
|
35
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
36
|
-
import { C as CollectionUtils } from "./collection.fn-
|
|
28
|
+
import { _ as _sfc_main$r, a as _sfc_main$t } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-gM2Q2SZj.js";
|
|
29
|
+
import { T as TEMPLATES } from "./index-DgbKnxUQ.js";
|
|
30
|
+
import { u as FdoCreditLoyaltyReward, v as FdtoRandomReward, w as F_MISSION_TYPE, x as FdoThresholdCreditReward, y as FdtoThresholdReward, z as FdoMission } from "./index-De8KJ5ee.js";
|
|
31
|
+
import "./index-B5ZaTTfd.js";
|
|
32
|
+
import "./index-FB5JDcqo.js";
|
|
33
|
+
import { a as F_GAME_TYPE } from "./collectible.enum-BKAKCyYj.js";
|
|
34
|
+
import { u as useLoading } from "./loading-BsFOHhQ7.js";
|
|
35
|
+
import { i as initCollectibleConfig } from "./helper-NA1sBf5O.js";
|
|
36
|
+
import { C as CollectionUtils } from "./collection.fn-DPhZ4J5s.js";
|
|
37
37
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
38
|
-
import { d as getCampaignSummaryObject } from "./campaign-
|
|
38
|
+
import { d as getCampaignSummaryObject } from "./campaign-rXQhZIDH.js";
|
|
39
39
|
import { useDialog } from "@feedmepos/ui-library";
|
|
40
|
-
import { u as useCampaignStore } from "./campaign-
|
|
40
|
+
import { u as useCampaignStore } from "./campaign-Dp6iTHEz.js";
|
|
41
41
|
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
42
42
|
function summarizeGrabDiscount(e) {
|
|
43
43
|
if (!e)
|
|
@@ -48,14 +48,14 @@ function summarizeGrabDiscount(e) {
|
|
|
48
48
|
case "order":
|
|
49
49
|
return "Bill discount";
|
|
50
50
|
case "items":
|
|
51
|
-
return l.type.startsWith("bundle") ?
|
|
51
|
+
return l.type.startsWith("bundle") ? c(l.type) : "Item discount";
|
|
52
52
|
case "categories":
|
|
53
53
|
return "Category discount";
|
|
54
54
|
default:
|
|
55
55
|
return "Discount";
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function c(l) {
|
|
59
59
|
switch (l) {
|
|
60
60
|
case "bundleSameFixPrice":
|
|
61
61
|
return "Bundle (same item) - Fixed price";
|
|
@@ -115,7 +115,7 @@ const _hoisted_1$l = {
|
|
|
115
115
|
},
|
|
116
116
|
emits: ["confirm", "cancel"],
|
|
117
117
|
setup(e, { emit: m }) {
|
|
118
|
-
const a = e,
|
|
118
|
+
const a = e, c = m, i = ref();
|
|
119
119
|
watch(
|
|
120
120
|
() => a.visible,
|
|
121
121
|
(n) => {
|
|
@@ -128,10 +128,10 @@ const _hoisted_1$l = {
|
|
|
128
128
|
(n = i.value) == null || n.onConfirm();
|
|
129
129
|
}
|
|
130
130
|
function l() {
|
|
131
|
-
|
|
131
|
+
c("cancel");
|
|
132
132
|
}
|
|
133
133
|
function o(n) {
|
|
134
|
-
|
|
134
|
+
c("confirm", n);
|
|
135
135
|
}
|
|
136
136
|
return (n, r) => {
|
|
137
137
|
const y = resolveComponent("FmIcon"), v = resolveComponent("FmButton");
|
|
@@ -190,22 +190,22 @@ const _hoisted_1$l = {
|
|
|
190
190
|
},
|
|
191
191
|
emits: ["confirm", "cancel"],
|
|
192
192
|
setup(e, { emit: m }) {
|
|
193
|
-
const a = e,
|
|
194
|
-
const
|
|
195
|
-
return
|
|
193
|
+
const a = e, c = m, i = Ud(), s = ref({}), l = ref(""), o = computed(() => {
|
|
194
|
+
const u = i.menu.value;
|
|
195
|
+
return u ? u.modules.category.map((f) => ({
|
|
196
196
|
id: f._id,
|
|
197
197
|
name: f.name
|
|
198
198
|
})) : [];
|
|
199
199
|
}), n = computed(() => {
|
|
200
200
|
if (!l.value) return o.value;
|
|
201
|
-
const
|
|
201
|
+
const u = l.value.toLowerCase();
|
|
202
202
|
return o.value.filter(
|
|
203
|
-
(f) => f.name.toLowerCase().includes(
|
|
203
|
+
(f) => f.name.toLowerCase().includes(u)
|
|
204
204
|
);
|
|
205
205
|
}), r = computed(() => Object.values(s.value).filter(Boolean).length);
|
|
206
206
|
function y() {
|
|
207
207
|
s.value = o.value.reduce(
|
|
208
|
-
(
|
|
208
|
+
(u, f) => (u[f.id] = a.initialValue.includes(f.id), u),
|
|
209
209
|
{}
|
|
210
210
|
);
|
|
211
211
|
}
|
|
@@ -214,31 +214,31 @@ const _hoisted_1$l = {
|
|
|
214
214
|
}), onMounted(async () => {
|
|
215
215
|
await i.store.getMenu(), y();
|
|
216
216
|
});
|
|
217
|
-
function v(
|
|
218
|
-
s.value[
|
|
217
|
+
function v(u) {
|
|
218
|
+
s.value[u] = !s.value[u];
|
|
219
219
|
}
|
|
220
220
|
function h() {
|
|
221
|
-
const
|
|
221
|
+
const u = r.value === n.value.length;
|
|
222
222
|
n.value.forEach((f) => {
|
|
223
|
-
s.value[f.id] = !
|
|
223
|
+
s.value[f.id] = !u;
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
function x() {
|
|
227
|
-
Object.keys(s.value).forEach((
|
|
228
|
-
s.value[
|
|
227
|
+
Object.keys(s.value).forEach((u) => {
|
|
228
|
+
s.value[u] = !1;
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
function k() {
|
|
232
|
-
const
|
|
233
|
-
|
|
232
|
+
const u = Object.entries(s.value).filter(([, f]) => f).map(([f]) => f);
|
|
233
|
+
c("confirm", u);
|
|
234
234
|
}
|
|
235
235
|
function p() {
|
|
236
|
-
|
|
236
|
+
c("cancel");
|
|
237
237
|
}
|
|
238
238
|
const d = computed(() => n.value.length > 0 && n.value.every(
|
|
239
|
-
(
|
|
239
|
+
(u) => s.value[u.id]
|
|
240
240
|
));
|
|
241
|
-
return (
|
|
241
|
+
return (u, f) => {
|
|
242
242
|
const B = resolveComponent("FmIcon"), b = resolveComponent("FmButton"), E = resolveComponent("FmTextField"), N = resolveComponent("FmCheckbox"), C = resolveComponent("FmListItem"), R = resolveComponent("FmList");
|
|
243
243
|
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
244
244
|
createElementVNode("div", _hoisted_2$g, [
|
|
@@ -349,7 +349,7 @@ const _hoisted_1$l = {
|
|
|
349
349
|
},
|
|
350
350
|
emits: ["update:model-value"],
|
|
351
351
|
setup(e, { emit: m }) {
|
|
352
|
-
const a = e,
|
|
352
|
+
const a = e, c = m, i = Ud(), s = ref(!1), l = ref(!1), o = ref(!1), n = ref({
|
|
353
353
|
type: "net",
|
|
354
354
|
value: 0,
|
|
355
355
|
scope: {
|
|
@@ -370,7 +370,7 @@ const _hoisted_1$l = {
|
|
|
370
370
|
return !(!n.value.type || !((g = n.value.scope) != null && g.type) || h(n.value.type) && (!n.value.value || n.value.value <= 0) || (n.value.scope.type === "items" || n.value.scope.type === "category") && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0));
|
|
371
371
|
});
|
|
372
372
|
async function y(g) {
|
|
373
|
-
g.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") &&
|
|
373
|
+
g.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && c("update:model-value", null);
|
|
374
374
|
}
|
|
375
375
|
function v() {
|
|
376
376
|
var g;
|
|
@@ -393,7 +393,7 @@ const _hoisted_1$l = {
|
|
|
393
393
|
function d(g) {
|
|
394
394
|
return g != null && g.includes("Percentage") || g === "percentage" ? "%" : "$";
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function u(g, V) {
|
|
397
397
|
n.value = {
|
|
398
398
|
...n.value,
|
|
399
399
|
[g]: V
|
|
@@ -534,7 +534,7 @@ const _hoisted_1$l = {
|
|
|
534
534
|
return n.value.type || g.push("Discount type is required"), (V = n.value.scope) != null && V.type || g.push("Scope type is required"), h(n.value.type) && (!n.value.value || n.value.value <= 0) && g.push("Discount amount must be greater than 0"), ((w = n.value.scope) == null ? void 0 : w.type) === "items" && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0) && g.push("Please select at least one item"), ((D = n.value.scope) == null ? void 0 : D.type) === "category" && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0) && g.push("Please select at least one category"), g;
|
|
535
535
|
});
|
|
536
536
|
function Z() {
|
|
537
|
-
|
|
537
|
+
c("update:model-value", n.value), s.value = !1;
|
|
538
538
|
}
|
|
539
539
|
const q = [
|
|
540
540
|
{ label: "Bill discount", value: "order" },
|
|
@@ -617,7 +617,7 @@ const _hoisted_1$l = {
|
|
|
617
617
|
V[9] || (V[9] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount type", -1)),
|
|
618
618
|
createVNode(D, {
|
|
619
619
|
"model-value": unref(n).type,
|
|
620
|
-
"onUpdate:modelValue": V[1] || (V[1] = (I) =>
|
|
620
|
+
"onUpdate:modelValue": V[1] || (V[1] = (I) => u("type", I)),
|
|
621
621
|
placeholder: "Select discount type",
|
|
622
622
|
items: v()
|
|
623
623
|
}, null, 8, ["model-value", "items"])
|
|
@@ -732,12 +732,12 @@ const _hoisted_1$l = {
|
|
|
732
732
|
},
|
|
733
733
|
emits: ["update:model-value"],
|
|
734
734
|
setup(e, { emit: m }) {
|
|
735
|
-
const { t: a } = useI18n(),
|
|
736
|
-
!
|
|
735
|
+
const { t: a } = useI18n(), c = e, i = m, s = ref(
|
|
736
|
+
!c.modelValue || !c.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(c.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
737
737
|
);
|
|
738
738
|
watch(s, async (o, n) => {
|
|
739
739
|
var r;
|
|
740
|
-
if (n == "custom" && o == "all_time" && RuleBuilder.getRules((r =
|
|
740
|
+
if (n == "custom" && o == "all_time" && RuleBuilder.getRules((r = c.modelValue) == null ? void 0 : r.rules.g_time).length > 0) {
|
|
741
741
|
const y = await prompt.confirm(
|
|
742
742
|
a("connect.template.rule.time.confirm_remove"),
|
|
743
743
|
a("connect.common.confirm"),
|
|
@@ -747,7 +747,7 @@ const _hoisted_1$l = {
|
|
|
747
747
|
y && i(
|
|
748
748
|
"update:model-value",
|
|
749
749
|
RuleBuilder.setRuleToGroup(
|
|
750
|
-
|
|
750
|
+
c.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
751
751
|
RuleBuilder.scaffoldGroup("g_time")
|
|
752
752
|
)
|
|
753
753
|
), s.value = y ? o : n;
|
|
@@ -755,7 +755,7 @@ const _hoisted_1$l = {
|
|
|
755
755
|
});
|
|
756
756
|
async function l(o) {
|
|
757
757
|
var n;
|
|
758
|
-
if (o == "custom" && RuleBuilder.getRules((n =
|
|
758
|
+
if (o == "custom" && RuleBuilder.getRules((n = c.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
|
|
759
759
|
if (!await prompt.confirm(
|
|
760
760
|
a("connect.template.rule.time.confirm_remove"),
|
|
761
761
|
a("connect.common.confirm"),
|
|
@@ -768,7 +768,7 @@ const _hoisted_1$l = {
|
|
|
768
768
|
i(
|
|
769
769
|
"update:model-value",
|
|
770
770
|
RuleBuilder.setRuleToGroup(
|
|
771
|
-
|
|
771
|
+
c.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
772
772
|
RuleBuilder.scaffoldGroup("g_time")
|
|
773
773
|
)
|
|
774
774
|
);
|
|
@@ -824,9 +824,9 @@ const _hoisted_1$l = {
|
|
|
824
824
|
},
|
|
825
825
|
emits: ["update:model-value"],
|
|
826
826
|
setup(e, { emit: m }) {
|
|
827
|
-
const { t: a } = useI18n(),
|
|
827
|
+
const { t: a } = useI18n(), c = e, i = m, s = computed(() => {
|
|
828
828
|
const { property: l, operator: o, equator: n } = RuleBuilder.simplify(
|
|
829
|
-
|
|
829
|
+
c.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
830
830
|
op: "before",
|
|
831
831
|
x: 1
|
|
832
832
|
})
|
|
@@ -934,9 +934,9 @@ const _hoisted_1$l = {
|
|
|
934
934
|
},
|
|
935
935
|
emits: ["update:model-value"],
|
|
936
936
|
setup(e, { emit: m }) {
|
|
937
|
-
const { t: a } = useI18n(),
|
|
938
|
-
(l) => l.value ==
|
|
939
|
-
) : TypeToTriggerOptions[
|
|
937
|
+
const { t: a } = useI18n(), c = e, i = m, s = computed(() => c.disabled ? TypeToTriggerOptions[c.campaignType].filter(
|
|
938
|
+
(l) => l.value == c.modelValue
|
|
939
|
+
) : TypeToTriggerOptions[c.campaignType]);
|
|
940
940
|
return (l, o) => {
|
|
941
941
|
const n = resolveComponent("FmCard");
|
|
942
942
|
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
@@ -944,14 +944,14 @@ const _hoisted_1$l = {
|
|
|
944
944
|
createElementVNode("div", _hoisted_3$b, [
|
|
945
945
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (r) => (openBlock(), createBlock(n, {
|
|
946
946
|
variant: "outlined",
|
|
947
|
-
disabled:
|
|
947
|
+
disabled: c.disabled,
|
|
948
948
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
949
949
|
"col-span-3": unref(s).length == 1,
|
|
950
950
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
|
|
951
951
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
952
952
|
}]),
|
|
953
953
|
onClick: () => {
|
|
954
|
-
|
|
954
|
+
c.modelValue != r.value && !c.disabled && i("update:model-value", r.value);
|
|
955
955
|
},
|
|
956
956
|
key: r.name
|
|
957
957
|
}, {
|
|
@@ -980,7 +980,7 @@ const _hoisted_1$l = {
|
|
|
980
980
|
emits: ["update:model-value"],
|
|
981
981
|
setup(e, { emit: m }) {
|
|
982
982
|
const a = m;
|
|
983
|
-
return (
|
|
983
|
+
return (c, i) => {
|
|
984
984
|
const s = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
|
|
985
985
|
return openBlock(), createBlock(o, {
|
|
986
986
|
label: e.label,
|
|
@@ -1023,7 +1023,7 @@ const _hoisted_1$l = {
|
|
|
1023
1023
|
},
|
|
1024
1024
|
emits: ["update:model-value"],
|
|
1025
1025
|
setup(e, { emit: m }) {
|
|
1026
|
-
const { t: a } = useI18n(),
|
|
1026
|
+
const { t: a } = useI18n(), c = m;
|
|
1027
1027
|
return (i, s) => {
|
|
1028
1028
|
var l, o;
|
|
1029
1029
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
@@ -1033,7 +1033,7 @@ const _hoisted_1$l = {
|
|
|
1033
1033
|
label: unref(a)("connect.common.startDate"),
|
|
1034
1034
|
"onUpdate:modelValue": s[0] || (s[0] = (n) => {
|
|
1035
1035
|
var r;
|
|
1036
|
-
return
|
|
1036
|
+
return c("update:model-value", {
|
|
1037
1037
|
startDate: n,
|
|
1038
1038
|
endDate: ((r = e.modelValue) == null ? void 0 : r.endDate) ?? null
|
|
1039
1039
|
});
|
|
@@ -1047,7 +1047,7 @@ const _hoisted_1$l = {
|
|
|
1047
1047
|
label: unref(a)("connect.common.endDate"),
|
|
1048
1048
|
"onUpdate:modelValue": s[1] || (s[1] = (n) => {
|
|
1049
1049
|
var r;
|
|
1050
|
-
return
|
|
1050
|
+
return c("update:model-value", {
|
|
1051
1051
|
startDate: ((r = e.modelValue) == null ? void 0 : r.startDate) ?? null,
|
|
1052
1052
|
endDate: n
|
|
1053
1053
|
});
|
|
@@ -1076,11 +1076,11 @@ const _hoisted_1$l = {
|
|
|
1076
1076
|
},
|
|
1077
1077
|
emits: ["update:model-value"],
|
|
1078
1078
|
setup(e, { emit: m }) {
|
|
1079
|
-
const { t: a } = useI18n(),
|
|
1079
|
+
const { t: a } = useI18n(), c = e, i = m, s = useCoreStore(), l = computed(
|
|
1080
1080
|
() => CountryTimezone[s.currentCountry.value || "MY"]
|
|
1081
1081
|
);
|
|
1082
1082
|
function o() {
|
|
1083
|
-
const p = RuleBuilder.getRules(
|
|
1083
|
+
const p = RuleBuilder.getRules(c.modelValue);
|
|
1084
1084
|
return p.length == 0 ? "fixed" : p.some(
|
|
1085
1085
|
(d) => isRuleEntry(d) && RuleBuilder.simplify(d).operator == "_rrule"
|
|
1086
1086
|
) ? "repeating" : "fixed";
|
|
@@ -1089,25 +1089,25 @@ const _hoisted_1$l = {
|
|
|
1089
1089
|
{ label: a("connect.template.rule.schedule.fixed"), value: "fixed" },
|
|
1090
1090
|
{ label: a("connect.template.rule.schedule.repeating"), value: "repeating" }
|
|
1091
1091
|
]), v = computed(() => {
|
|
1092
|
-
const p = RuleBuilder.getRules(
|
|
1092
|
+
const p = RuleBuilder.getRules(c.modelValue), d = p.find(
|
|
1093
1093
|
(f) => isRuleEntry(f) && RuleBuilder.simplify(f).property == "trigger.date"
|
|
1094
|
-
),
|
|
1094
|
+
), u = p.find(
|
|
1095
1095
|
(f) => isRuleEntry(f) && RuleBuilder.simplify(f).property == "trigger.time"
|
|
1096
1096
|
);
|
|
1097
1097
|
return {
|
|
1098
1098
|
date: d ? RuleBuilder.simplify(d).equator : null,
|
|
1099
|
-
time:
|
|
1099
|
+
time: u ? RuleBuilder.simplify(u).equator : null
|
|
1100
1100
|
};
|
|
1101
1101
|
}), h = computed(
|
|
1102
1102
|
() => calculateNextScheduleAt(
|
|
1103
|
-
|
|
1103
|
+
c.modelValue,
|
|
1104
1104
|
/* @__PURE__ */ new Date(),
|
|
1105
|
-
|
|
1106
|
-
|
|
1105
|
+
c.startDate ? new Date(c.startDate) : void 0,
|
|
1106
|
+
c.endDate ? new Date(c.endDate) : void 0
|
|
1107
1107
|
)
|
|
1108
1108
|
);
|
|
1109
1109
|
function x(p) {
|
|
1110
|
-
const d = p.value,
|
|
1110
|
+
const d = p.value, u = d == "fixed" ? [
|
|
1111
1111
|
RuleBuilder.constructEntry(
|
|
1112
1112
|
"trigger.date",
|
|
1113
1113
|
"_isOnDate",
|
|
@@ -1119,7 +1119,7 @@ const _hoisted_1$l = {
|
|
|
1119
1119
|
"trigger.date",
|
|
1120
1120
|
"_rrule",
|
|
1121
1121
|
new RRule({
|
|
1122
|
-
dtstart:
|
|
1122
|
+
dtstart: c.startDate ? new Date(c.startDate) : /* @__PURE__ */ new Date(),
|
|
1123
1123
|
freq: RRule.DAILY,
|
|
1124
1124
|
interval: 1,
|
|
1125
1125
|
byhour: 0,
|
|
@@ -1134,7 +1134,7 @@ const _hoisted_1$l = {
|
|
|
1134
1134
|
"update:model-value",
|
|
1135
1135
|
RuleBuilder.setRuleToGroup(
|
|
1136
1136
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1137
|
-
|
|
1137
|
+
u
|
|
1138
1138
|
)
|
|
1139
1139
|
), n.value = d;
|
|
1140
1140
|
}
|
|
@@ -1170,9 +1170,9 @@ const _hoisted_1$l = {
|
|
|
1170
1170
|
);
|
|
1171
1171
|
}
|
|
1172
1172
|
return (p, d) => {
|
|
1173
|
-
const
|
|
1173
|
+
const u = resolveComponent("FmButtonGroup"), f = resolveComponent("FmTimePicker"), B = resolveComponent("FmIcon"), b = resolveComponent("FmTooltip"), E = resolveComponent("FmField"), N = resolveComponent("FmCard"), C = resolveComponent("FmPopover"), R = resolveComponent("FmDatePicker"), S = resolveComponent("FmHelperText");
|
|
1174
1174
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
1175
|
-
createVNode(
|
|
1175
|
+
createVNode(u, {
|
|
1176
1176
|
items: unref(y),
|
|
1177
1177
|
"model-value": unref(y).find(($) => $.value === unref(n)) ?? null,
|
|
1178
1178
|
"onUpdate:modelValue": x,
|
|
@@ -1264,7 +1264,7 @@ const _hoisted_1$l = {
|
|
|
1264
1264
|
},
|
|
1265
1265
|
emits: ["update:model-value"],
|
|
1266
1266
|
setup(e, { emit: m }) {
|
|
1267
|
-
const { t: a } = useI18n(),
|
|
1267
|
+
const { t: a } = useI18n(), c = e, i = m, s = computed(
|
|
1268
1268
|
() => [
|
|
1269
1269
|
{
|
|
1270
1270
|
label: a("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
|
|
@@ -1293,7 +1293,7 @@ const _hoisted_1$l = {
|
|
|
1293
1293
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
1294
1294
|
}]),
|
|
1295
1295
|
onClick: () => {
|
|
1296
|
-
|
|
1296
|
+
c.modelValue != r.value && i("update:model-value", r.value);
|
|
1297
1297
|
},
|
|
1298
1298
|
key: r.value
|
|
1299
1299
|
}, {
|
|
@@ -1314,12 +1314,12 @@ const _hoisted_1$l = {
|
|
|
1314
1314
|
__name: "EditRewardPoolSheet",
|
|
1315
1315
|
emits: ["update:model-value"],
|
|
1316
1316
|
setup(e, { expose: m, emit: a }) {
|
|
1317
|
-
const
|
|
1317
|
+
const c = useMembershipStore(), { minor: i } = useLoading, s = ref(!1), l = ref(), o = ref(), n = ref(0), r = computed(() => {
|
|
1318
1318
|
var p;
|
|
1319
|
-
return ((p =
|
|
1319
|
+
return ((p = c.loyaltyRewards.items.find(
|
|
1320
1320
|
(d) => {
|
|
1321
|
-
var
|
|
1322
|
-
return d.value === ((
|
|
1321
|
+
var u;
|
|
1322
|
+
return d.value === ((u = l.value) == null ? void 0 : u.collectible);
|
|
1323
1323
|
}
|
|
1324
1324
|
)) == null ? void 0 : p.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
1325
1325
|
}), y = computed(() => {
|
|
@@ -1348,7 +1348,7 @@ const _hoisted_1$l = {
|
|
|
1348
1348
|
return m({
|
|
1349
1349
|
showSheet: v
|
|
1350
1350
|
}), (k, p) => {
|
|
1351
|
-
const d = resolveComponent("FmSelect"),
|
|
1351
|
+
const d = resolveComponent("FmSelect"), u = resolveComponent("FmStepperField"), f = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
|
|
1352
1352
|
return openBlock(), createBlock(B, {
|
|
1353
1353
|
"max-width": 560,
|
|
1354
1354
|
modelValue: unref(s),
|
|
@@ -1408,7 +1408,7 @@ const _hoisted_1$l = {
|
|
|
1408
1408
|
},
|
|
1409
1409
|
weight: 1
|
|
1410
1410
|
} : l.value = {
|
|
1411
|
-
collectible: unref(
|
|
1411
|
+
collectible: unref(c).loyaltyRewards.raw[0]._id,
|
|
1412
1412
|
type: "LOYALTY",
|
|
1413
1413
|
earningOption: {
|
|
1414
1414
|
amount: 1,
|
|
@@ -1425,11 +1425,11 @@ const _hoisted_1$l = {
|
|
|
1425
1425
|
key: 0,
|
|
1426
1426
|
label: "Loyalty type",
|
|
1427
1427
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "collectible", [unref(l).type])],
|
|
1428
|
-
items: unref(
|
|
1428
|
+
items: unref(c).loyaltyRewards.items,
|
|
1429
1429
|
"model-value": unref(l).collectible,
|
|
1430
1430
|
"onUpdate:modelValue": p[1] || (p[1] = (C) => unref(l).collectible = C)
|
|
1431
1431
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1432
|
-
createVNode(
|
|
1432
|
+
createVNode(u, {
|
|
1433
1433
|
label: "Weight",
|
|
1434
1434
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "weight", [unref(l).type])],
|
|
1435
1435
|
"model-value": unref(l).weight,
|
|
@@ -1439,7 +1439,7 @@ const _hoisted_1$l = {
|
|
|
1439
1439
|
})
|
|
1440
1440
|
}, null, 8, ["rules", "model-value"]),
|
|
1441
1441
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1442
|
-
((b = unref(
|
|
1442
|
+
((b = unref(c).loyaltyRewards.items.find(
|
|
1443
1443
|
(C) => {
|
|
1444
1444
|
var R;
|
|
1445
1445
|
return C.value === ((R = unref(l)) == null ? void 0 : R.collectible);
|
|
@@ -1464,7 +1464,7 @@ const _hoisted_1$l = {
|
|
|
1464
1464
|
p[12] || (p[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
1465
1465
|
createVNode(_sfc_main$s, {
|
|
1466
1466
|
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
1467
|
-
"for-credit": unref(l).type === "LOYALTY" && ((E = unref(
|
|
1467
|
+
"for-credit": unref(l).type === "LOYALTY" && ((E = unref(c).loyaltyRewards.items.find(
|
|
1468
1468
|
(C) => {
|
|
1469
1469
|
var R;
|
|
1470
1470
|
return C.value === ((R = unref(l)) == null ? void 0 : R.collectible);
|
|
@@ -1517,32 +1517,32 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1517
1517
|
},
|
|
1518
1518
|
emits: ["update:model-value"],
|
|
1519
1519
|
setup(e, { emit: m }) {
|
|
1520
|
-
const a = e,
|
|
1520
|
+
const a = e, c = m, i = useMembershipStore(), { t: s } = useI18n(), l = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => a.modelValue ?? []), n = computed(() => {
|
|
1521
1521
|
const p = l.safeParse(o.value);
|
|
1522
1522
|
return p.success ? [] : p.error.errors;
|
|
1523
1523
|
}), r = ref();
|
|
1524
1524
|
function y(p, d) {
|
|
1525
1525
|
var f;
|
|
1526
|
-
const
|
|
1527
|
-
|
|
1526
|
+
const u = [...o.value];
|
|
1527
|
+
u[d] = p, (f = r.value) == null || f.showSheet(!1), c("update:model-value", u);
|
|
1528
1528
|
}
|
|
1529
1529
|
function v(p) {
|
|
1530
1530
|
const d = p.type == "VOUCHER" ? p.collectibleConfig : i.collectibles.find(
|
|
1531
1531
|
(B) => B._id.toString() == p.collectible
|
|
1532
|
-
),
|
|
1532
|
+
), u = CollectionUtils.formattedType((d == null ? void 0 : d.name) || ""), f = p.weight;
|
|
1533
1533
|
return {
|
|
1534
|
-
label: isNullOrEmpty(
|
|
1534
|
+
label: isNullOrEmpty(u) ? "NO REWARD" : u,
|
|
1535
1535
|
sublabel: `${f} (${(f / o.value.reduce((B, b) => B + b.weight, 0) * 100).toFixed(2)}%)`
|
|
1536
1536
|
};
|
|
1537
1537
|
}
|
|
1538
1538
|
function h(p) {
|
|
1539
|
-
var
|
|
1539
|
+
var u;
|
|
1540
1540
|
const d = [...o.value];
|
|
1541
|
-
(
|
|
1541
|
+
(u = r.value) == null || u.showSheet(!0, d[p], p);
|
|
1542
1542
|
}
|
|
1543
1543
|
function x(p) {
|
|
1544
1544
|
const d = [...o.value];
|
|
1545
|
-
d.splice(p, 1),
|
|
1545
|
+
d.splice(p, 1), c("update:model-value", d);
|
|
1546
1546
|
}
|
|
1547
1547
|
function k() {
|
|
1548
1548
|
var p;
|
|
@@ -1557,10 +1557,10 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1557
1557
|
);
|
|
1558
1558
|
}
|
|
1559
1559
|
return (p, d) => {
|
|
1560
|
-
const
|
|
1560
|
+
const u = resolveComponent("FmButton"), f = resolveComponent("FmCard"), B = resolveComponent("FmHelperText");
|
|
1561
1561
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
1562
1562
|
createElementVNode("div", _hoisted_2$9, toDisplayString(unref(s)("connect.template.configure_reward_type")), 1),
|
|
1563
|
-
createVNode(
|
|
1563
|
+
createVNode(u, {
|
|
1564
1564
|
label: unref(s)("connect.campaign.rewardPool.addReward"),
|
|
1565
1565
|
onClick: d[0] || (d[0] = (b) => k()),
|
|
1566
1566
|
variant: "plain",
|
|
@@ -1579,7 +1579,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1579
1579
|
createElementVNode("div", _hoisted_3$7, toDisplayString(b.type == "LOYALTY" ? (N = b == null ? void 0 : b.earningOption) == null ? void 0 : N.amount : "") + " " + toDisplayString(v(b).label), 1),
|
|
1580
1580
|
createElementVNode("div", _hoisted_4$6, toDisplayString(v(b).sublabel), 1)
|
|
1581
1581
|
]),
|
|
1582
|
-
createVNode(
|
|
1582
|
+
createVNode(u, {
|
|
1583
1583
|
icon: "delete",
|
|
1584
1584
|
variant: "tertiary",
|
|
1585
1585
|
onClick: (C) => (C.stopPropagation(), x(E))
|
|
@@ -1613,7 +1613,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1613
1613
|
},
|
|
1614
1614
|
emits: ["update:model-value"],
|
|
1615
1615
|
setup(e, { emit: m }) {
|
|
1616
|
-
const { t: a } = useI18n(),
|
|
1616
|
+
const { t: a } = useI18n(), c = e, i = m, s = computed(() => [
|
|
1617
1617
|
{
|
|
1618
1618
|
label: a("connect.template.promotion_game.rock_paper_scissors.label"),
|
|
1619
1619
|
description: a("connect.template.promotion_game.rock_paper_scissors.description"),
|
|
@@ -1640,8 +1640,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1640
1640
|
"hover:bg-fm-color-opacity-sm": ((d = e.modelValue) == null ? void 0 : d.gameType) != k.value
|
|
1641
1641
|
}]),
|
|
1642
1642
|
onClick: () => {
|
|
1643
|
-
var
|
|
1644
|
-
((
|
|
1643
|
+
var u;
|
|
1644
|
+
((u = c.modelValue) == null ? void 0 : u.gameType) != k.value && i("update:model-value", { gameType: k.value });
|
|
1645
1645
|
},
|
|
1646
1646
|
key: k.value
|
|
1647
1647
|
}, {
|
|
@@ -1677,7 +1677,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1677
1677
|
},
|
|
1678
1678
|
emits: ["update:model-value"],
|
|
1679
1679
|
setup(e, { emit: m }) {
|
|
1680
|
-
const { t: a } = useI18n(),
|
|
1680
|
+
const { t: a } = useI18n(), c = e, i = m, s = ref(c.modelValue ?? {}), l = ref(
|
|
1681
1681
|
(() => {
|
|
1682
1682
|
const v = {};
|
|
1683
1683
|
return s.value.workingHour && Object.keys(s.value.workingHour).forEach((h) => {
|
|
@@ -1710,7 +1710,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1710
1710
|
s.value.workingHour = Object.keys(v).length > 0 ? v : void 0;
|
|
1711
1711
|
};
|
|
1712
1712
|
return watch(s, () => i("update:model-value", s.value), { deep: !0 }), watch(l, y, { deep: !0 }), (v, h) => {
|
|
1713
|
-
const x = resolveComponent("FmSelect"), k = resolveComponent("FmStepperField"), p = resolveComponent("FmCheckbox"), d = resolveComponent("FmTimePicker"),
|
|
1713
|
+
const x = resolveComponent("FmSelect"), k = resolveComponent("FmStepperField"), p = resolveComponent("FmCheckbox"), d = resolveComponent("FmTimePicker"), u = resolveComponent("FmButton");
|
|
1714
1714
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1715
1715
|
createElementVNode("div", _hoisted_2$7, [
|
|
1716
1716
|
createVNode(x, {
|
|
@@ -1794,13 +1794,13 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1794
1794
|
unref(l)[f.key] && unref(l)[f.key][b] && (unref(l)[f.key][b].endTime = E || "", y());
|
|
1795
1795
|
}
|
|
1796
1796
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
1797
|
-
createVNode(
|
|
1797
|
+
createVNode(u, {
|
|
1798
1798
|
variant: "tertiary",
|
|
1799
1799
|
size: "sm",
|
|
1800
1800
|
onClick: (E) => r(f.key, b),
|
|
1801
1801
|
icon: "close"
|
|
1802
1802
|
}, null, 8, ["onClick"]),
|
|
1803
|
-
b === 0 ? (openBlock(), createBlock(
|
|
1803
|
+
b === 0 ? (openBlock(), createBlock(u, {
|
|
1804
1804
|
key: 0,
|
|
1805
1805
|
onClick: (E) => n(f.key),
|
|
1806
1806
|
icon: "add",
|
|
@@ -1827,7 +1827,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1827
1827
|
},
|
|
1828
1828
|
emits: ["update:model-value"],
|
|
1829
1829
|
setup(e, { emit: m }) {
|
|
1830
|
-
const { t: a } = useI18n(),
|
|
1830
|
+
const { t: a } = useI18n(), c = e, i = m, s = ref(c.modelValue ?? {});
|
|
1831
1831
|
return watch(s, () => i("update:model-value", s.value)), (l, o) => {
|
|
1832
1832
|
const n = resolveComponent("FmStepperField");
|
|
1833
1833
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
@@ -1877,7 +1877,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1877
1877
|
},
|
|
1878
1878
|
emits: ["update:model-value"],
|
|
1879
1879
|
setup(e, { emit: m }) {
|
|
1880
|
-
const { t: a } = useI18n(),
|
|
1880
|
+
const { t: a } = useI18n(), c = e, i = m, s = computed(() => [
|
|
1881
1881
|
{
|
|
1882
1882
|
label: a("connect.campaign.mission.typeOption.STAMP.label"),
|
|
1883
1883
|
description: a("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -1902,7 +1902,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1902
1902
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
1903
1903
|
}]),
|
|
1904
1904
|
onClick: () => {
|
|
1905
|
-
|
|
1905
|
+
c.modelValue != r.value && i("update:model-value", r.value);
|
|
1906
1906
|
},
|
|
1907
1907
|
key: r.value
|
|
1908
1908
|
}, {
|
|
@@ -1932,7 +1932,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1932
1932
|
emits: ["update:model-value"],
|
|
1933
1933
|
setup(e, { emit: m }) {
|
|
1934
1934
|
const a = m;
|
|
1935
|
-
return (
|
|
1935
|
+
return (c, i) => {
|
|
1936
1936
|
const s = resolveComponent("FmStepperField");
|
|
1937
1937
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1938
1938
|
i[1] || (i[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1)),
|
|
@@ -1956,20 +1956,20 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1956
1956
|
},
|
|
1957
1957
|
emits: ["update:model-value"],
|
|
1958
1958
|
setup(e, { expose: m, emit: a }) {
|
|
1959
|
-
const
|
|
1960
|
-
var
|
|
1961
|
-
return ((
|
|
1959
|
+
const c = e, i = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), o = ref(), n = ref(), r = ref(0), y = computed(() => {
|
|
1960
|
+
var u;
|
|
1961
|
+
return ((u = i.loyaltyRewards.items.find(
|
|
1962
1962
|
(f) => {
|
|
1963
1963
|
var B;
|
|
1964
1964
|
return f.value === ((B = o.value) == null ? void 0 : B.collectible);
|
|
1965
1965
|
}
|
|
1966
|
-
)) == null ? void 0 :
|
|
1966
|
+
)) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
|
|
1967
1967
|
}), v = computed(() => {
|
|
1968
1968
|
const d = y.value.safeParse(o.value);
|
|
1969
1969
|
return d.success ? [] : d.error.errors;
|
|
1970
1970
|
});
|
|
1971
|
-
function h(d,
|
|
1972
|
-
d && (o.value =
|
|
1971
|
+
function h(d, u, f) {
|
|
1972
|
+
d && (o.value = u, r.value = f), l.value = d;
|
|
1973
1973
|
}
|
|
1974
1974
|
const x = a;
|
|
1975
1975
|
async function k() {
|
|
@@ -1990,14 +1990,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1990
1990
|
const p = ref();
|
|
1991
1991
|
return m({
|
|
1992
1992
|
showSheet: h
|
|
1993
|
-
}), (d,
|
|
1993
|
+
}), (d, u) => {
|
|
1994
1994
|
const f = resolveComponent("FmStepperField"), B = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), E = resolveComponent("FmButton"), N = resolveComponent("FmSideSheet");
|
|
1995
1995
|
return openBlock(), createBlock(N, {
|
|
1996
1996
|
"max-width": 560,
|
|
1997
1997
|
modelValue: unref(l),
|
|
1998
1998
|
"onUpdate:modelValue": [
|
|
1999
|
-
|
|
2000
|
-
|
|
1999
|
+
u[10] || (u[10] = (C) => isRef(l) ? l.value = C : null),
|
|
2000
|
+
u[11] || (u[11] = (C) => l.value = C)
|
|
2001
2001
|
],
|
|
2002
2002
|
header: "Edit reward",
|
|
2003
2003
|
"dismiss-away": ""
|
|
@@ -2009,7 +2009,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2009
2009
|
type: "button",
|
|
2010
2010
|
label: "Confirm",
|
|
2011
2011
|
disabled: unref(v).length > 0,
|
|
2012
|
-
onClick:
|
|
2012
|
+
onClick: u[8] || (u[8] = async () => {
|
|
2013
2013
|
var C;
|
|
2014
2014
|
return (C = unref(p)) == null ? void 0 : C.validateInputs();
|
|
2015
2015
|
})
|
|
@@ -2018,7 +2018,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2018
2018
|
variant: "secondary",
|
|
2019
2019
|
type: "button",
|
|
2020
2020
|
label: "Cancel",
|
|
2021
|
-
onClick:
|
|
2021
|
+
onClick: u[9] || (u[9] = (C) => l.value = !1)
|
|
2022
2022
|
})
|
|
2023
2023
|
])
|
|
2024
2024
|
]),
|
|
@@ -2029,7 +2029,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2029
2029
|
class: "flex flex-col gap-y-24",
|
|
2030
2030
|
ref_key: "formRef",
|
|
2031
2031
|
ref: p,
|
|
2032
|
-
onValidationSuccess:
|
|
2032
|
+
onValidationSuccess: u[7] || (u[7] = (C) => k())
|
|
2033
2033
|
}, {
|
|
2034
2034
|
default: withCtx(() => {
|
|
2035
2035
|
var C, R;
|
|
@@ -2040,13 +2040,13 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2040
2040
|
rules: [
|
|
2041
2041
|
unref(ZodHelper).toRule(
|
|
2042
2042
|
unref(z).number().min(1).max(
|
|
2043
|
-
|
|
2044
|
-
`Number cannot be more than ${
|
|
2043
|
+
c.maxThreshold,
|
|
2044
|
+
`Number cannot be more than ${c.maxThreshold}`
|
|
2045
2045
|
)
|
|
2046
2046
|
)
|
|
2047
2047
|
],
|
|
2048
2048
|
"model-value": unref(o).threshold,
|
|
2049
|
-
"onUpdate:modelValue":
|
|
2049
|
+
"onUpdate:modelValue": u[0] || (u[0] = (S) => o.value = {
|
|
2050
2050
|
...unref(o),
|
|
2051
2051
|
threshold: S
|
|
2052
2052
|
})
|
|
@@ -2058,7 +2058,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2058
2058
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
2059
2059
|
],
|
|
2060
2060
|
"model-value": unref(o).type,
|
|
2061
|
-
"onUpdate:modelValue":
|
|
2061
|
+
"onUpdate:modelValue": u[1] || (u[1] = (S) => {
|
|
2062
2062
|
var $, H;
|
|
2063
2063
|
S === "VOUCHER" ? o.value = {
|
|
2064
2064
|
collectible: null,
|
|
@@ -2094,10 +2094,10 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2094
2094
|
rules: [unref(ZodHelper).ruleAtPath(unref(y), "collectible", [unref(o).type])],
|
|
2095
2095
|
items: unref(i).loyaltyRewards.items,
|
|
2096
2096
|
"model-value": unref(o).collectible,
|
|
2097
|
-
"onUpdate:modelValue":
|
|
2097
|
+
"onUpdate:modelValue": u[2] || (u[2] = (S) => unref(o).collectible = S)
|
|
2098
2098
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
2099
2099
|
unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2100
|
-
|
|
2100
|
+
u[12] || (u[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
2101
2101
|
createVNode(_sfc_main$r, {
|
|
2102
2102
|
class: "mt-[-8px]",
|
|
2103
2103
|
rules: [unref(ZodHelper).ruleAtPath(unref(y), "earningOption", [unref(o).type])],
|
|
@@ -2105,7 +2105,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2105
2105
|
"error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
|
|
2106
2106
|
"fixed-type": !0,
|
|
2107
2107
|
"model-value": unref(o).earningOption,
|
|
2108
|
-
"onUpdate:modelValue":
|
|
2108
|
+
"onUpdate:modelValue": u[3] || (u[3] = (S) => o.value = {
|
|
2109
2109
|
...unref(o),
|
|
2110
2110
|
earningOption: S
|
|
2111
2111
|
})
|
|
@@ -2121,7 +2121,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2121
2121
|
)) == null ? void 0 : C.raw.type) === "CREDIT",
|
|
2122
2122
|
rules: [unref(ZodHelper).ruleAtPath(unref(y), "validityOption", [unref(o).type])],
|
|
2123
2123
|
"model-value": unref(o).validityOption,
|
|
2124
|
-
"onUpdate:modelValue":
|
|
2124
|
+
"onUpdate:modelValue": u[4] || (u[4] = (S) => o.value = {
|
|
2125
2125
|
...unref(o),
|
|
2126
2126
|
validityOption: S
|
|
2127
2127
|
})
|
|
@@ -2131,11 +2131,11 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2131
2131
|
key: 3,
|
|
2132
2132
|
"reward-image": unref(n),
|
|
2133
2133
|
"model-value": ((R = unref(o)) == null ? void 0 : R.collectibleConfig) ?? void 0,
|
|
2134
|
-
"onUpdate:modelValue":
|
|
2134
|
+
"onUpdate:modelValue": u[5] || (u[5] = (S) => o.value = {
|
|
2135
2135
|
...unref(o),
|
|
2136
2136
|
collectibleConfig: S
|
|
2137
2137
|
}),
|
|
2138
|
-
"onUpdate:rewardImage":
|
|
2138
|
+
"onUpdate:rewardImage": u[6] || (u[6] = (S) => n.value = S)
|
|
2139
2139
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
2140
2140
|
createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
|
|
2141
2141
|
];
|
|
@@ -2171,17 +2171,17 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2171
2171
|
}
|
|
2172
2172
|
},
|
|
2173
2173
|
setup(e) {
|
|
2174
|
-
const m = e, { maxRange: a, currentRange:
|
|
2175
|
-
() => Math.min(
|
|
2174
|
+
const m = e, { maxRange: a, currentRange: c, markers: i } = toRefs(m), s = computed(
|
|
2175
|
+
() => Math.min(c.value / a.value * 100, 100)
|
|
2176
2176
|
), l = (o) => o / a.value * 100;
|
|
2177
2177
|
return (o, n) => {
|
|
2178
2178
|
const r = resolveComponent("FmIcon");
|
|
2179
2179
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
2180
2180
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (y) => (openBlock(), createBlock(r, {
|
|
2181
2181
|
class: normalizeClass(
|
|
2182
|
-
unref(
|
|
2182
|
+
unref(c) >= y ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
2183
2183
|
),
|
|
2184
|
-
outline: unref(
|
|
2184
|
+
outline: unref(c) < y,
|
|
2185
2185
|
key: y,
|
|
2186
2186
|
name: unref(i).some((v) => v === y) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
2187
2187
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
@@ -2210,14 +2210,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2210
2210
|
}
|
|
2211
2211
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
2212
2212
|
function changeKeysFactory(e) {
|
|
2213
|
-
return function m(a,
|
|
2214
|
-
if (
|
|
2213
|
+
return function m(a, c = 1, i) {
|
|
2214
|
+
if (c === 0 || !isObject(a))
|
|
2215
2215
|
return a;
|
|
2216
2216
|
if (Array.isArray(a))
|
|
2217
|
-
return a.map((l) => m(l,
|
|
2217
|
+
return a.map((l) => m(l, c - 1, i));
|
|
2218
2218
|
const s = Object.create(Object.getPrototypeOf(a));
|
|
2219
2219
|
return Object.keys(a).forEach((l) => {
|
|
2220
|
-
const o = a[l], n = e(l, i), r = m(o,
|
|
2220
|
+
const o = a[l], n = e(l, i), r = m(o, c - 1, i);
|
|
2221
2221
|
s[n] = r;
|
|
2222
2222
|
}), s;
|
|
2223
2223
|
};
|
|
@@ -2236,21 +2236,21 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2236
2236
|
},
|
|
2237
2237
|
emits: ["update:model-value"],
|
|
2238
2238
|
setup(e, { emit: m }) {
|
|
2239
|
-
const { t: a } = useI18n(),
|
|
2240
|
-
() =>
|
|
2239
|
+
const { t: a } = useI18n(), c = e, i = m, s = useMembershipStore(), l = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
|
|
2240
|
+
() => c.modelValue.sort((d, u) => d.threshold - u.threshold) ?? []
|
|
2241
2241
|
), n = computed(() => {
|
|
2242
2242
|
const d = l.safeParse(o.value);
|
|
2243
2243
|
return d.success ? [] : d.error.errors;
|
|
2244
2244
|
}), r = ref();
|
|
2245
|
-
function y(d,
|
|
2245
|
+
function y(d, u) {
|
|
2246
2246
|
var B;
|
|
2247
2247
|
const f = [...o.value];
|
|
2248
|
-
f[
|
|
2248
|
+
f[u] = d, (B = r.value) == null || B.showSheet(!1), i("update:model-value", f);
|
|
2249
2249
|
}
|
|
2250
2250
|
function v(d) {
|
|
2251
|
-
const
|
|
2251
|
+
const u = d.type == "VOUCHER" ? d.collectibleConfig : s.collectibles.find(
|
|
2252
2252
|
(b) => b._id.toString() == d.collectible
|
|
2253
|
-
), f = CollectionUtils.formattedType((
|
|
2253
|
+
), f = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), B = d.earningOption.type == "FIXED" ? a("connect.template.mission_pool.reward_sublabel_fixed", {
|
|
2254
2254
|
threshold: d.threshold,
|
|
2255
2255
|
amount: d.earningOption.amount
|
|
2256
2256
|
}) : a("connect.template.mission_pool.reward_sublabel_per_spend", {
|
|
@@ -2265,12 +2265,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2265
2265
|
}
|
|
2266
2266
|
function h(d) {
|
|
2267
2267
|
var f;
|
|
2268
|
-
const
|
|
2269
|
-
(f = r.value) == null || f.showSheet(!0,
|
|
2268
|
+
const u = [...o.value];
|
|
2269
|
+
(f = r.value) == null || f.showSheet(!0, u[d], d);
|
|
2270
2270
|
}
|
|
2271
2271
|
function x(d) {
|
|
2272
|
-
const
|
|
2273
|
-
|
|
2272
|
+
const u = [...o.value];
|
|
2273
|
+
u.splice(d, 1), i("update:model-value", u);
|
|
2274
2274
|
}
|
|
2275
2275
|
function k() {
|
|
2276
2276
|
var d;
|
|
@@ -2292,20 +2292,20 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2292
2292
|
);
|
|
2293
2293
|
}
|
|
2294
2294
|
function p(d) {
|
|
2295
|
-
var
|
|
2296
|
-
return d.type == "VOUCHER" ? (
|
|
2295
|
+
var u, f;
|
|
2296
|
+
return d.type == "VOUCHER" ? (u = d.collectibleConfig) == null ? void 0 : u.name : sentenceCase(
|
|
2297
2297
|
((f = s.loyaltyRewards.items.find(
|
|
2298
2298
|
(B) => B.value == d.collectible
|
|
2299
2299
|
)) == null ? void 0 : f.label) || ""
|
|
2300
2300
|
);
|
|
2301
2301
|
}
|
|
2302
|
-
return (d,
|
|
2302
|
+
return (d, u) => {
|
|
2303
2303
|
const f = resolveComponent("FmButton"), B = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
|
|
2304
2304
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2305
2305
|
createElementVNode("div", _hoisted_2$3, toDisplayString(unref(a)("connect.template.configure_reward_customer")), 1),
|
|
2306
2306
|
createVNode(f, {
|
|
2307
2307
|
label: unref(a)("connect.template.mission_pool.add_reward"),
|
|
2308
|
-
onClick:
|
|
2308
|
+
onClick: u[0] || (u[0] = (E) => k()),
|
|
2309
2309
|
variant: "plain",
|
|
2310
2310
|
icon: "add"
|
|
2311
2311
|
}, null, 8, ["label"]),
|
|
@@ -2377,8 +2377,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2377
2377
|
},
|
|
2378
2378
|
emits: ["update:model-value"],
|
|
2379
2379
|
setup(e, { emit: m }) {
|
|
2380
|
-
const { t: a } = useI18n(),
|
|
2381
|
-
const o = FdoMission.safeParse(
|
|
2380
|
+
const { t: a } = useI18n(), c = e, i = computed(() => {
|
|
2381
|
+
const o = FdoMission.safeParse(c.modelValue);
|
|
2382
2382
|
return o.success ? [] : o.error.errors;
|
|
2383
2383
|
}), s = computed(() => [
|
|
2384
2384
|
{
|
|
@@ -2452,8 +2452,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2452
2452
|
});
|
|
2453
2453
|
function useLocaleText() {
|
|
2454
2454
|
const { locale: e, t: m } = useI18n();
|
|
2455
|
-
function a(
|
|
2456
|
-
return
|
|
2455
|
+
function a(c, i) {
|
|
2456
|
+
return c ? c[e.value] ?? c["en-US"] ?? m(i) : m(i);
|
|
2457
2457
|
}
|
|
2458
2458
|
return { getLocaleText: a };
|
|
2459
2459
|
}
|
|
@@ -2484,7 +2484,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2484
2484
|
},
|
|
2485
2485
|
emits: ["update:model-value", "update:file"],
|
|
2486
2486
|
setup(e, { emit: m }) {
|
|
2487
|
-
const { t: a } = useI18n(), { getLocaleText:
|
|
2487
|
+
const { t: a } = useI18n(), { getLocaleText: c } = useLocaleText(), i = e, s = m;
|
|
2488
2488
|
function l(y) {
|
|
2489
2489
|
switch (i.field.type) {
|
|
2490
2490
|
case "timeframe":
|
|
@@ -2534,15 +2534,15 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2534
2534
|
labelMark: i.schema && ZodHelper.isRequired(i.schema) == !1 ? "optional" : void 0,
|
|
2535
2535
|
zodLabel: i.schema ? ZodHelper.toInputLabel(
|
|
2536
2536
|
i.schema,
|
|
2537
|
-
|
|
2537
|
+
c(i.field.label_locale, i.field.label ?? "")
|
|
2538
2538
|
) : void 0
|
|
2539
2539
|
}));
|
|
2540
2540
|
return (y, v) => {
|
|
2541
|
-
var
|
|
2541
|
+
var u, f, B, b, E;
|
|
2542
2542
|
const h = resolveComponent("FmTextField"), x = resolveComponent("FmStepperField"), k = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), d = resolveComponent("FmSwitch");
|
|
2543
2543
|
return e.field.type === "text" ? (openBlock(), createBlock(h, {
|
|
2544
2544
|
key: 0,
|
|
2545
|
-
label: unref(
|
|
2545
|
+
label: unref(c)(e.field.label_locale, e.field.label ?? ""),
|
|
2546
2546
|
"label-mark": unref(r).labelMark,
|
|
2547
2547
|
rules: unref(r).rules,
|
|
2548
2548
|
"model-value": unref(o),
|
|
@@ -2554,7 +2554,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2554
2554
|
json: { schema: unref(r).unwrapped, props: i }
|
|
2555
2555
|
}, null, 8, ["json"]),
|
|
2556
2556
|
createVNode(x, {
|
|
2557
|
-
label: unref(
|
|
2557
|
+
label: unref(c)(e.field.label_locale, e.field.label ?? ""),
|
|
2558
2558
|
"label-mark": e.field.isRuleChildren ? void 0 : unref(r).labelMark,
|
|
2559
2559
|
"model-value": unref(o),
|
|
2560
2560
|
rules: e.field.isRuleChildren ? [] : unref(r).rules,
|
|
@@ -2564,13 +2564,13 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2564
2564
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
2565
2565
|
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(k, {
|
|
2566
2566
|
key: 2,
|
|
2567
|
-
label: unref(
|
|
2567
|
+
label: unref(c)(e.field.label_locale, e.field.label ?? ""),
|
|
2568
2568
|
"label-mark": unref(r).labelMark,
|
|
2569
2569
|
rules: unref(r).rules,
|
|
2570
2570
|
"model-value": unref(o),
|
|
2571
2571
|
"onUpdate:modelValue": l,
|
|
2572
2572
|
"show-word-count": "",
|
|
2573
|
-
"max-length": (E = (b = (B = (f = (
|
|
2573
|
+
"max-length": (E = (b = (B = (f = (u = unref(r)) == null ? void 0 : u.unwrapped) == null ? void 0 : f._def) == null ? void 0 : B.checks) == null ? void 0 : b.find((N) => N.kind == "max")) == null ? void 0 : E.value
|
|
2574
2574
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$i, {
|
|
2575
2575
|
key: 3,
|
|
2576
2576
|
"campaign-type": e.extras,
|
|
@@ -2600,7 +2600,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2600
2600
|
_: 1
|
|
2601
2601
|
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(d, {
|
|
2602
2602
|
key: 6,
|
|
2603
|
-
label: unref(
|
|
2603
|
+
label: unref(c)(e.field.label_locale, e.field.label ?? ""),
|
|
2604
2604
|
"label-placement": "right",
|
|
2605
2605
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
2606
2606
|
"label-mark": unref(r).labelMark,
|
|
@@ -2797,7 +2797,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2797
2797
|
},
|
|
2798
2798
|
setup(e) {
|
|
2799
2799
|
const { t: m, te: a } = useI18n();
|
|
2800
|
-
return (
|
|
2800
|
+
return (c, i) => {
|
|
2801
2801
|
const s = resolveComponent("FmCard");
|
|
2802
2802
|
return openBlock(), createBlock(s, {
|
|
2803
2803
|
variant: "outlined",
|
|
@@ -2831,28 +2831,32 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2831
2831
|
TEMPLATES.VOUCHER
|
|
2832
2832
|
), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign"), campaignType = ref("VOUCHER");
|
|
2833
2833
|
async function showSheet(visible, type, campaign, selectedTemplate) {
|
|
2834
|
-
var e, m;
|
|
2834
|
+
var e, m, a;
|
|
2835
2835
|
if (sheetVisible.value = visible, campaignType.value = type, visible == !0) {
|
|
2836
2836
|
try {
|
|
2837
2837
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
2838
2838
|
} catch {
|
|
2839
2839
|
} finally {
|
|
2840
|
-
await new Promise((
|
|
2840
|
+
await new Promise((c) => setTimeout(c, 120)), isLoading.value = !1;
|
|
2841
2841
|
}
|
|
2842
2842
|
console.log(
|
|
2843
2843
|
TEMPLATES[type],
|
|
2844
2844
|
"base template"
|
|
2845
|
-
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2845
|
+
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((c, i) => {
|
|
2846
|
+
var s;
|
|
2847
|
+
if (c.campaign.type === "VOUCHER" && c.campaign.code) {
|
|
2848
|
+
const l = (s = c.campaign._id) == null ? void 0 : s.toString();
|
|
2849
|
+
useCampaignStore().campaigns.voucher.some(
|
|
2850
|
+
(o) => o.code === c.campaign.code && o._id.toString() !== l
|
|
2851
|
+
) && i.addIssue({
|
|
2852
|
+
code: "custom",
|
|
2853
|
+
message: "Code already exists, please use another code",
|
|
2854
|
+
path: ["campaign", "code"]
|
|
2855
|
+
});
|
|
2856
|
+
}
|
|
2853
2857
|
})), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
2854
2858
|
...(m = template.value) == null ? void 0 : m.defaultValue
|
|
2855
|
-
}), "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 ? t("connect.campaign.common.edit_campaign_title", {
|
|
2859
|
+
}), "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 = (a = campaign == null ? void 0 : campaign.campaign) != null && a._id ? t("connect.campaign.common.edit_campaign_title", {
|
|
2856
2860
|
typeName: t(`connect.campaign.common.typeName.${type}`)
|
|
2857
2861
|
}) : t("connect.campaign.common.create_campaign_title", {
|
|
2858
2862
|
typeName: t(`connect.campaign.common.typeName.${type}`)
|
|
@@ -2883,10 +2887,10 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2883
2887
|
});
|
|
2884
2888
|
function stepErrors(e = currentStep.value - 1) {
|
|
2885
2889
|
const m = template.value.steps[e].groups.flatMap(
|
|
2886
|
-
(a) => a.fields.map((
|
|
2890
|
+
(a) => a.fields.map((c) => c.property)
|
|
2887
2891
|
);
|
|
2888
2892
|
return errors.value.filter(
|
|
2889
|
-
(a) => m.some((
|
|
2893
|
+
(a) => m.some((c) => a.path.join(".").includes(c))
|
|
2890
2894
|
);
|
|
2891
2895
|
}
|
|
2892
2896
|
__expose({ showSheet });
|
|
@@ -2900,9 +2904,9 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2900
2904
|
});
|
|
2901
2905
|
}
|
|
2902
2906
|
function onUpdateProperty(e, m) {
|
|
2903
|
-
var a,
|
|
2907
|
+
var a, c, i, s, l, o, n, r;
|
|
2904
2908
|
if (_.set(data.value, e, m), e == "campaign.event.type") {
|
|
2905
|
-
const v = ((s = (i = (
|
|
2909
|
+
const v = ((s = (i = (c = (a = template.value) == null ? void 0 : a.defaultValue) == null ? void 0 : c.campaign) == null ? void 0 : i.event) == null ? void 0 : s.rule) ? _.cloneDeep({
|
|
2906
2910
|
...(r = (n = (o = (l = template.value) == null ? void 0 : l.defaultValue) == null ? void 0 : o.campaign) == null ? void 0 : n.event) == null ? void 0 : r.rule
|
|
2907
2911
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
2908
2912
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
@@ -2959,7 +2963,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2959
2963
|
(m || m === void 0) && (sheetVisible.value = !1);
|
|
2960
2964
|
}
|
|
2961
2965
|
return (e, m) => {
|
|
2962
|
-
const a = resolveComponent("FmButton"),
|
|
2966
|
+
const a = resolveComponent("FmButton"), c = resolveComponent("FmStep"), i = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
2963
2967
|
return openBlock(), createBlock(l, {
|
|
2964
2968
|
"fullscreen-size": "lg",
|
|
2965
2969
|
modelValue: unref(sheetVisible),
|
|
@@ -3032,7 +3036,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3032
3036
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
3033
3037
|
}, {
|
|
3034
3038
|
default: withCtx(() => [
|
|
3035
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(
|
|
3039
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(c, {
|
|
3036
3040
|
key: o.name,
|
|
3037
3041
|
title: unref(getLocaleText)(o.name_locale, o.name),
|
|
3038
3042
|
value: n + 1,
|
|
@@ -3055,7 +3059,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3055
3059
|
class: "flex-1"
|
|
3056
3060
|
}, {
|
|
3057
3061
|
default: withCtx(() => [
|
|
3058
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(
|
|
3062
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(c, {
|
|
3059
3063
|
key: o.name,
|
|
3060
3064
|
title: unref(sheetTitle),
|
|
3061
3065
|
description: unref(getLocaleText)(o.name_locale, o.name),
|