@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,255 @@
|
|
|
1
|
+
import { defineComponent as D, ref as A, computed as H, onMounted as N, resolveComponent as r, openBlock as d, createElementBlock as x, Fragment as v, createVNode as i, unref as t, withCtx as h, createElementVNode as n, toDisplayString as l, renderList as q, createBlock as b, resolveDynamicComponent as z, h as p } from "vue";
|
|
2
|
+
import { _ as J } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as O, components as C } from "@feedmepos/ui-library";
|
|
4
|
+
import { u as Q, a as W, p as X } from "./loading-CqDGv2I6.js";
|
|
5
|
+
import { u as Y } from "./business-DDhQna1e.js";
|
|
6
|
+
import { u as Z } from "./campaign-CGa533e7.js";
|
|
7
|
+
import { g as B, a as $ } from "./dto-i36GeVm3.js";
|
|
8
|
+
import { _ as ee } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
9
|
+
import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BaOM6fUL.js";
|
|
10
|
+
import { u as oe } from "./template-CRNz0-Qj.js";
|
|
11
|
+
import { u as ae } from "./vue-i18n-0zlAmAlF.js";
|
|
12
|
+
import { c as w } from "./index-CLA_3YPs.js";
|
|
13
|
+
const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, le = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { class: "space-y-4" }, ue = { class: "fm-typo-en-body-lg-600" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = /* @__PURE__ */ n("img", {
|
|
14
|
+
src: J,
|
|
15
|
+
class: "aspect-square w-[150px]"
|
|
16
|
+
}, null, -1), _e = { class: "flex flex-col gap-16 text-center" }, he = { class: "fm-typo-en-title-sm-800" }, we = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ee = /* @__PURE__ */ D({
|
|
17
|
+
__name: "Game",
|
|
18
|
+
setup(xe) {
|
|
19
|
+
const { t: c } = ae(), E = {
|
|
20
|
+
label: c("connect.program.common.actions.create", {
|
|
21
|
+
type: c("connect.program.game.title").toLowerCase()
|
|
22
|
+
}),
|
|
23
|
+
value: "create",
|
|
24
|
+
isPrimary: !0,
|
|
25
|
+
prependIcon: "add"
|
|
26
|
+
}, K = oe("GAME", O()), f = Y(), m = Z(), { global: M, minor: k } = Q, s = A({
|
|
27
|
+
searchKey: "",
|
|
28
|
+
location: null
|
|
29
|
+
}), g = H(
|
|
30
|
+
() => m.campaigns.token.filter(
|
|
31
|
+
(e) => !s.value.location || !e.targetLocation || e.targetLocation.includes(s.value.location)
|
|
32
|
+
)
|
|
33
|
+
), R = [
|
|
34
|
+
{
|
|
35
|
+
header: "Program title",
|
|
36
|
+
accessorKey: "name",
|
|
37
|
+
// accessorFn: (v) => v.name,
|
|
38
|
+
cell(e) {
|
|
39
|
+
return p("div", { class: "flex items-center justify-between gap-4" }, [
|
|
40
|
+
p("div", { class: "flex items-center" }, [
|
|
41
|
+
p(
|
|
42
|
+
C.FmTooltip,
|
|
43
|
+
{
|
|
44
|
+
content: e.row.original._id,
|
|
45
|
+
onClick: (o) => {
|
|
46
|
+
o.stopPropagation(), W(e.row.original._id);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
[
|
|
50
|
+
p(C.FmIcon, {
|
|
51
|
+
name: "info",
|
|
52
|
+
outline: !0,
|
|
53
|
+
size: "sm"
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
)
|
|
57
|
+
]),
|
|
58
|
+
p("div", { class: "flex-1" }, e.row.original.name)
|
|
59
|
+
]);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
header: "Status",
|
|
64
|
+
cell(e) {
|
|
65
|
+
return B(e.row.original);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
header: "Summary",
|
|
70
|
+
accessorFn: (e) => $(e)
|
|
71
|
+
//v.effect,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
header: "Token received",
|
|
75
|
+
accessorFn: (e) => {
|
|
76
|
+
var o;
|
|
77
|
+
return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
header: "Actions",
|
|
82
|
+
cell(e) {
|
|
83
|
+
return p(C.FmButton, {
|
|
84
|
+
variant: "tertiary",
|
|
85
|
+
icon: "delete",
|
|
86
|
+
iconColor: "neutral-gray-400",
|
|
87
|
+
onClick: (o) => {
|
|
88
|
+
o.stopPropagation(), S(e.row.original);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
], F = A();
|
|
94
|
+
async function S(e) {
|
|
95
|
+
await X.remove(`Are you sure you want to remove ${e.name}?`) && await k(
|
|
96
|
+
async () => {
|
|
97
|
+
await w.delete(e._id), await m.read("GAME");
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
message: `Removing ${e.name}`,
|
|
101
|
+
successMessage: `Removed ${e.name} successfully`
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
async function y(e) {
|
|
106
|
+
e ? await o() : K.open(async (u) => {
|
|
107
|
+
await o(u);
|
|
108
|
+
});
|
|
109
|
+
async function o(u) {
|
|
110
|
+
var _;
|
|
111
|
+
(_ = F.value) == null || _.showSheet(
|
|
112
|
+
!0,
|
|
113
|
+
"GAME",
|
|
114
|
+
e ? await w.readById(e._id) : void 0,
|
|
115
|
+
u
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async function G(e) {
|
|
120
|
+
await k(
|
|
121
|
+
async () => {
|
|
122
|
+
e.campaign._id ? await w.update(e.campaign._id, e) : await w.create(e), await m.read("GAME");
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
message: `${e.campaign._id ? "Updating" : "Creating"} game program`,
|
|
126
|
+
successMessage: `Game program ${e.campaign._id ? "updated" : "created"} successfully`
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
return N(async () => {
|
|
131
|
+
await M(async () => {
|
|
132
|
+
await m.read("GAME"), await f.readPremium();
|
|
133
|
+
});
|
|
134
|
+
}), (e, o) => {
|
|
135
|
+
const u = r("FmPill"), _ = r("FmPageHead"), L = r("FmSearch"), I = r("FmTable"), P = r("FmButton"), T = r("FmListItem"), U = r("FmList"), j = r("FmCard");
|
|
136
|
+
return d(), x(v, null, [
|
|
137
|
+
i(_, {
|
|
138
|
+
actions: t(g).length > 0 && t(f).isPremium ? [E] : [],
|
|
139
|
+
"onClick:action": o[0] || (o[0] = () => y())
|
|
140
|
+
}, {
|
|
141
|
+
title: h(() => [
|
|
142
|
+
n("div", ne, [
|
|
143
|
+
n("span", se, l(t(c)("connect.program.game.title")), 1),
|
|
144
|
+
i(u, { variant: "premium" })
|
|
145
|
+
])
|
|
146
|
+
]),
|
|
147
|
+
_: 1
|
|
148
|
+
}, 8, ["actions"]),
|
|
149
|
+
n("div", ie, [
|
|
150
|
+
i(L, {
|
|
151
|
+
modelValue: t(s).searchKey,
|
|
152
|
+
"onUpdate:modelValue": o[1] || (o[1] = (a) => t(s).searchKey = a),
|
|
153
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
154
|
+
placeholder: "search",
|
|
155
|
+
collapsible: ""
|
|
156
|
+
}, null, 8, ["modelValue"]),
|
|
157
|
+
t(m).campaigns.token && t(m).campaigns.token.length > 0 ? (d(), x(v, { key: 0 }, [
|
|
158
|
+
n("div", re, [
|
|
159
|
+
n("div", le, [
|
|
160
|
+
i(ee, {
|
|
161
|
+
modelValue: t(s).location,
|
|
162
|
+
"onUpdate:modelValue": o[2] || (o[2] = (a) => t(s).location = a),
|
|
163
|
+
label: "Location: ",
|
|
164
|
+
"show-item-label": !0,
|
|
165
|
+
icon: "storefront",
|
|
166
|
+
placement: "bottom-start",
|
|
167
|
+
items: t(f).locationItems
|
|
168
|
+
}, null, 8, ["modelValue", "items"])
|
|
169
|
+
]),
|
|
170
|
+
i(L, {
|
|
171
|
+
modelValue: t(s).searchKey,
|
|
172
|
+
"onUpdate:modelValue": o[3] || (o[3] = (a) => t(s).searchKey = a),
|
|
173
|
+
class: "xs:hidden",
|
|
174
|
+
placeholder: "search",
|
|
175
|
+
collapsible: ""
|
|
176
|
+
}, null, 8, ["modelValue"])
|
|
177
|
+
]),
|
|
178
|
+
i(I, {
|
|
179
|
+
class: "xs:hidden",
|
|
180
|
+
"row-data": t(g),
|
|
181
|
+
"column-defs": R,
|
|
182
|
+
"search-value": t(s).searchKey,
|
|
183
|
+
"column-filter": [],
|
|
184
|
+
onRowClick: o[4] || (o[4] = (a) => y(a.original)),
|
|
185
|
+
"hide-footer": t(g).length < 10
|
|
186
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
187
|
+
i(U, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
188
|
+
default: h(() => [
|
|
189
|
+
(d(!0), x(v, null, q(t(g).filter(
|
|
190
|
+
(a) => a.name.toLowerCase().includes(t(s).searchKey.toLowerCase())
|
|
191
|
+
), (a) => (d(), b(T, {
|
|
192
|
+
key: a._id.toString(),
|
|
193
|
+
onClick: (V) => y(a),
|
|
194
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
195
|
+
}, {
|
|
196
|
+
default: h(() => [
|
|
197
|
+
n("div", ce, [
|
|
198
|
+
n("div", me, [
|
|
199
|
+
(d(), b(z(t(B)(a)))),
|
|
200
|
+
n("div", de, l(a.currentReceive ?? 0) + " used ", 1)
|
|
201
|
+
]),
|
|
202
|
+
n("div", pe, [
|
|
203
|
+
n("div", ue, l(a.name), 1),
|
|
204
|
+
n("div", fe, l(t($)(a)), 1)
|
|
205
|
+
]),
|
|
206
|
+
n("div", ge, l(t(c)("program.game.token_received", {
|
|
207
|
+
count: a.currentReceive ?? 0
|
|
208
|
+
})), 1)
|
|
209
|
+
]),
|
|
210
|
+
i(P, {
|
|
211
|
+
icon: "delete",
|
|
212
|
+
"icon-color": "neutral-gray-400",
|
|
213
|
+
variant: "tertiary",
|
|
214
|
+
onClick: (V) => (V.stopPropagation(), S(a))
|
|
215
|
+
}, null, 8, ["onClick"])
|
|
216
|
+
]),
|
|
217
|
+
_: 2
|
|
218
|
+
}, 1032, ["onClick"]))), 128))
|
|
219
|
+
]),
|
|
220
|
+
_: 1
|
|
221
|
+
})
|
|
222
|
+
], 64)) : (d(), b(j, {
|
|
223
|
+
key: 1,
|
|
224
|
+
variant: "outlined",
|
|
225
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
226
|
+
}, {
|
|
227
|
+
default: h(() => [
|
|
228
|
+
ye,
|
|
229
|
+
n("div", _e, [
|
|
230
|
+
n("div", he, l(t(c)("connect.program.game.empty_state.title")), 1),
|
|
231
|
+
n("div", we, l(t(c)("connect.program.game.empty_state.description")), 1)
|
|
232
|
+
]),
|
|
233
|
+
i(P, {
|
|
234
|
+
variant: "primary",
|
|
235
|
+
label: "Create game program",
|
|
236
|
+
icon: "add",
|
|
237
|
+
disabled: !t(f).isPremium,
|
|
238
|
+
onClick: o[5] || (o[5] = (a) => y())
|
|
239
|
+
}, null, 8, ["disabled"])
|
|
240
|
+
]),
|
|
241
|
+
_: 1
|
|
242
|
+
})),
|
|
243
|
+
i(te, {
|
|
244
|
+
ref_key: "sheetRef",
|
|
245
|
+
ref: F,
|
|
246
|
+
"onSubmit:modelValue": G
|
|
247
|
+
}, null, 512)
|
|
248
|
+
])
|
|
249
|
+
], 64);
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
export {
|
|
254
|
+
Ee as default
|
|
255
|
+
};
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { openBlock as m, createElementBlock as p, defineComponent as z, ref as S, onMounted as Y, computed as H, h as J, resolveComponent as c, Fragment as x, createVNode as i, unref as r, createElementVNode as s, withCtx as F, renderList as $, createBlock as B, toDisplayString as f, createCommentVNode as j } from "vue";
|
|
2
|
+
import { _ as q } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { components as G } from "@feedmepos/ui-library";
|
|
4
|
+
import { p as X, u as Q } from "./loading-CqDGv2I6.js";
|
|
5
|
+
import { defineStore as W } from "pinia";
|
|
6
|
+
import { F as C } from "./index-GQ4JIFWE.js";
|
|
7
|
+
import { useCoreStore as Z } from "@feedmepos/mf-common";
|
|
8
|
+
import { g as h, S as ee, b as te } from "./index-p3dozIB_.js";
|
|
9
|
+
import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
|
+
import { u as ae } from "./campaign-CGa533e7.js";
|
|
11
|
+
import { h as oe } from "./moment-BWErdI6_.js";
|
|
12
|
+
import { u as re } from "./vue-i18n-0zlAmAlF.js";
|
|
13
|
+
var se = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedme.cc" };
|
|
14
|
+
const y = () => {
|
|
15
|
+
const o = ee.getBusinessId();
|
|
16
|
+
if (!o) throw new Error("Invalid business ID");
|
|
17
|
+
return te(`businesses/${o}/marketing-materials/`, {
|
|
18
|
+
url: se.backendUrl,
|
|
19
|
+
noIdRequired: !0
|
|
20
|
+
});
|
|
21
|
+
}, L = {
|
|
22
|
+
async read() {
|
|
23
|
+
return h(await y().get(""));
|
|
24
|
+
},
|
|
25
|
+
async createMarketing(o) {
|
|
26
|
+
return h(await y().post("", o));
|
|
27
|
+
},
|
|
28
|
+
// add id
|
|
29
|
+
async updateMarketing(o, t) {
|
|
30
|
+
return h(
|
|
31
|
+
await y().put(o, t)
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
async deleteMarketing(o) {
|
|
35
|
+
return h(await y().delete(o));
|
|
36
|
+
}
|
|
37
|
+
}, I = W("mf-connect-marketing", {
|
|
38
|
+
state: () => {
|
|
39
|
+
var o, t;
|
|
40
|
+
return {
|
|
41
|
+
marketing: [],
|
|
42
|
+
defaultMarketing: {
|
|
43
|
+
_id: void 0,
|
|
44
|
+
business: ((t = (o = Z().currentBusiness) == null ? void 0 : o.value) == null ? void 0 : t._id) ?? "",
|
|
45
|
+
name: "",
|
|
46
|
+
campaign: null,
|
|
47
|
+
keywords: "",
|
|
48
|
+
image: "",
|
|
49
|
+
headline: {
|
|
50
|
+
content: "",
|
|
51
|
+
key: void 0
|
|
52
|
+
},
|
|
53
|
+
assets: [
|
|
54
|
+
{
|
|
55
|
+
platform: C.enum.FACEBOOK,
|
|
56
|
+
contents: [
|
|
57
|
+
{
|
|
58
|
+
type: "POST",
|
|
59
|
+
size: {
|
|
60
|
+
width: 1920,
|
|
61
|
+
height: 1080
|
|
62
|
+
},
|
|
63
|
+
images: []
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: "STORY",
|
|
67
|
+
size: {
|
|
68
|
+
width: 1080,
|
|
69
|
+
height: 1920
|
|
70
|
+
},
|
|
71
|
+
images: []
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
platform: C.enum.INSTAGRAM,
|
|
77
|
+
contents: [
|
|
78
|
+
{
|
|
79
|
+
type: "POST",
|
|
80
|
+
size: {
|
|
81
|
+
width: 1080,
|
|
82
|
+
height: 1080
|
|
83
|
+
},
|
|
84
|
+
images: []
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
type: "STORY",
|
|
88
|
+
size: {
|
|
89
|
+
width: 1080,
|
|
90
|
+
height: 1920
|
|
91
|
+
},
|
|
92
|
+
images: []
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: "REEL",
|
|
96
|
+
size: {
|
|
97
|
+
width: 1080,
|
|
98
|
+
height: 1920
|
|
99
|
+
},
|
|
100
|
+
images: []
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
platform: C.enum.BRAND_APP,
|
|
106
|
+
contents: [
|
|
107
|
+
{
|
|
108
|
+
type: "IMAGE",
|
|
109
|
+
size: {
|
|
110
|
+
width: 1080,
|
|
111
|
+
height: 1920
|
|
112
|
+
},
|
|
113
|
+
images: []
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
captions: [{ language: "en", content: "" }]
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
actions: {
|
|
123
|
+
async readMarketingMaterial() {
|
|
124
|
+
const o = await L.read();
|
|
125
|
+
this.marketing = o;
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
getters: {
|
|
129
|
+
state(o) {
|
|
130
|
+
return o;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}), ie = {};
|
|
134
|
+
function le(o, t) {
|
|
135
|
+
return m(), p("div");
|
|
136
|
+
}
|
|
137
|
+
const ce = /* @__PURE__ */ ne(ie, [["render", le]]), me = { class: "px-24 flex flex-col gap-y-16" }, de = { class: "flex items-center justify-between w-full" }, pe = { class: "space-y-8" }, ue = { class: "fm-typo-en-body-lg-600" }, ge = { class: "fm-typo-en-body-lg-600" }, fe = { key: 0 }, he = /* @__PURE__ */ s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1), ye = [
|
|
138
|
+
he
|
|
139
|
+
], ke = /* @__PURE__ */ s("img", {
|
|
140
|
+
src: q,
|
|
141
|
+
class: "w-[150px]"
|
|
142
|
+
}, null, -1), _e = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary w-4/6 text-center" }, Be = /* @__PURE__ */ z({
|
|
143
|
+
__name: "Marketing",
|
|
144
|
+
setup(o) {
|
|
145
|
+
const { t } = re(), O = {
|
|
146
|
+
label: t("connect.marketing.create"),
|
|
147
|
+
value: "create",
|
|
148
|
+
isPrimary: !0,
|
|
149
|
+
prependIcon: "add"
|
|
150
|
+
}, k = S(!1), _ = I(), b = ae(), { global: N, minor: U } = Q;
|
|
151
|
+
Y(async () => {
|
|
152
|
+
await N(async () => {
|
|
153
|
+
await b.read(), await _.readMarketingMaterial();
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
const d = H(() => _.marketing.filter(
|
|
157
|
+
(n) => n.name.includes(l.value.searchKey.toLowerCase())
|
|
158
|
+
)), u = S(
|
|
159
|
+
I().defaultMarketing
|
|
160
|
+
), D = [
|
|
161
|
+
{
|
|
162
|
+
header: t("connect.marketing.table.name"),
|
|
163
|
+
accessorFn: (n) => n.name
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
header: t("connect.marketing.table.campaign"),
|
|
167
|
+
accessorFn: (n) => {
|
|
168
|
+
var e;
|
|
169
|
+
return n.campaign === null || n.campaign === void 0 ? "-" : (e = b.campaigns.all.find(
|
|
170
|
+
(v) => v._id === n.campaign
|
|
171
|
+
)) == null ? void 0 : e.name;
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
header: t("connect.marketing.table.createdDate"),
|
|
176
|
+
accessorFn: (n) => {
|
|
177
|
+
const e = new Date(
|
|
178
|
+
parseInt(n._id.toString().substring(0, 8), 16) * 1e3
|
|
179
|
+
);
|
|
180
|
+
return oe(e).format("DD MMM YYYY");
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
header: t("connect.marketing.table.actions"),
|
|
185
|
+
cell(n) {
|
|
186
|
+
return J(G.FmButton, {
|
|
187
|
+
variant: "tertiary",
|
|
188
|
+
icon: "delete",
|
|
189
|
+
iconColor: "neutral-gray-400",
|
|
190
|
+
onClick: (e) => {
|
|
191
|
+
e.stopPropagation(), V(n.row.original);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
];
|
|
197
|
+
async function V(n) {
|
|
198
|
+
await X.remove(
|
|
199
|
+
t("marketing.delete.confirm", { name: n.name })
|
|
200
|
+
) && await U(
|
|
201
|
+
async () => {
|
|
202
|
+
await L.deleteMarketing(n._id), await _.readMarketingMaterial();
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
message: t("marketing.delete.removing", { name: n.name }),
|
|
206
|
+
successMessage: t("marketing.delete.success", { name: n.name })
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
async function g(n) {
|
|
211
|
+
n ? u.value = JSON.parse(JSON.stringify(n)) : u.value = JSON.parse(
|
|
212
|
+
JSON.stringify(I().defaultMarketing)
|
|
213
|
+
), k.value = !0;
|
|
214
|
+
}
|
|
215
|
+
const l = S({
|
|
216
|
+
searchKey: ""
|
|
217
|
+
});
|
|
218
|
+
return (n, e) => {
|
|
219
|
+
const v = c("FmPageHead"), P = c("FmSearch"), E = c("FmTable"), T = c("FmButton"), K = c("FmListItem"), A = c("FmList"), R = c("FmCard");
|
|
220
|
+
return m(), p(x, null, [
|
|
221
|
+
i(v, {
|
|
222
|
+
title: r(t)("connect.marketing.title"),
|
|
223
|
+
class: "xs:hidden",
|
|
224
|
+
actions: r(d).length > 0 ? [O] : [],
|
|
225
|
+
"onClick:action": e[0] || (e[0] = () => g())
|
|
226
|
+
}, null, 8, ["title", "actions"]),
|
|
227
|
+
s("div", me, [
|
|
228
|
+
i(P, {
|
|
229
|
+
modelValue: l.value.searchKey,
|
|
230
|
+
"onUpdate:modelValue": e[1] || (e[1] = (a) => l.value.searchKey = a),
|
|
231
|
+
placeholder: r(t)("connect.marketing.search"),
|
|
232
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
233
|
+
collapsible: ""
|
|
234
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
235
|
+
i(ce, {
|
|
236
|
+
modelValue: u.value,
|
|
237
|
+
"onUpdate:modelValue": e[2] || (e[2] = (a) => u.value = a),
|
|
238
|
+
"is-open": k.value,
|
|
239
|
+
"onUpdate:isOpen": e[3] || (e[3] = (a) => k.value = a)
|
|
240
|
+
}, null, 8, ["modelValue", "is-open"]),
|
|
241
|
+
r(d).length > 0 ? (m(), p(x, { key: 0 }, [
|
|
242
|
+
s("div", de, [
|
|
243
|
+
i(P, {
|
|
244
|
+
modelValue: l.value.searchKey,
|
|
245
|
+
"onUpdate:modelValue": e[4] || (e[4] = (a) => l.value.searchKey = a),
|
|
246
|
+
class: "xs:hidden",
|
|
247
|
+
placeholder: r(t)("connect.marketing.search"),
|
|
248
|
+
collapsible: ""
|
|
249
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
250
|
+
]),
|
|
251
|
+
i(E, {
|
|
252
|
+
class: "xs:hidden",
|
|
253
|
+
"row-data": r(d),
|
|
254
|
+
"column-defs": D,
|
|
255
|
+
"search-value": l.value.searchKey,
|
|
256
|
+
"column-filter": [],
|
|
257
|
+
onRowClick: e[5] || (e[5] = (a) => g(a.original)),
|
|
258
|
+
"hide-footer": !0
|
|
259
|
+
}, null, 8, ["row-data", "search-value"]),
|
|
260
|
+
i(A, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
261
|
+
default: F(() => [
|
|
262
|
+
(m(!0), p(x, null, $(r(d).filter(
|
|
263
|
+
(a) => a.name.toLowerCase().includes(l.value.searchKey.toLowerCase())
|
|
264
|
+
), (a) => (m(), B(K, {
|
|
265
|
+
key: a._id.toString(),
|
|
266
|
+
onClick: (w) => g(a),
|
|
267
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
268
|
+
}, {
|
|
269
|
+
default: F(() => {
|
|
270
|
+
var w;
|
|
271
|
+
return [
|
|
272
|
+
s("div", pe, [
|
|
273
|
+
s("div", ue, f(a.name), 1),
|
|
274
|
+
s("div", ge, f(a.campaign === null || a.campaign === void 0 ? "-" : (w = r(b).campaigns.all.find(
|
|
275
|
+
(M) => M._id === a.campaign
|
|
276
|
+
)) == null ? void 0 : w.name), 1)
|
|
277
|
+
]),
|
|
278
|
+
i(T, {
|
|
279
|
+
icon: "delete",
|
|
280
|
+
"icon-color": "neutral-gray-400",
|
|
281
|
+
variant: "tertiary",
|
|
282
|
+
onClick: (M) => (M.stopPropagation(), V(a))
|
|
283
|
+
}, null, 8, ["onClick"])
|
|
284
|
+
];
|
|
285
|
+
}),
|
|
286
|
+
_: 2
|
|
287
|
+
}, 1032, ["onClick"]))), 128))
|
|
288
|
+
]),
|
|
289
|
+
_: 1
|
|
290
|
+
}),
|
|
291
|
+
r(d).length == 0 ? (m(), p("div", fe, ye)) : j("", !0)
|
|
292
|
+
], 64)) : (m(), B(R, {
|
|
293
|
+
key: 1,
|
|
294
|
+
variant: "outlined",
|
|
295
|
+
class: "w-full justify-center items-center flex flex-col p-[24px] gap-[24px]"
|
|
296
|
+
}, {
|
|
297
|
+
default: F(() => [
|
|
298
|
+
ke,
|
|
299
|
+
s("p", _e, f(r(t)("connect.marketing.emptyState.title")), 1),
|
|
300
|
+
s("p", be, f(r(t)("connect.marketing.emptyState.description")), 1),
|
|
301
|
+
i(T, {
|
|
302
|
+
label: r(t)("connect.marketing.emptyState.action"),
|
|
303
|
+
"prepend-icon": "add",
|
|
304
|
+
onClick: e[6] || (e[6] = (a) => g())
|
|
305
|
+
}, null, 8, ["label"])
|
|
306
|
+
]),
|
|
307
|
+
_: 1
|
|
308
|
+
}))
|
|
309
|
+
])
|
|
310
|
+
], 64);
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
export {
|
|
315
|
+
Be as default
|
|
316
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { defineComponent as f, computed as T, ref as d, watch as k, resolveComponent as s, openBlock as _, createElementBlock as B, Fragment as E, createVNode as b, unref as n, createElementVNode as y, createBlock as A, createCommentVNode as L } from "vue";
|
|
2
|
+
import "./index-hp-LjMMQ.js";
|
|
3
|
+
import { u as M } from "./vue-i18n-0zlAmAlF.js";
|
|
4
|
+
import { useRouter as N } from "vue-router";
|
|
5
|
+
import { m as Y } from "./index-BOwZO-JV.js";
|
|
6
|
+
import { R as i } from "./app-CbpXeslU.js";
|
|
7
|
+
const h = { class: "px-24 flex flex-col gap-y-16 pb-24" }, g = /* @__PURE__ */ f({
|
|
8
|
+
__name: "Member",
|
|
9
|
+
setup(w) {
|
|
10
|
+
const e = N(), { t: p } = M(), o = [
|
|
11
|
+
{
|
|
12
|
+
label: p("connect.loyalty.member.tabs.member_list"),
|
|
13
|
+
value: i["$connect-LOYALTY_MEMBER_LIST"],
|
|
14
|
+
actions: []
|
|
15
|
+
}
|
|
16
|
+
], r = T(() => {
|
|
17
|
+
var a, c, m;
|
|
18
|
+
return e.currentRoute.value.name != i["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? {
|
|
19
|
+
title: u.value.label,
|
|
20
|
+
actions: u.value.actions,
|
|
21
|
+
description: void 0
|
|
22
|
+
} : (u.value = o[1], {
|
|
23
|
+
backButton: !0,
|
|
24
|
+
title: p("connect.loyalty.member.title"),
|
|
25
|
+
actions: [],
|
|
26
|
+
description: `${(a = l.value) == null ? void 0 : a.name} (${(c = l.value) == null ? void 0 : c._id}) (${(m = l.value) == null ? void 0 : m.phoneNumber})`,
|
|
27
|
+
onBackButton: async () => {
|
|
28
|
+
await e.push({ name: i["$connect-LOYALTY_MEMBER_LIST"] });
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}), u = d(
|
|
32
|
+
o.find((t) => t.value === e.currentRoute.value.name) ?? o[0]
|
|
33
|
+
), l = d();
|
|
34
|
+
async function v(t) {
|
|
35
|
+
await e.push({ name: t });
|
|
36
|
+
}
|
|
37
|
+
return k(
|
|
38
|
+
() => e.currentRoute.value.name,
|
|
39
|
+
async (t) => {
|
|
40
|
+
u.value = o.find((c) => c.value === t) ?? o[0];
|
|
41
|
+
const a = e.currentRoute.value.params.id;
|
|
42
|
+
a && (l.value = await Y.readById(a)), await e.push({ name: t });
|
|
43
|
+
}
|
|
44
|
+
), (t, a) => {
|
|
45
|
+
const c = s("FmPageHead"), m = s("FmTabs"), R = s("RouterView");
|
|
46
|
+
return _(), B(E, null, [
|
|
47
|
+
b(c, {
|
|
48
|
+
actions: n(r).actions,
|
|
49
|
+
title: n(r).title,
|
|
50
|
+
description: n(r).description,
|
|
51
|
+
"back-button": n(r).backButton,
|
|
52
|
+
"onClick:back": n(r).onBackButton
|
|
53
|
+
}, null, 8, ["actions", "title", "description", "back-button", "onClick:back"]),
|
|
54
|
+
y("div", h, [
|
|
55
|
+
n(e).currentRoute.value.name != n(i)["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? (_(), A(m, {
|
|
56
|
+
key: 0,
|
|
57
|
+
"model-value": n(u).value,
|
|
58
|
+
items: o,
|
|
59
|
+
"onUpdate:modelValue": v
|
|
60
|
+
}, null, 8, ["model-value"])) : L("", !0),
|
|
61
|
+
b(R)
|
|
62
|
+
])
|
|
63
|
+
], 64);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export {
|
|
68
|
+
g as default
|
|
69
|
+
};
|