@feedmepos/mf-connect 0.1.38-beta.1 → 0.1.38-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-Dc1l0CZK.js +427 -0
- package/dist/{App-BWZ2EE71.js → App-BLg0CWv-.js} +352 -364
- package/dist/{Bin-C-Ha-4yF.js → Bin-DDbKIePj.js} +8 -8
- package/dist/{Broadcast-Bo3QS8lS.js → Broadcast-CihKie6G.js} +40 -40
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-4vUMzH-l.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DbdBGvgR.js} +18 -18
- package/dist/{Card-Bs1TDE0e.js → Card-h1dYFE_s.js} +159 -159
- package/dist/{Collections-Dy5RN7Js.js → Collections-DUXdnJqQ.js} +91 -103
- package/dist/{Credit-Bqc4dw1s.js → Credit-CsGEuX9p.js} +74 -74
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-D6AmN3o3.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-0gMUNtdO.js} +488 -488
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BzwADnKp.js → EffectSheet.vue_vue_type_style_index_0_lang-CQDnl97F.js} +94 -94
- package/dist/{Experience-C2e2T7B-.js → Experience-CBbqYrql.js} +41 -41
- package/dist/{Game-C86eEhcx.js → Game-CicPpdT5.js} +31 -31
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
- package/dist/{Index-BRGweFco.js → Index-Xgvlt4vk.js} +10 -10
- package/dist/Marketing-CqOAQgg4.js +319 -0
- package/dist/{Member-B3o0Zhcw.js → Member-D1k4ZQ95.js} +76 -76
- package/dist/MemberList-BdV9sxO_.js +1606 -0
- package/dist/MemberOverview-C2n9oJZh.js +58 -0
- package/dist/{MemberTransactions-C4hao-d9.js → MemberTransactions-Q0_4nT4e.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D9zfmqLs.js → MessageInput.vue_vue_type_script_setup_true_lang-COGCJGRc.js} +36 -36
- package/dist/{Mission-BURXfzjd.js → Mission-D-TW52zn.js} +21 -21
- package/dist/{Overview-D_hrrM4O.js → Overview-BleJmxHa.js} +335 -335
- package/dist/{Point-CJXkJY5Q.js → Point-B7BYX9us.js} +41 -41
- package/dist/{Promotion-CunJrh42.js → Promotion-BphlQC55.js} +42 -42
- package/dist/{Queue-v5Itg9J4.js → Queue-DJfZqO1f.js} +51 -51
- package/dist/{Record-DJe4tg9R.js → Record-Bv1P0s2g.js} +9 -9
- package/dist/{Reward-Y9aHpny5.js → Reward-CRyEjr47.js} +173 -173
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-1KAjCblO.js → RewardGroup.vue_vue_type_script_setup_true_lang-Ckqox5Ut.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Cr99ikbK.js → RuleGroup.vue_vue_type_script_setup_true_lang-Dp4ku9ep.js} +431 -431
- package/dist/Segment-Br0Y5hzV.js +882 -0
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BhJ-oVMb.js → SelectItems.vue_vue_type_script_setup_true_lang-BuB-qwcM.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-b5bjfBvc.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DanHGQXC.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DoKAgSLE.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BCKUXnGl.js} +3 -3
- package/dist/{Setting-BU5778gG.js → Setting-BPFArJMv.js} +432 -432
- package/dist/{Store-IWg0POAU.js → Store-e_odFoS5.js} +210 -210
- package/dist/StoreRewards-wXhyzIFI.js +423 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CVPQt-bn.js +995 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BcOvr526.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CWJmeeo-.js} +1 -1
- package/dist/{Tier-iN30KD7g.js → Tier-GfdGRbTX.js} +106 -106
- package/dist/{Title-Duh_Srek.js → Title-C2ZyFxNf.js} +131 -133
- package/dist/{Transaction-DLBA7Svl.js → Transaction-Dv8yYXJS.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DLD5d43d.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CK_4iMCA.js} +6 -6
- package/dist/{Voucher-cTvlMN0Y.js → Voucher-CBujqgnF.js} +37 -37
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CgooH4yn.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-C5S-bi5J.js → ZodTextField.vue_vue_type_script_setup_true_lang-B8pgaARn.js} +1 -1
- package/dist/{app-De-yQ1CJ.js → app-B2Cgyy70.js} +124 -161
- package/dist/{app-A3oEKLq5.js → app-B8E3wp8L.js} +1 -1
- package/dist/app.js +3 -4
- package/dist/{business-B2JBpm4y.js → business-BRidHvRK.js} +1 -1
- package/dist/{campaign-vkzui6F2.js → campaign-B0vnIan2.js} +3 -5
- package/dist/{campaign-Bhur0NJx.js → campaign-B7v0a8YV.js} +9 -9
- package/dist/{campaign.enum-DCYkKGhd.js → campaign.enum-NH5faqyS.js} +1 -1
- package/dist/{campaign.fn--affTEi5.js → campaign.fn-BPHARk3Y.js} +161 -161
- package/dist/{collectible.enum-CLBCnfev.js → collectible.enum-Cun9w38h.js} +1 -1
- package/dist/{collection.fn-bA8q0KYy.js → collection.fn-RR5q6jqi.js} +2 -2
- package/dist/{dto-RCcWeYE0.js → dto-DK1VnGlq.js} +4 -4
- package/dist/{effect-D7qRfPe_.js → effect-CI4ZR8HW.js} +1 -1
- package/dist/{email-addresses-a8PqViID.js → email-addresses-bguwgnrW.js} +1 -1
- package/dist/{export-BneqNRn4.js → export-CcepocZB.js} +3 -3
- package/dist/{helper-DfvvxOyO.js → helper-BM1JTEFS.js} +1 -1
- package/dist/{index-CbsJ6vMJ.js → index-B0Slqiqo.js} +1 -1
- package/dist/{index-y-7yUm2e.js → index-B6_uPXyL.js} +9 -9
- package/dist/{index-CTKMdxSm.js → index-BS3AjuVw.js} +1 -1
- package/dist/{index-2LpkG8Ye.js → index-BfGdztHf.js} +1 -1
- package/dist/{index-D0GnMoag.js → index-CBuCx_0r.js} +79 -168
- package/dist/{index-4kMeSNTr.js → index-CLkqja9X.js} +385 -376
- package/dist/{index-DMrIQqFt.js → index-Cm_6xScD.js} +1 -1
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/index-DHEJX75j.js +44 -0
- package/dist/{index-CMBPIb8x.js → index-D_gLVFsk.js} +941 -932
- package/dist/{index-BWTvsoH0.js → index-DbjZHuoG.js} +1 -1
- package/dist/{index-CrFUhsZO.js → index-De1JnaPh.js} +1 -1
- package/dist/{index-DeXvASjP.js → index-Di6bqaLm.js} +3 -3
- package/dist/{index-CtDqXnOp.js → index-DjycZwfg.js} +448 -515
- package/dist/{index-B0T9GDIZ.js → index-vs1HgFHz.js} +1 -1
- package/dist/{index.esm2017-JtyypweZ.js → index.esm2017-DANlqJ4g.js} +127 -127
- package/dist/{loading-a-FqrwqI.js → loading-BXu9ofEu.js} +1 -1
- package/dist/{membership-CGVtil5J.js → membership-BBb7gdZg.js} +3 -3
- package/dist/{money-CTc1l_Cq.js → money-C02BW-pt.js} +1 -1
- package/dist/{number-W3R-0nYP.js → number-D7tIDv2q.js} +1 -1
- package/dist/objectid-oVX5A5oa.js +145 -0
- package/dist/{plugins-D2sSgTSl.js → plugins-B5tuGbFw.js} +2 -2
- package/dist/{reward-atP8vnNn.js → reward-CE-bnnnQ.js} +1 -1
- package/dist/{rule-eA5IvnjB.js → rule-BN5R8pYj.js} +3 -3
- package/dist/{rule-builder-BB29ZJ_C.js → rule-builder-16JDtaoI.js} +17 -17
- package/dist/style.css +1 -1
- package/dist/{template-DhBeDaAm.js → template-C-zyZgxl.js} +64 -64
- package/dist/{trigger-Bq_pZj1J.js → trigger-DCLjl3mM.js} +4 -4
- package/dist/{usePagination-BeF5K3M7.js → usePagination-JoYaROkV.js} +85 -85
- package/dist/{user-B-bhVFIG.js → user-C7bmFOaT.js} +1 -1
- package/dist/{vue-i18n-D-h8VDSx.js → vue-i18n-Cts9OsqE.js} +277 -277
- package/dist/{xlsx-DsByAcZl.js → xlsx-CJ5ufXk3.js} +226 -226
- package/package.json +3 -5
- package/dist/Analytic-O-qZWrFp.js +0 -761
- package/dist/AuditLogs-DlmcFEta.js +0 -1887
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +0 -58
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
- package/dist/Marketing-CnnrnXbS.js +0 -20073
- package/dist/MemberList-BpE1IjED.js +0 -1606
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/Segment-DVT8uDn8.js +0 -882
- package/dist/StoreRewards-CIjHcVoh.js +0 -423
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cx05-OPF.js +0 -1029
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DkjojUvD.js +0 -419
- package/dist/index-CVAWGMus.js +0 -56
- package/dist/index-CsaQJMAR.js +0 -66
- package/dist/objectid-BU0Y8iAN.js +0 -145
- package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
package/dist/Segment-DVT8uDn8.js
DELETED
|
@@ -1,882 +0,0 @@
|
|
|
1
|
-
import { defineComponent as ee, ref as z, resolveComponent as b, openBlock as p, createElementBlock as k, createElementVNode as l, createVNode as r, unref as t, createCommentVNode as le, withCtx as E, Fragment as O, renderList as ie, createBlock as J, toDisplayString as $, normalizeClass as re, onMounted as Se, computed as ce, isRef as Ie, createSlots as Me, h as Y, onBeforeMount as Te } from "vue";
|
|
2
|
-
import { _ as Ee } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { p as Ae } from "./plugins-D2sSgTSl.js";
|
|
4
|
-
import { u as De } from "./loading-a-FqrwqI.js";
|
|
5
|
-
import { FmButtonVariant as ae, useSnackbar as Re, components as X } from "@feedmepos/ui-library";
|
|
6
|
-
import { u as we, _ as be } from "./usePagination-BeF5K3M7.js";
|
|
7
|
-
import { u as Fe } from "./vue-i18n-D-h8VDSx.js";
|
|
8
|
-
import "./index-D0GnMoag.js";
|
|
9
|
-
import { i as $e, j as R, c as fe } from "./index-CtDqXnOp.js";
|
|
10
|
-
import "./index-y-7yUm2e.js";
|
|
11
|
-
import "./index-B0T9GDIZ.js";
|
|
12
|
-
import "./index-DeXvASjP.js";
|
|
13
|
-
import { u as ne, w as he } from "./xlsx-DsByAcZl.js";
|
|
14
|
-
import { e as Pe, M as Be } from "./email-addresses-a8PqViID.js";
|
|
15
|
-
import { Z as Ne } from "./zod-Bg2FbC-D.js";
|
|
16
|
-
import { u as Ve } from "./app-wDQR6dpb.js";
|
|
17
|
-
import { F as ye, z as Ye } from "./index-CMBPIb8x.js";
|
|
18
|
-
import { R as ge } from "./rule-builder-BB29ZJ_C.js";
|
|
19
|
-
import { _ as Ue } from "./ZodTextField.vue_vue_type_script_setup_true_lang-C5S-bi5J.js";
|
|
20
|
-
import { _ as Le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Cr99ikbK.js";
|
|
21
|
-
import { u as ze, v as Oe, w as je } from "./index.esm2017-JtyypweZ.js";
|
|
22
|
-
import { F as qe } from "./FileSaver.min-NlMItPOc.js";
|
|
23
|
-
import { h as H } from "./moment-BWErdI6_.js";
|
|
24
|
-
import { s as B, u as Ge } from "./membership-CGVtil5J.js";
|
|
25
|
-
import { o as He } from "./objectId-dwaoBfJX.js";
|
|
26
|
-
import { u as Ce } from "./business-B2JBpm4y.js";
|
|
27
|
-
import { f as Je } from "./number-W3R-0nYP.js";
|
|
28
|
-
import { t as Qe } from "./money-CTc1l_Cq.js";
|
|
29
|
-
import "./index-CrFUhsZO.js";
|
|
30
|
-
import { useRouter as We } from "vue-router";
|
|
31
|
-
import { m as ve } from "./index-DMrIQqFt.js";
|
|
32
|
-
import { R as _e } from "./app-De-yQ1CJ.js";
|
|
33
|
-
const Ze = $e.extend({
|
|
34
|
-
_id: ye.optional(),
|
|
35
|
-
business: ye.optional(),
|
|
36
|
-
file: Ye.any().nullish()
|
|
37
|
-
});
|
|
38
|
-
var Ke = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" };
|
|
39
|
-
const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
40
|
-
key: 0,
|
|
41
|
-
class: /* @__PURE__ */ re([
|
|
42
|
-
"p-16 pl-24 space-x-8",
|
|
43
|
-
"bg-fm-color-primary-oats rounded-lg",
|
|
44
|
-
"flex items-center",
|
|
45
|
-
"justify-between"
|
|
46
|
-
])
|
|
47
|
-
}, tt = { class: "flex justify-end" }, ot = {
|
|
48
|
-
key: 1,
|
|
49
|
-
class: /* @__PURE__ */ re([
|
|
50
|
-
"flex items-center",
|
|
51
|
-
"border border-fm-color-neutral-gray-300",
|
|
52
|
-
"p-16 space-x-16 rounded-md"
|
|
53
|
-
])
|
|
54
|
-
}, at = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, nt = /* @__PURE__ */ ee({
|
|
55
|
-
__name: "ImportSegment",
|
|
56
|
-
props: {
|
|
57
|
-
importFile: {}
|
|
58
|
-
},
|
|
59
|
-
emits: ["update:file"],
|
|
60
|
-
setup(e, { emit: _ }) {
|
|
61
|
-
const x = e, h = _, { t: m } = Fe(), y = z(null), f = z(null), F = ["Id"], i = [
|
|
62
|
-
{
|
|
63
|
-
label: "CSV",
|
|
64
|
-
icon: "csv",
|
|
65
|
-
value: "csv"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
label: "Excel",
|
|
69
|
-
icon: "description",
|
|
70
|
-
value: "xlsx"
|
|
71
|
-
}
|
|
72
|
-
];
|
|
73
|
-
async function n() {
|
|
74
|
-
if (x.importFile)
|
|
75
|
-
try {
|
|
76
|
-
const S = ze(void 0, Ke.importFilesBucketUrl), g = Oe(S, x.importFile), w = await je(g);
|
|
77
|
-
window.open(w, "_blank");
|
|
78
|
-
} catch (S) {
|
|
79
|
-
console.log(S);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
async function c(S) {
|
|
83
|
-
switch (S) {
|
|
84
|
-
case "csv":
|
|
85
|
-
const g = new Blob([F.join(",")], {
|
|
86
|
-
type: "text/csv;charset=utf-8;"
|
|
87
|
-
});
|
|
88
|
-
qe.saveAs(g, "ImportSegmentTemplate.csv");
|
|
89
|
-
break;
|
|
90
|
-
case "xlsx":
|
|
91
|
-
const w = ne.aoa_to_sheet([F]), I = ne.book_new();
|
|
92
|
-
ne.book_append_sheet(I, w, "Sheet1"), he(I, "ImportSegmentTemplate.xlsx");
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
function C(S) {
|
|
97
|
-
y.value = S, h("update:file", y.value);
|
|
98
|
-
}
|
|
99
|
-
function A(S) {
|
|
100
|
-
var w, I;
|
|
101
|
-
const g = ((I = (w = S.target) == null ? void 0 : w.files) == null ? void 0 : I[0]) ?? null;
|
|
102
|
-
C(g);
|
|
103
|
-
}
|
|
104
|
-
return (S, g) => {
|
|
105
|
-
const w = b("FmButton"), I = b("FmMenuItem"), u = b("FmMenu"), s = b("FmDropField");
|
|
106
|
-
return p(), k("div", Xe, [
|
|
107
|
-
g[2] || (g[2] = l("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1)),
|
|
108
|
-
S.importFile ? (p(), k("div", et, [
|
|
109
|
-
r(w, {
|
|
110
|
-
label: t(m)("View uploaded file"),
|
|
111
|
-
variant: t(ae).Plain,
|
|
112
|
-
icon: "file_present",
|
|
113
|
-
onClick: n
|
|
114
|
-
}, null, 8, ["label", "variant"])
|
|
115
|
-
])) : le("", !0),
|
|
116
|
-
l("div", null, [
|
|
117
|
-
l("div", tt, [
|
|
118
|
-
r(u, { class: "" }, {
|
|
119
|
-
"menu-button": E(() => [
|
|
120
|
-
r(w, {
|
|
121
|
-
variant: "tertiary",
|
|
122
|
-
icon: "download",
|
|
123
|
-
label: "Download Template"
|
|
124
|
-
})
|
|
125
|
-
]),
|
|
126
|
-
default: E(() => [
|
|
127
|
-
(p(), k(O, null, ie(i, (v) => r(I, {
|
|
128
|
-
key: v.value,
|
|
129
|
-
icon: v.icon,
|
|
130
|
-
label: v.label,
|
|
131
|
-
onClick: (U) => c(v.value),
|
|
132
|
-
selectable: ""
|
|
133
|
-
}, null, 8, ["icon", "label", "onClick"])), 64))
|
|
134
|
-
]),
|
|
135
|
-
_: 1
|
|
136
|
-
})
|
|
137
|
-
]),
|
|
138
|
-
y.value ? (p(), k("div", ot, [
|
|
139
|
-
r(w, {
|
|
140
|
-
variant: t(ae).Tertiary,
|
|
141
|
-
"prepend-icon": "attach_file"
|
|
142
|
-
}, null, 8, ["variant"]),
|
|
143
|
-
l("p", at, $(y.value.name), 1),
|
|
144
|
-
l("label", {
|
|
145
|
-
ref_key: "fileLabelRef",
|
|
146
|
-
ref: f,
|
|
147
|
-
htmlFor: "file"
|
|
148
|
-
}, [
|
|
149
|
-
r(w, {
|
|
150
|
-
variant: t(ae).Plain,
|
|
151
|
-
label: t(m)("Replace File"),
|
|
152
|
-
onClick: g[1] || (g[1] = () => {
|
|
153
|
-
var v;
|
|
154
|
-
return (v = f.value) == null ? void 0 : v.click();
|
|
155
|
-
})
|
|
156
|
-
}, null, 8, ["variant", "label"]),
|
|
157
|
-
l("input", {
|
|
158
|
-
id: "file",
|
|
159
|
-
accept: ".csv",
|
|
160
|
-
class: "hidden",
|
|
161
|
-
type: "file",
|
|
162
|
-
multiple: "",
|
|
163
|
-
onChange: A
|
|
164
|
-
}, null, 32)
|
|
165
|
-
], 512)
|
|
166
|
-
])) : (p(), J(s, {
|
|
167
|
-
key: 0,
|
|
168
|
-
onFileUpload: g[0] || (g[0] = (v) => C(v)),
|
|
169
|
-
accept: ".csv, .xlsx",
|
|
170
|
-
"max-file-size": 2e7
|
|
171
|
-
}))
|
|
172
|
-
])
|
|
173
|
-
]);
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
}), st = { class: "space-y-16 pr-12" }, lt = { class: "fm-typo-en-title-md-800" }, it = { class: "flex space-x-8" }, rt = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, ct = { class: "text-fm-color-typo-secondary" }, dt = /* @__PURE__ */ ee({
|
|
177
|
-
__name: "ReviewSegment",
|
|
178
|
-
props: {
|
|
179
|
-
title: {},
|
|
180
|
-
segment: {}
|
|
181
|
-
},
|
|
182
|
-
setup(e) {
|
|
183
|
-
const _ = e, x = [
|
|
184
|
-
{
|
|
185
|
-
header: "Name",
|
|
186
|
-
accessorFn: (n) => n.name
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
header: "Id",
|
|
190
|
-
accessorFn: (n) => n._id
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
header: "Customer Since",
|
|
194
|
-
accessorFn: (n) => H(He(n._id.toString())).format("DD MMM YYYY")
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
header: "Phone",
|
|
198
|
-
accessorFn: (n) => n.phoneNumber
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
header: "Birthday",
|
|
202
|
-
accessorFn: (n) => H(n.birthday).format("DD MMM YYYY")
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
header: "Last Visit",
|
|
206
|
-
accessorFn: (n) => H(n.stats.lastVisit).format("DD MMM YYYY")
|
|
207
|
-
}
|
|
208
|
-
];
|
|
209
|
-
async function h(n) {
|
|
210
|
-
return _.segment._id ? (console.log(n), await B.paginateSegmentUsers(
|
|
211
|
-
_.segment._id,
|
|
212
|
-
n
|
|
213
|
-
)) : {
|
|
214
|
-
resources: [],
|
|
215
|
-
meta: {
|
|
216
|
-
totalResources: 0,
|
|
217
|
-
totalPages: 0,
|
|
218
|
-
skip: n.skip,
|
|
219
|
-
limit: n.limit,
|
|
220
|
-
sortBy: n.sortBy
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: F, onSearch: i } = we(h);
|
|
225
|
-
return Se(async () => {
|
|
226
|
-
await F();
|
|
227
|
-
}), (n, c) => (p(), k("div", st, [
|
|
228
|
-
l("div", lt, $(_.title), 1),
|
|
229
|
-
l("div", it, [
|
|
230
|
-
l("div", rt, $(n.segment.members.length), 1),
|
|
231
|
-
l("div", ct, [
|
|
232
|
-
c[1] || (c[1] = l("div", null, "contacts in your segment", -1)),
|
|
233
|
-
l("div", null, "as of " + $(t(H)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
234
|
-
])
|
|
235
|
-
]),
|
|
236
|
-
r(be, {
|
|
237
|
-
loading: t(m).isLoading,
|
|
238
|
-
"row-data": t(y),
|
|
239
|
-
"row-count": t(m).totalRows,
|
|
240
|
-
"column-defs": x,
|
|
241
|
-
"page-size": t(m).pageSize,
|
|
242
|
-
"page-count": t(m).pageCount,
|
|
243
|
-
"page-index": t(m).pageIndex,
|
|
244
|
-
onSortChange: t(f),
|
|
245
|
-
onPageChange: c[0] || (c[0] = (C) => t(F)({ pageSize: C.pageSize, pageIndex: C.pageIndex }))
|
|
246
|
-
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
|
|
247
|
-
]));
|
|
248
|
-
}
|
|
249
|
-
}), ut = { class: "space-y-24" }, pt = { class: "grid grid-cols-2 gap-16" }, mt = { class: "fm-typo-en-title-sm-800" }, ft = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, yt = /* @__PURE__ */ ee({
|
|
250
|
-
__name: "SegmentTypeOption",
|
|
251
|
-
props: {
|
|
252
|
-
modelValue: {},
|
|
253
|
-
errorText: {}
|
|
254
|
-
},
|
|
255
|
-
emits: ["update:model-value"],
|
|
256
|
-
setup(e, { emit: _ }) {
|
|
257
|
-
const x = e, h = _, m = [
|
|
258
|
-
{
|
|
259
|
-
label: "Dynamic",
|
|
260
|
-
sublabel: "Segment statistics are based on rules configured and will be recalculated automatically when rule changes.",
|
|
261
|
-
value: R.enum.DYNAMIC
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
label: "Static",
|
|
265
|
-
sublabel: "Segment statistics are based on imported data and will not be recalculated.",
|
|
266
|
-
value: R.enum.STATIC
|
|
267
|
-
}
|
|
268
|
-
];
|
|
269
|
-
function y(f) {
|
|
270
|
-
f !== x.modelValue && h("update:model-value", f);
|
|
271
|
-
}
|
|
272
|
-
return (f, F) => {
|
|
273
|
-
const i = b("FmCard"), n = b("FmHelperText");
|
|
274
|
-
return p(), k("div", ut, [
|
|
275
|
-
l("div", pt, [
|
|
276
|
-
(p(), k(O, null, ie(m, (c) => r(i, {
|
|
277
|
-
variant: "outlined",
|
|
278
|
-
class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
279
|
-
"col-span-2": m.length == 1,
|
|
280
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": f.modelValue === c.value,
|
|
281
|
-
"hover:bg-fm-color-opacity-sm": f.modelValue !== c.value
|
|
282
|
-
}]),
|
|
283
|
-
onClick: (C) => y(c.value),
|
|
284
|
-
key: c.value
|
|
285
|
-
}, {
|
|
286
|
-
default: E(() => [
|
|
287
|
-
l("div", mt, $(c.label), 1),
|
|
288
|
-
l("div", ft, $(c.sublabel), 1)
|
|
289
|
-
]),
|
|
290
|
-
_: 2
|
|
291
|
-
}, 1032, ["class", "onClick"])), 64))
|
|
292
|
-
]),
|
|
293
|
-
f.errorText ? (p(), J(n, {
|
|
294
|
-
key: 0,
|
|
295
|
-
class: "!mt-4",
|
|
296
|
-
text: f.errorText,
|
|
297
|
-
state: "error"
|
|
298
|
-
}, null, 8, ["text"])) : le("", !0)
|
|
299
|
-
]);
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
}), gt = { class: "flex items-center gap-x-8" }, vt = {
|
|
303
|
-
key: 0,
|
|
304
|
-
class: "space-y-16 pr-12"
|
|
305
|
-
}, _t = { class: "flex flex-col space-y-16" }, xt = {
|
|
306
|
-
key: 0,
|
|
307
|
-
class: "flex flex-col space-y-16"
|
|
308
|
-
}, St = {
|
|
309
|
-
key: 1,
|
|
310
|
-
class: "flex flex-col space-y-16"
|
|
311
|
-
}, wt = {
|
|
312
|
-
key: 2,
|
|
313
|
-
class: "flex flex-col space-y-16"
|
|
314
|
-
}, bt = { class: "flex items-center gap-8" }, Ft = /* @__PURE__ */ ee({
|
|
315
|
-
__name: "SegmentSheet",
|
|
316
|
-
emits: ["update:model-value"],
|
|
317
|
-
setup(e, { expose: _, emit: x }) {
|
|
318
|
-
const h = Ve(), m = z(!1), y = z(!1), f = {
|
|
319
|
-
name: "",
|
|
320
|
-
isActive: !0,
|
|
321
|
-
type: R.enum.DYNAMIC,
|
|
322
|
-
rule: ge.scaffoldGroup(),
|
|
323
|
-
members: []
|
|
324
|
-
}, F = Ze, i = z(f), n = ce(() => {
|
|
325
|
-
const u = F.safeParse(i.value);
|
|
326
|
-
return u.success ? [] : u.error.errors;
|
|
327
|
-
});
|
|
328
|
-
function c(u) {
|
|
329
|
-
m.value = !0, y.value = !1, u ? i.value = {
|
|
330
|
-
...u,
|
|
331
|
-
isActive: u.isActive !== !1,
|
|
332
|
-
type: u.type ?? (u.importFile ? R.enum.STATIC : R.enum.DYNAMIC)
|
|
333
|
-
} : i.value = { ...f };
|
|
334
|
-
}
|
|
335
|
-
function C() {
|
|
336
|
-
m.value = !1;
|
|
337
|
-
}
|
|
338
|
-
async function A() {
|
|
339
|
-
F.safeParse(i.value).success && (y.value = !0);
|
|
340
|
-
}
|
|
341
|
-
function S() {
|
|
342
|
-
y.value = !1;
|
|
343
|
-
}
|
|
344
|
-
async function g() {
|
|
345
|
-
i.value.type === R.enum.STATIC ? (i.value.rule = ge.scaffoldGroup(), i.value.isActive = !0) : i.value.file = void 0, I("update:model-value", i.value);
|
|
346
|
-
}
|
|
347
|
-
async function w(u) {
|
|
348
|
-
i.value.type = u;
|
|
349
|
-
}
|
|
350
|
-
Se(async () => {
|
|
351
|
-
});
|
|
352
|
-
const I = x;
|
|
353
|
-
return _({
|
|
354
|
-
showSheet: c,
|
|
355
|
-
hideSheet: C
|
|
356
|
-
}), (u, s) => {
|
|
357
|
-
const v = b("FmButton"), U = b("FmSwitch"), a = b("FmSideSheet");
|
|
358
|
-
return p(), J(a, {
|
|
359
|
-
modelValue: t(m),
|
|
360
|
-
"onUpdate:modelValue": s[8] || (s[8] = (o) => Ie(m) ? m.value = o : null),
|
|
361
|
-
header: "Add segment",
|
|
362
|
-
"dismiss-away": "",
|
|
363
|
-
"close-button": !0,
|
|
364
|
-
"max-width": 1100
|
|
365
|
-
}, Me({
|
|
366
|
-
"side-sheet-footer": E(() => [
|
|
367
|
-
l("div", bt, [
|
|
368
|
-
t(y) || t(i).type === t(R).enum.STATIC ? (p(), k(O, { key: 0 }, [
|
|
369
|
-
r(v, {
|
|
370
|
-
label: "Save Segment",
|
|
371
|
-
onClick: g,
|
|
372
|
-
loading: t(h).isLoading,
|
|
373
|
-
disabled: t(n).length > 0 || t(h).isLoading
|
|
374
|
-
}, null, 8, ["loading", "disabled"]),
|
|
375
|
-
r(v, {
|
|
376
|
-
label: "Cancel",
|
|
377
|
-
onClick: s[6] || (s[6] = (o) => S()),
|
|
378
|
-
variant: "tertiary"
|
|
379
|
-
})
|
|
380
|
-
], 64)) : (p(), k(O, { key: 1 }, [
|
|
381
|
-
r(v, {
|
|
382
|
-
label: "Review Segment",
|
|
383
|
-
disabled: t(n).length > 0 || t(h).isLoading,
|
|
384
|
-
onClick: A
|
|
385
|
-
}, null, 8, ["disabled"]),
|
|
386
|
-
r(v, {
|
|
387
|
-
label: "Cancel",
|
|
388
|
-
onClick: s[7] || (s[7] = (o) => C()),
|
|
389
|
-
variant: "tertiary"
|
|
390
|
-
})
|
|
391
|
-
], 64))
|
|
392
|
-
])
|
|
393
|
-
]),
|
|
394
|
-
default: E(() => {
|
|
395
|
-
var o;
|
|
396
|
-
return [
|
|
397
|
-
t(y) ? (p(), J(dt, {
|
|
398
|
-
key: 1,
|
|
399
|
-
title: t(i).name,
|
|
400
|
-
segment: t(i)
|
|
401
|
-
}, null, 8, ["title", "segment"])) : (p(), k("div", vt, [
|
|
402
|
-
r(Ue, {
|
|
403
|
-
modelValue: t(i).name,
|
|
404
|
-
"onUpdate:modelValue": s[1] || (s[1] = (d) => t(i).name = d),
|
|
405
|
-
label: "Segment title",
|
|
406
|
-
schema: t(Ne).typeAtPath(t(F), "name")
|
|
407
|
-
}, null, 8, ["modelValue", "schema"]),
|
|
408
|
-
l("div", _t, [
|
|
409
|
-
s[10] || (s[10] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1)),
|
|
410
|
-
r(yt, {
|
|
411
|
-
"model-value": t(i).type,
|
|
412
|
-
"onUpdate:modelValue": s[2] || (s[2] = (d) => {
|
|
413
|
-
w(d);
|
|
414
|
-
})
|
|
415
|
-
}, null, 8, ["model-value"])
|
|
416
|
-
]),
|
|
417
|
-
t(i).type === t(R).enum.DYNAMIC ? (p(), k("div", xt, [
|
|
418
|
-
s[11] || (s[11] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
|
|
419
|
-
r(Le, {
|
|
420
|
-
"trigger-type": "MEMBERSHIP_JOINED",
|
|
421
|
-
includeOnly: "user",
|
|
422
|
-
"model-value": (o = t(i)) == null ? void 0 : o.rule,
|
|
423
|
-
"onUpdate:modelValue": s[3] || (s[3] = (d) => {
|
|
424
|
-
t(i).rule = d;
|
|
425
|
-
})
|
|
426
|
-
}, null, 8, ["model-value"])
|
|
427
|
-
])) : (p(), k("div", St, [
|
|
428
|
-
r(nt, {
|
|
429
|
-
importFile: t(i).importFile,
|
|
430
|
-
"onUpdate:file": s[4] || (s[4] = (d) => {
|
|
431
|
-
t(i).file = d;
|
|
432
|
-
})
|
|
433
|
-
}, null, 8, ["importFile"])
|
|
434
|
-
])),
|
|
435
|
-
t(i).type === t(R).enum.DYNAMIC ? (p(), k("div", wt, [
|
|
436
|
-
s[12] || (s[12] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1)),
|
|
437
|
-
r(U, {
|
|
438
|
-
"model-value": t(i).isActive ?? !0,
|
|
439
|
-
"onUpdate:modelValue": s[5] || (s[5] = (d) => t(i).isActive = d),
|
|
440
|
-
label: "Active",
|
|
441
|
-
sublabel: "When enabled, this will recalculate the segment statistics daily.",
|
|
442
|
-
"label-placement": "right"
|
|
443
|
-
}, null, 8, ["model-value"])
|
|
444
|
-
])) : le("", !0)
|
|
445
|
-
]))
|
|
446
|
-
];
|
|
447
|
-
}),
|
|
448
|
-
_: 2
|
|
449
|
-
}, [
|
|
450
|
-
t(y) ? {
|
|
451
|
-
name: "side-sheet-header",
|
|
452
|
-
fn: E(() => [
|
|
453
|
-
l("div", gt, [
|
|
454
|
-
r(v, {
|
|
455
|
-
icon: "arrow_back",
|
|
456
|
-
variant: "tertiary",
|
|
457
|
-
onClick: s[0] || (s[0] = (o) => y.value = !1)
|
|
458
|
-
}),
|
|
459
|
-
s[9] || (s[9] = l("div", null, "Review segment", -1))
|
|
460
|
-
])
|
|
461
|
-
]),
|
|
462
|
-
key: "0"
|
|
463
|
-
} : void 0
|
|
464
|
-
]), 1032, ["modelValue"]);
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
}), xe = Ge(), ht = Ce();
|
|
468
|
-
function se(e) {
|
|
469
|
-
const _ = H(e);
|
|
470
|
-
return _.isValid() ? _.format("DD/MM/YYYY") : "";
|
|
471
|
-
}
|
|
472
|
-
const Ct = {
|
|
473
|
-
mapMemberExportRow: (e) => {
|
|
474
|
-
var n, c, C, A, S, g, w, I, u, s, v, U, a, o, d, P, D, N, V, j, q, G, te, M, Q, de, ue, pe;
|
|
475
|
-
const _ = ce(() => ht.locations.map((T) => ({
|
|
476
|
-
label: T.name,
|
|
477
|
-
value: T._id
|
|
478
|
-
}))), x = (n = Pe.parseOneAddress(
|
|
479
|
-
e == null ? void 0 : e.email
|
|
480
|
-
)) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email, h = (C = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : C.reduce(
|
|
481
|
-
(T, L) => {
|
|
482
|
-
var Z, K;
|
|
483
|
-
const W = (K = (Z = xe.sortedTitles) == null ? void 0 : Z.find(
|
|
484
|
-
(oe) => oe._id === L.collectible
|
|
485
|
-
)) == null ? void 0 : K.name;
|
|
486
|
-
return !W || L.balance <= 0 || T.push(W), T;
|
|
487
|
-
},
|
|
488
|
-
[]
|
|
489
|
-
), m = (xe.sortedTitles || []).reduce(
|
|
490
|
-
(T, L) => {
|
|
491
|
-
var Z, K, oe, me;
|
|
492
|
-
const W = (me = (oe = (K = (((Z = e == null ? void 0 : e.collection) == null ? void 0 : Z.TITLE) || []).find(
|
|
493
|
-
(ke) => ke.collectible === L._id
|
|
494
|
-
)) == null ? void 0 : K.expiryBalance) == null ? void 0 : oe[0]) == null ? void 0 : me.expiredAt;
|
|
495
|
-
return T[L.name] = W ? H(W).format("DD/MM/YYYY") : "", T;
|
|
496
|
-
},
|
|
497
|
-
{}
|
|
498
|
-
), y = ((g = (S = (A = e.collection) == null ? void 0 : A.CREDIT) == null ? void 0 : S.at(0)) == null ? void 0 : g.balance) || 0, f = ((s = (u = (I = (w = e.collection) == null ? void 0 : w.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : u.expiryBalance) == null ? void 0 : s.reduce(
|
|
499
|
-
(T, L) => T + L.amount,
|
|
500
|
-
0
|
|
501
|
-
)) || 0, F = Je(y, 2);
|
|
502
|
-
return {
|
|
503
|
-
ID: e._id.toString(),
|
|
504
|
-
Name: ((v = e.name) == null ? void 0 : v.trim()) || "",
|
|
505
|
-
Phone: ((U = e == null ? void 0 : e.phoneNumber) == null ? void 0 : U.trim()) || "",
|
|
506
|
-
Email: x || "",
|
|
507
|
-
Gender: e.gender || "",
|
|
508
|
-
CardNo: e.cardNo || "",
|
|
509
|
-
Birthday: e != null && e.birthday ? se(e == null ? void 0 : e.birthday) : "",
|
|
510
|
-
Credit: parseFloat((Number(F) - Number(f)).toFixed(2)),
|
|
511
|
-
FreeCredit: Number(f.toFixed(2)),
|
|
512
|
-
TotalCredit: Number(F),
|
|
513
|
-
Exp: e != null && e.collection ? ((d = (o = (a = e.collection) == null ? void 0 : a.POINT) == null ? void 0 : o.at(0)) == null ? void 0 : d.balance) ?? 0 : 0,
|
|
514
|
-
Point: e != null && e.collection ? ((N = (D = (P = e.collection) == null ? void 0 : P.COIN) == null ? void 0 : D.at(0)) == null ? void 0 : N.balance) ?? 0 : 0,
|
|
515
|
-
Level: e != null && e.collection ? ((q = (j = (V = e.collection) == null ? void 0 : V.TIER) == null ? void 0 : j.at(0)) == null ? void 0 : q.balance) ?? 0 : 0,
|
|
516
|
-
Tier: e != null && e.collection ? ((M = (te = (G = e.collection) == null ? void 0 : G.TIER) == null ? void 0 : te.at(0)) == null ? void 0 : M.balance) ?? 0 : 0,
|
|
517
|
-
Titles: h.join(","),
|
|
518
|
-
...m,
|
|
519
|
-
TotalTransaction: e.stats.visitCount,
|
|
520
|
-
AvgSpent: Qe(Number(e.stats.avgBillSize || 0)).toFormat(
|
|
521
|
-
!1
|
|
522
|
-
),
|
|
523
|
-
TotalSpent: e.stats.avgBillSize * e.stats.visitCount,
|
|
524
|
-
LastVisit: se(e.stats.lastVisit),
|
|
525
|
-
Feedback: ((Q = e.stats) == null ? void 0 : Q.feedbackCount) || 0,
|
|
526
|
-
LastSeasonTierEarned: ((de = e.stats) == null ? void 0 : de.lastSeasonTierEarned) || 0,
|
|
527
|
-
LastSeasonPointEarned: ((ue = e.stats) == null ? void 0 : ue.lastSeasonPointEarned) || 0,
|
|
528
|
-
JoinedAt: se(e.joinAt || void 0),
|
|
529
|
-
JoinedAtLocation: e.location && ((pe = _.value.find((T) => T.value == e.location)) == null ? void 0 : pe.label) || "-",
|
|
530
|
-
VisitFrequency: `${Number(
|
|
531
|
-
Math.ceil(e.stats.avgVisitFrequency).toFixed(0)
|
|
532
|
-
)}`
|
|
533
|
-
};
|
|
534
|
-
}
|
|
535
|
-
}, kt = { class: "flex items-center" }, It = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Mt = { class: "px-24 flex flex-col gap-y-16" }, Tt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Et = { class: "fm-typo-en-body-md-600" }, At = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, uo = /* @__PURE__ */ ee({
|
|
536
|
-
__name: "Segment",
|
|
537
|
-
setup(e) {
|
|
538
|
-
const { minor: _ } = De, { t: x } = Fe(), h = Ce(), { mapMemberExportRow: m } = Ct, y = Re(), f = We(), F = z(0), i = [
|
|
539
|
-
{
|
|
540
|
-
header: x("connect.loyalty.segment.table.name"),
|
|
541
|
-
accessorFn: (a) => a.name
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
header: x("connect.loyalty.segment.table.status"),
|
|
545
|
-
enableSorting: !1,
|
|
546
|
-
cell(a) {
|
|
547
|
-
const o = a.row.original.isActive === !1 ? "Inactive" : "Active";
|
|
548
|
-
return Y(X.FmChip, {
|
|
549
|
-
class: a.row.original.isActive === !1 ? "text-fm-color-typo-error bg-fm-color-system-error-100" : "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
550
|
-
label: o,
|
|
551
|
-
compact: !0
|
|
552
|
-
});
|
|
553
|
-
}
|
|
554
|
-
},
|
|
555
|
-
{
|
|
556
|
-
header: x("connect.loyalty.segment.table.total_customers"),
|
|
557
|
-
accessorFn: (a) => a.memberCount ?? 0
|
|
558
|
-
},
|
|
559
|
-
{
|
|
560
|
-
header: x("connect.loyalty.segment.table.customer_percentage"),
|
|
561
|
-
accessorFn: (a) => ((a.memberCount ?? 0) * 100 / F.value).toFixed(2)
|
|
562
|
-
},
|
|
563
|
-
{
|
|
564
|
-
header: x("connect.loyalty.segment.table.actions"),
|
|
565
|
-
meta: {
|
|
566
|
-
maxWidth: "100px"
|
|
567
|
-
},
|
|
568
|
-
cell(a) {
|
|
569
|
-
return Y("div", { class: "flex items-center justify-end" }, [
|
|
570
|
-
Y(
|
|
571
|
-
X.FmMenu,
|
|
572
|
-
{
|
|
573
|
-
placement: "bottom-end",
|
|
574
|
-
onClick: (o) => {
|
|
575
|
-
o.stopPropagation();
|
|
576
|
-
}
|
|
577
|
-
},
|
|
578
|
-
{
|
|
579
|
-
"menu-button": () => Y(X.FmButton, {
|
|
580
|
-
icon: "more_vert",
|
|
581
|
-
iconColor: "neutral-gray-400",
|
|
582
|
-
variant: "tertiary"
|
|
583
|
-
}),
|
|
584
|
-
default: () => [
|
|
585
|
-
Y(
|
|
586
|
-
X.FmMenuItem,
|
|
587
|
-
{
|
|
588
|
-
onClick: async (o) => {
|
|
589
|
-
o.stopPropagation(), w(a.row.original);
|
|
590
|
-
}
|
|
591
|
-
},
|
|
592
|
-
{
|
|
593
|
-
label: Y(
|
|
594
|
-
"div",
|
|
595
|
-
{
|
|
596
|
-
class: "fm-typo-en-body-md-400"
|
|
597
|
-
},
|
|
598
|
-
"Export"
|
|
599
|
-
)
|
|
600
|
-
}
|
|
601
|
-
),
|
|
602
|
-
Y(
|
|
603
|
-
X.FmMenuItem,
|
|
604
|
-
{
|
|
605
|
-
onClick: async (o) => {
|
|
606
|
-
o.stopPropagation(), g(a.row.original);
|
|
607
|
-
}
|
|
608
|
-
},
|
|
609
|
-
{
|
|
610
|
-
label: Y(
|
|
611
|
-
"div",
|
|
612
|
-
{
|
|
613
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
614
|
-
},
|
|
615
|
-
"Remove"
|
|
616
|
-
)
|
|
617
|
-
}
|
|
618
|
-
)
|
|
619
|
-
]
|
|
620
|
-
}
|
|
621
|
-
)
|
|
622
|
-
]);
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
], n = z(null), { tableMeta: c, rowData: C, debouncedFetchData: A } = we(
|
|
626
|
-
B.readAll
|
|
627
|
-
);
|
|
628
|
-
async function S() {
|
|
629
|
-
await _(
|
|
630
|
-
async () => {
|
|
631
|
-
await B.refreshSegments(), await A({ pageSize: 10, pageIndex: 0 });
|
|
632
|
-
},
|
|
633
|
-
{ message: "Refreshing segmentations" }
|
|
634
|
-
);
|
|
635
|
-
}
|
|
636
|
-
async function g(a) {
|
|
637
|
-
await Ae.remove(`Are you sure you want to remove ${a.name}?`) && await _(
|
|
638
|
-
async () => {
|
|
639
|
-
await B.delete(a._id), await A({ pageSize: 10, pageIndex: 0 });
|
|
640
|
-
},
|
|
641
|
-
{
|
|
642
|
-
message: `Removing ${a.name}`,
|
|
643
|
-
successMessage: `Removed ${a.name} successfully`
|
|
644
|
-
}
|
|
645
|
-
);
|
|
646
|
-
}
|
|
647
|
-
async function w(a) {
|
|
648
|
-
const o = {
|
|
649
|
-
sortBy: "_id",
|
|
650
|
-
descending: !1,
|
|
651
|
-
rowsPerPage: 1e3,
|
|
652
|
-
page: 1,
|
|
653
|
-
rowsNumber: 0
|
|
654
|
-
}, d = new Be(), P = (await ve.read({
|
|
655
|
-
limit: 1,
|
|
656
|
-
skip: 0,
|
|
657
|
-
sortBy: o.sortBy,
|
|
658
|
-
descending: o.descending
|
|
659
|
-
})).meta.totalResources ?? 0, D = o.rowsPerPage;
|
|
660
|
-
await _(
|
|
661
|
-
async () => {
|
|
662
|
-
for (let N = 0; N < P; N += D) {
|
|
663
|
-
const V = {
|
|
664
|
-
...o,
|
|
665
|
-
limit: D,
|
|
666
|
-
skip: o.page - 1,
|
|
667
|
-
sortBy: o.sortBy,
|
|
668
|
-
descending: o.descending
|
|
669
|
-
}, j = await B.paginateSegmentUsers(
|
|
670
|
-
a._id,
|
|
671
|
-
V
|
|
672
|
-
);
|
|
673
|
-
for (const q of j.resources) {
|
|
674
|
-
const G = m(q);
|
|
675
|
-
d.addRecord(G);
|
|
676
|
-
}
|
|
677
|
-
o.page++;
|
|
678
|
-
}
|
|
679
|
-
await he(
|
|
680
|
-
d.buildExcel(),
|
|
681
|
-
`[${a.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
682
|
-
{
|
|
683
|
-
bookType: "xlsx",
|
|
684
|
-
bookSST: !1,
|
|
685
|
-
type: "array"
|
|
686
|
-
}
|
|
687
|
-
), o.page = 1;
|
|
688
|
-
},
|
|
689
|
-
{
|
|
690
|
-
message: "Exporting member...",
|
|
691
|
-
successMessage: "Member exported successfully"
|
|
692
|
-
}
|
|
693
|
-
);
|
|
694
|
-
}
|
|
695
|
-
async function I(a) {
|
|
696
|
-
await _(
|
|
697
|
-
async () => {
|
|
698
|
-
var o;
|
|
699
|
-
if (a.type === R.enum.STATIC) {
|
|
700
|
-
const d = new FormData();
|
|
701
|
-
if (d.append("file", a.file), a._id) {
|
|
702
|
-
const { members: P, _id: D, file: N, ...V } = a;
|
|
703
|
-
d.append("segment", JSON.stringify(V)), await B.updateStatic(a._id, d);
|
|
704
|
-
} else {
|
|
705
|
-
const { file: P, ...D } = a;
|
|
706
|
-
d.append("segment", JSON.stringify(D)), await B.createStatic(d);
|
|
707
|
-
}
|
|
708
|
-
a.file && y.open({
|
|
709
|
-
type: "info",
|
|
710
|
-
title: "Import begins soon. Check Queue for updates.",
|
|
711
|
-
action: "View",
|
|
712
|
-
onAction: async () => {
|
|
713
|
-
await f.push({
|
|
714
|
-
name: _e["$connect-QUEUE"],
|
|
715
|
-
query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
} else if (a._id) {
|
|
720
|
-
const { members: d, _id: P, ...D } = a;
|
|
721
|
-
await B.update(a._id, D);
|
|
722
|
-
} else
|
|
723
|
-
await B.create(a);
|
|
724
|
-
await A({ pageSize: 10, pageIndex: 0 }), (o = n.value) == null || o.hideSheet();
|
|
725
|
-
},
|
|
726
|
-
{
|
|
727
|
-
message: "Saving segment",
|
|
728
|
-
successMessage: "Segment saved"
|
|
729
|
-
}
|
|
730
|
-
);
|
|
731
|
-
}
|
|
732
|
-
function u(a) {
|
|
733
|
-
var o;
|
|
734
|
-
(o = n.value) == null || o.showSheet(a);
|
|
735
|
-
}
|
|
736
|
-
const s = {
|
|
737
|
-
label: x("connect.navigation.queue"),
|
|
738
|
-
value: "queue",
|
|
739
|
-
isPrimary: !1,
|
|
740
|
-
prependIcon: "work_history"
|
|
741
|
-
}, v = ce(() => h.isPremium ? [
|
|
742
|
-
s,
|
|
743
|
-
{
|
|
744
|
-
label: "Refresh segments",
|
|
745
|
-
value: "refresh",
|
|
746
|
-
prependIcon: "refresh"
|
|
747
|
-
},
|
|
748
|
-
{
|
|
749
|
-
label: "Add segment",
|
|
750
|
-
value: "add",
|
|
751
|
-
isPrimary: !0,
|
|
752
|
-
prependIcon: "add"
|
|
753
|
-
}
|
|
754
|
-
] : []);
|
|
755
|
-
function U(a) {
|
|
756
|
-
switch (a) {
|
|
757
|
-
case "add":
|
|
758
|
-
u();
|
|
759
|
-
break;
|
|
760
|
-
case "refresh":
|
|
761
|
-
S();
|
|
762
|
-
break;
|
|
763
|
-
case "queue":
|
|
764
|
-
f.push({
|
|
765
|
-
name: _e["$connect-QUEUE"],
|
|
766
|
-
query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
|
|
767
|
-
});
|
|
768
|
-
break;
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
return Te(async () => {
|
|
772
|
-
const { meta: a } = await ve.read({
|
|
773
|
-
limit: 1,
|
|
774
|
-
skip: 0,
|
|
775
|
-
sortBy: "_id",
|
|
776
|
-
search: void 0,
|
|
777
|
-
descending: !1
|
|
778
|
-
});
|
|
779
|
-
F.value = a.totalResources ?? 0, await A({ pageSize: 10, pageIndex: 0 }), await h.readPremium(), await h.readLocations();
|
|
780
|
-
}), (a, o) => {
|
|
781
|
-
const d = b("FmPill"), P = b("FmPageHead"), D = b("FmIcon"), N = b("FmMenuItem"), V = b("FmMenu"), j = b("FmListItem"), q = b("FmList"), G = b("FmButton"), te = b("FmCard");
|
|
782
|
-
return p(), k(O, null, [
|
|
783
|
-
r(P, {
|
|
784
|
-
title: "Segments",
|
|
785
|
-
actions: t(v),
|
|
786
|
-
"onClick:action": o[0] || (o[0] = (M) => U(M))
|
|
787
|
-
}, {
|
|
788
|
-
title: E(() => [
|
|
789
|
-
l("div", kt, [
|
|
790
|
-
l("span", It, $(t(x)("connect.loyalty.segment.title")), 1),
|
|
791
|
-
r(d, { variant: "premium" })
|
|
792
|
-
])
|
|
793
|
-
]),
|
|
794
|
-
_: 1
|
|
795
|
-
}, 8, ["actions"]),
|
|
796
|
-
l("div", Mt, [
|
|
797
|
-
t(C).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), k(O, { key: 0 }, [
|
|
798
|
-
r(be, {
|
|
799
|
-
loading: t(c).isLoading,
|
|
800
|
-
"row-data": t(C),
|
|
801
|
-
"row-count": t(c).totalRows,
|
|
802
|
-
"column-defs": i,
|
|
803
|
-
"shrink-at": !1,
|
|
804
|
-
"page-count": t(c).pageCount,
|
|
805
|
-
"page-index": t(c).pageIndex,
|
|
806
|
-
"page-size": t(c).pageSize,
|
|
807
|
-
onRowClick: o[1] || (o[1] = (M) => {
|
|
808
|
-
u(M.original);
|
|
809
|
-
}),
|
|
810
|
-
onPageChange: t(A)
|
|
811
|
-
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
|
|
812
|
-
r(q, { class: "w-full hidden xs:block" }, {
|
|
813
|
-
default: E(() => [
|
|
814
|
-
(p(!0), k(O, null, ie(t(C), (M) => (p(), J(j, {
|
|
815
|
-
key: M._id.toString(),
|
|
816
|
-
tag: "label",
|
|
817
|
-
onClick: (Q) => u(M)
|
|
818
|
-
}, {
|
|
819
|
-
default: E(() => [
|
|
820
|
-
l("div", null, [
|
|
821
|
-
l("div", Tt, $((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
822
|
-
l("div", Et, $(M.name), 1),
|
|
823
|
-
l("div", At, $(((M.memberCount ?? 0) * 100 / t(F)).toFixed(2)) + "% of customers ", 1)
|
|
824
|
-
])
|
|
825
|
-
]),
|
|
826
|
-
append: E(() => [
|
|
827
|
-
r(V, { "stop-click-propagation": !0 }, {
|
|
828
|
-
"menu-button": E(() => [
|
|
829
|
-
r(D, { name: "more_vert" })
|
|
830
|
-
]),
|
|
831
|
-
default: E(() => [
|
|
832
|
-
r(N, {
|
|
833
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400",
|
|
834
|
-
label: "Remove",
|
|
835
|
-
"onUpdate:modelValue": (Q) => Q && g(M)
|
|
836
|
-
}, null, 8, ["onUpdate:modelValue"])
|
|
837
|
-
]),
|
|
838
|
-
_: 2
|
|
839
|
-
}, 1024)
|
|
840
|
-
]),
|
|
841
|
-
_: 2
|
|
842
|
-
}, 1032, ["onClick"]))), 128))
|
|
843
|
-
]),
|
|
844
|
-
_: 1
|
|
845
|
-
})
|
|
846
|
-
], 64)) : (p(), J(te, {
|
|
847
|
-
key: 1,
|
|
848
|
-
variant: "outlined",
|
|
849
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
850
|
-
}, {
|
|
851
|
-
default: E(() => [
|
|
852
|
-
o[3] || (o[3] = l("img", {
|
|
853
|
-
src: Ee,
|
|
854
|
-
class: "aspect-square w-[150px]"
|
|
855
|
-
}, null, -1)),
|
|
856
|
-
o[4] || (o[4] = l("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
857
|
-
l("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
|
|
858
|
-
l("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. ")
|
|
859
|
-
], -1)),
|
|
860
|
-
r(G, {
|
|
861
|
-
variant: "primary",
|
|
862
|
-
label: "Create segment",
|
|
863
|
-
disabled: !t(h).isPremium,
|
|
864
|
-
icon: "add",
|
|
865
|
-
onClick: o[2] || (o[2] = (M) => u())
|
|
866
|
-
}, null, 8, ["disabled"])
|
|
867
|
-
]),
|
|
868
|
-
_: 1
|
|
869
|
-
})),
|
|
870
|
-
r(Ft, {
|
|
871
|
-
ref_key: "sheetRef",
|
|
872
|
-
ref: n,
|
|
873
|
-
"onUpdate:modelValue": I
|
|
874
|
-
}, null, 512)
|
|
875
|
-
])
|
|
876
|
-
], 64);
|
|
877
|
-
};
|
|
878
|
-
}
|
|
879
|
-
});
|
|
880
|
-
export {
|
|
881
|
-
uo as default
|
|
882
|
-
};
|