@feedmepos/mf-connect 0.1.38-beta.48 → 0.1.38-beta.49
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-BdTI8QeJ.js → Analytic-BQGW_-c3.js} +13 -13
- package/dist/{App-CqE8tmm5.js → App-BYOr_3in.js} +7 -7
- package/dist/{AuditLogs-N6PJ7zmZ.js → AuditLogs-B_T5_CiH.js} +9 -9
- package/dist/{Bin-CH0XJZhw.js → Bin-C1xrtDE0.js} +8 -8
- package/dist/{Broadcast-BDQ22JfE.js → Broadcast-GxpCUcrZ.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-7LjzxM8q.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DUnMhv4S.js} +7 -7
- package/dist/{Card-CzEPaCa3.js → Card-0oDoiIRu.js} +18 -18
- package/dist/{Collections-Dg6YTOHB.js → Collections-rYjZyG69.js} +6 -6
- package/dist/{Credit-6_sZp_Zw.js → Credit-DsH1Bc3y.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CC9UAteP.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-B7eMDETW.js} +202 -193
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Nzn5Hyxa.js → EffectSheet.vue_vue_type_style_index_0_lang--iiw8XH6.js} +7 -7
- package/dist/{Experience-CMLOrZkY.js → Experience-DlX6PfWR.js} +8 -8
- package/dist/{Game-DJseO_du.js → Game-D0QqnZ2e.js} +9 -9
- package/dist/{Grab-micp3m5W.js → Grab-6F-Z0_F6.js} +8 -8
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BiCXHRaH.js → ImageInput.vue_vue_type_script_setup_true_lang-DZHaJART.js} +1 -1
- package/dist/{Index-DLpDi_cy.js → Index-xZ25tvPZ.js} +10 -10
- package/dist/{Marketing-DqJO7WgB.js → Marketing-Chdt0nui.js} +7 -7
- package/dist/{Member-aW1AkGtG.js → Member-CNE_CmUr.js} +11 -11
- package/dist/{MemberList-CSEXOjId.js → MemberList-DyIkeWwP.js} +25 -25
- package/dist/{MemberTransactions-6ex8Ib2y.js → MemberTransactions-SYjVSwvU.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CpF8IiNa.js → MessageInput.vue_vue_type_script_setup_true_lang-CCkSlsWQ.js} +8 -8
- package/dist/{Mission-B8ljYU3c.js → Mission-CgWBJtr6.js} +9 -9
- package/dist/{Overview-qb9NE2q5.js → Overview-BtsOQR97.js} +19 -19
- package/dist/{Point-Cm1cT5hm.js → Point-BJoB6lGN.js} +8 -8
- package/dist/{Promotion-Cs2ctN6u.js → Promotion-Bspz7mj9.js} +9 -9
- package/dist/{Queue-BT0uPunD.js → Queue-DFPvtMwZ.js} +10 -10
- package/dist/{Record-DDdJneoU.js → Record-DmJXlqg1.js} +8 -8
- package/dist/{Reward-n_n4NfyX.js → Reward-CS2dRJRI.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Dr6UhxJP.js → RewardGroup.vue_vue_type_script_setup_true_lang-IlNqykKZ.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CbispEAQ.js → RuleGroup.vue_vue_type_script_setup_true_lang-BDFJqGHC.js} +15 -15
- package/dist/{Segment-N1gQ8qm8.js → Segment-C0u4NNJx.js} +23 -23
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Dy1Mb5IT.js → SelectItems.vue_vue_type_script_setup_true_lang-C4i9ZzGe.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B2HDsU1M.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-AP5kVvEF.js} +13 -13
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cbb2bUx4.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BKZKWxKi.js} +3 -3
- package/dist/{Setting-DtrEdA8n.js → Setting-BefPl5s7.js} +14 -14
- package/dist/{SettingAdvertisements-BsaUI4ee.js → SettingAdvertisements-DGNSNlfS.js} +12 -12
- package/dist/{Store-7K4dCqLz.js → Store-Ci8NoL5C.js} +613 -608
- package/dist/StoreRewards-DYmb7TZc.js +535 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-gQAVfOaO.js → StoreTransactions.vue_vue_type_script_setup_true_lang-C2oHSA6v.js} +20 -20
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BKtZYIXq.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DgQwfKcF.js} +1 -1
- package/dist/{Tier-BrBKiJVi.js → Tier-4boFdwfx.js} +23 -23
- package/dist/{Title-D0JZ5a1W.js → Title-Cgh40Avw.js} +21 -21
- package/dist/{Transaction-1Ezo434J.js → Transaction-Z2U5elSk.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DXtCFYQD.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-B5-J1FET.js} +6 -6
- package/dist/{Voucher-BUpNoMai.js → Voucher-W8Oxnzpv.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-B89f69_4.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CHYLFObC.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CP9MxTZp.js → ZodTextField.vue_vue_type_script_setup_true_lang-B61Mje_C.js} +2 -2
- package/dist/{app-n25mH1jh.js → app-BU48DR8E.js} +33 -33
- package/dist/{app-H4ENNOaz.js → app-CrFBlZQC.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-EBXezo6J.js → business-BXXPV_BJ.js} +1 -1
- package/dist/{campaign-DesdjAY6.js → campaign-CFNs4abH.js} +8 -8
- package/dist/{campaign-BN0i6iJO.js → campaign-Dan0mmow.js} +1 -1
- package/dist/{campaign.enum-qxS2fQk7.js → campaign.enum-C2FJOSn5.js} +1 -1
- package/dist/{campaign.fn-I2uFvg7P.js → campaign.fn-_QD-klUZ.js} +140 -140
- package/dist/{collectible.enum-Baqpjq8J.js → collectible.enum-ef49SjA4.js} +1 -1
- package/dist/{collection.fn-BdQIdCAt.js → collection.fn-BLlJd7Mr.js} +2 -2
- package/dist/{dto-Br-8HD59.js → dto-BJeHlJPS.js} +4 -4
- package/dist/{effect-DyFXnYmQ.js → effect-D5J5xLJX.js} +1 -1
- package/dist/{email-addresses-MSrP4LTD.js → email-addresses-CgCtARgI.js} +1 -1
- package/dist/{export-BY865yv2.js → export-Zzk4jiBl.js} +3 -3
- package/dist/{helper-HqVx57H2.js → helper-BLELjodn.js} +22 -7
- package/dist/{index-D-iMf42_.js → index-7_8Sujrx.js} +3 -3
- package/dist/{index-bv1tZyOP.js → index-BGHhNcXH.js} +1 -1
- package/dist/{index-CzgqyTL1.js → index-BS1mIYfK.js} +1 -1
- package/dist/{index-D7PO0UKQ.js → index-BqvUAoPO.js} +1 -1
- package/dist/{index-BrnFRS32.js → index-C-YRCQZ4.js} +1 -1
- package/dist/{index---uN-pH0.js → index-CJHTigmz.js} +1022 -1022
- package/dist/{index-ztHZzIr9.js → index-CvmXvyLj.js} +1 -1
- package/dist/{index-DC2GrowN.js → index-DITIOfs4.js} +1 -1
- package/dist/{index-BLJr7LtA.js → index-DZanCQd8.js} +3 -3
- package/dist/{index-cMmTqITC.js → index-DemX8i2v.js} +6 -6
- package/dist/{index-BfMLNFI8.js → index-Dgnwhbhv.js} +528 -519
- package/dist/{index-C8k1aJKs.js → index-OZj06Ttw.js} +558 -555
- package/dist/{index-BWpdwY5c.js → index-_uDo6MR6.js} +1 -1
- package/dist/{index.esm2017-BwT_KNxm.js → index.esm2017-CT9d1NRD.js} +1 -1
- package/dist/{loading-8oJ7H0gh.js → loading-up7stUln.js} +1 -1
- package/dist/{membership-Ba0jBtyb.js → membership-BbEmnTSf.js} +3 -3
- package/dist/{money-z1PZr-eS.js → money-DVfpKSC6.js} +1 -1
- package/dist/{number-DzTfLPeS.js → number-BAwtHKVN.js} +1 -1
- package/dist/{objectid-BR4MDrG1.js → objectid-D72PsUrT.js} +4 -4
- package/dist/{plugins-B2ZWqCHm.js → plugins-C7_WZRNH.js} +3 -3
- package/dist/{reward-Bked_Y9c.js → reward-XSRjQepF.js} +1 -1
- package/dist/{rule-BhElycg_.js → rule-CRsnYcDX.js} +3 -3
- package/dist/{rule-builder-xM8Eeaql.js → rule-builder-BO6eO4WG.js} +1 -1
- package/dist/{template-DXtQ1Ded.js → template-Dml8mXUA.js} +5 -5
- package/dist/{timezone-CfHsyzQT.js → timezone-CBvYuUvv.js} +1 -1
- package/dist/{trigger-DMMWDpq3.js → trigger-CNN8uWUi.js} +5 -5
- package/dist/user-DYhRGvv5.js +55 -0
- package/dist/{vue-i18n-Ckgo63dC.js → vue-i18n-Bq3nuxaj.js} +157 -157
- package/dist/{xlsx-BNwJhY08.js → xlsx-DNBXAk5t.js} +1 -1
- package/dist/{zod-DsT4pGmM.js → zod-BSmgtLPD.js} +1 -1
- package/package.json +1 -1
- package/dist/StoreRewards-CJN8n2d1.js +0 -423
- package/dist/user-CKJkW0xd.js +0 -54
|
@@ -1,45 +1,45 @@
|
|
|
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
2
|
import { _ } from "./lodash-B5I3zXaY.js";
|
|
3
|
-
import { 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-
|
|
3
|
+
import { z } from "./app-BU48DR8E.js";
|
|
4
|
+
import { Z as ZodHelper } from "./zod-BSmgtLPD.js";
|
|
5
|
+
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-BJeHlJPS.js";
|
|
6
|
+
import { u as useMembershipStore } from "./membership-BbEmnTSf.js";
|
|
7
|
+
import { u as useBusinessStore } from "./business-BXXPV_BJ.js";
|
|
8
|
+
import "./index-OZj06Ttw.js";
|
|
9
|
+
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-BO6eO4WG.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 { C as Cb } from "./app-
|
|
19
|
-
import { _ as _sfc_main$o } from "./SelectItems.vue_vue_type_script_setup_true_lang-
|
|
12
|
+
import { f as featureVersionMapping } from "./campaign.enum-C2FJOSn5.js";
|
|
13
|
+
import { _ as _sfc_main$u } from "./ImageInput.vue_vue_type_script_setup_true_lang-DZHaJART.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--iiw8XH6.js";
|
|
15
|
+
import { _ as _sfc_main$w } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DgQwfKcF.js";
|
|
16
|
+
import { c as core, S as SvcConfig } from "./index-DZanCQd8.js";
|
|
17
|
+
import { p as prompt, f as firebaseStorage } from "./plugins-C7_WZRNH.js";
|
|
18
|
+
import { C as Cb } from "./app-CrFBlZQC.js";
|
|
19
|
+
import { _ as _sfc_main$o } from "./SelectItems.vue_vue_type_script_setup_true_lang-C4i9ZzGe.js";
|
|
20
20
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
21
|
-
import { _ as _sfc_main$z } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-
|
|
22
|
-
import { _ as _sfc_main$p, a as _sfc_main$q } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
23
|
-
import { u as useI18n } from "./vue-i18n-
|
|
24
|
-
import { T as TypeToTriggerOptions, _ as _sfc_main$A, b as _sfc_main$B } from "./trigger-
|
|
25
|
-
import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
26
|
-
import { C as CountryTimezone, m as moment } from "./timezone-
|
|
27
|
-
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-
|
|
21
|
+
import { _ as _sfc_main$z } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-B5-J1FET.js";
|
|
22
|
+
import { _ as _sfc_main$p, a as _sfc_main$q } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BDFJqGHC.js";
|
|
23
|
+
import { u as useI18n } from "./vue-i18n-Bq3nuxaj.js";
|
|
24
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$A, b as _sfc_main$B } from "./trigger-CNN8uWUi.js";
|
|
25
|
+
import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-CCkSlsWQ.js";
|
|
26
|
+
import { C as CountryTimezone, m as moment } from "./timezone-CBvYuUvv.js";
|
|
27
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-CRsnYcDX.js";
|
|
28
28
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
29
|
-
import { _ as _sfc_main$r, a as _sfc_main$t } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-
|
|
30
|
-
import { T as TEMPLATES } from "./index-
|
|
31
|
-
import { v as FdoCreditLoyaltyReward, w as FdtoRandomReward, x as F_MISSION_TYPE, y as FdoThresholdCreditReward, z as FdtoThresholdReward, A as FdoMission } from "./index-
|
|
32
|
-
import "./index
|
|
33
|
-
import "./index-
|
|
34
|
-
import "./index-
|
|
35
|
-
import { a as F_GAME_TYPE } from "./collectible.enum-
|
|
36
|
-
import { u as useLoading } from "./loading-
|
|
37
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
38
|
-
import { C as CollectionUtils } from "./collection.fn-
|
|
29
|
+
import { _ as _sfc_main$r, a as _sfc_main$t } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-CHYLFObC.js";
|
|
30
|
+
import { T as TEMPLATES } from "./index-DemX8i2v.js";
|
|
31
|
+
import { v as FdoCreditLoyaltyReward, w as FdtoRandomReward, x as F_MISSION_TYPE, y as FdoThresholdCreditReward, z as FdtoThresholdReward, A as FdoMission } from "./index-Dgnwhbhv.js";
|
|
32
|
+
import "./index-CJHTigmz.js";
|
|
33
|
+
import "./index-CvmXvyLj.js";
|
|
34
|
+
import "./index-7_8Sujrx.js";
|
|
35
|
+
import { a as F_GAME_TYPE } from "./collectible.enum-ef49SjA4.js";
|
|
36
|
+
import { u as useLoading } from "./loading-up7stUln.js";
|
|
37
|
+
import { i as initCollectibleConfig } from "./helper-BLELjodn.js";
|
|
38
|
+
import { C as CollectionUtils } from "./collection.fn-BLlJd7Mr.js";
|
|
39
39
|
import { s as sentenceCase$1 } from "./index-CsaQJMAR.js";
|
|
40
|
-
import { d as getCampaignSummaryObject } from "./campaign-
|
|
40
|
+
import { d as getCampaignSummaryObject } from "./campaign-CFNs4abH.js";
|
|
41
41
|
import { useDialog } from "@feedmepos/ui-library";
|
|
42
|
-
import { u as useCampaignStore } from "./campaign-
|
|
42
|
+
import { u as useCampaignStore } from "./campaign-Dan0mmow.js";
|
|
43
43
|
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
44
44
|
function summarizeGrabDiscount(e) {
|
|
45
45
|
if (!e)
|
|
@@ -50,14 +50,14 @@ function summarizeGrabDiscount(e) {
|
|
|
50
50
|
case "order":
|
|
51
51
|
return "Bill discount";
|
|
52
52
|
case "items":
|
|
53
|
-
return l.type.startsWith("bundle") ?
|
|
53
|
+
return l.type.startsWith("bundle") ? u(l.type) : "Item discount";
|
|
54
54
|
case "categories":
|
|
55
55
|
return "Category discount";
|
|
56
56
|
default:
|
|
57
57
|
return "Discount";
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function u(l) {
|
|
61
61
|
switch (l) {
|
|
62
62
|
case "bundleSameFixPrice":
|
|
63
63
|
return "Bundle (same item) - Fixed price";
|
|
@@ -117,7 +117,7 @@ const _hoisted_1$l = {
|
|
|
117
117
|
},
|
|
118
118
|
emits: ["confirm", "cancel"],
|
|
119
119
|
setup(e, { emit: m }) {
|
|
120
|
-
const a = e,
|
|
120
|
+
const a = e, u = m, i = ref();
|
|
121
121
|
watch(
|
|
122
122
|
() => a.visible,
|
|
123
123
|
(n) => {
|
|
@@ -130,10 +130,10 @@ const _hoisted_1$l = {
|
|
|
130
130
|
(n = i.value) == null || n.onConfirm();
|
|
131
131
|
}
|
|
132
132
|
function l() {
|
|
133
|
-
|
|
133
|
+
u("cancel");
|
|
134
134
|
}
|
|
135
135
|
function o(n) {
|
|
136
|
-
|
|
136
|
+
u("confirm", n);
|
|
137
137
|
}
|
|
138
138
|
return (n, r) => {
|
|
139
139
|
const y = resolveComponent("FmIcon"), v = resolveComponent("FmButton");
|
|
@@ -192,7 +192,7 @@ const _hoisted_1$l = {
|
|
|
192
192
|
},
|
|
193
193
|
emits: ["confirm", "cancel"],
|
|
194
194
|
setup(e, { emit: m }) {
|
|
195
|
-
const a = e,
|
|
195
|
+
const a = e, u = m, i = Cb(), s = ref({}), l = ref(""), o = computed(() => {
|
|
196
196
|
const c = i.menu.value;
|
|
197
197
|
return c ? c.modules.category.map((f) => ({
|
|
198
198
|
id: f._id,
|
|
@@ -232,12 +232,12 @@ const _hoisted_1$l = {
|
|
|
232
232
|
}
|
|
233
233
|
function k() {
|
|
234
234
|
const c = Object.entries(s.value).filter(([, f]) => f).map(([f]) => f);
|
|
235
|
-
|
|
235
|
+
u("confirm", c);
|
|
236
236
|
}
|
|
237
237
|
function p() {
|
|
238
|
-
|
|
238
|
+
u("cancel");
|
|
239
239
|
}
|
|
240
|
-
const
|
|
240
|
+
const d = computed(() => n.value.length > 0 && n.value.every(
|
|
241
241
|
(c) => s.value[c.id]
|
|
242
242
|
));
|
|
243
243
|
return (c, f) => {
|
|
@@ -264,7 +264,7 @@ const _hoisted_1$l = {
|
|
|
264
264
|
icon: "select_all",
|
|
265
265
|
variant: "tertiary",
|
|
266
266
|
size: "small",
|
|
267
|
-
label: `${
|
|
267
|
+
label: `${d.value ? "Deselect" : "Select"} All`,
|
|
268
268
|
onClick: h
|
|
269
269
|
}, null, 8, ["label"]),
|
|
270
270
|
createVNode(b, {
|
|
@@ -351,7 +351,7 @@ const _hoisted_1$l = {
|
|
|
351
351
|
},
|
|
352
352
|
emits: ["update:model-value"],
|
|
353
353
|
setup(e, { emit: m }) {
|
|
354
|
-
const a = e,
|
|
354
|
+
const a = e, u = m, i = Cb(), s = ref(!1), l = ref(!1), o = ref(!1), n = ref({
|
|
355
355
|
type: "net",
|
|
356
356
|
value: 0,
|
|
357
357
|
scope: {
|
|
@@ -372,7 +372,7 @@ const _hoisted_1$l = {
|
|
|
372
372
|
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));
|
|
373
373
|
});
|
|
374
374
|
async function y(g) {
|
|
375
|
-
g.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") &&
|
|
375
|
+
g.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && u("update:model-value", null);
|
|
376
376
|
}
|
|
377
377
|
function v() {
|
|
378
378
|
var g;
|
|
@@ -392,7 +392,7 @@ const _hoisted_1$l = {
|
|
|
392
392
|
function p(g) {
|
|
393
393
|
return g != null && g.includes("Percentage") || g === "percentage" ? "10" : "5.00";
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function d(g) {
|
|
396
396
|
return g != null && g.includes("Percentage") || g === "percentage" ? "%" : "$";
|
|
397
397
|
}
|
|
398
398
|
function c(g, V) {
|
|
@@ -536,7 +536,7 @@ const _hoisted_1$l = {
|
|
|
536
536
|
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;
|
|
537
537
|
});
|
|
538
538
|
function Z() {
|
|
539
|
-
|
|
539
|
+
u("update:model-value", n.value), s.value = !1;
|
|
540
540
|
}
|
|
541
541
|
const q = [
|
|
542
542
|
{ label: "Bill discount", value: "order" },
|
|
@@ -630,7 +630,7 @@ const _hoisted_1$l = {
|
|
|
630
630
|
modelValue: unref(n).value,
|
|
631
631
|
"onUpdate:modelValue": V[2] || (V[2] = (I) => unref(n).value = I),
|
|
632
632
|
placeholder: p(unref(n).type),
|
|
633
|
-
suffix:
|
|
633
|
+
suffix: d(unref(n).type),
|
|
634
634
|
type: "number"
|
|
635
635
|
}, null, 8, ["modelValue", "placeholder", "suffix"])
|
|
636
636
|
])) : createCommentVNode("", !0),
|
|
@@ -734,12 +734,12 @@ const _hoisted_1$l = {
|
|
|
734
734
|
},
|
|
735
735
|
emits: ["update:model-value"],
|
|
736
736
|
setup(e, { emit: m }) {
|
|
737
|
-
const { t: a } = useI18n(),
|
|
738
|
-
!
|
|
737
|
+
const { t: a } = useI18n(), u = e, i = m, s = ref(
|
|
738
|
+
!u.modelValue || !u.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(u.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
739
739
|
);
|
|
740
740
|
watch(s, async (o, n) => {
|
|
741
741
|
var r;
|
|
742
|
-
if (n == "custom" && o == "all_time" && RuleBuilder.getRules((r =
|
|
742
|
+
if (n == "custom" && o == "all_time" && RuleBuilder.getRules((r = u.modelValue) == null ? void 0 : r.rules.g_time).length > 0) {
|
|
743
743
|
const y = await prompt.confirm(
|
|
744
744
|
a("connect.template.rule.time.confirm_remove"),
|
|
745
745
|
a("connect.common.confirm"),
|
|
@@ -749,7 +749,7 @@ const _hoisted_1$l = {
|
|
|
749
749
|
y && i(
|
|
750
750
|
"update:model-value",
|
|
751
751
|
RuleBuilder.setRuleToGroup(
|
|
752
|
-
|
|
752
|
+
u.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
753
753
|
RuleBuilder.scaffoldGroup("g_time")
|
|
754
754
|
)
|
|
755
755
|
), s.value = y ? o : n;
|
|
@@ -757,7 +757,7 @@ const _hoisted_1$l = {
|
|
|
757
757
|
});
|
|
758
758
|
async function l(o) {
|
|
759
759
|
var n;
|
|
760
|
-
if (o == "custom" && RuleBuilder.getRules((n =
|
|
760
|
+
if (o == "custom" && RuleBuilder.getRules((n = u.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
|
|
761
761
|
if (!await prompt.confirm(
|
|
762
762
|
a("connect.template.rule.time.confirm_remove"),
|
|
763
763
|
a("connect.common.confirm"),
|
|
@@ -770,7 +770,7 @@ const _hoisted_1$l = {
|
|
|
770
770
|
i(
|
|
771
771
|
"update:model-value",
|
|
772
772
|
RuleBuilder.setRuleToGroup(
|
|
773
|
-
|
|
773
|
+
u.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
774
774
|
RuleBuilder.scaffoldGroup("g_time")
|
|
775
775
|
)
|
|
776
776
|
);
|
|
@@ -826,9 +826,9 @@ const _hoisted_1$l = {
|
|
|
826
826
|
},
|
|
827
827
|
emits: ["update:model-value"],
|
|
828
828
|
setup(e, { emit: m }) {
|
|
829
|
-
const { t: a } = useI18n(),
|
|
829
|
+
const { t: a } = useI18n(), u = e, i = m, s = computed(() => {
|
|
830
830
|
const { property: l, operator: o, equator: n } = RuleBuilder.simplify(
|
|
831
|
-
|
|
831
|
+
u.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
832
832
|
op: "before",
|
|
833
833
|
x: 1
|
|
834
834
|
})
|
|
@@ -936,9 +936,9 @@ const _hoisted_1$l = {
|
|
|
936
936
|
},
|
|
937
937
|
emits: ["update:model-value"],
|
|
938
938
|
setup(e, { emit: m }) {
|
|
939
|
-
const { t: a } = useI18n(),
|
|
940
|
-
(l) => l.value ==
|
|
941
|
-
) : TypeToTriggerOptions[
|
|
939
|
+
const { t: a } = useI18n(), u = e, i = m, s = computed(() => u.disabled ? TypeToTriggerOptions[u.campaignType].filter(
|
|
940
|
+
(l) => l.value == u.modelValue
|
|
941
|
+
) : TypeToTriggerOptions[u.campaignType]);
|
|
942
942
|
return (l, o) => {
|
|
943
943
|
const n = resolveComponent("FmCard");
|
|
944
944
|
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
@@ -946,14 +946,14 @@ const _hoisted_1$l = {
|
|
|
946
946
|
createElementVNode("div", _hoisted_3$b, [
|
|
947
947
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (r) => (openBlock(), createBlock(n, {
|
|
948
948
|
variant: "outlined",
|
|
949
|
-
disabled:
|
|
949
|
+
disabled: u.disabled,
|
|
950
950
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
951
951
|
"col-span-3": unref(s).length == 1,
|
|
952
952
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
|
|
953
953
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
954
954
|
}]),
|
|
955
955
|
onClick: () => {
|
|
956
|
-
|
|
956
|
+
u.modelValue != r.value && !u.disabled && i("update:model-value", r.value);
|
|
957
957
|
},
|
|
958
958
|
key: r.name
|
|
959
959
|
}, {
|
|
@@ -982,7 +982,7 @@ const _hoisted_1$l = {
|
|
|
982
982
|
emits: ["update:model-value"],
|
|
983
983
|
setup(e, { emit: m }) {
|
|
984
984
|
const a = m;
|
|
985
|
-
return (
|
|
985
|
+
return (u, i) => {
|
|
986
986
|
const s = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
|
|
987
987
|
return openBlock(), createBlock(o, {
|
|
988
988
|
label: e.label,
|
|
@@ -1025,7 +1025,7 @@ const _hoisted_1$l = {
|
|
|
1025
1025
|
},
|
|
1026
1026
|
emits: ["update:model-value"],
|
|
1027
1027
|
setup(e, { emit: m }) {
|
|
1028
|
-
const { t: a } = useI18n(),
|
|
1028
|
+
const { t: a } = useI18n(), u = m;
|
|
1029
1029
|
return (i, s) => {
|
|
1030
1030
|
var l, o;
|
|
1031
1031
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
@@ -1035,7 +1035,7 @@ const _hoisted_1$l = {
|
|
|
1035
1035
|
label: unref(a)("connect.common.startDate"),
|
|
1036
1036
|
"onUpdate:modelValue": s[0] || (s[0] = (n) => {
|
|
1037
1037
|
var r;
|
|
1038
|
-
return
|
|
1038
|
+
return u("update:model-value", {
|
|
1039
1039
|
startDate: n,
|
|
1040
1040
|
endDate: ((r = e.modelValue) == null ? void 0 : r.endDate) ?? null
|
|
1041
1041
|
});
|
|
@@ -1049,7 +1049,7 @@ const _hoisted_1$l = {
|
|
|
1049
1049
|
label: unref(a)("connect.common.endDate"),
|
|
1050
1050
|
"onUpdate:modelValue": s[1] || (s[1] = (n) => {
|
|
1051
1051
|
var r;
|
|
1052
|
-
return
|
|
1052
|
+
return u("update:model-value", {
|
|
1053
1053
|
startDate: ((r = e.modelValue) == null ? void 0 : r.startDate) ?? null,
|
|
1054
1054
|
endDate: n
|
|
1055
1055
|
});
|
|
@@ -1078,38 +1078,38 @@ const _hoisted_1$l = {
|
|
|
1078
1078
|
},
|
|
1079
1079
|
emits: ["update:model-value"],
|
|
1080
1080
|
setup(e, { emit: m }) {
|
|
1081
|
-
const { t: a } = useI18n(),
|
|
1081
|
+
const { t: a } = useI18n(), u = e, i = m, s = useCoreStore(), l = computed(
|
|
1082
1082
|
() => CountryTimezone[s.currentCountry.value || "MY"]
|
|
1083
1083
|
);
|
|
1084
1084
|
function o() {
|
|
1085
|
-
const p = RuleBuilder.getRules(
|
|
1085
|
+
const p = RuleBuilder.getRules(u.modelValue);
|
|
1086
1086
|
return p.length == 0 ? "fixed" : p.some(
|
|
1087
|
-
(
|
|
1087
|
+
(d) => isRuleEntry(d) && RuleBuilder.simplify(d).operator == "_rrule"
|
|
1088
1088
|
) ? "repeating" : "fixed";
|
|
1089
1089
|
}
|
|
1090
1090
|
const n = ref(o()), r = ref(!1), y = computed(() => [
|
|
1091
1091
|
{ label: a("connect.template.rule.schedule.fixed"), value: "fixed" },
|
|
1092
1092
|
{ label: a("connect.template.rule.schedule.repeating"), value: "repeating" }
|
|
1093
1093
|
]), v = computed(() => {
|
|
1094
|
-
const p = RuleBuilder.getRules(
|
|
1094
|
+
const p = RuleBuilder.getRules(u.modelValue), d = p.find(
|
|
1095
1095
|
(f) => isRuleEntry(f) && RuleBuilder.simplify(f).property == "trigger.date"
|
|
1096
1096
|
), c = p.find(
|
|
1097
1097
|
(f) => isRuleEntry(f) && RuleBuilder.simplify(f).property == "trigger.time"
|
|
1098
1098
|
);
|
|
1099
1099
|
return {
|
|
1100
|
-
date:
|
|
1100
|
+
date: d ? RuleBuilder.simplify(d).equator : null,
|
|
1101
1101
|
time: c ? RuleBuilder.simplify(c).equator : null
|
|
1102
1102
|
};
|
|
1103
1103
|
}), h = computed(
|
|
1104
1104
|
() => calculateNextScheduleAt(
|
|
1105
|
-
|
|
1105
|
+
u.modelValue,
|
|
1106
1106
|
/* @__PURE__ */ new Date(),
|
|
1107
|
-
|
|
1108
|
-
|
|
1107
|
+
u.startDate ? new Date(u.startDate) : void 0,
|
|
1108
|
+
u.endDate ? new Date(u.endDate) : void 0
|
|
1109
1109
|
)
|
|
1110
1110
|
);
|
|
1111
1111
|
function x(p) {
|
|
1112
|
-
const
|
|
1112
|
+
const d = p.value, c = d == "fixed" ? [
|
|
1113
1113
|
RuleBuilder.constructEntry(
|
|
1114
1114
|
"trigger.date",
|
|
1115
1115
|
"_isOnDate",
|
|
@@ -1120,7 +1120,15 @@ const _hoisted_1$l = {
|
|
|
1120
1120
|
RuleBuilder.constructEntry(
|
|
1121
1121
|
"trigger.date",
|
|
1122
1122
|
"_rrule",
|
|
1123
|
-
|
|
1123
|
+
new RRule({
|
|
1124
|
+
dtstart: u.startDate ? new Date(u.startDate) : /* @__PURE__ */ new Date(),
|
|
1125
|
+
freq: RRule.DAILY,
|
|
1126
|
+
interval: 1,
|
|
1127
|
+
byhour: 0,
|
|
1128
|
+
byminute: 0,
|
|
1129
|
+
bysecond: 0,
|
|
1130
|
+
wkst: RRule.SU
|
|
1131
|
+
}).toString()
|
|
1124
1132
|
),
|
|
1125
1133
|
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
1126
1134
|
];
|
|
@@ -1130,7 +1138,7 @@ const _hoisted_1$l = {
|
|
|
1130
1138
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1131
1139
|
c
|
|
1132
1140
|
)
|
|
1133
|
-
), n.value =
|
|
1141
|
+
), n.value = d;
|
|
1134
1142
|
}
|
|
1135
1143
|
function k(p) {
|
|
1136
1144
|
n.value == "fixed" ? i(
|
|
@@ -1163,7 +1171,7 @@ const _hoisted_1$l = {
|
|
|
1163
1171
|
])
|
|
1164
1172
|
);
|
|
1165
1173
|
}
|
|
1166
|
-
return (p,
|
|
1174
|
+
return (p, d) => {
|
|
1167
1175
|
const c = 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");
|
|
1168
1176
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
1169
1177
|
createVNode(c, {
|
|
@@ -1177,7 +1185,7 @@ const _hoisted_1$l = {
|
|
|
1177
1185
|
createVNode(f, {
|
|
1178
1186
|
label: unref(a)("connect.template.rule.schedule.notify_time"),
|
|
1179
1187
|
"model-value": unref(v).time,
|
|
1180
|
-
"onUpdate:modelValue":
|
|
1188
|
+
"onUpdate:modelValue": d[0] || (d[0] = ($) => k({ date: unref(v).date, time: $ })),
|
|
1181
1189
|
"helper-text": unref(v).time ? void 0 : unref(a)("connect.template.rule.schedule.time_required"),
|
|
1182
1190
|
"helper-state": unref(v).time ? void 0 : "error"
|
|
1183
1191
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
|
|
@@ -1201,7 +1209,7 @@ const _hoisted_1$l = {
|
|
|
1201
1209
|
]),
|
|
1202
1210
|
createVNode(C, {
|
|
1203
1211
|
"show-popover": unref(r),
|
|
1204
|
-
onPopoverChanged:
|
|
1212
|
+
onPopoverChanged: d[3] || (d[3] = ($) => r.value = $)
|
|
1205
1213
|
}, {
|
|
1206
1214
|
"popover-button": withCtx(() => [
|
|
1207
1215
|
createVNode(E, {
|
|
@@ -1221,9 +1229,10 @@ const _hoisted_1$l = {
|
|
|
1221
1229
|
createVNode(_sfc_main$q, {
|
|
1222
1230
|
"apply-button": !0,
|
|
1223
1231
|
"model-value": unref(v).date || "",
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1232
|
+
"start-date": e.startDate ? new Date(e.startDate) : void 0,
|
|
1233
|
+
onCancel: d[1] || (d[1] = ($) => r.value = !1),
|
|
1234
|
+
"onUpdate:modelValue": d[2] || (d[2] = ($) => (k({ date: $, time: unref(v).time }), r.value = !1))
|
|
1235
|
+
}, null, 8, ["model-value", "start-date"])
|
|
1227
1236
|
]),
|
|
1228
1237
|
_: 1
|
|
1229
1238
|
})
|
|
@@ -1234,7 +1243,7 @@ const _hoisted_1$l = {
|
|
|
1234
1243
|
key: 1,
|
|
1235
1244
|
label: unref(a)("connect.template.rule.schedule.notify_date"),
|
|
1236
1245
|
"model-value": unref(v).date || "",
|
|
1237
|
-
"onUpdate:modelValue":
|
|
1246
|
+
"onUpdate:modelValue": d[4] || (d[4] = ($) => k({ date: $, time: unref(v).time })),
|
|
1238
1247
|
"helper-text": unref(v).date ? void 0 : unref(a)("connect.template.rule.schedule.date_required"),
|
|
1239
1248
|
"helper-state": unref(v).date ? void 0 : "error"
|
|
1240
1249
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
|
|
@@ -1257,7 +1266,7 @@ const _hoisted_1$l = {
|
|
|
1257
1266
|
},
|
|
1258
1267
|
emits: ["update:model-value"],
|
|
1259
1268
|
setup(e, { emit: m }) {
|
|
1260
|
-
const { t: a } = useI18n(),
|
|
1269
|
+
const { t: a } = useI18n(), u = e, i = m, s = computed(
|
|
1261
1270
|
() => [
|
|
1262
1271
|
{
|
|
1263
1272
|
label: a("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
|
|
@@ -1286,7 +1295,7 @@ const _hoisted_1$l = {
|
|
|
1286
1295
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
1287
1296
|
}]),
|
|
1288
1297
|
onClick: () => {
|
|
1289
|
-
|
|
1298
|
+
u.modelValue != r.value && i("update:model-value", r.value);
|
|
1290
1299
|
},
|
|
1291
1300
|
key: r.value
|
|
1292
1301
|
}, {
|
|
@@ -1307,20 +1316,20 @@ const _hoisted_1$l = {
|
|
|
1307
1316
|
__name: "EditRewardPoolSheet",
|
|
1308
1317
|
emits: ["update:model-value"],
|
|
1309
1318
|
setup(e, { expose: m, emit: a }) {
|
|
1310
|
-
const
|
|
1319
|
+
const u = useMembershipStore(), { minor: i } = useLoading, s = ref(!1), l = ref(), o = ref(), n = ref(0), r = computed(() => {
|
|
1311
1320
|
var p;
|
|
1312
|
-
return ((p =
|
|
1313
|
-
(
|
|
1321
|
+
return ((p = u.loyaltyRewards.items.find(
|
|
1322
|
+
(d) => {
|
|
1314
1323
|
var c;
|
|
1315
|
-
return
|
|
1324
|
+
return d.value === ((c = l.value) == null ? void 0 : c.collectible);
|
|
1316
1325
|
}
|
|
1317
1326
|
)) == null ? void 0 : p.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
1318
1327
|
}), y = computed(() => {
|
|
1319
1328
|
const k = r.value.safeParse(l.value);
|
|
1320
1329
|
return k.success ? [] : k.error.errors;
|
|
1321
1330
|
});
|
|
1322
|
-
function v(k, p,
|
|
1323
|
-
k && (l.value = p, n.value =
|
|
1331
|
+
function v(k, p, d) {
|
|
1332
|
+
k && (l.value = p, n.value = d), s.value = k;
|
|
1324
1333
|
}
|
|
1325
1334
|
const h = a;
|
|
1326
1335
|
async function x() {
|
|
@@ -1341,7 +1350,7 @@ const _hoisted_1$l = {
|
|
|
1341
1350
|
return m({
|
|
1342
1351
|
showSheet: v
|
|
1343
1352
|
}), (k, p) => {
|
|
1344
|
-
const
|
|
1353
|
+
const d = resolveComponent("FmSelect"), c = resolveComponent("FmStepperField"), f = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
|
|
1345
1354
|
return openBlock(), createBlock(B, {
|
|
1346
1355
|
"max-width": 560,
|
|
1347
1356
|
modelValue: unref(s),
|
|
@@ -1373,7 +1382,7 @@ const _hoisted_1$l = {
|
|
|
1373
1382
|
var b, E, N;
|
|
1374
1383
|
return [
|
|
1375
1384
|
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
1376
|
-
createVNode(
|
|
1385
|
+
createVNode(d, {
|
|
1377
1386
|
label: "Reward Type",
|
|
1378
1387
|
items: [
|
|
1379
1388
|
{ label: "No Reward", value: "NO_REWARD" },
|
|
@@ -1401,7 +1410,7 @@ const _hoisted_1$l = {
|
|
|
1401
1410
|
},
|
|
1402
1411
|
weight: 1
|
|
1403
1412
|
} : l.value = {
|
|
1404
|
-
collectible: unref(
|
|
1413
|
+
collectible: unref(u).loyaltyRewards.raw[0]._id,
|
|
1405
1414
|
type: "LOYALTY",
|
|
1406
1415
|
earningOption: {
|
|
1407
1416
|
amount: 1,
|
|
@@ -1414,11 +1423,11 @@ const _hoisted_1$l = {
|
|
|
1414
1423
|
};
|
|
1415
1424
|
})
|
|
1416
1425
|
}, null, 8, ["model-value"]),
|
|
1417
|
-
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(
|
|
1426
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(d, {
|
|
1418
1427
|
key: 0,
|
|
1419
1428
|
label: "Loyalty type",
|
|
1420
1429
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "collectible", [unref(l).type])],
|
|
1421
|
-
items: unref(
|
|
1430
|
+
items: unref(u).loyaltyRewards.items,
|
|
1422
1431
|
"model-value": unref(l).collectible,
|
|
1423
1432
|
"onUpdate:modelValue": p[1] || (p[1] = (C) => unref(l).collectible = C)
|
|
1424
1433
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
@@ -1432,7 +1441,7 @@ const _hoisted_1$l = {
|
|
|
1432
1441
|
})
|
|
1433
1442
|
}, null, 8, ["rules", "model-value"]),
|
|
1434
1443
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1435
|
-
((b = unref(
|
|
1444
|
+
((b = unref(u).loyaltyRewards.items.find(
|
|
1436
1445
|
(C) => {
|
|
1437
1446
|
var R;
|
|
1438
1447
|
return C.value === ((R = unref(l)) == null ? void 0 : R.collectible);
|
|
@@ -1457,7 +1466,7 @@ const _hoisted_1$l = {
|
|
|
1457
1466
|
p[12] || (p[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
1458
1467
|
createVNode(_sfc_main$s, {
|
|
1459
1468
|
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
1460
|
-
"for-credit": unref(l).type === "LOYALTY" && ((E = unref(
|
|
1469
|
+
"for-credit": unref(l).type === "LOYALTY" && ((E = unref(u).loyaltyRewards.items.find(
|
|
1461
1470
|
(C) => {
|
|
1462
1471
|
var R;
|
|
1463
1472
|
return C.value === ((R = unref(l)) == null ? void 0 : R.collectible);
|
|
@@ -1510,19 +1519,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1510
1519
|
},
|
|
1511
1520
|
emits: ["update:model-value"],
|
|
1512
1521
|
setup(e, { emit: m }) {
|
|
1513
|
-
const a = e,
|
|
1522
|
+
const a = e, u = 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(() => {
|
|
1514
1523
|
const p = l.safeParse(o.value);
|
|
1515
1524
|
return p.success ? [] : p.error.errors;
|
|
1516
1525
|
}), r = ref();
|
|
1517
|
-
function y(p,
|
|
1526
|
+
function y(p, d) {
|
|
1518
1527
|
var f;
|
|
1519
1528
|
const c = [...o.value];
|
|
1520
|
-
c[
|
|
1529
|
+
c[d] = p, (f = r.value) == null || f.showSheet(!1), u("update:model-value", c);
|
|
1521
1530
|
}
|
|
1522
1531
|
function v(p) {
|
|
1523
|
-
const
|
|
1532
|
+
const d = p.type == "VOUCHER" ? p.collectibleConfig : i.collectibles.find(
|
|
1524
1533
|
(B) => B._id.toString() == p.collectible
|
|
1525
|
-
), c = CollectionUtils.formattedType((
|
|
1534
|
+
), c = CollectionUtils.formattedType((d == null ? void 0 : d.name) || ""), f = p.weight;
|
|
1526
1535
|
return {
|
|
1527
1536
|
label: isNullOrEmpty(c) ? "NO REWARD" : c,
|
|
1528
1537
|
sublabel: `${f} (${(f / o.value.reduce((B, b) => B + b.weight, 0) * 100).toFixed(2)}%)`
|
|
@@ -1530,12 +1539,12 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1530
1539
|
}
|
|
1531
1540
|
function h(p) {
|
|
1532
1541
|
var c;
|
|
1533
|
-
const
|
|
1534
|
-
(c = r.value) == null || c.showSheet(!0,
|
|
1542
|
+
const d = [...o.value];
|
|
1543
|
+
(c = r.value) == null || c.showSheet(!0, d[p], p);
|
|
1535
1544
|
}
|
|
1536
1545
|
function x(p) {
|
|
1537
|
-
const
|
|
1538
|
-
|
|
1546
|
+
const d = [...o.value];
|
|
1547
|
+
d.splice(p, 1), u("update:model-value", d);
|
|
1539
1548
|
}
|
|
1540
1549
|
function k() {
|
|
1541
1550
|
var p;
|
|
@@ -1549,13 +1558,13 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1549
1558
|
o.value.length
|
|
1550
1559
|
);
|
|
1551
1560
|
}
|
|
1552
|
-
return (p,
|
|
1561
|
+
return (p, d) => {
|
|
1553
1562
|
const c = resolveComponent("FmButton"), f = resolveComponent("FmCard"), B = resolveComponent("FmHelperText");
|
|
1554
1563
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
1555
1564
|
createElementVNode("div", _hoisted_2$9, toDisplayString(unref(s)("connect.template.configure_reward_type")), 1),
|
|
1556
1565
|
createVNode(c, {
|
|
1557
1566
|
label: unref(s)("connect.campaign.rewardPool.addReward"),
|
|
1558
|
-
onClick:
|
|
1567
|
+
onClick: d[0] || (d[0] = (b) => k()),
|
|
1559
1568
|
variant: "plain",
|
|
1560
1569
|
icon: "add"
|
|
1561
1570
|
}, null, 8, ["label"]),
|
|
@@ -1606,7 +1615,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1606
1615
|
},
|
|
1607
1616
|
emits: ["update:model-value"],
|
|
1608
1617
|
setup(e, { emit: m }) {
|
|
1609
|
-
const { t: a } = useI18n(),
|
|
1618
|
+
const { t: a } = useI18n(), u = e, i = m, s = computed(() => [
|
|
1610
1619
|
{
|
|
1611
1620
|
label: a("connect.template.promotion_game.rock_paper_scissors.label"),
|
|
1612
1621
|
description: a("connect.template.promotion_game.rock_paper_scissors.description"),
|
|
@@ -1624,17 +1633,17 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1624
1633
|
}, null, 8, ["label", "model-value"]),
|
|
1625
1634
|
((h = e.modelValue) == null ? void 0 : h.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
1626
1635
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (k) => {
|
|
1627
|
-
var p,
|
|
1636
|
+
var p, d;
|
|
1628
1637
|
return openBlock(), createBlock(r, {
|
|
1629
1638
|
variant: "outlined",
|
|
1630
1639
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1631
1640
|
"col-span-2": unref(s).length == 1,
|
|
1632
1641
|
"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) == k.value,
|
|
1633
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
1642
|
+
"hover:bg-fm-color-opacity-sm": ((d = e.modelValue) == null ? void 0 : d.gameType) != k.value
|
|
1634
1643
|
}]),
|
|
1635
1644
|
onClick: () => {
|
|
1636
1645
|
var c;
|
|
1637
|
-
((c =
|
|
1646
|
+
((c = u.modelValue) == null ? void 0 : c.gameType) != k.value && i("update:model-value", { gameType: k.value });
|
|
1638
1647
|
},
|
|
1639
1648
|
key: k.value
|
|
1640
1649
|
}, {
|
|
@@ -1670,7 +1679,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1670
1679
|
},
|
|
1671
1680
|
emits: ["update:model-value"],
|
|
1672
1681
|
setup(e, { emit: m }) {
|
|
1673
|
-
const { t: a } = useI18n(),
|
|
1682
|
+
const { t: a } = useI18n(), u = e, i = m, s = ref(u.modelValue ?? {}), l = ref(
|
|
1674
1683
|
(() => {
|
|
1675
1684
|
const v = {};
|
|
1676
1685
|
return s.value.workingHour && Object.keys(s.value.workingHour).forEach((h) => {
|
|
@@ -1703,7 +1712,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1703
1712
|
s.value.workingHour = Object.keys(v).length > 0 ? v : void 0;
|
|
1704
1713
|
};
|
|
1705
1714
|
return watch(s, () => i("update:model-value", s.value), { deep: !0 }), watch(l, y, { deep: !0 }), (v, h) => {
|
|
1706
|
-
const x = resolveComponent("FmSelect"), k = resolveComponent("FmStepperField"), p = resolveComponent("FmCheckbox"),
|
|
1715
|
+
const x = resolveComponent("FmSelect"), k = resolveComponent("FmStepperField"), p = resolveComponent("FmCheckbox"), d = resolveComponent("FmTimePicker"), c = resolveComponent("FmButton");
|
|
1707
1716
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1708
1717
|
createElementVNode("div", _hoisted_2$7, [
|
|
1709
1718
|
createVNode(x, {
|
|
@@ -1774,14 +1783,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1774
1783
|
key: b,
|
|
1775
1784
|
class: "flex items-center space-x-2 w-100"
|
|
1776
1785
|
}, [
|
|
1777
|
-
createVNode(
|
|
1786
|
+
createVNode(d, {
|
|
1778
1787
|
"model-value": B.startTime || "",
|
|
1779
1788
|
"onUpdate:modelValue": (E) => {
|
|
1780
1789
|
unref(l)[f.key] && unref(l)[f.key][b] && (unref(l)[f.key][b].startTime = E || "", y());
|
|
1781
1790
|
}
|
|
1782
1791
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
1783
1792
|
h[3] || (h[3] = createElementVNode("span", null, "to", -1)),
|
|
1784
|
-
createVNode(
|
|
1793
|
+
createVNode(d, {
|
|
1785
1794
|
"model-value": B.endTime || "",
|
|
1786
1795
|
"onUpdate:modelValue": (E) => {
|
|
1787
1796
|
unref(l)[f.key] && unref(l)[f.key][b] && (unref(l)[f.key][b].endTime = E || "", y());
|
|
@@ -1820,7 +1829,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1820
1829
|
},
|
|
1821
1830
|
emits: ["update:model-value"],
|
|
1822
1831
|
setup(e, { emit: m }) {
|
|
1823
|
-
const { t: a } = useI18n(),
|
|
1832
|
+
const { t: a } = useI18n(), u = e, i = m, s = ref(u.modelValue ?? {});
|
|
1824
1833
|
return watch(s, () => i("update:model-value", s.value)), (l, o) => {
|
|
1825
1834
|
const n = resolveComponent("FmStepperField");
|
|
1826
1835
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
@@ -1870,7 +1879,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1870
1879
|
},
|
|
1871
1880
|
emits: ["update:model-value"],
|
|
1872
1881
|
setup(e, { emit: m }) {
|
|
1873
|
-
const { t: a } = useI18n(),
|
|
1882
|
+
const { t: a } = useI18n(), u = e, i = m, s = computed(() => [
|
|
1874
1883
|
{
|
|
1875
1884
|
label: a("connect.campaign.mission.typeOption.STAMP.label"),
|
|
1876
1885
|
description: a("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -1895,7 +1904,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1895
1904
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
1896
1905
|
}]),
|
|
1897
1906
|
onClick: () => {
|
|
1898
|
-
|
|
1907
|
+
u.modelValue != r.value && i("update:model-value", r.value);
|
|
1899
1908
|
},
|
|
1900
1909
|
key: r.value
|
|
1901
1910
|
}, {
|
|
@@ -1925,7 +1934,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1925
1934
|
emits: ["update:model-value"],
|
|
1926
1935
|
setup(e, { emit: m }) {
|
|
1927
1936
|
const a = m;
|
|
1928
|
-
return (
|
|
1937
|
+
return (u, i) => {
|
|
1929
1938
|
const s = resolveComponent("FmStepperField");
|
|
1930
1939
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1931
1940
|
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)),
|
|
@@ -1949,7 +1958,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1949
1958
|
},
|
|
1950
1959
|
emits: ["update:model-value"],
|
|
1951
1960
|
setup(e, { expose: m, emit: a }) {
|
|
1952
|
-
const
|
|
1961
|
+
const u = e, i = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), o = ref(), n = ref(), r = ref(0), y = computed(() => {
|
|
1953
1962
|
var c;
|
|
1954
1963
|
return ((c = i.loyaltyRewards.items.find(
|
|
1955
1964
|
(f) => {
|
|
@@ -1958,19 +1967,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1958
1967
|
}
|
|
1959
1968
|
)) == null ? void 0 : c.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
|
|
1960
1969
|
}), v = computed(() => {
|
|
1961
|
-
const
|
|
1962
|
-
return
|
|
1970
|
+
const d = y.value.safeParse(o.value);
|
|
1971
|
+
return d.success ? [] : d.error.errors;
|
|
1963
1972
|
});
|
|
1964
|
-
function h(
|
|
1965
|
-
|
|
1973
|
+
function h(d, c, f) {
|
|
1974
|
+
d && (o.value = c, r.value = f), l.value = d;
|
|
1966
1975
|
}
|
|
1967
1976
|
const x = a;
|
|
1968
1977
|
async function k() {
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1978
|
+
const d = y.value.safeParse(o.value);
|
|
1979
|
+
d.success && (await s(
|
|
1971
1980
|
async () => {
|
|
1972
|
-
|
|
1973
|
-
|
|
1981
|
+
d.data.type === "VOUCHER" && n.value && (d.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1982
|
+
d.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
|
|
1974
1983
|
n.value
|
|
1975
1984
|
));
|
|
1976
1985
|
},
|
|
@@ -1978,12 +1987,12 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1978
1987
|
message: "Uploading reward image",
|
|
1979
1988
|
successMessage: "Reward image updated"
|
|
1980
1989
|
}
|
|
1981
|
-
), x("update:model-value",
|
|
1990
|
+
), x("update:model-value", d.data, r.value));
|
|
1982
1991
|
}
|
|
1983
1992
|
const p = ref();
|
|
1984
1993
|
return m({
|
|
1985
1994
|
showSheet: h
|
|
1986
|
-
}), (
|
|
1995
|
+
}), (d, c) => {
|
|
1987
1996
|
const f = resolveComponent("FmStepperField"), B = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), E = resolveComponent("FmButton"), N = resolveComponent("FmSideSheet");
|
|
1988
1997
|
return openBlock(), createBlock(N, {
|
|
1989
1998
|
"max-width": 560,
|
|
@@ -2033,8 +2042,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2033
2042
|
rules: [
|
|
2034
2043
|
unref(ZodHelper).toRule(
|
|
2035
2044
|
unref(z).number().min(1).max(
|
|
2036
|
-
|
|
2037
|
-
`Number cannot be more than ${
|
|
2045
|
+
u.maxThreshold,
|
|
2046
|
+
`Number cannot be more than ${u.maxThreshold}`
|
|
2038
2047
|
)
|
|
2039
2048
|
)
|
|
2040
2049
|
],
|
|
@@ -2164,17 +2173,17 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2164
2173
|
}
|
|
2165
2174
|
},
|
|
2166
2175
|
setup(e) {
|
|
2167
|
-
const m = e, { maxRange: a, currentRange:
|
|
2168
|
-
() => Math.min(
|
|
2176
|
+
const m = e, { maxRange: a, currentRange: u, markers: i } = toRefs(m), s = computed(
|
|
2177
|
+
() => Math.min(u.value / a.value * 100, 100)
|
|
2169
2178
|
), l = (o) => o / a.value * 100;
|
|
2170
2179
|
return (o, n) => {
|
|
2171
2180
|
const r = resolveComponent("FmIcon");
|
|
2172
2181
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
2173
2182
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (y) => (openBlock(), createBlock(r, {
|
|
2174
2183
|
class: normalizeClass(
|
|
2175
|
-
unref(
|
|
2184
|
+
unref(u) >= y ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
2176
2185
|
),
|
|
2177
|
-
outline: unref(
|
|
2186
|
+
outline: unref(u) < y,
|
|
2178
2187
|
key: y,
|
|
2179
2188
|
name: unref(i).some((v) => v === y) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
2180
2189
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
@@ -2203,14 +2212,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2203
2212
|
}
|
|
2204
2213
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
2205
2214
|
function changeKeysFactory(e) {
|
|
2206
|
-
return function m(a,
|
|
2207
|
-
if (
|
|
2215
|
+
return function m(a, u = 1, i) {
|
|
2216
|
+
if (u === 0 || !isObject(a))
|
|
2208
2217
|
return a;
|
|
2209
2218
|
if (Array.isArray(a))
|
|
2210
|
-
return a.map((l) => m(l,
|
|
2219
|
+
return a.map((l) => m(l, u - 1, i));
|
|
2211
2220
|
const s = Object.create(Object.getPrototypeOf(a));
|
|
2212
2221
|
return Object.keys(a).forEach((l) => {
|
|
2213
|
-
const o = a[l], n = e(l, i), r = m(o,
|
|
2222
|
+
const o = a[l], n = e(l, i), r = m(o, u - 1, i);
|
|
2214
2223
|
s[n] = r;
|
|
2215
2224
|
}), s;
|
|
2216
2225
|
};
|
|
@@ -2229,45 +2238,45 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2229
2238
|
},
|
|
2230
2239
|
emits: ["update:model-value"],
|
|
2231
2240
|
setup(e, { emit: m }) {
|
|
2232
|
-
const { t: a } = useI18n(),
|
|
2233
|
-
() =>
|
|
2241
|
+
const { t: a } = useI18n(), u = e, i = m, s = useMembershipStore(), l = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
|
|
2242
|
+
() => u.modelValue.sort((d, c) => d.threshold - c.threshold) ?? []
|
|
2234
2243
|
), n = computed(() => {
|
|
2235
|
-
const
|
|
2236
|
-
return
|
|
2244
|
+
const d = l.safeParse(o.value);
|
|
2245
|
+
return d.success ? [] : d.error.errors;
|
|
2237
2246
|
}), r = ref();
|
|
2238
|
-
function y(
|
|
2247
|
+
function y(d, c) {
|
|
2239
2248
|
var B;
|
|
2240
2249
|
const f = [...o.value];
|
|
2241
|
-
f[c] =
|
|
2242
|
-
}
|
|
2243
|
-
function v(
|
|
2244
|
-
const c =
|
|
2245
|
-
(b) => b._id.toString() ==
|
|
2246
|
-
), f = CollectionUtils.formattedType((c == null ? void 0 : c.name) || ""), B =
|
|
2247
|
-
threshold:
|
|
2248
|
-
amount:
|
|
2250
|
+
f[c] = d, (B = r.value) == null || B.showSheet(!1), i("update:model-value", f);
|
|
2251
|
+
}
|
|
2252
|
+
function v(d) {
|
|
2253
|
+
const c = d.type == "VOUCHER" ? d.collectibleConfig : s.collectibles.find(
|
|
2254
|
+
(b) => b._id.toString() == d.collectible
|
|
2255
|
+
), f = CollectionUtils.formattedType((c == null ? void 0 : c.name) || ""), B = d.earningOption.type == "FIXED" ? a("connect.template.mission_pool.reward_sublabel_fixed", {
|
|
2256
|
+
threshold: d.threshold,
|
|
2257
|
+
amount: d.earningOption.amount
|
|
2249
2258
|
}) : a("connect.template.mission_pool.reward_sublabel_per_spend", {
|
|
2250
|
-
threshold:
|
|
2251
|
-
amount:
|
|
2252
|
-
every:
|
|
2259
|
+
threshold: d.threshold,
|
|
2260
|
+
amount: d.earningOption.amount,
|
|
2261
|
+
every: d.earningOption.every
|
|
2253
2262
|
});
|
|
2254
2263
|
return {
|
|
2255
2264
|
label: isNullOrEmpty(f) ? a("connect.template.mission_pool.no_reward") : f,
|
|
2256
2265
|
sublabel: B
|
|
2257
2266
|
};
|
|
2258
2267
|
}
|
|
2259
|
-
function h(
|
|
2268
|
+
function h(d) {
|
|
2260
2269
|
var f;
|
|
2261
2270
|
const c = [...o.value];
|
|
2262
|
-
(f = r.value) == null || f.showSheet(!0, c[
|
|
2271
|
+
(f = r.value) == null || f.showSheet(!0, c[d], d);
|
|
2263
2272
|
}
|
|
2264
|
-
function x(
|
|
2273
|
+
function x(d) {
|
|
2265
2274
|
const c = [...o.value];
|
|
2266
|
-
c.splice(
|
|
2275
|
+
c.splice(d, 1), i("update:model-value", c);
|
|
2267
2276
|
}
|
|
2268
2277
|
function k() {
|
|
2269
|
-
var
|
|
2270
|
-
(
|
|
2278
|
+
var d;
|
|
2279
|
+
(d = r.value) == null || d.showSheet(
|
|
2271
2280
|
!0,
|
|
2272
2281
|
{
|
|
2273
2282
|
type: "LOYALTY",
|
|
@@ -2284,15 +2293,15 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2284
2293
|
o.value.length
|
|
2285
2294
|
);
|
|
2286
2295
|
}
|
|
2287
|
-
function p(
|
|
2296
|
+
function p(d) {
|
|
2288
2297
|
var c, f;
|
|
2289
|
-
return
|
|
2298
|
+
return d.type == "VOUCHER" ? (c = d.collectibleConfig) == null ? void 0 : c.name : sentenceCase(
|
|
2290
2299
|
((f = s.loyaltyRewards.items.find(
|
|
2291
|
-
(B) => B.value ==
|
|
2300
|
+
(B) => B.value == d.collectible
|
|
2292
2301
|
)) == null ? void 0 : f.label) || ""
|
|
2293
2302
|
);
|
|
2294
2303
|
}
|
|
2295
|
-
return (
|
|
2304
|
+
return (d, c) => {
|
|
2296
2305
|
const f = resolveComponent("FmButton"), B = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
|
|
2297
2306
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2298
2307
|
createElementVNode("div", _hoisted_2$3, toDisplayString(unref(a)("connect.template.configure_reward_customer")), 1),
|
|
@@ -2370,8 +2379,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2370
2379
|
},
|
|
2371
2380
|
emits: ["update:model-value"],
|
|
2372
2381
|
setup(e, { emit: m }) {
|
|
2373
|
-
const { t: a } = useI18n(),
|
|
2374
|
-
const o = FdoMission.safeParse(
|
|
2382
|
+
const { t: a } = useI18n(), u = e, i = computed(() => {
|
|
2383
|
+
const o = FdoMission.safeParse(u.modelValue);
|
|
2375
2384
|
return o.success ? [] : o.error.errors;
|
|
2376
2385
|
}), s = computed(() => [
|
|
2377
2386
|
{
|
|
@@ -2403,11 +2412,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2403
2412
|
"hover:bg-fm-color-opacity-sm": ((k = e.modelValue) == null ? void 0 : k.type) != h.value
|
|
2404
2413
|
}]),
|
|
2405
2414
|
onClick: () => {
|
|
2406
|
-
var p,
|
|
2415
|
+
var p, d;
|
|
2407
2416
|
((p = e.modelValue) == null ? void 0 : p.type) != h.value && l("update:model-value", {
|
|
2408
2417
|
...e.modelValue,
|
|
2409
2418
|
type: h.value,
|
|
2410
|
-
end: ((
|
|
2419
|
+
end: ((d = e.modelValue) == null ? void 0 : d.end) || 1
|
|
2411
2420
|
});
|
|
2412
2421
|
},
|
|
2413
2422
|
key: h.value
|
|
@@ -2445,8 +2454,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2445
2454
|
});
|
|
2446
2455
|
function useLocaleText() {
|
|
2447
2456
|
const { locale: e, t: m } = useI18n();
|
|
2448
|
-
function a(
|
|
2449
|
-
return
|
|
2457
|
+
function a(u, i) {
|
|
2458
|
+
return u ? u[e.value] ?? u["en-US"] ?? m(i) : m(i);
|
|
2450
2459
|
}
|
|
2451
2460
|
return { getLocaleText: a };
|
|
2452
2461
|
}
|
|
@@ -2477,7 +2486,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2477
2486
|
},
|
|
2478
2487
|
emits: ["update:model-value", "update:file"],
|
|
2479
2488
|
setup(e, { emit: m }) {
|
|
2480
|
-
const { t: a } = useI18n(), { getLocaleText:
|
|
2489
|
+
const { t: a } = useI18n(), { getLocaleText: u } = useLocaleText(), i = e, s = m;
|
|
2481
2490
|
function l(y) {
|
|
2482
2491
|
switch (i.field.type) {
|
|
2483
2492
|
case "timeframe":
|
|
@@ -2527,15 +2536,15 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2527
2536
|
labelMark: i.schema && ZodHelper.isRequired(i.schema) == !1 ? "optional" : void 0,
|
|
2528
2537
|
zodLabel: i.schema ? ZodHelper.toInputLabel(
|
|
2529
2538
|
i.schema,
|
|
2530
|
-
|
|
2539
|
+
u(i.field.label_locale, i.field.label ?? "")
|
|
2531
2540
|
) : void 0
|
|
2532
2541
|
}));
|
|
2533
2542
|
return (y, v) => {
|
|
2534
2543
|
var c, f, B, b, E;
|
|
2535
|
-
const h = resolveComponent("FmTextField"), x = resolveComponent("FmStepperField"), k = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"),
|
|
2544
|
+
const h = resolveComponent("FmTextField"), x = resolveComponent("FmStepperField"), k = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), d = resolveComponent("FmSwitch");
|
|
2536
2545
|
return e.field.type === "text" ? (openBlock(), createBlock(h, {
|
|
2537
2546
|
key: 0,
|
|
2538
|
-
label: unref(
|
|
2547
|
+
label: unref(u)(e.field.label_locale, e.field.label ?? ""),
|
|
2539
2548
|
"label-mark": unref(r).labelMark,
|
|
2540
2549
|
rules: unref(r).rules,
|
|
2541
2550
|
"model-value": unref(o),
|
|
@@ -2547,7 +2556,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2547
2556
|
json: { schema: unref(r).unwrapped, props: i }
|
|
2548
2557
|
}, null, 8, ["json"]),
|
|
2549
2558
|
createVNode(x, {
|
|
2550
|
-
label: unref(
|
|
2559
|
+
label: unref(u)(e.field.label_locale, e.field.label ?? ""),
|
|
2551
2560
|
"label-mark": e.field.isRuleChildren ? void 0 : unref(r).labelMark,
|
|
2552
2561
|
"model-value": unref(o),
|
|
2553
2562
|
rules: e.field.isRuleChildren ? [] : unref(r).rules,
|
|
@@ -2557,7 +2566,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2557
2566
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
2558
2567
|
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(k, {
|
|
2559
2568
|
key: 2,
|
|
2560
|
-
label: unref(
|
|
2569
|
+
label: unref(u)(e.field.label_locale, e.field.label ?? ""),
|
|
2561
2570
|
"label-mark": unref(r).labelMark,
|
|
2562
2571
|
rules: unref(r).rules,
|
|
2563
2572
|
"model-value": unref(o),
|
|
@@ -2591,9 +2600,9 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2591
2600
|
(openBlock(), createBlock(resolveDynamicComponent(unref(r).zodLabel)))
|
|
2592
2601
|
]),
|
|
2593
2602
|
_: 1
|
|
2594
|
-
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(
|
|
2603
|
+
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(d, {
|
|
2595
2604
|
key: 6,
|
|
2596
|
-
label: unref(
|
|
2605
|
+
label: unref(u)(e.field.label_locale, e.field.label ?? ""),
|
|
2597
2606
|
"label-placement": "right",
|
|
2598
2607
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
2599
2608
|
"label-mark": unref(r).labelMark,
|
|
@@ -2790,7 +2799,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2790
2799
|
},
|
|
2791
2800
|
setup(e) {
|
|
2792
2801
|
const { t: m, te: a } = useI18n();
|
|
2793
|
-
return (
|
|
2802
|
+
return (u, i) => {
|
|
2794
2803
|
const s = resolveComponent("FmCard");
|
|
2795
2804
|
return openBlock(), createBlock(s, {
|
|
2796
2805
|
variant: "outlined",
|
|
@@ -2835,10 +2844,10 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2835
2844
|
console.log(
|
|
2836
2845
|
TEMPLATES[type],
|
|
2837
2846
|
"base template"
|
|
2838
|
-
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a,
|
|
2847
|
+
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a, u) => {
|
|
2839
2848
|
a.campaign.type === "VOUCHER" && a.campaign.code && useCampaignStore().campaigns.voucher.some(
|
|
2840
2849
|
(i) => i.code === a.campaign.code && i._id.toString() !== a.campaign._id.toString()
|
|
2841
|
-
) &&
|
|
2850
|
+
) && u.addIssue({
|
|
2842
2851
|
code: "custom",
|
|
2843
2852
|
message: "Code already exists, please use another code",
|
|
2844
2853
|
path: ["campaign", "code"]
|
|
@@ -2876,10 +2885,10 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2876
2885
|
});
|
|
2877
2886
|
function stepErrors(e = currentStep.value - 1) {
|
|
2878
2887
|
const m = template.value.steps[e].groups.flatMap(
|
|
2879
|
-
(a) => a.fields.map((
|
|
2888
|
+
(a) => a.fields.map((u) => u.property)
|
|
2880
2889
|
);
|
|
2881
2890
|
return errors.value.filter(
|
|
2882
|
-
(a) => m.some((
|
|
2891
|
+
(a) => m.some((u) => a.path.join(".").includes(u))
|
|
2883
2892
|
);
|
|
2884
2893
|
}
|
|
2885
2894
|
__expose({ showSheet });
|
|
@@ -2893,9 +2902,9 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2893
2902
|
});
|
|
2894
2903
|
}
|
|
2895
2904
|
function onUpdateProperty(e, m) {
|
|
2896
|
-
var a,
|
|
2905
|
+
var a, u, i, s, l, o, n, r;
|
|
2897
2906
|
if (_.set(data.value, e, m), e == "campaign.event.type") {
|
|
2898
|
-
const v = ((s = (i = (
|
|
2907
|
+
const v = ((s = (i = (u = (a = template.value) == null ? void 0 : a.defaultValue) == null ? void 0 : u.campaign) == null ? void 0 : i.event) == null ? void 0 : s.rule) ? _.cloneDeep({
|
|
2899
2908
|
...(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
|
|
2900
2909
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
2901
2910
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
@@ -2952,7 +2961,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2952
2961
|
(m || m === void 0) && (sheetVisible.value = !1);
|
|
2953
2962
|
}
|
|
2954
2963
|
return (e, m) => {
|
|
2955
|
-
const a = resolveComponent("FmButton"),
|
|
2964
|
+
const a = resolveComponent("FmButton"), u = resolveComponent("FmStep"), i = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
2956
2965
|
return openBlock(), createBlock(l, {
|
|
2957
2966
|
"fullscreen-size": "lg",
|
|
2958
2967
|
modelValue: unref(sheetVisible),
|
|
@@ -3025,7 +3034,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3025
3034
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
3026
3035
|
}, {
|
|
3027
3036
|
default: withCtx(() => [
|
|
3028
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(
|
|
3037
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(u, {
|
|
3029
3038
|
key: o.name,
|
|
3030
3039
|
title: unref(getLocaleText)(o.name_locale, o.name),
|
|
3031
3040
|
value: n + 1,
|
|
@@ -3048,7 +3057,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3048
3057
|
class: "flex-1"
|
|
3049
3058
|
}, {
|
|
3050
3059
|
default: withCtx(() => [
|
|
3051
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(
|
|
3060
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(u, {
|
|
3052
3061
|
key: o.name,
|
|
3053
3062
|
title: unref(sheetTitle),
|
|
3054
3063
|
description: unref(getLocaleText)(o.name_locale, o.name),
|