@feedmepos/mf-connect 0.1.38-beta.8 → 0.1.38-beta.80
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-CJap-Cat.js → Analytic-LOK5TzX0.js} +31 -32
- package/dist/{App-CLTtX1QT.js → App-Bk5Z5u5_.js} +617 -607
- package/dist/AuditLogs-Rezf9EeA.js +1991 -0
- package/dist/{Bin-C2xMLxoE.js → Bin-B8yzS5bD.js} +10 -10
- package/dist/Broadcast-CZ0QCvua.js +266 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BCkD7Xfn.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-iJQS2Ck9.js} +6 -6
- package/dist/{Card-BPrCNLQy.js → Card-BQOv5yB9.js} +145 -140
- package/dist/Collections-qenPlCd2.js +540 -0
- package/dist/Credit-BJLskbVu.js +260 -0
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
- package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DKWCWOU_.js +3120 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Dw1qQfnG.js +351 -0
- package/dist/Experience-BjfEiGT8.js +259 -0
- package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-C013Tr1o.js} +1 -1
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
- package/dist/Game-Gw_tFjen.js +330 -0
- package/dist/Grab-Bdv7SaB9.js +300 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-Ba4L39GL.js} +49 -48
- package/dist/{Index-DMdNgISh.js → Index-C67U3YDJ.js} +54 -54
- package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-pQ8sF5KW.js +48 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-o-eN3J4i.js} +1 -1
- package/dist/{MainLayout-B1aJoR95.js → MainLayout-DPjqCyJ5.js} +1 -1
- package/dist/Marketing-DtEooXof.js +166 -0
- package/dist/MarketingMaterialEdit-Balw055Y.js +1065 -0
- package/dist/{Member-CnSXGQi_.js → Member-QA7TQnyw.js} +38 -37
- package/dist/{MemberList-DcpEKV1D.js → MemberList-CSJQFYlh.js} +486 -491
- package/dist/{MemberTransactions-DeuuEcO5.js → MemberTransactions-D-46vda_.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DLAEPNsq.js → MessageInput.vue_vue_type_script_setup_true_lang-6a7_lw74.js} +13443 -10607
- package/dist/Mission-DJVxFbX5.js +334 -0
- package/dist/{Overview-elpi-jpI.js → Overview-Btkh3oiI.js} +24 -25
- package/dist/Point-CVdF9GtN.js +262 -0
- package/dist/Promotion-BtmlvUd3.js +396 -0
- package/dist/{Queue-GvBhNEFe.js → Queue-BfiCMsLC.js} +23 -24
- package/dist/{Record-CbSxgo8i.js → Record-B07QGPli.js} +10 -10
- package/dist/Review-BeZ90jW9.js +621 -0
- package/dist/ReviewFacebookCallback-CwAcKaib.js +243 -0
- package/dist/ReviewGoogleCallback-CVK6Yc5E.js +213 -0
- package/dist/{Reward-QCGlrq89.js → Reward-CyXqNpAa.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DSRvoo9z.js → RewardGroup.vue_vue_type_script_setup_true_lang-BICsdgSh.js} +13 -14
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BgKGNK7y.js +1912 -0
- package/dist/{Segment-5PndnEUa.js → Segment-B9g57O7g.js} +273 -274
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DXR7bpzY.js → SelectItems.vue_vue_type_script_setup_true_lang-BwDOXE87.js} +23 -23
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DmITlNtt.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DXDcJLYF.js} +12 -12
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CROBk6cD.js +226 -0
- package/dist/Setting-BHteqZv6.js +2039 -0
- package/dist/SettingAdvertisements-CubrbuSL.js +264 -0
- package/dist/Store-u6LYUnmp.js +1996 -0
- package/dist/StoreRewards-D9h0YnEx.js +535 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-vrYqDGOa.js +1129 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-WgNstmNx.js +7007 -0
- package/dist/{Tier-BKKxG29r.js → Tier-CBdi4sPT.js} +561 -480
- package/dist/{Title-CReZgw8V.js → Title-BegmN7hs.js} +151 -149
- package/dist/{Transaction-HWCmSVaJ.js → Transaction-C6XMd9_r.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D00AchXo.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BBf4BP4m.js} +7 -7
- package/dist/Voucher-D6hSas_z.js +421 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-ZOlAZ_q5.js +421 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXF39yC1.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bs8TNiCY.js} +2 -2
- package/dist/app-Duwed9mD.js +59309 -0
- package/dist/app.js +1 -1
- package/dist/{business-Bc-EMd2p.js → business-6oZ8Rgui.js} +11 -8
- package/dist/campaign-CzenWLhs.js +219 -0
- package/dist/campaign-PYce7g0o.js +253 -0
- package/dist/campaign.enum-KHniCp5a.js +26 -0
- package/dist/campaign.fn-dOSgHJcU.js +776 -0
- package/dist/{collectible.enum-C4dM8khp.js → collectible.enum-BZA1DKIB.js} +1 -1
- package/dist/{collection.fn-AjDNdFe1.js → collection.fn-CyfrdKBf.js} +2 -2
- package/dist/dto-DYmM2ud_.js +222 -0
- package/dist/duplicateCampaign-BXaDK8Q6.js +51 -0
- package/dist/effect-DBI_JHbP.js +89 -0
- package/dist/{email-addresses-B0SzUCQM.js → email-addresses-BNs-WN79.js} +2 -2
- package/dist/{export-Bgz6WcNZ.js → export-DTCCKE2m.js} +4 -4
- package/dist/{helper-B1vFwohM.js → helper-CeYr7Anh.js} +22 -7
- package/dist/index-38u-cCwD.js +3431 -0
- package/dist/{index-Cm2sBagk.js → index-BdjY7GRO.js} +1 -1
- package/dist/index-CGMiuxyf.js +85 -0
- package/dist/index-CQZbm9P5.js +8912 -0
- package/dist/index-Cal60fAm.js +48 -0
- package/dist/{index-DT2viYsL.js → index-CnRLkzpg.js} +617 -191
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/{index-CSQY21Zb.js → index-D-kPBF9C.js} +3 -3
- package/dist/{index-DVQnrex_.js → index-DcFYm1fy.js} +3 -3
- package/dist/index-DjONNxbl.js +30289 -0
- package/dist/{index-26SopNpv.js → index-ItaoypTr.js} +1 -1
- package/dist/index-_jxXI4_v.js +28899 -0
- package/dist/{index-DwT9RLst.js → index-nXfjG8UQ.js} +23 -12
- package/dist/{index-BIRmS75g.js → index-pHQfP2e7.js} +1 -1
- package/dist/{index.esm2017-BAIN70_n.js → index.esm2017-CokFPnqn.js} +185 -185
- package/dist/{loading-C6Ouh0mG.js → loading-fZQi5zP8.js} +1 -1
- package/dist/{lodash-B5I3zXaY.js → lodash-R-DIRmbj.js} +1 -1
- package/dist/{membership-DU0BwIj8.js → membership-CApN5ZJ1.js} +3 -3
- package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
- package/dist/{money-Bg7GuE5s.js → money-C6I6vVy2.js} +1 -1
- package/dist/{number-Ddmqo5D_.js → number-Dq4d381U.js} +1 -1
- package/dist/objectid-Kv5GREBk.js +145 -0
- package/dist/{campaign-BeF8kTyg.js → plugins-9_UvAdJ2.js} +784 -777
- package/dist/remy-NLAa-9Qg.js +46 -0
- package/dist/{reward-CN4gvn4c.js → reward-DXHGeGYY.js} +1 -1
- package/dist/{rule-CpiqqR0c.js → rule-B_XgRDr-.js} +505 -487
- package/dist/rule-builder-BMXyzu8k.js +102 -0
- package/dist/style.css +11 -2
- package/dist/template-CnyTUzQU.js +188 -0
- package/dist/timezone-Izs3ibB-.js +1156 -0
- package/dist/trigger-Dda3NmaE.js +213 -0
- package/dist/usePagination-Byxk4XVn.js +220 -0
- package/dist/user-BZxO8qdh.js +55 -0
- package/dist/{vue-i18n-DVmD9I_o.js → vue-i18n-DDbkmbSf.js} +433 -433
- package/dist/{xlsx-qJHsnW7k.js → xlsx-D8yNl8dN.js} +1 -1
- package/dist/{zod-Bg2FbC-D.js → zod-Xp7TePRP.js} +32 -31
- package/package.json +14 -6
- package/dist/AuditLogs-DW4rwNOn.js +0 -1887
- package/dist/Broadcast-Dhc0j16O.js +0 -227
- package/dist/Collections-CsUJEmqz.js +0 -465
- package/dist/Credit-Mqa-0XJd.js +0 -222
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DWWLxIq-.js +0 -2185
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BiQGZeDc.js +0 -347
- package/dist/Experience-BD5C3old.js +0 -223
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
- package/dist/Game-D4xsi8Ym.js +0 -278
- package/dist/Marketing-axcQYl8k.js +0 -20073
- package/dist/Mission-BHZiL-GH.js +0 -296
- package/dist/Point-gKvdggAl.js +0 -226
- package/dist/Promotion-7x2F_sFX.js +0 -289
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-AuN9NgcG.js +0 -1751
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DTlv8ZAn.js +0 -147
- package/dist/Setting-Cab47wfH.js +0 -1936
- package/dist/Store-BFL3T9B5.js +0 -1842
- package/dist/StoreRewards-C43dCJtM.js +0 -423
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-aAj5-nzZ.js +0 -1029
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-K3OPSYrF.js +0 -139
- package/dist/Voucher-BhUAcPZg.js +0 -384
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-C0YNez2L.js +0 -419
- package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/app-BGaUIdCr.js +0 -7086
- package/dist/app-DccKBdW_.js +0 -33357
- package/dist/campaign-DbJZEU7P.js +0 -96
- package/dist/campaign.enum-PBKYGUQY.js +0 -20
- package/dist/campaign.fn-Cq-4LfQj.js +0 -758
- package/dist/dto-8NvMMYAb.js +0 -214
- package/dist/effect-DZhcEQ5g.js +0 -78
- package/dist/index-CQQedv0M.js +0 -32260
- package/dist/index-CTgQRqQR.js +0 -30038
- package/dist/index-CsaQJMAR.js +0 -66
- package/dist/index-DGaywhpY.js +0 -76
- package/dist/index-DOfLDlI8.js +0 -8861
- package/dist/index-DVpAocyR.js +0 -3120
- package/dist/index-DlJGd8RC.js +0 -121
- package/dist/index-Dm65CTdy.js +0 -38
- package/dist/objectid-MCaJXAgq.js +0 -145
- package/dist/plugins-C-CRzeyC.js +0 -208
- package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
- package/dist/rule-builder-DmkJng-x.js +0 -89
- package/dist/template-DTZgnkl5.js +0 -190
- package/dist/trigger-CPjJ73Rc.js +0 -144
- package/dist/usePagination-BeF5K3M7.js +0 -223
- package/dist/user-8VIt8A1x.js +0 -54
|
@@ -1,42 +1,41 @@
|
|
|
1
|
-
import { defineComponent as ee, ref as z, resolveComponent as
|
|
1
|
+
import { defineComponent as ee, ref as z, resolveComponent as S, 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 R, normalizeClass as re, onMounted as Se, computed as ce, isRef as Ie, createSlots as Me, h as Y, onBeforeMount as Te } from "vue";
|
|
2
2
|
import { _ as Ee } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import {
|
|
4
|
-
import { u as
|
|
3
|
+
import { n as Ae, p as De } from "./plugins-9_UvAdJ2.js";
|
|
4
|
+
import { u as $e } from "./loading-fZQi5zP8.js";
|
|
5
5
|
import { FmButtonVariant as ae, useSnackbar as Re, components as X } from "@feedmepos/ui-library";
|
|
6
|
-
import { u as we, _ as
|
|
7
|
-
import { u as
|
|
8
|
-
import "./index-
|
|
9
|
-
import { i as
|
|
10
|
-
import "./index-
|
|
11
|
-
import "./index-
|
|
12
|
-
import "./index-
|
|
13
|
-
import { u as ne, w as he } from "./xlsx-
|
|
14
|
-
import { e as
|
|
15
|
-
import { Z as
|
|
16
|
-
import { u as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { _ as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
import "
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
const Ze = $e.extend({
|
|
6
|
+
import { u as we, _ as Fe } from "./usePagination-Byxk4XVn.js";
|
|
7
|
+
import { u as be } from "./vue-i18n-DDbkmbSf.js";
|
|
8
|
+
import "./index-CnRLkzpg.js";
|
|
9
|
+
import { i as Pe, j as $, c as fe } from "./index-38u-cCwD.js";
|
|
10
|
+
import "./index-CQZbm9P5.js";
|
|
11
|
+
import { F as ye, z as Be } from "./index-DjONNxbl.js";
|
|
12
|
+
import "./index-D-kPBF9C.js";
|
|
13
|
+
import { u as ne, w as he } from "./xlsx-D8yNl8dN.js";
|
|
14
|
+
import { e as Ne, M as Ve } from "./email-addresses-BNs-WN79.js";
|
|
15
|
+
import { Z as Ye } from "./zod-Xp7TePRP.js";
|
|
16
|
+
import { u as Ue } from "./app-wDQR6dpb.js";
|
|
17
|
+
import { R as ge } from "./rule-builder-BMXyzu8k.js";
|
|
18
|
+
import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Bs8TNiCY.js";
|
|
19
|
+
import { _ as ze } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BgKGNK7y.js";
|
|
20
|
+
import { u as Oe, v as je, w as qe } from "./index.esm2017-CokFPnqn.js";
|
|
21
|
+
import { F as Ge } from "./FileSaver.min-C013Tr1o.js";
|
|
22
|
+
import { h as H } from "./moment-D7p2TMB-.js";
|
|
23
|
+
import { s as B, u as He } from "./membership-CApN5ZJ1.js";
|
|
24
|
+
import { o as Je } from "./objectId-dwaoBfJX.js";
|
|
25
|
+
import { u as Ce } from "./business-6oZ8Rgui.js";
|
|
26
|
+
import { f as Qe } from "./number-Dq4d381U.js";
|
|
27
|
+
import { t as We } from "./money-C6I6vVy2.js";
|
|
28
|
+
import "./index-BdjY7GRO.js";
|
|
29
|
+
import { useRouter as Ze } from "vue-router";
|
|
30
|
+
import { m as ve } from "./index-CGMiuxyf.js";
|
|
31
|
+
import { R as _e } from "./app-Duwed9mD.js";
|
|
32
|
+
const Ke = Pe.extend({
|
|
34
33
|
_id: ye.optional(),
|
|
35
34
|
business: ye.optional(),
|
|
36
|
-
file:
|
|
35
|
+
file: Be.any().nullish()
|
|
37
36
|
});
|
|
38
|
-
var
|
|
39
|
-
const
|
|
37
|
+
var Xe = { 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" };
|
|
38
|
+
const et = { class: "flex flex-col space-y-16" }, tt = {
|
|
40
39
|
key: 0,
|
|
41
40
|
class: /* @__PURE__ */ re([
|
|
42
41
|
"p-16 pl-24 space-x-8",
|
|
@@ -44,21 +43,21 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
44
43
|
"flex items-center",
|
|
45
44
|
"justify-between"
|
|
46
45
|
])
|
|
47
|
-
},
|
|
46
|
+
}, ot = { class: "flex justify-end" }, at = {
|
|
48
47
|
key: 1,
|
|
49
48
|
class: /* @__PURE__ */ re([
|
|
50
49
|
"flex items-center",
|
|
51
50
|
"border border-fm-color-neutral-gray-300",
|
|
52
51
|
"p-16 space-x-16 rounded-md"
|
|
53
52
|
])
|
|
54
|
-
},
|
|
53
|
+
}, nt = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, st = /* @__PURE__ */ ee({
|
|
55
54
|
__name: "ImportSegment",
|
|
56
55
|
props: {
|
|
57
56
|
importFile: {}
|
|
58
57
|
},
|
|
59
58
|
emits: ["update:file"],
|
|
60
|
-
setup(e, { emit:
|
|
61
|
-
const
|
|
59
|
+
setup(e, { emit: v }) {
|
|
60
|
+
const _ = e, C = v, { t: m } = be(), f = z(null), w = z(null), F = ["Id"], n = [
|
|
62
61
|
{
|
|
63
62
|
label: "CSV",
|
|
64
63
|
icon: "csv",
|
|
@@ -70,88 +69,88 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
70
69
|
value: "xlsx"
|
|
71
70
|
}
|
|
72
71
|
];
|
|
73
|
-
async function
|
|
74
|
-
if (
|
|
72
|
+
async function i() {
|
|
73
|
+
if (_.importFile)
|
|
75
74
|
try {
|
|
76
|
-
const
|
|
77
|
-
window.open(
|
|
78
|
-
} catch (
|
|
79
|
-
console.log(
|
|
75
|
+
const h = Oe(void 0, Xe.importFilesBucketUrl), y = je(h, _.importFile), x = await qe(y);
|
|
76
|
+
window.open(x, "_blank");
|
|
77
|
+
} catch (h) {
|
|
78
|
+
console.log(h), Ae.error("Failed to download uploaded file");
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
|
-
async function c(
|
|
83
|
-
switch (
|
|
81
|
+
async function c(h) {
|
|
82
|
+
switch (h) {
|
|
84
83
|
case "csv":
|
|
85
|
-
const
|
|
84
|
+
const y = new Blob([F.join(",")], {
|
|
86
85
|
type: "text/csv;charset=utf-8;"
|
|
87
86
|
});
|
|
88
|
-
|
|
87
|
+
Ge.saveAs(y, "ImportSegmentTemplate.csv");
|
|
89
88
|
break;
|
|
90
89
|
case "xlsx":
|
|
91
|
-
const
|
|
92
|
-
ne.book_append_sheet(I,
|
|
90
|
+
const x = ne.aoa_to_sheet([F]), I = ne.book_new();
|
|
91
|
+
ne.book_append_sheet(I, x, "Sheet1"), he(I, "ImportSegmentTemplate.xlsx");
|
|
93
92
|
break;
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
95
|
+
function b(h) {
|
|
96
|
+
f.value = h, C("update:file", f.value);
|
|
98
97
|
}
|
|
99
|
-
function A(
|
|
100
|
-
var
|
|
101
|
-
const
|
|
102
|
-
|
|
98
|
+
function A(h) {
|
|
99
|
+
var x, I;
|
|
100
|
+
const y = ((I = (x = h.target) == null ? void 0 : x.files) == null ? void 0 : I[0]) ?? null;
|
|
101
|
+
b(y);
|
|
103
102
|
}
|
|
104
|
-
return (
|
|
105
|
-
const
|
|
106
|
-
return p(), k("div",
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
r(
|
|
103
|
+
return (h, y) => {
|
|
104
|
+
const x = S("FmButton"), I = S("FmMenuItem"), d = S("FmMenu"), s = S("FmDropField");
|
|
105
|
+
return p(), k("div", et, [
|
|
106
|
+
y[2] || (y[2] = l("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1)),
|
|
107
|
+
e.importFile ? (p(), k("div", tt, [
|
|
108
|
+
r(x, {
|
|
110
109
|
label: t(m)("View uploaded file"),
|
|
111
110
|
variant: t(ae).Plain,
|
|
112
111
|
icon: "file_present",
|
|
113
|
-
onClick:
|
|
112
|
+
onClick: i
|
|
114
113
|
}, null, 8, ["label", "variant"])
|
|
115
114
|
])) : le("", !0),
|
|
116
115
|
l("div", null, [
|
|
117
|
-
l("div",
|
|
118
|
-
r(
|
|
116
|
+
l("div", ot, [
|
|
117
|
+
r(d, { class: "" }, {
|
|
119
118
|
"menu-button": E(() => [
|
|
120
|
-
r(
|
|
119
|
+
r(x, {
|
|
121
120
|
variant: "tertiary",
|
|
122
121
|
icon: "download",
|
|
123
122
|
label: "Download Template"
|
|
124
123
|
})
|
|
125
124
|
]),
|
|
126
125
|
default: E(() => [
|
|
127
|
-
(p(), k(O, null, ie(
|
|
128
|
-
key:
|
|
129
|
-
icon:
|
|
130
|
-
label:
|
|
131
|
-
onClick: (U) => c(
|
|
126
|
+
(p(), k(O, null, ie(n, (g) => r(I, {
|
|
127
|
+
key: g.value,
|
|
128
|
+
icon: g.icon,
|
|
129
|
+
label: g.label,
|
|
130
|
+
onClick: (U) => c(g.value),
|
|
132
131
|
selectable: ""
|
|
133
132
|
}, null, 8, ["icon", "label", "onClick"])), 64))
|
|
134
133
|
]),
|
|
135
134
|
_: 1
|
|
136
135
|
})
|
|
137
136
|
]),
|
|
138
|
-
|
|
139
|
-
r(
|
|
137
|
+
f.value ? (p(), k("div", at, [
|
|
138
|
+
r(x, {
|
|
140
139
|
variant: t(ae).Tertiary,
|
|
141
140
|
"prepend-icon": "attach_file"
|
|
142
141
|
}, null, 8, ["variant"]),
|
|
143
|
-
l("p",
|
|
142
|
+
l("p", nt, R(f.value.name), 1),
|
|
144
143
|
l("label", {
|
|
145
144
|
ref_key: "fileLabelRef",
|
|
146
|
-
ref:
|
|
145
|
+
ref: w,
|
|
147
146
|
htmlFor: "file"
|
|
148
147
|
}, [
|
|
149
|
-
r(
|
|
148
|
+
r(x, {
|
|
150
149
|
variant: t(ae).Plain,
|
|
151
150
|
label: t(m)("Replace File"),
|
|
152
|
-
onClick:
|
|
153
|
-
var
|
|
154
|
-
return (
|
|
151
|
+
onClick: y[1] || (y[1] = () => {
|
|
152
|
+
var g;
|
|
153
|
+
return (g = w.value) == null ? void 0 : g.click();
|
|
155
154
|
})
|
|
156
155
|
}, null, 8, ["variant", "label"]),
|
|
157
156
|
l("input", {
|
|
@@ -165,7 +164,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
165
164
|
], 512)
|
|
166
165
|
])) : (p(), J(s, {
|
|
167
166
|
key: 0,
|
|
168
|
-
onFileUpload:
|
|
167
|
+
onFileUpload: y[0] || (y[0] = (g) => b(g)),
|
|
169
168
|
accept: ".csv, .xlsx",
|
|
170
169
|
"max-file-size": 2e7
|
|
171
170
|
}))
|
|
@@ -173,188 +172,188 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
173
172
|
]);
|
|
174
173
|
};
|
|
175
174
|
}
|
|
176
|
-
}),
|
|
175
|
+
}), lt = { class: "space-y-16 pr-12" }, it = { class: "fm-typo-en-title-md-800" }, rt = { class: "flex space-x-8" }, ct = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, dt = { class: "text-fm-color-typo-secondary" }, ut = /* @__PURE__ */ ee({
|
|
177
176
|
__name: "ReviewSegment",
|
|
178
177
|
props: {
|
|
179
178
|
title: {},
|
|
180
179
|
segment: {}
|
|
181
180
|
},
|
|
182
181
|
setup(e) {
|
|
183
|
-
const
|
|
182
|
+
const v = e, _ = [
|
|
184
183
|
{
|
|
185
184
|
header: "Name",
|
|
186
|
-
accessorFn: (
|
|
185
|
+
accessorFn: (i) => i.name
|
|
187
186
|
},
|
|
188
187
|
{
|
|
189
188
|
header: "Id",
|
|
190
|
-
accessorFn: (
|
|
189
|
+
accessorFn: (i) => i._id
|
|
191
190
|
},
|
|
192
191
|
{
|
|
193
192
|
header: "Customer Since",
|
|
194
|
-
accessorFn: (
|
|
193
|
+
accessorFn: (i) => H(Je(i._id.toString())).format("DD MMM YYYY")
|
|
195
194
|
},
|
|
196
195
|
{
|
|
197
196
|
header: "Phone",
|
|
198
|
-
accessorFn: (
|
|
197
|
+
accessorFn: (i) => i.phoneNumber
|
|
199
198
|
},
|
|
200
199
|
{
|
|
201
200
|
header: "Birthday",
|
|
202
|
-
accessorFn: (
|
|
201
|
+
accessorFn: (i) => H(i.birthday).format("DD MMM YYYY")
|
|
203
202
|
},
|
|
204
203
|
{
|
|
205
204
|
header: "Last Visit",
|
|
206
|
-
accessorFn: (
|
|
205
|
+
accessorFn: (i) => H(i.stats.lastVisit).format("DD MMM YYYY")
|
|
207
206
|
}
|
|
208
207
|
];
|
|
209
|
-
async function
|
|
210
|
-
return
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
async function C(i) {
|
|
209
|
+
return v.segment._id ? (console.log(i), await B.paginateSegmentUsers(
|
|
210
|
+
v.segment._id,
|
|
211
|
+
i
|
|
213
212
|
)) : {
|
|
214
213
|
resources: [],
|
|
215
214
|
meta: {
|
|
216
215
|
totalResources: 0,
|
|
217
216
|
totalPages: 0,
|
|
218
|
-
skip:
|
|
219
|
-
limit:
|
|
220
|
-
sortBy:
|
|
217
|
+
skip: i.skip,
|
|
218
|
+
limit: i.limit,
|
|
219
|
+
sortBy: i.sortBy
|
|
221
220
|
}
|
|
222
221
|
};
|
|
223
222
|
}
|
|
224
|
-
const { tableMeta: m, rowData:
|
|
223
|
+
const { tableMeta: m, rowData: f, onSort: w, debouncedFetchData: F, onSearch: n } = we(C);
|
|
225
224
|
return Se(async () => {
|
|
226
225
|
await F();
|
|
227
|
-
}), (
|
|
228
|
-
l("div",
|
|
229
|
-
l("div",
|
|
230
|
-
l("div",
|
|
231
|
-
l("div",
|
|
226
|
+
}), (i, c) => (p(), k("div", lt, [
|
|
227
|
+
l("div", it, R(v.title), 1),
|
|
228
|
+
l("div", rt, [
|
|
229
|
+
l("div", ct, R(e.segment.members.length), 1),
|
|
230
|
+
l("div", dt, [
|
|
232
231
|
c[1] || (c[1] = l("div", null, "contacts in your segment", -1)),
|
|
233
|
-
l("div", null, "as of " +
|
|
232
|
+
l("div", null, "as of " + R(t(H)(e.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
234
233
|
])
|
|
235
234
|
]),
|
|
236
|
-
r(
|
|
235
|
+
r(Fe, {
|
|
237
236
|
loading: t(m).isLoading,
|
|
238
|
-
"row-data": t(
|
|
237
|
+
"row-data": t(f),
|
|
239
238
|
"row-count": t(m).totalRows,
|
|
240
|
-
"column-defs":
|
|
239
|
+
"column-defs": _,
|
|
241
240
|
"page-size": t(m).pageSize,
|
|
242
241
|
"page-count": t(m).pageCount,
|
|
243
242
|
"page-index": t(m).pageIndex,
|
|
244
|
-
onSortChange: t(
|
|
245
|
-
onPageChange: c[0] || (c[0] = (
|
|
243
|
+
onSortChange: t(w),
|
|
244
|
+
onPageChange: c[0] || (c[0] = (b) => t(F)({ pageSize: b.pageSize, pageIndex: b.pageIndex }))
|
|
246
245
|
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
|
|
247
246
|
]));
|
|
248
247
|
}
|
|
249
|
-
}),
|
|
248
|
+
}), pt = { class: "space-y-24" }, mt = { class: "grid grid-cols-2 gap-16" }, ft = { class: "fm-typo-en-title-sm-800" }, yt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, gt = /* @__PURE__ */ ee({
|
|
250
249
|
__name: "SegmentTypeOption",
|
|
251
250
|
props: {
|
|
252
251
|
modelValue: {},
|
|
253
252
|
errorText: {}
|
|
254
253
|
},
|
|
255
254
|
emits: ["update:model-value"],
|
|
256
|
-
setup(e, { emit:
|
|
257
|
-
const
|
|
255
|
+
setup(e, { emit: v }) {
|
|
256
|
+
const _ = e, C = v, m = [
|
|
258
257
|
{
|
|
259
258
|
label: "Dynamic",
|
|
260
259
|
sublabel: "Segment statistics are based on rules configured and will be recalculated automatically when rule changes.",
|
|
261
|
-
value:
|
|
260
|
+
value: $.enum.DYNAMIC
|
|
262
261
|
},
|
|
263
262
|
{
|
|
264
263
|
label: "Static",
|
|
265
264
|
sublabel: "Segment statistics are based on imported data and will not be recalculated.",
|
|
266
|
-
value:
|
|
265
|
+
value: $.enum.STATIC
|
|
267
266
|
}
|
|
268
267
|
];
|
|
269
|
-
function
|
|
270
|
-
|
|
268
|
+
function f(w) {
|
|
269
|
+
w !== _.modelValue && C("update:model-value", w);
|
|
271
270
|
}
|
|
272
|
-
return (
|
|
273
|
-
const
|
|
274
|
-
return p(), k("div",
|
|
275
|
-
l("div",
|
|
276
|
-
(p(), k(O, null, ie(m, (c) => r(
|
|
271
|
+
return (w, F) => {
|
|
272
|
+
const n = S("FmCard"), i = S("FmHelperText");
|
|
273
|
+
return p(), k("div", pt, [
|
|
274
|
+
l("div", mt, [
|
|
275
|
+
(p(), k(O, null, ie(m, (c) => r(n, {
|
|
277
276
|
variant: "outlined",
|
|
278
277
|
class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
279
278
|
"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)]":
|
|
281
|
-
"hover:bg-fm-color-opacity-sm":
|
|
279
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue === c.value,
|
|
280
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue !== c.value
|
|
282
281
|
}]),
|
|
283
|
-
onClick: (
|
|
282
|
+
onClick: (b) => f(c.value),
|
|
284
283
|
key: c.value
|
|
285
284
|
}, {
|
|
286
285
|
default: E(() => [
|
|
287
|
-
l("div",
|
|
288
|
-
l("div",
|
|
286
|
+
l("div", ft, R(c.label), 1),
|
|
287
|
+
l("div", yt, R(c.sublabel), 1)
|
|
289
288
|
]),
|
|
290
289
|
_: 2
|
|
291
290
|
}, 1032, ["class", "onClick"])), 64))
|
|
292
291
|
]),
|
|
293
|
-
|
|
292
|
+
e.errorText ? (p(), J(i, {
|
|
294
293
|
key: 0,
|
|
295
294
|
class: "!mt-4",
|
|
296
|
-
text:
|
|
295
|
+
text: e.errorText,
|
|
297
296
|
state: "error"
|
|
298
297
|
}, null, 8, ["text"])) : le("", !0)
|
|
299
298
|
]);
|
|
300
299
|
};
|
|
301
300
|
}
|
|
302
|
-
}),
|
|
301
|
+
}), vt = { class: "flex items-center gap-x-8" }, _t = {
|
|
303
302
|
key: 0,
|
|
304
303
|
class: "space-y-16 pr-12"
|
|
305
|
-
},
|
|
304
|
+
}, xt = { class: "flex flex-col space-y-16" }, St = {
|
|
306
305
|
key: 0,
|
|
307
306
|
class: "flex flex-col space-y-16"
|
|
308
|
-
},
|
|
307
|
+
}, wt = {
|
|
309
308
|
key: 1,
|
|
310
309
|
class: "flex flex-col space-y-16"
|
|
311
|
-
},
|
|
310
|
+
}, Ft = {
|
|
312
311
|
key: 2,
|
|
313
312
|
class: "flex flex-col space-y-16"
|
|
314
|
-
}, bt = { class: "flex items-center gap-8" },
|
|
313
|
+
}, bt = { class: "flex items-center gap-8" }, ht = /* @__PURE__ */ ee({
|
|
315
314
|
__name: "SegmentSheet",
|
|
316
315
|
emits: ["update:model-value"],
|
|
317
|
-
setup(e, { expose:
|
|
318
|
-
const
|
|
316
|
+
setup(e, { expose: v, emit: _ }) {
|
|
317
|
+
const C = Ue(), m = z(!1), f = z(!1), w = {
|
|
319
318
|
name: "",
|
|
320
319
|
isActive: !0,
|
|
321
|
-
type:
|
|
320
|
+
type: $.enum.DYNAMIC,
|
|
322
321
|
rule: ge.scaffoldGroup(),
|
|
323
322
|
members: []
|
|
324
|
-
}, F =
|
|
325
|
-
const
|
|
326
|
-
return
|
|
323
|
+
}, F = Ke, n = z(w), i = ce(() => {
|
|
324
|
+
const d = F.safeParse(n.value);
|
|
325
|
+
return d.success ? [] : d.error.errors;
|
|
327
326
|
});
|
|
328
|
-
function c(
|
|
329
|
-
m.value = !0,
|
|
330
|
-
...
|
|
331
|
-
isActive:
|
|
332
|
-
type:
|
|
333
|
-
} :
|
|
327
|
+
function c(d) {
|
|
328
|
+
m.value = !0, f.value = !1, d ? n.value = {
|
|
329
|
+
...d,
|
|
330
|
+
isActive: d.isActive !== !1,
|
|
331
|
+
type: d.type ?? (d.importFile ? $.enum.STATIC : $.enum.DYNAMIC)
|
|
332
|
+
} : n.value = { ...w };
|
|
334
333
|
}
|
|
335
|
-
function
|
|
334
|
+
function b() {
|
|
336
335
|
m.value = !1;
|
|
337
336
|
}
|
|
338
337
|
async function A() {
|
|
339
|
-
F.safeParse(
|
|
338
|
+
F.safeParse(n.value).success && (f.value = !0);
|
|
340
339
|
}
|
|
341
|
-
function
|
|
342
|
-
|
|
340
|
+
function h(d) {
|
|
341
|
+
d === $.enum.STATIC ? b() : f.value = !1;
|
|
343
342
|
}
|
|
344
|
-
async function
|
|
345
|
-
|
|
343
|
+
async function y() {
|
|
344
|
+
n.value.type === $.enum.STATIC ? (n.value.rule = ge.scaffoldGroup(), n.value.isActive = !0) : n.value.file = void 0, I("update:model-value", n.value);
|
|
346
345
|
}
|
|
347
|
-
async function
|
|
348
|
-
|
|
346
|
+
async function x(d) {
|
|
347
|
+
n.value.type = d;
|
|
349
348
|
}
|
|
350
349
|
Se(async () => {
|
|
351
350
|
});
|
|
352
|
-
const I =
|
|
353
|
-
return
|
|
351
|
+
const I = _;
|
|
352
|
+
return v({
|
|
354
353
|
showSheet: c,
|
|
355
|
-
hideSheet:
|
|
356
|
-
}), (
|
|
357
|
-
const
|
|
354
|
+
hideSheet: b
|
|
355
|
+
}), (d, s) => {
|
|
356
|
+
const g = S("FmButton"), U = S("FmSwitch"), a = S("FmSideSheet");
|
|
358
357
|
return p(), J(a, {
|
|
359
358
|
modelValue: t(m),
|
|
360
359
|
"onUpdate:modelValue": s[8] || (s[8] = (o) => Ie(m) ? m.value = o : null),
|
|
@@ -365,27 +364,27 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
365
364
|
}, Me({
|
|
366
365
|
"side-sheet-footer": E(() => [
|
|
367
366
|
l("div", bt, [
|
|
368
|
-
t(
|
|
369
|
-
r(
|
|
367
|
+
t(f) || t(n).type === t($).enum.STATIC ? (p(), k(O, { key: 0 }, [
|
|
368
|
+
r(g, {
|
|
370
369
|
label: "Save Segment",
|
|
371
|
-
onClick:
|
|
372
|
-
loading: t(
|
|
373
|
-
disabled: t(
|
|
370
|
+
onClick: y,
|
|
371
|
+
loading: t(C).isLoading,
|
|
372
|
+
disabled: t(i).length > 0 || t(C).isLoading
|
|
374
373
|
}, null, 8, ["loading", "disabled"]),
|
|
375
|
-
r(
|
|
374
|
+
r(g, {
|
|
376
375
|
label: "Cancel",
|
|
377
|
-
onClick: s[6] || (s[6] = (o) =>
|
|
376
|
+
onClick: s[6] || (s[6] = (o) => h(t(n).type)),
|
|
378
377
|
variant: "tertiary"
|
|
379
378
|
})
|
|
380
379
|
], 64)) : (p(), k(O, { key: 1 }, [
|
|
381
|
-
r(
|
|
380
|
+
r(g, {
|
|
382
381
|
label: "Review Segment",
|
|
383
|
-
disabled: t(
|
|
382
|
+
disabled: t(i).length > 0 || t(C).isLoading,
|
|
384
383
|
onClick: A
|
|
385
384
|
}, null, 8, ["disabled"]),
|
|
386
|
-
r(
|
|
385
|
+
r(g, {
|
|
387
386
|
label: "Cancel",
|
|
388
|
-
onClick: s[7] || (s[7] = (o) =>
|
|
387
|
+
onClick: s[7] || (s[7] = (o) => b()),
|
|
389
388
|
variant: "tertiary"
|
|
390
389
|
})
|
|
391
390
|
], 64))
|
|
@@ -394,49 +393,49 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
394
393
|
default: E(() => {
|
|
395
394
|
var o;
|
|
396
395
|
return [
|
|
397
|
-
t(
|
|
396
|
+
t(f) ? (p(), J(ut, {
|
|
398
397
|
key: 1,
|
|
399
|
-
title: t(
|
|
400
|
-
segment: t(
|
|
401
|
-
}, null, 8, ["title", "segment"])) : (p(), k("div",
|
|
402
|
-
r(
|
|
403
|
-
modelValue: t(
|
|
404
|
-
"onUpdate:modelValue": s[1] || (s[1] = (
|
|
398
|
+
title: t(n).name,
|
|
399
|
+
segment: t(n)
|
|
400
|
+
}, null, 8, ["title", "segment"])) : (p(), k("div", _t, [
|
|
401
|
+
r(Le, {
|
|
402
|
+
modelValue: t(n).name,
|
|
403
|
+
"onUpdate:modelValue": s[1] || (s[1] = (u) => t(n).name = u),
|
|
405
404
|
label: "Segment title",
|
|
406
|
-
schema: t(
|
|
405
|
+
schema: t(Ye).typeAtPath(t(F), "name")
|
|
407
406
|
}, null, 8, ["modelValue", "schema"]),
|
|
408
|
-
l("div",
|
|
407
|
+
l("div", xt, [
|
|
409
408
|
s[10] || (s[10] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1)),
|
|
410
|
-
r(
|
|
411
|
-
"model-value": t(
|
|
412
|
-
"onUpdate:modelValue": s[2] || (s[2] = (
|
|
413
|
-
|
|
409
|
+
r(gt, {
|
|
410
|
+
"model-value": t(n).type,
|
|
411
|
+
"onUpdate:modelValue": s[2] || (s[2] = (u) => {
|
|
412
|
+
x(u);
|
|
414
413
|
})
|
|
415
414
|
}, null, 8, ["model-value"])
|
|
416
415
|
]),
|
|
417
|
-
t(
|
|
416
|
+
t(n).type === t($).enum.DYNAMIC ? (p(), k("div", St, [
|
|
418
417
|
s[11] || (s[11] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
|
|
419
|
-
r(
|
|
418
|
+
r(ze, {
|
|
420
419
|
"trigger-type": "MEMBERSHIP_JOINED",
|
|
421
420
|
includeOnly: "user",
|
|
422
|
-
"model-value": (o = t(
|
|
423
|
-
"onUpdate:modelValue": s[3] || (s[3] = (
|
|
424
|
-
t(
|
|
421
|
+
"model-value": (o = t(n)) == null ? void 0 : o.rule,
|
|
422
|
+
"onUpdate:modelValue": s[3] || (s[3] = (u) => {
|
|
423
|
+
t(n).rule = u;
|
|
425
424
|
})
|
|
426
425
|
}, null, 8, ["model-value"])
|
|
427
|
-
])) : (p(), k("div",
|
|
428
|
-
r(
|
|
429
|
-
importFile: t(
|
|
430
|
-
"onUpdate:file": s[4] || (s[4] = (
|
|
431
|
-
t(
|
|
426
|
+
])) : (p(), k("div", wt, [
|
|
427
|
+
r(st, {
|
|
428
|
+
importFile: t(n).importFile,
|
|
429
|
+
"onUpdate:file": s[4] || (s[4] = (u) => {
|
|
430
|
+
t(n).file = u;
|
|
432
431
|
})
|
|
433
432
|
}, null, 8, ["importFile"])
|
|
434
433
|
])),
|
|
435
|
-
t(
|
|
434
|
+
t(n).type === t($).enum.DYNAMIC ? (p(), k("div", Ft, [
|
|
436
435
|
s[12] || (s[12] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1)),
|
|
437
436
|
r(U, {
|
|
438
|
-
"model-value": t(
|
|
439
|
-
"onUpdate:modelValue": s[5] || (s[5] = (
|
|
437
|
+
"model-value": t(n).isActive ?? !0,
|
|
438
|
+
"onUpdate:modelValue": s[5] || (s[5] = (u) => t(n).isActive = u),
|
|
440
439
|
label: "Active",
|
|
441
440
|
sublabel: "When enabled, this will recalculate the segment statistics daily.",
|
|
442
441
|
"label-placement": "right"
|
|
@@ -447,14 +446,14 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
447
446
|
}),
|
|
448
447
|
_: 2
|
|
449
448
|
}, [
|
|
450
|
-
t(
|
|
449
|
+
t(f) ? {
|
|
451
450
|
name: "side-sheet-header",
|
|
452
451
|
fn: E(() => [
|
|
453
|
-
l("div",
|
|
454
|
-
r(
|
|
452
|
+
l("div", vt, [
|
|
453
|
+
r(g, {
|
|
455
454
|
icon: "arrow_back",
|
|
456
455
|
variant: "tertiary",
|
|
457
|
-
onClick: s[0] || (s[0] = (o) =>
|
|
456
|
+
onClick: s[0] || (s[0] = (o) => f.value = !1)
|
|
458
457
|
}),
|
|
459
458
|
s[9] || (s[9] = l("div", null, "Review segment", -1))
|
|
460
459
|
])
|
|
@@ -464,20 +463,20 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
464
463
|
]), 1032, ["modelValue"]);
|
|
465
464
|
};
|
|
466
465
|
}
|
|
467
|
-
}), xe =
|
|
466
|
+
}), xe = He(), Ct = Ce();
|
|
468
467
|
function se(e) {
|
|
469
|
-
const
|
|
470
|
-
return
|
|
468
|
+
const v = H(e);
|
|
469
|
+
return v.isValid() ? v.format("DD/MM/YYYY") : "";
|
|
471
470
|
}
|
|
472
|
-
const
|
|
471
|
+
const kt = {
|
|
473
472
|
mapMemberExportRow: (e) => {
|
|
474
|
-
var
|
|
475
|
-
const
|
|
473
|
+
var i, c, b, A, h, y, x, I, d, s, g, U, a, o, u, P, D, N, V, j, q, G, te, M, Q, de, ue, pe;
|
|
474
|
+
const v = ce(() => Ct.locations.map((T) => ({
|
|
476
475
|
label: T.name,
|
|
477
476
|
value: T._id
|
|
478
|
-
}))),
|
|
477
|
+
}))), _ = (i = Ne.parseOneAddress(
|
|
479
478
|
e == null ? void 0 : e.email
|
|
480
|
-
)) != null &&
|
|
479
|
+
)) != null && i.domain.includes("feedmepos.com") ? void 0 : e.email, C = (b = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : b.reduce(
|
|
481
480
|
(T, L) => {
|
|
482
481
|
var Z, K;
|
|
483
482
|
const W = (K = (Z = xe.sortedTitles) == null ? void 0 : Z.find(
|
|
@@ -495,29 +494,29 @@ const Ct = {
|
|
|
495
494
|
return T[L.name] = W ? H(W).format("DD/MM/YYYY") : "", T;
|
|
496
495
|
},
|
|
497
496
|
{}
|
|
498
|
-
),
|
|
497
|
+
), f = ((y = (h = (A = e.collection) == null ? void 0 : A.CREDIT) == null ? void 0 : h.at(0)) == null ? void 0 : y.balance) || 0, w = ((s = (d = (I = (x = e.collection) == null ? void 0 : x.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : d.expiryBalance) == null ? void 0 : s.reduce(
|
|
499
498
|
(T, L) => T + L.amount,
|
|
500
499
|
0
|
|
501
|
-
)) || 0, F =
|
|
500
|
+
)) || 0, F = Qe(f, 2);
|
|
502
501
|
return {
|
|
503
502
|
ID: e._id.toString(),
|
|
504
|
-
Name: ((
|
|
503
|
+
Name: ((g = e.name) == null ? void 0 : g.trim()) || "",
|
|
505
504
|
Phone: ((U = e == null ? void 0 : e.phoneNumber) == null ? void 0 : U.trim()) || "",
|
|
506
|
-
Email:
|
|
505
|
+
Email: _ || "",
|
|
507
506
|
Gender: e.gender || "",
|
|
508
507
|
CardNo: e.cardNo || "",
|
|
509
508
|
Birthday: e != null && e.birthday ? se(e == null ? void 0 : e.birthday) : "",
|
|
510
|
-
Credit: parseFloat((Number(F) - Number(
|
|
511
|
-
FreeCredit: Number(
|
|
509
|
+
Credit: parseFloat((Number(F) - Number(w)).toFixed(2)),
|
|
510
|
+
FreeCredit: Number(w.toFixed(2)),
|
|
512
511
|
TotalCredit: Number(F),
|
|
513
|
-
Exp: e != null && e.collection ? ((
|
|
512
|
+
Exp: e != null && e.collection ? ((u = (o = (a = e.collection) == null ? void 0 : a.POINT) == null ? void 0 : o.at(0)) == null ? void 0 : u.balance) ?? 0 : 0,
|
|
514
513
|
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
514
|
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
515
|
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:
|
|
516
|
+
Titles: C.join(","),
|
|
518
517
|
...m,
|
|
519
518
|
TotalTransaction: e.stats.visitCount,
|
|
520
|
-
AvgSpent:
|
|
519
|
+
AvgSpent: We(Number(e.stats.avgBillSize || 0)).toFormat(
|
|
521
520
|
!1
|
|
522
521
|
),
|
|
523
522
|
TotalSpent: e.stats.avgBillSize * e.stats.visitCount,
|
|
@@ -526,22 +525,22 @@ const Ct = {
|
|
|
526
525
|
LastSeasonTierEarned: ((de = e.stats) == null ? void 0 : de.lastSeasonTierEarned) || 0,
|
|
527
526
|
LastSeasonPointEarned: ((ue = e.stats) == null ? void 0 : ue.lastSeasonPointEarned) || 0,
|
|
528
527
|
JoinedAt: se(e.joinAt || void 0),
|
|
529
|
-
JoinedAtLocation: e.location && ((pe =
|
|
528
|
+
JoinedAtLocation: e.location && ((pe = v.value.find((T) => T.value == e.location)) == null ? void 0 : pe.label) || "-",
|
|
530
529
|
VisitFrequency: `${Number(
|
|
531
530
|
Math.ceil(e.stats.avgVisitFrequency).toFixed(0)
|
|
532
531
|
)}`
|
|
533
532
|
};
|
|
534
533
|
}
|
|
535
|
-
},
|
|
534
|
+
}, It = { class: "flex items-center" }, Mt = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Tt = { class: "px-24 flex flex-col gap-y-16" }, Et = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, At = { class: "fm-typo-en-body-md-600" }, Dt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, uo = /* @__PURE__ */ ee({
|
|
536
535
|
__name: "Segment",
|
|
537
536
|
setup(e) {
|
|
538
|
-
const { minor:
|
|
537
|
+
const { minor: v } = $e, { t: _ } = be(), C = Ce(), { mapMemberExportRow: m } = kt, f = Re(), w = Ze(), F = z(0), n = [
|
|
539
538
|
{
|
|
540
|
-
header:
|
|
539
|
+
header: _("connect.loyalty.segment.table.name"),
|
|
541
540
|
accessorFn: (a) => a.name
|
|
542
541
|
},
|
|
543
542
|
{
|
|
544
|
-
header:
|
|
543
|
+
header: _("connect.loyalty.segment.table.status"),
|
|
545
544
|
enableSorting: !1,
|
|
546
545
|
cell(a) {
|
|
547
546
|
const o = a.row.original.isActive === !1 ? "Inactive" : "Active";
|
|
@@ -553,15 +552,15 @@ const Ct = {
|
|
|
553
552
|
}
|
|
554
553
|
},
|
|
555
554
|
{
|
|
556
|
-
header:
|
|
555
|
+
header: _("connect.loyalty.segment.table.total_customers"),
|
|
557
556
|
accessorFn: (a) => a.memberCount ?? 0
|
|
558
557
|
},
|
|
559
558
|
{
|
|
560
|
-
header:
|
|
559
|
+
header: _("connect.loyalty.segment.table.customer_percentage"),
|
|
561
560
|
accessorFn: (a) => ((a.memberCount ?? 0) * 100 / F.value).toFixed(2)
|
|
562
561
|
},
|
|
563
562
|
{
|
|
564
|
-
header:
|
|
563
|
+
header: _("connect.loyalty.segment.table.actions"),
|
|
565
564
|
meta: {
|
|
566
565
|
maxWidth: "100px"
|
|
567
566
|
},
|
|
@@ -586,7 +585,7 @@ const Ct = {
|
|
|
586
585
|
X.FmMenuItem,
|
|
587
586
|
{
|
|
588
587
|
onClick: async (o) => {
|
|
589
|
-
o.stopPropagation(),
|
|
588
|
+
o.stopPropagation(), x(a.row.original);
|
|
590
589
|
}
|
|
591
590
|
},
|
|
592
591
|
{
|
|
@@ -603,7 +602,7 @@ const Ct = {
|
|
|
603
602
|
X.FmMenuItem,
|
|
604
603
|
{
|
|
605
604
|
onClick: async (o) => {
|
|
606
|
-
o.stopPropagation(),
|
|
605
|
+
o.stopPropagation(), y(a.row.original);
|
|
607
606
|
}
|
|
608
607
|
},
|
|
609
608
|
{
|
|
@@ -622,19 +621,19 @@ const Ct = {
|
|
|
622
621
|
]);
|
|
623
622
|
}
|
|
624
623
|
}
|
|
625
|
-
],
|
|
624
|
+
], i = z(null), { tableMeta: c, rowData: b, debouncedFetchData: A } = we(
|
|
626
625
|
B.readAll
|
|
627
626
|
);
|
|
628
|
-
async function
|
|
629
|
-
await
|
|
627
|
+
async function h() {
|
|
628
|
+
await v(
|
|
630
629
|
async () => {
|
|
631
630
|
await B.refreshSegments(), await A({ pageSize: 10, pageIndex: 0 });
|
|
632
631
|
},
|
|
633
632
|
{ message: "Refreshing segmentations" }
|
|
634
633
|
);
|
|
635
634
|
}
|
|
636
|
-
async function
|
|
637
|
-
await
|
|
635
|
+
async function y(a) {
|
|
636
|
+
await De.remove(`Are you sure you want to remove ${a.name}?`) && await v(
|
|
638
637
|
async () => {
|
|
639
638
|
await B.delete(a._id), await A({ pageSize: 10, pageIndex: 0 });
|
|
640
639
|
},
|
|
@@ -644,20 +643,20 @@ const Ct = {
|
|
|
644
643
|
}
|
|
645
644
|
);
|
|
646
645
|
}
|
|
647
|
-
async function
|
|
646
|
+
async function x(a) {
|
|
648
647
|
const o = {
|
|
649
648
|
sortBy: "_id",
|
|
650
649
|
descending: !1,
|
|
651
650
|
rowsPerPage: 1e3,
|
|
652
651
|
page: 1,
|
|
653
652
|
rowsNumber: 0
|
|
654
|
-
},
|
|
653
|
+
}, u = new Ve(), P = (await ve.read({
|
|
655
654
|
limit: 1,
|
|
656
655
|
skip: 0,
|
|
657
656
|
sortBy: o.sortBy,
|
|
658
657
|
descending: o.descending
|
|
659
658
|
})).meta.totalResources ?? 0, D = o.rowsPerPage;
|
|
660
|
-
await
|
|
659
|
+
await v(
|
|
661
660
|
async () => {
|
|
662
661
|
for (let N = 0; N < P; N += D) {
|
|
663
662
|
const V = {
|
|
@@ -672,12 +671,12 @@ const Ct = {
|
|
|
672
671
|
);
|
|
673
672
|
for (const q of j.resources) {
|
|
674
673
|
const G = m(q);
|
|
675
|
-
|
|
674
|
+
u.addRecord(G);
|
|
676
675
|
}
|
|
677
676
|
o.page++;
|
|
678
677
|
}
|
|
679
678
|
await he(
|
|
680
|
-
|
|
679
|
+
u.buildExcel(),
|
|
681
680
|
`[${a.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
682
681
|
{
|
|
683
682
|
bookType: "xlsx",
|
|
@@ -693,35 +692,35 @@ const Ct = {
|
|
|
693
692
|
);
|
|
694
693
|
}
|
|
695
694
|
async function I(a) {
|
|
696
|
-
await
|
|
695
|
+
await v(
|
|
697
696
|
async () => {
|
|
698
697
|
var o;
|
|
699
|
-
if (a.type ===
|
|
700
|
-
const
|
|
701
|
-
if (
|
|
698
|
+
if (a.type === $.enum.STATIC) {
|
|
699
|
+
const u = new FormData();
|
|
700
|
+
if (u.append("file", a.file), a._id) {
|
|
702
701
|
const { members: P, _id: D, file: N, ...V } = a;
|
|
703
|
-
|
|
702
|
+
u.append("segment", JSON.stringify(V)), await B.updateStatic(a._id, u);
|
|
704
703
|
} else {
|
|
705
704
|
const { file: P, ...D } = a;
|
|
706
|
-
|
|
705
|
+
u.append("segment", JSON.stringify(D)), await B.createStatic(u);
|
|
707
706
|
}
|
|
708
|
-
a.file &&
|
|
707
|
+
a.file && f.open({
|
|
709
708
|
type: "info",
|
|
710
709
|
title: "Import begins soon. Check Queue for updates.",
|
|
711
710
|
action: "View",
|
|
712
711
|
onAction: async () => {
|
|
713
|
-
await
|
|
712
|
+
await w.push({
|
|
714
713
|
name: _e["$connect-QUEUE"],
|
|
715
714
|
query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
|
|
716
715
|
});
|
|
717
716
|
}
|
|
718
717
|
});
|
|
719
718
|
} else if (a._id) {
|
|
720
|
-
const { members:
|
|
719
|
+
const { members: u, _id: P, ...D } = a;
|
|
721
720
|
await B.update(a._id, D);
|
|
722
721
|
} else
|
|
723
722
|
await B.create(a);
|
|
724
|
-
await A({ pageSize: 10, pageIndex: 0 }), (o =
|
|
723
|
+
await A({ pageSize: 10, pageIndex: 0 }), (o = i.value) == null || o.hideSheet();
|
|
725
724
|
},
|
|
726
725
|
{
|
|
727
726
|
message: "Saving segment",
|
|
@@ -729,16 +728,16 @@ const Ct = {
|
|
|
729
728
|
}
|
|
730
729
|
);
|
|
731
730
|
}
|
|
732
|
-
function
|
|
731
|
+
function d(a) {
|
|
733
732
|
var o;
|
|
734
|
-
(o =
|
|
733
|
+
(o = i.value) == null || o.showSheet(a);
|
|
735
734
|
}
|
|
736
735
|
const s = {
|
|
737
|
-
label:
|
|
736
|
+
label: _("connect.navigation.queue"),
|
|
738
737
|
value: "queue",
|
|
739
738
|
isPrimary: !1,
|
|
740
739
|
prependIcon: "work_history"
|
|
741
|
-
},
|
|
740
|
+
}, g = ce(() => C.isPremium ? [
|
|
742
741
|
s,
|
|
743
742
|
{
|
|
744
743
|
label: "Refresh segments",
|
|
@@ -755,13 +754,13 @@ const Ct = {
|
|
|
755
754
|
function U(a) {
|
|
756
755
|
switch (a) {
|
|
757
756
|
case "add":
|
|
758
|
-
|
|
757
|
+
d();
|
|
759
758
|
break;
|
|
760
759
|
case "refresh":
|
|
761
|
-
|
|
760
|
+
h();
|
|
762
761
|
break;
|
|
763
762
|
case "queue":
|
|
764
|
-
|
|
763
|
+
w.push({
|
|
765
764
|
name: _e["$connect-QUEUE"],
|
|
766
765
|
query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
|
|
767
766
|
});
|
|
@@ -776,51 +775,51 @@ const Ct = {
|
|
|
776
775
|
search: void 0,
|
|
777
776
|
descending: !1
|
|
778
777
|
});
|
|
779
|
-
F.value = a.totalResources ?? 0, await A({ pageSize: 10, pageIndex: 0 }), await
|
|
778
|
+
F.value = a.totalResources ?? 0, await A({ pageSize: 10, pageIndex: 0 }), await C.readPremium(), await C.readLocations();
|
|
780
779
|
}), (a, o) => {
|
|
781
|
-
const
|
|
780
|
+
const u = S("FmPill"), P = S("FmPageHead"), D = S("FmIcon"), N = S("FmMenuItem"), V = S("FmMenu"), j = S("FmListItem"), q = S("FmList"), G = S("FmButton"), te = S("FmCard");
|
|
782
781
|
return p(), k(O, null, [
|
|
783
782
|
r(P, {
|
|
784
783
|
title: "Segments",
|
|
785
|
-
actions: t(
|
|
784
|
+
actions: t(g),
|
|
786
785
|
"onClick:action": o[0] || (o[0] = (M) => U(M))
|
|
787
786
|
}, {
|
|
788
787
|
title: E(() => [
|
|
789
|
-
l("div",
|
|
790
|
-
l("span",
|
|
791
|
-
r(
|
|
788
|
+
l("div", It, [
|
|
789
|
+
l("span", Mt, R(t(_)("connect.loyalty.segment.title")), 1),
|
|
790
|
+
r(u, { variant: "premium" })
|
|
792
791
|
])
|
|
793
792
|
]),
|
|
794
793
|
_: 1
|
|
795
794
|
}, 8, ["actions"]),
|
|
796
|
-
l("div",
|
|
797
|
-
t(
|
|
798
|
-
r(
|
|
795
|
+
l("div", Tt, [
|
|
796
|
+
t(b).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), k(O, { key: 0 }, [
|
|
797
|
+
r(Fe, {
|
|
799
798
|
loading: t(c).isLoading,
|
|
800
|
-
"row-data": t(
|
|
799
|
+
"row-data": t(b),
|
|
801
800
|
"row-count": t(c).totalRows,
|
|
802
|
-
"column-defs":
|
|
801
|
+
"column-defs": n,
|
|
803
802
|
"shrink-at": !1,
|
|
804
803
|
"page-count": t(c).pageCount,
|
|
805
804
|
"page-index": t(c).pageIndex,
|
|
806
805
|
"page-size": t(c).pageSize,
|
|
807
806
|
onRowClick: o[1] || (o[1] = (M) => {
|
|
808
|
-
|
|
807
|
+
d(M.original);
|
|
809
808
|
}),
|
|
810
809
|
onPageChange: t(A)
|
|
811
810
|
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
|
|
812
|
-
r(q, { class: "w-full hidden xs
|
|
811
|
+
r(q, { class: "w-full hidden xs:!block" }, {
|
|
813
812
|
default: E(() => [
|
|
814
|
-
(p(!0), k(O, null, ie(t(
|
|
813
|
+
(p(!0), k(O, null, ie(t(b), (M) => (p(), J(j, {
|
|
815
814
|
key: M._id.toString(),
|
|
816
815
|
tag: "label",
|
|
817
|
-
onClick: (Q) =>
|
|
816
|
+
onClick: (Q) => d(M)
|
|
818
817
|
}, {
|
|
819
818
|
default: E(() => [
|
|
820
819
|
l("div", null, [
|
|
821
|
-
l("div",
|
|
822
|
-
l("div",
|
|
823
|
-
l("div",
|
|
820
|
+
l("div", Et, R((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
821
|
+
l("div", At, R(M.name), 1),
|
|
822
|
+
l("div", Dt, R(((M.memberCount ?? 0) * 100 / t(F)).toFixed(2)) + "% of customers ", 1)
|
|
824
823
|
])
|
|
825
824
|
]),
|
|
826
825
|
append: E(() => [
|
|
@@ -832,7 +831,7 @@ const Ct = {
|
|
|
832
831
|
r(N, {
|
|
833
832
|
class: "text-fm-color-typo-error fm-typo-en-body-md-400",
|
|
834
833
|
label: "Remove",
|
|
835
|
-
"onUpdate:modelValue": (Q) => Q &&
|
|
834
|
+
"onUpdate:modelValue": (Q) => Q && y(M)
|
|
836
835
|
}, null, 8, ["onUpdate:modelValue"])
|
|
837
836
|
]),
|
|
838
837
|
_: 2
|
|
@@ -860,16 +859,16 @@ const Ct = {
|
|
|
860
859
|
r(G, {
|
|
861
860
|
variant: "primary",
|
|
862
861
|
label: "Create segment",
|
|
863
|
-
disabled: !t(
|
|
862
|
+
disabled: !t(C).isPremium,
|
|
864
863
|
icon: "add",
|
|
865
|
-
onClick: o[2] || (o[2] = (M) =>
|
|
864
|
+
onClick: o[2] || (o[2] = (M) => d())
|
|
866
865
|
}, null, 8, ["disabled"])
|
|
867
866
|
]),
|
|
868
867
|
_: 1
|
|
869
868
|
})),
|
|
870
|
-
r(
|
|
869
|
+
r(ht, {
|
|
871
870
|
ref_key: "sheetRef",
|
|
872
|
-
ref:
|
|
871
|
+
ref: i,
|
|
873
872
|
"onUpdate:modelValue": I
|
|
874
873
|
}, null, 512)
|
|
875
874
|
])
|