@feedmepos/mf-connect 0.1.0-beta.9 → 0.1.0-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Analytic-D1vIDmhJ.js +620 -0
- package/dist/{App-DQUbRsdA.js → App-DHrfWG8l.js} +249 -250
- package/dist/Broadcast-B2rxZAZi.js +216 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D-BFllvG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2a9rcXK.js} +20 -20
- package/dist/Card-Dr6pTTM0.js +824 -0
- package/dist/Collections-0tbg0MFt.js +441 -0
- package/dist/Credit-KbB_7Jq-.js +214 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C_ZKNWzb.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-we7ADwFk.js} +999 -1018
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-VBNyvZCJ.js +344 -0
- package/dist/Experience-C_Q9Iml8.js +211 -0
- package/dist/Game-BwODw7M6.js +250 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → MainLayout-DpZC6o3R.js} +53 -19
- package/dist/Marketing-QOKTAS_T.js +309 -0
- package/dist/Member-d7RIGRm1.js +92 -0
- package/dist/MemberList-CK9629ew.js +1737 -0
- package/dist/MemberOverview-C2n9oJZh.js +58 -0
- package/dist/{MemberTransactions-zSxSnUkK.js → MemberTransactions-D-pnlXiP.js} +1 -1
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-3VS7JnK6.js +203 -0
- package/dist/Mission-BAKDm4VZ.js +248 -0
- package/dist/Point-Puu0jKz0.js +220 -0
- package/dist/Promotion-DRIaUvJi.js +244 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CTKKhH-r.js → RuleGroup.vue_vue_type_script_setup_true_lang-DTdfYGya.js} +557 -557
- package/dist/Segment-DpBxGuuu.js +435 -0
- package/dist/Setting-DLB2ywCp.js +1870 -0
- package/dist/Store-8DO6ITWc.js +1513 -0
- package/dist/StoreRewards-DZfqUeYR.js +429 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-2Jqj_rKv.js → StoreTransactions.vue_vue_type_script_setup_true_lang-RTfozD01.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BkdSj0cX.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BGI78ycg.js} +1 -1
- package/dist/{Tier-Cpl0FV8L.js → Tier-BnQRujpX.js} +453 -481
- package/dist/{Title-CbMDd1Et.js → Title-BPf1tUFx.js} +295 -314
- package/dist/Transaction-ese0oNrz.js +36 -0
- package/dist/Voucher--gtOZQx1.js +485 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +140 -0
- package/dist/app-Bt59niI-.js +2974 -0
- package/dist/{app-VxaUCtgl.js → app-DHE61XdR.js} +1 -1
- package/dist/app.js +3 -5
- package/dist/{business-DR7jpnLz.js → business-BSo7EPan.js} +1 -1
- package/dist/{campaign-MqcTb329.js → campaign-CsOje3Ap.js} +3 -5
- package/dist/{collection.fn-CvEoe61K.js → collection.fn-BYQfFJOr.js} +2 -2
- package/dist/dto-CfEXSCq6.js +1145 -0
- package/dist/{effect-BjjQeiQg.js → effect-Bn_ofYS3.js} +9 -9
- package/dist/{export-B8cvWh5n.js → export-CMR243CF.js} +3 -3
- package/dist/{helper-DfgVNY7B.js → helper-BqOQRtvW.js} +1 -1
- package/dist/index-BLDYTxnc.js +28058 -0
- package/dist/{index-C2JNcGc-.js → index-BWnFs-Cb.js} +281 -299
- package/dist/{index-B5NufbUt.js → index-BaBNmzUb.js} +1 -1
- package/dist/{index-CWR3qYjb.js → index-Boo5np6l.js} +1 -1
- package/dist/{index-BsfWRB8R.js → index-CC1GV8OW.js} +1 -1
- package/dist/{index-0UYoh1-7.js → index-CHO4_zsT.js} +1 -1
- package/dist/{index-2P9w5u3m.js → index-DEZsrQ2f.js} +3 -3
- package/dist/{index-C7zMfUgy.js → index-D_f2lmK2.js} +1 -1
- package/dist/{index-Dap5R3vr.js → index-Da142OER.js} +66 -78
- package/dist/index-DbP04yeg.js +11 -0
- package/dist/{index-DBy30v8N.js → index-DtPe-TEm.js} +3 -3
- package/dist/{index-CJ8Uh2Ja.js → index-FvlaxwGB.js} +3 -3
- package/dist/{index.esm2017-D1X3PgpO.js → index.esm2017-ePm--Atp.js} +55 -55
- package/dist/{loading-CJ3nOovJ.js → loading-KNmEMBUB.js} +460 -469
- package/dist/{membership-B1cmSRyk.js → membership-DKoVIS1a.js} +3 -3
- package/dist/money-CkD3zl5C.js +15 -0
- package/dist/number-BDsGpOXm.js +12 -0
- package/dist/{rule-ChWyR-0j.js → rule-CzamI50_.js} +2 -2
- package/dist/{rule-builder-CSmOONdb.js → rule-builder-DHf6wfaQ.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-Cug7aRK0.js → template-CFAIPoD7.js} +63 -63
- package/dist/{usePagination-BeF5K3M7.js → usePagination-JoYaROkV.js} +85 -85
- package/dist/{xlsx-CfgPFFvp.js → xlsx-BDJMaozs.js} +517 -517
- package/package.json +4 -7
- package/dist/Analytic-CMXUjK_F.js +0 -622
- package/dist/Broadcast-DowFtHv6.js +0 -223
- package/dist/Card-C7rhL0pV.js +0 -825
- package/dist/Collections-B-1wlk3r.js +0 -453
- package/dist/Credit-DDjozmoF.js +0 -220
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-pwMuIgs5.js +0 -345
- package/dist/Experience-BbE-c1Op.js +0 -221
- package/dist/Game-DQdRpaN-.js +0 -255
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-Dgmxzg4h.js +0 -316
- package/dist/Member-w23oRVwN.js +0 -69
- package/dist/MemberList-BLIdjznQ.js +0 -1735
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Dy_lMdZA.js +0 -432
- package/dist/Mission-Cjt0E083.js +0 -261
- package/dist/Point-CQJL3Ewu.js +0 -222
- package/dist/Promotion-BYViH3bu.js +0 -247
- package/dist/Segment-B9Jj1ak0.js +0 -437
- package/dist/Setting-DXWbgRxs.js +0 -1901
- package/dist/Store-Dswk2e_z.js +0 -1511
- package/dist/StoreRewards-CNUhG_Ue.js +0 -401
- package/dist/Transaction-BB-kk-84.js +0 -39
- package/dist/Voucher-b1_Jlm6X.js +0 -490
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-pG-SrXp9.js +0 -56
- package/dist/app-DCHKJoql.js +0 -5639
- package/dist/dto-jcK3TGB7.js +0 -2770
- package/dist/index-Cv7pLAYq.js +0 -3
- package/dist/index-LrSSauN2.js +0 -29193
- package/dist/money-BEATdGS6.js +0 -15
- package/dist/number-CeAYAKCp.js +0 -12
- package/dist/vue-i18n-BRhKDHdF.js +0 -2365
- package/dist/zod-Bg2FbC-D.js +0 -90
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feedmepos/mf-connect",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-prod",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@feedmepos/core": "^2.10.6",
|
|
19
|
-
"@feedmepos/ui-library": "1.3.5",
|
|
20
19
|
"@feedmepos/menu": "1.0.34",
|
|
21
|
-
"@feedmepos/mf-common": "1.
|
|
20
|
+
"@feedmepos/mf-common": "1.8.37",
|
|
22
21
|
"@feedmepos/mf-core-ui": "1.0.18",
|
|
22
|
+
"@feedmepos/ui-library": "1.3.5",
|
|
23
23
|
"@types/qrcode": "^1.5.5",
|
|
24
24
|
"axios": "^1.7.2",
|
|
25
25
|
"bson-objectid": "^2.0.4",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"dotenv": "^16.4.5",
|
|
30
30
|
"email-addresses": "^5.0.0",
|
|
31
31
|
"fabric": "^6.4.2",
|
|
32
|
-
"i18next": "24.2.1",
|
|
33
32
|
"firebase": "^10.12.4",
|
|
34
33
|
"lodash": "^4.17.21",
|
|
35
34
|
"moment": "^2.30.1",
|
|
@@ -39,13 +38,11 @@
|
|
|
39
38
|
"unplugin-auto-import": "^0.17.8",
|
|
40
39
|
"uuid": "^10.0.0",
|
|
41
40
|
"vite-plugin-vue-devtools": "^7.6.4",
|
|
42
|
-
"vue-i18n": "10.0.5",
|
|
43
41
|
"vue": "^3.4.33",
|
|
44
42
|
"vue-router": "^4.4.0",
|
|
45
43
|
"vue3-lottie": "^3.3.0",
|
|
46
44
|
"xlsx": "^0.18.5",
|
|
47
|
-
"zod": "3.22.4"
|
|
48
|
-
"zod-i18n-map": "2.27.0"
|
|
45
|
+
"zod": "3.22.4"
|
|
49
46
|
},
|
|
50
47
|
"devDependencies": {
|
|
51
48
|
"@types/lodash": "^4.17.7",
|
|
@@ -1,622 +0,0 @@
|
|
|
1
|
-
import { defineComponent as T, openBlock as s, createElementBlock as h, Fragment as U, renderList as M, createElementVNode as a, toDisplayString as A, createCommentVNode as B, resolveComponent as k, createBlock as O, withCtx as I, createVNode as v, unref as t, ref as x, computed as G, onMounted as K, watch as Y, isRef as H, createSlots as ee, createTextVNode as te, reactive as ae, onBeforeMount as ne, normalizeClass as le } from "vue";
|
|
2
|
-
import { _ as oe } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { f as se } from "./number-CeAYAKCp.js";
|
|
4
|
-
import { C as ie, F as re, a as ce } from "./dto-jcK3TGB7.js";
|
|
5
|
-
import { useRouter as W } from "vue-router";
|
|
6
|
-
import { c as L } from "./index-CWR3qYjb.js";
|
|
7
|
-
import { _ as ue } from "./ZodTextField.vue_vue_type_script_setup_true_lang-pG-SrXp9.js";
|
|
8
|
-
import { Z as me } from "./zod-Bg2FbC-D.js";
|
|
9
|
-
import { J as de } from "./JsonViewer-v8_C7l5N.js";
|
|
10
|
-
import { u as pe } from "./loading-CJ3nOovJ.js";
|
|
11
|
-
import { useSnackbar as fe } from "@feedmepos/ui-library";
|
|
12
|
-
import { u as ye } from "./app-wDQR6dpb.js";
|
|
13
|
-
import { g as ve } from "./object-qECH92oz.js";
|
|
14
|
-
import { u as ge } from "./campaign-MqcTb329.js";
|
|
15
|
-
import { u as _e } from "./membership-B1cmSRyk.js";
|
|
16
|
-
import { u as be } from "./vue-i18n-BRhKDHdF.js";
|
|
17
|
-
import { m as he } from "./index-0UYoh1-7.js";
|
|
18
|
-
const xe = { class: "divide-x flex flex-wrap" }, Ce = { class: "fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, ke = { class: "fm-typo-en-title-sm-800" }, Se = /* @__PURE__ */ T({
|
|
19
|
-
__name: "CampaignStat",
|
|
20
|
-
props: {
|
|
21
|
-
data: {
|
|
22
|
-
type: Object,
|
|
23
|
-
required: !0
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
setup(p) {
|
|
27
|
-
const f = p, r = [
|
|
28
|
-
{ label: "Credit Received", key: "CREDIT" },
|
|
29
|
-
{ label: "EXP Received", key: "POINT" },
|
|
30
|
-
{ label: "Points Received", key: "COIN" },
|
|
31
|
-
{ label: "Message Sent", key: "BROADCAST" },
|
|
32
|
-
{ label: "Vouchers Claimed", key: "VOUCHER" },
|
|
33
|
-
{ label: "Users Joined", key: "UNIQUE_USER" }
|
|
34
|
-
];
|
|
35
|
-
function u(S) {
|
|
36
|
-
var c;
|
|
37
|
-
return se((c = f.data) == null ? void 0 : c[S], 2, !0) || 0;
|
|
38
|
-
}
|
|
39
|
-
return (S, c) => (s(), h("div", xe, [
|
|
40
|
-
(s(), h(U, null, M(r, (n) => (s(), h(U, null, [
|
|
41
|
-
n.key in p.data ? (s(), h("div", {
|
|
42
|
-
key: n.key,
|
|
43
|
-
class: "px-16"
|
|
44
|
-
}, [
|
|
45
|
-
a("div", Ce, A(n.label), 1),
|
|
46
|
-
a("div", ke, A(u(n.key)), 1)
|
|
47
|
-
])) : B("", !0)
|
|
48
|
-
], 64))), 64))
|
|
49
|
-
]));
|
|
50
|
-
}
|
|
51
|
-
}), we = { class: "bg-fm-color-neutral-gray-100 gap-4 h-[30px] inline-flex items-center justify-center max-w-[250px] px-8 py-4 rounded-md" }, Fe = { class: "fm-typo-en-body-md-600 overflow-hidden select-none text-ellipsis text-fm-color-typo-secondary whitespace-nowrap" }, Ve = /* @__PURE__ */ T({
|
|
52
|
-
__name: "CampaignChip",
|
|
53
|
-
props: {
|
|
54
|
-
type: { type: String, required: !0 },
|
|
55
|
-
icon: {
|
|
56
|
-
type: Object,
|
|
57
|
-
default: () => ({ icon: "circle", color: "typo-sucess" })
|
|
58
|
-
},
|
|
59
|
-
label: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: ""
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
setup(p) {
|
|
65
|
-
const r = ie[p.type];
|
|
66
|
-
return (u, S) => {
|
|
67
|
-
const c = k("FmIcon"), n = k("FmTooltip");
|
|
68
|
-
return s(), O(n, {
|
|
69
|
-
variant: "plain",
|
|
70
|
-
placement: "top",
|
|
71
|
-
content: p.label
|
|
72
|
-
}, {
|
|
73
|
-
default: I(() => [
|
|
74
|
-
a("div", we, [
|
|
75
|
-
v(c, {
|
|
76
|
-
name: t(r).icon,
|
|
77
|
-
outline: "",
|
|
78
|
-
size: "sm"
|
|
79
|
-
}, null, 8, ["name"]),
|
|
80
|
-
a("div", Fe, A(p.label), 1),
|
|
81
|
-
v(c, {
|
|
82
|
-
name: p.icon.name,
|
|
83
|
-
color: p.icon.color,
|
|
84
|
-
size: "sm"
|
|
85
|
-
}, null, 8, ["name", "color"])
|
|
86
|
-
])
|
|
87
|
-
]),
|
|
88
|
-
_: 1
|
|
89
|
-
}, 8, ["content"]);
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
}), $e = { class: "flex flex-col" }, Ae = { class: "flex flex-nowrap items-center justify-between mb-12" }, Re = { class: "flex gap-4 items-center justify-start" }, Oe = { class: "fm-typo-en-title-sm-800" }, Ue = { class: "flex flex-wrap gap-4 items-center mb-16 overflow-y-hidden" }, Ee = /* @__PURE__ */ T({
|
|
93
|
-
__name: "CampaignGroup",
|
|
94
|
-
props: {
|
|
95
|
-
group: {
|
|
96
|
-
type: Object,
|
|
97
|
-
required: !0
|
|
98
|
-
},
|
|
99
|
-
onEdit: {
|
|
100
|
-
type: Function,
|
|
101
|
-
required: !0
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
emits: ["changed"],
|
|
105
|
-
setup(p, { emit: f }) {
|
|
106
|
-
W(), x(!1);
|
|
107
|
-
const r = p, u = x([]), S = G(
|
|
108
|
-
() => u.value.reduce(
|
|
109
|
-
(n, o) => ({ ...n, [o.type]: o.totalAmount }),
|
|
110
|
-
{}
|
|
111
|
-
)
|
|
112
|
-
), c = G(() => {
|
|
113
|
-
var n;
|
|
114
|
-
return ((n = r.group.pf_campaigns) == null ? void 0 : n.map((o) => ({
|
|
115
|
-
campaign: o,
|
|
116
|
-
label: o.name
|
|
117
|
-
}))) || [];
|
|
118
|
-
});
|
|
119
|
-
return K(async () => {
|
|
120
|
-
u.value = await L.readStats({
|
|
121
|
-
groupId: r.group._id.toString()
|
|
122
|
-
});
|
|
123
|
-
}), (n, o) => {
|
|
124
|
-
const i = k("FmButton"), l = k("FmCard");
|
|
125
|
-
return s(), O(l, {
|
|
126
|
-
class: "mb-24 p-24",
|
|
127
|
-
variant: "outlined"
|
|
128
|
-
}, {
|
|
129
|
-
default: I(() => [
|
|
130
|
-
a("div", $e, [
|
|
131
|
-
a("div", Ae, [
|
|
132
|
-
a("div", Re, [
|
|
133
|
-
a("div", Oe, A(p.group.name), 1),
|
|
134
|
-
v(i, {
|
|
135
|
-
icon: "edit",
|
|
136
|
-
variant: "tertiary",
|
|
137
|
-
onClick: o[0] || (o[0] = (y) => p.onEdit(p.group))
|
|
138
|
-
})
|
|
139
|
-
])
|
|
140
|
-
]),
|
|
141
|
-
a("div", Ue, [
|
|
142
|
-
(s(!0), h(U, null, M(t(c), (y) => (s(), O(Ve, {
|
|
143
|
-
key: n.index,
|
|
144
|
-
type: y.campaign.type,
|
|
145
|
-
label: y.label
|
|
146
|
-
}, null, 8, ["type", "label"]))), 128))
|
|
147
|
-
]),
|
|
148
|
-
v(Se, { data: t(S) }, null, 8, ["data"])
|
|
149
|
-
])
|
|
150
|
-
]),
|
|
151
|
-
_: 1
|
|
152
|
-
});
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
}), Pe = { class: "ml-32 flex flex-col" }, Be = /* @__PURE__ */ T({
|
|
156
|
-
__name: "CampaignCard",
|
|
157
|
-
props: {
|
|
158
|
-
title: {},
|
|
159
|
-
items: {},
|
|
160
|
-
modelValue: {}
|
|
161
|
-
},
|
|
162
|
-
emits: ["update:model-value"],
|
|
163
|
-
setup(p, { emit: f }) {
|
|
164
|
-
const r = p, u = f, S = (i) => {
|
|
165
|
-
i ? o.value = r.items.map((l) => l.value) : o.value = [], n.value = i, u("update:model-value", o.value);
|
|
166
|
-
}, c = (i) => {
|
|
167
|
-
o.value = i, n.value = i.length === r.items.length, u("update:model-value", i);
|
|
168
|
-
}, n = x(!1), o = x([]);
|
|
169
|
-
return Y(
|
|
170
|
-
() => r.modelValue,
|
|
171
|
-
() => {
|
|
172
|
-
o.value = r.modelValue.filter(
|
|
173
|
-
(i) => r.items.find((l) => l.value === i)
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
), K(() => {
|
|
177
|
-
o.value = r.modelValue.filter(
|
|
178
|
-
(i) => r.items.find((l) => l.value === i)
|
|
179
|
-
);
|
|
180
|
-
}), (i, l) => {
|
|
181
|
-
const y = k("FmCheckbox"), _ = k("FmCard");
|
|
182
|
-
return s(), O(_, {
|
|
183
|
-
variant: "outlined",
|
|
184
|
-
class: "p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3"
|
|
185
|
-
}, {
|
|
186
|
-
default: I(() => [
|
|
187
|
-
v(y, {
|
|
188
|
-
"model-value": t(n),
|
|
189
|
-
value: "1",
|
|
190
|
-
label: r.title,
|
|
191
|
-
indeterminate: t(o).length > 0,
|
|
192
|
-
"onUpdate:modelValue": S
|
|
193
|
-
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
194
|
-
a("div", Pe, [
|
|
195
|
-
(s(!0), h(U, null, M(r.items, (b, j) => (s(), O(y, {
|
|
196
|
-
key: j,
|
|
197
|
-
"model-value": t(o),
|
|
198
|
-
label: b.label,
|
|
199
|
-
value: b.value,
|
|
200
|
-
"onUpdate:modelValue": c
|
|
201
|
-
}, null, 8, ["model-value", "label", "value"]))), 128))
|
|
202
|
-
])
|
|
203
|
-
]),
|
|
204
|
-
_: 1
|
|
205
|
-
});
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
}), Ie = { class: "space-y-16" }, Ge = { class: "flex items-center" }, Me = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary w-[300px]" }, Le = { class: "space-y-[40px]" }, Te = /* @__PURE__ */ T({
|
|
209
|
-
__name: "LinkCampaign",
|
|
210
|
-
props: {
|
|
211
|
-
modelValue: {
|
|
212
|
-
type: Array,
|
|
213
|
-
required: !0
|
|
214
|
-
},
|
|
215
|
-
campaigns: {
|
|
216
|
-
type: Object,
|
|
217
|
-
required: !0
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
emits: ["update:model-value"],
|
|
221
|
-
setup(p, { emit: f }) {
|
|
222
|
-
const r = x(""), u = x([]), S = p, c = f, n = G(() => Object.entries(S.campaigns).reduce((i, [l, y]) => {
|
|
223
|
-
const _ = y.filter(
|
|
224
|
-
(b) => b.label.toLowerCase().includes(r.value.toLowerCase())
|
|
225
|
-
);
|
|
226
|
-
return _.length > 0 && (i[l] = _), i;
|
|
227
|
-
}, {}));
|
|
228
|
-
function o(i, l) {
|
|
229
|
-
u.value = u.value.filter(
|
|
230
|
-
(y) => !l.map((_) => _.value).includes(y)
|
|
231
|
-
), u.value = [.../* @__PURE__ */ new Set([...u.value, ...i])], c("update:model-value", u.value);
|
|
232
|
-
}
|
|
233
|
-
return K(() => {
|
|
234
|
-
u.value = S.modelValue;
|
|
235
|
-
}), (i, l) => {
|
|
236
|
-
const y = k("FmTextField");
|
|
237
|
-
return s(), h(U, null, [
|
|
238
|
-
v(de, { json: p.campaigns }, null, 8, ["json"]),
|
|
239
|
-
a("div", Ie, [
|
|
240
|
-
a("div", Ge, [
|
|
241
|
-
a("div", Me, A(t(u).length) + " campaign(s) linked ", 1),
|
|
242
|
-
v(y, {
|
|
243
|
-
modelValue: t(r),
|
|
244
|
-
"onUpdate:modelValue": l[0] || (l[0] = (_) => H(r) ? r.value = _ : null),
|
|
245
|
-
"prepend-icon": "search",
|
|
246
|
-
placeholder: "Search",
|
|
247
|
-
class: "w-full"
|
|
248
|
-
}, null, 8, ["modelValue"])
|
|
249
|
-
]),
|
|
250
|
-
a("div", Le, [
|
|
251
|
-
(s(!0), h(U, null, M(t(n), (_, b) => (s(), O(Be, {
|
|
252
|
-
"model-value": t(u),
|
|
253
|
-
title: b,
|
|
254
|
-
items: _,
|
|
255
|
-
"onUpdate:modelValue": (j) => o(j, _)
|
|
256
|
-
}, null, 8, ["model-value", "title", "items", "onUpdate:modelValue"]))), 256))
|
|
257
|
-
])
|
|
258
|
-
])
|
|
259
|
-
], 64);
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
}), je = { class: "flex items-center gap-x-8" }, De = {
|
|
263
|
-
key: 0,
|
|
264
|
-
class: "space-y-16 pr-12"
|
|
265
|
-
}, Ne = { class: "flex items-center gap-x-16" }, qe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, He = { class: "mt-16" }, Ke = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600 py-8 px-16 bg-gray-100" }, ze = { class: "flex justify-between items-center py-8 px-16 border-b-1" }, Je = { class: "flex items-center gap-8" }, We = /* @__PURE__ */ T({
|
|
266
|
-
__name: "AnalyticSheet",
|
|
267
|
-
emits: ["success"],
|
|
268
|
-
setup(p, { expose: f, emit: r }) {
|
|
269
|
-
const u = r, S = ye();
|
|
270
|
-
fe();
|
|
271
|
-
const c = x(!1), n = x(!1), o = {
|
|
272
|
-
name: "",
|
|
273
|
-
campaigns: []
|
|
274
|
-
}, i = x(""), l = x({ ...o }), y = re.superRefine((d, e) => {
|
|
275
|
-
}), _ = x([]), b = x(null), { global: j, minor: $ } = pe, w = G(() => {
|
|
276
|
-
const d = y.safeParse(l.value);
|
|
277
|
-
return d.success ? [] : d.error.errors;
|
|
278
|
-
});
|
|
279
|
-
function m(d) {
|
|
280
|
-
var e;
|
|
281
|
-
c.value = !0, d ? (b.value = { ...d }, l.value = { ...d, campaigns: (e = d.pf_campaigns) == null ? void 0 : e.map((g) => g._id) }) : (b.value = null, l.value = { ...o });
|
|
282
|
-
}
|
|
283
|
-
function F() {
|
|
284
|
-
c.value = !1, b.value = null;
|
|
285
|
-
}
|
|
286
|
-
function P() {
|
|
287
|
-
n.value = !0;
|
|
288
|
-
}
|
|
289
|
-
async function V() {
|
|
290
|
-
const d = await L.readAll({
|
|
291
|
-
limit: 1e3,
|
|
292
|
-
skip: 0,
|
|
293
|
-
sortBy: "_id",
|
|
294
|
-
search: "",
|
|
295
|
-
descending: !0
|
|
296
|
-
});
|
|
297
|
-
_.value = d.resources.filter(
|
|
298
|
-
(e) => !["MEMBERSHIP", "REWARD_POOL"].includes(e.type) && !["ISSUE_REWARD"].includes("event" in e ? e == null ? void 0 : e.event.type : "")
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
const D = G(() => {
|
|
302
|
-
const d = (g) => g.map((E) => ({
|
|
303
|
-
label: E.name,
|
|
304
|
-
value: E._id
|
|
305
|
-
}));
|
|
306
|
-
return ve(
|
|
307
|
-
_.value,
|
|
308
|
-
(g) => ce.formattedType(g.type),
|
|
309
|
-
d
|
|
310
|
-
);
|
|
311
|
-
}), R = G(() => Object.entries(D.value).reduce(
|
|
312
|
-
(d, [e, g]) => {
|
|
313
|
-
const E = g.filter((N) => {
|
|
314
|
-
var q, C;
|
|
315
|
-
return (C = (q = l.value) == null ? void 0 : q.campaigns) == null ? void 0 : C.includes(N.value);
|
|
316
|
-
}).filter(
|
|
317
|
-
(N) => N.label.toLowerCase().includes(i.value.toLowerCase())
|
|
318
|
-
);
|
|
319
|
-
return E.length > 0 && (d[e] = E), d;
|
|
320
|
-
},
|
|
321
|
-
{}
|
|
322
|
-
));
|
|
323
|
-
function z(d) {
|
|
324
|
-
var g, E;
|
|
325
|
-
const e = (g = l.value.campaigns) == null ? void 0 : g.indexOf(d);
|
|
326
|
-
e != null && e > -1 && ((E = l.value.campaigns) == null || E.splice(e, 1));
|
|
327
|
-
}
|
|
328
|
-
async function Z() {
|
|
329
|
-
y.safeParse(l.value).success && await $(
|
|
330
|
-
async () => {
|
|
331
|
-
var e;
|
|
332
|
-
b.value ? await L.updateGroup(
|
|
333
|
-
(e = b.value) == null ? void 0 : e._id,
|
|
334
|
-
l.value
|
|
335
|
-
) : await L.createGroup(l.value), u("success"), F();
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
message: "Saving group",
|
|
339
|
-
successMessage: "Group saved"
|
|
340
|
-
}
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
async function Q() {
|
|
344
|
-
await $(
|
|
345
|
-
async () => {
|
|
346
|
-
var d;
|
|
347
|
-
await L.deleteGroup((d = b.value) == null ? void 0 : d._id), u("success"), F();
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
message: "Deleting group",
|
|
351
|
-
successMessage: "Group deleted"
|
|
352
|
-
}
|
|
353
|
-
);
|
|
354
|
-
}
|
|
355
|
-
return K(async () => {
|
|
356
|
-
await V();
|
|
357
|
-
}), f({
|
|
358
|
-
showSheet: m,
|
|
359
|
-
hideSheet: F
|
|
360
|
-
}), (d, e) => {
|
|
361
|
-
const g = k("FmButton"), E = k("FmTextField"), N = k("FmList"), q = k("FmSideSheet");
|
|
362
|
-
return s(), O(q, {
|
|
363
|
-
modelValue: t(c),
|
|
364
|
-
"onUpdate:modelValue": e[7] || (e[7] = (C) => H(c) ? c.value = C : null),
|
|
365
|
-
header: t(b) ? "Edit group" : "Add group",
|
|
366
|
-
"dismiss-away": "",
|
|
367
|
-
"close-button": !0,
|
|
368
|
-
"max-width": 550
|
|
369
|
-
}, ee({
|
|
370
|
-
"side-sheet-footer": I(() => [
|
|
371
|
-
a("div", Je, [
|
|
372
|
-
t(n) ? B("", !0) : (s(), h(U, { key: 0 }, [
|
|
373
|
-
v(g, {
|
|
374
|
-
label: "Submit",
|
|
375
|
-
onClick: Z,
|
|
376
|
-
disabled: t(w).length > 0 || t(S).isLoading
|
|
377
|
-
}, null, 8, ["disabled"]),
|
|
378
|
-
v(g, {
|
|
379
|
-
label: "Cancel",
|
|
380
|
-
onClick: e[4] || (e[4] = (C) => F()),
|
|
381
|
-
variant: "tertiary"
|
|
382
|
-
}),
|
|
383
|
-
t(b) ? (s(), O(g, {
|
|
384
|
-
key: 0,
|
|
385
|
-
label: "Delete",
|
|
386
|
-
variant: "plain",
|
|
387
|
-
class: "ml-auto fm-color-system-error-300",
|
|
388
|
-
onClick: e[5] || (e[5] = (C) => Q())
|
|
389
|
-
})) : B("", !0)
|
|
390
|
-
], 64)),
|
|
391
|
-
t(n) ? (s(), O(g, {
|
|
392
|
-
key: 1,
|
|
393
|
-
label: "Confirm",
|
|
394
|
-
onClick: e[6] || (e[6] = (C) => n.value = !1)
|
|
395
|
-
})) : B("", !0)
|
|
396
|
-
])
|
|
397
|
-
]),
|
|
398
|
-
default: I(() => [
|
|
399
|
-
t(n) ? B("", !0) : (s(), h("div", De, [
|
|
400
|
-
e[9] || (e[9] = a("div", { class: "fm-typo-en-title-sm-800" }, "Group detail", -1)),
|
|
401
|
-
v(ue, {
|
|
402
|
-
modelValue: t(l).name,
|
|
403
|
-
"onUpdate:modelValue": e[1] || (e[1] = (C) => t(l).name = C),
|
|
404
|
-
label: "Name",
|
|
405
|
-
schema: t(me).typeAtPath(t(y), "name")
|
|
406
|
-
}, null, 8, ["modelValue", "schema"]),
|
|
407
|
-
e[10] || (e[10] = a("div", { class: "fm-typo-en-title-sm-800" }, "Link campaign", -1)),
|
|
408
|
-
a("div", Ne, [
|
|
409
|
-
a("div", qe, A(t(l).campaigns.length) + " campaign(s) linked ", 1),
|
|
410
|
-
v(E, {
|
|
411
|
-
modelValue: t(i),
|
|
412
|
-
"onUpdate:modelValue": e[2] || (e[2] = (C) => H(i) ? i.value = C : null),
|
|
413
|
-
"prepend-icon": "search",
|
|
414
|
-
placeholder: "Search",
|
|
415
|
-
class: "w-auto"
|
|
416
|
-
}, null, 8, ["modelValue"])
|
|
417
|
-
]),
|
|
418
|
-
v(g, {
|
|
419
|
-
variant: "plain",
|
|
420
|
-
icon: "link",
|
|
421
|
-
label: "Link Campaign",
|
|
422
|
-
onClick: P
|
|
423
|
-
})
|
|
424
|
-
])),
|
|
425
|
-
t(n) ? (s(), O(Te, {
|
|
426
|
-
key: 1,
|
|
427
|
-
modelValue: t(l).campaigns,
|
|
428
|
-
"onUpdate:modelValue": e[3] || (e[3] = (C) => t(l).campaigns = C),
|
|
429
|
-
campaigns: t(D)
|
|
430
|
-
}, null, 8, ["modelValue", "campaigns"])) : B("", !0),
|
|
431
|
-
a("div", He, [
|
|
432
|
-
t(n) ? B("", !0) : (s(!0), h(U, { key: 0 }, M(t(R), (C, X) => (s(), h("div", null, [
|
|
433
|
-
a("div", Ke, A(X), 1),
|
|
434
|
-
v(N, { separator: !0 }, {
|
|
435
|
-
default: I(() => [
|
|
436
|
-
(s(!0), h(U, null, M(C, (J) => (s(), h("div", ze, [
|
|
437
|
-
a("div", null, A(J.label), 1),
|
|
438
|
-
a("div", null, [
|
|
439
|
-
v(g, {
|
|
440
|
-
icon: "delete",
|
|
441
|
-
onClick: (st) => z(J.value),
|
|
442
|
-
variant: "tertiary"
|
|
443
|
-
}, null, 8, ["onClick"])
|
|
444
|
-
])
|
|
445
|
-
]))), 256))
|
|
446
|
-
]),
|
|
447
|
-
_: 2
|
|
448
|
-
}, 1024)
|
|
449
|
-
]))), 256))
|
|
450
|
-
])
|
|
451
|
-
]),
|
|
452
|
-
_: 2
|
|
453
|
-
}, [
|
|
454
|
-
t(n) ? {
|
|
455
|
-
name: "side-sheet-header",
|
|
456
|
-
fn: I(() => [
|
|
457
|
-
a("div", je, [
|
|
458
|
-
v(g, {
|
|
459
|
-
icon: "arrow_back",
|
|
460
|
-
variant: "tertiary",
|
|
461
|
-
onClick: e[0] || (e[0] = (C) => n.value = !1)
|
|
462
|
-
}),
|
|
463
|
-
e[8] || (e[8] = te("Link campaign "))
|
|
464
|
-
])
|
|
465
|
-
]),
|
|
466
|
-
key: "0"
|
|
467
|
-
} : void 0
|
|
468
|
-
]), 1032, ["modelValue", "header"]);
|
|
469
|
-
};
|
|
470
|
-
}
|
|
471
|
-
}), Ze = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Qe = { class: "space-y-16" }, Xe = { class: "flex items-center justify-end" }, Ye = { class: "fm-typo-en-body-lg-600" }, et = { class: "grid grid-cols-4 xs:grid-cols-2 gap-4 divide-x xs:divide-x-0" }, tt = { class: "fm-typo-body-md-400 fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, at = { class: "fm-typo-en-title-sm-800" }, nt = { class: "fm-typo-en-title-sm-800 text-center" }, lt = { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, ot = { class: "flex gap-16 items-center" }, St = /* @__PURE__ */ T({
|
|
472
|
-
__name: "Analytic",
|
|
473
|
-
setup(p) {
|
|
474
|
-
const { t: f } = be(), r = {
|
|
475
|
-
label: f("connect.analytic.addGroup"),
|
|
476
|
-
value: "create",
|
|
477
|
-
isPrimary: !0,
|
|
478
|
-
prependIcon: "add"
|
|
479
|
-
}, u = ge(), S = x(), c = x([]), n = x(""), o = ae({
|
|
480
|
-
totalCampaign: 0,
|
|
481
|
-
totalProgram: 0,
|
|
482
|
-
totalMember: 0
|
|
483
|
-
}), i = x("1"), l = [
|
|
484
|
-
{
|
|
485
|
-
key: f("connect.analytic.summary.totalCampaign"),
|
|
486
|
-
value: () => o.totalCampaign
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
key: f("connect.analytic.summary.totalProgram"),
|
|
490
|
-
value: () => o.totalProgram
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
key: f("connect.analytic.summary.totalMember"),
|
|
494
|
-
value: () => o.totalMember
|
|
495
|
-
}
|
|
496
|
-
];
|
|
497
|
-
function y(w) {
|
|
498
|
-
var m;
|
|
499
|
-
i.value = (/* @__PURE__ */ new Date()).toISOString(), (m = S.value) == null || m.showSheet(w);
|
|
500
|
-
}
|
|
501
|
-
async function _() {
|
|
502
|
-
await u.readGroups();
|
|
503
|
-
const w = await L.readAllGrouped({
|
|
504
|
-
limit: 100,
|
|
505
|
-
skip: 0,
|
|
506
|
-
sortBy: "_id",
|
|
507
|
-
search: "",
|
|
508
|
-
descending: !0
|
|
509
|
-
});
|
|
510
|
-
c.value = w.resources;
|
|
511
|
-
}
|
|
512
|
-
async function b() {
|
|
513
|
-
var F, P;
|
|
514
|
-
const w = await he.read({
|
|
515
|
-
limit: 1,
|
|
516
|
-
skip: 0,
|
|
517
|
-
sortBy: "_id",
|
|
518
|
-
search: "",
|
|
519
|
-
descending: !1
|
|
520
|
-
}), m = await L.readAll({
|
|
521
|
-
limit: 1e3,
|
|
522
|
-
skip: 0,
|
|
523
|
-
sortBy: "_id",
|
|
524
|
-
search: "",
|
|
525
|
-
descending: !1
|
|
526
|
-
});
|
|
527
|
-
o.totalCampaign = ((F = m.resources) == null ? void 0 : F.filter(
|
|
528
|
-
(V) => ["PROMOTION", "VOUCHER", "BROADCAST"].includes(V.type) && !["ISSUE_REWARD"].includes("event" in V ? V == null ? void 0 : V.event.type : "")
|
|
529
|
-
).length) ?? 0, o.totalProgram = ((P = m.resources) == null ? void 0 : P.filter(
|
|
530
|
-
(V) => ["POINT", "COIN", "CREDIT", "GAME"].includes(V.type)
|
|
531
|
-
).length) ?? 0, o.totalMember = w.meta.totalResources ?? 0;
|
|
532
|
-
}
|
|
533
|
-
const j = G(() => c.value.filter((w) => {
|
|
534
|
-
var m;
|
|
535
|
-
return w.name.includes(n.value) || ((m = w.pf_campaigns) == null ? void 0 : m.filter((F) => F.name.includes(n.value)).length);
|
|
536
|
-
})), $ = _e();
|
|
537
|
-
return W(), x(!0), G(() => {
|
|
538
|
-
var w, m, F, P;
|
|
539
|
-
return !$.storeOption || !$.storeOption.company ? -1 : !$.payoutAccount || !$.payoutAccount.enable || $.payoutAccount.status != "APPROVED" ? 0 : (m = (w = $.store) == null ? void 0 : w.categories) != null && m.length ? (P = (F = $.store) == null ? void 0 : F.categories) != null && P.some(
|
|
540
|
-
(V) => V.bundles.some((D) => D.isFeedvibe)
|
|
541
|
-
) ? 3 : 2 : 1;
|
|
542
|
-
}), ne(async () => {
|
|
543
|
-
await _(), await b(), await $.readMemberStore(), await $.readMembership(), await $.readPayoutAccount();
|
|
544
|
-
}), (w, m) => {
|
|
545
|
-
const F = k("FmPageHead"), P = k("FmSearch"), V = k("FmCard"), D = k("FmButton");
|
|
546
|
-
return k("FmIcon"), s(), h(U, null, [
|
|
547
|
-
v(F, {
|
|
548
|
-
title: t(f)("connect.analytic.title"),
|
|
549
|
-
actions: t(c).length > 0 ? [r] : [],
|
|
550
|
-
"onClick:action": m[0] || (m[0] = (R) => y())
|
|
551
|
-
}, null, 8, ["title", "actions"]),
|
|
552
|
-
a("div", Ze, [
|
|
553
|
-
a("div", Qe, [
|
|
554
|
-
a("div", Xe, [
|
|
555
|
-
v(P, {
|
|
556
|
-
class: "xs:hidden",
|
|
557
|
-
modelValue: t(n),
|
|
558
|
-
"onUpdate:modelValue": m[1] || (m[1] = (R) => H(n) ? n.value = R : null),
|
|
559
|
-
placeholder: t(f)("connect.analytic.search"),
|
|
560
|
-
collapsible: ""
|
|
561
|
-
}, null, 8, ["modelValue", "placeholder"])
|
|
562
|
-
]),
|
|
563
|
-
v(V, {
|
|
564
|
-
variant: "outlined",
|
|
565
|
-
class: "flex flex-col gap-16 p-16"
|
|
566
|
-
}, {
|
|
567
|
-
default: I(() => [
|
|
568
|
-
a("div", Ye, A(t(f)("connect.analytic.summary.title")), 1),
|
|
569
|
-
a("div", et, [
|
|
570
|
-
(s(), h(U, null, M(l, (R, z) => a("div", {
|
|
571
|
-
key: R.key,
|
|
572
|
-
class: le(["px-8", { "xs:!border-r": z % 2 == 0 }])
|
|
573
|
-
}, [
|
|
574
|
-
a("div", tt, A(R.key), 1),
|
|
575
|
-
a("div", at, A(R.value()), 1)
|
|
576
|
-
], 2)), 64))
|
|
577
|
-
])
|
|
578
|
-
]),
|
|
579
|
-
_: 1
|
|
580
|
-
})
|
|
581
|
-
]),
|
|
582
|
-
B("", !0),
|
|
583
|
-
t(c).length ? B("", !0) : (s(), O(V, {
|
|
584
|
-
key: 1,
|
|
585
|
-
variant: "outlined",
|
|
586
|
-
class: "flex flex-col gap-y-24 items-center p-16"
|
|
587
|
-
}, {
|
|
588
|
-
default: I(() => [
|
|
589
|
-
m[8] || (m[8] = a("img", {
|
|
590
|
-
src: oe,
|
|
591
|
-
class: "w-[150px]"
|
|
592
|
-
}, null, -1)),
|
|
593
|
-
a("div", nt, A(t(f)("connect.analytic.emptyState.title")), 1),
|
|
594
|
-
a("div", lt, A(t(f)("connect.analytic.emptyState.description")), 1),
|
|
595
|
-
a("div", ot, [
|
|
596
|
-
v(D, {
|
|
597
|
-
label: t(f)("connect.analytic.emptyState.action"),
|
|
598
|
-
icon: "add",
|
|
599
|
-
onClick: m[3] || (m[3] = (R) => y())
|
|
600
|
-
}, null, 8, ["label"])
|
|
601
|
-
])
|
|
602
|
-
]),
|
|
603
|
-
_: 1
|
|
604
|
-
})),
|
|
605
|
-
(s(!0), h(U, null, M(t(j), (R) => (s(), O(Ee, {
|
|
606
|
-
key: R._id.toString(),
|
|
607
|
-
group: R,
|
|
608
|
-
"on-edit": y
|
|
609
|
-
}, null, 8, ["group"]))), 128)),
|
|
610
|
-
v(We, {
|
|
611
|
-
ref_key: "sheetRef",
|
|
612
|
-
ref: S,
|
|
613
|
-
onSuccess: _
|
|
614
|
-
}, null, 512)
|
|
615
|
-
])
|
|
616
|
-
], 64);
|
|
617
|
-
};
|
|
618
|
-
}
|
|
619
|
-
});
|
|
620
|
-
export {
|
|
621
|
-
St as default
|
|
622
|
-
};
|