@feedmepos/mf-connect 0.1.3-prod → 0.1.5-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-CC5xdRtS.js +423 -0
- package/dist/{App-DvtYt9h5.js → App-CFLVGljI.js} +276 -275
- package/dist/Broadcast-B5OnLTNo.js +223 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DoH4RX_Y.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B6oleems.js} +8 -8
- package/dist/Card-Cw9Ts0qN.js +824 -0
- package/dist/{Collections-C5-k8WkG.js → Collections-CTEOsTLk.js} +4 -4
- package/dist/Credit-Bt2ntvn6.js +220 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCbvlp5V.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BaOM6fUL.js} +918 -901
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Dxyv9AzJ.js +345 -0
- package/dist/Experience-CdiCyjUs.js +221 -0
- package/dist/Game-CD07hjmT.js +255 -0
- package/dist/Marketing-CodbC8LJ.js +316 -0
- package/dist/Member-Cr8ki7-7.js +69 -0
- package/dist/{MemberList-CMefeirT.js → MemberList-_-IwGMer.js} +75 -75
- package/dist/{MemberTransactions-B9oYdzjR.js → MemberTransactions-B3LWcATC.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B0T7ze7r.js → MessageInput.vue_vue_type_script_setup_true_lang-DF-PHN1Z.js} +2 -2
- package/dist/Mission-BqR_oPzu.js +261 -0
- package/dist/Point-wI_0oL5d.js +222 -0
- package/dist/Promotion-Dx6CD3_V.js +253 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BGM1doWM.js → RuleGroup.vue_vue_type_script_setup_true_lang-DiaYx2vk.js} +15 -15
- package/dist/Segment-BzM2a7dM.js +565 -0
- package/dist/Setting-C8me75UN.js +1871 -0
- package/dist/Store-CT-y0pJ4.js +1530 -0
- package/dist/StoreRewards-l5qkiIy-.js +400 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-JumDBZLs.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DNyeXIL6.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BtBCggcN.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BYwjePth.js} +1 -1
- package/dist/{Tier-ms8r2E7c.js → Tier-gHTgMsQ3.js} +470 -445
- package/dist/{Title-BBKoBs46.js → Title-DQS7FHaO.js} +298 -282
- package/dist/Transaction-D7nTuNwj.js +39 -0
- package/dist/Voucher-Dr6IxBlt.js +490 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-Jh7OW6Wa.js +141 -0
- package/dist/{app-CGgrMOc_.js → app-BCgzIoKj.js} +1 -1
- package/dist/app-CbpXeslU.js +5639 -0
- package/dist/app.js +4 -3
- package/dist/{business-DeMUnCNX.js → business-DDhQna1e.js} +1 -1
- package/dist/{campaign-CBszI6An.js → campaign-CGa533e7.js} +2 -2
- package/dist/{collection.fn-D4Qgx1aW.js → collection.fn-CalTbTcW.js} +2 -2
- package/dist/dto-i36GeVm3.js +2770 -0
- package/dist/{effect-2p4_SGbQ.js → effect-DdEyoxWE.js} +1 -1
- package/dist/{email-addresses-Bc9od2gA.js → email-addresses-DJkhLbVW.js} +1 -1
- package/dist/{export-BK6FgeQO.js → export-g24Ga1Ru.js} +3 -3
- package/dist/{helper-DUkKW7uc.js → helper-BILtwZxJ.js} +1 -1
- package/dist/{index-Cvbyv9Hx.js → index-61n4HR_9.js} +1 -1
- package/dist/{index-AZ8cKg9n.js → index-BOwZO-JV.js} +1 -1
- package/dist/{index-M1SmasnI.js → index-BzskWtcd.js} +3 -3
- package/dist/{index-CTmiZrHu.js → index-CLA_3YPs.js} +1 -1
- package/dist/{index-B9f-K1No.js → index-Ca1erv2G.js} +2 -2
- package/dist/{index-BWWnWRpt.js → index-DgfFUabi.js} +2 -2
- package/dist/{index-Ci8tkzSn.js → index-GQ4JIFWE.js} +1 -1
- package/dist/{index-BFcrfL4W.js → index-ZcMWfKwl.js} +1 -1
- package/dist/{index-g4L04WYz.js → index-bkuptzmD.js} +91 -86
- package/dist/index-hp-LjMMQ.js +3 -0
- package/dist/{index-DRaETKbn.js → index-lYDskqcR.js} +258 -256
- package/dist/{index-D4HYMbSu.js → index-p3dozIB_.js} +3 -3
- package/dist/{index.esm2017-kvuav0Sd.js → index.esm2017-DeO7Sly1.js} +38 -38
- package/dist/{loading-MNCADfHc.js → loading-CqDGv2I6.js} +11 -11
- package/dist/{membership-CsbTF-DX.js → membership-aP_8YmFK.js} +3 -3
- package/dist/{money-Lo7kavmu.js → money-BmmtBTzl.js} +1 -1
- package/dist/{number-BviV2K5O.js → number-By8HkTkQ.js} +1 -1
- package/dist/{rule-DKrUrnrM.js → rule-CI2g3FmQ.js} +3 -3
- package/dist/{rule-builder-DjPniLk6.js → rule-builder-BCBsbe_y.js} +1 -1
- package/dist/{template-DteMEC9C.js → template-CRNz0-Qj.js} +4 -4
- package/dist/{usePagination-BKTq-UbV.js → usePagination-D4IC9efy.js} +1 -1
- package/dist/vue-i18n-0zlAmAlF.js +2365 -0
- package/package.json +7 -4
- package/dist/Analytic-DiPWt78u.js +0 -423
- package/dist/Broadcast-Dv4XcvBh.js +0 -216
- package/dist/Card-DDvwlZF0.js +0 -823
- package/dist/Credit-BDQIr_FJ.js +0 -214
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BQzgcn4V.js +0 -344
- package/dist/Experience-B9H3tOF0.js +0 -211
- package/dist/Game-cy3_ppLO.js +0 -250
- package/dist/Marketing-CWXV2n5F.js +0 -309
- package/dist/Member-DyTX22Zk.js +0 -92
- package/dist/Mission-DxSO3iES.js +0 -248
- package/dist/Point-C5UtlqkX.js +0 -220
- package/dist/Promotion-DhSGTj-R.js +0 -244
- package/dist/Segment-BzI6Ykxp.js +0 -564
- package/dist/Setting-SRUWwF9w.js +0 -1870
- package/dist/Store-CIrn_7Mh.js +0 -1533
- package/dist/StoreRewards-BYc0vgnr.js +0 -429
- package/dist/Transaction-IZL9-6fe.js +0 -36
- package/dist/Voucher-CIWulmcc.js +0 -485
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
- package/dist/app-BQvluJk_.js +0 -2974
- package/dist/dto-Dtvg93Bz.js +0 -1145
- package/dist/index-UR1Lxi0C.js +0 -11
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import { defineComponent as j, ref as y, watch as X, onMounted as I, resolveComponent as x, openBlock as d, createBlock as A, withCtx as L, createVNode as h, unref as t, createElementVNode as i, createElementBlock as k, Fragment as $, renderList as D, computed as G, toDisplayString as O, isRef as T, createSlots as Y, createCommentVNode as V, createTextVNode as ee, reactive as te, onBeforeMount as ae } from "vue";
|
|
2
|
+
import { _ as ne } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import "./index-p3dozIB_.js";
|
|
4
|
+
import { F as le, C as oe } from "./dto-i36GeVm3.js";
|
|
5
|
+
import { useRouter as se } from "vue-router";
|
|
6
|
+
import { c as R } from "./index-CLA_3YPs.js";
|
|
7
|
+
import { _ as re, Z as ie } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Jh7OW6Wa.js";
|
|
8
|
+
import { J as ue } from "./JsonViewer-v8_C7l5N.js";
|
|
9
|
+
import { u as ce } from "./loading-CqDGv2I6.js";
|
|
10
|
+
import { useSnackbar as me } from "@feedmepos/ui-library";
|
|
11
|
+
import { u as de } from "./app-wDQR6dpb.js";
|
|
12
|
+
import { g as pe } from "./object-qECH92oz.js";
|
|
13
|
+
import { u as ve } from "./campaign-CGa533e7.js";
|
|
14
|
+
import { u as fe } from "./membership-aP_8YmFK.js";
|
|
15
|
+
import { u as ye } from "./vue-i18n-0zlAmAlF.js";
|
|
16
|
+
const _e = { class: "ml-32 flex flex-col" }, ge = /* @__PURE__ */ j({
|
|
17
|
+
__name: "CampaignCard",
|
|
18
|
+
props: {
|
|
19
|
+
title: {},
|
|
20
|
+
items: {},
|
|
21
|
+
modelValue: {}
|
|
22
|
+
},
|
|
23
|
+
emits: ["update:model-value"],
|
|
24
|
+
setup(U, { emit: b }) {
|
|
25
|
+
const u = U, v = b, S = (o) => {
|
|
26
|
+
o ? p.value = u.items.map((a) => a.value) : p.value = [], r.value = o, v("update:model-value", p.value);
|
|
27
|
+
}, _ = (o) => {
|
|
28
|
+
p.value = o, r.value = o.length === u.items.length, v("update:model-value", o);
|
|
29
|
+
}, r = y(!1), p = y([]);
|
|
30
|
+
return X(
|
|
31
|
+
() => u.modelValue,
|
|
32
|
+
() => {
|
|
33
|
+
p.value = u.modelValue.filter(
|
|
34
|
+
(o) => u.items.find((a) => a.value === o)
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
), I(() => {
|
|
38
|
+
p.value = u.modelValue.filter(
|
|
39
|
+
(o) => u.items.find((a) => a.value === o)
|
|
40
|
+
);
|
|
41
|
+
}), (o, a) => {
|
|
42
|
+
const g = x("FmCheckbox"), l = x("FmCard");
|
|
43
|
+
return d(), A(l, {
|
|
44
|
+
variant: "outlined",
|
|
45
|
+
class: "p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3"
|
|
46
|
+
}, {
|
|
47
|
+
default: L(() => [
|
|
48
|
+
h(g, {
|
|
49
|
+
"model-value": t(r),
|
|
50
|
+
value: "1",
|
|
51
|
+
label: u.title,
|
|
52
|
+
indeterminate: t(p).length > 0,
|
|
53
|
+
"onUpdate:modelValue": S
|
|
54
|
+
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
55
|
+
i("div", _e, [
|
|
56
|
+
(d(!0), k($, null, D(u.items, (n, c) => (d(), A(g, {
|
|
57
|
+
key: c,
|
|
58
|
+
"model-value": t(p),
|
|
59
|
+
label: n.label,
|
|
60
|
+
value: n.value,
|
|
61
|
+
"onUpdate:modelValue": _
|
|
62
|
+
}, null, 8, ["model-value", "label", "value"]))), 128))
|
|
63
|
+
])
|
|
64
|
+
]),
|
|
65
|
+
_: 1
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}), he = { class: "space-y-16" }, be = { class: "flex items-center" }, xe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary w-[300px]" }, Ce = { class: "space-y-[40px]" }, ke = /* @__PURE__ */ j({
|
|
70
|
+
__name: "LinkCampaign",
|
|
71
|
+
props: {
|
|
72
|
+
modelValue: {
|
|
73
|
+
type: Array,
|
|
74
|
+
required: !0
|
|
75
|
+
},
|
|
76
|
+
campaigns: {
|
|
77
|
+
type: Object,
|
|
78
|
+
required: !0
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
emits: ["update:model-value"],
|
|
82
|
+
setup(U, { emit: b }) {
|
|
83
|
+
const u = y(""), v = y([]), S = U, _ = b, r = G(() => Object.entries(S.campaigns).reduce((o, [a, g]) => {
|
|
84
|
+
const l = g.filter(
|
|
85
|
+
(n) => n.label.toLowerCase().includes(u.value.toLowerCase())
|
|
86
|
+
);
|
|
87
|
+
return l.length > 0 && (o[a] = l), o;
|
|
88
|
+
}, {}));
|
|
89
|
+
function p(o, a) {
|
|
90
|
+
v.value = v.value.filter(
|
|
91
|
+
(g) => !a.map((l) => l.value).includes(g)
|
|
92
|
+
), v.value = [.../* @__PURE__ */ new Set([...v.value, ...o])], _("update:model-value", v.value);
|
|
93
|
+
}
|
|
94
|
+
return I(() => {
|
|
95
|
+
v.value = S.modelValue;
|
|
96
|
+
}), (o, a) => {
|
|
97
|
+
const g = x("FmTextField");
|
|
98
|
+
return d(), k($, null, [
|
|
99
|
+
h(ue, { json: U.campaigns }, null, 8, ["json"]),
|
|
100
|
+
i("div", he, [
|
|
101
|
+
i("div", be, [
|
|
102
|
+
i("div", xe, O(t(v).length) + " campaign(s) linked ", 1),
|
|
103
|
+
h(g, {
|
|
104
|
+
modelValue: t(u),
|
|
105
|
+
"onUpdate:modelValue": a[0] || (a[0] = (l) => T(u) ? u.value = l : null),
|
|
106
|
+
"prepend-icon": "search",
|
|
107
|
+
placeholder: "Search",
|
|
108
|
+
class: "w-full"
|
|
109
|
+
}, null, 8, ["modelValue"])
|
|
110
|
+
]),
|
|
111
|
+
i("div", Ce, [
|
|
112
|
+
(d(!0), k($, null, D(t(r), (l, n) => (d(), A(ge, {
|
|
113
|
+
"model-value": t(v),
|
|
114
|
+
title: n,
|
|
115
|
+
items: l,
|
|
116
|
+
"onUpdate:modelValue": (c) => p(c, l)
|
|
117
|
+
}, null, 8, ["model-value", "title", "items", "onUpdate:modelValue"]))), 256))
|
|
118
|
+
])
|
|
119
|
+
])
|
|
120
|
+
], 64);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
}), Ve = { class: "flex items-center gap-x-8" }, Se = {
|
|
124
|
+
key: 0,
|
|
125
|
+
class: "space-y-16 pr-12"
|
|
126
|
+
}, we = /* @__PURE__ */ i("div", { class: "fm-typo-en-title-sm-800" }, "Group detail", -1), Fe = /* @__PURE__ */ i("div", { class: "fm-typo-en-title-sm-800" }, "Link campaign", -1), Ae = { class: "flex items-center gap-x-16" }, $e = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ue = { class: "mt-16" }, Pe = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600 py-8 px-16 bg-gray-100" }, Le = { class: "flex justify-between items-center py-8 px-16 border-b-1" }, Ge = { class: "flex items-center gap-8" }, Me = /* @__PURE__ */ j({
|
|
127
|
+
__name: "AnalyticSheet",
|
|
128
|
+
emits: ["success"],
|
|
129
|
+
setup(U, { expose: b, emit: u }) {
|
|
130
|
+
const v = u, S = de();
|
|
131
|
+
me();
|
|
132
|
+
const _ = y(!1), r = y(!1), p = {
|
|
133
|
+
name: "",
|
|
134
|
+
campaigns: []
|
|
135
|
+
}, o = y(""), a = y({ ...p }), g = le.superRefine((s, e) => {
|
|
136
|
+
}), l = y([]), n = y(null), { global: c, minor: w } = ce, P = G(() => {
|
|
137
|
+
const s = g.safeParse(a.value);
|
|
138
|
+
return s.success ? [] : s.error.errors;
|
|
139
|
+
});
|
|
140
|
+
function M(s) {
|
|
141
|
+
var e;
|
|
142
|
+
_.value = !0, s ? (n.value = { ...s }, a.value = { ...s, campaigns: (e = s.pf_campaigns) == null ? void 0 : e.map((m) => m._id) }) : (n.value = null, a.value = { ...p });
|
|
143
|
+
}
|
|
144
|
+
function F() {
|
|
145
|
+
_.value = !1, n.value = null;
|
|
146
|
+
}
|
|
147
|
+
function K() {
|
|
148
|
+
r.value = !0;
|
|
149
|
+
}
|
|
150
|
+
async function W() {
|
|
151
|
+
const s = await R.readAll({
|
|
152
|
+
limit: 1e3,
|
|
153
|
+
skip: 0,
|
|
154
|
+
sortBy: "_id",
|
|
155
|
+
search: "",
|
|
156
|
+
descending: !0
|
|
157
|
+
});
|
|
158
|
+
l.value = s.resources.filter(
|
|
159
|
+
(e) => !["MEMBERSHIP", "REWARD_POOL"].includes(e.type) && !["ISSUE_REWARD"].includes("event" in e ? e == null ? void 0 : e.event.type : "")
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
const N = G(() => {
|
|
163
|
+
const s = (m) => m.map((C) => ({
|
|
164
|
+
label: C.name,
|
|
165
|
+
value: C._id
|
|
166
|
+
}));
|
|
167
|
+
return pe(
|
|
168
|
+
l.value,
|
|
169
|
+
(m) => oe.formattedType(m.type),
|
|
170
|
+
s
|
|
171
|
+
);
|
|
172
|
+
}), q = G(() => Object.entries(N.value).reduce(
|
|
173
|
+
(s, [e, m]) => {
|
|
174
|
+
const C = m.filter((B) => {
|
|
175
|
+
var E, f;
|
|
176
|
+
return (f = (E = a.value) == null ? void 0 : E.campaigns) == null ? void 0 : f.includes(B.value);
|
|
177
|
+
}).filter(
|
|
178
|
+
(B) => B.label.toLowerCase().includes(o.value.toLowerCase())
|
|
179
|
+
);
|
|
180
|
+
return C.length > 0 && (s[e] = C), s;
|
|
181
|
+
},
|
|
182
|
+
{}
|
|
183
|
+
));
|
|
184
|
+
function J(s) {
|
|
185
|
+
var m, C;
|
|
186
|
+
const e = (m = a.value.campaigns) == null ? void 0 : m.indexOf(s);
|
|
187
|
+
e != null && e > -1 && ((C = a.value.campaigns) == null || C.splice(e, 1));
|
|
188
|
+
}
|
|
189
|
+
async function Z() {
|
|
190
|
+
g.safeParse(a.value).success && await w(
|
|
191
|
+
async () => {
|
|
192
|
+
var e;
|
|
193
|
+
n.value ? await R.updateGroup(
|
|
194
|
+
(e = n.value) == null ? void 0 : e._id,
|
|
195
|
+
a.value
|
|
196
|
+
) : await R.createGroup(a.value), v("success"), F();
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
message: "Saving group",
|
|
200
|
+
successMessage: "Group saved"
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
async function z() {
|
|
205
|
+
await w(
|
|
206
|
+
async () => {
|
|
207
|
+
var s;
|
|
208
|
+
await R.deleteGroup((s = n.value) == null ? void 0 : s._id), v("success"), F();
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
message: "Deleting group",
|
|
212
|
+
successMessage: "Group deleted"
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
return I(async () => {
|
|
217
|
+
await W();
|
|
218
|
+
}), b({
|
|
219
|
+
showSheet: M,
|
|
220
|
+
hideSheet: F
|
|
221
|
+
}), (s, e) => {
|
|
222
|
+
const m = x("FmButton"), C = x("FmTextField"), B = x("FmList"), E = x("FmSideSheet");
|
|
223
|
+
return d(), A(E, {
|
|
224
|
+
modelValue: t(_),
|
|
225
|
+
"onUpdate:modelValue": e[7] || (e[7] = (f) => T(_) ? _.value = f : null),
|
|
226
|
+
header: t(n) ? "Edit group" : "Add group",
|
|
227
|
+
"dismiss-away": "",
|
|
228
|
+
"close-button": !0,
|
|
229
|
+
"max-width": 550
|
|
230
|
+
}, Y({
|
|
231
|
+
"side-sheet-footer": L(() => [
|
|
232
|
+
i("div", Ge, [
|
|
233
|
+
t(r) ? V("", !0) : (d(), k($, { key: 0 }, [
|
|
234
|
+
h(m, {
|
|
235
|
+
label: "Submit",
|
|
236
|
+
onClick: Z,
|
|
237
|
+
disabled: t(P).length > 0 || t(S).isLoading
|
|
238
|
+
}, null, 8, ["disabled"]),
|
|
239
|
+
h(m, {
|
|
240
|
+
label: "Cancel",
|
|
241
|
+
onClick: e[4] || (e[4] = (f) => F()),
|
|
242
|
+
variant: "tertiary"
|
|
243
|
+
}),
|
|
244
|
+
t(n) ? (d(), A(m, {
|
|
245
|
+
key: 0,
|
|
246
|
+
label: "Delete",
|
|
247
|
+
variant: "plain",
|
|
248
|
+
class: "ml-auto fm-color-system-error-300",
|
|
249
|
+
onClick: e[5] || (e[5] = (f) => z())
|
|
250
|
+
})) : V("", !0)
|
|
251
|
+
], 64)),
|
|
252
|
+
t(r) ? (d(), A(m, {
|
|
253
|
+
key: 1,
|
|
254
|
+
label: "Confirm",
|
|
255
|
+
onClick: e[6] || (e[6] = (f) => r.value = !1)
|
|
256
|
+
})) : V("", !0)
|
|
257
|
+
])
|
|
258
|
+
]),
|
|
259
|
+
default: L(() => [
|
|
260
|
+
t(r) ? V("", !0) : (d(), k("div", Se, [
|
|
261
|
+
we,
|
|
262
|
+
h(re, {
|
|
263
|
+
modelValue: t(a).name,
|
|
264
|
+
"onUpdate:modelValue": e[1] || (e[1] = (f) => t(a).name = f),
|
|
265
|
+
label: "Name",
|
|
266
|
+
schema: t(ie).typeAtPath(t(g), "name")
|
|
267
|
+
}, null, 8, ["modelValue", "schema"]),
|
|
268
|
+
Fe,
|
|
269
|
+
i("div", Ae, [
|
|
270
|
+
i("div", $e, O(t(a).campaigns.length) + " campaign(s) linked ", 1),
|
|
271
|
+
h(C, {
|
|
272
|
+
modelValue: t(o),
|
|
273
|
+
"onUpdate:modelValue": e[2] || (e[2] = (f) => T(o) ? o.value = f : null),
|
|
274
|
+
"prepend-icon": "search",
|
|
275
|
+
placeholder: "Search",
|
|
276
|
+
class: "w-auto"
|
|
277
|
+
}, null, 8, ["modelValue"])
|
|
278
|
+
]),
|
|
279
|
+
h(m, {
|
|
280
|
+
variant: "plain",
|
|
281
|
+
icon: "link",
|
|
282
|
+
label: "Link Campaign",
|
|
283
|
+
onClick: K
|
|
284
|
+
})
|
|
285
|
+
])),
|
|
286
|
+
t(r) ? (d(), A(ke, {
|
|
287
|
+
key: 1,
|
|
288
|
+
modelValue: t(a).campaigns,
|
|
289
|
+
"onUpdate:modelValue": e[3] || (e[3] = (f) => t(a).campaigns = f),
|
|
290
|
+
campaigns: t(N)
|
|
291
|
+
}, null, 8, ["modelValue", "campaigns"])) : V("", !0),
|
|
292
|
+
i("div", Ue, [
|
|
293
|
+
t(r) ? V("", !0) : (d(!0), k($, { key: 0 }, D(t(q), (f, Q) => (d(), k("div", null, [
|
|
294
|
+
i("div", Pe, O(Q), 1),
|
|
295
|
+
h(B, { separator: !0 }, {
|
|
296
|
+
default: L(() => [
|
|
297
|
+
(d(!0), k($, null, D(f, (H) => (d(), k("div", Le, [
|
|
298
|
+
i("div", null, O(H.label), 1),
|
|
299
|
+
i("div", null, [
|
|
300
|
+
h(m, {
|
|
301
|
+
icon: "delete",
|
|
302
|
+
onClick: (je) => J(H.value),
|
|
303
|
+
variant: "tertiary"
|
|
304
|
+
}, null, 8, ["onClick"])
|
|
305
|
+
])
|
|
306
|
+
]))), 256))
|
|
307
|
+
]),
|
|
308
|
+
_: 2
|
|
309
|
+
}, 1024)
|
|
310
|
+
]))), 256))
|
|
311
|
+
])
|
|
312
|
+
]),
|
|
313
|
+
_: 2
|
|
314
|
+
}, [
|
|
315
|
+
t(r) ? {
|
|
316
|
+
name: "side-sheet-header",
|
|
317
|
+
fn: L(() => [
|
|
318
|
+
i("div", Ve, [
|
|
319
|
+
h(m, {
|
|
320
|
+
icon: "arrow_back",
|
|
321
|
+
variant: "tertiary",
|
|
322
|
+
onClick: e[0] || (e[0] = (f) => r.value = !1)
|
|
323
|
+
}),
|
|
324
|
+
ee("Link campaign ")
|
|
325
|
+
])
|
|
326
|
+
]),
|
|
327
|
+
key: "0"
|
|
328
|
+
} : void 0
|
|
329
|
+
]), 1032, ["modelValue", "header"]);
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
}), Be = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Re = { class: "space-y-16" }, Ee = { class: "flex items-center justify-end" }, Oe = /* @__PURE__ */ i("img", {
|
|
333
|
+
src: ne,
|
|
334
|
+
class: "w-[150px]"
|
|
335
|
+
}, null, -1), De = /* @__PURE__ */ i("div", { class: "fm-typo-en-title-sm-800 text-center" }, " Analytics Dashboard Temporarily Unavailable ", -1), Te = /* @__PURE__ */ i("div", { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, " We apologize for the inconvenience. The analytics dashboard is currently under maintenance to improve your experience. Please check back later for updates on system availability. ", -1), nt = /* @__PURE__ */ j({
|
|
336
|
+
__name: "Analytic",
|
|
337
|
+
setup(U) {
|
|
338
|
+
const { t: b } = ye(), u = {
|
|
339
|
+
label: b("connect.analytic.addGroup"),
|
|
340
|
+
value: "create",
|
|
341
|
+
isPrimary: !0,
|
|
342
|
+
prependIcon: "add"
|
|
343
|
+
}, v = ve(), S = y(), _ = y([]), r = y(""), p = te({
|
|
344
|
+
totalCampaign: 0,
|
|
345
|
+
totalProgram: 0,
|
|
346
|
+
totalMember: 0
|
|
347
|
+
}), o = y("1");
|
|
348
|
+
b("connect.analytic.summary.totalCampaign"), b("connect.analytic.summary.totalProgram"), b("connect.analytic.summary.totalMember");
|
|
349
|
+
function a(n) {
|
|
350
|
+
var c;
|
|
351
|
+
o.value = (/* @__PURE__ */ new Date()).toISOString(), (c = S.value) == null || c.showSheet(n);
|
|
352
|
+
}
|
|
353
|
+
async function g() {
|
|
354
|
+
await v.readGroups();
|
|
355
|
+
const n = await R.readAllGrouped({
|
|
356
|
+
limit: 100,
|
|
357
|
+
skip: 0,
|
|
358
|
+
sortBy: "_id",
|
|
359
|
+
search: "",
|
|
360
|
+
descending: !0
|
|
361
|
+
});
|
|
362
|
+
_.value = n.resources;
|
|
363
|
+
}
|
|
364
|
+
G(() => _.value.filter((n) => {
|
|
365
|
+
var c;
|
|
366
|
+
return n.name.includes(r.value) || ((c = n.pf_campaigns) == null ? void 0 : c.filter((w) => w.name.includes(r.value)).length);
|
|
367
|
+
}));
|
|
368
|
+
const l = fe();
|
|
369
|
+
return se(), y(!0), G(() => {
|
|
370
|
+
var n, c, w, P;
|
|
371
|
+
return !l.storeOption || !l.storeOption.company ? -1 : !l.payoutAccount || !l.payoutAccount.enable || l.payoutAccount.status != "APPROVED" ? 0 : (c = (n = l.store) == null ? void 0 : n.categories) != null && c.length ? (P = (w = l.store) == null ? void 0 : w.categories) != null && P.some(
|
|
372
|
+
(M) => M.bundles.some((F) => F.isFeedvibe)
|
|
373
|
+
) ? 3 : 2 : 1;
|
|
374
|
+
}), ae(async () => {
|
|
375
|
+
await l.readMemberStore(), await l.readMembership(), await l.readPayoutAccount();
|
|
376
|
+
}), (n, c) => {
|
|
377
|
+
const w = x("FmPageHead"), P = x("FmSearch"), M = x("FmCard");
|
|
378
|
+
return x("FmButton"), x("FmIcon"), d(), k($, null, [
|
|
379
|
+
h(w, {
|
|
380
|
+
title: t(b)("connect.analytic.title"),
|
|
381
|
+
actions: t(_).length > 0 ? [u] : [],
|
|
382
|
+
"onClick:action": c[0] || (c[0] = (F) => a())
|
|
383
|
+
}, null, 8, ["title", "actions"]),
|
|
384
|
+
i("div", Be, [
|
|
385
|
+
i("div", Re, [
|
|
386
|
+
i("div", Ee, [
|
|
387
|
+
h(P, {
|
|
388
|
+
class: "xs:hidden",
|
|
389
|
+
modelValue: t(r),
|
|
390
|
+
"onUpdate:modelValue": c[1] || (c[1] = (F) => T(r) ? r.value = F : null),
|
|
391
|
+
placeholder: t(b)("connect.analytic.search"),
|
|
392
|
+
collapsible: ""
|
|
393
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
394
|
+
]),
|
|
395
|
+
V("", !0)
|
|
396
|
+
]),
|
|
397
|
+
V("", !0),
|
|
398
|
+
t(_).length ? V("", !0) : (d(), A(M, {
|
|
399
|
+
key: 1,
|
|
400
|
+
variant: "outlined",
|
|
401
|
+
class: "flex flex-col gap-y-24 items-center p-16"
|
|
402
|
+
}, {
|
|
403
|
+
default: L(() => [
|
|
404
|
+
Oe,
|
|
405
|
+
De,
|
|
406
|
+
Te
|
|
407
|
+
]),
|
|
408
|
+
_: 1
|
|
409
|
+
})),
|
|
410
|
+
V("", !0),
|
|
411
|
+
h(Me, {
|
|
412
|
+
ref_key: "sheetRef",
|
|
413
|
+
ref: S,
|
|
414
|
+
onSuccess: g
|
|
415
|
+
}, null, 512)
|
|
416
|
+
])
|
|
417
|
+
], 64);
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
export {
|
|
422
|
+
nt as default
|
|
423
|
+
};
|