@feedmepos/mf-connect 0.1.38-beta.73 → 0.1.38-beta.75
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-gGjm5ome.js → Analytic-9B27Q-I3.js} +14 -14
- package/dist/{App-BDz9mw-6.js → App-isiE4pjM.js} +44 -40
- package/dist/{AuditLogs-4x90ZjjY.js → AuditLogs-BmHr7pNI.js} +9 -9
- package/dist/{Bin-Bby2f42O.js → Bin-BR06pDbx.js} +8 -8
- package/dist/{Broadcast-eYN2AqFC.js → Broadcast-D_t80J2I.js} +10 -10
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B-fO9-Hb.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C5IuPCTB.js} +6 -6
- package/dist/{Card-Cz-pLt7X.js → Card-Zs-1lcSr.js} +20 -19
- package/dist/{Collections-CgfXuVA1.js → Collections-BjeTJSHo.js} +19 -18
- package/dist/{Credit-Lc6B2oQ9.js → Credit-DdmdsxOF.js} +10 -10
- package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bm7XTR7o.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DkOfrONH.js} +253 -300
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Cp5nSLEX.js → EffectSheet.vue_vue_type_style_index_0_lang-kzk3iEKA.js} +6 -6
- package/dist/{Experience-Ca94IJBt.js → Experience-WxtE9ZIT.js} +10 -10
- package/dist/{FileSaver.min-BThLVsSf.js → FileSaver.min-Vgxo4jNi.js} +1 -1
- package/dist/{Game-BYLYDTU9.js → Game-Cc0mZ3y4.js} +11 -11
- package/dist/{GenerateMaterial-CUoG6uyI.js → GenerateMaterial-Dsvnpz4o.js} +6 -6
- package/dist/{Grab-DZ_LkTly.js → Grab-CcaXToD-.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CI4kP9ul.js → ImageInput.vue_vue_type_script_setup_true_lang-D0yJMgs9.js} +1 -1
- package/dist/{Index-BZ2r8x0t.js → Index-C0TcFJJY.js} +10 -10
- package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-CXFtSS9_.js +48 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BLKlXW1b.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Ca7hKpcD.js} +1 -1
- package/dist/{MainLayout-BfGSSVMW.js → MainLayout-DPpjvWwq.js} +1 -1
- package/dist/{Marketing-DYg0J1xG.js → Marketing-DfXuNM7X.js} +4 -4
- package/dist/{MarketingMaterialEdit-B--Kck7j.js → MarketingMaterialEdit-C63qyQSd.js} +4 -4
- package/dist/{Member-By5QEJxn.js → Member-LTYVn-80.js} +11 -11
- package/dist/{MemberList-D49bMmGJ.js → MemberList-Gqr6ha5p.js} +28 -27
- package/dist/{MemberTransactions-Cz9XENK1.js → MemberTransactions-CVZ-SPhm.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-IlFjM-Y5.js → MessageInput.vue_vue_type_script_setup_true_lang-BGooFTgg.js} +16 -15
- package/dist/{Mission-Cvl-V7c8.js → Mission-CLQdNsOe.js} +11 -11
- package/dist/{Overview-lu82lUJp.js → Overview-BluyLBRI.js} +18 -18
- package/dist/{Point-C65YFhOB.js → Point-DQLQxJG1.js} +10 -10
- package/dist/{Promotion-DQCrKO6a.js → Promotion-BG0xL1ed.js} +11 -11
- package/dist/{Queue-DR5lfSMi.js → Queue-BR7TrLI8.js} +19 -19
- package/dist/{Record-BCt42_VZ.js → Record-2WFpDhAb.js} +9 -9
- package/dist/Review-Bu9SGftr.js +617 -0
- package/dist/ReviewFacebookCallback-CV99Udei.js +243 -0
- package/dist/ReviewGoogleCallback-DiqgQzOt.js +213 -0
- package/dist/{Reward-7aOnjmMm.js → Reward-CPhM3ChT.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BPgjr91S.js → RewardGroup.vue_vue_type_script_setup_true_lang-Q9pVq11w.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Bp5jnlFr.js → RuleGroup.vue_vue_type_script_setup_true_lang-BRUQtqjv.js} +14 -14
- package/dist/{Segment-DiYwfb8M.js → Segment-D6V8FKUY.js} +24 -24
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-ydM5ypC0.js → SelectItems.vue_vue_type_script_setup_true_lang-BrE1gGHP.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BRs7pw0l.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DQhO9k7V.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DU8AAPFD.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CyHx6m95.js} +4 -4
- package/dist/{Setting-k6xShcs8.js → Setting-Bh5bB75w.js} +16 -15
- package/dist/{SettingAdvertisements-DQa_jXYM.js → SettingAdvertisements-CFUjq6s1.js} +22 -21
- package/dist/{Store-B6lYBpsm.js → Store-DiVaUn7w.js} +23 -22
- package/dist/{StoreRewards-Cqd399q8.js → StoreRewards-Bb9iW3Yz.js} +25 -24
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Wv_SHwmo.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DVFsPzLK.js} +31 -30
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Bi1o4YAz.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-D9uZR0si.js} +2 -2
- package/dist/{Tier-CXXImaDx.js → Tier-BYxLjqAB.js} +26 -25
- package/dist/{Title-CTxNCmBW.js → Title-D3cdNE2O.js} +28 -27
- package/dist/{Transaction-DonaHVzF.js → Transaction-D7ItbBra.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DbRVYccO.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-UXSlpEM0.js} +6 -6
- package/dist/{Voucher-Bso_Mjlg.js → Voucher-DNQz_ujN.js} +14 -14
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DNvmaJk9.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CztGuaCV.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-KHZ3-THo.js → ZodTextField.vue_vue_type_script_setup_true_lang-RI0mY3Nx.js} +2 -2
- package/dist/{app-DKrmktFJ.js → app-zPef9Uzl.js} +5619 -5294
- package/dist/app.js +1 -1
- package/dist/{business-Dd73TVX5.js → business-DKEB57Mf.js} +1 -1
- package/dist/{campaign-BUQHH4KL.js → campaign-BD_s6pW4.js} +2 -2
- package/dist/{campaign-DkJOyF24.js → campaign-D9IfNIPI.js} +8 -8
- package/dist/{campaign.enum-C8vJuDAq.js → campaign.enum-gPz5hWSW.js} +1 -1
- package/dist/{campaign.fn-DJSpfhZH.js → campaign.fn-Csxad3W7.js} +48 -48
- package/dist/{collectible.enum-D3W0TwoJ.js → collectible.enum-CA-QbTP-.js} +1 -1
- package/dist/{collection.fn-YzgpOmG0.js → collection.fn-tFxG0UiA.js} +2 -2
- package/dist/{dto-sceHHLGr.js → dto-CdvywxS_.js} +4 -4
- package/dist/{duplicateCampaign-CDulKxgJ.js → duplicateCampaign-Cj68m0Ti.js} +2 -2
- package/dist/{effect-BSgfR9iB.js → effect-KecOJIEK.js} +1 -1
- package/dist/{email-addresses-D_fyxOof.js → email-addresses-Ske7sY-s.js} +2 -2
- package/dist/{export-OxiqL1B7.js → export-17vDh5vq.js} +10 -9
- package/dist/{helper-CzurWUe4.js → helper-B-ZDFjy7.js} +1 -1
- package/dist/{index-Dw3ew6qN.js → index-BRZC-Cy5.js} +1 -1
- package/dist/{index-IBvUTxqC.js → index-BV_G-XzK.js} +3 -3
- package/dist/{index-BtMmY44D.js → index-BwLCkOIF.js} +1 -1
- package/dist/index-C1Z4oibL.js +48 -0
- package/dist/{index-BqQas5Sx.js → index-CNLqZu6_.js} +424 -213
- package/dist/{index-BF0hGAkO.js → index-CdByBgmF.js} +1 -1
- package/dist/{index-Cyt6eKEF.js → index-CkqQGjg1.js} +3 -3
- package/dist/{index-BGMhsZnB.js → index-D05Pcg0E.js} +1 -1
- package/dist/{index-pkwrUX33.js → index-D58_aTiN.js} +2 -2
- package/dist/{index-CAUVTn1I.js → index-DCzjjZgV.js} +1 -1
- package/dist/{index-Cg-sBBf_.js → index-DY3_9zbY.js} +46 -34
- package/dist/{index-B_QGGlMD.js → index-Dc2JsMD2.js} +3 -3
- package/dist/index-Dh78uGTl.js +146 -0
- package/dist/{index-tYmg4eyJ.js → index-DnrSd_o_.js} +1 -1
- package/dist/{index-BbTHqh58.js → index-woXH3LmA.js} +1 -1
- package/dist/{index.esm2017-5xGykkgL.js → index.esm2017-DxQe1gCt.js} +1 -1
- package/dist/loading-B1ymwDT_.js +71 -0
- package/dist/{lodash-Q-_FPkpI.js → lodash-BiGSPE0G.js} +1 -1
- package/dist/{membership-CU-wFWan.js → membership-GnNCDGBk.js} +3 -3
- package/dist/{money-CzlfhEoe.js → money-CG6LGklW.js} +1 -1
- package/dist/{number-Bee2M41N.js → number-p19we-YD.js} +1 -1
- package/dist/{objectid-DRJQv7AY.js → objectid-XhaZoPQl.js} +15 -15
- package/dist/{plugins-CAdlnev8.js → plugins-cxSxZO0d.js} +3 -3
- package/dist/{reward-BhlYd0FB.js → reward-siULTu5h.js} +1 -1
- package/dist/{rule-Ccvu41A_.js → rule-GD9oMCPH.js} +3 -3
- package/dist/{rule-builder-B968rIyS.js → rule-builder-DWFem4d5.js} +1 -1
- package/dist/{template-OZfyPJVE.js → template-o23nw6e2.js} +6 -6
- package/dist/{timezone-CopuRbDK.js → timezone-BVwygiRH.js} +2 -2
- package/dist/{trigger-BtQI81FL.js → trigger-CrEBP1aZ.js} +5 -5
- package/dist/{usePagination-Ciom38dd.js → usePagination-BbTCnhtY.js} +1 -1
- package/dist/{user-BOW0ixDK.js → user-DcMEufQ6.js} +1 -1
- package/dist/{vue-i18n-jTYKTJq1.js → vue-i18n-BxV_u4BZ.js} +368 -368
- package/dist/{xlsx-YD3LYwip.js → xlsx-BnJDxONa.js} +1 -1
- package/dist/{zod-B_G9o5PC.js → zod-CUN5LrI6.js} +1 -1
- package/package.json +1 -1
- package/dist/loading-CvHPT80F.js +0 -215
|
@@ -1,43 +1,44 @@
|
|
|
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 { F as Fh, 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-BiGSPE0G.js";
|
|
3
|
+
import { F as Fh, z } from "./app-zPef9Uzl.js";
|
|
4
|
+
import { Z as ZodHelper } from "./zod-CUN5LrI6.js";
|
|
5
|
+
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-CdvywxS_.js";
|
|
6
|
+
import { u as useMembershipStore } from "./membership-GnNCDGBk.js";
|
|
7
|
+
import { u as useBusinessStore } from "./business-DKEB57Mf.js";
|
|
8
|
+
import "./index-CkqQGjg1.js";
|
|
9
|
+
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-DWFem4d5.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$
|
|
12
|
+
import { f as featureVersionMapping } from "./campaign.enum-gPz5hWSW.js";
|
|
13
|
+
import { _ as _sfc_main$u } from "./ImageInput.vue_vue_type_script_setup_true_lang-D0yJMgs9.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-kzk3iEKA.js";
|
|
15
|
+
import { _ as _sfc_main$w } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-D9uZR0si.js";
|
|
16
|
+
import { c as core, S as SvcConfig } from "./index-D58_aTiN.js";
|
|
17
|
+
import { p as prompt, f as firebaseStorage } from "./plugins-cxSxZO0d.js";
|
|
18
|
+
import { _ as _sfc_main$n } from "./SelectItems.vue_vue_type_script_setup_true_lang-BrE1gGHP.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$
|
|
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$
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
20
|
+
import { _ as _sfc_main$z } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-UXSlpEM0.js";
|
|
21
|
+
import { _ as _sfc_main$o, a as _sfc_main$q } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BRUQtqjv.js";
|
|
22
|
+
import { u as useI18n } from "./vue-i18n-BxV_u4BZ.js";
|
|
23
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$A, b as _sfc_main$B } from "./trigger-CrEBP1aZ.js";
|
|
24
|
+
import { _ as _sfc_main$p } from "./DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js";
|
|
25
|
+
import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-BGooFTgg.js";
|
|
26
|
+
import { C as CountryTimezone, m as moment } from "./timezone-BVwygiRH.js";
|
|
27
|
+
import { c as calculateNextScheduleAt, R as RRule, S as SummarizeRrule, g as getRruleAnchorDate } from "./rule-GD9oMCPH.js";
|
|
27
28
|
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-
|
|
29
|
+
import { _ as _sfc_main$r, a as _sfc_main$t } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-CztGuaCV.js";
|
|
30
|
+
import { T as TEMPLATES } from "./index-CNLqZu6_.js";
|
|
31
|
+
import { u as FdoCreditLoyaltyReward, v as FdtoRandomReward, w as F_MISSION_TYPE, x as FdoThresholdCreditReward, y as FdtoThresholdReward, z as FdoMission } from "./index-DY3_9zbY.js";
|
|
32
|
+
import "./index-BV_G-XzK.js";
|
|
33
|
+
import "./index-Dc2JsMD2.js";
|
|
34
|
+
import { a as F_GAME_TYPE } from "./collectible.enum-CA-QbTP-.js";
|
|
35
|
+
import { u as useLoading } from "./loading-B1ymwDT_.js";
|
|
36
|
+
import { i as initCollectibleConfig } from "./helper-B-ZDFjy7.js";
|
|
37
|
+
import { C as CollectionUtils } from "./collection.fn-tFxG0UiA.js";
|
|
37
38
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
38
|
-
import { d as getCampaignSummaryObject } from "./campaign-
|
|
39
|
+
import { d as getCampaignSummaryObject } from "./campaign-D9IfNIPI.js";
|
|
39
40
|
import { useDialog } from "@feedmepos/ui-library";
|
|
40
|
-
import { u as useCampaignStore } from "./campaign-
|
|
41
|
+
import { u as useCampaignStore } from "./campaign-BD_s6pW4.js";
|
|
41
42
|
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
42
43
|
function summarizeGrabDiscount(e) {
|
|
43
44
|
if (!e)
|
|
@@ -48,14 +49,14 @@ function summarizeGrabDiscount(e) {
|
|
|
48
49
|
case "order":
|
|
49
50
|
return "Bill discount";
|
|
50
51
|
case "items":
|
|
51
|
-
return l.type.startsWith("bundle") ?
|
|
52
|
+
return l.type.startsWith("bundle") ? u(l.type) : "Item discount";
|
|
52
53
|
case "categories":
|
|
53
54
|
return "Category discount";
|
|
54
55
|
default:
|
|
55
56
|
return "Discount";
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
+
function u(l) {
|
|
59
60
|
switch (l) {
|
|
60
61
|
case "bundleSameFixPrice":
|
|
61
62
|
return "Bundle (same item) - Fixed price";
|
|
@@ -73,7 +74,7 @@ function summarizeGrabDiscount(e) {
|
|
|
73
74
|
return "Bundle discount";
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
+
function d(l) {
|
|
77
78
|
switch (l.type) {
|
|
78
79
|
case "percentage":
|
|
79
80
|
case "bundleSamePercentage":
|
|
@@ -99,14 +100,14 @@ function summarizeGrabDiscount(e) {
|
|
|
99
100
|
}
|
|
100
101
|
return {
|
|
101
102
|
type: a(e),
|
|
102
|
-
adjustment:
|
|
103
|
+
adjustment: d(e),
|
|
103
104
|
cap: s(e)
|
|
104
105
|
};
|
|
105
106
|
}
|
|
106
107
|
const _hoisted_1$l = {
|
|
107
108
|
key: 0,
|
|
108
109
|
class: "bg-fm-color-neutral-gray-50 border border-fm-color-neutral-gray-200 rounded-8 p-16 space-y-16"
|
|
109
|
-
}, _hoisted_2$h = { class: "flex items-center justify-between" }, _hoisted_3$e = { class: "flex items-center gap-8" }, _hoisted_4$d = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 p-16" }, _hoisted_5$a = { class: "flex justify-end gap-8 pt-8 border-t border-fm-color-neutral-gray-200" }, _sfc_main$
|
|
110
|
+
}, _hoisted_2$h = { class: "flex items-center justify-between" }, _hoisted_3$e = { class: "flex items-center gap-8" }, _hoisted_4$d = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 p-16" }, _hoisted_5$a = { class: "flex justify-end gap-8 pt-8 border-t border-fm-color-neutral-gray-200" }, _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
110
111
|
__name: "GrabItemSelectionInline",
|
|
111
112
|
props: {
|
|
112
113
|
visible: { type: Boolean },
|
|
@@ -115,23 +116,23 @@ const _hoisted_1$l = {
|
|
|
115
116
|
},
|
|
116
117
|
emits: ["confirm", "cancel"],
|
|
117
118
|
setup(e, { emit: m }) {
|
|
118
|
-
const a = e,
|
|
119
|
+
const a = e, u = m, d = ref();
|
|
119
120
|
watch(
|
|
120
121
|
() => a.visible,
|
|
121
122
|
(n) => {
|
|
122
123
|
var r, p;
|
|
123
|
-
!n &&
|
|
124
|
+
!n && d.value && ((p = (r = d.value).setSelectedItems) == null || p.call(r, a.initialValue || []));
|
|
124
125
|
}
|
|
125
126
|
);
|
|
126
127
|
function s() {
|
|
127
128
|
var n;
|
|
128
|
-
(n =
|
|
129
|
+
(n = d.value) == null || n.onConfirm();
|
|
129
130
|
}
|
|
130
131
|
function l() {
|
|
131
|
-
|
|
132
|
+
u("cancel");
|
|
132
133
|
}
|
|
133
134
|
function o(n) {
|
|
134
|
-
|
|
135
|
+
u("confirm", n);
|
|
135
136
|
}
|
|
136
137
|
return (n, r) => {
|
|
137
138
|
const p = resolveComponent("FmIcon"), h = resolveComponent("FmButton");
|
|
@@ -152,9 +153,9 @@ const _hoisted_1$l = {
|
|
|
152
153
|
]),
|
|
153
154
|
r[1] || (r[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which items this discount applies to. For bundle discounts, select multiple items that can be bundled together. ", -1)),
|
|
154
155
|
createElementVNode("div", _hoisted_4$d, [
|
|
155
|
-
createVNode(_sfc_main$
|
|
156
|
+
createVNode(_sfc_main$n, {
|
|
156
157
|
ref_key: "selectItemRef",
|
|
157
|
-
ref:
|
|
158
|
+
ref: d,
|
|
158
159
|
"initial-value": e.initialValue,
|
|
159
160
|
"filter-items": e.filterItems,
|
|
160
161
|
"on-complete": o,
|
|
@@ -182,7 +183,7 @@ const _hoisted_1$l = {
|
|
|
182
183
|
}, _hoisted_2$g = { class: "flex items-center justify-between" }, _hoisted_3$d = { class: "flex items-center gap-8" }, _hoisted_4$c = { class: "flex gap-16 items-center flex-wrap" }, _hoisted_5$9 = { class: "flex gap-8 items-center" }, _hoisted_6$5 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_7$5 = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 max-h-[300px] overflow-y-auto" }, _hoisted_8$4 = { class: "flex items-center gap-12" }, _hoisted_9$4 = { class: "fm-typo-en-body-md-600" }, _hoisted_10$4 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_11$2 = {
|
|
183
184
|
key: 1,
|
|
184
185
|
class: "p-24 text-center"
|
|
185
|
-
}, _hoisted_12$1 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_13$1 = { class: "flex justify-end gap-8 pt-8 border-t border-fm-color-neutral-gray-200" }, _sfc_main$
|
|
186
|
+
}, _hoisted_12$1 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_13$1 = { class: "flex justify-end gap-8 pt-8 border-t border-fm-color-neutral-gray-200" }, _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
186
187
|
__name: "GrabCategorySelectionInline",
|
|
187
188
|
props: {
|
|
188
189
|
visible: { type: Boolean },
|
|
@@ -190,8 +191,8 @@ const _hoisted_1$l = {
|
|
|
190
191
|
},
|
|
191
192
|
emits: ["confirm", "cancel"],
|
|
192
193
|
setup(e, { emit: m }) {
|
|
193
|
-
const a = e,
|
|
194
|
-
const i =
|
|
194
|
+
const a = e, u = m, d = Fh(), s = ref({}), l = ref(""), o = computed(() => {
|
|
195
|
+
const i = d.menu.value;
|
|
195
196
|
return i ? i.modules.category.map((c) => ({
|
|
196
197
|
id: c._id,
|
|
197
198
|
name: c.name
|
|
@@ -212,7 +213,7 @@ const _hoisted_1$l = {
|
|
|
212
213
|
watch([() => a.visible, () => a.initialValue], () => {
|
|
213
214
|
a.visible && p();
|
|
214
215
|
}), onMounted(async () => {
|
|
215
|
-
await
|
|
216
|
+
await d.store.getMenu(), p();
|
|
216
217
|
});
|
|
217
218
|
function h(i) {
|
|
218
219
|
s.value[i] = !s.value[i];
|
|
@@ -230,16 +231,16 @@ const _hoisted_1$l = {
|
|
|
230
231
|
}
|
|
231
232
|
function x() {
|
|
232
233
|
const i = Object.entries(s.value).filter(([, c]) => c).map(([c]) => c);
|
|
233
|
-
|
|
234
|
+
u("confirm", i);
|
|
234
235
|
}
|
|
235
236
|
function v() {
|
|
236
|
-
|
|
237
|
+
u("cancel");
|
|
237
238
|
}
|
|
238
239
|
const f = computed(() => n.value.length > 0 && n.value.every(
|
|
239
240
|
(i) => s.value[i.id]
|
|
240
241
|
));
|
|
241
242
|
return (i, c) => {
|
|
242
|
-
const k = resolveComponent("FmIcon"), b = resolveComponent("FmButton"),
|
|
243
|
+
const k = resolveComponent("FmIcon"), b = resolveComponent("FmButton"), E = resolveComponent("FmTextField"), N = resolveComponent("FmCheckbox"), B = resolveComponent("FmListItem"), w = resolveComponent("FmList");
|
|
243
244
|
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
244
245
|
createElementVNode("div", _hoisted_2$g, [
|
|
245
246
|
createElementVNode("div", _hoisted_3$d, [
|
|
@@ -274,9 +275,9 @@ const _hoisted_1$l = {
|
|
|
274
275
|
}),
|
|
275
276
|
createElementVNode("span", _hoisted_6$5, toDisplayString(r.value) + " selected ", 1)
|
|
276
277
|
]),
|
|
277
|
-
createVNode(
|
|
278
|
+
createVNode(E, {
|
|
278
279
|
modelValue: l.value,
|
|
279
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
280
|
+
"onUpdate:modelValue": c[0] || (c[0] = (S) => l.value = S),
|
|
280
281
|
placeholder: "Search categories",
|
|
281
282
|
"leading-icon": { name: "search", color: "" },
|
|
282
283
|
class: "flex-1 min-w-[200px]"
|
|
@@ -285,16 +286,16 @@ const _hoisted_1$l = {
|
|
|
285
286
|
createElementVNode("div", _hoisted_7$5, [
|
|
286
287
|
n.value.length > 0 ? (openBlock(), createBlock(w, { key: 0 }, {
|
|
287
288
|
default: withCtx(() => [
|
|
288
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (
|
|
289
|
-
key:
|
|
289
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (S) => (openBlock(), createBlock(B, {
|
|
290
|
+
key: S.id,
|
|
290
291
|
clickable: !0,
|
|
291
|
-
onClick: (F) => h(
|
|
292
|
+
onClick: (F) => h(S.id)
|
|
292
293
|
}, {
|
|
293
294
|
leading: withCtx(() => [
|
|
294
295
|
createVNode(N, {
|
|
295
|
-
"model-value": s.value[
|
|
296
|
-
value:
|
|
297
|
-
"onUpdate:modelValue": (F) => h(
|
|
296
|
+
"model-value": s.value[S.id] || !1,
|
|
297
|
+
value: S.id,
|
|
298
|
+
"onUpdate:modelValue": (F) => h(S.id),
|
|
298
299
|
onClick: c[1] || (c[1] = withModifiers(() => {
|
|
299
300
|
}, ["stop"]))
|
|
300
301
|
}, null, 8, ["model-value", "value", "onUpdate:modelValue"])
|
|
@@ -307,8 +308,8 @@ const _hoisted_1$l = {
|
|
|
307
308
|
class: "text-fm-color-typo-secondary"
|
|
308
309
|
}),
|
|
309
310
|
createElementVNode("div", null, [
|
|
310
|
-
createElementVNode("div", _hoisted_9$4, toDisplayString(
|
|
311
|
-
createElementVNode("div", _hoisted_10$4, " ID: " + toDisplayString(
|
|
311
|
+
createElementVNode("div", _hoisted_9$4, toDisplayString(S.name), 1),
|
|
312
|
+
createElementVNode("div", _hoisted_10$4, " ID: " + toDisplayString(S.id), 1)
|
|
312
313
|
])
|
|
313
314
|
])
|
|
314
315
|
]),
|
|
@@ -342,14 +343,14 @@ const _hoisted_1$l = {
|
|
|
342
343
|
}, _hoisted_3$c = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$b = { class: "text-fm-color-typo-secondary" }, _hoisted_5$8 = { key: 0 }, _hoisted_6$4 = { class: "space-y-24" }, _hoisted_7$4 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-4" }, _hoisted_8$3 = { key: 0 }, _hoisted_9$3 = { class: "fm-typo-en-body-md-600 mb-8 block" }, _hoisted_10$3 = { key: 1 }, _hoisted_11$1 = { key: 2 }, _hoisted_12 = { key: 0 }, _hoisted_13 = { class: "space-y-8" }, _hoisted_14 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_15 = { class: "flex items-center gap-8" }, _hoisted_16 = { class: "fm-typo-en-body-md-400" }, _hoisted_17 = { key: 3 }, _hoisted_18 = { key: 0 }, _hoisted_19 = { class: "space-y-8" }, _hoisted_20 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_21 = { class: "flex items-center gap-8" }, _hoisted_22 = { class: "fm-typo-en-body-md-400" }, _hoisted_23 = {
|
|
343
344
|
key: 0,
|
|
344
345
|
class: "mt-16 p-12 bg-fm-color-feedback-error-light rounded-8 border border-fm-color-feedback-error-main"
|
|
345
|
-
}, _hoisted_24 = { class: "flex items-center gap-8 mb-8 text-fm-color-system-error-300" }, _hoisted_25 = { class: "space-y-4" }, _hoisted_26 = { class: "flex gap-16" }, _sfc_main$
|
|
346
|
+
}, _hoisted_24 = { class: "flex items-center gap-8 mb-8 text-fm-color-system-error-300" }, _hoisted_25 = { class: "space-y-4" }, _hoisted_26 = { class: "flex gap-16" }, _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
346
347
|
__name: "GrabEffectSheet",
|
|
347
348
|
props: {
|
|
348
349
|
modelValue: { type: Object }
|
|
349
350
|
},
|
|
350
351
|
emits: ["update:model-value"],
|
|
351
352
|
setup(e, { emit: m }) {
|
|
352
|
-
const a = e,
|
|
353
|
+
const a = e, u = m, d = Fh(), s = ref(!1), l = ref(!1), o = ref(!1), n = ref({
|
|
353
354
|
type: "net",
|
|
354
355
|
value: 0,
|
|
355
356
|
scope: {
|
|
@@ -363,14 +364,14 @@ const _hoisted_1$l = {
|
|
|
363
364
|
},
|
|
364
365
|
{ immediate: !0 }
|
|
365
366
|
), onMounted(async () => {
|
|
366
|
-
await
|
|
367
|
+
await d.store.getMenu();
|
|
367
368
|
});
|
|
368
369
|
const r = computed(() => {
|
|
369
370
|
var g;
|
|
370
371
|
return !(!n.value.type || !((g = n.value.scope) != null && g.type) || y(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
372
|
});
|
|
372
373
|
async function p(g) {
|
|
373
|
-
g.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") &&
|
|
374
|
+
g.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && u("update:model-value", null);
|
|
374
375
|
}
|
|
375
376
|
function h() {
|
|
376
377
|
var g;
|
|
@@ -480,7 +481,7 @@ const _hoisted_1$l = {
|
|
|
480
481
|
return "Select how you want to apply the discount.";
|
|
481
482
|
}
|
|
482
483
|
}
|
|
483
|
-
function
|
|
484
|
+
function E() {
|
|
484
485
|
var g;
|
|
485
486
|
return ((g = n.value.scope) == null ? void 0 : g.type) === "items";
|
|
486
487
|
}
|
|
@@ -493,7 +494,7 @@ const _hoisted_1$l = {
|
|
|
493
494
|
const g = ($ = n.value.scope) == null ? void 0 : $.objectIDs;
|
|
494
495
|
if (!g || g.length === 0)
|
|
495
496
|
return "No items selected";
|
|
496
|
-
const V =
|
|
497
|
+
const V = d.menu.value;
|
|
497
498
|
return V && g.length <= 3 ? g.map((T) => {
|
|
498
499
|
const D = V.modules.item.find((A) => A._id === T);
|
|
499
500
|
return D ? (D.name2 || D.name).trim() : `Item ${T}`;
|
|
@@ -504,13 +505,13 @@ const _hoisted_1$l = {
|
|
|
504
505
|
const g = ($ = n.value.scope) == null ? void 0 : $.objectIDs;
|
|
505
506
|
if (!g || g.length === 0)
|
|
506
507
|
return "No categories selected";
|
|
507
|
-
const V =
|
|
508
|
+
const V = d.menu.value;
|
|
508
509
|
return V && g.length <= 3 ? g.map((T) => {
|
|
509
510
|
const D = V.modules.category.find((A) => A._id === T);
|
|
510
511
|
return D ? D.name : `Category ${T}`;
|
|
511
512
|
}).join(", ") : g.length === 1 ? "1 category selected" : `${g.length} categories selected`;
|
|
512
513
|
}
|
|
513
|
-
function
|
|
514
|
+
function S() {
|
|
514
515
|
l.value = !0;
|
|
515
516
|
}
|
|
516
517
|
function F() {
|
|
@@ -534,7 +535,7 @@ const _hoisted_1$l = {
|
|
|
534
535
|
return n.value.type || g.push("Discount type is required"), (V = n.value.scope) != null && V.type || g.push("Scope type is required"), y(n.value.type) && (!n.value.value || n.value.value <= 0) && g.push("Discount amount must be greater than 0"), (($ = n.value.scope) == null ? void 0 : $.type) === "items" && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0) && g.push("Please select at least one item"), ((O = n.value.scope) == null ? void 0 : O.type) === "category" && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0) && g.push("Please select at least one category"), g;
|
|
535
536
|
});
|
|
536
537
|
function Z() {
|
|
537
|
-
|
|
538
|
+
u("update:model-value", n.value), s.value = !1;
|
|
538
539
|
}
|
|
539
540
|
const q = [
|
|
540
541
|
{ label: "Bill discount", value: "order" },
|
|
@@ -641,7 +642,7 @@ const _hoisted_1$l = {
|
|
|
641
642
|
type: "number"
|
|
642
643
|
}, null, 8, ["modelValue"])
|
|
643
644
|
])) : createCommentVNode("", !0),
|
|
644
|
-
|
|
645
|
+
E() ? (openBlock(), createElementBlock("div", _hoisted_11$1, [
|
|
645
646
|
unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_12, [
|
|
646
647
|
V[12] || (V[12] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Items", -1)),
|
|
647
648
|
createElementVNode("div", _hoisted_13, [
|
|
@@ -657,13 +658,13 @@ const _hoisted_1$l = {
|
|
|
657
658
|
variant: "secondary",
|
|
658
659
|
label: "Select Items",
|
|
659
660
|
icon: "chevron_right",
|
|
660
|
-
onClick:
|
|
661
|
+
onClick: S
|
|
661
662
|
})
|
|
662
663
|
]),
|
|
663
664
|
V[11] || (V[11] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which items this discount applies to. Bundle discounts require multiple items. ", -1))
|
|
664
665
|
])
|
|
665
666
|
])),
|
|
666
|
-
createVNode(_sfc_main$
|
|
667
|
+
createVNode(_sfc_main$m, {
|
|
667
668
|
visible: unref(l),
|
|
668
669
|
"initial-value": ((H = unref(n).scope) == null ? void 0 : H.objectIDs) || [],
|
|
669
670
|
onConfirm: U,
|
|
@@ -692,7 +693,7 @@ const _hoisted_1$l = {
|
|
|
692
693
|
V[13] || (V[13] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. ", -1))
|
|
693
694
|
])
|
|
694
695
|
])),
|
|
695
|
-
createVNode(_sfc_main$
|
|
696
|
+
createVNode(_sfc_main$l, {
|
|
696
697
|
visible: unref(o),
|
|
697
698
|
"initial-value": ((M = unref(n).scope) == null ? void 0 : M.objectIDs) || [],
|
|
698
699
|
onConfirm: R,
|
|
@@ -721,7 +722,7 @@ const _hoisted_1$l = {
|
|
|
721
722
|
}, 8, ["modelValue"]);
|
|
722
723
|
};
|
|
723
724
|
}
|
|
724
|
-
}), GrabEffectSheet = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
725
|
+
}), GrabEffectSheet = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-cf604dd7"]]), _hoisted_1$i = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
725
726
|
__name: "TimeRuleGroup",
|
|
726
727
|
props: {
|
|
727
728
|
modelValue: {
|
|
@@ -732,22 +733,22 @@ const _hoisted_1$l = {
|
|
|
732
733
|
},
|
|
733
734
|
emits: ["update:model-value"],
|
|
734
735
|
setup(e, { emit: m }) {
|
|
735
|
-
const { t: a } = useI18n(),
|
|
736
|
-
!
|
|
736
|
+
const { t: a } = useI18n(), u = e, d = m, s = ref(
|
|
737
|
+
!u.modelValue || !u.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(u.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
737
738
|
);
|
|
738
739
|
watch(s, async (o, n) => {
|
|
739
740
|
var r;
|
|
740
|
-
if (n == "custom" && o == "all_time" && RuleBuilder.getRules((r =
|
|
741
|
+
if (n == "custom" && o == "all_time" && RuleBuilder.getRules((r = u.modelValue) == null ? void 0 : r.rules.g_time).length > 0) {
|
|
741
742
|
const p = await prompt.confirm(
|
|
742
743
|
a("connect.template.rule.time.confirm_remove"),
|
|
743
744
|
a("connect.common.confirm"),
|
|
744
745
|
a("connect.common.confirm"),
|
|
745
746
|
a("connect.common.cancel")
|
|
746
747
|
);
|
|
747
|
-
p &&
|
|
748
|
+
p && d(
|
|
748
749
|
"update:model-value",
|
|
749
750
|
RuleBuilder.setRuleToGroup(
|
|
750
|
-
|
|
751
|
+
u.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
751
752
|
RuleBuilder.scaffoldGroup("g_time")
|
|
752
753
|
)
|
|
753
754
|
), s.value = p ? o : n;
|
|
@@ -755,7 +756,7 @@ const _hoisted_1$l = {
|
|
|
755
756
|
});
|
|
756
757
|
async function l(o) {
|
|
757
758
|
var n;
|
|
758
|
-
if (o == "custom" && RuleBuilder.getRules((n =
|
|
759
|
+
if (o == "custom" && RuleBuilder.getRules((n = u.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
|
|
759
760
|
if (!await prompt.confirm(
|
|
760
761
|
a("connect.template.rule.time.confirm_remove"),
|
|
761
762
|
a("connect.common.confirm"),
|
|
@@ -765,10 +766,10 @@ const _hoisted_1$l = {
|
|
|
765
766
|
s.value = "all_time";
|
|
766
767
|
return;
|
|
767
768
|
}
|
|
768
|
-
|
|
769
|
+
d(
|
|
769
770
|
"update:model-value",
|
|
770
771
|
RuleBuilder.setRuleToGroup(
|
|
771
|
-
|
|
772
|
+
u.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
772
773
|
RuleBuilder.scaffoldGroup("g_time")
|
|
773
774
|
)
|
|
774
775
|
);
|
|
@@ -797,13 +798,13 @@ const _hoisted_1$l = {
|
|
|
797
798
|
]),
|
|
798
799
|
_: 1
|
|
799
800
|
}, 8, ["modelValue"]),
|
|
800
|
-
unref(s) == "custom" ? (openBlock(), createBlock(_sfc_main$
|
|
801
|
+
unref(s) == "custom" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
801
802
|
key: 0,
|
|
802
803
|
class: "!mt-[0px]",
|
|
803
804
|
"include-only": "trigger",
|
|
804
805
|
"trigger-type": "SCHEDULE",
|
|
805
806
|
"model-value": ((h = e.modelValue) == null ? void 0 : h.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
806
|
-
"onUpdate:modelValue": n[2] || (n[2] = (y) =>
|
|
807
|
+
"onUpdate:modelValue": n[2] || (n[2] = (y) => d(
|
|
807
808
|
"update:model-value",
|
|
808
809
|
unref(RuleBuilder).setRuleToGroup(
|
|
809
810
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
@@ -815,7 +816,7 @@ const _hoisted_1$l = {
|
|
|
815
816
|
]);
|
|
816
817
|
};
|
|
817
818
|
}
|
|
818
|
-
}), _sfc_main$
|
|
819
|
+
}), _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
819
820
|
__name: "BirthdayInput",
|
|
820
821
|
props: {
|
|
821
822
|
modelValue: {
|
|
@@ -824,9 +825,9 @@ const _hoisted_1$l = {
|
|
|
824
825
|
},
|
|
825
826
|
emits: ["update:model-value"],
|
|
826
827
|
setup(e, { emit: m }) {
|
|
827
|
-
const { t: a } = useI18n(),
|
|
828
|
+
const { t: a } = useI18n(), u = e, d = m, s = computed(() => {
|
|
828
829
|
const { property: l, operator: o, equator: n } = RuleBuilder.simplify(
|
|
829
|
-
|
|
830
|
+
u.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
830
831
|
op: "before",
|
|
831
832
|
x: 1
|
|
832
833
|
})
|
|
@@ -845,7 +846,7 @@ const _hoisted_1$l = {
|
|
|
845
846
|
value: "_isRange-day",
|
|
846
847
|
"model-value": `${unref(s).operator}-${unref(s).equator.unit}`,
|
|
847
848
|
"onUpdate:modelValue": o[0] || (o[0] = () => {
|
|
848
|
-
|
|
849
|
+
d(
|
|
849
850
|
"update:model-value",
|
|
850
851
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
851
852
|
op: "this",
|
|
@@ -860,7 +861,7 @@ const _hoisted_1$l = {
|
|
|
860
861
|
value: "_isDay",
|
|
861
862
|
"model-value": unref(s).operator,
|
|
862
863
|
"onUpdate:modelValue": o[1] || (o[1] = () => {
|
|
863
|
-
|
|
864
|
+
d(
|
|
864
865
|
"update:model-value",
|
|
865
866
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
866
867
|
op: "after",
|
|
@@ -875,7 +876,7 @@ const _hoisted_1$l = {
|
|
|
875
876
|
label: unref(a)("connect.template.rule.birthday.days_before_label"),
|
|
876
877
|
"show-steppers": !1,
|
|
877
878
|
"model-value": unref(s).equator.x,
|
|
878
|
-
"onUpdate:modelValue": o[2] || (o[2] = (p) =>
|
|
879
|
+
"onUpdate:modelValue": o[2] || (o[2] = (p) => d(
|
|
879
880
|
"update:model-value",
|
|
880
881
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
881
882
|
op: "after",
|
|
@@ -889,7 +890,7 @@ const _hoisted_1$l = {
|
|
|
889
890
|
value: "_isRange-week",
|
|
890
891
|
"model-value": `${unref(s).operator}-${unref(s).equator.unit}`,
|
|
891
892
|
"onUpdate:modelValue": o[3] || (o[3] = () => {
|
|
892
|
-
|
|
893
|
+
d(
|
|
893
894
|
"update:model-value",
|
|
894
895
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
895
896
|
op: "this",
|
|
@@ -904,7 +905,7 @@ const _hoisted_1$l = {
|
|
|
904
905
|
value: "_isRange-month",
|
|
905
906
|
"model-value": `${unref(s).operator}-${unref(s).equator.unit}`,
|
|
906
907
|
"onUpdate:modelValue": o[4] || (o[4] = () => {
|
|
907
|
-
|
|
908
|
+
d(
|
|
908
909
|
"update:model-value",
|
|
909
910
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
910
911
|
op: "this",
|
|
@@ -917,7 +918,7 @@ const _hoisted_1$l = {
|
|
|
917
918
|
]);
|
|
918
919
|
};
|
|
919
920
|
}
|
|
920
|
-
}), _hoisted_1$h = { class: "space-y-16" }, _hoisted_2$e = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$b = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$a = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$7 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$
|
|
921
|
+
}), _hoisted_1$h = { class: "space-y-16" }, _hoisted_2$e = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$b = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$a = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$7 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
921
922
|
__name: "CampaignTriggerInput",
|
|
922
923
|
props: {
|
|
923
924
|
campaignType: {
|
|
@@ -934,9 +935,9 @@ const _hoisted_1$l = {
|
|
|
934
935
|
},
|
|
935
936
|
emits: ["update:model-value"],
|
|
936
937
|
setup(e, { emit: m }) {
|
|
937
|
-
const { t: a } = useI18n(),
|
|
938
|
-
(l) => l.value ==
|
|
939
|
-
) : TypeToTriggerOptions[
|
|
938
|
+
const { t: a } = useI18n(), u = e, d = m, s = computed(() => u.disabled ? TypeToTriggerOptions[u.campaignType].filter(
|
|
939
|
+
(l) => l.value == u.modelValue
|
|
940
|
+
) : TypeToTriggerOptions[u.campaignType]);
|
|
940
941
|
return (l, o) => {
|
|
941
942
|
const n = resolveComponent("FmCard");
|
|
942
943
|
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
@@ -944,14 +945,14 @@ const _hoisted_1$l = {
|
|
|
944
945
|
createElementVNode("div", _hoisted_3$b, [
|
|
945
946
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (r) => (openBlock(), createBlock(n, {
|
|
946
947
|
variant: "outlined",
|
|
947
|
-
disabled:
|
|
948
|
+
disabled: u.disabled,
|
|
948
949
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
949
950
|
"col-span-3": unref(s).length == 1,
|
|
950
951
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
|
|
951
952
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
952
953
|
}]),
|
|
953
954
|
onClick: () => {
|
|
954
|
-
|
|
955
|
+
u.modelValue != r.value && !u.disabled && d("update:model-value", r.value);
|
|
955
956
|
},
|
|
956
957
|
key: r.name
|
|
957
958
|
}, {
|
|
@@ -965,54 +966,6 @@ const _hoisted_1$l = {
|
|
|
965
966
|
]);
|
|
966
967
|
};
|
|
967
968
|
}
|
|
968
|
-
}), _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
969
|
-
__name: "DateInput",
|
|
970
|
-
props: {
|
|
971
|
-
label: {
|
|
972
|
-
type: String,
|
|
973
|
-
required: !1
|
|
974
|
-
},
|
|
975
|
-
modelValue: {
|
|
976
|
-
type: Object,
|
|
977
|
-
required: !1
|
|
978
|
-
}
|
|
979
|
-
},
|
|
980
|
-
emits: ["update:model-value"],
|
|
981
|
-
setup(e, { emit: m }) {
|
|
982
|
-
const a = m;
|
|
983
|
-
return (d, u) => {
|
|
984
|
-
const s = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
|
|
985
|
-
return openBlock(), createBlock(o, {
|
|
986
|
-
label: e.label,
|
|
987
|
-
"model-value": e.modelValue || "",
|
|
988
|
-
"onUpdate:modelValue": u[1] || (u[1] = (n) => a("update:model-value", n))
|
|
989
|
-
}, {
|
|
990
|
-
"trigger-button": withCtx(({ opened: n }) => [
|
|
991
|
-
createVNode(l, {
|
|
992
|
-
class: "flex items-center",
|
|
993
|
-
"prepend-icon": "calendar_month",
|
|
994
|
-
"icon-outlined": !n
|
|
995
|
-
}, {
|
|
996
|
-
append: withCtx(() => [
|
|
997
|
-
e.modelValue ? (openBlock(), createBlock(s, {
|
|
998
|
-
key: 0,
|
|
999
|
-
variant: "tertiary",
|
|
1000
|
-
icon: "clear",
|
|
1001
|
-
onClick: u[0] || (u[0] = (r) => (r.stopPropagation(), a("update:model-value", null)))
|
|
1002
|
-
})) : createCommentVNode("", !0)
|
|
1003
|
-
]),
|
|
1004
|
-
default: withCtx(() => [
|
|
1005
|
-
createElementVNode("div", {
|
|
1006
|
-
class: normalizeClass(["fm-typo-en-body-lg-400", { "text-fm-color-typo-secondary": !e.modelValue }])
|
|
1007
|
-
}, toDisplayString(e.modelValue ? unref(hooks)(e.modelValue).format("DD MMM YYYY") : "DD MM YYYY"), 3)
|
|
1008
|
-
]),
|
|
1009
|
-
_: 1
|
|
1010
|
-
}, 8, ["icon-outlined"])
|
|
1011
|
-
]),
|
|
1012
|
-
_: 1
|
|
1013
|
-
}, 8, ["label", "model-value"]);
|
|
1014
|
-
};
|
|
1015
|
-
}
|
|
1016
969
|
}), _hoisted_1$g = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$d = { class: "flex-1 xs:w-full" }, _hoisted_3$a = { class: "mt-5 xs:hidden" }, _hoisted_4$9 = { class: "flex-1 xs:w-full" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1017
970
|
__name: "DateRangeInput",
|
|
1018
971
|
props: {
|
|
@@ -1023,17 +976,17 @@ const _hoisted_1$l = {
|
|
|
1023
976
|
},
|
|
1024
977
|
emits: ["update:model-value"],
|
|
1025
978
|
setup(e, { emit: m }) {
|
|
1026
|
-
const { t: a } = useI18n(),
|
|
1027
|
-
return (
|
|
979
|
+
const { t: a } = useI18n(), u = m;
|
|
980
|
+
return (d, s) => {
|
|
1028
981
|
var l, o;
|
|
1029
982
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
1030
983
|
createElementVNode("div", _hoisted_2$d, [
|
|
1031
|
-
createVNode(_sfc_main$
|
|
984
|
+
createVNode(_sfc_main$p, {
|
|
1032
985
|
"model-value": ((l = e.modelValue) == null ? void 0 : l.startDate) ?? null,
|
|
1033
986
|
label: unref(a)("connect.common.startDate"),
|
|
1034
987
|
"onUpdate:modelValue": s[0] || (s[0] = (n) => {
|
|
1035
988
|
var r;
|
|
1036
|
-
return
|
|
989
|
+
return u("update:model-value", {
|
|
1037
990
|
startDate: n,
|
|
1038
991
|
endDate: ((r = e.modelValue) == null ? void 0 : r.endDate) ?? null
|
|
1039
992
|
});
|
|
@@ -1042,12 +995,12 @@ const _hoisted_1$l = {
|
|
|
1042
995
|
]),
|
|
1043
996
|
createElementVNode("div", _hoisted_3$a, toDisplayString(unref(a)("connect.common.to")), 1),
|
|
1044
997
|
createElementVNode("div", _hoisted_4$9, [
|
|
1045
|
-
createVNode(_sfc_main$
|
|
998
|
+
createVNode(_sfc_main$p, {
|
|
1046
999
|
"model-value": ((o = e.modelValue) == null ? void 0 : o.endDate) ?? null,
|
|
1047
1000
|
label: unref(a)("connect.common.endDate"),
|
|
1048
1001
|
"onUpdate:modelValue": s[1] || (s[1] = (n) => {
|
|
1049
1002
|
var r;
|
|
1050
|
-
return
|
|
1003
|
+
return u("update:model-value", {
|
|
1051
1004
|
startDate: ((r = e.modelValue) == null ? void 0 : r.startDate) ?? null,
|
|
1052
1005
|
endDate: n
|
|
1053
1006
|
});
|
|
@@ -1076,11 +1029,11 @@ const _hoisted_1$l = {
|
|
|
1076
1029
|
},
|
|
1077
1030
|
emits: ["update:model-value"],
|
|
1078
1031
|
setup(e, { emit: m }) {
|
|
1079
|
-
const { t: a } = useI18n(),
|
|
1032
|
+
const { t: a } = useI18n(), u = e, d = m, s = useCoreStore(), l = computed(
|
|
1080
1033
|
() => CountryTimezone[s.currentCountry.value || "MY"]
|
|
1081
1034
|
);
|
|
1082
1035
|
function o() {
|
|
1083
|
-
const i = RuleBuilder.getRules(
|
|
1036
|
+
const i = RuleBuilder.getRules(u.modelValue);
|
|
1084
1037
|
return i.length == 0 ? "fixed" : i.some(
|
|
1085
1038
|
(c) => isRuleEntry(c) && RuleBuilder.simplify(c).operator == "_rrule"
|
|
1086
1039
|
) ? "repeating" : "fixed";
|
|
@@ -1089,7 +1042,7 @@ const _hoisted_1$l = {
|
|
|
1089
1042
|
{ label: a("connect.template.rule.schedule.fixed"), value: "fixed" },
|
|
1090
1043
|
{ label: a("connect.template.rule.schedule.repeating"), value: "repeating" }
|
|
1091
1044
|
]), y = computed(() => {
|
|
1092
|
-
const i = RuleBuilder.getRules(
|
|
1045
|
+
const i = RuleBuilder.getRules(u.modelValue), c = i.find(
|
|
1093
1046
|
(b) => isRuleEntry(b) && RuleBuilder.simplify(b).property == "trigger.date"
|
|
1094
1047
|
), k = i.find(
|
|
1095
1048
|
(b) => isRuleEntry(b) && RuleBuilder.simplify(b).property == "trigger.time"
|
|
@@ -1100,14 +1053,14 @@ const _hoisted_1$l = {
|
|
|
1100
1053
|
};
|
|
1101
1054
|
}), C = computed(
|
|
1102
1055
|
() => calculateNextScheduleAt(
|
|
1103
|
-
|
|
1056
|
+
u.modelValue,
|
|
1104
1057
|
/* @__PURE__ */ new Date(),
|
|
1105
|
-
|
|
1106
|
-
|
|
1058
|
+
u.startDate ? new Date(u.startDate) : /* @__PURE__ */ new Date(),
|
|
1059
|
+
u.endDate ? new Date(u.endDate) : void 0
|
|
1107
1060
|
)
|
|
1108
1061
|
);
|
|
1109
1062
|
function x(i, c) {
|
|
1110
|
-
|
|
1063
|
+
d(
|
|
1111
1064
|
"update:model-value",
|
|
1112
1065
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
1113
1066
|
RuleBuilder.constructEntry("trigger.date", "_rrule", i),
|
|
@@ -1116,7 +1069,7 @@ const _hoisted_1$l = {
|
|
|
1116
1069
|
);
|
|
1117
1070
|
}
|
|
1118
1071
|
watch(
|
|
1119
|
-
() =>
|
|
1072
|
+
() => u.startDate,
|
|
1120
1073
|
(i, c) => {
|
|
1121
1074
|
if (!i || i === c || n.value !== "repeating" || !y.value.date) return;
|
|
1122
1075
|
const k = RRule.fromString(y.value.date), b = new RRule({
|
|
@@ -1128,7 +1081,7 @@ const _hoisted_1$l = {
|
|
|
1128
1081
|
);
|
|
1129
1082
|
function v(i) {
|
|
1130
1083
|
const c = i.value, k = getRruleAnchorDate({
|
|
1131
|
-
startDate:
|
|
1084
|
+
startDate: u.startDate ? new Date(u.startDate) : void 0
|
|
1132
1085
|
}), b = c == "fixed" ? [
|
|
1133
1086
|
RuleBuilder.constructEntry(
|
|
1134
1087
|
"trigger.date",
|
|
@@ -1152,7 +1105,7 @@ const _hoisted_1$l = {
|
|
|
1152
1105
|
),
|
|
1153
1106
|
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
1154
1107
|
];
|
|
1155
|
-
|
|
1108
|
+
d(
|
|
1156
1109
|
"update:model-value",
|
|
1157
1110
|
RuleBuilder.setRuleToGroup(
|
|
1158
1111
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
@@ -1161,7 +1114,7 @@ const _hoisted_1$l = {
|
|
|
1161
1114
|
), n.value = c, p.value = !1;
|
|
1162
1115
|
}
|
|
1163
1116
|
function f(i) {
|
|
1164
|
-
n.value == "fixed" ?
|
|
1117
|
+
n.value == "fixed" ? d(
|
|
1165
1118
|
"update:model-value",
|
|
1166
1119
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
1167
1120
|
RuleBuilder.constructEntry(
|
|
@@ -1178,7 +1131,7 @@ const _hoisted_1$l = {
|
|
|
1178
1131
|
) : x(i.date, i.time), p.value = !1;
|
|
1179
1132
|
}
|
|
1180
1133
|
return (i, c) => {
|
|
1181
|
-
const k = resolveComponent("FmButtonGroup"), b = resolveComponent("FmTimePicker"),
|
|
1134
|
+
const k = resolveComponent("FmButtonGroup"), b = resolveComponent("FmTimePicker"), E = resolveComponent("FmIcon"), N = resolveComponent("FmTooltip"), B = resolveComponent("FmField"), w = resolveComponent("FmCard"), S = resolveComponent("FmPopover"), F = resolveComponent("FmDatePicker"), U = resolveComponent("FmHelperText");
|
|
1182
1135
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
1183
1136
|
createVNode(k, {
|
|
1184
1137
|
items: unref(h),
|
|
@@ -1204,7 +1157,7 @@ const _hoisted_1$l = {
|
|
|
1204
1157
|
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(y).date).options)
|
|
1205
1158
|
}, {
|
|
1206
1159
|
default: withCtx(() => [
|
|
1207
|
-
createVNode(
|
|
1160
|
+
createVNode(E, {
|
|
1208
1161
|
name: "info",
|
|
1209
1162
|
size: "sm",
|
|
1210
1163
|
outline: !0
|
|
@@ -1213,7 +1166,7 @@ const _hoisted_1$l = {
|
|
|
1213
1166
|
_: 1
|
|
1214
1167
|
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
1215
1168
|
]),
|
|
1216
|
-
createVNode(
|
|
1169
|
+
createVNode(S, {
|
|
1217
1170
|
"show-popover": unref(r),
|
|
1218
1171
|
onPopoverChanged: c[3] || (c[3] = (R) => r.value = R)
|
|
1219
1172
|
}, {
|
|
@@ -1277,7 +1230,7 @@ const _hoisted_1$l = {
|
|
|
1277
1230
|
},
|
|
1278
1231
|
emits: ["update:model-value"],
|
|
1279
1232
|
setup(e, { emit: m }) {
|
|
1280
|
-
const { t: a } = useI18n(),
|
|
1233
|
+
const { t: a } = useI18n(), u = e, d = m, s = computed(
|
|
1281
1234
|
() => [
|
|
1282
1235
|
{
|
|
1283
1236
|
label: a("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
|
|
@@ -1306,7 +1259,7 @@ const _hoisted_1$l = {
|
|
|
1306
1259
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
1307
1260
|
}]),
|
|
1308
1261
|
onClick: () => {
|
|
1309
|
-
|
|
1262
|
+
u.modelValue != r.value && d("update:model-value", r.value);
|
|
1310
1263
|
},
|
|
1311
1264
|
key: r.value
|
|
1312
1265
|
}, {
|
|
@@ -1327,9 +1280,9 @@ const _hoisted_1$l = {
|
|
|
1327
1280
|
__name: "EditRewardPoolSheet",
|
|
1328
1281
|
emits: ["update:model-value"],
|
|
1329
1282
|
setup(e, { expose: m, emit: a }) {
|
|
1330
|
-
const
|
|
1283
|
+
const u = useMembershipStore(), { minor: d } = useLoading, s = ref(!1), l = ref(), o = ref(), n = ref(0), r = computed(() => {
|
|
1331
1284
|
var v;
|
|
1332
|
-
return ((v =
|
|
1285
|
+
return ((v = u.loyaltyRewards.items.find(
|
|
1333
1286
|
(f) => {
|
|
1334
1287
|
var i;
|
|
1335
1288
|
return f.value === ((i = l.value) == null ? void 0 : i.collectible);
|
|
@@ -1345,7 +1298,7 @@ const _hoisted_1$l = {
|
|
|
1345
1298
|
const y = a;
|
|
1346
1299
|
async function C() {
|
|
1347
1300
|
const x = r.value.safeParse(l.value);
|
|
1348
|
-
x.success && (await
|
|
1301
|
+
x.success && (await d(
|
|
1349
1302
|
async () => {
|
|
1350
1303
|
x.data.type === "VOUCHER" && o.value && (x.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1351
1304
|
x.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, o.value),
|
|
@@ -1390,7 +1343,7 @@ const _hoisted_1$l = {
|
|
|
1390
1343
|
])
|
|
1391
1344
|
]),
|
|
1392
1345
|
default: withCtx(() => {
|
|
1393
|
-
var b,
|
|
1346
|
+
var b, E, N;
|
|
1394
1347
|
return [
|
|
1395
1348
|
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
1396
1349
|
createVNode(f, {
|
|
@@ -1421,7 +1374,7 @@ const _hoisted_1$l = {
|
|
|
1421
1374
|
},
|
|
1422
1375
|
weight: 1
|
|
1423
1376
|
} : l.value = {
|
|
1424
|
-
collectible: unref(
|
|
1377
|
+
collectible: unref(u).loyaltyRewards.raw[0]._id,
|
|
1425
1378
|
type: "LOYALTY",
|
|
1426
1379
|
earningOption: {
|
|
1427
1380
|
amount: 1,
|
|
@@ -1438,7 +1391,7 @@ const _hoisted_1$l = {
|
|
|
1438
1391
|
key: 0,
|
|
1439
1392
|
label: "Loyalty type",
|
|
1440
1393
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "collectible", [unref(l).type])],
|
|
1441
|
-
items: unref(
|
|
1394
|
+
items: unref(u).loyaltyRewards.items,
|
|
1442
1395
|
"model-value": unref(l).collectible,
|
|
1443
1396
|
"onUpdate:modelValue": v[1] || (v[1] = (B) => unref(l).collectible = B)
|
|
1444
1397
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
@@ -1452,7 +1405,7 @@ const _hoisted_1$l = {
|
|
|
1452
1405
|
})
|
|
1453
1406
|
}, null, 8, ["rules", "model-value"]),
|
|
1454
1407
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1455
|
-
((b = unref(
|
|
1408
|
+
((b = unref(u).loyaltyRewards.items.find(
|
|
1456
1409
|
(B) => {
|
|
1457
1410
|
var w;
|
|
1458
1411
|
return B.value === ((w = unref(l)) == null ? void 0 : w.collectible);
|
|
@@ -1477,12 +1430,12 @@ const _hoisted_1$l = {
|
|
|
1477
1430
|
v[12] || (v[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
1478
1431
|
createVNode(_sfc_main$s, {
|
|
1479
1432
|
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
1480
|
-
"for-credit": unref(l).type === "LOYALTY" && ((
|
|
1433
|
+
"for-credit": unref(l).type === "LOYALTY" && ((E = unref(u).loyaltyRewards.items.find(
|
|
1481
1434
|
(B) => {
|
|
1482
1435
|
var w;
|
|
1483
1436
|
return B.value === ((w = unref(l)) == null ? void 0 : w.collectible);
|
|
1484
1437
|
}
|
|
1485
|
-
)) == null ? void 0 :
|
|
1438
|
+
)) == null ? void 0 : E.raw.type) === "CREDIT",
|
|
1486
1439
|
class: "!gap-24",
|
|
1487
1440
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "validityOption", [unref(l).type])],
|
|
1488
1441
|
"model-value": unref(l).validityOption,
|
|
@@ -1530,17 +1483,17 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1530
1483
|
},
|
|
1531
1484
|
emits: ["update:model-value"],
|
|
1532
1485
|
setup(e, { emit: m }) {
|
|
1533
|
-
const a = e,
|
|
1486
|
+
const a = e, u = m, d = useMembershipStore(), { t: s } = useI18n(), l = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => a.modelValue ?? []), n = computed(() => {
|
|
1534
1487
|
const v = l.safeParse(o.value);
|
|
1535
1488
|
return v.success ? [] : v.error.errors;
|
|
1536
1489
|
}), r = ref();
|
|
1537
1490
|
function p(v, f) {
|
|
1538
1491
|
var c;
|
|
1539
1492
|
const i = [...o.value];
|
|
1540
|
-
i[f] = v, (c = r.value) == null || c.showSheet(!1),
|
|
1493
|
+
i[f] = v, (c = r.value) == null || c.showSheet(!1), u("update:model-value", i);
|
|
1541
1494
|
}
|
|
1542
1495
|
function h(v) {
|
|
1543
|
-
const f = v.type == "VOUCHER" ? v.collectibleConfig :
|
|
1496
|
+
const f = v.type == "VOUCHER" ? v.collectibleConfig : d.collectibles.find(
|
|
1544
1497
|
(k) => k._id.toString() == v.collectible
|
|
1545
1498
|
), i = CollectionUtils.formattedType((f == null ? void 0 : f.name) || ""), c = v.weight;
|
|
1546
1499
|
return {
|
|
@@ -1555,7 +1508,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1555
1508
|
}
|
|
1556
1509
|
function C(v) {
|
|
1557
1510
|
const f = [...o.value];
|
|
1558
|
-
f.splice(v, 1),
|
|
1511
|
+
f.splice(v, 1), u("update:model-value", f);
|
|
1559
1512
|
}
|
|
1560
1513
|
function x() {
|
|
1561
1514
|
var v;
|
|
@@ -1579,11 +1532,11 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1579
1532
|
variant: "plain",
|
|
1580
1533
|
icon: "add"
|
|
1581
1534
|
}, null, 8, ["label"]),
|
|
1582
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (b,
|
|
1583
|
-
key:
|
|
1535
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (b, E) => (openBlock(), createBlock(c, {
|
|
1536
|
+
key: E,
|
|
1584
1537
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1585
1538
|
variant: "outlined",
|
|
1586
|
-
onClick: (N) => y(
|
|
1539
|
+
onClick: (N) => y(E)
|
|
1587
1540
|
}, {
|
|
1588
1541
|
default: withCtx(() => {
|
|
1589
1542
|
var N;
|
|
@@ -1595,7 +1548,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1595
1548
|
createVNode(i, {
|
|
1596
1549
|
icon: "delete",
|
|
1597
1550
|
variant: "tertiary",
|
|
1598
|
-
onClick: (B) => (B.stopPropagation(), C(
|
|
1551
|
+
onClick: (B) => (B.stopPropagation(), C(E))
|
|
1599
1552
|
}, null, 8, ["onClick"])
|
|
1600
1553
|
];
|
|
1601
1554
|
}),
|
|
@@ -1626,7 +1579,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1626
1579
|
},
|
|
1627
1580
|
emits: ["update:model-value"],
|
|
1628
1581
|
setup(e, { emit: m }) {
|
|
1629
|
-
const { t: a } = useI18n(),
|
|
1582
|
+
const { t: a } = useI18n(), u = e, d = m, s = computed(() => [
|
|
1630
1583
|
{
|
|
1631
1584
|
label: a("connect.template.promotion_game.rock_paper_scissors.label"),
|
|
1632
1585
|
description: a("connect.template.promotion_game.rock_paper_scissors.description"),
|
|
@@ -1640,7 +1593,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1640
1593
|
createVNode(n, {
|
|
1641
1594
|
label: unref(a)("connect.template.promotion_game.enable"),
|
|
1642
1595
|
"model-value": !!((h = e.modelValue) != null && h.gameType),
|
|
1643
|
-
"onUpdate:modelValue": o[0] || (o[0] = (x) => x ?
|
|
1596
|
+
"onUpdate:modelValue": o[0] || (o[0] = (x) => x ? d("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : d("update:model-value", null))
|
|
1644
1597
|
}, null, 8, ["label", "model-value"]),
|
|
1645
1598
|
((y = e.modelValue) == null ? void 0 : y.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
1646
1599
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (x) => {
|
|
@@ -1654,7 +1607,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1654
1607
|
}]),
|
|
1655
1608
|
onClick: () => {
|
|
1656
1609
|
var i;
|
|
1657
|
-
((i =
|
|
1610
|
+
((i = u.modelValue) == null ? void 0 : i.gameType) != x.value && d("update:model-value", { gameType: x.value });
|
|
1658
1611
|
},
|
|
1659
1612
|
key: x.value
|
|
1660
1613
|
}, {
|
|
@@ -1690,7 +1643,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1690
1643
|
},
|
|
1691
1644
|
emits: ["update:model-value"],
|
|
1692
1645
|
setup(e, { emit: m }) {
|
|
1693
|
-
const { t: a } = useI18n(),
|
|
1646
|
+
const { t: a } = useI18n(), u = e, d = m, s = ref(u.modelValue ?? {}), l = ref(
|
|
1694
1647
|
(() => {
|
|
1695
1648
|
const h = {};
|
|
1696
1649
|
return s.value.workingHour && Object.keys(s.value.workingHour).forEach((y) => {
|
|
@@ -1722,7 +1675,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1722
1675
|
);
|
|
1723
1676
|
s.value.workingHour = Object.keys(h).length > 0 ? h : void 0;
|
|
1724
1677
|
};
|
|
1725
|
-
return watch(s, () =>
|
|
1678
|
+
return watch(s, () => d("update:model-value", s.value), { deep: !0 }), watch(l, p, { deep: !0 }), (h, y) => {
|
|
1726
1679
|
const C = resolveComponent("FmSelect"), x = resolveComponent("FmStepperField"), v = resolveComponent("FmCheckbox"), f = resolveComponent("FmTimePicker"), i = resolveComponent("FmButton");
|
|
1727
1680
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1728
1681
|
createElementVNode("div", _hoisted_2$7, [
|
|
@@ -1796,26 +1749,26 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1796
1749
|
}, [
|
|
1797
1750
|
createVNode(f, {
|
|
1798
1751
|
"model-value": k.startTime || "",
|
|
1799
|
-
"onUpdate:modelValue": (
|
|
1800
|
-
unref(l)[c.key] && unref(l)[c.key][b] && (unref(l)[c.key][b].startTime =
|
|
1752
|
+
"onUpdate:modelValue": (E) => {
|
|
1753
|
+
unref(l)[c.key] && unref(l)[c.key][b] && (unref(l)[c.key][b].startTime = E || "", p());
|
|
1801
1754
|
}
|
|
1802
1755
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
1803
1756
|
y[3] || (y[3] = createElementVNode("span", null, "to", -1)),
|
|
1804
1757
|
createVNode(f, {
|
|
1805
1758
|
"model-value": k.endTime || "",
|
|
1806
|
-
"onUpdate:modelValue": (
|
|
1807
|
-
unref(l)[c.key] && unref(l)[c.key][b] && (unref(l)[c.key][b].endTime =
|
|
1759
|
+
"onUpdate:modelValue": (E) => {
|
|
1760
|
+
unref(l)[c.key] && unref(l)[c.key][b] && (unref(l)[c.key][b].endTime = E || "", p());
|
|
1808
1761
|
}
|
|
1809
1762
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
1810
1763
|
createVNode(i, {
|
|
1811
1764
|
variant: "tertiary",
|
|
1812
1765
|
size: "sm",
|
|
1813
|
-
onClick: (
|
|
1766
|
+
onClick: (E) => r(c.key, b),
|
|
1814
1767
|
icon: "close"
|
|
1815
1768
|
}, null, 8, ["onClick"]),
|
|
1816
1769
|
b === 0 ? (openBlock(), createBlock(i, {
|
|
1817
1770
|
key: 0,
|
|
1818
|
-
onClick: (
|
|
1771
|
+
onClick: (E) => n(c.key),
|
|
1819
1772
|
icon: "add",
|
|
1820
1773
|
variant: "plain"
|
|
1821
1774
|
}, null, 8, ["onClick"])) : createCommentVNode("", !0)
|
|
@@ -1840,8 +1793,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1840
1793
|
},
|
|
1841
1794
|
emits: ["update:model-value"],
|
|
1842
1795
|
setup(e, { emit: m }) {
|
|
1843
|
-
const { t: a } = useI18n(),
|
|
1844
|
-
return watch(s, () =>
|
|
1796
|
+
const { t: a } = useI18n(), u = e, d = m, s = ref(u.modelValue ?? {});
|
|
1797
|
+
return watch(s, () => d("update:model-value", s.value)), (l, o) => {
|
|
1845
1798
|
const n = resolveComponent("FmStepperField");
|
|
1846
1799
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
1847
1800
|
createElementVNode("div", _hoisted_2$6, [
|
|
@@ -1890,7 +1843,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1890
1843
|
},
|
|
1891
1844
|
emits: ["update:model-value"],
|
|
1892
1845
|
setup(e, { emit: m }) {
|
|
1893
|
-
const { t: a } = useI18n(),
|
|
1846
|
+
const { t: a } = useI18n(), u = e, d = m, s = computed(() => [
|
|
1894
1847
|
{
|
|
1895
1848
|
label: a("connect.campaign.mission.typeOption.STAMP.label"),
|
|
1896
1849
|
description: a("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -1915,7 +1868,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1915
1868
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
1916
1869
|
}]),
|
|
1917
1870
|
onClick: () => {
|
|
1918
|
-
|
|
1871
|
+
u.modelValue != r.value && d("update:model-value", r.value);
|
|
1919
1872
|
},
|
|
1920
1873
|
key: r.value
|
|
1921
1874
|
}, {
|
|
@@ -1945,14 +1898,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1945
1898
|
emits: ["update:model-value"],
|
|
1946
1899
|
setup(e, { emit: m }) {
|
|
1947
1900
|
const a = m;
|
|
1948
|
-
return (
|
|
1901
|
+
return (u, d) => {
|
|
1949
1902
|
const s = resolveComponent("FmStepperField");
|
|
1950
1903
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1951
|
-
|
|
1904
|
+
d[1] || (d[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)),
|
|
1952
1905
|
createVNode(s, {
|
|
1953
1906
|
label: "Maximum to collect",
|
|
1954
1907
|
"model-value": e.modelValue || null,
|
|
1955
|
-
"onUpdate:modelValue":
|
|
1908
|
+
"onUpdate:modelValue": d[0] || (d[0] = (l) => a("update:model-value", l)),
|
|
1956
1909
|
"helper-text": e.helperText || "Set the threshold required for reward eligibility",
|
|
1957
1910
|
"helper-state": e.helperState || "none"
|
|
1958
1911
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
@@ -1969,9 +1922,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1969
1922
|
},
|
|
1970
1923
|
emits: ["update:model-value"],
|
|
1971
1924
|
setup(e, { expose: m, emit: a }) {
|
|
1972
|
-
const
|
|
1925
|
+
const u = e, d = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), o = ref(), n = ref(), r = ref(0), p = computed(() => {
|
|
1973
1926
|
var i;
|
|
1974
|
-
return ((i =
|
|
1927
|
+
return ((i = d.loyaltyRewards.items.find(
|
|
1975
1928
|
(c) => {
|
|
1976
1929
|
var k;
|
|
1977
1930
|
return c.value === ((k = o.value) == null ? void 0 : k.collectible);
|
|
@@ -2004,7 +1957,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2004
1957
|
return m({
|
|
2005
1958
|
showSheet: y
|
|
2006
1959
|
}), (f, i) => {
|
|
2007
|
-
const c = resolveComponent("FmStepperField"), k = resolveComponent("FmSelect"), b = resolveComponent("FmForm"),
|
|
1960
|
+
const c = resolveComponent("FmStepperField"), k = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), E = resolveComponent("FmButton"), N = resolveComponent("FmSideSheet");
|
|
2008
1961
|
return openBlock(), createBlock(N, {
|
|
2009
1962
|
"max-width": 560,
|
|
2010
1963
|
modelValue: unref(l),
|
|
@@ -2017,7 +1970,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2017
1970
|
}, {
|
|
2018
1971
|
"side-sheet-footer": withCtx(() => [
|
|
2019
1972
|
createElementVNode("div", _hoisted_1$6, [
|
|
2020
|
-
createVNode(
|
|
1973
|
+
createVNode(E, {
|
|
2021
1974
|
variant: "primary",
|
|
2022
1975
|
type: "button",
|
|
2023
1976
|
label: "Confirm",
|
|
@@ -2027,7 +1980,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2027
1980
|
return (B = unref(v)) == null ? void 0 : B.validateInputs();
|
|
2028
1981
|
})
|
|
2029
1982
|
}, null, 8, ["disabled"]),
|
|
2030
|
-
createVNode(
|
|
1983
|
+
createVNode(E, {
|
|
2031
1984
|
variant: "secondary",
|
|
2032
1985
|
type: "button",
|
|
2033
1986
|
label: "Cancel",
|
|
@@ -2053,15 +2006,15 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2053
2006
|
rules: [
|
|
2054
2007
|
unref(ZodHelper).toRule(
|
|
2055
2008
|
unref(z).number().min(1).max(
|
|
2056
|
-
|
|
2057
|
-
`Number cannot be more than ${
|
|
2009
|
+
u.maxThreshold,
|
|
2010
|
+
`Number cannot be more than ${u.maxThreshold}`
|
|
2058
2011
|
)
|
|
2059
2012
|
)
|
|
2060
2013
|
],
|
|
2061
2014
|
"model-value": unref(o).threshold,
|
|
2062
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
2015
|
+
"onUpdate:modelValue": i[0] || (i[0] = (S) => o.value = {
|
|
2063
2016
|
...unref(o),
|
|
2064
|
-
threshold:
|
|
2017
|
+
threshold: S
|
|
2065
2018
|
})
|
|
2066
2019
|
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
2067
2020
|
createVNode(k, {
|
|
@@ -2071,9 +2024,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2071
2024
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
2072
2025
|
],
|
|
2073
2026
|
"model-value": unref(o).type,
|
|
2074
|
-
"onUpdate:modelValue": i[1] || (i[1] = (
|
|
2027
|
+
"onUpdate:modelValue": i[1] || (i[1] = (S) => {
|
|
2075
2028
|
var F, U;
|
|
2076
|
-
|
|
2029
|
+
S === "VOUCHER" ? o.value = {
|
|
2077
2030
|
collectible: null,
|
|
2078
2031
|
type: "VOUCHER",
|
|
2079
2032
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -2088,7 +2041,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2088
2041
|
},
|
|
2089
2042
|
threshold: (F = unref(o)) == null ? void 0 : F.threshold
|
|
2090
2043
|
} : o.value = {
|
|
2091
|
-
collectible: unref(
|
|
2044
|
+
collectible: unref(d).loyaltyRewards.raw[0]._id,
|
|
2092
2045
|
type: "LOYALTY",
|
|
2093
2046
|
earningOption: {
|
|
2094
2047
|
amount: 1,
|
|
@@ -2105,9 +2058,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2105
2058
|
key: 1,
|
|
2106
2059
|
label: "Loyalty type",
|
|
2107
2060
|
rules: [unref(ZodHelper).ruleAtPath(unref(p), "collectible", [unref(o).type])],
|
|
2108
|
-
items: unref(
|
|
2061
|
+
items: unref(d).loyaltyRewards.items,
|
|
2109
2062
|
"model-value": unref(o).collectible,
|
|
2110
|
-
"onUpdate:modelValue": i[2] || (i[2] = (
|
|
2063
|
+
"onUpdate:modelValue": i[2] || (i[2] = (S) => unref(o).collectible = S)
|
|
2111
2064
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
2112
2065
|
unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2113
2066
|
i[12] || (i[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
@@ -2118,25 +2071,25 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2118
2071
|
"error-text": unref(ZodHelper).helperText(unref(h), "earningOption"),
|
|
2119
2072
|
"fixed-type": !0,
|
|
2120
2073
|
"model-value": unref(o).earningOption,
|
|
2121
|
-
"onUpdate:modelValue": i[3] || (i[3] = (
|
|
2074
|
+
"onUpdate:modelValue": i[3] || (i[3] = (S) => o.value = {
|
|
2122
2075
|
...unref(o),
|
|
2123
|
-
earningOption:
|
|
2076
|
+
earningOption: S
|
|
2124
2077
|
})
|
|
2125
2078
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
2126
2079
|
createVNode(_sfc_main$s, {
|
|
2127
2080
|
class: "!gap-24",
|
|
2128
2081
|
type: unref(o).type === "LOYALTY" ? "custom" : "range",
|
|
2129
|
-
"for-credit": unref(o).type === "LOYALTY" && ((B = unref(
|
|
2130
|
-
(
|
|
2082
|
+
"for-credit": unref(o).type === "LOYALTY" && ((B = unref(d).loyaltyRewards.items.find(
|
|
2083
|
+
(S) => {
|
|
2131
2084
|
var F;
|
|
2132
|
-
return
|
|
2085
|
+
return S.value === ((F = unref(o)) == null ? void 0 : F.collectible);
|
|
2133
2086
|
}
|
|
2134
2087
|
)) == null ? void 0 : B.raw.type) === "CREDIT",
|
|
2135
2088
|
rules: [unref(ZodHelper).ruleAtPath(unref(p), "validityOption", [unref(o).type])],
|
|
2136
2089
|
"model-value": unref(o).validityOption,
|
|
2137
|
-
"onUpdate:modelValue": i[4] || (i[4] = (
|
|
2090
|
+
"onUpdate:modelValue": i[4] || (i[4] = (S) => o.value = {
|
|
2138
2091
|
...unref(o),
|
|
2139
|
-
validityOption:
|
|
2092
|
+
validityOption: S
|
|
2140
2093
|
})
|
|
2141
2094
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
2142
2095
|
], 64)) : createCommentVNode("", !0),
|
|
@@ -2144,11 +2097,11 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2144
2097
|
key: 3,
|
|
2145
2098
|
"reward-image": unref(n),
|
|
2146
2099
|
"model-value": ((w = unref(o)) == null ? void 0 : w.collectibleConfig) ?? void 0,
|
|
2147
|
-
"onUpdate:modelValue": i[5] || (i[5] = (
|
|
2100
|
+
"onUpdate:modelValue": i[5] || (i[5] = (S) => o.value = {
|
|
2148
2101
|
...unref(o),
|
|
2149
|
-
collectibleConfig:
|
|
2102
|
+
collectibleConfig: S
|
|
2150
2103
|
}),
|
|
2151
|
-
"onUpdate:rewardImage": i[6] || (i[6] = (
|
|
2104
|
+
"onUpdate:rewardImage": i[6] || (i[6] = (S) => n.value = S)
|
|
2152
2105
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
2153
2106
|
createVNode(JsonViewer, { json: unref(h) }, null, 8, ["json"])
|
|
2154
2107
|
];
|
|
@@ -2184,19 +2137,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2184
2137
|
}
|
|
2185
2138
|
},
|
|
2186
2139
|
setup(e) {
|
|
2187
|
-
const m = e, { maxRange: a, currentRange:
|
|
2188
|
-
() => Math.min(
|
|
2140
|
+
const m = e, { maxRange: a, currentRange: u, markers: d } = toRefs(m), s = computed(
|
|
2141
|
+
() => Math.min(u.value / a.value * 100, 100)
|
|
2189
2142
|
), l = (o) => o / a.value * 100;
|
|
2190
2143
|
return (o, n) => {
|
|
2191
2144
|
const r = resolveComponent("FmIcon");
|
|
2192
2145
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
2193
2146
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (p) => (openBlock(), createBlock(r, {
|
|
2194
2147
|
class: normalizeClass(
|
|
2195
|
-
unref(
|
|
2148
|
+
unref(u) >= p ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
2196
2149
|
),
|
|
2197
|
-
outline: unref(
|
|
2150
|
+
outline: unref(u) < p,
|
|
2198
2151
|
key: p,
|
|
2199
|
-
name: unref(
|
|
2152
|
+
name: unref(d).some((h) => h === p) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
2200
2153
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
2201
2154
|
])) : (openBlock(), createElementBlock("div", {
|
|
2202
2155
|
key: 1,
|
|
@@ -2206,7 +2159,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2206
2159
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
2207
2160
|
style: normalizeStyle({ width: unref(s) + "%" })
|
|
2208
2161
|
}, null, 4),
|
|
2209
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2162
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(d), (p, h) => (openBlock(), createElementBlock("div", {
|
|
2210
2163
|
key: h,
|
|
2211
2164
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
2212
2165
|
style: normalizeStyle({ left: l(p) + "%" })
|
|
@@ -2223,14 +2176,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2223
2176
|
}
|
|
2224
2177
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
2225
2178
|
function changeKeysFactory(e) {
|
|
2226
|
-
return function m(a,
|
|
2227
|
-
if (
|
|
2179
|
+
return function m(a, u = 1, d) {
|
|
2180
|
+
if (u === 0 || !isObject(a))
|
|
2228
2181
|
return a;
|
|
2229
2182
|
if (Array.isArray(a))
|
|
2230
|
-
return a.map((l) => m(l,
|
|
2183
|
+
return a.map((l) => m(l, u - 1, d));
|
|
2231
2184
|
const s = Object.create(Object.getPrototypeOf(a));
|
|
2232
2185
|
return Object.keys(a).forEach((l) => {
|
|
2233
|
-
const o = a[l], n = e(l,
|
|
2186
|
+
const o = a[l], n = e(l, d), r = m(o, u - 1, d);
|
|
2234
2187
|
s[n] = r;
|
|
2235
2188
|
}), s;
|
|
2236
2189
|
};
|
|
@@ -2249,8 +2202,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2249
2202
|
},
|
|
2250
2203
|
emits: ["update:model-value"],
|
|
2251
2204
|
setup(e, { emit: m }) {
|
|
2252
|
-
const { t: a } = useI18n(),
|
|
2253
|
-
() =>
|
|
2205
|
+
const { t: a } = useI18n(), u = e, d = m, s = useMembershipStore(), l = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
|
|
2206
|
+
() => u.modelValue.sort((f, i) => f.threshold - i.threshold) ?? []
|
|
2254
2207
|
), n = computed(() => {
|
|
2255
2208
|
const f = l.safeParse(o.value);
|
|
2256
2209
|
return f.success ? [] : f.error.errors;
|
|
@@ -2258,7 +2211,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2258
2211
|
function p(f, i) {
|
|
2259
2212
|
var k;
|
|
2260
2213
|
const c = [...o.value];
|
|
2261
|
-
c[i] = f, (k = r.value) == null || k.showSheet(!1),
|
|
2214
|
+
c[i] = f, (k = r.value) == null || k.showSheet(!1), d("update:model-value", c);
|
|
2262
2215
|
}
|
|
2263
2216
|
function h(f) {
|
|
2264
2217
|
const i = f.type == "VOUCHER" ? f.collectibleConfig : s.collectibles.find(
|
|
@@ -2283,7 +2236,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2283
2236
|
}
|
|
2284
2237
|
function C(f) {
|
|
2285
2238
|
const i = [...o.value];
|
|
2286
|
-
i.splice(f, 1),
|
|
2239
|
+
i.splice(f, 1), d("update:model-value", i);
|
|
2287
2240
|
}
|
|
2288
2241
|
function x() {
|
|
2289
2242
|
var f;
|
|
@@ -2318,11 +2271,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2318
2271
|
createElementVNode("div", _hoisted_2$3, toDisplayString(unref(a)("connect.template.configure_reward_customer")), 1),
|
|
2319
2272
|
createVNode(c, {
|
|
2320
2273
|
label: unref(a)("connect.template.mission_pool.add_reward"),
|
|
2321
|
-
onClick: i[0] || (i[0] = (
|
|
2274
|
+
onClick: i[0] || (i[0] = (E) => x()),
|
|
2322
2275
|
variant: "plain",
|
|
2323
2276
|
icon: "add"
|
|
2324
2277
|
}, null, 8, ["label"]),
|
|
2325
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (
|
|
2278
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (E, N) => (openBlock(), createBlock(k, {
|
|
2326
2279
|
key: N,
|
|
2327
2280
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
2328
2281
|
variant: "outlined",
|
|
@@ -2330,8 +2283,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2330
2283
|
}, {
|
|
2331
2284
|
default: withCtx(() => [
|
|
2332
2285
|
createElementVNode("div", null, [
|
|
2333
|
-
createElementVNode("div", _hoisted_3$3, toDisplayString(h(
|
|
2334
|
-
createElementVNode("div", _hoisted_4$2, toDisplayString(h(
|
|
2286
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(h(E).label), 1),
|
|
2287
|
+
createElementVNode("div", _hoisted_4$2, toDisplayString(h(E).sublabel), 1)
|
|
2335
2288
|
]),
|
|
2336
2289
|
createVNode(c, {
|
|
2337
2290
|
icon: "delete",
|
|
@@ -2341,9 +2294,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2341
2294
|
]),
|
|
2342
2295
|
_: 2
|
|
2343
2296
|
}, 1032, ["onClick"]))), 128)),
|
|
2344
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((
|
|
2345
|
-
key:
|
|
2346
|
-
text:
|
|
2297
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((E) => E.path.join(".") == ""), (E) => (openBlock(), createBlock(b, {
|
|
2298
|
+
key: E.message,
|
|
2299
|
+
text: E.message,
|
|
2347
2300
|
state: "error"
|
|
2348
2301
|
}, null, 8, ["text"]))), 128)),
|
|
2349
2302
|
createElementVNode("div", _hoisted_5$2, toDisplayString(unref(a)("connect.template.mission_pool.preview")), 1),
|
|
@@ -2353,11 +2306,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2353
2306
|
class: "p-24 space-y-16 w-fit"
|
|
2354
2307
|
}, {
|
|
2355
2308
|
default: withCtx(() => {
|
|
2356
|
-
var
|
|
2309
|
+
var E, N;
|
|
2357
2310
|
return [
|
|
2358
2311
|
createElementVNode("div", _hoisted_6$2, [
|
|
2359
2312
|
createElementVNode("div", null, [
|
|
2360
|
-
createElementVNode("div", _hoisted_7$2, toDisplayString(unref(a)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString(((
|
|
2313
|
+
createElementVNode("div", _hoisted_7$2, toDisplayString(unref(a)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString(((E = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : E.earningOption.amount) > 1 ? (N = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : N.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? v(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
2361
2314
|
createElementVNode("div", _hoisted_8$2, toDisplayString(unref(a)("connect.template.mission_pool.earn_stamp")), 1)
|
|
2362
2315
|
])
|
|
2363
2316
|
]),
|
|
@@ -2390,8 +2343,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2390
2343
|
},
|
|
2391
2344
|
emits: ["update:model-value"],
|
|
2392
2345
|
setup(e, { emit: m }) {
|
|
2393
|
-
const { t: a } = useI18n(),
|
|
2394
|
-
const o = FdoMission.safeParse(
|
|
2346
|
+
const { t: a } = useI18n(), u = e, d = computed(() => {
|
|
2347
|
+
const o = FdoMission.safeParse(u.modelValue);
|
|
2395
2348
|
return o.success ? [] : o.error.errors;
|
|
2396
2349
|
}), s = computed(() => [
|
|
2397
2350
|
{
|
|
@@ -2455,8 +2408,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2455
2408
|
end: y
|
|
2456
2409
|
});
|
|
2457
2410
|
}),
|
|
2458
|
-
"helper-text": unref(ZodHelper).helperText(unref(
|
|
2459
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
2411
|
+
"helper-text": unref(ZodHelper).helperText(unref(d), "end") || unref(a)("connect.campaign.mission.thresholdHelperText"),
|
|
2412
|
+
"helper-state": unref(ZodHelper).helperState(unref(d), "end") || "none"
|
|
2460
2413
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"])
|
|
2461
2414
|
])
|
|
2462
2415
|
]);
|
|
@@ -2465,8 +2418,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2465
2418
|
});
|
|
2466
2419
|
function useLocaleText() {
|
|
2467
2420
|
const { locale: e, t: m } = useI18n();
|
|
2468
|
-
function a(
|
|
2469
|
-
return
|
|
2421
|
+
function a(u, d) {
|
|
2422
|
+
return u ? u[e.value] ?? u["en-US"] ?? m(d) : m(d);
|
|
2470
2423
|
}
|
|
2471
2424
|
return { getLocaleText: a };
|
|
2472
2425
|
}
|
|
@@ -2497,9 +2450,9 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2497
2450
|
},
|
|
2498
2451
|
emits: ["update:model-value", "update:file"],
|
|
2499
2452
|
setup(e, { emit: m }) {
|
|
2500
|
-
const { t: a } = useI18n(), { getLocaleText:
|
|
2453
|
+
const { t: a } = useI18n(), { getLocaleText: u } = useLocaleText(), d = e, s = m;
|
|
2501
2454
|
function l(p) {
|
|
2502
|
-
switch (
|
|
2455
|
+
switch (d.field.type) {
|
|
2503
2456
|
case "timeframe":
|
|
2504
2457
|
const h = p.startDate ? hooks(p.startDate).startOf("day").toISOString() : void 0, y = p.endDate ? hooks(p.endDate).endOf("day").toISOString() : void 0;
|
|
2505
2458
|
s("update:model-value", {
|
|
@@ -2523,39 +2476,39 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2523
2476
|
}
|
|
2524
2477
|
}
|
|
2525
2478
|
const o = computed(() => {
|
|
2526
|
-
switch (
|
|
2479
|
+
switch (d.field.type) {
|
|
2527
2480
|
case "timeframe": {
|
|
2528
|
-
const p =
|
|
2481
|
+
const p = d.modelValue;
|
|
2529
2482
|
return {
|
|
2530
2483
|
startDate: p != null && p.start ? hooks(p == null ? void 0 : p.start).format("YYYY-MM-DD") : null,
|
|
2531
2484
|
endDate: p != null && p.end ? hooks(p == null ? void 0 : p.end).format("YYYY-MM-DD") : null
|
|
2532
2485
|
};
|
|
2533
2486
|
}
|
|
2534
2487
|
default:
|
|
2535
|
-
return
|
|
2488
|
+
return d.modelValue;
|
|
2536
2489
|
}
|
|
2537
2490
|
});
|
|
2538
2491
|
function n() {
|
|
2539
2492
|
if (!r.value.schema) return [];
|
|
2540
|
-
const p = r.value.schema.safeParse(
|
|
2493
|
+
const p = r.value.schema.safeParse(d.modelValue);
|
|
2541
2494
|
return p.success ? [] : p.error.errors;
|
|
2542
2495
|
}
|
|
2543
2496
|
const r = computed(() => ({
|
|
2544
|
-
schema:
|
|
2545
|
-
unwrapped:
|
|
2546
|
-
rules:
|
|
2547
|
-
labelMark:
|
|
2548
|
-
zodLabel:
|
|
2549
|
-
|
|
2550
|
-
d
|
|
2497
|
+
schema: d.schema,
|
|
2498
|
+
unwrapped: d.schema ? ZodHelper.unwrap(d.schema) : void 0,
|
|
2499
|
+
rules: d.schema ? [ZodHelper.ruleAtPath(d.schema, "")] : void 0,
|
|
2500
|
+
labelMark: d.schema && ZodHelper.isRequired(d.schema) == !1 ? "optional" : void 0,
|
|
2501
|
+
zodLabel: d.schema ? ZodHelper.toInputLabel(
|
|
2502
|
+
d.schema,
|
|
2503
|
+
u(d.field.label_locale, d.field.label ?? "")
|
|
2551
2504
|
) : void 0
|
|
2552
2505
|
}));
|
|
2553
2506
|
return (p, h) => {
|
|
2554
|
-
var i, c, k, b,
|
|
2507
|
+
var i, c, k, b, E;
|
|
2555
2508
|
const y = resolveComponent("FmTextField"), C = resolveComponent("FmStepperField"), x = resolveComponent("FmTextarea"), v = resolveComponent("FmHelperText"), f = resolveComponent("FmSwitch");
|
|
2556
2509
|
return e.field.type === "text" ? (openBlock(), createBlock(y, {
|
|
2557
2510
|
key: 0,
|
|
2558
|
-
label: unref(
|
|
2511
|
+
label: unref(u)(e.field.label_locale, e.field.label ?? ""),
|
|
2559
2512
|
"label-mark": unref(r).labelMark,
|
|
2560
2513
|
rules: unref(r).rules,
|
|
2561
2514
|
"model-value": unref(o),
|
|
@@ -2564,10 +2517,10 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2564
2517
|
"helper-text": e.helperText
|
|
2565
2518
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2566
2519
|
createVNode(JsonViewer, {
|
|
2567
|
-
json: { schema: unref(r).unwrapped, props:
|
|
2520
|
+
json: { schema: unref(r).unwrapped, props: d }
|
|
2568
2521
|
}, null, 8, ["json"]),
|
|
2569
2522
|
createVNode(C, {
|
|
2570
|
-
label: unref(
|
|
2523
|
+
label: unref(u)(e.field.label_locale, e.field.label ?? ""),
|
|
2571
2524
|
"label-mark": e.field.isRuleChildren ? void 0 : unref(r).labelMark,
|
|
2572
2525
|
"model-value": unref(o),
|
|
2573
2526
|
rules: e.field.isRuleChildren ? [] : unref(r).rules,
|
|
@@ -2577,14 +2530,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2577
2530
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
2578
2531
|
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(x, {
|
|
2579
2532
|
key: 2,
|
|
2580
|
-
label: unref(
|
|
2533
|
+
label: unref(u)(e.field.label_locale, e.field.label ?? ""),
|
|
2581
2534
|
"label-mark": unref(r).labelMark,
|
|
2582
2535
|
rules: unref(r).rules,
|
|
2583
2536
|
"model-value": unref(o),
|
|
2584
2537
|
"onUpdate:modelValue": l,
|
|
2585
2538
|
"show-word-count": "",
|
|
2586
|
-
"max-length": (
|
|
2587
|
-
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$
|
|
2539
|
+
"max-length": (E = (b = (k = (c = (i = unref(r)) == null ? void 0 : i.unwrapped) == null ? void 0 : c._def) == null ? void 0 : k.checks) == null ? void 0 : b.find((N) => N.kind == "max")) == null ? void 0 : E.value
|
|
2540
|
+
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$h, {
|
|
2588
2541
|
key: 3,
|
|
2589
2542
|
"campaign-type": e.extras,
|
|
2590
2543
|
"model-value": unref(o),
|
|
@@ -2613,7 +2566,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2613
2566
|
_: 1
|
|
2614
2567
|
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(f, {
|
|
2615
2568
|
key: 6,
|
|
2616
|
-
label: unref(
|
|
2569
|
+
label: unref(u)(e.field.label_locale, e.field.label ?? ""),
|
|
2617
2570
|
"label-placement": "right",
|
|
2618
2571
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
2619
2572
|
"label-mark": unref(r).labelMark,
|
|
@@ -2685,7 +2638,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2685
2638
|
"model-value": unref(o),
|
|
2686
2639
|
"onUpdate:modelValue": l,
|
|
2687
2640
|
"helper-text": e.helperText || unref(ZodHelper).helperText(n(), ""),
|
|
2688
|
-
"for-credit":
|
|
2641
|
+
"for-credit": d.campaignType === "CREDIT"
|
|
2689
2642
|
}, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$e, {
|
|
2690
2643
|
key: 16,
|
|
2691
2644
|
"model-value": unref(o),
|
|
@@ -2743,7 +2696,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2743
2696
|
state: "warning",
|
|
2744
2697
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
2745
2698
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
2746
|
-
createVNode(_sfc_main$
|
|
2699
|
+
createVNode(_sfc_main$j, {
|
|
2747
2700
|
"model-value": unref(o),
|
|
2748
2701
|
"onUpdate:modelValue": l
|
|
2749
2702
|
}, null, 8, ["model-value"]),
|
|
@@ -2776,7 +2729,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2776
2729
|
state: "error"
|
|
2777
2730
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2778
2731
|
], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 27 }, [
|
|
2779
|
-
createVNode(_sfc_main$
|
|
2732
|
+
createVNode(_sfc_main$i, {
|
|
2780
2733
|
"model-value": unref(o),
|
|
2781
2734
|
"onUpdate:modelValue": l
|
|
2782
2735
|
}, null, 8, ["model-value"]),
|
|
@@ -2797,7 +2750,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2797
2750
|
text: e.helperText,
|
|
2798
2751
|
state: "error"
|
|
2799
2752
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2800
|
-
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(
|
|
2753
|
+
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(d.field), 1));
|
|
2801
2754
|
};
|
|
2802
2755
|
}
|
|
2803
2756
|
}), _hoisted_1$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_2$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$1 = { class: "fm-typo-en-body-lg-600" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
@@ -2810,7 +2763,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2810
2763
|
},
|
|
2811
2764
|
setup(e) {
|
|
2812
2765
|
const { t: m, te: a } = useI18n();
|
|
2813
|
-
return (
|
|
2766
|
+
return (u, d) => {
|
|
2814
2767
|
const s = resolveComponent("FmCard");
|
|
2815
2768
|
return openBlock(), createBlock(s, {
|
|
2816
2769
|
variant: "outlined",
|
|
@@ -2818,7 +2771,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2818
2771
|
}, {
|
|
2819
2772
|
default: withCtx(() => [
|
|
2820
2773
|
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(m)("connect.campaign.common.summary")), 1),
|
|
2821
|
-
|
|
2774
|
+
d[0] || (d[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
|
|
2822
2775
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (l, o) => (openBlock(), createElementBlock("div", {
|
|
2823
2776
|
class: "space-y-4",
|
|
2824
2777
|
key: o
|
|
@@ -2850,18 +2803,18 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2850
2803
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
2851
2804
|
} catch {
|
|
2852
2805
|
} finally {
|
|
2853
|
-
await new Promise((
|
|
2806
|
+
await new Promise((u) => setTimeout(u, 120)), isLoading.value = !1;
|
|
2854
2807
|
}
|
|
2855
2808
|
console.log(
|
|
2856
2809
|
TEMPLATES[type],
|
|
2857
2810
|
"base template"
|
|
2858
|
-
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((
|
|
2811
|
+
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((u, d) => {
|
|
2859
2812
|
var s;
|
|
2860
|
-
if (
|
|
2861
|
-
const l = (s =
|
|
2813
|
+
if (u.campaign.type === "VOUCHER" && u.campaign.code) {
|
|
2814
|
+
const l = (s = u.campaign._id) == null ? void 0 : s.toString();
|
|
2862
2815
|
useCampaignStore().campaigns.voucher.some(
|
|
2863
|
-
(o) => o.code ===
|
|
2864
|
-
) &&
|
|
2816
|
+
(o) => o.code === u.campaign.code && o._id.toString() !== l
|
|
2817
|
+
) && d.addIssue({
|
|
2865
2818
|
code: "custom",
|
|
2866
2819
|
message: "Code already exists, please use another code",
|
|
2867
2820
|
path: ["campaign", "code"]
|
|
@@ -2900,10 +2853,10 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2900
2853
|
});
|
|
2901
2854
|
function stepErrors(e = currentStep.value - 1) {
|
|
2902
2855
|
const m = template.value.steps[e].groups.flatMap(
|
|
2903
|
-
(a) => a.fields.map((
|
|
2856
|
+
(a) => a.fields.map((u) => u.property)
|
|
2904
2857
|
);
|
|
2905
2858
|
return errors.value.filter(
|
|
2906
|
-
(a) => m.some((
|
|
2859
|
+
(a) => m.some((u) => a.path.join(".").includes(u))
|
|
2907
2860
|
);
|
|
2908
2861
|
}
|
|
2909
2862
|
__expose({ showSheet });
|
|
@@ -2917,9 +2870,9 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2917
2870
|
});
|
|
2918
2871
|
}
|
|
2919
2872
|
function onUpdateProperty(e, m) {
|
|
2920
|
-
var a,
|
|
2873
|
+
var a, u, d, s, l, o, n, r;
|
|
2921
2874
|
if (_.set(data.value, e, m), e == "campaign.event.type") {
|
|
2922
|
-
const h = ((s = (
|
|
2875
|
+
const h = ((s = (d = (u = (a = template.value) == null ? void 0 : a.defaultValue) == null ? void 0 : u.campaign) == null ? void 0 : d.event) == null ? void 0 : s.rule) ? _.cloneDeep({
|
|
2923
2876
|
...(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
|
|
2924
2877
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
2925
2878
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
@@ -2976,7 +2929,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2976
2929
|
(m || m === void 0) && (sheetVisible.value = !1);
|
|
2977
2930
|
}
|
|
2978
2931
|
return (e, m) => {
|
|
2979
|
-
const a = resolveComponent("FmButton"),
|
|
2932
|
+
const a = resolveComponent("FmButton"), u = resolveComponent("FmStep"), d = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
2980
2933
|
return openBlock(), createBlock(l, {
|
|
2981
2934
|
"fullscreen-size": "lg",
|
|
2982
2935
|
modelValue: unref(sheetVisible),
|
|
@@ -3042,14 +2995,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3042
2995
|
name: "default",
|
|
3043
2996
|
fn: withCtx(() => [
|
|
3044
2997
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
3045
|
-
createVNode(
|
|
2998
|
+
createVNode(d, {
|
|
3046
2999
|
modelValue: unref(currentStep),
|
|
3047
3000
|
"onUpdate:modelValue": m[1] || (m[1] = (o) => isRef(currentStep) ? currentStep.value = o : null),
|
|
3048
3001
|
orientation: "horizontal",
|
|
3049
3002
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
3050
3003
|
}, {
|
|
3051
3004
|
default: withCtx(() => [
|
|
3052
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(
|
|
3005
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(u, {
|
|
3053
3006
|
key: o.name,
|
|
3054
3007
|
title: unref(getLocaleText)(o.name_locale, o.name),
|
|
3055
3008
|
value: n + 1,
|
|
@@ -3065,14 +3018,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3065
3018
|
variant: "tertiary",
|
|
3066
3019
|
onClick: m[2] || (m[2] = (o) => sheetVisible.value = !1)
|
|
3067
3020
|
}),
|
|
3068
|
-
createVNode(
|
|
3021
|
+
createVNode(d, {
|
|
3069
3022
|
modelValue: unref(currentStep),
|
|
3070
3023
|
"onUpdate:modelValue": m[3] || (m[3] = (o) => isRef(currentStep) ? currentStep.value = o : null),
|
|
3071
3024
|
orientation: "horizontal",
|
|
3072
3025
|
class: "flex-1"
|
|
3073
3026
|
}, {
|
|
3074
3027
|
default: withCtx(() => [
|
|
3075
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(
|
|
3028
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(u, {
|
|
3076
3029
|
key: o.name,
|
|
3077
3030
|
title: unref(sheetTitle),
|
|
3078
3031
|
description: unref(getLocaleText)(o.name_locale, o.name),
|