@feedmepos/mf-connect 0.1.98-beta.6 → 0.1.98-beta.60
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/{App-CvJ0ASlp.js → App-BUwQLdzG.js} +812 -666
- package/dist/{AuditLogs-Bt9S2LKL.js → AuditLogs-laNQB1ef.js} +14 -13
- package/dist/{Bin-ZSCDSioa.js → Bin-Bfboeea_.js} +8 -8
- package/dist/{Broadcast-BT0R11RB.js → Broadcast-CDz-_eDz.js} +40 -37
- package/dist/CampaignAnalytic-BiA-5XG3.js +1830 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-LweQ57aG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-VrTN-c_a.js} +6 -5
- package/dist/Card-CKHaW8N7.js +1084 -0
- package/dist/{Collections-H7zhe9zN.js → Collections-DRocQb1D.js} +14 -13
- package/dist/Credit-DWaoVhSP.js +286 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-B7ZdULCu.js +53 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-B2sZFWUF.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-3ERieT1j.js} +54 -52
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-qNmiKaJc.js → EffectSheet.vue_vue_type_style_index_0_lang-yDUjXV2O.js} +35 -35
- package/dist/{Experience-CH5tg-tm.js → Experience-C1_LpneJ.js} +112 -86
- package/dist/{FileSaver.min-DNFqiyZb.js → FileSaver.min-CWJ-6CFP.js} +1 -1
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
- package/dist/Game-DtTYcSZk.js +356 -0
- package/dist/GiftCardSetup-B770Rl1Q.js +662 -0
- package/dist/{Grab-3s_sLewD.js → Grab-CN0gmIxT.js} +33 -32
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-fbmoN1e9.js → ImageInput.vue_vue_type_script_setup_true_lang-BaAhKWhX.js} +1 -1
- package/dist/{Index-zTWZCiEo.js → Index-0F6aq3f9.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BOxYPkf5.js → LocationPicker.vue_vue_type_script_setup_true_lang-BrKj8W2H.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-wjJ_cwft.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DOuHSVdR.js} +1 -1
- package/dist/LoyaltyDashboard-CtXyDFqa.js +2865 -0
- package/dist/MainLayout-BSWLr3gE.js +143 -0
- package/dist/{Marketing-Bto1OvK1.js → Marketing-Ci2haxRd.js} +7 -6
- package/dist/{MarketingMaterialEdit-D7rIqF5U.js → MarketingMaterialEdit-Cw6R0bNM.js} +15 -14
- package/dist/Member-DEzSTAQy.js +649 -0
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-BrhSxbrI.js +1287 -0
- package/dist/MemberImportHistory-BGfNLzma.js +187 -0
- package/dist/MemberList-Cq5Gsv3G.js +336 -0
- package/dist/{MemberTransactions-CjTtGB2y.js → MemberTransactions-BrUVZRtt.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DvKL7BL5.js → MessageInput.vue_vue_type_script_setup_true_lang-DCQ6Fse-.js} +5434 -5279
- package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CETwYfZD.js +40 -0
- package/dist/Mission-Do4IonLo.js +360 -0
- package/dist/{Overview-mxGLyFvE.js → Overview-DA90l9Kb.js} +21 -20
- package/dist/Overview-DN-nJxw9.js +1316 -0
- package/dist/Point-DQ4w857n.js +288 -0
- package/dist/Promotion-Rgt9LcYi.js +423 -0
- package/dist/{Queue-DgaFyyyH.js → Queue-SzypUxgD.js} +14 -13
- package/dist/{Record-BRol__6_.js → Record-DYvPPhIW.js} +9 -9
- package/dist/Review-B0TERyHM.js +45 -0
- package/dist/ReviewFacebookCallback-BJ5jQ3Dv.js +238 -0
- package/dist/ReviewGoogleCallback-BKQD39dv.js +213 -0
- package/dist/{Reward-DQI0PvmR.js → Reward-BexlVT_C.js} +35 -35
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B6bvQNsU.js → RewardGroup.vue_vue_type_script_setup_true_lang-C-ygqNur.js} +14 -13
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DgAU7jGo.js → RuleGroup.vue_vue_type_script_setup_true_lang-DjxIJcdv.js} +103 -109
- package/dist/{Segment-DFaLx0QZ.js → Segment-CYa4GjtQ.js} +30 -29
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cpb2i9iV.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-b-K-VDJC.js} +31 -30
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-MvoepHn9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-t2mlDDtn.js} +4 -4
- package/dist/{Setting-D2NjFJvq.js → Setting-Dmm5BKdF.js} +14 -14
- package/dist/{SettingAdvertisements-CPWgSMaA.js → SettingAdvertisements-cy4cRBop.js} +12 -12
- package/dist/Settings-DMQuLDM4.js +230 -0
- package/dist/Store-B7KflfSk.js +2612 -0
- package/dist/{StoreRewards-Ccj12pyq.js → StoreRewards-BKae8uZn.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-sbIR-k1R.js +1329 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CfWTn0Xd.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DRT3N9SD.js} +2 -2
- package/dist/{Tier-vaJoohiM.js → Tier-BeTz6LHH.js} +2296 -750
- package/dist/{Title-BqHC7-v9.js → Title-OEVVw5I-.js} +39 -37
- package/dist/Transaction-D-MZjntW.js +45 -0
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Dporb9KE.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-xIEOUOdo.js} +26 -26
- package/dist/{Voucher-DeN6C6DQ.js → Voucher-BJCf3pSa.js} +156 -133
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-De16fuC4.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BFQ_CYub.js} +115 -121
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DAC-j0Ln.js → ZodTextField.vue_vue_type_script_setup_true_lang-DGDw3Too.js} +2 -2
- package/dist/{app-n4Y2jMee.js → app-J8VIC7-H.js} +29852 -25997
- package/dist/app.js +1 -1
- package/dist/base.export-HYFFI4OS.js +75 -0
- package/dist/{business-jn-_l48y.js → business-BonuheMK.js} +5 -5
- package/dist/{campaign-rgDnocfT.js → campaign-7CI7gfS5.js} +74 -96
- package/dist/campaign-Ct7jhugP.js +100 -0
- package/dist/{campaign.enum-C9HvoKuq.js → campaign.enum-OzJ9IbAW.js} +1 -1
- package/dist/{campaign.fn-D21ettpH.js → campaign.fn-CDjxE9B2.js} +99 -99
- package/dist/{collectible.enum-_HVU4lWn.js → collectible.enum-Dw_tlI9E.js} +1 -1
- package/dist/collection.fn-CER0_NEn.js +26 -0
- package/dist/currency-CTUS4vS8.js +7 -0
- package/dist/{duplicateCampaign-gzVwrnWb.js → duplicateCampaign-CMQ-RMH-.js} +11 -11
- package/dist/{effect-DhpIv1L3.js → effect-DBeGoMNE.js} +1 -1
- package/dist/{email-addresses-DPxYLSoa.js → email-addresses-BH3mQzan.js} +209 -201
- package/dist/google-C3S8u0mT.js +4 -0
- package/dist/{helper-WYHUnHVy.js → helper-DJe_JbKJ.js} +1 -1
- package/dist/{index-BdnHQSDd.js → index-B14H1rLW.js} +5 -4
- package/dist/{index-7HizF3GI.js → index-BOVnM3gL.js} +1588 -1522
- package/dist/{index-Cvfavr2M.js → index-BRCB6yJ6.js} +232 -200
- package/dist/{index-BPsofsGt.js → index-BZKKS7jO.js} +1933 -2560
- package/dist/{index-BuLfxJyC.js → index-BlwAgY_z.js} +105 -123
- package/dist/index-BmN_Qcw7.js +151 -0
- package/dist/index-Bnk3vdb-.js +72 -0
- package/dist/index-BzVTqlVH.js +137 -0
- package/dist/{index--fNMSXUf.js → index-CEDhjZzd.js} +1 -1
- package/dist/{index-BdqRrCt8.js → index-CM9GTQIo.js} +5 -5
- package/dist/index-CN8VyVEB.js +53 -0
- package/dist/{index-Cte6dHHy.js → index-COuceEFz.js} +14 -14
- package/dist/{index-BN-FP9kx.js → index-CWR2s6Nt.js} +1 -1
- package/dist/index-CrMBqkKk.js +897 -0
- package/dist/{index-xao4ggML.js → index-D9f3AIaO.js} +5 -5
- package/dist/index-Do36kJeb.js +51 -0
- package/dist/{index-C-5YgmkC.js → index-bGByr1XM.js} +7 -5
- package/dist/{index-DUTFNEn9.js → index-bJX4zgh0.js} +4 -4
- package/dist/{index.esm2017-CjzFPUCa.js → index.esm2017-BpCPgTjc.js} +128 -128
- package/dist/{loading-CojnK00V.js → loading-D_rPJ-Yc.js} +1 -1
- package/dist/{lodash-CLkg5jTT.js → lodash-BM976Z2I.js} +1 -1
- package/dist/member-import-C5rhD3f8.js +187 -0
- package/dist/membership-CIQCEKiL.js +274 -0
- package/dist/{money-CyaLaEKo.js → money-BrMT193t.js} +1 -1
- package/dist/{number-DEtI4bEX.js → number-DOcD1tqL.js} +1 -1
- package/dist/objectid-CAdRRoFu.js +145 -0
- package/dist/{plugins-MnP1vCcg.js → plugins-696Z9K6A.js} +3 -3
- package/dist/remy-Qz_pNsUS.js +13 -0
- package/dist/{reward-Dk3D26xC.js → reward-lSVIBiE9.js} +1 -1
- package/dist/{rule-B1Agad1n.js → rule-BUGAimk8.js} +335 -275
- package/dist/style.css +1 -1
- package/dist/{template-DpqLCq1p.js → template-01_h2Gac.js} +6 -6
- package/dist/timezone-okTdM2YU.js +20 -0
- package/dist/transaction.fn-Nz0T33ex.js +64 -0
- package/dist/{trigger-cwPN-4Ia.js → trigger-CKj1X6zs.js} +17 -17
- package/dist/useMarketingMaterialActions-yKqKaPpe.js +96 -0
- package/dist/{usePagination-D8zBMxdJ.js → usePagination-D6cYlfni.js} +1 -1
- package/dist/{user-EUGwaL2f.js → user-DX5qCQfz.js} +1 -1
- package/dist/{vue-i18n-BBj45p9N.js → vue-i18n-DowpocqN.js} +204 -204
- package/dist/{xlsx-DiMIlKmu.js → xlsx-Dv4SuJbw.js} +1 -1
- package/dist/{zod-B1cU167C.js → zod-DVw24Ejy.js} +1 -1
- package/package.json +6 -5
- package/dist/Card-Wdh8lyUv.js +0 -910
- package/dist/Credit-BuKLrFtM.js +0 -260
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-C9s4qZz4.js +0 -330
- package/dist/LoyaltyDashboard-tOOk6zvV.js +0 -1082
- package/dist/MainLayout-iWi1DzXS.js +0 -41
- package/dist/Member-BdgdT-sa.js +0 -280
- package/dist/MemberList-DBIE-RWC.js +0 -1601
- package/dist/Mission-CWR6FBvN.js +0 -334
- package/dist/Point-BIt82fJk.js +0 -262
- package/dist/Promotion-Cl1vPi0B.js +0 -397
- package/dist/Review-DmV2YnFd.js +0 -1076
- package/dist/ReviewFacebookCallback-B5XgAWXo.js +0 -243
- package/dist/ReviewGoogleCallback-CYR03Wfd.js +0 -208
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CAImd3yc.js +0 -181
- package/dist/Store-DjUe8ady.js +0 -1996
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B7w69A3j.js +0 -1130
- package/dist/Transaction-BOmDOGnD.js +0 -39
- package/dist/campaign-BnI7-ceP.js +0 -219
- package/dist/export-CWAxYj7W.js +0 -97
- package/dist/index-B6EBgIUx.js +0 -85
- package/dist/index-CxR1baaG.js +0 -52
- package/dist/membership-CeX8E_I9.js +0 -255
- package/dist/objectid-CMau7CW-.js +0 -145
- package/dist/useMarketingMaterialActions-CGzfJ68e.js +0 -107
package/dist/app.js
CHANGED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var w = Object.defineProperty;
|
|
2
|
+
var y = (e, s, o) => s in e ? w(e, s, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[s] = o;
|
|
3
|
+
var n = (e, s, o) => y(e, typeof s != "symbol" ? s + "" : s, o);
|
|
4
|
+
import { u as x } from "./loading-D_rPJ-Yc.js";
|
|
5
|
+
import { w as h, u as a } from "./xlsx-Dv4SuJbw.js";
|
|
6
|
+
const t = {
|
|
7
|
+
sortBy: "_id",
|
|
8
|
+
descending: !1,
|
|
9
|
+
rowsPerPage: 1e3,
|
|
10
|
+
page: 1,
|
|
11
|
+
rowsNumber: 0
|
|
12
|
+
}, { minor: m } = x;
|
|
13
|
+
async function B({
|
|
14
|
+
exporter: e,
|
|
15
|
+
readFunction: s,
|
|
16
|
+
transformRecord: o,
|
|
17
|
+
filename: r
|
|
18
|
+
}) {
|
|
19
|
+
const d = (await s({
|
|
20
|
+
limit: 1,
|
|
21
|
+
skip: 0,
|
|
22
|
+
sortBy: t.sortBy,
|
|
23
|
+
descending: t.descending
|
|
24
|
+
})).meta.totalResources ?? 0, c = t.rowsPerPage;
|
|
25
|
+
await m(
|
|
26
|
+
async () => {
|
|
27
|
+
for (let i = 0; i < d; i += c) {
|
|
28
|
+
const p = {
|
|
29
|
+
...t,
|
|
30
|
+
limit: c,
|
|
31
|
+
skip: t.page - 1,
|
|
32
|
+
sortBy: t.sortBy,
|
|
33
|
+
descending: t.descending
|
|
34
|
+
}, g = await s(p);
|
|
35
|
+
for (const l of g.resources) {
|
|
36
|
+
const u = o(l);
|
|
37
|
+
e.addRecord(u);
|
|
38
|
+
}
|
|
39
|
+
t.page++;
|
|
40
|
+
}
|
|
41
|
+
await h(
|
|
42
|
+
e.buildExcel(),
|
|
43
|
+
`${r}-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
44
|
+
{
|
|
45
|
+
bookType: "xlsx",
|
|
46
|
+
bookSST: !1,
|
|
47
|
+
type: "array"
|
|
48
|
+
}
|
|
49
|
+
), t.page = 1;
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
message: `Exporting ${r}...`,
|
|
53
|
+
successMessage: `${r} exported successfully`
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
class S {
|
|
58
|
+
constructor() {
|
|
59
|
+
n(this, "records", []);
|
|
60
|
+
}
|
|
61
|
+
addRecord(s) {
|
|
62
|
+
this.records.push(s);
|
|
63
|
+
}
|
|
64
|
+
addRecords(s) {
|
|
65
|
+
this.records.push(...s);
|
|
66
|
+
}
|
|
67
|
+
buildExcel() {
|
|
68
|
+
const s = a.json_to_sheet(this.records), o = a.book_new();
|
|
69
|
+
return a.book_append_sheet(o, s, "Sheet1"), o;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
S as B,
|
|
74
|
+
B as e
|
|
75
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref as i, computed as u } from "vue";
|
|
2
2
|
import { defineStore as w } from "pinia";
|
|
3
3
|
import { useCoreStore as y } from "@feedmepos/mf-common";
|
|
4
|
-
import {
|
|
4
|
+
import { d as I, g as r, A as b, S, b as D } from "./index-B14H1rLW.js";
|
|
5
5
|
const $ = {
|
|
6
6
|
async readSettings(e) {
|
|
7
7
|
try {
|
|
@@ -37,11 +37,11 @@ const $ = {
|
|
|
37
37
|
}
|
|
38
38
|
}, h = w("mf-connect-business", () => {
|
|
39
39
|
const e = i("v2"), t = i(!1), a = i([]), c = i([]);
|
|
40
|
-
async function
|
|
40
|
+
async function d() {
|
|
41
41
|
const n = y().currentBusiness.value, s = await $.readSettings(n == null ? void 0 : n.id);
|
|
42
42
|
return t.value = s && "business" in s && s.premium == !0 || !1, e.value = (s == null ? void 0 : s.apiVersion) || "v1", t.value;
|
|
43
43
|
}
|
|
44
|
-
async function
|
|
44
|
+
async function v() {
|
|
45
45
|
return a.value = await l.read(), a.value;
|
|
46
46
|
}
|
|
47
47
|
async function p() {
|
|
@@ -67,8 +67,8 @@ const $ = {
|
|
|
67
67
|
locations: a,
|
|
68
68
|
locationDevices: c,
|
|
69
69
|
// actions
|
|
70
|
-
readPremium:
|
|
71
|
-
readLocations:
|
|
70
|
+
readPremium: d,
|
|
71
|
+
readLocations: v,
|
|
72
72
|
readLocationDevices: p,
|
|
73
73
|
locationById: m,
|
|
74
74
|
// getters
|
|
@@ -1,67 +1,45 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./index-
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { u as C } from "./business-jn-_l48y.js";
|
|
10
|
-
import { C as m } from "./campaign.fn-D21ettpH.js";
|
|
1
|
+
import { h as i } from "./moment-D7p2TMB-.js";
|
|
2
|
+
import "./index-CrMBqkKk.js";
|
|
3
|
+
import { e as p } from "./effect-DBeGoMNE.js";
|
|
4
|
+
import { components as f } from "@feedmepos/ui-library";
|
|
5
|
+
import { a as y } from "./index-BRCB6yJ6.js";
|
|
6
|
+
import { c as h } from "./rule-BUGAimk8.js";
|
|
7
|
+
import { u as O } from "./business-BonuheMK.js";
|
|
8
|
+
import { C as m } from "./campaign.fn-CDjxE9B2.js";
|
|
11
9
|
import { c as g } from "./string-Gcy5IM_H.js";
|
|
12
|
-
import { i as d } from "./plugins-
|
|
13
|
-
import { h as
|
|
14
|
-
import { F as a } from "./campaign.enum-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
case "PROMOTION":
|
|
18
|
-
return "Promotion";
|
|
19
|
-
case "VOUCHER":
|
|
20
|
-
return "Voucher";
|
|
21
|
-
case "CREDIT":
|
|
22
|
-
return "Credit";
|
|
23
|
-
case "POINT":
|
|
24
|
-
return "Experience";
|
|
25
|
-
case "COIN":
|
|
26
|
-
return "Point";
|
|
27
|
-
case "GAME":
|
|
28
|
-
return "Game";
|
|
29
|
-
default:
|
|
30
|
-
return e;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const G = {
|
|
34
|
-
formattedType: E
|
|
35
|
-
}, o = d.global.t;
|
|
36
|
-
function I() {
|
|
10
|
+
import { i as d } from "./plugins-696Z9K6A.js";
|
|
11
|
+
import { h as s } from "vue";
|
|
12
|
+
import { F as a } from "./campaign.enum-OzJ9IbAW.js";
|
|
13
|
+
const n = d.global.t;
|
|
14
|
+
function C() {
|
|
37
15
|
const e = d.global.locale;
|
|
38
16
|
return typeof e == "string" ? e : e.value;
|
|
39
17
|
}
|
|
40
18
|
function u(e) {
|
|
41
|
-
return new Intl.DateTimeFormat(
|
|
19
|
+
return new Intl.DateTimeFormat(C(), {
|
|
42
20
|
day: "2-digit",
|
|
43
21
|
month: "short",
|
|
44
22
|
year: "numeric"
|
|
45
23
|
}).format(new Date(e));
|
|
46
24
|
}
|
|
47
25
|
function c(e) {
|
|
48
|
-
return
|
|
26
|
+
return s(
|
|
49
27
|
"div",
|
|
50
28
|
{
|
|
51
29
|
class: `${e.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
|
|
52
30
|
},
|
|
53
31
|
[
|
|
54
|
-
|
|
55
|
-
|
|
32
|
+
s(f.FmIcon, { size: "sm", name: e.icon, outline: !0 }),
|
|
33
|
+
s("span", { class: "fm-typo-en-body-md-600" }, e.name)
|
|
56
34
|
]
|
|
57
35
|
);
|
|
58
36
|
}
|
|
59
|
-
const
|
|
37
|
+
const P = {
|
|
60
38
|
[a.enum.CREDIT]: {
|
|
61
39
|
chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
|
|
62
40
|
icon: "local_activity",
|
|
63
41
|
get name() {
|
|
64
|
-
return
|
|
42
|
+
return n("connect.campaign.common.typeName.CREDIT");
|
|
65
43
|
},
|
|
66
44
|
chip() {
|
|
67
45
|
return c(this);
|
|
@@ -71,7 +49,7 @@ const H = {
|
|
|
71
49
|
chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
|
|
72
50
|
icon: "loyalty",
|
|
73
51
|
get name() {
|
|
74
|
-
return
|
|
52
|
+
return n("connect.campaign.common.typeName.PROMOTION");
|
|
75
53
|
},
|
|
76
54
|
chip() {
|
|
77
55
|
return c(this);
|
|
@@ -81,7 +59,7 @@ const H = {
|
|
|
81
59
|
chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
|
|
82
60
|
icon: "sell",
|
|
83
61
|
get name() {
|
|
84
|
-
return
|
|
62
|
+
return n("connect.campaign.common.typeName.VOUCHER");
|
|
85
63
|
},
|
|
86
64
|
chip() {
|
|
87
65
|
return c(this);
|
|
@@ -91,7 +69,7 @@ const H = {
|
|
|
91
69
|
chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
|
|
92
70
|
icon: "award_star",
|
|
93
71
|
get name() {
|
|
94
|
-
return
|
|
72
|
+
return n("connect.campaign.common.typeName.POINT");
|
|
95
73
|
},
|
|
96
74
|
chip() {
|
|
97
75
|
return c(this);
|
|
@@ -101,7 +79,7 @@ const H = {
|
|
|
101
79
|
chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
|
|
102
80
|
icon: "campaign",
|
|
103
81
|
get name() {
|
|
104
|
-
return
|
|
82
|
+
return n("connect.campaign.common.typeName.BROADCAST");
|
|
105
83
|
},
|
|
106
84
|
chip() {
|
|
107
85
|
return c(this);
|
|
@@ -111,7 +89,7 @@ const H = {
|
|
|
111
89
|
chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
|
|
112
90
|
icon: "database",
|
|
113
91
|
get name() {
|
|
114
|
-
return
|
|
92
|
+
return n("connect.campaign.common.typeName.GAME");
|
|
115
93
|
},
|
|
116
94
|
chip() {
|
|
117
95
|
return c(this);
|
|
@@ -121,7 +99,7 @@ const H = {
|
|
|
121
99
|
chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
|
|
122
100
|
icon: "editor_choice",
|
|
123
101
|
get name() {
|
|
124
|
-
return
|
|
102
|
+
return n("connect.campaign.common.typeName.REWARD_POOL");
|
|
125
103
|
},
|
|
126
104
|
chip() {
|
|
127
105
|
return c(this);
|
|
@@ -131,7 +109,7 @@ const H = {
|
|
|
131
109
|
chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
|
|
132
110
|
icon: "monetization_on",
|
|
133
111
|
get name() {
|
|
134
|
-
return
|
|
112
|
+
return n("connect.campaign.common.typeName.COIN");
|
|
135
113
|
},
|
|
136
114
|
chip() {
|
|
137
115
|
return c(this);
|
|
@@ -141,7 +119,7 @@ const H = {
|
|
|
141
119
|
chipClass: "",
|
|
142
120
|
icon: "",
|
|
143
121
|
get name() {
|
|
144
|
-
return
|
|
122
|
+
return n("connect.campaign.common.typeName.MEMBERSHIP");
|
|
145
123
|
},
|
|
146
124
|
chip() {
|
|
147
125
|
return c(this);
|
|
@@ -151,7 +129,7 @@ const H = {
|
|
|
151
129
|
chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
|
|
152
130
|
icon: "editor_choice",
|
|
153
131
|
get name() {
|
|
154
|
-
return
|
|
132
|
+
return n("connect.campaign.common.typeName.MISSION");
|
|
155
133
|
},
|
|
156
134
|
chip() {
|
|
157
135
|
return c(this);
|
|
@@ -166,87 +144,87 @@ const H = {
|
|
|
166
144
|
}
|
|
167
145
|
}
|
|
168
146
|
};
|
|
169
|
-
function
|
|
170
|
-
const t =
|
|
147
|
+
function L(e) {
|
|
148
|
+
const t = b(e), o = {
|
|
171
149
|
active: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
172
150
|
upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
|
|
173
151
|
expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
|
|
174
152
|
};
|
|
175
|
-
return e.type == "VOUCHER" ?
|
|
176
|
-
class:
|
|
177
|
-
label: g.title(
|
|
153
|
+
return e.type == "VOUCHER" ? s(f.FmChip, {
|
|
154
|
+
class: o[t],
|
|
155
|
+
label: g.title(n(`connect.campaign.common.status.${t}`)),
|
|
178
156
|
compact: !0
|
|
179
|
-
}) :
|
|
180
|
-
class:
|
|
181
|
-
label: g.title(
|
|
157
|
+
}) : s(f.FmChip, {
|
|
158
|
+
class: o[t],
|
|
159
|
+
label: g.title(n(`connect.campaign.common.status.${t}`)),
|
|
182
160
|
compact: !0
|
|
183
161
|
});
|
|
184
162
|
}
|
|
185
|
-
function
|
|
163
|
+
function w(e) {
|
|
186
164
|
const t = e.timeframeOptions;
|
|
187
165
|
if (!t || !t.start && !t.end)
|
|
188
|
-
return
|
|
166
|
+
return n("connect.campaign.common.always_active");
|
|
189
167
|
if (!t.start && t.end)
|
|
190
|
-
return
|
|
168
|
+
return n("connect.campaign.common.valid_until", {
|
|
191
169
|
date: u(t.end)
|
|
192
170
|
});
|
|
193
|
-
const
|
|
194
|
-
return `${
|
|
171
|
+
const o = u(t.start), r = t.end ? u(t.end) : n("connect.campaign.common.unlimited");
|
|
172
|
+
return `${o} -> ${r}`;
|
|
195
173
|
}
|
|
196
|
-
function
|
|
174
|
+
function E(e) {
|
|
175
|
+
if (!e || !e.start && !e.end)
|
|
176
|
+
return "connect.campaign.common.always";
|
|
177
|
+
const t = e.start ? i(e.start).format("DD MMM YYYY") : "From campaign creation", o = e.end ? i(e.end).format("DD MMM YYYY") : "Never ends";
|
|
178
|
+
return `${t} - ${o}`;
|
|
179
|
+
}
|
|
180
|
+
function Y(e) {
|
|
197
181
|
const { campaign: t } = e;
|
|
198
|
-
function r(n) {
|
|
199
|
-
if (!n || !n.start && !n.end)
|
|
200
|
-
return "connect.campaign.common.always";
|
|
201
|
-
const i = n.start ? u(n.start) : "From campaign creation", y = n.end ? u(n.end) : "Never ends";
|
|
202
|
-
return `${i} - ${y}`;
|
|
203
|
-
}
|
|
204
182
|
return {
|
|
205
183
|
"connect.campaign.common.campaign_name": t.name,
|
|
206
|
-
"connect.campaign.common.campaign_period":
|
|
184
|
+
"connect.campaign.common.campaign_period": E(
|
|
207
185
|
t.timeframeOptions
|
|
208
186
|
),
|
|
209
187
|
get "connect.campaign.common.next_schedule_at"() {
|
|
210
|
-
if ((t == null ? void 0 : t.event.type) != "SCHEDULE" || !t.event.rule || !
|
|
188
|
+
if ((t == null ? void 0 : t.event.type) != "SCHEDULE" || !t.event.rule || !y(t.event.rule))
|
|
211
189
|
return;
|
|
212
|
-
const
|
|
190
|
+
const o = h(
|
|
213
191
|
t.event.rule.rules.g_schedule
|
|
214
192
|
);
|
|
215
|
-
return
|
|
193
|
+
return o ? i(o).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
|
|
216
194
|
},
|
|
217
195
|
get "connect.campaign.common.discount_type"() {
|
|
218
|
-
if (t.type == "PROMOTION") return
|
|
196
|
+
if (t.type == "PROMOTION") return p(t.effect);
|
|
219
197
|
if ("configs" in e && e.configs.type == "VOUCHER")
|
|
220
|
-
return
|
|
198
|
+
return p(e.configs.extras.effect);
|
|
221
199
|
},
|
|
222
200
|
get "connect.campaign.common.available_at"() {
|
|
223
201
|
return t.targetLocation ? t.targetLocation.length > 0 ? t.targetLocation.map(
|
|
224
|
-
(
|
|
202
|
+
(o) => O().locationItems.find((r) => r.value == o).label
|
|
225
203
|
).join(",") : "connect.campaign.common.no_location" : "connect.campaign.common.all_locations";
|
|
226
204
|
}
|
|
227
205
|
};
|
|
228
206
|
}
|
|
229
|
-
function
|
|
230
|
-
return e.timeframeOptions && e.timeframeOptions.type == "timeframe" ?
|
|
231
|
-
e.timeframeOptions.start ??
|
|
232
|
-
e.timeframeOptions.end ??
|
|
233
|
-
) ? "active" :
|
|
207
|
+
function b(e) {
|
|
208
|
+
return e.timeframeOptions && e.timeframeOptions.type == "timeframe" ? i().isBetween(
|
|
209
|
+
e.timeframeOptions.start ?? i().subtract(1, "d"),
|
|
210
|
+
e.timeframeOptions.end ?? i().add(1, "d")
|
|
211
|
+
) ? "active" : i().isAfter(e.timeframeOptions.end) ? "expired" : "upcoming" : "active";
|
|
234
212
|
}
|
|
235
|
-
function
|
|
236
|
-
var t,
|
|
213
|
+
function B(e) {
|
|
214
|
+
var t, o;
|
|
237
215
|
switch (e.event.type) {
|
|
238
216
|
case "BILL_COMPLETED":
|
|
239
|
-
const
|
|
217
|
+
const r = `Spend to get ${m.formattedType(e.type)}`;
|
|
240
218
|
switch (e.type) {
|
|
241
219
|
case "POINT":
|
|
242
220
|
case "CREDIT":
|
|
243
221
|
case "COIN":
|
|
244
222
|
return e.earningOption.type == "FIXED" ? `Spend to get ${e.earningOption.amount} ${m.formattedType(e.type)}` : `Every ${e.earningOption.every} amount spent get ${e.earningOption.amount} ${m.formattedType(e.type)}`;
|
|
245
223
|
case "VOUCHER":
|
|
246
|
-
const
|
|
247
|
-
return
|
|
224
|
+
const l = (o = (t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.extras) == null ? void 0 : o.effect;
|
|
225
|
+
return l ? `${r} - ${p(l)}` : r;
|
|
248
226
|
default:
|
|
249
|
-
return
|
|
227
|
+
return r;
|
|
250
228
|
}
|
|
251
229
|
case "FEEDBACK":
|
|
252
230
|
return `Give feedback to receive ${m.formattedType(e.type)}`;
|
|
@@ -259,7 +237,7 @@ function V(e) {
|
|
|
259
237
|
case "MEMBERSHIP_JOINED":
|
|
260
238
|
return `Receive ${m.formattedType(e.type)} when member joined`;
|
|
261
239
|
case "MAKING_ORDER":
|
|
262
|
-
return e.type !== "PROMOTION" ? void 0 :
|
|
240
|
+
return e.type !== "PROMOTION" ? void 0 : p(e.effect);
|
|
263
241
|
default:
|
|
264
242
|
throw new Error(
|
|
265
243
|
`Not implemented ${JSON.stringify({ cause: e.event.type })}`
|
|
@@ -267,11 +245,11 @@ function V(e) {
|
|
|
267
245
|
}
|
|
268
246
|
}
|
|
269
247
|
export {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
248
|
+
P as C,
|
|
249
|
+
b as a,
|
|
250
|
+
L as b,
|
|
251
|
+
B as c,
|
|
252
|
+
Y as d,
|
|
253
|
+
w as g,
|
|
254
|
+
E as s
|
|
277
255
|
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { defineStore as d } from "pinia";
|
|
2
|
+
import { reactive as b, onMounted as f, ref as s } from "vue";
|
|
3
|
+
import { c } from "./index-BmN_Qcw7.js";
|
|
4
|
+
import { g as i, S as g, b as h } from "./index-B14H1rLW.js";
|
|
5
|
+
const p = () => {
|
|
6
|
+
const e = g.getBusinessId();
|
|
7
|
+
if (!e) throw new Error("Invalid business ID");
|
|
8
|
+
return h(`businesses/${e}/campaigns`, {
|
|
9
|
+
noIdRequired: !0
|
|
10
|
+
});
|
|
11
|
+
}, I = {
|
|
12
|
+
async readAll() {
|
|
13
|
+
return i(await p().get("templates"));
|
|
14
|
+
},
|
|
15
|
+
async readById(e) {
|
|
16
|
+
return i(
|
|
17
|
+
await p().get(`templates/${e}`)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
}, A = d("mf-connect-campaign", () => {
|
|
21
|
+
const e = b({
|
|
22
|
+
promotion: [],
|
|
23
|
+
voucher: [],
|
|
24
|
+
broadcast: [],
|
|
25
|
+
experience: [],
|
|
26
|
+
point: [],
|
|
27
|
+
credit: [],
|
|
28
|
+
token: [],
|
|
29
|
+
mission: [],
|
|
30
|
+
grab: [],
|
|
31
|
+
all: []
|
|
32
|
+
});
|
|
33
|
+
f(() => {
|
|
34
|
+
console.log("🔧 CampaignStore Installed");
|
|
35
|
+
});
|
|
36
|
+
const t = s([]), r = s([]), n = s([]);
|
|
37
|
+
async function u(k) {
|
|
38
|
+
const o = await c.readAll({
|
|
39
|
+
limit: 1e3,
|
|
40
|
+
skip: 0,
|
|
41
|
+
sortBy: "_id",
|
|
42
|
+
descending: !0
|
|
43
|
+
});
|
|
44
|
+
Object.keys(e).forEach((a) => {
|
|
45
|
+
e[a] = [];
|
|
46
|
+
}), e.all = o.resources.filter(
|
|
47
|
+
(a) => a.type !== "MEMBERSHIP"
|
|
48
|
+
);
|
|
49
|
+
for (const a of o.resources)
|
|
50
|
+
switch (a.type) {
|
|
51
|
+
case "PROMOTION":
|
|
52
|
+
e.promotion.push(a);
|
|
53
|
+
break;
|
|
54
|
+
case "VOUCHER":
|
|
55
|
+
e.voucher.push(a), n.value.push(a);
|
|
56
|
+
break;
|
|
57
|
+
case "BROADCAST":
|
|
58
|
+
["SCHEDULE", "FEEDBACK"].includes(a.event.type) && e.broadcast.push(a);
|
|
59
|
+
break;
|
|
60
|
+
case "POINT":
|
|
61
|
+
e.experience.push(a);
|
|
62
|
+
break;
|
|
63
|
+
case "COIN":
|
|
64
|
+
e.point.push(a);
|
|
65
|
+
break;
|
|
66
|
+
case "CREDIT":
|
|
67
|
+
e.credit.push(a);
|
|
68
|
+
break;
|
|
69
|
+
case "GAME":
|
|
70
|
+
e.token.push(a);
|
|
71
|
+
break;
|
|
72
|
+
case "MISSION":
|
|
73
|
+
e.mission.push(a);
|
|
74
|
+
break;
|
|
75
|
+
case "GRAB":
|
|
76
|
+
e.grab.push(a);
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async function l() {
|
|
81
|
+
r.value = await c.readGroups();
|
|
82
|
+
}
|
|
83
|
+
async function m() {
|
|
84
|
+
t.value = await I.readAll();
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
// State
|
|
88
|
+
campaigns: e,
|
|
89
|
+
templates: t,
|
|
90
|
+
groups: r,
|
|
91
|
+
voucher: n,
|
|
92
|
+
// Actions
|
|
93
|
+
read: u,
|
|
94
|
+
readGroups: l,
|
|
95
|
+
readTemplates: m
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
export {
|
|
99
|
+
A as u
|
|
100
|
+
};
|