@feedmepos/mf-connect 0.0.28-prod → 0.0.30-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-zePfeaJ8.js → Analytic-CMw4c42B.js} +8 -8
- package/dist/{App-DoJIzLZX.js → App-DgQEvhoW.js} +41 -41
- package/dist/{Broadcast-CjKEjend.js → Broadcast-DZ0QPkD7.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CLfPnwwA.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DjbB5yP1.js} +8 -8
- package/dist/{Card-CAa06jQK.js → Card-DLS4WEBw.js} +36 -36
- package/dist/{Collections-1Sn-K2RI.js → Collections-CtAWEIcO.js} +137 -138
- package/dist/{Credit-DmEBNtvC.js → Credit-D7pQXqEt.js} +7 -7
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C36lFGES.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BXz2IKaK.js} +21 -21
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DA2cZ139.js → EffectSheet.vue_vue_type_style_index_0_lang-Cw-KLvgf.js} +5 -5
- package/dist/{Experience-Dn8qQUIo.js → Experience-_UabVSY7.js} +7 -7
- package/dist/{Game-QnvPORdU.js → Game-CHMBITlG.js} +7 -7
- package/dist/{Marketing-4QXTJvLt.js → Marketing-BHv9eyo6.js} +4 -4
- package/dist/{Member-tk4Jxb-q.js → Member-BkqNzcG3.js} +3 -3
- package/dist/{MemberList-B898N6zA.js → MemberList-FfxRRSLP.js} +76 -76
- package/dist/{MemberTransactions-BbdsbQqh.js → MemberTransactions-DvCtHUkt.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Ct7Vc_Ik.js → MessageInput.vue_vue_type_script_setup_true_lang-MaCtf4Xn.js} +2 -2
- package/dist/{Mission-DiOdia3J.js → Mission-OrOKxoPz.js} +7 -7
- package/dist/{Point-DyvajcmR.js → Point-CTKv_6wI.js} +7 -7
- package/dist/{Promotion-BQ-1dZaK.js → Promotion-D3pQZxX7.js} +8 -8
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Dx9-QqeK.js → RuleGroup.vue_vue_type_script_setup_true_lang-CE9TmOhA.js} +94 -92
- package/dist/Segment-DSX0DD-P.js +434 -0
- package/dist/{Setting-BgJYDQ2u.js → Setting-CzxXS6LJ.js} +7 -7
- package/dist/{Store-Clv8qG7p.js → Store-BfiGvIid.js} +11 -11
- package/dist/{StoreRewards-IZjC2nTN.js → StoreRewards-Bm39d1Cc.js} +10 -10
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CHVFEK2H.js +890 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-aiclx2-7.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DdtJ3kNK.js} +1 -1
- package/dist/{Tier-ClyCt9KM.js → Tier-BP44jWgR.js} +13 -13
- package/dist/{Title-D6PaK72H.js → Title-Ct8QWL2Q.js} +13 -13
- package/dist/{Transaction-CLiY-R9h.js → Transaction-RP2dj85O.js} +1 -1
- package/dist/{Voucher-DYJDRt0u.js → Voucher-BQ6Kq-jX.js} +10 -10
- package/dist/{app-DBR_YmVt.js → app-Bzct9xVo.js} +24 -24
- package/dist/{app-OXHo6S1u.js → app-DiKC7FId.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-CSmJnfxU.js → business-iGcoCCSb.js} +1 -1
- package/dist/{campaign-BfzDFYy4.js → campaign-DeEhf0-p.js} +2 -2
- package/dist/{collection.fn-B3fehEh0.js → collection.fn-DV5EnxQc.js} +2 -2
- package/dist/{dto-D1k_7uk-.js → dto-D27dJqWy.js} +180 -180
- package/dist/{effect-Bp1S3oSk.js → effect-cdw61g2Y.js} +1 -1
- package/dist/{export-CET2lLBf.js → export-CLtQanYU.js} +3 -3
- package/dist/{helper-C6m_E9sn.js → helper-O1xiribY.js} +1 -1
- package/dist/{index-CQbf7JEL.js → index-3_r2IGAF.js} +2 -2
- package/dist/{index-DcGAYeSq.js → index-Bpb0PhDQ.js} +1 -1
- package/dist/{index-vtedTQkR.js → index-BzFp6WIZ.js} +1 -1
- package/dist/{index-CCTaLZTz.js → index-C6kizPcL.js} +5 -3
- package/dist/{index-BELLwClJ.js → index-C9iPmltA.js} +1 -1
- package/dist/{index-B-cD3OOl.js → index-DG0RrwCN.js} +5 -5
- package/dist/{index-B1877KRd.js → index-DLxzqdlK.js} +3 -3
- package/dist/{index-BaYn8lfH.js → index-DOMUfanW.js} +12 -7
- package/dist/{index-C208T65R.js → index-PO2CtKXo.js} +1 -1
- package/dist/{index-BzeGWwDC.js → index-X-EzXcGs.js} +3 -3
- package/dist/{index-BEi_LnV_.js → index-dbSbwT_z.js} +1 -1
- package/dist/{index-JyK7n__U.js → index-rOKsnWx1.js} +16 -14
- package/dist/{index.esm2017-D14o0xmi.js → index.esm2017-Dp0jAeUG.js} +30 -30
- package/dist/{loading-CTZia9no.js → loading-C7oH4e0j.js} +4 -4
- package/dist/{membership-Cdywxyet.js → membership-D0G_5G-y.js} +3 -3
- package/dist/{money-epFszMWD.js → money-B6MghTDE.js} +1 -1
- package/dist/{number-Ciw2FH5f.js → number-qKhyhzHd.js} +1 -1
- package/dist/{rule-DTOaDgf-.js → rule-BIAblb97.js} +2 -2
- package/dist/{rule-builder-DR45Z_8u.js → rule-builder-JAqgqMza.js} +1 -1
- package/dist/{template-BqcNGFEN.js → template-0FGOnSoC.js} +4 -4
- package/dist/{xlsx-Dn1FUo_C.js → xlsx-DD6vbwKN.js} +226 -226
- package/package.json +1 -1
- package/dist/Segment-ET69WJXK.js +0 -445
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-C0zTQM7S.js +0 -818
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
import { defineComponent as A, onMounted as E, openBlock as c, createElementBlock as b, createElementVNode as o, toDisplayString as M, unref as e, createVNode as i, createCommentVNode as G, ref as I, computed as j, resolveComponent as p, createBlock as B, isRef as J, createSlots as W, withCtx as _, Fragment as P, onBeforeMount as K, renderList as Q, h as R } from "vue";
|
|
2
|
+
import { _ as X } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { F as U, p as ee, u as te } from "./loading-C7oH4e0j.js";
|
|
4
|
+
import { components as L } from "@feedmepos/ui-library";
|
|
5
|
+
import { u as H, _ as O } from "./usePagination-JoYaROkV.js";
|
|
6
|
+
import { _ as oe, Z as ne } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
7
|
+
import { a as ae } from "./index-DLxzqdlK.js";
|
|
8
|
+
import { u as se } from "./app-wDQR6dpb.js";
|
|
9
|
+
import { R as ie } from "./rule-builder-JAqgqMza.js";
|
|
10
|
+
import { _ as le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CE9TmOhA.js";
|
|
11
|
+
import { h as V } from "./moment-BWErdI6_.js";
|
|
12
|
+
import { s as C } from "./membership-D0G_5G-y.js";
|
|
13
|
+
import { o as re } from "./objectId-dwaoBfJX.js";
|
|
14
|
+
import { u as me } from "./business-iGcoCCSb.js";
|
|
15
|
+
const de = ae.extend({
|
|
16
|
+
_id: U.optional(),
|
|
17
|
+
business: U.optional()
|
|
18
|
+
}), ce = { class: "space-y-16 pr-12" }, ue = { class: "fm-typo-en-title-md-800" }, pe = { class: "flex space-x-8" }, ge = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, fe = { class: "text-fm-color-typo-secondary" }, _e = /* @__PURE__ */ o("div", null, "contacts in your segment", -1), ye = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "w-full flex flex-col gap-16 items-center pt-16"
|
|
21
|
+
}, ve = /* @__PURE__ */ o("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1), he = /* @__PURE__ */ o("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1), Se = [
|
|
22
|
+
ve,
|
|
23
|
+
he
|
|
24
|
+
], be = /* @__PURE__ */ A({
|
|
25
|
+
__name: "ReviewSegment",
|
|
26
|
+
props: {
|
|
27
|
+
title: {},
|
|
28
|
+
segment: {}
|
|
29
|
+
},
|
|
30
|
+
setup(D) {
|
|
31
|
+
const y = D, x = [
|
|
32
|
+
{
|
|
33
|
+
header: "Name",
|
|
34
|
+
accessorFn: (n) => n.name
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
header: "Id",
|
|
38
|
+
accessorFn: (n) => n._id
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
header: "Customer Since",
|
|
42
|
+
accessorFn: (n) => V(re(n._id.toString())).format("DD MMM YYYY")
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
header: "Phone",
|
|
46
|
+
accessorFn: (n) => n.phoneNumber
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
header: "Birthday",
|
|
50
|
+
accessorFn: (n) => V(n.birthday).format("DD MMM YYYY")
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
header: "Last Visit",
|
|
54
|
+
accessorFn: (n) => V(n.stats.lastVisit).format("DD MMM YYYY")
|
|
55
|
+
}
|
|
56
|
+
], v = async (n) => y.segment._id ? await C.paginateSegmentUsers(y.segment._id, {
|
|
57
|
+
limit: r.value.pageSize,
|
|
58
|
+
skip: n.pageIndex ?? 0,
|
|
59
|
+
sortBy: "_id",
|
|
60
|
+
search: n.searchValue,
|
|
61
|
+
descending: !0
|
|
62
|
+
}) : { resources: [], meta: { totalResources: 0, totalPages: 0 } }, { tableMeta: r, rowData: m, onSort: d, debouncedFetchData: g, onSearch: a } = H(v);
|
|
63
|
+
return E(async () => {
|
|
64
|
+
await g();
|
|
65
|
+
}), (n, w) => (c(), b("div", ce, [
|
|
66
|
+
o("div", ue, M(y.title), 1),
|
|
67
|
+
o("div", pe, [
|
|
68
|
+
o("div", ge, M(n.segment.members.length), 1),
|
|
69
|
+
o("div", fe, [
|
|
70
|
+
_e,
|
|
71
|
+
o("div", null, "as of " + M(e(V)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
72
|
+
])
|
|
73
|
+
]),
|
|
74
|
+
i(O, {
|
|
75
|
+
loading: e(r).isLoading,
|
|
76
|
+
"row-data": e(m),
|
|
77
|
+
"row-count": e(r).totalRows,
|
|
78
|
+
"column-defs": x,
|
|
79
|
+
"page-size": e(r).pageSize,
|
|
80
|
+
"page-count": e(r).pageCount,
|
|
81
|
+
"page-index": e(r).pageIndex,
|
|
82
|
+
onSortChange: e(d),
|
|
83
|
+
onPageChange: w[0] || (w[0] = (F) => e(g)({ pageSize: F.pageSize, pageIndex: F.pageIndex }))
|
|
84
|
+
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"]),
|
|
85
|
+
e(m).length == 0 ? (c(), b("div", ye, Se)) : G("", !0)
|
|
86
|
+
]));
|
|
87
|
+
}
|
|
88
|
+
}), xe = { class: "flex items-center gap-x-8" }, we = /* @__PURE__ */ o("div", null, "Review segment", -1), Fe = {
|
|
89
|
+
key: 0,
|
|
90
|
+
class: "space-y-16 pr-12"
|
|
91
|
+
}, Ce = /* @__PURE__ */ o("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1), ke = { class: "flex items-center gap-8" }, Me = /* @__PURE__ */ A({
|
|
92
|
+
__name: "SegmentSheet",
|
|
93
|
+
emits: ["update:model-value"],
|
|
94
|
+
setup(D, { expose: y, emit: x }) {
|
|
95
|
+
const v = se(), r = I(!1), m = I(!1), d = {
|
|
96
|
+
name: "",
|
|
97
|
+
rule: ie.scaffoldGroup(),
|
|
98
|
+
members: []
|
|
99
|
+
}, g = de, a = I(d), n = j(() => {
|
|
100
|
+
const f = g.safeParse(a.value);
|
|
101
|
+
return f.success ? [] : f.error.errors;
|
|
102
|
+
});
|
|
103
|
+
function w(f) {
|
|
104
|
+
r.value = !0, m.value = !1, f ? a.value = { ...f } : a.value = { ...d };
|
|
105
|
+
}
|
|
106
|
+
function F() {
|
|
107
|
+
r.value = !1;
|
|
108
|
+
}
|
|
109
|
+
async function k() {
|
|
110
|
+
g.safeParse(a.value).success && (m.value = !0);
|
|
111
|
+
}
|
|
112
|
+
function Y() {
|
|
113
|
+
m.value = !1;
|
|
114
|
+
}
|
|
115
|
+
async function t() {
|
|
116
|
+
s("update:model-value", a.value);
|
|
117
|
+
}
|
|
118
|
+
E(async () => {
|
|
119
|
+
});
|
|
120
|
+
const s = x;
|
|
121
|
+
return y({
|
|
122
|
+
showSheet: w,
|
|
123
|
+
hideSheet: F
|
|
124
|
+
}), (f, l) => {
|
|
125
|
+
const h = p("FmButton"), z = p("FmSideSheet");
|
|
126
|
+
return c(), B(z, {
|
|
127
|
+
modelValue: e(r),
|
|
128
|
+
"onUpdate:modelValue": l[5] || (l[5] = (S) => J(r) ? r.value = S : null),
|
|
129
|
+
header: "Add segment",
|
|
130
|
+
"dismiss-away": "",
|
|
131
|
+
"close-button": !0,
|
|
132
|
+
"max-width": 1100
|
|
133
|
+
}, W({
|
|
134
|
+
"side-sheet-footer": _(() => [
|
|
135
|
+
o("div", ke, [
|
|
136
|
+
e(m) ? (c(), b(P, { key: 0 }, [
|
|
137
|
+
i(h, {
|
|
138
|
+
label: "Save Segment",
|
|
139
|
+
onClick: t,
|
|
140
|
+
loading: e(v).isLoading,
|
|
141
|
+
disabled: e(n).length > 0 || e(v).isLoading
|
|
142
|
+
}, null, 8, ["loading", "disabled"]),
|
|
143
|
+
i(h, {
|
|
144
|
+
label: "Cancel",
|
|
145
|
+
onClick: l[3] || (l[3] = (S) => Y()),
|
|
146
|
+
variant: "tertiary"
|
|
147
|
+
})
|
|
148
|
+
], 64)) : (c(), b(P, { key: 1 }, [
|
|
149
|
+
i(h, {
|
|
150
|
+
label: "Review Segment",
|
|
151
|
+
disabled: e(n).length > 0 || e(v).isLoading,
|
|
152
|
+
onClick: k
|
|
153
|
+
}, null, 8, ["disabled"]),
|
|
154
|
+
i(h, {
|
|
155
|
+
label: "Cancel",
|
|
156
|
+
onClick: l[4] || (l[4] = (S) => F()),
|
|
157
|
+
variant: "tertiary"
|
|
158
|
+
})
|
|
159
|
+
], 64))
|
|
160
|
+
])
|
|
161
|
+
]),
|
|
162
|
+
default: _(() => {
|
|
163
|
+
var S;
|
|
164
|
+
return [
|
|
165
|
+
e(m) ? (c(), B(be, {
|
|
166
|
+
key: 1,
|
|
167
|
+
title: e(a).name,
|
|
168
|
+
segment: e(a)
|
|
169
|
+
}, null, 8, ["title", "segment"])) : (c(), b("div", Fe, [
|
|
170
|
+
i(oe, {
|
|
171
|
+
modelValue: e(a).name,
|
|
172
|
+
"onUpdate:modelValue": l[1] || (l[1] = ($) => e(a).name = $),
|
|
173
|
+
label: "Segment title",
|
|
174
|
+
schema: e(ne).typeAtPath(e(g), "name")
|
|
175
|
+
}, null, 8, ["modelValue", "schema"]),
|
|
176
|
+
Ce,
|
|
177
|
+
i(le, {
|
|
178
|
+
"trigger-type": "MEMBERSHIP_JOINED",
|
|
179
|
+
includeOnly: "user",
|
|
180
|
+
"model-value": (S = e(a)) == null ? void 0 : S.rule,
|
|
181
|
+
"onUpdate:modelValue": l[2] || (l[2] = ($) => {
|
|
182
|
+
e(a).rule = $;
|
|
183
|
+
})
|
|
184
|
+
}, null, 8, ["model-value"])
|
|
185
|
+
]))
|
|
186
|
+
];
|
|
187
|
+
}),
|
|
188
|
+
_: 2
|
|
189
|
+
}, [
|
|
190
|
+
e(m) ? {
|
|
191
|
+
name: "side-sheet-header",
|
|
192
|
+
fn: _(() => [
|
|
193
|
+
o("div", xe, [
|
|
194
|
+
i(h, {
|
|
195
|
+
icon: "arrow_back",
|
|
196
|
+
variant: "tertiary",
|
|
197
|
+
onClick: l[0] || (l[0] = (S) => m.value = !1)
|
|
198
|
+
}),
|
|
199
|
+
we
|
|
200
|
+
])
|
|
201
|
+
]),
|
|
202
|
+
key: "0"
|
|
203
|
+
} : void 0
|
|
204
|
+
]), 1032, ["modelValue"]);
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
}), $e = { class: "flex items-center" }, Re = /* @__PURE__ */ o("span", { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, " Segments ", -1), Ie = { class: "px-24 flex flex-col gap-y-16" }, Pe = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Ve = { class: "fm-typo-en-body-md-600" }, Be = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, De = /* @__PURE__ */ o("img", {
|
|
208
|
+
src: X,
|
|
209
|
+
class: "aspect-square w-[150px]"
|
|
210
|
+
}, null, -1), Ye = /* @__PURE__ */ o("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
211
|
+
/* @__PURE__ */ o("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
|
|
212
|
+
/* @__PURE__ */ o("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. ")
|
|
213
|
+
], -1), We = /* @__PURE__ */ A({
|
|
214
|
+
__name: "Segment",
|
|
215
|
+
setup(D) {
|
|
216
|
+
const { minor: y } = te, x = me(), v = I(0), r = [
|
|
217
|
+
{
|
|
218
|
+
header: "Name",
|
|
219
|
+
accessorFn: (t) => t.name
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
header: "Total Customers in this Segment",
|
|
223
|
+
accessorFn: (t) => t.memberCount ?? 0
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
header: "% of customers",
|
|
227
|
+
accessorFn: (t) => ((t.memberCount ?? 0) * 100 / v.value).toFixed(2)
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
header: "Actions",
|
|
231
|
+
meta: {
|
|
232
|
+
maxWidth: "100px"
|
|
233
|
+
},
|
|
234
|
+
cell(t) {
|
|
235
|
+
return R("div", { class: "flex items-center justify-end" }, [
|
|
236
|
+
R(
|
|
237
|
+
L.FmMenu,
|
|
238
|
+
{
|
|
239
|
+
placement: "bottom-end",
|
|
240
|
+
onClick: (s) => {
|
|
241
|
+
s.stopPropagation();
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"menu-button": () => R(L.FmButton, {
|
|
246
|
+
icon: "more_vert",
|
|
247
|
+
iconColor: "neutral-gray-400",
|
|
248
|
+
variant: "tertiary"
|
|
249
|
+
}),
|
|
250
|
+
default: () => [
|
|
251
|
+
R(
|
|
252
|
+
L.FmMenuItem,
|
|
253
|
+
{
|
|
254
|
+
onClick: async (s) => {
|
|
255
|
+
s.stopPropagation(), w(t.row.original);
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
label: R(
|
|
260
|
+
"div",
|
|
261
|
+
{
|
|
262
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
263
|
+
},
|
|
264
|
+
"Remove"
|
|
265
|
+
)
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
)
|
|
271
|
+
]);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
], m = I(null), { tableMeta: d, rowData: g, debouncedFetchData: a } = H(
|
|
275
|
+
C.readAll
|
|
276
|
+
);
|
|
277
|
+
async function n() {
|
|
278
|
+
await y(
|
|
279
|
+
async () => {
|
|
280
|
+
await C.refreshSegments(), await a({ pageSize: 10, pageIndex: 0 });
|
|
281
|
+
},
|
|
282
|
+
{ message: "Refreshing segmentations" }
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
async function w(t) {
|
|
286
|
+
await ee.remove(`Are you sure you want to remove ${t.name}?`) && await y(
|
|
287
|
+
async () => {
|
|
288
|
+
await C.delete(t._id), await a({ pageSize: 10, pageIndex: 0 });
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
message: `Removing ${t.name}`,
|
|
292
|
+
successMessage: `Removed ${t.name} successfully`
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
async function F(t) {
|
|
297
|
+
await y(
|
|
298
|
+
async () => {
|
|
299
|
+
var s;
|
|
300
|
+
if (t._id) {
|
|
301
|
+
const { members: f, _id: l, ...h } = t;
|
|
302
|
+
await C.update(t._id, h);
|
|
303
|
+
} else
|
|
304
|
+
await C.create(t);
|
|
305
|
+
await a({ pageSize: 10, pageIndex: 0 }), (s = m.value) == null || s.hideSheet();
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
message: "Saving segment",
|
|
309
|
+
successMessage: "Segment saved"
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
function k(t) {
|
|
314
|
+
var s;
|
|
315
|
+
(s = m.value) == null || s.showSheet(t);
|
|
316
|
+
}
|
|
317
|
+
const Y = j(() => x.isPremium ? [
|
|
318
|
+
{
|
|
319
|
+
label: "Refresh segments",
|
|
320
|
+
value: "refresh"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
label: "Add segment",
|
|
324
|
+
value: "add",
|
|
325
|
+
isPrimary: !0,
|
|
326
|
+
prependIcon: "add"
|
|
327
|
+
}
|
|
328
|
+
] : []);
|
|
329
|
+
return K(async () => {
|
|
330
|
+
const { meta: t } = await C.readAll({
|
|
331
|
+
limit: 1,
|
|
332
|
+
skip: 0,
|
|
333
|
+
sortBy: "_id",
|
|
334
|
+
search: d.value.searchValue,
|
|
335
|
+
descending: !1
|
|
336
|
+
});
|
|
337
|
+
v.value = t.totalResources ?? 0, await a({ pageSize: 10, pageIndex: 0 }), await x.readPremium();
|
|
338
|
+
}), (t, s) => {
|
|
339
|
+
const f = p("FmPill"), l = p("FmPageHead"), h = p("FmIcon"), z = p("FmMenuItem"), S = p("FmMenu"), $ = p("FmListItem"), T = p("FmList"), Z = p("FmButton"), q = p("FmCard");
|
|
340
|
+
return c(), b(P, null, [
|
|
341
|
+
i(l, {
|
|
342
|
+
title: "Segments",
|
|
343
|
+
actions: e(Y),
|
|
344
|
+
"onClick:action": s[0] || (s[0] = (u) => u === "add" ? k() : n())
|
|
345
|
+
}, {
|
|
346
|
+
title: _(() => [
|
|
347
|
+
o("div", $e, [
|
|
348
|
+
Re,
|
|
349
|
+
i(f, { variant: "premium" })
|
|
350
|
+
])
|
|
351
|
+
]),
|
|
352
|
+
_: 1
|
|
353
|
+
}, 8, ["actions"]),
|
|
354
|
+
o("div", Ie, [
|
|
355
|
+
e(g).length > 0 || e(d).searchValue || e(d).isLoading ? (c(), b(P, { key: 0 }, [
|
|
356
|
+
i(O, {
|
|
357
|
+
loading: e(d).isLoading,
|
|
358
|
+
"row-data": e(g),
|
|
359
|
+
"row-count": e(d).totalRows,
|
|
360
|
+
"column-defs": r,
|
|
361
|
+
"shrink-at": !1,
|
|
362
|
+
"page-count": e(d).pageCount,
|
|
363
|
+
"page-index": e(d).pageIndex,
|
|
364
|
+
"page-size": e(d).pageSize,
|
|
365
|
+
onRowClick: s[1] || (s[1] = (u) => {
|
|
366
|
+
k(u.original);
|
|
367
|
+
}),
|
|
368
|
+
onPageChange: e(a)
|
|
369
|
+
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
|
|
370
|
+
i(T, { class: "w-full hidden xs:block" }, {
|
|
371
|
+
default: _(() => [
|
|
372
|
+
(c(!0), b(P, null, Q(e(g), (u) => (c(), B($, {
|
|
373
|
+
key: u._id.toString(),
|
|
374
|
+
tag: "label",
|
|
375
|
+
onClick: (N) => k(u)
|
|
376
|
+
}, {
|
|
377
|
+
default: _(() => [
|
|
378
|
+
o("div", null, [
|
|
379
|
+
o("div", Pe, M((u.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
380
|
+
o("div", Ve, M(u.name), 1),
|
|
381
|
+
o("div", Be, M(((u.memberCount ?? 0) * 100 / e(v)).toFixed(2)) + "% of customers ", 1)
|
|
382
|
+
])
|
|
383
|
+
]),
|
|
384
|
+
append: _(() => [
|
|
385
|
+
i(S, { "stop-click-propagation": !0 }, {
|
|
386
|
+
"menu-button": _(() => [
|
|
387
|
+
i(h, { name: "more_vert" })
|
|
388
|
+
]),
|
|
389
|
+
default: _(() => [
|
|
390
|
+
i(z, {
|
|
391
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400",
|
|
392
|
+
label: "Remove",
|
|
393
|
+
"onUpdate:modelValue": (N) => N && w(u)
|
|
394
|
+
}, null, 8, ["onUpdate:modelValue"])
|
|
395
|
+
]),
|
|
396
|
+
_: 2
|
|
397
|
+
}, 1024)
|
|
398
|
+
]),
|
|
399
|
+
_: 2
|
|
400
|
+
}, 1032, ["onClick"]))), 128))
|
|
401
|
+
]),
|
|
402
|
+
_: 1
|
|
403
|
+
})
|
|
404
|
+
], 64)) : (c(), B(q, {
|
|
405
|
+
key: 1,
|
|
406
|
+
variant: "outlined",
|
|
407
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
408
|
+
}, {
|
|
409
|
+
default: _(() => [
|
|
410
|
+
De,
|
|
411
|
+
Ye,
|
|
412
|
+
i(Z, {
|
|
413
|
+
variant: "primary",
|
|
414
|
+
label: "Create segment",
|
|
415
|
+
disabled: !e(x).isPremium,
|
|
416
|
+
icon: "add",
|
|
417
|
+
onClick: s[2] || (s[2] = (u) => k())
|
|
418
|
+
}, null, 8, ["disabled"])
|
|
419
|
+
]),
|
|
420
|
+
_: 1
|
|
421
|
+
})),
|
|
422
|
+
i(Me, {
|
|
423
|
+
ref_key: "sheetRef",
|
|
424
|
+
ref: m,
|
|
425
|
+
"onUpdate:modelValue": F
|
|
426
|
+
}, null, 512)
|
|
427
|
+
])
|
|
428
|
+
], 64);
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
export {
|
|
433
|
+
We as default
|
|
434
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineComponent as Re, ref as z, computed as ie, onMounted as De, resolveComponent as L, openBlock as V, createBlock as we, withCtx as G, createElementVNode as b, createVNode as M, unref as h, isRef as ke, createElementBlock as q, Fragment as fe, createTextVNode as Q, toDisplayString as k, renderList as Ie, createCommentVNode as Pe } from "vue";
|
|
2
2
|
import { h as rt } from "./moment-BWErdI6_.js";
|
|
3
3
|
import { useDialog as Ve } from "@feedmepos/ui-library";
|
|
4
|
-
import { a as xe, u as it, p as st, f as K } from "./loading-
|
|
4
|
+
import { a as xe, u as it, p as st, f as K } from "./loading-C7oH4e0j.js";
|
|
5
5
|
import { u as at } from "./app-wDQR6dpb.js";
|
|
6
|
-
import { u as be, l as $e } from "./business-
|
|
7
|
-
import { u as ze } from "./membership-
|
|
8
|
-
import { l as lt } from "./index-
|
|
6
|
+
import { u as be, l as $e } from "./business-iGcoCCSb.js";
|
|
7
|
+
import { u as ze } from "./membership-D0G_5G-y.js";
|
|
8
|
+
import { l as lt } from "./index-DG0RrwCN.js";
|
|
9
9
|
import { _ as Ne } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
10
|
-
import { _ as ct } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
11
|
-
import { _ as ut } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
12
|
-
import { m as dt } from "./index-
|
|
10
|
+
import { _ as ct } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DdtJ3kNK.js";
|
|
11
|
+
import { _ as ut } from "./MessageInput.vue_vue_type_script_setup_true_lang-MaCtf4Xn.js";
|
|
12
|
+
import { m as dt } from "./index-dbSbwT_z.js";
|
|
13
13
|
import { o as ft } from "./objectId-dwaoBfJX.js";
|
|
14
14
|
import { a as gt } from "./object-qECH92oz.js";
|
|
15
15
|
var Z = {}, mt = function() {
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { defineComponent as G, computed as D, resolveComponent as _, openBlock as b, createBlock as B, withCtx as P, createElementVNode as v, createElementBlock as $, createVNode as s, createCommentVNode as j, toDisplayString as ne, unref as e, Fragment as L, renderList as ae, ref as A, isRef as se, reactive as Ae, onMounted as me, watch as he, toRaw as Ne, createTextVNode as oe, h as Oe } from "vue";
|
|
2
2
|
import { _ as Ee } from "./tier-BJDhpH6X.js";
|
|
3
3
|
import { useDialog as Re, useDialogChild as Ie, components as Me } from "@feedmepos/ui-library";
|
|
4
|
-
import { c as R, e as ce, S as je } from "./index-
|
|
5
|
-
import { d as Q, a as Le, u as qe, p as pe, n as He, f as ye } from "./loading-
|
|
6
|
-
import { u as xe, C as ie } from "./membership-
|
|
4
|
+
import { c as R, e as ce, S as je } from "./index-X-EzXcGs.js";
|
|
5
|
+
import { d as Q, a as Le, u as qe, p as pe, n as He, f as ye } from "./loading-C7oH4e0j.js";
|
|
6
|
+
import { u as xe, C as ie } from "./membership-D0G_5G-y.js";
|
|
7
7
|
import { a as Ke, c as ke } from "./object-qECH92oz.js";
|
|
8
8
|
import { _ as le } from "./lodash-B5I3zXaY.js";
|
|
9
9
|
import { Z as z, _ as X, g as K, a as W } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
10
|
-
import { z as Y, R as We } from "./app-
|
|
11
|
-
import { F as ze, a as Ye, b as Je, c as Ue } from "./index-
|
|
10
|
+
import { z as Y, R as We } from "./app-Bzct9xVo.js";
|
|
11
|
+
import { F as ze, a as Ye, b as Je, c as Ue } from "./index-3_r2IGAF.js";
|
|
12
12
|
import { u as ve } from "./app-wDQR6dpb.js";
|
|
13
13
|
import { J as _e } from "./JsonViewer-v8_C7l5N.js";
|
|
14
|
-
import { _ as Ge } from "./index-
|
|
14
|
+
import { _ as Ge } from "./index-C6kizPcL.js";
|
|
15
15
|
import { _ as Xe } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
16
16
|
import { _ as Ze } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
17
|
-
import { z as Qe, a as et } from "./money-
|
|
18
|
-
import { F as tt } from "./number-
|
|
19
|
-
import { t as ot } from "./helper-
|
|
20
|
-
import "./index-
|
|
17
|
+
import { z as Qe, a as et } from "./money-B6MghTDE.js";
|
|
18
|
+
import { F as tt } from "./number-qKhyhzHd.js";
|
|
19
|
+
import { t as ot } from "./helper-O1xiribY.js";
|
|
20
|
+
import "./index-PO2CtKXo.js";
|
|
21
21
|
import { useRouter as at } from "vue-router";
|
|
22
|
-
import { m as fe } from "./index-
|
|
22
|
+
import { m as fe } from "./index-dbSbwT_z.js";
|
|
23
23
|
function lt(f) {
|
|
24
24
|
return Q.DineroFactory(f).toUnit();
|
|
25
25
|
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { defineComponent as q, ref as V, computed as N, onMounted as Y, resolveComponent as p, openBlock as u, createBlock as b, unref as e, isRef as W, withCtx as x, createElementVNode as l, createVNode as s, createElementBlock as O, createTextVNode as z, resolveDynamicComponent as H, toDisplayString as G, Fragment as j, createCommentVNode as U, h } from "vue";
|
|
2
2
|
import { _ as J } from "./campaign-CpzFl8Vr.js";
|
|
3
3
|
import { components as $ } from "@feedmepos/ui-library";
|
|
4
|
-
import "./index-
|
|
5
|
-
import { u as Q, p as M, f as B } from "./loading-
|
|
6
|
-
import { C, u as X } from "./membership-
|
|
7
|
-
import { F as ee } from "./index-
|
|
4
|
+
import "./index-PO2CtKXo.js";
|
|
5
|
+
import { u as Q, p as M, f as B } from "./loading-C7oH4e0j.js";
|
|
6
|
+
import { C, u as X } from "./membership-D0G_5G-y.js";
|
|
7
|
+
import { F as ee } from "./index-C6kizPcL.js";
|
|
8
8
|
import { c as te } from "./object-qECH92oz.js";
|
|
9
9
|
import { _ as oe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
10
10
|
import { u as K } from "./app-wDQR6dpb.js";
|
|
11
|
-
import { u as ae } from "./business-
|
|
11
|
+
import { u as ae } from "./business-iGcoCCSb.js";
|
|
12
12
|
import { useCoreStore as ne } from "@feedmepos/mf-common";
|
|
13
13
|
import { _ as se, Z as g } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
14
14
|
import { _ as le } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
15
|
-
import { _ as re } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { _ as ie, a as me } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
17
|
-
import { i as de, t as ce } from "./helper-
|
|
15
|
+
import { _ as re } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DdtJ3kNK.js";
|
|
16
|
+
import { _ as ie, a as me } from "./EffectSheet.vue_vue_type_style_index_0_lang-Cw-KLvgf.js";
|
|
17
|
+
import { i as de, t as ce } from "./helper-O1xiribY.js";
|
|
18
18
|
import { useRouter as ue } from "vue-router";
|
|
19
|
-
import { m as D } from "./index-
|
|
20
|
-
import { R as k } from "./app-
|
|
19
|
+
import { m as D } from "./index-dbSbwT_z.js";
|
|
20
|
+
import { R as k } from "./app-Bzct9xVo.js";
|
|
21
21
|
const pe = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "flex flex-col space-y-16 pr-12"
|