@feedmepos/mf-connect 0.0.39-prod → 0.1.0-beta.2
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-DSD9TsKr.js +622 -0
- package/dist/{App-X3fNEBF3.js → App-D8a5eW51.js} +250 -249
- package/dist/Broadcast-C8jgMe6g.js +223 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CRYS_tzZ.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-pG8WvV4I.js} +20 -20
- package/dist/Card-C1K7ULPo.js +825 -0
- package/dist/Collections-lMrdPUuM.js +453 -0
- package/dist/Credit-CJfU5tP4.js +220 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DoZyevfa.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYoaa_-x.js} +1042 -1011
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CzEtOmp0.js +345 -0
- package/dist/Experience-Bp2ki8gU.js +221 -0
- package/dist/Game-BpTf6ebE.js +255 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
- package/dist/{MainLayout-DpZC6o3R.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +19 -53
- package/dist/MainLayout-B1aJoR95.js +41 -0
- package/dist/Marketing-BiKE2gxA.js +316 -0
- package/dist/Member-BSWyy32a.js +69 -0
- package/dist/MemberList-CHlGREyR.js +1733 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/{MemberTransactions-DueaXBCy.js → MemberTransactions-BzHiXCnp.js} +1 -1
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-e-zWg08J.js +432 -0
- package/dist/Mission-8IGT3T2C.js +261 -0
- package/dist/Point-CbbJ6ohd.js +222 -0
- package/dist/Promotion-BYXCJa_S.js +247 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-_RX1J0Br.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bruh-umZ.js} +557 -557
- package/dist/Segment-DXDNM0yd.js +437 -0
- package/dist/Setting-CLpvvZTv.js +1901 -0
- package/dist/Store-C6-P6bwc.js +1511 -0
- package/dist/StoreRewards-CUM2irXK.js +401 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CLFiuO5k.js → StoreTransactions.vue_vue_type_script_setup_true_lang-JaRdmqif.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CoMQBL4P.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DEb4OBcX.js} +1 -1
- package/dist/{Tier-CftEoP_R.js → Tier-DZTDxWBo.js} +481 -453
- package/dist/{Title-BsavXbYh.js → Title-C2Dr5ceK.js} +314 -295
- package/dist/Transaction-BL4mS29d.js +39 -0
- package/dist/Voucher-Cx0r2-df.js +490 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-DWuAODUF.js +56 -0
- package/dist/{app-BNmAx3zq.js → app-B_xuZ5HB.js} +1 -1
- package/dist/app-wE5HTF_Y.js +5762 -0
- package/dist/app.js +5 -3
- package/dist/{business-DGL4Ayx0.js → business-DSv8zM8C.js} +1 -1
- package/dist/{campaign-D94sS1kM.js → campaign-7y5qquHZ.js} +5 -3
- package/dist/{collection.fn-BHJ1ISqO.js → collection.fn-BxVZQAx0.js} +2 -2
- package/dist/dto-Ew1QwLci.js +2778 -0
- package/dist/{effect-CFRICzlM.js → effect-BzPh8fRI.js} +9 -9
- package/dist/{export-w2o9NYcy.js → export-C9tDplkA.js} +3 -3
- package/dist/{helper-CUDWQ8vq.js → helper-Sz7oQ0F4.js} +1 -1
- package/dist/{index-BGuLhEym.js → index-BQm0C3Jm.js} +3 -3
- package/dist/{index-BjwyxNSp.js → index-C-SOz7jt.js} +1 -1
- package/dist/{index-BcWJcD9f.js → index-C0lpADCo.js} +1 -1
- package/dist/{index-DIq2KVis.js → index-C3_4GUiI.js} +1 -1
- package/dist/{index-BPEV5Tzg.js → index-D-2nFLsg.js} +59 -47
- package/dist/{index-CFMBSL24.js → index-DBMaUGYI.js} +2 -2
- package/dist/{index-CpwFQFTV.js → index-DH_1nOJ_.js} +3 -3
- package/dist/index-Dy4pmQpt.js +29193 -0
- package/dist/{index-BQ6isIeo.js → index-_3qBsogG.js} +1 -1
- package/dist/index-gIRszcHf.js +3 -0
- package/dist/{index-VjUw31dN.js → index-tv4t0Pnh.js} +1 -1
- package/dist/{index-tZ1aqhks.js → index-z0IfdrZk.js} +319 -281
- package/dist/{index.esm2017-zciuPty-.js → index.esm2017-BnKJDxUo.js} +55 -55
- package/dist/{loading-GuXe5bYG.js → loading-Ds-yFYhc.js} +469 -460
- package/dist/{membership-BHWJVI3e.js → membership-DaiVw9qF.js} +3 -3
- package/dist/money-BHtBdZoz.js +15 -0
- package/dist/number-CZhcB8ef.js +12 -0
- package/dist/{rule-MgNa_8FF.js → rule-Cd2M6Ri2.js} +2 -2
- package/dist/{rule-builder-BsBCWzq_.js → rule-builder-B6og27Q1.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-D6k3lusq.js → template-DouRWBpv.js} +63 -63
- package/dist/{usePagination-JoYaROkV.js → usePagination-BeF5K3M7.js} +85 -85
- package/dist/vue-i18n-BTlOChXs.js +2365 -0
- package/dist/{xlsx-ClrA4KOh.js → xlsx-SahfXQ70.js} +517 -517
- package/dist/zod-Bg2FbC-D.js +90 -0
- package/package.json +7 -4
- package/dist/Analytic-DMFueUju.js +0 -620
- package/dist/Broadcast-YIfWIXeA.js +0 -216
- package/dist/Card-BIxlgQm7.js +0 -824
- package/dist/Collections-M6DaHM2W.js +0 -441
- package/dist/Credit-BtRy-xoY.js +0 -214
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D5DNTBSQ.js +0 -344
- package/dist/Experience-DGm1lnqj.js +0 -211
- package/dist/Game-B8-lG7qq.js +0 -250
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
- package/dist/Marketing-DtG3AIWr.js +0 -309
- package/dist/Member-K443-9Vy.js +0 -92
- package/dist/MemberList-CYXHXFTL.js +0 -1735
- package/dist/MemberOverview-C2n9oJZh.js +0 -58
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Bk2HLVmt.js +0 -203
- package/dist/Mission-CN5umXXA.js +0 -248
- package/dist/Point-XAm6H2p_.js +0 -220
- package/dist/Promotion-DsrA4KiE.js +0 -244
- package/dist/Segment-CZGGHoAu.js +0 -435
- package/dist/Setting-BjfxLKyp.js +0 -1870
- package/dist/Store-D_B-vhh3.js +0 -1513
- package/dist/StoreRewards-BjHffUKj.js +0 -429
- package/dist/Transaction-CdxzoKDG.js +0 -36
- package/dist/Voucher-B_9Nv1Mr.js +0 -485
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
- package/dist/app--1Ks5Hms.js +0 -2974
- package/dist/dto-X0Eeujxx.js +0 -1151
- package/dist/index-BPNG8N-w.js +0 -11
- package/dist/index-DWM9MWGj.js +0 -28058
- package/dist/money-CrttVpCp.js +0 -15
- package/dist/number-CIndGU4O.js +0 -12
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import { defineComponent as A, onMounted as E, openBlock as c, createElementBlock as w, createElementVNode as a, toDisplayString as F, unref as e, createVNode as l, createCommentVNode as T, ref as $, computed as j, resolveComponent as p, createBlock as B, isRef as W, createSlots as K, withCtx as f, Fragment as P, h as R, onBeforeMount as Q, renderList as X } from "vue";
|
|
2
|
+
import { _ as ee } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { F as N, p as te, u as oe } from "./loading-Ds-yFYhc.js";
|
|
4
|
+
import { components as L } from "@feedmepos/ui-library";
|
|
5
|
+
import { u as H, _ as O } from "./usePagination-BeF5K3M7.js";
|
|
6
|
+
import { u as ne } from "./vue-i18n-BTlOChXs.js";
|
|
7
|
+
import { Z as ae } from "./zod-Bg2FbC-D.js";
|
|
8
|
+
import { a as se } from "./index-DH_1nOJ_.js";
|
|
9
|
+
import { u as le } from "./app-wDQR6dpb.js";
|
|
10
|
+
import { R as ie } from "./rule-builder-B6og27Q1.js";
|
|
11
|
+
import { _ as re } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DWuAODUF.js";
|
|
12
|
+
import { _ as me } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Bruh-umZ.js";
|
|
13
|
+
import { h as V } from "./moment-BWErdI6_.js";
|
|
14
|
+
import { s as k } from "./membership-DaiVw9qF.js";
|
|
15
|
+
import { o as de } from "./objectId-dwaoBfJX.js";
|
|
16
|
+
import { u as ce } from "./business-DSv8zM8C.js";
|
|
17
|
+
import { m as ue } from "./index-tv4t0Pnh.js";
|
|
18
|
+
const pe = se.extend({
|
|
19
|
+
_id: N.optional(),
|
|
20
|
+
business: N.optional()
|
|
21
|
+
}), ge = { class: "space-y-16 pr-12" }, fe = { class: "fm-typo-en-title-md-800" }, ye = { class: "flex space-x-8" }, ve = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, _e = { class: "text-fm-color-typo-secondary" }, be = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "w-full flex flex-col gap-16 items-center pt-16"
|
|
24
|
+
}, he = /* @__PURE__ */ A({
|
|
25
|
+
__name: "ReviewSegment",
|
|
26
|
+
props: {
|
|
27
|
+
title: {},
|
|
28
|
+
segment: {}
|
|
29
|
+
},
|
|
30
|
+
setup(D) {
|
|
31
|
+
const y = D, v = [
|
|
32
|
+
{
|
|
33
|
+
header: "Name",
|
|
34
|
+
accessorFn: (o) => o.name
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
header: "Id",
|
|
38
|
+
accessorFn: (o) => o._id
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
header: "Customer Since",
|
|
42
|
+
accessorFn: (o) => V(de(o._id.toString())).format("DD MMM YYYY")
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
header: "Phone",
|
|
46
|
+
accessorFn: (o) => o.phoneNumber
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
header: "Birthday",
|
|
50
|
+
accessorFn: (o) => V(o.birthday).format("DD MMM YYYY")
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
header: "Last Visit",
|
|
54
|
+
accessorFn: (o) => V(o.stats.lastVisit).format("DD MMM YYYY")
|
|
55
|
+
}
|
|
56
|
+
], _ = async (o) => y.segment._id ? await k.paginateSegmentUsers(y.segment._id, {
|
|
57
|
+
limit: i.value.pageSize,
|
|
58
|
+
skip: o.pageIndex ?? 0,
|
|
59
|
+
sortBy: "_id",
|
|
60
|
+
search: o.searchValue,
|
|
61
|
+
descending: !0
|
|
62
|
+
}) : { resources: [], meta: { totalResources: 0, totalPages: 0 } }, { tableMeta: i, rowData: d, onSort: h, debouncedFetchData: m, onSearch: r } = H(_);
|
|
63
|
+
return E(async () => {
|
|
64
|
+
await m();
|
|
65
|
+
}), (o, g) => (c(), w("div", ge, [
|
|
66
|
+
a("div", fe, F(y.title), 1),
|
|
67
|
+
a("div", ye, [
|
|
68
|
+
a("div", ve, F(o.segment.members.length), 1),
|
|
69
|
+
a("div", _e, [
|
|
70
|
+
g[1] || (g[1] = a("div", null, "contacts in your segment", -1)),
|
|
71
|
+
a("div", null, "as of " + F(e(V)(o.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
72
|
+
])
|
|
73
|
+
]),
|
|
74
|
+
l(O, {
|
|
75
|
+
loading: e(i).isLoading,
|
|
76
|
+
"row-data": e(d),
|
|
77
|
+
"row-count": e(i).totalRows,
|
|
78
|
+
"column-defs": v,
|
|
79
|
+
"page-size": e(i).pageSize,
|
|
80
|
+
"page-count": e(i).pageCount,
|
|
81
|
+
"page-index": e(i).pageIndex,
|
|
82
|
+
onSortChange: e(h),
|
|
83
|
+
onPageChange: g[0] || (g[0] = (S) => e(m)({ pageSize: S.pageSize, pageIndex: S.pageIndex }))
|
|
84
|
+
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"]),
|
|
85
|
+
e(d).length == 0 ? (c(), w("div", be, g[2] || (g[2] = [
|
|
86
|
+
a("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1),
|
|
87
|
+
a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1)
|
|
88
|
+
]))) : T("", !0)
|
|
89
|
+
]));
|
|
90
|
+
}
|
|
91
|
+
}), Se = { class: "flex items-center gap-x-8" }, xe = {
|
|
92
|
+
key: 0,
|
|
93
|
+
class: "space-y-16 pr-12"
|
|
94
|
+
}, we = { class: "flex items-center gap-8" }, Fe = /* @__PURE__ */ A({
|
|
95
|
+
__name: "SegmentSheet",
|
|
96
|
+
emits: ["update:model-value"],
|
|
97
|
+
setup(D, { expose: y, emit: v }) {
|
|
98
|
+
const _ = le(), i = $(!1), d = $(!1), h = {
|
|
99
|
+
name: "",
|
|
100
|
+
rule: ie.scaffoldGroup(),
|
|
101
|
+
members: []
|
|
102
|
+
}, m = pe, r = $(h), o = j(() => {
|
|
103
|
+
const t = m.safeParse(r.value);
|
|
104
|
+
return t.success ? [] : t.error.errors;
|
|
105
|
+
});
|
|
106
|
+
function g(t) {
|
|
107
|
+
i.value = !0, d.value = !1, t ? r.value = { ...t } : r.value = { ...h };
|
|
108
|
+
}
|
|
109
|
+
function S() {
|
|
110
|
+
i.value = !1;
|
|
111
|
+
}
|
|
112
|
+
async function Y() {
|
|
113
|
+
m.safeParse(r.value).success && (d.value = !0);
|
|
114
|
+
}
|
|
115
|
+
function C() {
|
|
116
|
+
d.value = !1;
|
|
117
|
+
}
|
|
118
|
+
async function z() {
|
|
119
|
+
n("update:model-value", r.value);
|
|
120
|
+
}
|
|
121
|
+
E(async () => {
|
|
122
|
+
});
|
|
123
|
+
const n = v;
|
|
124
|
+
return y({
|
|
125
|
+
showSheet: g,
|
|
126
|
+
hideSheet: S
|
|
127
|
+
}), (t, s) => {
|
|
128
|
+
const x = p("FmButton"), M = p("FmSideSheet");
|
|
129
|
+
return c(), B(M, {
|
|
130
|
+
modelValue: e(i),
|
|
131
|
+
"onUpdate:modelValue": s[5] || (s[5] = (b) => W(i) ? i.value = b : null),
|
|
132
|
+
header: "Add segment",
|
|
133
|
+
"dismiss-away": "",
|
|
134
|
+
"close-button": !0,
|
|
135
|
+
"max-width": 1100
|
|
136
|
+
}, K({
|
|
137
|
+
"side-sheet-footer": f(() => [
|
|
138
|
+
a("div", we, [
|
|
139
|
+
e(d) ? (c(), w(P, { key: 0 }, [
|
|
140
|
+
l(x, {
|
|
141
|
+
label: "Save Segment",
|
|
142
|
+
onClick: z,
|
|
143
|
+
loading: e(_).isLoading,
|
|
144
|
+
disabled: e(o).length > 0 || e(_).isLoading
|
|
145
|
+
}, null, 8, ["loading", "disabled"]),
|
|
146
|
+
l(x, {
|
|
147
|
+
label: "Cancel",
|
|
148
|
+
onClick: s[3] || (s[3] = (b) => C()),
|
|
149
|
+
variant: "tertiary"
|
|
150
|
+
})
|
|
151
|
+
], 64)) : (c(), w(P, { key: 1 }, [
|
|
152
|
+
l(x, {
|
|
153
|
+
label: "Review Segment",
|
|
154
|
+
disabled: e(o).length > 0 || e(_).isLoading,
|
|
155
|
+
onClick: Y
|
|
156
|
+
}, null, 8, ["disabled"]),
|
|
157
|
+
l(x, {
|
|
158
|
+
label: "Cancel",
|
|
159
|
+
onClick: s[4] || (s[4] = (b) => S()),
|
|
160
|
+
variant: "tertiary"
|
|
161
|
+
})
|
|
162
|
+
], 64))
|
|
163
|
+
])
|
|
164
|
+
]),
|
|
165
|
+
default: f(() => {
|
|
166
|
+
var b;
|
|
167
|
+
return [
|
|
168
|
+
e(d) ? (c(), B(he, {
|
|
169
|
+
key: 1,
|
|
170
|
+
title: e(r).name,
|
|
171
|
+
segment: e(r)
|
|
172
|
+
}, null, 8, ["title", "segment"])) : (c(), w("div", xe, [
|
|
173
|
+
l(re, {
|
|
174
|
+
modelValue: e(r).name,
|
|
175
|
+
"onUpdate:modelValue": s[1] || (s[1] = (I) => e(r).name = I),
|
|
176
|
+
label: "Segment title",
|
|
177
|
+
schema: e(ae).typeAtPath(e(m), "name")
|
|
178
|
+
}, null, 8, ["modelValue", "schema"]),
|
|
179
|
+
s[7] || (s[7] = a("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
|
|
180
|
+
l(me, {
|
|
181
|
+
"trigger-type": "MEMBERSHIP_JOINED",
|
|
182
|
+
includeOnly: "user",
|
|
183
|
+
"model-value": (b = e(r)) == null ? void 0 : b.rule,
|
|
184
|
+
"onUpdate:modelValue": s[2] || (s[2] = (I) => {
|
|
185
|
+
e(r).rule = I;
|
|
186
|
+
})
|
|
187
|
+
}, null, 8, ["model-value"])
|
|
188
|
+
]))
|
|
189
|
+
];
|
|
190
|
+
}),
|
|
191
|
+
_: 2
|
|
192
|
+
}, [
|
|
193
|
+
e(d) ? {
|
|
194
|
+
name: "side-sheet-header",
|
|
195
|
+
fn: f(() => [
|
|
196
|
+
a("div", Se, [
|
|
197
|
+
l(x, {
|
|
198
|
+
icon: "arrow_back",
|
|
199
|
+
variant: "tertiary",
|
|
200
|
+
onClick: s[0] || (s[0] = (b) => d.value = !1)
|
|
201
|
+
}),
|
|
202
|
+
s[6] || (s[6] = a("div", null, "Review segment", -1))
|
|
203
|
+
])
|
|
204
|
+
]),
|
|
205
|
+
key: "0"
|
|
206
|
+
} : void 0
|
|
207
|
+
]), 1032, ["modelValue"]);
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}), Ce = { class: "flex items-center" }, ke = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Me = { class: "px-24 flex flex-col gap-y-16" }, Ie = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Re = { class: "fm-typo-en-body-md-600" }, $e = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Je = /* @__PURE__ */ A({
|
|
211
|
+
__name: "Segment",
|
|
212
|
+
setup(D) {
|
|
213
|
+
const { minor: y } = oe, { t: v } = ne(), _ = ce(), i = $(0), d = [
|
|
214
|
+
{
|
|
215
|
+
header: v("connect.loyalty.segment.table.name"),
|
|
216
|
+
accessorFn: (n) => n.name
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
header: v("connect.loyalty.segment.table.total_customers"),
|
|
220
|
+
accessorFn: (n) => n.memberCount ?? 0
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
header: v("connect.loyalty.segment.table.customer_percentage"),
|
|
224
|
+
accessorFn: (n) => ((n.memberCount ?? 0) * 100 / i.value).toFixed(2)
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
header: v("connect.loyalty.segment.table.actions"),
|
|
228
|
+
meta: {
|
|
229
|
+
maxWidth: "100px"
|
|
230
|
+
},
|
|
231
|
+
cell(n) {
|
|
232
|
+
return R("div", { class: "flex items-center justify-end" }, [
|
|
233
|
+
R(
|
|
234
|
+
L.FmMenu,
|
|
235
|
+
{
|
|
236
|
+
placement: "bottom-end",
|
|
237
|
+
onClick: (t) => {
|
|
238
|
+
t.stopPropagation();
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"menu-button": () => R(L.FmButton, {
|
|
243
|
+
icon: "more_vert",
|
|
244
|
+
iconColor: "neutral-gray-400",
|
|
245
|
+
variant: "tertiary"
|
|
246
|
+
}),
|
|
247
|
+
default: () => [
|
|
248
|
+
R(
|
|
249
|
+
L.FmMenuItem,
|
|
250
|
+
{
|
|
251
|
+
onClick: async (t) => {
|
|
252
|
+
t.stopPropagation(), S(n.row.original);
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
label: R(
|
|
257
|
+
"div",
|
|
258
|
+
{
|
|
259
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
260
|
+
},
|
|
261
|
+
"Remove"
|
|
262
|
+
)
|
|
263
|
+
}
|
|
264
|
+
)
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
]);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
], h = $(null), { tableMeta: m, rowData: r, debouncedFetchData: o } = H(
|
|
272
|
+
k.readAll
|
|
273
|
+
);
|
|
274
|
+
async function g() {
|
|
275
|
+
await y(
|
|
276
|
+
async () => {
|
|
277
|
+
await k.refreshSegments(), await o({ pageSize: 10, pageIndex: 0 });
|
|
278
|
+
},
|
|
279
|
+
{ message: "Refreshing segmentations" }
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
async function S(n) {
|
|
283
|
+
await te.remove(`Are you sure you want to remove ${n.name}?`) && await y(
|
|
284
|
+
async () => {
|
|
285
|
+
await k.delete(n._id), await o({ pageSize: 10, pageIndex: 0 });
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
message: `Removing ${n.name}`,
|
|
289
|
+
successMessage: `Removed ${n.name} successfully`
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
async function Y(n) {
|
|
294
|
+
await y(
|
|
295
|
+
async () => {
|
|
296
|
+
var t;
|
|
297
|
+
if (n._id) {
|
|
298
|
+
const { members: s, _id: x, ...M } = n;
|
|
299
|
+
await k.update(n._id, M);
|
|
300
|
+
} else
|
|
301
|
+
await k.create(n);
|
|
302
|
+
await o({ pageSize: 10, pageIndex: 0 }), (t = h.value) == null || t.hideSheet();
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
message: "Saving segment",
|
|
306
|
+
successMessage: "Segment saved"
|
|
307
|
+
}
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
function C(n) {
|
|
311
|
+
var t;
|
|
312
|
+
(t = h.value) == null || t.showSheet(n);
|
|
313
|
+
}
|
|
314
|
+
const z = j(() => _.isPremium ? [
|
|
315
|
+
{
|
|
316
|
+
label: "Refresh segments",
|
|
317
|
+
value: "refresh"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
label: "Add segment",
|
|
321
|
+
value: "add",
|
|
322
|
+
isPrimary: !0,
|
|
323
|
+
prependIcon: "add"
|
|
324
|
+
}
|
|
325
|
+
] : []);
|
|
326
|
+
return Q(async () => {
|
|
327
|
+
const { meta: n } = await ue.read({
|
|
328
|
+
limit: 1,
|
|
329
|
+
skip: 0,
|
|
330
|
+
sortBy: "_id",
|
|
331
|
+
search: void 0,
|
|
332
|
+
descending: !1
|
|
333
|
+
});
|
|
334
|
+
i.value = n.totalResources ?? 0, await o({ pageSize: 10, pageIndex: 0 }), await _.readPremium();
|
|
335
|
+
}), (n, t) => {
|
|
336
|
+
const s = p("FmPill"), x = p("FmPageHead"), M = p("FmIcon"), b = p("FmMenuItem"), I = p("FmMenu"), Z = p("FmListItem"), q = p("FmList"), G = p("FmButton"), J = p("FmCard");
|
|
337
|
+
return c(), w(P, null, [
|
|
338
|
+
l(x, {
|
|
339
|
+
title: "Segments",
|
|
340
|
+
actions: e(z),
|
|
341
|
+
"onClick:action": t[0] || (t[0] = (u) => u === "add" ? C() : g())
|
|
342
|
+
}, {
|
|
343
|
+
title: f(() => [
|
|
344
|
+
a("div", Ce, [
|
|
345
|
+
a("span", ke, F(e(v)("connect.loyalty.segment.title")), 1),
|
|
346
|
+
l(s, { variant: "premium" })
|
|
347
|
+
])
|
|
348
|
+
]),
|
|
349
|
+
_: 1
|
|
350
|
+
}, 8, ["actions"]),
|
|
351
|
+
a("div", Me, [
|
|
352
|
+
e(r).length > 0 || e(m).searchValue || e(m).isLoading ? (c(), w(P, { key: 0 }, [
|
|
353
|
+
l(O, {
|
|
354
|
+
loading: e(m).isLoading,
|
|
355
|
+
"row-data": e(r),
|
|
356
|
+
"row-count": e(m).totalRows,
|
|
357
|
+
"column-defs": d,
|
|
358
|
+
"shrink-at": !1,
|
|
359
|
+
"page-count": e(m).pageCount,
|
|
360
|
+
"page-index": e(m).pageIndex,
|
|
361
|
+
"page-size": e(m).pageSize,
|
|
362
|
+
onRowClick: t[1] || (t[1] = (u) => {
|
|
363
|
+
C(u.original);
|
|
364
|
+
}),
|
|
365
|
+
onPageChange: e(o)
|
|
366
|
+
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
|
|
367
|
+
l(q, { class: "w-full hidden xs:block" }, {
|
|
368
|
+
default: f(() => [
|
|
369
|
+
(c(!0), w(P, null, X(e(r), (u) => (c(), B(Z, {
|
|
370
|
+
key: u._id.toString(),
|
|
371
|
+
tag: "label",
|
|
372
|
+
onClick: (U) => C(u)
|
|
373
|
+
}, {
|
|
374
|
+
default: f(() => [
|
|
375
|
+
a("div", null, [
|
|
376
|
+
a("div", Ie, F((u.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
377
|
+
a("div", Re, F(u.name), 1),
|
|
378
|
+
a("div", $e, F(((u.memberCount ?? 0) * 100 / e(i)).toFixed(2)) + "% of customers ", 1)
|
|
379
|
+
])
|
|
380
|
+
]),
|
|
381
|
+
append: f(() => [
|
|
382
|
+
l(I, { "stop-click-propagation": !0 }, {
|
|
383
|
+
"menu-button": f(() => [
|
|
384
|
+
l(M, { name: "more_vert" })
|
|
385
|
+
]),
|
|
386
|
+
default: f(() => [
|
|
387
|
+
l(b, {
|
|
388
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400",
|
|
389
|
+
label: "Remove",
|
|
390
|
+
"onUpdate:modelValue": (U) => U && S(u)
|
|
391
|
+
}, null, 8, ["onUpdate:modelValue"])
|
|
392
|
+
]),
|
|
393
|
+
_: 2
|
|
394
|
+
}, 1024)
|
|
395
|
+
]),
|
|
396
|
+
_: 2
|
|
397
|
+
}, 1032, ["onClick"]))), 128))
|
|
398
|
+
]),
|
|
399
|
+
_: 1
|
|
400
|
+
})
|
|
401
|
+
], 64)) : (c(), B(J, {
|
|
402
|
+
key: 1,
|
|
403
|
+
variant: "outlined",
|
|
404
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
405
|
+
}, {
|
|
406
|
+
default: f(() => [
|
|
407
|
+
t[3] || (t[3] = a("img", {
|
|
408
|
+
src: ee,
|
|
409
|
+
class: "aspect-square w-[150px]"
|
|
410
|
+
}, null, -1)),
|
|
411
|
+
t[4] || (t[4] = a("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
412
|
+
a("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
|
|
413
|
+
a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Segments allow you to categorize your customers based on various criteria, enabling targeted marketing and personalized experiences. ")
|
|
414
|
+
], -1)),
|
|
415
|
+
l(G, {
|
|
416
|
+
variant: "primary",
|
|
417
|
+
label: "Create segment",
|
|
418
|
+
disabled: !e(_).isPremium,
|
|
419
|
+
icon: "add",
|
|
420
|
+
onClick: t[2] || (t[2] = (u) => C())
|
|
421
|
+
}, null, 8, ["disabled"])
|
|
422
|
+
]),
|
|
423
|
+
_: 1
|
|
424
|
+
})),
|
|
425
|
+
l(Fe, {
|
|
426
|
+
ref_key: "sheetRef",
|
|
427
|
+
ref: h,
|
|
428
|
+
"onUpdate:modelValue": Y
|
|
429
|
+
}, null, 512)
|
|
430
|
+
])
|
|
431
|
+
], 64);
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
export {
|
|
436
|
+
Je as default
|
|
437
|
+
};
|