@feedmepos/mf-connect 0.1.0-beta.6 → 0.1.0-beta.60
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-CXegtSEd.js +427 -0
- package/dist/{App-C2616cfr.js → App-m9A9s3wd.js} +445 -420
- package/dist/AuditLogs-CpUOkyXq.js +1886 -0
- package/dist/Bin-m6mPl3FE.js +166 -0
- package/dist/{Broadcast-CqSwLTAq.js → Broadcast-DNjHnlPp.js} +56 -54
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DrR9Pmtb.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-cjdNZLkE.js} +6 -8
- package/dist/Card-CAvS5aaN.js +896 -0
- package/dist/Collections-3C9I2byH.js +459 -0
- package/dist/{Credit-CPcLgnsq.js → Credit-DcAmLeMb.js} +36 -34
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-wGFMCV-y.js +2181 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-D2buK6Dj.js → EffectSheet.vue_vue_type_style_index_0_lang-CIEn1N24.js} +6 -6
- package/dist/{Experience-BoBikt-x.js → Experience-GF9yOrlE.js} +32 -30
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
- package/dist/{Game-DR8PyYZa.js → Game-CzBn_Li3.js} +39 -37
- package/dist/Index-Bhmkdb4n.js +259 -0
- package/dist/Marketing-DlbcOoiN.js +20071 -0
- package/dist/Member-CdXG5uEN.js +317 -0
- package/dist/MemberList-xIOXAHJf.js +1598 -0
- package/dist/MemberTransactions-CsW9vso0.js +45 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DhtIZCjT.js → MessageInput.vue_vue_type_script_setup_true_lang-jtjk9NjI.js} +83 -71
- package/dist/{Mission-CMpvz9zN.js → Mission-2UjKrmGe.js} +101 -87
- package/dist/Overview-ClittdS6.js +1078 -0
- package/dist/{Point-DkZn6p9s.js → Point-BON4g7zE.js} +55 -53
- package/dist/{Promotion-B7YzwPc_.js → Promotion-qUEZmmm8.js} +65 -57
- package/dist/Queue-DA4glGdE.js +244 -0
- package/dist/Record-EUAnp1--.js +340 -0
- package/dist/Reward-ChbsdQuW.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CUFw56sf.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BKesht7Y.js +1637 -0
- package/dist/Segment-DbwFx6vD.js +568 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-lwpYOWMR.js +181 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-BbuOPEGY.js +147 -0
- package/dist/Setting-FMTftvlU.js +1931 -0
- package/dist/Store-BkUwiBUq.js +1751 -0
- package/dist/{StoreRewards-6BzVwZqr.js → StoreRewards-Z8uhK0v1.js} +33 -32
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DwFYJ1Iz.js +943 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B6cAveco.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-D6mrJp05.js} +1 -1
- package/dist/{Tier-CW-46oJS.js → Tier-COCmcJJF.js} +327 -318
- package/dist/{Title-CE9rWVdi.js → Title-7qCjbur9.js} +199 -184
- package/dist/{Transaction-B21RrC4M.js → Transaction-9FS_K2hv.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Fx-J2gcK.js +130 -0
- package/dist/Voucher-Dx70JAgw.js +354 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CECJsKRJ.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BiVZwBuG.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bne_nxYS.js} +1 -1
- package/dist/{app-CjhXHUQv.js → app-CWKpKW78.js} +1 -1
- package/dist/app-q6W6-faT.js +7059 -0
- package/dist/app.js +1 -1
- package/dist/{business-aHhRUXc0.js → business-D5AQBRGS.js} +1 -1
- package/dist/campaign-BGiM8ccX.js +1810 -0
- package/dist/{campaign-DH9NUNf_.js → campaign-v8MAkDo-.js} +2 -2
- package/dist/campaign.enum-Dro6UEcE.js +20 -0
- package/dist/campaign.fn-DsJUr-gE.js +758 -0
- package/dist/collectible.enum-BH9pX7PE.js +19 -0
- package/dist/{collection.fn-CYlsA-kW.js → collection.fn-CHiRShK_.js} +2 -2
- package/dist/dto-CeX9egUp.js +214 -0
- package/dist/{effect-LSc9YanX.js → effect-DtJQE1cD.js} +9 -9
- package/dist/email-addresses-DKOsgzML.js +705 -0
- package/dist/{export-Cf0-C5Ly.js → export-Daiv_zH9.js} +5 -5
- package/dist/{helper-CiZpeMCM.js → helper-B5Emawnj.js} +1 -1
- package/dist/index-9WBy0L7U.js +54 -0
- package/dist/{index-D6cEOHP4.js → index-BSHuLDD0.js} +1501 -1480
- package/dist/{index-BVb5-Ht8.js → index-CUl_8M_c.js} +259 -173
- package/dist/{index-gxwjKu3-.js → index-CgCcvX_L.js} +2212 -871
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/{index-D_83JP2i.js → index-DrWrGAHJ.js} +48 -4
- package/dist/index-DteeKoFo.js +115 -0
- package/dist/{index-DW3PRjPL.js → index-Dw2RtHKR.js} +1 -1
- package/dist/{index-kPhrD63q.js → index-ICbXrXiP.js} +1 -1
- package/dist/index-Xwc07I54.js +29000 -0
- package/dist/{index-DtsDOuDx.js → index-ZBSI6ViG.js} +24 -21
- package/dist/index-g9NNHS8s.js +32 -0
- package/dist/index-p6F08hhh.js +44 -0
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/{index.esm2017-B7oVYIbY.js → index.esm2017-B-SDA6Y2.js} +121 -121
- package/dist/loading-CDbkBsRr.js +71 -0
- package/dist/{membership-Dw1ylJ9Y.js → membership-B8uwuntJ.js} +54 -46
- package/dist/money-DRKB3Rpe.js +15 -0
- package/dist/number-DtyC1DJU.js +12 -0
- package/dist/objectid-wGrq9P1h.js +145 -0
- package/dist/{loading-7yq1tinq.js → plugins-DKNh-lBz.js} +3871 -3943
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/reward-C2jv5dmJ.js +36 -0
- package/dist/{rule-C0Q_SHow.js → rule-C5AMTchR.js} +180 -177
- package/dist/{rule-builder-iu17XIof.js → rule-builder-DLOGHT1l.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-CyOanTMu.js → template-C-fz1DXI.js} +5 -5
- package/dist/trigger-DTErX60D.js +144 -0
- package/dist/user-CVRoQGCF.js +54 -0
- package/dist/{vue-i18n-B0fLJH7a.js → vue-i18n-CxMxiW_u.js} +366 -366
- package/dist/{xlsx-BYO_bB9J.js → xlsx-CARvMJN_.js} +1 -1
- package/package.json +10 -6
- package/dist/Analytic-muDf0oMG.js +0 -622
- package/dist/Card-bhLoK0ZV.js +0 -825
- package/dist/Collections-DjtsAiol.js +0 -453
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-U_QZneS6.js +0 -2813
- package/dist/Marketing-Dny2nMUl.js +0 -316
- package/dist/Member-CP_smyk8.js +0 -69
- package/dist/MemberList-CR3eYI9p.js +0 -1733
- package/dist/MemberTransactions-RTx_lKFb.js +0 -38
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cs67_GLE.js +0 -1753
- package/dist/Segment-Bb4gHt5V.js +0 -437
- package/dist/Setting-Xj0AVzh3.js +0 -1901
- package/dist/Store-BWRHQ6Ie.js +0 -1511
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BsFnT8BS.js +0 -890
- package/dist/Voucher-KK9fBI0u.js +0 -490
- package/dist/app-Dvf_JNMf.js +0 -5764
- package/dist/dto-DArfyZAI.js +0 -2770
- package/dist/index-Bi_LGEtY.js +0 -99
- package/dist/index-CiQDG7Cm.js +0 -762
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DQfjSSMF.js +0 -206
- package/dist/index-DcxssxPi.js +0 -29193
- package/dist/index-DqJVH2kv.js +0 -298
- package/dist/money-CPd0XTNv.js +0 -15
- package/dist/number-BgXY4un8.js +0 -12
- package/dist/user-Bm4KttFq.js +0 -37
package/dist/Segment-Bb4gHt5V.js
DELETED
|
@@ -1,437 +0,0 @@
|
|
|
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-7yq1tinq.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-B0fLJH7a.js";
|
|
7
|
-
import { Z as ae } from "./zod-Bg2FbC-D.js";
|
|
8
|
-
import { a as se } from "./index-gxwjKu3-.js";
|
|
9
|
-
import { u as le } from "./app-wDQR6dpb.js";
|
|
10
|
-
import { R as ie } from "./rule-builder-iu17XIof.js";
|
|
11
|
-
import { _ as re } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BiVZwBuG.js";
|
|
12
|
-
import { _ as me } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Cs67_GLE.js";
|
|
13
|
-
import { h as V } from "./moment-BWErdI6_.js";
|
|
14
|
-
import { s as k } from "./membership-Dw1ylJ9Y.js";
|
|
15
|
-
import { o as de } from "./objectId-dwaoBfJX.js";
|
|
16
|
-
import { u as ce } from "./business-aHhRUXc0.js";
|
|
17
|
-
import { m as ue } from "./index-DtsDOuDx.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
|
-
};
|